@kjanat/dreamcli 3.0.1 → 4.0.0-rc.2

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 (137) hide show
  1. package/CHANGELOG.md +962 -1
  2. package/README.md +7 -3
  3. package/dist/core/cli/builtins.d.mts +47 -0
  4. package/dist/core/cli/builtins.mjs +135 -0
  5. package/dist/core/cli/compiled.d.mts +29 -0
  6. package/dist/core/cli/compiled.mjs +76 -0
  7. package/dist/core/cli/dispatch.d.mts +9 -85
  8. package/dist/core/cli/help-links.d.mts +2 -14
  9. package/dist/core/cli/index.d.mts +282 -101
  10. package/dist/core/cli/index.mjs +497 -264
  11. package/dist/core/cli/planner.d.mts +13 -86
  12. package/dist/core/cli/planner.mjs +47 -30
  13. package/dist/core/cli/plugin.d.mts +1 -1
  14. package/dist/core/cli/propagate.mjs +1 -1
  15. package/dist/core/cli/reserved-flags.d.mts +1 -0
  16. package/dist/core/cli/reserved-flags.mjs +158 -0
  17. package/dist/core/cli/root-help.d.mts +1 -47
  18. package/dist/core/cli/root-help.mjs +37 -47
  19. package/dist/core/cli/root-output-flags.d.mts +1 -0
  20. package/dist/core/cli/root-output-flags.mjs +169 -0
  21. package/dist/core/cli/root-surface.d.mts +1 -68
  22. package/dist/core/cli/root-surface.mjs +2 -2
  23. package/dist/core/cli/runtime-preflight.d.mts +1 -199
  24. package/dist/core/cli/runtime-preflight.mjs +67 -17
  25. package/dist/core/completion/index.d.mts +2 -2
  26. package/dist/core/completion/shells/bash.d.mts +0 -1
  27. package/dist/core/completion/shells/bash.mjs +2 -1
  28. package/dist/core/completion/shells/fish.d.mts +0 -1
  29. package/dist/core/completion/shells/fish.mjs +2 -1
  30. package/dist/core/completion/shells/powershell.d.mts +0 -1
  31. package/dist/core/completion/shells/powershell.mjs +2 -1
  32. package/dist/core/completion/shells/shared.d.mts +3 -114
  33. package/dist/core/completion/shells/shared.mjs +9 -39
  34. package/dist/core/completion/shells/zsh.d.mts +0 -1
  35. package/dist/core/completion/shells/zsh.mjs +2 -1
  36. package/dist/core/config/index.d.mts +3 -3
  37. package/dist/core/config/index.mjs +2 -2
  38. package/dist/core/config/package-json.d.mts +2 -33
  39. package/dist/core/config/package-json.mjs +1 -34
  40. package/dist/core/errors/index.d.mts +7 -7
  41. package/dist/core/execution/index.d.mts +1 -48
  42. package/dist/core/execution/index.mjs +42 -27
  43. package/dist/core/help/ansi.d.mts +0 -11
  44. package/dist/core/help/index.d.mts +3 -35
  45. package/dist/core/help/index.mjs +29 -6
  46. package/dist/core/help/theme.d.mts +1 -21
  47. package/dist/core/json-schema/index.d.mts +279 -10
  48. package/dist/core/json-schema/index.mjs +482 -237
  49. package/dist/core/json-schema/meta-descriptions.generated.d.mts +79 -7
  50. package/dist/core/json-schema/meta-descriptions.generated.mjs +40 -6
  51. package/dist/core/output/activity.d.mts +1 -193
  52. package/dist/core/output/activity.mjs +1 -1
  53. package/dist/core/output/bind.d.mts +1 -37
  54. package/dist/core/output/contracts.d.mts +7 -13
  55. package/dist/core/output/contracts.mjs +1 -1
  56. package/dist/core/output/display-value.d.mts +1 -19
  57. package/dist/core/output/index.d.mts +5 -187
  58. package/dist/core/output/index.mjs +44 -9
  59. package/dist/core/output/renderers.d.mts +1 -45
  60. package/dist/core/output/writer.d.mts +0 -1
  61. package/dist/core/parse/index.d.mts +27 -5
  62. package/dist/core/parse/index.mjs +350 -227
  63. package/dist/core/parse/occurrences.d.mts +89 -0
  64. package/dist/core/parse/occurrences.mjs +114 -0
  65. package/dist/core/prompt/index.d.mts +3 -3
  66. package/dist/core/read-flags/index.d.mts +150 -0
  67. package/dist/core/read-flags/index.mjs +217 -0
  68. package/dist/core/resolve/args.d.mts +35 -4
  69. package/dist/core/resolve/args.mjs +132 -55
  70. package/dist/core/resolve/coerce.d.mts +66 -9
  71. package/dist/core/resolve/coerce.mjs +834 -270
  72. package/dist/core/resolve/config.d.mts +1 -10
  73. package/dist/core/resolve/contracts.d.mts +67 -44
  74. package/dist/core/resolve/errors.mjs +29 -21
  75. package/dist/core/resolve/flags.d.mts +36 -9
  76. package/dist/core/resolve/flags.mjs +129 -151
  77. package/dist/core/resolve/index.d.mts +8 -6
  78. package/dist/core/resolve/index.mjs +51 -18
  79. package/dist/core/resolve/path-checks.d.mts +47 -0
  80. package/dist/core/resolve/path-checks.mjs +102 -0
  81. package/dist/core/resolve/redaction.d.mts +12 -0
  82. package/dist/core/resolve/redaction.mjs +14 -0
  83. package/dist/core/resolve/stages.d.mts +85 -0
  84. package/dist/core/resolve/stages.mjs +170 -0
  85. package/dist/core/resolve/standard.d.mts +1 -24
  86. package/dist/core/resolve/standard.mjs +141 -43
  87. package/dist/core/schema/activity.d.mts +16 -16
  88. package/dist/core/schema/arg.d.mts +849 -71
  89. package/dist/core/schema/arg.mjs +727 -54
  90. package/dist/core/schema/brand.d.mts +17 -0
  91. package/dist/core/schema/cardinality.d.mts +301 -0
  92. package/dist/core/schema/cardinality.mjs +514 -0
  93. package/dist/core/schema/command.d.mts +173 -119
  94. package/dist/core/schema/command.mjs +305 -42
  95. package/dist/core/schema/flag.d.mts +515 -173
  96. package/dist/core/schema/flag.mjs +576 -78
  97. package/dist/core/schema/index.d.mts +11 -8
  98. package/dist/core/schema/index.mjs +10 -0
  99. package/dist/core/schema/middleware.d.mts +15 -12
  100. package/dist/core/schema/number-constraints.d.mts +5 -5
  101. package/dist/core/schema/prompt.d.mts +4 -4
  102. package/dist/core/schema/provenance.d.mts +99 -0
  103. package/dist/core/schema/provenance.mjs +28 -0
  104. package/dist/core/schema/run.d.mts +21 -60
  105. package/dist/core/schema/source.d.mts +179 -0
  106. package/dist/core/schema/source.mjs +206 -0
  107. package/dist/core/schema/standard.d.mts +12 -19
  108. package/dist/core/schema/stdin.d.mts +87 -0
  109. package/dist/core/schema/stdin.mjs +91 -0
  110. package/dist/core/schema/string-constraints.d.mts +16 -5
  111. package/dist/core/schema/string-constraints.mjs +18 -1
  112. package/dist/core/schema/value-parsers.d.mts +81 -9
  113. package/dist/core/schema/value-parsers.mjs +19 -1
  114. package/dist/core/schema/value.d.mts +242 -0
  115. package/dist/core/schema/value.mjs +573 -0
  116. package/dist/core/testkit/index.d.mts +30 -3
  117. package/dist/core/testkit/index.mjs +40 -26
  118. package/dist/index.d.mts +21 -16
  119. package/dist/index.mjs +10 -6
  120. package/dist/runtime/adapter.d.mts +3 -3
  121. package/dist/runtime/deno.d.mts +3 -3
  122. package/dist/runtime/detect.d.mts +2 -2
  123. package/dist/runtime/node.d.mts +3 -3
  124. package/dist/runtime/paths.d.mts +1 -31
  125. package/dist/runtime.d.mts +4 -4
  126. package/dist/strings.d.mts +1 -16
  127. package/dist/testkit.d.mts +2 -2
  128. package/dist/testkit.mjs +1 -1
  129. package/dist/version.d.mts +0 -13
  130. package/dist/version.mjs +2 -2
  131. package/dreamcli.schema.json +368 -78
  132. package/examples/interactive.ts +6 -5
  133. package/package.json +12 -11
  134. package/skills/cli-creation/SKILL.md +72 -16
  135. package/skills/cli-creation/references/pattern-cookbook.md +169 -11
  136. package/dist/core/resolve/property.d.mts +0 -51
  137. package/dist/core/resolve/property.mjs +0 -53
@@ -1,23 +1,10 @@
1
- import { includesBeforeSeparator, stripBeforeSeparator } from "../parse/index.mjs";
1
+ import { requestsHelp } from "../parse/index.mjs";
2
+ import { builtinEnabled } from "../cli/builtins.mjs";
2
3
  import { createCaptureOutput } from "../output/index.mjs";
3
4
  import { buildRunResult, executeCommand } from "../execution/index.mjs";
5
+ import { readRootOutputFlags, resolveRootJsonMode, resolveRootVerbosity } from "../cli/root-output-flags.mjs";
4
6
  //#region src/core/testkit/index.ts
5
7
  /**
6
- * Test harness: command.run() with injected state, output capture.
7
- *
8
- * Provides {@linkcode runCommand()} — the in-process test harness wrapper over DreamCLI's
9
- * shared executor.\
10
- * It wires capture output and standalone command metadata,
11
- * then returns a structured {@linkcode RunResult} with exitCode and captured output.
12
- *
13
- * This keeps command tests process-free without testkit owning the canonical pipeline:
14
- *
15
- * ```text
16
- * parse -> resolve -> execute
17
- * ```
18
- * @module dreamcli/core/testkit
19
- */
20
- /**
21
8
  * Run a command builder against the given argv with injected options.
22
9
  *
23
10
  * This is the testkit wrapper around the shared executor:
@@ -37,16 +24,27 @@ import { buildRunResult, executeCommand } from "../execution/index.mjs";
37
24
  * and stripped here, just like the real CLI root — so `['--json']` enables
38
25
  * JSON mode and `['--quiet']` sets quiet verbosity rather than failing as
39
26
  * unknown flags. Equivalent to `{ jsonMode: true }` / `{ verbosity: 'quiet' }`.
27
+ * Both accept an explicit value (`--json=false`), and an invalid one fails
28
+ * with the same `INVALID_VALUE` error the CLI root produces. Pass
29
+ * `options.builtins` to mirror a CLI that released one of these tokens to its
30
+ * commands.
40
31
  * @param options - Injectable runtime state
41
32
  * @returns Structured run result with exit code and captured output
42
33
  */
43
34
  async function runCommand(cmd, argv, options) {
44
- const hasJsonFlag = includesBeforeSeparator(argv, "--json");
45
- const jsonMode = hasJsonFlag || options?.jsonMode === true;
46
- const hasQuietFlag = includesBeforeSeparator(argv, "--quiet") || includesBeforeSeparator(argv, "-q");
47
- const verbosity = hasQuietFlag ? "quiet" : options?.verbosity;
48
- let effectiveArgv = hasJsonFlag ? stripBeforeSeparator(argv, "--json") : argv;
49
- if (hasQuietFlag) effectiveArgv = stripBeforeSeparator(stripBeforeSeparator(effectiveArgv, "--quiet"), "-q");
35
+ return runCommandInternal(cmd, argv, options);
36
+ }
37
+ /**
38
+ * Execution body behind {@linkcode runCommand}, accepting the
39
+ * framework-populated channel, capture, schema, and meta fields.
40
+ *
41
+ * @internal
42
+ */
43
+ async function runCommandInternal(cmd, argv, options) {
44
+ const rootOutputFlags = readRootOutputFlags(argv, options?.builtins);
45
+ const jsonMode = resolveRootJsonMode(rootOutputFlags, options?.jsonMode);
46
+ const verbosity = resolveRootVerbosity(rootOutputFlags, options?.verbosity);
47
+ const effectiveArgv = rootOutputFlags.argv;
50
48
  let out;
51
49
  let captured;
52
50
  if (options?.out !== void 0) {
@@ -64,6 +62,18 @@ async function runCommand(cmd, argv, options) {
64
62
  };
65
63
  [out, captured] = createCaptureOutput(Object.keys(captureOptions).length > 0 ? captureOptions : void 0);
66
64
  }
65
+ if (rootOutputFlags.kind === "failed" && !(builtinEnabled(options?.builtins, "help") && requestsHelp(effectiveArgv))) {
66
+ const { error } = rootOutputFlags;
67
+ if (jsonMode) out.json({ error: error.toJSON() });
68
+ else {
69
+ out.error(error.message);
70
+ if (error.suggest !== void 0) out.error(`Suggestion: ${error.suggest}`);
71
+ }
72
+ return buildRunResult({
73
+ exitCode: error.exitCode,
74
+ error
75
+ }, captured);
76
+ }
67
77
  const schema = options?.mergedSchema ?? cmd.schema;
68
78
  const meta = options?.meta ?? {
69
79
  name: schema.name,
@@ -75,14 +85,18 @@ async function runCommand(cmd, argv, options) {
75
85
  ...options,
76
86
  ...jsonMode ? { jsonMode } : {}
77
87
  } : jsonMode ? { jsonMode } : void 0;
78
- return buildRunResult(await executeCommand({
79
- command: cmd,
88
+ const result = await executeCommand({
89
+ command: {
90
+ handler: cmd.handler,
91
+ steps: cmd._executionSteps
92
+ },
80
93
  argv: effectiveArgv,
81
94
  out,
82
95
  schema,
83
96
  meta,
84
97
  ...effectiveOptions !== void 0 ? { options: effectiveOptions } : {}
85
- }), captured);
98
+ });
99
+ return buildRunResult(result, captured);
86
100
  }
87
101
  //#endregion
88
- export { runCommand };
102
+ export { runCommand, runCommandInternal };
package/dist/index.d.mts CHANGED
@@ -1,28 +1,31 @@
1
+ import { BuiltinMode, BuiltinName, Builtins, BuiltinsConfig } from "./core/cli/builtins.mjs";
2
+ import { Verbosity } from "./core/output/contracts.mjs";
1
3
  import { ActivityEvent, Fallback, ProgressHandle, ProgressOptions, SpinnerHandle, SpinnerOptions, TableColumn, TableFormat, TableOptions, TableStream } from "./core/schema/activity.mjs";
2
4
  import { NumberConstraintViolation, NumberConstraints } from "./core/schema/number-constraints.mjs";
3
- import { InferStandardInput, InferStandardOutput, StandardSchemaV1, StandardSchemaV1FailureResult, StandardSchemaV1Issue, StandardSchemaV1Options, StandardSchemaV1PathSegment, StandardSchemaV1Props, StandardSchemaV1Result, StandardSchemaV1SuccessResult, StandardSchemaV1Types } from "./core/schema/standard.mjs";
4
- import { ArgBuilder, ArgConfig, ArgFactory, ArgKind, ArgParseFn, ArgPresence, ArgSchema, InferArg, InferArgs, ResolvedArgValue, WithArgPresence, WithVariadic, arg, createArgSchema } from "./core/schema/arg.mjs";
5
5
  import { ConfirmPromptConfig, InputPromptConfig, MultiselectPromptConfig, PromptConfig, PromptConfigBase, PromptKind, PromptResult, SelectChoice, SelectPromptConfig } from "./core/schema/prompt.mjs";
6
+ import { InferStandardInput, InferStandardOutput, StandardSchemaV1, StandardSchemaV1FailureResult, StandardSchemaV1Issue, StandardSchemaV1Options, StandardSchemaV1PathSegment, StandardSchemaV1Props, StandardSchemaV1Result, StandardSchemaV1SuccessResult, StandardSchemaV1Types } from "./core/schema/standard.mjs";
7
+ import { StdinBinding, StdinConsume, StdinOptions, StdinWhen } from "./core/schema/stdin.mjs";
6
8
  import { StringConstraintViolation, StringConstraints } from "./core/schema/string-constraints.mjs";
7
- import { DateFlagOptions, UrlFlagOptions } from "./core/schema/value-parsers.mjs";
8
- import { DuplicatePolicy, FlagBuilder, FlagConfig, FlagFactory, FlagKind, FlagNegation, FlagParseFn, FlagPresence, FlagSchema, InferFlag, InferFlags, PathChecks, PathFlagOptions, ResolvedValue, WithPresence, createSchema, flag, getFlagNegatedName } from "./core/schema/flag.mjs";
9
+ import { DateFlagOptions, PathChecks, PathFlagOptions, UrlFlagOptions } from "./core/schema/value-parsers.mjs";
10
+ import { ArrayFlagDefinition, BooleanFlagDefinition, CountFlagDefinition, CustomFlagDefinition, DuplicatePolicy, EnumFlagDefinition, FlagBuilder, FlagConfig, FlagDefinition, FlagDefinitionBase, FlagDefinitionByKind, FlagDefinitionOverrides, FlagFactory, FlagKind, FlagNegation, FlagParseFn, FlagPresence, FlagSchema, InferFlag, InferFlags, KeyValueFlagDefinition, NumberFlagDefinition, ResolvedValue, StringElementConfig, StringFlagDefinition, WithPresence, WithoutElementEligibility, createFlagSchema, flag, getFlagNegatedName } from "./core/schema/flag.mjs";
11
+ import { DUPLICATE_KEYS, DuplicateKeys, SPLIT_FORMATS, SourceSplitBinding, SplitBinding, SplitFormat, SplitOptions, SplitPolicy, SplitSetting } from "./core/schema/cardinality.mjs";
12
+ import { ArgBuilder, ArgConfig, ArgDefaultValue, ArgDefinition, ArgDefinitionBase, ArgDefinitionByKind, ArgDefinitionOverrides, ArgFactory, ArgKind, ArgParseFn, ArgPresence, ArgSchema, BooleanArgDefinition, CustomArgDefinition, EnumArgDefinition, InferArg, InferArgs, KeyValueArgDefinition, NumberArgDefinition, ResolvedArgValue, StringArgDefinition, StringArgElementConfig, WithArgPresence, WithVariadic, WithoutArgElementEligibility, arg, createArgSchema } from "./core/schema/arg.mjs";
9
13
  import { Middleware, MiddlewareHandler, MiddlewareParams, middleware } from "./core/schema/middleware.mjs";
10
- import { WriteFn } from "./core/output/writer.mjs";
11
- import { Verbosity } from "./core/output/contracts.mjs";
12
- import { OutputOptions, createOutput } from "./core/output/index.mjs";
13
- import { PromptEngine, ReadFn, ResolvedMultiselectPromptConfig, ResolvedPromptConfig, ResolvedSelectPromptConfig, createTerminalPrompter, resolvePromptConfig } from "./core/prompt/index.mjs";
14
- import { DeprecationWarning, ResolveOptions, ResolveResult } from "./core/resolve/contracts.mjs";
15
- import { resolve } from "./core/resolve/index.mjs";
16
- import { BeforeParseParams, CLIPlugin, CLIPluginHooks, PluginCommandContext, ResolvedCommandParams, plugin } from "./core/cli/plugin.mjs";
14
+ import { InputSources, ResolutionProvenance, SourcesOf, wasExplicit } from "./core/schema/provenance.mjs";
15
+ import { ActionHandler, ActionParams, CommandArgEntry, CommandArgEntryDefinition, CommandBuilder, CommandDefinition, CommandExample, CommandMeta, CommandSchema, DeriveHandler, DeriveParams, ExampleCommand, ExampleMeta, InteractiveParams, InteractiveResolver, InteractiveResult, Out, command, createCommandSchema, group, resolveExampleCommand } from "./core/schema/command.mjs";
17
16
  import { CLIError, CLIErrorJSON, CLIErrorOptions, ErrorCode, ParseError, ParseErrorCode, ParseErrorOptions, ValidationError, ValidationErrorCode, ValidationErrorOptions, isCLIError, isParseError, isValidationError } from "./core/errors/index.mjs";
18
17
  import { HelpTheme, HelpThemeFactory } from "./core/help/theme.mjs";
19
18
  import { osc8, visibleWidth } from "./core/help/ansi.mjs";
20
19
  import { HelpOptions, formatHelp } from "./core/help/index.mjs";
20
+ import { WriteFn } from "./core/output/writer.mjs";
21
+ import { OutputOptions, createOutput } from "./core/output/index.mjs";
22
+ import { PromptEngine, ReadFn, ResolvedMultiselectPromptConfig, ResolvedPromptConfig, ResolvedSelectPromptConfig, createTerminalPrompter, resolvePromptConfig } from "./core/prompt/index.mjs";
21
23
  import { RunResult } from "./core/schema/run.mjs";
22
- import { ActionHandler, ActionParams, AnyCommandBuilder, CommandArgEntry, CommandBuilder, CommandConfig, CommandExample, CommandMeta, CommandSchema, DeriveHandler, DeriveParams, ExampleCommand, ExampleMeta, InteractiveParams, InteractiveResolver, InteractiveResult, Out, command, group, resolveExampleCommand } from "./core/schema/command.mjs";
23
24
  import "./core/schema/index.mjs";
24
25
  import { ParseOptions, ParseResult, Token, includesBeforeSeparator, parse, stripBeforeSeparator, tokenize } from "./core/parse/index.mjs";
25
- import { ManifestDiscoveryOptions, PackageJsonAdapter, PackageJsonData, PackageRepository, PackageRepositoryUrlOptions, discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl } from "./core/config/package-json.mjs";
26
+ import { DeprecationWarning, ResolutionProvenanceRecord, ResolveOptions, ResolveResult } from "./core/resolve/contracts.mjs";
27
+ import { resolve } from "./core/resolve/index.mjs";
28
+ import { BeforeParseParams, CLIPlugin, CLIPluginHooks, PluginCommandContext, ResolvedCommandParams, plugin } from "./core/cli/plugin.mjs";
26
29
  import { HelpLinks } from "./core/cli/help-links.mjs";
27
30
  import { CompletionOptions } from "./core/completion/shells/shared.mjs";
28
31
  import { generateBashCompletion } from "./core/completion/shells/bash.mjs";
@@ -30,8 +33,10 @@ import { generateFishCompletion } from "./core/completion/shells/fish.mjs";
30
33
  import { generatePowerShellCompletion } from "./core/completion/shells/powershell.mjs";
31
34
  import { generateZshCompletion } from "./core/completion/shells/zsh.mjs";
32
35
  import { SHELLS, Shell, generateCompletion } from "./core/completion/index.mjs";
36
+ import { ManifestDiscoveryOptions, PackageJsonAdapter, PackageJsonData, PackageRepository, PackageRepositoryUrlOptions, discoverManifest, inferCliName, packageRepositoryUrl } from "./core/config/package-json.mjs";
33
37
  import { ConfigAdapter, ConfigDiscoveryOptions, ConfigDiscoveryResult, ConfigFound, ConfigNotFound, FormatLoader, buildConfigSearchPaths, configFormat, discoverConfig } from "./core/config/index.mjs";
34
- import { CLIBuilder, CLIOptions, CLIRunOptions, CLISchema, ConfigSettings, DefaultCommandOptions, InferNameOption, ManifestPresetSettings, ManifestSettings, PackageJsonSettings, RenderContext, RenderContextOptions, ResolvedManifestSettings, cli, isMainModule, resolveRenderContext } from "./core/cli/index.mjs";
35
- import { JsonSchemaOptions, definitionMetaSchema, generateCommandSchema, generateInputSchema, generateSchema } from "./core/json-schema/index.mjs";
38
+ import { CLIBuilder, CLIDefinition, CLIExecuteOptions, CLIOptions, CLIRunOptions, CLISchema, CompletionsFlagConfig, ConfigSettings, ConfigSettingsDefinition, DefaultCommandOptions, HelpConfig, InferNameOption, ManifestSettings, RenderContext, RenderContextOptions, ResolvedManifestSettings, cli, createCLISchema, isMainModule, resolveRenderContext } from "./core/cli/index.mjs";
39
+ import { ArgDefinitionFragmentV1, ArgElementFragmentV1, CommandDefinitionDocument, CommandDefinitionDocumentV1, CommandDefinitionFragmentV1, DEFINITION_SCHEMA_URL, DEFINITION_SCHEMA_VERSION, DefinitionDocument, DefinitionDocumentV1, ExampleDefinitionFragmentV1, FlagDefinitionFragmentV1, FlagNegationFragmentV1, FlagPathChecksFragmentV1, FlagStringConstraintsFragmentV1, InputSchemaBranch, InputSchemaDocument, InputSchemaProperty, JsonSchemaOptions, PromptChoiceFragmentV1, PromptDefinitionFragmentV1, SourceSplitFragmentV1, SplitPolicyFragmentV1, StdinBindingFragmentV1, definitionMetaSchema, generateCommandSchema, generateInputSchema, generateSchema } from "./core/json-schema/index.mjs";
40
+ import { FlagMap, ReadFlagsOptions, readFlags } from "./core/read-flags/index.mjs";
36
41
  import { Colors } from "ansispeck";
37
- export { type ActionHandler, type ActionParams, type ActivityEvent, type AnyCommandBuilder, ArgBuilder, type ArgConfig, type ArgFactory, type ArgKind, type ArgParseFn, type ArgPresence, type ArgSchema, type BeforeParseParams, CLIBuilder, CLIError, type CLIErrorJSON, type CLIErrorOptions, type CLIOptions, type CLIPlugin, type CLIPluginHooks, type CLIRunOptions, type CLISchema, type Colors, type CommandArgEntry, CommandBuilder, type CommandConfig, type CommandExample, type CommandMeta, type CommandSchema, type CompletionOptions, type ConfigAdapter, type ConfigDiscoveryOptions, type ConfigDiscoveryResult, type ConfigFound, type ConfigNotFound, type ConfigSettings, type ConfirmPromptConfig, type DateFlagOptions, type DefaultCommandOptions, type DeprecationWarning, type DeriveHandler, type DeriveParams, type DuplicatePolicy, type ErrorCode, type ExampleCommand, type ExampleMeta, type Fallback, FlagBuilder, type FlagConfig, type FlagFactory, type FlagKind, type FlagNegation, type FlagParseFn, type FlagPresence, type FlagSchema, type FormatLoader, type HelpLinks, type HelpOptions, type HelpTheme, type HelpThemeFactory, type InferArg, type InferArgs, type InferFlag, type InferFlags, type InferNameOption, type InferStandardInput, type InferStandardOutput, type InputPromptConfig, type InteractiveParams, type InteractiveResolver, type InteractiveResult, type JsonSchemaOptions, type ManifestDiscoveryOptions, type ManifestPresetSettings, type ManifestSettings, type Middleware, type MiddlewareHandler, type MiddlewareParams, type MultiselectPromptConfig, type NumberConstraintViolation, type NumberConstraints, type Out, type OutputOptions, type PackageJsonAdapter, type PackageJsonData, type PackageJsonSettings, type PackageRepository, type PackageRepositoryUrlOptions, ParseError, type ParseErrorCode, type ParseErrorOptions, type ParseOptions, type ParseResult, type PathChecks, type PathFlagOptions, type PluginCommandContext, type ProgressHandle, type ProgressOptions, type PromptConfig, type PromptConfigBase, type PromptEngine, type PromptKind, type PromptResult, type ReadFn, type RenderContext, type RenderContextOptions, type ResolveOptions, type ResolveResult, type ResolvedArgValue, type ResolvedCommandParams, type ResolvedManifestSettings, type ResolvedMultiselectPromptConfig, type ResolvedPromptConfig, type ResolvedSelectPromptConfig, type ResolvedValue, type RunResult, SHELLS, type SelectChoice, type SelectPromptConfig, type Shell, type SpinnerHandle, type SpinnerOptions, type StandardSchemaV1, type StandardSchemaV1FailureResult, type StandardSchemaV1Issue, type StandardSchemaV1Options, type StandardSchemaV1PathSegment, type StandardSchemaV1Props, type StandardSchemaV1Result, type StandardSchemaV1SuccessResult, type StandardSchemaV1Types, type StringConstraintViolation, type StringConstraints, 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 WriteFn, arg, buildConfigSearchPaths, cli, command, configFormat, createArgSchema, createOutput, createSchema, createTerminalPrompter, definitionMetaSchema, discoverConfig, discoverManifest, discoverPackageJson, flag, formatHelp, generateBashCompletion, generateCommandSchema, generateCompletion, generateFishCompletion, generateInputSchema, generatePowerShellCompletion, generateSchema, generateZshCompletion, getFlagNegatedName, group, includesBeforeSeparator, inferCliName, isCLIError, isMainModule, isParseError, isValidationError, middleware, osc8, packageRepositoryUrl, parse, plugin, resolve, resolveExampleCommand, resolvePromptConfig, resolveRenderContext, stripBeforeSeparator, tokenize, visibleWidth };
42
+ 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 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 CompletionsFlagConfig, type ConfigAdapter, type ConfigDiscoveryOptions, type ConfigDiscoveryResult, type ConfigFound, type ConfigNotFound, 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 DefinitionDocument, type DefinitionDocumentV1, type DeprecationWarning, type DeriveHandler, type DeriveParams, type DuplicateKeys, type DuplicatePolicy, type EnumArgDefinition, type EnumFlagDefinition, type ErrorCode, type ExampleCommand, type ExampleDefinitionFragmentV1, type ExampleMeta, type Fallback, FlagBuilder, type FlagConfig, type FlagDefinition, type FlagDefinitionBase, type FlagDefinitionByKind, type FlagDefinitionFragmentV1, type FlagDefinitionOverrides, 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 HelpLinks, type HelpOptions, type HelpTheme, type HelpThemeFactory, type InferArg, type InferArgs, type InferFlag, type InferFlags, type InferNameOption, 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 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 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, buildConfigSearchPaths, cli, command, configFormat, createArgSchema, createCLISchema, createCommandSchema, createFlagSchema, createOutput, createTerminalPrompter, definitionMetaSchema, discoverConfig, discoverManifest, flag, formatHelp, generateBashCompletion, generateCommandSchema, generateCompletion, generateFishCompletion, generateInputSchema, generatePowerShellCompletion, generateSchema, generateZshCompletion, getFlagNegatedName, group, includesBeforeSeparator, inferCliName, isCLIError, isMainModule, isParseError, isValidationError, middleware, osc8, packageRepositoryUrl, parse, plugin, readFlags, resolve, resolveExampleCommand, resolvePromptConfig, resolveRenderContext, stripBeforeSeparator, tokenize, visibleWidth, wasExplicit };
package/dist/index.mjs CHANGED
@@ -1,8 +1,11 @@
1
1
  import { CLIError, ParseError, ValidationError, isCLIError, isParseError, isValidationError } from "./core/errors/index.mjs";
2
- import { FlagBuilder, createSchema, flag, getFlagNegatedName } from "./core/schema/flag.mjs";
2
+ import { DUPLICATE_KEYS, SPLIT_FORMATS } from "./core/schema/cardinality.mjs";
3
+ import { FlagBuilder, createFlagSchema, flag, getFlagNegatedName } from "./core/schema/flag.mjs";
3
4
  import { ArgBuilder, arg, createArgSchema } from "./core/schema/arg.mjs";
4
- import { CommandBuilder, command, group, resolveExampleCommand } from "./core/schema/command.mjs";
5
+ import { CommandBuilder, command, createCommandSchema, group, resolveExampleCommand } from "./core/schema/command.mjs";
5
6
  import { middleware } from "./core/schema/middleware.mjs";
7
+ import { wasExplicit } from "./core/schema/provenance.mjs";
8
+ import "./core/schema/index.mjs";
6
9
  import { includesBeforeSeparator, parse, stripBeforeSeparator, tokenize } from "./core/parse/index.mjs";
7
10
  import { generateBashCompletion } from "./core/completion/shells/bash.mjs";
8
11
  import { generateFishCompletion } from "./core/completion/shells/fish.mjs";
@@ -11,12 +14,13 @@ import { generateZshCompletion } from "./core/completion/shells/zsh.mjs";
11
14
  import { SHELLS, generateCompletion } from "./core/completion/index.mjs";
12
15
  import { osc8, visibleWidth } from "./core/help/ansi.mjs";
13
16
  import { formatHelp } from "./core/help/index.mjs";
14
- import { definitionMetaSchema, generateCommandSchema, generateInputSchema, generateSchema } from "./core/json-schema/index.mjs";
17
+ import { DEFINITION_SCHEMA_URL, DEFINITION_SCHEMA_VERSION, definitionMetaSchema, generateCommandSchema, generateInputSchema, generateSchema } from "./core/json-schema/index.mjs";
15
18
  import { createOutput } from "./core/output/index.mjs";
16
19
  import { createTerminalPrompter, resolvePromptConfig } from "./core/prompt/index.mjs";
17
20
  import { resolve } from "./core/resolve/index.mjs";
18
- import { discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl } from "./core/config/package-json.mjs";
21
+ import { discoverManifest, inferCliName, packageRepositoryUrl } from "./core/config/package-json.mjs";
19
22
  import { plugin } from "./core/cli/plugin.mjs";
20
23
  import { buildConfigSearchPaths, configFormat, discoverConfig } from "./core/config/index.mjs";
21
- import { CLIBuilder, cli, isMainModule, resolveRenderContext } from "./core/cli/index.mjs";
22
- export { ArgBuilder, CLIBuilder, CLIError, CommandBuilder, FlagBuilder, ParseError, SHELLS, ValidationError, arg, buildConfigSearchPaths, cli, command, configFormat, createArgSchema, createOutput, createSchema, createTerminalPrompter, definitionMetaSchema, discoverConfig, discoverManifest, discoverPackageJson, flag, formatHelp, generateBashCompletion, generateCommandSchema, generateCompletion, generateFishCompletion, generateInputSchema, generatePowerShellCompletion, generateSchema, generateZshCompletion, getFlagNegatedName, group, includesBeforeSeparator, inferCliName, isCLIError, isMainModule, isParseError, isValidationError, middleware, osc8, packageRepositoryUrl, parse, plugin, resolve, resolveExampleCommand, resolvePromptConfig, resolveRenderContext, stripBeforeSeparator, tokenize, visibleWidth };
24
+ import { CLIBuilder, cli, createCLISchema, isMainModule, resolveRenderContext } from "./core/cli/index.mjs";
25
+ import { readFlags } from "./core/read-flags/index.mjs";
26
+ export { ArgBuilder, CLIBuilder, CLIError, CommandBuilder, DEFINITION_SCHEMA_URL, DEFINITION_SCHEMA_VERSION, DUPLICATE_KEYS, FlagBuilder, ParseError, SHELLS, SPLIT_FORMATS, ValidationError, arg, buildConfigSearchPaths, cli, command, configFormat, createArgSchema, createCLISchema, createCommandSchema, createFlagSchema, createOutput, createTerminalPrompter, definitionMetaSchema, discoverConfig, discoverManifest, flag, formatHelp, generateBashCompletion, generateCommandSchema, generateCompletion, generateFishCompletion, generateInputSchema, generatePowerShellCompletion, generateSchema, generateZshCompletion, getFlagNegatedName, group, includesBeforeSeparator, inferCliName, isCLIError, isMainModule, isParseError, isValidationError, middleware, osc8, packageRepositoryUrl, parse, plugin, readFlags, resolve, resolveExampleCommand, resolvePromptConfig, resolveRenderContext, stripBeforeSeparator, tokenize, visibleWidth, wasExplicit };
@@ -90,7 +90,7 @@ interface RuntimeAdapter {
90
90
  *
91
91
  * Used by `flag.path()` existence/type checks after resolution.
92
92
  */
93
- readonly stat: (path: string) => Promise<'file' | 'directory' | null>;
93
+ readonly stat: (path: string) => Promise<"file" | "directory" | null>;
94
94
  /**
95
95
  * Create a directory, including missing parents.
96
96
  *
@@ -217,7 +217,7 @@ interface TestAdapterOptions {
217
217
  * })
218
218
  * ```
219
219
  */
220
- readonly stat?: (path: string) => Promise<'file' | 'directory' | null>;
220
+ readonly stat?: (path: string) => Promise<"file" | "directory" | null>;
221
221
  /**
222
222
  * Directory creation stub for `flag.path()` `create` checks (defaults to
223
223
  * a noop that resolves without creating anything).
@@ -250,7 +250,7 @@ interface TestAdapterOptions {
250
250
  */
251
251
  declare class ExitError extends Error {
252
252
  /** Error name — always `'ExitError'` for `instanceof` checks. */
253
- readonly name = "ExitError";
253
+ override readonly name = "ExitError";
254
254
  /** The exit code passed to `exit()`. */
255
255
  readonly code: number;
256
256
  /** Create an ExitError for the given process exit code. */
@@ -13,7 +13,7 @@ import { RuntimeAdapter } from "./adapter.mjs";
13
13
  interface DenoNamespace {
14
14
  /** Build target metadata (OS detection). */
15
15
  readonly build: {
16
- readonly os: 'darwin' | 'linux' | 'android' | 'windows' | 'freebsd' | 'netbsd' | 'aix' | 'solaris' | 'illumos';
16
+ readonly os: "darwin" | "linux" | "android" | "windows" | "freebsd" | "netbsd" | "aix" | "solaris" | "illumos";
17
17
  };
18
18
  /** Deno version info — used for minimum-version guard. */
19
19
  readonly version?: {
@@ -43,9 +43,9 @@ interface DenoNamespace {
43
43
  readonly rows: number;
44
44
  };
45
45
  /** Register a native signal listener. */
46
- addSignalListener?(signal: 'SIGWINCH', listener: () => void): void;
46
+ addSignalListener?(signal: "SIGWINCH", listener: () => void): void;
47
47
  /** Remove a native signal listener. */
48
- removeSignalListener?(signal: 'SIGWINCH', listener: () => void): void;
48
+ removeSignalListener?(signal: "SIGWINCH", listener: () => void): void;
49
49
  /** Standard error — synchronous byte writer. */
50
50
  readonly stderr: {
51
51
  /** Write raw bytes to stderr synchronously. */
@@ -24,7 +24,7 @@
24
24
  * - `'deno'` — Deno
25
25
  * - `'unknown'` — Unrecognized environment
26
26
  */
27
- type Runtime = 'node' | 'bun' | 'deno' | 'unknown';
27
+ type Runtime = "node" | "bun" | "deno" | "unknown";
28
28
  /**
29
29
  * All known runtime values as a readonly tuple.
30
30
  *
@@ -37,7 +37,7 @@ type Runtime = 'node' | 'bun' | 'deno' | 'unknown';
37
37
  * }
38
38
  * ```
39
39
  */
40
- declare const RUNTIMES: readonly ['node', 'bun', 'deno', 'unknown'];
40
+ declare const RUNTIMES: readonly ["node", "bun", "deno", "unknown"];
41
41
  /**
42
42
  * Minimal `globalThis` shape used for runtime detection.
43
43
  *
@@ -33,9 +33,9 @@ interface NodeProcess {
33
33
  readonly columns?: number;
34
34
  readonly rows?: number;
35
35
  getWindowSize?(): readonly [number, number];
36
- on?(event: 'resize', listener: () => void): unknown;
37
- off?(event: 'resize', listener: () => void): unknown;
38
- removeListener?(event: 'resize', listener: () => void): unknown;
36
+ on?(event: "resize", listener: () => void): unknown;
37
+ off?(event: "resize", listener: () => void): unknown;
38
+ removeListener?(event: "resize", listener: () => void): unknown;
39
39
  write(data: string): unknown;
40
40
  };
41
41
  /** Standard error stream with write. */
@@ -1,31 +1 @@
1
- //#region src/runtime/paths.d.ts
2
- /**
3
- * Shared env-based path resolution for runtime adapters.
4
- *
5
- * Node, Bun, and Deno all need the same user home/config directory behavior.
6
- * These helpers keep the fallback chain identical across runtimes while
7
- * letting each adapter supply its own platform detection.
8
- *
9
- * @module @kjanat/dreamcli/runtime/paths
10
- */
11
- /**
12
- * Resolve the user's home directory from environment variables.
13
- *
14
- * @param env - Environment variable map.
15
- * @param isWindows - Whether the platform is Windows.
16
- * @returns Absolute path to the home directory.
17
- * @internal
18
- */
19
- declare function resolveHomeDirectory(env: Readonly<Record<string, string | undefined>>, isWindows: boolean): string;
20
- /**
21
- * Resolve the user's config directory (`XDG_CONFIG_HOME` / `APPDATA`).
22
- *
23
- * @param env - Environment variable map.
24
- * @param isWindows - Whether the platform is Windows.
25
- * @param homedir - Pre-resolved home directory (from {@link resolveHomeDirectory}).
26
- * @returns Absolute path to the config directory.
27
- * @internal
28
- */
29
- declare function resolveConfigDirectory(env: Readonly<Record<string, string | undefined>>, isWindows: boolean, homedir: string): string;
30
- //#endregion
31
- export { resolveConfigDirectory, resolveHomeDirectory };
1
+ export {}
@@ -1,7 +1,7 @@
1
1
  import { ExitError, RuntimeAdapter, TerminalSize } from "./runtime/adapter.mjs";
2
- import { RUNTIMES, Runtime, detectRuntime } from "./runtime/detect.mjs";
2
+ import { GlobalForDetect, RUNTIMES, Runtime, detectRuntime } from "./runtime/detect.mjs";
3
3
  import { createAdapter } from "./runtime/auto.mjs";
4
- import { createDenoAdapter } from "./runtime/deno.mjs";
5
- import { createNodeAdapter } from "./runtime/node.mjs";
4
+ import { DenoNamespace, createDenoAdapter } from "./runtime/deno.mjs";
5
+ import { NodeProcess, createNodeAdapter } from "./runtime/node.mjs";
6
6
  import "./runtime/index.mjs";
7
- export { ExitError, RUNTIMES, type Runtime, type RuntimeAdapter, type TerminalSize, createAdapter, createDenoAdapter, createNodeAdapter, detectRuntime };
7
+ export { type DenoNamespace, ExitError, type GlobalForDetect, type NodeProcess, RUNTIMES, type Runtime, type RuntimeAdapter, type TerminalSize, createAdapter, createDenoAdapter, createNodeAdapter, detectRuntime };
@@ -8,20 +8,5 @@
8
8
  declare const SLASH = 47;
9
9
  /** Character code for `\` (backslash). */
10
10
  declare const BACKSLASH = 92;
11
- /**
12
- * Remove trailing characters whose code points appear in `codes`.
13
- *
14
- * Linear-time replacement for trailing-character regexes such as
15
- * `/[\\/]+$/`. Those patterns are polynomial-ReDoS prone: the engine
16
- * greedily consumes the run, fails the end anchor, backtracks one
17
- * character at a time, and repeats that work from every start position —
18
- * O(n²) on adversarial input. This scan is O(n) with no backtracking.
19
- *
20
- * @param input - Source string.
21
- * @param codes - Character codes to strip from the end of `input`.
22
- * @returns `input` with all trailing matching characters removed.
23
- * @internal
24
- */
25
- declare function stripTrailing(input: string, codes: readonly number[]): string;
26
11
  //#endregion
27
- export { BACKSLASH, SLASH, stripTrailing };
12
+ export { BACKSLASH, SLASH };
@@ -2,6 +2,6 @@ import { CapturedOutput, createCaptureOutput } from "./core/output/index.mjs";
2
2
  import { PROMPT_CANCEL, TestAnswer, TestPrompterOptions, createTestPrompter } from "./core/prompt/index.mjs";
3
3
  import { RunOptions, RunResult } from "./core/schema/run.mjs";
4
4
  import { TestAdapterOptions, createTestAdapter } from "./runtime/adapter.mjs";
5
- import { runCommand } from "./core/testkit/index.mjs";
5
+ import { RunCommandOptions, runCommand } from "./core/testkit/index.mjs";
6
6
  import "./runtime/index.mjs";
7
- export { type CapturedOutput, PROMPT_CANCEL, type RunOptions, type RunResult, type TestAdapterOptions, type TestAnswer, type TestPrompterOptions, createCaptureOutput, createTestAdapter, createTestPrompter, runCommand };
7
+ export { type CapturedOutput, PROMPT_CANCEL, type RunCommandOptions, type RunOptions, type RunResult, type TestAdapterOptions, type TestAnswer, type TestPrompterOptions, createCaptureOutput, createTestAdapter, createTestPrompter, runCommand };
package/dist/testkit.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createCaptureOutput } from "./core/output/index.mjs";
2
2
  import { PROMPT_CANCEL, createTestPrompter } from "./core/prompt/index.mjs";
3
- import { runCommand } from "./core/testkit/index.mjs";
4
3
  import { createTestAdapter } from "./runtime/adapter.mjs";
4
+ import { runCommand } from "./core/testkit/index.mjs";
5
5
  export { PROMPT_CANCEL, createCaptureOutput, createTestAdapter, createTestPrompter, runCommand };
@@ -1,17 +1,4 @@
1
1
  //#region src/version.d.ts
2
- /**
3
- * DreamCLI's own build-time version constants.
4
- *
5
- * Not the app version configured via `cli().version(...)` — these identify
6
- * the framework build itself (diagnostics, bug reports, completion-script
7
- * stamps). Kept on a dedicated subpath so they stay out of root-entrypoint
8
- * import completions.
9
- *
10
- * Replaced by tsdown `define` during bundling. In development (unbundled),
11
- * the declared globals resolve to the `'dev'` fallback.
12
- *
13
- * @module @kjanat/dreamcli/version
14
- */
15
2
  /** Package version (e.g. `"0.9.1"`). `"dev"` when running unbundled. */
16
3
  declare const DREAMCLI_VERSION: string;
17
4
  /** Git short SHA (e.g. `"f9b5f1a"`). `"dev"` when running unbundled. */
package/dist/version.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  //#region src/version.ts
2
2
  /** Package version (e.g. `"0.9.1"`). `"dev"` when running unbundled. */
3
- const DREAMCLI_VERSION = "3.0.1";
3
+ const DREAMCLI_VERSION = "4.0.0-rc.2";
4
4
  /** Git short SHA (e.g. `"f9b5f1a"`). `"dev"` when running unbundled. */
5
- const DREAMCLI_REVISION = "7379236";
5
+ const DREAMCLI_REVISION = "879b2b8";
6
6
  //#endregion
7
7
  export { DREAMCLI_REVISION, DREAMCLI_VERSION };