@kjanat/dreamcli 3.0.0-rc.15 → 3.0.0-rc.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,41 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [3.0.0-rc.17] - 2026-07-20
11
+
12
+ ### Added
13
+
14
+ - **`out.status()`** — a success/status line channel that writes to **stderr**
15
+ (stdout stays clean for piping) and is suppressed under quiet verbosity.
16
+ `info` remains stdout-bound; `warn`/`error` remain always-emitted.
17
+ - **Global `--quiet`/`-q` flag** — sets quiet verbosity on every CLI, wired
18
+ like `--json`: detected and stripped at the root before dispatch (command
19
+ schemas never see it), honoring the `--` separator so a literal `-q`
20
+ positional reaches the command unchanged. Listed under root help's
21
+ `Global options:`.
22
+
23
+ ### Fixed
24
+
25
+ - **`.run()` misread a post-separator `--json`** — runtime preflight used a
26
+ naive `includes('--json')`, so `mycli cmd -- --json` entered JSON mode via
27
+ the adapter path even though `.execute()` correctly treats it as a
28
+ positional. Preflight now uses the `--`-aware detection.
29
+
30
+ ## [3.0.0-rc.16] - 2026-07-20
31
+
32
+ ### Added
33
+
34
+ - **`resolveRenderContext(argv, options?)`** — pre-`run()` probe returning the
35
+ output decisions the framework will make for a given argv: `jsonMode`
36
+ (`--`-aware `--json` detection), `isTTY`, the gated `color` palette, and
37
+ `isHyperlinkSupported`. Computed with the same composition `.execute()`/
38
+ `.run()` feed into the output channel, so content styled before `run()` —
39
+ banners, hand-rendered help — matches the channel that will actually render,
40
+ with zero argv re-parsing.
41
+ - **`includesBeforeSeparator` / `stripBeforeSeparator`** exported from the
42
+ package root — the `--`-aware root-flag primitives, for consumers who only
43
+ need correct flag detection.
44
+
10
45
  ## [3.0.0-rc.15] - 2026-07-20
11
46
 
12
47
  ### Added
@@ -1300,7 +1335,9 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1300
1335
  - MIT License.
1301
1336
  - Markdownlint configuration.
1302
1337
 
1303
- [Unreleased]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.15...HEAD
1338
+ [Unreleased]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.17...HEAD
1339
+ [3.0.0-rc.17]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.16...v3.0.0-rc.17
1340
+ [3.0.0-rc.16]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.15...v3.0.0-rc.16
1304
1341
  [3.0.0-rc.15]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.14...v3.0.0-rc.15
1305
1342
  [3.0.0-rc.14]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.13...v3.0.0-rc.14
1306
1343
  [3.0.0-rc.13]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.12...v3.0.0-rc.13
@@ -13,6 +13,7 @@ import { CompletionOptions } from "../completion/shells/shared.mjs";
13
13
  import { Shell } from "../completion/index.mjs";
14
14
  import { FormatLoader } from "../config/index.mjs";
15
15
  import { formatRootHelp } from "./root-help.mjs";
16
+ import { Colors } from "ansispeck";
16
17
  //#region src/core/cli/index.d.ts
17
18
  /**
18
19
  * Runtime descriptor for the CLI program.
@@ -287,6 +288,82 @@ interface CLIRunOptions extends Omit<RunOptions, 'meta' | 'mergedSchema'> {
287
288
  */
288
289
  readonly adapter?: RuntimeAdapter;
289
290
  }
291
+ /**
292
+ * Inputs for {@linkcode resolveRenderContext}. Pass the host facts (TTY
293
+ * status, environment) and any explicit overrides; the resolver applies the
294
+ * same gating `.execute()`/`.run()` feed into the output channel.
295
+ */
296
+ interface RenderContextOptions {
297
+ /**
298
+ * Whether stdout is connected to a TTY (e.g. `process.stdout.isTTY`).
299
+ *
300
+ * @defaultValue `false`
301
+ */
302
+ readonly isTTY?: boolean;
303
+ /**
304
+ * Force JSON mode on regardless of argv.
305
+ *
306
+ * @defaultValue detected from a pre-separator `--json` in `argv`
307
+ */
308
+ readonly jsonMode?: boolean;
309
+ /**
310
+ * Explicitly enable or disable colors, winning over the auto-gate.
311
+ *
312
+ * @defaultValue auto — `isTTY && !jsonMode` and environment support
313
+ */
314
+ readonly color?: boolean;
315
+ /**
316
+ * Environment variables consulted for `NO_HYPERLINKS`/`FORCE_HYPERLINKS`
317
+ * (e.g. `process.env`).
318
+ *
319
+ * @defaultValue `{}`
320
+ */
321
+ readonly env?: Readonly<Record<string, string | undefined>>;
322
+ }
323
+ /**
324
+ * The output decisions the framework will make for a given argv, resolved
325
+ * before `.run()`.
326
+ */
327
+ interface RenderContext {
328
+ /** Whether a pre-separator `--json` puts the run in JSON mode. */
329
+ readonly jsonMode: boolean;
330
+ /** The TTY status the output channel will carry. */
331
+ readonly isTTY: boolean;
332
+ /**
333
+ * The gated ANSI palette the output channel will expose as `out.color` —
334
+ * identity formatters when color is off; `color.isColorSupported` is the
335
+ * boolean gate.
336
+ */
337
+ readonly color: Colors;
338
+ /** Whether OSC 8 hyperlinks should be emitted (see `out.isHyperlinkSupported`). */
339
+ readonly isHyperlinkSupported: boolean;
340
+ }
341
+ /**
342
+ * Resolve the render context for content built before `.run()`.
343
+ *
344
+ * Content styled ahead of execution — hand-rendered banners, custom help, or
345
+ * anything else emitted outside an action handler — has no `out` to consult,
346
+ * which pushes consumers into re-deriving the framework's decisions from raw
347
+ * argv (`argv.includes('--json')` misreads a post-`--` literal). This probe
348
+ * runs the same composition `.execute()`/`.run()` feed into the output
349
+ * channel — `--`-aware `--json` detection, the color gate, and the hyperlink
350
+ * override — so pre-run styling matches the channel that will render.
351
+ *
352
+ * @param argv - Raw argv tokens (NOT including the binary/script path,
353
+ * i.e. equivalent to `process.argv.slice(2)`).
354
+ * @param options - Host facts and overrides.
355
+ * @returns The resolved output decisions.
356
+ *
357
+ * @example
358
+ * ```ts
359
+ * const ctx = resolveRenderContext(process.argv.slice(2), {
360
+ * isTTY: process.stdout.isTTY === true,
361
+ * env: process.env,
362
+ * });
363
+ * const banner = ctx.color.bold('mycli');
364
+ * ```
365
+ */
366
+ declare function resolveRenderContext(argv: readonly string[], options?: RenderContextOptions): RenderContext;
290
367
  /**
291
368
  * Options for {@linkcode CLIBuilder.default | .default()}.
292
369
  */
@@ -846,4 +923,4 @@ declare function cli(options: CLIOptions): CLIBuilder;
846
923
  */
847
924
  declare function isMainModule(meta: ImportMeta): boolean;
848
925
  //#endregion
849
- export { type BeforeParseParams, CLIBuilder, type CLIOptions, type CLIPlugin, type CLIPluginHooks, type CLIRunOptions, type CLISchema, type CompletionsFlagConfig, type ConfigSettings, type DefaultCommandOptions, type HelpConfig, type HelpLinks, type InferNameOption, type ManifestPresetSettings, type ManifestSettings, type PackageJsonSettings, type PluginCommandContext, type ResolvedCommandParams, type ResolvedManifestSettings, cli, formatRootHelp, isMainModule, plugin };
926
+ export { type BeforeParseParams, CLIBuilder, type CLIOptions, type CLIPlugin, type CLIPluginHooks, type CLIRunOptions, type CLISchema, type CompletionsFlagConfig, type ConfigSettings, type DefaultCommandOptions, type HelpConfig, type HelpLinks, type InferNameOption, type ManifestPresetSettings, type ManifestSettings, type PackageJsonSettings, type PluginCommandContext, type RenderContext, type RenderContextOptions, type ResolvedCommandParams, type ResolvedManifestSettings, cli, formatRootHelp, isMainModule, plugin, resolveRenderContext };
@@ -100,6 +100,45 @@ function eraseCommand(cmd) {
100
100
  };
101
101
  }
102
102
  /**
103
+ * Resolve the render context for content built before `.run()`.
104
+ *
105
+ * Content styled ahead of execution — hand-rendered banners, custom help, or
106
+ * anything else emitted outside an action handler — has no `out` to consult,
107
+ * which pushes consumers into re-deriving the framework's decisions from raw
108
+ * argv (`argv.includes('--json')` misreads a post-`--` literal). This probe
109
+ * runs the same composition `.execute()`/`.run()` feed into the output
110
+ * channel — `--`-aware `--json` detection, the color gate, and the hyperlink
111
+ * override — so pre-run styling matches the channel that will render.
112
+ *
113
+ * @param argv - Raw argv tokens (NOT including the binary/script path,
114
+ * i.e. equivalent to `process.argv.slice(2)`).
115
+ * @param options - Host facts and overrides.
116
+ * @returns The resolved output decisions.
117
+ *
118
+ * @example
119
+ * ```ts
120
+ * const ctx = resolveRenderContext(process.argv.slice(2), {
121
+ * isTTY: process.stdout.isTTY === true,
122
+ * env: process.env,
123
+ * });
124
+ * const banner = ctx.color.bold('mycli');
125
+ * ```
126
+ */
127
+ function resolveRenderContext(argv, options) {
128
+ const out = createOutput({
129
+ jsonMode: includesBeforeSeparator(argv, "--json") || options?.jsonMode === true,
130
+ isTTY: options?.isTTY ?? false,
131
+ ...options?.color !== void 0 ? { color: options.color } : {},
132
+ ...hyperlinksOption(resolveHyperlinkOverride(options?.env ?? {}, argv))
133
+ });
134
+ return {
135
+ jsonMode: out.jsonMode,
136
+ isTTY: out.isTTY,
137
+ color: out.color,
138
+ isHyperlinkSupported: out.isHyperlinkSupported
139
+ };
140
+ }
141
+ /**
103
142
  * Conditional-spread wrapper for the output channel's `hyperlinks` option:
104
143
  * omit the key entirely when there is no override so `exactOptionalPropertyTypes`
105
144
  * stays happy and the channel falls back to `isTTY`.
@@ -545,8 +584,9 @@ var CLIBuilder = class CLIBuilder {
545
584
  */
546
585
  async execute(argv, options) {
547
586
  const jsonMode = includesBeforeSeparator(argv, "--json") || options?.jsonMode === true;
587
+ const verbosity = includesBeforeSeparator(argv, "--quiet") || includesBeforeSeparator(argv, "-q") ? "quiet" : options?.verbosity;
548
588
  const captureOptions = {
549
- ...options?.verbosity !== void 0 ? { verbosity: options.verbosity } : {},
589
+ ...verbosity !== void 0 ? { verbosity } : {},
550
590
  ...jsonMode ? { jsonMode } : {},
551
591
  ...options?.isTTY !== void 0 ? { isTTY: options.isTTY } : {},
552
592
  ...hyperlinksOption(resolveHyperlinkOverride(options?.env ?? {}, argv))
@@ -576,12 +616,13 @@ var CLIBuilder = class CLIBuilder {
576
616
  ...options,
577
617
  plugins: this.schema.plugins,
578
618
  ...jsonMode ? { jsonMode } : {},
619
+ ...verbosity !== void 0 ? { verbosity } : {},
579
620
  ...flagSettings !== void 0 ? { flags: flagSettings } : {}
580
621
  };
581
622
  const output = {
582
623
  jsonMode,
583
624
  isTTY: out.isTTY,
584
- verbosity: options?.verbosity ?? "normal"
625
+ verbosity: verbosity ?? "normal"
585
626
  };
586
627
  const planned = planInvocation({
587
628
  schema: options?.flags !== void 0 ? {
@@ -983,4 +1024,4 @@ function isMainModule(meta) {
983
1024
  return meta.main === true;
984
1025
  }
985
1026
  //#endregion
986
- export { CLIBuilder, cli, formatRootHelp, isMainModule, plugin };
1027
+ export { CLIBuilder, cli, formatRootHelp, isMainModule, plugin, resolveRenderContext };
@@ -190,6 +190,12 @@ function planCompletionsFlag(argv, config) {
190
190
  };
191
191
  }
192
192
  }
193
+ /** Root-level output flags stripped before dispatch (never part of a command schema). */
194
+ const ROOT_OUTPUT_FLAGS = /* @__PURE__ */ new Set([
195
+ "--json",
196
+ "--quiet",
197
+ "-q"
198
+ ]);
193
199
  /**
194
200
  * Decide what to do with an argv invocation before any command executes.
195
201
  *
@@ -202,7 +208,7 @@ function planInvocation(options) {
202
208
  const separatorIndex = options.argv.indexOf("--");
203
209
  const head = separatorIndex === -1 ? options.argv : options.argv.slice(0, separatorIndex);
204
210
  const tail = separatorIndex === -1 ? [] : options.argv.slice(separatorIndex);
205
- const filteredHead = head.includes("--json") ? head.filter((arg) => arg !== "--json") : head;
211
+ const filteredHead = head.some((arg) => ROOT_OUTPUT_FLAGS.has(arg)) ? head.filter((arg) => !ROOT_OUTPUT_FLAGS.has(arg)) : head;
206
212
  const filteredArgv = separatorIndex === -1 ? filteredHead : [...filteredHead, ...tail];
207
213
  const defaultCommand = options.schema.defaultCommand;
208
214
  const rootValueFlags = defaultCommand !== void 0 ? buildFlagLookup(defaultCommand.schema.flags, options.schema.flagSettings) : void 0;
@@ -202,6 +202,10 @@ function formatGlobalOptionsSection(schema, width, theme) {
202
202
  left: theme.flag("--json"),
203
203
  description: "Emit machine-readable JSON output"
204
204
  });
205
+ entries.push({
206
+ left: theme.flag("-q, --quiet"),
207
+ description: "Suppress informational output"
208
+ });
205
209
  if (schema.configSettings !== void 0) entries.push({
206
210
  left: `${theme.flag("--config")} ${theme.placeholder("<path>")}`,
207
211
  description: "Load configuration from the given file"
@@ -1,5 +1,5 @@
1
1
  import { CLIError, ParseError } from "../errors/index.mjs";
2
- import { parse } from "../parse/index.mjs";
2
+ import { includesBeforeSeparator, parse } from "../parse/index.mjs";
3
3
  import { createTerminalPrompter } from "../prompt/index.mjs";
4
4
  import { discoverManifest, inferCliName } from "../config/package-json.mjs";
5
5
  import { deriveHelpLinks } from "./help-links.mjs";
@@ -138,7 +138,8 @@ async function prepareRuntimePreflight(options) {
138
138
  configPath: void 0,
139
139
  filteredArgv: rawArgv
140
140
  };
141
- const jsonMode = filteredArgv.includes("--json") || options.options?.jsonMode === true;
141
+ const jsonMode = includesBeforeSeparator(filteredArgv, "--json") || options.options?.jsonMode === true;
142
+ const hasQuietFlag = includesBeforeSeparator(filteredArgv, "--quiet") || includesBeforeSeparator(filteredArgv, "-q");
142
143
  const isCompletions = isCompletionsInvocation(options.schema, filteredArgv);
143
144
  const schema = await applyPackageJsonDiscovery(options.schema, options.adapter, options.inheritedName, isCompletions);
144
145
  const loadedConfig = await loadRuntimeConfig(schema, options.adapter, configPath, isCompletions, options.options?.config);
@@ -157,7 +158,7 @@ async function prepareRuntimePreflight(options) {
157
158
  env: options.options?.env ?? options.adapter.env,
158
159
  isTTY: options.options?.isTTY ?? options.adapter.isTTY,
159
160
  jsonMode,
160
- verbosity: options.options?.verbosity ?? "normal",
161
+ verbosity: hasQuietFlag ? "quiet" : options.options?.verbosity ?? "normal",
161
162
  stat: options.options?.stat ?? options.adapter.stat,
162
163
  ...stdinData !== void 0 ? { stdinData } : {},
163
164
  ...options.options?.prompter !== void 0 ? { prompter: options.options.prompter } : autoPrompter !== void 0 ? { prompter: autoPrompter } : {},
@@ -71,7 +71,7 @@ declare const outputContract: {
71
71
  declare function resolveOutputPolicy(options: ResolveOutputPolicyOptions): OutputPolicy;
72
72
  /** Resolve the default text stream for non-JSON structured output. */
73
73
  declare function resolveTextStream(policy: OutputPolicy): OutputStream;
74
- /** Whether `info()` messages should be emitted under the current policy. */
74
+ /** Whether `info()`/`status()` messages should be emitted under the current policy. */
75
75
  declare function shouldEmitInfo(policy: OutputPolicy): boolean;
76
76
  /** Resolve the concrete table format under the current policy. */
77
77
  declare function resolveTableFormat(policy: OutputPolicy, options?: TableOptions): 'text' | 'json';
@@ -11,7 +11,7 @@ function resolveOutputPolicy(options) {
11
11
  function resolveTextStream(policy) {
12
12
  return policy.jsonMode ? "stderr" : "stdout";
13
13
  }
14
- /** Whether `info()` messages should be emitted under the current policy. */
14
+ /** Whether `info()`/`status()` messages should be emitted under the current policy. */
15
15
  function shouldEmitInfo(policy) {
16
16
  return policy.verbosity !== "quiet";
17
17
  }
@@ -151,6 +151,11 @@ declare class OutputChannel implements Out {
151
151
  * In JSON mode, redirected to stderr.
152
152
  */
153
153
  info(message: string): void;
154
+ /**
155
+ * Status line to stderr (stdout stays clean for piping).
156
+ * Suppressed when verbosity is `'quiet'`.
157
+ */
158
+ status(message: string): void;
154
159
  /** Warning to stderr. Always emitted. */
155
160
  warn(message: string): void;
156
161
  /** Error to stderr. Always emitted. */
@@ -138,6 +138,14 @@ var OutputChannel = class {
138
138
  if (!shouldEmitInfo(this.policy)) return;
139
139
  writeLine(resolveWriterForStream(this.options, resolveTextStream(this.policy)), message);
140
140
  }
141
+ /**
142
+ * Status line to stderr (stdout stays clean for piping).
143
+ * Suppressed when verbosity is `'quiet'`.
144
+ */
145
+ status(message) {
146
+ if (!shouldEmitInfo(this.policy)) return;
147
+ writeLine(this.options.stderr, message);
148
+ }
141
149
  /** Warning to stderr. Always emitted. */
142
150
  warn(message) {
143
151
  writeLine(this.options.stderr, message);
@@ -112,6 +112,13 @@ interface Out {
112
112
  log(message: string): void;
113
113
  /** Informational (may be suppressed in quiet mode). */
114
114
  info(message: string): void;
115
+ /**
116
+ * Status line to stderr, suppressed in quiet mode.
117
+ *
118
+ * Keeps stdout clean for piping; for success and progress notes like
119
+ * `Wrote <path>` that scripts silence with `--quiet`.
120
+ */
121
+ status(message: string): void;
115
122
  /** Warning to stderr. */
116
123
  warn(message: string): void;
117
124
  /** Error to stderr. */
package/dist/index.d.mts CHANGED
@@ -21,7 +21,7 @@ import { HelpOptions, formatHelp } from "./core/help/index.mjs";
21
21
  import { RunResult } from "./core/schema/run.mjs";
22
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
23
  import "./core/schema/index.mjs";
24
- import { ParseOptions, ParseResult, Token, parse, tokenize } from "./core/parse/index.mjs";
24
+ import { ParseOptions, ParseResult, Token, includesBeforeSeparator, parse, stripBeforeSeparator, tokenize } from "./core/parse/index.mjs";
25
25
  import { ManifestDiscoveryOptions, PackageJsonAdapter, PackageJsonData, PackageRepository, PackageRepositoryUrlOptions, discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl } from "./core/config/package-json.mjs";
26
26
  import { HelpLinks } from "./core/cli/help-links.mjs";
27
27
  import { CompletionOptions } from "./core/completion/shells/shared.mjs";
@@ -31,7 +31,7 @@ import { generatePowerShellCompletion } from "./core/completion/shells/powershel
31
31
  import { generateZshCompletion } from "./core/completion/shells/zsh.mjs";
32
32
  import { SHELLS, Shell, generateCompletion } from "./core/completion/index.mjs";
33
33
  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, ResolvedManifestSettings, cli, isMainModule } from "./core/cli/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
35
  import { JsonSchemaOptions, definitionMetaSchema, generateCommandSchema, generateInputSchema, generateSchema } from "./core/json-schema/index.mjs";
36
36
  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 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, inferCliName, isCLIError, isMainModule, isParseError, isValidationError, middleware, osc8, packageRepositoryUrl, parse, plugin, resolve, resolveExampleCommand, resolvePromptConfig, tokenize, visibleWidth };
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 };
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@ import { FlagBuilder, createSchema, flag, getFlagNegatedName } from "./core/sche
3
3
  import { ArgBuilder, arg, createArgSchema } from "./core/schema/arg.mjs";
4
4
  import { CommandBuilder, command, group, resolveExampleCommand } from "./core/schema/command.mjs";
5
5
  import { middleware } from "./core/schema/middleware.mjs";
6
- import { parse, tokenize } from "./core/parse/index.mjs";
6
+ import { includesBeforeSeparator, parse, stripBeforeSeparator, tokenize } from "./core/parse/index.mjs";
7
7
  import { generateBashCompletion } from "./core/completion/shells/bash.mjs";
8
8
  import { generateFishCompletion } from "./core/completion/shells/fish.mjs";
9
9
  import { generatePowerShellCompletion } from "./core/completion/shells/powershell.mjs";
@@ -18,5 +18,5 @@ import { resolve } from "./core/resolve/index.mjs";
18
18
  import { discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl } from "./core/config/package-json.mjs";
19
19
  import { plugin } from "./core/cli/plugin.mjs";
20
20
  import { buildConfigSearchPaths, configFormat, discoverConfig } from "./core/config/index.mjs";
21
- import { CLIBuilder, cli, isMainModule } 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, inferCliName, isCLIError, isMainModule, isParseError, isValidationError, middleware, osc8, packageRepositoryUrl, parse, plugin, resolve, resolveExampleCommand, resolvePromptConfig, tokenize, visibleWidth };
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 };
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.0-rc.15";
3
+ const DREAMCLI_VERSION = "3.0.0-rc.17";
4
4
  /** Git short SHA (e.g. `"f9b5f1a"`). `"dev"` when running unbundled. */
5
- const DREAMCLI_REVISION = "403c982";
5
+ const DREAMCLI_REVISION = "58d3353";
6
6
  //#endregion
7
7
  export { DREAMCLI_REVISION, DREAMCLI_VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kjanat/dreamcli",
3
- "version": "3.0.0-rc.15",
3
+ "version": "3.0.0-rc.17",
4
4
  "description": "Schema-first, fully typed TypeScript CLI framework",
5
5
  "keywords": [
6
6
  "dreamcli",