politty 0.4.16 → 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.
Files changed (52) hide show
  1. package/dist/{arg-registry-MVWOAcvw.d.cts → arg-registry--NRaNFJM.d.cts} +123 -3
  2. package/dist/arg-registry--NRaNFJM.d.cts.map +1 -0
  3. package/dist/{arg-registry-Cd6xnjHa.d.ts → arg-registry-6E0WHOh_.d.ts} +123 -3
  4. package/dist/arg-registry-6E0WHOh_.d.ts.map +1 -0
  5. package/dist/augment.d.cts +1 -1
  6. package/dist/augment.d.ts +1 -1
  7. package/dist/completion/index.cjs +1 -1
  8. package/dist/completion/index.d.cts +3 -2
  9. package/dist/completion/index.d.ts +3 -2
  10. package/dist/completion/index.js +1 -1
  11. package/dist/completion-BA5JMvVG.js +4067 -0
  12. package/dist/completion-BA5JMvVG.js.map +1 -0
  13. package/dist/completion-Cqs1Ja7C.cjs +4169 -0
  14. package/dist/completion-Cqs1Ja7C.cjs.map +1 -0
  15. package/dist/docs/index.cjs +9 -9
  16. package/dist/docs/index.cjs.map +1 -1
  17. package/dist/docs/index.d.cts +1 -1
  18. package/dist/docs/index.d.ts +1 -1
  19. package/dist/docs/index.js +2 -2
  20. package/dist/{index-CPebddth.d.cts → index-DBMfKZ34.d.ts} +135 -15
  21. package/dist/index-DBMfKZ34.d.ts.map +1 -0
  22. package/dist/{index-DR9HLxIP.d.ts → index-DJp8k5Bq.d.cts} +135 -15
  23. package/dist/index-DJp8k5Bq.d.cts.map +1 -0
  24. package/dist/index.cjs +10 -10
  25. package/dist/index.d.cts +3 -3
  26. package/dist/index.d.ts +3 -3
  27. package/dist/index.js +3 -3
  28. package/dist/prompt/clack/index.d.cts +1 -1
  29. package/dist/prompt/clack/index.d.ts +1 -1
  30. package/dist/prompt/index.d.cts +1 -1
  31. package/dist/prompt/index.d.ts +1 -1
  32. package/dist/prompt/inquirer/index.d.cts +1 -1
  33. package/dist/prompt/inquirer/index.d.ts +1 -1
  34. package/dist/{runner-BHeCMEa5.js → runner-BmSEiD9A.js} +12 -9
  35. package/dist/{runner-BHeCMEa5.js.map → runner-BmSEiD9A.js.map} +1 -1
  36. package/dist/{runner-BcyR6Z8r.cjs → runner-CRZ_7Y9i.cjs} +56 -53
  37. package/dist/{runner-BcyR6Z8r.cjs.map → runner-CRZ_7Y9i.cjs.map} +1 -1
  38. package/dist/{subcommand-router-XZBWe8HN.js → schema-extractor-C50R-1re.js} +135 -135
  39. package/dist/schema-extractor-C50R-1re.js.map +1 -0
  40. package/dist/{subcommand-router-DQy0KZU-.cjs → schema-extractor-SLPgBNgZ.cjs} +134 -134
  41. package/dist/schema-extractor-SLPgBNgZ.cjs.map +1 -0
  42. package/package.json +5 -5
  43. package/dist/arg-registry-Cd6xnjHa.d.ts.map +0 -1
  44. package/dist/arg-registry-MVWOAcvw.d.cts.map +0 -1
  45. package/dist/completion-B04iiki9.js +0 -2338
  46. package/dist/completion-B04iiki9.js.map +0 -1
  47. package/dist/completion-BlZxMSeU.cjs +0 -2440
  48. package/dist/completion-BlZxMSeU.cjs.map +0 -1
  49. package/dist/index-CPebddth.d.cts.map +0 -1
  50. package/dist/index-DR9HLxIP.d.ts.map +0 -1
  51. package/dist/subcommand-router-DQy0KZU-.cjs.map +0 -1
  52. package/dist/subcommand-router-XZBWe8HN.js.map +0 -1
@@ -455,19 +455,139 @@ interface RunResultFailure {
455
455
  */
456
456
  type RunResult<T = unknown> = RunResultSuccess<T> | RunResultFailure;
457
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
458
559
  //#region src/core/arg-registry.d.ts
459
560
  /**
460
561
  * Built-in completion types
461
562
  */
462
563
  type CompletionType = "file" | "directory" | "none";
463
564
  /**
464
- * 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.
465
569
  */
466
570
  interface CustomCompletion {
467
571
  /** Static list of choices for completion */
468
572
  choices?: string[];
469
573
  /** Shell command to execute for dynamic completion */
470
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;
471
591
  }
472
592
  /**
473
593
  * Completion metadata for an argument
@@ -794,5 +914,5 @@ type ValidateArgMeta<M, TValue = unknown> = M extends {
794
914
  declare function arg<T extends z.ZodType>(schema: T): T;
795
915
  declare function arg<T extends z.ZodType, M extends ArgMeta<z.output<T>>>(schema: T, meta: ValidateArgMeta<M, z.output<T>>): T;
796
916
  //#endregion
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 };
798
- //# sourceMappingURL=arg-registry-MVWOAcvw.d.cts.map
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;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;A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AEZ,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"}
@@ -455,19 +455,139 @@ interface RunResultFailure {
455
455
  */
456
456
  type RunResult<T = unknown> = RunResultSuccess<T> | RunResultFailure;
457
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
458
559
  //#region src/core/arg-registry.d.ts
459
560
  /**
460
561
  * Built-in completion types
461
562
  */
462
563
  type CompletionType = "file" | "directory" | "none";
463
564
  /**
464
- * 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.
465
569
  */
466
570
  interface CustomCompletion {
467
571
  /** Static list of choices for completion */
468
572
  choices?: string[];
469
573
  /** Shell command to execute for dynamic completion */
470
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;
471
591
  }
472
592
  /**
473
593
  * Completion metadata for an argument
@@ -794,5 +914,5 @@ type ValidateArgMeta<M, TValue = unknown> = M extends {
794
914
  declare function arg<T extends z.ZodType>(schema: T): T;
795
915
  declare function arg<T extends z.ZodType, M extends ArgMeta<z.output<T>>>(schema: T, meta: ValidateArgMeta<M, z.output<T>>): T;
796
916
  //#endregion
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 };
798
- //# sourceMappingURL=arg-registry-Cd6xnjHa.d.ts.map
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/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;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,EAAiB,eAAA;AAAA;AA+nB+C;;;;AChwBlE;;ADgwBkE,KAtnBtD,eAAA;;;;;;;;;iBA6CI,kBAAA,CAAmB,MAAA,EAAQ,CAAA,CAAE,OAAA,GAAU,eAAe;;ACpL7B;AAMzC;;;;iBDkUgB,WAAA,CAAY,GAAW;;;;AClU4B;AAkCnE;;;;;;;iBDkTgB,WAAA,CAAY,GA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AA,IAAyB,CAAA;;;;;;;AHtMsB;AAAE;KGgNrF,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"}
@@ -1,4 +1,4 @@
1
- import { t as ArgMeta } from "./arg-registry-MVWOAcvw.cjs";
1
+ import { t as ArgMeta } from "./arg-registry--NRaNFJM.cjs";
2
2
 
3
3
  //#region src/augment.d.ts
4
4
  declare module "zod" {
package/dist/augment.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as ArgMeta } from "./arg-registry-Cd6xnjHa.js";
1
+ import { t as ArgMeta } from "./arg-registry-6E0WHOh_.js";
2
2
 
3
3
  //#region src/augment.d.ts
4
4
  declare module "zod" {
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_completion = require('../completion-BlZxMSeU.cjs');
2
+ const require_completion = require('../completion-Cqs1Ja7C.cjs');
3
3
 
4
4
  exports.CompletionDirective = require_completion.CompletionDirective;
5
5
  exports.createCompletionCommand = require_completion.createCompletionCommand;
@@ -1,2 +1,3 @@
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
+ import { f as CompletionDirectiveMask, g as DynamicCompletionResult, h as DynamicCompletionResolver, m as DynamicCompletionContext, p as DynamicCompletionCandidate } from "../arg-registry--NRaNFJM.cjs";
2
+ 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-DJp8k5Bq.cjs";
3
+ export { type CandidateResult, type CompletableOption, type CompletableSubcommand, type CompletionCandidate, type CompletionContext, type CompletionData, CompletionDirective, type CompletionDirectiveMask, type CompletionGenerator, type CompletionOptions, type CompletionResult, type CompletionType, type DynamicCompletionCandidate, type DynamicCompletionContext, type DynamicCompletionResolver, type DynamicCompletionResult, type ShellFormatOptions, type ShellType, type ValueCompletionField, WithCompletionOptions, createCompletionCommand, createDynamicCompleteCommand, createRefreshCompletionCommand, detectShell, extractCompletionData, extractPositionals, formatForShell, generateCandidates, generateCompletion, getSupportedShells, hasCompleteCommand, parseCompletionContext, resolveValueCompletion, withCompletionCommand };
@@ -1,2 +1,3 @@
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 };
1
+ import { f as CompletionDirectiveMask, g as DynamicCompletionResult, h as DynamicCompletionResolver, m as DynamicCompletionContext, p as DynamicCompletionCandidate } from "../arg-registry-6E0WHOh_.js";
2
+ 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-DBMfKZ34.js";
3
+ export { type CandidateResult, type CompletableOption, type CompletableSubcommand, type CompletionCandidate, type CompletionContext, type CompletionData, CompletionDirective, type CompletionDirectiveMask, type CompletionGenerator, type CompletionOptions, type CompletionResult, type CompletionType, type DynamicCompletionCandidate, type DynamicCompletionContext, type DynamicCompletionResolver, type DynamicCompletionResult, type ShellFormatOptions, type ShellType, type ValueCompletionField, WithCompletionOptions, createCompletionCommand, createDynamicCompleteCommand, createRefreshCompletionCommand, detectShell, extractCompletionData, extractPositionals, formatForShell, generateCandidates, generateCompletion, getSupportedShells, hasCompleteCommand, parseCompletionContext, resolveValueCompletion, withCompletionCommand };
@@ -1,3 +1,3 @@
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";
1
+ import { a as getSupportedShells, c as hasCompleteCommand, d as extractPositionals, f as CompletionDirective, h as resolveValueCompletion, i as generateCompletion, l as formatForShell, m as parseCompletionContext, n as createRefreshCompletionCommand, o as withCompletionCommand, p as generateCandidates, r as detectShell, s as createDynamicCompleteCommand, t as createCompletionCommand, u as extractCompletionData } from "../completion-BA5JMvVG.js";
2
2
 
3
3
  export { CompletionDirective, createCompletionCommand, createDynamicCompleteCommand, createRefreshCompletionCommand, detectShell, extractCompletionData, extractPositionals, formatForShell, generateCandidates, generateCompletion, getSupportedShells, hasCompleteCommand, parseCompletionContext, resolveValueCompletion, withCompletionCommand };