@flowscripter/dynamic-cli-framework 1.7.5 → 2.1.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 (514) hide show
  1. package/README.md +3 -0
  2. package/cli-plugin.ts +1 -104
  3. package/dist/cli-plugin.d.ts +1 -58
  4. package/dist/cli-plugin.d.ts.map +1 -1
  5. package/dist/cli-plugin.js +1 -25
  6. package/dist/index.d.ts +70 -69
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +27 -26
  9. package/dist/src/cli/BaseCLI.d.ts +13 -7
  10. package/dist/src/cli/BaseCLI.d.ts.map +1 -1
  11. package/dist/src/cli/BaseCLI.js +33 -7
  12. package/dist/src/{api → cli}/BaseCLIFeatureOptions.d.ts.map +1 -1
  13. package/dist/src/cli/DefaultRuntimeCLI.d.ts +7 -3
  14. package/dist/src/cli/DefaultRuntimeCLI.d.ts.map +1 -1
  15. package/dist/src/cli/DefaultRuntimeCLI.js +29 -1
  16. package/dist/src/cli/DynamicPluginRuntimeCLI.d.ts +3 -3
  17. package/dist/src/cli/DynamicPluginRuntimeCLI.d.ts.map +1 -1
  18. package/dist/src/cli/DynamicPluginRuntimeCLI.js +3 -3
  19. package/dist/src/command/MultiCommandCliHelpCommand.d.ts +7 -7
  20. package/dist/src/command/MultiCommandCliHelpCommand.d.ts.map +1 -1
  21. package/dist/src/command/MultiCommandCliHelpCommand.js +3 -3
  22. package/dist/src/command/SingleCommandCliHelpCommand.d.ts +6 -6
  23. package/dist/src/command/SingleCommandCliHelpCommand.d.ts.map +1 -1
  24. package/dist/src/command/SingleCommandCliHelpCommand.js +2 -2
  25. package/dist/src/command/UsageCommand.d.ts +3 -3
  26. package/dist/src/command/UsageCommand.d.ts.map +1 -1
  27. package/dist/src/command/UsageCommand.js +1 -1
  28. package/dist/src/command/VersionCommand.d.ts +2 -2
  29. package/dist/src/command/VersionCommand.d.ts.map +1 -1
  30. package/dist/src/command/VersionCommand.js +1 -1
  31. package/dist/src/launcher.d.ts +2 -5
  32. package/dist/src/launcher.d.ts.map +1 -1
  33. package/dist/src/runtime/DefaultContext.d.ts +2 -2
  34. package/dist/src/runtime/DefaultContext.d.ts.map +1 -1
  35. package/dist/src/runtime/argument/ArgumentTypeGuards.d.ts +2 -2
  36. package/dist/src/runtime/argument/ArgumentTypeGuards.d.ts.map +1 -1
  37. package/dist/src/runtime/command/CommandTypeGuards.d.ts +5 -5
  38. package/dist/src/runtime/command/CommandTypeGuards.d.ts.map +1 -1
  39. package/dist/src/runtime/command/CommandValidator.d.ts +2 -2
  40. package/dist/src/runtime/command/CommandValidator.d.ts.map +1 -1
  41. package/dist/src/runtime/command/CommandValidator.js +1 -1
  42. package/dist/src/runtime/parser.d.ts +3 -32
  43. package/dist/src/runtime/parser.d.ts.map +1 -1
  44. package/dist/src/runtime/registry/DefaultCommandRegistry.d.ts +6 -6
  45. package/dist/src/runtime/registry/DefaultCommandRegistry.d.ts.map +1 -1
  46. package/dist/src/runtime/registry/DefaultServiceProviderRegistry.d.ts +2 -2
  47. package/dist/src/runtime/registry/DefaultServiceProviderRegistry.d.ts.map +1 -1
  48. package/dist/src/runtime/runner.d.ts +5 -5
  49. package/dist/src/runtime/runner.d.ts.map +1 -1
  50. package/dist/src/runtime/runner.js +2 -2
  51. package/dist/src/runtime/scanner.d.ts +4 -4
  52. package/dist/src/runtime/scanner.d.ts.map +1 -1
  53. package/dist/src/runtime/values/ValuePopulationResult.d.ts +2 -2
  54. package/dist/src/runtime/values/ValuePopulationResult.d.ts.map +1 -1
  55. package/dist/src/runtime/values/argumentValueMerge.d.ts +1 -1
  56. package/dist/src/runtime/values/argumentValueMerge.d.ts.map +1 -1
  57. package/dist/src/runtime/values/argumentValueMerge.js +2 -2
  58. package/dist/src/runtime/values/argumentValueValidation.d.ts +6 -6
  59. package/dist/src/runtime/values/argumentValueValidation.d.ts.map +1 -1
  60. package/dist/src/runtime/values/argumentValueValidation.js +2 -2
  61. package/dist/src/runtime/values/globalCommandValuePopulation.d.ts +2 -2
  62. package/dist/src/runtime/values/globalCommandValuePopulation.d.ts.map +1 -1
  63. package/dist/src/runtime/values/globalCommandValuePopulation.js +2 -2
  64. package/dist/src/runtime/values/subCommandValuePopulation.d.ts +2 -2
  65. package/dist/src/runtime/values/subCommandValuePopulation.d.ts.map +1 -1
  66. package/dist/src/runtime/values/subCommandValuePopulation.js +4 -4
  67. package/dist/src/service/argumentPrompter/ArgumentPrompterServiceProvider.d.ts +4 -4
  68. package/dist/src/service/argumentPrompter/ArgumentPrompterServiceProvider.d.ts.map +1 -1
  69. package/dist/src/service/argumentPrompter/ArgumentPrompterServiceProvider.js +1 -1
  70. package/dist/src/service/argumentPrompter/DefaultArgumentPrompterService.d.ts +2 -2
  71. package/dist/src/service/argumentPrompter/DefaultArgumentPrompterService.d.ts.map +1 -1
  72. package/dist/src/service/argumentPrompter/DefaultArgumentPrompterService.js +3 -3
  73. package/dist/src/service/asciiBannerGenerator/AsciiBannerGeneratorServiceProvider.d.ts +3 -3
  74. package/dist/src/service/asciiBannerGenerator/AsciiBannerGeneratorServiceProvider.d.ts.map +1 -1
  75. package/dist/src/service/asciiBannerGenerator/AsciiBannerGeneratorServiceProvider.js +1 -1
  76. package/dist/src/service/asciiBannerGenerator/DefaultAsciiBannerGeneratorService.d.ts +2 -2
  77. package/dist/src/service/asciiBannerGenerator/DefaultAsciiBannerGeneratorService.d.ts.map +1 -1
  78. package/dist/src/service/banner/BannerServiceProvider.d.ts +3 -3
  79. package/dist/src/service/banner/BannerServiceProvider.d.ts.map +1 -1
  80. package/dist/src/service/banner/BannerServiceProvider.js +2 -2
  81. package/dist/src/service/banner/command/NoBannerCommand.d.ts +4 -4
  82. package/dist/src/service/banner/command/NoBannerCommand.d.ts.map +1 -1
  83. package/dist/src/service/banner/command/NoBannerCommand.js +1 -1
  84. package/dist/src/service/chiselAsciiBannerGenerator/ChiselFontAsciiBannerGeneratorService.d.ts +2 -2
  85. package/dist/src/service/chiselAsciiBannerGenerator/ChiselFontAsciiBannerGeneratorService.d.ts.map +1 -1
  86. package/dist/src/service/completion/CompletionServiceProvider.d.ts +5 -5
  87. package/dist/src/service/completion/CompletionServiceProvider.d.ts.map +1 -1
  88. package/dist/src/service/completion/CompletionServiceProvider.js +6 -6
  89. package/dist/src/service/completion/DefaultCompletionService.d.ts +3 -3
  90. package/dist/src/service/completion/DefaultCompletionService.d.ts.map +1 -1
  91. package/dist/src/service/completion/DefaultCompletionService.js +1 -1
  92. package/dist/src/service/completion/command/CompletionCompleteSubCommand.d.ts +5 -5
  93. package/dist/src/service/completion/command/CompletionCompleteSubCommand.d.ts.map +1 -1
  94. package/dist/src/service/completion/command/CompletionCompleteSubCommand.js +3 -3
  95. package/dist/src/service/completion/command/CompletionGroupCommand.d.ts +3 -3
  96. package/dist/src/service/completion/command/CompletionGroupCommand.d.ts.map +1 -1
  97. package/dist/src/service/completion/command/CompletionIntegrationSubCommand.d.ts +5 -5
  98. package/dist/src/service/completion/command/CompletionIntegrationSubCommand.d.ts.map +1 -1
  99. package/dist/src/service/completion/command/CompletionIntegrationSubCommand.js +3 -3
  100. package/dist/src/service/completion/shell/ShellHandler.d.ts +1 -1
  101. package/dist/src/service/completion/shell/ShellHandler.d.ts.map +1 -1
  102. package/dist/src/service/completion/shell/bash.d.ts +1 -1
  103. package/dist/src/service/completion/shell/bash.d.ts.map +1 -1
  104. package/dist/src/service/completion/shell/fish.d.ts +1 -1
  105. package/dist/src/service/completion/shell/fish.d.ts.map +1 -1
  106. package/dist/src/service/completion/shell/powershell.d.ts +1 -1
  107. package/dist/src/service/completion/shell/powershell.d.ts.map +1 -1
  108. package/dist/src/service/completion/shell/zsh.d.ts +1 -1
  109. package/dist/src/service/completion/shell/zsh.d.ts.map +1 -1
  110. package/dist/src/service/configuration/ConfigurationServiceProvider.d.ts +5 -5
  111. package/dist/src/service/configuration/ConfigurationServiceProvider.d.ts.map +1 -1
  112. package/dist/src/service/configuration/ConfigurationServiceProvider.js +1 -1
  113. package/dist/src/service/configuration/DefaultKeyValueService.d.ts +1 -1
  114. package/dist/src/service/configuration/DefaultKeyValueService.d.ts.map +1 -1
  115. package/dist/src/service/configuration/DefaultKeyValueService.js +1 -1
  116. package/dist/src/service/configuration/DefaultSecretService.d.ts +1 -1
  117. package/dist/src/service/configuration/DefaultSecretService.d.ts.map +1 -1
  118. package/dist/src/service/configuration/command/ConfigCommand.d.ts +4 -4
  119. package/dist/src/service/configuration/command/ConfigCommand.d.ts.map +1 -1
  120. package/dist/src/service/configuration/command/ConfigCommand.js +1 -1
  121. package/dist/src/service/configuration/command/DumpConfigCommand.d.ts +2 -2
  122. package/dist/src/service/configuration/command/DumpConfigCommand.d.ts.map +1 -1
  123. package/dist/src/service/configuration/command/DumpConfigCommand.js +2 -2
  124. package/dist/src/service/dataDumpGenerator/DataDumpGeneratorServiceProvider.d.ts +3 -3
  125. package/dist/src/service/dataDumpGenerator/DataDumpGeneratorServiceProvider.d.ts.map +1 -1
  126. package/dist/src/service/dataDumpGenerator/DataDumpGeneratorServiceProvider.js +2 -2
  127. package/dist/src/service/dataDumpGenerator/DefaultDataDumpGeneratorService.d.ts +2 -2
  128. package/dist/src/service/dataDumpGenerator/DefaultDataDumpGeneratorService.d.ts.map +1 -1
  129. package/dist/src/service/dataDumpGenerator/DefaultDataDumpGeneratorService.js +1 -1
  130. package/dist/src/service/imagePrinter/DefaultImagePrinterService.d.ts +1 -1
  131. package/dist/src/service/imagePrinter/DefaultImagePrinterService.d.ts.map +1 -1
  132. package/dist/src/service/imagePrinter/ImagePrinterServiceProvider.d.ts +3 -3
  133. package/dist/src/service/imagePrinter/ImagePrinterServiceProvider.d.ts.map +1 -1
  134. package/dist/src/service/imagePrinter/ImagePrinterServiceProvider.js +1 -1
  135. package/dist/src/service/plugin/DefaultPluginService.d.ts +1 -1
  136. package/dist/src/service/plugin/DefaultPluginService.d.ts.map +1 -1
  137. package/dist/src/service/plugin/DefaultPluginServiceProvider.d.ts +3 -3
  138. package/dist/src/service/plugin/DefaultPluginServiceProvider.d.ts.map +1 -1
  139. package/dist/src/service/plugin/DefaultPluginServiceProvider.js +1 -1
  140. package/dist/src/service/plugin/command/PluginAddSubCommand.d.ts +4 -4
  141. package/dist/src/service/plugin/command/PluginAddSubCommand.d.ts.map +1 -1
  142. package/dist/src/service/plugin/command/PluginAddSubCommand.js +3 -3
  143. package/dist/src/service/plugin/command/PluginGroupCommand.d.ts +3 -3
  144. package/dist/src/service/plugin/command/PluginGroupCommand.d.ts.map +1 -1
  145. package/dist/src/service/plugin/command/PluginListSubCommand.d.ts +3 -3
  146. package/dist/src/service/plugin/command/PluginListSubCommand.d.ts.map +1 -1
  147. package/dist/src/service/plugin/command/PluginListSubCommand.js +2 -2
  148. package/dist/src/service/plugin/command/PluginRemoveSubCommand.d.ts +4 -4
  149. package/dist/src/service/plugin/command/PluginRemoveSubCommand.d.ts.map +1 -1
  150. package/dist/src/service/plugin/command/PluginRemoveSubCommand.js +3 -3
  151. package/dist/src/service/plugin/command/PluginSearchSubCommand.d.ts +4 -4
  152. package/dist/src/service/plugin/command/PluginSearchSubCommand.d.ts.map +1 -1
  153. package/dist/src/service/plugin/command/PluginSearchSubCommand.js +3 -3
  154. package/dist/src/service/plugin/command/PluginUpgradeSubCommand.d.ts +3 -3
  155. package/dist/src/service/plugin/command/PluginUpgradeSubCommand.d.ts.map +1 -1
  156. package/dist/src/service/plugin/command/PluginUpgradeSubCommand.js +2 -2
  157. package/dist/src/service/prettyPrinter/DefaultPrettyPrinterService.d.ts +2 -2
  158. package/dist/src/service/prettyPrinter/DefaultPrettyPrinterService.d.ts.map +1 -1
  159. package/dist/src/service/prettyPrinter/PrettyPrinterServiceProvider.d.ts +3 -3
  160. package/dist/src/service/prettyPrinter/PrettyPrinterServiceProvider.d.ts.map +1 -1
  161. package/dist/src/service/prettyPrinter/PrettyPrinterServiceProvider.js +1 -1
  162. package/dist/src/service/printer/DefaultPrinterService.d.ts +7 -2
  163. package/dist/src/service/printer/DefaultPrinterService.d.ts.map +1 -1
  164. package/dist/src/service/printer/DefaultPrinterService.js +65 -3
  165. package/dist/src/service/printer/PrinterServiceProvider.d.ts +4 -4
  166. package/dist/src/service/printer/PrinterServiceProvider.d.ts.map +1 -1
  167. package/dist/src/service/printer/PrinterServiceProvider.js +2 -2
  168. package/dist/src/service/printer/command/DarkModeCommand.d.ts +4 -4
  169. package/dist/src/service/printer/command/DarkModeCommand.d.ts.map +1 -1
  170. package/dist/src/service/printer/command/DarkModeCommand.js +1 -1
  171. package/dist/src/service/printer/command/LogLevelCommand.d.ts +4 -4
  172. package/dist/src/service/printer/command/LogLevelCommand.d.ts.map +1 -1
  173. package/dist/src/service/printer/command/LogLevelCommand.js +2 -2
  174. package/dist/src/service/printer/command/NoColorCommand.d.ts +4 -4
  175. package/dist/src/service/printer/command/NoColorCommand.d.ts.map +1 -1
  176. package/dist/src/service/printer/command/NoColorCommand.js +1 -1
  177. package/dist/src/service/printer/command/NoHyperlinksCommand.d.ts +4 -4
  178. package/dist/src/service/printer/command/NoHyperlinksCommand.d.ts.map +1 -1
  179. package/dist/src/service/printer/command/NoHyperlinksCommand.js +1 -1
  180. package/dist/src/service/printer/terminal/Progress.d.ts +2 -2
  181. package/dist/src/service/printer/terminal/Progress.d.ts.map +1 -1
  182. package/dist/src/service/printer/terminal/Progress.js +2 -2
  183. package/dist/src/service/printer/terminal/Quote.d.ts +10 -0
  184. package/dist/src/service/printer/terminal/Quote.d.ts.map +1 -0
  185. package/dist/src/service/printer/terminal/Quote.js +50 -0
  186. package/dist/src/service/printer/terminal/Spinner.d.ts +2 -2
  187. package/dist/src/service/printer/terminal/Spinner.d.ts.map +1 -1
  188. package/dist/src/service/printer/terminal/Spinner.js +2 -2
  189. package/dist/src/service/prompter/DefaultPrompterService.d.ts +3 -3
  190. package/dist/src/service/prompter/DefaultPrompterService.d.ts.map +1 -1
  191. package/dist/src/service/prompter/DefaultPrompterService.js +1 -1
  192. package/dist/src/service/prompter/PrompterServiceProvider.d.ts +4 -4
  193. package/dist/src/service/prompter/PrompterServiceProvider.d.ts.map +1 -1
  194. package/dist/src/service/prompter/PrompterServiceProvider.js +1 -1
  195. package/dist/src/service/prompter/command/NoPromptCommand.d.ts +4 -4
  196. package/dist/src/service/prompter/command/NoPromptCommand.d.ts.map +1 -1
  197. package/dist/src/service/prompter/command/NoPromptCommand.js +1 -1
  198. package/dist/src/service/prompter/prompt/PromptContext.d.ts +2 -2
  199. package/dist/src/service/prompter/prompt/PromptContext.d.ts.map +1 -1
  200. package/dist/src/service/prompter/prompt/promptAcknowledge.d.ts +1 -1
  201. package/dist/src/service/prompter/prompt/promptAcknowledge.d.ts.map +1 -1
  202. package/dist/src/service/prompter/prompt/promptAcknowledge.js +1 -1
  203. package/dist/src/service/prompter/prompt/promptMultiSelect.d.ts +1 -1
  204. package/dist/src/service/prompter/prompt/promptMultiSelect.d.ts.map +1 -1
  205. package/dist/src/service/prompter/prompt/promptOpenUrl.d.ts +1 -1
  206. package/dist/src/service/prompter/prompt/promptOpenUrl.d.ts.map +1 -1
  207. package/dist/src/service/prompter/prompt/promptSingleSelect.d.ts +1 -1
  208. package/dist/src/service/prompter/prompt/promptSingleSelect.d.ts.map +1 -1
  209. package/dist/src/service/prompter/prompt/promptText.d.ts +1 -1
  210. package/dist/src/service/prompter/prompt/promptText.d.ts.map +1 -1
  211. package/dist/src/service/prompter/prompt/promptToggle.d.ts +1 -1
  212. package/dist/src/service/prompter/prompt/promptToggle.d.ts.map +1 -1
  213. package/dist/src/service/prompter/prompt/promptToggle.js +1 -1
  214. package/dist/src/service/shutdown/DefaultShutdownService.d.ts +1 -1
  215. package/dist/src/service/shutdown/DefaultShutdownService.d.ts.map +1 -1
  216. package/dist/src/service/shutdown/ShutdownServiceProvider.d.ts +3 -3
  217. package/dist/src/service/shutdown/ShutdownServiceProvider.d.ts.map +1 -1
  218. package/dist/src/service/shutdown/ShutdownServiceProvider.js +1 -1
  219. package/dist/src/service/syntaxHighlighter/DefaultSyntaxHighlighterService.d.ts +2 -2
  220. package/dist/src/service/syntaxHighlighter/DefaultSyntaxHighlighterService.d.ts.map +1 -1
  221. package/dist/src/service/syntaxHighlighter/SyntaxHighlighterServiceProvider.d.ts +3 -3
  222. package/dist/src/service/syntaxHighlighter/SyntaxHighlighterServiceProvider.d.ts.map +1 -1
  223. package/dist/src/service/syntaxHighlighter/SyntaxHighlighterServiceProvider.js +2 -2
  224. package/dist/src/service/tableGenerator/DefaultTableGeneratorService.d.ts +3 -3
  225. package/dist/src/service/tableGenerator/DefaultTableGeneratorService.d.ts.map +1 -1
  226. package/dist/src/service/tableGenerator/DefaultTableGeneratorService.js +2 -2
  227. package/dist/src/service/tableGenerator/TableGeneratorServiceProvider.d.ts +3 -3
  228. package/dist/src/service/tableGenerator/TableGeneratorServiceProvider.d.ts.map +1 -1
  229. package/dist/src/service/tableGenerator/TableGeneratorServiceProvider.js +2 -2
  230. package/dist/src/service/treePrinter/DefaultTreePrinterService.d.ts +2 -2
  231. package/dist/src/service/treePrinter/DefaultTreePrinterService.d.ts.map +1 -1
  232. package/dist/src/service/treePrinter/TreePrinterServiceProvider.d.ts +3 -3
  233. package/dist/src/service/treePrinter/TreePrinterServiceProvider.d.ts.map +1 -1
  234. package/dist/src/service/treePrinter/TreePrinterServiceProvider.js +2 -2
  235. package/dist/src/terminal/NonTtyTerminal.d.ts +14 -0
  236. package/dist/src/terminal/NonTtyTerminal.d.ts.map +1 -0
  237. package/dist/src/terminal/NonTtyTerminal.js +36 -0
  238. package/dist/src/terminal/Terminal.d.ts +1 -0
  239. package/dist/src/terminal/Terminal.d.ts.map +1 -1
  240. package/dist/src/terminal/TtyStyler.d.ts +1 -0
  241. package/dist/src/terminal/TtyStyler.d.ts.map +1 -1
  242. package/dist/src/terminal/TtyStyler.js +6 -2
  243. package/dist/src/terminal/TtyTerminal.d.ts +1 -0
  244. package/dist/src/terminal/TtyTerminal.d.ts.map +1 -1
  245. package/dist/src/terminal/TtyTerminal.js +3 -0
  246. package/dist/src/util/configHelper.d.ts +4 -4
  247. package/dist/src/util/configHelper.d.ts.map +1 -1
  248. package/dist/src/util/envVarHelper.d.ts +4 -4
  249. package/dist/src/util/envVarHelper.d.ts.map +1 -1
  250. package/dist/src/util/envVarHelper.js +2 -2
  251. package/dist/src/util/helpHelper.d.ts +8 -8
  252. package/dist/src/util/helpHelper.d.ts.map +1 -1
  253. package/dist/src/util/helpHelper.js +1 -1
  254. package/dist/src/util/runnerHelper.d.ts +2 -2
  255. package/dist/src/util/runnerHelper.d.ts.map +1 -1
  256. package/dist/src/util/runnerHelper.js +1 -1
  257. package/index.ts +70 -69
  258. package/package.json +2 -1
  259. package/src/cli/BaseCLI.ts +57 -23
  260. package/src/cli/DefaultRuntimeCLI.ts +55 -11
  261. package/src/cli/DynamicPluginRuntimeCLI.ts +8 -8
  262. package/src/command/MultiCommandCliHelpCommand.ts +13 -13
  263. package/src/command/SingleCommandCliHelpCommand.ts +12 -12
  264. package/src/command/UsageCommand.ts +5 -5
  265. package/src/command/VersionCommand.ts +4 -4
  266. package/src/launcher.ts +8 -6
  267. package/src/runtime/DefaultContext.ts +2 -2
  268. package/src/runtime/argument/ArgumentTypeGuards.ts +2 -2
  269. package/src/runtime/command/CommandTypeGuards.ts +5 -5
  270. package/src/runtime/command/CommandValidator.ts +13 -13
  271. package/src/runtime/parser.ts +6 -38
  272. package/src/runtime/registry/DefaultCommandRegistry.ts +6 -6
  273. package/src/runtime/registry/DefaultServiceProviderRegistry.ts +2 -2
  274. package/src/runtime/runner.ts +13 -13
  275. package/src/runtime/scanner.ts +4 -4
  276. package/src/runtime/values/ValuePopulationResult.ts +2 -2
  277. package/src/runtime/values/argumentValueMerge.ts +3 -3
  278. package/src/runtime/values/argumentValueValidation.ts +10 -10
  279. package/src/runtime/values/globalCommandValuePopulation.ts +4 -4
  280. package/src/runtime/values/subCommandValuePopulation.ts +10 -7
  281. package/src/service/argumentPrompter/ArgumentPrompterServiceProvider.ts +5 -5
  282. package/src/service/argumentPrompter/DefaultArgumentPrompterService.ts +12 -12
  283. package/src/service/asciiBannerGenerator/AsciiBannerGeneratorServiceProvider.ts +5 -5
  284. package/src/service/asciiBannerGenerator/DefaultAsciiBannerGeneratorService.ts +2 -5
  285. package/src/service/banner/BannerServiceProvider.ts +7 -7
  286. package/src/service/banner/command/NoBannerCommand.ts +4 -4
  287. package/src/service/chiselAsciiBannerGenerator/ChiselFontAsciiBannerGeneratorService.ts +2 -2
  288. package/src/service/completion/CompletionServiceProvider.ts +14 -14
  289. package/src/service/completion/DefaultCompletionService.ts +5 -5
  290. package/src/service/completion/command/CompletionCompleteSubCommand.ts +8 -8
  291. package/src/service/completion/command/CompletionGroupCommand.ts +3 -3
  292. package/src/service/completion/command/CompletionIntegrationSubCommand.ts +8 -8
  293. package/src/service/completion/shell/ShellHandler.ts +1 -1
  294. package/src/service/completion/shell/bash.ts +1 -1
  295. package/src/service/completion/shell/fish.ts +1 -1
  296. package/src/service/completion/shell/powershell.ts +1 -1
  297. package/src/service/completion/shell/zsh.ts +1 -1
  298. package/src/service/configuration/ConfigurationServiceProvider.ts +6 -6
  299. package/src/service/configuration/DefaultKeyValueService.ts +2 -2
  300. package/src/service/configuration/DefaultSecretService.ts +1 -1
  301. package/src/service/configuration/command/ConfigCommand.ts +4 -4
  302. package/src/service/configuration/command/DumpConfigCommand.ts +6 -6
  303. package/src/service/dataDumpGenerator/DataDumpGeneratorServiceProvider.ts +6 -6
  304. package/src/service/dataDumpGenerator/DefaultDataDumpGeneratorService.ts +2 -2
  305. package/src/service/imagePrinter/DefaultImagePrinterService.ts +1 -1
  306. package/src/service/imagePrinter/ImagePrinterServiceProvider.ts +4 -4
  307. package/src/service/plugin/DefaultPluginService.ts +1 -1
  308. package/src/service/plugin/DefaultPluginServiceProvider.ts +4 -4
  309. package/src/service/plugin/command/PluginAddSubCommand.ts +8 -8
  310. package/src/service/plugin/command/PluginGroupCommand.ts +3 -3
  311. package/src/service/plugin/command/PluginListSubCommand.ts +7 -7
  312. package/src/service/plugin/command/PluginRemoveSubCommand.ts +8 -8
  313. package/src/service/plugin/command/PluginSearchSubCommand.ts +8 -8
  314. package/src/service/plugin/command/PluginUpgradeSubCommand.ts +7 -7
  315. package/src/service/prettyPrinter/DefaultPrettyPrinterService.ts +3 -3
  316. package/src/service/prettyPrinter/PrettyPrinterServiceProvider.ts +4 -4
  317. package/src/service/printer/DefaultPrinterService.ts +76 -8
  318. package/src/service/printer/PrinterServiceProvider.ts +7 -7
  319. package/src/service/printer/command/DarkModeCommand.ts +4 -4
  320. package/src/service/printer/command/LogLevelCommand.ts +5 -5
  321. package/src/service/printer/command/NoColorCommand.ts +4 -4
  322. package/src/service/printer/command/NoHyperlinksCommand.ts +4 -4
  323. package/src/service/printer/terminal/Progress.ts +2 -2
  324. package/src/service/printer/terminal/Quote.ts +66 -0
  325. package/src/service/printer/terminal/Spinner.ts +2 -2
  326. package/src/service/prompter/DefaultPrompterService.ts +3 -3
  327. package/src/service/prompter/PrompterServiceProvider.ts +5 -5
  328. package/src/service/prompter/command/NoPromptCommand.ts +4 -4
  329. package/src/service/prompter/prompt/PromptContext.ts +2 -2
  330. package/src/service/prompter/prompt/promptAcknowledge.ts +1 -1
  331. package/src/service/prompter/prompt/promptMultiSelect.ts +1 -1
  332. package/src/service/prompter/prompt/promptOpenUrl.ts +1 -1
  333. package/src/service/prompter/prompt/promptSingleSelect.ts +1 -1
  334. package/src/service/prompter/prompt/promptText.ts +2 -2
  335. package/src/service/prompter/prompt/promptToggle.ts +1 -1
  336. package/src/service/shutdown/DefaultShutdownService.ts +1 -1
  337. package/src/service/shutdown/ShutdownServiceProvider.ts +5 -5
  338. package/src/service/syntaxHighlighter/DefaultSyntaxHighlighterService.ts +2 -2
  339. package/src/service/syntaxHighlighter/SyntaxHighlighterServiceProvider.ts +6 -6
  340. package/src/service/tableGenerator/DefaultTableGeneratorService.ts +4 -4
  341. package/src/service/tableGenerator/TableGeneratorServiceProvider.ts +6 -6
  342. package/src/service/treePrinter/DefaultTreePrinterService.ts +2 -2
  343. package/src/service/treePrinter/TreePrinterServiceProvider.ts +6 -6
  344. package/src/terminal/NonTtyTerminal.ts +48 -0
  345. package/src/terminal/Terminal.ts +1 -0
  346. package/src/terminal/TtyStyler.ts +6 -2
  347. package/src/terminal/TtyTerminal.ts +4 -0
  348. package/src/util/configHelper.ts +6 -6
  349. package/src/util/envVarHelper.ts +10 -10
  350. package/src/util/helpHelper.ts +19 -16
  351. package/src/util/runnerHelper.ts +4 -4
  352. package/dist/src/api/CLI.d.ts +0 -17
  353. package/dist/src/api/CLI.d.ts.map +0 -1
  354. package/dist/src/api/CLI.js +0 -0
  355. package/dist/src/api/CLIConfig.d.ts +0 -22
  356. package/dist/src/api/CLIConfig.d.ts.map +0 -1
  357. package/dist/src/api/CLIConfig.js +0 -0
  358. package/dist/src/api/Context.d.ts +0 -23
  359. package/dist/src/api/Context.d.ts.map +0 -1
  360. package/dist/src/api/Context.js +0 -0
  361. package/dist/src/api/RunResult.d.ts +0 -128
  362. package/dist/src/api/RunResult.d.ts.map +0 -1
  363. package/dist/src/api/RunResult.js +0 -73
  364. package/dist/src/api/argument/Argument.d.ts +0 -62
  365. package/dist/src/api/argument/Argument.d.ts.map +0 -1
  366. package/dist/src/api/argument/Argument.js +0 -0
  367. package/dist/src/api/argument/ArgumentValueTypes.d.ts +0 -68
  368. package/dist/src/api/argument/ArgumentValueTypes.d.ts.map +0 -1
  369. package/dist/src/api/argument/ArgumentValueTypes.js +0 -18
  370. package/dist/src/api/argument/ComplexOption.d.ts +0 -21
  371. package/dist/src/api/argument/ComplexOption.d.ts.map +0 -1
  372. package/dist/src/api/argument/ComplexOption.js +0 -1
  373. package/dist/src/api/argument/GlobalCommandArgument.d.ts +0 -16
  374. package/dist/src/api/argument/GlobalCommandArgument.d.ts.map +0 -1
  375. package/dist/src/api/argument/GlobalCommandArgument.js +0 -0
  376. package/dist/src/api/argument/Option.d.ts +0 -29
  377. package/dist/src/api/argument/Option.d.ts.map +0 -1
  378. package/dist/src/api/argument/Option.js +0 -0
  379. package/dist/src/api/argument/Positional.d.ts +0 -26
  380. package/dist/src/api/argument/Positional.d.ts.map +0 -1
  381. package/dist/src/api/argument/Positional.js +0 -0
  382. package/dist/src/api/argument/SubCommandArgument.d.ts +0 -18
  383. package/dist/src/api/argument/SubCommandArgument.d.ts.map +0 -1
  384. package/dist/src/api/argument/SubCommandArgument.js +0 -1
  385. package/dist/src/api/command/Command.d.ts +0 -26
  386. package/dist/src/api/command/Command.d.ts.map +0 -1
  387. package/dist/src/api/command/Command.js +0 -0
  388. package/dist/src/api/command/GlobalCommand.d.ts +0 -28
  389. package/dist/src/api/command/GlobalCommand.d.ts.map +0 -1
  390. package/dist/src/api/command/GlobalCommand.js +0 -0
  391. package/dist/src/api/command/GlobalModifierCommand.d.ts +0 -12
  392. package/dist/src/api/command/GlobalModifierCommand.d.ts.map +0 -1
  393. package/dist/src/api/command/GlobalModifierCommand.js +0 -0
  394. package/dist/src/api/command/GroupCommand.d.ts +0 -19
  395. package/dist/src/api/command/GroupCommand.d.ts.map +0 -1
  396. package/dist/src/api/command/GroupCommand.js +0 -0
  397. package/dist/src/api/command/SubCommand.d.ts +0 -37
  398. package/dist/src/api/command/SubCommand.d.ts.map +0 -1
  399. package/dist/src/api/command/SubCommand.js +0 -0
  400. package/dist/src/api/command/UsageExample.d.ts +0 -20
  401. package/dist/src/api/command/UsageExample.d.ts.map +0 -1
  402. package/dist/src/api/command/UsageExample.js +0 -0
  403. package/dist/src/api/plugin/CLIPlugin.d.ts +0 -31
  404. package/dist/src/api/plugin/CLIPlugin.d.ts.map +0 -1
  405. package/dist/src/api/plugin/CLIPlugin.js +0 -2
  406. package/dist/src/api/plugin/CommandFactory.d.ts +0 -23
  407. package/dist/src/api/plugin/CommandFactory.d.ts.map +0 -1
  408. package/dist/src/api/plugin/CommandFactory.js +0 -7
  409. package/dist/src/api/plugin/ServiceProviderFactory.d.ts +0 -25
  410. package/dist/src/api/plugin/ServiceProviderFactory.d.ts.map +0 -1
  411. package/dist/src/api/plugin/ServiceProviderFactory.js +0 -7
  412. package/dist/src/api/plugin/createCLIPlugin.d.ts +0 -14
  413. package/dist/src/api/plugin/createCLIPlugin.d.ts.map +0 -1
  414. package/dist/src/api/plugin/createCLIPlugin.js +0 -30
  415. package/dist/src/api/service/ServiceProvider.d.ts +0 -47
  416. package/dist/src/api/service/ServiceProvider.d.ts.map +0 -1
  417. package/dist/src/api/service/ServiceProvider.js +0 -0
  418. package/dist/src/api/service/core/ArgumentPrompterService.d.ts +0 -6
  419. package/dist/src/api/service/core/ArgumentPrompterService.d.ts.map +0 -1
  420. package/dist/src/api/service/core/ArgumentPrompterService.js +0 -1
  421. package/dist/src/api/service/core/AsciiBannerGeneratorService.d.ts +0 -59
  422. package/dist/src/api/service/core/AsciiBannerGeneratorService.d.ts.map +0 -1
  423. package/dist/src/api/service/core/AsciiBannerGeneratorService.js +0 -1
  424. package/dist/src/api/service/core/CompletionService.d.ts +0 -22
  425. package/dist/src/api/service/core/CompletionService.d.ts.map +0 -1
  426. package/dist/src/api/service/core/CompletionService.js +0 -8
  427. package/dist/src/api/service/core/DataDumpGeneratorService.d.ts +0 -22
  428. package/dist/src/api/service/core/DataDumpGeneratorService.d.ts.map +0 -1
  429. package/dist/src/api/service/core/DataDumpGeneratorService.js +0 -7
  430. package/dist/src/api/service/core/ImagePrinterService.d.ts +0 -21
  431. package/dist/src/api/service/core/ImagePrinterService.d.ts.map +0 -1
  432. package/dist/src/api/service/core/ImagePrinterService.js +0 -1
  433. package/dist/src/api/service/core/KeyValueService.d.ts +0 -40
  434. package/dist/src/api/service/core/KeyValueService.d.ts.map +0 -1
  435. package/dist/src/api/service/core/KeyValueService.js +0 -7
  436. package/dist/src/api/service/core/PluginService.d.ts +0 -55
  437. package/dist/src/api/service/core/PluginService.d.ts.map +0 -1
  438. package/dist/src/api/service/core/PluginService.js +0 -6
  439. package/dist/src/api/service/core/PrettyPrinterService.d.ts +0 -35
  440. package/dist/src/api/service/core/PrettyPrinterService.d.ts.map +0 -1
  441. package/dist/src/api/service/core/PrettyPrinterService.js +0 -1
  442. package/dist/src/api/service/core/PrinterService.d.ts +0 -339
  443. package/dist/src/api/service/core/PrinterService.d.ts.map +0 -1
  444. package/dist/src/api/service/core/PrinterService.js +0 -42
  445. package/dist/src/api/service/core/PrompterService.d.ts +0 -35
  446. package/dist/src/api/service/core/PrompterService.d.ts.map +0 -1
  447. package/dist/src/api/service/core/PrompterService.js +0 -10
  448. package/dist/src/api/service/core/SecretService.d.ts +0 -25
  449. package/dist/src/api/service/core/SecretService.d.ts.map +0 -1
  450. package/dist/src/api/service/core/SecretService.js +0 -0
  451. package/dist/src/api/service/core/ShutdownService.d.ts +0 -24
  452. package/dist/src/api/service/core/ShutdownService.d.ts.map +0 -1
  453. package/dist/src/api/service/core/ShutdownService.js +0 -1
  454. package/dist/src/api/service/core/SyntaxHighlighterService.d.ts +0 -49
  455. package/dist/src/api/service/core/SyntaxHighlighterService.d.ts.map +0 -1
  456. package/dist/src/api/service/core/SyntaxHighlighterService.js +0 -1
  457. package/dist/src/api/service/core/Table.d.ts +0 -18
  458. package/dist/src/api/service/core/Table.d.ts.map +0 -1
  459. package/dist/src/api/service/core/Table.js +0 -49
  460. package/dist/src/api/service/core/TableGeneratorService.d.ts +0 -32
  461. package/dist/src/api/service/core/TableGeneratorService.d.ts.map +0 -1
  462. package/dist/src/api/service/core/TableGeneratorService.js +0 -7
  463. package/dist/src/api/service/core/TreePrinterService.d.ts +0 -9
  464. package/dist/src/api/service/core/TreePrinterService.d.ts.map +0 -1
  465. package/dist/src/api/service/core/TreePrinterService.js +0 -1
  466. package/dist/src/runtime/registry/CommandRegistry.d.ts +0 -89
  467. package/dist/src/runtime/registry/CommandRegistry.d.ts.map +0 -1
  468. package/dist/src/runtime/registry/CommandRegistry.js +0 -0
  469. package/dist/src/runtime/registry/ServiceProviderRegistry.d.ts +0 -11
  470. package/dist/src/runtime/registry/ServiceProviderRegistry.d.ts.map +0 -1
  471. package/dist/src/runtime/registry/ServiceProviderRegistry.js +0 -0
  472. package/src/api/CLI.ts +0 -17
  473. package/src/api/CLIConfig.ts +0 -24
  474. package/src/api/Context.ts +0 -25
  475. package/src/api/RunResult.ts +0 -158
  476. package/src/api/argument/Argument.ts +0 -75
  477. package/src/api/argument/ArgumentValueTypes.ts +0 -80
  478. package/src/api/argument/ComplexOption.ts +0 -27
  479. package/src/api/argument/GlobalCommandArgument.ts +0 -17
  480. package/src/api/argument/Option.ts +0 -32
  481. package/src/api/argument/Positional.ts +0 -27
  482. package/src/api/argument/SubCommandArgument.ts +0 -20
  483. package/src/api/command/Command.ts +0 -28
  484. package/src/api/command/GlobalCommand.ts +0 -30
  485. package/src/api/command/GlobalModifierCommand.ts +0 -12
  486. package/src/api/command/GroupCommand.ts +0 -20
  487. package/src/api/command/SubCommand.ts +0 -41
  488. package/src/api/command/UsageExample.ts +0 -21
  489. package/src/api/plugin/CLIPlugin.ts +0 -35
  490. package/src/api/plugin/CommandFactory.ts +0 -25
  491. package/src/api/plugin/ServiceProviderFactory.ts +0 -27
  492. package/src/api/plugin/createCLIPlugin.ts +0 -47
  493. package/src/api/service/ServiceProvider.ts +0 -52
  494. package/src/api/service/core/ArgumentPrompterService.ts +0 -8
  495. package/src/api/service/core/AsciiBannerGeneratorService.ts +0 -69
  496. package/src/api/service/core/CompletionService.ts +0 -32
  497. package/src/api/service/core/DataDumpGeneratorService.ts +0 -27
  498. package/src/api/service/core/ImagePrinterService.ts +0 -25
  499. package/src/api/service/core/KeyValueService.ts +0 -44
  500. package/src/api/service/core/PluginService.ts +0 -63
  501. package/src/api/service/core/PrettyPrinterService.ts +0 -39
  502. package/src/api/service/core/PrinterService.ts +0 -400
  503. package/src/api/service/core/PrompterService.ts +0 -42
  504. package/src/api/service/core/SecretService.ts +0 -27
  505. package/src/api/service/core/ShutdownService.ts +0 -27
  506. package/src/api/service/core/SyntaxHighlighterService.ts +0 -54
  507. package/src/api/service/core/Table.ts +0 -67
  508. package/src/api/service/core/TableGeneratorService.ts +0 -39
  509. package/src/api/service/core/TreePrinterService.ts +0 -10
  510. package/src/runtime/registry/CommandRegistry.ts +0 -116
  511. package/src/runtime/registry/ServiceProviderRegistry.ts +0 -11
  512. /package/dist/src/{api → cli}/BaseCLIFeatureOptions.d.ts +0 -0
  513. /package/dist/src/{api → cli}/BaseCLIFeatureOptions.js +0 -0
  514. /package/src/{api → cli}/BaseCLIFeatureOptions.ts +0 -0
package/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // Argument API
2
- export type { default as Argument } from "./src/api/argument/Argument.ts";
2
+ export type { Argument } from "@flowscripter/dynamic-cli-framework-api";
3
3
  export type {
4
4
  ArgumentSingleValueType,
5
5
  ArgumentValues,
@@ -7,37 +7,37 @@ export type {
7
7
  PopulatedArgumentSingleValueType,
8
8
  PopulatedArgumentValues,
9
9
  PopulatedArgumentValueType,
10
- } from "./src/api/argument/ArgumentValueTypes.ts";
10
+ } from "@flowscripter/dynamic-cli-framework-api";
11
11
  export {
12
12
  ArgumentValueTypeName,
13
13
  ComplexValueTypeName,
14
- } from "./src/api/argument/ArgumentValueTypes.ts";
15
- export type { default as ComplexOption } from "./src/api/argument/ComplexOption.ts";
16
- export { MAXIMUM_COMPLEX_OPTION_NESTING_DEPTH } from "./src/api/argument/ComplexOption.ts";
17
- export type { default as SubCommandArgument } from "./src/api/argument/SubCommandArgument.ts";
18
- export { MAXIMUM_ARGUMENT_ARRAY_SIZE } from "./src/api/argument/SubCommandArgument.ts";
19
- export type { default as GlobalCommandArgument } from "./src/api/argument/GlobalCommandArgument.ts";
20
- export type { default as Option } from "./src/api/argument/Option.ts";
21
- export type { default as Positional } from "./src/api/argument/Positional.ts";
14
+ } from "@flowscripter/dynamic-cli-framework-api";
15
+ export type { ComplexOption } from "@flowscripter/dynamic-cli-framework-api";
16
+ export { MAXIMUM_COMPLEX_OPTION_NESTING_DEPTH } from "@flowscripter/dynamic-cli-framework-api";
17
+ export type { SubCommandArgument } from "@flowscripter/dynamic-cli-framework-api";
18
+ export { MAXIMUM_ARGUMENT_ARRAY_SIZE } from "@flowscripter/dynamic-cli-framework-api";
19
+ export type { GlobalCommandArgument } from "@flowscripter/dynamic-cli-framework-api";
20
+ export type { Option } from "@flowscripter/dynamic-cli-framework-api";
21
+ export type { Positional } from "@flowscripter/dynamic-cli-framework-api";
22
22
 
23
23
  // Command API
24
- export type { default as Command } from "./src/api/command/Command.ts";
25
- export type { default as GlobalCommand } from "./src/api/command/GlobalCommand.ts";
26
- export type { default as GlobalModifierCommand } from "./src/api/command/GlobalModifierCommand.ts";
27
- export type { default as GroupCommand } from "./src/api/command/GroupCommand.ts";
28
- export type { default as SubCommand } from "./src/api/command/SubCommand.ts";
29
- export type { default as UsageExample } from "./src/api/command/UsageExample.ts";
24
+ export type { Command } from "@flowscripter/dynamic-cli-framework-api";
25
+ export type { GlobalCommand } from "@flowscripter/dynamic-cli-framework-api";
26
+ export type { GlobalModifierCommand } from "@flowscripter/dynamic-cli-framework-api";
27
+ export type { GroupCommand } from "@flowscripter/dynamic-cli-framework-api";
28
+ export type { SubCommand } from "@flowscripter/dynamic-cli-framework-api";
29
+ export type { UsageExample } from "@flowscripter/dynamic-cli-framework-api";
30
30
 
31
31
  // Service API
32
- export type { ServiceInfo, ServiceProvider } from "./src/api/service/ServiceProvider.ts";
32
+ export type { ServiceInfo, ServiceProvider } from "@flowscripter/dynamic-cli-framework-api";
33
33
 
34
34
  // Registry API
35
- export type { default as CommandRegistry } from "./src/runtime/registry/CommandRegistry.ts";
36
- export type { default as ServiceProviderRegistry } from "./src/runtime/registry/ServiceProviderRegistry.ts";
35
+ export type { CommandRegistry } from "@flowscripter/dynamic-cli-framework-api";
36
+ export type { ServiceProviderRegistry } from "@flowscripter/dynamic-cli-framework-api";
37
37
 
38
38
  // Core Services
39
- export { ASCII_BANNER_GENERATOR_SERVICE_ID } from "./src/api/service/core/AsciiBannerGeneratorService.ts";
40
- export type { default as AsciiBannerGeneratorService } from "./src/api/service/core/AsciiBannerGeneratorService.ts";
39
+ export { ASCII_BANNER_GENERATOR_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
40
+ export type { AsciiBannerGeneratorService } from "@flowscripter/dynamic-cli-framework-api";
41
41
  export type {
42
42
  BannerColorEffects,
43
43
  BannerGenerateOptions,
@@ -46,7 +46,7 @@ export type {
46
46
  FixedColorEffect,
47
47
  GradientColorEffect,
48
48
  RainbowColorEffect,
49
- } from "./src/api/service/core/AsciiBannerGeneratorService.ts";
49
+ } from "@flowscripter/dynamic-cli-framework-api";
50
50
  export { default as DefaultAsciiBannerGeneratorService } from "./src/service/asciiBannerGenerator/DefaultAsciiBannerGeneratorService.ts";
51
51
  export { default as AsciiBannerGeneratorServiceProvider } from "./src/service/asciiBannerGenerator/AsciiBannerGeneratorServiceProvider.ts";
52
52
  export { default as ChiselFontAsciiBannerGeneratorService } from "./src/service/chiselAsciiBannerGenerator/ChiselFontAsciiBannerGeneratorService.ts";
@@ -57,86 +57,86 @@ export type {
57
57
 
58
58
  export { default as BannerServiceProvider } from "./src/service/banner/BannerServiceProvider.ts";
59
59
 
60
- export { KEY_VALUE_SERVICE_ID } from "./src/api/service/core/KeyValueService.ts";
61
- export { SECRET_SENTINEL_PREFIX } from "./src/api/service/core/KeyValueService.ts";
62
- export type { default as KeyValueService } from "./src/api/service/core/KeyValueService.ts";
63
- export type { default as SecretService } from "./src/api/service/core/SecretService.ts";
60
+ export { KEY_VALUE_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
61
+ export { SECRET_SENTINEL_PREFIX } from "@flowscripter/dynamic-cli-framework-api";
62
+ export type { KeyValueService } from "@flowscripter/dynamic-cli-framework-api";
63
+ export type { SecretService } from "@flowscripter/dynamic-cli-framework-api";
64
64
  export { default as DefaultKeyValueService } from "./src/service/configuration/DefaultKeyValueService.ts";
65
65
  export { default as DefaultSecretService } from "./src/service/configuration/DefaultSecretService.ts";
66
66
  export type { SecretsApi } from "./src/service/configuration/DefaultSecretService.ts";
67
67
  export { default as ConfigCommand } from "./src/service/configuration/command/ConfigCommand.ts";
68
68
  export { default as ConfigurationServiceProvider } from "./src/service/configuration/ConfigurationServiceProvider.ts";
69
69
 
70
- export { PRINTER_SERVICE_ID } from "./src/api/service/core/PrinterService.ts";
71
- export type { default as PrinterService } from "./src/api/service/core/PrinterService.ts";
72
- export { Icon, Level, ProgressStyle, SpinnerStyle } from "./src/api/service/core/PrinterService.ts";
70
+ export { PRINTER_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
71
+ export type { PrinterService } from "@flowscripter/dynamic-cli-framework-api";
72
+ export { Icon, Level, ProgressStyle, SpinnerStyle } from "@flowscripter/dynamic-cli-framework-api";
73
73
  export { default as DefaultPrinterService } from "./src/service/printer/DefaultPrinterService.ts";
74
74
  export { default as PrinterServiceProvider } from "./src/service/printer/PrinterServiceProvider.ts";
75
75
 
76
- export { SHUTDOWN_SERVICE_ID } from "./src/api/service/core/ShutdownService.ts";
77
- export type { default as ShutdownService } from "./src/api/service/core/ShutdownService.ts";
76
+ export { SHUTDOWN_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
77
+ export type { ShutdownService } from "@flowscripter/dynamic-cli-framework-api";
78
78
  export { default as DefaultShutdownService } from "./src/service/shutdown/DefaultShutdownService.ts";
79
79
  export { default as ShutdownServiceProvider } from "./src/service/shutdown/ShutdownServiceProvider.ts";
80
80
 
81
- export { SYNTAX_HIGHLIGHTER_SERVICE_ID } from "./src/api/service/core/SyntaxHighlighterService.ts";
82
- export type { default as SyntaxHighlighterService } from "./src/api/service/core/SyntaxHighlighterService.ts";
83
- export type { ColorScheme } from "./src/api/service/core/SyntaxHighlighterService.ts";
81
+ export { SYNTAX_HIGHLIGHTER_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
82
+ export type { SyntaxHighlighterService } from "@flowscripter/dynamic-cli-framework-api";
83
+ export type { ColorScheme } from "@flowscripter/dynamic-cli-framework-api";
84
84
  export { default as DefaultSyntaxHighlighterService } from "./src/service/syntaxHighlighter/DefaultSyntaxHighlighterService.ts";
85
85
  export { default as SyntaxHighlighterServiceProvider } from "./src/service/syntaxHighlighter/SyntaxHighlighterServiceProvider.ts";
86
86
 
87
- export { PRETTY_PRINTER_SERVICE_ID } from "./src/api/service/core/PrettyPrinterService.ts";
88
- export type { default as PrettyPrinterService } from "./src/api/service/core/PrettyPrinterService.ts";
87
+ export { PRETTY_PRINTER_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
88
+ export type { PrettyPrinterService } from "@flowscripter/dynamic-cli-framework-api";
89
89
  export { default as DefaultPrettyPrinterService } from "./src/service/prettyPrinter/DefaultPrettyPrinterService.ts";
90
90
  export { default as PrettyPrinterServiceProvider } from "./src/service/prettyPrinter/PrettyPrinterServiceProvider.ts";
91
91
 
92
- export { IMAGE_PRINTER_SERVICE_ID } from "./src/api/service/core/ImagePrinterService.ts";
93
- export type { default as ImagePrinterService } from "./src/api/service/core/ImagePrinterService.ts";
92
+ export { IMAGE_PRINTER_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
93
+ export type { ImagePrinterService } from "@flowscripter/dynamic-cli-framework-api";
94
94
  export { default as DefaultImagePrinterService } from "./src/service/imagePrinter/DefaultImagePrinterService.ts";
95
95
  export { default as ImagePrinterServiceProvider } from "./src/service/imagePrinter/ImagePrinterServiceProvider.ts";
96
96
 
97
- export { TREE_PRINTER_SERVICE_ID } from "./src/api/service/core/TreePrinterService.ts";
98
- export type { default as TreePrinterService } from "./src/api/service/core/TreePrinterService.ts";
99
- export type { TreeNode } from "./src/api/service/core/TreePrinterService.ts";
97
+ export { TREE_PRINTER_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
98
+ export type { TreePrinterService } from "@flowscripter/dynamic-cli-framework-api";
99
+ export type { TreeNode } from "@flowscripter/dynamic-cli-framework-api";
100
100
  export { default as DefaultTreePrinterService } from "./src/service/treePrinter/DefaultTreePrinterService.ts";
101
101
  export { default as TreePrinterServiceProvider } from "./src/service/treePrinter/TreePrinterServiceProvider.ts";
102
102
 
103
- export { TABLE_GENERATOR_SERVICE_ID } from "./src/api/service/core/TableGeneratorService.ts";
104
- export type { default as TableGeneratorService } from "./src/api/service/core/TableGeneratorService.ts";
103
+ export { TABLE_GENERATOR_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
104
+ export type { TableGeneratorService } from "@flowscripter/dynamic-cli-framework-api";
105
105
  export {
106
106
  Align,
107
107
  type CellOptions,
108
108
  type ColumnOptions,
109
109
  type RowOptions,
110
110
  type TableOptions,
111
- } from "./src/api/service/core/TableGeneratorService.ts";
112
- export { default as Table } from "./src/api/service/core/Table.ts";
111
+ } from "@flowscripter/dynamic-cli-framework-api";
112
+ export { Table } from "@flowscripter/dynamic-cli-framework-api";
113
113
  export { default as DefaultTableGeneratorService } from "./src/service/tableGenerator/DefaultTableGeneratorService.ts";
114
114
  export { default as TableGeneratorServiceProvider } from "./src/service/tableGenerator/TableGeneratorServiceProvider.ts";
115
115
 
116
- export { DATA_DUMP_GENERATOR_SERVICE_ID } from "./src/api/service/core/DataDumpGeneratorService.ts";
117
- export type { default as DataDumpGeneratorService } from "./src/api/service/core/DataDumpGeneratorService.ts";
116
+ export { DATA_DUMP_GENERATOR_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
117
+ export type { DataDumpGeneratorService } from "@flowscripter/dynamic-cli-framework-api";
118
118
  export {
119
119
  type ByteRangeColor,
120
120
  DumpFormat,
121
121
  type HexDumpGenerateOptions,
122
- } from "./src/api/service/core/DataDumpGeneratorService.ts";
122
+ } from "@flowscripter/dynamic-cli-framework-api";
123
123
  export { default as DefaultDataDumpGeneratorService } from "./src/service/dataDumpGenerator/DefaultDataDumpGeneratorService.ts";
124
124
  export { default as DataDumpGeneratorServiceProvider } from "./src/service/dataDumpGenerator/DataDumpGeneratorServiceProvider.ts";
125
125
 
126
- export { COMPLETION_SERVICE_ID } from "./src/api/service/core/CompletionService.ts";
127
- export type { default as CompletionService } from "./src/api/service/core/CompletionService.ts";
128
- export { type CompletionItem, ShellType } from "./src/api/service/core/CompletionService.ts";
126
+ export { COMPLETION_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
127
+ export type { CompletionService } from "@flowscripter/dynamic-cli-framework-api";
128
+ export { type CompletionItem, ShellType } from "@flowscripter/dynamic-cli-framework-api";
129
129
  export { default as DefaultCompletionService } from "./src/service/completion/DefaultCompletionService.ts";
130
130
  export { default as CompletionServiceProvider } from "./src/service/completion/CompletionServiceProvider.ts";
131
131
 
132
- export { PROMPTER_SERVICE_ID } from "./src/api/service/core/PrompterService.ts";
133
- export type { default as PrompterService } from "./src/api/service/core/PrompterService.ts";
132
+ export { PROMPTER_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
133
+ export type { PrompterService } from "@flowscripter/dynamic-cli-framework-api";
134
134
  export {
135
135
  type Prompt,
136
136
  type PromptOption,
137
137
  type PromptResult,
138
138
  PromptType,
139
- } from "./src/api/service/core/PrompterService.ts";
139
+ } from "@flowscripter/dynamic-cli-framework-api";
140
140
  export { default as DefaultPrompterService } from "./src/service/prompter/DefaultPrompterService.ts";
141
141
  export {
142
142
  DEFAULT_PROMPTER_CONFIG,
@@ -144,19 +144,20 @@ export {
144
144
  } from "./src/service/prompter/DefaultPrompterService.ts";
145
145
  export { default as PrompterServiceProvider } from "./src/service/prompter/PrompterServiceProvider.ts";
146
146
 
147
- export { ARGUMENT_PROMPTER_SERVICE_ID } from "./src/api/service/core/ArgumentPrompterService.ts";
148
- export type { default as ArgumentPrompterService } from "./src/api/service/core/ArgumentPrompterService.ts";
149
- export type { ParseResult } from "./src/runtime/parser.ts";
147
+ export { ARGUMENT_PROMPTER_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
148
+ export type { ArgumentPrompterService } from "@flowscripter/dynamic-cli-framework-api";
149
+ export type { ParseResult } from "@flowscripter/dynamic-cli-framework-api";
150
150
  export { default as DefaultArgumentPrompterService } from "./src/service/argumentPrompter/DefaultArgumentPrompterService.ts";
151
151
  export { default as ArgumentPrompterServiceProvider } from "./src/service/argumentPrompter/ArgumentPrompterServiceProvider.ts";
152
152
 
153
153
  // CLI API
154
- export type { InvalidArgument } from "./src/api/RunResult.ts";
155
- export type { default as Context } from "./src/api/Context.ts";
156
- export type { default as RunResult, InvalidArgumentReason, RunState } from "./src/api/RunResult.ts";
157
- export type { default as BaseCLIFeatureOptions } from "./src/api/BaseCLIFeatureOptions.ts";
158
- export type { default as CLIConfig } from "./src/api/CLIConfig.ts";
159
- export type { default as CLI } from "./src/api/CLI.ts";
154
+ export type { InvalidArgument } from "@flowscripter/dynamic-cli-framework-api";
155
+ export type { Context } from "@flowscripter/dynamic-cli-framework-api";
156
+ export type { RunResult } from "@flowscripter/dynamic-cli-framework-api";
157
+ export { InvalidArgumentReason, RunState } from "@flowscripter/dynamic-cli-framework-api";
158
+ export type { default as BaseCLIFeatureOptions } from "./src/cli/BaseCLIFeatureOptions.ts";
159
+ export type { CLIConfig } from "@flowscripter/dynamic-cli-framework-api";
160
+ export type { CLI } from "@flowscripter/dynamic-cli-framework-api";
160
161
 
161
162
  // Help Commands
162
163
  export {
@@ -169,12 +170,12 @@ export {
169
170
  } from "./src/command/MultiCommandCliHelpCommand.ts";
170
171
 
171
172
  // Plugin API
172
- export type { default as CommandFactory } from "./src/api/plugin/CommandFactory.ts";
173
- export { DYNAMIC_CLI_FRAMEWORK_COMMAND_FACTORY_EXTENSION_POINT } from "./src/api/plugin/CommandFactory.ts";
174
- export type { default as ServiceProviderFactory } from "./src/api/plugin/ServiceProviderFactory.ts";
175
- export { DYNAMIC_CLI_FRAMEWORK_SERVICE_PROVIDER_FACTORY_EXTENSION_POINT } from "./src/api/plugin/ServiceProviderFactory.ts";
176
- export { PLUGIN_SERVICE_ID } from "./src/api/service/core/PluginService.ts";
177
- export type { default as PluginService } from "./src/api/service/core/PluginService.ts";
173
+ export type { CommandFactory } from "@flowscripter/dynamic-cli-framework-api";
174
+ export { DYNAMIC_CLI_FRAMEWORK_COMMAND_FACTORY_EXTENSION_POINT } from "@flowscripter/dynamic-cli-framework-api";
175
+ export type { ServiceProviderFactory } from "@flowscripter/dynamic-cli-framework-api";
176
+ export { DYNAMIC_CLI_FRAMEWORK_SERVICE_PROVIDER_FACTORY_EXTENSION_POINT } from "@flowscripter/dynamic-cli-framework-api";
177
+ export { PLUGIN_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
178
+ export type { PluginService } from "@flowscripter/dynamic-cli-framework-api";
178
179
  export { default as DefaultPluginServiceProvider } from "./src/service/plugin/DefaultPluginServiceProvider.ts";
179
180
 
180
181
  // Core CLI
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowscripter/dynamic-cli-framework",
3
- "version": "1.7.5",
3
+ "version": "2.1.0",
4
4
  "description": "A framework for developing CLI applications which supports dynamic discovery and installation of new commands",
5
5
  "keywords": [
6
6
  "bun",
@@ -48,6 +48,7 @@
48
48
  "build": "tsc -p tsconfig.build.json"
49
49
  },
50
50
  "dependencies": {
51
+ "@flowscripter/dynamic-cli-framework-api": "^1.0.1",
51
52
  "@flowscripter/dynamic-plugin-framework": "1.10.1",
52
53
  "emphasize": "^7.0.0",
53
54
  "fastest-levenshtein": "^1.0.16",
@@ -1,15 +1,15 @@
1
- import type CLI from "../api/CLI.ts";
2
- import type RunResult from "../api/RunResult.ts";
3
- import { RunState } from "../api/RunResult.ts";
1
+ import type { CLI } from "@flowscripter/dynamic-cli-framework-api";
2
+ import type { RunResult } from "@flowscripter/dynamic-cli-framework-api";
3
+ import { RunState } from "@flowscripter/dynamic-cli-framework-api";
4
4
  import getLogger from "../util/logger.ts";
5
5
  import DefaultCommandRegistry from "../runtime/registry/DefaultCommandRegistry.ts";
6
- import type Command from "../api/command/Command.ts";
6
+ import type { Command } from "@flowscripter/dynamic-cli-framework-api";
7
7
  import DefaultServiceProviderRegistry from "../runtime/registry/DefaultServiceProviderRegistry.ts";
8
8
  import DefaultContext from "../runtime/DefaultContext.ts";
9
- import type { ServiceProvider } from "../api/service/ServiceProvider.ts";
10
- import type CLIConfig from "../api/CLIConfig.ts";
11
- import type SubCommand from "../api/command/SubCommand.ts";
12
- import type GlobalCommand from "../api/command/GlobalCommand.ts";
9
+ import type { ServiceProvider } from "@flowscripter/dynamic-cli-framework-api";
10
+ import type { CLIConfig } from "@flowscripter/dynamic-cli-framework-api";
11
+ import type { SubCommand } from "@flowscripter/dynamic-cli-framework-api";
12
+ import type { GlobalCommand } from "@flowscripter/dynamic-cli-framework-api";
13
13
  import {
14
14
  SingleCommandCliHelpGlobalCommand,
15
15
  SingleCommandCliHelpSubCommand,
@@ -37,11 +37,11 @@ import { printRuntimeError } from "../util/runnerHelper.ts";
37
37
 
38
38
  import { WritableStream } from "node:stream/web";
39
39
  import type Terminal from "../terminal/Terminal.ts";
40
- import type PrinterService from "../api/service/core/PrinterService.ts";
40
+ import type { PrinterService } from "@flowscripter/dynamic-cli-framework-api";
41
41
  import DefaultPrinterService from "../service/printer/DefaultPrinterService.ts";
42
42
  import type Styler from "../terminal/Styler.ts";
43
43
  import type KeyReader from "../terminal/KeyReader.ts";
44
- import type BaseCLIFeatureOptions from "../api/BaseCLIFeatureOptions.ts";
44
+ import type BaseCLIFeatureOptions from "./BaseCLIFeatureOptions.ts";
45
45
  import DefaultPrompterService, {
46
46
  DEFAULT_PROMPTER_CONFIG,
47
47
  } from "../service/prompter/DefaultPrompterService.ts";
@@ -70,6 +70,12 @@ const logger = getLogger("BaseCLI");
70
70
  *
71
71
  * * {@link ImagePrinterServiceProvider}
72
72
  *
73
+ * `keyReader` is optional. If omitted, or if the stderr {@link Terminal} is not a TTY, prompting is
74
+ * unavailable: {@link PrompterServiceProvider} (and {@link ArgumentPrompterServiceProvider}, if
75
+ * enabled) are simply not registered. If `promptingEnabled` is `true` in that situation, {@link run}
76
+ * throws rather than failing later inside a prompt. Similarly {@link ImagePrinterServiceProvider} is
77
+ * only registered if the stdout {@link Terminal} is a TTY.
78
+ *
73
79
  * By default the following commands are added:
74
80
  *
75
81
  * * {@link SingleCommandCliHelpSubCommand} or {@link MultiCommandCliHelpSubCommand}
@@ -80,7 +86,7 @@ const logger = getLogger("BaseCLI");
80
86
  export default class BaseCLI implements CLI {
81
87
  readonly #cliConfig: CLIConfig;
82
88
  readonly #options: Required<BaseCLIFeatureOptions>;
83
- readonly #keyReader: KeyReader;
89
+ readonly #keyReader: KeyReader | undefined;
84
90
  readonly #stderrTerminal: Terminal;
85
91
  readonly #addedNonModifierCommands: Array<Command>;
86
92
  readonly #serviceProviderRegistry: DefaultServiceProviderRegistry;
@@ -98,7 +104,7 @@ export default class BaseCLI implements CLI {
98
104
  stdoutTerminal: Terminal,
99
105
  stderrTerminal: Terminal,
100
106
  styler: Styler,
101
- keyReader: KeyReader,
107
+ keyReader: KeyReader | undefined,
102
108
  options?: BaseCLIFeatureOptions,
103
109
  ) {
104
110
  if (cliConfig.name.length === 0) {
@@ -210,22 +216,50 @@ export default class BaseCLI implements CLI {
210
216
  this.addServiceProvider(new PrinterServiceProvider(80, this.#printerService));
211
217
  this.addServiceProvider(new TableGeneratorServiceProvider(70));
212
218
 
213
- const prompterService = new DefaultPrompterService(
214
- DEFAULT_PROMPTER_CONFIG,
215
- this.#stderrTerminal,
216
- this.#keyReader,
217
- this.#printerService,
218
- );
219
- prompterService.promptEnabled = this.#options.promptingEnabled;
220
- this.addServiceProvider(new PrompterServiceProvider(75, prompterService));
219
+ const canPrompt = this.#keyReader !== undefined && this.#stderrTerminal.isTty();
220
+
221
+ if (this.#options.promptingEnabled && !canPrompt) {
222
+ throw new Error("promptingEnabled requires a keyReader and a TTY stderr terminal");
223
+ }
224
+
225
+ let prompterService: DefaultPrompterService | undefined;
226
+ if (canPrompt) {
227
+ prompterService = new DefaultPrompterService(
228
+ DEFAULT_PROMPTER_CONFIG,
229
+ this.#stderrTerminal,
230
+ this.#keyReader!,
231
+ this.#printerService,
232
+ );
233
+ prompterService.promptEnabled = this.#options.promptingEnabled;
234
+ this.addServiceProvider(new PrompterServiceProvider(75, prompterService));
235
+ } else {
236
+ logger.debug(
237
+ () =>
238
+ `Skipping PrompterServiceProvider: keyReader present: ${
239
+ this.#keyReader !== undefined
240
+ }, stderr isTty: ${this.#stderrTerminal.isTty()}`,
241
+ );
242
+ }
221
243
 
222
244
  if (this.#options.argumentPrompterServiceEnabled) {
223
- const argumentPrompterService = new DefaultArgumentPrompterService(prompterService);
224
- this.addServiceProvider(new ArgumentPrompterServiceProvider(65, argumentPrompterService));
245
+ if (prompterService !== undefined) {
246
+ const argumentPrompterService = new DefaultArgumentPrompterService(prompterService);
247
+ this.addServiceProvider(new ArgumentPrompterServiceProvider(65, argumentPrompterService));
248
+ } else {
249
+ logger.debug(
250
+ "Skipping ArgumentPrompterServiceProvider: argumentPrompterServiceEnabled is true but prompting is unavailable",
251
+ );
252
+ }
225
253
  }
226
254
 
227
255
  if (this.#options.imagePrinterServiceEnabled) {
228
- this.addServiceProvider(new ImagePrinterServiceProvider(55, this.#stdoutTerminal));
256
+ if (this.#stdoutTerminal.isTty()) {
257
+ this.addServiceProvider(new ImagePrinterServiceProvider(55, this.#stdoutTerminal));
258
+ } else {
259
+ logger.debug(
260
+ "Skipping ImagePrinterServiceProvider: imagePrinterServiceEnabled is true but stdout is not a TTY",
261
+ );
262
+ }
229
263
  }
230
264
 
231
265
  if (this.#options.completionServiceEnabled) {
@@ -1,34 +1,78 @@
1
1
  import process from "node:process";
2
2
  import BaseCLI from "./BaseCLI.ts";
3
- import type RunResult from "../api/RunResult.ts";
4
- import type CLIConfig from "../api/CLIConfig.ts";
5
- import type BaseCLIFeatureOptions from "../api/BaseCLIFeatureOptions.ts";
3
+ import type { RunResult } from "@flowscripter/dynamic-cli-framework-api";
4
+ import type { CLIConfig } from "@flowscripter/dynamic-cli-framework-api";
5
+ import type BaseCLIFeatureOptions from "./BaseCLIFeatureOptions.ts";
6
6
  import { Writable } from "node:stream";
7
7
  import TtyTerminal from "../terminal/TtyTerminal.ts";
8
+ import NonTtyTerminal from "../terminal/NonTtyTerminal.ts";
8
9
  import TtyKeyReader from "../terminal/TtyKeyReader.ts";
9
10
  import TtyStyler from "../terminal/TtyStyler.ts";
10
11
  import supportsColor from "supports-color";
11
12
  import supportsHyperlinks from "../terminal/supportsHyperlinks.ts";
13
+ import getLogger from "../util/logger.ts";
14
+
15
+ const logger = getLogger("DefaultRuntimeCLI");
12
16
 
13
17
  /**
14
18
  * Default Bun implementation of a {@link CLI} using `process.stdout`, `process.stderr` and `process.argv`.
19
+ *
20
+ * Degrades gracefully when `stdin`, `stdout` or `stderr` are not TTYs (e.g. piped or redirected):
21
+ * color and hyperlinks are disabled, prompting is disabled, and non-TTY streams are wrapped in a
22
+ * {@link NonTtyTerminal} rather than the usual {@link TtyTerminal}.
15
23
  */
16
24
  export default class DefaultRuntimeCLI extends BaseCLI {
17
25
  constructor(cliConfig: CLIConfig, options?: BaseCLIFeatureOptions) {
26
+ const stdinIsTty = process.stdin.isTTY === true;
27
+ const stdoutIsTty = process.stdout.isTTY === true;
28
+ const stderrIsTty = process.stderr.isTTY === true;
29
+
30
+ logger.debug(
31
+ () =>
32
+ `stdin isTTY: ${stdinIsTty}, stdout isTTY: ${stdoutIsTty}, stderr isTTY: ${stderrIsTty}`,
33
+ );
34
+
35
+ const stdoutTerminal = stdoutIsTty
36
+ ? new TtyTerminal(process.stdout)
37
+ : new NonTtyTerminal(process.stdout);
38
+ const stderrTerminal = stderrIsTty
39
+ ? new TtyTerminal(process.stderr)
40
+ : new NonTtyTerminal(process.stderr);
41
+
42
+ logger.debug(
43
+ () =>
44
+ `stdout terminal: ${
45
+ stdoutIsTty ? "TtyTerminal" : "NonTtyTerminal"
46
+ }, stderr terminal: ${stderrIsTty ? "TtyTerminal" : "NonTtyTerminal"}`,
47
+ );
48
+
49
+ const colorLevel = stderrIsTty
50
+ ? supportsColor.stderr === false
51
+ ? 1
52
+ : supportsColor.stderr.level
53
+ : 0;
54
+
55
+ logger.debug(() => `color level: ${colorLevel}`);
56
+
57
+ const keyReader = stdinIsTty ? new TtyKeyReader(process.stdin) : undefined;
58
+
59
+ logger.debug(() => `keyReader constructed: ${keyReader !== undefined}`);
60
+
61
+ const promptingEnabled = stdinIsTty && stderrIsTty;
62
+
63
+ logger.debug(() => `promptingEnabled default: ${promptingEnabled}`);
64
+
18
65
  super(
19
66
  cliConfig,
20
67
  Writable.toWeb(process.stdout),
21
68
  Writable.toWeb(process.stderr),
22
69
  supportsColor.stdout !== false,
23
70
  supportsColor.stderr !== false,
24
- new TtyTerminal(process.stdout),
25
- new TtyTerminal(process.stderr),
26
- new TtyStyler(
27
- supportsColor.stderr === false ? 1 : supportsColor.stderr.level,
28
- supportsHyperlinks(process.stderr),
29
- ),
30
- new TtyKeyReader(process.stdin),
31
- { promptingEnabled: process.stdin.isTTY === true, ...options },
71
+ stdoutTerminal,
72
+ stderrTerminal,
73
+ new TtyStyler(colorLevel, supportsHyperlinks(process.stderr)),
74
+ keyReader,
75
+ { promptingEnabled, ...options },
32
76
  );
33
77
  }
34
78
 
@@ -1,14 +1,14 @@
1
1
  import type { MarketplacePluginManager } from "@flowscripter/dynamic-plugin-framework";
2
- import type CLIConfig from "../api/CLIConfig.ts";
3
- import type BaseCLIFeatureOptions from "../api/BaseCLIFeatureOptions.ts";
4
- import type RunResult from "../api/RunResult.ts";
5
- import { RunState } from "../api/RunResult.ts";
2
+ import type { CLIConfig } from "@flowscripter/dynamic-cli-framework-api";
3
+ import type BaseCLIFeatureOptions from "./BaseCLIFeatureOptions.ts";
4
+ import type { RunResult } from "@flowscripter/dynamic-cli-framework-api";
5
+ import { RunState } from "@flowscripter/dynamic-cli-framework-api";
6
6
  import DefaultRuntimeCLI from "./DefaultRuntimeCLI.ts";
7
7
  import DefaultPluginServiceProvider from "../service/plugin/DefaultPluginServiceProvider.ts";
8
- import { DYNAMIC_CLI_FRAMEWORK_COMMAND_FACTORY_EXTENSION_POINT } from "../api/plugin/CommandFactory.ts";
9
- import { DYNAMIC_CLI_FRAMEWORK_SERVICE_PROVIDER_FACTORY_EXTENSION_POINT } from "../api/plugin/ServiceProviderFactory.ts";
10
- import type CommandFactory from "../api/plugin/CommandFactory.ts";
11
- import type ServiceProviderFactory from "../api/plugin/ServiceProviderFactory.ts";
8
+ import { DYNAMIC_CLI_FRAMEWORK_COMMAND_FACTORY_EXTENSION_POINT } from "@flowscripter/dynamic-cli-framework-api";
9
+ import { DYNAMIC_CLI_FRAMEWORK_SERVICE_PROVIDER_FACTORY_EXTENSION_POINT } from "@flowscripter/dynamic-cli-framework-api";
10
+ import type { CommandFactory } from "@flowscripter/dynamic-cli-framework-api";
11
+ import type { ServiceProviderFactory } from "@flowscripter/dynamic-cli-framework-api";
12
12
  import process from "node:process";
13
13
 
14
14
  /**
@@ -1,14 +1,14 @@
1
- import type Positional from "../api/argument/Positional.ts";
2
- import type Option from "../api/argument/Option.ts";
3
- import type SubCommand from "../api/command/SubCommand.ts";
4
- import type GlobalCommand from "../api/command/GlobalCommand.ts";
5
- import type GroupCommand from "../api/command/GroupCommand.ts";
1
+ import type { Positional } from "@flowscripter/dynamic-cli-framework-api";
2
+ import type { Option } from "@flowscripter/dynamic-cli-framework-api";
3
+ import type { SubCommand } from "@flowscripter/dynamic-cli-framework-api";
4
+ import type { GlobalCommand } from "@flowscripter/dynamic-cli-framework-api";
5
+ import type { GroupCommand } from "@flowscripter/dynamic-cli-framework-api";
6
6
  import {
7
7
  type ArgumentSingleValueType,
8
8
  type ArgumentValues,
9
9
  ArgumentValueTypeName,
10
- } from "../api/argument/ArgumentValueTypes.ts";
11
- import type Context from "../api/Context.ts";
10
+ } from "@flowscripter/dynamic-cli-framework-api";
11
+ import type { Context } from "@flowscripter/dynamic-cli-framework-api";
12
12
  import type { HelpSection } from "../util/helpHelper.ts";
13
13
  import {
14
14
  findPossibleCommandNames,
@@ -19,12 +19,12 @@ import {
19
19
  getSubCommandArgumentsSyntax,
20
20
  printHelpSections,
21
21
  } from "../util/helpHelper.ts";
22
- import type GlobalModifierCommand from "../api/command/GlobalModifierCommand.ts";
23
- import type CommandRegistry from "../runtime/registry/CommandRegistry.ts";
24
- import type PrinterService from "../api/service/core/PrinterService.ts";
25
- import { Icon, PRINTER_SERVICE_ID } from "../api/service/core/PrinterService.ts";
26
- import type TableGeneratorService from "../api/service/core/TableGeneratorService.ts";
27
- import { TABLE_GENERATOR_SERVICE_ID } from "../api/service/core/TableGeneratorService.ts";
22
+ import type { GlobalModifierCommand } from "@flowscripter/dynamic-cli-framework-api";
23
+ import type { CommandRegistry } from "@flowscripter/dynamic-cli-framework-api";
24
+ import type { PrinterService } from "@flowscripter/dynamic-cli-framework-api";
25
+ import { Icon, PRINTER_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
26
+ import type { TableGeneratorService } from "@flowscripter/dynamic-cli-framework-api";
27
+ import { TABLE_GENERATOR_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
28
28
 
29
29
  /**
30
30
  * Provides common implementation for both {@link MultiCommandCliHelpGlobalCommand} and {@link MultiCommandCliHelpSubCommand}.
@@ -1,8 +1,8 @@
1
- import type GlobalCommand from "../api/command/GlobalCommand.ts";
2
- import type SubCommand from "../api/command/SubCommand.ts";
3
- import type Option from "../api/argument/Option.ts";
4
- import type Positional from "../api/argument/Positional.ts";
5
- import type Context from "../api/Context.ts";
1
+ import type { GlobalCommand } from "@flowscripter/dynamic-cli-framework-api";
2
+ import type { SubCommand } from "@flowscripter/dynamic-cli-framework-api";
3
+ import type { Option } from "@flowscripter/dynamic-cli-framework-api";
4
+ import type { Positional } from "@flowscripter/dynamic-cli-framework-api";
5
+ import type { Context } from "@flowscripter/dynamic-cli-framework-api";
6
6
  import {
7
7
  getCommandArgsHelpSections,
8
8
  getCommandExamplesHelpSections,
@@ -12,13 +12,13 @@ import {
12
12
  type HelpSection,
13
13
  printHelpSections,
14
14
  } from "../util/helpHelper.ts";
15
- import type GlobalModifierCommand from "../api/command/GlobalModifierCommand.ts";
16
- import type GroupCommand from "../api/command/GroupCommand.ts";
17
- import type CommandRegistry from "../runtime/registry/CommandRegistry.ts";
18
- import type PrinterService from "../api/service/core/PrinterService.ts";
19
- import { PRINTER_SERVICE_ID } from "../api/service/core/PrinterService.ts";
20
- import type TableGeneratorService from "../api/service/core/TableGeneratorService.ts";
21
- import { TABLE_GENERATOR_SERVICE_ID } from "../api/service/core/TableGeneratorService.ts";
15
+ import type { GlobalModifierCommand } from "@flowscripter/dynamic-cli-framework-api";
16
+ import type { GroupCommand } from "@flowscripter/dynamic-cli-framework-api";
17
+ import type { CommandRegistry } from "@flowscripter/dynamic-cli-framework-api";
18
+ import type { PrinterService } from "@flowscripter/dynamic-cli-framework-api";
19
+ import { PRINTER_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
20
+ import type { TableGeneratorService } from "@flowscripter/dynamic-cli-framework-api";
21
+ import { TABLE_GENERATOR_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
22
22
 
23
23
  /**
24
24
  * Provides common implementation for both {@link SingleCommandCliHelpGlobalCommand} and {@link SingleCommandCliHelpSubCommand}.
@@ -1,8 +1,8 @@
1
- import type Context from "../api/Context.ts";
2
- import type GlobalCommand from "../api/command/GlobalCommand.ts";
3
- import type Command from "../api/command/Command.ts";
4
- import type PrinterService from "../api/service/core/PrinterService.ts";
5
- import { PRINTER_SERVICE_ID } from "../api/service/core/PrinterService.ts";
1
+ import type { Context } from "@flowscripter/dynamic-cli-framework-api";
2
+ import type { GlobalCommand } from "@flowscripter/dynamic-cli-framework-api";
3
+ import type { Command } from "@flowscripter/dynamic-cli-framework-api";
4
+ import type { PrinterService } from "@flowscripter/dynamic-cli-framework-api";
5
+ import { PRINTER_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
6
6
 
7
7
  /**
8
8
  * Command printing basic CLI usage.
@@ -1,7 +1,7 @@
1
- import type Context from "../api/Context.ts";
2
- import type GlobalCommand from "../api/command/GlobalCommand.ts";
3
- import type PrinterService from "../api/service/core/PrinterService.ts";
4
- import { PRINTER_SERVICE_ID } from "../api/service/core/PrinterService.ts";
1
+ import type { Context } from "@flowscripter/dynamic-cli-framework-api";
2
+ import type { GlobalCommand } from "@flowscripter/dynamic-cli-framework-api";
3
+ import type { PrinterService } from "@flowscripter/dynamic-cli-framework-api";
4
+ import { PRINTER_SERVICE_ID } from "@flowscripter/dynamic-cli-framework-api";
5
5
 
6
6
  /**
7
7
  * Implementation of a {@link GlobalCommand} which outputs the version of the CLI.