@kjanat/dreamcli 4.0.0-rc.2 → 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 (629) hide show
  1. package/README.md +5 -7
  2. package/dist/{runtime/adapter.d.mts → adapter-D0hbBNVB.d.mts} +5 -7
  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} +149 -25
  14. package/dist/index-DndPmT8J.d.mts +275 -0
  15. package/dist/{core/json-schema/index.d.mts → index-DyoaS234.d.mts} +54 -45
  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.d.mts +16 -4
  32. package/dist/version.mjs +1 -7
  33. package/dreamcli.schema.json +697 -538
  34. package/package.json +37 -12
  35. package/skills/cli-creation/SKILL.md +16 -11
  36. package/CHANGELOG.md +0 -2453
  37. package/dist/core/cli/builtins.d.mts +0 -47
  38. package/dist/core/cli/builtins.mjs +0 -135
  39. package/dist/core/cli/compiled.d.mts +0 -29
  40. package/dist/core/cli/compiled.mjs +0 -76
  41. package/dist/core/cli/dispatch.d.mts +0 -38
  42. package/dist/core/cli/dispatch.mjs +0 -205
  43. package/dist/core/cli/help-links.d.mts +0 -15
  44. package/dist/core/cli/help-links.mjs +0 -41
  45. package/dist/core/cli/index.mjs +0 -1265
  46. package/dist/core/cli/planner.d.mts +0 -96
  47. package/dist/core/cli/planner.mjs +0 -323
  48. package/dist/core/cli/plugin.d.mts +0 -94
  49. package/dist/core/cli/plugin.mjs +0 -41
  50. package/dist/core/cli/propagate.d.mts +0 -39
  51. package/dist/core/cli/propagate.mjs +0 -57
  52. package/dist/core/cli/reserved-flags.d.mts +0 -1
  53. package/dist/core/cli/reserved-flags.mjs +0 -158
  54. package/dist/core/cli/root-help.d.mts +0 -1
  55. package/dist/core/cli/root-help.mjs +0 -221
  56. package/dist/core/cli/root-output-flags.d.mts +0 -1
  57. package/dist/core/cli/root-output-flags.mjs +0 -169
  58. package/dist/core/cli/root-surface.d.mts +0 -1
  59. package/dist/core/cli/root-surface.mjs +0 -28
  60. package/dist/core/cli/runtime-preflight.d.mts +0 -1
  61. package/dist/core/cli/runtime-preflight.mjs +0 -221
  62. package/dist/core/completion/index.d.mts +0 -76
  63. package/dist/core/completion/index.mjs +0 -90
  64. package/dist/core/completion/shells/bash.d.mts +0 -22
  65. package/dist/core/completion/shells/bash.mjs +0 -309
  66. package/dist/core/completion/shells/fish.d.mts +0 -18
  67. package/dist/core/completion/shells/fish.mjs +0 -163
  68. package/dist/core/completion/shells/powershell.d.mts +0 -12
  69. package/dist/core/completion/shells/powershell.mjs +0 -359
  70. package/dist/core/completion/shells/shared.d.mts +0 -49
  71. package/dist/core/completion/shells/shared.mjs +0 -147
  72. package/dist/core/completion/shells/zsh.d.mts +0 -22
  73. package/dist/core/completion/shells/zsh.mjs +0 -252
  74. package/dist/core/config/index.d.mts +0 -191
  75. package/dist/core/config/index.mjs +0 -285
  76. package/dist/core/config/package-json.d.mts +0 -179
  77. package/dist/core/config/package-json.mjs +0 -353
  78. package/dist/core/errors/index.d.mts +0 -126
  79. package/dist/core/errors/index.mjs +0 -87
  80. package/dist/core/execution/index.d.mts +0 -1
  81. package/dist/core/execution/index.mjs +0 -220
  82. package/dist/core/help/ansi.d.mts +0 -73
  83. package/dist/core/help/ansi.mjs +0 -121
  84. package/dist/core/help/index.d.mts +0 -110
  85. package/dist/core/help/index.mjs +0 -414
  86. package/dist/core/help/theme.d.mts +0 -48
  87. package/dist/core/help/theme.mjs +0 -46
  88. package/dist/core/json-schema/index.mjs +0 -1007
  89. package/dist/core/json-schema/meta-descriptions.generated.d.mts +0 -274
  90. package/dist/core/json-schema/meta-descriptions.generated.mjs +0 -136
  91. package/dist/core/output/activity.d.mts +0 -1
  92. package/dist/core/output/activity.mjs +0 -452
  93. package/dist/core/output/bind.d.mts +0 -1
  94. package/dist/core/output/bind.mjs +0 -56
  95. package/dist/core/output/contracts.d.mts +0 -81
  96. package/dist/core/output/contracts.mjs +0 -57
  97. package/dist/core/output/display-value.d.mts +0 -1
  98. package/dist/core/output/display-value.mjs +0 -32
  99. package/dist/core/output/index.d.mts +0 -160
  100. package/dist/core/output/index.mjs +0 -512
  101. package/dist/core/output/renderers.d.mts +0 -1
  102. package/dist/core/output/renderers.mjs +0 -46
  103. package/dist/core/output/writer.d.mts +0 -39
  104. package/dist/core/output/writer.mjs +0 -12
  105. package/dist/core/parse/index.d.mts +0 -178
  106. package/dist/core/parse/index.mjs +0 -850
  107. package/dist/core/parse/occurrences.d.mts +0 -89
  108. package/dist/core/parse/occurrences.mjs +0 -114
  109. package/dist/core/prompt/index.d.mts +0 -213
  110. package/dist/core/prompt/index.mjs +0 -348
  111. package/dist/core/read-flags/index.d.mts +0 -150
  112. package/dist/core/read-flags/index.mjs +0 -217
  113. package/dist/core/resolve/args.d.mts +0 -39
  114. package/dist/core/resolve/args.mjs +0 -182
  115. package/dist/core/resolve/coerce.d.mts +0 -79
  116. package/dist/core/resolve/coerce.mjs +0 -900
  117. package/dist/core/resolve/config.d.mts +0 -1
  118. package/dist/core/resolve/config.mjs +0 -19
  119. package/dist/core/resolve/contracts.d.mts +0 -145
  120. package/dist/core/resolve/errors.d.mts +0 -10
  121. package/dist/core/resolve/errors.mjs +0 -148
  122. package/dist/core/resolve/flags.d.mts +0 -47
  123. package/dist/core/resolve/flags.mjs +0 -246
  124. package/dist/core/resolve/index.d.mts +0 -44
  125. package/dist/core/resolve/index.mjs +0 -123
  126. package/dist/core/resolve/path-checks.d.mts +0 -47
  127. package/dist/core/resolve/path-checks.mjs +0 -102
  128. package/dist/core/resolve/redaction.d.mts +0 -12
  129. package/dist/core/resolve/redaction.mjs +0 -14
  130. package/dist/core/resolve/stages.d.mts +0 -85
  131. package/dist/core/resolve/stages.mjs +0 -170
  132. package/dist/core/resolve/standard.d.mts +0 -1
  133. package/dist/core/resolve/standard.mjs +0 -212
  134. package/dist/core/schema/activity.d.mts +0 -189
  135. package/dist/core/schema/arg.d.mts +0 -1451
  136. package/dist/core/schema/arg.mjs +0 -1139
  137. package/dist/core/schema/brand.d.mts +0 -17
  138. package/dist/core/schema/cardinality.d.mts +0 -301
  139. package/dist/core/schema/cardinality.mjs +0 -514
  140. package/dist/core/schema/command.d.mts +0 -1086
  141. package/dist/core/schema/command.mjs +0 -999
  142. package/dist/core/schema/flag.d.mts +0 -1487
  143. package/dist/core/schema/flag.mjs +0 -1207
  144. package/dist/core/schema/index.d.mts +0 -15
  145. package/dist/core/schema/index.mjs +0 -10
  146. package/dist/core/schema/middleware.d.mts +0 -126
  147. package/dist/core/schema/middleware.mjs +0 -41
  148. package/dist/core/schema/number-constraints.d.mts +0 -96
  149. package/dist/core/schema/number-constraints.mjs +0 -60
  150. package/dist/core/schema/prompt.d.mts +0 -135
  151. package/dist/core/schema/provenance.d.mts +0 -99
  152. package/dist/core/schema/provenance.mjs +0 -28
  153. package/dist/core/schema/run.d.mts +0 -161
  154. package/dist/core/schema/source.d.mts +0 -179
  155. package/dist/core/schema/source.mjs +0 -206
  156. package/dist/core/schema/standard.d.mts +0 -93
  157. package/dist/core/schema/standard.mjs +0 -15
  158. package/dist/core/schema/stdin.d.mts +0 -87
  159. package/dist/core/schema/stdin.mjs +0 -91
  160. package/dist/core/schema/string-constraints.d.mts +0 -108
  161. package/dist/core/schema/string-constraints.mjs +0 -86
  162. package/dist/core/schema/value-parsers.d.mts +0 -150
  163. package/dist/core/schema/value-parsers.mjs +0 -160
  164. package/dist/core/schema/value.d.mts +0 -242
  165. package/dist/core/schema/value.mjs +0 -573
  166. package/dist/core/testkit/index.d.mts +0 -56
  167. package/dist/core/testkit/index.mjs +0 -102
  168. package/dist/runtime/adapter.mjs +0 -92
  169. package/dist/runtime/auto.d.mts +0 -25
  170. package/dist/runtime/auto.mjs +0 -45
  171. package/dist/runtime/deno.d.mts +0 -99
  172. package/dist/runtime/deno.mjs +0 -265
  173. package/dist/runtime/detect.d.mts +0 -86
  174. package/dist/runtime/detect.mjs +0 -45
  175. package/dist/runtime/index.d.mts +0 -6
  176. package/dist/runtime/node.d.mts +0 -71
  177. package/dist/runtime/node.mjs +0 -228
  178. package/dist/runtime/paths.d.mts +0 -1
  179. package/dist/runtime/paths.mjs +0 -48
  180. package/dist/strings.d.mts +0 -12
  181. package/dist/strings.mjs +0 -22
  182. package/examples/basic.ts +0 -37
  183. package/examples/flag-types.ts +0 -79
  184. package/examples/gh/node_modules/typescript/LICENSE +0 -55
  185. package/examples/gh/node_modules/typescript/NOTICE.txt +0 -436
  186. package/examples/gh/node_modules/typescript/README.md +0 -49
  187. package/examples/gh/node_modules/typescript/bin/tsc +0 -2
  188. package/examples/gh/node_modules/typescript/dist/api/async/api.d.ts +0 -529
  189. package/examples/gh/node_modules/typescript/dist/api/async/api.d.ts.map +0 -1
  190. package/examples/gh/node_modules/typescript/dist/api/async/api.js +0 -1657
  191. package/examples/gh/node_modules/typescript/dist/api/async/api.js.map +0 -1
  192. package/examples/gh/node_modules/typescript/dist/api/async/client.d.ts +0 -39
  193. package/examples/gh/node_modules/typescript/dist/api/async/client.d.ts.map +0 -1
  194. package/examples/gh/node_modules/typescript/dist/api/async/client.js +0 -211
  195. package/examples/gh/node_modules/typescript/dist/api/async/client.js.map +0 -1
  196. package/examples/gh/node_modules/typescript/dist/api/async/types.d.ts +0 -310
  197. package/examples/gh/node_modules/typescript/dist/api/async/types.d.ts.map +0 -1
  198. package/examples/gh/node_modules/typescript/dist/api/async/types.js +0 -2
  199. package/examples/gh/node_modules/typescript/dist/api/async/types.js.map +0 -1
  200. package/examples/gh/node_modules/typescript/dist/api/compilerOptions.d.ts +0 -109
  201. package/examples/gh/node_modules/typescript/dist/api/compilerOptions.d.ts.map +0 -1
  202. package/examples/gh/node_modules/typescript/dist/api/compilerOptions.js +0 -2
  203. package/examples/gh/node_modules/typescript/dist/api/compilerOptions.js.map +0 -1
  204. package/examples/gh/node_modules/typescript/dist/api/fs.d.ts +0 -23
  205. package/examples/gh/node_modules/typescript/dist/api/fs.d.ts.map +0 -1
  206. package/examples/gh/node_modules/typescript/dist/api/fs.js +0 -109
  207. package/examples/gh/node_modules/typescript/dist/api/fs.js.map +0 -1
  208. package/examples/gh/node_modules/typescript/dist/api/node/encoder.d.ts +0 -15
  209. package/examples/gh/node_modules/typescript/dist/api/node/encoder.d.ts.map +0 -1
  210. package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.d.ts +0 -5
  211. package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.d.ts.map +0 -1
  212. package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.js +0 -74
  213. package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.js.map +0 -1
  214. package/examples/gh/node_modules/typescript/dist/api/node/encoder.js +0 -287
  215. package/examples/gh/node_modules/typescript/dist/api/node/encoder.js.map +0 -1
  216. package/examples/gh/node_modules/typescript/dist/api/node/msgpack.d.ts +0 -32
  217. package/examples/gh/node_modules/typescript/dist/api/node/msgpack.d.ts.map +0 -1
  218. package/examples/gh/node_modules/typescript/dist/api/node/msgpack.js +0 -213
  219. package/examples/gh/node_modules/typescript/dist/api/node/msgpack.js.map +0 -1
  220. package/examples/gh/node_modules/typescript/dist/api/node/node.d.ts +0 -76
  221. package/examples/gh/node_modules/typescript/dist/api/node/node.d.ts.map +0 -1
  222. package/examples/gh/node_modules/typescript/dist/api/node/node.generated.d.ts +0 -182
  223. package/examples/gh/node_modules/typescript/dist/api/node/node.generated.d.ts.map +0 -1
  224. package/examples/gh/node_modules/typescript/dist/api/node/node.generated.js +0 -835
  225. package/examples/gh/node_modules/typescript/dist/api/node/node.generated.js.map +0 -1
  226. package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.d.ts +0 -62
  227. package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.d.ts.map +0 -1
  228. package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.js +0 -122
  229. package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.js.map +0 -1
  230. package/examples/gh/node_modules/typescript/dist/api/node/node.js +0 -298
  231. package/examples/gh/node_modules/typescript/dist/api/node/node.js.map +0 -1
  232. package/examples/gh/node_modules/typescript/dist/api/node/protocol.d.ts +0 -29
  233. package/examples/gh/node_modules/typescript/dist/api/node/protocol.d.ts.map +0 -1
  234. package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.d.ts +0 -4
  235. package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.d.ts.map +0 -1
  236. package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.js +0 -241
  237. package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.js.map +0 -1
  238. package/examples/gh/node_modules/typescript/dist/api/node/protocol.js +0 -30
  239. package/examples/gh/node_modules/typescript/dist/api/node/protocol.js.map +0 -1
  240. package/examples/gh/node_modules/typescript/dist/api/node/wtf8.d.ts +0 -6
  241. package/examples/gh/node_modules/typescript/dist/api/node/wtf8.d.ts.map +0 -1
  242. package/examples/gh/node_modules/typescript/dist/api/node/wtf8.js +0 -61
  243. package/examples/gh/node_modules/typescript/dist/api/node/wtf8.js.map +0 -1
  244. package/examples/gh/node_modules/typescript/dist/api/options.d.ts +0 -32
  245. package/examples/gh/node_modules/typescript/dist/api/options.d.ts.map +0 -1
  246. package/examples/gh/node_modules/typescript/dist/api/options.js +0 -11
  247. package/examples/gh/node_modules/typescript/dist/api/options.js.map +0 -1
  248. package/examples/gh/node_modules/typescript/dist/api/path.d.ts +0 -110
  249. package/examples/gh/node_modules/typescript/dist/api/path.d.ts.map +0 -1
  250. package/examples/gh/node_modules/typescript/dist/api/path.js +0 -508
  251. package/examples/gh/node_modules/typescript/dist/api/path.js.map +0 -1
  252. package/examples/gh/node_modules/typescript/dist/api/proto.d.ts +0 -239
  253. package/examples/gh/node_modules/typescript/dist/api/proto.d.ts.map +0 -1
  254. package/examples/gh/node_modules/typescript/dist/api/proto.js +0 -37
  255. package/examples/gh/node_modules/typescript/dist/api/proto.js.map +0 -1
  256. package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.d.ts +0 -79
  257. package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.d.ts.map +0 -1
  258. package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.js +0 -169
  259. package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.js.map +0 -1
  260. package/examples/gh/node_modules/typescript/dist/api/sync/api.d.ts +0 -529
  261. package/examples/gh/node_modules/typescript/dist/api/sync/api.d.ts.map +0 -1
  262. package/examples/gh/node_modules/typescript/dist/api/sync/api.js +0 -1665
  263. package/examples/gh/node_modules/typescript/dist/api/sync/api.js.map +0 -1
  264. package/examples/gh/node_modules/typescript/dist/api/sync/client.d.ts +0 -30
  265. package/examples/gh/node_modules/typescript/dist/api/sync/client.d.ts.map +0 -1
  266. package/examples/gh/node_modules/typescript/dist/api/sync/client.js +0 -124
  267. package/examples/gh/node_modules/typescript/dist/api/sync/client.js.map +0 -1
  268. package/examples/gh/node_modules/typescript/dist/api/sync/types.d.ts +0 -310
  269. package/examples/gh/node_modules/typescript/dist/api/sync/types.d.ts.map +0 -1
  270. package/examples/gh/node_modules/typescript/dist/api/sync/types.js +0 -2
  271. package/examples/gh/node_modules/typescript/dist/api/sync/types.js.map +0 -1
  272. package/examples/gh/node_modules/typescript/dist/api/syncChannel.d.ts +0 -114
  273. package/examples/gh/node_modules/typescript/dist/api/syncChannel.d.ts.map +0 -1
  274. package/examples/gh/node_modules/typescript/dist/api/syncChannel.js +0 -508
  275. package/examples/gh/node_modules/typescript/dist/api/syncChannel.js.map +0 -1
  276. package/examples/gh/node_modules/typescript/dist/api/timing.d.ts +0 -175
  277. package/examples/gh/node_modules/typescript/dist/api/timing.d.ts.map +0 -1
  278. package/examples/gh/node_modules/typescript/dist/api/timing.js +0 -149
  279. package/examples/gh/node_modules/typescript/dist/api/timing.js.map +0 -1
  280. package/examples/gh/node_modules/typescript/dist/ast/ast.d.ts +0 -100
  281. package/examples/gh/node_modules/typescript/dist/ast/ast.d.ts.map +0 -1
  282. package/examples/gh/node_modules/typescript/dist/ast/ast.generated.d.ts +0 -1161
  283. package/examples/gh/node_modules/typescript/dist/ast/ast.generated.d.ts.map +0 -1
  284. package/examples/gh/node_modules/typescript/dist/ast/ast.generated.js +0 -4
  285. package/examples/gh/node_modules/typescript/dist/ast/ast.generated.js.map +0 -1
  286. package/examples/gh/node_modules/typescript/dist/ast/ast.js +0 -7
  287. package/examples/gh/node_modules/typescript/dist/ast/ast.js.map +0 -1
  288. package/examples/gh/node_modules/typescript/dist/ast/astnav.d.ts +0 -19
  289. package/examples/gh/node_modules/typescript/dist/ast/astnav.d.ts.map +0 -1
  290. package/examples/gh/node_modules/typescript/dist/ast/astnav.js +0 -596
  291. package/examples/gh/node_modules/typescript/dist/ast/astnav.js.map +0 -1
  292. package/examples/gh/node_modules/typescript/dist/ast/clone.d.ts +0 -16
  293. package/examples/gh/node_modules/typescript/dist/ast/clone.d.ts.map +0 -1
  294. package/examples/gh/node_modules/typescript/dist/ast/clone.js +0 -104
  295. package/examples/gh/node_modules/typescript/dist/ast/clone.js.map +0 -1
  296. package/examples/gh/node_modules/typescript/dist/ast/factory.generated.d.ts +0 -520
  297. package/examples/gh/node_modules/typescript/dist/ast/factory.generated.d.ts.map +0 -1
  298. package/examples/gh/node_modules/typescript/dist/ast/factory.generated.js +0 -3057
  299. package/examples/gh/node_modules/typescript/dist/ast/factory.generated.js.map +0 -1
  300. package/examples/gh/node_modules/typescript/dist/ast/index.d.ts +0 -20
  301. package/examples/gh/node_modules/typescript/dist/ast/index.d.ts.map +0 -1
  302. package/examples/gh/node_modules/typescript/dist/ast/index.js +0 -20
  303. package/examples/gh/node_modules/typescript/dist/ast/index.js.map +0 -1
  304. package/examples/gh/node_modules/typescript/dist/ast/is.d.ts +0 -35
  305. package/examples/gh/node_modules/typescript/dist/ast/is.d.ts.map +0 -1
  306. package/examples/gh/node_modules/typescript/dist/ast/is.generated.d.ts +0 -329
  307. package/examples/gh/node_modules/typescript/dist/ast/is.generated.d.ts.map +0 -1
  308. package/examples/gh/node_modules/typescript/dist/ast/is.generated.js +0 -1103
  309. package/examples/gh/node_modules/typescript/dist/ast/is.generated.js.map +0 -1
  310. package/examples/gh/node_modules/typescript/dist/ast/is.js +0 -233
  311. package/examples/gh/node_modules/typescript/dist/ast/is.js.map +0 -1
  312. package/examples/gh/node_modules/typescript/dist/ast/jsdoc.d.ts +0 -11
  313. package/examples/gh/node_modules/typescript/dist/ast/jsdoc.d.ts.map +0 -1
  314. package/examples/gh/node_modules/typescript/dist/ast/jsdoc.js +0 -202
  315. package/examples/gh/node_modules/typescript/dist/ast/jsdoc.js.map +0 -1
  316. package/examples/gh/node_modules/typescript/dist/ast/scanner.d.ts +0 -97
  317. package/examples/gh/node_modules/typescript/dist/ast/scanner.d.ts.map +0 -1
  318. package/examples/gh/node_modules/typescript/dist/ast/scanner.js +0 -2230
  319. package/examples/gh/node_modules/typescript/dist/ast/scanner.js.map +0 -1
  320. package/examples/gh/node_modules/typescript/dist/ast/utils.d.ts +0 -17
  321. package/examples/gh/node_modules/typescript/dist/ast/utils.d.ts.map +0 -1
  322. package/examples/gh/node_modules/typescript/dist/ast/utils.js +0 -67
  323. package/examples/gh/node_modules/typescript/dist/ast/utils.js.map +0 -1
  324. package/examples/gh/node_modules/typescript/dist/ast/visitor.d.ts +0 -14
  325. package/examples/gh/node_modules/typescript/dist/ast/visitor.d.ts.map +0 -1
  326. package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.d.ts +0 -50
  327. package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.d.ts.map +0 -1
  328. package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.js +0 -978
  329. package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.js.map +0 -1
  330. package/examples/gh/node_modules/typescript/dist/ast/visitor.js +0 -47
  331. package/examples/gh/node_modules/typescript/dist/ast/visitor.js.map +0 -1
  332. package/examples/gh/node_modules/typescript/dist/enums/characterCodes.d.ts +0 -2
  333. package/examples/gh/node_modules/typescript/dist/enums/characterCodes.d.ts.map +0 -1
  334. package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.d.ts +0 -129
  335. package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.d.ts.map +0 -1
  336. package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.js +0 -132
  337. package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.js.map +0 -1
  338. package/examples/gh/node_modules/typescript/dist/enums/characterCodes.js +0 -130
  339. package/examples/gh/node_modules/typescript/dist/enums/characterCodes.js.map +0 -1
  340. package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.d.ts +0 -2
  341. package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.d.ts.map +0 -1
  342. package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.d.ts +0 -5
  343. package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.d.ts.map +0 -1
  344. package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.js +0 -6
  345. package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.js.map +0 -1
  346. package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.js +0 -6
  347. package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.js.map +0 -1
  348. package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.d.ts +0 -2
  349. package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.d.ts.map +0 -1
  350. package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.d.ts +0 -28
  351. package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.d.ts.map +0 -1
  352. package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.js +0 -30
  353. package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.js.map +0 -1
  354. package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.js +0 -30
  355. package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.js.map +0 -1
  356. package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.d.ts +0 -2
  357. package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.d.ts.map +0 -1
  358. package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.d.ts +0 -7
  359. package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.d.ts.map +0 -1
  360. package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.js +0 -9
  361. package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.js.map +0 -1
  362. package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.js +0 -9
  363. package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.js.map +0 -1
  364. package/examples/gh/node_modules/typescript/dist/enums/elementFlags.d.ts +0 -2
  365. package/examples/gh/node_modules/typescript/dist/enums/elementFlags.d.ts.map +0 -1
  366. package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.d.ts +0 -12
  367. package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.d.ts.map +0 -1
  368. package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.js +0 -14
  369. package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.js.map +0 -1
  370. package/examples/gh/node_modules/typescript/dist/enums/elementFlags.js +0 -14
  371. package/examples/gh/node_modules/typescript/dist/enums/elementFlags.js.map +0 -1
  372. package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.d.ts +0 -2
  373. package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.d.ts.map +0 -1
  374. package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.d.ts +0 -23
  375. package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.d.ts.map +0 -1
  376. package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.js +0 -25
  377. package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.js.map +0 -1
  378. package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.js +0 -25
  379. package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.js.map +0 -1
  380. package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.d.ts +0 -2
  381. package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.d.ts.map +0 -1
  382. package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.d.ts +0 -9
  383. package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.d.ts.map +0 -1
  384. package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.js +0 -11
  385. package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.js.map +0 -1
  386. package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.js +0 -11
  387. package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.js.map +0 -1
  388. package/examples/gh/node_modules/typescript/dist/enums/languageVariant.d.ts +0 -2
  389. package/examples/gh/node_modules/typescript/dist/enums/languageVariant.d.ts.map +0 -1
  390. package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.d.ts +0 -5
  391. package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.d.ts.map +0 -1
  392. package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.js +0 -6
  393. package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.js.map +0 -1
  394. package/examples/gh/node_modules/typescript/dist/enums/languageVariant.js +0 -6
  395. package/examples/gh/node_modules/typescript/dist/enums/languageVariant.js.map +0 -1
  396. package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.d.ts +0 -2
  397. package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.d.ts.map +0 -1
  398. package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.d.ts +0 -42
  399. package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.d.ts.map +0 -1
  400. package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.js +0 -44
  401. package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.js.map +0 -1
  402. package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.js +0 -44
  403. package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.js.map +0 -1
  404. package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.d.ts +0 -2
  405. package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.d.ts.map +0 -1
  406. package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.d.ts +0 -7
  407. package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.d.ts.map +0 -1
  408. package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.js +0 -9
  409. package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.js.map +0 -1
  410. package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.js +0 -9
  411. package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.js.map +0 -1
  412. package/examples/gh/node_modules/typescript/dist/enums/moduleKind.d.ts +0 -2
  413. package/examples/gh/node_modules/typescript/dist/enums/moduleKind.d.ts.map +0 -1
  414. package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.d.ts +0 -17
  415. package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.d.ts.map +0 -1
  416. package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.js +0 -19
  417. package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.js.map +0 -1
  418. package/examples/gh/node_modules/typescript/dist/enums/moduleKind.js +0 -19
  419. package/examples/gh/node_modules/typescript/dist/enums/moduleKind.js.map +0 -1
  420. package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.d.ts +0 -2
  421. package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.d.ts.map +0 -1
  422. package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.d.ts +0 -9
  423. package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.d.ts.map +0 -1
  424. package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.js +0 -11
  425. package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.js.map +0 -1
  426. package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.js +0 -11
  427. package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.js.map +0 -1
  428. package/examples/gh/node_modules/typescript/dist/enums/newLineKind.d.ts +0 -2
  429. package/examples/gh/node_modules/typescript/dist/enums/newLineKind.d.ts.map +0 -1
  430. package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.d.ts +0 -6
  431. package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.d.ts.map +0 -1
  432. package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.js +0 -8
  433. package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.js.map +0 -1
  434. package/examples/gh/node_modules/typescript/dist/enums/newLineKind.js +0 -8
  435. package/examples/gh/node_modules/typescript/dist/enums/newLineKind.js.map +0 -1
  436. package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.d.ts +0 -2
  437. package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.d.ts.map +0 -1
  438. package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.d.ts +0 -36
  439. package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.d.ts.map +0 -1
  440. package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.js +0 -38
  441. package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.js.map +0 -1
  442. package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.js +0 -38
  443. package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.js.map +0 -1
  444. package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.d.ts +0 -2
  445. package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.d.ts.map +0 -1
  446. package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.d.ts +0 -44
  447. package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.d.ts.map +0 -1
  448. package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.js +0 -46
  449. package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.js.map +0 -1
  450. package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.js +0 -46
  451. package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.js.map +0 -1
  452. package/examples/gh/node_modules/typescript/dist/enums/objectFlags.d.ts +0 -2
  453. package/examples/gh/node_modules/typescript/dist/enums/objectFlags.d.ts.map +0 -1
  454. package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.d.ts +0 -50
  455. package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.d.ts.map +0 -1
  456. package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.js +0 -52
  457. package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.js.map +0 -1
  458. package/examples/gh/node_modules/typescript/dist/enums/objectFlags.js +0 -52
  459. package/examples/gh/node_modules/typescript/dist/enums/objectFlags.js.map +0 -1
  460. package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.d.ts +0 -2
  461. package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.d.ts.map +0 -1
  462. package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.d.ts +0 -16
  463. package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.d.ts.map +0 -1
  464. package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.js +0 -18
  465. package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.js.map +0 -1
  466. package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.js +0 -18
  467. package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.js.map +0 -1
  468. package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.d.ts +0 -2
  469. package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.d.ts.map +0 -1
  470. package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.d.ts +0 -13
  471. package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.d.ts.map +0 -1
  472. package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.js +0 -14
  473. package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.js.map +0 -1
  474. package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.js +0 -14
  475. package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.js.map +0 -1
  476. package/examples/gh/node_modules/typescript/dist/enums/scriptKind.d.ts +0 -2
  477. package/examples/gh/node_modules/typescript/dist/enums/scriptKind.d.ts.map +0 -1
  478. package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.d.ts +0 -11
  479. package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.d.ts.map +0 -1
  480. package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.js +0 -12
  481. package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.js.map +0 -1
  482. package/examples/gh/node_modules/typescript/dist/enums/scriptKind.js +0 -12
  483. package/examples/gh/node_modules/typescript/dist/enums/scriptKind.js.map +0 -1
  484. package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.d.ts +0 -2
  485. package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.d.ts.map +0 -1
  486. package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.d.ts +0 -17
  487. package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.d.ts.map +0 -1
  488. package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.js +0 -18
  489. package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.js.map +0 -1
  490. package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.js +0 -18
  491. package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.js.map +0 -1
  492. package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.d.ts +0 -2
  493. package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.d.ts.map +0 -1
  494. package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.d.ts +0 -15
  495. package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.d.ts.map +0 -1
  496. package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.js +0 -17
  497. package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.js.map +0 -1
  498. package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.js +0 -17
  499. package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.js.map +0 -1
  500. package/examples/gh/node_modules/typescript/dist/enums/signatureKind.d.ts +0 -2
  501. package/examples/gh/node_modules/typescript/dist/enums/signatureKind.d.ts.map +0 -1
  502. package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.d.ts +0 -5
  503. package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.d.ts.map +0 -1
  504. package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.js +0 -7
  505. package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.js.map +0 -1
  506. package/examples/gh/node_modules/typescript/dist/enums/signatureKind.js +0 -7
  507. package/examples/gh/node_modules/typescript/dist/enums/signatureKind.js.map +0 -1
  508. package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.d.ts +0 -2
  509. package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.d.ts.map +0 -1
  510. package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.d.ts +0 -71
  511. package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.d.ts.map +0 -1
  512. package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.js +0 -73
  513. package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.js.map +0 -1
  514. package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.js +0 -73
  515. package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.js.map +0 -1
  516. package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.d.ts +0 -2
  517. package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.d.ts.map +0 -1
  518. package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.d.ts +0 -389
  519. package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.d.ts.map +0 -1
  520. package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.js +0 -391
  521. package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.js.map +0 -1
  522. package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.js +0 -391
  523. package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.js.map +0 -1
  524. package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.d.ts +0 -2
  525. package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.d.ts.map +0 -1
  526. package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.d.ts +0 -30
  527. package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.d.ts.map +0 -1
  528. package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.js +0 -32
  529. package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.js.map +0 -1
  530. package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.js +0 -32
  531. package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.js.map +0 -1
  532. package/examples/gh/node_modules/typescript/dist/enums/typeFlags.d.ts +0 -2
  533. package/examples/gh/node_modules/typescript/dist/enums/typeFlags.d.ts.map +0 -1
  534. package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.d.ts +0 -76
  535. package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.d.ts.map +0 -1
  536. package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.js +0 -78
  537. package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.js.map +0 -1
  538. package/examples/gh/node_modules/typescript/dist/enums/typeFlags.js +0 -78
  539. package/examples/gh/node_modules/typescript/dist/enums/typeFlags.js.map +0 -1
  540. package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.d.ts +0 -2
  541. package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.d.ts.map +0 -1
  542. package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.d.ts +0 -7
  543. package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.d.ts.map +0 -1
  544. package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.js +0 -9
  545. package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.js.map +0 -1
  546. package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.js +0 -9
  547. package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.js.map +0 -1
  548. package/examples/gh/node_modules/typescript/dist/internal/utils.d.ts +0 -23
  549. package/examples/gh/node_modules/typescript/dist/internal/utils.d.ts.map +0 -1
  550. package/examples/gh/node_modules/typescript/dist/internal/utils.js +0 -25
  551. package/examples/gh/node_modules/typescript/dist/internal/utils.js.map +0 -1
  552. package/examples/gh/node_modules/typescript/lib/getExePath.d.ts +0 -2
  553. package/examples/gh/node_modules/typescript/lib/getExePath.js +0 -70
  554. package/examples/gh/node_modules/typescript/lib/tsc.js +0 -28
  555. package/examples/gh/node_modules/typescript/lib/version.cjs +0 -3
  556. package/examples/gh/node_modules/typescript/lib/version.d.cts +0 -2
  557. package/examples/gh/node_modules/typescript/package.json +0 -87
  558. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/License.txt +0 -11
  559. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/README.md +0 -54
  560. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/main.d.ts +0 -17
  561. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/main.js +0 -83
  562. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/ril.d.ts +0 -22
  563. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/ril.js +0 -210
  564. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/api.d.ts +0 -14
  565. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/api.js +0 -87
  566. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/cancellation.d.ts +0 -32
  567. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/cancellation.js +0 -132
  568. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/connection.d.ts +0 -367
  569. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/connection.js +0 -1271
  570. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/disposable.d.ts +0 -9
  571. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/disposable.js +0 -16
  572. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/encoding.d.ts +0 -52
  573. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/encoding.js +0 -70
  574. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/events.d.ts +0 -39
  575. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/events.js +0 -135
  576. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/is.d.ts +0 -7
  577. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/is.js +0 -34
  578. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/linkedMap.d.ts +0 -55
  579. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/linkedMap.js +0 -412
  580. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageBuffer.d.ts +0 -18
  581. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageBuffer.js +0 -155
  582. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageReader.d.ts +0 -77
  583. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageReader.js +0 -246
  584. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageWriter.d.ts +0 -60
  585. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageWriter.js +0 -157
  586. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messages.d.ts +0 -369
  587. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messages.js +0 -436
  588. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/ral.d.ts +0 -74
  589. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/ral.js +0 -23
  590. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/semaphore.d.ts +0 -10
  591. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/semaphore.js +0 -74
  592. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.d.ts +0 -15
  593. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +0 -77
  594. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/main.d.ts +0 -58
  595. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/main.js +0 -289
  596. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/ril.d.ts +0 -12
  597. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/ril.js +0 -163
  598. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/package.json +0 -54
  599. package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/typings/thenable.d.ts +0 -5
  600. package/examples/gh/package.json +0 -45
  601. package/examples/gh/src/commands/auth.ts +0 -66
  602. package/examples/gh/src/commands/issue.ts +0 -120
  603. package/examples/gh/src/commands/pr.ts +0 -125
  604. package/examples/gh/src/data/issues.yaml +0 -5
  605. package/examples/gh/src/data/issues.yaml.d.ts +0 -17
  606. package/examples/gh/src/data/pull-requests.yaml +0 -7
  607. package/examples/gh/src/data/pull-requests.yaml.d.ts +0 -18
  608. package/examples/gh/src/docs.ts +0 -11
  609. package/examples/gh/src/lib/auth.ts +0 -37
  610. package/examples/gh/src/lib/utils.ts +0 -17
  611. package/examples/gh/src/main.test.ts +0 -307
  612. package/examples/gh/src/main.ts +0 -46
  613. package/examples/help-config.ts +0 -43
  614. package/examples/interactive.ts +0 -67
  615. package/examples/json-mode.ts +0 -95
  616. package/examples/middleware.ts +0 -71
  617. package/examples/multi-command.ts +0 -66
  618. package/examples/output-extras.ts +0 -46
  619. package/examples/parser-control.ts +0 -40
  620. package/examples/pwsh-demo/README.md +0 -40
  621. package/examples/pwsh-demo/package.json +0 -41
  622. package/examples/pwsh-demo/pwsh-demo.cmd +0 -3
  623. package/examples/pwsh-demo/smoke-powershell.ps1 +0 -218
  624. package/examples/pwsh-demo/src/main.test.ts +0 -45
  625. package/examples/pwsh-demo/src/main.ts +0 -140
  626. package/examples/spinner-progress.ts +0 -49
  627. package/examples/standard-schema.ts +0 -45
  628. package/examples/testing.ts +0 -147
  629. package/examples/transport-launcher.ts +0 -85
@@ -1,1451 +0,0 @@
1
- import { schemaBrand } from "./brand.mjs";
2
- import { NumberConstraints } from "./number-constraints.mjs";
3
- import { ConfirmPromptConfig, InputPromptConfig, MultiselectPromptConfig, PromptConfig, SelectPromptConfig } from "./prompt.mjs";
4
- import { InferStandardOutput, StandardSchemaV1 } from "./standard.mjs";
5
- import { StdinBinding, StdinConsume, StdinOptions, StdinWhen } from "./stdin.mjs";
6
- import { StringConstraints } from "./string-constraints.mjs";
7
- import { DateFlagOptions, PathChecks, PathFlagOptions, UrlFlagOptions } from "./value-parsers.mjs";
8
- import { DuplicateKeys, SourceSplitBinding, SplitBinding, SplitFormat, SplitOptions, SplitPolicy, SplitSetting } from "./cardinality.mjs";
9
- //#region src/core/schema/arg.d.ts
10
- /** All arg presence states as a runtime array. */
11
- declare const ARG_PRESENCES: readonly ["required", "optional", "defaulted"];
12
- /**
13
- * Presence describes whether a positional arg is guaranteed to exist when the
14
- * action handler runs:
15
- *
16
- * - `'required'` — must be supplied; error if missing (default)
17
- * - `'optional'` — may be `undefined` if not supplied
18
- * - `'defaulted'` — always present (falls back to default value)
19
- */
20
- type ArgPresence = (typeof ARG_PRESENCES)[number];
21
- /**
22
- * Compile-time state carried through the builder chain.
23
- */
24
- interface ArgConfig {
25
- /** The resolved value type (e.g. `string`, `number`, custom). */
26
- readonly valueType: unknown;
27
- /** Whether the arg is required, optional, or has a default. */
28
- readonly presence: ArgPresence;
29
- /** Whether this arg consumes remaining positionals. */
30
- readonly variadic: boolean;
31
- /** The runtime kind discriminator, mirroring {@link ArgKind}. */
32
- readonly argKind: ArgKind;
33
- /**
34
- * Whether this builder may still be passed to `arg.keyValue()` as its entry
35
- * value. Factories start `true`; the modifiers that describe the positional
36
- * itself (`.env()`, `.prompt()`, `.optional()`, `.stdin()`, …) flip it to
37
- * `false`, since an entry value is never read for those settings.
38
- */
39
- readonly elementEligible: boolean;
40
- }
41
- /**
42
- * Advanced type helper used by {@linkcode ArgBuilder} modifiers to replace presence.
43
- * Most consumers rely on inference and never reference this directly.
44
- */
45
- type WithArgPresence<C extends ArgConfig, P extends ArgPresence> = {
46
- readonly valueType: C["valueType"];
47
- readonly presence: P;
48
- readonly variadic: C["variadic"];
49
- readonly argKind: C["argKind"];
50
- readonly elementEligible: false;
51
- };
52
- /**
53
- * Advanced type helper used by {@linkcode ArgBuilder.variadic | ArgBuilder.variadic()}.
54
- * Most consumers rely on inference and never reference this directly.
55
- */
56
- type WithVariadic<C extends ArgConfig> = {
57
- readonly valueType: C["valueType"];
58
- readonly presence: C["presence"];
59
- readonly variadic: true;
60
- readonly argKind: C["argKind"];
61
- readonly elementEligible: false;
62
- };
63
- /**
64
- * Advanced type helper: marks a builder as no longer usable as an entry value
65
- * (returned by the modifiers whose settings an entry value ignores).
66
- */
67
- type WithoutArgElementEligibility<C extends ArgConfig> = {
68
- readonly valueType: C["valueType"];
69
- readonly presence: C["presence"];
70
- readonly variadic: C["variadic"];
71
- readonly argKind: C["argKind"];
72
- readonly elementEligible: false;
73
- };
74
- /**
75
- * The element config `arg.keyValue()` assumes when given no element builder: an
76
- * unconstrained string.
77
- */
78
- type StringArgElementConfig = {
79
- /** Element value type. */
80
- readonly valueType: string;
81
- /** Elements carry no presence of their own. */
82
- readonly presence: "required";
83
- /** Elements are never variadic on their own. */
84
- readonly variadic: false;
85
- /** Element kind discriminator. */
86
- readonly argKind: "string";
87
- /** Elements are element-eligible by construction. */
88
- readonly elementEligible: true;
89
- };
90
- /**
91
- * Compute the final value type from config — this is what handlers receive.
92
- *
93
- * Advanced type helper: this powers {@link InferArg} and action-handler
94
- * inference. Most apps do not need to mention it explicitly.
95
- *
96
- * A `keyValue` arg always produces a record, variadic or not, because it
97
- * aggregates entries rather than a list. Variadic args of every other kind
98
- * produce an array. Non-variadic:
99
- * - `'optional'` → `T | undefined`
100
- * - `'required'` → `T`
101
- * - `'defaulted'` → `T`
102
- */
103
- type ResolvedArgValue<C extends ArgConfig> = C["argKind"] extends "keyValue" ? C["valueType"] : C["variadic"] extends true ? C["valueType"][] : C["presence"] extends "optional" ? C["valueType"] | undefined : C["valueType"];
104
- /**
105
- * The value `.default()` accepts for an arg.
106
- *
107
- * A default stands in for what the arg resolves to, so an arg that aggregates
108
- * takes the completed array or record and every other arg takes one value.
109
- */
110
- type ArgDefaultValue<C extends ArgConfig> = C["argKind"] extends "keyValue" ? C["valueType"] : C["variadic"] extends true ? readonly C["valueType"][] : C["valueType"];
111
- /**
112
- * Maps an {@linkcode ArgKind} to the prompt config types compatible with it,
113
- * mirroring the flag table for the kinds args have.
114
- *
115
- * - `'string'` → {@link InputPromptConfig} | {@link SelectPromptConfig}
116
- * - `'number'` → {@link InputPromptConfig}
117
- * - `'boolean'` → {@link ConfirmPromptConfig}
118
- * - `'enum'` → {@link SelectPromptConfig} | {@link InputPromptConfig}
119
- * - `'custom'` → all prompt kinds ({@link PromptConfig})
120
- * - `'keyValue'` → `never` (not promptable)
121
- */
122
- type PromptConfigByArgKind = {
123
- readonly string: InputPromptConfig | SelectPromptConfig;
124
- readonly number: InputPromptConfig;
125
- readonly boolean: ConfirmPromptConfig;
126
- readonly enum: SelectPromptConfig | InputPromptConfig;
127
- readonly custom: PromptConfig;
128
- readonly keyValue: never;
129
- };
130
- /**
131
- * Prompt configuration compatible with an {@link ArgConfig}.
132
- *
133
- * A variadic arg collects several values, so it takes the multiselect a
134
- * `flag.array()` takes; every other arg takes what its kind takes.
135
- */
136
- type AllowedArgPromptConfig<C extends ArgConfig> = C["argKind"] extends "keyValue" ? never : C["variadic"] extends true ? MultiselectPromptConfig : PromptConfigByArgKind[C["argKind"]];
137
- /** Extract the resolved value type from an {@linkcode ArgBuilder}. */
138
- type InferArg<B> = B extends ArgBuilder<infer C extends ArgConfig> ? ResolvedArgValue<C> : never;
139
- /** Extract resolved value types from a record of builders. */
140
- type InferArgs<T extends Record<string, ArgBuilder<ArgConfig>>> = { [K in keyof T]: InferArg<T[K]>; };
141
- /** All arg kind discriminators as a runtime array. */
142
- declare const ARG_KINDS: readonly ["string", "number", "boolean", "enum", "custom", "keyValue"];
143
- /** Discriminator for the kind of value an arg accepts. */
144
- type ArgKind = (typeof ARG_KINDS)[number];
145
- /** Custom parse function for `arg.custom()`. */
146
- type ArgParseFn<T> = (raw: string) => T;
147
- /**
148
- * The runtime descriptor stored inside every {@linkcode ArgBuilder}. Consumers (parser,
149
- * help generator) read this to understand the arg's shape without touching
150
- * generics.
151
- */
152
- interface ArgSchema<K extends ArgKind = ArgKind> {
153
- /** Type-only seal produced by {@link createArgSchema}. */
154
- readonly [schemaBrand]: "arg";
155
- /** What kind of value this arg accepts. */
156
- readonly kind: K;
157
- /** Current presence state. */
158
- readonly presence: ArgPresence;
159
- /** Whether this arg consumes all remaining positionals. */
160
- readonly variadic: boolean;
161
- /**
162
- * Stdin binding set by `.stdin()` (`undefined` when the arg never reads
163
- * stdin). See {@link StdinBinding}.
164
- */
165
- readonly stdin: StdinBinding | undefined;
166
- /** Runtime default value (if any). */
167
- readonly defaultValue: unknown;
168
- /** Human-readable description for help text. */
169
- readonly description: string | undefined;
170
- /**
171
- * Environment variable name for env resolution.
172
- *
173
- * When set and the CLI value is absent, the resolver reads this env var
174
- * and coerces the string to the arg's declared kind.
175
- *
176
- * @see {@link ArgBuilder.env} for the builder method.
177
- */
178
- readonly envVar: string | undefined;
179
- /**
180
- * Dotted config path for config resolution (e.g. `'deploy.region'`).
181
- *
182
- * @see {@link ArgBuilder.config} for the builder method.
183
- */
184
- readonly configPath: string | undefined;
185
- /**
186
- * Interactive prompt configuration.
187
- *
188
- * @see {@link ArgBuilder.prompt} for the builder method.
189
- */
190
- readonly prompt: PromptConfig | undefined;
191
- /** Allowed literal values when `kind === 'enum'`. */
192
- readonly enumValues: readonly string[] | undefined;
193
- /**
194
- * Element schema when `kind === 'keyValue'`.
195
- *
196
- * Describes the value of each entry, so `arg.keyValue(arg.number())` decodes
197
- * `A=1` to the number `1`. `undefined` leaves entry values as strings.
198
- */
199
- readonly elementSchema: ArgSchema | undefined;
200
- /**
201
- * Numeric constraints when `kind === 'number'` (`undefined` otherwise).
202
- *
203
- * Enforced at the parse and resolution boundaries. `finite` defaults to
204
- * `true`, so `Infinity` is rejected even when no constraints object is set.
205
- */
206
- readonly numberConstraints: NumberConstraints | undefined;
207
- /**
208
- * String constraints when `kind === 'string'` (`undefined` otherwise).
209
- *
210
- * Enforced at the parse and resolution boundaries, in fixed order:
211
- * nonEmpty → minLength → maxLength → pattern. A `defaultValue` is a typed
212
- * value, so it is validated against them when the schema is built.
213
- */
214
- readonly stringConstraints: StringConstraints | undefined;
215
- /**
216
- * Filesystem checks for path-valued args (set by `arg.path()`).
217
- *
218
- * Validated after resolution through the runtime adapter, so CLI, stdin,
219
- * env, and defaulted values are all checked. Only meaningful when
220
- * `kind === 'string'`.
221
- */
222
- readonly pathChecks: PathChecks | undefined;
223
- /**
224
- * Help placeholder label (e.g. `'url'`).
225
- *
226
- * Set by the sugar factories (`arg.url()`, `arg.date()`, …) so tooling
227
- * reading the schema knows the expected value shape. Help renders a
228
- * positional by its own name, so this does not change the usage line.
229
- */
230
- readonly valueHint: string | undefined;
231
- /** Custom parse function (only when `kind === 'custom'`). */
232
- readonly parseFn: ArgParseFn<unknown> | undefined;
233
- /**
234
- * CLI value separator for a collection (`undefined` otherwise).
235
- *
236
- * When set, each positional token is split on this separator before element
237
- * coercion. Other sources decode through {@link ArgSchema.split}.
238
- */
239
- readonly separator: string | undefined;
240
- /**
241
- * Env and stdin split policies for a collection (`undefined` otherwise).
242
- *
243
- * A source the binding leaves out takes its default: comma-delimited for env,
244
- * line-delimited for stdin.
245
- */
246
- readonly split: SourceSplitBinding | undefined;
247
- /**
248
- * How a repeated key combines when `kind === 'keyValue'`.
249
- *
250
- * @defaultValue `'last'`
251
- */
252
- readonly duplicateKeys: DuplicateKeys;
253
- /**
254
- * Deduplicate the resolved values of a variadic arg.
255
- *
256
- * Applied after all sources resolve, preserving first-seen order. Uses
257
- * `SameValueZero` semantics (like `Set`).
258
- */
259
- readonly unique: boolean;
260
- /**
261
- * Standard Schema v1 validator applied to each resolved value.
262
- *
263
- * When set, the value from any source (CLI, env, stdin, default) is
264
- * validated after resolution via `~standard.validate`. Sync and async
265
- * validators are both awaited; issues surface as a `CONSTRAINT_VIOLATED`
266
- * {@link ValidationError}. A variadic arg validates every element with it.
267
- */
268
- readonly standard: StandardSchemaV1 | undefined;
269
- /**
270
- * Standard Schema v1 validator applied to the completed collection.
271
- *
272
- * Set by `.standard()` on a builder that already aggregates, so the array or
273
- * record is validated as a whole after every element passed.
274
- */
275
- readonly aggregateStandard: StandardSchemaV1 | undefined;
276
- /**
277
- * Deprecation marker.
278
- *
279
- * - `undefined` — not deprecated (default)
280
- * - `true` — deprecated with no migration message
281
- * - `string` — deprecated with a reason/migration message
282
- *
283
- * When a deprecated arg is used, a warning is emitted to stderr.
284
- * Help text shows `[deprecated]` or `[deprecated: <reason>]`.
285
- */
286
- readonly deprecated: string | true | undefined;
287
- }
288
- /** Definition fields accepted by every arg kind. */
289
- interface ArgDefinitionBase {
290
- /**
291
- * Presence state.
292
- * @defaultValue `'required'`
293
- */
294
- readonly presence?: ArgPresence | undefined;
295
- /**
296
- * Whether this arg consumes all remaining positionals.
297
- * @defaultValue `false`
298
- */
299
- readonly variadic?: boolean | undefined;
300
- /**
301
- * Stdin binding. See {@link StdinOptions}.
302
- * @defaultValue `undefined`
303
- */
304
- readonly stdin?: StdinOptions | undefined;
305
- /**
306
- * Runtime default value.
307
- * @defaultValue `undefined`
308
- */
309
- readonly defaultValue?: unknown;
310
- /**
311
- * Human-readable description for help text.
312
- * @defaultValue `undefined`
313
- */
314
- readonly description?: string | undefined;
315
- /**
316
- * Environment variable name for env resolution.
317
- * @defaultValue `undefined`
318
- */
319
- readonly envVar?: string | undefined;
320
- /**
321
- * Dotted config path for config resolution (e.g. `'deploy.region'`).
322
- * @defaultValue `undefined`
323
- */
324
- readonly configPath?: string | undefined;
325
- /**
326
- * Interactive prompt configuration.
327
- * @defaultValue `undefined`
328
- */
329
- readonly prompt?: PromptConfig | undefined;
330
- /**
331
- * Help placeholder label (`'url'`, `'path'`, …).
332
- * @defaultValue `undefined`
333
- */
334
- readonly valueHint?: string | undefined;
335
- /**
336
- * CLI value separator each positional token is split on.
337
- * @defaultValue `undefined`
338
- */
339
- readonly separator?: string | undefined;
340
- /**
341
- * Env and stdin split policies.
342
- * @defaultValue `undefined`
343
- */
344
- readonly split?: SourceSplitBinding | undefined;
345
- /**
346
- * Deduplicate the resolved values of a variadic arg.
347
- * @defaultValue `false`
348
- */
349
- readonly unique?: boolean | undefined;
350
- /**
351
- * Standard Schema v1 validator applied to each resolved value.
352
- * @defaultValue `undefined`
353
- */
354
- readonly standard?: StandardSchemaV1 | undefined;
355
- /**
356
- * Standard Schema v1 validator applied to a completed collection.
357
- * @defaultValue `undefined`
358
- */
359
- readonly aggregateStandard?: StandardSchemaV1 | undefined;
360
- /**
361
- * Deprecation marker. `true` deprecates without a message, a string carries
362
- * the migration guidance.
363
- * @defaultValue `undefined`
364
- */
365
- readonly deprecated?: string | true | undefined;
366
- }
367
- /** Definition of a `string` arg. */
368
- interface StringArgDefinition extends ArgDefinitionBase {
369
- /** Kind discriminator. */
370
- readonly kind: "string";
371
- /**
372
- * String constraints enforced at the parse and resolution boundaries.
373
- * @defaultValue `undefined`
374
- */
375
- readonly stringConstraints?: StringConstraints | undefined;
376
- /**
377
- * Filesystem checks applied after resolution.
378
- * @defaultValue `undefined`
379
- */
380
- readonly pathChecks?: PathChecks | undefined;
381
- }
382
- /** Definition of a `number` arg. */
383
- interface NumberArgDefinition extends ArgDefinitionBase {
384
- /** Kind discriminator. */
385
- readonly kind: "number";
386
- /**
387
- * Numeric constraints enforced at the parse and resolution boundaries.
388
- * @defaultValue `undefined`
389
- */
390
- readonly numberConstraints?: NumberConstraints | undefined;
391
- }
392
- /** Definition of an `enum` arg. */
393
- interface EnumArgDefinition extends ArgDefinitionBase {
394
- /** Kind discriminator. */
395
- readonly kind: "enum";
396
- /** Allowed literal values. */
397
- readonly enumValues: readonly string[];
398
- }
399
- /** Definition of a `custom` arg. */
400
- interface CustomArgDefinition extends ArgDefinitionBase {
401
- /** Kind discriminator. */
402
- readonly kind: "custom";
403
- /**
404
- * Parse function applied to the raw value.
405
- * @defaultValue `undefined`
406
- */
407
- readonly parseFn?: ArgParseFn<unknown> | undefined;
408
- }
409
- /** Definition of a `boolean` arg. */
410
- interface BooleanArgDefinition extends ArgDefinitionBase {
411
- /** Kind discriminator. */
412
- readonly kind: "boolean";
413
- }
414
- /** Definition of a `keyValue` arg. */
415
- interface KeyValueArgDefinition extends ArgDefinitionBase {
416
- /** Kind discriminator. */
417
- readonly kind: "keyValue";
418
- /**
419
- * How a repeated key combines. See {@link DuplicateKeys}.
420
- * @defaultValue `'last'`
421
- */
422
- readonly duplicateKeys?: DuplicateKeys | undefined;
423
- /**
424
- * Schema describing the value of each entry, as a definition or an already
425
- * built {@link ArgSchema}.
426
- * @defaultValue `undefined`, which leaves entry values as strings
427
- */
428
- readonly elementSchema?: ArgDefinition | ArgSchema | undefined;
429
- }
430
- /** Maps each {@link ArgKind} to its definition shape. */
431
- interface ArgDefinitionByKind {
432
- /** Definition shape for `string` args. */
433
- readonly string: StringArgDefinition;
434
- /** Definition shape for `number` args. */
435
- readonly number: NumberArgDefinition;
436
- /** Definition shape for `boolean` args. */
437
- readonly boolean: BooleanArgDefinition;
438
- /** Definition shape for `enum` args. */
439
- readonly enum: EnumArgDefinition;
440
- /** Definition shape for `custom` args. */
441
- readonly custom: CustomArgDefinition;
442
- /** Definition shape for `keyValue` args. */
443
- readonly keyValue: KeyValueArgDefinition;
444
- }
445
- /** Definition of an arg of kind `K`, including the kind discriminator. */
446
- type ArgDefinition<K extends ArgKind = ArgKind> = ArgDefinitionByKind[K];
447
- /** Definition of an arg of kind `K` with the kind discriminator removed. */
448
- type ArgDefinitionOverrides<K extends ArgKind = ArgKind> = Omit<ArgDefinitionByKind[K], "kind">;
449
- /** Positional factory arguments, requiring fields that the selected kind requires. */
450
- type ArgDefinitionArguments<K extends ArgKind> = K extends "enum" ? [overrides: ArgDefinitionOverrides<K>] : [overrides?: ArgDefinitionOverrides<K>];
451
- /**
452
- * Create a raw {@link ArgSchema} object with sensible defaults.
453
- *
454
- * Most consumers should prefer the higher-level {@link arg} factory, which
455
- * returns an immutable {@link ArgBuilder} with type inference and fluent
456
- * modifiers. `createArgSchema()` exists for advanced schema composition,
457
- * targeted tests, or custom builders that need the plain runtime descriptor.
458
- *
459
- * Fields are shallow-merged on top of the default shape, so callers are
460
- * responsible for preserving invariants such as variadic ordering.
461
- *
462
- * @param kind - Discriminator for the value type this arg accepts.
463
- * @param overrides - Definition fields for `kind`, shallow-merged onto defaults.
464
- * @returns A fully populated {@link ArgSchema}.
465
- * @throws {CLIError} With code `'INVALID_SCHEMA'` when a field belongs to a
466
- * different {@link ArgKind}.
467
- *
468
- * @example
469
- * ```ts
470
- * const schema = createArgSchema('custom', {
471
- * description: 'Hex color',
472
- * parseFn: (raw) => `#${raw}`,
473
- * });
474
- * ```
475
- */
476
- declare function createArgSchema<K extends ArgKind>(kind: K, ...overrides: ArgDefinitionArguments<K>): ArgSchema<K>;
477
- /**
478
- * Create a raw {@link ArgSchema} object from a single definition object.
479
- *
480
- * An already-built {@link ArgSchema} is accepted and re-normalized into a
481
- * deep-equal schema.
482
- *
483
- * @param definition - Kind discriminator plus the fields valid for that kind.
484
- * @returns A fully populated {@link ArgSchema}.
485
- * @throws {CLIError} With code `'INVALID_SCHEMA'` when a field belongs to a
486
- * different {@link ArgKind}.
487
- *
488
- * @example
489
- * ```ts
490
- * const schema = createArgSchema({
491
- * kind: 'enum',
492
- * enumValues: ['us', 'eu', 'ap'],
493
- * description: 'Target region',
494
- * });
495
- * ```
496
- */
497
- declare function createArgSchema<K extends ArgKind>(definition: ArgDefinition<K> | ArgSchema<K>): ArgSchema<K>;
498
- /**
499
- * Immutable positional argument schema builder.
500
- *
501
- * The type parameter `C` is a phantom that tracks the value type, presence,
502
- * and variadic state through the fluent chain. Each modifier returns a **new**
503
- * builder — the original is never mutated.
504
- *
505
- * @example
506
- * ```ts
507
- * // Full command with multiple args and modifiers
508
- * import { command, arg } from '@kjanat/dreamcli';
509
- *
510
- * command('deploy')
511
- * .arg('target', arg.string()
512
- * .env('DEPLOY_TARGET')
513
- * .describe('Deploy target'))
514
- * .arg('port', arg.number()
515
- * .env('PORT')
516
- * .default(3000)
517
- * .describe('Port number'))
518
- * .arg('files', arg.string()
519
- * .variadic()
520
- * .optional()
521
- * .describe('Extra config files'))
522
- * .action(({ args }) => {
523
- * args.target; // string (required, from CLI or $DEPLOY_TARGET)
524
- * args.port; // number (defaulted, from CLI, $PORT, or 3000)
525
- * args.files; // string[] (optional variadic)
526
- * });
527
- * ```
528
- *
529
- * @example
530
- * ```ts
531
- * // Type inference
532
- * const target = arg.string();
533
- * type T = InferArg<typeof target>; // string
534
- *
535
- * const opt = arg.string().optional();
536
- * type O = InferArg<typeof opt>; // string | undefined
537
- *
538
- * const files = arg.string().variadic();
539
- * type F = InferArg<typeof files>; // string[]
540
- * ```
541
- */
542
- declare class ArgBuilder<C extends ArgConfig> {
543
- /**
544
- * Create an arg builder from a pre-built schema descriptor.
545
- *
546
- * @param schema - Runtime descriptor for this positional argument.
547
- */
548
- constructor(schema: ArgSchema);
549
- /**
550
- * Mark the arg as required (this is the default for positional args).
551
- * Produces an error if no value resolves from any configured source
552
- * (CLI → stdin → env → config → prompt → default).
553
- *
554
- * @example
555
- * ```ts
556
- * arg.string().required() // explicit, same as default
557
- *
558
- * // In a command — omitting <target> causes a ValidationError:
559
- * command('deploy')
560
- * .arg('target', arg.string().required().describe('Deploy target'))
561
- * // $ mycli deploy
562
- * // Error: Missing required argument <target>
563
- * ```
564
- *
565
- * @returns The builder (for chaining).
566
- */
567
- required(): ArgBuilder<WithArgPresence<C, "required">>;
568
- /**
569
- * Mark the arg as optional. Handlers receive `undefined` when absent.
570
- *
571
- * @example
572
- * ```ts
573
- * arg.string().optional()
574
- *
575
- * // In a command — handler receives `undefined` when omitted:
576
- * command('greet')
577
- * .arg('name', arg.string().optional().describe('Who to greet'))
578
- * .action(({ args }) => {
579
- * args.name; // string | undefined
580
- * });
581
- * // $ mycli greet → args.name is undefined
582
- * // $ mycli greet Alice → args.name is 'Alice'
583
- * ```
584
- *
585
- * @returns The builder (for chaining).
586
- */
587
- optional(): ArgBuilder<WithArgPresence<C, "optional">>;
588
- /**
589
- * Provide a default value. The arg becomes "always present" — handlers
590
- * will never see `undefined`.
591
- *
592
- * The generic constraint {@link ArgDefaultValue} ensures the default matches
593
- * what the arg resolves to: an array for a variadic arg, a record for a
594
- * `keyValue` one, and a single value otherwise.
595
- *
596
- * Resolution order when extra sources are configured:
597
- * CLI → stdin → env → config → prompt → **default**.
598
- *
599
- * @param value - Fallback used when no CLI value or env var resolves.
600
- * @returns The builder (for chaining).
601
- * @throws {CLIError} With code `'INVALID_DEFAULT'` when the value is one the
602
- * arg could never hold.
603
- *
604
- * @example
605
- * ```ts
606
- * arg.string().default('production')
607
- * arg.number().default(3000)
608
- * arg.string().variadic().default(['a', 'b'])
609
- *
610
- * // In a command — default kicks in when CLI and env are both absent:
611
- * command('deploy')
612
- * .arg('env', arg.string()
613
- * .env('DEPLOY_ENV')
614
- * .default('staging')
615
- * .describe('Target environment'))
616
- * .action(({ args }) => {
617
- * args.env; // string (never undefined)
618
- * });
619
- * // $ mycli deploy → 'staging' (default)
620
- * // $ DEPLOY_ENV=prod mycli deploy → 'prod' (env)
621
- * // $ mycli deploy production → 'production' (CLI)
622
- * ```
623
- */
624
- default<V extends ArgDefaultValue<C>>(value: V): ArgBuilder<WithArgPresence<C, "defaulted">>;
625
- /**
626
- * Mark this arg as variadic — it consumes all remaining positional
627
- * arguments. The inferred type becomes `T[]`.
628
- *
629
- * A variadic arg is the last positional a command can declare. Registering
630
- * another positional after it throws `INVALID_BUILDER_STATE` from `.arg()`
631
- * and from `createCommandSchema()`.
632
- *
633
- * @example
634
- * ```ts
635
- * arg.string().variadic()
636
- *
637
- * // In a command — collects all remaining positionals:
638
- * command('build')
639
- * .arg('entry', arg.string().describe('Main entry'))
640
- * .arg('extras', arg.string().variadic().optional().describe('Extra files'))
641
- * .action(({ args }) => {
642
- * args.entry; // string
643
- * args.extras; // string[]
644
- * });
645
- * // $ mycli build main.ts a.ts b.ts
646
- * // → entry = 'main.ts', extras = ['a.ts', 'b.ts']
647
- * ```
648
- *
649
- * @returns The builder (for chaining).
650
- */
651
- variadic(): ArgBuilder<WithVariadic<C>>;
652
- /**
653
- * Split each positional token on a separator before element coercion, so
654
- * `mycli build a,b c` collects `['a', 'b', 'c']` into a variadic arg.
655
- *
656
- * The separator is the CLI policy alone. Env values split on `','` and the
657
- * stdin buffer on line terminators unless `.split()` says otherwise.
658
- *
659
- * Available on an arg that aggregates, so call it after `.variadic()` or on
660
- * `arg.keyValue()`.
661
- *
662
- * @param value - Separator string (e.g. `','`).
663
- * @returns The builder (for chaining).
664
- * @throws {CLIError} With code `'INVALID_SCHEMA'` on an arg carrying a single
665
- * value.
666
- */
667
- separator(this: ArgBuilder<C & {
668
- readonly variadic: true;
669
- }> | ArgBuilder<C & {
670
- readonly argKind: "keyValue";
671
- }>, value: string): ArgBuilder<C>;
672
- /**
673
- * Set how each source decodes into elements.
674
- *
675
- * CLI tokens accept `'whole'` and a delimiter; env values also accept
676
- * `'json'`; the stdin buffer accepts every format, including `'lines'`. The
677
- * strings `'whole'`, `'lines'`, and `'json'` name their format, and every
678
- * other string is the delimiter to split on. A source left out keeps what it
679
- * already had, or its default: whole CLI tokens, comma-delimited env values,
680
- * line-delimited stdin. For stdin, `'whole'` passes the complete buffer to a
681
- * string element, including its final line terminator.
682
- *
683
- * Available on an arg that aggregates, so call it after `.variadic()` or on
684
- * `arg.keyValue()`.
685
- *
686
- * @param options - Per-source split settings.
687
- * @returns The builder (for chaining).
688
- * @throws {CLIError} With code `'INVALID_SCHEMA'` on a format the source does
689
- * not accept, an empty delimiter, or an arg carrying a single value.
690
- *
691
- * @example
692
- * ```ts
693
- * arg.string().variadic().split({ env: { format: 'json' } })
694
- * // FILES='["a.ts","b.ts"]' → ['a.ts', 'b.ts']
695
- * ```
696
- */
697
- split(this: ArgBuilder<C & {
698
- readonly variadic: true;
699
- }> | ArgBuilder<C & {
700
- readonly argKind: "keyValue";
701
- }>, options: SplitOptions): ArgBuilder<C>;
702
- /**
703
- * Deduplicate the resolved values of a variadic arg, preserving first-seen
704
- * order. Applied after all sources resolve, using `SameValueZero` semantics.
705
- *
706
- * Available on a variadic arg of a list kind, so call it after `.variadic()`.
707
- *
708
- * @param value - Whether to deduplicate.
709
- * @defaultValue `true`
710
- * @returns The builder (for chaining).
711
- * @throws {CLIError} With code `'INVALID_SCHEMA'` on an arg that resolves to
712
- * one value or to a record.
713
- */
714
- unique(this: ArgBuilder<C & {
715
- readonly variadic: true;
716
- readonly argKind: ListArgKind;
717
- }>, value?: boolean): ArgBuilder<C>;
718
- /**
719
- * Set how a repeated key combines.
720
- *
721
- * @param policy - `'last'` (default), `'first'`, or `'error'`.
722
- * @returns The builder (for chaining).
723
- * @throws {CLIError} With code `'INVALID_SCHEMA'` on an arg that is not
724
- * `arg.keyValue()`.
725
- *
726
- * @example
727
- * ```ts
728
- * arg.keyValue().variadic().duplicateKeys('error').env('VARS')
729
- * // $ VARS='A=1,A=2' mycli run
730
- * // # → Duplicate key '<redacted>' from env VARS for argument <vars> (CONSTRAINT_VIOLATED)
731
- * ```
732
- */
733
- duplicateKeys(this: ArgBuilder<C & {
734
- readonly argKind: "keyValue";
735
- }>, policy: DuplicateKeys): ArgBuilder<C>;
736
- /**
737
- * Validate the resolved value with a Standard Schema v1 validator.
738
- *
739
- * On a single-value builder the validator sees each value; on a builder that
740
- * already aggregates (`.variadic()` or `arg.keyValue()`) it sees the
741
- * completed array or record, after every element passed its own validator.
742
- *
743
- * The builder this is called on is what decides, so where the call sits
744
- * relative to `.variadic()` chooses between the two.
745
- *
746
- * @param schema - A Standard Schema v1 validator.
747
- * @returns The builder (for chaining).
748
- *
749
- * @example
750
- * ```ts
751
- * import { z } from 'zod';
752
- * arg.string().standard(z.string().min(1)).variadic() // each element
753
- * arg.string().variadic().standard(z.array(z.string())) // the whole array
754
- * ```
755
- */
756
- standard(schema: StandardSchemaV1): ArgBuilder<C>;
757
- /**
758
- * Let this arg read its value from piped stdin.
759
- *
760
- * An explicit `-` in the arg's slot is CLI-sourced with bytes from stdin and
761
- * keeps CLI precedence. An absent positional takes the stdin fallback stage,
762
- * which sits between CLI and env, so an arg set in the environment still
763
- * reads stdin and stdin wins. The whole buffer becomes the value, byte for
764
- * byte for a string arg; every other kind drops the single line terminator a
765
- * pipe appends before decoding, and `{ trim: true }` drops it for a string
766
- * arg too.
767
- *
768
- * On an arg that aggregates, a `-` among the tail tokens splices what the
769
- * buffer decodes to into that position, so `mycli build a - b` over
770
- * `'x\ny\n'` collects `['a', 'x', 'y', 'b']`. Each `-` stands for the whole
771
- * source, so two of them splice the buffer twice. A `-` typed beside other
772
- * tokens with nothing piped fails with `MISSING_STDIN`; a tail of nothing but
773
- * `-` falls through to the later sources.
774
- *
775
- * A stdin-enabled arg cannot receive a literal `-` as its value, since the
776
- * token names the source.
777
- *
778
- * One command may declare a single exclusive stdin consumer; pass
779
- * `{ consume: 'broadcast' }` on every input that should share the buffer.
780
- *
781
- * @param options - When to read stdin, how to share it, and whether to trim.
782
- * @returns The builder (for chaining).
783
- *
784
- * @example
785
- * ```ts
786
- * arg.string().describe('Input text').stdin()
787
- * // $ echo "hello" | mycli transform → input = 'hello\n' (from stdin)
788
- * // $ mycli transform - → input reads stdin
789
- * // $ mycli transform "hello" → input = 'hello' (from CLI)
790
- *
791
- * arg.string().stdin({ when: 'dash' })
792
- * // only an explicit `-` reads stdin
793
- *
794
- * arg.path({ mustExist: true }).stdin({ trim: true })
795
- * // $ echo ./dist | mycli clean → path = './dist', checked on disk
796
- * ```
797
- */
798
- stdin(options?: StdinOptions): ArgBuilder<WithoutArgElementEligibility<C>>;
799
- /**
800
- * Bind to an environment variable.
801
- *
802
- * When the arg is not provided on the CLI or by stdin, the resolver checks
803
- * this env var before config, prompt, and the default value. The env string
804
- * is coerced to the arg's declared kind (passthrough for strings, parsed
805
- * for numbers, run through `parseFn` for custom args).
806
- *
807
- * Resolution order when extra sources are configured:
808
- * **CLI → stdin → env → config → prompt → default**.
809
- *
810
- * Help output shows `[env: VAR]` next to the arg description.
811
- *
812
- * @param varName - Environment variable name (e.g. `'DEPLOY_TARGET'`).
813
- * @returns The builder (for chaining).
814
- *
815
- * @example
816
- * ```ts
817
- * command('deploy')
818
- * .arg('target', arg.string().env('DEPLOY_TARGET').describe('Deploy target'))
819
- * .arg('port', arg.number().env('PORT').default(3000))
820
- * .action(({ args }) => {
821
- * console.log(args.target); // from CLI, $DEPLOY_TARGET, or error
822
- * console.log(args.port); // from CLI, $PORT, or 3000
823
- * });
824
- * ```
825
- */
826
- env(varName: string): ArgBuilder<WithoutArgElementEligibility<C>>;
827
- /**
828
- * Bind to a dotted config path.
829
- *
830
- * The config value is read after CLI, stdin, and env, and is coerced to the
831
- * arg's declared kind the same way a flag's config value is.
832
- *
833
- * @param path - Dotted config key (e.g. `'deploy.region'`).
834
- * @returns The builder (for chaining).
835
- *
836
- * @example
837
- * ```ts
838
- * arg.string().config('deploy.region').default('us-east-1')
839
- * // Config file: { "deploy": { "region": "eu-west-1" } }
840
- * // $ mycli deploy → region = 'eu-west-1'
841
- * // $ mycli deploy ap-south-1 → CLI positional wins
842
- * ```
843
- */
844
- config(path: string): ArgBuilder<WithoutArgElementEligibility<C>>;
845
- /**
846
- * Attach interactive prompt configuration.
847
- *
848
- * When CLI, stdin, env, and config all produce nothing, the prompt engine
849
- * uses this config to ask the user. In non-interactive contexts the prompt
850
- * is skipped and resolution falls through to the default or the missing-arg
851
- * error.
852
- *
853
- * The compatible kinds follow the value and the cardinality: a variadic arg
854
- * takes the `multiselect` a `flag.array()` takes, and every other arg takes
855
- * what its kind takes on the flag surface.
856
- *
857
- * @param config - {@link PromptConfig} describing the interactive prompt.
858
- * @returns The builder (for chaining).
859
- *
860
- * @example
861
- * ```ts
862
- * arg.string().prompt({ kind: 'input', message: 'Target:' })
863
- * // $ mycli deploy → prompts "Target:"
864
- * // $ mycli deploy production → skips the prompt
865
- *
866
- * arg.string().variadic().prompt({ kind: 'multiselect', message: 'Targets:' })
867
- * ```
868
- */
869
- prompt(config: AllowedArgPromptConfig<C>): ArgBuilder<WithoutArgElementEligibility<C>>;
870
- /**
871
- * Human-readable description shown in help output.
872
- *
873
- * @param description - Text displayed next to the arg in `--help`.
874
- * @returns The builder (for chaining).
875
- *
876
- * @example
877
- * ```ts
878
- * arg.string().describe('Deploy target')
879
- *
880
- * // Help output:
881
- * // Arguments:
882
- * // <target> Deploy target
883
- * ```
884
- */
885
- describe(description: string): ArgBuilder<WithoutArgElementEligibility<C>>;
886
- /**
887
- * Mark this arg as deprecated.
888
- *
889
- * When used, a warning is emitted to stderr. Help text shows
890
- * `[deprecated]` or `[deprecated: <reason>]`.
891
- *
892
- * Does not change the arg's type-level config — it's metadata only.
893
- *
894
- * @param message - Optional migration reason/guidance.
895
- * @returns The builder (for chaining).
896
- *
897
- * @example
898
- * ```ts
899
- * arg.string().deprecated() // generic
900
- * arg.string().deprecated('use --target flag instead') // with guidance
901
- *
902
- * // Help output:
903
- * // Arguments:
904
- * // <target> Deploy target [deprecated: use --target flag instead]
905
- * ```
906
- */
907
- deprecated(message?: string): ArgBuilder<WithoutArgElementEligibility<C>>;
908
- /**
909
- * Require an integer value. Composes with other numeric constraints.
910
- *
911
- * @param value - Whether to require an integer.
912
- * @defaultValue `true`
913
- * @returns The builder (for chaining).
914
- *
915
- * @example
916
- * ```ts
917
- * arg.number().int() // rejects 3.7, accepts 3
918
- * arg.number({ int: true }).int(false) // re-allows non-integers
919
- * ```
920
- */
921
- int(this: ArgBuilder<C & {
922
- readonly argKind: "number";
923
- }>, value?: boolean): ArgBuilder<C>;
924
- /**
925
- * Set an inclusive lower bound. Composes with other numeric constraints;
926
- * a later call overrides an earlier `min` (including one from the options
927
- * object).
928
- *
929
- * @param value - Inclusive minimum.
930
- * @returns The builder (for chaining).
931
- *
932
- * @example
933
- * ```ts
934
- * arg.number().min(0) // rejects -1, accepts 0
935
- * arg.number({ min: 0 }).min(5) // effective min is 5
936
- * ```
937
- */
938
- min(this: ArgBuilder<C & {
939
- readonly argKind: "number";
940
- }>, value: number): ArgBuilder<C>;
941
- /**
942
- * Set an inclusive upper bound. Composes with other numeric constraints;
943
- * a later call overrides an earlier `max`.
944
- *
945
- * @param value - Inclusive maximum.
946
- * @returns The builder (for chaining).
947
- *
948
- * @example
949
- * ```ts
950
- * arg.number().max(100) // rejects 101, accepts 100
951
- * ```
952
- */
953
- max(this: ArgBuilder<C & {
954
- readonly argKind: "number";
955
- }>, value: number): ArgBuilder<C>;
956
- /**
957
- * Require (or, with `false`, allow) a finite value. Finiteness is enforced
958
- * by default, so this is mainly used as `.finite(false)` to re-allow
959
- * `Infinity` / `-Infinity`.
960
- *
961
- * @param allow - Whether to require a finite value.
962
- * @defaultValue `true`
963
- * @returns The builder (for chaining).
964
- *
965
- * @example
966
- * ```ts
967
- * arg.number().finite(false) // accepts Infinity
968
- * ```
969
- */
970
- finite(this: ArgBuilder<C & {
971
- readonly argKind: "number";
972
- }>, allow?: boolean): ArgBuilder<C>;
973
- /**
974
- * Reject empty strings. Composes with other string constraints.
975
- *
976
- * @param value - Whether to reject empty strings.
977
- * @defaultValue `true`
978
- * @returns The builder (for chaining).
979
- *
980
- * @example
981
- * ```ts
982
- * arg.string().nonEmpty() // rejects '', accepts 'x'
983
- * ```
984
- */
985
- nonEmpty(this: ArgBuilder<C & {
986
- readonly argKind: "string";
987
- }>, value?: boolean): ArgBuilder<C>;
988
- /**
989
- * Set an inclusive minimum length (UTF-16 code units). Composes with other
990
- * string constraints; a later call overrides an earlier `minLength`.
991
- *
992
- * @param value - Inclusive minimum length.
993
- * @returns The builder (for chaining).
994
- *
995
- * @example
996
- * ```ts
997
- * arg.string().minLength(3) // rejects 'ab', accepts 'abc'
998
- * ```
999
- */
1000
- minLength(this: ArgBuilder<C & {
1001
- readonly argKind: "string";
1002
- }>, value: number): ArgBuilder<C>;
1003
- /**
1004
- * Set an inclusive maximum length (UTF-16 code units). Composes with other
1005
- * string constraints; a later call overrides an earlier `maxLength`.
1006
- *
1007
- * @param value - Inclusive maximum length.
1008
- * @returns The builder (for chaining).
1009
- *
1010
- * @example
1011
- * ```ts
1012
- * arg.string().maxLength(8) // rejects 9+ chars
1013
- * ```
1014
- */
1015
- maxLength(this: ArgBuilder<C & {
1016
- readonly argKind: "string";
1017
- }>, value: number): ArgBuilder<C>;
1018
- /**
1019
- * Require the value to match a regular expression. Anchor with `^`/`$`
1020
- * for full-string matching. Composes with other string constraints.
1021
- *
1022
- * @param value - Pattern the value must match.
1023
- * @returns The builder (for chaining).
1024
- *
1025
- * @example
1026
- * ```ts
1027
- * arg.string().pattern(/^ghp_/) // rejects 'abc', accepts 'ghp_x'
1028
- * ```
1029
- */
1030
- pattern(this: ArgBuilder<C & {
1031
- readonly argKind: "string";
1032
- }>, value: RegExp): ArgBuilder<C>;
1033
- }
1034
- /**
1035
- * Arg factory functions — the public API for creating positional arguments.
1036
- *
1037
- * Each method returns an {@linkcode ArgBuilder} seeded with the correct {@linkcode ArgKind}
1038
- * and initial type-level config. Chain modifiers (`.optional()`, `.env()`,
1039
- * `.config()`, `.prompt()`, `.default()`, `.variadic()`, `.stdin()`,
1040
- * `.describe()`, `.deprecated()`) to refine.
1041
- *
1042
- * All args are **required** by default. Resolution order when extra
1043
- * sources are configured: **CLI → stdin → env → config → prompt → default**.
1044
- *
1045
- * @example Overview of common kinds with common modifier patterns
1046
- * ```ts
1047
- * command('process')
1048
- * // String arg with env fallback
1049
- * .arg('input', arg.string()
1050
- * .env('INPUT_FILE')
1051
- * .describe('Input file path'))
1052
- *
1053
- * // Number arg with env + default
1054
- * .arg('concurrency', arg.number()
1055
- * .env('CONCURRENCY')
1056
- * .default(4)
1057
- * .describe('Worker threads'))
1058
- *
1059
- * // Custom arg — hex color parser with env
1060
- * .arg('color', arg.custom((raw) => {
1061
- * if (!/^#?[0-9a-f]{6}$/i.test(raw)) throw new Error('bad hex');
1062
- * return raw.startsWith('#') ? raw : `#${raw}`;
1063
- * })
1064
- * .env('THEME_COLOR')
1065
- * .optional()
1066
- * .describe('Theme color (hex)'))
1067
- *
1068
- * .action(({ args }) => {
1069
- * args.input; // string (required)
1070
- * args.concurrency; // number (defaulted)
1071
- * args.color; // string | undefined (optional custom)
1072
- * });
1073
- * ```
1074
- */
1075
- interface ArgFactory {
1076
- /**
1077
- * String-valued positional argument, with optional string constraints.
1078
- * Required by default.
1079
- *
1080
- * Constraints are enforced at the parse and resolution boundaries, in
1081
- * fixed order: nonEmpty → minLength → maxLength → pattern. A `.default()`
1082
- * value is validated against them where the chain declares it. They also
1083
- * compose via chained methods (`.nonEmpty()`, `.minLength()`,
1084
- * `.maxLength()`, `.pattern()`), which override values set here.
1085
- *
1086
- * @param constraints - Optional string constraints.
1087
- * @defaultValue `undefined` (no constraints)
1088
- * @returns A required string {@link ArgBuilder}.
1089
- *
1090
- * @example
1091
- * ```ts
1092
- * arg.string() // required string
1093
- * arg.string().optional() // string | undefined
1094
- * arg.string().env('TARGET') // falls back to $TARGET
1095
- * arg.string().default('production') // always present
1096
- * arg.string({ nonEmpty: true }) // rejects ''
1097
- * arg.string({ pattern: /^ghp_/ }) // token shapes
1098
- *
1099
- * // In a command:
1100
- * command('deploy')
1101
- * .arg('target', arg.string().env('DEPLOY_TARGET').describe('Deploy target'))
1102
- * ```
1103
- */
1104
- string(constraints?: StringConstraints): ArgBuilder<{
1105
- readonly valueType: string;
1106
- readonly presence: "required";
1107
- readonly variadic: false;
1108
- readonly argKind: "string";
1109
- readonly elementEligible: true;
1110
- }>;
1111
- /**
1112
- * Number-valued positional argument. Required by default.
1113
- *
1114
- * The parser coerces the raw CLI string to a number and emits a
1115
- * `ParseError` if conversion fails. Env values are coerced the same way.
1116
- *
1117
- * @example
1118
- * ```ts
1119
- * arg.number() // required number
1120
- * arg.number().default(8080) // defaults to 8080
1121
- * arg.number().env('PORT') // falls back to $PORT (coerced)
1122
- *
1123
- * // In a command:
1124
- * command('serve')
1125
- * .arg('port', arg.number().env('PORT').default(3000).describe('Port'))
1126
- * // $ mycli serve 8080 → 8080
1127
- * // $ PORT=9090 mycli serve → 9090
1128
- * // $ mycli serve → 3000
1129
- * ```
1130
- *
1131
- * Constraints are enforced at the parse and resolution boundaries and also
1132
- * compose via chained methods (`.int()`, `.min()`, `.max()`, `.finite()`),
1133
- * which override values set here. The resolved value type stays `number`.
1134
- *
1135
- * @param constraints - Optional numeric constraints. `finite` defaults to
1136
- * `true`, so `Infinity` / `-Infinity` are rejected unless `finite: false`.
1137
- * @defaultValue `undefined` (finite-only, no bounds, non-integer allowed)
1138
- * @returns A required number {@link ArgBuilder}.
1139
- */
1140
- number(constraints?: NumberConstraints): ArgBuilder<{
1141
- readonly valueType: number;
1142
- readonly presence: "required";
1143
- readonly variadic: false;
1144
- readonly argKind: "number";
1145
- readonly elementEligible: true;
1146
- }>;
1147
- /**
1148
- * Boolean positional argument. Required by default.
1149
- *
1150
- * A positional carries no presence semantics, so the token spells the value
1151
- * out: `true`/`false` or `1`/`0` from argv, and also `yes`/`no` or an empty
1152
- * string from env, config, stdin, and a prompt.
1153
- *
1154
- * @returns A required boolean {@link ArgBuilder}.
1155
- *
1156
- * @example
1157
- * ```ts
1158
- * command('feature')
1159
- * .arg('enabled', arg.boolean().describe('Whether the feature is on'))
1160
- * // $ mycli feature true → enabled = true
1161
- * // $ mycli feature nope → ParseError: Invalid boolean value 'nope'
1162
- * ```
1163
- */
1164
- boolean(): ArgBuilder<{
1165
- readonly valueType: boolean;
1166
- readonly presence: "required";
1167
- readonly variadic: false;
1168
- readonly argKind: "boolean";
1169
- readonly elementEligible: true;
1170
- }>;
1171
- /**
1172
- * Key-value positional argument. Required by default.
1173
- *
1174
- * Consumes `KEY=VALUE` tokens and resolves to a record, split at the
1175
- * **first** `=`. The non-variadic form reads one token, the variadic form
1176
- * aggregates the whole tail. Later occurrences of the same key win, which
1177
- * `.duplicateKeys()` changes. Not promptable.
1178
- *
1179
- * An element builder gives each entry value its own codec, constraints, and
1180
- * checks, so `arg.keyValue(arg.path())` checks every value on disk.
1181
- *
1182
- * @param element - {@link ArgBuilder} describing the value of each entry.
1183
- * @defaultValue an unconstrained string element
1184
- * @returns A required key-value {@link ArgBuilder} for records of the element type.
1185
- *
1186
- * @example
1187
- * ```ts
1188
- * command('run')
1189
- * .arg('vars', arg.keyValue().variadic().describe('Template variables'))
1190
- * // $ mycli run A=1 B=2 → vars = { A: '1', B: '2' }
1191
- *
1192
- * command('scale')
1193
- * .arg('replicas', arg.keyValue(arg.number().int().min(0)).variadic())
1194
- * // $ mycli scale web=3 api=2 → replicas = { web: 3, api: 2 }
1195
- * ```
1196
- */
1197
- keyValue<E extends ArgConfig & {
1198
- readonly elementEligible: true;
1199
- } = StringArgElementConfig>(element?: ArgBuilder<E>): ArgBuilder<{
1200
- readonly valueType: Record<string, E["valueType"]>;
1201
- readonly presence: "required";
1202
- readonly variadic: false;
1203
- readonly argKind: "keyValue";
1204
- readonly elementEligible: false;
1205
- }>;
1206
- /**
1207
- * Enum-valued positional argument. Required by default.
1208
- *
1209
- * Accepts only the listed string literals. The inferred type is the
1210
- * union of those literals (e.g. `'us' | 'eu' | 'ap'`), not `string`.
1211
- * Invalid values produce a `ParseError` listing allowed options.
1212
- *
1213
- * @param values - Non-empty tuple of allowed string values.
1214
- * @returns A required enum {@link ArgBuilder} typed to the union of `values`.
1215
- *
1216
- * @example
1217
- * ```ts
1218
- * arg.enum(['us', 'eu', 'ap']) // required, 'us' | 'eu' | 'ap'
1219
- * arg.enum(['dev', 'prod']).default('dev') // defaulted
1220
- * arg.enum(['json', 'csv']).optional() // 'json' | 'csv' | undefined
1221
- *
1222
- * // In a command:
1223
- * command('deploy')
1224
- * .arg('region', arg.enum(['us', 'eu', 'ap']).env('REGION').describe('Target region'))
1225
- * // $ mycli deploy us → 'us'
1226
- * // $ mycli deploy invalid → ParseError: Allowed: us, eu, ap
1227
- * ```
1228
- */
1229
- enum<const T extends readonly [string, ...string[]]>(values: T): ArgBuilder<{
1230
- readonly valueType: T[number];
1231
- readonly presence: "required";
1232
- readonly variadic: false;
1233
- readonly argKind: "enum";
1234
- readonly elementEligible: true;
1235
- }>;
1236
- /**
1237
- * Custom positional argument validated by a Standard Schema v1 validator
1238
- * (zod, valibot, arktype, …). The resolved value from any source is
1239
- * validated after resolution; the arg's value type is the validator's
1240
- * output type.
1241
- *
1242
- * Sync and async validators are both supported. Validation issues surface
1243
- * as a `CONSTRAINT_VIOLATED` error naming the argument.
1244
- *
1245
- * @example
1246
- * ```ts
1247
- * import { z } from 'zod';
1248
- * arg.custom(z.string().uuid())
1249
- * // inferred type: string
1250
- * ```
1251
- *
1252
- * @param schema - A Standard Schema v1 validator.
1253
- * @returns A required custom {@link ArgBuilder} typed to the validator's output.
1254
- */
1255
- custom<S extends StandardSchemaV1>(schema: S): ArgBuilder<{
1256
- readonly valueType: InferStandardOutput<S>;
1257
- readonly presence: "required";
1258
- readonly variadic: false;
1259
- readonly argKind: "custom";
1260
- readonly elementEligible: true;
1261
- }>;
1262
- /**
1263
- * Custom-parsed positional argument. Required by default.
1264
- *
1265
- * The parse function receives the raw string and must return a value of
1266
- * type `T`. Throw an `Error` (or `ParseError`) to signal invalid input.
1267
- * The same parse function is used for both CLI and env values.
1268
- *
1269
- * @param parseFn - Converts the raw CLI string to `T`.
1270
- * @returns A required custom {@link ArgBuilder} typed to the return of `parseFn`.
1271
- *
1272
- * @example
1273
- * ```ts
1274
- * arg.custom((raw) => Number.parseInt(raw, 16))
1275
- * // inferred type: number
1276
- *
1277
- * // In a command — parse hex color from CLI or $COLOR:
1278
- * command('theme')
1279
- * .arg('color', arg.custom((raw) => {
1280
- * if (!/^[0-9a-f]{6}$/i.test(raw)) throw new Error('Expected 6-digit hex');
1281
- * return `#${raw}`;
1282
- * }).env('COLOR').describe('Hex color code'))
1283
- * // $ mycli theme ff6600 → '#ff6600'
1284
- * // $ COLOR=aabbcc mycli theme → '#aabbcc'
1285
- * ```
1286
- */
1287
- custom<T>(parseFn: ArgParseFn<T>): ArgBuilder<{
1288
- readonly valueType: T;
1289
- readonly presence: "required";
1290
- readonly variadic: false;
1291
- readonly argKind: "custom";
1292
- readonly elementEligible: true;
1293
- }>;
1294
- /**
1295
- * URL-valued positional argument. Parses into a `URL`; invalid URLs are
1296
- * rejected with an `INVALID_VALUE` error naming the argument.
1297
- *
1298
- * @param options - Optional protocol allowlist (without trailing colon).
1299
- * @returns A required `URL` {@link ArgBuilder}.
1300
- *
1301
- * @example
1302
- * ```ts
1303
- * arg.url() // any URL
1304
- * arg.url({ protocols: ['https'] }) // https only
1305
- *
1306
- * // In a command:
1307
- * command('fetch')
1308
- * .arg('endpoint', arg.url().env('API_URL').describe('Service endpoint'))
1309
- * ```
1310
- */
1311
- url(options?: UrlFlagOptions): ArgBuilder<{
1312
- readonly valueType: URL;
1313
- readonly presence: "required";
1314
- readonly variadic: false;
1315
- readonly argKind: "custom";
1316
- readonly elementEligible: true;
1317
- }>;
1318
- /**
1319
- * Path-valued positional argument. The value stays a `string`; optional
1320
- * filesystem checks run **after resolution** through the runtime adapter,
1321
- * so CLI, stdin, env, and defaulted values are all validated.
1322
- *
1323
- * A variadic path arg checks every value it collects. Help renders a
1324
- * positional by its own name, so the `'path'` value hint on the schema does
1325
- * not reach the usage line.
1326
- *
1327
- * @param options - Optional existence/type checks. `type` implies
1328
- * existence unless `mustExist` is explicitly `false`.
1329
- * @returns A required path-string {@link ArgBuilder}.
1330
- *
1331
- * @example
1332
- * ```ts
1333
- * arg.path() // any string
1334
- * arg.path({ mustExist: true }) // rejects missing paths
1335
- * arg.path({ type: 'directory' }) // must exist and be a directory
1336
- * arg.path({ type: 'directory', create: true })
1337
- * // created recursively when missing
1338
- * ```
1339
- */
1340
- path(options?: PathFlagOptions): ArgBuilder<{
1341
- readonly valueType: string;
1342
- readonly presence: "required";
1343
- readonly variadic: false;
1344
- readonly argKind: "string";
1345
- readonly elementEligible: true;
1346
- }>;
1347
- /**
1348
- * Date-valued positional argument. Accepts strict ISO-8601 (`2026-07-10`,
1349
- * `2026-07-10T14:30:00Z`) and parses into a `Date`. Lenient `Date.parse`
1350
- * inputs (`'0'`, `'March 5'`) and calendar-invalid dates (`2026-02-31`)
1351
- * are rejected.
1352
- *
1353
- * Returns `Date` (not `Temporal`) because the supported runtimes do not
1354
- * all ship Temporal yet; use `arg.custom()` with `Temporal.PlainDate.from`
1355
- * where the target runtime has it.
1356
- *
1357
- * @param options - Optional inclusive `min`/`max` date bounds.
1358
- * @returns A required `Date` {@link ArgBuilder}.
1359
- *
1360
- * @example
1361
- * ```ts
1362
- * arg.date()
1363
- * arg.date({ min: new Date('2020-01-01') })
1364
- * ```
1365
- */
1366
- date(options?: DateFlagOptions): ArgBuilder<{
1367
- readonly valueType: Date;
1368
- readonly presence: "required";
1369
- readonly variadic: false;
1370
- readonly argKind: "custom";
1371
- readonly elementEligible: true;
1372
- }>;
1373
- /**
1374
- * Duration positional argument. Accepts `'30s'`, `'5m'`, `'1.5h'`,
1375
- * `'250ms'`, `'2d'`, compounds like `'1h30m'`, or a bare millisecond
1376
- * count, and resolves to **milliseconds**.
1377
- *
1378
- * @returns A required duration {@link ArgBuilder} in milliseconds.
1379
- *
1380
- * @example
1381
- * ```ts
1382
- * arg.duration().default(30_000) // `mycli wait 45s` → 45000
1383
- * ```
1384
- */
1385
- duration(): ArgBuilder<{
1386
- readonly valueType: number;
1387
- readonly presence: "required";
1388
- readonly variadic: false;
1389
- readonly argKind: "custom";
1390
- readonly elementEligible: true;
1391
- }>;
1392
- /**
1393
- * Byte-size positional argument. Accepts `'512mb'`, `'1.5gb'`, `'64kb'`,
1394
- * `'100b'` or a bare byte count, and resolves to **bytes**. Units are
1395
- * binary (`1kb` = 1024) and case-insensitive.
1396
- *
1397
- * @returns A required size {@link ArgBuilder} in bytes.
1398
- *
1399
- * @example
1400
- * ```ts
1401
- * arg.bytes().default(10 * 1024 ** 2) // `mycli split 512kb` → 524288
1402
- * ```
1403
- */
1404
- bytes(): ArgBuilder<{
1405
- readonly valueType: number;
1406
- readonly presence: "required";
1407
- readonly variadic: false;
1408
- readonly argKind: "custom";
1409
- readonly elementEligible: true;
1410
- }>;
1411
- }
1412
- /**
1413
- * Positional argument schema factory.
1414
- *
1415
- * Entry point for defining args on a command. Use `arg.<kind>()` to create
1416
- * an {@linkcode ArgBuilder}, then chain modifiers and pass the result to
1417
- * `command().arg(name, builder)`.
1418
- *
1419
- * Six base kinds are available:
1420
- * - `arg.string()` — raw string (most common)
1421
- * - `arg.number()` — parsed to number, errors on NaN
1422
- * - `arg.boolean()` reads an explicit true/false token
1423
- * - `arg.enum(values)` — constrained to listed literals
1424
- * - `arg.keyValue()` merges `KEY=VALUE` tokens into a record
1425
- * - `arg.custom(fn)` — arbitrary parse function, infers return type
1426
- *
1427
- * Five sugar factories build on them, mirroring their flag counterparts:
1428
- * - `arg.url()` parses to `URL`, with an optional protocol allowlist
1429
- * - `arg.path()` keeps the string and adds optional filesystem checks
1430
- * - `arg.date()` parses strict ISO-8601 to `Date`
1431
- * - `arg.duration()` resolves `'1h30m'` and friends to milliseconds
1432
- * - `arg.bytes()` resolves `'512mb'` and friends to bytes
1433
- *
1434
- * @example
1435
- * ```ts
1436
- * import { command, arg } from '@kjanat/dreamcli';
1437
- *
1438
- * command('deploy')
1439
- * .arg('target', arg.string().env('DEPLOY_TARGET').describe('Where to deploy'))
1440
- * .arg('port', arg.number().env('PORT').default(3000))
1441
- * .action(({ args }) => {
1442
- * console.log(`Deploying to ${args.target} on port ${args.port}`);
1443
- * });
1444
- *
1445
- * // $ mycli deploy production 8080 → target='production', port=8080
1446
- * // $ DEPLOY_TARGET=staging mycli deploy → target='staging', port=3000
1447
- * ```
1448
- */
1449
- declare const arg: ArgFactory;
1450
- //#endregion
1451
- export { ARG_KINDS, ARG_PRESENCES, type AllowedArgPromptConfig, ArgBuilder, type ArgConfig, type ArgDefaultValue, type ArgDefinition, type ArgDefinitionBase, type ArgDefinitionByKind, type ArgDefinitionOverrides, type ArgFactory, type ArgKind, type ArgParseFn, type ArgPresence, type ArgSchema, type BooleanArgDefinition, type CustomArgDefinition, type DuplicateKeys, type EnumArgDefinition, type InferArg, type InferArgs, type KeyValueArgDefinition, type NumberArgDefinition, type PromptConfigByArgKind, type ResolvedArgValue, type SourceSplitBinding, type SplitBinding, type SplitFormat, type SplitOptions, type SplitPolicy, type SplitSetting, type StdinBinding, type StdinConsume, type StdinOptions, type StdinWhen, type StringArgDefinition, type StringArgElementConfig, type WithArgPresence, type WithVariadic, type WithoutArgElementEligibility, arg, createArgSchema };