@kjanat/dreamcli 4.0.0-rc.3 → 4.0.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 (212) hide show
  1. package/README.md +5 -7
  2. package/dist/{runtime/adapter.d.mts → adapter-D0hbBNVB.d.mts} +2 -4
  3. package/dist/completion-D4mz6axB.mjs +6 -0
  4. package/dist/completion.d.mts +90 -0
  5. package/dist/completion.mjs +1 -0
  6. package/dist/config-B9ddC-Kb.mjs +1 -0
  7. package/dist/config.d.mts +2 -0
  8. package/dist/config.mjs +1 -0
  9. package/dist/core-Cp2w8vRq.mjs +17 -0
  10. package/dist/index-BziI2aKc.d.mts +5440 -0
  11. package/dist/index-DOfClfYR.d.mts +370 -0
  12. package/dist/index-DWsnGZlx.d.mts +831 -0
  13. package/dist/{core/cli/index.d.mts → index-DXROeDPC.d.mts} +116 -57
  14. package/dist/index-DndPmT8J.d.mts +275 -0
  15. package/dist/{core/json-schema/index.d.mts → index-DyoaS234.d.mts} +43 -34
  16. package/dist/index.d.mts +190 -41
  17. package/dist/index.mjs +1 -26
  18. package/dist/json-schema-C9SzZ7jY.mjs +52 -0
  19. package/dist/json-schema.d.mts +2 -0
  20. package/dist/json-schema.mjs +1 -0
  21. package/dist/package-json-BgE9YjjQ.mjs +3 -0
  22. package/dist/prompt.d.mts +48 -0
  23. package/dist/prompt.mjs +1 -0
  24. package/dist/rolldown-runtime-G4Kt5YOX.mjs +1 -0
  25. package/dist/runtime.d.mts +2 -6
  26. package/dist/runtime.mjs +1 -6
  27. package/dist/terminal-C8KTXjv5.mjs +6 -0
  28. package/dist/test-prompter-v__jT2yG.mjs +1 -0
  29. package/dist/testkit.d.mts +54 -6
  30. package/dist/testkit.mjs +1 -5
  31. package/dist/version.mjs +1 -7
  32. package/dreamcli.schema.json +697 -538
  33. package/package.json +29 -7
  34. package/skills/cli-creation/SKILL.md +16 -11
  35. package/CHANGELOG.md +0 -1116
  36. package/dist/core/cli/builtins.d.mts +0 -117
  37. package/dist/core/cli/builtins.mjs +0 -135
  38. package/dist/core/cli/compiled.d.mts +0 -66
  39. package/dist/core/cli/compiled.mjs +0 -76
  40. package/dist/core/cli/dispatch.d.mts +0 -115
  41. package/dist/core/cli/dispatch.mjs +0 -205
  42. package/dist/core/cli/help-links.d.mts +0 -27
  43. package/dist/core/cli/help-links.mjs +0 -41
  44. package/dist/core/cli/index.mjs +0 -1271
  45. package/dist/core/cli/planner.d.mts +0 -174
  46. package/dist/core/cli/planner.mjs +0 -323
  47. package/dist/core/cli/plugin.d.mts +0 -94
  48. package/dist/core/cli/plugin.mjs +0 -41
  49. package/dist/core/cli/propagate.d.mts +0 -39
  50. package/dist/core/cli/propagate.mjs +0 -57
  51. package/dist/core/cli/reserved-flags.d.mts +0 -19
  52. package/dist/core/cli/reserved-flags.mjs +0 -158
  53. package/dist/core/cli/root-help.d.mts +0 -53
  54. package/dist/core/cli/root-help.mjs +0 -221
  55. package/dist/core/cli/root-output-flags.d.mts +0 -74
  56. package/dist/core/cli/root-output-flags.mjs +0 -169
  57. package/dist/core/cli/root-surface.d.mts +0 -64
  58. package/dist/core/cli/root-surface.mjs +0 -28
  59. package/dist/core/cli/runtime-preflight.d.mts +0 -213
  60. package/dist/core/cli/runtime-preflight.mjs +0 -221
  61. package/dist/core/completion/index.d.mts +0 -76
  62. package/dist/core/completion/index.mjs +0 -90
  63. package/dist/core/completion/shells/bash.d.mts +0 -23
  64. package/dist/core/completion/shells/bash.mjs +0 -312
  65. package/dist/core/completion/shells/fish.d.mts +0 -19
  66. package/dist/core/completion/shells/fish.mjs +0 -164
  67. package/dist/core/completion/shells/powershell.d.mts +0 -13
  68. package/dist/core/completion/shells/powershell.mjs +0 -360
  69. package/dist/core/completion/shells/shared.d.mts +0 -164
  70. package/dist/core/completion/shells/shared.mjs +0 -147
  71. package/dist/core/completion/shells/zsh.d.mts +0 -23
  72. package/dist/core/completion/shells/zsh.mjs +0 -256
  73. package/dist/core/config/index.d.mts +0 -191
  74. package/dist/core/config/index.mjs +0 -285
  75. package/dist/core/config/package-json.d.mts +0 -179
  76. package/dist/core/config/package-json.mjs +0 -353
  77. package/dist/core/errors/index.d.mts +0 -125
  78. package/dist/core/errors/index.mjs +0 -87
  79. package/dist/core/execution/index.d.mts +0 -61
  80. package/dist/core/execution/index.mjs +0 -220
  81. package/dist/core/help/ansi.d.mts +0 -84
  82. package/dist/core/help/ansi.mjs +0 -121
  83. package/dist/core/help/index.d.mts +0 -149
  84. package/dist/core/help/index.mjs +0 -418
  85. package/dist/core/help/theme.d.mts +0 -86
  86. package/dist/core/help/theme.mjs +0 -69
  87. package/dist/core/json-schema/index.mjs +0 -1008
  88. package/dist/core/json-schema/meta-descriptions.generated.d.mts +0 -274
  89. package/dist/core/json-schema/meta-descriptions.generated.mjs +0 -136
  90. package/dist/core/output/activity.d.mts +0 -193
  91. package/dist/core/output/activity.mjs +0 -452
  92. package/dist/core/output/bind.d.mts +0 -37
  93. package/dist/core/output/bind.mjs +0 -56
  94. package/dist/core/output/contracts.d.mts +0 -82
  95. package/dist/core/output/contracts.mjs +0 -57
  96. package/dist/core/output/display-value.d.mts +0 -19
  97. package/dist/core/output/display-value.mjs +0 -32
  98. package/dist/core/output/index.d.mts +0 -344
  99. package/dist/core/output/index.mjs +0 -514
  100. package/dist/core/output/renderers.d.mts +0 -45
  101. package/dist/core/output/renderers.mjs +0 -46
  102. package/dist/core/output/writer.d.mts +0 -39
  103. package/dist/core/output/writer.mjs +0 -12
  104. package/dist/core/parse/index.d.mts +0 -178
  105. package/dist/core/parse/index.mjs +0 -850
  106. package/dist/core/parse/occurrences.d.mts +0 -90
  107. package/dist/core/parse/occurrences.mjs +0 -114
  108. package/dist/core/prompt/index.d.mts +0 -213
  109. package/dist/core/prompt/index.mjs +0 -348
  110. package/dist/core/read-flags/index.d.mts +0 -150
  111. package/dist/core/read-flags/index.mjs +0 -217
  112. package/dist/core/resolve/args.d.mts +0 -39
  113. package/dist/core/resolve/args.mjs +0 -182
  114. package/dist/core/resolve/coerce.d.mts +0 -79
  115. package/dist/core/resolve/coerce.mjs +0 -900
  116. package/dist/core/resolve/config.d.mts +0 -10
  117. package/dist/core/resolve/config.mjs +0 -19
  118. package/dist/core/resolve/contracts.d.mts +0 -146
  119. package/dist/core/resolve/errors.d.mts +0 -10
  120. package/dist/core/resolve/errors.mjs +0 -148
  121. package/dist/core/resolve/flags.d.mts +0 -74
  122. package/dist/core/resolve/flags.mjs +0 -246
  123. package/dist/core/resolve/index.d.mts +0 -44
  124. package/dist/core/resolve/index.mjs +0 -123
  125. package/dist/core/resolve/path-checks.d.mts +0 -48
  126. package/dist/core/resolve/path-checks.mjs +0 -102
  127. package/dist/core/resolve/redaction.d.mts +0 -13
  128. package/dist/core/resolve/redaction.mjs +0 -14
  129. package/dist/core/resolve/stages.d.mts +0 -86
  130. package/dist/core/resolve/stages.mjs +0 -170
  131. package/dist/core/resolve/standard.d.mts +0 -26
  132. package/dist/core/resolve/standard.mjs +0 -212
  133. package/dist/core/schema/activity.d.mts +0 -189
  134. package/dist/core/schema/arg.d.mts +0 -1461
  135. package/dist/core/schema/arg.mjs +0 -1139
  136. package/dist/core/schema/brand.d.mts +0 -17
  137. package/dist/core/schema/cardinality.d.mts +0 -302
  138. package/dist/core/schema/cardinality.mjs +0 -514
  139. package/dist/core/schema/command.d.mts +0 -1132
  140. package/dist/core/schema/command.mjs +0 -999
  141. package/dist/core/schema/flag.d.mts +0 -1495
  142. package/dist/core/schema/flag.mjs +0 -1207
  143. package/dist/core/schema/index.d.mts +0 -15
  144. package/dist/core/schema/index.mjs +0 -10
  145. package/dist/core/schema/middleware.d.mts +0 -129
  146. package/dist/core/schema/middleware.mjs +0 -41
  147. package/dist/core/schema/number-constraints.d.mts +0 -96
  148. package/dist/core/schema/number-constraints.mjs +0 -60
  149. package/dist/core/schema/prompt.d.mts +0 -135
  150. package/dist/core/schema/provenance.d.mts +0 -99
  151. package/dist/core/schema/provenance.mjs +0 -28
  152. package/dist/core/schema/run.d.mts +0 -211
  153. package/dist/core/schema/source.d.mts +0 -180
  154. package/dist/core/schema/source.mjs +0 -206
  155. package/dist/core/schema/standard.d.mts +0 -100
  156. package/dist/core/schema/standard.mjs +0 -15
  157. package/dist/core/schema/stdin.d.mts +0 -97
  158. package/dist/core/schema/stdin.mjs +0 -91
  159. package/dist/core/schema/string-constraints.d.mts +0 -108
  160. package/dist/core/schema/string-constraints.mjs +0 -86
  161. package/dist/core/schema/value-parsers.d.mts +0 -150
  162. package/dist/core/schema/value-parsers.mjs +0 -160
  163. package/dist/core/schema/value.d.mts +0 -243
  164. package/dist/core/schema/value.mjs +0 -573
  165. package/dist/core/testkit/index.d.mts +0 -63
  166. package/dist/core/testkit/index.mjs +0 -102
  167. package/dist/runtime/adapter.mjs +0 -92
  168. package/dist/runtime/auto.d.mts +0 -25
  169. package/dist/runtime/auto.mjs +0 -45
  170. package/dist/runtime/deno.d.mts +0 -99
  171. package/dist/runtime/deno.mjs +0 -265
  172. package/dist/runtime/detect.d.mts +0 -86
  173. package/dist/runtime/detect.mjs +0 -45
  174. package/dist/runtime/index.d.mts +0 -6
  175. package/dist/runtime/node.d.mts +0 -71
  176. package/dist/runtime/node.mjs +0 -228
  177. package/dist/runtime/paths.d.mts +0 -31
  178. package/dist/runtime/paths.mjs +0 -48
  179. package/dist/strings.d.mts +0 -27
  180. package/dist/strings.mjs +0 -22
  181. package/examples/basic.ts +0 -37
  182. package/examples/flag-types.ts +0 -79
  183. package/examples/gh/package.json +0 -45
  184. package/examples/gh/src/commands/auth.ts +0 -66
  185. package/examples/gh/src/commands/issue.ts +0 -120
  186. package/examples/gh/src/commands/pr.ts +0 -125
  187. package/examples/gh/src/data/issues.yaml +0 -5
  188. package/examples/gh/src/data/issues.yaml.d.ts +0 -17
  189. package/examples/gh/src/data/pull-requests.yaml +0 -7
  190. package/examples/gh/src/data/pull-requests.yaml.d.ts +0 -18
  191. package/examples/gh/src/docs.ts +0 -11
  192. package/examples/gh/src/lib/auth.ts +0 -37
  193. package/examples/gh/src/lib/utils.ts +0 -17
  194. package/examples/gh/src/main.test.ts +0 -307
  195. package/examples/gh/src/main.ts +0 -46
  196. package/examples/help-config.ts +0 -43
  197. package/examples/interactive.ts +0 -67
  198. package/examples/json-mode.ts +0 -95
  199. package/examples/middleware.ts +0 -71
  200. package/examples/multi-command.ts +0 -66
  201. package/examples/output-extras.ts +0 -46
  202. package/examples/parser-control.ts +0 -40
  203. package/examples/pwsh-demo/README.md +0 -40
  204. package/examples/pwsh-demo/package.json +0 -41
  205. package/examples/pwsh-demo/pwsh-demo.cmd +0 -3
  206. package/examples/pwsh-demo/smoke-powershell.ps1 +0 -218
  207. package/examples/pwsh-demo/src/main.test.ts +0 -45
  208. package/examples/pwsh-demo/src/main.ts +0 -140
  209. package/examples/spinner-progress.ts +0 -49
  210. package/examples/standard-schema.ts +0 -45
  211. package/examples/testing.ts +0 -147
  212. package/examples/transport-launcher.ts +0 -85
@@ -1,274 +0,0 @@
1
- //#region src/core/json-schema/meta-descriptions.generated.d.ts
2
- /**
3
- * Generated definition meta-schema descriptions from normalized TypeDoc output.
4
- *
5
- * @module
6
- */
7
- declare const definitionMetaSchemaDescriptions: {
8
- readonly root: {
9
- readonly description: "Runtime descriptor for the CLI program.\n\nStores the program name, version, description, and registered command schemas.\\\nSealed by createCLISchema and rebuilt by each CLIBuilder step.";
10
- readonly properties: {
11
- readonly name: {
12
- readonly description: "Program name (used in help text, usage lines, and completion scripts).";
13
- };
14
- readonly version: {
15
- readonly description: "Program version (shown by `--version`).";
16
- };
17
- readonly description: {
18
- readonly description: "Program description (shown in root help).";
19
- };
20
- readonly defaultCommand: {
21
- readonly description: "Schema of the default command dispatched when no subcommand matches.\n\nWhen set, the CLI root behaves like a hybrid command group: subcommands\ndispatch by name as usual, but empty argv or flags-only argv falls\nthrough to this command instead of showing root help.\n\nSet via the .default() builder method\nor the `defaultCommand` field of CLIDefinition.";
22
- };
23
- readonly commands: {
24
- readonly description: "Schemas of the registered commands, in registration order.";
25
- };
26
- };
27
- };
28
- readonly defs: {
29
- readonly command: {
30
- readonly description: "Runtime descriptor produced by CommandBuilder.\n\nConsumers (parser, help generator, CLI dispatcher) read this to\nunderstand the command's shape — flags, args, aliases, subcommands,\nand interactive resolver.";
31
- readonly properties: {
32
- readonly name: {
33
- readonly description: "The command name (used for dispatch, e.g. `'deploy'`).";
34
- };
35
- readonly description: {
36
- readonly description: "Human-readable description for help text.";
37
- };
38
- readonly aliases: {
39
- readonly description: "Alternative names for this command.";
40
- };
41
- readonly hidden: {
42
- readonly description: "Whether this command is hidden from help listings.";
43
- };
44
- readonly examples: {
45
- readonly description: "Usage examples for help text.";
46
- };
47
- readonly flags: {
48
- readonly description: "Named flag schemas, keyed by flag name.";
49
- };
50
- readonly args: {
51
- readonly description: "Ordered positional arg entries (name + schema).";
52
- };
53
- readonly commands: {
54
- readonly description: "Nested subcommand schemas (for help rendering and completion).\n\nPure data — no execution closures. Populated by `.command()` on\n`CommandBuilder`. Empty for leaf commands.";
55
- };
56
- };
57
- };
58
- readonly commandDocument: {
59
- readonly description: "A single-command definition document, version 1.\n\nProduced by generateCommandSchema. Same shape as a\nCommandDefinitionFragmentV1 plus the `schemaVersion` every standalone\ndocument carries.";
60
- readonly properties: {
61
- readonly schemaVersion: {
62
- readonly description: "Version of the definition document format emitted by generateSchema\nand generateCommandSchema.";
63
- };
64
- readonly name: {
65
- readonly description: "The command name used for dispatch.";
66
- };
67
- readonly description: {
68
- readonly description: "Human-readable description for help text.";
69
- };
70
- readonly aliases: {
71
- readonly description: "Alternative names accepted for this command.";
72
- };
73
- readonly hidden: {
74
- readonly description: "Whether the command is omitted from help listings.";
75
- };
76
- readonly examples: {
77
- readonly description: "Usage examples attached to the command.";
78
- };
79
- readonly flags: {
80
- readonly description: "Named flag definitions keyed by flag name.";
81
- };
82
- readonly args: {
83
- readonly description: "Positional argument definitions in CLI order.";
84
- };
85
- readonly commands: {
86
- readonly description: "Nested subcommand definitions.";
87
- };
88
- };
89
- };
90
- readonly flag: {
91
- readonly description: "The runtime descriptor stored inside every FlagBuilder. Consumers (parser,\nhelp generator, resolution chain) read this to understand the flag's shape\nwithout touching generics.";
92
- readonly properties: {
93
- readonly kind: {
94
- readonly description: "What kind of value this flag accepts.";
95
- };
96
- readonly presence: {
97
- readonly description: "Presence describes whether a flag value is guaranteed to exist when the\naction handler runs:\n\n- `'optional'` — not required; unresolved value follows the kind-specific\n optional fallback (`undefined` for most flags, `[]` for arrays)\n- `'required'` — must be supplied; error if missing\n- `'defaulted'` — always present (falls back to default value)";
98
- };
99
- readonly defaultValue: {
100
- readonly description: "Runtime default value (if any).";
101
- };
102
- readonly aliases: {
103
- readonly description: "Short/long aliases (e.g. `[{ name: 'f', hidden: false }]` for `--force`).";
104
- };
105
- readonly stdin: {
106
- readonly description: "Stdin binding set by `.stdin()` (`undefined` when the flag never reads\nstdin). See StdinBinding.";
107
- };
108
- readonly envVar: {
109
- readonly description: "Environment variable name for v0.2+ resolution.";
110
- };
111
- readonly configPath: {
112
- readonly description: "Dotted config path for v0.2+ resolution (e.g. `'deploy.region'`).";
113
- };
114
- readonly description: {
115
- readonly description: "Human-readable description for help text.";
116
- };
117
- readonly enumValues: {
118
- readonly description: "Allowed literal values when `kind === 'enum'`.";
119
- };
120
- readonly elementSchema: {
121
- readonly description: "Element schema when `kind === 'array'` or `kind === 'keyValue'`.";
122
- };
123
- readonly prompt: {
124
- readonly description: "Interactive prompt configuration for v0.3+ resolution.";
125
- };
126
- readonly deprecated: {
127
- readonly description: "Deprecation marker.\n\n- `undefined` — not deprecated (default)\n- `true` — deprecated with no migration message\n- `string` — deprecated with a reason/migration message\n\nWhen a deprecated flag is used, a warning is emitted to stderr.\nHelp text shows `[deprecated]` or `[deprecated: <reason>]`.";
128
- };
129
- readonly propagate: {
130
- readonly description: "Whether this flag propagates to subcommands in nested command trees.\n\nWhen `true`, the flag is automatically available to all descendant\ncommands. A child command that defines a flag with the same name\nshadows the propagated parent flag.\n\nDefault: `false`";
131
- };
132
- readonly negation: {
133
- readonly description: "Negation settings when `kind === 'boolean'` and `.negatable()` was\ncalled (`undefined` otherwise). See FlagNegation.";
134
- };
135
- readonly duplicates: {
136
- readonly description: "How repeated CLI occurrences of a singleton flag combine.\n\n- `'last'` — last occurrence wins (matches historic behavior)\n- `'first'` — first occurrence wins; later ones parse but are ignored\n- `'error'` — a second occurrence is a `ParseError` (`DUPLICATE_FLAG`)\n\nApplies to CLI token occurrences only — env/config/prompt/default\nresolution keeps its precedence semantics and never raises duplicates.\nOccurrences are counted per *logical* flag: aliases and the negated\nspelling all count toward the same flag.\n\nDefault: `'last'`";
137
- };
138
- };
139
- };
140
- readonly stdin: {
141
- readonly description: "The normalized stdin axis of a flag or an arg.";
142
- readonly properties: {
143
- readonly when: {
144
- readonly description: "When this input reads the stdin stream.";
145
- };
146
- readonly consume: {
147
- readonly description: "Whether this input consumes the stream alone.";
148
- };
149
- readonly trim: {
150
- readonly description: "Whether one trailing line terminator is dropped from a single value.";
151
- };
152
- };
153
- };
154
- readonly negation: {
155
- readonly description: "Negation settings for a boolean flag (set by `.negatable()`).\n\nThe negated spelling and the positive form are two spellings of ONE\nlogical flag: they share duplicate policy, and the last CLI occurrence\nwins across both. The negated spelling is presence-only — `--no-foo=x`\nis rejected.";
156
- readonly properties: {
157
- readonly alias: {
158
- readonly description: "Explicit negated spelling without the `--` prefix (e.g. `'no-sandbox'`).\n`undefined` synthesizes `no-<flagName>` wherever the flag name is known.";
159
- };
160
- readonly hidden: {
161
- readonly description: "Hide the negated spelling from help, completions, and suggestions.";
162
- };
163
- };
164
- };
165
- readonly arg: {
166
- readonly description: "The runtime descriptor stored inside every ArgBuilder. Consumers (parser,\nhelp generator) read this to understand the arg's shape without touching\ngenerics.";
167
- readonly properties: {
168
- readonly name: {
169
- readonly description: "A named positional argument entry in the command schema.\n\nPairs a user-facing arg name with its ArgSchema descriptor.\nThe array ordering in CommandSchema.args determines CLI position.";
170
- };
171
- readonly kind: {
172
- readonly description: "What kind of value this arg accepts.";
173
- };
174
- readonly presence: {
175
- readonly description: "Presence describes whether a positional arg is guaranteed to exist when the\naction handler runs:\n\n- `'required'` — must be supplied; error if missing (default)\n- `'optional'` — may be `undefined` if not supplied\n- `'defaulted'` — always present (falls back to default value)";
176
- };
177
- readonly variadic: {
178
- readonly description: "Whether this arg consumes all remaining positionals.";
179
- };
180
- readonly stdin: {
181
- readonly description: "Stdin binding set by `.stdin()` (`undefined` when the arg never reads\nstdin). See StdinBinding.";
182
- };
183
- readonly defaultValue: {
184
- readonly description: "Runtime default value (if any).";
185
- };
186
- readonly description: {
187
- readonly description: "Human-readable description for help text.";
188
- };
189
- readonly envVar: {
190
- readonly description: "Environment variable name for env resolution.\n\nWhen set and the CLI value is absent, the resolver reads this env var\nand coerces the string to the arg's declared kind.";
191
- };
192
- readonly configPath: {
193
- readonly description: "Dotted config path for config resolution (e.g. `'deploy.region'`).";
194
- };
195
- readonly prompt: {
196
- readonly description: "Interactive prompt configuration.";
197
- };
198
- readonly enumValues: {
199
- readonly description: "Allowed literal values when `kind === 'enum'`.";
200
- };
201
- readonly elementSchema: {
202
- readonly description: "Element schema when `kind === 'keyValue'`.\n\nDescribes the value of each entry, so `arg.keyValue(arg.number())` decodes\n`A=1` to the number `1`. `undefined` leaves entry values as strings.";
203
- };
204
- readonly deprecated: {
205
- readonly description: "Deprecation marker.\n\n- `undefined` — not deprecated (default)\n- `true` — deprecated with no migration message\n- `string` — deprecated with a reason/migration message\n\nWhen a deprecated arg is used, a warning is emitted to stderr.\nHelp text shows `[deprecated]` or `[deprecated: <reason>]`.";
206
- };
207
- };
208
- };
209
- readonly argElement: {
210
- readonly description: "Element schema when `kind === 'keyValue'`.\n\nDescribes the value of each entry, so `arg.keyValue(arg.number())` decodes\n`A=1` to the number `1`. `undefined` leaves entry values as strings.";
211
- readonly properties: {
212
- readonly kind: {
213
- readonly description: "What kind of value this arg accepts.";
214
- };
215
- readonly presence: {
216
- readonly description: "Entry values are required once their containing key-value argument is present.";
217
- };
218
- readonly enumValues: {
219
- readonly description: "Allowed literal values when `kind === 'enum'`.";
220
- };
221
- };
222
- };
223
- readonly prompt: {
224
- readonly description: "Discriminated union of all prompt configurations.\n\nUse the `kind` field to narrow:\n```ts\nif (config.kind === 'select') {\n config.choices // readonly SelectChoice[] | undefined\n}\n```";
225
- readonly properties: {
226
- readonly kind: {
227
- readonly description: "The kind of interactive prompt to present.\n\n- `'confirm'` — yes/no boolean question\n- `'input'` — free-text string input\n- `'select'` — single selection from a list\n- `'multiselect'` — multiple selections from a list";
228
- };
229
- readonly message: {
230
- readonly description: "The question displayed to the user.";
231
- };
232
- readonly placeholder: {
233
- readonly description: "Placeholder text shown before user types (informational only).";
234
- };
235
- readonly choices: {
236
- readonly description: "Available choices. When omitted for `enum` flags, the enum values\nfrom the flag schema are used automatically.";
237
- };
238
- readonly min: {
239
- readonly description: "Minimum number of selections required.\n\nDefault: `0`";
240
- };
241
- readonly max: {
242
- readonly description: "Maximum number of selections allowed.\n\nDefault: `Infinity`";
243
- };
244
- };
245
- };
246
- readonly choice: {
247
- readonly description: "A selectable option for SelectPromptConfig and MultiselectPromptConfig prompts.";
248
- readonly properties: {
249
- readonly value: {
250
- readonly description: "The value returned when this choice is selected.";
251
- };
252
- readonly label: {
253
- readonly description: "Display label shown to the user.\n\nDefault: value";
254
- };
255
- readonly description: {
256
- readonly description: "Optional description shown alongside the choice.";
257
- };
258
- };
259
- };
260
- readonly example: {
261
- readonly description: "A single usage example shown in help text.";
262
- readonly properties: {
263
- readonly command: {
264
- readonly description: "The command invocation (e.g. `'deploy production --force'`).";
265
- };
266
- readonly description: {
267
- readonly description: "Optional description of what this example does.";
268
- };
269
- };
270
- };
271
- };
272
- };
273
- //#endregion
274
- export { definitionMetaSchemaDescriptions };
@@ -1,136 +0,0 @@
1
- //#region src/core/json-schema/meta-descriptions.generated.ts
2
- /**
3
- * Generated definition meta-schema descriptions from normalized TypeDoc output.
4
- *
5
- * @module
6
- */
7
- const definitionMetaSchemaDescriptions = {
8
- root: {
9
- description: "Runtime descriptor for the CLI program.\n\nStores the program name, version, description, and registered command schemas.\\\nSealed by createCLISchema and rebuilt by each CLIBuilder step.",
10
- properties: {
11
- name: { description: "Program name (used in help text, usage lines, and completion scripts)." },
12
- version: { description: "Program version (shown by `--version`)." },
13
- description: { description: "Program description (shown in root help)." },
14
- defaultCommand: { description: "Schema of the default command dispatched when no subcommand matches.\n\nWhen set, the CLI root behaves like a hybrid command group: subcommands\ndispatch by name as usual, but empty argv or flags-only argv falls\nthrough to this command instead of showing root help.\n\nSet via the .default() builder method\nor the `defaultCommand` field of CLIDefinition." },
15
- commands: { description: "Schemas of the registered commands, in registration order." }
16
- }
17
- },
18
- defs: {
19
- command: {
20
- description: "Runtime descriptor produced by CommandBuilder.\n\nConsumers (parser, help generator, CLI dispatcher) read this to\nunderstand the command's shape — flags, args, aliases, subcommands,\nand interactive resolver.",
21
- properties: {
22
- name: { description: "The command name (used for dispatch, e.g. `'deploy'`)." },
23
- description: { description: "Human-readable description for help text." },
24
- aliases: { description: "Alternative names for this command." },
25
- hidden: { description: "Whether this command is hidden from help listings." },
26
- examples: { description: "Usage examples for help text." },
27
- flags: { description: "Named flag schemas, keyed by flag name." },
28
- args: { description: "Ordered positional arg entries (name + schema)." },
29
- commands: { description: "Nested subcommand schemas (for help rendering and completion).\n\nPure data — no execution closures. Populated by `.command()` on\n`CommandBuilder`. Empty for leaf commands." }
30
- }
31
- },
32
- commandDocument: {
33
- description: "A single-command definition document, version 1.\n\nProduced by generateCommandSchema. Same shape as a\nCommandDefinitionFragmentV1 plus the `schemaVersion` every standalone\ndocument carries.",
34
- properties: {
35
- schemaVersion: { description: "Version of the definition document format emitted by generateSchema\nand generateCommandSchema." },
36
- name: { description: "The command name used for dispatch." },
37
- description: { description: "Human-readable description for help text." },
38
- aliases: { description: "Alternative names accepted for this command." },
39
- hidden: { description: "Whether the command is omitted from help listings." },
40
- examples: { description: "Usage examples attached to the command." },
41
- flags: { description: "Named flag definitions keyed by flag name." },
42
- args: { description: "Positional argument definitions in CLI order." },
43
- commands: { description: "Nested subcommand definitions." }
44
- }
45
- },
46
- flag: {
47
- description: "The runtime descriptor stored inside every FlagBuilder. Consumers (parser,\nhelp generator, resolution chain) read this to understand the flag's shape\nwithout touching generics.",
48
- properties: {
49
- kind: { description: "What kind of value this flag accepts." },
50
- presence: { description: "Presence describes whether a flag value is guaranteed to exist when the\naction handler runs:\n\n- `'optional'` — not required; unresolved value follows the kind-specific\n optional fallback (`undefined` for most flags, `[]` for arrays)\n- `'required'` — must be supplied; error if missing\n- `'defaulted'` — always present (falls back to default value)" },
51
- defaultValue: { description: "Runtime default value (if any)." },
52
- aliases: { description: "Short/long aliases (e.g. `[{ name: 'f', hidden: false }]` for `--force`)." },
53
- stdin: { description: "Stdin binding set by `.stdin()` (`undefined` when the flag never reads\nstdin). See StdinBinding." },
54
- envVar: { description: "Environment variable name for v0.2+ resolution." },
55
- configPath: { description: "Dotted config path for v0.2+ resolution (e.g. `'deploy.region'`)." },
56
- description: { description: "Human-readable description for help text." },
57
- enumValues: { description: "Allowed literal values when `kind === 'enum'`." },
58
- elementSchema: { description: "Element schema when `kind === 'array'` or `kind === 'keyValue'`." },
59
- prompt: { description: "Interactive prompt configuration for v0.3+ resolution." },
60
- deprecated: { description: "Deprecation marker.\n\n- `undefined` — not deprecated (default)\n- `true` — deprecated with no migration message\n- `string` — deprecated with a reason/migration message\n\nWhen a deprecated flag is used, a warning is emitted to stderr.\nHelp text shows `[deprecated]` or `[deprecated: <reason>]`." },
61
- propagate: { description: "Whether this flag propagates to subcommands in nested command trees.\n\nWhen `true`, the flag is automatically available to all descendant\ncommands. A child command that defines a flag with the same name\nshadows the propagated parent flag.\n\nDefault: `false`" },
62
- negation: { description: "Negation settings when `kind === 'boolean'` and `.negatable()` was\ncalled (`undefined` otherwise). See FlagNegation." },
63
- duplicates: { description: "How repeated CLI occurrences of a singleton flag combine.\n\n- `'last'` — last occurrence wins (matches historic behavior)\n- `'first'` — first occurrence wins; later ones parse but are ignored\n- `'error'` — a second occurrence is a `ParseError` (`DUPLICATE_FLAG`)\n\nApplies to CLI token occurrences only — env/config/prompt/default\nresolution keeps its precedence semantics and never raises duplicates.\nOccurrences are counted per *logical* flag: aliases and the negated\nspelling all count toward the same flag.\n\nDefault: `'last'`" }
64
- }
65
- },
66
- stdin: {
67
- description: "The normalized stdin axis of a flag or an arg.",
68
- properties: {
69
- when: { description: "When this input reads the stdin stream." },
70
- consume: { description: "Whether this input consumes the stream alone." },
71
- trim: { description: "Whether one trailing line terminator is dropped from a single value." }
72
- }
73
- },
74
- negation: {
75
- description: "Negation settings for a boolean flag (set by `.negatable()`).\n\nThe negated spelling and the positive form are two spellings of ONE\nlogical flag: they share duplicate policy, and the last CLI occurrence\nwins across both. The negated spelling is presence-only — `--no-foo=x`\nis rejected.",
76
- properties: {
77
- alias: { description: "Explicit negated spelling without the `--` prefix (e.g. `'no-sandbox'`).\n`undefined` synthesizes `no-<flagName>` wherever the flag name is known." },
78
- hidden: { description: "Hide the negated spelling from help, completions, and suggestions." }
79
- }
80
- },
81
- arg: {
82
- description: "The runtime descriptor stored inside every ArgBuilder. Consumers (parser,\nhelp generator) read this to understand the arg's shape without touching\ngenerics.",
83
- properties: {
84
- name: { description: "A named positional argument entry in the command schema.\n\nPairs a user-facing arg name with its ArgSchema descriptor.\nThe array ordering in CommandSchema.args determines CLI position." },
85
- kind: { description: "What kind of value this arg accepts." },
86
- presence: { description: "Presence describes whether a positional arg is guaranteed to exist when the\naction handler runs:\n\n- `'required'` — must be supplied; error if missing (default)\n- `'optional'` — may be `undefined` if not supplied\n- `'defaulted'` — always present (falls back to default value)" },
87
- variadic: { description: "Whether this arg consumes all remaining positionals." },
88
- stdin: { description: "Stdin binding set by `.stdin()` (`undefined` when the arg never reads\nstdin). See StdinBinding." },
89
- defaultValue: { description: "Runtime default value (if any)." },
90
- description: { description: "Human-readable description for help text." },
91
- envVar: { description: "Environment variable name for env resolution.\n\nWhen set and the CLI value is absent, the resolver reads this env var\nand coerces the string to the arg's declared kind." },
92
- configPath: { description: "Dotted config path for config resolution (e.g. `'deploy.region'`)." },
93
- prompt: { description: "Interactive prompt configuration." },
94
- enumValues: { description: "Allowed literal values when `kind === 'enum'`." },
95
- elementSchema: { description: "Element schema when `kind === 'keyValue'`.\n\nDescribes the value of each entry, so `arg.keyValue(arg.number())` decodes\n`A=1` to the number `1`. `undefined` leaves entry values as strings." },
96
- deprecated: { description: "Deprecation marker.\n\n- `undefined` — not deprecated (default)\n- `true` — deprecated with no migration message\n- `string` — deprecated with a reason/migration message\n\nWhen a deprecated arg is used, a warning is emitted to stderr.\nHelp text shows `[deprecated]` or `[deprecated: <reason>]`." }
97
- }
98
- },
99
- argElement: {
100
- description: "Element schema when `kind === 'keyValue'`.\n\nDescribes the value of each entry, so `arg.keyValue(arg.number())` decodes\n`A=1` to the number `1`. `undefined` leaves entry values as strings.",
101
- properties: {
102
- kind: { description: "What kind of value this arg accepts." },
103
- presence: { description: "Entry values are required once their containing key-value argument is present." },
104
- enumValues: { description: "Allowed literal values when `kind === 'enum'`." }
105
- }
106
- },
107
- prompt: {
108
- description: "Discriminated union of all prompt configurations.\n\nUse the `kind` field to narrow:\n```ts\nif (config.kind === 'select') {\n config.choices // readonly SelectChoice[] | undefined\n}\n```",
109
- properties: {
110
- kind: { description: "The kind of interactive prompt to present.\n\n- `'confirm'` — yes/no boolean question\n- `'input'` — free-text string input\n- `'select'` — single selection from a list\n- `'multiselect'` — multiple selections from a list" },
111
- message: { description: "The question displayed to the user." },
112
- placeholder: { description: "Placeholder text shown before user types (informational only)." },
113
- choices: { description: "Available choices. When omitted for `enum` flags, the enum values\nfrom the flag schema are used automatically." },
114
- min: { description: "Minimum number of selections required.\n\nDefault: `0`" },
115
- max: { description: "Maximum number of selections allowed.\n\nDefault: `Infinity`" }
116
- }
117
- },
118
- choice: {
119
- description: "A selectable option for SelectPromptConfig and MultiselectPromptConfig prompts.",
120
- properties: {
121
- value: { description: "The value returned when this choice is selected." },
122
- label: { description: "Display label shown to the user.\n\nDefault: value" },
123
- description: { description: "Optional description shown alongside the choice." }
124
- }
125
- },
126
- example: {
127
- description: "A single usage example shown in help text.",
128
- properties: {
129
- command: { description: "The command invocation (e.g. `'deploy production --force'`)." },
130
- description: { description: "Optional description of what this example does." }
131
- }
132
- }
133
- }
134
- };
135
- //#endregion
136
- export { definitionMetaSchemaDescriptions };
@@ -1,193 +0,0 @@
1
- import { ActivityEvent, ProgressHandle, ProgressOptions, SpinnerHandle } from "../schema/activity.mjs";
2
- import { WriteFn } from "./writer.mjs";
3
- //#region src/core/output/activity.d.ts
4
- /**
5
- * Noop spinner handle singleton.
6
- *
7
- * All methods are no-ops. Used when spinners should produce no output
8
- * at all — `jsonMode`, or non-TTY with `fallback: 'silent'` (default).
9
- *
10
- * @internal
11
- */
12
- declare const noopSpinnerHandle: SpinnerHandle;
13
- /**
14
- * Noop progress handle singleton.
15
- *
16
- * All methods are no-ops. Used when progress bars should produce no
17
- * output at all — `jsonMode`, or non-TTY with `fallback: 'silent'`.
18
- *
19
- * @internal
20
- */
21
- declare const noopProgressHandle: ProgressHandle;
22
- /**
23
- * Static spinner handle — emits plain text at lifecycle boundaries.
24
- *
25
- * Used in non-TTY environments with `fallback: 'static'`. No animation,
26
- * no ANSI codes. Emits text on start and terminal events only.
27
- *
28
- * Terminal methods are idempotent — calling after stop is a no-op.
29
- *
30
- * @internal
31
- */
32
- declare class StaticSpinnerHandle implements SpinnerHandle {
33
- private readonly write;
34
- /** Whether the handle has been stopped (terminal state reached). */
35
- private stopped;
36
- constructor(text: string, write: WriteFn);
37
- update(_text: string): void;
38
- succeed(text?: string): void;
39
- fail(text?: string): void;
40
- stop(): void;
41
- wrap<T>(promise: Promise<T>, options?: {
42
- readonly succeed?: string;
43
- readonly fail?: string;
44
- }): Promise<T>;
45
- }
46
- /**
47
- * Static progress handle — emits plain text at lifecycle boundaries.
48
- *
49
- * Used in non-TTY environments with `fallback: 'static'`. No animation,
50
- * no progress bar rendering. Emits label on start, text on done/fail.
51
- *
52
- * Terminal methods are idempotent — calling after stop is a no-op.
53
- *
54
- * @internal
55
- */
56
- declare class StaticProgressHandle implements ProgressHandle {
57
- private readonly write;
58
- /** Whether the handle has been stopped (terminal state reached). */
59
- private stopped;
60
- constructor(label: string | undefined, write: WriteFn);
61
- increment(_n?: number): void;
62
- update(_value: number): void;
63
- done(text?: string): void;
64
- fail(text?: string): void;
65
- }
66
- /**
67
- * TTY spinner handle — animated braille frames with ANSI line overwrite.
68
- *
69
- * Used in TTY environments (non-JSON mode). Renders a spinning indicator
70
- * with configurable text, using `\r` + erase-line to overwrite in place.
71
- * Hides the cursor during animation and restores it on any terminal method.
72
- *
73
- * Terminal methods (`succeed`, `fail`, `stop`) are idempotent — calling any
74
- * of them after the handle is already stopped is a no-op.
75
- *
76
- * **Note:** If the process exits abnormally (e.g. `SIGKILL`) while a spinner
77
- * is active, the cursor may remain hidden. Use {@link SpinnerHandle.wrap} to
78
- * ensure cleanup on both success and failure paths.
79
- *
80
- * @internal
81
- */
82
- declare class TTYSpinnerHandle implements SpinnerHandle {
83
- private readonly write;
84
- /** Whether the handle has been stopped (terminal state reached). */
85
- private stopped;
86
- /** Animation timer handle — cleared on any terminal method. */
87
- private timer;
88
- /** Current position in the braille frame sequence. */
89
- private frameIndex;
90
- /** Current spinner text (mutable via `update()`). */
91
- private text;
92
- constructor(text: string, write: WriteFn);
93
- /** Render the current frame + text, overwriting the current line. */
94
- private render;
95
- /** Clear the animation timer, erase the line, and restore the cursor. */
96
- private cleanup;
97
- update(text: string): void;
98
- succeed(text?: string): void;
99
- fail(text?: string): void;
100
- stop(): void;
101
- wrap<T>(promise: Promise<T>, options?: {
102
- readonly succeed?: string;
103
- readonly fail?: string;
104
- }): Promise<T>;
105
- }
106
- /**
107
- * TTY progress handle — bar rendering with ANSI line overwrite.
108
- *
109
- * Supports two modes:
110
- * - **Determinate** (`total` provided) — renders `[████░░░░░░] 40% label`,
111
- * re-rendered on each `increment()` / `update()` call. No timer.
112
- * - **Indeterminate** (`total` omitted) — renders a pulsing highlight that
113
- * bounces across the bar via `setInterval`.
114
- *
115
- * Terminal methods (`done`, `fail`) are idempotent — calling any of them
116
- * after the handle is already stopped is a no-op.
117
- *
118
- * @internal
119
- */
120
- declare class TTYProgressHandle implements ProgressHandle {
121
- private readonly write;
122
- /** Whether the handle has been stopped (terminal state reached). */
123
- private stopped;
124
- /** Animation timer for indeterminate mode — `undefined` in determinate mode. */
125
- private timer;
126
- /** Current progress value (units completed). */
127
- private current;
128
- /** Total units of work (`undefined` = indeterminate mode). */
129
- private readonly total;
130
- /** Label displayed alongside the bar. */
131
- private readonly label;
132
- /** Pulse position for indeterminate animation (bouncing highlight). */
133
- private pulsePos;
134
- /** Pulse direction: 1 = forward, -1 = backward (for bounce). */
135
- private pulseDir;
136
- constructor(opts: ProgressOptions, write: WriteFn);
137
- /** Advance the indeterminate pulse position with bounce logic. */
138
- private advancePulse;
139
- /** Render the progress bar, overwriting the current line. */
140
- private render;
141
- /** Render a determinate bar: `[████░░░░░░] 40%`. */
142
- private renderDeterminate;
143
- /** Render an indeterminate bar: pulsing highlight bouncing across empty segments. */
144
- private renderIndeterminate;
145
- /** Clear the animation timer, erase the line, and restore the cursor. */
146
- private cleanup;
147
- increment(n?: number): void;
148
- update(value: number): void;
149
- done(text?: string): void;
150
- fail(text?: string): void;
151
- }
152
- /**
153
- * Spinner handle that records lifecycle events to a shared `ActivityEvent[]`.
154
- *
155
- * Used by `createCaptureOutput()` so testkit can assert on spinner behaviour
156
- * without polluting stdout/stderr arrays. Terminal methods are idempotent.
157
- *
158
- * @internal
159
- */
160
- declare class CaptureSpinnerHandle implements SpinnerHandle {
161
- private readonly events;
162
- /** Whether the handle has been stopped (terminal state reached). */
163
- private stopped;
164
- constructor(text: string, events: ActivityEvent[]);
165
- update(text: string): void;
166
- succeed(text?: string): void;
167
- fail(text?: string): void;
168
- stop(): void;
169
- wrap<T>(promise: Promise<T>, options?: {
170
- readonly succeed?: string;
171
- readonly fail?: string;
172
- }): Promise<T>;
173
- }
174
- /**
175
- * Progress handle that records lifecycle events to a shared `ActivityEvent[]`.
176
- *
177
- * Used by `createCaptureOutput()` so testkit can assert on progress behaviour
178
- * without polluting stdout/stderr arrays. Terminal methods are idempotent.
179
- *
180
- * @internal
181
- */
182
- declare class CaptureProgressHandle implements ProgressHandle {
183
- private readonly events;
184
- /** Whether the handle has been stopped (terminal state reached). */
185
- private stopped;
186
- constructor(opts: ProgressOptions, events: ActivityEvent[]);
187
- increment(n?: number): void;
188
- update(value: number): void;
189
- done(text?: string): void;
190
- fail(text?: string): void;
191
- }
192
- //#endregion
193
- export { CaptureProgressHandle, CaptureSpinnerHandle, StaticProgressHandle, StaticSpinnerHandle, TTYProgressHandle, TTYSpinnerHandle, noopProgressHandle, noopSpinnerHandle };