@flowscripter/dynamic-cli-framework 1.7.3 → 1.7.5

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 (369) hide show
  1. package/cli-plugin.ts +1 -1
  2. package/dist/cli-plugin.d.ts +1 -1
  3. package/dist/cli-plugin.d.ts.map +1 -1
  4. package/dist/cli-plugin.js +25 -247
  5. package/dist/index.js +70 -105754
  6. package/dist/src/api/BaseCLIFeatureOptions.js +0 -0
  7. package/dist/src/api/CLI.js +0 -0
  8. package/dist/src/api/CLIConfig.js +0 -0
  9. package/dist/src/api/Context.js +0 -0
  10. package/dist/src/api/RunResult.js +73 -0
  11. package/dist/src/api/argument/Argument.js +0 -0
  12. package/dist/src/api/argument/ArgumentValueTypes.js +18 -0
  13. package/dist/src/api/argument/ComplexOption.js +1 -0
  14. package/dist/src/api/argument/GlobalCommandArgument.js +0 -0
  15. package/dist/src/api/argument/Option.js +0 -0
  16. package/dist/src/api/argument/Positional.js +0 -0
  17. package/dist/src/api/argument/SubCommandArgument.js +1 -0
  18. package/dist/src/api/command/Command.js +0 -0
  19. package/dist/src/api/command/GlobalCommand.js +0 -0
  20. package/dist/src/api/command/GlobalModifierCommand.js +0 -0
  21. package/dist/src/api/command/GroupCommand.js +0 -0
  22. package/dist/src/api/command/SubCommand.js +0 -0
  23. package/dist/src/api/command/UsageExample.js +0 -0
  24. package/dist/src/api/plugin/CLIPlugin.js +2 -0
  25. package/dist/src/api/plugin/CommandFactory.js +7 -0
  26. package/dist/src/api/plugin/ServiceProviderFactory.js +7 -0
  27. package/dist/src/api/plugin/createCLIPlugin.js +30 -0
  28. package/dist/src/api/service/ServiceProvider.js +0 -0
  29. package/dist/src/api/service/core/ArgumentPrompterService.js +1 -0
  30. package/dist/src/api/service/core/AsciiBannerGeneratorService.js +1 -0
  31. package/dist/src/api/service/core/CompletionService.js +8 -0
  32. package/dist/src/api/service/core/DataDumpGeneratorService.js +7 -0
  33. package/dist/src/api/service/core/ImagePrinterService.js +1 -0
  34. package/dist/src/api/service/core/KeyValueService.js +7 -0
  35. package/dist/src/api/service/core/PluginService.js +6 -0
  36. package/dist/src/api/service/core/PrettyPrinterService.js +1 -0
  37. package/dist/src/api/service/core/PrinterService.js +42 -0
  38. package/dist/src/api/service/core/PrompterService.js +10 -0
  39. package/dist/src/api/service/core/SecretService.js +0 -0
  40. package/dist/src/api/service/core/ShutdownService.js +1 -0
  41. package/dist/src/api/service/core/SyntaxHighlighterService.js +1 -0
  42. package/dist/src/api/service/core/Table.js +49 -0
  43. package/dist/src/api/service/core/TableGeneratorService.d.ts +1 -0
  44. package/dist/src/api/service/core/TableGeneratorService.d.ts.map +1 -1
  45. package/dist/src/api/service/core/TableGeneratorService.js +7 -0
  46. package/dist/src/api/service/core/TreePrinterService.js +1 -0
  47. package/dist/src/cli/BaseCLI.d.ts.map +1 -1
  48. package/dist/src/cli/BaseCLI.js +232 -0
  49. package/dist/src/cli/DefaultRuntimeCLI.js +20 -0
  50. package/dist/src/cli/DynamicPluginRuntimeCLI.js +50 -0
  51. package/dist/src/command/MultiCommandCliHelpCommand.js +238 -0
  52. package/dist/src/command/SingleCommandCliHelpCommand.js +104 -0
  53. package/dist/src/command/UsageCommand.js +16 -0
  54. package/dist/src/command/VersionCommand.js +13 -0
  55. package/dist/src/launcher.js +61 -0
  56. package/dist/src/runtime/DefaultContext.js +25 -0
  57. package/dist/src/runtime/argument/ArgumentTypeGuards.js +3 -0
  58. package/dist/src/runtime/command/CommandTypeGuards.js +12 -0
  59. package/dist/src/runtime/command/CommandValidator.js +371 -0
  60. package/dist/src/runtime/parser.js +105 -0
  61. package/dist/src/runtime/registry/CommandRegistry.js +0 -0
  62. package/dist/src/runtime/registry/DefaultCommandRegistry.js +190 -0
  63. package/dist/src/runtime/registry/DefaultServiceProviderRegistry.js +20 -0
  64. package/dist/src/runtime/registry/ServiceProviderRegistry.js +0 -0
  65. package/dist/src/runtime/runner.js +507 -0
  66. package/dist/src/runtime/scanner.js +244 -0
  67. package/dist/src/runtime/values/ValuePopulationResult.js +0 -0
  68. package/dist/src/runtime/values/argumentValueMerge.js +122 -0
  69. package/dist/src/runtime/values/argumentValueValidation.js +505 -0
  70. package/dist/src/runtime/values/globalCommandValuePopulation.js +67 -0
  71. package/dist/src/runtime/values/subCommandValuePopulation.js +549 -0
  72. package/dist/src/service/argumentPrompter/ArgumentPrompterServiceProvider.js +19 -0
  73. package/dist/src/service/argumentPrompter/DefaultArgumentPrompterService.js +197 -0
  74. package/dist/src/service/asciiBannerGenerator/AsciiBannerGeneratorServiceProvider.js +28 -0
  75. package/dist/src/service/asciiBannerGenerator/DefaultAsciiBannerGeneratorService.js +233 -0
  76. package/dist/src/service/asciiBannerGenerator/standard.flf.json +3 -0
  77. package/dist/src/service/banner/BannerServiceProvider.js +60 -0
  78. package/dist/src/service/banner/command/NoBannerCommand.js +24 -0
  79. package/dist/src/service/chiselAsciiBannerGenerator/ChiselFontAsciiBannerGeneratorService.js +51 -0
  80. package/dist/src/service/chiselAsciiBannerGenerator/chisel.flf.json +3 -0
  81. package/dist/src/service/completion/CompletionServiceProvider.d.ts +2 -1
  82. package/dist/src/service/completion/CompletionServiceProvider.d.ts.map +1 -1
  83. package/dist/src/service/completion/CompletionServiceProvider.js +159 -0
  84. package/dist/src/service/completion/DefaultCompletionService.js +279 -0
  85. package/dist/src/service/completion/command/CompletionCompleteSubCommand.d.ts +15 -0
  86. package/dist/src/service/completion/command/CompletionCompleteSubCommand.d.ts.map +1 -0
  87. package/dist/src/service/completion/command/CompletionCompleteSubCommand.js +37 -0
  88. package/dist/src/service/completion/command/CompletionGroupCommand.d.ts +14 -0
  89. package/dist/src/service/completion/command/CompletionGroupCommand.d.ts.map +1 -0
  90. package/dist/src/service/completion/command/CompletionGroupCommand.js +10 -0
  91. package/dist/src/service/completion/command/CompletionIntegrationSubCommand.d.ts +14 -0
  92. package/dist/src/service/completion/command/CompletionIntegrationSubCommand.d.ts.map +1 -0
  93. package/dist/src/service/completion/command/CompletionIntegrationSubCommand.js +67 -0
  94. package/dist/src/service/completion/shell/ShellHandler.js +0 -0
  95. package/dist/src/service/completion/shell/bash.js +39 -0
  96. package/dist/src/service/completion/shell/fish.js +35 -0
  97. package/dist/src/service/completion/shell/powershell.js +51 -0
  98. package/dist/src/service/completion/shell/zsh.js +42 -0
  99. package/dist/src/service/configuration/ConfigurationServiceProvider.js +482 -0
  100. package/dist/src/service/configuration/DefaultKeyValueService.js +80 -0
  101. package/dist/src/service/configuration/DefaultSecretService.js +60 -0
  102. package/dist/src/service/configuration/command/ConfigCommand.js +24 -0
  103. package/dist/src/service/configuration/command/DumpConfigCommand.js +18 -0
  104. package/dist/src/service/dataDumpGenerator/DataDumpGeneratorServiceProvider.js +24 -0
  105. package/dist/src/service/dataDumpGenerator/DefaultDataDumpGeneratorService.js +59 -0
  106. package/dist/src/service/imagePrinter/DefaultImagePrinterService.js +10 -0
  107. package/dist/src/service/imagePrinter/ImagePrinterServiceProvider.js +20 -0
  108. package/dist/src/service/plugin/DefaultPluginService.js +21 -0
  109. package/dist/src/service/plugin/DefaultPluginServiceProvider.d.ts +1 -1
  110. package/dist/src/service/plugin/DefaultPluginServiceProvider.d.ts.map +1 -1
  111. package/dist/src/service/plugin/DefaultPluginServiceProvider.js +21 -0
  112. package/dist/src/service/plugin/command/PluginAddSubCommand.d.ts +17 -0
  113. package/dist/src/service/plugin/command/PluginAddSubCommand.d.ts.map +1 -0
  114. package/dist/src/service/plugin/command/PluginAddSubCommand.js +49 -0
  115. package/dist/src/service/plugin/command/PluginGroupCommand.d.ts +12 -0
  116. package/dist/src/service/plugin/command/PluginGroupCommand.d.ts.map +1 -0
  117. package/dist/src/service/plugin/command/PluginGroupCommand.js +21 -0
  118. package/dist/src/service/plugin/command/PluginListSubCommand.d.ts +12 -0
  119. package/dist/src/service/plugin/command/PluginListSubCommand.d.ts.map +1 -0
  120. package/dist/src/service/plugin/command/PluginListSubCommand.js +25 -0
  121. package/dist/src/service/plugin/command/PluginRemoveSubCommand.d.ts +17 -0
  122. package/dist/src/service/plugin/command/PluginRemoveSubCommand.d.ts.map +1 -0
  123. package/dist/src/service/plugin/command/PluginRemoveSubCommand.js +24 -0
  124. package/dist/src/service/plugin/command/PluginSearchSubCommand.d.ts +18 -0
  125. package/dist/src/service/plugin/command/PluginSearchSubCommand.d.ts.map +1 -0
  126. package/dist/src/service/plugin/command/PluginSearchSubCommand.js +34 -0
  127. package/dist/src/service/plugin/command/PluginUpgradeSubCommand.d.ts +12 -0
  128. package/dist/src/service/plugin/command/PluginUpgradeSubCommand.d.ts.map +1 -0
  129. package/dist/src/service/plugin/command/PluginUpgradeSubCommand.js +25 -0
  130. package/dist/src/service/plugin/command/getPluginId.d.ts +3 -0
  131. package/dist/src/service/plugin/command/getPluginId.d.ts.map +1 -0
  132. package/dist/src/service/plugin/command/getPluginId.js +3 -0
  133. package/dist/src/service/prettyPrinter/DefaultPrettyPrinterService.js +45 -0
  134. package/dist/src/service/prettyPrinter/PrettyPrinterServiceProvider.js +28 -0
  135. package/dist/src/service/printer/DefaultPrinterService.js +250 -0
  136. package/dist/src/service/printer/PrinterServiceProvider.js +43 -0
  137. package/dist/src/service/printer/command/DarkModeCommand.js +24 -0
  138. package/dist/src/service/printer/command/LogLevelCommand.js +41 -0
  139. package/dist/src/service/printer/command/NoColorCommand.js +24 -0
  140. package/dist/src/service/printer/command/NoHyperlinksCommand.js +21 -0
  141. package/dist/src/service/printer/terminal/Color.js +15 -0
  142. package/dist/src/service/printer/terminal/Progress.js +271 -0
  143. package/dist/src/service/printer/terminal/Spinner.js +83 -0
  144. package/dist/src/service/printer/terminal/Theme.js +26 -0
  145. package/dist/src/service/prompter/DefaultPrompterService.js +52 -0
  146. package/dist/src/service/prompter/PrompterServiceProvider.js +20 -0
  147. package/dist/src/service/prompter/command/NoPromptCommand.js +21 -0
  148. package/dist/src/service/prompter/prompt/PromptContext.js +22 -0
  149. package/dist/src/service/prompter/prompt/promptAcknowledge.js +19 -0
  150. package/dist/src/service/prompter/prompt/promptMultiSelect.js +74 -0
  151. package/dist/src/service/prompter/prompt/promptOpenUrl.js +70 -0
  152. package/dist/src/service/prompter/prompt/promptSingleSelect.js +73 -0
  153. package/dist/src/service/prompter/prompt/promptText.js +75 -0
  154. package/dist/src/service/prompter/prompt/promptToggle.js +21 -0
  155. package/dist/src/service/shutdown/DefaultShutdownService.js +16 -0
  156. package/dist/src/service/shutdown/ShutdownServiceProvider.js +60 -0
  157. package/dist/src/service/shutdown/ShutdownState.js +5 -0
  158. package/dist/src/service/syntaxHighlighter/DefaultSyntaxHighlighterService.js +54 -0
  159. package/dist/src/service/syntaxHighlighter/SyntaxHighlighterServiceProvider.js +32 -0
  160. package/dist/src/service/tableGenerator/DefaultTableGeneratorService.d.ts +3 -1
  161. package/dist/src/service/tableGenerator/DefaultTableGeneratorService.d.ts.map +1 -1
  162. package/dist/src/service/tableGenerator/DefaultTableGeneratorService.js +344 -0
  163. package/dist/src/service/tableGenerator/TableGeneratorServiceProvider.js +26 -0
  164. package/dist/src/service/treePrinter/DefaultTreePrinterService.js +35 -0
  165. package/dist/src/service/treePrinter/TreePrinterServiceProvider.js +24 -0
  166. package/dist/src/terminal/Ansi.js +23 -0
  167. package/dist/src/terminal/ImageRenderer.d.ts.map +1 -1
  168. package/dist/src/terminal/ImageRenderer.js +166 -0
  169. package/dist/src/terminal/KeyReader.js +13 -0
  170. package/dist/src/terminal/PngDecoder.js +115 -0
  171. package/dist/src/terminal/Styler.js +0 -0
  172. package/dist/src/terminal/Terminal.js +0 -0
  173. package/dist/src/terminal/TtyKeyReader.js +87 -0
  174. package/dist/src/terminal/TtyStyler.js +55 -0
  175. package/dist/src/terminal/TtyTerminal.js +52 -0
  176. package/dist/src/terminal/supportsHyperlinks.js +95 -0
  177. package/dist/src/util/configHelper.js +61 -0
  178. package/dist/src/util/envVarHelper.js +216 -0
  179. package/dist/src/util/helpHelper.d.ts.map +1 -1
  180. package/dist/src/util/helpHelper.js +497 -0
  181. package/dist/src/util/logger.js +81 -0
  182. package/dist/src/util/runnerHelper.js +80 -0
  183. package/package.json +2 -2
  184. package/src/api/service/core/TableGeneratorService.ts +1 -0
  185. package/src/cli/BaseCLI.ts +4 -19
  186. package/src/service/completion/CompletionServiceProvider.ts +16 -3
  187. package/src/service/completion/command/CompletionCompleteSubCommand.ts +59 -0
  188. package/src/service/completion/command/CompletionGroupCommand.ts +21 -0
  189. package/src/{command/CompletionCommand.ts → service/completion/command/CompletionIntegrationSubCommand.ts} +12 -73
  190. package/src/service/completion/shell/bash.ts +1 -1
  191. package/src/service/completion/shell/fish.ts +1 -1
  192. package/src/service/completion/shell/powershell.ts +1 -1
  193. package/src/service/completion/shell/zsh.ts +1 -1
  194. package/src/service/plugin/DefaultPluginServiceProvider.ts +2 -2
  195. package/src/service/plugin/command/PluginAddSubCommand.ts +64 -0
  196. package/src/service/plugin/command/PluginGroupCommand.ts +27 -0
  197. package/src/service/plugin/command/PluginListSubCommand.ts +33 -0
  198. package/src/service/plugin/command/PluginRemoveSubCommand.ts +32 -0
  199. package/src/service/plugin/command/PluginSearchSubCommand.ts +42 -0
  200. package/src/service/plugin/command/PluginUpgradeSubCommand.ts +36 -0
  201. package/src/service/plugin/command/getPluginId.ts +5 -0
  202. package/src/service/tableGenerator/DefaultTableGeneratorService.ts +6 -1
  203. package/src/terminal/ImageRenderer.ts +7 -5
  204. package/src/util/helpHelper.ts +1 -2
  205. package/dist/src/command/CompletionCommand.d.ts +0 -32
  206. package/dist/src/command/CompletionCommand.d.ts.map +0 -1
  207. package/dist/src/command/PluginCommand.d.ts +0 -67
  208. package/dist/src/command/PluginCommand.d.ts.map +0 -1
  209. package/dist/tests/cli/BaseCLI.test.d.ts +0 -2
  210. package/dist/tests/cli/BaseCLI.test.d.ts.map +0 -1
  211. package/dist/tests/cli/DynamicPluginRuntimeCLI.test.d.ts +0 -2
  212. package/dist/tests/cli/DynamicPluginRuntimeCLI.test.d.ts.map +0 -1
  213. package/dist/tests/command/CompletionCommand.test.d.ts +0 -2
  214. package/dist/tests/command/CompletionCommand.test.d.ts.map +0 -1
  215. package/dist/tests/command/MultiCommandCliHelpCommand.test.d.ts +0 -2
  216. package/dist/tests/command/MultiCommandCliHelpCommand.test.d.ts.map +0 -1
  217. package/dist/tests/command/PluginCommand.test.d.ts +0 -2
  218. package/dist/tests/command/PluginCommand.test.d.ts.map +0 -1
  219. package/dist/tests/command/SingleCommandCliHelpCommand.test.d.ts +0 -2
  220. package/dist/tests/command/SingleCommandCliHelpCommand.test.d.ts.map +0 -1
  221. package/dist/tests/command/UsageCommand.test.d.ts +0 -2
  222. package/dist/tests/command/UsageCommand.test.d.ts.map +0 -1
  223. package/dist/tests/command/VersionCommand.test.d.ts +0 -2
  224. package/dist/tests/command/VersionCommand.test.d.ts.map +0 -1
  225. package/dist/tests/fixtures/CLIConfig.d.ts +0 -3
  226. package/dist/tests/fixtures/CLIConfig.d.ts.map +0 -1
  227. package/dist/tests/fixtures/Command.d.ts +0 -20
  228. package/dist/tests/fixtures/Command.d.ts.map +0 -1
  229. package/dist/tests/fixtures/CommandRegistry.d.ts +0 -4
  230. package/dist/tests/fixtures/CommandRegistry.d.ts.map +0 -1
  231. package/dist/tests/fixtures/ConfigurationServiceProvider.d.ts +0 -10
  232. package/dist/tests/fixtures/ConfigurationServiceProvider.d.ts.map +0 -1
  233. package/dist/tests/fixtures/Context.d.ts +0 -4
  234. package/dist/tests/fixtures/Context.d.ts.map +0 -1
  235. package/dist/tests/fixtures/ServiceProviderRegistry.d.ts +0 -4
  236. package/dist/tests/fixtures/ServiceProviderRegistry.d.ts.map +0 -1
  237. package/dist/tests/fixtures/StreamString.d.ts +0 -10
  238. package/dist/tests/fixtures/StreamString.d.ts.map +0 -1
  239. package/dist/tests/fixtures/prettierPluginFoo.d.ts +0 -4
  240. package/dist/tests/fixtures/prettierPluginFoo.d.ts.map +0 -1
  241. package/dist/tests/fixtures/util.d.ts +0 -8
  242. package/dist/tests/fixtures/util.d.ts.map +0 -1
  243. package/dist/tests/runtime/DefaultContext.test.d.ts +0 -2
  244. package/dist/tests/runtime/DefaultContext.test.d.ts.map +0 -1
  245. package/dist/tests/runtime/argument/ArgumentTypeGuards.test.d.ts +0 -2
  246. package/dist/tests/runtime/argument/ArgumentTypeGuards.test.d.ts.map +0 -1
  247. package/dist/tests/runtime/command/CommandTypeGuards.test.d.ts +0 -2
  248. package/dist/tests/runtime/command/CommandTypeGuards.test.d.ts.map +0 -1
  249. package/dist/tests/runtime/command/CommandValidator.test.d.ts +0 -2
  250. package/dist/tests/runtime/command/CommandValidator.test.d.ts.map +0 -1
  251. package/dist/tests/runtime/parser.test.d.ts +0 -2
  252. package/dist/tests/runtime/parser.test.d.ts.map +0 -1
  253. package/dist/tests/runtime/registry/DefaultCommandRegistry.test.d.ts +0 -2
  254. package/dist/tests/runtime/registry/DefaultCommandRegistry.test.d.ts.map +0 -1
  255. package/dist/tests/runtime/registry/DefaultServiceProviderRegistry.test.d.ts +0 -2
  256. package/dist/tests/runtime/registry/DefaultServiceProviderRegistry.test.d.ts.map +0 -1
  257. package/dist/tests/runtime/runner.test.d.ts +0 -2
  258. package/dist/tests/runtime/runner.test.d.ts.map +0 -1
  259. package/dist/tests/runtime/scanner.test.d.ts +0 -2
  260. package/dist/tests/runtime/scanner.test.d.ts.map +0 -1
  261. package/dist/tests/runtime/values/argumentValueMerge.test.d.ts +0 -2
  262. package/dist/tests/runtime/values/argumentValueMerge.test.d.ts.map +0 -1
  263. package/dist/tests/runtime/values/argumentValueValidation.test.d.ts +0 -2
  264. package/dist/tests/runtime/values/argumentValueValidation.test.d.ts.map +0 -1
  265. package/dist/tests/runtime/values/globalCommandValuePopulation.test.d.ts +0 -2
  266. package/dist/tests/runtime/values/globalCommandValuePopulation.test.d.ts.map +0 -1
  267. package/dist/tests/runtime/values/subCommandValuePopulation.test.d.ts +0 -2
  268. package/dist/tests/runtime/values/subCommandValuePopulation.test.d.ts.map +0 -1
  269. package/dist/tests/service/argumentPrompter/ArgumentPrompterServiceProvider.test.d.ts +0 -2
  270. package/dist/tests/service/argumentPrompter/ArgumentPrompterServiceProvider.test.d.ts.map +0 -1
  271. package/dist/tests/service/argumentPrompter/DefaultArgumentPrompterService.test.d.ts +0 -2
  272. package/dist/tests/service/argumentPrompter/DefaultArgumentPrompterService.test.d.ts.map +0 -1
  273. package/dist/tests/service/asciiBannerGenerator/AsciiBannerGeneratorServiceProvider.test.d.ts +0 -2
  274. package/dist/tests/service/asciiBannerGenerator/AsciiBannerGeneratorServiceProvider.test.d.ts.map +0 -1
  275. package/dist/tests/service/asciiBannerGenerator/DefaultAsciiBannerGeneratorService.test.d.ts +0 -2
  276. package/dist/tests/service/asciiBannerGenerator/DefaultAsciiBannerGeneratorService.test.d.ts.map +0 -1
  277. package/dist/tests/service/banner/BannerServiceProvider.test.d.ts +0 -2
  278. package/dist/tests/service/banner/BannerServiceProvider.test.d.ts.map +0 -1
  279. package/dist/tests/service/banner/command/NoBannerCommand.test.d.ts +0 -2
  280. package/dist/tests/service/banner/command/NoBannerCommand.test.d.ts.map +0 -1
  281. package/dist/tests/service/chiselAsciiBannerGenerator/ChiselFontAsciiBannerGeneratorService.test.d.ts +0 -2
  282. package/dist/tests/service/chiselAsciiBannerGenerator/ChiselFontAsciiBannerGeneratorService.test.d.ts.map +0 -1
  283. package/dist/tests/service/completion/CompletionServiceProvider.test.d.ts +0 -2
  284. package/dist/tests/service/completion/CompletionServiceProvider.test.d.ts.map +0 -1
  285. package/dist/tests/service/completion/DefaultCompletionService.test.d.ts +0 -2
  286. package/dist/tests/service/completion/DefaultCompletionService.test.d.ts.map +0 -1
  287. package/dist/tests/service/completion/shell/bash.test.d.ts +0 -2
  288. package/dist/tests/service/completion/shell/bash.test.d.ts.map +0 -1
  289. package/dist/tests/service/completion/shell/fish.test.d.ts +0 -2
  290. package/dist/tests/service/completion/shell/fish.test.d.ts.map +0 -1
  291. package/dist/tests/service/completion/shell/powershell.test.d.ts +0 -2
  292. package/dist/tests/service/completion/shell/powershell.test.d.ts.map +0 -1
  293. package/dist/tests/service/completion/shell/zsh.test.d.ts +0 -2
  294. package/dist/tests/service/completion/shell/zsh.test.d.ts.map +0 -1
  295. package/dist/tests/service/configuration/ConfigurationServiceProvider.test.d.ts +0 -2
  296. package/dist/tests/service/configuration/ConfigurationServiceProvider.test.d.ts.map +0 -1
  297. package/dist/tests/service/configuration/DefaultKeyValueService.test.d.ts +0 -2
  298. package/dist/tests/service/configuration/DefaultKeyValueService.test.d.ts.map +0 -1
  299. package/dist/tests/service/configuration/DefaultSecretService.test.d.ts +0 -2
  300. package/dist/tests/service/configuration/DefaultSecretService.test.d.ts.map +0 -1
  301. package/dist/tests/service/configuration/command/ConfigCommand.test.d.ts +0 -2
  302. package/dist/tests/service/configuration/command/ConfigCommand.test.d.ts.map +0 -1
  303. package/dist/tests/service/configuration/command/DumpConfigCommand.test.d.ts +0 -2
  304. package/dist/tests/service/configuration/command/DumpConfigCommand.test.d.ts.map +0 -1
  305. package/dist/tests/service/dataDumpGenerator/DataDumpGeneratorServiceProvider.test.d.ts +0 -2
  306. package/dist/tests/service/dataDumpGenerator/DataDumpGeneratorServiceProvider.test.d.ts.map +0 -1
  307. package/dist/tests/service/dataDumpGenerator/DefaultDataDumpGeneratorService.test.d.ts +0 -2
  308. package/dist/tests/service/dataDumpGenerator/DefaultDataDumpGeneratorService.test.d.ts.map +0 -1
  309. package/dist/tests/service/imagePrinter/DefaultImagePrinterService.test.d.ts +0 -2
  310. package/dist/tests/service/imagePrinter/DefaultImagePrinterService.test.d.ts.map +0 -1
  311. package/dist/tests/service/imagePrinter/ImagePrinterServiceProvider.test.d.ts +0 -2
  312. package/dist/tests/service/imagePrinter/ImagePrinterServiceProvider.test.d.ts.map +0 -1
  313. package/dist/tests/service/plugin/DefaultPluginServiceProvider.test.d.ts +0 -2
  314. package/dist/tests/service/plugin/DefaultPluginServiceProvider.test.d.ts.map +0 -1
  315. package/dist/tests/service/prettyPrinter/DefaultPrettyPrinterService.test.d.ts +0 -2
  316. package/dist/tests/service/prettyPrinter/DefaultPrettyPrinterService.test.d.ts.map +0 -1
  317. package/dist/tests/service/prettyPrinter/PrettyPrinterServiceProvider.test.d.ts +0 -2
  318. package/dist/tests/service/prettyPrinter/PrettyPrinterServiceProvider.test.d.ts.map +0 -1
  319. package/dist/tests/service/printer/DefaultPrinterService.test.d.ts +0 -2
  320. package/dist/tests/service/printer/DefaultPrinterService.test.d.ts.map +0 -1
  321. package/dist/tests/service/printer/PrinterServiceProvider.test.d.ts +0 -2
  322. package/dist/tests/service/printer/PrinterServiceProvider.test.d.ts.map +0 -1
  323. package/dist/tests/service/printer/command/DarkModeCommand.test.d.ts +0 -2
  324. package/dist/tests/service/printer/command/DarkModeCommand.test.d.ts.map +0 -1
  325. package/dist/tests/service/printer/command/LogLevelCommand.test.d.ts +0 -2
  326. package/dist/tests/service/printer/command/LogLevelCommand.test.d.ts.map +0 -1
  327. package/dist/tests/service/printer/command/NoColorCommand.test.d.ts +0 -2
  328. package/dist/tests/service/printer/command/NoColorCommand.test.d.ts.map +0 -1
  329. package/dist/tests/service/printer/command/NoHyperlinksCommand.test.d.ts +0 -2
  330. package/dist/tests/service/printer/command/NoHyperlinksCommand.test.d.ts.map +0 -1
  331. package/dist/tests/service/printer/terminal/Progress.test.d.ts +0 -2
  332. package/dist/tests/service/printer/terminal/Progress.test.d.ts.map +0 -1
  333. package/dist/tests/service/printer/terminal/Spinner.test.d.ts +0 -2
  334. package/dist/tests/service/printer/terminal/Spinner.test.d.ts.map +0 -1
  335. package/dist/tests/service/prompter/DefaultPrompterService.test.d.ts +0 -2
  336. package/dist/tests/service/prompter/DefaultPrompterService.test.d.ts.map +0 -1
  337. package/dist/tests/service/prompter/PrompterServiceProvider.test.d.ts +0 -2
  338. package/dist/tests/service/prompter/PrompterServiceProvider.test.d.ts.map +0 -1
  339. package/dist/tests/service/prompter/command/NoPromptCommand.test.d.ts +0 -2
  340. package/dist/tests/service/prompter/command/NoPromptCommand.test.d.ts.map +0 -1
  341. package/dist/tests/service/prompter/prompt/PromptContext.test.d.ts +0 -2
  342. package/dist/tests/service/prompter/prompt/PromptContext.test.d.ts.map +0 -1
  343. package/dist/tests/service/shutdown/ShutdownServiceProvider.test.d.ts +0 -2
  344. package/dist/tests/service/shutdown/ShutdownServiceProvider.test.d.ts.map +0 -1
  345. package/dist/tests/service/syntaxHighlighter/DefaultSyntaxHighlighterService.test.d.ts +0 -2
  346. package/dist/tests/service/syntaxHighlighter/DefaultSyntaxHighlighterService.test.d.ts.map +0 -1
  347. package/dist/tests/service/syntaxHighlighter/SyntaxHighlighterServiceProvider.test.d.ts +0 -2
  348. package/dist/tests/service/syntaxHighlighter/SyntaxHighlighterServiceProvider.test.d.ts.map +0 -1
  349. package/dist/tests/service/tableGenerator/DefaultTableGeneratorService.test.d.ts +0 -2
  350. package/dist/tests/service/tableGenerator/DefaultTableGeneratorService.test.d.ts.map +0 -1
  351. package/dist/tests/service/tableGenerator/TableGeneratorServiceProvider.test.d.ts +0 -2
  352. package/dist/tests/service/tableGenerator/TableGeneratorServiceProvider.test.d.ts.map +0 -1
  353. package/dist/tests/service/treePrinter/DefaultTreePrinterService.test.d.ts +0 -2
  354. package/dist/tests/service/treePrinter/DefaultTreePrinterService.test.d.ts.map +0 -1
  355. package/dist/tests/service/treePrinter/TreePrinterServiceProvider.test.d.ts +0 -2
  356. package/dist/tests/service/treePrinter/TreePrinterServiceProvider.test.d.ts.map +0 -1
  357. package/dist/tests/terminal/ImageRenderer.test.d.ts +0 -2
  358. package/dist/tests/terminal/ImageRenderer.test.d.ts.map +0 -1
  359. package/dist/tests/terminal/PngDecoder.test.d.ts +0 -2
  360. package/dist/tests/terminal/PngDecoder.test.d.ts.map +0 -1
  361. package/dist/tests/terminal/supportsHyperlinks.test.d.ts +0 -2
  362. package/dist/tests/terminal/supportsHyperlinks.test.d.ts.map +0 -1
  363. package/dist/tests/util/configHelper.test.d.ts +0 -2
  364. package/dist/tests/util/configHelper.test.d.ts.map +0 -1
  365. package/dist/tests/util/envVarHelper.test.d.ts +0 -2
  366. package/dist/tests/util/envVarHelper.test.d.ts.map +0 -1
  367. package/dist/tests/util/logger.test.d.ts +0 -2
  368. package/dist/tests/util/logger.test.d.ts.map +0 -1
  369. package/src/command/PluginCommand.ts +0 -197
@@ -0,0 +1,197 @@
1
+ import { PromptType, } from "../../api/service/core/PrompterService.js";
2
+ import { InvalidArgumentReason } from "../../api/RunResult.js";
3
+ import { ArgumentValueTypeName, ComplexValueTypeName, } from "../../api/argument/ArgumentValueTypes.js";
4
+ import { isGlobalCommand, isSubCommand } from "../../runtime/command/CommandTypeGuards.js";
5
+ export default class DefaultArgumentPrompterService {
6
+ #prompterService;
7
+ constructor(prompterService) {
8
+ this.#prompterService = prompterService;
9
+ }
10
+ async promptForMissingArguments(parseResult) {
11
+ if (!this.#prompterService.promptEnabled) {
12
+ return parseResult;
13
+ }
14
+ const allMissingValue = parseResult.invalidArguments.every((ia) => ia.reason === InvalidArgumentReason.MISSING_VALUE);
15
+ if (!allMissingValue) {
16
+ return parseResult;
17
+ }
18
+ if (parseResult.invalidArguments.length === 0) {
19
+ return parseResult;
20
+ }
21
+ try {
22
+ if (isGlobalCommand(parseResult.command)) {
23
+ return await this.#promptForGlobalCommand(parseResult);
24
+ }
25
+ if (isSubCommand(parseResult.command)) {
26
+ return await this.#promptForSubCommand(parseResult);
27
+ }
28
+ }
29
+ catch (error) {
30
+ if (error.message === "Interrupted") {
31
+ throw error;
32
+ }
33
+ return parseResult;
34
+ }
35
+ return parseResult;
36
+ }
37
+ async #promptForGlobalCommand(parseResult) {
38
+ const command = parseResult.command;
39
+ if (!command.argument) {
40
+ return parseResult;
41
+ }
42
+ const prompt = DefaultArgumentPrompterService.#argumentToPrompt(command.name, command.name, command.argument);
43
+ const result = await this.#prompterService.prompt(prompt);
44
+ const value = DefaultArgumentPrompterService.#coerceValue(result.value, command.argument.type);
45
+ return {
46
+ command: parseResult.command,
47
+ groupCommand: parseResult.groupCommand,
48
+ populatedArgumentValues: value,
49
+ invalidArguments: [],
50
+ unusedArgs: parseResult.unusedArgs,
51
+ };
52
+ }
53
+ async #promptForSubCommand(parseResult) {
54
+ const command = parseResult.command;
55
+ const existingValues = (parseResult.populatedArgumentValues ?? {});
56
+ const newValues = {
57
+ ...existingValues,
58
+ };
59
+ const remainingInvalid = [];
60
+ for (const invalid of parseResult.invalidArguments) {
61
+ if (invalid.reason !== InvalidArgumentReason.MISSING_VALUE || !invalid.name) {
62
+ remainingInvalid.push(invalid);
63
+ continue;
64
+ }
65
+ const arg = DefaultArgumentPrompterService.#findArgument(command, invalid.name);
66
+ if (!arg) {
67
+ remainingInvalid.push(invalid);
68
+ continue;
69
+ }
70
+ if ("type" in arg && arg.type === ComplexValueTypeName.COMPLEX) {
71
+ const complexValues = await this.#promptForComplexOption(invalid.name, arg);
72
+ newValues[invalid.name] = complexValues;
73
+ }
74
+ else if (DefaultArgumentPrompterService.#isArrayArgument(arg)) {
75
+ const arrayValues = await this.#promptForArrayArgument(invalid.name, arg);
76
+ newValues[invalid.name] = arrayValues;
77
+ }
78
+ else {
79
+ const prompt = DefaultArgumentPrompterService.#argumentToPrompt(invalid.name, arg.description ?? invalid.name, arg);
80
+ const result = await this.#prompterService.prompt(prompt);
81
+ newValues[invalid.name] = DefaultArgumentPrompterService.#coerceValue(result.value, arg.type);
82
+ }
83
+ }
84
+ return {
85
+ command: parseResult.command,
86
+ groupCommand: parseResult.groupCommand,
87
+ populatedArgumentValues: newValues,
88
+ invalidArguments: remainingInvalid,
89
+ unusedArgs: parseResult.unusedArgs,
90
+ };
91
+ }
92
+ async #promptForComplexOption(name, complexOption) {
93
+ const values = {};
94
+ for (const prop of complexOption.properties) {
95
+ if ("type" in prop && prop.type === ComplexValueTypeName.COMPLEX) {
96
+ values[prop.name] = await this.#promptForComplexOption(`${name}.${prop.name}`, prop);
97
+ }
98
+ else {
99
+ const option = prop;
100
+ if (option.isOptional && option.defaultValue !== undefined) {
101
+ continue;
102
+ }
103
+ const prompt = DefaultArgumentPrompterService.#argumentToPrompt(`${name}.${option.name}`, option.description ?? `${name}.${option.name}`, option);
104
+ const result = await this.#prompterService.prompt(prompt);
105
+ values[option.name] = DefaultArgumentPrompterService.#coerceValue(result.value, option.type);
106
+ }
107
+ }
108
+ return values;
109
+ }
110
+ async #promptForArrayArgument(name, arg) {
111
+ const values = [];
112
+ while (true) {
113
+ const prompt = DefaultArgumentPrompterService.#argumentToPrompt(name, `${arg.description ?? name}${values.length > 0 ? ` [${values.length + 1}]` : ""}`, arg);
114
+ const result = await this.#prompterService.prompt(prompt);
115
+ values.push(DefaultArgumentPrompterService.#coerceValue(result.value, arg.type));
116
+ const addAnother = {
117
+ name: `${name}_more`,
118
+ promptText: `Add another value for ${name}?`,
119
+ type: PromptType.ACKNOWLEDGE,
120
+ options: [],
121
+ };
122
+ const moreResult = await this.#prompterService.prompt(addAnother);
123
+ if (moreResult.value !== true) {
124
+ break;
125
+ }
126
+ }
127
+ return values;
128
+ }
129
+ static #argumentToPrompt(name, description, arg) {
130
+ if (arg.type === ArgumentValueTypeName.BOOLEAN) {
131
+ return {
132
+ name,
133
+ promptText: description,
134
+ type: PromptType.TOGGLE,
135
+ options: [],
136
+ };
137
+ }
138
+ if (arg.allowableValues && arg.allowableValues.length > 0) {
139
+ const options = arg.allowableValues.map((v) => ({
140
+ displayValue: String(v),
141
+ returnedValue: v,
142
+ }));
143
+ return {
144
+ name,
145
+ promptText: description,
146
+ type: PromptType.SINGLE_SELECT,
147
+ options,
148
+ };
149
+ }
150
+ const validationOption = {
151
+ displayValue: arg.type === ArgumentValueTypeName.SECRET ? "__SECRET__" : name,
152
+ returnedValue: "",
153
+ min: arg.minValueInclusive,
154
+ max: arg.maxValueInclusive,
155
+ validate: arg.validate ? (v) => arg.validate(v) : undefined,
156
+ };
157
+ return {
158
+ name,
159
+ promptText: description,
160
+ type: PromptType.TEXT,
161
+ options: [validationOption],
162
+ };
163
+ }
164
+ static #coerceValue(value, type) {
165
+ if (typeof value === "string") {
166
+ switch (type) {
167
+ case ArgumentValueTypeName.INTEGER:
168
+ return parseInt(value, 10);
169
+ case ArgumentValueTypeName.NUMBER:
170
+ return parseFloat(value);
171
+ case ArgumentValueTypeName.BOOLEAN:
172
+ return value.toLowerCase() === "true";
173
+ }
174
+ }
175
+ return value;
176
+ }
177
+ static #findArgument(command, name) {
178
+ for (const opt of command.options) {
179
+ if (opt.name === name)
180
+ return opt;
181
+ }
182
+ for (const pos of command.positionals) {
183
+ if (pos.name === name)
184
+ return pos;
185
+ }
186
+ return undefined;
187
+ }
188
+ static #isArrayArgument(arg) {
189
+ if ("isArray" in arg && arg.isArray) {
190
+ return true;
191
+ }
192
+ if ("isVarargMultiple" in arg && arg.isVarargMultiple) {
193
+ return true;
194
+ }
195
+ return false;
196
+ }
197
+ }
@@ -0,0 +1,28 @@
1
+ import { ASCII_BANNER_GENERATOR_SERVICE_ID } from "../../api/service/core/AsciiBannerGeneratorService.js";
2
+ import DefaultAsciiBannerGeneratorService from "./DefaultAsciiBannerGeneratorService.js";
3
+ /**
4
+ * Provides an {@link AsciiBannerGeneratorService}.
5
+ */
6
+ export default class AsciiBannerGeneratorServiceProvider {
7
+ serviceId = ASCII_BANNER_GENERATOR_SERVICE_ID;
8
+ servicePriority;
9
+ #asciiBannerGeneratorService;
10
+ /**
11
+ * Create an instance of the service provider with the specified details.
12
+ *
13
+ * @param servicePriority the priority of the service.
14
+ */
15
+ constructor(servicePriority) {
16
+ this.servicePriority = servicePriority;
17
+ this.#asciiBannerGeneratorService = new DefaultAsciiBannerGeneratorService();
18
+ }
19
+ getServiceInfo(_cliConfig) {
20
+ return Promise.resolve({
21
+ service: this.#asciiBannerGeneratorService,
22
+ commands: [],
23
+ });
24
+ }
25
+ initService(_context) {
26
+ return Promise.resolve(undefined);
27
+ }
28
+ }
@@ -0,0 +1,233 @@
1
+ import { BACKGROUND_COLOR_END, backgroundColorStart, FOREGROUND_COLOR_END, foregroundColorStart, } from "../../terminal/Ansi.js";
2
+ import figlet from "figlet";
3
+ import standardFont from "./standard.flf.json" with { type: "json" };
4
+ function hslToRgb(h, s, l) {
5
+ const c = (1 - Math.abs(2 * l - 1)) * s;
6
+ const x = c * (1 - Math.abs(((h * 6) % 2) - 1));
7
+ const m = l - c / 2;
8
+ let r = 0, g = 0, b = 0;
9
+ if (h < 1 / 6) {
10
+ r = c;
11
+ g = x;
12
+ b = 0;
13
+ }
14
+ else if (h < 2 / 6) {
15
+ r = x;
16
+ g = c;
17
+ b = 0;
18
+ }
19
+ else if (h < 3 / 6) {
20
+ r = 0;
21
+ g = c;
22
+ b = x;
23
+ }
24
+ else if (h < 4 / 6) {
25
+ r = 0;
26
+ g = x;
27
+ b = c;
28
+ }
29
+ else if (h < 5 / 6) {
30
+ r = x;
31
+ g = 0;
32
+ b = c;
33
+ }
34
+ else {
35
+ r = c;
36
+ g = 0;
37
+ b = x;
38
+ }
39
+ return [Math.round((r + m) * 255), Math.round((g + m) * 255), Math.round((b + m) * 255)];
40
+ }
41
+ function parseHex(hex) {
42
+ const v = parseInt(hex.slice(1), 16);
43
+ return [(v >> 16) & 0xff, (v >> 8) & 0xff, v & 0xff];
44
+ }
45
+ function interpolateColors(colorStops, position, total) {
46
+ const first = colorStops[0];
47
+ if (total <= 1 || first === undefined)
48
+ return first ?? [0, 0, 0];
49
+ const t = position / (total - 1);
50
+ const scaledT = t * (colorStops.length - 1);
51
+ const idx = Math.min(Math.floor(scaledT), colorStops.length - 2);
52
+ const localT = scaledT - idx;
53
+ const stop1 = colorStops[idx];
54
+ const stop2 = colorStops[idx + 1];
55
+ if (stop1 === undefined || stop2 === undefined)
56
+ return first;
57
+ const [r1, g1, b1] = stop1;
58
+ const [r2, g2, b2] = stop2;
59
+ return [
60
+ Math.round(r1 + (r2 - r1) * localT),
61
+ Math.round(g1 + (g2 - g1) * localT),
62
+ Math.round(b1 + (b2 - b1) * localT),
63
+ ];
64
+ }
65
+ function rainbowColor(freq, spread, seed, x, y) {
66
+ const h = (((freq * (x / spread) + seed + (y * freq) / spread) % 1.0) + 1.0) % 1.0;
67
+ return hslToRgb(h, 1.0, 0.5);
68
+ }
69
+ export default class DefaultAsciiBannerGeneratorService {
70
+ #registeredFontNames = [];
71
+ constructor() {
72
+ this.registerFont("standard", standardFont.font);
73
+ }
74
+ getRegisteredFonts() {
75
+ return this.#registeredFontNames;
76
+ }
77
+ registerFont(fontName, fontDefinition) {
78
+ const name = fontName.toLowerCase();
79
+ if (this.getRegisteredFonts().includes(name)) {
80
+ throw new Error(`Font name already registered: ${name}`);
81
+ }
82
+ this.#registeredFontNames.push(name);
83
+ figlet.parseFont(fontName, fontDefinition);
84
+ }
85
+ applyForegroundEffect(lines, effect) {
86
+ if (effect.type === "fixed") {
87
+ const [r, g, b] = parseHex(effect.color);
88
+ const code = foregroundColorStart(r, g, b);
89
+ return lines.map((line) => line
90
+ .split("")
91
+ .map((ch) => (ch === " " ? ch : code + ch + FOREGROUND_COLOR_END))
92
+ .join(""));
93
+ }
94
+ if (effect.type === "gradient") {
95
+ const colorStops = effect.colors.map(parseHex);
96
+ return lines.map((line, yi) => {
97
+ if (effect.direction === "vertical") {
98
+ const [r, g, b] = interpolateColors(colorStops, yi, Math.max(lines.length, 1));
99
+ const code = foregroundColorStart(r, g, b);
100
+ return line
101
+ .split("")
102
+ .map((ch) => (ch === " " ? ch : code + ch + FOREGROUND_COLOR_END))
103
+ .join("");
104
+ }
105
+ const nonSpaceCount = line.split("").filter((c) => c !== " ").length;
106
+ let charIdx = 0;
107
+ return line
108
+ .split("")
109
+ .map((ch) => {
110
+ if (ch === " ")
111
+ return ch;
112
+ const [r, g, b] = interpolateColors(colorStops, charIdx, Math.max(nonSpaceCount, 1));
113
+ charIdx++;
114
+ return foregroundColorStart(r, g, b) + ch + FOREGROUND_COLOR_END;
115
+ })
116
+ .join("");
117
+ });
118
+ }
119
+ const freq = effect.frequency ?? 0.3;
120
+ const spread = effect.spread ?? 8.0;
121
+ const seed = effect.seed ?? Math.random();
122
+ return lines.map((line, yi) => {
123
+ if (effect.direction === "vertical") {
124
+ const [r, g, b] = rainbowColor(freq, spread, seed, 0, yi);
125
+ const code = foregroundColorStart(r, g, b);
126
+ return line
127
+ .split("")
128
+ .map((ch) => (ch === " " ? ch : code + ch + FOREGROUND_COLOR_END))
129
+ .join("");
130
+ }
131
+ let charIdx = 0;
132
+ return line
133
+ .split("")
134
+ .map((ch) => {
135
+ if (ch === " ")
136
+ return ch;
137
+ const [r, g, b] = rainbowColor(freq, spread, seed, charIdx, yi);
138
+ charIdx++;
139
+ return foregroundColorStart(r, g, b) + ch + FOREGROUND_COLOR_END;
140
+ })
141
+ .join("");
142
+ });
143
+ }
144
+ applyBackgroundEffect(lines, effect) {
145
+ if (effect.type === "fixed") {
146
+ const [r, g, b] = parseHex(effect.color);
147
+ const code = backgroundColorStart(r, g, b);
148
+ return lines.map((line) => code + line + BACKGROUND_COLOR_END);
149
+ }
150
+ if (effect.type === "gradient") {
151
+ const colorStops = effect.colors.map(parseHex);
152
+ return lines.map((line, yi) => {
153
+ if (effect.direction === "vertical") {
154
+ const [r, g, b] = interpolateColors(colorStops, yi, Math.max(lines.length, 1));
155
+ return backgroundColorStart(r, g, b) + line + BACKGROUND_COLOR_END;
156
+ }
157
+ const totalChars = Math.max(line.length, 1);
158
+ return line
159
+ .split("")
160
+ .map((ch, xi) => {
161
+ const [r, g, b] = interpolateColors(colorStops, xi, totalChars);
162
+ return backgroundColorStart(r, g, b) + ch + BACKGROUND_COLOR_END;
163
+ })
164
+ .join("");
165
+ });
166
+ }
167
+ const freq = effect.frequency ?? 0.3;
168
+ const spread = effect.spread ?? 8.0;
169
+ const seed = effect.seed ?? Math.random();
170
+ return lines.map((line, yi) => {
171
+ if (effect.direction === "vertical") {
172
+ const [r, g, b] = rainbowColor(freq, spread, seed, 0, yi);
173
+ return backgroundColorStart(r, g, b) + line + BACKGROUND_COLOR_END;
174
+ }
175
+ return line
176
+ .split("")
177
+ .map((ch, xi) => {
178
+ const [r, g, b] = rainbowColor(freq, spread, seed, xi, yi);
179
+ return backgroundColorStart(r, g, b) + ch + BACKGROUND_COLOR_END;
180
+ })
181
+ .join("");
182
+ });
183
+ }
184
+ async generate(message, options) {
185
+ const fontName = (options?.fontName ?? "standard").toLowerCase();
186
+ if (!this.getRegisteredFonts().includes(fontName)) {
187
+ throw new Error(`Font name is not registered: ${fontName}`);
188
+ }
189
+ const bannerText = await figlet.text(message, { font: fontName });
190
+ let titleLines = bannerText.split("\n");
191
+ while (titleLines.length > 0) {
192
+ const last = titleLines[titleLines.length - 1];
193
+ if (last === undefined || last.trim().length > 0)
194
+ break;
195
+ titleLines.pop();
196
+ }
197
+ let subMessageLine;
198
+ if (options?.subMessage) {
199
+ subMessageLine = options.subMessage
200
+ .toUpperCase()
201
+ .split("")
202
+ .map((c) => (c === " " ? " " : c + " "))
203
+ .join("")
204
+ .trimEnd();
205
+ const bannerWidth = Math.max(...titleLines.map((l) => l.length));
206
+ const subWidth = subMessageLine.length;
207
+ if (bannerWidth >= subWidth) {
208
+ const pad = Math.floor((bannerWidth - subWidth) / 2);
209
+ subMessageLine = " ".repeat(pad) + subMessageLine;
210
+ }
211
+ else {
212
+ const pad = Math.floor((subWidth - bannerWidth) / 2);
213
+ titleLines = titleLines.map((l) => " ".repeat(pad) + l);
214
+ }
215
+ }
216
+ const colorEffects = options?.colorEffects;
217
+ if (colorEffects?.messageForeground) {
218
+ titleLines = this.applyForegroundEffect(titleLines, colorEffects.messageForeground);
219
+ }
220
+ let subLines;
221
+ if (subMessageLine !== undefined) {
222
+ subLines = [subMessageLine];
223
+ if (colorEffects?.subMessageForeground) {
224
+ subLines = this.applyForegroundEffect(subLines, colorEffects.subMessageForeground);
225
+ }
226
+ }
227
+ let allLines = subLines ? [...titleLines, ...subLines] : titleLines;
228
+ if (colorEffects?.background) {
229
+ allLines = this.applyBackgroundEffect(allLines, colorEffects.background);
230
+ }
231
+ return "\n" + allLines.join("\n") + "\n";
232
+ }
233
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "font": "flf2a$ 6 5 16 15 11 0 24463\nStandard by Glenn Chappell & Ian Chai 3/93 -- based on Frank's .sig\nIncludes ISO Latin-1\nfiglet release 2.1 -- 12 Aug 1994\nModified for figlet 2.2 by John Cowan <cowan@ccil.org>\n to add Latin-{2,3,4,5} support (Unicode U+0100-017F).\nPermission is hereby given to modify this font, as long as the\nmodifier's name is placed on a comment line.\n\nModified by Paul Burton <solution@earthlink.net> 12/96 to include new parameter\nsupported by FIGlet and FIGWin. May also be slightly modified for better use\nof new full-width/kern/smush alternatives, but default output is NOT changed.\n $@\n $@\n $@\n $@\n $@\n $@@\n _ @\n | |@\n | |@\n |_|@\n (_)@\n @@\n _ _ @\n ( | )@\n V V @\n $ @\n $ @\n @@\n _ _ @\n _| || |_ @\n |_ .. _|@\n |_ _|@\n |_||_| @\n @@\n _ @\n | | @\n / __)@\n \\__ \\@\n ( /@\n |_| @@\n _ __@\n (_)/ /@\n / / @\n / /_ @\n /_/(_)@\n @@\n ___ @\n ( _ ) @\n / _ \\/\\@\n | (_> <@\n \\___/\\/@\n @@\n _ @\n ( )@\n |/ @\n $ @\n $ @\n @@\n __@\n / /@\n | | @\n | | @\n | | @\n \\_\\@@\n __ @\n \\ \\ @\n | |@\n | |@\n | |@\n /_/ @@\n @\n __/\\__@\n \\ /@\n /_ _\\@\n \\/ @\n @@\n @\n _ @\n _| |_ @\n |_ _|@\n |_| @\n @@\n @\n @\n @\n _ @\n ( )@\n |/ @@\n @\n @\n _____ @\n |_____|@\n $ @\n @@\n @\n @\n @\n _ @\n (_)@\n @@\n __@\n / /@\n / / @\n / / @\n /_/ @\n @@\n ___ @\n / _ \\ @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n _ @\n / |@\n | |@\n | |@\n |_|@\n @@\n ____ @\n |___ \\ @\n __) |@\n / __/ @\n |_____|@\n @@\n _____ @\n |___ / @\n |_ \\ @\n ___) |@\n |____/ @\n @@\n _ _ @\n | || | @\n | || |_ @\n |__ _|@\n |_| @\n @@\n ____ @\n | ___| @\n |___ \\ @\n ___) |@\n |____/ @\n @@\n __ @\n / /_ @\n | '_ \\ @\n | (_) |@\n \\___/ @\n @@\n _____ @\n |___ |@\n / / @\n / / @\n /_/ @\n @@\n ___ @\n ( _ ) @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n ___ @\n / _ \\ @\n | (_) |@\n \\__, |@\n /_/ @\n @@\n @\n _ @\n (_)@\n _ @\n (_)@\n @@\n @\n _ @\n (_)@\n _ @\n ( )@\n |/ @@\n __@\n / /@\n / / @\n \\ \\ @\n \\_\\@\n @@\n @\n _____ @\n |_____|@\n |_____|@\n $ @\n @@\n __ @\n \\ \\ @\n \\ \\@\n / /@\n /_/ @\n @@\n ___ @\n |__ \\@\n / /@\n |_| @\n (_) @\n @@\n ____ @\n / __ \\ @\n / / _` |@\n | | (_| |@\n \\ \\__,_|@\n \\____/ @@\n _ @\n / \\ @\n / _ \\ @\n / ___ \\ @\n /_/ \\_\\@\n @@\n ____ @\n | __ ) @\n | _ \\ @\n | |_) |@\n |____/ @\n @@\n ____ @\n / ___|@\n | | @\n | |___ @\n \\____|@\n @@\n ____ @\n | _ \\ @\n | | | |@\n | |_| |@\n |____/ @\n @@\n _____ @\n | ____|@\n | _| @\n | |___ @\n |_____|@\n @@\n _____ @\n | ___|@\n | |_ @\n | _| @\n |_| @\n @@\n ____ @\n / ___|@\n | | _ @\n | |_| |@\n \\____|@\n @@\n _ _ @\n | | | |@\n | |_| |@\n | _ |@\n |_| |_|@\n @@\n ___ @\n |_ _|@\n | | @\n | | @\n |___|@\n @@\n _ @\n | |@\n _ | |@\n | |_| |@\n \\___/ @\n @@\n _ __@\n | |/ /@\n | ' / @\n | . \\ @\n |_|\\_\\@\n @@\n _ @\n | | @\n | | @\n | |___ @\n |_____|@\n @@\n __ __ @\n | \\/ |@\n | |\\/| |@\n | | | |@\n |_| |_|@\n @@\n _ _ @\n | \\ | |@\n | \\| |@\n | |\\ |@\n |_| \\_|@\n @@\n ___ @\n / _ \\ @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n ____ @\n | _ \\ @\n | |_) |@\n | __/ @\n |_| @\n @@\n ___ @\n / _ \\ @\n | | | |@\n | |_| |@\n \\__\\_\\@\n @@\n ____ @\n | _ \\ @\n | |_) |@\n | _ < @\n |_| \\_\\@\n @@\n ____ @\n / ___| @\n \\___ \\ @\n ___) |@\n |____/ @\n @@\n _____ @\n |_ _|@\n | | @\n | | @\n |_| @\n @@\n _ _ @\n | | | |@\n | | | |@\n | |_| |@\n \\___/ @\n @@\n __ __@\n \\ \\ / /@\n \\ \\ / / @\n \\ V / @\n \\_/ @\n @@\n __ __@\n \\ \\ / /@\n \\ \\ /\\ / / @\n \\ V V / @\n \\_/\\_/ @\n @@\n __ __@\n \\ \\/ /@\n \\ / @\n / \\ @\n /_/\\_\\@\n @@\n __ __@\n \\ \\ / /@\n \\ V / @\n | | @\n |_| @\n @@\n _____@\n |__ /@\n / / @\n / /_ @\n /____|@\n @@\n __ @\n | _|@\n | | @\n | | @\n | | @\n |__|@@\n __ @\n \\ \\ @\n \\ \\ @\n \\ \\ @\n \\_\\@\n @@\n __ @\n |_ |@\n | |@\n | |@\n | |@\n |__|@@\n /\\ @\n |/\\|@\n $ @\n $ @\n $ @\n @@\n @\n @\n @\n @\n _____ @\n |_____|@@\n _ @\n ( )@\n \\|@\n $ @\n $ @\n @@\n @\n __ _ @\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n _ @\n | |__ @\n | '_ \\ @\n | |_) |@\n |_.__/ @\n @@\n @\n ___ @\n / __|@\n | (__ @\n \\___|@\n @@\n _ @\n __| |@\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n @\n ___ @\n / _ \\@\n | __/@\n \\___|@\n @@\n __ @\n / _|@\n | |_ @\n | _|@\n |_| @\n @@\n @\n __ _ @\n / _` |@\n | (_| |@\n \\__, |@\n |___/ @@\n _ @\n | |__ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n _ @\n (_)@\n | |@\n | |@\n |_|@\n @@\n _ @\n (_)@\n | |@\n | |@\n _/ |@\n |__/ @@\n _ @\n | | __@\n | |/ /@\n | < @\n |_|\\_\\@\n @@\n _ @\n | |@\n | |@\n | |@\n |_|@\n @@\n @\n _ __ ___ @\n | '_ ` _ \\ @\n | | | | | |@\n |_| |_| |_|@\n @@\n @\n _ __ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n @\n ___ @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n @\n _ __ @\n | '_ \\ @\n | |_) |@\n | .__/ @\n |_| @@\n @\n __ _ @\n / _` |@\n | (_| |@\n \\__, |@\n |_|@@\n @\n _ __ @\n | '__|@\n | | @\n |_| @\n @@\n @\n ___ @\n / __|@\n \\__ \\@\n |___/@\n @@\n _ @\n | |_ @\n | __|@\n | |_ @\n \\__|@\n @@\n @\n _ _ @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n @\n __ __@\n \\ \\ / /@\n \\ V / @\n \\_/ @\n @@\n @\n __ __@\n \\ \\ /\\ / /@\n \\ V V / @\n \\_/\\_/ @\n @@\n @\n __ __@\n \\ \\/ /@\n > < @\n /_/\\_\\@\n @@\n @\n _ _ @\n | | | |@\n | |_| |@\n \\__, |@\n |___/ @@\n @\n ____@\n |_ /@\n / / @\n /___|@\n @@\n __@\n / /@\n | | @\n < < @\n | | @\n \\_\\@@\n _ @\n | |@\n | |@\n | |@\n | |@\n |_|@@\n __ @\n \\ \\ @\n | | @\n > >@\n | | @\n /_/ @@\n /\\/|@\n |/\\/ @\n $ @\n $ @\n $ @\n @@\n _ _ @\n (_)_(_)@\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n _ _ @\n (_)_(_)@\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n _ _ @\n (_) (_)@\n | | | |@\n | |_| |@\n \\___/ @\n @@\n _ _ @\n (_)_(_)@\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n _ _ @\n (_)_(_)@\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n _ _ @\n (_) (_)@\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n ___ @\n / _ \\@\n | |/ /@\n | |\\ \\@\n | ||_/@\n |_| @@\n160 NO-BREAK SPACE\n $@\n $@\n $@\n $@\n $@\n $@@\n161 INVERTED EXCLAMATION MARK\n _ @\n (_)@\n | |@\n | |@\n |_|@\n @@\n162 CENT SIGN\n _ @\n | | @\n / __)@\n | (__ @\n \\ )@\n |_| @@\n163 POUND SIGN\n ___ @\n / ,_\\ @\n _| |_ @\n | |___ @\n (_,____|@\n @@\n164 CURRENCY SIGN\n /\\___/\\@\n \\ _ /@\n | (_) |@\n / ___ \\@\n \\/ \\/@\n @@\n165 YEN SIGN\n __ __ @\n \\ V / @\n |__ __|@\n |__ __|@\n |_| @\n @@\n166 BROKEN BAR\n _ @\n | |@\n |_|@\n _ @\n | |@\n |_|@@\n167 SECTION SIGN\n __ @\n _/ _)@\n / \\ \\ @\n \\ \\\\ \\@\n \\ \\_/@\n (__/ @@\n168 DIAERESIS\n _ _ @\n (_) (_)@\n $ $ @\n $ $ @\n $ $ @\n @@\n169 COPYRIGHT SIGN\n _____ @\n / ___ \\ @\n / / __| \\ @\n | | (__ |@\n \\ \\___| / @\n \\_____/ @@\n170 FEMININE ORDINAL INDICATOR\n __ _ @\n / _` |@\n \\__,_|@\n |____|@\n $ @\n @@\n171 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK\n ____@\n / / /@\n / / / @\n \\ \\ \\ @\n \\_\\_\\@\n @@\n172 NOT SIGN\n @\n _____ @\n |___ |@\n |_|@\n $ @\n @@\n173 SOFT HYPHEN\n @\n @\n ____ @\n |____|@\n $ @\n @@\n174 REGISTERED SIGN\n _____ @\n / ___ \\ @\n / | _ \\ \\ @\n | | / |@\n \\ |_|_\\ / @\n \\_____/ @@\n175 MACRON\n _____ @\n |_____|@\n $ @\n $ @\n $ @\n @@\n176 DEGREE SIGN\n __ @\n / \\ @\n | () |@\n \\__/ @\n $ @\n @@\n177 PLUS-MINUS SIGN\n _ @\n _| |_ @\n |_ _|@\n _|_|_ @\n |_____|@\n @@\n178 SUPERSCRIPT TWO\n ___ @\n |_ )@\n / / @\n /___|@\n $ @\n @@\n179 SUPERSCRIPT THREE\n ____@\n |__ /@\n |_ \\@\n |___/@\n $ @\n @@\n180 ACUTE ACCENT\n __@\n /_/@\n $ @\n $ @\n $ @\n @@\n181 MICRO SIGN\n @\n _ _ @\n | | | |@\n | |_| |@\n | ._,_|@\n |_| @@\n182 PILCROW SIGN\n _____ @\n / |@\n | (| | |@\n \\__ | |@\n |_|_|@\n @@\n183 MIDDLE DOT\n @\n _ @\n (_)@\n $ @\n $ @\n @@\n184 CEDILLA\n @\n @\n @\n @\n _ @\n )_)@@\n185 SUPERSCRIPT ONE\n _ @\n / |@\n | |@\n |_|@\n $ @\n @@\n186 MASCULINE ORDINAL INDICATOR\n ___ @\n / _ \\@\n \\___/@\n |___|@\n $ @\n @@\n187 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK\n ____ @\n \\ \\ \\ @\n \\ \\ \\@\n / / /@\n /_/_/ @\n @@\n188 VULGAR FRACTION ONE QUARTER\n _ __ @\n / | / / _ @\n | |/ / | | @\n |_/ /|_ _|@\n /_/ |_| @\n @@\n189 VULGAR FRACTION ONE HALF\n _ __ @\n / | / /__ @\n | |/ /_ )@\n |_/ / / / @\n /_/ /___|@\n @@\n190 VULGAR FRACTION THREE QUARTERS\n ____ __ @\n |__ / / / _ @\n |_ \\/ / | | @\n |___/ /|_ _|@\n /_/ |_| @\n @@\n191 INVERTED QUESTION MARK\n _ @\n (_) @\n | | @\n / /_ @\n \\___|@\n @@\n192 LATIN CAPITAL LETTER A WITH GRAVE\n __ @\n \\_\\ @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n193 LATIN CAPITAL LETTER A WITH ACUTE\n __ @\n /_/ @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n194 LATIN CAPITAL LETTER A WITH CIRCUMFLEX\n //\\ @\n |/_\\| @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n195 LATIN CAPITAL LETTER A WITH TILDE\n /\\/| @\n |/\\/ @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n196 LATIN CAPITAL LETTER A WITH DIAERESIS\n _ _ @\n (_)_(_)@\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n197 LATIN CAPITAL LETTER A WITH RING ABOVE\n _ @\n (o) @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n198 LATIN CAPITAL LETTER AE\n ______ @\n / ____|@\n / _ _| @\n / __ |___ @\n /_/ |_____|@\n @@\n199 LATIN CAPITAL LETTER C WITH CEDILLA\n ____ @\n / ___|@\n | | @\n | |___ @\n \\____|@\n )_) @@\n200 LATIN CAPITAL LETTER E WITH GRAVE\n __ @\n _\\_\\_ @\n | ____|@\n | _|_ @\n |_____|@\n @@\n201 LATIN CAPITAL LETTER E WITH ACUTE\n __ @\n _/_/_ @\n | ____|@\n | _|_ @\n |_____|@\n @@\n202 LATIN CAPITAL LETTER E WITH CIRCUMFLEX\n //\\ @\n |/_\\| @\n | ____|@\n | _|_ @\n |_____|@\n @@\n203 LATIN CAPITAL LETTER E WITH DIAERESIS\n _ _ @\n (_)_(_)@\n | ____|@\n | _|_ @\n |_____|@\n @@\n204 LATIN CAPITAL LETTER I WITH GRAVE\n __ @\n \\_\\ @\n |_ _|@\n | | @\n |___|@\n @@\n205 LATIN CAPITAL LETTER I WITH ACUTE\n __ @\n /_/ @\n |_ _|@\n | | @\n |___|@\n @@\n206 LATIN CAPITAL LETTER I WITH CIRCUMFLEX\n //\\ @\n |/_\\|@\n |_ _|@\n | | @\n |___|@\n @@\n207 LATIN CAPITAL LETTER I WITH DIAERESIS\n _ _ @\n (_)_(_)@\n |_ _| @\n | | @\n |___| @\n @@\n208 LATIN CAPITAL LETTER ETH\n ____ @\n | _ \\ @\n _| |_| |@\n |__ __| |@\n |____/ @\n @@\n209 LATIN CAPITAL LETTER N WITH TILDE\n /\\/|@\n |/\\/ @\n | \\| |@\n | .` |@\n |_|\\_|@\n @@\n210 LATIN CAPITAL LETTER O WITH GRAVE\n __ @\n \\_\\ @\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n211 LATIN CAPITAL LETTER O WITH ACUTE\n __ @\n /_/ @\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n212 LATIN CAPITAL LETTER O WITH CIRCUMFLEX\n //\\ @\n |/_\\| @\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n213 LATIN CAPITAL LETTER O WITH TILDE\n /\\/| @\n |/\\/ @\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n214 LATIN CAPITAL LETTER O WITH DIAERESIS\n _ _ @\n (_)_(_)@\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n215 MULTIPLICATION SIGN\n @\n @\n /\\/\\@\n > <@\n \\/\\/@\n @@\n216 LATIN CAPITAL LETTER O WITH STROKE\n ____ @\n / _// @\n | |// |@\n | //| |@\n //__/ @\n @@\n217 LATIN CAPITAL LETTER U WITH GRAVE\n __ @\n _\\_\\_ @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n218 LATIN CAPITAL LETTER U WITH ACUTE\n __ @\n _/_/_ @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n219 LATIN CAPITAL LETTER U WITH CIRCUMFLEX\n //\\ @\n |/ \\| @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n220 LATIN CAPITAL LETTER U WITH DIAERESIS\n _ _ @\n (_) (_)@\n | | | |@\n | |_| |@\n \\___/ @\n @@\n221 LATIN CAPITAL LETTER Y WITH ACUTE\n __ @\n __/_/__@\n \\ \\ / /@\n \\ V / @\n |_| @\n @@\n222 LATIN CAPITAL LETTER THORN\n _ @\n | |___ @\n | __ \\@\n | ___/@\n |_| @\n @@\n223 LATIN SMALL LETTER SHARP S\n ___ @\n / _ \\@\n | |/ /@\n | |\\ \\@\n | ||_/@\n |_| @@\n224 LATIN SMALL LETTER A WITH GRAVE\n __ @\n \\_\\_ @\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n225 LATIN SMALL LETTER A WITH ACUTE\n __ @\n /_/_ @\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n226 LATIN SMALL LETTER A WITH CIRCUMFLEX\n //\\ @\n |/_\\| @\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n227 LATIN SMALL LETTER A WITH TILDE\n /\\/| @\n |/\\/_ @\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n228 LATIN SMALL LETTER A WITH DIAERESIS\n _ _ @\n (_)_(_)@\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n229 LATIN SMALL LETTER A WITH RING ABOVE\n __ @\n (()) @\n / _ '|@\n | (_| |@\n \\__,_|@\n @@\n230 LATIN SMALL LETTER AE\n @\n __ ____ @\n / _` _ \\@\n | (_| __/@\n \\__,____|@\n @@\n231 LATIN SMALL LETTER C WITH CEDILLA\n @\n ___ @\n / __|@\n | (__ @\n \\___|@\n )_) @@\n232 LATIN SMALL LETTER E WITH GRAVE\n __ @\n \\_\\ @\n / _ \\@\n | __/@\n \\___|@\n @@\n233 LATIN SMALL LETTER E WITH ACUTE\n __ @\n /_/ @\n / _ \\@\n | __/@\n \\___|@\n @@\n234 LATIN SMALL LETTER E WITH CIRCUMFLEX\n //\\ @\n |/_\\|@\n / _ \\@\n | __/@\n \\___|@\n @@\n235 LATIN SMALL LETTER E WITH DIAERESIS\n _ _ @\n (_)_(_)@\n / _ \\ @\n | __/ @\n \\___| @\n @@\n236 LATIN SMALL LETTER I WITH GRAVE\n __ @\n \\_\\@\n | |@\n | |@\n |_|@\n @@\n237 LATIN SMALL LETTER I WITH ACUTE\n __@\n /_/@\n | |@\n | |@\n |_|@\n @@\n238 LATIN SMALL LETTER I WITH CIRCUMFLEX\n //\\ @\n |/_\\|@\n | | @\n | | @\n |_| @\n @@\n239 LATIN SMALL LETTER I WITH DIAERESIS\n _ _ @\n (_)_(_)@\n | | @\n | | @\n |_| @\n @@\n240 LATIN SMALL LETTER ETH\n /\\/\\ @\n > < @\n _\\/\\ |@\n / __` |@\n \\____/ @\n @@\n241 LATIN SMALL LETTER N WITH TILDE\n /\\/| @\n |/\\/ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n242 LATIN SMALL LETTER O WITH GRAVE\n __ @\n \\_\\ @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n243 LATIN SMALL LETTER O WITH ACUTE\n __ @\n /_/ @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n244 LATIN SMALL LETTER O WITH CIRCUMFLEX\n //\\ @\n |/_\\| @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n245 LATIN SMALL LETTER O WITH TILDE\n /\\/| @\n |/\\/ @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n246 LATIN SMALL LETTER O WITH DIAERESIS\n _ _ @\n (_)_(_)@\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n247 DIVISION SIGN\n @\n _ @\n _(_)_ @\n |_____|@\n (_) @\n @@\n248 LATIN SMALL LETTER O WITH STROKE\n @\n ____ @\n / _//\\ @\n | (//) |@\n \\//__/ @\n @@\n249 LATIN SMALL LETTER U WITH GRAVE\n __ @\n _\\_\\_ @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n250 LATIN SMALL LETTER U WITH ACUTE\n __ @\n _/_/_ @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n251 LATIN SMALL LETTER U WITH CIRCUMFLEX\n //\\ @\n |/ \\| @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n252 LATIN SMALL LETTER U WITH DIAERESIS\n _ _ @\n (_) (_)@\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n253 LATIN SMALL LETTER Y WITH ACUTE\n __ @\n _/_/_ @\n | | | |@\n | |_| |@\n \\__, |@\n |___/ @@\n254 LATIN SMALL LETTER THORN\n _ @\n | |__ @\n | '_ \\ @\n | |_) |@\n | .__/ @\n |_| @@\n255 LATIN SMALL LETTER Y WITH DIAERESIS\n _ _ @\n (_) (_)@\n | | | |@\n | |_| |@\n \\__, |@\n |___/ @@\n0x0100 LATIN CAPITAL LETTER A WITH MACRON\n ____ @\n /___/ @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n0x0101 LATIN SMALL LETTER A WITH MACRON\n ___ @\n /_ _/@\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n0x0102 LATIN CAPITAL LETTER A WITH BREVE\n _ _ @\n \\\\_// @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n0x0103 LATIN SMALL LETTER A WITH BREVE\n \\_/ @\n ___ @\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n0x0104 LATIN CAPITAL LETTER A WITH OGONEK\n @\n _ @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n (_(@@\n0x0105 LATIN SMALL LETTER A WITH OGONEK\n @\n __ _ @\n / _` |@\n | (_| |@\n \\__,_|@\n (_(@@\n0x0106 LATIN CAPITAL LETTER C WITH ACUTE\n __ @\n _/_/ @\n / ___|@\n | |___ @\n \\____|@\n @@\n0x0107 LATIN SMALL LETTER C WITH ACUTE\n __ @\n /__/@\n / __|@\n | (__ @\n \\___|@\n @@\n0x0108 LATIN CAPITAL LETTER C WITH CIRCUMFLEX\n /\\ @\n _//\\\\@\n / ___|@\n | |___ @\n \\____|@\n @@\n0x0109 LATIN SMALL LETTER C WITH CIRCUMFLEX\n /\\ @\n /_\\ @\n / __|@\n | (__ @\n \\___|@\n @@\n0x010A LATIN CAPITAL LETTER C WITH DOT ABOVE\n [] @\n ____ @\n / ___|@\n | |___ @\n \\____|@\n @@\n0x010B LATIN SMALL LETTER C WITH DOT ABOVE\n [] @\n ___ @\n / __|@\n | (__ @\n \\___|@\n @@\n0x010C LATIN CAPITAL LETTER C WITH CARON\n \\\\// @\n _\\/_ @\n / ___|@\n | |___ @\n \\____|@\n @@\n0x010D LATIN SMALL LETTER C WITH CARON\n \\\\//@\n _\\/ @\n / __|@\n | (__ @\n \\___|@\n @@\n0x010E LATIN CAPITAL LETTER D WITH CARON\n \\\\// @\n __\\/ @\n | _ \\ @\n | |_| |@\n |____/ @\n @@\n0x010F LATIN SMALL LETTER D WITH CARON\n \\/ _ @\n __| |@\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n0x0110 LATIN CAPITAL LETTER D WITH STROKE\n ____ @\n |_ __ \\ @\n /| |/ | |@\n /|_|/_| |@\n |_____/ @\n @@\n0x0111 LATIN SMALL LETTER D WITH STROKE\n ---|@\n __| |@\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n0x0112 LATIN CAPITAL LETTER E WITH MACRON\n ____ @\n /___/ @\n | ____|@\n | _|_ @\n |_____|@\n @@\n0x0113 LATIN SMALL LETTER E WITH MACRON\n ____@\n /_ _/@\n / _ \\ @\n | __/ @\n \\___| @\n @@\n0x0114 LATIN CAPITAL LETTER E WITH BREVE\n _ _ @\n \\\\_// @\n | ____|@\n | _|_ @\n |_____|@\n @@\n0x0115 LATIN SMALL LETTER E WITH BREVE\n \\\\ //@\n -- @\n / _ \\ @\n | __/ @\n \\___| @\n @@\n0x0116 LATIN CAPITAL LETTER E WITH DOT ABOVE\n [] @\n _____ @\n | ____|@\n | _|_ @\n |_____|@\n @@\n0x0117 LATIN SMALL LETTER E WITH DOT ABOVE\n [] @\n __ @\n / _ \\@\n | __/@\n \\___|@\n @@\n0x0118 LATIN CAPITAL LETTER E WITH OGONEK\n @\n _____ @\n | ____|@\n | _|_ @\n |_____|@\n (__(@@\n0x0119 LATIN SMALL LETTER E WITH OGONEK\n @\n ___ @\n / _ \\@\n | __/@\n \\___|@\n (_(@@\n0x011A LATIN CAPITAL LETTER E WITH CARON\n \\\\// @\n __\\/_ @\n | ____|@\n | _|_ @\n |_____|@\n @@\n0x011B LATIN SMALL LETTER E WITH CARON\n \\\\//@\n \\/ @\n / _ \\@\n | __/@\n \\___|@\n @@\n0x011C LATIN CAPITAL LETTER G WITH CIRCUMFLEX\n _/\\_ @\n / ___|@\n | | _ @\n | |_| |@\n \\____|@\n @@\n0x011D LATIN SMALL LETTER G WITH CIRCUMFLEX\n /\\ @\n _/_ \\@\n / _` |@\n | (_| |@\n \\__, |@\n |___/ @@\n0x011E LATIN CAPITAL LETTER G WITH BREVE\n _\\/_ @\n / ___|@\n | | _ @\n | |_| |@\n \\____|@\n @@\n0x011F LATIN SMALL LETTER G WITH BREVE\n \\___/ @\n __ _ @\n / _` |@\n | (_| |@\n \\__, |@\n |___/ @@\n0x0120 LATIN CAPITAL LETTER G WITH DOT ABOVE\n _[]_ @\n / ___|@\n | | _ @\n | |_| |@\n \\____|@\n @@\n0x0121 LATIN SMALL LETTER G WITH DOT ABOVE\n [] @\n __ _ @\n / _` |@\n | (_| |@\n \\__, |@\n |___/ @@\n0x0122 LATIN CAPITAL LETTER G WITH CEDILLA\n ____ @\n / ___|@\n | | _ @\n | |_| |@\n \\____|@\n )__) @@\n0x0123 LATIN SMALL LETTER G WITH CEDILLA\n @\n __ _ @\n / _` |@\n | (_| |@\n \\__, |@\n |_))))@@\n0x0124 LATIN CAPITAL LETTER H WITH CIRCUMFLEX\n _/ \\_ @\n | / \\ |@\n | |_| |@\n | _ |@\n |_| |_|@\n @@\n0x0125 LATIN SMALL LETTER H WITH CIRCUMFLEX\n _ /\\ @\n | |//\\ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n0x0126 LATIN CAPITAL LETTER H WITH STROKE\n _ _ @\n | |=| |@\n | |_| |@\n | _ |@\n |_| |_|@\n @@\n0x0127 LATIN SMALL LETTER H WITH STROKE\n _ @\n |=|__ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n0x0128 LATIN CAPITAL LETTER I WITH TILDE\n /\\//@\n |_ _|@\n | | @\n | | @\n |___|@\n @@\n0x0129 LATIN SMALL LETTER I WITH TILDE\n @\n /\\/@\n | |@\n | |@\n |_|@\n @@\n0x012A LATIN CAPITAL LETTER I WITH MACRON\n /___/@\n |_ _|@\n | | @\n | | @\n |___|@\n @@\n0x012B LATIN SMALL LETTER I WITH MACRON\n ____@\n /___/@\n | | @\n | | @\n |_| @\n @@\n0x012C LATIN CAPITAL LETTER I WITH BREVE\n \\__/@\n |_ _|@\n | | @\n | | @\n |___|@\n @@\n0x012D LATIN SMALL LETTER I WITH BREVE\n @\n \\_/@\n | |@\n | |@\n |_|@\n @@\n0x012E LATIN CAPITAL LETTER I WITH OGONEK\n ___ @\n |_ _|@\n | | @\n | | @\n |___|@\n (__(@@\n0x012F LATIN SMALL LETTER I WITH OGONEK\n _ @\n (_) @\n | | @\n | | @\n |_|_@\n (_(@@\n0x0130 LATIN CAPITAL LETTER I WITH DOT ABOVE\n _[] @\n |_ _|@\n | | @\n | | @\n |___|@\n @@\n0x0131 LATIN SMALL LETTER DOTLESS I\n @\n _ @\n | |@\n | |@\n |_|@\n @@\n0x0132 LATIN CAPITAL LIGATURE IJ\n ___ _ @\n |_ _|| |@\n | | | |@\n | |_| |@\n |__|__/ @\n @@\n0x0133 LATIN SMALL LIGATURE IJ\n _ _ @\n (_) (_)@\n | | | |@\n | | | |@\n |_|_/ |@\n |__/ @@\n0x0134 LATIN CAPITAL LETTER J WITH CIRCUMFLEX\n /\\ @\n /_\\|@\n _ | | @\n | |_| | @\n \\___/ @\n @@\n0x0135 LATIN SMALL LETTER J WITH CIRCUMFLEX\n /\\@\n /_\\@\n | |@\n | |@\n _/ |@\n |__/ @@\n0x0136 LATIN CAPITAL LETTER K WITH CEDILLA\n _ _ @\n | |/ / @\n | ' / @\n | . \\ @\n |_|\\_\\ @\n )__)@@\n0x0137 LATIN SMALL LETTER K WITH CEDILLA\n _ @\n | | __@\n | |/ /@\n | < @\n |_|\\_\\@\n )_)@@\n0x0138 LATIN SMALL LETTER KRA\n @\n _ __ @\n | |/ \\@\n | < @\n |_|\\_\\@\n @@\n0x0139 LATIN CAPITAL LETTER L WITH ACUTE\n _ //@\n | | // @\n | | @\n | |___ @\n |_____|@\n @@\n0x013A LATIN SMALL LETTER L WITH ACUTE\n //@\n | |@\n | |@\n | |@\n |_|@\n @@\n0x013B LATIN CAPITAL LETTER L WITH CEDILLA\n _ @\n | | @\n | | @\n | |___ @\n |_____|@\n )__)@@\n0x013C LATIN SMALL LETTER L WITH CEDILLA\n _ @\n | | @\n | | @\n | | @\n |_| @\n )_)@@\n0x013D LATIN CAPITAL LETTER L WITH CARON\n _ \\\\//@\n | | \\/ @\n | | @\n | |___ @\n |_____|@\n @@\n0x013E LATIN SMALL LETTER L WITH CARON\n _ \\\\//@\n | | \\/ @\n | | @\n | | @\n |_| @\n @@\n0x013F LATIN CAPITAL LETTER L WITH MIDDLE DOT\n _ @\n | | @\n | | [] @\n | |___ @\n |_____|@\n @@\n0x0140 LATIN SMALL LETTER L WITH MIDDLE DOT\n _ @\n | | @\n | | []@\n | | @\n |_| @\n @@\n0x0141 LATIN CAPITAL LETTER L WITH STROKE\n __ @\n | // @\n |//| @\n // |__ @\n |_____|@\n @@\n0x0142 LATIN SMALL LETTER L WITH STROKE\n _ @\n | |@\n |//@\n //|@\n |_|@\n @@\n0x0143 LATIN CAPITAL LETTER N WITH ACUTE\n _/ /_ @\n | \\ | |@\n | \\| |@\n | |\\ |@\n |_| \\_|@\n @@\n0x0144 LATIN SMALL LETTER N WITH ACUTE\n _ @\n _ /_/ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n0x0145 LATIN CAPITAL LETTER N WITH CEDILLA\n _ _ @\n | \\ | |@\n | \\| |@\n | |\\ |@\n |_| \\_|@\n )_) @@\n0x0146 LATIN SMALL LETTER N WITH CEDILLA\n @\n _ __ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n )_) @@\n0x0147 LATIN CAPITAL LETTER N WITH CARON\n _\\/ _ @\n | \\ | |@\n | \\| |@\n | |\\ |@\n |_| \\_|@\n @@\n0x0148 LATIN SMALL LETTER N WITH CARON\n \\\\// @\n _\\/_ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n0x0149 LATIN SMALL LETTER N PRECEDED BY APOSTROPHE\n @\n _ __ @\n ( )| '_\\ @\n |/| | | |@\n |_| |_|@\n @@\n0x014A LATIN CAPITAL LETTER ENG\n _ _ @\n | \\ | |@\n | \\| |@\n | |\\ |@\n |_| \\ |@\n )_)@@\n0x014B LATIN SMALL LETTER ENG\n _ __ @\n | '_ \\ @\n | | | |@\n |_| | |@\n | |@\n |__ @@\n0x014C LATIN CAPITAL LETTER O WITH MACRON\n ____ @\n /_ _/ @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n0x014D LATIN SMALL LETTER O WITH MACRON\n ____ @\n /_ _/ @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n0x014E LATIN CAPITAL LETTER O WITH BREVE\n \\ / @\n _-_ @\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n0x014F LATIN SMALL LETTER O WITH BREVE\n \\ / @\n _-_ @\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n0x0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE\n ___ @\n /_/_/@\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n0x0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE\n ___ @\n /_/_/@\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n0x0152 LATIN CAPITAL LIGATURE OE\n ___ ___ @\n / _ \\| __|@\n | | | | | @\n | |_| | |__@\n \\___/|____@\n @@\n0x0153 LATIN SMALL LIGATURE OE\n @\n ___ ___ @\n / _ \\ / _ \\@\n | (_) | __/@\n \\___/ \\___|@\n @@\n0x0154 LATIN CAPITAL LETTER R WITH ACUTE\n _/_/ @\n | _ \\ @\n | |_) |@\n | _ < @\n |_| \\_\\@\n @@\n0x0155 LATIN SMALL LETTER R WITH ACUTE\n __@\n _ /_/@\n | '__|@\n | | @\n |_| @\n @@\n0x0156 LATIN CAPITAL LETTER R WITH CEDILLA\n ____ @\n | _ \\ @\n | |_) |@\n | _ < @\n |_| \\_\\@\n )_) @@\n0x0157 LATIN SMALL LETTER R WITH CEDILLA\n @\n _ __ @\n | '__|@\n | | @\n |_| @\n )_) @@\n0x0158 LATIN CAPITAL LETTER R WITH CARON\n _\\_/ @\n | _ \\ @\n | |_) |@\n | _ < @\n |_| \\_\\@\n @@\n0x0159 LATIN SMALL LETTER R WITH CARON\n \\\\// @\n _\\/_ @\n | '__|@\n | | @\n |_| @\n @@\n0x015A LATIN CAPITAL LETTER S WITH ACUTE\n _/_/ @\n / ___| @\n \\___ \\ @\n ___) |@\n |____/ @\n @@\n0x015B LATIN SMALL LETTER S WITH ACUTE\n __@\n _/_/@\n / __|@\n \\__ \\@\n |___/@\n @@\n0x015C LATIN CAPITAL LETTER S WITH CIRCUMFLEX\n _/\\_ @\n / ___| @\n \\___ \\ @\n ___) |@\n |____/ @\n @@\n0x015D LATIN SMALL LETTER S WITH CIRCUMFLEX\n @\n /_\\_@\n / __|@\n \\__ \\@\n |___/@\n @@\n0x015E LATIN CAPITAL LETTER S WITH CEDILLA\n ____ @\n / ___| @\n \\___ \\ @\n ___) |@\n |____/ @\n )__)@@\n0x015F LATIN SMALL LETTER S WITH CEDILLA\n @\n ___ @\n / __|@\n \\__ \\@\n |___/@\n )_)@@\n0x0160 LATIN CAPITAL LETTER S WITH CARON\n _\\_/ @\n / ___| @\n \\___ \\ @\n ___) |@\n |____/ @\n @@\n0x0161 LATIN SMALL LETTER S WITH CARON\n \\\\//@\n _\\/ @\n / __|@\n \\__ \\@\n |___/@\n @@\n0x0162 LATIN CAPITAL LETTER T WITH CEDILLA\n _____ @\n |_ _|@\n | | @\n | | @\n |_| @\n )__)@@\n0x0163 LATIN SMALL LETTER T WITH CEDILLA\n _ @\n | |_ @\n | __|@\n | |_ @\n \\__|@\n )_)@@\n0x0164 LATIN CAPITAL LETTER T WITH CARON\n _____ @\n |_ _|@\n | | @\n | | @\n |_| @\n @@\n0x0165 LATIN SMALL LETTER T WITH CARON\n \\/ @\n | |_ @\n | __|@\n | |_ @\n \\__|@\n @@\n0x0166 LATIN CAPITAL LETTER T WITH STROKE\n _____ @\n |_ _|@\n | | @\n -|-|- @\n |_| @\n @@\n0x0167 LATIN SMALL LETTER T WITH STROKE\n _ @\n | |_ @\n | __|@\n |-|_ @\n \\__|@\n @@\n0x0168 LATIN CAPITAL LETTER U WITH TILDE\n @\n _/\\/_ @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n0x0169 LATIN SMALL LETTER U WITH TILDE\n @\n _/\\/_ @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n0x016A LATIN CAPITAL LETTER U WITH MACRON\n ____ @\n /__ _/@\n | | | |@\n | |_| |@\n \\___/ @\n @@\n0x016B LATIN SMALL LETTER U WITH MACRON\n ____ @\n / _ /@\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n0x016C LATIN CAPITAL LETTER U WITH BREVE\n @\n \\_/_ @\n | | | |@\n | |_| |@\n \\____|@\n @@\n0x016D LATIN SMALL LETTER U WITH BREVE\n @\n \\_/_ @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n0x016E LATIN CAPITAL LETTER U WITH RING ABOVE\n O @\n __ _ @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n0x016F LATIN SMALL LETTER U WITH RING ABOVE\n O @\n __ __ @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n0x0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE\n -- --@\n /_//_/@\n | | | |@\n | |_| |@\n \\___/ @\n @@\n0x0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE\n ____@\n _/_/_/@\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n0x0172 LATIN CAPITAL LETTER U WITH OGONEK\n _ _ @\n | | | |@\n | | | |@\n | |_| |@\n \\___/ @\n (__(@@\n0x0173 LATIN SMALL LETTER U WITH OGONEK\n @\n _ _ @\n | | | |@\n | |_| |@\n \\__,_|@\n (_(@@\n0x0174 LATIN CAPITAL LETTER W WITH CIRCUMFLEX\n __ /\\ __@\n \\ \\ //\\\\/ /@\n \\ \\ /\\ / / @\n \\ V V / @\n \\_/\\_/ @\n @@\n0x0175 LATIN SMALL LETTER W WITH CIRCUMFLEX\n /\\ @\n __ //\\\\__@\n \\ \\ /\\ / /@\n \\ V V / @\n \\_/\\_/ @\n @@\n0x0176 LATIN CAPITAL LETTER Y WITH CIRCUMFLEX\n /\\ @\n __//\\\\ @\n \\ \\ / /@\n \\ V / @\n |_| @\n @@\n0x0177 LATIN SMALL LETTER Y WITH CIRCUMFLEX\n /\\ @\n //\\\\ @\n | | | |@\n | |_| |@\n \\__, |@\n |___/ @@\n0x0178 LATIN CAPITAL LETTER Y WITH DIAERESIS\n [] []@\n __ _@\n \\ \\ / /@\n \\ V / @\n |_| @\n @@\n0x0179 LATIN CAPITAL LETTER Z WITH ACUTE\n __/_/@\n |__ /@\n / / @\n / /_ @\n /____|@\n @@\n0x017A LATIN SMALL LETTER Z WITH ACUTE\n _ @\n _/_/@\n |_ /@\n / / @\n /___|@\n @@\n0x017B LATIN CAPITAL LETTER Z WITH DOT ABOVE\n __[]_@\n |__ /@\n / / @\n / /_ @\n /____|@\n @@\n0x017C LATIN SMALL LETTER Z WITH DOT ABOVE\n [] @\n ____@\n |_ /@\n / / @\n /___|@\n @@\n0x017D LATIN CAPITAL LETTER Z WITH CARON\n _\\_/_@\n |__ /@\n / / @\n / /_ @\n /____|@\n @@\n0x017E LATIN SMALL LETTER Z WITH CARON\n \\\\//@\n _\\/_@\n |_ /@\n / / @\n /___|@\n @@\n0x017F LATIN SMALL LETTER LONG S\n __ @\n / _|@\n |-| | @\n |-| | @\n |_| @\n @@\n0x02C7 CARON\n \\\\//@\n \\/ @\n $@\n $@\n $@\n $@@\n0x02D8 BREVE\n \\\\_//@\n \\_/ @\n $@\n $@\n $@\n $@@\n0x02D9 DOT ABOVE\n []@\n $@\n $@\n $@\n $@\n $@@\n0x02DB OGONEK\n $@\n $@\n $@\n $@\n $@\n )_) @@\n0x02DD DOUBLE ACUTE ACCENT\n _ _ @\n /_/_/@\n $@\n $@\n $@\n $@@"
3
+ }
@@ -0,0 +1,60 @@
1
+ import NoBannerCommand from "./command/NoBannerCommand.js";
2
+ import { PRINTER_SERVICE_ID } from "../../api/service/core/PrinterService.js";
3
+ import { ASCII_BANNER_GENERATOR_SERVICE_ID } from "../../api/service/core/AsciiBannerGeneratorService.js";
4
+ export const BANNER_SERVICE_ID = "@flowscripter/dynamic-cli-framework/banner-service";
5
+ /**
6
+ * Provides ascii banner functionality.
7
+ */
8
+ export default class BannerServiceProvider {
9
+ fontName;
10
+ serviceId = BANNER_SERVICE_ID;
11
+ servicePriority;
12
+ #configurationServiceProvider;
13
+ /**
14
+ * Whether or not to print the banner, defaults to true.
15
+ */
16
+ printBanner = true;
17
+ /**
18
+ * Create an instance of the service provider with the specified details.
19
+ *
20
+ * @param servicePriority the priority of the service.
21
+ * @param configurationServiceProvider an optional {@link ConfigurationServiceProvider} to make use of.
22
+ * @param fontName an optional [FIGlet](http://www.figlet.org) font name to use for the banner, defaults to "standard".
23
+ */
24
+ constructor(servicePriority, configurationServiceProvider, fontName = "standard") {
25
+ this.fontName = fontName;
26
+ this.servicePriority = servicePriority;
27
+ this.#configurationServiceProvider = configurationServiceProvider;
28
+ }
29
+ getServiceInfo(_cliConfig) {
30
+ return Promise.resolve({
31
+ commands: [new NoBannerCommand(this, this.servicePriority)],
32
+ });
33
+ }
34
+ async initService(context) {
35
+ if (this.printBanner === false) {
36
+ return Promise.resolve();
37
+ }
38
+ const printerService = context.getServiceById(PRINTER_SERVICE_ID);
39
+ const asciiBannerGeneratorService = context.getServiceById(ASCII_BANNER_GENERATOR_SERVICE_ID);
40
+ const { cliConfig } = context;
41
+ const bannerText = await asciiBannerGeneratorService.generate(cliConfig.name.toUpperCase(), {
42
+ fontName: this.fontName,
43
+ subMessage: cliConfig.subMessage,
44
+ });
45
+ await printerService.info(printerService.blue(bannerText));
46
+ if (cliConfig.description !== undefined) {
47
+ await printerService.info(` ${printerService.primary(cliConfig.description)}\n`);
48
+ }
49
+ if (cliConfig.version.length > 0) {
50
+ await printerService.info(` ${printerService.secondary("version: " + cliConfig.version)}\n`);
51
+ }
52
+ if (this.#configurationServiceProvider) {
53
+ const configLocation = this.#configurationServiceProvider.configLocation;
54
+ if (configLocation && configLocation.length > 0) {
55
+ await printerService.info(` ${printerService.secondary("config: " + configLocation)}\n`);
56
+ }
57
+ }
58
+ await printerService.info("\n");
59
+ }
60
+ }
@@ -0,0 +1,24 @@
1
+ import { ArgumentValueTypeName, } from "../../../api/argument/ArgumentValueTypes.js";
2
+ /**
3
+ * Command to disable banner output for the CLI application.
4
+ */
5
+ export default class NoBannerCommand {
6
+ name = "no-banner";
7
+ description = "Disable output of banner";
8
+ enableConfiguration = true;
9
+ argument = {
10
+ type: ArgumentValueTypeName.BOOLEAN,
11
+ defaultValue: true,
12
+ configurationKey: "NO_BANNER",
13
+ };
14
+ executePriority;
15
+ #bannerServiceProvider;
16
+ constructor(bannerServiceProvider, executePriority) {
17
+ this.#bannerServiceProvider = bannerServiceProvider;
18
+ this.executePriority = executePriority;
19
+ }
20
+ execute(_context, argumentValue) {
21
+ this.#bannerServiceProvider.printBanner = !argumentValue;
22
+ return Promise.resolve();
23
+ }
24
+ }