politty 0.4.15 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{arg-registry-Dw0f11Zc.d.ts → arg-registry--NRaNFJM.d.cts} +238 -6
- package/dist/arg-registry--NRaNFJM.d.cts.map +1 -0
- package/dist/{arg-registry-CB5gGtzp.d.cts → arg-registry-6E0WHOh_.d.ts} +238 -6
- package/dist/arg-registry-6E0WHOh_.d.ts.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 +3 -2
- package/dist/completion/index.d.ts +3 -2
- package/dist/completion/index.js +2 -2
- package/dist/completion-BA5JMvVG.js +4067 -0
- package/dist/completion-BA5JMvVG.js.map +1 -0
- package/dist/completion-Cqs1Ja7C.cjs +4169 -0
- package/dist/completion-Cqs1Ja7C.cjs.map +1 -0
- package/dist/docs/index.cjs +89 -29
- 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-C1gGgUeB.d.cts → index-DBMfKZ34.d.ts} +189 -17
- package/dist/index-DBMfKZ34.d.ts.map +1 -0
- package/dist/{index-Dg9Fpz0R.d.ts → index-DJp8k5Bq.d.cts} +189 -17
- package/dist/index-DJp8k5Bq.d.cts.map +1 -0
- package/dist/index.cjs +12 -10
- 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-BmSEiD9A.js} +319 -52
- package/dist/runner-BmSEiD9A.js.map +1 -0
- package/dist/{runner-CriXJlm4.cjs → runner-CRZ_7Y9i.cjs} +366 -87
- package/dist/runner-CRZ_7Y9i.cjs.map +1 -0
- package/dist/{subcommand-router-ENeCymvX.js → schema-extractor-C50R-1re.js} +175 -137
- package/dist/schema-extractor-C50R-1re.js.map +1 -0
- package/dist/{subcommand-router-CqZX3orq.cjs → schema-extractor-SLPgBNgZ.cjs} +174 -136
- package/dist/schema-extractor-SLPgBNgZ.cjs.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 +0 -1940
- package/dist/completion-B5fgnUGm.cjs.map +0 -1
- package/dist/completion-Ca5ESJlG.js +0 -1844
- 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
|
|
@@ -424,19 +455,139 @@ interface RunResultFailure {
|
|
|
424
455
|
*/
|
|
425
456
|
type RunResult<T = unknown> = RunResultSuccess<T> | RunResultFailure;
|
|
426
457
|
//#endregion
|
|
458
|
+
//#region src/core/dynamic-completion-types.d.ts
|
|
459
|
+
/**
|
|
460
|
+
* Types for in-process dynamic value completion.
|
|
461
|
+
*
|
|
462
|
+
* A `resolve` callback registered on `arg(...)` receives parsed context
|
|
463
|
+
* (other arg values typed so far, previous values supplied to the same
|
|
464
|
+
* option, the current word being completed, target shell) and returns
|
|
465
|
+
* candidates. The callback runs inside the `__complete` command, so static
|
|
466
|
+
* shell scripts delegate to `<program> __complete` for any spec that uses
|
|
467
|
+
* `resolve`.
|
|
468
|
+
*
|
|
469
|
+
* Defined under `core/` (not `completion/`) so `arg-registry.ts` can
|
|
470
|
+
* reference the resolver type without crossing the lint-enforced
|
|
471
|
+
* `completion → core` boundary.
|
|
472
|
+
*/
|
|
473
|
+
/** Bitmask combining `CompletionDirective` values. */
|
|
474
|
+
type CompletionDirectiveMask = number;
|
|
475
|
+
interface DynamicCompletionContext {
|
|
476
|
+
/** Word being completed. `--field=` inline prefix is stripped before this is set. */
|
|
477
|
+
currentWord: string;
|
|
478
|
+
/** Target shell formatting requested by the caller. */
|
|
479
|
+
shell: "bash" | "zsh" | "fish";
|
|
480
|
+
/**
|
|
481
|
+
* Best-effort parsed values of OTHER args on the same command, keyed by
|
|
482
|
+
* camelCase name. Includes positionals and other options. Zod validation
|
|
483
|
+
* is NOT applied; values are raw strings (or arrays of raw strings for
|
|
484
|
+
* array-typed options/variadic positionals).
|
|
485
|
+
*/
|
|
486
|
+
parsedArgs: Readonly<Record<string, unknown>>;
|
|
487
|
+
/**
|
|
488
|
+
* Values already supplied for the SAME option/positional being completed.
|
|
489
|
+
* Useful for de-duplicating repeated array options.
|
|
490
|
+
*/
|
|
491
|
+
previousValues: readonly string[];
|
|
492
|
+
/**
|
|
493
|
+
* Subcommand path from root (e.g. ["api"]). Reflects what the user
|
|
494
|
+
* actually typed — aliases are NOT resolved to their canonical names, so
|
|
495
|
+
* resolvers that branch on the path should accept every alias they care
|
|
496
|
+
* about.
|
|
497
|
+
*/
|
|
498
|
+
subcommandPath: readonly string[];
|
|
499
|
+
}
|
|
500
|
+
interface DynamicCompletionCandidate {
|
|
501
|
+
value: string;
|
|
502
|
+
description?: string;
|
|
503
|
+
}
|
|
504
|
+
interface DynamicCompletionResult {
|
|
505
|
+
/** Candidates to surface. Strings or `{value, description}` objects. */
|
|
506
|
+
candidates: Array<string | DynamicCompletionCandidate>;
|
|
507
|
+
/**
|
|
508
|
+
* Optional directive override. When omitted, defaults to
|
|
509
|
+
* `FilterPrefix | NoFileCompletion` (matches `choices` behaviour).
|
|
510
|
+
*/
|
|
511
|
+
directive?: CompletionDirectiveMask;
|
|
512
|
+
}
|
|
513
|
+
type DynamicCompletionResolver = (ctx: DynamicCompletionContext) => DynamicCompletionResult | Promise<DynamicCompletionResult>;
|
|
514
|
+
//#endregion
|
|
515
|
+
//#region src/core/expand-completion-types.d.ts
|
|
516
|
+
/**
|
|
517
|
+
* Types for "expand" completion — candidates that are pre-enumerated at
|
|
518
|
+
* script-generation time and inlined into the static shell script.
|
|
519
|
+
*
|
|
520
|
+
* The user provides `dependsOn` (sibling arg names that must have static
|
|
521
|
+
* `choices` or an enum schema) and `enumerate(deps)`. politty walks the
|
|
522
|
+
* cartesian product of the dependsOn values, calls `enumerate` for each
|
|
523
|
+
* combination, and emits a case lookup keyed on the runtime values of those
|
|
524
|
+
* args. No Node process is spawned on TAB.
|
|
525
|
+
*
|
|
526
|
+
* Defined under `core/` (not `completion/`) so `arg-registry.ts` can
|
|
527
|
+
* reference these types without crossing the lint-enforced
|
|
528
|
+
* `completion → core` boundary.
|
|
529
|
+
*/
|
|
530
|
+
/** Candidate returned by an `enumerate` callback. */
|
|
531
|
+
interface ExpandCandidate {
|
|
532
|
+
value: string;
|
|
533
|
+
description?: string;
|
|
534
|
+
}
|
|
535
|
+
/** Resolved candidate stored on a {@link ValueCompletion} after enumeration. */
|
|
536
|
+
interface ResolvedExpandCandidate {
|
|
537
|
+
value: string;
|
|
538
|
+
description?: string;
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* User-facing spec attached to `completion.custom.expand`.
|
|
542
|
+
*
|
|
543
|
+
* `dependsOn` lists sibling args (camelCase names) whose values determine
|
|
544
|
+
* which candidates apply. Each named arg must have a static set of values —
|
|
545
|
+
* either an explicit `completion.custom.choices` or an enum schema. The
|
|
546
|
+
* order of `dependsOn` is the order in which `deps` keys are exposed to
|
|
547
|
+
* `enumerate`.
|
|
548
|
+
*
|
|
549
|
+
* `enumerate` runs once per cartesian-product combination at the time the
|
|
550
|
+
* shell script is generated (e.g. when the user runs `<program> completion
|
|
551
|
+
* zsh`). It must be a pure function of `deps`; politty does not retain it
|
|
552
|
+
* for runtime use.
|
|
553
|
+
*/
|
|
554
|
+
interface ExpandCompletion {
|
|
555
|
+
dependsOn: readonly string[];
|
|
556
|
+
enumerate: (deps: Readonly<Record<string, string>>) => ReadonlyArray<string | ExpandCandidate>;
|
|
557
|
+
}
|
|
558
|
+
//#endregion
|
|
427
559
|
//#region src/core/arg-registry.d.ts
|
|
428
560
|
/**
|
|
429
561
|
* Built-in completion types
|
|
430
562
|
*/
|
|
431
563
|
type CompletionType = "file" | "directory" | "none";
|
|
432
564
|
/**
|
|
433
|
-
* Custom completion specification
|
|
565
|
+
* Custom completion specification.
|
|
566
|
+
*
|
|
567
|
+
* `choices`, `shellCommand`, `resolve`, and `expand` are mutually exclusive —
|
|
568
|
+
* specifying more than one throws when the field metadata is resolved.
|
|
434
569
|
*/
|
|
435
570
|
interface CustomCompletion {
|
|
436
571
|
/** Static list of choices for completion */
|
|
437
572
|
choices?: string[];
|
|
438
573
|
/** Shell command to execute for dynamic completion */
|
|
439
574
|
shellCommand?: string;
|
|
575
|
+
/**
|
|
576
|
+
* In-process JS callback for dynamic completion. Receives parsed context
|
|
577
|
+
* (other arg values typed so far, previously supplied values for this same
|
|
578
|
+
* option) and returns candidates. Static shell scripts delegate to
|
|
579
|
+
* `<program> __complete` whenever this is set.
|
|
580
|
+
*/
|
|
581
|
+
resolve?: DynamicCompletionResolver;
|
|
582
|
+
/**
|
|
583
|
+
* Pre-enumerated completion baked into the generated shell script. The
|
|
584
|
+
* candidate list is computed at script-generation time by calling
|
|
585
|
+
* `enumerate` for every combination of the sibling arg values listed in
|
|
586
|
+
* `dependsOn` (each must have a static `choices` or enum schema). The
|
|
587
|
+
* shell then dispatches via a case lookup keyed by the runtime values of
|
|
588
|
+
* those args — no Node process is spawned on TAB.
|
|
589
|
+
*/
|
|
590
|
+
expand?: ExpandCompletion;
|
|
440
591
|
}
|
|
441
592
|
/**
|
|
442
593
|
* Completion metadata for an argument
|
|
@@ -578,6 +729,58 @@ interface BaseArgMeta<TValue = unknown> {
|
|
|
578
729
|
* ```
|
|
579
730
|
*/
|
|
580
731
|
prompt?: PromptMeta;
|
|
732
|
+
/**
|
|
733
|
+
* Control the boolean negation option.
|
|
734
|
+
*
|
|
735
|
+
* Boolean fields automatically accept `--no-<cliName>` (and the camelCase
|
|
736
|
+
* `--no<Name>` form) to set the value to `false`. By default this form is
|
|
737
|
+
* accepted by the parser but hidden from help, generated docs, and shell
|
|
738
|
+
* completions. This option lets you customize or expose that behavior:
|
|
739
|
+
*
|
|
740
|
+
* - `string` — replaces the auto-generated `--no-*` form with a custom
|
|
741
|
+
* name. The default `--no-*` is no longer recognized.
|
|
742
|
+
* - `true` — opt-in to advertising the default `--no-<cliName>` form in
|
|
743
|
+
* help, generated docs, and shell completions. Parser behavior is
|
|
744
|
+
* unchanged.
|
|
745
|
+
* - `false` — disables negation entirely; neither the default `--no-*`
|
|
746
|
+
* nor any custom name is accepted.
|
|
747
|
+
*
|
|
748
|
+
* String values follow the same naming conventions as `cliName`
|
|
749
|
+
* (kebab-case is recommended). Only valid on boolean fields; setting
|
|
750
|
+
* `negation` on a non-boolean field is a type error and raises a
|
|
751
|
+
* runtime error during command parsing.
|
|
752
|
+
*
|
|
753
|
+
* @example
|
|
754
|
+
* ```ts
|
|
755
|
+
* // Custom negation name
|
|
756
|
+
* cache: arg(z.boolean().default(true), {
|
|
757
|
+
* description: "Enable caching",
|
|
758
|
+
* negation: "disable-cache",
|
|
759
|
+
* })
|
|
760
|
+
* // Accepts: --cache (true), --disable-cache (false)
|
|
761
|
+
* // No longer accepts: --no-cache
|
|
762
|
+
*
|
|
763
|
+
* // Expose default `--no-X` in help/docs/completion
|
|
764
|
+
* verbose: arg(z.boolean().default(false), {
|
|
765
|
+
* negation: true,
|
|
766
|
+
* })
|
|
767
|
+
* // Help shows `--verbose / --no-verbose`
|
|
768
|
+
*
|
|
769
|
+
* // Disable negation entirely
|
|
770
|
+
* dryRun: arg(z.boolean().default(false), {
|
|
771
|
+
* negation: false,
|
|
772
|
+
* })
|
|
773
|
+
* // Accepts: --dry-run (true)
|
|
774
|
+
* // No longer accepts: --no-dry-run
|
|
775
|
+
* ```
|
|
776
|
+
*/
|
|
777
|
+
negation?: string | boolean;
|
|
778
|
+
/**
|
|
779
|
+
* Description shown for the negation option in help and generated docs.
|
|
780
|
+
* Only meaningful when `negation` is set to a custom name string or `true`.
|
|
781
|
+
* Disallowed when `negation` is `false`.
|
|
782
|
+
*/
|
|
783
|
+
negationDescription?: string;
|
|
581
784
|
/**
|
|
582
785
|
* Side-effect callback executed after argument parsing and validation.
|
|
583
786
|
* Runs before the command lifecycle (setup/run/cleanup).
|
|
@@ -664,23 +867,52 @@ type ContainsReservedAlias<A> = [A] extends [never] ? false : A extends "h" | "H
|
|
|
664
867
|
type ReservedAliasTypeError<M> = { [K in keyof M]: M[K] } & {
|
|
665
868
|
__typeError: "Alias 'h' or 'H' requires overrideBuiltinAlias: true";
|
|
666
869
|
};
|
|
870
|
+
type NegationTypeError<M> = { [K in keyof M]: M[K] } & {
|
|
871
|
+
__typeError: "negation/negationDescription can only be used on boolean fields";
|
|
872
|
+
};
|
|
667
873
|
type AliasFieldOf<M> = M extends {
|
|
668
874
|
alias: infer A;
|
|
669
875
|
} ? A : never;
|
|
670
876
|
type HiddenAliasFieldOf<M> = M extends {
|
|
671
877
|
hiddenAlias: infer H;
|
|
672
878
|
} ? H : never;
|
|
879
|
+
/**
|
|
880
|
+
* Check whether a Zod output type is a (possibly optional) boolean.
|
|
881
|
+
* Strips `undefined` to allow `z.boolean().optional()`. Requires both
|
|
882
|
+
* `boolean extends NonNullable<T>` (so `z.literal(true)` is rejected — the full
|
|
883
|
+
* `boolean` domain is needed) and `NonNullable<T> extends boolean` (so unions
|
|
884
|
+
* such as `z.union([z.boolean(), z.string()])` are rejected at the type level
|
|
885
|
+
* to match the runtime check).
|
|
886
|
+
*/
|
|
887
|
+
type IsBooleanField<T> = boolean extends NonNullable<T> ? ([NonNullable<T>] extends [boolean] ? true : false) : false;
|
|
888
|
+
/**
|
|
889
|
+
* Detect whether `M` has `K` set to a non-undefined value.
|
|
890
|
+
*
|
|
891
|
+
* When `M` is inferred from a literal such as `{ negation: "off" }`,
|
|
892
|
+
* `M["negation"]` is `"off"` (without `undefined`), so this returns `true`.
|
|
893
|
+
* When `M` is the wider `ArgMeta` type, `M["negation"]` is
|
|
894
|
+
* `string | boolean | undefined`, so this returns `false` and avoids
|
|
895
|
+
* false-positive type errors on broadly-typed meta values.
|
|
896
|
+
*/
|
|
897
|
+
type HasExplicit<M, K extends string> = K extends keyof M ? undefined extends M[K] ? false : true : false;
|
|
898
|
+
/**
|
|
899
|
+
* Reject `negation` / `negationDescription` on non-boolean fields.
|
|
900
|
+
* Uses {@link HasExplicit} so the error only fires when the user explicitly
|
|
901
|
+
* sets the field on a narrowly-inferred meta literal.
|
|
902
|
+
*/
|
|
903
|
+
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
904
|
/**
|
|
674
905
|
* Type helper to validate ArgMeta.
|
|
675
906
|
* Forces a type error when a reserved alias ("h" / "H") is used without
|
|
676
907
|
* `overrideBuiltinAlias: true`, whether the alias is provided as a string
|
|
677
908
|
* or as part of an array, and whether it appears in `alias` or `hiddenAlias`.
|
|
909
|
+
* Also rejects `negation` / `negationDescription` on non-boolean fields.
|
|
678
910
|
*/
|
|
679
|
-
type ValidateArgMeta<M> = M extends {
|
|
911
|
+
type ValidateArgMeta<M, TValue = unknown> = M extends {
|
|
680
912
|
overrideBuiltinAlias: true;
|
|
681
|
-
} ? M : ContainsReservedAlias<AliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : ContainsReservedAlias<HiddenAliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : M
|
|
913
|
+
} ? ValidateNegation<M, TValue> : ContainsReservedAlias<AliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : ContainsReservedAlias<HiddenAliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : ValidateNegation<M, TValue>;
|
|
682
914
|
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
|
|
915
|
+
declare function arg<T extends z.ZodType, M extends ArgMeta<z.output<T>>>(schema: T, meta: ValidateArgMeta<M, z.output<T>>): T;
|
|
684
916
|
//#endregion
|
|
685
|
-
export {
|
|
686
|
-
//# sourceMappingURL=arg-registry
|
|
917
|
+
export { LogStream as A, SetupContext as B, Example as C, IsEmpty as D, GlobalSetupContext as E, RunCommandOptions as F, lazy as G, SubCommandsRecord as H, RunResult as I, UnknownKeysMode as J, ExtractedFields as K, RunResultFailure as L, MainOptions as M, NonRunnableCommand as N, LogEntry as O, PromptResolver as P, toKebabCase as Q, RunResultSuccess as R, CommandBase as S, GlobalCleanupContext as T, LazyCommand as U, SubCommandValue as V, isLazyCommand as W, getUnknownKeysMode as X, extractFields as Y, toCamelCase as Z, AnyCommand as _, EffectContext as a, CollectedLogs as b, arg as c, ResolvedExpandCandidate as d, CompletionDirectiveMask as f, DynamicCompletionResult as g, DynamicCompletionResolver as h, CustomCompletion as i, Logger as j, LogLevel as k, ExpandCandidate as l, DynamicCompletionContext as m, CompletionMeta as n, PromptMeta as o, DynamicCompletionCandidate as p, ResolvedFieldMeta as q, CompletionType as r, PromptType as s, ArgMeta as t, ExpandCompletion as u, ArgsSchema as v, GlobalArgs as w, Command as x, CleanupContext as y, RunnableCommand as z };
|
|
918
|
+
//# sourceMappingURL=arg-registry--NRaNFJM.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arg-registry--NRaNFJM.d.cts","names":[],"sources":["../src/core/schema-extractor.ts","../src/lazy.ts","../src/types.ts","../src/core/dynamic-completion-types.ts","../src/core/expand-completion-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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AA;EAAY,oBAAA;AAAA,IACpD,gBAAA,CAAiB,CAAA,EAAG,MAAA,IACpB,qBAAA,CAAsB,YAAA,CAAa,CAAA,kBACjC,sBAAA,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"}
|
|
@@ -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
|
|
@@ -424,19 +455,139 @@ interface RunResultFailure {
|
|
|
424
455
|
*/
|
|
425
456
|
type RunResult<T = unknown> = RunResultSuccess<T> | RunResultFailure;
|
|
426
457
|
//#endregion
|
|
458
|
+
//#region src/core/dynamic-completion-types.d.ts
|
|
459
|
+
/**
|
|
460
|
+
* Types for in-process dynamic value completion.
|
|
461
|
+
*
|
|
462
|
+
* A `resolve` callback registered on `arg(...)` receives parsed context
|
|
463
|
+
* (other arg values typed so far, previous values supplied to the same
|
|
464
|
+
* option, the current word being completed, target shell) and returns
|
|
465
|
+
* candidates. The callback runs inside the `__complete` command, so static
|
|
466
|
+
* shell scripts delegate to `<program> __complete` for any spec that uses
|
|
467
|
+
* `resolve`.
|
|
468
|
+
*
|
|
469
|
+
* Defined under `core/` (not `completion/`) so `arg-registry.ts` can
|
|
470
|
+
* reference the resolver type without crossing the lint-enforced
|
|
471
|
+
* `completion → core` boundary.
|
|
472
|
+
*/
|
|
473
|
+
/** Bitmask combining `CompletionDirective` values. */
|
|
474
|
+
type CompletionDirectiveMask = number;
|
|
475
|
+
interface DynamicCompletionContext {
|
|
476
|
+
/** Word being completed. `--field=` inline prefix is stripped before this is set. */
|
|
477
|
+
currentWord: string;
|
|
478
|
+
/** Target shell formatting requested by the caller. */
|
|
479
|
+
shell: "bash" | "zsh" | "fish";
|
|
480
|
+
/**
|
|
481
|
+
* Best-effort parsed values of OTHER args on the same command, keyed by
|
|
482
|
+
* camelCase name. Includes positionals and other options. Zod validation
|
|
483
|
+
* is NOT applied; values are raw strings (or arrays of raw strings for
|
|
484
|
+
* array-typed options/variadic positionals).
|
|
485
|
+
*/
|
|
486
|
+
parsedArgs: Readonly<Record<string, unknown>>;
|
|
487
|
+
/**
|
|
488
|
+
* Values already supplied for the SAME option/positional being completed.
|
|
489
|
+
* Useful for de-duplicating repeated array options.
|
|
490
|
+
*/
|
|
491
|
+
previousValues: readonly string[];
|
|
492
|
+
/**
|
|
493
|
+
* Subcommand path from root (e.g. ["api"]). Reflects what the user
|
|
494
|
+
* actually typed — aliases are NOT resolved to their canonical names, so
|
|
495
|
+
* resolvers that branch on the path should accept every alias they care
|
|
496
|
+
* about.
|
|
497
|
+
*/
|
|
498
|
+
subcommandPath: readonly string[];
|
|
499
|
+
}
|
|
500
|
+
interface DynamicCompletionCandidate {
|
|
501
|
+
value: string;
|
|
502
|
+
description?: string;
|
|
503
|
+
}
|
|
504
|
+
interface DynamicCompletionResult {
|
|
505
|
+
/** Candidates to surface. Strings or `{value, description}` objects. */
|
|
506
|
+
candidates: Array<string | DynamicCompletionCandidate>;
|
|
507
|
+
/**
|
|
508
|
+
* Optional directive override. When omitted, defaults to
|
|
509
|
+
* `FilterPrefix | NoFileCompletion` (matches `choices` behaviour).
|
|
510
|
+
*/
|
|
511
|
+
directive?: CompletionDirectiveMask;
|
|
512
|
+
}
|
|
513
|
+
type DynamicCompletionResolver = (ctx: DynamicCompletionContext) => DynamicCompletionResult | Promise<DynamicCompletionResult>;
|
|
514
|
+
//#endregion
|
|
515
|
+
//#region src/core/expand-completion-types.d.ts
|
|
516
|
+
/**
|
|
517
|
+
* Types for "expand" completion — candidates that are pre-enumerated at
|
|
518
|
+
* script-generation time and inlined into the static shell script.
|
|
519
|
+
*
|
|
520
|
+
* The user provides `dependsOn` (sibling arg names that must have static
|
|
521
|
+
* `choices` or an enum schema) and `enumerate(deps)`. politty walks the
|
|
522
|
+
* cartesian product of the dependsOn values, calls `enumerate` for each
|
|
523
|
+
* combination, and emits a case lookup keyed on the runtime values of those
|
|
524
|
+
* args. No Node process is spawned on TAB.
|
|
525
|
+
*
|
|
526
|
+
* Defined under `core/` (not `completion/`) so `arg-registry.ts` can
|
|
527
|
+
* reference these types without crossing the lint-enforced
|
|
528
|
+
* `completion → core` boundary.
|
|
529
|
+
*/
|
|
530
|
+
/** Candidate returned by an `enumerate` callback. */
|
|
531
|
+
interface ExpandCandidate {
|
|
532
|
+
value: string;
|
|
533
|
+
description?: string;
|
|
534
|
+
}
|
|
535
|
+
/** Resolved candidate stored on a {@link ValueCompletion} after enumeration. */
|
|
536
|
+
interface ResolvedExpandCandidate {
|
|
537
|
+
value: string;
|
|
538
|
+
description?: string;
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* User-facing spec attached to `completion.custom.expand`.
|
|
542
|
+
*
|
|
543
|
+
* `dependsOn` lists sibling args (camelCase names) whose values determine
|
|
544
|
+
* which candidates apply. Each named arg must have a static set of values —
|
|
545
|
+
* either an explicit `completion.custom.choices` or an enum schema. The
|
|
546
|
+
* order of `dependsOn` is the order in which `deps` keys are exposed to
|
|
547
|
+
* `enumerate`.
|
|
548
|
+
*
|
|
549
|
+
* `enumerate` runs once per cartesian-product combination at the time the
|
|
550
|
+
* shell script is generated (e.g. when the user runs `<program> completion
|
|
551
|
+
* zsh`). It must be a pure function of `deps`; politty does not retain it
|
|
552
|
+
* for runtime use.
|
|
553
|
+
*/
|
|
554
|
+
interface ExpandCompletion {
|
|
555
|
+
dependsOn: readonly string[];
|
|
556
|
+
enumerate: (deps: Readonly<Record<string, string>>) => ReadonlyArray<string | ExpandCandidate>;
|
|
557
|
+
}
|
|
558
|
+
//#endregion
|
|
427
559
|
//#region src/core/arg-registry.d.ts
|
|
428
560
|
/**
|
|
429
561
|
* Built-in completion types
|
|
430
562
|
*/
|
|
431
563
|
type CompletionType = "file" | "directory" | "none";
|
|
432
564
|
/**
|
|
433
|
-
* Custom completion specification
|
|
565
|
+
* Custom completion specification.
|
|
566
|
+
*
|
|
567
|
+
* `choices`, `shellCommand`, `resolve`, and `expand` are mutually exclusive —
|
|
568
|
+
* specifying more than one throws when the field metadata is resolved.
|
|
434
569
|
*/
|
|
435
570
|
interface CustomCompletion {
|
|
436
571
|
/** Static list of choices for completion */
|
|
437
572
|
choices?: string[];
|
|
438
573
|
/** Shell command to execute for dynamic completion */
|
|
439
574
|
shellCommand?: string;
|
|
575
|
+
/**
|
|
576
|
+
* In-process JS callback for dynamic completion. Receives parsed context
|
|
577
|
+
* (other arg values typed so far, previously supplied values for this same
|
|
578
|
+
* option) and returns candidates. Static shell scripts delegate to
|
|
579
|
+
* `<program> __complete` whenever this is set.
|
|
580
|
+
*/
|
|
581
|
+
resolve?: DynamicCompletionResolver;
|
|
582
|
+
/**
|
|
583
|
+
* Pre-enumerated completion baked into the generated shell script. The
|
|
584
|
+
* candidate list is computed at script-generation time by calling
|
|
585
|
+
* `enumerate` for every combination of the sibling arg values listed in
|
|
586
|
+
* `dependsOn` (each must have a static `choices` or enum schema). The
|
|
587
|
+
* shell then dispatches via a case lookup keyed by the runtime values of
|
|
588
|
+
* those args — no Node process is spawned on TAB.
|
|
589
|
+
*/
|
|
590
|
+
expand?: ExpandCompletion;
|
|
440
591
|
}
|
|
441
592
|
/**
|
|
442
593
|
* Completion metadata for an argument
|
|
@@ -578,6 +729,58 @@ interface BaseArgMeta<TValue = unknown> {
|
|
|
578
729
|
* ```
|
|
579
730
|
*/
|
|
580
731
|
prompt?: PromptMeta;
|
|
732
|
+
/**
|
|
733
|
+
* Control the boolean negation option.
|
|
734
|
+
*
|
|
735
|
+
* Boolean fields automatically accept `--no-<cliName>` (and the camelCase
|
|
736
|
+
* `--no<Name>` form) to set the value to `false`. By default this form is
|
|
737
|
+
* accepted by the parser but hidden from help, generated docs, and shell
|
|
738
|
+
* completions. This option lets you customize or expose that behavior:
|
|
739
|
+
*
|
|
740
|
+
* - `string` — replaces the auto-generated `--no-*` form with a custom
|
|
741
|
+
* name. The default `--no-*` is no longer recognized.
|
|
742
|
+
* - `true` — opt-in to advertising the default `--no-<cliName>` form in
|
|
743
|
+
* help, generated docs, and shell completions. Parser behavior is
|
|
744
|
+
* unchanged.
|
|
745
|
+
* - `false` — disables negation entirely; neither the default `--no-*`
|
|
746
|
+
* nor any custom name is accepted.
|
|
747
|
+
*
|
|
748
|
+
* String values follow the same naming conventions as `cliName`
|
|
749
|
+
* (kebab-case is recommended). Only valid on boolean fields; setting
|
|
750
|
+
* `negation` on a non-boolean field is a type error and raises a
|
|
751
|
+
* runtime error during command parsing.
|
|
752
|
+
*
|
|
753
|
+
* @example
|
|
754
|
+
* ```ts
|
|
755
|
+
* // Custom negation name
|
|
756
|
+
* cache: arg(z.boolean().default(true), {
|
|
757
|
+
* description: "Enable caching",
|
|
758
|
+
* negation: "disable-cache",
|
|
759
|
+
* })
|
|
760
|
+
* // Accepts: --cache (true), --disable-cache (false)
|
|
761
|
+
* // No longer accepts: --no-cache
|
|
762
|
+
*
|
|
763
|
+
* // Expose default `--no-X` in help/docs/completion
|
|
764
|
+
* verbose: arg(z.boolean().default(false), {
|
|
765
|
+
* negation: true,
|
|
766
|
+
* })
|
|
767
|
+
* // Help shows `--verbose / --no-verbose`
|
|
768
|
+
*
|
|
769
|
+
* // Disable negation entirely
|
|
770
|
+
* dryRun: arg(z.boolean().default(false), {
|
|
771
|
+
* negation: false,
|
|
772
|
+
* })
|
|
773
|
+
* // Accepts: --dry-run (true)
|
|
774
|
+
* // No longer accepts: --no-dry-run
|
|
775
|
+
* ```
|
|
776
|
+
*/
|
|
777
|
+
negation?: string | boolean;
|
|
778
|
+
/**
|
|
779
|
+
* Description shown for the negation option in help and generated docs.
|
|
780
|
+
* Only meaningful when `negation` is set to a custom name string or `true`.
|
|
781
|
+
* Disallowed when `negation` is `false`.
|
|
782
|
+
*/
|
|
783
|
+
negationDescription?: string;
|
|
581
784
|
/**
|
|
582
785
|
* Side-effect callback executed after argument parsing and validation.
|
|
583
786
|
* Runs before the command lifecycle (setup/run/cleanup).
|
|
@@ -664,23 +867,52 @@ type ContainsReservedAlias<A> = [A] extends [never] ? false : A extends "h" | "H
|
|
|
664
867
|
type ReservedAliasTypeError<M> = { [K in keyof M]: M[K] } & {
|
|
665
868
|
__typeError: "Alias 'h' or 'H' requires overrideBuiltinAlias: true";
|
|
666
869
|
};
|
|
870
|
+
type NegationTypeError<M> = { [K in keyof M]: M[K] } & {
|
|
871
|
+
__typeError: "negation/negationDescription can only be used on boolean fields";
|
|
872
|
+
};
|
|
667
873
|
type AliasFieldOf<M> = M extends {
|
|
668
874
|
alias: infer A;
|
|
669
875
|
} ? A : never;
|
|
670
876
|
type HiddenAliasFieldOf<M> = M extends {
|
|
671
877
|
hiddenAlias: infer H;
|
|
672
878
|
} ? H : never;
|
|
879
|
+
/**
|
|
880
|
+
* Check whether a Zod output type is a (possibly optional) boolean.
|
|
881
|
+
* Strips `undefined` to allow `z.boolean().optional()`. Requires both
|
|
882
|
+
* `boolean extends NonNullable<T>` (so `z.literal(true)` is rejected — the full
|
|
883
|
+
* `boolean` domain is needed) and `NonNullable<T> extends boolean` (so unions
|
|
884
|
+
* such as `z.union([z.boolean(), z.string()])` are rejected at the type level
|
|
885
|
+
* to match the runtime check).
|
|
886
|
+
*/
|
|
887
|
+
type IsBooleanField<T> = boolean extends NonNullable<T> ? ([NonNullable<T>] extends [boolean] ? true : false) : false;
|
|
888
|
+
/**
|
|
889
|
+
* Detect whether `M` has `K` set to a non-undefined value.
|
|
890
|
+
*
|
|
891
|
+
* When `M` is inferred from a literal such as `{ negation: "off" }`,
|
|
892
|
+
* `M["negation"]` is `"off"` (without `undefined`), so this returns `true`.
|
|
893
|
+
* When `M` is the wider `ArgMeta` type, `M["negation"]` is
|
|
894
|
+
* `string | boolean | undefined`, so this returns `false` and avoids
|
|
895
|
+
* false-positive type errors on broadly-typed meta values.
|
|
896
|
+
*/
|
|
897
|
+
type HasExplicit<M, K extends string> = K extends keyof M ? undefined extends M[K] ? false : true : false;
|
|
898
|
+
/**
|
|
899
|
+
* Reject `negation` / `negationDescription` on non-boolean fields.
|
|
900
|
+
* Uses {@link HasExplicit} so the error only fires when the user explicitly
|
|
901
|
+
* sets the field on a narrowly-inferred meta literal.
|
|
902
|
+
*/
|
|
903
|
+
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
904
|
/**
|
|
674
905
|
* Type helper to validate ArgMeta.
|
|
675
906
|
* Forces a type error when a reserved alias ("h" / "H") is used without
|
|
676
907
|
* `overrideBuiltinAlias: true`, whether the alias is provided as a string
|
|
677
908
|
* or as part of an array, and whether it appears in `alias` or `hiddenAlias`.
|
|
909
|
+
* Also rejects `negation` / `negationDescription` on non-boolean fields.
|
|
678
910
|
*/
|
|
679
|
-
type ValidateArgMeta<M> = M extends {
|
|
911
|
+
type ValidateArgMeta<M, TValue = unknown> = M extends {
|
|
680
912
|
overrideBuiltinAlias: true;
|
|
681
|
-
} ? M : ContainsReservedAlias<AliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : ContainsReservedAlias<HiddenAliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : M
|
|
913
|
+
} ? ValidateNegation<M, TValue> : ContainsReservedAlias<AliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : ContainsReservedAlias<HiddenAliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : ValidateNegation<M, TValue>;
|
|
682
914
|
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
|
|
915
|
+
declare function arg<T extends z.ZodType, M extends ArgMeta<z.output<T>>>(schema: T, meta: ValidateArgMeta<M, z.output<T>>): T;
|
|
684
916
|
//#endregion
|
|
685
|
-
export {
|
|
686
|
-
//# sourceMappingURL=arg-registry-
|
|
917
|
+
export { LogStream as A, SetupContext as B, Example as C, IsEmpty as D, GlobalSetupContext as E, RunCommandOptions as F, lazy as G, SubCommandsRecord as H, RunResult as I, UnknownKeysMode as J, ExtractedFields as K, RunResultFailure as L, MainOptions as M, NonRunnableCommand as N, LogEntry as O, PromptResolver as P, toKebabCase as Q, RunResultSuccess as R, CommandBase as S, GlobalCleanupContext as T, LazyCommand as U, SubCommandValue as V, isLazyCommand as W, getUnknownKeysMode as X, extractFields as Y, toCamelCase as Z, AnyCommand as _, EffectContext as a, CollectedLogs as b, arg as c, ResolvedExpandCandidate as d, CompletionDirectiveMask as f, DynamicCompletionResult as g, DynamicCompletionResolver as h, CustomCompletion as i, Logger as j, LogLevel as k, ExpandCandidate as l, DynamicCompletionContext as m, CompletionMeta as n, PromptMeta as o, DynamicCompletionCandidate as p, ResolvedFieldMeta as q, CompletionType as r, PromptType as s, ArgMeta as t, ExpandCompletion as u, ArgsSchema as v, GlobalArgs as w, Command as x, CleanupContext as y, RunnableCommand as z };
|
|
918
|
+
//# sourceMappingURL=arg-registry-6E0WHOh_.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arg-registry-6E0WHOh_.d.ts","names":[],"sources":["../src/core/schema-extractor.ts","../src/lazy.ts","../src/types.ts","../src/core/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NrF,cAAA,sBACa,WAAA,CAAY,CAAA,MAAO,WAAA,CAAY,CAAA;;;AHxMrC;AAAA;;;;AAOE;AAMd;KGsMK,WAAA,wBAAmC,CAAA,eAAgB,CAAA,qBAClC,CAAA,CAAE,CAAA;;;;;;KAUnB,gBAAA,cACH,WAAA,CAAY,CAAA,6BACR,cAAA,CAAe,MAAA,iBACb,CAAA,GACA,iBAAA,CAAkB,CAAA,IACpB,WAAA,CAAY,CAAA,wCACV,cAAA,CAAe,MAAA,iBACb,CAAA,GACA,iBAAA,CAAkB,CAAA,IACpB,CAAA;;;;;;;AH1NmE;KGmOtE,eAAA,wBAAuC,CAAA;EAAY,oBAAA;AAAA,IACpD,gBAAA,CAAiB,CAAA,EAAG,MAAA,IACpB,qBAAA,CAAsB,YAAA,CAAa,CAAA,kBACjC,sBAAA,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