@kjanat/dreamcli 5.0.0 → 5.2.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.
Files changed (42) hide show
  1. package/dist/{index-BIMjOsR6.d.mts → command-Cq6YZjEH.d.mts} +1183 -691
  2. package/dist/completion-DCWRvQjQ.mjs +59 -0
  3. package/dist/completion.d.mts +11 -1
  4. package/dist/completion.mjs +1 -1
  5. package/dist/config-CANc4lsA.mjs +1 -0
  6. package/dist/config.d.mts +12 -2
  7. package/dist/config.mjs +1 -1
  8. package/dist/core-CPh0FcFg.mjs +25 -0
  9. package/dist/dynamic-xPNS3_vL.mjs +1 -0
  10. package/dist/{index-jq_FJRKt.d.mts → index-8EiEDJfX.d.mts} +33 -7
  11. package/dist/{index-DpslpOVV.d.mts → index-BZ3jYjyh.d.mts} +18 -3
  12. package/dist/{index-hzYPRc_O.d.mts → index-Bkk86gFg.d.mts} +18 -13
  13. package/dist/{index-AIC5Gler.d.mts → index-CLg6j-KJ.d.mts} +1 -1
  14. package/dist/{index-BidVVmln.d.mts → index-DBepo8jX.d.mts} +28 -6
  15. package/dist/index.d.mts +33 -10
  16. package/dist/index.mjs +1 -1
  17. package/dist/json-schema-DmFJR8c6.mjs +59 -0
  18. package/dist/json-schema.d.mts +9 -1
  19. package/dist/json-schema.mjs +1 -1
  20. package/dist/{package-json-fYhxDdWD.mjs → package-json-hqUWeazy.mjs} +1 -1
  21. package/dist/prompt.d.mts +12 -1
  22. package/dist/prompt.mjs +1 -1
  23. package/dist/rolldown-runtime-DOYBPklu.mjs +1 -0
  24. package/dist/runtime.d.mts +20 -2
  25. package/dist/runtime.mjs +1 -1
  26. package/dist/session-BBRg9p2u.mjs +1 -0
  27. package/dist/{terminal-DRsRn4sc.mjs → terminal-mINn5p7B.mjs} +1 -1
  28. package/dist/test-prompter-BI9sA9n7.mjs +1 -0
  29. package/dist/testkit.d.mts +17 -4
  30. package/dist/testkit.mjs +1 -1
  31. package/dist/version.mjs +1 -1
  32. package/dreamcli.schema.json +186 -0
  33. package/package.json +13 -14
  34. package/skills/cli-creation/SKILL.md +1 -1
  35. package/dist/adapter-DBeedKmD.d.mts +0 -283
  36. package/dist/completion-Bh-qywmB.mjs +0 -6
  37. package/dist/config-DruA8aFV.mjs +0 -1
  38. package/dist/core-B9YNSJeA.mjs +0 -19
  39. package/dist/json-schema-DF5fXdKQ.mjs +0 -59
  40. package/dist/rolldown-runtime-G4Kt5YOX.mjs +0 -1
  41. package/dist/session-Crtzt7LY.mjs +0 -1
  42. package/dist/test-prompter-BLNGCOA_.mjs +0 -1
@@ -1,4 +1,4 @@
1
- import { n as RuntimeAdapter } from "./adapter-DBeedKmD.mjs";
1
+ import { L as RuntimeAdapter } from "./command-Cq6YZjEH.mjs";
2
2
  /**
3
3
  * Object form of a manifest's `repository` field
4
4
  * (e.g. `{"type":"git","url":"git+https://github.com/u/r.git"}`).
@@ -197,6 +197,20 @@ interface FormatLoader {
197
197
  */
198
198
  readonly parse: (content: string) => unknown;
199
199
  }
200
+ /** Load an existing config file by path. Its result must be a plain object. */
201
+ interface PathConfigLoader {
202
+ /** File extensions this loader handles, without leading dots. */
203
+ readonly extensions: readonly string[];
204
+ /** Load the selected file, synchronously or asynchronously. Failures become `CONFIG_PARSE_ERROR`. */
205
+ readonly load: (path: string, adapter: ConfigAdapter) => unknown;
206
+ }
207
+ /** A text parser or a path-based config loader. */
208
+ type ConfigLoader = FormatLoader | PathConfigLoader;
209
+ /** Extension options for {@link configModule}. */
210
+ interface ConfigModuleOptions {
211
+ /** Also discover `.ts`, `.mts`, and `.cts` modules using the runtime's TypeScript support. */
212
+ readonly typescript?: boolean;
213
+ }
200
214
  /** Options for {@link discoverConfig}. */
201
215
  interface ConfigDiscoveryOptions {
202
216
  /**
@@ -208,7 +222,7 @@ interface ConfigDiscoveryOptions {
208
222
  * Additional format loaders (JSON is built-in).
209
223
  * Later loaders for the same extension win (allows override).
210
224
  */
211
- readonly loaders?: readonly FormatLoader[];
225
+ readonly loaders?: readonly ConfigLoader[];
212
226
  /**
213
227
  * Custom search paths (absolute).
214
228
  * Replaces the default search paths when provided.
@@ -256,8 +270,8 @@ interface ConfigSearchPathOptions {
256
270
  * @defaultValue `[]`
257
271
  */
258
272
  readonly systemConfigDirs?: readonly string[];
259
- /** Custom {@link FormatLoader}s whose extensions expand the search set. */
260
- readonly loaders?: readonly FormatLoader[];
273
+ /** Custom {@link ConfigLoader}s whose extensions expand the search set. */
274
+ readonly loaders?: readonly ConfigLoader[];
261
275
  }
262
276
  /**
263
277
  * Build the default config search paths for an app.
@@ -300,7 +314,7 @@ declare function buildConfigSearchPaths(appName: string, options: ConfigSearchPa
300
314
  * Exported so custom hosts and tests can type the minimal adapter required by
301
315
  * {@link discoverConfig} without depending on the full runtime adapter shape.
302
316
  */
303
- type ConfigAdapter = Pick<RuntimeAdapter, 'readFile' | 'cwd' | 'configDir'> & Partial<Pick<RuntimeAdapter, 'userConfigDirs' | 'systemConfigDirs'>>;
317
+ type ConfigAdapter = Pick<RuntimeAdapter, 'readFile' | 'cwd' | 'configDir'> & Partial<Pick<RuntimeAdapter, 'userConfigDirs' | 'systemConfigDirs' | 'importConfigModule'>>;
304
318
  /**
305
319
  * Discover and load a config file.
306
320
  *
@@ -308,7 +322,7 @@ type ConfigAdapter = Pick<RuntimeAdapter, 'readFile' | 'cwd' | 'configDir'> & Pa
308
322
  * let the CLI runtime call this automatically; call it directly when testing
309
323
  * config behavior or building custom bootstrapping around {@linkcode RuntimeAdapter}.
310
324
  *
311
- * Pure function — all filesystem I/O flows through `adapter.readFile`.
325
+ * Probes candidates with `adapter.readFile` and invokes the selected loader.
312
326
  * Returns a discriminated union: `{ found: true, ... }` when a config
313
327
  * file was found and parsed, `{ found: false }` when no file exists.
314
328
  *
@@ -361,4 +375,16 @@ declare function discoverConfig(appName: string, adapter: ConfigAdapter, options
361
375
  * ```
362
376
  */
363
377
  declare function configFormat(extensions: readonly string[], parse: (content: string) => unknown): FormatLoader;
364
- export { discoverManifest as _, ConfigNotFound as a, buildConfigSearchPaths as c, PackageRepositoryUrlOptions as d, packageRepositoryUrl as f, PackageRepository as g, PackageJsonData as h, ConfigFound as i, configFormat as l, PackageJsonAdapter as m, ConfigDiscoveryOptions as n, ConfigSearchPathOptions as o, ManifestDiscoveryOptions as p, ConfigDiscoveryResult as r, FormatLoader as s, ConfigAdapter as t, discoverConfig as u, inferCliName as v };
378
+ /**
379
+ * Opt in to executable config files that export a plain object as their default export.
380
+ * Registers `.mjs`, `.cjs`, and `.js`. Pass `{ typescript: true }` to also register
381
+ * `.ts`, `.mts`, and `.cts`. Module format and supported TS syntax follow the host runtime.
382
+ * Only register this loader when you trust the files at your CLI's config search locations.
383
+ *
384
+ * @example
385
+ * ```ts
386
+ * cli('myapp').config('myapp', [configModule({ typescript: true })]);
387
+ * ```
388
+ */
389
+ declare function configModule(options?: ConfigModuleOptions): PathConfigLoader;
390
+ export { inferCliName as S, ManifestDiscoveryOptions as _, ConfigLoader as a, PackageRepository as b, ConfigSearchPathOptions as c, buildConfigSearchPaths as d, configFormat as f, packageRepositoryUrl as g, PackageRepositoryUrlOptions as h, ConfigFound as i, FormatLoader as l, discoverConfig as m, ConfigDiscoveryOptions as n, ConfigModuleOptions as o, configModule as p, ConfigDiscoveryResult as r, ConfigNotFound as s, ConfigAdapter as t, PathConfigLoader as u, PackageJsonAdapter as v, discoverManifest as x, PackageJsonData as y };
@@ -1,4 +1,4 @@
1
- import { A as Out, Gn as HelpThemeFactory, I as ResolutionProvenance, K as Verbosity, Kn as ActivityEvent, b as CommandSchema, nr as schemaBrand, o as PromptEngine, sn as PathChecks, y as CommandMeta } from "./index-BIMjOsR6.mjs";
1
+ import { R as TerminalSize, T as ResolutionProvenance, V as PromptEngine, c as CommandMeta, gn as PathChecks, l as CommandSchema, nr as HelpThemeFactory, pr as schemaBrand, rr as ActivityEvent, tt as Verbosity, y as Out } from "./command-Cq6YZjEH.mjs";
2
2
  import { t as CLIError } from "./index-D683D09G.mjs";
3
3
  import { Colors } from "ansispeck";
4
4
  /** A built-in flag a consumer can take over. */
@@ -424,7 +424,7 @@ interface HelpOptions {
424
424
  /** Program version passed to function-form examples as `meta.version`. */
425
425
  readonly version?: string;
426
426
  /**
427
- * Order of flags in the `Flags:` table.
427
+ * Order of flags within each help section.
428
428
  *
429
429
  * - `'alphabetical'` — short-aliased flags first, then alphabetical by name.
430
430
  * - `'declaration'` — the order `.flag()` was called.
@@ -435,12 +435,19 @@ interface HelpOptions {
435
435
  */
436
436
  readonly flagOrder?: 'alphabetical' | 'declaration';
437
437
  /**
438
- * Custom comparator over flag long names for the `Flags:` table. When set,
438
+ * Custom comparator over flag long names within each help section. When set,
439
439
  * it wins over {@link HelpOptions.flagOrder}.
440
440
  *
441
441
  * @defaultValue `undefined` (use `flagOrder`)
442
442
  */
443
443
  readonly sortFlags?: (a: string, b: string) => number;
444
+ /**
445
+ * Named argument and flag groups to show first, in order. Remaining named
446
+ * groups follow declaration order within each input kind.
447
+ */
448
+ readonly groupOrder?: readonly string[];
449
+ /** Include flags marked as advanced. */
450
+ readonly showAdvanced?: boolean;
444
451
  /**
445
452
  * Spelling of long flag names, aliases, and negations in the `Flags:` table.
446
453
  *
@@ -767,6 +774,14 @@ interface RunOptions {
767
774
  * @defaultValue `false`
768
775
  */
769
776
  readonly isTTY?: boolean;
777
+ /** Terminal dimensions to expose on the output channel. `.run()` defaults to the adapter size. */
778
+ readonly terminalSize?: TerminalSize;
779
+ /**
780
+ * Explicitly enable or disable ANSI color, overriding automatic selection.
781
+ * Otherwise, `env.NO_COLOR` disables color and `env.FORCE_COLOR` enables it
782
+ * unless set to `'0'`. With neither set, color follows `isTTY` outside JSON mode.
783
+ */
784
+ readonly color?: boolean;
770
785
  /**
771
786
  * Help formatting options (width, binName).
772
787
  * Used when `--help` is detected.
@@ -1,7 +1,6 @@
1
- import { C as ErasedActionHandler, E as ExecutionStep, Gn as HelpThemeFactory, It as FlagBuilder, J as ArgConfig, K as Verbosity, Lt as FlagConfig, _ as CommandDefinition, b as CommandSchema, g as CommandBuilder, nr as schemaBrand, q as ArgBuilder } from "./index-BIMjOsR6.mjs";
2
- import { A as Builtins, j as BuiltinsConfig, n as RunResult, t as RunOptions, u as CLIPlugin, x as ParseOptions } from "./index-DpslpOVV.mjs";
3
- import { n as RuntimeAdapter } from "./adapter-DBeedKmD.mjs";
4
- import { h as PackageJsonData, s as FormatLoader } from "./index-jq_FJRKt.mjs";
1
+ import { A as Builtins, j as BuiltinsConfig, n as RunResult, t as RunOptions, u as CLIPlugin, x as ParseOptions } from "./index-BZ3jYjyh.mjs";
2
+ import { Gt as FlagBuilder, Kt as FlagConfig, L as RuntimeAdapter, a as CommandBuilder, f as ErasedActionHandler, h as ExecutionStep, l as CommandSchema, nr as HelpThemeFactory, nt as ArgBuilder, o as CommandDefinition, pr as schemaBrand, rt as ArgConfig, tt as Verbosity } from "./command-Cq6YZjEH.mjs";
3
+ import { a as ConfigLoader, y as PackageJsonData } from "./index-8EiEDJfX.mjs";
5
4
  import { Colors } from "ansispeck";
6
5
  /**
7
6
  * Options for completion script generation.
@@ -264,7 +263,7 @@ interface HelpConfig {
264
263
  /** Emit OSC 8 hyperlinks in the header when supported. */
265
264
  readonly hyperlinks?: boolean;
266
265
  /**
267
- * Order of flags in the `Flags:` table.
266
+ * Order of flags within each help section.
268
267
  *
269
268
  * - `'alphabetical'` — short-aliased flags first, then alphabetical by name.
270
269
  * - `'declaration'` — the order `.flag()` was called.
@@ -275,12 +274,17 @@ interface HelpConfig {
275
274
  */
276
275
  readonly flagOrder?: 'alphabetical' | 'declaration';
277
276
  /**
278
- * Custom comparator over flag long names for the `Flags:` table. When set,
277
+ * Custom comparator over flag long names within each help section. When set,
279
278
  * it wins over {@link HelpConfig.flagOrder}.
280
279
  *
281
280
  * @defaultValue `undefined` (use `flagOrder`)
282
281
  */
283
282
  readonly sortFlags?: (a: string, b: string) => number;
283
+ /**
284
+ * Named argument and flag groups to show first, in order. Remaining named
285
+ * groups follow declaration order within each input kind.
286
+ */
287
+ readonly groupOrder?: readonly string[];
284
288
  /**
285
289
  * Spelling of long flag names, aliases, and negations in the `Flags:` table.
286
290
  *
@@ -330,7 +334,7 @@ interface ConfigSettings {
330
334
  */
331
335
  readonly appName: string;
332
336
  /** Additional format loaders beyond the built-in JSON loader. */
333
- readonly loaders: readonly FormatLoader[] | undefined;
337
+ readonly loaders: readonly ConfigLoader[] | undefined;
334
338
  }
335
339
  /**
336
340
  * Manifest auto-discovery settings — the resolved/normalized shape stored in
@@ -405,7 +409,7 @@ interface ConfigSettingsDefinition {
405
409
  * Additional format loaders beyond the built-in JSON loader.
406
410
  * @defaultValue `undefined`
407
411
  */
408
- readonly loaders?: readonly FormatLoader[] | undefined;
412
+ readonly loaders?: readonly ConfigLoader[] | undefined;
409
413
  }
410
414
  /**
411
415
  * Input shape accepted by {@link createCLISchema}.
@@ -589,7 +593,8 @@ interface RenderContextOptions {
589
593
  */
590
594
  readonly color?: boolean;
591
595
  /**
592
- * Environment variables consulted for `NO_HYPERLINKS`/`FORCE_HYPERLINKS`
596
+ * Environment variables consulted for `NO_COLOR`/`FORCE_COLOR` and
597
+ * `NO_HYPERLINKS`/`FORCE_HYPERLINKS`
593
598
  * (e.g. `process.env`).
594
599
  *
595
600
  * @defaultValue `{}`
@@ -906,14 +911,14 @@ declare class CLIBuilder {
906
911
  * `options.config` directly).
907
912
  *
908
913
  * @param appName - Name used to build search paths.
909
- * @param loaders - Additional {@link FormatLoader}s (JSON is built-in).
914
+ * @param loaders - Additional {@link ConfigLoader}s (JSON is built-in).
910
915
  * @returns The builder (for chaining).
911
916
  */
912
- config(appName: string, loaders?: readonly FormatLoader[]): CLIBuilder;
917
+ config(appName: string, loaders?: readonly ConfigLoader[]): CLIBuilder;
913
918
  /**
914
919
  * Register a custom config format loader.
915
920
  *
916
- * Adds a {@link FormatLoader} incrementally — call multiple times to
921
+ * Adds a {@link ConfigLoader} incrementally — call multiple times to
917
922
  * register multiple formats. Loaders registered later for the same
918
923
  * extension override earlier ones.
919
924
  *
@@ -946,7 +951,7 @@ declare class CLIBuilder {
946
951
  * .run();
947
952
  * ```
948
953
  */
949
- configLoader(loader: FormatLoader): CLIBuilder;
954
+ configLoader(loader: ConfigLoader): CLIBuilder;
950
955
  /**
951
956
  * Enable manifest metadata from pre-loaded data.
952
957
  *
@@ -1,4 +1,4 @@
1
- import { n as RuntimeAdapter } from "./adapter-DBeedKmD.mjs";
1
+ import { L as RuntimeAdapter } from "./command-Cq6YZjEH.mjs";
2
2
  /**
3
3
  * Auto-detects the current JavaScript runtime environment.
4
4
  *
@@ -1,6 +1,6 @@
1
- import { Kt as FlagPresence, Nn as PromptKind, Pt as DuplicatePolicy, Rn as NumberConstraints, T as ExampleMeta, Ut as FlagKind, b as CommandSchema, rt as ArgPresence, tt as ArgKind, xt as DuplicateKeys } from "./index-BIMjOsR6.mjs";
2
- import "./index-DpslpOVV.mjs";
3
- import { o as CLISchema } from "./index-hzYPRc_O.mjs";
1
+ import { At as DuplicateKeys, Hn as PromptKind, M as CommandConstraint, Qt as FlagKind, Ut as DuplicatePolicy, ft as ArgPresence, l as CommandSchema, m as ExampleMeta, qn as NumberConstraints, tn as FlagPresence, ut as ArgKind } from "./command-Cq6YZjEH.mjs";
2
+ import "./index-BZ3jYjyh.mjs";
3
+ import { o as CLISchema } from "./index-Bkk86gFg.mjs";
4
4
  /**
5
5
  * Identifiers of the definition document format.
6
6
  *
@@ -63,7 +63,12 @@ interface JsonSchemaOptions {
63
63
  *
64
64
  * @defaultValue the CLI's `envPrefix` for {@link generateSchema}, none otherwise
65
65
  */
66
- readonly envPrefix?: string;
66
+ readonly envPrefix?: string | undefined;
67
+ /**
68
+ * Named help groups to display first, in order. Defaults to the CLI help
69
+ * configuration for {@link generateSchema} and declaration order otherwise.
70
+ */
71
+ readonly groupOrder?: readonly string[] | undefined;
67
72
  }
68
73
  /**
69
74
  * A usage example inside a definition document.
@@ -100,13 +105,14 @@ type PromptDefinitionFragmentV1 = { [K in PromptKind]: {
100
105
  /**
101
106
  * Stdin binding of a flag or arg fragment.
102
107
  *
103
- * Every field is always written, so a document states the trigger, the sharing
104
- * mode, and the trimming without a reader having to know the builder's defaults.
108
+ * The trigger, sharing mode, and trimming are always written. `argv` is written
109
+ * only when false, preserving the default command-line behavior of older documents.
105
110
  */
106
111
  type StdinBindingFragmentV1 = {
107
112
  readonly when: 'dash' | 'missing' | 'dash-or-missing';
108
113
  readonly consume: 'exclusive' | 'broadcast';
109
114
  readonly trim: boolean;
115
+ readonly argv?: false;
110
116
  };
111
117
  /**
112
118
  * How one source's text decodes into collection elements.
@@ -209,6 +215,10 @@ type FlagElementFragmentV1 = {
209
215
  type FlagDefinitionFragmentV1 = FlagElementFragmentV1 & {
210
216
  readonly defaultDescription?: string | false;
211
217
  readonly sensitive?: true;
218
+ /** Named options section in command help. */
219
+ readonly group?: string;
220
+ /** Whether the flag is shown only in full text help. */
221
+ readonly advanced?: true;
212
222
  };
213
223
  /**
214
224
  * The supported value-axis fields of an entries arg's `elementSchema`.
@@ -242,6 +252,8 @@ type ArgDefinitionFragmentV1 = {
242
252
  readonly defaultDescription?: string | false;
243
253
  readonly sensitive?: true;
244
254
  readonly description?: string;
255
+ /** Named arguments section in command help. */
256
+ readonly group?: string;
245
257
  readonly envVar?: string;
246
258
  readonly envIndexed?: EnvIndexedFragmentV1;
247
259
  readonly envAbsolute?: true;
@@ -270,6 +282,8 @@ type CommandDefinitionFragmentV1 = {
270
282
  readonly name: string;
271
283
  /** Human-readable description for help text. */
272
284
  readonly description?: string;
285
+ /** Longer explanation shown only in this command's help. */
286
+ readonly details?: string;
273
287
  /** Alternative names accepted for this command. */
274
288
  readonly aliases?: readonly string[];
275
289
  /** Whether the command is omitted from help listings. */
@@ -278,8 +292,12 @@ type CommandDefinitionFragmentV1 = {
278
292
  readonly examples?: readonly ExampleDefinitionFragmentV1[];
279
293
  /** Named flag definitions keyed by flag name. */
280
294
  readonly flags: Readonly<Record<string, FlagDefinitionFragmentV1>>;
295
+ /** Flag declaration order when it differs from the flag record's key order. */
296
+ readonly flagDeclarationOrder?: readonly string[];
281
297
  /** Positional argument definitions in CLI order. */
282
298
  readonly args: readonly ArgDefinitionFragmentV1[];
299
+ /** Declarative relationships between the command's inputs. */
300
+ readonly constraints?: readonly CommandConstraint[];
283
301
  /** Nested subcommand definitions. */
284
302
  readonly commands: readonly CommandDefinitionFragmentV1[];
285
303
  };
@@ -301,6 +319,8 @@ type DefinitionDocumentV1 = {
301
319
  * fragment marked `envAbsolute` reads its names as written.
302
320
  */
303
321
  readonly envPrefix?: string;
322
+ /** Named help groups to display first, in order. */
323
+ readonly groupOrder?: readonly string[];
304
324
  readonly defaultCommand?: CommandDefinitionFragmentV1;
305
325
  readonly commands: readonly CommandDefinitionFragmentV1[];
306
326
  };
@@ -319,6 +339,8 @@ type CommandDefinitionDocumentV1 = CommandDefinitionFragmentV1 & {
319
339
  * {@link DefinitionDocumentV1.envPrefix}.
320
340
  */
321
341
  readonly envPrefix?: string;
342
+ /** Named help groups to display first, in order, for this command. */
343
+ readonly groupOrder?: readonly string[];
322
344
  };
323
345
  /** The current whole-CLI definition document. */
324
346
  type DefinitionDocument = DefinitionDocumentV1;
package/dist/index.d.mts CHANGED
@@ -1,10 +1,33 @@
1
- import { $ as ArgDefinitionOverrides, $n as TableFormat, $t as StringElementConfig, A as Out, An as PasswordPromptConfig, At as BooleanFlagDefinition, B as MiddlewareHandler, Bn as IndexedEnvBinding, Bt as FlagDefinitionByKind, Cn as StandardSchemaV1Props, Ct as SourceSplitBinding, D as InteractiveParams, Dn as ConfirmPromptConfig, Dt as SplitPolicy, En as StandardSchemaV1Types, Et as SplitOptions, F as InputSources, Fn as SelectChoice, Ft as EnumFlagDefinition, Gn as HelpThemeFactory, Gt as FlagParseFn, H as middleware, Hn as IndexedValueEnvBinding, Ht as FlagFactory, I as ResolutionProvenance, In as SelectPromptConfig, It as FlagBuilder, J as ArgConfig, Jn as ProgressHandle, Jt as InferFlag, K as Verbosity, Kn as ActivityEvent, Kt as FlagPresence, L as SourcesOf, Ln as NumberConstraintViolation, Lt as FlagConfig, M as createCommandSchema, Mn as PromptConfigBase, Mt as CustomFlagDefinition, N as group, Nn as PromptKind, Nt as DefaultValueOptions, O as InteractiveResolver, On as InputPromptConfig, Ot as SplitSetting, P as resolveExampleCommand, Pn as PromptResult, Pt as DuplicatePolicy, Q as ArgDefinitionByKind, Qn as TableColumn, Qt as ResolvedValue, R as wasExplicit, Rn as NumberConstraints, Rt as FlagDefinition, S as DeriveParams, Sn as StandardSchemaV1PathSegment, St as SPLIT_FORMATS, T as ExampleMeta, Tn as StandardSchemaV1SuccessResult, Tt as SplitFormat, U as Ask, Un as HelpDescription, Ut as FlagKind, V as MiddlewareParams, Vn as IndexedRecordEnvBinding, Vt as FlagDefinitionOverrides, W as InferPrompt, Wn as HelpTheme, Wt as FlagNegation, X as ArgDefinition, Xn as SpinnerHandle, Xt as KeyValueFlagDefinition, Y as ArgDefaultValue, Yn as ProgressOptions, Yt as InferFlags, Z as ArgDefinitionBase, Zn as SpinnerOptions, Zt as NumberFlagDefinition, _ as CommandDefinition, _n as InferStandardOutput, _t as WithoutArgElementEligibility, a as WriteFn, an as getFlagNegatedName, at as BooleanArgDefinition, b as CommandSchema, bn as StandardSchemaV1Issue, bt as DUPLICATE_KEYS, c as ResolvedMultiselectPromptConfig, cn as PathFlagOptions, ct as InferArg, d as resolvePromptConfig, dn as StringConstraints, dt as NumberArgDefinition, en as StringFlagDefinition, er as TableOptions, et as ArgFactory, f as ActionHandler, fn as StdinBinding, ft as ResolvedArgValue, g as CommandBuilder, gn as InferStandardInput, gt as WithVariadic, h as CommandArgEntryDefinition, hn as StdinWhen, ht as WithArgPresence, i as createOutput, in as flag, it as ArgSchema, j as command, jn as PromptConfig, jt as CountFlagDefinition, k as InteractiveResult, kn as MultiselectPromptConfig, kt as ArrayFlagDefinition, l as ResolvedPromptConfig, ln as UrlFlagOptions, lt as InferArgs, m as CommandArgEntry, mn as StdinOptions, mt as StringArgElementConfig, n as OutputOptions, nn as WithoutElementEligibility, nt as ArgParseFn, o as PromptEngine, on as DateFlagOptions, ot as CustomArgDefinition, p as ActionParams, pn as StdinConsume, pt as StringArgDefinition, q as ArgBuilder, qn as Fallback, qt as FlagSchema, rn as createFlagSchema, rt as ArgPresence, s as ReadFn, sn as PathChecks, st as EnumArgDefinition, tn as WithPresence, tr as TableStream, tt as ArgKind, u as ResolvedSelectPromptConfig, un as StringConstraintViolation, ut as KeyValueArgDefinition, v as CommandExample, vn as StandardSchemaV1, vt as arg, w as ExampleCommand, wn as StandardSchemaV1Result, wt as SplitBinding, x as DeriveHandler, xn as StandardSchemaV1Options, xt as DuplicateKeys, y as CommandMeta, yn as StandardSchemaV1FailureResult, yt as createArgSchema, z as Middleware, zn as EnvOptions, zt as FlagDefinitionBase } from "./index-BIMjOsR6.mjs";
2
- import { A as Builtins, C as Token, D as tokenize, E as stripBeforeSeparator, O as BuiltinMode, S as ParseResult, T as parse, _ as ResolutionProvenanceRecord, b as SkippedPathCheck, c as formatHelp, d as CLIPluginHooks, f as PluginCommandContext, g as DeprecationWarning, h as resolve, j as BuiltinsConfig, k as BuiltinName, l as BeforeParseParams, m as plugin, n as RunResult, p as ResolvedCommandParams, s as HelpOptions, u as CLIPlugin, v as ResolveOptions, w as includesBeforeSeparator, x as ParseOptions, y as ResolveResult } from "./index-DpslpOVV.mjs";
1
+ /**
2
+ * DreamCLI — Schema-first, fully typed TypeScript CLI framework.
3
+ *
4
+ * Start here for most applications:
5
+ * - {@link cli} to define a program
6
+ * - {@link command} to define commands and groups
7
+ * - {@link flag} and {@link arg} to describe inputs
8
+ *
9
+ * This root entrypoint also re-exports lower-level building blocks such as
10
+ * parsing, resolution, and help formatting. Those are useful for advanced
11
+ * integrations, custom tooling, or focused tests, but they are not the
12
+ * typical starting point for application code.
13
+ *
14
+ * Optional features live on their own subpaths and the builder loads them on
15
+ * demand: completion scripts (`@kjanat/dreamcli/completion`), definition and
16
+ * input schemas (`@kjanat/dreamcli/json-schema`), config and manifest
17
+ * discovery (`@kjanat/dreamcli/config`), and the terminal prompter
18
+ * (`@kjanat/dreamcli/prompt`). Test utilities (runCommand,
19
+ * createCaptureOutput, createTestPrompter, etc.) are available from
20
+ * `@kjanat/dreamcli/testkit`. Runtime adapters (createAdapter,
21
+ * RuntimeAdapter, etc.) are available from `@kjanat/dreamcli/runtime`.
22
+ *
23
+ * @module @kjanat/dreamcli
24
+ */
25
+ import { C as SHELLS, S as HelpLinks, T as CompletionOptions, _ as ResolvedManifestSettings, a as CLIRunOptions, b as isMainModule, c as CompletionsFlagConfig, d as DefaultCommandOptions, f as HelpConfig, g as RenderContextOptions, h as RenderContext, i as CLIOptions, l as ConfigSettings, m as ManifestSettings, n as CLIDefinition, o as CLISchema, p as InferNameOption, r as CLIExecuteOptions, s as CompletionRegistrationOptions, t as CLIBuilder, u as ConfigSettingsDefinition, v as cli, w as Shell, x as resolveRenderContext, y as createCLISchema } from "./index-Bkk86gFg.mjs";
26
+ import { _ as ManifestDiscoveryOptions, a as ConfigLoader, b as PackageRepository, c as ConfigSearchPathOptions, h as PackageRepositoryUrlOptions, i as ConfigFound, l as FormatLoader, n as ConfigDiscoveryOptions, o as ConfigModuleOptions, r as ConfigDiscoveryResult, s as ConfigNotFound, t as ConfigAdapter, u as PathConfigLoader, v as PackageJsonAdapter, y as PackageJsonData } from "./index-8EiEDJfX.mjs";
3
27
  import { a as ParseError, c as ValidationError, d as isCLIError, f as isParseError, i as ErrorCode, l as ValidationErrorCode, n as CLIErrorJSON, o as ParseErrorCode, p as isValidationError, r as CLIErrorOptions, s as ParseErrorOptions, t as CLIError, u as ValidationErrorOptions } from "./index-D683D09G.mjs";
4
- import { C as SHELLS, S as HelpLinks, T as CompletionOptions, _ as ResolvedManifestSettings, a as CLIRunOptions, b as isMainModule, c as CompletionsFlagConfig, d as DefaultCommandOptions, f as HelpConfig, g as RenderContextOptions, h as RenderContext, i as CLIOptions, l as ConfigSettings, m as ManifestSettings, n as CLIDefinition, o as CLISchema, p as InferNameOption, r as CLIExecuteOptions, s as CompletionRegistrationOptions, t as CLIBuilder, u as ConfigSettingsDefinition, v as cli, w as Shell, x as resolveRenderContext, y as createCLISchema } from "./index-hzYPRc_O.mjs";
5
- import { n as RuntimeAdapter } from "./adapter-DBeedKmD.mjs";
6
- import { a as ConfigNotFound, d as PackageRepositoryUrlOptions, g as PackageRepository, h as PackageJsonData, i as ConfigFound, m as PackageJsonAdapter, n as ConfigDiscoveryOptions, o as ConfigSearchPathOptions, p as ManifestDiscoveryOptions, r as ConfigDiscoveryResult, s as FormatLoader, t as ConfigAdapter } from "./index-jq_FJRKt.mjs";
7
- import { C as StdinBindingFragmentV1, O as DEFINITION_SCHEMA_URL, S as SplitPolicyFragmentV1, _ as InputSchemaProperty, a as CommandDefinitionFragmentV1, b as PromptDefinitionFragmentV1, c as EnvIndexedFragmentV1, d as FlagElementFragmentV1, f as FlagNegationFragmentV1, g as InputSchemaDocument, h as InputSchemaBranch, i as CommandDefinitionDocumentV1, k as DEFINITION_SCHEMA_VERSION, l as ExampleDefinitionFragmentV1, m as FlagStringConstraintsFragmentV1, n as ArgElementFragmentV1, o as DefinitionDocument, p as FlagPathChecksFragmentV1, r as CommandDefinitionDocument, s as DefinitionDocumentV1, t as ArgDefinitionFragmentV1, u as FlagDefinitionFragmentV1, v as JsonSchemaOptions, x as SourceSplitFragmentV1, y as PromptChoiceFragmentV1 } from "./index-BidVVmln.mjs";
28
+ import { A as Builtins, C as Token, D as tokenize, E as stripBeforeSeparator, O as BuiltinMode, S as ParseResult, T as parse, _ as ResolutionProvenanceRecord, b as SkippedPathCheck, c as formatHelp, d as CLIPluginHooks, f as PluginCommandContext, g as DeprecationWarning, h as resolve, j as BuiltinsConfig, k as BuiltinName, l as BeforeParseParams, m as plugin, n as RunResult, p as ResolvedCommandParams, s as HelpOptions, u as CLIPlugin, v as ResolveOptions, w as includesBeforeSeparator, x as ParseOptions, y as ResolveResult } from "./index-BZ3jYjyh.mjs";
29
+ import { C as StdinBindingFragmentV1, O as DEFINITION_SCHEMA_URL, S as SplitPolicyFragmentV1, _ as InputSchemaProperty, a as CommandDefinitionFragmentV1, b as PromptDefinitionFragmentV1, c as EnvIndexedFragmentV1, d as FlagElementFragmentV1, f as FlagNegationFragmentV1, g as InputSchemaDocument, h as InputSchemaBranch, i as CommandDefinitionDocumentV1, k as DEFINITION_SCHEMA_VERSION, l as ExampleDefinitionFragmentV1, m as FlagStringConstraintsFragmentV1, n as ArgElementFragmentV1, o as DefinitionDocument, p as FlagPathChecksFragmentV1, r as CommandDefinitionDocument, s as DefinitionDocumentV1, t as ArgDefinitionFragmentV1, u as FlagDefinitionFragmentV1, v as JsonSchemaOptions, x as SourceSplitFragmentV1, y as PromptChoiceFragmentV1 } from "./index-DBepo8jX.mjs";
30
+ import { $ as InferPrompt, $n as CompletionHandler, $t as FlagNegation, A as MiddlewareParams, An as StandardSchemaV1Options, At as DuplicateKeys, Bn as PromptConfig, Bt as CountFlagDefinition, C as resolveExampleCommand, Cn as StdinOptions, Ct as StringArgElementConfig, D as wasExplicit, Dn as StandardSchemaV1, Dt as arg, E as SourcesOf, En as InferStandardOutput, Et as WithoutArgElementEligibility, F as ConstraintInput, Fn as StandardSchemaV1Types, Ft as SplitOptions, G as ResolvedSelectPromptConfig, Gn as SelectPromptConfig, Gt as FlagBuilder, H as ReadFn, Hn as PromptKind, Ht as DefaultValueOptions, In as ConfirmPromptConfig, It as SplitPolicy, J as OutputOptions, Jn as EnvOptions, Jt as FlagDefinitionBase, K as resolvePromptConfig, Kn as NumberConstraintViolation, Kt as FlagConfig, L as RuntimeAdapter, Ln as InputPromptConfig, Lt as SplitSetting, M as CommandConstraint, Mn as StandardSchemaV1Props, Mt as SourceSplitBinding, N as CommandValidationOptions, Nn as StandardSchemaV1Result, Nt as SplitBinding, O as Middleware, On as StandardSchemaV1FailureResult, Ot as createArgSchema, P as ConstraintBuilder, Pn as StandardSchemaV1SuccessResult, Pt as SplitFormat, Q as Ask, Qn as CompletionContext, Qt as FlagKind, Rn as MultiselectPromptConfig, Rt as ArrayFlagDefinition, S as group, Sn as StdinConsume, St as StringArgDefinition, T as ResolutionProvenance, Tn as InferStandardInput, Tt as WithVariadic, U as ResolvedMultiselectPromptConfig, Un as PromptResult, Ut as DuplicatePolicy, V as PromptEngine, Vn as PromptConfigBase, Vt as CustomFlagDefinition, W as ResolvedPromptConfig, Wn as SelectChoice, Wt as EnumFlagDefinition, X as createOutput, Xn as IndexedRecordEnvBinding, Xt as FlagDefinitionOverrides, Yn as IndexedEnvBinding, Yt as FlagDefinitionByKind, Z as WriteFn, Zn as IndexedValueEnvBinding, Zt as FlagFactory, _ as InteractiveResolver, _n as PathFlagOptions, _t as InferArg, a as CommandBuilder, an as KeyValueFlagDefinition, ar as ProgressHandle, at as ArgDefinition, b as command, bn as StringConstraints, bt as NumberArgDefinition, c as CommandMeta, cn as StringElementConfig, cr as SpinnerOptions, ct as ArgDefinitionOverrides, d as DeriveParams, dn as WithoutElementEligibility, dr as TableOptions, dt as ArgParseFn, en as FlagParseFn, er as HelpDescription, fn as createFlagSchema, fr as TableStream, ft as ArgPresence, g as InteractiveParams, gn as PathChecks, gt as EnumArgDefinition, hn as DateFlagOptions, ht as CustomArgDefinition, i as CommandArgEntryDefinition, in as InferFlags, ir as Fallback, it as ArgDefaultValue, j as middleware, jn as StandardSchemaV1PathSegment, jt as SPLIT_FORMATS, k as MiddlewareHandler, kn as StandardSchemaV1Issue, kt as DUPLICATE_KEYS, l as CommandSchema, ln as StringFlagDefinition, lr as TableColumn, lt as ArgFactory, m as ExampleMeta, mn as getFlagNegatedName, mt as BooleanArgDefinition, n as ActionParams, nn as FlagSchema, nr as HelpThemeFactory, nt as ArgBuilder, o as CommandDefinition, on as NumberFlagDefinition, or as ProgressOptions, ot as ArgDefinitionBase, p as ExampleCommand, pn as flag, pt as ArgSchema, qn as NumberConstraints, qt as FlagDefinition, r as CommandArgEntry, rn as InferFlag, rr as ActivityEvent, rt as ArgConfig, s as CommandExample, sn as ResolvedValue, sr as SpinnerHandle, st as ArgDefinitionByKind, t as ActionHandler, tn as FlagPresence, tr as HelpTheme, tt as Verbosity, u as DeriveHandler, un as WithPresence, ur as TableFormat, ut as ArgKind, v as InteractiveResult, vn as UrlFlagOptions, vt as InferArgs, w as InputSources, wn as StdinWhen, wt as WithArgPresence, x as createCommandSchema, xn as StdinBinding, xt as ResolvedArgValue, y as Out, yn as StringConstraintViolation, yt as KeyValueArgDefinition, zn as PasswordPromptConfig, zt as BooleanFlagDefinition } from "./command-Cq6YZjEH.mjs";
8
31
  import { Colors } from "ansispeck";
9
32
  /**
10
33
  * Measure the visible column width of `text`, ignoring ANSI/OSC escapes.
@@ -87,9 +110,9 @@ interface ReadFlagsOptions<F extends FlagMap = FlagMap> extends ResolveOptions {
87
110
  */
88
111
  readonly strict?: boolean;
89
112
  /**
90
- * The built-in `--help`/`-h` handling.
113
+ * The built-in `--help`/`-h`/`--help=all` handling.
91
114
  *
92
- * While `'on'`, a pre-separator `--help` or `-h` prints generated help for
115
+ * While `'on'`, a pre-separator help flag prints generated help for
93
116
  * the definitions to the adapter's stdout and exits the process with
94
117
  * code 0. The built-in yields automatically when any definition claims the
95
118
  * `help` or `h` spelling through its name, an alias, a negated form, or a
@@ -133,7 +156,7 @@ interface ReadFlagsOptions<F extends FlagMap = FlagMap> extends ResolveOptions {
133
156
  * unknown-flag rejection, coercion, constraints, Standard Schema validators, and
134
157
  * `flag.path()` checks behave exactly as they do inside a command.
135
158
  *
136
- * A pre-separator `--help` or `-h` prints generated help to the adapter's
159
+ * A pre-separator help flag prints generated help to the adapter's
137
160
  * stdout and exits with code 0, unless {@linkcode ReadFlagsOptions.help} is
138
161
  * `'off'` or a definition claims either spelling. With
139
162
  * {@linkcode ReadFlagsOptions.strict} set to `false`, undeclared argv content
@@ -195,4 +218,4 @@ interface ReadFlagsOptions<F extends FlagMap = FlagMap> extends ResolveOptions {
195
218
  * ```
196
219
  */
197
220
  declare function readFlags<const F extends FlagMap>(definitions: F, options?: ReadFlagsOptions<F>): Promise<InferFlags<F>>;
198
- export { type ActionHandler, type ActionParams, type ActivityEvent, ArgBuilder, type ArgConfig, type ArgDefaultValue, type ArgDefinition, type ArgDefinitionBase, type ArgDefinitionByKind, type ArgDefinitionFragmentV1, type ArgDefinitionOverrides, type ArgElementFragmentV1, type ArgFactory, type ArgKind, type ArgParseFn, type ArgPresence, type ArgSchema, type ArrayFlagDefinition, type Ask, type BeforeParseParams, type BooleanArgDefinition, type BooleanFlagDefinition, type BuiltinMode, type BuiltinName, type Builtins, type BuiltinsConfig, CLIBuilder, type CLIDefinition, CLIError, type CLIErrorJSON, type CLIErrorOptions, type CLIExecuteOptions, type CLIOptions, type CLIPlugin, type CLIPluginHooks, type CLIRunOptions, type CLISchema, type Colors, type CommandArgEntry, type CommandArgEntryDefinition, CommandBuilder, type CommandDefinition, type CommandDefinitionDocument, type CommandDefinitionDocumentV1, type CommandDefinitionFragmentV1, type CommandExample, type CommandMeta, type CommandSchema, type CompletionOptions, type CompletionRegistrationOptions, type CompletionsFlagConfig, type ConfigAdapter, type ConfigDiscoveryOptions, type ConfigDiscoveryResult, type ConfigFound, type ConfigNotFound, type ConfigSearchPathOptions, type ConfigSettings, type ConfigSettingsDefinition, type ConfirmPromptConfig, type CountFlagDefinition, type CustomArgDefinition, type CustomFlagDefinition, DEFINITION_SCHEMA_URL, DEFINITION_SCHEMA_VERSION, DUPLICATE_KEYS, type DateFlagOptions, type DefaultCommandOptions, type DefaultValueOptions, type DefinitionDocument, type DefinitionDocumentV1, type DeprecationWarning, type DeriveHandler, type DeriveParams, type DuplicateKeys, type DuplicatePolicy, type EnumArgDefinition, type EnumFlagDefinition, type EnvIndexedFragmentV1, type EnvOptions, type ErrorCode, type ExampleCommand, type ExampleDefinitionFragmentV1, type ExampleMeta, type Fallback, FlagBuilder, type FlagConfig, type FlagDefinition, type FlagDefinitionBase, type FlagDefinitionByKind, type FlagDefinitionFragmentV1, type FlagDefinitionOverrides, type FlagElementFragmentV1, type FlagFactory, type FlagKind, type FlagMap, type FlagNegation, type FlagNegationFragmentV1, type FlagParseFn, type FlagPathChecksFragmentV1, type FlagPresence, type FlagSchema, type FlagStringConstraintsFragmentV1, type FormatLoader, type HelpConfig, type HelpDescription, type HelpLinks, type HelpOptions, type HelpTheme, type HelpThemeFactory, type IndexedEnvBinding, type IndexedRecordEnvBinding, type IndexedValueEnvBinding, type InferArg, type InferArgs, type InferFlag, type InferFlags, type InferNameOption, type InferPrompt, type InferStandardInput, type InferStandardOutput, type InputPromptConfig, type InputSchemaBranch, type InputSchemaDocument, type InputSchemaProperty, type InputSources, type InteractiveParams, type InteractiveResolver, type InteractiveResult, type JsonSchemaOptions, type KeyValueArgDefinition, type KeyValueFlagDefinition, type ManifestDiscoveryOptions, type ManifestSettings, type Middleware, type MiddlewareHandler, type MiddlewareParams, type MultiselectPromptConfig, type NumberArgDefinition, type NumberConstraintViolation, type NumberConstraints, type NumberFlagDefinition, type Out, type OutputOptions, type PackageJsonAdapter, type PackageJsonData, type PackageRepository, type PackageRepositoryUrlOptions, ParseError, type ParseErrorCode, type ParseErrorOptions, type ParseOptions, type ParseResult, type PasswordPromptConfig, type PathChecks, type PathFlagOptions, type PluginCommandContext, type ProgressHandle, type ProgressOptions, type PromptChoiceFragmentV1, type PromptConfig, type PromptConfigBase, type PromptDefinitionFragmentV1, type PromptEngine, type PromptKind, type PromptResult, type ReadFlagsOptions, type ReadFn, type RenderContext, type RenderContextOptions, type ResolutionProvenance, type ResolutionProvenanceRecord, type ResolveOptions, type ResolveResult, type ResolvedArgValue, type ResolvedCommandParams, type ResolvedManifestSettings, type ResolvedMultiselectPromptConfig, type ResolvedPromptConfig, type ResolvedSelectPromptConfig, type ResolvedValue, type RunResult, SHELLS, SPLIT_FORMATS, type SelectChoice, type SelectPromptConfig, type Shell, type SkippedPathCheck, type SourceSplitBinding, type SourceSplitFragmentV1, type SourcesOf, type SpinnerHandle, type SpinnerOptions, type SplitBinding, type SplitFormat, type SplitOptions, type SplitPolicy, type SplitPolicyFragmentV1, type SplitSetting, type StandardSchemaV1, type StandardSchemaV1FailureResult, type StandardSchemaV1Issue, type StandardSchemaV1Options, type StandardSchemaV1PathSegment, type StandardSchemaV1Props, type StandardSchemaV1Result, type StandardSchemaV1SuccessResult, type StandardSchemaV1Types, type StdinBinding, type StdinBindingFragmentV1, type StdinConsume, type StdinOptions, type StdinWhen, type StringArgDefinition, type StringArgElementConfig, type StringConstraintViolation, type StringConstraints, type StringElementConfig, type StringFlagDefinition, type TableColumn, type TableFormat, type TableOptions, type TableStream, type Token, type UrlFlagOptions, ValidationError, type ValidationErrorCode, type ValidationErrorOptions, type Verbosity, type WithArgPresence, type WithPresence, type WithVariadic, type WithoutArgElementEligibility, type WithoutElementEligibility, type WriteFn, arg, cli, command, createArgSchema, createCLISchema, createCommandSchema, createFlagSchema, createOutput, flag, formatHelp, getFlagNegatedName, group, includesBeforeSeparator, isCLIError, isMainModule, isParseError, isValidationError, middleware, osc8, parse, plugin, readFlags, resolve, resolveExampleCommand, resolvePromptConfig, resolveRenderContext, stripBeforeSeparator, tokenize, visibleWidth, wasExplicit };
221
+ export { type ActionHandler, type ActionParams, type ActivityEvent, ArgBuilder, type ArgConfig, type ArgDefaultValue, type ArgDefinition, type ArgDefinitionBase, type ArgDefinitionByKind, type ArgDefinitionFragmentV1, type ArgDefinitionOverrides, type ArgElementFragmentV1, type ArgFactory, type ArgKind, type ArgParseFn, type ArgPresence, type ArgSchema, type ArrayFlagDefinition, type Ask, type BeforeParseParams, type BooleanArgDefinition, type BooleanFlagDefinition, type BuiltinMode, type BuiltinName, type Builtins, type BuiltinsConfig, CLIBuilder, type CLIDefinition, CLIError, type CLIErrorJSON, type CLIErrorOptions, type CLIExecuteOptions, type CLIOptions, type CLIPlugin, type CLIPluginHooks, type CLIRunOptions, type CLISchema, type Colors, type CommandArgEntry, type CommandArgEntryDefinition, CommandBuilder, type CommandConstraint, type CommandDefinition, type CommandDefinitionDocument, type CommandDefinitionDocumentV1, type CommandDefinitionFragmentV1, type CommandExample, type CommandMeta, type CommandSchema, type CommandValidationOptions, type CompletionContext, type CompletionHandler, type CompletionOptions, type CompletionRegistrationOptions, type CompletionsFlagConfig, type ConfigAdapter, type ConfigDiscoveryOptions, type ConfigDiscoveryResult, type ConfigFound, type ConfigLoader, type ConfigModuleOptions, type ConfigNotFound, type ConfigSearchPathOptions, type ConfigSettings, type ConfigSettingsDefinition, type ConfirmPromptConfig, type ConstraintBuilder, type ConstraintInput, type CountFlagDefinition, type CustomArgDefinition, type CustomFlagDefinition, DEFINITION_SCHEMA_URL, DEFINITION_SCHEMA_VERSION, DUPLICATE_KEYS, type DateFlagOptions, type DefaultCommandOptions, type DefaultValueOptions, type DefinitionDocument, type DefinitionDocumentV1, type DeprecationWarning, type DeriveHandler, type DeriveParams, type DuplicateKeys, type DuplicatePolicy, type EnumArgDefinition, type EnumFlagDefinition, type EnvIndexedFragmentV1, type EnvOptions, type ErrorCode, type ExampleCommand, type ExampleDefinitionFragmentV1, type ExampleMeta, type Fallback, FlagBuilder, type FlagConfig, type FlagDefinition, type FlagDefinitionBase, type FlagDefinitionByKind, type FlagDefinitionFragmentV1, type FlagDefinitionOverrides, type FlagElementFragmentV1, type FlagFactory, type FlagKind, type FlagMap, type FlagNegation, type FlagNegationFragmentV1, type FlagParseFn, type FlagPathChecksFragmentV1, type FlagPresence, type FlagSchema, type FlagStringConstraintsFragmentV1, type FormatLoader, type HelpConfig, type HelpDescription, type HelpLinks, type HelpOptions, type HelpTheme, type HelpThemeFactory, type IndexedEnvBinding, type IndexedRecordEnvBinding, type IndexedValueEnvBinding, type InferArg, type InferArgs, type InferFlag, type InferFlags, type InferNameOption, type InferPrompt, type InferStandardInput, type InferStandardOutput, type InputPromptConfig, type InputSchemaBranch, type InputSchemaDocument, type InputSchemaProperty, type InputSources, type InteractiveParams, type InteractiveResolver, type InteractiveResult, type JsonSchemaOptions, type KeyValueArgDefinition, type KeyValueFlagDefinition, type ManifestDiscoveryOptions, type ManifestSettings, type Middleware, type MiddlewareHandler, type MiddlewareParams, type MultiselectPromptConfig, type NumberArgDefinition, type NumberConstraintViolation, type NumberConstraints, type NumberFlagDefinition, type Out, type OutputOptions, type PackageJsonAdapter, type PackageJsonData, type PackageRepository, type PackageRepositoryUrlOptions, ParseError, type ParseErrorCode, type ParseErrorOptions, type ParseOptions, type ParseResult, type PasswordPromptConfig, type PathChecks, type PathConfigLoader, type PathFlagOptions, type PluginCommandContext, type ProgressHandle, type ProgressOptions, type PromptChoiceFragmentV1, type PromptConfig, type PromptConfigBase, type PromptDefinitionFragmentV1, type PromptEngine, type PromptKind, type PromptResult, type ReadFlagsOptions, type ReadFn, type RenderContext, type RenderContextOptions, type ResolutionProvenance, type ResolutionProvenanceRecord, type ResolveOptions, type ResolveResult, type ResolvedArgValue, type ResolvedCommandParams, type ResolvedManifestSettings, type ResolvedMultiselectPromptConfig, type ResolvedPromptConfig, type ResolvedSelectPromptConfig, type ResolvedValue, type RunResult, SHELLS, SPLIT_FORMATS, type SelectChoice, type SelectPromptConfig, type Shell, type SkippedPathCheck, type SourceSplitBinding, type SourceSplitFragmentV1, type SourcesOf, type SpinnerHandle, type SpinnerOptions, type SplitBinding, type SplitFormat, type SplitOptions, type SplitPolicy, type SplitPolicyFragmentV1, type SplitSetting, type StandardSchemaV1, type StandardSchemaV1FailureResult, type StandardSchemaV1Issue, type StandardSchemaV1Options, type StandardSchemaV1PathSegment, type StandardSchemaV1Props, type StandardSchemaV1Result, type StandardSchemaV1SuccessResult, type StandardSchemaV1Types, type StdinBinding, type StdinBindingFragmentV1, type StdinConsume, type StdinOptions, type StdinWhen, type StringArgDefinition, type StringArgElementConfig, type StringConstraintViolation, type StringConstraints, type StringElementConfig, type StringFlagDefinition, type TableColumn, type TableFormat, type TableOptions, type TableStream, type Token, type UrlFlagOptions, ValidationError, type ValidationErrorCode, type ValidationErrorOptions, type Verbosity, type WithArgPresence, type WithPresence, type WithVariadic, type WithoutArgElementEligibility, type WithoutElementEligibility, type WriteFn, arg, cli, command, createArgSchema, createCLISchema, createCommandSchema, createFlagSchema, createOutput, flag, formatHelp, getFlagNegatedName, group, includesBeforeSeparator, isCLIError, isMainModule, isParseError, isValidationError, middleware, osc8, parse, plugin, readFlags, resolve, resolveExampleCommand, resolvePromptConfig, resolveRenderContext, stripBeforeSeparator, tokenize, visibleWidth, wasExplicit };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export{W as ArgBuilder,s as CLIBuilder,tt as CLIError,z as CommandBuilder,a as DEFINITION_SCHEMA_URL,o as DEFINITION_SCHEMA_VERSION,Q as DUPLICATE_KEYS,q as FlagBuilder,nt as ParseError,st as SHELLS,$ as SPLIT_FORMATS,rt as ValidationError,G as arg,c as cli,B as command,K as createArgSchema,l as createCLISchema,V as createCommandSchema,J as createFlagSchema,D as createOutput,Y as flag,O as formatHelp,Z as getFlagNegatedName,H as group,N as includesBeforeSeparator,it as isCLIError,u as isMainModule,at as isParseError,ot as isValidationError,R as middleware,A as osc8,P as parse,p as plugin,i as readFlags,C as resolve,U as resolveExampleCommand,w as resolvePromptConfig,d as resolveRenderContext,F as stripBeforeSeparator,I as tokenize,j as visibleWidth,L as wasExplicit}from"./core-B9YNSJeA.mjs";
1
+ export{et as ArgBuilder,s as CLIBuilder,_t as CLIError,q as CommandBuilder,a as DEFINITION_SCHEMA_URL,o as DEFINITION_SCHEMA_VERSION,ut as DUPLICATE_KEYS,rt as FlagBuilder,vt as ParseError,Ct as SHELLS,dt as SPLIT_FORMATS,yt as ValidationError,tt as arg,c as cli,J as command,nt as createArgSchema,l as createCLISchema,Y as createCommandSchema,it as createFlagSchema,N as createOutput,at as flag,P as formatHelp,st as getFlagNegatedName,X as group,V as includesBeforeSeparator,bt as isCLIError,u as isMainModule,xt as isParseError,St as isValidationError,K as middleware,I as osc8,H as parse,m as plugin,i as readFlags,k as resolve,Z as resolveExampleCommand,A as resolvePromptConfig,d as resolveRenderContext,U as stripBeforeSeparator,W as tokenize,L as visibleWidth,G as wasExplicit}from"./core-CPh0FcFg.mjs";
@@ -0,0 +1,59 @@
1
+ import{t as __exportAll}from"./rolldown-runtime-DOYBPklu.mjs";import{F as resolvePlainHelpDescription,Q as CONSTRAINT_KINDS,Z as resolveExampleCommand,a as DEFINITION_SCHEMA_URL,ot as getFlagAliasNames,ut as DUPLICATE_KEYS}from"./core-CPh0FcFg.mjs";const definitionMetaSchemaDescriptions={root:{description:`Runtime descriptor for the CLI program.
2
+
3
+ Stores the program name, version, description, and registered command schemas.\\
4
+ Sealed by createCLISchema and rebuilt by each CLIBuilder step.`,properties:{name:{description:`Program name (used in help text, usage lines, and completion scripts).`},version:{description:"Program version (shown by `--version`)."},description:{description:`Program description (shown in root help).`},envPrefix:{description:"CLI-wide environment namespace prepended to every relative env binding\n(`undefined` when none is set). `.env('TOKEN')` reads `<envPrefix>TOKEN`;\na binding declared with `{ absolute: true }` is read as written.\n\nSet via the .envPrefix() builder method\nor the `envPrefix` field of CLIDefinition. Fixed when declared, so\nneither manifest name inference nor an inherited invocation name changes it."},groupOrder:{description:`Named help groups to display first, in order.`},defaultCommand:{description:`Schema of the default command dispatched when no subcommand matches.
5
+
6
+ When set, the CLI root behaves like a hybrid command group: subcommands
7
+ dispatch by name as usual, but empty argv or flags-only argv falls
8
+ through to this command instead of showing root help.
9
+
10
+ Set via the .default() builder method
11
+ or the \`defaultCommand\` field of CLIDefinition.`},commands:{description:`Schemas of the registered commands, in registration order.`}}},defs:{command:{description:`Runtime descriptor produced by CommandBuilder.
12
+
13
+ Consumers (parser, help generator, CLI dispatcher) read this to
14
+ understand the command's shape — flags, args, aliases, subcommands,
15
+ and interactive resolver.`,properties:{name:{description:"The command name (used for dispatch, e.g. `'deploy'`)."},description:{description:`Human-readable description for help text.`},details:{description:`Longer explanation shown only in this command's help, with paragraphs wrapped to its width.`},aliases:{description:`Alternative names for this command.`},hidden:{description:`Whether this command is hidden from help listings.`},examples:{description:`Usage examples for help text.`},flags:{description:`Named flag schemas, keyed by flag name.`},flagDeclarationOrder:{description:`Flag declaration order when it differs from the flag record's key order.`},args:{description:`Ordered positional arg entries (name + schema).`},constraints:{description:`Relationships checked after input resolution.`},commands:{description:"Nested subcommand schemas (for help rendering and completion).\n\nPure data — no execution closures. Populated by `.command()` on\n`CommandBuilder`. Empty for leaf commands."}}},commandDocument:{description:`A single-command definition document, version 1.
16
+
17
+ Produced by generateCommandSchema. Same shape as a
18
+ CommandDefinitionFragmentV1 plus the \`schemaVersion\` every standalone
19
+ document carries.`,properties:{schemaVersion:{description:"Version of the definition document format emitted by `generateSchema()`\nand `generateCommandSchema()` from `@kjanat/dreamcli/json-schema`."},envPrefix:{description:"CLI-wide environment namespace prepended to every relative env binding\n(`undefined` when none is set). `.env('TOKEN')` reads `<envPrefix>TOKEN`;\na binding declared with `{ absolute: true }` is read as written.\n\nSet via the .envPrefix() builder method\nor the `envPrefix` field of CLIDefinition. Fixed when declared, so\nneither manifest name inference nor an inherited invocation name changes it."},groupOrder:{description:`Named help groups to display first, in order.`},name:{description:`The command name used for dispatch.`},description:{description:`Human-readable description for help text.`},details:{description:`Longer explanation shown only in this command's help.`},aliases:{description:`Alternative names accepted for this command.`},hidden:{description:`Whether the command is omitted from help listings.`},examples:{description:`Usage examples attached to the command.`},flags:{description:`Named flag definitions keyed by flag name.`},flagDeclarationOrder:{description:`Flag declaration order when it differs from the flag record's key order.`},args:{description:`Positional argument definitions in CLI order.`},constraints:{description:`Declarative relationships between the command's inputs.`},commands:{description:`Nested subcommand definitions.`}}},flag:{description:`The runtime descriptor stored inside every FlagBuilder. Consumers (parser,
20
+ help generator, resolution chain) read this to understand the flag's shape
21
+ without touching generics.`,properties:{kind:{description:`What kind of value this flag accepts.`},presence:{description:"Presence describes whether a flag value is guaranteed to exist when the\naction handler runs:\n\n- `'optional'` — not required; unresolved value follows the kind-specific\n optional fallback (`undefined` for most flags, `[]` for arrays)\n- `'required'` — must be supplied; error if missing\n- `'defaulted'` — always present (falls back to default value)"},defaultValue:{description:`Runtime default value (if any).`},aliases:{description:"Short/long aliases (e.g. `[{ name: 'f', hidden: false }]` for `--force`)."},stdin:{description:"Stdin binding set by `.stdin()` (`undefined` when the flag never reads\nstdin). See StdinBinding."},envVar:{description:`Environment variable name for v0.2+ resolution.`},envIndexed:{description:"Indexed environment family read as the env source, set by `.env()` with an\nIndexedEnvBinding (`undefined` otherwise). A flag declares at most\none env source, so this and FlagSchema.envVar are never both set."},envAbsolute:{description:"Whether the env source is read exactly as written, outside the CLI-wide\nnamespace set by `CLIBuilder.envPrefix()` (set by `.env(…, { absolute:\ntrue })`). Applies to FlagSchema.envVar and\nFlagSchema.envIndexed alike.\n\nDefault: `false`"},configPath:{description:"Dotted config path for v0.2+ resolution (e.g. `'deploy.region'`)."},description:{description:`Human-readable description for help text.`},enumValues:{description:"Allowed literal values when `kind === 'enum'`."},elementSchema:{description:"Element schema when `kind === 'array'` or `kind === 'keyValue'`."},prompt:{description:`Interactive prompt configuration for v0.3+ resolution.`},deprecated:{description:"Deprecation marker.\n\n- `undefined` — not deprecated (default)\n- `true` — deprecated with no migration message\n- `string` — deprecated with a reason/migration message\n\nWhen a deprecated flag is used, a warning is emitted to stderr.\nHelp text shows `[deprecated]` or `[deprecated: <reason>]`."},propagate:{description:`Whether this flag propagates to subcommands in nested command trees.
22
+
23
+ When \`true\`, the flag is automatically available to all descendant
24
+ commands. A child command that defines a flag with the same name
25
+ shadows the propagated parent flag.
26
+
27
+ Default: \`false\``},negation:{description:"Negation settings when `kind === 'boolean'` and `.negatable()` was\ncalled (`undefined` otherwise). See FlagNegation."},duplicates:{description:"How repeated CLI occurrences of a singleton flag combine.\n\n- `'last'` — last occurrence wins (matches historic behavior)\n- `'first'` — first occurrence wins; later ones parse but are ignored\n- `'error'` — a second occurrence is a `ParseError` (`DUPLICATE_FLAG`)\n\nApplies to CLI token occurrences only — env/config/prompt/default\nresolution keeps its precedence semantics and never raises duplicates.\nOccurrences are counted per *logical* flag: aliases and the negated\nspelling all count toward the same flag.\n\nDefault: `'last'`"},group:{description:`Named section in command help.`},advanced:{description:`Whether the flag is shown only in full text help.`},defaultDescription:{description:"Human-readable replacement for the default value in help, or `false` to\nomit the default annotation."},sensitive:{description:`Whether values from this input must be kept out of user-facing projections.`}}},flagElement:{description:"Element schema when `kind === 'array'` or `kind === 'keyValue'`.",properties:{kind:{description:`What kind of value this flag accepts.`},presence:{description:"Presence describes whether a flag value is guaranteed to exist when the\naction handler runs:\n\n- `'optional'` — not required; unresolved value follows the kind-specific\n optional fallback (`undefined` for most flags, `[]` for arrays)\n- `'required'` — must be supplied; error if missing\n- `'defaulted'` — always present (falls back to default value)"},defaultValue:{description:`Runtime default value (if any).`},aliases:{description:"Short/long aliases (e.g. `[{ name: 'f', hidden: false }]` for `--force`)."},stdin:{description:"Stdin binding set by `.stdin()` (`undefined` when the flag never reads\nstdin). See StdinBinding."},envVar:{description:`Environment variable name for v0.2+ resolution.`},envIndexed:{description:"Indexed environment family read as the env source, set by `.env()` with an\nIndexedEnvBinding (`undefined` otherwise). A flag declares at most\none env source, so this and FlagSchema.envVar are never both set."},envAbsolute:{description:"Whether the env source is read exactly as written, outside the CLI-wide\nnamespace set by `CLIBuilder.envPrefix()` (set by `.env(…, { absolute:\ntrue })`). Applies to FlagSchema.envVar and\nFlagSchema.envIndexed alike.\n\nDefault: `false`"},configPath:{description:"Dotted config path for v0.2+ resolution (e.g. `'deploy.region'`)."},description:{description:`Human-readable description for help text.`},enumValues:{description:"Allowed literal values when `kind === 'enum'`."},elementSchema:{description:"Element schema when `kind === 'array'` or `kind === 'keyValue'`."},prompt:{description:`Interactive prompt configuration for v0.3+ resolution.`},deprecated:{description:"Deprecation marker.\n\n- `undefined` — not deprecated (default)\n- `true` — deprecated with no migration message\n- `string` — deprecated with a reason/migration message\n\nWhen a deprecated flag is used, a warning is emitted to stderr.\nHelp text shows `[deprecated]` or `[deprecated: <reason>]`."},propagate:{description:`Whether this flag propagates to subcommands in nested command trees.
28
+
29
+ When \`true\`, the flag is automatically available to all descendant
30
+ commands. A child command that defines a flag with the same name
31
+ shadows the propagated parent flag.
32
+
33
+ Default: \`false\``},negation:{description:"Negation settings when `kind === 'boolean'` and `.negatable()` was\ncalled (`undefined` otherwise). See FlagNegation."},duplicates:{description:"How repeated CLI occurrences of a singleton flag combine.\n\n- `'last'` — last occurrence wins (matches historic behavior)\n- `'first'` — first occurrence wins; later ones parse but are ignored\n- `'error'` — a second occurrence is a `ParseError` (`DUPLICATE_FLAG`)\n\nApplies to CLI token occurrences only — env/config/prompt/default\nresolution keeps its precedence semantics and never raises duplicates.\nOccurrences are counted per *logical* flag: aliases and the negated\nspelling all count toward the same flag.\n\nDefault: `'last'`"}}},stdin:{description:`The normalized stdin axis of a flag or an arg.`,properties:{when:{description:`When this input reads the stdin stream.`},consume:{description:`Whether this input consumes the stream alone.`},trim:{description:`Whether one trailing line terminator is dropped from a single value.`}}},envIndexed:{description:`A numbered family of environment variables read as one input's env source.
34
+
35
+ Pass it to \`.env()\` in place of a variable name. The count variable decides
36
+ whether the env stage supplied a value at all, and how many entries it owns;
37
+ a declared entry with a missing member is an error, never a fallback to a
38
+ later source.`,properties:{count:{description:`Variable holding how many entries the family declares, as a canonical
39
+ non-negative integer. When it is unset the env source supplies nothing;
40
+ \`0\` supplies an explicit empty list.`},value:{description:"Variable template for one entry, with `{index}` standing for the zero-based index."},fields:{description:"One variable template per record field, each with `{index}` standing for\nthe zero-based index. Every field is required for every declared entry."}}},negation:{description:`Negation settings for a boolean flag (set by \`.negatable()\`).
41
+
42
+ The negated spelling and the positive form are two spellings of ONE
43
+ logical flag: they share duplicate policy, and the last CLI occurrence
44
+ wins across both. The negated spelling is presence-only — \`--no-foo=x\`
45
+ is rejected.`,properties:{alias:{description:"Explicit negated spelling without the `--` prefix (e.g. `'no-sandbox'`).\n`undefined` synthesizes `no-<flagName>` wherever the flag name is known."},hidden:{description:`Hide the negated spelling from help, completions, and suggestions.`}}},arg:{description:`The runtime descriptor stored inside every ArgBuilder. Consumers (parser,
46
+ help generator) read this to understand the arg's shape without touching
47
+ generics.`,properties:{name:{description:`A named positional argument entry in the command schema.
48
+
49
+ Pairs a user-facing arg name with its ArgSchema descriptor.
50
+ The array ordering in CommandSchema.args determines CLI position.`},kind:{description:`What kind of value this arg accepts.`},presence:{description:"Presence describes whether a positional arg is guaranteed to exist when the\naction handler runs:\n\n- `'required'` — must be supplied; error if missing (default)\n- `'optional'` — may be `undefined` if not supplied\n- `'defaulted'` — always present (falls back to default value)"},variadic:{description:`Whether this arg consumes all remaining positionals.`},stdin:{description:"Stdin binding set by `.stdin()` (`undefined` when the arg never reads\nstdin). See StdinBinding."},defaultValue:{description:`Runtime default value (if any).`},defaultDescription:{description:"Human-readable replacement for the default value in help, or `false` to\nomit the default annotation."},sensitive:{description:`Whether values from this input must be kept out of user-facing projections.`},description:{description:`Human-readable description for help text.`},group:{description:`Named section in command help.`},envVar:{description:`Environment variable name for env resolution.
51
+
52
+ When set and the CLI value is absent, the resolver reads this env var
53
+ and coerces the string to the arg's declared kind.`},envIndexed:{description:"Indexed environment family read as the env source, set by `.env()` with an\nIndexedEnvBinding (`undefined` otherwise). An arg declares at most\none env source, so this and ArgSchema.envVar are never both set."},envAbsolute:{description:"Whether the env source is read exactly as written, outside the CLI-wide\nnamespace set by `CLIBuilder.envPrefix()` (set by `.env(…, { absolute:\ntrue })`). Applies to ArgSchema.envVar and\nArgSchema.envIndexed alike.\n\nDefault: `false`"},configPath:{description:"Dotted config path for config resolution (e.g. `'deploy.region'`)."},prompt:{description:`Interactive prompt configuration.`},enumValues:{description:"Allowed literal values when `kind === 'enum'`."},elementSchema:{description:"Element schema when `kind === 'keyValue'`.\n\nDescribes the value of each entry, so `arg.keyValue(arg.number())` decodes\n`A=1` to the number `1`. `undefined` leaves entry values as strings."},deprecated:{description:"Deprecation marker.\n\n- `undefined` — not deprecated (default)\n- `true` — deprecated with no migration message\n- `string` — deprecated with a reason/migration message\n\nWhen a deprecated arg is used, a warning is emitted to stderr.\nHelp text shows `[deprecated]` or `[deprecated: <reason>]`."}}},argElement:{description:"Element schema when `kind === 'keyValue'`.\n\nDescribes the value of each entry, so `arg.keyValue(arg.number())` decodes\n`A=1` to the number `1`. `undefined` leaves entry values as strings.",properties:{kind:{description:`What kind of value this arg accepts.`},presence:{description:`Entry values are required once their containing key-value argument is present.`},enumValues:{description:"Allowed literal values when `kind === 'enum'`."}}},prompt:{description:"Discriminated union of all prompt configurations.\n\nUse the `kind` field to narrow:\n```ts\nif (config.kind === 'select') {\n config.choices // readonly SelectChoice[] | undefined\n}\n```",properties:{kind:{description:"The kind of interactive prompt to present.\n\n- `'confirm'` — yes/no boolean question\n- `'input'` — free-text string input\n- `'password'` — hidden text input, preserving whitespace\n- `'select'` — single selection from a list\n- `'multiselect'` — multiple selections from a list"},message:{description:`The question displayed to the user.`},placeholder:{description:`Placeholder text shown before user types (informational only).`},choices:{description:"Available choices. When omitted for `enum` flags, the enum values\nfrom the flag schema are used automatically."},min:{description:`Minimum number of selections required.
54
+
55
+ Default: \`0\``},max:{description:`Maximum number of selections allowed.
56
+
57
+ Default: \`Infinity\``}}},choice:{description:`A selectable option for SelectPromptConfig and MultiselectPromptConfig prompts.`,properties:{value:{description:`The value returned when this choice is selected.`},label:{description:`Display label shown to the user.
58
+
59
+ Default: value`},description:{description:`Optional description shown alongside the choice.`}}},example:{description:`A single usage example shown in help text.`,properties:{command:{description:"The command invocation (e.g. `'deploy production --force'`)."},description:{description:`Optional description of what this example does.`}}}}};var json_schema_exports=/* @__PURE__ */ __exportAll({generateCommandSchema:()=>generateCommandSchema,generateSchema:()=>generateSchema});function resolveOptions(e){return{includeHidden:e?.includeHidden??!0,includePrompts:e?.includePrompts??!0,envPrefix:e?.envPrefix}}const JSON_SCHEMA_DRAFT=`https://json-schema.org/draft/2020-12/schema`;function generateSchema(e,t,n){let r=resolveOptions(t),i=r.envPrefix??e.envPrefix,a=t?.groupOrder??e.helpConfig?.groupOrder,o=n??{name:e.name,version:e.version},s=e.defaultCommand!==void 0&&(r.includeHidden||!e.defaultCommand.hidden)?serializeCommand(e.defaultCommand,r,o):void 0;return{$schema:DEFINITION_SCHEMA_URL,schemaVersion:1,name:e.name,...e.version===void 0?{}:{version:e.version},...e.description===void 0?{}:{description:resolvePlainHelpDescription(e.description)},...i===void 0?{}:{envPrefix:i},...a===void 0?{}:{groupOrder:[...a]},...s===void 0?{}:{defaultCommand:s},commands:e.commands.filter(e=>r.includeHidden||!e.hidden).map(e=>serializeCommand(e,r,o))}}function generateCommandSchema(e,t,n){let r=n??{name:e.name,version:void 0},i=resolveOptions(t);return{schemaVersion:1,...i.envPrefix===void 0?{}:{envPrefix:i.envPrefix},...t?.groupOrder===void 0?{}:{groupOrder:[...t.groupOrder]},...serializeCommand(e,i,r)}}function serializeCommand(e,t,n){let r={};for(let[n,i]of Object.entries(e.flags))r[n]=serializeFlag(i,t);return{name:e.name,...e.description===void 0?{}:{description:resolvePlainHelpDescription(e.description)},...e.details===void 0?{}:{details:resolvePlainHelpDescription(e.details)},...e.aliases.length>0?{aliases:[...e.aliases]}:{},...e.hidden?{hidden:!0}:{},...e.examples.length>0?{examples:e.examples.map(e=>serializeExample(e,n))}:{},flags:r,...e.flagDeclarationOrder===void 0?{}:{flagDeclarationOrder:[...e.flagDeclarationOrder]},args:e.args.map(e=>serializeArgEntry(e,t)),...e.constraints?.length?{constraints:e.constraints}:{},commands:e.commands.filter(e=>t.includeHidden||!e.hidden).map(e=>serializeCommand(e,t,n))}}function serializeFlag(e,t,n=!1){let r=getFlagAliasNames(e),i=e.stringConstraints,a=e.pathChecks,o=e.negation,s=n||e.sensitive;return{kind:e.kind,presence:e.presence,...!s&&isJsonSerializable(e.defaultValue)?{defaultValue:e.defaultValue}:{},...e.defaultDescription===void 0?{}:{defaultDescription:e.defaultDescription},...e.sensitive?{sensitive:!0}:{},...r.length>0?{aliases:[...r]}:{},...e.stdin===void 0?{}:{stdin:serializeStdin(e.stdin)},...e.envVar===void 0?{}:{envVar:e.envVar},...e.envIndexed===void 0?{}:{envIndexed:serializeEnvIndexed(e.envIndexed)},...e.envAbsolute?{envAbsolute:!0}:{},...e.configPath===void 0?{}:{configPath:e.configPath},...e.description===void 0?{}:{description:resolvePlainHelpDescription(e.description)},...e.group===void 0?{}:{group:e.group},...e.advanced?{advanced:!0}:{},...e.enumValues===void 0?{}:{enumValues:[...e.enumValues]},...e.numberConstraints===void 0?{}:{numberConstraints:{...e.numberConstraints}},...i===void 0?{}:{stringConstraints:serializeStringConstraints(i)},...e.elementSchema===void 0?{}:{elementSchema:serializeFlag(e.elementSchema,t,s)},...e.separator===void 0?{}:{separator:e.separator},...e.split===void 0?{}:{split:serializeSplit(e.split)},...e.duplicateKeys===`last`?{}:{duplicateKeys:e.duplicateKeys},...e.unique?{unique:!0}:{},...a===void 0?{}:{pathChecks:serializePathChecks(a)},...e.valueHint===void 0?{}:{valueHint:e.valueHint},...t.includePrompts&&e.prompt!==void 0?{prompt:serializePrompt(e.prompt)}:{},...e.deprecated===void 0?{}:{deprecated:e.deprecated},...e.propagate?{propagate:!0}:{},...o===void 0?{}:{negation:{...o.alias===void 0?{}:{alias:o.alias},...o.hidden?{hidden:!0}:{}}},...e.duplicates===`last`?{}:{duplicates:e.duplicates}}}function serializeStringConstraints(e){let t=e.pattern;return{...e.nonEmpty===void 0?{}:{nonEmpty:e.nonEmpty},...e.minLength===void 0?{}:{minLength:e.minLength},...e.maxLength===void 0?{}:{maxLength:e.maxLength},...t===void 0?{}:{pattern:{source:t.source,flags:t.flags}}}}function serializeEnvIndexed(e){return e.fields===void 0?{count:e.count,value:e.value}:{count:e.count,fields:{...e.fields}}}function serializePathChecks(e){return{mustExist:e.mustExist,...e.type===void 0?{}:{type:e.type},...e.create?{create:!0}:{}}}function serializeArgEntry(e,t){return{name:e.name,...serializeArgValue(e.schema,t)}}function serializeArgValue(e,t){let n=e.stringConstraints,r=e.pathChecks;return{kind:e.kind,presence:e.presence,...e.variadic?{variadic:!0}:{},...e.stdin===void 0?{}:{stdin:serializeStdin(e.stdin)},...!e.sensitive&&isJsonSerializable(e.defaultValue)?{defaultValue:e.defaultValue}:{},...e.defaultDescription===void 0?{}:{defaultDescription:e.defaultDescription},...e.sensitive?{sensitive:!0}:{},...e.description===void 0?{}:{description:resolvePlainHelpDescription(e.description)},...e.group===void 0?{}:{group:e.group},...e.envVar===void 0?{}:{envVar:e.envVar},...e.envIndexed===void 0?{}:{envIndexed:serializeEnvIndexed(e.envIndexed)},...e.envAbsolute?{envAbsolute:!0}:{},...e.configPath===void 0?{}:{configPath:e.configPath},...e.enumValues===void 0?{}:{enumValues:[...e.enumValues]},...e.elementSchema===void 0?{}:{elementSchema:serializeArgElementValue(e.elementSchema)},...e.numberConstraints===void 0?{}:{numberConstraints:{...e.numberConstraints}},...n===void 0?{}:{stringConstraints:serializeStringConstraints(n)},...r===void 0?{}:{pathChecks:serializePathChecks(r)},...e.valueHint===void 0?{}:{valueHint:e.valueHint},...e.separator===void 0?{}:{separator:e.separator},...e.split===void 0?{}:{split:serializeSplit(e.split)},...e.duplicateKeys===`last`?{}:{duplicateKeys:e.duplicateKeys},...e.unique?{unique:!0}:{},...t.includePrompts&&e.prompt!==void 0?{prompt:serializePrompt(e.prompt)}:{},...e.deprecated===void 0?{}:{deprecated:e.deprecated}}}function serializeArgElementValue(e){if(e.kind===`keyValue`)throw TypeError(`Arg element schema kind 'keyValue' is not supported`);return{kind:e.kind,presence:`required`,...e.enumValues===void 0?{}:{enumValues:[...e.enumValues]},...e.numberConstraints===void 0?{}:{numberConstraints:{...e.numberConstraints}},...e.stringConstraints===void 0?{}:{stringConstraints:serializeStringConstraints(e.stringConstraints)},...e.pathChecks===void 0?{}:{pathChecks:serializePathChecks(e.pathChecks)},...e.valueHint===void 0?{}:{valueHint:e.valueHint}}}function serializeSplit(e){return{...e.env===void 0?{}:{env:{...e.env}},...e.stdin===void 0?{}:{stdin:{...e.stdin}}}}function serializeStdin(e){return{when:e.when,consume:e.consume,trim:e.trim,...e.argv===!1?{argv:!1}:{}}}function serializePrompt(e){let t={...e.sensitive===!0||e.kind===`password`?{sensitive:!0}:{}};switch(e.kind){case`input`:return{kind:e.kind,message:e.message,...t,...e.empty===void 0?{}:{empty:e.empty},...e.trim===void 0?{}:{trim:e.trim},...e.placeholder===void 0?{}:{placeholder:e.placeholder}};case`password`:return{kind:e.kind,message:e.message,...t,...e.empty===void 0?{}:{empty:e.empty}};case`select`:return{kind:e.kind,message:e.message,...t,...e.choices===void 0?{}:{choices:e.choices.map(serializeChoice)}};case`multiselect`:return{kind:e.kind,message:e.message,...t,...e.choices===void 0?{}:{choices:e.choices.map(serializeChoice)},...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max}};case`confirm`:return{kind:e.kind,message:e.message,...t}}}function serializeChoice(e){return{value:e.value,...e.label===void 0?{}:{label:e.label},...e.description===void 0?{}:{description:e.description}}}function serializeExample(e,t){return{command:resolveExampleCommand(e.command,t),...e.description===void 0?{}:{description:e.description}}}function generateInputSchema(e,t){let n=resolveOptions(t);if(isCommandSchema(e))return{$schema:JSON_SCHEMA_DRAFT,...commandToInputSchema(e)};let r=[];e.defaultCommand!==void 0&&(n.includeHidden||!e.defaultCommand.hidden)&&collectInputBranches(e.defaultCommand,``,r,n);for(let t of e.commands)t!==e.defaultCommand&&t.name!==e.defaultCommand?.name&&(n.includeHidden||!t.hidden)&&collectInputBranches(t,``,r,n);let[i]=r;if(r.length===1&&i!==void 0)return{$schema:JSON_SCHEMA_DRAFT,...stripCommandDiscriminator(i)};if(r.length>0){let t=e.defaultCommand!==void 0&&(n.includeHidden||!e.defaultCommand.hidden)?e.defaultCommand.name:void 0,i=t===void 0?r:r.map(e=>getBranchCommandDiscriminator(e)===t?stripCommandDiscriminator(e):e);return{$schema:JSON_SCHEMA_DRAFT,oneOf:i}}return{$schema:JSON_SCHEMA_DRAFT,type:`object`}}function isCommandSchema(e){return`flags`in e&&`args`in e&&`hasAction`in e}function collectInputBranches(e,t,n,r){let i=t?`${t}.${e.name}`:e.name;e.hasAction&&n.push(commandToInputSchema(e,i));for(let t of e.commands)(r.includeHidden||!t.hidden)&&collectInputBranches(t,i,n,r)}function commandToInputSchema(e,t){let n={},r=[];t!==void 0&&(n.command={const:t},r.push(`command`));for(let[t,i]of Object.entries(e.flags))n[t]=flagToJsonSchemaType(i),i.presence===`required`&&r.push(t);for(let t of e.args)n[t.name]=argToJsonSchemaType(t.schema),t.schema.presence===`required`&&r.push(t.name);return{type:`object`,properties:n,additionalProperties:!1,...r.length>0?{required:r}:{}}}function stripCommandDiscriminator(e){let{command:t,...n}=e.properties,r=e.required?.filter(e=>e!==`command`);return{type:e.type,properties:n,additionalProperties:e.additionalProperties,...r!==void 0&&r.length>0?{required:r}:{}}}function getBranchCommandDiscriminator(e){let t=e.properties.command;if(t===void 0)return;let n=t.const;return typeof n==`string`?n:void 0}function stringConstraintsToJsonSchemaProperties(e){let t={},n=e?.nonEmpty===!0?Math.max(e.minLength??1,1):e?.minLength;return n!==void 0&&(t.minLength=n),e?.maxLength!==void 0&&(t.maxLength=e.maxLength),e?.pattern!==void 0&&(t.pattern=e.pattern.source),t}function flagToJsonSchemaType(e,t=!1){let n={},r=t||e.sensitive;switch(e.kind){case`string`:n.type=`string`,Object.assign(n,stringConstraintsToJsonSchemaProperties(e.stringConstraints));break;case`number`:{let t=e.numberConstraints;n.type=t?.int===!0?`integer`:`number`,t?.min!==void 0&&(n.minimum=t.min),t?.max!==void 0&&(n.maximum=t.max);break}case`boolean`:n.type=`boolean`;break;case`enum`:n.type=`string`,e.enumValues!==void 0&&(n.enum=[...e.enumValues]);break;case`array`:n.type=`array`,e.elementSchema!==void 0&&(n.items=flagToJsonSchemaType(e.elementSchema,r));break;case`custom`:break;case`count`:n.type=`integer`,n.minimum=0;break;case`keyValue`:n.type=`object`,n.additionalProperties=e.elementSchema===void 0?{type:`string`}:flagToJsonSchemaType(e.elementSchema,r)}return e.description!==void 0&&(n.description=resolvePlainHelpDescription(e.description)),e.sensitive&&(n.writeOnly=!0),!r&&isJsonSerializable(e.defaultValue)&&(n.default=e.defaultValue),e.deprecated!==void 0&&(n.deprecated=e.deprecated),n}function argToJsonSchemaType(e){let t=argKindToType(e),n=e.variadic&&e.kind!==`keyValue`?{type:`array`,items:t}:{...t};return e.description!==void 0&&(n.description=resolvePlainHelpDescription(e.description)),e.sensitive&&(n.writeOnly=!0),!e.sensitive&&isJsonSerializable(e.defaultValue)&&(n.default=e.defaultValue),e.deprecated!==void 0&&(n.deprecated=e.deprecated),n}function argKindToType(e){switch(e.kind){case`string`:return{type:`string`,...stringConstraintsToJsonSchemaProperties(e.stringConstraints)};case`number`:{let t=e.numberConstraints,n={type:t?.int===!0?`integer`:`number`};return t?.min!==void 0&&(n.minimum=t.min),t?.max!==void 0&&(n.maximum=t.max),n}case`enum`:{let t={type:`string`};return e.enumValues!==void 0&&(t.enum=[...e.enumValues]),t}case`boolean`:return{type:`boolean`};case`keyValue`:return{type:`object`,additionalProperties:e.elementSchema===void 0?{type:`string`}:argKindToType(e.elementSchema)};case`custom`:return{}}}function isJsonSerializable(e,t=/* @__PURE__ */ new WeakSet){if(e===void 0)return!1;if(e===null)return!0;let n=typeof e;if(n===`string`||n===`boolean`)return!0;if(n===`number`)return Number.isFinite(e);if(n===`function`||n===`symbol`||n===`bigint`)return!1;if(Array.isArray(e)){if(t.has(e))return!1;t.add(e);try{return e.every(e=>isJsonSerializable(e,t))}finally{t.delete(e)}}if(n===`object`){let n=e;if(!isPlainJsonObject(n)||t.has(n))return!1;t.add(n);try{return Object.values(n).every(e=>isJsonSerializable(e,t))}finally{t.delete(n)}}return!1}function isPlainJsonObject(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function withDefinitionDescriptions(e,t){let n=e.properties,r=typeof n==`object`&&n&&isPlainJsonObject(n)&&t.properties!==void 0?Object.fromEntries(Object.entries(n).map(([e,n])=>{let r=t.properties?.[e];return r===void 0||typeof n!=`object`||!n||!isPlainJsonObject(n)?[e,n]:[e,withDefinitionDescriptions(n,r)]})):void 0;return{...e,...t.description===void 0?{}:{description:t.description},...r===void 0?{}:{properties:r}}}function withDefinitionMetaSchemaDescriptions(e,t){let n=withDefinitionDescriptions(e,t.root),r=n.$defs;return typeof r!=`object`||!r||!isPlainJsonObject(r)?n:{...n,$defs:Object.fromEntries(Object.entries(r).map(([e,n])=>{let r=t.defs[e];return r===void 0||typeof n!=`object`||!n||!isPlainJsonObject(n)?[e,n]:[e,withDefinitionDescriptions(n,r)]}))}}const ENV_PREFIX_PROPERTY={type:`string`,minLength:1,not:{pattern:`[={}]`}},GROUP_ORDER_PROPERTY={type:`array`,items:{type:`string`}},commandFragmentProperties={name:{type:`string`},description:{type:`string`},details:{type:`string`},aliases:{type:`array`,items:{type:`string`}},hidden:{const:!0},examples:{type:`array`,items:{$ref:`#/$defs/example`}},flags:{type:`object`,additionalProperties:{$ref:`#/$defs/flag`}},flagDeclarationOrder:{type:`array`,items:{type:`string`},uniqueItems:!0},args:{type:`array`,items:{$ref:`#/$defs/arg`}},constraints:{type:`array`,items:{type:`object`,additionalProperties:!1,required:[`kind`,`inputs`],properties:{kind:{enum:CONSTRAINT_KINDS},inputs:{type:`array`,minItems:2,uniqueItems:!0,items:{$ref:`#/$defs/constraintInput`}}},anyOf:[{properties:{kind:{enum:[`conflicts`,`requires`]},inputs:{maxItems:2}}},{properties:{kind:{enum:[`exactlyOne`,`atMostOne`,`allOrNone`]}}}]}},commands:{type:`array`,items:{$ref:`#/$defs/command`}}},argValueFragmentProperties={kind:{enum:[`string`,`number`,`boolean`,`enum`,`custom`,`keyValue`]},presence:{enum:[`required`,`optional`,`defaulted`]},variadic:{const:!0},stdin:{$ref:`#/$defs/stdin`},defaultValue:{},defaultDescription:{oneOf:[{type:`string`},{const:!1}]},sensitive:{const:!0},description:{type:`string`},group:{type:`string`},envVar:{type:`string`},envIndexed:{$ref:`#/$defs/envIndexed`},envAbsolute:{const:!0},configPath:{type:`string`},enumValues:{type:`array`,items:{type:`string`}},elementSchema:{$ref:`#/$defs/argElement`},numberConstraints:{$ref:`#/$defs/numberConstraints`},stringConstraints:{$ref:`#/$defs/stringConstraints`},pathChecks:{$ref:`#/$defs/pathChecks`},valueHint:{type:`string`},separator:{type:`string`,minLength:1},split:{$ref:`#/$defs/split`},duplicateKeys:{enum:[...DUPLICATE_KEYS]},unique:{const:!0},prompt:{$ref:`#/$defs/prompt`},deprecated:{oneOf:[{type:`string`},{const:!0}]}},argElementFragmentProperties={kind:{enum:[`string`,`number`,`boolean`,`enum`,`custom`]},presence:{const:`required`},enumValues:{type:`array`,items:{type:`string`}},numberConstraints:{$ref:`#/$defs/numberConstraints`},stringConstraints:{$ref:`#/$defs/stringConstraints`},pathChecks:{$ref:`#/$defs/pathChecks`},valueHint:{type:`string`}},flagElementFragmentProperties={kind:{enum:[`string`,`number`,`boolean`,`enum`,`array`,`custom`,`count`,`keyValue`]},presence:{enum:[`optional`,`required`,`defaulted`]},defaultValue:{},aliases:{type:`array`,items:{type:`string`}},stdin:{$ref:`#/$defs/stdin`},envVar:{type:`string`},envIndexed:{$ref:`#/$defs/envIndexed`},envAbsolute:{const:!0},configPath:{type:`string`},description:{type:`string`},enumValues:{type:`array`,items:{type:`string`}},numberConstraints:{$ref:`#/$defs/numberConstraints`},stringConstraints:{$ref:`#/$defs/stringConstraints`},elementSchema:{$ref:`#/$defs/flagElement`},separator:{type:`string`,minLength:1},split:{$ref:`#/$defs/split`},duplicateKeys:{enum:[...DUPLICATE_KEYS]},unique:{const:!0},pathChecks:{$ref:`#/$defs/pathChecks`},valueHint:{type:`string`},prompt:{$ref:`#/$defs/prompt`},deprecated:{oneOf:[{type:`string`},{const:!0}]},propagate:{const:!0},negation:{$ref:`#/$defs/negation`},duplicates:{enum:[`last`,`first`,`error`]}},flagFragmentProperties={...flagElementFragmentProperties,defaultDescription:{oneOf:[{type:`string`},{const:!1}]},sensitive:{const:!0},group:{type:`string`},advanced:{const:!0}},definitionMetaSchema=withDefinitionMetaSchemaDescriptions({$schema:JSON_SCHEMA_DRAFT,$id:DEFINITION_SCHEMA_URL,title:`@kjanat/dreamcli definition schema`,description:`Describes the structure of a CLI built with dreamcli — commands, flags, args, types, constraints, env bindings, and prompts.`,type:`object`,additionalProperties:!1,properties:{$schema:{const:DEFINITION_SCHEMA_URL},schemaVersion:{const:1},name:{type:`string`},version:{type:`string`},description:{type:`string`},envPrefix:ENV_PREFIX_PROPERTY,groupOrder:GROUP_ORDER_PROPERTY,defaultCommand:{$ref:`#/$defs/command`},commands:{type:`array`,items:{$ref:`#/$defs/command`}}},required:[`$schema`,`schemaVersion`,`name`,`commands`],$defs:{constraintInput:{type:`object`,additionalProperties:!1,required:[`kind`,`name`],properties:{kind:{enum:[`flag`,`arg`]},name:{type:`string`}}},command:{type:`object`,additionalProperties:!1,properties:commandFragmentProperties,required:[`name`,`flags`,`args`,`commands`]},commandDocument:{type:`object`,additionalProperties:!1,properties:{schemaVersion:{const:1},envPrefix:ENV_PREFIX_PROPERTY,groupOrder:GROUP_ORDER_PROPERTY,...commandFragmentProperties},required:[`schemaVersion`,`name`,`flags`,`args`,`commands`]},flag:{type:`object`,additionalProperties:!1,properties:flagFragmentProperties,required:[`kind`,`presence`],not:{required:[`envVar`,`envIndexed`]},dependentSchemas:{envAbsolute:{$ref:`#/$defs/envBound`}}},flagElement:{type:`object`,additionalProperties:!1,properties:flagElementFragmentProperties,required:[`kind`,`presence`]},envBound:{anyOf:[{required:[`envVar`]},{required:[`envIndexed`]}]},envIndexed:{type:`object`,additionalProperties:!1,properties:{count:{type:`string`,minLength:1,not:{pattern:`[{}=]`}},value:{$ref:`#/$defs/envIndexedTemplate`},fields:{type:`object`,minProperties:1,propertyNames:{minLength:1},additionalProperties:{$ref:`#/$defs/envIndexedTemplate`}}},required:[`count`],oneOf:[{required:[`value`],not:{required:[`fields`]}},{required:[`fields`],not:{required:[`value`]}}]},envIndexedTemplate:{type:`string`,pattern:`\\{index\\}`,not:{pattern:`=`}},stdin:{type:`object`,additionalProperties:!1,properties:{when:{enum:[`dash`,`missing`,`dash-or-missing`]},consume:{enum:[`exclusive`,`broadcast`]},trim:{type:`boolean`},argv:{const:!1}},required:[`when`,`consume`]},split:{type:`object`,additionalProperties:!1,properties:{env:{$ref:`#/$defs/splitPolicy`},stdin:{$ref:`#/$defs/splitPolicy`}}},splitPolicy:{type:`object`,additionalProperties:!1,properties:{format:{enum:[`whole`,`delimiter`,`lines`,`json`]},delimiter:{type:`string`,minLength:1}},required:[`format`],oneOf:[{properties:{format:{const:`delimiter`}},required:[`format`,`delimiter`]},{properties:{format:{enum:[`whole`,`lines`,`json`]}},not:{required:[`delimiter`]}}]},negation:{type:`object`,additionalProperties:!1,properties:{alias:{type:`string`},hidden:{const:!0}}},numberConstraints:{type:`object`,additionalProperties:!1,properties:{min:{type:`number`},max:{type:`number`},int:{type:`boolean`},finite:{type:`boolean`}}},stringConstraints:{type:`object`,additionalProperties:!1,properties:{nonEmpty:{type:`boolean`},minLength:{type:`integer`,minimum:0},maxLength:{type:`integer`,minimum:0},pattern:{type:`object`,additionalProperties:!1,properties:{source:{type:`string`},flags:{type:`string`}},required:[`source`,`flags`]}}},pathChecks:{type:`object`,additionalProperties:!1,properties:{mustExist:{type:`boolean`},type:{enum:[`file`,`directory`]},create:{const:!0}},required:[`mustExist`]},argElement:{type:`object`,additionalProperties:!1,properties:argElementFragmentProperties,required:[`kind`,`presence`]},arg:{type:`object`,additionalProperties:!1,properties:{name:{type:`string`},...argValueFragmentProperties},required:[`name`,`kind`,`presence`],anyOf:[{not:{required:[`elementSchema`]}},{properties:{kind:{const:`keyValue`}},required:[`kind`]}],not:{required:[`envVar`,`envIndexed`]},dependentSchemas:{envAbsolute:{$ref:`#/$defs/envBound`}}},prompt:{type:`object`,additionalProperties:!1,properties:{kind:{enum:[`confirm`,`input`,`password`,`select`,`multiselect`]},message:{type:`string`},placeholder:{type:`string`},trim:{type:`boolean`},empty:{enum:[`skip`,`accept`,`retry`]},sensitive:{const:!0},choices:{type:`array`,items:{$ref:`#/$defs/choice`}},min:{type:`integer`},max:{type:`integer`}},required:[`kind`,`message`]},choice:{type:`object`,additionalProperties:!1,properties:{value:{type:`string`},label:{type:`string`},description:{type:`string`}},required:[`value`]},example:{type:`object`,additionalProperties:!1,properties:{command:{type:`string`},description:{type:`string`}},required:[`command`]}}},definitionMetaSchemaDescriptions);export{json_schema_exports as a,generateSchema as i,generateCommandSchema as n,generateInputSchema as r,definitionMetaSchema as t};
@@ -1,2 +1,10 @@
1
- import { C as StdinBindingFragmentV1, D as generateSchema, E as generateInputSchema, O as DEFINITION_SCHEMA_URL, S as SplitPolicyFragmentV1, T as generateCommandSchema, _ as InputSchemaProperty, a as CommandDefinitionFragmentV1, b as PromptDefinitionFragmentV1, c as EnvIndexedFragmentV1, d as FlagElementFragmentV1, f as FlagNegationFragmentV1, g as InputSchemaDocument, h as InputSchemaBranch, i as CommandDefinitionDocumentV1, k as DEFINITION_SCHEMA_VERSION, l as ExampleDefinitionFragmentV1, m as FlagStringConstraintsFragmentV1, n as ArgElementFragmentV1, o as DefinitionDocument, p as FlagPathChecksFragmentV1, r as CommandDefinitionDocument, s as DefinitionDocumentV1, t as ArgDefinitionFragmentV1, u as FlagDefinitionFragmentV1, v as JsonSchemaOptions, w as definitionMetaSchema, x as SourceSplitFragmentV1, y as PromptChoiceFragmentV1 } from "./index-BidVVmln.mjs";
1
+ /**
2
+ * Definition documents and input JSON Schema generation.
3
+ *
4
+ * `--help --json` loads this module on demand. Import it directly to emit
5
+ * definition documents or input schemas from build scripts and tooling.
6
+ *
7
+ * @module @kjanat/dreamcli/json-schema
8
+ */
9
+ import { C as StdinBindingFragmentV1, D as generateSchema, E as generateInputSchema, O as DEFINITION_SCHEMA_URL, S as SplitPolicyFragmentV1, T as generateCommandSchema, _ as InputSchemaProperty, a as CommandDefinitionFragmentV1, b as PromptDefinitionFragmentV1, c as EnvIndexedFragmentV1, d as FlagElementFragmentV1, f as FlagNegationFragmentV1, g as InputSchemaDocument, h as InputSchemaBranch, i as CommandDefinitionDocumentV1, k as DEFINITION_SCHEMA_VERSION, l as ExampleDefinitionFragmentV1, m as FlagStringConstraintsFragmentV1, n as ArgElementFragmentV1, o as DefinitionDocument, p as FlagPathChecksFragmentV1, r as CommandDefinitionDocument, s as DefinitionDocumentV1, t as ArgDefinitionFragmentV1, u as FlagDefinitionFragmentV1, v as JsonSchemaOptions, w as definitionMetaSchema, x as SourceSplitFragmentV1, y as PromptChoiceFragmentV1 } from "./index-DBepo8jX.mjs";
2
10
  export { type ArgDefinitionFragmentV1, type ArgElementFragmentV1, type CommandDefinitionDocument, type CommandDefinitionDocumentV1, type CommandDefinitionFragmentV1, DEFINITION_SCHEMA_URL, DEFINITION_SCHEMA_VERSION, type DefinitionDocument, type DefinitionDocumentV1, type EnvIndexedFragmentV1, type ExampleDefinitionFragmentV1, type FlagDefinitionFragmentV1, type FlagElementFragmentV1, type FlagNegationFragmentV1, type FlagPathChecksFragmentV1, type FlagStringConstraintsFragmentV1, type InputSchemaBranch, type InputSchemaDocument, type InputSchemaProperty, type JsonSchemaOptions, type PromptChoiceFragmentV1, type PromptDefinitionFragmentV1, type SourceSplitFragmentV1, type SplitPolicyFragmentV1, type StdinBindingFragmentV1, definitionMetaSchema, generateCommandSchema, generateInputSchema, generateSchema };
@@ -1 +1 @@
1
- import{a as DEFINITION_SCHEMA_URL,o as DEFINITION_SCHEMA_VERSION}from"./core-B9YNSJeA.mjs";import{i as generateSchema,n as generateCommandSchema,r as generateInputSchema,t as definitionMetaSchema}from"./json-schema-DF5fXdKQ.mjs";export{DEFINITION_SCHEMA_URL,DEFINITION_SCHEMA_VERSION,definitionMetaSchema,generateCommandSchema,generateInputSchema,generateSchema};
1
+ import{a as DEFINITION_SCHEMA_URL,o as DEFINITION_SCHEMA_VERSION}from"./core-CPh0FcFg.mjs";import{i as generateSchema,n as generateCommandSchema,r as generateInputSchema,t as definitionMetaSchema}from"./json-schema-DmFJR8c6.mjs";export{DEFINITION_SCHEMA_URL,DEFINITION_SCHEMA_VERSION,definitionMetaSchema,generateCommandSchema,generateInputSchema,generateSchema};