politty 0.4.15 → 0.4.16
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/dist/{arg-registry-CB5gGtzp.d.cts → arg-registry-Cd6xnjHa.d.ts} +116 -4
- package/dist/arg-registry-Cd6xnjHa.d.ts.map +1 -0
- package/dist/{arg-registry-Dw0f11Zc.d.ts → arg-registry-MVWOAcvw.d.cts} +116 -4
- package/dist/arg-registry-MVWOAcvw.d.cts.map +1 -0
- package/dist/augment.d.cts +1 -1
- package/dist/augment.d.cts.map +1 -1
- package/dist/augment.d.ts +1 -1
- package/dist/augment.d.ts.map +1 -1
- package/dist/completion/index.cjs +2 -1
- package/dist/completion/index.d.cts +2 -2
- package/dist/completion/index.d.ts +2 -2
- package/dist/completion/index.js +2 -2
- package/dist/{completion-Ca5ESJlG.js → completion-B04iiki9.js} +512 -18
- package/dist/completion-B04iiki9.js.map +1 -0
- package/dist/{completion-B5fgnUGm.cjs → completion-BlZxMSeU.cjs} +516 -16
- package/dist/completion-BlZxMSeU.cjs.map +1 -0
- package/dist/docs/index.cjs +82 -22
- package/dist/docs/index.cjs.map +1 -1
- package/dist/docs/index.d.cts +1 -1
- package/dist/docs/index.d.cts.map +1 -1
- package/dist/docs/index.d.ts +1 -1
- package/dist/docs/index.d.ts.map +1 -1
- package/dist/docs/index.js +92 -31
- package/dist/docs/index.js.map +1 -1
- package/dist/{index-Dg9Fpz0R.d.ts → index-CPebddth.d.cts} +56 -4
- package/dist/index-CPebddth.d.cts.map +1 -0
- package/dist/{index-C1gGgUeB.d.cts → index-DR9HLxIP.d.ts} +56 -4
- package/dist/index-DR9HLxIP.d.ts.map +1 -0
- package/dist/index.cjs +5 -3
- package/dist/index.d.cts +36 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +36 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/log-collector-Cd2_mv87.cjs.map +1 -1
- package/dist/log-collector-Cu6MCtAx.js.map +1 -1
- package/dist/prompt/clack/index.cjs.map +1 -1
- package/dist/prompt/clack/index.d.cts +1 -1
- package/dist/prompt/clack/index.d.cts.map +1 -1
- package/dist/prompt/clack/index.d.ts +1 -1
- package/dist/prompt/clack/index.d.ts.map +1 -1
- package/dist/prompt/clack/index.js.map +1 -1
- package/dist/prompt/index.d.cts +1 -1
- package/dist/prompt/index.d.cts.map +1 -1
- package/dist/prompt/index.d.ts +1 -1
- package/dist/prompt/index.d.ts.map +1 -1
- package/dist/prompt/inquirer/index.cjs.map +1 -1
- package/dist/prompt/inquirer/index.d.cts +1 -1
- package/dist/prompt/inquirer/index.d.cts.map +1 -1
- package/dist/prompt/inquirer/index.d.ts +1 -1
- package/dist/prompt/inquirer/index.d.ts.map +1 -1
- package/dist/prompt/inquirer/index.js.map +1 -1
- package/dist/prompt-BKHqGrFw.js.map +1 -1
- package/dist/prompt-aXfSf27y.cjs.map +1 -1
- package/dist/{runner-DKAQBNNh.js → runner-BHeCMEa5.js} +309 -45
- package/dist/runner-BHeCMEa5.js.map +1 -0
- package/dist/{runner-CriXJlm4.cjs → runner-BcyR6Z8r.cjs} +320 -44
- package/dist/runner-BcyR6Z8r.cjs.map +1 -0
- package/dist/{subcommand-router-CqZX3orq.cjs → subcommand-router-DQy0KZU-.cjs} +41 -3
- package/dist/subcommand-router-DQy0KZU-.cjs.map +1 -0
- package/dist/{subcommand-router-ENeCymvX.js → subcommand-router-XZBWe8HN.js} +41 -3
- package/dist/subcommand-router-XZBWe8HN.js.map +1 -0
- package/package.json +16 -16
- package/dist/arg-registry-CB5gGtzp.d.cts.map +0 -1
- package/dist/arg-registry-Dw0f11Zc.d.ts.map +0 -1
- package/dist/completion-B5fgnUGm.cjs.map +0 -1
- package/dist/completion-Ca5ESJlG.js.map +0 -1
- package/dist/index-C1gGgUeB.d.cts.map +0 -1
- package/dist/index-Dg9Fpz0R.d.ts.map +0 -1
- package/dist/runner-CriXJlm4.cjs.map +0 -1
- package/dist/runner-DKAQBNNh.js.map +0 -1
- package/dist/subcommand-router-CqZX3orq.cjs.map +0 -1
- package/dist/subcommand-router-ENeCymvX.js.map +0 -1
|
@@ -47,6 +47,30 @@ interface ResolvedFieldMeta {
|
|
|
47
47
|
completion?: CompletionMeta | undefined;
|
|
48
48
|
/** Prompt metadata from arg() for interactive input */
|
|
49
49
|
prompt?: PromptMeta | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Negation configuration for this boolean field.
|
|
52
|
+
*
|
|
53
|
+
* - String (e.g. `"disable-cache"`): the default `--no-<cliName>` form is
|
|
54
|
+
* suppressed and only `--<negation>` (plus its camelCase variant) is
|
|
55
|
+
* accepted as the negation flag.
|
|
56
|
+
* - `true`: the default `--no-<cliName>` form is accepted **and** shown in
|
|
57
|
+
* help, generated docs, and shell completions.
|
|
58
|
+
* - `false`: neither the default `--no-<cliName>` nor any custom name is
|
|
59
|
+
* accepted; the field only responds to the positive flag.
|
|
60
|
+
* - `undefined`: the default `--no-<cliName>` is accepted by the parser
|
|
61
|
+
* but hidden from help/docs/completions.
|
|
62
|
+
*
|
|
63
|
+
* Only applies to boolean fields; populated as `undefined` otherwise.
|
|
64
|
+
*/
|
|
65
|
+
negation?: string | boolean | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Derived display name (no `--` prefix) for the negation flag in help,
|
|
68
|
+
* generated docs, and shell completions. `undefined` means the negation
|
|
69
|
+
* is hidden from those surfaces. Computed from `negation` + `cliName`.
|
|
70
|
+
*/
|
|
71
|
+
negationDisplay?: string | undefined;
|
|
72
|
+
/** Description shown for the negation option in help/docs. */
|
|
73
|
+
negationDescription?: string | undefined;
|
|
50
74
|
/** Side-effect callback from arg() metadata */
|
|
51
75
|
effect?: ((value: unknown, context: EffectContext) => void | PromiseLike<void>) | undefined;
|
|
52
76
|
}
|
|
@@ -260,6 +284,13 @@ interface CommandBase<TArgsSchema extends ArgsSchema | undefined = undefined, TA
|
|
|
260
284
|
notes?: string | undefined;
|
|
261
285
|
/** Example usages for this command */
|
|
262
286
|
examples?: Example[] | undefined;
|
|
287
|
+
/**
|
|
288
|
+
* @internal
|
|
289
|
+
* Hook invoked once at the top of `runMain`, before any parsing. Used
|
|
290
|
+
* by `withCompletionCommand` to fire its detached background-refresh
|
|
291
|
+
* spawn. Best-effort; never throws.
|
|
292
|
+
*/
|
|
293
|
+
runMainHook?: ((argv: readonly string[]) => void) | undefined;
|
|
263
294
|
}
|
|
264
295
|
/**
|
|
265
296
|
* A command with a run function
|
|
@@ -578,6 +609,58 @@ interface BaseArgMeta<TValue = unknown> {
|
|
|
578
609
|
* ```
|
|
579
610
|
*/
|
|
580
611
|
prompt?: PromptMeta;
|
|
612
|
+
/**
|
|
613
|
+
* Control the boolean negation option.
|
|
614
|
+
*
|
|
615
|
+
* Boolean fields automatically accept `--no-<cliName>` (and the camelCase
|
|
616
|
+
* `--no<Name>` form) to set the value to `false`. By default this form is
|
|
617
|
+
* accepted by the parser but hidden from help, generated docs, and shell
|
|
618
|
+
* completions. This option lets you customize or expose that behavior:
|
|
619
|
+
*
|
|
620
|
+
* - `string` — replaces the auto-generated `--no-*` form with a custom
|
|
621
|
+
* name. The default `--no-*` is no longer recognized.
|
|
622
|
+
* - `true` — opt-in to advertising the default `--no-<cliName>` form in
|
|
623
|
+
* help, generated docs, and shell completions. Parser behavior is
|
|
624
|
+
* unchanged.
|
|
625
|
+
* - `false` — disables negation entirely; neither the default `--no-*`
|
|
626
|
+
* nor any custom name is accepted.
|
|
627
|
+
*
|
|
628
|
+
* String values follow the same naming conventions as `cliName`
|
|
629
|
+
* (kebab-case is recommended). Only valid on boolean fields; setting
|
|
630
|
+
* `negation` on a non-boolean field is a type error and raises a
|
|
631
|
+
* runtime error during command parsing.
|
|
632
|
+
*
|
|
633
|
+
* @example
|
|
634
|
+
* ```ts
|
|
635
|
+
* // Custom negation name
|
|
636
|
+
* cache: arg(z.boolean().default(true), {
|
|
637
|
+
* description: "Enable caching",
|
|
638
|
+
* negation: "disable-cache",
|
|
639
|
+
* })
|
|
640
|
+
* // Accepts: --cache (true), --disable-cache (false)
|
|
641
|
+
* // No longer accepts: --no-cache
|
|
642
|
+
*
|
|
643
|
+
* // Expose default `--no-X` in help/docs/completion
|
|
644
|
+
* verbose: arg(z.boolean().default(false), {
|
|
645
|
+
* negation: true,
|
|
646
|
+
* })
|
|
647
|
+
* // Help shows `--verbose / --no-verbose`
|
|
648
|
+
*
|
|
649
|
+
* // Disable negation entirely
|
|
650
|
+
* dryRun: arg(z.boolean().default(false), {
|
|
651
|
+
* negation: false,
|
|
652
|
+
* })
|
|
653
|
+
* // Accepts: --dry-run (true)
|
|
654
|
+
* // No longer accepts: --no-dry-run
|
|
655
|
+
* ```
|
|
656
|
+
*/
|
|
657
|
+
negation?: string | boolean;
|
|
658
|
+
/**
|
|
659
|
+
* Description shown for the negation option in help and generated docs.
|
|
660
|
+
* Only meaningful when `negation` is set to a custom name string or `true`.
|
|
661
|
+
* Disallowed when `negation` is `false`.
|
|
662
|
+
*/
|
|
663
|
+
negationDescription?: string;
|
|
581
664
|
/**
|
|
582
665
|
* Side-effect callback executed after argument parsing and validation.
|
|
583
666
|
* Runs before the command lifecycle (setup/run/cleanup).
|
|
@@ -664,23 +747,52 @@ type ContainsReservedAlias<A> = [A] extends [never] ? false : A extends "h" | "H
|
|
|
664
747
|
type ReservedAliasTypeError<M> = { [K in keyof M]: M[K] } & {
|
|
665
748
|
__typeError: "Alias 'h' or 'H' requires overrideBuiltinAlias: true";
|
|
666
749
|
};
|
|
750
|
+
type NegationTypeError<M> = { [K in keyof M]: M[K] } & {
|
|
751
|
+
__typeError: "negation/negationDescription can only be used on boolean fields";
|
|
752
|
+
};
|
|
667
753
|
type AliasFieldOf<M> = M extends {
|
|
668
754
|
alias: infer A;
|
|
669
755
|
} ? A : never;
|
|
670
756
|
type HiddenAliasFieldOf<M> = M extends {
|
|
671
757
|
hiddenAlias: infer H;
|
|
672
758
|
} ? H : never;
|
|
759
|
+
/**
|
|
760
|
+
* Check whether a Zod output type is a (possibly optional) boolean.
|
|
761
|
+
* Strips `undefined` to allow `z.boolean().optional()`. Requires both
|
|
762
|
+
* `boolean extends NonNullable<T>` (so `z.literal(true)` is rejected — the full
|
|
763
|
+
* `boolean` domain is needed) and `NonNullable<T> extends boolean` (so unions
|
|
764
|
+
* such as `z.union([z.boolean(), z.string()])` are rejected at the type level
|
|
765
|
+
* to match the runtime check).
|
|
766
|
+
*/
|
|
767
|
+
type IsBooleanField<T> = boolean extends NonNullable<T> ? ([NonNullable<T>] extends [boolean] ? true : false) : false;
|
|
768
|
+
/**
|
|
769
|
+
* Detect whether `M` has `K` set to a non-undefined value.
|
|
770
|
+
*
|
|
771
|
+
* When `M` is inferred from a literal such as `{ negation: "off" }`,
|
|
772
|
+
* `M["negation"]` is `"off"` (without `undefined`), so this returns `true`.
|
|
773
|
+
* When `M` is the wider `ArgMeta` type, `M["negation"]` is
|
|
774
|
+
* `string | boolean | undefined`, so this returns `false` and avoids
|
|
775
|
+
* false-positive type errors on broadly-typed meta values.
|
|
776
|
+
*/
|
|
777
|
+
type HasExplicit<M, K extends string> = K extends keyof M ? undefined extends M[K] ? false : true : false;
|
|
778
|
+
/**
|
|
779
|
+
* Reject `negation` / `negationDescription` on non-boolean fields.
|
|
780
|
+
* Uses {@link HasExplicit} so the error only fires when the user explicitly
|
|
781
|
+
* sets the field on a narrowly-inferred meta literal.
|
|
782
|
+
*/
|
|
783
|
+
type ValidateNegation<M, TValue> = HasExplicit<M, "negation"> extends true ? IsBooleanField<TValue> extends true ? M : NegationTypeError<M> : HasExplicit<M, "negationDescription"> extends true ? IsBooleanField<TValue> extends true ? M : NegationTypeError<M> : M;
|
|
673
784
|
/**
|
|
674
785
|
* Type helper to validate ArgMeta.
|
|
675
786
|
* Forces a type error when a reserved alias ("h" / "H") is used without
|
|
676
787
|
* `overrideBuiltinAlias: true`, whether the alias is provided as a string
|
|
677
788
|
* or as part of an array, and whether it appears in `alias` or `hiddenAlias`.
|
|
789
|
+
* Also rejects `negation` / `negationDescription` on non-boolean fields.
|
|
678
790
|
*/
|
|
679
|
-
type ValidateArgMeta<M> = M extends {
|
|
791
|
+
type ValidateArgMeta<M, TValue = unknown> = M extends {
|
|
680
792
|
overrideBuiltinAlias: true;
|
|
681
|
-
} ? M : ContainsReservedAlias<AliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : ContainsReservedAlias<HiddenAliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : M
|
|
793
|
+
} ? ValidateNegation<M, TValue> : ContainsReservedAlias<AliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : ContainsReservedAlias<HiddenAliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : ValidateNegation<M, TValue>;
|
|
682
794
|
declare function arg<T extends z.ZodType>(schema: T): T;
|
|
683
|
-
declare function arg<T extends z.ZodType, M extends ArgMeta<z.output<T>>>(schema: T, meta: ValidateArgMeta<M
|
|
795
|
+
declare function arg<T extends z.ZodType, M extends ArgMeta<z.output<T>>>(schema: T, meta: ValidateArgMeta<M, z.output<T>>): T;
|
|
684
796
|
//#endregion
|
|
685
797
|
export { RunResultSuccess as A, UnknownKeysMode as B, Logger as C, RunCommandOptions as D, PromptResolver as E, LazyCommand as F, getUnknownKeysMode as H, isLazyCommand as I, lazy as L, SetupContext as M, SubCommandValue as N, RunResult as O, SubCommandsRecord as P, ExtractedFields as R, LogStream as S, NonRunnableCommand as T, toCamelCase as U, extractFields as V, toKebabCase as W, GlobalCleanupContext as _, EffectContext as a, LogEntry as b, arg as c, CleanupContext as d, CollectedLogs as f, GlobalArgs as g, Example as h, CustomCompletion as i, RunnableCommand as j, RunResultFailure as k, AnyCommand as l, CommandBase as m, CompletionMeta as n, PromptMeta as o, Command as p, CompletionType as r, PromptType as s, ArgMeta as t, ArgsSchema as u, GlobalSetupContext as v, MainOptions as w, LogLevel as x, IsEmpty as y, ResolvedFieldMeta as z };
|
|
686
|
-
//# sourceMappingURL=arg-registry-
|
|
798
|
+
//# sourceMappingURL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,OAAA,CAAA,CAAS,MAAA,EAAQ,CAAA,GAAI,CAAA;AAAA,iBACrC,GAAA,WAAc,CAAA,CAAE,OAAA,YAAmB,OAAA,CAAQ,CAAA,CAAE,MAAA,CAAO,CAAA,GAAA,CAClE,MAAA,EAAQ,CAAA,EACR,IAAA,EAAM,eAAA,CAAgB,CAAA,EAAG,CAAA,CAAE,MAAA,CAAO,CAAA,KACjC,CAAA"}
|
|
@@ -47,6 +47,30 @@ interface ResolvedFieldMeta {
|
|
|
47
47
|
completion?: CompletionMeta | undefined;
|
|
48
48
|
/** Prompt metadata from arg() for interactive input */
|
|
49
49
|
prompt?: PromptMeta | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Negation configuration for this boolean field.
|
|
52
|
+
*
|
|
53
|
+
* - String (e.g. `"disable-cache"`): the default `--no-<cliName>` form is
|
|
54
|
+
* suppressed and only `--<negation>` (plus its camelCase variant) is
|
|
55
|
+
* accepted as the negation flag.
|
|
56
|
+
* - `true`: the default `--no-<cliName>` form is accepted **and** shown in
|
|
57
|
+
* help, generated docs, and shell completions.
|
|
58
|
+
* - `false`: neither the default `--no-<cliName>` nor any custom name is
|
|
59
|
+
* accepted; the field only responds to the positive flag.
|
|
60
|
+
* - `undefined`: the default `--no-<cliName>` is accepted by the parser
|
|
61
|
+
* but hidden from help/docs/completions.
|
|
62
|
+
*
|
|
63
|
+
* Only applies to boolean fields; populated as `undefined` otherwise.
|
|
64
|
+
*/
|
|
65
|
+
negation?: string | boolean | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Derived display name (no `--` prefix) for the negation flag in help,
|
|
68
|
+
* generated docs, and shell completions. `undefined` means the negation
|
|
69
|
+
* is hidden from those surfaces. Computed from `negation` + `cliName`.
|
|
70
|
+
*/
|
|
71
|
+
negationDisplay?: string | undefined;
|
|
72
|
+
/** Description shown for the negation option in help/docs. */
|
|
73
|
+
negationDescription?: string | undefined;
|
|
50
74
|
/** Side-effect callback from arg() metadata */
|
|
51
75
|
effect?: ((value: unknown, context: EffectContext) => void | PromiseLike<void>) | undefined;
|
|
52
76
|
}
|
|
@@ -260,6 +284,13 @@ interface CommandBase<TArgsSchema extends ArgsSchema | undefined = undefined, TA
|
|
|
260
284
|
notes?: string | undefined;
|
|
261
285
|
/** Example usages for this command */
|
|
262
286
|
examples?: Example[] | undefined;
|
|
287
|
+
/**
|
|
288
|
+
* @internal
|
|
289
|
+
* Hook invoked once at the top of `runMain`, before any parsing. Used
|
|
290
|
+
* by `withCompletionCommand` to fire its detached background-refresh
|
|
291
|
+
* spawn. Best-effort; never throws.
|
|
292
|
+
*/
|
|
293
|
+
runMainHook?: ((argv: readonly string[]) => void) | undefined;
|
|
263
294
|
}
|
|
264
295
|
/**
|
|
265
296
|
* A command with a run function
|
|
@@ -578,6 +609,58 @@ interface BaseArgMeta<TValue = unknown> {
|
|
|
578
609
|
* ```
|
|
579
610
|
*/
|
|
580
611
|
prompt?: PromptMeta;
|
|
612
|
+
/**
|
|
613
|
+
* Control the boolean negation option.
|
|
614
|
+
*
|
|
615
|
+
* Boolean fields automatically accept `--no-<cliName>` (and the camelCase
|
|
616
|
+
* `--no<Name>` form) to set the value to `false`. By default this form is
|
|
617
|
+
* accepted by the parser but hidden from help, generated docs, and shell
|
|
618
|
+
* completions. This option lets you customize or expose that behavior:
|
|
619
|
+
*
|
|
620
|
+
* - `string` — replaces the auto-generated `--no-*` form with a custom
|
|
621
|
+
* name. The default `--no-*` is no longer recognized.
|
|
622
|
+
* - `true` — opt-in to advertising the default `--no-<cliName>` form in
|
|
623
|
+
* help, generated docs, and shell completions. Parser behavior is
|
|
624
|
+
* unchanged.
|
|
625
|
+
* - `false` — disables negation entirely; neither the default `--no-*`
|
|
626
|
+
* nor any custom name is accepted.
|
|
627
|
+
*
|
|
628
|
+
* String values follow the same naming conventions as `cliName`
|
|
629
|
+
* (kebab-case is recommended). Only valid on boolean fields; setting
|
|
630
|
+
* `negation` on a non-boolean field is a type error and raises a
|
|
631
|
+
* runtime error during command parsing.
|
|
632
|
+
*
|
|
633
|
+
* @example
|
|
634
|
+
* ```ts
|
|
635
|
+
* // Custom negation name
|
|
636
|
+
* cache: arg(z.boolean().default(true), {
|
|
637
|
+
* description: "Enable caching",
|
|
638
|
+
* negation: "disable-cache",
|
|
639
|
+
* })
|
|
640
|
+
* // Accepts: --cache (true), --disable-cache (false)
|
|
641
|
+
* // No longer accepts: --no-cache
|
|
642
|
+
*
|
|
643
|
+
* // Expose default `--no-X` in help/docs/completion
|
|
644
|
+
* verbose: arg(z.boolean().default(false), {
|
|
645
|
+
* negation: true,
|
|
646
|
+
* })
|
|
647
|
+
* // Help shows `--verbose / --no-verbose`
|
|
648
|
+
*
|
|
649
|
+
* // Disable negation entirely
|
|
650
|
+
* dryRun: arg(z.boolean().default(false), {
|
|
651
|
+
* negation: false,
|
|
652
|
+
* })
|
|
653
|
+
* // Accepts: --dry-run (true)
|
|
654
|
+
* // No longer accepts: --no-dry-run
|
|
655
|
+
* ```
|
|
656
|
+
*/
|
|
657
|
+
negation?: string | boolean;
|
|
658
|
+
/**
|
|
659
|
+
* Description shown for the negation option in help and generated docs.
|
|
660
|
+
* Only meaningful when `negation` is set to a custom name string or `true`.
|
|
661
|
+
* Disallowed when `negation` is `false`.
|
|
662
|
+
*/
|
|
663
|
+
negationDescription?: string;
|
|
581
664
|
/**
|
|
582
665
|
* Side-effect callback executed after argument parsing and validation.
|
|
583
666
|
* Runs before the command lifecycle (setup/run/cleanup).
|
|
@@ -664,23 +747,52 @@ type ContainsReservedAlias<A> = [A] extends [never] ? false : A extends "h" | "H
|
|
|
664
747
|
type ReservedAliasTypeError<M> = { [K in keyof M]: M[K] } & {
|
|
665
748
|
__typeError: "Alias 'h' or 'H' requires overrideBuiltinAlias: true";
|
|
666
749
|
};
|
|
750
|
+
type NegationTypeError<M> = { [K in keyof M]: M[K] } & {
|
|
751
|
+
__typeError: "negation/negationDescription can only be used on boolean fields";
|
|
752
|
+
};
|
|
667
753
|
type AliasFieldOf<M> = M extends {
|
|
668
754
|
alias: infer A;
|
|
669
755
|
} ? A : never;
|
|
670
756
|
type HiddenAliasFieldOf<M> = M extends {
|
|
671
757
|
hiddenAlias: infer H;
|
|
672
758
|
} ? H : never;
|
|
759
|
+
/**
|
|
760
|
+
* Check whether a Zod output type is a (possibly optional) boolean.
|
|
761
|
+
* Strips `undefined` to allow `z.boolean().optional()`. Requires both
|
|
762
|
+
* `boolean extends NonNullable<T>` (so `z.literal(true)` is rejected — the full
|
|
763
|
+
* `boolean` domain is needed) and `NonNullable<T> extends boolean` (so unions
|
|
764
|
+
* such as `z.union([z.boolean(), z.string()])` are rejected at the type level
|
|
765
|
+
* to match the runtime check).
|
|
766
|
+
*/
|
|
767
|
+
type IsBooleanField<T> = boolean extends NonNullable<T> ? ([NonNullable<T>] extends [boolean] ? true : false) : false;
|
|
768
|
+
/**
|
|
769
|
+
* Detect whether `M` has `K` set to a non-undefined value.
|
|
770
|
+
*
|
|
771
|
+
* When `M` is inferred from a literal such as `{ negation: "off" }`,
|
|
772
|
+
* `M["negation"]` is `"off"` (without `undefined`), so this returns `true`.
|
|
773
|
+
* When `M` is the wider `ArgMeta` type, `M["negation"]` is
|
|
774
|
+
* `string | boolean | undefined`, so this returns `false` and avoids
|
|
775
|
+
* false-positive type errors on broadly-typed meta values.
|
|
776
|
+
*/
|
|
777
|
+
type HasExplicit<M, K extends string> = K extends keyof M ? undefined extends M[K] ? false : true : false;
|
|
778
|
+
/**
|
|
779
|
+
* Reject `negation` / `negationDescription` on non-boolean fields.
|
|
780
|
+
* Uses {@link HasExplicit} so the error only fires when the user explicitly
|
|
781
|
+
* sets the field on a narrowly-inferred meta literal.
|
|
782
|
+
*/
|
|
783
|
+
type ValidateNegation<M, TValue> = HasExplicit<M, "negation"> extends true ? IsBooleanField<TValue> extends true ? M : NegationTypeError<M> : HasExplicit<M, "negationDescription"> extends true ? IsBooleanField<TValue> extends true ? M : NegationTypeError<M> : M;
|
|
673
784
|
/**
|
|
674
785
|
* Type helper to validate ArgMeta.
|
|
675
786
|
* Forces a type error when a reserved alias ("h" / "H") is used without
|
|
676
787
|
* `overrideBuiltinAlias: true`, whether the alias is provided as a string
|
|
677
788
|
* or as part of an array, and whether it appears in `alias` or `hiddenAlias`.
|
|
789
|
+
* Also rejects `negation` / `negationDescription` on non-boolean fields.
|
|
678
790
|
*/
|
|
679
|
-
type ValidateArgMeta<M> = M extends {
|
|
791
|
+
type ValidateArgMeta<M, TValue = unknown> = M extends {
|
|
680
792
|
overrideBuiltinAlias: true;
|
|
681
|
-
} ? M : ContainsReservedAlias<AliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : ContainsReservedAlias<HiddenAliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : M
|
|
793
|
+
} ? ValidateNegation<M, TValue> : ContainsReservedAlias<AliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : ContainsReservedAlias<HiddenAliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : ValidateNegation<M, TValue>;
|
|
682
794
|
declare function arg<T extends z.ZodType>(schema: T): T;
|
|
683
|
-
declare function arg<T extends z.ZodType, M extends ArgMeta<z.output<T>>>(schema: T, meta: ValidateArgMeta<M
|
|
795
|
+
declare function arg<T extends z.ZodType, M extends ArgMeta<z.output<T>>>(schema: T, meta: ValidateArgMeta<M, z.output<T>>): T;
|
|
684
796
|
//#endregion
|
|
685
797
|
export { RunResultSuccess as A, UnknownKeysMode as B, Logger as C, RunCommandOptions as D, PromptResolver as E, LazyCommand as F, getUnknownKeysMode as H, isLazyCommand as I, lazy as L, SetupContext as M, SubCommandValue as N, RunResult as O, SubCommandsRecord as P, ExtractedFields as R, LogStream as S, NonRunnableCommand as T, toCamelCase as U, extractFields as V, toKebabCase as W, GlobalCleanupContext as _, EffectContext as a, LogEntry as b, arg as c, CleanupContext as d, CollectedLogs as f, GlobalArgs as g, Example as h, CustomCompletion as i, RunnableCommand as j, RunResultFailure as k, AnyCommand as l, CommandBase as m, CompletionMeta as n, PromptMeta as o, Command as p, CompletionType as r, PromptType as s, ArgMeta as t, ArgsSchema as u, GlobalSetupContext as v, MainOptions as w, LogLevel as x, IsEmpty as y, ResolvedFieldMeta as z };
|
|
686
|
-
//# sourceMappingURL=arg-registry-
|
|
798
|
+
//# sourceMappingURL=arg-registry-MVWOAcvw.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arg-registry-MVWOAcvw.d.cts","names":[],"sources":["../src/core/schema-extractor.ts","../src/lazy.ts","../src/types.ts","../src/core/arg-registry.ts"],"mappings":";;;AA8CA;;;AAAA,UAAiB,iBAAA;EAwCF;EAtCb,IAAA;EAkEoC;EAhEpC,OAAA;EAgEwE;;;;;EA1DxE,KAAA;EAOA;;;;EAFA,WAAA;EAeA;EAbA,WAAA;EAiBA;EAfA,UAAA;EAeU;EAbV,WAAA;EAiBA;;;;EAZA,GAAA;EAgCA;EA9BA,QAAA;EAsCA;EApCA,YAAA;EAsCW;EApCX,IAAA;EAoC2B;EAlC3B,MAAA,EAAQ,CAAA,CAAE,OAAA;EAkC8D;EAhCxE,oBAAA;EAsCe;EApCf,UAAA;;EAEA,UAAA,GAAa,cAAA;EAsCL;EApCR,MAAA,GAAS,UAAA;EA0CE;;;;;;;;;;;;;;;EA1BX,QAAA;EA6BE;;;;;EAvBF,eAAA;EAmCgC;EAjChC,mBAAA;EA0CU;EAxCV,MAAA,KAAW,KAAA,WAAgB,OAAA,EAAS,aAAA,YAAyB,WAAA;AAAA;;AAwCpC;AA6C3B;UA/EiB,eAAA;;EAEf,MAAA,EAAQ,iBAAA;EA6EiC;EA3EzC,MAAA,EAAQ,UAAA;EA2EyB;EAzEjC,UAAA;EAyEoE;EAvEpE,aAAA;EA2Nc;EAzNd,QAAA,GAAW,KAAA;IACT,kBAAA;IACA,MAAA,EAAQ,iBAAA;IACR,WAAA;EAAA;EAwOuB;EArOzB,YAAA,GAAe,eAAA;EAqOsB;EAnOrC,WAAA;EAsoBc;;;;;;EA/nBd,eAAA,EA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BAAA,CAAuB,CAAA,IACvB,qBAAA,CAAsB,kBAAA,CAAmB,CAAA,kBACvC,sBAAA,CAAuB,CAAA,IACvB,gBAAA,CAAiB,CAAA,EAAG,MAAA;AAAA,iBAEZ,GAAA,WAAc,CAAA,CAAE,OAAA,CAAA,CAAS,MAAA,EAAQ,CAAA,GAAI,CAAA;AAAA,iBACrC,GAAA,WAAc,CAAA,CAAE,OAAA,YAAmB,OAAA,CAAQ,CAAA,CAAE,MAAA,CAAO,CAAA,GAAA,CAClE,MAAA,EAAQ,CAAA,EACR,IAAA,EAAM,eAAA,CAAgB,CAAA,EAAG,CAAA,CAAE,MAAA,CAAO,CAAA,KACjC,CAAA"}
|
package/dist/augment.d.cts
CHANGED
package/dist/augment.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"augment.d.cts","names":[],"sources":["../src/augment.ts"],"mappings":";;;;YAiBY,UAAA;IACR,OAAA,GAAU,
|
|
1
|
+
{"version":3,"file":"augment.d.cts","names":[],"sources":["../src/augment.ts"],"mappings":";;;;YAiBY,UAAA;IACR,OAAA,GAAU,OAAO;EAAA;EAAA,UAGT,UAAA;IACR,WAAA;IACA,UAAA;IACA,WAAA;IACA,KAAA;IACA,WAAA;IACA,oBAAA;EAAA;AAAA"}
|
package/dist/augment.d.ts
CHANGED
package/dist/augment.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"augment.d.ts","names":[],"sources":["../src/augment.ts"],"mappings":";;;;YAiBY,UAAA;IACR,OAAA,GAAU,
|
|
1
|
+
{"version":3,"file":"augment.d.ts","names":[],"sources":["../src/augment.ts"],"mappings":";;;;YAiBY,UAAA;IACR,OAAA,GAAU,OAAO;EAAA;EAAA,UAGT,UAAA;IACR,WAAA;IACA,UAAA;IACA,WAAA;IACA,KAAA;IACA,WAAA;IACA,oBAAA;EAAA;AAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_completion = require('../completion-
|
|
2
|
+
const require_completion = require('../completion-BlZxMSeU.cjs');
|
|
3
3
|
|
|
4
4
|
exports.CompletionDirective = require_completion.CompletionDirective;
|
|
5
5
|
exports.createCompletionCommand = require_completion.createCompletionCommand;
|
|
6
6
|
exports.createDynamicCompleteCommand = require_completion.createDynamicCompleteCommand;
|
|
7
|
+
exports.createRefreshCompletionCommand = require_completion.createRefreshCompletionCommand;
|
|
7
8
|
exports.detectShell = require_completion.detectShell;
|
|
8
9
|
exports.extractCompletionData = require_completion.extractCompletionData;
|
|
9
10
|
exports.extractPositionals = require_completion.extractPositionals;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
export { CandidateResult, CompletableOption, CompletableSubcommand, CompletionCandidate, CompletionContext, CompletionData, CompletionDirective, CompletionGenerator, CompletionOptions, CompletionResult, CompletionType, ShellFormatOptions, ShellType, ValueCompletionField, WithCompletionOptions, createCompletionCommand, createDynamicCompleteCommand, detectShell, extractCompletionData, extractPositionals, formatForShell, generateCandidates, generateCompletion, getSupportedShells, hasCompleteCommand, parseCompletionContext, resolveValueCompletion, withCompletionCommand };
|
|
1
|
+
import { C as CompletableOption, D as CompletionOptions, E as CompletionGenerator, O as CompletionResult, S as parseCompletionContext, T as CompletionData, _ as CompletionCandidate, a as generateCompletion, b as CompletionContext, c as ValueCompletionField, d as extractPositionals, f as ShellFormatOptions, g as CandidateResult, h as hasCompleteCommand, i as detectShell, k as ShellType, l as resolveValueCompletion, m as createDynamicCompleteCommand, n as createCompletionCommand, o as getSupportedShells, p as formatForShell, r as createRefreshCompletionCommand, s as withCompletionCommand, t as WithCompletionOptions, u as extractCompletionData, v as CompletionDirective, w as CompletableSubcommand, x as CompletionType, y as generateCandidates } from "../index-CPebddth.cjs";
|
|
2
|
+
export { type CandidateResult, type CompletableOption, type CompletableSubcommand, type CompletionCandidate, type CompletionContext, type CompletionData, CompletionDirective, type CompletionGenerator, type CompletionOptions, type CompletionResult, type CompletionType, type ShellFormatOptions, type ShellType, type ValueCompletionField, WithCompletionOptions, createCompletionCommand, createDynamicCompleteCommand, createRefreshCompletionCommand, detectShell, extractCompletionData, extractPositionals, formatForShell, generateCandidates, generateCompletion, getSupportedShells, hasCompleteCommand, parseCompletionContext, resolveValueCompletion, withCompletionCommand };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
export { CandidateResult, CompletableOption, CompletableSubcommand, CompletionCandidate, CompletionContext, CompletionData, CompletionDirective, CompletionGenerator, CompletionOptions, CompletionResult, CompletionType, ShellFormatOptions, ShellType, ValueCompletionField, WithCompletionOptions, createCompletionCommand, createDynamicCompleteCommand, detectShell, extractCompletionData, extractPositionals, formatForShell, generateCandidates, generateCompletion, getSupportedShells, hasCompleteCommand, parseCompletionContext, resolveValueCompletion, withCompletionCommand };
|
|
1
|
+
import { C as CompletableOption, D as CompletionOptions, E as CompletionGenerator, O as CompletionResult, S as parseCompletionContext, T as CompletionData, _ as CompletionCandidate, a as generateCompletion, b as CompletionContext, c as ValueCompletionField, d as extractPositionals, f as ShellFormatOptions, g as CandidateResult, h as hasCompleteCommand, i as detectShell, k as ShellType, l as resolveValueCompletion, m as createDynamicCompleteCommand, n as createCompletionCommand, o as getSupportedShells, p as formatForShell, r as createRefreshCompletionCommand, s as withCompletionCommand, t as WithCompletionOptions, u as extractCompletionData, v as CompletionDirective, w as CompletableSubcommand, x as CompletionType, y as generateCandidates } from "../index-DR9HLxIP.js";
|
|
2
|
+
export { type CandidateResult, type CompletableOption, type CompletableSubcommand, type CompletionCandidate, type CompletionContext, type CompletionData, CompletionDirective, type CompletionGenerator, type CompletionOptions, type CompletionResult, type CompletionType, type ShellFormatOptions, type ShellType, type ValueCompletionField, WithCompletionOptions, createCompletionCommand, createDynamicCompleteCommand, createRefreshCompletionCommand, detectShell, extractCompletionData, extractPositionals, formatForShell, generateCandidates, generateCompletion, getSupportedShells, hasCompleteCommand, parseCompletionContext, resolveValueCompletion, withCompletionCommand };
|
package/dist/completion/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as getSupportedShells, c as hasCompleteCommand, d as CompletionDirective, f as generateCandidates, h as resolveValueCompletion, i as generateCompletion, l as formatForShell, m as extractPositionals, n as createRefreshCompletionCommand, o as withCompletionCommand, p as extractCompletionData, r as detectShell, s as createDynamicCompleteCommand, t as createCompletionCommand, u as parseCompletionContext } from "../completion-B04iiki9.js";
|
|
2
2
|
|
|
3
|
-
export { CompletionDirective, createCompletionCommand, createDynamicCompleteCommand, detectShell, extractCompletionData, extractPositionals, formatForShell, generateCandidates, generateCompletion, getSupportedShells, hasCompleteCommand, parseCompletionContext, resolveValueCompletion, withCompletionCommand };
|
|
3
|
+
export { CompletionDirective, createCompletionCommand, createDynamicCompleteCommand, createRefreshCompletionCommand, detectShell, extractCompletionData, extractPositionals, formatForShell, generateCandidates, generateCompletion, getSupportedShells, hasCompleteCommand, parseCompletionContext, resolveValueCompletion, withCompletionCommand };
|