@shell-shock/core 0.17.8 → 0.17.11

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 (272) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +29 -1
  2. package/dist/api.cjs +36 -1
  3. package/dist/api.cjs.map +1 -0
  4. package/dist/api.d.cts +2 -77
  5. package/dist/api.d.cts.map +1 -1
  6. package/dist/api.d.mts +2 -76
  7. package/dist/api.d.mts.map +1 -1
  8. package/dist/api.mjs +35 -1
  9. package/dist/api.mjs.map +1 -1
  10. package/dist/components/command-validation-logic.cjs +291 -1
  11. package/dist/components/command-validation-logic.cjs.map +1 -0
  12. package/dist/components/command-validation-logic.d.cts +1 -3
  13. package/dist/components/command-validation-logic.d.cts.map +1 -1
  14. package/dist/components/command-validation-logic.d.mts +1 -3
  15. package/dist/components/command-validation-logic.d.mts.map +1 -1
  16. package/dist/components/command-validation-logic.mjs +288 -1
  17. package/dist/components/command-validation-logic.mjs.map +1 -1
  18. package/dist/components/docs.cjs +265 -1
  19. package/dist/components/docs.cjs.map +1 -0
  20. package/dist/components/docs.d.cts +4 -5
  21. package/dist/components/docs.d.cts.map +1 -1
  22. package/dist/components/docs.d.mts +4 -5
  23. package/dist/components/docs.d.mts.map +1 -1
  24. package/dist/components/docs.mjs +256 -1
  25. package/dist/components/docs.mjs.map +1 -1
  26. package/dist/components/exec-builtin.cjs +429 -15
  27. package/dist/components/exec-builtin.cjs.map +1 -0
  28. package/dist/components/exec-builtin.d.cts +1 -2
  29. package/dist/components/exec-builtin.d.cts.map +1 -1
  30. package/dist/components/exec-builtin.d.mts +1 -2
  31. package/dist/components/exec-builtin.d.mts.map +1 -1
  32. package/dist/components/exec-builtin.mjs +424 -15
  33. package/dist/components/exec-builtin.mjs.map +1 -1
  34. package/dist/components/helpers.cjs +119 -1
  35. package/dist/components/helpers.cjs.map +1 -0
  36. package/dist/components/helpers.d.cts +6 -8
  37. package/dist/components/helpers.d.cts.map +1 -1
  38. package/dist/components/helpers.d.mts +6 -8
  39. package/dist/components/helpers.d.mts.map +1 -1
  40. package/dist/components/helpers.mjs +111 -1
  41. package/dist/components/helpers.mjs.map +1 -1
  42. package/dist/components/index.cjs +58 -1
  43. package/dist/components/index.mjs +10 -1
  44. package/dist/components/options-parser-logic.cjs +959 -5
  45. package/dist/components/options-parser-logic.cjs.map +1 -0
  46. package/dist/components/options-parser-logic.d.cts +8 -9
  47. package/dist/components/options-parser-logic.d.cts.map +1 -1
  48. package/dist/components/options-parser-logic.d.mts +8 -9
  49. package/dist/components/options-parser-logic.d.mts.map +1 -1
  50. package/dist/components/options-parser-logic.mjs +944 -5
  51. package/dist/components/options-parser-logic.mjs.map +1 -1
  52. package/dist/components/state-builtin.cjs +630 -8
  53. package/dist/components/state-builtin.cjs.map +1 -0
  54. package/dist/components/state-builtin.d.cts +4 -5
  55. package/dist/components/state-builtin.d.cts.map +1 -1
  56. package/dist/components/state-builtin.d.mts +4 -5
  57. package/dist/components/state-builtin.d.mts.map +1 -1
  58. package/dist/components/state-builtin.mjs +622 -8
  59. package/dist/components/state-builtin.mjs.map +1 -1
  60. package/dist/components/usage.cjs +116 -1
  61. package/dist/components/usage.cjs.map +1 -0
  62. package/dist/components/usage.d.cts +1 -2
  63. package/dist/components/usage.d.cts.map +1 -1
  64. package/dist/components/usage.d.mts +1 -2
  65. package/dist/components/usage.d.mts.map +1 -1
  66. package/dist/components/usage.mjs +113 -1
  67. package/dist/components/usage.mjs.map +1 -1
  68. package/dist/components/utils-builtin.cjs +839 -33
  69. package/dist/components/utils-builtin.cjs.map +1 -0
  70. package/dist/components/utils-builtin.d.cts +7 -8
  71. package/dist/components/utils-builtin.d.cts.map +1 -1
  72. package/dist/components/utils-builtin.d.mts +7 -8
  73. package/dist/components/utils-builtin.d.mts.map +1 -1
  74. package/dist/components/utils-builtin.mjs +828 -33
  75. package/dist/components/utils-builtin.mjs.map +1 -1
  76. package/dist/config.cjs +65 -1
  77. package/dist/config.cjs.map +1 -0
  78. package/dist/config.d.cts +29 -8
  79. package/dist/config.d.cts.map +1 -1
  80. package/dist/config.d.mts +29 -8
  81. package/dist/config.d.mts.map +1 -1
  82. package/dist/config.mjs +62 -1
  83. package/dist/config.mjs.map +1 -1
  84. package/dist/contexts/command.cjs +26 -1
  85. package/dist/contexts/command.cjs.map +1 -0
  86. package/dist/contexts/command.d.cts.map +1 -1
  87. package/dist/contexts/command.d.mts.map +1 -1
  88. package/dist/contexts/command.mjs +23 -1
  89. package/dist/contexts/command.mjs.map +1 -1
  90. package/dist/contexts/index.cjs +9 -1
  91. package/dist/contexts/index.mjs +4 -1
  92. package/dist/contexts/options.cjs +63 -1
  93. package/dist/contexts/options.cjs.map +1 -0
  94. package/dist/contexts/options.d.cts.map +1 -1
  95. package/dist/contexts/options.d.mts.map +1 -1
  96. package/dist/contexts/options.mjs +57 -1
  97. package/dist/contexts/options.mjs.map +1 -1
  98. package/dist/engine.cjs +138 -0
  99. package/dist/engine.cjs.map +1 -0
  100. package/dist/engine.d.cts +79 -0
  101. package/dist/engine.d.cts.map +1 -0
  102. package/dist/engine.d.mts +79 -0
  103. package/dist/engine.d.mts.map +1 -0
  104. package/dist/engine.mjs +136 -0
  105. package/dist/engine.mjs.map +1 -0
  106. package/dist/helpers/automd.cjs +70 -1
  107. package/dist/helpers/automd.cjs.map +1 -0
  108. package/dist/helpers/automd.mjs +69 -1
  109. package/dist/helpers/automd.mjs.map +1 -1
  110. package/dist/helpers/docs-helpers.cjs +23 -1
  111. package/dist/helpers/docs-helpers.cjs.map +1 -0
  112. package/dist/helpers/docs-helpers.mjs +22 -1
  113. package/dist/helpers/docs-helpers.mjs.map +1 -1
  114. package/dist/helpers/get-framework.cjs +24 -0
  115. package/dist/helpers/get-framework.cjs.map +1 -0
  116. package/dist/helpers/get-framework.mjs +24 -0
  117. package/dist/helpers/get-framework.mjs.map +1 -0
  118. package/dist/helpers/paths.cjs +137 -1
  119. package/dist/helpers/paths.cjs.map +1 -0
  120. package/dist/helpers/paths.mjs +133 -1
  121. package/dist/helpers/paths.mjs.map +1 -1
  122. package/dist/helpers/persistence.cjs +113 -1
  123. package/dist/helpers/persistence.cjs.map +1 -0
  124. package/dist/helpers/persistence.mjs +112 -1
  125. package/dist/helpers/persistence.mjs.map +1 -1
  126. package/dist/helpers/update-package-json.cjs +65 -1
  127. package/dist/helpers/update-package-json.cjs.map +1 -0
  128. package/dist/helpers/update-package-json.mjs +63 -1
  129. package/dist/helpers/update-package-json.mjs.map +1 -1
  130. package/dist/helpers/utilities.cjs +95 -1
  131. package/dist/helpers/utilities.cjs.map +1 -0
  132. package/dist/helpers/utilities.mjs +93 -1
  133. package/dist/helpers/utilities.mjs.map +1 -1
  134. package/dist/helpers/validations.cjs +71 -1
  135. package/dist/helpers/validations.cjs.map +1 -0
  136. package/dist/helpers/validations.mjs +69 -1
  137. package/dist/helpers/validations.mjs.map +1 -1
  138. package/dist/index.cjs +123 -1
  139. package/dist/index.cjs.map +1 -0
  140. package/dist/index.d.cts +80 -5
  141. package/dist/index.d.cts.map +1 -0
  142. package/dist/index.d.mts +80 -5
  143. package/dist/index.d.mts.map +1 -0
  144. package/dist/index.mjs +119 -1
  145. package/dist/index.mjs.map +1 -0
  146. package/dist/package.cjs +12 -0
  147. package/dist/package.cjs.map +1 -0
  148. package/dist/package.mjs +6 -0
  149. package/dist/package.mjs.map +1 -0
  150. package/dist/plugin-utils/compute-bin.cjs +48 -1
  151. package/dist/plugin-utils/compute-bin.cjs.map +1 -0
  152. package/dist/plugin-utils/compute-bin.d.cts +2 -2
  153. package/dist/plugin-utils/compute-bin.d.cts.map +1 -1
  154. package/dist/plugin-utils/compute-bin.d.mts +2 -2
  155. package/dist/plugin-utils/compute-bin.d.mts.map +1 -1
  156. package/dist/plugin-utils/compute-bin.mjs +47 -1
  157. package/dist/plugin-utils/compute-bin.mjs.map +1 -1
  158. package/dist/plugin-utils/context-helpers.cjs +224 -1
  159. package/dist/plugin-utils/context-helpers.cjs.map +1 -0
  160. package/dist/plugin-utils/context-helpers.d.cts +4 -4
  161. package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
  162. package/dist/plugin-utils/context-helpers.d.mts +4 -4
  163. package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
  164. package/dist/plugin-utils/context-helpers.mjs +214 -1
  165. package/dist/plugin-utils/context-helpers.mjs.map +1 -1
  166. package/dist/plugin-utils/deepkit.cjs +70 -1
  167. package/dist/plugin-utils/deepkit.cjs.map +1 -0
  168. package/dist/plugin-utils/deepkit.d.cts +5 -5
  169. package/dist/plugin-utils/deepkit.d.cts.map +1 -1
  170. package/dist/plugin-utils/deepkit.d.mts +5 -5
  171. package/dist/plugin-utils/deepkit.d.mts.map +1 -1
  172. package/dist/plugin-utils/deepkit.mjs +68 -1
  173. package/dist/plugin-utils/deepkit.mjs.map +1 -1
  174. package/dist/plugin-utils/description-helpers.cjs +112 -2
  175. package/dist/plugin-utils/description-helpers.cjs.map +1 -0
  176. package/dist/plugin-utils/description-helpers.d.cts.map +1 -1
  177. package/dist/plugin-utils/description-helpers.d.mts.map +1 -1
  178. package/dist/plugin-utils/description-helpers.mjs +107 -2
  179. package/dist/plugin-utils/description-helpers.mjs.map +1 -1
  180. package/dist/plugin-utils/get-command-tree.cjs +118 -1
  181. package/dist/plugin-utils/get-command-tree.cjs.map +1 -0
  182. package/dist/plugin-utils/get-command-tree.d.cts.map +1 -1
  183. package/dist/plugin-utils/get-command-tree.d.mts.map +1 -1
  184. package/dist/plugin-utils/get-command-tree.mjs +114 -1
  185. package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
  186. package/dist/plugin-utils/index.cjs +39 -1
  187. package/dist/plugin-utils/index.d.cts +2 -2
  188. package/dist/plugin-utils/index.d.mts +2 -2
  189. package/dist/plugin-utils/index.mjs +10 -1
  190. package/dist/plugin-utils/reflect.cjs +52 -1
  191. package/dist/plugin-utils/reflect.cjs.map +1 -0
  192. package/dist/plugin-utils/reflect.d.cts.map +1 -1
  193. package/dist/plugin-utils/reflect.d.mts.map +1 -1
  194. package/dist/plugin-utils/reflect.mjs +50 -1
  195. package/dist/plugin-utils/reflect.mjs.map +1 -1
  196. package/dist/plugin-utils/traverse-command-tree.cjs +65 -1
  197. package/dist/plugin-utils/traverse-command-tree.cjs.map +1 -0
  198. package/dist/plugin-utils/traverse-command-tree.d.cts.map +1 -1
  199. package/dist/plugin-utils/traverse-command-tree.d.mts.map +1 -1
  200. package/dist/plugin-utils/traverse-command-tree.mjs +62 -1
  201. package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -1
  202. package/dist/plugin-utils/type-checks.cjs +222 -1
  203. package/dist/plugin-utils/type-checks.cjs.map +1 -0
  204. package/dist/plugin-utils/type-checks.d.cts +5 -5
  205. package/dist/plugin-utils/type-checks.d.cts.map +1 -1
  206. package/dist/plugin-utils/type-checks.d.mts +5 -5
  207. package/dist/plugin-utils/type-checks.d.mts.map +1 -1
  208. package/dist/plugin-utils/type-checks.mjs +217 -1
  209. package/dist/plugin-utils/type-checks.mjs.map +1 -1
  210. package/dist/plugin.cjs +495 -4
  211. package/dist/plugin.cjs.map +1 -0
  212. package/dist/plugin.d.cts.map +1 -1
  213. package/dist/plugin.d.mts.map +1 -1
  214. package/dist/plugin.mjs +488 -4
  215. package/dist/plugin.mjs.map +1 -1
  216. package/dist/resolver/helpers.cjs +182 -1
  217. package/dist/resolver/helpers.cjs.map +1 -0
  218. package/dist/resolver/helpers.mjs +178 -1
  219. package/dist/resolver/helpers.mjs.map +1 -1
  220. package/dist/resolver/resolve.cjs +479 -1
  221. package/dist/resolver/resolve.cjs.map +1 -0
  222. package/dist/resolver/resolve.mjs +478 -1
  223. package/dist/resolver/resolve.mjs.map +1 -1
  224. package/dist/types/command.cjs +402 -1
  225. package/dist/types/command.cjs.map +1 -0
  226. package/dist/types/command.d.cts +61 -119
  227. package/dist/types/command.d.cts.map +1 -1
  228. package/dist/types/command.d.mts +61 -119
  229. package/dist/types/command.d.mts.map +1 -1
  230. package/dist/types/command.mjs +367 -1
  231. package/dist/types/command.mjs.map +1 -1
  232. package/dist/types/config.cjs +175 -1
  233. package/dist/types/config.cjs.map +1 -0
  234. package/dist/types/config.d.cts +19 -12
  235. package/dist/types/config.d.cts.map +1 -1
  236. package/dist/types/config.d.mts +19 -12
  237. package/dist/types/config.d.mts.map +1 -1
  238. package/dist/types/config.mjs +163 -1
  239. package/dist/types/config.mjs.map +1 -1
  240. package/dist/types/context.cjs +45 -1
  241. package/dist/types/context.cjs.map +1 -0
  242. package/dist/types/context.d.cts +3 -2
  243. package/dist/types/context.d.cts.map +1 -1
  244. package/dist/types/context.d.mts +3 -2
  245. package/dist/types/context.d.mts.map +1 -1
  246. package/dist/types/context.mjs +40 -1
  247. package/dist/types/context.mjs.map +1 -1
  248. package/dist/types/env.cjs +53 -1
  249. package/dist/types/env.cjs.map +1 -0
  250. package/dist/types/env.d.cts +1 -1
  251. package/dist/types/env.d.cts.map +1 -1
  252. package/dist/types/env.d.mts +1 -1
  253. package/dist/types/env.d.mts.map +1 -1
  254. package/dist/types/env.mjs +50 -1
  255. package/dist/types/env.mjs.map +1 -1
  256. package/dist/types/index.cjs +53 -1
  257. package/dist/types/index.d.cts +4 -4
  258. package/dist/types/index.d.mts +4 -4
  259. package/dist/types/index.mjs +6 -1
  260. package/dist/types/options.cjs +13 -1
  261. package/dist/types/options.cjs.map +1 -0
  262. package/dist/types/options.d.cts.map +1 -1
  263. package/dist/types/options.d.mts.map +1 -1
  264. package/dist/types/options.mjs +10 -1
  265. package/dist/types/options.mjs.map +1 -1
  266. package/package.json +43 -34
  267. package/dist/resolver/deepkit.cjs +0 -1
  268. package/dist/resolver/deepkit.mjs +0 -2
  269. package/dist/resolver/deepkit.mjs.map +0 -1
  270. package/dist/resolver/module.cjs +0 -1
  271. package/dist/resolver/module.mjs +0 -2
  272. package/dist/resolver/module.mjs.map +0 -1
@@ -1,4 +1,53 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`@alloy-js/core/jsx-runtime`),n=require(`defu`);n=e.__toESM(n);let r=require(`@alloy-js/core`),i=require(`@powerlines/plugin-alloy/core/components/spacing`),a=require(`@powerlines/plugin-alloy/core/contexts/context`),o=require(`@alloy-js/typescript`),s=require(`@powerlines/plugin-alloy/typescript/components/builtin-file`),c=require(`@powerlines/plugin-alloy/typescript/components/tsdoc`);const l=[`T`,`K`,()=>u,()=>d,`Omit`,`b!b"e!!e!!ge!"o$#o##w%y`],u=[`T`,`K`,`Pick`,`l+e#!e"!fRb!b"Pde""N#!w#y`],d=[`T`,`U`,`Exclude`,`l6!Re$!RPe#!e$"qk#%QRb!b"Pde"!p)w#y`],f=[()=>l,`id`,`description`,`UtilsBuiltinProps`,`P!P.".#Jo!#Mw$y`];function p(){let e=(a.usePowerlines.Ω=[[`Context`,`"w!`]],(0,a.usePowerlines)());return[(0,t.createComponent)(o.VarDeclaration,{const:!0,name:`deburred`,initializer:r.code` {
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
+ let _alloy_js_core = require("@alloy-js/core");
5
+ let defu = require("defu");
6
+ defu = require_runtime.__toESM(defu);
7
+ let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
8
+ let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
9
+ let _alloy_js_typescript = require("@alloy-js/typescript");
10
+ let _powerlines_plugin_alloy_typescript_components_builtin_file = require("@powerlines/plugin-alloy/typescript/components/builtin-file");
11
+ let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
12
+
13
+ //#region src/components/utils-builtin.tsx
14
+ const __ΩOmit = [
15
+ "T",
16
+ "K",
17
+ () => __ΩPick,
18
+ () => __ΩExclude,
19
+ "Omit",
20
+ "b!b\"e!!e!!ge!\"o$#o##w%y"
21
+ ];
22
+ const __ΩPick = [
23
+ "T",
24
+ "K",
25
+ "Pick",
26
+ "l+e#!e\"!fRb!b\"Pde\"\"N#!w#y"
27
+ ];
28
+ const __ΩExclude = [
29
+ "T",
30
+ "U",
31
+ "Exclude",
32
+ "l6!Re$!RPe#!e$\"qk#%QRb!b\"Pde\"!p)w#y"
33
+ ];
34
+ const __ΩUtilsBuiltinProps = [
35
+ () => __ΩOmit,
36
+ "id",
37
+ "description",
38
+ "UtilsBuiltinProps",
39
+ "P!P.\".#Jo!#Mw$y"
40
+ ];
41
+ /**
42
+ * Generates the `findSuggestions` function for suggesting corrections for potentially misspelled options or commands.
43
+ */
44
+ function FindSuggestionsDeclaration() {
45
+ const context = (_powerlines_plugin_alloy_core_contexts_context.usePowerlines.Ω = [["Context", "\"w!"]], (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)());
46
+ return [
47
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
48
+ "const": true,
49
+ name: "deburred",
50
+ initializer: _alloy_js_core.code` {
2
51
  "\\xc0": "A", "\\xc1": "A", "\\xc2": "A", "\\xc3": "A", "\\xc4": "A", "\\xc5": "A",
3
52
  "\\xe0": "a", "\\xe1": "a", "\\xe2": "a", "\\xe3": "a", "\\xe4": "a", "\\xe5": "a",
4
53
  "\\xc7": "C", "\\xe7": "c",
@@ -51,7 +100,51 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
51
100
  "\\u0132": "IJ", "\\u0133": "ij",
52
101
  "\\u0152": "Oe", "\\u0153": "oe",
53
102
  "\\u0149": "n", "\\u017f": "s"
54
- } as Record<string, string>; `}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(c.TSDoc,{heading:`A utility function that takes an input string and a list of possible matches, and returns a list of suggested matches based on the Levenshtein distance between the input and the possible matches.`,get children(){return[(0,t.createComponent)(c.TSDocRemarks,{children:`This function is intended to be used to suggest corrections for potentially misspelled options or commands.`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(c.TSDocInternal,{}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(c.TSDocParam,{name:`input`,children:`The input string to check for potential matches.`}),(0,t.createComponent)(c.TSDocParam,{name:`options`,children:`A list of possible matches to compare against the input.`}),(0,t.createComponent)(c.TSDocReturns,{children:`A list of suggested matches based on the Levenshtein distance.`})]}}),(0,t.createComponent)(o.FunctionDeclaration,{export:!0,name:`findSuggestions`,parameters:[{name:`input`,type:`string`},{name:`options`,type:`string[]`}],returnType:`string[]`,get children(){return[(0,t.createComponent)(o.VarDeclaration,{const:!0,name:`normalizedInput`,get initializer(){return r.code`String(input ?? "")${e.config.isCaseSensitive?``:`.toLowerCase()`}.trim().replaceAll(/[\\s\\-_\\.]+/gu, " ").replace(/[\\\\xc0-\\\\xd6\\\\xd8-\\\\xf6\\\\xf8-\\\\xff\\\\u0100-\\\\u017f]/g, key => deburred[key]).replace(/[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]/g, ""); `}}),(0,t.createComponent)(i.Spacing,{}),(0,t.memo)(()=>r.code`
103
+ } as Record<string, string>; `
104
+ }),
105
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
106
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
107
+ heading: "A utility function that takes an input string and a list of possible matches, and returns a list of suggested matches based on the Levenshtein distance between the input and the possible matches.",
108
+ get children() {
109
+ return [
110
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: "This function is intended to be used to suggest corrections for potentially misspelled options or commands." }),
111
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
112
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocInternal, {}),
113
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
114
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
115
+ name: "input",
116
+ children: "The input string to check for potential matches."
117
+ }),
118
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
119
+ name: "options",
120
+ children: "A list of possible matches to compare against the input."
121
+ }),
122
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: "A list of suggested matches based on the Levenshtein distance." })
123
+ ];
124
+ }
125
+ }),
126
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
127
+ "export": true,
128
+ name: "findSuggestions",
129
+ parameters: [{
130
+ name: "input",
131
+ type: "string"
132
+ }, {
133
+ name: "options",
134
+ type: "string[]"
135
+ }],
136
+ returnType: "string[]",
137
+ get children() {
138
+ return [
139
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
140
+ "const": true,
141
+ name: "normalizedInput",
142
+ get initializer() {
143
+ return _alloy_js_core.code`String(input ?? "")${context.config.isCaseSensitive ? "" : ".toLowerCase()"}.trim().replaceAll(/[\\s\\-_\\.]+/gu, " ").replace(/[\\\\xc0-\\\\xd6\\\\xd8-\\\\xf6\\\\xf8-\\\\xff\\\\u0100-\\\\u017f]/g, key => deburred[key]).replace(/[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]/g, ""); `;
144
+ }
145
+ }),
146
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
147
+ (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
55
148
  if (!normalizedInput || options.length === 0) {
56
149
  return [];
57
150
  }
@@ -60,7 +153,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
60
153
  const results: Array<{ option: string; distance: number }> = [];
61
154
 
62
155
  for (const option of options) {
63
- const normalizedOption = String(option ?? "")${e.config.isCaseSensitive?``:`.toLowerCase()`}.trim().replaceAll(/[\\s\\-_\\.]+/gu, " ").replace(/[\\\\xc0-\\\\xd6\\\\xd8-\\\\xf6\\\\xf8-\\\\xff\\\\u0100-\\\\u017f]/g, key => deburred[key]).replace(/[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]/g, "");
156
+ const normalizedOption = String(option ?? "")${context.config.isCaseSensitive ? "" : ".toLowerCase()"}.trim().replaceAll(/[\\s\\-_\\.]+/gu, " ").replace(/[\\\\xc0-\\\\xd6\\\\xd8-\\\\xf6\\\\xf8-\\\\xff\\\\u0100-\\\\u017f]/g, key => deburred[key]).replace(/[\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff]/g, "");
64
157
 
65
158
  if (!normalizedOption) {
66
159
  continue;
@@ -137,7 +230,41 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
137
230
  }
138
231
 
139
232
  return results.sort((a, b) => a.distance - b.distance).map(r => r.option);
140
- `)]}})]}p.__type=[`FindSuggestionsDeclaration`,"Generates the `findSuggestions` function for suggesting corrections for potentially misspelled options or commands.",`P"/!?"`];function m(){return[(0,t.createComponent)(o.VarDeclaration,{export:!0,const:!0,name:`DEFAULT_TERMINAL_COLUMNS`,doc:`Default number of terminal columns`,initializer:r.code`80`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.VarDeclaration,{export:!0,const:!0,name:`DEFAULT_TERMINAL_ROWS`,doc:`Default number of terminal rows`,initializer:r.code`24`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.FunctionDeclaration,{name:`isForegroundProcess`,children:r.code`if (isLinux) {
233
+ `)
234
+ ];
235
+ }
236
+ })
237
+ ];
238
+ }
239
+ FindSuggestionsDeclaration.__type = [
240
+ "FindSuggestionsDeclaration",
241
+ "Generates the `findSuggestions` function for suggesting corrections for potentially misspelled options or commands.",
242
+ "P\"/!?\""
243
+ ];
244
+ /**
245
+ * Generates utilities for detecting terminal size and whether the process is running in the foreground, which can be used to determine how to render output (e.g., whether to use a progress bar or spinner).
246
+ */
247
+ function TerminalSizeDeclaration() {
248
+ return [
249
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
250
+ "export": true,
251
+ "const": true,
252
+ name: "DEFAULT_TERMINAL_COLUMNS",
253
+ doc: "Default number of terminal columns",
254
+ initializer: _alloy_js_core.code`80`
255
+ }),
256
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
257
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
258
+ "export": true,
259
+ "const": true,
260
+ name: "DEFAULT_TERMINAL_ROWS",
261
+ doc: "Default number of terminal rows",
262
+ initializer: _alloy_js_core.code`24`
263
+ }),
264
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
265
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
266
+ name: "isForegroundProcess",
267
+ children: _alloy_js_core.code`if (isLinux) {
141
268
  return true;
142
269
  }
143
270
 
@@ -164,14 +291,24 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
164
291
  return processGroupId === foregroundProcessGroupId;
165
292
  } catch {
166
293
  return false;
167
- } `}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.FunctionDeclaration,{name:`tput`,children:r.code`try {
294
+ } `
295
+ }),
296
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
297
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
298
+ name: "tput",
299
+ children: _alloy_js_core.code`try {
168
300
  const columns = execSync(["tput", "cols"], { env: { TERM: 'dumb', ...process.env } });
169
301
  const rows = execSync(["tput", "lines"], { env: { TERM: 'dumb', ...process.env } });
170
302
 
171
303
  if (columns && rows) {
172
304
  return { columns: Number.parseInt(columns.toString().trim(), 10), rows: Number.parseInt(rows.toString().trim(), 10) };
173
305
  }
174
- } catch {} `}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.FunctionDeclaration,{name:`devTty`,children:r.code`try {
306
+ } catch {} `
307
+ }),
308
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
309
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
310
+ name: "devTty",
311
+ children: _alloy_js_core.code`try {
175
312
  const writeStream = new WriteStream(
176
313
  openSync(
177
314
  "/dev/tty",
@@ -180,21 +317,160 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
180
317
  ).getWindowSize();
181
318
 
182
319
  return { columns: writeStream[0], rows: writeStream[1] };
183
- } catch {} `}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(c.TSDoc,{heading:`A utility function that attempts to determine the size of the terminal (number of columns and rows) using various methods, and falls back to default values if it cannot be determined. This can be used to adjust output formatting based on the available terminal size.`,get children(){return[(0,t.createComponent)(c.TSDocRemarks,{children:`The function first checks if the process is running in a TTY environment and if the stdout or stderr streams provide column and row information. If not, it attempts to use platform-specific methods (like reading from /proc/self/stat on Linux, using tput on Unix-like systems, or checking /dev/tty) to determine the terminal size. If all else fails, it returns default values.`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(c.TSDocReturns,{children:`An object containing the number of columns and rows of the terminal.`})]}}),(0,t.createComponent)(o.FunctionDeclaration,{export:!0,name:`getTerminalSize`,returnType:`{ columns: number; rows: number; }`,get children(){return[(0,t.createComponent)(o.IfStatement,{condition:r.code`process.stdout?.columns && process.stdout?.rows`,children:r.code`return { columns: process.stdout.columns, rows: process.stdout.rows }; `}),(0,t.createComponent)(o.IfStatement,{condition:r.code`process.stderr?.columns && process.stderr?.rows`,children:r.code`return { columns: process.stderr.columns, rows: process.stderr.rows };`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.IfStatement,{condition:r.code`isWindows`,children:r.code`return tput() ?? {
320
+ } catch {} `
321
+ }),
322
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
323
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
324
+ heading: "A utility function that attempts to determine the size of the terminal (number of columns and rows) using various methods, and falls back to default values if it cannot be determined. This can be used to adjust output formatting based on the available terminal size.",
325
+ get children() {
326
+ return [
327
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: "The function first checks if the process is running in a TTY environment and if the stdout or stderr streams provide column and row information. If not, it attempts to use platform-specific methods (like reading from /proc/self/stat on Linux, using tput on Unix-like systems, or checking /dev/tty) to determine the terminal size. If all else fails, it returns default values." }),
328
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
329
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: "An object containing the number of columns and rows of the terminal." })
330
+ ];
331
+ }
332
+ }),
333
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
334
+ "export": true,
335
+ name: "getTerminalSize",
336
+ returnType: "{ columns: number; rows: number; }",
337
+ get children() {
338
+ return [
339
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
340
+ condition: _alloy_js_core.code`process.stdout?.columns && process.stdout?.rows`,
341
+ children: _alloy_js_core.code`return { columns: process.stdout.columns, rows: process.stdout.rows }; `
342
+ }),
343
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
344
+ condition: _alloy_js_core.code`process.stderr?.columns && process.stderr?.rows`,
345
+ children: _alloy_js_core.code`return { columns: process.stderr.columns, rows: process.stderr.rows };`
346
+ }),
347
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
348
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
349
+ condition: _alloy_js_core.code`isWindows`,
350
+ children: _alloy_js_core.code`return tput() ?? {
184
351
  columns: DEFAULT_TERMINAL_COLUMNS,
185
352
  rows: DEFAULT_TERMINAL_ROWS,
186
- }; `}),(0,t.createComponent)(o.IfStatement,{condition:r.code`isMacOS`,children:r.code`return devTty() ?? tput() ?? {
353
+ }; `
354
+ }),
355
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
356
+ condition: _alloy_js_core.code`isMacOS`,
357
+ children: _alloy_js_core.code`return devTty() ?? tput() ?? {
187
358
  columns: DEFAULT_TERMINAL_COLUMNS,
188
359
  rows: DEFAULT_TERMINAL_ROWS,
189
- }; `}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.VarDeclaration,{let:!0,name:`result`,initializer:r.code`devTty() ?? tput(); `}),(0,t.createComponent)(o.IfStatement,{condition:r.code`!result && isForegroundProcess()`,children:r.code`try {
360
+ }; `
361
+ }),
362
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
363
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
364
+ "let": true,
365
+ name: "result",
366
+ initializer: _alloy_js_core.code`devTty() ?? tput(); `
367
+ }),
368
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
369
+ condition: _alloy_js_core.code`!result && isForegroundProcess()`,
370
+ children: _alloy_js_core.code`try {
190
371
  const size = execSync(["resize", "-u"]).match(/\\d+/g);
191
372
  if (size.length === 2) {
192
373
  result = { columns: Number.parseInt(size[0], 10), rows: Number.parseInt(size[1], 10) };
193
374
  }
194
- } catch {} `}),(0,t.createComponent)(i.Spacing,{}),r.code`return result ?? {
375
+ } catch {} `
376
+ }),
377
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
378
+ _alloy_js_core.code`return result ?? {
195
379
  columns: DEFAULT_TERMINAL_COLUMNS,
196
380
  rows: DEFAULT_TERMINAL_ROWS,
197
- }; `]}})]}m.__type=[`TerminalSizeDeclaration`,`Generates utilities for detecting terminal size and whether the process is running in the foreground, which can be used to determine how to render output (e.g., whether to use a progress bar or spinner).`,`P"/!?"`];function h(){return[(0,t.createComponent)(o.VarDeclaration,{export:!0,const:!0,name:`isTTY`,doc:`Detect if stdout.TTY is available`,initializer:r.code`Boolean(process.stdout && process.stdout.isTTY);`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.VarDeclaration,{export:!0,const:!0,name:`isMinimal`,doc:`Detect if the current environment is minimal (CI, non-TTY, etc.)`,initializer:r.code` env.MINIMAL || isCI || isTest || !isTTY; `}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.VarDeclaration,{export:!0,const:!0,name:`isInteractive`,doc:`Detect if the current environment is interactive`,initializer:r.code` !isMinimal && process.stdin?.isTTY && env.TERM !== "dumb" && !hasFlag(["no-interactive", "non-interactive", "no-interact"]); `})]}h.__type=[`EnvSupportUtilities`,`Generates utilities for detecting terminal color support.`,`P"/!?"`];function g(){return[(0,t.createComponent)(o.InterfaceDeclaration,{export:!0,name:`GetColorSupportLevelOptions`,doc:`Options for the getColorSupportLevel function`,get children(){return(0,t.createComponent)(o.InterfaceMember,{name:`ignoreFlags`,type:`boolean`,doc:`Indicates if the function should skip checking command-line flags for color support`})}}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(c.TSDoc,{heading:`Checks if a specific flag is present in the command-line arguments.`,get children(){return[(0,t.createComponent)(c.TSDocLink,{children:`https://github.com/sindresorhus/has-flag/blob/main/index.js`}),(0,t.createComponent)(c.TSDocParam,{name:`flag`,children:`The flag to check for, e.g., "color", "no-color".`}),(0,t.createComponent)(c.TSDocParam,{name:`argv`,children:`The command-line arguments to check against. Defaults to global Deno args or process args.`}),(0,t.createComponent)(c.TSDocReturns,{children:`True if the flag is present, false otherwise.`})]}}),(0,t.createComponent)(o.FunctionDeclaration,{export:!0,name:`getColorSupportLevel`,parameters:[{name:`stream`,type:`NodeJS.WriteStream & { fd: 1 | 2; }`},{name:`options`,type:`GetColorSupportLevelOptions`,default:`{ ignoreFlags: false }`}],children:r.code`const { ignoreFlags } = options;
381
+ }; `
382
+ ];
383
+ }
384
+ })
385
+ ];
386
+ }
387
+ TerminalSizeDeclaration.__type = [
388
+ "TerminalSizeDeclaration",
389
+ "Generates utilities for detecting terminal size and whether the process is running in the foreground, which can be used to determine how to render output (e.g., whether to use a progress bar or spinner).",
390
+ "P\"/!?\""
391
+ ];
392
+ /**
393
+ * Generates utilities for detecting terminal color support.
394
+ */
395
+ function EnvSupportUtilities() {
396
+ return [
397
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
398
+ "export": true,
399
+ "const": true,
400
+ name: "isTTY",
401
+ doc: "Detect if stdout.TTY is available",
402
+ initializer: _alloy_js_core.code`Boolean(process.stdout && process.stdout.isTTY);`
403
+ }),
404
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
405
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
406
+ "export": true,
407
+ "const": true,
408
+ name: "isMinimal",
409
+ doc: "Detect if the current environment is minimal (CI, non-TTY, etc.)",
410
+ initializer: _alloy_js_core.code` env.MINIMAL || isCI || isTest || !isTTY; `
411
+ }),
412
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
413
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
414
+ "export": true,
415
+ "const": true,
416
+ name: "isInteractive",
417
+ doc: "Detect if the current environment is interactive",
418
+ initializer: _alloy_js_core.code` !isMinimal && process.stdin?.isTTY && env.TERM !== "dumb" && !hasFlag(["no-interactive", "non-interactive", "no-interact"]); `
419
+ })
420
+ ];
421
+ }
422
+ EnvSupportUtilities.__type = [
423
+ "EnvSupportUtilities",
424
+ "Generates utilities for detecting terminal color support.",
425
+ "P\"/!?\""
426
+ ];
427
+ /**
428
+ * Generates utilities for detecting terminal color support.
429
+ */
430
+ function ColorSupportUtilities() {
431
+ return [
432
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
433
+ "export": true,
434
+ name: "GetColorSupportLevelOptions",
435
+ doc: "Options for the getColorSupportLevel function",
436
+ get children() {
437
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
438
+ name: "ignoreFlags",
439
+ type: "boolean",
440
+ doc: "Indicates if the function should skip checking command-line flags for color support"
441
+ });
442
+ }
443
+ }),
444
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
445
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
446
+ heading: "Checks if a specific flag is present in the command-line arguments.",
447
+ get children() {
448
+ return [
449
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocLink, { children: "https://github.com/sindresorhus/has-flag/blob/main/index.js" }),
450
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
451
+ name: "flag",
452
+ children: "The flag to check for, e.g., \"color\", \"no-color\"."
453
+ }),
454
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
455
+ name: "argv",
456
+ children: "The command-line arguments to check against. Defaults to global Deno args or process args."
457
+ }),
458
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: "True if the flag is present, false otherwise." })
459
+ ];
460
+ }
461
+ }),
462
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
463
+ "export": true,
464
+ name: "getColorSupportLevel",
465
+ parameters: [{
466
+ name: "stream",
467
+ type: "NodeJS.WriteStream & { fd: 1 | 2; }"
468
+ }, {
469
+ name: "options",
470
+ type: "GetColorSupportLevelOptions",
471
+ default: "{ ignoreFlags: false }"
472
+ }],
473
+ children: _alloy_js_core.code`const { ignoreFlags } = options;
198
474
 
199
475
  let forceColor: number | undefined;
200
476
  if (env.FORCE_COLOR !== undefined) {
@@ -303,10 +579,34 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
303
579
  has16m: level >= 3,
304
580
  };
305
581
 
306
- `}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.VarDeclaration,{export:!0,const:!0,name:`colorSupportLevels`,doc:`Detect the terminal color support level in the current environment`,initializer:r.code` {
582
+ `
583
+ }),
584
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
585
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
586
+ "export": true,
587
+ "const": true,
588
+ name: "colorSupportLevels",
589
+ doc: "Detect the terminal color support level in the current environment",
590
+ initializer: _alloy_js_core.code` {
307
591
  stdout: getColorSupportLevel(process.stdout),
308
592
  stderr: getColorSupportLevel(process.stderr),
309
- }; `}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.VarDeclaration,{export:!0,const:!0,name:`isColorSupported`,doc:`Detect if terminal color is supported in the current environment`,initializer:r.code` Boolean(colorSupportLevels.stdout); `}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.VarDeclaration,{export:!0,const:!0,name:`isUnicodeSupported`,doc:`Detect if Unicode characters are supported in the current environment`,initializer:r.code` !isWindows
593
+ }; `
594
+ }),
595
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
596
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
597
+ "export": true,
598
+ "const": true,
599
+ name: "isColorSupported",
600
+ doc: "Detect if terminal color is supported in the current environment",
601
+ initializer: _alloy_js_core.code` Boolean(colorSupportLevels.stdout); `
602
+ }),
603
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
604
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
605
+ "export": true,
606
+ "const": true,
607
+ name: "isUnicodeSupported",
608
+ doc: "Detect if Unicode characters are supported in the current environment",
609
+ initializer: _alloy_js_core.code` !isWindows
310
610
  ? env.TERM !== "linux"
311
611
  : Boolean(env.WT_SESSION) ||
312
612
  Boolean(env.TERMINUS_SUBLIME) ||
@@ -317,7 +617,28 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
317
617
  env.TERM === "alacritty" ||
318
618
  env.TERM === "rxvt-unicode" ||
319
619
  env.TERM === "rxvt-unicode-256color" ||
320
- env.TERMINAL_EMULATOR === "JetBrains-JediTerm"; `})]}g.__type=[`ColorSupportUtilities`,`Generates utilities for detecting terminal color support.`,`P"/!?"`];function _(){return[(0,t.createComponent)(o.FunctionDeclaration,{name:`parseVersion`,parameters:[{name:`version`,type:`string`,default:`""`}],children:r.code`if (/^\d{3,4}$/.test(version)) {
620
+ env.TERMINAL_EMULATOR === "JetBrains-JediTerm"; `
621
+ })
622
+ ];
623
+ }
624
+ ColorSupportUtilities.__type = [
625
+ "ColorSupportUtilities",
626
+ "Generates utilities for detecting terminal color support.",
627
+ "P\"/!?\""
628
+ ];
629
+ /**
630
+ * Generates utilities for detecting terminal color support.
631
+ */
632
+ function HyperlinkSupportUtilities() {
633
+ return [
634
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
635
+ name: "parseVersion",
636
+ parameters: [{
637
+ name: "version",
638
+ type: "string",
639
+ default: "\"\""
640
+ }],
641
+ children: _alloy_js_core.code`if (/^\d{3,4}$/.test(version)) {
321
642
  const match = /(\d{1,2})(\d{2})/.exec(version) ?? [];
322
643
 
323
644
  return {
@@ -335,7 +656,20 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
335
656
  major: versionParts[0],
336
657
  minor: versionParts[1],
337
658
  patch: versionParts[2]
338
- }; `}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(c.TSDoc,{heading:`Check if the current environment/terminal supports hyperlinks in the terminal.`,get children(){return(0,t.createComponent)(c.TSDocReturns,{children:`True if the current environment/terminal supports hyperlinks.`})}}),(0,t.createComponent)(o.FunctionDeclaration,{export:!0,name:`isHyperlinkSupported`,returnType:`boolean`,children:r.code`if (Boolean(env.FORCE_HYPERLINK)) {
659
+ }; `
660
+ }),
661
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
662
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
663
+ heading: "Check if the current environment/terminal supports hyperlinks in the terminal.",
664
+ get children() {
665
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: "True if the current environment/terminal supports hyperlinks." });
666
+ }
667
+ }),
668
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
669
+ "export": true,
670
+ name: "isHyperlinkSupported",
671
+ returnType: "boolean",
672
+ children: _alloy_js_core.code`if (Boolean(env.FORCE_HYPERLINK)) {
339
673
  return true;
340
674
  }
341
675
 
@@ -396,7 +730,126 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
396
730
  return true;
397
731
  }
398
732
 
399
- return false; `})]}_.__type=[`HyperlinkSupportUtilities`,`Generates utilities for detecting terminal color support.`,`P"/!?"`];function v(){let e=(a.usePowerlines.Ω=[[`Context`,`"w!`]],(0,a.usePowerlines)());return[(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.InterfaceDeclaration,{name:`ResolveModuleOptions`,doc:"Options for the `resolve` handler function.",get children(){return[(0,t.createComponent)(o.InterfaceMember,{name:`parentURL`,optional:!0,type:`string`,doc:`The parent URL to use for resolving paths.`}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(o.InterfaceMember,{name:`conditions`,optional:!0,type:`string[]`,doc:`The conditions to use for resolving paths.`}),(0,t.createIntrinsic)(`hbr`,{})]}}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.InterfaceDeclaration,{name:`PackageConfig`,doc:`Parsed package.json configuration for module resolution.`,get children(){return[(0,t.createComponent)(o.InterfaceMember,{name:`pjsonPath`,type:`string`,doc:`The path to the package.json file.`}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(o.InterfaceMember,{name:`exists`,type:`boolean`,doc:`Whether the package.json file exists.`}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(o.InterfaceMember,{name:`main`,optional:!0,type:`string`,doc:`The main entry point of the package.`}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(o.InterfaceMember,{name:`name`,optional:!0,type:`string`,doc:`The name of the package.`}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(o.InterfaceMember,{name:`type`,optional:!0,type:`"commonjs" | "module" | "none"`,doc:`The module type of the package.`}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(o.InterfaceMember,{name:`exports`,optional:!0,type:`Record<string, unknown>`,doc:`The exports map of the package.`}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(o.InterfaceMember,{name:`imports`,optional:!0,type:`Record<string, unknown>`,doc:`The imports map of the package.`})]}}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.VarDeclaration,{const:!0,name:`DEFAULT_CONDITIONS_SET`,initializer:r.code`new Set(["node", "import"]);`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.VarDeclaration,{const:!0,name:`DEFAULT_EXTENSIONS`,initializer:r.code`[".mjs", ".cjs", ".js", ".json", ".node"];`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.VarDeclaration,{const:!0,name:`invalidPackageNameRegEx`,initializer:r.code`/^\\.|\\/|%/;`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.FunctionDeclaration,{name:`readPackageConfig`,parameters:[{name:`jsonPath`,type:`string`}],returnType:`PackageConfig`,children:r.code`const result: PackageConfig = {
733
+ return false; `
734
+ })
735
+ ];
736
+ }
737
+ HyperlinkSupportUtilities.__type = [
738
+ "HyperlinkSupportUtilities",
739
+ "Generates utilities for detecting terminal color support.",
740
+ "P\"/!?\""
741
+ ];
742
+ /**
743
+ * Generates the `resolveModule` function declaration, which is a utility for resolving file paths across different platforms.
744
+ */
745
+ function ResolveModuleFunctionDeclaration() {
746
+ const context = (_powerlines_plugin_alloy_core_contexts_context.usePowerlines.Ω = [["Context", "\"w!"]], (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)());
747
+ return [
748
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
749
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
750
+ name: "ResolveModuleOptions",
751
+ doc: "Options for the `resolve` handler function.",
752
+ get children() {
753
+ return [
754
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
755
+ name: "parentURL",
756
+ optional: true,
757
+ type: "string",
758
+ doc: "The parent URL to use for resolving paths."
759
+ }),
760
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
761
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
762
+ name: "conditions",
763
+ optional: true,
764
+ type: "string[]",
765
+ doc: "The conditions to use for resolving paths."
766
+ }),
767
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
768
+ ];
769
+ }
770
+ }),
771
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
772
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
773
+ name: "PackageConfig",
774
+ doc: "Parsed package.json configuration for module resolution.",
775
+ get children() {
776
+ return [
777
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
778
+ name: "pjsonPath",
779
+ type: "string",
780
+ doc: "The path to the package.json file."
781
+ }),
782
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
783
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
784
+ name: "exists",
785
+ type: "boolean",
786
+ doc: "Whether the package.json file exists."
787
+ }),
788
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
789
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
790
+ name: "main",
791
+ optional: true,
792
+ type: "string",
793
+ doc: "The main entry point of the package."
794
+ }),
795
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
796
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
797
+ name: "name",
798
+ optional: true,
799
+ type: "string",
800
+ doc: "The name of the package."
801
+ }),
802
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
803
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
804
+ name: "type",
805
+ optional: true,
806
+ type: `"commonjs" | "module" | "none"`,
807
+ doc: "The module type of the package."
808
+ }),
809
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
810
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
811
+ name: "exports",
812
+ optional: true,
813
+ type: "Record<string, unknown>",
814
+ doc: "The exports map of the package."
815
+ }),
816
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
817
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceMember, {
818
+ name: "imports",
819
+ optional: true,
820
+ type: "Record<string, unknown>",
821
+ doc: "The imports map of the package."
822
+ })
823
+ ];
824
+ }
825
+ }),
826
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
827
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
828
+ "const": true,
829
+ name: "DEFAULT_CONDITIONS_SET",
830
+ initializer: _alloy_js_core.code`new Set(["node", "import"]);`
831
+ }),
832
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
833
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
834
+ "const": true,
835
+ name: "DEFAULT_EXTENSIONS",
836
+ initializer: _alloy_js_core.code`[".mjs", ".cjs", ".js", ".json", ".node"];`
837
+ }),
838
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
839
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
840
+ "const": true,
841
+ name: "invalidPackageNameRegEx",
842
+ initializer: _alloy_js_core.code`/^\\.|\\/|%/;`
843
+ }),
844
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
845
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
846
+ name: "readPackageConfig",
847
+ parameters: [{
848
+ name: "jsonPath",
849
+ type: "string"
850
+ }],
851
+ returnType: "PackageConfig",
852
+ children: _alloy_js_core.code`const result: PackageConfig = {
400
853
  pjsonPath: jsonPath,
401
854
  exists: false,
402
855
  main: undefined,
@@ -441,7 +894,17 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
441
894
  result.type = parsed.type;
442
895
  }
443
896
 
444
- return result;`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.FunctionDeclaration,{name:`getPackageScopeConfig`,parameters:[{name:`resolved`,type:`URL | string`}],returnType:`PackageConfig`,children:r.code`let packageJSONUrl = new URL("package.json", resolved);
897
+ return result;`
898
+ }),
899
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
900
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
901
+ name: "getPackageScopeConfig",
902
+ parameters: [{
903
+ name: "resolved",
904
+ type: "URL | string"
905
+ }],
906
+ returnType: "PackageConfig",
907
+ children: _alloy_js_core.code`let packageJSONUrl = new URL("package.json", resolved);
445
908
 
446
909
  while (true) {
447
910
  const packageJSONPath = packageJSONUrl.pathname;
@@ -466,7 +929,17 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
466
929
  pjsonPath: fileURLToPath(packageJSONUrl),
467
930
  exists: false,
468
931
  type: "none"
469
- };`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.FunctionDeclaration,{name:`isConditionalExportsMainSugar`,parameters:[{name:`exports`,type:`unknown`}],returnType:`boolean`,children:r.code`if (typeof exports === "string" || Array.isArray(exports)) {
932
+ };`
933
+ }),
934
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
935
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
936
+ name: "isConditionalExportsMainSugar",
937
+ parameters: [{
938
+ name: "exports",
939
+ type: "unknown"
940
+ }],
941
+ returnType: "boolean",
942
+ children: _alloy_js_core.code`if (typeof exports === "string" || Array.isArray(exports)) {
470
943
  return true;
471
944
  }
472
945
  if (typeof exports !== "object" || exports === null) {
@@ -488,7 +961,47 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
488
961
  }
489
962
  }
490
963
 
491
- return isConditionalSugar;`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.FunctionDeclaration,{name:`resolvePackageTarget`,parameters:[{name:`packageJsonUrl`,type:`URL`},{name:`target`,type:`unknown`},{name:`subpath`,type:`string`},{name:`packageSubpath`,type:`string`},{name:`base`,type:`URL`},{name:`pattern`,type:`boolean`},{name:`internal`,type:`boolean`},{name:`conditions`,type:`Set<string>`}],returnType:`URL | null | undefined`,children:r.code`if (typeof target === "string") {
964
+ return isConditionalSugar;`
965
+ }),
966
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
967
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
968
+ name: "resolvePackageTarget",
969
+ parameters: [
970
+ {
971
+ name: "packageJsonUrl",
972
+ type: "URL"
973
+ },
974
+ {
975
+ name: "target",
976
+ type: "unknown"
977
+ },
978
+ {
979
+ name: "subpath",
980
+ type: "string"
981
+ },
982
+ {
983
+ name: "packageSubpath",
984
+ type: "string"
985
+ },
986
+ {
987
+ name: "base",
988
+ type: "URL"
989
+ },
990
+ {
991
+ name: "pattern",
992
+ type: "boolean"
993
+ },
994
+ {
995
+ name: "internal",
996
+ type: "boolean"
997
+ },
998
+ {
999
+ name: "conditions",
1000
+ type: "Set<string>"
1001
+ }
1002
+ ],
1003
+ returnType: "URL | null | undefined",
1004
+ children: _alloy_js_core.code`if (typeof target === "string") {
492
1005
  if (!target.startsWith("./")) {
493
1006
  if (internal && !target.startsWith("../") && !target.startsWith("/")) {
494
1007
  let isURL = false;
@@ -585,7 +1098,35 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
585
1098
  return null;
586
1099
  }
587
1100
 
588
- return null;`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.FunctionDeclaration,{name:`packageExportsResolve`,parameters:[{name:`packageJsonUrl`,type:`URL`},{name:`packageSubpath`,type:`string`},{name:`packageConfig`,type:`PackageConfig`},{name:`base`,type:`URL`},{name:`conditions`,type:`Set<string>`}],returnType:`URL | null | undefined`,children:r.code`let exports = packageConfig.exports;
1101
+ return null;`
1102
+ }),
1103
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1104
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
1105
+ name: "packageExportsResolve",
1106
+ parameters: [
1107
+ {
1108
+ name: "packageJsonUrl",
1109
+ type: "URL"
1110
+ },
1111
+ {
1112
+ name: "packageSubpath",
1113
+ type: "string"
1114
+ },
1115
+ {
1116
+ name: "packageConfig",
1117
+ type: "PackageConfig"
1118
+ },
1119
+ {
1120
+ name: "base",
1121
+ type: "URL"
1122
+ },
1123
+ {
1124
+ name: "conditions",
1125
+ type: "Set<string>"
1126
+ }
1127
+ ],
1128
+ returnType: "URL | null | undefined",
1129
+ children: _alloy_js_core.code`let exports = packageConfig.exports;
589
1130
  if (isConditionalExportsMainSugar(exports)) {
590
1131
  exports = { ".": exports } as Record<string, unknown>;
591
1132
  }
@@ -659,7 +1200,20 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
659
1200
  \`Package subpath '\${packageSubpath}' is not defined by "exports" in \${fileURLToPath(packageJsonUrl)}\`
660
1201
  );
661
1202
  (err as any).code = "ERR_PACKAGE_PATH_NOT_EXPORTED";
662
- throw err;`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.FunctionDeclaration,{name:`patternKeyCompare`,parameters:[{name:`a`,type:`string`},{name:`b`,type:`string`}],returnType:`number`,children:r.code`const aPatternIndex = a.indexOf("*");
1203
+ throw err;`
1204
+ }),
1205
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1206
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
1207
+ name: "patternKeyCompare",
1208
+ parameters: [{
1209
+ name: "a",
1210
+ type: "string"
1211
+ }, {
1212
+ name: "b",
1213
+ type: "string"
1214
+ }],
1215
+ returnType: "number",
1216
+ children: _alloy_js_core.code`const aPatternIndex = a.indexOf("*");
663
1217
  const bPatternIndex = b.indexOf("*");
664
1218
  const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1;
665
1219
  const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1;
@@ -669,7 +1223,20 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
669
1223
  if (bPatternIndex === -1) return -1;
670
1224
  if (a.length > b.length) return -1;
671
1225
  if (b.length > a.length) return 1;
672
- return 0;`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.FunctionDeclaration,{name:`legacyMainResolve`,parameters:[{name:`packageJsonUrl`,type:`URL`},{name:`packageConfig`,type:`PackageConfig`}],returnType:`URL | undefined`,children:r.code`let guess: URL | undefined;
1226
+ return 0;`
1227
+ }),
1228
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1229
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
1230
+ name: "legacyMainResolve",
1231
+ parameters: [{
1232
+ name: "packageJsonUrl",
1233
+ type: "URL"
1234
+ }, {
1235
+ name: "packageConfig",
1236
+ type: "PackageConfig"
1237
+ }],
1238
+ returnType: "URL | undefined",
1239
+ children: _alloy_js_core.code`let guess: URL | undefined;
673
1240
  const tries: string[] = [];
674
1241
 
675
1242
  if (packageConfig.main !== undefined) {
@@ -697,7 +1264,20 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
697
1264
  guess = undefined;
698
1265
  }
699
1266
 
700
- return undefined;`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.FunctionDeclaration,{name:`parsePackageName`,parameters:[{name:`specifier`,type:`string`},{name:`base`,type:`URL`}],returnType:`{ packageName: string; packageSubpath: string; isScoped: boolean }`,children:r.code`let separatorIndex = specifier.indexOf("/");
1267
+ return undefined;`
1268
+ }),
1269
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1270
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
1271
+ name: "parsePackageName",
1272
+ parameters: [{
1273
+ name: "specifier",
1274
+ type: "string"
1275
+ }, {
1276
+ name: "base",
1277
+ type: "URL"
1278
+ }],
1279
+ returnType: "{ packageName: string; packageSubpath: string; isScoped: boolean }",
1280
+ children: _alloy_js_core.code`let separatorIndex = specifier.indexOf("/");
701
1281
  let validPackageName = true;
702
1282
  let isScoped = false;
703
1283
 
@@ -730,7 +1310,27 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
730
1310
  ? ""
731
1311
  : specifier.slice(separatorIndex));
732
1312
 
733
- return { packageName, packageSubpath, isScoped };`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.FunctionDeclaration,{name:`packageResolve`,parameters:[{name:`specifier`,type:`string`},{name:`base`,type:`URL`},{name:`conditions`,type:`Set<string>`}],returnType:`URL`,children:r.code`if (builtinModules.includes(specifier)) {
1313
+ return { packageName, packageSubpath, isScoped };`
1314
+ }),
1315
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1316
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
1317
+ name: "packageResolve",
1318
+ parameters: [
1319
+ {
1320
+ name: "specifier",
1321
+ type: "string"
1322
+ },
1323
+ {
1324
+ name: "base",
1325
+ type: "URL"
1326
+ },
1327
+ {
1328
+ name: "conditions",
1329
+ type: "Set<string>"
1330
+ }
1331
+ ],
1332
+ returnType: "URL",
1333
+ children: _alloy_js_core.code`if (builtinModules.includes(specifier)) {
734
1334
  return new URL("node:" + specifier);
735
1335
  }
736
1336
 
@@ -804,7 +1404,20 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
804
1404
  const err = new Error(\`Cannot find package \\\`\${packageName}\\\`\`);
805
1405
  (err as any).code = "ERR_MODULE_NOT_FOUND";
806
1406
 
807
- throw err;`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.FunctionDeclaration,{name:`finalizeResolution`,parameters:[{name:`resolved`,type:`URL`},{name:`base`,type:`URL`}],returnType:`URL`,children:r.code`if (/%2f|%5c/i.test(resolved.pathname)) {
1407
+ throw err;`
1408
+ }),
1409
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1410
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
1411
+ name: "finalizeResolution",
1412
+ parameters: [{
1413
+ name: "resolved",
1414
+ type: "URL"
1415
+ }, {
1416
+ name: "base",
1417
+ type: "URL"
1418
+ }],
1419
+ returnType: "URL",
1420
+ children: _alloy_js_core.code`if (/%2f|%5c/i.test(resolved.pathname)) {
808
1421
  const err = new Error(
809
1422
  \`Invalid module \\\`\${resolved.pathname}\\\` must not include encoded "/" or "\\\\" characters imported from \${fileURLToPath(base)}\`
810
1423
  );
@@ -842,7 +1455,27 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
842
1455
  realUrl.search = search;
843
1456
  realUrl.hash = hash;
844
1457
 
845
- return realUrl;`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.FunctionDeclaration,{name:`moduleResolve`,parameters:[{name:`specifier`,type:`string`},{name:`base`,type:`URL`},{name:`conditions`,type:`Set<string>`}],returnType:`URL`,children:r.code`let resolved: URL | undefined;
1458
+ return realUrl;`
1459
+ }),
1460
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1461
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
1462
+ name: "moduleResolve",
1463
+ parameters: [
1464
+ {
1465
+ name: "specifier",
1466
+ type: "string"
1467
+ },
1468
+ {
1469
+ name: "base",
1470
+ type: "URL"
1471
+ },
1472
+ {
1473
+ name: "conditions",
1474
+ type: "Set<string>"
1475
+ }
1476
+ ],
1477
+ returnType: "URL",
1478
+ children: _alloy_js_core.code`let resolved: URL | undefined;
846
1479
 
847
1480
  if (
848
1481
  specifier[0] === "/" ||
@@ -931,7 +1564,27 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
931
1564
  return resolved;
932
1565
  }
933
1566
 
934
- return finalizeResolution(resolved, base);`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(o.FunctionDeclaration,{name:`tryModuleResolve`,parameters:[{name:`id`,type:`string`},{name:`url`,type:`URL`},{name:`conditions`,type:`Set<string>`}],returnType:`URL | undefined`,children:r.code`try {
1567
+ return finalizeResolution(resolved, base);`
1568
+ }),
1569
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1570
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
1571
+ name: "tryModuleResolve",
1572
+ parameters: [
1573
+ {
1574
+ name: "id",
1575
+ type: "string"
1576
+ },
1577
+ {
1578
+ name: "url",
1579
+ type: "URL"
1580
+ },
1581
+ {
1582
+ name: "conditions",
1583
+ type: "Set<string>"
1584
+ }
1585
+ ],
1586
+ returnType: "URL | undefined",
1587
+ children: _alloy_js_core.code`try {
935
1588
  return moduleResolve(id, url, conditions);
936
1589
  } catch (error: any) {
937
1590
  if (
@@ -945,13 +1598,46 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
945
1598
  ) {
946
1599
  throw error;
947
1600
  }
948
- }`}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(c.TSDoc,{heading:`A function to resolve module specifiers to URLs.`,get children(){return[(0,t.createComponent)(c.TSDocParam,{name:`specifier`,children:`The module specifier to resolve.`}),(0,t.createComponent)(c.TSDocParam,{name:`options`,children:`The options for resolving the module. Defaults to an empty object.`}),(0,t.createComponent)(c.TSDocReturns,{children:`The result of the resolve operation.`})]}}),(0,t.createComponent)(o.FunctionDeclaration,{async:!0,export:!0,name:`resolveModule`,parameters:[{name:`specifier`,type:`string`},{name:`options`,type:`ResolveModuleOptions`,default:`{} as ResolveModuleOptions`}],returnType:`Promise<string>`,get children(){return r.code`const parentURL = options.parentURL ? new URL(options.parentURL) : undefined;
1601
+ }`
1602
+ }),
1603
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1604
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
1605
+ heading: "A function to resolve module specifiers to URLs.",
1606
+ get children() {
1607
+ return [
1608
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
1609
+ name: "specifier",
1610
+ children: `The module specifier to resolve.`
1611
+ }),
1612
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
1613
+ name: "options",
1614
+ children: `The options for resolving the module. Defaults to an empty object.`
1615
+ }),
1616
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: `The result of the resolve operation.` })
1617
+ ];
1618
+ }
1619
+ }),
1620
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
1621
+ async: true,
1622
+ "export": true,
1623
+ name: "resolveModule",
1624
+ parameters: [{
1625
+ name: "specifier",
1626
+ type: "string"
1627
+ }, {
1628
+ name: "options",
1629
+ type: "ResolveModuleOptions",
1630
+ default: "{} as ResolveModuleOptions"
1631
+ }],
1632
+ returnType: "Promise<string>",
1633
+ get children() {
1634
+ return _alloy_js_core.code`const parentURL = options.parentURL ? new URL(options.parentURL) : undefined;
949
1635
  const conditionsSet = options.conditions?.length
950
1636
  ? new Set(options.conditions)
951
1637
  : DEFAULT_CONDITIONS_SET;
952
1638
 
953
- // Handle protocol-prefixed specifiers (node:, data:, http:, https:, ${e.config.framework}:)
954
- if (/^(?:node|data|https?|${e.config.framework}):/.test(specifier)) {
1639
+ // Handle protocol-prefixed specifiers (node:, data:, http:, https:, ${context.config.framework?.name || "shell-shock"}:)
1640
+ if (/^(?:node|data|https?|${context.config.framework?.name || "shell-shock"}):/.test(specifier)) {
955
1641
  return specifier;
956
1642
  }
957
1643
 
@@ -979,12 +1665,12 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
979
1665
 
980
1666
  const roots = [parentURL ?? pathToFileURL(join(process.cwd(), "_"))];
981
1667
 
982
- const projectRootURL = pathToFileURL("${e.config.root}");
1668
+ const projectRootURL = pathToFileURL("${context.config.root}");
983
1669
  if (!roots.some(root => root.href === projectRootURL.href)) {
984
1670
  roots.push(projectRootURL);
985
1671
  }
986
1672
 
987
- const workspaceRootURL = pathToFileURL("${e.config.cwd}");
1673
+ const workspaceRootURL = pathToFileURL("${context.config.cwd}");
988
1674
  if (!roots.some(root => root.href === workspaceRootURL.href)) {
989
1675
  roots.push(workspaceRootURL);
990
1676
  }
@@ -1042,4 +1728,124 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
1042
1728
  }
1043
1729
 
1044
1730
  return pathToFileURL(fileURLToPath(resolved)).href;
1045
- `}})]}v.__type=[`ResolveModuleFunctionDeclaration`,"Generates the `resolveModule` function declaration, which is a utility for resolving file paths across different platforms.",`P"/!?"`];function y(e){let[{children:a},l]=(0,r.splitProps)(e,[`children`]);return(0,t.createComponent)(s.BuiltinFile,(0,t.mergeProps)({id:`utils`,description:`A collection of helper utilities that ease command-line application development.`},l,{get imports(){return(0,n.default)(l.imports??{},{"node:os":`os`,"node:process":`process`,"node:path":[`join`,`sep`,`isAbsolute`],"node:fs":[{name:`constants`,alias:`fsConstants`},`openSync`,`closeSync`,`read`,`readFileSync`,`statSync`,`realpathSync`],"node:tty":[`WriteStream`],"node:url":[`fileURLToPath`,`pathToFileURL`],"node:module":[`builtinModules`]})},get builtinImports(){return(0,n.default)(l.builtinImports??{},{env:[`env`,`isCI`,`isTest`,`isWindows`,`isLinux`,`isMacOS`],exec:[`execSync`],state:[`hasFlag`]})},get children(){return[(0,t.createComponent)(c.TSDoc,{heading:`A utility function to pause execution for a specified duration, which can be used in prompt interactions to create delays or timeouts. The function returns a promise that resolves after the specified duration in milliseconds, allowing it to be used with async/await syntax for easier handling of asynchronous prompt logic.`,get children(){return[(0,t.createComponent)(c.TSDocParam,{name:`durationMs`,children:`The duration to sleep in milliseconds.`}),(0,t.createComponent)(c.TSDocReturns,{children:`A promise that resolves after the specified duration, allowing for asynchronous delays in prompt interactions.`})]}}),(0,t.createComponent)(o.FunctionDeclaration,{export:!0,name:`sleep`,parameters:[{name:`durationMs`,type:`number`}],returnType:`Promise<void>`,children:r.code`return new Promise((resolve) => setTimeout(resolve, durationMs)); `}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(m,{}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(h,{}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(_,{}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(g,{}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(v,{}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(p,{}),(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(r.Show,{get when(){return!!a},children:a})]}}))}y.__type=[()=>f,`props`,`UtilsBuiltin`,`A built-in utilities module for Shell Shock.`,`Pn!2""/#?$`],exports.ColorSupportUtilities=g,exports.EnvSupportUtilities=h,exports.FindSuggestionsDeclaration=p,exports.HyperlinkSupportUtilities=_,exports.ResolveModuleFunctionDeclaration=v,exports.TerminalSizeDeclaration=m,exports.UtilsBuiltin=y,exports.__ΩUtilsBuiltinProps=f;
1731
+ `;
1732
+ }
1733
+ })
1734
+ ];
1735
+ }
1736
+ ResolveModuleFunctionDeclaration.__type = [
1737
+ "ResolveModuleFunctionDeclaration",
1738
+ "Generates the `resolveModule` function declaration, which is a utility for resolving file paths across different platforms.",
1739
+ "P\"/!?\""
1740
+ ];
1741
+ /**
1742
+ * A built-in utilities module for Shell Shock.
1743
+ */
1744
+ function UtilsBuiltin(props) {
1745
+ const [{ children }, rest] = (0, _alloy_js_core.splitProps)(props, ["children"]);
1746
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_builtin_file.BuiltinFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({
1747
+ id: "utils",
1748
+ description: "A collection of helper utilities that ease command-line application development."
1749
+ }, rest, {
1750
+ get imports() {
1751
+ return (0, defu.default)(rest.imports ?? {}, {
1752
+ "node:os": "os",
1753
+ "node:process": "process",
1754
+ "node:path": [
1755
+ "join",
1756
+ "sep",
1757
+ "isAbsolute"
1758
+ ],
1759
+ "node:fs": [
1760
+ {
1761
+ name: "constants",
1762
+ alias: "fsConstants"
1763
+ },
1764
+ "openSync",
1765
+ "closeSync",
1766
+ "read",
1767
+ "readFileSync",
1768
+ "statSync",
1769
+ "realpathSync"
1770
+ ],
1771
+ "node:tty": ["WriteStream"],
1772
+ "node:url": ["fileURLToPath", "pathToFileURL"],
1773
+ "node:module": ["builtinModules"]
1774
+ });
1775
+ },
1776
+ get builtinImports() {
1777
+ return (0, defu.default)(rest.builtinImports ?? {}, {
1778
+ env: [
1779
+ "env",
1780
+ "isCI",
1781
+ "isTest",
1782
+ "isWindows",
1783
+ "isLinux",
1784
+ "isMacOS"
1785
+ ],
1786
+ exec: ["execSync"],
1787
+ state: ["hasFlag"]
1788
+ });
1789
+ },
1790
+ get children() {
1791
+ return [
1792
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
1793
+ heading: "A utility function to pause execution for a specified duration, which can be used in prompt interactions to create delays or timeouts. The function returns a promise that resolves after the specified duration in milliseconds, allowing it to be used with async/await syntax for easier handling of asynchronous prompt logic.",
1794
+ get children() {
1795
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
1796
+ name: "durationMs",
1797
+ children: `The duration to sleep in milliseconds.`
1798
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: `A promise that resolves after the specified duration, allowing for asynchronous delays in prompt interactions.` })];
1799
+ }
1800
+ }),
1801
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
1802
+ "export": true,
1803
+ name: "sleep",
1804
+ parameters: [{
1805
+ name: "durationMs",
1806
+ type: "number"
1807
+ }],
1808
+ returnType: "Promise<void>",
1809
+ children: _alloy_js_core.code`return new Promise((resolve) => setTimeout(resolve, durationMs)); `
1810
+ }),
1811
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1812
+ (0, _alloy_js_core_jsx_runtime.createComponent)(TerminalSizeDeclaration, {}),
1813
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1814
+ (0, _alloy_js_core_jsx_runtime.createComponent)(EnvSupportUtilities, {}),
1815
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1816
+ (0, _alloy_js_core_jsx_runtime.createComponent)(HyperlinkSupportUtilities, {}),
1817
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1818
+ (0, _alloy_js_core_jsx_runtime.createComponent)(ColorSupportUtilities, {}),
1819
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1820
+ (0, _alloy_js_core_jsx_runtime.createComponent)(ResolveModuleFunctionDeclaration, {}),
1821
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1822
+ (0, _alloy_js_core_jsx_runtime.createComponent)(FindSuggestionsDeclaration, {}),
1823
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
1824
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
1825
+ get when() {
1826
+ return Boolean(children);
1827
+ },
1828
+ children
1829
+ })
1830
+ ];
1831
+ }
1832
+ }));
1833
+ }
1834
+ UtilsBuiltin.__type = [
1835
+ () => __ΩUtilsBuiltinProps,
1836
+ "props",
1837
+ "UtilsBuiltin",
1838
+ "A built-in utilities module for Shell Shock.",
1839
+ "Pn!2\"\"/#?$"
1840
+ ];
1841
+
1842
+ //#endregion
1843
+ exports.ColorSupportUtilities = ColorSupportUtilities;
1844
+ exports.EnvSupportUtilities = EnvSupportUtilities;
1845
+ exports.FindSuggestionsDeclaration = FindSuggestionsDeclaration;
1846
+ exports.HyperlinkSupportUtilities = HyperlinkSupportUtilities;
1847
+ exports.ResolveModuleFunctionDeclaration = ResolveModuleFunctionDeclaration;
1848
+ exports.TerminalSizeDeclaration = TerminalSizeDeclaration;
1849
+ exports.UtilsBuiltin = UtilsBuiltin;
1850
+ exports.__ΩUtilsBuiltinProps = __ΩUtilsBuiltinProps;
1851
+ //# sourceMappingURL=utils-builtin.cjs.map