@kjanat/dreamcli 4.2.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/completion-B4oRc2Ae.mjs +59 -0
- package/dist/completion.d.mts +11 -11
- package/dist/completion.mjs +1 -1
- package/dist/config-DSh3QJpX.mjs +1 -0
- package/dist/config.d.mts +11 -1
- package/dist/config.mjs +1 -1
- package/dist/core-BZx351-p.mjs +21 -0
- package/dist/dynamic-BK2lQF2M.mjs +1 -0
- package/dist/{index-C5CYWtxn.d.mts → index-CLtWJqwn.d.mts} +50 -10
- package/dist/{index-B6oD4_8b.d.mts → index-CuhI1Ynv.d.mts} +638 -47
- package/dist/{index-B3_9MlHz.d.mts → index-D683D09G.d.mts} +0 -2
- package/dist/{index-B_1Dmsdq.d.mts → index-DDhRLoTu.d.mts} +157 -21
- package/dist/{index-Cj7kXwQH.d.mts → index-DIWRV_wp.d.mts} +1 -7
- package/dist/{index-eF7SkQzQ.d.mts → index-Vjl2_m23.d.mts} +66 -15
- package/dist/{index-CaRNJH2R.d.mts → index-aTmg9yfl.d.mts} +14 -12
- package/dist/index.d.mts +41 -12
- package/dist/index.mjs +1 -1
- package/dist/json-schema-CYgq_hFu.mjs +59 -0
- package/dist/json-schema.d.mts +10 -2
- package/dist/json-schema.mjs +1 -1
- package/dist/{package-json-fYhxDdWD.mjs → package-json-hqUWeazy.mjs} +1 -1
- package/dist/prompt.d.mts +13 -8
- package/dist/prompt.mjs +1 -1
- package/dist/rolldown-runtime-DOYBPklu.mjs +1 -0
- package/dist/runtime.d.mts +20 -2
- package/dist/runtime.mjs +1 -1
- package/dist/session-BEKj0yLA.mjs +1 -0
- package/dist/{terminal-cbye9mKF.mjs → terminal-Dws_b5UK.mjs} +1 -1
- package/dist/test-prompter-euLYzWWO.mjs +1 -0
- package/dist/testkit.d.mts +18 -7
- package/dist/testkit.mjs +1 -1
- package/dist/version.d.mts +1 -3
- package/dist/version.mjs +1 -1
- package/dreamcli.schema.json +151 -2
- package/package.json +11 -11
- package/skills/cli-creation/SKILL.md +1 -1
- package/dist/adapter-DsmEc0WO.d.mts +0 -285
- package/dist/completion-BYhuYn2Q.mjs +0 -6
- package/dist/config-BgJZ-X4r.mjs +0 -1
- package/dist/core-B4Twhd48.mjs +0 -18
- package/dist/json-schema-DVyfq4bA.mjs +0 -52
- package/dist/rolldown-runtime-G4Kt5YOX.mjs +0 -1
- package/dist/session-CQsnVijE.mjs +0 -1
- package/dist/test-prompter-Ddkt9n5A.mjs +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Colors, Formatter } from "ansispeck";
|
|
2
|
-
//#region src/core/schema/brand.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Type-only seal for framework-normalized schema values.
|
|
5
4
|
*
|
|
@@ -12,8 +11,6 @@ import { Colors, Formatter } from "ansispeck";
|
|
|
12
11
|
* @module dreamcli/core/schema/brand
|
|
13
12
|
*/
|
|
14
13
|
declare const schemaBrand: unique symbol;
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/core/schema/activity.d.ts
|
|
17
14
|
/**
|
|
18
15
|
* Activity types — spinner and progress bar handles, options, events.
|
|
19
16
|
*
|
|
@@ -33,6 +30,8 @@ declare const schemaBrand: unique symbol;
|
|
|
33
30
|
type Fallback = 'silent' | 'static';
|
|
34
31
|
/** Options for {@link Out.spinner}. */
|
|
35
32
|
interface SpinnerOptions {
|
|
33
|
+
/** Render alongside other concurrent activities instead of replacing them. */
|
|
34
|
+
readonly concurrent?: boolean;
|
|
36
35
|
/**
|
|
37
36
|
* Fallback strategy when `!isTTY` or `jsonMode`.
|
|
38
37
|
* @defaultValue `'silent'`
|
|
@@ -60,12 +59,14 @@ interface SpinnerHandle {
|
|
|
60
59
|
* @returns The resolved value of the wrapped promise.
|
|
61
60
|
*/
|
|
62
61
|
wrap<T>(promise: Promise<T>, options?: {
|
|
63
|
-
readonly succeed?: string;
|
|
64
|
-
readonly fail?: string;
|
|
62
|
+
readonly succeed?: string | ((value: T) => string);
|
|
63
|
+
readonly fail?: string | ((error: unknown) => string);
|
|
65
64
|
}): Promise<T>;
|
|
66
65
|
}
|
|
67
66
|
/** Options for {@link Out.progress}. */
|
|
68
67
|
interface ProgressOptions {
|
|
68
|
+
/** Render alongside other concurrent activities instead of replacing them. */
|
|
69
|
+
readonly concurrent?: boolean;
|
|
69
70
|
/**
|
|
70
71
|
* Total units of work. When provided, the bar shows a determinate
|
|
71
72
|
* percentage. When omitted, the bar pulses in indeterminate mode.
|
|
@@ -200,8 +201,6 @@ interface TableOptionsText {
|
|
|
200
201
|
}
|
|
201
202
|
/** Per-call rendering options for {@link Out.table}. */
|
|
202
203
|
type TableOptions = TableOptionsAuto | TableOptionsJson | TableOptionsText;
|
|
203
|
-
//#endregion
|
|
204
|
-
//#region src/core/help/theme.d.ts
|
|
205
204
|
/**
|
|
206
205
|
* Semantic styling roles for help output.
|
|
207
206
|
*
|
|
@@ -251,8 +250,95 @@ type HelpDescription = string | ((theme: HelpTheme) => string);
|
|
|
251
250
|
* unconditionally, gating is the framework's job.
|
|
252
251
|
*/
|
|
253
252
|
type HelpThemeFactory = (colors: Colors) => Partial<HelpTheme>;
|
|
254
|
-
|
|
255
|
-
|
|
253
|
+
/**
|
|
254
|
+
* Runtime value completion callbacks.
|
|
255
|
+
*
|
|
256
|
+
* @module dreamcli/core/schema/completion
|
|
257
|
+
*/
|
|
258
|
+
/** The input and partial command line being completed. */
|
|
259
|
+
interface CompletionContext {
|
|
260
|
+
/** The value prefix typed before the cursor. */
|
|
261
|
+
readonly prefix: string;
|
|
262
|
+
/** Canonical command names, excluding the executable. Empty for a default command. */
|
|
263
|
+
readonly commandPath: readonly string[];
|
|
264
|
+
/** The input whose value is being completed. */
|
|
265
|
+
readonly input: {
|
|
266
|
+
readonly kind: 'flag' | 'arg';
|
|
267
|
+
readonly name: string;
|
|
268
|
+
};
|
|
269
|
+
/** Arguments before the cursor, including the current partial token. */
|
|
270
|
+
readonly argv: readonly string[];
|
|
271
|
+
/** Environment supplied to this execution. */
|
|
272
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
273
|
+
}
|
|
274
|
+
/** Return complete candidate values. DreamCLI filters them by prefix. */
|
|
275
|
+
type CompletionHandler = (context: CompletionContext) => readonly string[] | Promise<readonly string[]>;
|
|
276
|
+
/**
|
|
277
|
+
* An indexed env family whose entries are single values.
|
|
278
|
+
*
|
|
279
|
+
* ```text
|
|
280
|
+
* SERVER_COUNT=2 SERVER_0=a.example.com SERVER_1=b.example.com
|
|
281
|
+
* ```
|
|
282
|
+
*
|
|
283
|
+
* reads as `['a.example.com', 'b.example.com']`.
|
|
284
|
+
*/
|
|
285
|
+
interface IndexedValueEnvBinding {
|
|
286
|
+
/**
|
|
287
|
+
* Variable holding how many entries the family declares, as a canonical
|
|
288
|
+
* non-negative integer. When it is unset the env source supplies nothing;
|
|
289
|
+
* `0` supplies an explicit empty list.
|
|
290
|
+
*/
|
|
291
|
+
readonly count: string;
|
|
292
|
+
/** Variable template for one entry, with `{index}` standing for the zero-based index. */
|
|
293
|
+
readonly value: string;
|
|
294
|
+
/** Not available on a value family; see {@link IndexedRecordEnvBinding}. */
|
|
295
|
+
readonly fields?: never;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* An indexed env family whose entries are records, one variable per field.
|
|
299
|
+
*
|
|
300
|
+
* ```text
|
|
301
|
+
* CONFIG_COUNT=1 CONFIG_KEY_0=user.name CONFIG_VALUE_0=Kaj
|
|
302
|
+
* ```
|
|
303
|
+
*
|
|
304
|
+
* with `fields: { key: 'CONFIG_KEY_{index}', value: 'CONFIG_VALUE_{index}' }`
|
|
305
|
+
* reads as `[{ key: 'user.name', value: 'Kaj' }]`.
|
|
306
|
+
*/
|
|
307
|
+
interface IndexedRecordEnvBinding {
|
|
308
|
+
/**
|
|
309
|
+
* Variable holding how many entries the family declares, as a canonical
|
|
310
|
+
* non-negative integer. When it is unset the env source supplies nothing;
|
|
311
|
+
* `0` supplies an explicit empty list.
|
|
312
|
+
*/
|
|
313
|
+
readonly count: string;
|
|
314
|
+
/**
|
|
315
|
+
* One variable template per record field, each with `{index}` standing for
|
|
316
|
+
* the zero-based index. Every field is required for every declared entry.
|
|
317
|
+
*/
|
|
318
|
+
readonly fields: Readonly<Record<string, string>>;
|
|
319
|
+
/** Not available on a record family; see {@link IndexedValueEnvBinding}. */
|
|
320
|
+
readonly value?: never;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* A numbered family of environment variables read as one input's env source.
|
|
324
|
+
*
|
|
325
|
+
* Pass it to `.env()` in place of a variable name. The count variable decides
|
|
326
|
+
* whether the env stage supplied a value at all, and how many entries it owns;
|
|
327
|
+
* a declared entry with a missing member is an error, never a fallback to a
|
|
328
|
+
* later source.
|
|
329
|
+
*/
|
|
330
|
+
type IndexedEnvBinding = IndexedValueEnvBinding | IndexedRecordEnvBinding;
|
|
331
|
+
/** Options accepted by `.env()` beside the variable name or indexed binding. */
|
|
332
|
+
interface EnvOptions {
|
|
333
|
+
/**
|
|
334
|
+
* Read the name exactly as written, ignoring the CLI-wide namespace set by
|
|
335
|
+
* `CLIBuilder.envPrefix()`. Use it for variables the CLI does not own, such
|
|
336
|
+
* as `HOME`, `CI`, or a credential another tool exports.
|
|
337
|
+
*
|
|
338
|
+
* @defaultValue `false` (the name is relative to the CLI namespace)
|
|
339
|
+
*/
|
|
340
|
+
readonly absolute?: boolean;
|
|
341
|
+
}
|
|
256
342
|
/**
|
|
257
343
|
* Numeric constraints for number-valued flags and args.
|
|
258
344
|
*
|
|
@@ -309,8 +395,6 @@ type NumberConstraintViolation = {
|
|
|
309
395
|
readonly kind: 'max';
|
|
310
396
|
readonly bound: number;
|
|
311
397
|
};
|
|
312
|
-
//#endregion
|
|
313
|
-
//#region src/core/schema/prompt.d.ts
|
|
314
398
|
/**
|
|
315
399
|
* Prompt type definitions for interactive flag resolution.
|
|
316
400
|
*
|
|
@@ -461,8 +545,6 @@ type PromptResult = {
|
|
|
461
545
|
/** Retry exhaustion; omitted for cancellation or EOF. */
|
|
462
546
|
readonly reason?: 'invalid';
|
|
463
547
|
};
|
|
464
|
-
//#endregion
|
|
465
|
-
//#region src/core/schema/standard.d.ts
|
|
466
548
|
/**
|
|
467
549
|
* The Standard Schema v1 interface, vendored as types only.
|
|
468
550
|
*
|
|
@@ -553,8 +635,6 @@ type StandardSchemaV1Types<Input = unknown, Output = Input> = StandardSchemaV1.T
|
|
|
553
635
|
type InferStandardInput<Schema extends StandardSchemaV1> = StandardSchemaV1.InferInput<Schema>;
|
|
554
636
|
/** Flat alias for {@link StandardSchemaV1.InferOutput}. */
|
|
555
637
|
type InferStandardOutput<Schema extends StandardSchemaV1> = StandardSchemaV1.InferOutput<Schema>;
|
|
556
|
-
//#endregion
|
|
557
|
-
//#region src/core/schema/stdin.d.ts
|
|
558
638
|
/**
|
|
559
639
|
* The stdin binding shared by the `flag` and `arg` factories.
|
|
560
640
|
*
|
|
@@ -590,6 +670,8 @@ declare const STDIN_CONSUMES: readonly ["exclusive", "broadcast"];
|
|
|
590
670
|
type StdinConsume = (typeof STDIN_CONSUMES)[number];
|
|
591
671
|
/** The normalized stdin axis of a flag or an arg. */
|
|
592
672
|
interface StdinBinding {
|
|
673
|
+
/** False when this input has no command-line form. Omitted means true. */
|
|
674
|
+
readonly argv?: false;
|
|
593
675
|
/** When this input reads the stdin stream. */
|
|
594
676
|
readonly when: StdinWhen;
|
|
595
677
|
/** Whether this input consumes the stream alone. */
|
|
@@ -599,6 +681,13 @@ interface StdinBinding {
|
|
|
599
681
|
}
|
|
600
682
|
/** Stdin settings accepted by `.stdin()` and by the schema definitions. */
|
|
601
683
|
interface StdinOptions {
|
|
684
|
+
/**
|
|
685
|
+
* Accept this input on the command line. Set false to omit its flag spellings
|
|
686
|
+
* or positional slot from parsing, help, and completion. Other sources still apply.
|
|
687
|
+
* Cannot be combined with `when: 'dash'`.
|
|
688
|
+
* @defaultValue `true`
|
|
689
|
+
*/
|
|
690
|
+
readonly argv?: boolean | undefined;
|
|
602
691
|
/**
|
|
603
692
|
* When this input reads the stdin stream.
|
|
604
693
|
* @defaultValue `'dash-or-missing'`
|
|
@@ -618,8 +707,6 @@ interface StdinOptions {
|
|
|
618
707
|
*/
|
|
619
708
|
readonly trim?: boolean | undefined;
|
|
620
709
|
}
|
|
621
|
-
//#endregion
|
|
622
|
-
//#region src/core/schema/string-constraints.d.ts
|
|
623
710
|
/**
|
|
624
711
|
* String constraints for string-valued flags.
|
|
625
712
|
*
|
|
@@ -679,8 +766,6 @@ type StringConstraintViolation = {
|
|
|
679
766
|
readonly kind: 'pattern';
|
|
680
767
|
readonly pattern: string;
|
|
681
768
|
};
|
|
682
|
-
//#endregion
|
|
683
|
-
//#region src/core/schema/value-parsers.d.ts
|
|
684
769
|
/**
|
|
685
770
|
* Value-level machinery behind the sugar factories on both `flag` and `arg`
|
|
686
771
|
* (`url()`, `path()`, `date()`, `duration()`, `bytes()`).
|
|
@@ -774,8 +859,6 @@ interface PathChecks {
|
|
|
774
859
|
/** Create the directory (recursively) when nothing exists at the path. */
|
|
775
860
|
readonly create: boolean;
|
|
776
861
|
}
|
|
777
|
-
//#endregion
|
|
778
|
-
//#region src/core/schema/flag.d.ts
|
|
779
862
|
/** All flag presence states as a runtime array. */
|
|
780
863
|
declare const FLAG_PRESENCES: readonly ["optional", "required", "defaulted"];
|
|
781
864
|
/**
|
|
@@ -966,6 +1049,8 @@ type DuplicatePolicy = 'last' | 'first' | 'error';
|
|
|
966
1049
|
interface FlagSchema<K extends FlagKind = FlagKind> {
|
|
967
1050
|
/** Type-only seal produced by {@link createFlagSchema}. */
|
|
968
1051
|
readonly [schemaBrand]: 'flag';
|
|
1052
|
+
/** Callback used to complete this input's values. */
|
|
1053
|
+
readonly completion?: CompletionHandler | undefined;
|
|
969
1054
|
/** What kind of value this flag accepts. */
|
|
970
1055
|
readonly kind: K;
|
|
971
1056
|
/** Current presence state. */
|
|
@@ -988,6 +1073,26 @@ interface FlagSchema<K extends FlagKind = FlagKind> {
|
|
|
988
1073
|
readonly stdin: StdinBinding | undefined;
|
|
989
1074
|
/** Environment variable name for v0.2+ resolution. */
|
|
990
1075
|
readonly envVar: string | undefined;
|
|
1076
|
+
/**
|
|
1077
|
+
* Indexed environment family read as the env source, set by `.env()` with an
|
|
1078
|
+
* {@link IndexedEnvBinding} (`undefined` otherwise). A flag declares at most
|
|
1079
|
+
* one env source, so this and {@link FlagSchema.envVar} are never both set.
|
|
1080
|
+
*/
|
|
1081
|
+
readonly envIndexed: IndexedEnvBinding | undefined;
|
|
1082
|
+
/**
|
|
1083
|
+
* Whether the env source is read exactly as written, outside the CLI-wide
|
|
1084
|
+
* namespace set by `CLIBuilder.envPrefix()` (set by `.env(…, { absolute:
|
|
1085
|
+
* true })`). Applies to {@link FlagSchema.envVar} and
|
|
1086
|
+
* {@link FlagSchema.envIndexed} alike.
|
|
1087
|
+
*
|
|
1088
|
+
* @defaultValue `false`
|
|
1089
|
+
*/
|
|
1090
|
+
readonly envAbsolute: boolean;
|
|
1091
|
+
/**
|
|
1092
|
+
* Whether `.env()` was called without a name. Registration on a command
|
|
1093
|
+
* replaces it with the derived {@link FlagSchema.envVar}.
|
|
1094
|
+
*/
|
|
1095
|
+
readonly envFromName: boolean;
|
|
991
1096
|
/** Dotted config path for v0.2+ resolution (e.g. `'deploy.region'`). */
|
|
992
1097
|
readonly configPath: string | undefined;
|
|
993
1098
|
/** Human-readable description for help text. */
|
|
@@ -1108,6 +1213,8 @@ interface FlagSchema<K extends FlagKind = FlagKind> {
|
|
|
1108
1213
|
}
|
|
1109
1214
|
/** Definition fields accepted by every flag kind. */
|
|
1110
1215
|
interface FlagDefinitionBase {
|
|
1216
|
+
/** Callback used to complete this input's values. */
|
|
1217
|
+
readonly completion?: CompletionHandler | undefined;
|
|
1111
1218
|
/**
|
|
1112
1219
|
* Presence state.
|
|
1113
1220
|
* @defaultValue `'optional'`
|
|
@@ -1144,6 +1251,23 @@ interface FlagDefinitionBase {
|
|
|
1144
1251
|
* @defaultValue `undefined`
|
|
1145
1252
|
*/
|
|
1146
1253
|
readonly envVar?: string | undefined;
|
|
1254
|
+
/**
|
|
1255
|
+
* Indexed environment family read as the env source, in place of
|
|
1256
|
+
* {@link FlagDefinitionBase.envVar}. Requires kind `'array'` or `'custom'`.
|
|
1257
|
+
* @defaultValue `undefined`
|
|
1258
|
+
*/
|
|
1259
|
+
readonly envIndexed?: IndexedEnvBinding | undefined;
|
|
1260
|
+
/**
|
|
1261
|
+
* Read the env source exactly as written, outside the CLI-wide namespace.
|
|
1262
|
+
* Requires `envVar` or `envIndexed`.
|
|
1263
|
+
* @defaultValue `false`
|
|
1264
|
+
*/
|
|
1265
|
+
readonly envAbsolute?: boolean | undefined;
|
|
1266
|
+
/**
|
|
1267
|
+
* Derive `envVar` from the registered name.
|
|
1268
|
+
* @defaultValue `false`
|
|
1269
|
+
*/
|
|
1270
|
+
readonly envFromName?: boolean | undefined;
|
|
1147
1271
|
/**
|
|
1148
1272
|
* Dotted config path for config resolution (e.g. `'deploy.region'`).
|
|
1149
1273
|
* @defaultValue `undefined`
|
|
@@ -1416,6 +1540,17 @@ declare class FlagBuilder<C extends FlagConfig> {
|
|
|
1416
1540
|
* @param schema - Runtime descriptor seeding this builder's state.
|
|
1417
1541
|
*/
|
|
1418
1542
|
constructor(schema: FlagSchema);
|
|
1543
|
+
/**
|
|
1544
|
+
* Compute value candidates when the user requests shell completion.
|
|
1545
|
+
*
|
|
1546
|
+
* The callback runs without the command action, middleware, prompts, or
|
|
1547
|
+
* config discovery. Return complete values; DreamCLI filters by prefix.
|
|
1548
|
+
* Candidates containing control characters are omitted.
|
|
1549
|
+
*
|
|
1550
|
+
* @param handler - Callback receiving the input and partial command line.
|
|
1551
|
+
* @returns A new builder with the completion callback.
|
|
1552
|
+
*/
|
|
1553
|
+
complete(handler: CompletionHandler): FlagBuilder<WithoutElementEligibility<C>>;
|
|
1419
1554
|
/**
|
|
1420
1555
|
* Provide a default value. The flag becomes "always present" — handlers
|
|
1421
1556
|
* will never see `undefined`.
|
|
@@ -1490,7 +1625,12 @@ declare class FlagBuilder<C extends FlagConfig> {
|
|
|
1490
1625
|
* The env value is read after CLI and stdin, and before config, the prompt,
|
|
1491
1626
|
* and the default: CLI → stdin → **env** → config → prompt → default.
|
|
1492
1627
|
*
|
|
1628
|
+
* Under a CLI-wide namespace (`CLIBuilder.envPrefix()`) the name is relative:
|
|
1629
|
+
* `.env('TOKEN')` in `cli('foo').envPrefix()` reads `FOO_TOKEN`. Pass
|
|
1630
|
+
* `{ absolute: true }` to read the name exactly as written.
|
|
1631
|
+
*
|
|
1493
1632
|
* @param varName - Environment variable name (e.g. `'PORT'`).
|
|
1633
|
+
* @param options - Whether the name ignores the CLI namespace.
|
|
1494
1634
|
* @returns The builder (for chaining).
|
|
1495
1635
|
*
|
|
1496
1636
|
* @example
|
|
@@ -1499,9 +1639,57 @@ declare class FlagBuilder<C extends FlagConfig> {
|
|
|
1499
1639
|
*
|
|
1500
1640
|
* // $ API_KEY=sk-123 mycli request → apiKey = 'sk-123'
|
|
1501
1641
|
* // $ mycli request --api-key sk-456 → apiKey = 'sk-456' (CLI wins)
|
|
1642
|
+
*
|
|
1643
|
+
* flag.path().env('HOME', { absolute: true }) // never namespaced
|
|
1502
1644
|
* ```
|
|
1503
1645
|
*/
|
|
1504
|
-
env(varName: string): FlagBuilder<WithoutElementEligibility<C>>;
|
|
1646
|
+
env(varName: string, options?: EnvOptions): FlagBuilder<WithoutElementEligibility<C>>;
|
|
1647
|
+
/**
|
|
1648
|
+
* Bind to an indexed family of environment variables, read as one env source.
|
|
1649
|
+
*
|
|
1650
|
+
* The count variable owns indices `0..count-1`; `{index}` in each template
|
|
1651
|
+
* expands to the zero-based index. An unset count means the env source
|
|
1652
|
+
* supplied nothing, so resolution continues to config, the prompt, and the
|
|
1653
|
+
* default. A set count claims the flag: `0` resolves an empty list, and a
|
|
1654
|
+
* malformed count or a missing member is an error, never a fallback.
|
|
1655
|
+
*
|
|
1656
|
+
* A `value` family reads a list of strings, so it suits `flag.array()` (each
|
|
1657
|
+
* entry decoded by the element) and `flag.custom()` (handed the whole list).
|
|
1658
|
+
* A `fields` family reads a list of records, one variable per field, so it
|
|
1659
|
+
* suits `flag.array(flag.custom(...))` and `flag.custom()`.
|
|
1660
|
+
*
|
|
1661
|
+
* Under a CLI-wide namespace the count and every template are relative, the
|
|
1662
|
+
* same as a single name; `{ absolute: true }` reads them as written.
|
|
1663
|
+
*
|
|
1664
|
+
* @param binding - The count variable plus a `value` template or `fields` templates.
|
|
1665
|
+
* @param options - Whether the names ignore the CLI namespace.
|
|
1666
|
+
* @returns The builder (for chaining).
|
|
1667
|
+
* @throws {CLIError} With code `'INVALID_SCHEMA'` on a malformed template or a
|
|
1668
|
+
* flag kind that cannot hold a list.
|
|
1669
|
+
*
|
|
1670
|
+
* @example
|
|
1671
|
+
* ```ts
|
|
1672
|
+
* flag.array(flag.string()).env({ count: 'SERVER_COUNT', value: 'SERVER_{index}' })
|
|
1673
|
+
* // SERVER_COUNT=2 SERVER_0=a SERVER_1=b → ['a', 'b']
|
|
1674
|
+
*
|
|
1675
|
+
* flag.custom(gitConfigEntries).env({
|
|
1676
|
+
* count: 'GIT_CONFIG_COUNT',
|
|
1677
|
+
* fields: { key: 'GIT_CONFIG_KEY_{index}', value: 'GIT_CONFIG_VALUE_{index}' },
|
|
1678
|
+
* })
|
|
1679
|
+
* // GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=user.name GIT_CONFIG_VALUE_0=Kaj
|
|
1680
|
+
* // → gitConfigEntries receives [{ key: 'user.name', value: 'Kaj' }]
|
|
1681
|
+
* ```
|
|
1682
|
+
*/
|
|
1683
|
+
env(binding: IndexedEnvBinding, options?: EnvOptions): FlagBuilder<WithoutElementEligibility<C>>;
|
|
1684
|
+
/**
|
|
1685
|
+
* Bind to an environment variable derived from this input's registered
|
|
1686
|
+
* name (`api-token` and `apiToken` → `API_TOKEN`), relative to the CLI
|
|
1687
|
+
* namespace unless `{ absolute: true }`.
|
|
1688
|
+
*
|
|
1689
|
+
* @param options - Whether the derived name ignores the CLI namespace.
|
|
1690
|
+
* @returns The builder (for chaining).
|
|
1691
|
+
*/
|
|
1692
|
+
env(options?: EnvOptions): FlagBuilder<WithoutElementEligibility<C>>;
|
|
1505
1693
|
/**
|
|
1506
1694
|
* Let this flag read its value from piped stdin.
|
|
1507
1695
|
*
|
|
@@ -2272,8 +2460,6 @@ interface FlagFactory {
|
|
|
2272
2460
|
* {@link FlagBuilder} with full type inference and safe modifier chaining.
|
|
2273
2461
|
*/
|
|
2274
2462
|
declare const flag: FlagFactory;
|
|
2275
|
-
//#endregion
|
|
2276
|
-
//#region src/core/schema/cardinality.d.ts
|
|
2277
2463
|
/** All split formats as a runtime array. */
|
|
2278
2464
|
declare const SPLIT_FORMATS: readonly ["whole", "delimiter", "lines", "json"];
|
|
2279
2465
|
/** How one source's text decodes into collection elements. */
|
|
@@ -2359,8 +2545,6 @@ declare const DUPLICATE_KEYS: readonly ["first", "last", "error"];
|
|
|
2359
2545
|
* @defaultValue `'last'`
|
|
2360
2546
|
*/
|
|
2361
2547
|
type DuplicateKeys = (typeof DUPLICATE_KEYS)[number];
|
|
2362
|
-
//#endregion
|
|
2363
|
-
//#region src/core/schema/arg.d.ts
|
|
2364
2548
|
/** All arg presence states as a runtime array. */
|
|
2365
2549
|
declare const ARG_PRESENCES: readonly ["required", "optional", "defaulted"];
|
|
2366
2550
|
/**
|
|
@@ -2508,6 +2692,8 @@ type ArgParseFn<T> = (raw: string) => T;
|
|
|
2508
2692
|
interface ArgSchema<K extends ArgKind = ArgKind> {
|
|
2509
2693
|
/** Type-only seal produced by {@link createArgSchema}. */
|
|
2510
2694
|
readonly [schemaBrand]: 'arg';
|
|
2695
|
+
/** Callback used to complete this input's values. */
|
|
2696
|
+
readonly completion?: CompletionHandler | undefined;
|
|
2511
2697
|
/** What kind of value this arg accepts. */
|
|
2512
2698
|
readonly kind: K;
|
|
2513
2699
|
/** Current presence state. */
|
|
@@ -2539,6 +2725,28 @@ interface ArgSchema<K extends ArgKind = ArgKind> {
|
|
|
2539
2725
|
* @see {@link ArgBuilder.env} for the builder method.
|
|
2540
2726
|
*/
|
|
2541
2727
|
readonly envVar: string | undefined;
|
|
2728
|
+
/**
|
|
2729
|
+
* Indexed environment family read as the env source, set by `.env()` with an
|
|
2730
|
+
* {@link IndexedEnvBinding} (`undefined` otherwise). An arg declares at most
|
|
2731
|
+
* one env source, so this and {@link ArgSchema.envVar} are never both set.
|
|
2732
|
+
*
|
|
2733
|
+
* @see {@link ArgBuilder.env} for the builder method.
|
|
2734
|
+
*/
|
|
2735
|
+
readonly envIndexed: IndexedEnvBinding | undefined;
|
|
2736
|
+
/**
|
|
2737
|
+
* Whether the env source is read exactly as written, outside the CLI-wide
|
|
2738
|
+
* namespace set by `CLIBuilder.envPrefix()` (set by `.env(…, { absolute:
|
|
2739
|
+
* true })`). Applies to {@link ArgSchema.envVar} and
|
|
2740
|
+
* {@link ArgSchema.envIndexed} alike.
|
|
2741
|
+
*
|
|
2742
|
+
* @defaultValue `false`
|
|
2743
|
+
*/
|
|
2744
|
+
readonly envAbsolute: boolean;
|
|
2745
|
+
/**
|
|
2746
|
+
* Whether `.env()` was called without a name. Registration on a command
|
|
2747
|
+
* replaces it with the derived {@link ArgSchema.envVar}.
|
|
2748
|
+
*/
|
|
2749
|
+
readonly envFromName: boolean;
|
|
2542
2750
|
/**
|
|
2543
2751
|
* Dotted config path for config resolution (e.g. `'deploy.region'`).
|
|
2544
2752
|
*
|
|
@@ -2650,6 +2858,8 @@ interface ArgSchema<K extends ArgKind = ArgKind> {
|
|
|
2650
2858
|
}
|
|
2651
2859
|
/** Definition fields accepted by every arg kind. */
|
|
2652
2860
|
interface ArgDefinitionBase {
|
|
2861
|
+
/** Callback used to complete this input's values. */
|
|
2862
|
+
readonly completion?: CompletionHandler | undefined;
|
|
2653
2863
|
/**
|
|
2654
2864
|
* Presence state.
|
|
2655
2865
|
* @defaultValue `'required'`
|
|
@@ -2691,6 +2901,24 @@ interface ArgDefinitionBase {
|
|
|
2691
2901
|
* @defaultValue `undefined`
|
|
2692
2902
|
*/
|
|
2693
2903
|
readonly envVar?: string | undefined;
|
|
2904
|
+
/**
|
|
2905
|
+
* Indexed environment family read as the env source, in place of
|
|
2906
|
+
* {@link ArgDefinitionBase.envVar}. Requires a variadic arg, or a custom arg
|
|
2907
|
+
* without a string parse function.
|
|
2908
|
+
* @defaultValue `undefined`
|
|
2909
|
+
*/
|
|
2910
|
+
readonly envIndexed?: IndexedEnvBinding | undefined;
|
|
2911
|
+
/**
|
|
2912
|
+
* Read the env source exactly as written, outside the CLI-wide namespace.
|
|
2913
|
+
* Requires `envVar` or `envIndexed`.
|
|
2914
|
+
* @defaultValue `false`
|
|
2915
|
+
*/
|
|
2916
|
+
readonly envAbsolute?: boolean | undefined;
|
|
2917
|
+
/**
|
|
2918
|
+
* Derive `envVar` from the registered name.
|
|
2919
|
+
* @defaultValue `false`
|
|
2920
|
+
*/
|
|
2921
|
+
readonly envFromName?: boolean | undefined;
|
|
2694
2922
|
/**
|
|
2695
2923
|
* Dotted config path for config resolution (e.g. `'deploy.region'`).
|
|
2696
2924
|
* @defaultValue `undefined`
|
|
@@ -2927,6 +3155,17 @@ declare class ArgBuilder<C extends ArgConfig> {
|
|
|
2927
3155
|
* @param schema - Runtime descriptor for this positional argument.
|
|
2928
3156
|
*/
|
|
2929
3157
|
constructor(schema: ArgSchema);
|
|
3158
|
+
/**
|
|
3159
|
+
* Compute value candidates when the user requests shell completion.
|
|
3160
|
+
*
|
|
3161
|
+
* The callback runs without the command action, middleware, prompts, or
|
|
3162
|
+
* config discovery. Return complete values; DreamCLI filters by prefix.
|
|
3163
|
+
* Candidates containing control characters are omitted.
|
|
3164
|
+
*
|
|
3165
|
+
* @param handler - Callback receiving the input and partial command line.
|
|
3166
|
+
* @returns A new builder with the completion callback.
|
|
3167
|
+
*/
|
|
3168
|
+
complete(handler: CompletionHandler): ArgBuilder<WithoutArgElementEligibility<C>>;
|
|
2930
3169
|
/**
|
|
2931
3170
|
* Mark the arg as required (this is the default for positional args).
|
|
2932
3171
|
* Produces an error if no value resolves from any configured source
|
|
@@ -3191,7 +3430,12 @@ declare class ArgBuilder<C extends ArgConfig> {
|
|
|
3191
3430
|
*
|
|
3192
3431
|
* Help output shows `[env: VAR]` next to the arg description.
|
|
3193
3432
|
*
|
|
3433
|
+
* Under a CLI-wide namespace (`CLIBuilder.envPrefix()`) the name is relative:
|
|
3434
|
+
* `.env('TARGET')` in `cli('foo').envPrefix()` reads `FOO_TARGET`. Pass
|
|
3435
|
+
* `{ absolute: true }` to read the name exactly as written.
|
|
3436
|
+
*
|
|
3194
3437
|
* @param varName - Environment variable name (e.g. `'DEPLOY_TARGET'`).
|
|
3438
|
+
* @param options - Whether the name ignores the CLI namespace.
|
|
3195
3439
|
* @returns The builder (for chaining).
|
|
3196
3440
|
*
|
|
3197
3441
|
* @example
|
|
@@ -3205,7 +3449,34 @@ declare class ArgBuilder<C extends ArgConfig> {
|
|
|
3205
3449
|
* });
|
|
3206
3450
|
* ```
|
|
3207
3451
|
*/
|
|
3208
|
-
env(varName: string): ArgBuilder<WithoutArgElementEligibility<C>>;
|
|
3452
|
+
env(varName: string, options?: EnvOptions): ArgBuilder<WithoutArgElementEligibility<C>>;
|
|
3453
|
+
/**
|
|
3454
|
+
* Bind to an indexed family of environment variables, read as one env
|
|
3455
|
+
* source; see `FlagBuilder.env()` for the count and template rules. A
|
|
3456
|
+
* `value` family needs a variadic arg (call `.variadic()` first), and a
|
|
3457
|
+
* `fields` family a Standard Schema `arg.custom()`.
|
|
3458
|
+
*
|
|
3459
|
+
* @param binding - The count variable plus a `value` template or `fields` templates.
|
|
3460
|
+
* @param options - Whether the names ignore the CLI namespace.
|
|
3461
|
+
* @returns The builder (for chaining).
|
|
3462
|
+
* @throws {CLIError} With code `'INVALID_SCHEMA'` on a malformed template or an
|
|
3463
|
+
* arg that cannot hold a list.
|
|
3464
|
+
*
|
|
3465
|
+
* @example
|
|
3466
|
+
* ```ts
|
|
3467
|
+
* arg.string().variadic().env({ count: 'FILE_COUNT', value: 'FILE_{index}' })
|
|
3468
|
+
* ```
|
|
3469
|
+
*/
|
|
3470
|
+
env(binding: IndexedEnvBinding, options?: EnvOptions): ArgBuilder<WithoutArgElementEligibility<C>>;
|
|
3471
|
+
/**
|
|
3472
|
+
* Bind to an environment variable derived from this input's registered
|
|
3473
|
+
* name (`api-token` and `apiToken` → `API_TOKEN`), relative to the CLI
|
|
3474
|
+
* namespace unless `{ absolute: true }`.
|
|
3475
|
+
*
|
|
3476
|
+
* @param options - Whether the derived name ignores the CLI namespace.
|
|
3477
|
+
* @returns The builder (for chaining).
|
|
3478
|
+
*/
|
|
3479
|
+
env(options?: EnvOptions): ArgBuilder<WithoutArgElementEligibility<C>>;
|
|
3209
3480
|
/**
|
|
3210
3481
|
* Bind to a dotted config path.
|
|
3211
3482
|
*
|
|
@@ -3840,14 +4111,10 @@ interface ArgFactory {
|
|
|
3840
4111
|
* ```
|
|
3841
4112
|
*/
|
|
3842
4113
|
declare const arg: ArgFactory;
|
|
3843
|
-
//#endregion
|
|
3844
|
-
//#region src/core/output/contracts.d.ts
|
|
3845
4114
|
/** Ordered output verbosity levels owned by the output policy layer. */
|
|
3846
4115
|
declare const OUTPUT_VERBOSITY_LEVELS: readonly ["normal", "quiet"];
|
|
3847
4116
|
/** Stable text verbosity labels. */
|
|
3848
4117
|
type Verbosity = (typeof OUTPUT_VERBOSITY_LEVELS)[number];
|
|
3849
|
-
//#endregion
|
|
3850
|
-
//#region src/core/prompt/definitions.d.ts
|
|
3851
4118
|
/** Infer an answer, preserving literal choice values. */
|
|
3852
4119
|
type InferPrompt<C extends PromptConfig> = C extends ConfirmPromptConfig ? boolean : C extends {
|
|
3853
4120
|
readonly kind: 'multiselect';
|
|
@@ -3879,8 +4146,6 @@ declare const prompt: {
|
|
|
3879
4146
|
kind: 'multiselect';
|
|
3880
4147
|
};
|
|
3881
4148
|
};
|
|
3882
|
-
//#endregion
|
|
3883
|
-
//#region src/core/schema/middleware.d.ts
|
|
3884
4149
|
/**
|
|
3885
4150
|
* Parameters received by a middleware function at runtime.
|
|
3886
4151
|
*
|
|
@@ -4010,8 +4275,6 @@ type Middleware<Output extends Record<string, unknown>> = MiddlewareImpl & {
|
|
|
4010
4275
|
* ```
|
|
4011
4276
|
*/
|
|
4012
4277
|
declare function middleware<Output extends Record<string, unknown>>(handler: MiddlewareHandler<Output>): Middleware<Output>;
|
|
4013
|
-
//#endregion
|
|
4014
|
-
//#region src/core/schema/provenance.d.ts
|
|
4015
4278
|
/**
|
|
4016
4279
|
* Where a resolved value came from.
|
|
4017
4280
|
*
|
|
@@ -4030,13 +4293,21 @@ declare function middleware<Output extends Record<string, unknown>>(handler: Mid
|
|
|
4030
4293
|
* 'dash' }`; an absent input takes the fallback stage between CLI and env and
|
|
4031
4294
|
* reports `{ stage: 'stdin', via: 'stdin', trigger: 'fallback' }`.
|
|
4032
4295
|
*
|
|
4296
|
+
* The `'env'` stage is two records the same way. A variable bound by name
|
|
4297
|
+
* reports `{ stage: 'env', envVar }`, the one concrete variable that supplied
|
|
4298
|
+
* the value. An indexed family bound with an `IndexedEnvBinding` reports
|
|
4299
|
+
* `{ stage: 'env', via: 'indexed', count, envVars }`: the count variable that
|
|
4300
|
+
* claimed the input and every member variable read, in entry order and, within
|
|
4301
|
+
* an entry, in field order. `envVars` is empty when the count is `0`. Test
|
|
4302
|
+
* `'envVar' in source` (or `source.via`) before reading either shape's fields.
|
|
4303
|
+
*
|
|
4033
4304
|
* @example
|
|
4034
4305
|
* ```ts
|
|
4035
4306
|
* command('deploy')
|
|
4036
4307
|
* .flag('region', flag.string().env('REGION').default('us'))
|
|
4037
4308
|
* .action(({ sources }) => {
|
|
4038
4309
|
* const region = sources.flags.region;
|
|
4039
|
-
* if (region?.stage === 'env') console.log(`from ${region.envVar}`);
|
|
4310
|
+
* if (region?.stage === 'env' && 'envVar' in region) console.log(`from ${region.envVar}`);
|
|
4040
4311
|
* });
|
|
4041
4312
|
* ```
|
|
4042
4313
|
*/
|
|
@@ -4053,6 +4324,11 @@ type ResolutionProvenance = {
|
|
|
4053
4324
|
} | {
|
|
4054
4325
|
readonly stage: 'env';
|
|
4055
4326
|
readonly envVar: string;
|
|
4327
|
+
} | {
|
|
4328
|
+
readonly stage: 'env';
|
|
4329
|
+
readonly via: 'indexed';
|
|
4330
|
+
readonly count: string;
|
|
4331
|
+
readonly envVars: readonly string[];
|
|
4056
4332
|
} | {
|
|
4057
4333
|
readonly stage: 'config';
|
|
4058
4334
|
readonly configPath: string;
|
|
@@ -4108,8 +4384,6 @@ interface InputSources<F, A> {
|
|
|
4108
4384
|
* ```
|
|
4109
4385
|
*/
|
|
4110
4386
|
declare function wasExplicit(source: ResolutionProvenance | undefined): boolean;
|
|
4111
|
-
//#endregion
|
|
4112
|
-
//#region src/core/schema/command.d.ts
|
|
4113
4387
|
/**
|
|
4114
4388
|
* Widen the context type when adding middleware.
|
|
4115
4389
|
*
|
|
@@ -4547,6 +4821,8 @@ interface CommandSchema {
|
|
|
4547
4821
|
readonly name: string;
|
|
4548
4822
|
/** Human-readable description for help text. */
|
|
4549
4823
|
readonly description: string | undefined;
|
|
4824
|
+
/** Longer explanation shown only in this command's help, with paragraphs wrapped to its width. */
|
|
4825
|
+
readonly details?: HelpDescription | undefined;
|
|
4550
4826
|
/** Alternative names for this command. */
|
|
4551
4827
|
readonly aliases: readonly string[];
|
|
4552
4828
|
/** Whether this command is hidden from help listings. */
|
|
@@ -4615,6 +4891,8 @@ interface CommandDefinition {
|
|
|
4615
4891
|
* @defaultValue `undefined`
|
|
4616
4892
|
*/
|
|
4617
4893
|
readonly description?: string | undefined;
|
|
4894
|
+
/** Longer explanation shown only in this command's help. */
|
|
4895
|
+
readonly details?: HelpDescription | undefined;
|
|
4618
4896
|
/**
|
|
4619
4897
|
* Alternative names for this command.
|
|
4620
4898
|
* @defaultValue `[]`
|
|
@@ -4713,6 +4991,10 @@ declare function createCommandSchema(definition: CommandDefinition): CommandSche
|
|
|
4713
4991
|
*
|
|
4714
4992
|
*/
|
|
4715
4993
|
type AnyCommandBuilder = CommandBuilder<Record<string, FlagBuilder<FlagConfig>>, Record<string, ArgBuilder<ArgConfig>>, Record<string, unknown>>;
|
|
4994
|
+
/** Retain declared flag names for duplicate checks alongside an index signature. */
|
|
4995
|
+
type KnownFlags<F> = { [K in keyof F as string extends K ? never : number extends K ? never : K]: F[K]; };
|
|
4996
|
+
/** Generated names can carry any registered builder, while declared names keep their types. */
|
|
4997
|
+
type MergeFlags<F extends Record<string, FlagBuilder<FlagConfig>>, R extends Record<string, FlagBuilder<FlagConfig>>> = string extends keyof F | keyof R ? KnownFlags<F> & KnownFlags<R> & Record<string, F[keyof F] | R[keyof R]> : F & R;
|
|
4716
4998
|
/**
|
|
4717
4999
|
* Immutable command schema builder.
|
|
4718
5000
|
*
|
|
@@ -4925,6 +5207,16 @@ declare class CommandBuilder<F extends Record<string, FlagBuilder<FlagConfig>> =
|
|
|
4925
5207
|
* @returns The builder (for chaining).
|
|
4926
5208
|
*/
|
|
4927
5209
|
description(text: string): CommandBuilder<F, A, C>;
|
|
5210
|
+
/**
|
|
5211
|
+
* Add a longer explanation to this command's help.
|
|
5212
|
+
*
|
|
5213
|
+
* Paragraphs wrap to the help width. Parent command listings use only
|
|
5214
|
+
* `.description()`. A function receives the current help description theme.
|
|
5215
|
+
*
|
|
5216
|
+
* @param text - Literal text or a function that styles the explanation.
|
|
5217
|
+
* @returns A new builder with the explanation.
|
|
5218
|
+
*/
|
|
5219
|
+
details(text: HelpDescription): CommandBuilder<F, A, C>;
|
|
4928
5220
|
/**
|
|
4929
5221
|
* Add an alternative name for this command.
|
|
4930
5222
|
*
|
|
@@ -5054,7 +5346,26 @@ declare class CommandBuilder<F extends Record<string, FlagBuilder<FlagConfig>> =
|
|
|
5054
5346
|
* @throws {@link CLIError} `PROPAGATED_FLAG_COLLISION` when a spelling
|
|
5055
5347
|
* collides with one propagated to a registered subcommand.
|
|
5056
5348
|
*/
|
|
5057
|
-
flag<N extends string, B extends FlagBuilder<FlagConfig>>(name: N & Exclude<N, keyof F
|
|
5349
|
+
flag<N extends string, B extends FlagBuilder<FlagConfig>>(name: N & Exclude<N, keyof KnownFlags<F>>, builder: B): CommandBuilder<MergeFlags<F, Record<N, B>>, A, C>;
|
|
5350
|
+
/**
|
|
5351
|
+
* Register a record of flags, preserving each key and inferred value type.
|
|
5352
|
+
*
|
|
5353
|
+
* Names and aliases must not collide with existing flags or other entries.
|
|
5354
|
+
* Literal names are checked by the compiler. Generated names are checked
|
|
5355
|
+
* at runtime, and their values include the registered flag value types.
|
|
5356
|
+
* Adding flags clears any previously registered action, like `.flag()`.
|
|
5357
|
+
*
|
|
5358
|
+
* @param record - Named flag builders to add to this command.
|
|
5359
|
+
* @returns A new builder with the added flags.
|
|
5360
|
+
*
|
|
5361
|
+
* @example
|
|
5362
|
+
* ```ts
|
|
5363
|
+
* command('serve')
|
|
5364
|
+
* .flags({ port: flag.number().default(3000), host: flag.string() })
|
|
5365
|
+
* .action(({ flags }) => { flags.port; flags.host; });
|
|
5366
|
+
* ```
|
|
5367
|
+
*/
|
|
5368
|
+
flags<const R extends Record<string, FlagBuilder<FlagConfig>>>(record: R & { [K in (keyof KnownFlags<R> & keyof KnownFlags<F>) | Extract<keyof R, symbol>]: never; }): CommandBuilder<MergeFlags<F, R>, A, C>;
|
|
5058
5369
|
/**
|
|
5059
5370
|
* Register a named positional argument on this command.
|
|
5060
5371
|
*
|
|
@@ -5220,8 +5531,6 @@ declare function command(name: string): CommandBuilder;
|
|
|
5220
5531
|
* @returns A fresh {@link CommandBuilder} with empty flags, args, and context.
|
|
5221
5532
|
*/
|
|
5222
5533
|
declare function group(name: string): CommandBuilder;
|
|
5223
|
-
//#endregion
|
|
5224
|
-
//#region src/core/prompt/index.d.ts
|
|
5225
5534
|
/**
|
|
5226
5535
|
* A select prompt config with choices guaranteed non-empty.
|
|
5227
5536
|
*
|
|
@@ -5322,8 +5631,287 @@ type ReadFn = () => Promise<string | null>;
|
|
|
5322
5631
|
* @throws Error if select/multiselect has no choices and no enum values
|
|
5323
5632
|
*/
|
|
5324
5633
|
declare function resolvePromptConfig(config: PromptConfig, enumValues: readonly string[] | undefined): ResolvedPromptConfig;
|
|
5325
|
-
|
|
5326
|
-
|
|
5634
|
+
/**
|
|
5635
|
+
* Runtime adapter interface.
|
|
5636
|
+
*
|
|
5637
|
+
* Defines the minimal contract between the platform-agnostic core and
|
|
5638
|
+
* the host runtime (Node.js, Bun, Deno). Every platform-dependent
|
|
5639
|
+
* operation flows through this interface — the core never calls
|
|
5640
|
+
* `process.*`, `Deno.*`, or `Bun.*` directly.
|
|
5641
|
+
*
|
|
5642
|
+
* Adapters are designed to be:
|
|
5643
|
+
* - **Immutable in shape:** all properties are readonly
|
|
5644
|
+
* - **Minimal:** only the operations the framework actually needs
|
|
5645
|
+
* - **Testable:** easily stubbed in tests via {@linkcode createTestAdapter | createTestAdapter()}
|
|
5646
|
+
*
|
|
5647
|
+
* @example
|
|
5648
|
+
* ```ts
|
|
5649
|
+
* // Production: auto-detected
|
|
5650
|
+
* cli('mycli').run(); // uses Node/Bun/Deno adapter
|
|
5651
|
+
*
|
|
5652
|
+
* // Test: explicit adapter
|
|
5653
|
+
* cli('mycli').run({ adapter: createTestAdapter({ argv: ['deploy'] }) });
|
|
5654
|
+
* ```
|
|
5655
|
+
*/
|
|
5656
|
+
interface RuntimeAdapter {
|
|
5657
|
+
/** Raw argv array (including binary + script path, e.g. `['node', 'cli.js', 'deploy']`). */
|
|
5658
|
+
readonly argv: readonly string[];
|
|
5659
|
+
/**
|
|
5660
|
+
* Environment variables.
|
|
5661
|
+
* Values are `string | undefined` — mirrors Node's `process.env` semantics.
|
|
5662
|
+
*/
|
|
5663
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
5664
|
+
/** Current working directory (absolute path). */
|
|
5665
|
+
readonly cwd: string;
|
|
5666
|
+
/** Writer for stdout. Framework routes `out.log`/`out.info` through this. */
|
|
5667
|
+
readonly stdout: WriteFn;
|
|
5668
|
+
/** Writer for stderr. Framework routes `out.warn`/`out.error` through this. */
|
|
5669
|
+
readonly stderr: WriteFn;
|
|
5670
|
+
/** Wait for pending output writes to settle, rejecting with a recorded output failure. */
|
|
5671
|
+
readonly flush?: () => Promise<void>;
|
|
5672
|
+
/**
|
|
5673
|
+
* Line reader for stdin. Used by the prompt engine for interactive input.
|
|
5674
|
+
*
|
|
5675
|
+
* Returns `null` on EOF (Ctrl+D on Unix, Ctrl+Z on Windows),
|
|
5676
|
+
* indicating the user closed the input stream (treated as cancel).
|
|
5677
|
+
*/
|
|
5678
|
+
readonly stdin: ReadFn;
|
|
5679
|
+
/** Hidden terminal input. Absent when echo suppression is unsupported. */
|
|
5680
|
+
readonly readSecret?: ReadFn;
|
|
5681
|
+
/**
|
|
5682
|
+
* Read all of stdin as a single string (for piped data).
|
|
5683
|
+
*
|
|
5684
|
+
* Returns the full stdin contents when data is piped (`stdinIsTTY` is
|
|
5685
|
+
* false), or `null` when stdin is a TTY (no piped data available).
|
|
5686
|
+
*
|
|
5687
|
+
* Used by the resolve chain for args with `.stdin()` configured.
|
|
5688
|
+
* Unlike {@link stdin} (which reads one line for prompts), this
|
|
5689
|
+
* consumes the entire stream to EOF.
|
|
5690
|
+
*
|
|
5691
|
+
* @returns Full stdin contents as a string, or `null` if stdin is a TTY.
|
|
5692
|
+
*/
|
|
5693
|
+
readonly readStdin: () => Promise<string | null>;
|
|
5694
|
+
/** Whether stdout is connected to a TTY. */
|
|
5695
|
+
readonly isTTY: boolean;
|
|
5696
|
+
/** Whether stdin is connected to a TTY (used for prompt gating). */
|
|
5697
|
+
readonly stdinIsTTY: boolean;
|
|
5698
|
+
/** Read current terminal dimensions for stdout, if available. */
|
|
5699
|
+
readonly getTerminalSize: () => TerminalSize | undefined;
|
|
5700
|
+
/** Subscribe to terminal resize events when the runtime supports them. */
|
|
5701
|
+
readonly onTerminalResize: (listener: () => void) => (() => void) | undefined;
|
|
5702
|
+
/**
|
|
5703
|
+
* Exit the process with the given code.
|
|
5704
|
+
* Must not return (divergent function).
|
|
5705
|
+
*/
|
|
5706
|
+
readonly exit: (code: number) => never;
|
|
5707
|
+
/**
|
|
5708
|
+
* Read a file as UTF-8 text.
|
|
5709
|
+
*
|
|
5710
|
+
* Returns file contents on success, `null` if the file does not exist
|
|
5711
|
+
* (ENOENT/NotFound). Throws on other I/O errors (permission denied,
|
|
5712
|
+
* is-directory, etc.) — those indicate unexpected failures, not
|
|
5713
|
+
* "try the next path".
|
|
5714
|
+
*
|
|
5715
|
+
* Used by config file discovery to probe multiple candidate paths.
|
|
5716
|
+
*/
|
|
5717
|
+
readonly readFile: (path: string) => Promise<string | null>;
|
|
5718
|
+
/**
|
|
5719
|
+
* Probe what exists at a filesystem path.
|
|
5720
|
+
*
|
|
5721
|
+
* Returns `'file'` or `'directory'` for existing paths (other kinds such
|
|
5722
|
+
* as sockets report `'file'`), or `null` when nothing exists there.
|
|
5723
|
+
*
|
|
5724
|
+
* Used by `flag.path()` existence/type checks after resolution.
|
|
5725
|
+
*/
|
|
5726
|
+
readonly stat: (path: string) => Promise<'file' | 'directory' | null>;
|
|
5727
|
+
/**
|
|
5728
|
+
* Create a directory, including missing parents.
|
|
5729
|
+
*
|
|
5730
|
+
* Succeeds when the directory already exists. Throws on other I/O errors
|
|
5731
|
+
* (permission denied, existing file at the path, etc.).
|
|
5732
|
+
*
|
|
5733
|
+
* Used by `flag.path()` `create` checks after resolution.
|
|
5734
|
+
*/
|
|
5735
|
+
readonly mkdir: (path: string) => Promise<void>;
|
|
5736
|
+
/**
|
|
5737
|
+
* User home directory (absolute path).
|
|
5738
|
+
*
|
|
5739
|
+
* - Node/Bun: derived from `HOME` / `USERPROFILE` env
|
|
5740
|
+
* - Deno: `Deno.env.get('HOME')` / `Deno.env.get('USERPROFILE')`
|
|
5741
|
+
*/
|
|
5742
|
+
readonly homedir: string;
|
|
5743
|
+
/**
|
|
5744
|
+
* Platform-specific user configuration directory (absolute path).
|
|
5745
|
+
*
|
|
5746
|
+
* - Unix: `$XDG_CONFIG_HOME` or `~/.config`
|
|
5747
|
+
* - Windows: `%APPDATA%` or `~\AppData\Roaming`
|
|
5748
|
+
*
|
|
5749
|
+
* Config discovery appends the app-specific subdirectory.
|
|
5750
|
+
*/
|
|
5751
|
+
readonly configDir: string;
|
|
5752
|
+
/**
|
|
5753
|
+
* User-scope config roots for discovery, highest priority first.
|
|
5754
|
+
*
|
|
5755
|
+
* - Unix: `[configDir]`
|
|
5756
|
+
* - macOS: `[configDir, ~/Library/Application Support]`
|
|
5757
|
+
* - Windows: `[configDir]`
|
|
5758
|
+
*
|
|
5759
|
+
* When absent, discovery falls back to `[configDir]`.
|
|
5760
|
+
*/
|
|
5761
|
+
readonly userConfigDirs?: readonly string[];
|
|
5762
|
+
/**
|
|
5763
|
+
* System-scope config roots for discovery (`['/etc']` on Linux and
|
|
5764
|
+
* macOS, `[]` on Windows). When absent, discovery probes none.
|
|
5765
|
+
*/
|
|
5766
|
+
readonly systemConfigDirs?: readonly string[];
|
|
5767
|
+
}
|
|
5768
|
+
/** Current terminal dimensions in columns and rows. */
|
|
5769
|
+
interface TerminalSize {
|
|
5770
|
+
/** Terminal width in columns. */
|
|
5771
|
+
readonly columns: number;
|
|
5772
|
+
/** Terminal height in rows. */
|
|
5773
|
+
readonly rows: number;
|
|
5774
|
+
}
|
|
5775
|
+
/**
|
|
5776
|
+
* Options for creating a test adapter.
|
|
5777
|
+
*
|
|
5778
|
+
* All fields are optional — sensible defaults are applied for testing
|
|
5779
|
+
* scenarios (empty argv, empty env, noop stdout/stderr, non-TTY, exit
|
|
5780
|
+
* throws instead of killing the process).
|
|
5781
|
+
*/
|
|
5782
|
+
interface TestAdapterOptions {
|
|
5783
|
+
/** Raw argv (defaults to `['node', 'test']`). */
|
|
5784
|
+
readonly argv?: readonly string[];
|
|
5785
|
+
/** Environment variables (defaults to `{}`). */
|
|
5786
|
+
readonly env?: Readonly<Record<string, string | undefined>>;
|
|
5787
|
+
/** Working directory (defaults to `'/test'`). */
|
|
5788
|
+
readonly cwd?: string;
|
|
5789
|
+
/** Stdout writer (defaults to noop). */
|
|
5790
|
+
readonly stdout?: WriteFn;
|
|
5791
|
+
/** Stderr writer (defaults to noop). */
|
|
5792
|
+
readonly stderr?: WriteFn;
|
|
5793
|
+
/**
|
|
5794
|
+
* Stdin line reader (defaults to returning `null` — immediate EOF).
|
|
5795
|
+
*
|
|
5796
|
+
* Use a custom {@linkcode ReadFn} to simulate user input in tests.
|
|
5797
|
+
*/
|
|
5798
|
+
readonly stdin?: ReadFn;
|
|
5799
|
+
/** Hidden reader stub; omitted adapters report unsupported hidden input. */
|
|
5800
|
+
readonly readSecret?: ReadFn;
|
|
5801
|
+
/**
|
|
5802
|
+
* Piped stdin data for testing args with `.stdin()` configured.
|
|
5803
|
+
*
|
|
5804
|
+
* When provided and `stdinIsTTY` is `false`, `readStdin()` returns this
|
|
5805
|
+
* string once, then `null` on subsequent reads. When absent, or when
|
|
5806
|
+
* `stdinIsTTY` is `true`, `readStdin()` returns `null`.
|
|
5807
|
+
*
|
|
5808
|
+
* @example
|
|
5809
|
+
* ```ts
|
|
5810
|
+
* createTestAdapter({
|
|
5811
|
+
* stdinData: '{"key": "value"}',
|
|
5812
|
+
* })
|
|
5813
|
+
* ```
|
|
5814
|
+
*/
|
|
5815
|
+
readonly stdinData?: string;
|
|
5816
|
+
/** TTY flag for stdout (defaults to `false`). */
|
|
5817
|
+
readonly isTTY?: boolean;
|
|
5818
|
+
/** TTY flag for stdin (defaults to `false`). */
|
|
5819
|
+
readonly stdinIsTTY?: boolean;
|
|
5820
|
+
/** Terminal dimensions returned by `getTerminalSize()`. */
|
|
5821
|
+
readonly terminalSize?: TerminalSize;
|
|
5822
|
+
/** Resize subscription hook returned by `onTerminalResize()`. */
|
|
5823
|
+
readonly onTerminalResize?: (listener: () => void) => (() => void) | undefined;
|
|
5824
|
+
/**
|
|
5825
|
+
* Exit function (defaults to throwing {@linkcode ExitError}).
|
|
5826
|
+
* The default throw-based exit allows tests to catch the exit code.
|
|
5827
|
+
*/
|
|
5828
|
+
readonly exit?: (code: number) => never;
|
|
5829
|
+
/**
|
|
5830
|
+
* File reader stub (defaults to returning `null` — all files not found).
|
|
5831
|
+
*
|
|
5832
|
+
* Supply a custom function to simulate a virtual filesystem in tests:
|
|
5833
|
+
* ```ts
|
|
5834
|
+
* createTestAdapter({
|
|
5835
|
+
* readFile: (path) => Promise.resolve(
|
|
5836
|
+
* path === '/home/test/.config/myapp/config.json'
|
|
5837
|
+
* ? '{"region":"eu"}'
|
|
5838
|
+
* : null
|
|
5839
|
+
* ),
|
|
5840
|
+
* })
|
|
5841
|
+
* ```
|
|
5842
|
+
*/
|
|
5843
|
+
readonly readFile?: (path: string) => Promise<string | null>;
|
|
5844
|
+
/**
|
|
5845
|
+
* Filesystem probe stub for `flag.path()` checks (defaults to returning
|
|
5846
|
+
* `null` — nothing exists).
|
|
5847
|
+
*
|
|
5848
|
+
* Supply a custom function to simulate a virtual filesystem in tests:
|
|
5849
|
+
* ```ts
|
|
5850
|
+
* createTestAdapter({
|
|
5851
|
+
* stat: (path) => Promise.resolve(path === '/data' ? 'directory' : null),
|
|
5852
|
+
* })
|
|
5853
|
+
* ```
|
|
5854
|
+
*/
|
|
5855
|
+
readonly stat?: (path: string) => Promise<'file' | 'directory' | null>;
|
|
5856
|
+
/**
|
|
5857
|
+
* Directory creation stub for `flag.path()` `create` checks (defaults to
|
|
5858
|
+
* a noop that resolves without creating anything).
|
|
5859
|
+
*/
|
|
5860
|
+
readonly mkdir?: (path: string) => Promise<void>;
|
|
5861
|
+
/** Home directory (defaults to `'/home/test'`). */
|
|
5862
|
+
readonly homedir?: string;
|
|
5863
|
+
/** Config directory (defaults to `'/home/test/.config'`). */
|
|
5864
|
+
readonly configDir?: string;
|
|
5865
|
+
/** User-scope config roots for discovery (defaults to `[configDir]`). */
|
|
5866
|
+
readonly userConfigDirs?: readonly string[];
|
|
5867
|
+
/** System-scope config roots for discovery (defaults to `[]`). */
|
|
5868
|
+
readonly systemConfigDirs?: readonly string[];
|
|
5869
|
+
}
|
|
5870
|
+
/**
|
|
5871
|
+
* Error thrown by adapter implementations that model process exit as an
|
|
5872
|
+
* exception instead of terminating immediately.
|
|
5873
|
+
*
|
|
5874
|
+
* Runtime and CLI dispatch layers can catch this to perform real process
|
|
5875
|
+
* termination, while tests can assert on exit codes without killing the
|
|
5876
|
+
* runner:
|
|
5877
|
+
*
|
|
5878
|
+
* ```ts
|
|
5879
|
+
* try {
|
|
5880
|
+
* await cli.run({ adapter: createTestAdapter() });
|
|
5881
|
+
* } catch (e) {
|
|
5882
|
+
* if (e instanceof ExitError) expect(e.code).toBe(0);
|
|
5883
|
+
* }
|
|
5884
|
+
* ```
|
|
5885
|
+
*/
|
|
5886
|
+
declare class ExitError extends Error {
|
|
5887
|
+
/** Error name — always `'ExitError'` for `instanceof` checks. */
|
|
5888
|
+
readonly name = "ExitError";
|
|
5889
|
+
/** The exit code passed to `exit()`. */
|
|
5890
|
+
readonly code: number;
|
|
5891
|
+
/** Create an ExitError for the given process exit code. */
|
|
5892
|
+
constructor(code: number);
|
|
5893
|
+
}
|
|
5894
|
+
/**
|
|
5895
|
+
* Create a test runtime adapter with injectable process state.
|
|
5896
|
+
*
|
|
5897
|
+
* Use this in `@kjanat/dreamcli/testkit` tests when you need to simulate argv,
|
|
5898
|
+
* environment variables, TTY state, stdin, or config-file reads without
|
|
5899
|
+
* touching the host process.
|
|
5900
|
+
*
|
|
5901
|
+
* @param options - Optional overrides for any adapter field.
|
|
5902
|
+
* @returns A {@linkcode RuntimeAdapter} suitable for test scenarios.
|
|
5903
|
+
*
|
|
5904
|
+
* @example
|
|
5905
|
+
* ```ts
|
|
5906
|
+
* const adapter = createTestAdapter({
|
|
5907
|
+
* argv: ['node', 'cli.js', 'deploy', '--force'],
|
|
5908
|
+
* env: { DEPLOY_REGION: 'us' },
|
|
5909
|
+
* });
|
|
5910
|
+
*
|
|
5911
|
+
* const result = await cli('mycli').run({ adapter });
|
|
5912
|
+
* ```
|
|
5913
|
+
*/
|
|
5914
|
+
declare function createTestAdapter(options?: TestAdapterOptions): RuntimeAdapter;
|
|
5327
5915
|
/**
|
|
5328
5916
|
* Minimal I/O seam — the only write primitive the output module depends on.
|
|
5329
5917
|
*
|
|
@@ -5353,8 +5941,6 @@ declare function resolvePromptConfig(config: PromptConfig, enumValues: readonly
|
|
|
5353
5941
|
* ```
|
|
5354
5942
|
*/
|
|
5355
5943
|
type WriteFn = (data: string) => void;
|
|
5356
|
-
//#endregion
|
|
5357
|
-
//#region src/core/output/index.d.ts
|
|
5358
5944
|
/**
|
|
5359
5945
|
* Configuration for creating an output channel.
|
|
5360
5946
|
*
|
|
@@ -5379,6 +5965,12 @@ interface OutputOptions {
|
|
|
5379
5965
|
* Defaults to `false` (safe default — non-TTY until proven otherwise).
|
|
5380
5966
|
*/
|
|
5381
5967
|
readonly isTTY?: boolean;
|
|
5968
|
+
/**
|
|
5969
|
+
* Read the terminal's current dimensions before concurrent activity redraws.
|
|
5970
|
+
* `.run()` supplies the runtime adapter's getter. Without usable dimensions,
|
|
5971
|
+
* concurrent activities emit static start and completion messages.
|
|
5972
|
+
*/
|
|
5973
|
+
readonly getTerminalSize?: () => TerminalSize | undefined;
|
|
5382
5974
|
/**
|
|
5383
5975
|
* Verbosity level.
|
|
5384
5976
|
* - `'normal'` (default) — emit all messages
|
|
@@ -5498,5 +6090,4 @@ interface CapturedOutput {
|
|
|
5498
6090
|
* ```
|
|
5499
6091
|
*/
|
|
5500
6092
|
declare function createCaptureOutput(options?: Omit<OutputOptions, 'stdout' | 'stderr'>): [out: Out, captured: CapturedOutput];
|
|
5501
|
-
|
|
5502
|
-
export { ArgDefinitionOverrides as $, StringElementConfig as $t, Out as A, PasswordPromptConfig as An, BooleanFlagDefinition as At, MiddlewareHandler as B, HelpTheme as Bn, FlagDefinitionByKind as Bt, ErasedActionHandler as C, StandardSchemaV1Props as Cn, SourceSplitBinding as Ct, InteractiveParams as D, ConfirmPromptConfig as Dn, SplitPolicy as Dt, ExecutionStep as E, StandardSchemaV1Types as En, SplitOptions as Et, InputSources as F, SelectChoice as Fn, EnumFlagDefinition as Ft, prompt as G, ProgressOptions as Gn, FlagParseFn as Gt, middleware as H, ActivityEvent as Hn, FlagFactory as Ht, ResolutionProvenance as I, SelectPromptConfig as In, FlagBuilder as It, ArgConfig as J, TableColumn as Jn, InferFlag as Jt, Verbosity as K, SpinnerHandle as Kn, FlagPresence as Kt, SourcesOf as L, NumberConstraintViolation as Ln, FlagConfig as Lt, createCommandSchema as M, PromptConfigBase as Mn, CustomFlagDefinition as Mt, group as N, PromptKind as Nn, DefaultValueOptions as Nt, InteractiveResolver as O, InputPromptConfig as On, SplitSetting as Ot, resolveExampleCommand as P, PromptResult as Pn, DuplicatePolicy as Pt, ArgDefinitionByKind as Q, schemaBrand as Qn, ResolvedValue as Qt, wasExplicit as R, NumberConstraints as Rn, FlagDefinition as Rt, DeriveParams as S, StandardSchemaV1PathSegment as Sn, SPLIT_FORMATS as St, ExampleMeta as T, StandardSchemaV1SuccessResult as Tn, SplitFormat as Tt, Ask as U, Fallback as Un, FlagKind as Ut, MiddlewareParams as V, HelpThemeFactory as Vn, FlagDefinitionOverrides as Vt, InferPrompt as W, ProgressHandle as Wn, FlagNegation as Wt, ArgDefinition as X, TableOptions as Xn, KeyValueFlagDefinition as Xt, ArgDefaultValue as Y, TableFormat as Yn, InferFlags as Yt, ArgDefinitionBase as Z, TableStream as Zn, NumberFlagDefinition as Zt, CommandDefinition as _, InferStandardOutput as _n, WithoutArgElementEligibility as _t, WriteFn as a, getFlagNegatedName as an, BooleanArgDefinition as at, CommandSchema as b, StandardSchemaV1Issue as bn, DUPLICATE_KEYS as bt, ResolvedMultiselectPromptConfig as c, PathFlagOptions as cn, InferArg as ct, resolvePromptConfig as d, StringConstraints as dn, NumberArgDefinition as dt, StringFlagDefinition as en, ArgFactory as et, ActionHandler as f, StdinBinding as fn, ResolvedArgValue as ft, CommandBuilder as g, InferStandardInput as gn, WithVariadic as gt, CommandArgEntryDefinition as h, StdinWhen as hn, WithArgPresence as ht, createOutput as i, flag as in, ArgSchema as it, command as j, PromptConfig as jn, CountFlagDefinition as jt, InteractiveResult as k, MultiselectPromptConfig as kn, ArrayFlagDefinition as kt, ResolvedPromptConfig as l, UrlFlagOptions as ln, InferArgs as lt, CommandArgEntry as m, StdinOptions as mn, StringArgElementConfig as mt, OutputOptions as n, WithoutElementEligibility as nn, ArgParseFn as nt, PromptEngine as o, DateFlagOptions as on, CustomArgDefinition as ot, ActionParams as p, StdinConsume as pn, StringArgDefinition as pt, ArgBuilder as q, SpinnerOptions as qn, FlagSchema as qt, createCaptureOutput as r, createFlagSchema as rn, ArgPresence as rt, ReadFn as s, PathChecks as sn, EnumArgDefinition as st, CapturedOutput as t, WithPresence as tn, ArgKind as tt, ResolvedSelectPromptConfig as u, StringConstraintViolation as un, KeyValueArgDefinition as ut, CommandExample as v, StandardSchemaV1 as vn, arg as vt, ExampleCommand as w, StandardSchemaV1Result as wn, SplitBinding as wt, DeriveHandler as x, StandardSchemaV1Options as xn, DuplicateKeys as xt, CommandMeta as y, StandardSchemaV1FailureResult as yn, createArgSchema as yt, Middleware as z, HelpDescription as zn, FlagDefinitionBase as zt };
|
|
6093
|
+
export { ArgConfig as $, ActivityEvent as $n, InferFlag as $t, ExampleMeta as A, StandardSchemaV1SuccessResult as An, SplitFormat as At, InputSources as B, SelectChoice as Bn, EnumFlagDefinition as Bt, CommandExample as C, StandardSchemaV1 as Cn, arg as Ct, DeriveParams as D, StandardSchemaV1PathSegment as Dn, SPLIT_FORMATS as Dt, DeriveHandler as E, StandardSchemaV1Options as En, DuplicateKeys as Et, Out as F, PasswordPromptConfig as Fn, BooleanFlagDefinition as Ft, MiddlewareHandler as G, IndexedEnvBinding as Gn, FlagDefinitionByKind as Gt, SourcesOf as H, NumberConstraintViolation as Hn, FlagConfig as Ht, command as I, PromptConfig as In, CountFlagDefinition as It, Ask as J, CompletionContext as Jn, FlagKind as Jt, MiddlewareParams as K, IndexedRecordEnvBinding as Kn, FlagDefinitionOverrides as Kt, createCommandSchema as L, PromptConfigBase as Ln, CustomFlagDefinition as Lt, InteractiveParams as M, ConfirmPromptConfig as Mn, SplitPolicy as Mt, InteractiveResolver as N, InputPromptConfig as Nn, SplitSetting as Nt, ErasedActionHandler as O, StandardSchemaV1Props as On, SourceSplitBinding as Ot, InteractiveResult as P, MultiselectPromptConfig as Pn, ArrayFlagDefinition as Pt, ArgBuilder as Q, HelpThemeFactory as Qn, FlagSchema as Qt, group as R, PromptKind as Rn, DefaultValueOptions as Rt, CommandDefinition as S, InferStandardOutput as Sn, WithoutArgElementEligibility as St, CommandSchema as T, StandardSchemaV1Issue as Tn, DUPLICATE_KEYS as Tt, wasExplicit as U, NumberConstraints as Un, FlagDefinition as Ut, ResolutionProvenance as V, SelectPromptConfig as Vn, FlagBuilder as Vt, Middleware as W, EnvOptions as Wn, FlagDefinitionBase as Wt, prompt as X, HelpDescription as Xn, FlagParseFn as Xt, InferPrompt as Y, CompletionHandler as Yn, FlagNegation as Yt, Verbosity as Z, HelpTheme as Zn, FlagPresence as Zt, ActionHandler as _, StdinBinding as _n, ResolvedArgValue as _t, WriteFn as a, StringFlagDefinition as an, TableColumn as ar, ArgFactory as at, CommandArgEntryDefinition as b, StdinWhen as bn, WithArgPresence as bt, TerminalSize as c, createFlagSchema as cn, TableStream as cr, ArgPresence as ct, PromptEngine as d, DateFlagOptions as dn, CustomArgDefinition as dt, InferFlags as en, Fallback as er, ArgDefaultValue as et, ReadFn as f, PathChecks as fn, EnumArgDefinition as ft, resolvePromptConfig as g, StringConstraints as gn, NumberArgDefinition as gt, ResolvedSelectPromptConfig as h, StringConstraintViolation as hn, KeyValueArgDefinition as ht, createOutput as i, StringElementConfig as in, SpinnerOptions as ir, ArgDefinitionOverrides as it, ExecutionStep as j, StandardSchemaV1Types as jn, SplitOptions as jt, ExampleCommand as k, StandardSchemaV1Result as kn, SplitBinding as kt, TestAdapterOptions as l, flag as ln, schemaBrand as lr, ArgSchema as lt, ResolvedPromptConfig as m, UrlFlagOptions as mn, InferArgs as mt, OutputOptions as n, NumberFlagDefinition as nn, ProgressOptions as nr, ArgDefinitionBase as nt, ExitError as o, WithPresence as on, TableFormat as or, ArgKind as ot, ResolvedMultiselectPromptConfig as p, PathFlagOptions as pn, InferArg as pt, middleware as q, IndexedValueEnvBinding as qn, FlagFactory as qt, createCaptureOutput as r, ResolvedValue as rn, SpinnerHandle as rr, ArgDefinitionByKind as rt, RuntimeAdapter as s, WithoutElementEligibility as sn, TableOptions as sr, ArgParseFn as st, CapturedOutput as t, KeyValueFlagDefinition as tn, ProgressHandle as tr, ArgDefinition as tt, createTestAdapter as u, getFlagNegatedName as un, BooleanArgDefinition as ut, ActionParams as v, StdinConsume as vn, StringArgDefinition as vt, CommandMeta as w, StandardSchemaV1FailureResult as wn, createArgSchema as wt, CommandBuilder as x, InferStandardInput as xn, WithVariadic as xt, CommandArgEntry as y, StdinOptions as yn, StringArgElementConfig as yt, resolveExampleCommand as z, PromptResult as zn, DuplicatePolicy as zt };
|