@socketsecurity/lib 5.18.2 → 5.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (305) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +6 -5
  3. package/dist/abort.d.ts +3 -0
  4. package/dist/abort.js +1 -0
  5. package/dist/agent.d.ts +66 -49
  6. package/dist/agent.js +51 -50
  7. package/dist/ansi.d.ts +2 -5
  8. package/dist/ansi.js +3 -2
  9. package/dist/archives.d.ts +25 -21
  10. package/dist/archives.js +35 -34
  11. package/dist/argv/flags.d.ts +100 -91
  12. package/dist/argv/flags.js +88 -87
  13. package/dist/argv/parse.d.ts +30 -40
  14. package/dist/argv/parse.js +33 -32
  15. package/dist/arrays.d.ts +4 -8
  16. package/dist/arrays.js +1 -0
  17. package/dist/bin.d.ts +7 -5
  18. package/dist/bin.js +52 -29
  19. package/dist/cacache.d.ts +13 -12
  20. package/dist/cacache.js +9 -8
  21. package/dist/cache-with-ttl.d.ts +53 -35
  22. package/dist/cache-with-ttl.js +1 -0
  23. package/dist/colors.d.ts +5 -5
  24. package/dist/colors.js +1 -0
  25. package/dist/constants/agents.d.ts +5 -9
  26. package/dist/constants/agents.js +3 -2
  27. package/dist/constants/core.d.ts +5 -10
  28. package/dist/constants/core.js +2 -1
  29. package/dist/constants/encoding.d.ts +3 -3
  30. package/dist/constants/encoding.js +1 -0
  31. package/dist/constants/github.d.ts +3 -3
  32. package/dist/constants/github.js +1 -0
  33. package/dist/constants/licenses.d.ts +9 -2
  34. package/dist/constants/licenses.js +1 -0
  35. package/dist/constants/lifecycle-script-names.js +1 -0
  36. package/dist/constants/maintained-node-versions.d.ts +3 -0
  37. package/dist/constants/maintained-node-versions.js +1 -0
  38. package/dist/constants/node.d.ts +125 -16
  39. package/dist/constants/node.js +74 -73
  40. package/dist/constants/package-default-node-range.d.ts +3 -1
  41. package/dist/constants/package-default-node-range.js +2 -1
  42. package/dist/constants/package-default-socket-categories.d.ts +0 -1
  43. package/dist/constants/package-default-socket-categories.js +1 -0
  44. package/dist/constants/packages.d.ts +12 -17
  45. package/dist/constants/packages.js +31 -16
  46. package/dist/constants/platform.d.ts +1 -2
  47. package/dist/constants/platform.js +2 -1
  48. package/dist/constants/process.d.ts +18 -0
  49. package/dist/constants/process.js +1 -0
  50. package/dist/constants/socket.d.ts +4 -10
  51. package/dist/constants/socket.js +2 -1
  52. package/dist/constants/testing.d.ts +3 -3
  53. package/dist/constants/testing.js +1 -0
  54. package/dist/constants/time.d.ts +3 -4
  55. package/dist/constants/time.js +1 -0
  56. package/dist/constants/typescript.d.ts +10 -3
  57. package/dist/constants/typescript.js +5 -4
  58. package/dist/cover/code.d.ts +3 -0
  59. package/dist/cover/code.js +12 -12
  60. package/dist/cover/formatters.d.ts +12 -9
  61. package/dist/cover/formatters.js +19 -18
  62. package/dist/cover/type.d.ts +3 -0
  63. package/dist/cover/type.js +1 -0
  64. package/dist/cover/types.js +1 -0
  65. package/dist/debug.d.ts +32 -47
  66. package/dist/debug.js +97 -96
  67. package/dist/dlx/arborist.d.ts +134 -0
  68. package/dist/dlx/arborist.js +177 -0
  69. package/dist/dlx/binary.d.ts +25 -9
  70. package/dist/dlx/binary.js +34 -12
  71. package/dist/dlx/cache.d.ts +1 -0
  72. package/dist/dlx/cache.js +2 -1
  73. package/dist/dlx/detect.d.ts +15 -0
  74. package/dist/dlx/detect.js +28 -20
  75. package/dist/dlx/dir.d.ts +1 -11
  76. package/dist/dlx/dir.js +2 -12
  77. package/dist/dlx/integrity.d.ts +86 -0
  78. package/dist/dlx/integrity.js +112 -0
  79. package/dist/dlx/lockfile.d.ts +115 -0
  80. package/dist/dlx/lockfile.js +139 -0
  81. package/dist/dlx/manifest.d.ts +26 -1
  82. package/dist/dlx/manifest.js +9 -6
  83. package/dist/dlx/package.d.ts +58 -3
  84. package/dist/dlx/package.js +101 -74
  85. package/dist/dlx/packages.d.ts +1 -11
  86. package/dist/dlx/packages.js +3 -14
  87. package/dist/dlx/paths.d.ts +1 -0
  88. package/dist/dlx/paths.js +2 -1
  89. package/dist/effects/pulse-frames.js +1 -0
  90. package/dist/effects/text-shimmer.d.ts +13 -2
  91. package/dist/effects/text-shimmer.js +50 -46
  92. package/dist/effects/types.js +1 -0
  93. package/dist/effects/ultra.js +1 -0
  94. package/dist/env/ci.d.ts +6 -1
  95. package/dist/env/ci.js +1 -0
  96. package/dist/env/debug.d.ts +5 -1
  97. package/dist/env/debug.js +1 -0
  98. package/dist/env/github.d.ts +19 -23
  99. package/dist/env/github.js +5 -4
  100. package/dist/env/helpers.d.ts +21 -9
  101. package/dist/env/helpers.js +5 -11
  102. package/dist/env/home.d.ts +17 -4
  103. package/dist/env/home.js +2 -1
  104. package/dist/env/locale.d.ts +4 -3
  105. package/dist/env/locale.js +1 -0
  106. package/dist/env/node-auth-token.d.ts +5 -1
  107. package/dist/env/node-auth-token.js +1 -0
  108. package/dist/env/node-env.d.ts +5 -1
  109. package/dist/env/node-env.js +1 -0
  110. package/dist/env/npm.d.ts +4 -5
  111. package/dist/env/npm.js +1 -0
  112. package/dist/env/package-manager.d.ts +4 -3
  113. package/dist/env/package-manager.js +2 -1
  114. package/dist/env/path.d.ts +5 -1
  115. package/dist/env/path.js +1 -0
  116. package/dist/env/pre-commit.d.ts +5 -1
  117. package/dist/env/pre-commit.js +1 -0
  118. package/dist/env/rewire.d.ts +10 -0
  119. package/dist/env/rewire.js +7 -5
  120. package/dist/env/shell.d.ts +5 -1
  121. package/dist/env/shell.js +1 -0
  122. package/dist/env/socket-cli-shadow.d.ts +4 -5
  123. package/dist/env/socket-cli-shadow.js +1 -0
  124. package/dist/env/socket-cli.d.ts +4 -14
  125. package/dist/env/socket-cli.js +1 -0
  126. package/dist/env/socket.d.ts +6 -18
  127. package/dist/env/socket.js +4 -3
  128. package/dist/env/temp-dir.d.ts +4 -3
  129. package/dist/env/temp-dir.js +1 -0
  130. package/dist/env/term.d.ts +5 -1
  131. package/dist/env/term.js +1 -0
  132. package/dist/env/test.d.ts +4 -3
  133. package/dist/env/test.js +1 -0
  134. package/dist/env/windows.d.ts +4 -4
  135. package/dist/env/windows.js +1 -0
  136. package/dist/env/xdg.d.ts +4 -3
  137. package/dist/env/xdg.js +1 -0
  138. package/dist/env.d.ts +83 -23
  139. package/dist/env.js +112 -80
  140. package/dist/errors.js +1 -0
  141. package/dist/external/@npmcli/package-json.js +9 -3968
  142. package/dist/external/@socketregistry/packageurl-js.js +2 -2
  143. package/dist/external/debug.js +162 -328
  144. package/dist/external/external-pack.js +3 -2835
  145. package/dist/external/npm-pack.js +13939 -33342
  146. package/dist/external/zod.js +160 -7558
  147. package/dist/fs.d.ts +92 -113
  148. package/dist/fs.js +35 -35
  149. package/dist/git.d.ts +170 -164
  150. package/dist/git.js +113 -87
  151. package/dist/github.d.ts +249 -227
  152. package/dist/github.js +82 -81
  153. package/dist/globs.d.ts +31 -17
  154. package/dist/globs.js +51 -58
  155. package/dist/http-request.d.ts +99 -99
  156. package/dist/http-request.js +182 -156
  157. package/dist/ipc-cli.d.ts +28 -0
  158. package/dist/{utils/get-ipc.js → ipc-cli.js} +4 -3
  159. package/dist/ipc.d.ts +9 -299
  160. package/dist/ipc.js +18 -204
  161. package/dist/json/edit.d.ts +3 -1
  162. package/dist/json/edit.js +30 -30
  163. package/dist/json/format.d.ts +36 -36
  164. package/dist/json/format.js +22 -21
  165. package/dist/json/parse.d.ts +4 -2
  166. package/dist/json/parse.js +1 -0
  167. package/dist/json/types.js +1 -0
  168. package/dist/{links/index.d.ts → links.d.ts} +6 -2
  169. package/dist/{links/index.js → links.js} +5 -4
  170. package/dist/logger.d.ts +4 -6
  171. package/dist/logger.js +61 -53
  172. package/dist/memoization.d.ts +52 -49
  173. package/dist/memoization.js +55 -33
  174. package/dist/objects.d.ts +25 -44
  175. package/dist/objects.js +2 -1
  176. package/dist/package-extensions.d.ts +6 -0
  177. package/dist/package-extensions.js +2 -1
  178. package/dist/packages/edit.d.ts +3 -5
  179. package/dist/packages/edit.js +4 -3
  180. package/dist/packages/exports.d.ts +11 -14
  181. package/dist/packages/exports.js +11 -10
  182. package/dist/packages/isolation.d.ts +4 -0
  183. package/dist/packages/isolation.js +20 -19
  184. package/dist/packages/licenses.d.ts +3 -10
  185. package/dist/packages/licenses.js +2 -1
  186. package/dist/packages/manifest.d.ts +3 -3
  187. package/dist/packages/manifest.js +1 -0
  188. package/dist/packages/normalize.d.ts +3 -4
  189. package/dist/packages/normalize.js +1 -0
  190. package/dist/packages/operations.d.ts +3 -10
  191. package/dist/packages/operations.js +1 -0
  192. package/dist/packages/provenance.d.ts +10 -8
  193. package/dist/packages/provenance.js +55 -54
  194. package/dist/packages/specs.d.ts +3 -5
  195. package/dist/packages/specs.js +1 -0
  196. package/dist/packages/validation.d.ts +3 -3
  197. package/dist/packages/validation.js +1 -0
  198. package/dist/packages.d.ts +2 -17
  199. package/dist/packages.js +2 -1
  200. package/dist/paths/dirnames.d.ts +0 -2
  201. package/dist/paths/dirnames.js +1 -0
  202. package/dist/paths/exts.d.ts +0 -1
  203. package/dist/paths/exts.js +1 -0
  204. package/dist/paths/filenames.d.ts +0 -1
  205. package/dist/paths/filenames.js +1 -0
  206. package/dist/paths/globs.d.ts +0 -1
  207. package/dist/paths/globs.js +1 -0
  208. package/dist/paths/normalize.d.ts +115 -123
  209. package/dist/paths/normalize.js +128 -127
  210. package/dist/paths/packages.d.ts +3 -2
  211. package/dist/paths/packages.js +2 -1
  212. package/dist/paths/rewire.d.ts +9 -0
  213. package/dist/paths/rewire.js +5 -3
  214. package/dist/paths/socket.d.ts +37 -23
  215. package/dist/paths/socket.js +26 -25
  216. package/dist/performance.d.ts +87 -84
  217. package/dist/performance.js +97 -96
  218. package/dist/process-lock.d.ts +41 -1
  219. package/dist/process-lock.js +24 -17
  220. package/dist/promise-queue.d.ts +6 -0
  221. package/dist/promise-queue.js +1 -0
  222. package/dist/promises.d.ts +40 -55
  223. package/dist/promises.js +12 -11
  224. package/dist/regexps.d.ts +0 -5
  225. package/dist/regexps.js +1 -0
  226. package/dist/releases/github.d.ts +59 -63
  227. package/dist/releases/github.js +95 -100
  228. package/dist/releases/socket-btm.d.ts +9 -2
  229. package/dist/releases/socket-btm.js +32 -25
  230. package/dist/sea.d.ts +5 -0
  231. package/dist/sea.js +1 -0
  232. package/dist/shadow.d.ts +4 -0
  233. package/dist/shadow.js +1 -0
  234. package/dist/signal-exit.d.ts +7 -7
  235. package/dist/signal-exit.js +46 -45
  236. package/dist/sorts.d.ts +5 -7
  237. package/dist/sorts.js +11 -10
  238. package/dist/spawn.d.ts +96 -77
  239. package/dist/spawn.js +39 -38
  240. package/dist/spinner.d.ts +21 -22
  241. package/dist/spinner.js +15 -11
  242. package/dist/ssri.d.ts +31 -36
  243. package/dist/ssri.js +15 -14
  244. package/dist/stdio/_stream.d.ts +31 -0
  245. package/dist/stdio/_stream.js +57 -0
  246. package/dist/stdio/divider.d.ts +40 -36
  247. package/dist/stdio/divider.js +10 -9
  248. package/dist/stdio/footer.d.ts +20 -0
  249. package/dist/stdio/footer.js +12 -2
  250. package/dist/stdio/header.d.ts +4 -16
  251. package/dist/stdio/header.js +1 -9
  252. package/dist/stdio/stderr.d.ts +51 -39
  253. package/dist/stdio/stderr.js +19 -22
  254. package/dist/stdio/stdout.d.ts +54 -52
  255. package/dist/stdio/stdout.js +35 -33
  256. package/dist/streams.d.ts +4 -3
  257. package/dist/streams.js +1 -0
  258. package/dist/strings.d.ts +31 -85
  259. package/dist/strings.js +5 -49
  260. package/dist/suppress-warnings.d.ts +32 -15
  261. package/dist/suppress-warnings.js +14 -13
  262. package/dist/tables.d.ts +30 -26
  263. package/dist/tables.js +24 -23
  264. package/dist/temporary-executor.d.ts +4 -0
  265. package/dist/temporary-executor.js +1 -0
  266. package/dist/themes/context.d.ts +30 -26
  267. package/dist/themes/context.js +19 -18
  268. package/dist/themes/index.d.ts +0 -4
  269. package/dist/themes/index.js +1 -0
  270. package/dist/themes/themes.d.ts +1 -1
  271. package/dist/themes/themes.js +1 -0
  272. package/dist/themes/types.js +1 -0
  273. package/dist/themes/utils.d.ts +46 -43
  274. package/dist/themes/utils.js +45 -44
  275. package/dist/types.d.ts +48 -52
  276. package/dist/types.js +35 -35
  277. package/dist/url.d.ts +48 -53
  278. package/dist/url.js +38 -37
  279. package/dist/validation/json-parser.d.ts +19 -190
  280. package/dist/validation/json-parser.js +5 -69
  281. package/dist/validation/types.d.ts +9 -33
  282. package/dist/validation/types.js +1 -0
  283. package/dist/versions.d.ts +1 -0
  284. package/dist/versions.js +2 -1
  285. package/dist/words.d.ts +3 -6
  286. package/dist/words.js +1 -0
  287. package/dist/zod.js +1 -0
  288. package/package.json +34 -66
  289. package/dist/external/@inquirer/checkbox.js +0 -5
  290. package/dist/external/@inquirer/confirm.js +0 -5
  291. package/dist/external/@inquirer/input.js +0 -5
  292. package/dist/external/@inquirer/password.js +0 -5
  293. package/dist/external/@inquirer/search.js +0 -5
  294. package/dist/external/@inquirer/select.js +0 -5
  295. package/dist/functions.d.ts +0 -57
  296. package/dist/functions.js +0 -70
  297. package/dist/stdio/clear.d.ts +0 -140
  298. package/dist/stdio/clear.js +0 -95
  299. package/dist/stdio/mask.d.ts +0 -151
  300. package/dist/stdio/mask.js +0 -224
  301. package/dist/stdio/progress.d.ts +0 -148
  302. package/dist/stdio/progress.js +0 -212
  303. package/dist/stdio/prompts.d.ts +0 -195
  304. package/dist/stdio/prompts.js +0 -176
  305. package/dist/utils/get-ipc.d.ts +0 -15
@@ -497,12 +497,12 @@ var require_yoctocolors_cjs = __commonJS({
497
497
  var hasColors = tty2?.WriteStream?.prototype?.hasColors?.() ?? false;
498
498
  var format = /* @__PURE__ */ __name((open, close) => {
499
499
  if (!hasColors) {
500
- return (input2) => input2;
500
+ return (input) => input;
501
501
  }
502
502
  const openCode = `\x1B[${open}m`;
503
503
  const closeCode = `\x1B[${close}m`;
504
- return (input2) => {
505
- const string = input2 + "";
504
+ return (input) => {
505
+ const string = input + "";
506
506
  let index = string.indexOf(closeCode);
507
507
  if (index === -1) {
508
508
  return openCode + string + closeCode;
@@ -566,2845 +566,13 @@ var require_yoctocolors_cjs = __commonJS({
566
566
  }
567
567
  });
568
568
 
569
- // node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/key.js
570
- var require_key = __commonJS({
571
- "node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/key.js"(exports2) {
572
- "use strict";
573
- Object.defineProperty(exports2, "__esModule", { value: true });
574
- exports2.isEnterKey = exports2.isNumberKey = exports2.isTabKey = exports2.isBackspaceKey = exports2.isSpaceKey = exports2.isDownKey = exports2.isUpKey = void 0;
575
- var isUpKey = /* @__PURE__ */ __name((key, keybindings = []) => (
576
- // The up key
577
- key.name === "up" || // Vim keybinding: hjkl keys map to left/down/up/right
578
- keybindings.includes("vim") && key.name === "k" || // Emacs keybinding: Ctrl+P means "previous" in Emacs navigation conventions
579
- keybindings.includes("emacs") && key.ctrl && key.name === "p"
580
- ), "isUpKey");
581
- exports2.isUpKey = isUpKey;
582
- var isDownKey = /* @__PURE__ */ __name((key, keybindings = []) => (
583
- // The down key
584
- key.name === "down" || // Vim keybinding: hjkl keys map to left/down/up/right
585
- keybindings.includes("vim") && key.name === "j" || // Emacs keybinding: Ctrl+N means "next" in Emacs navigation conventions
586
- keybindings.includes("emacs") && key.ctrl && key.name === "n"
587
- ), "isDownKey");
588
- exports2.isDownKey = isDownKey;
589
- var isSpaceKey = /* @__PURE__ */ __name((key) => key.name === "space", "isSpaceKey");
590
- exports2.isSpaceKey = isSpaceKey;
591
- var isBackspaceKey = /* @__PURE__ */ __name((key) => key.name === "backspace", "isBackspaceKey");
592
- exports2.isBackspaceKey = isBackspaceKey;
593
- var isTabKey = /* @__PURE__ */ __name((key) => key.name === "tab", "isTabKey");
594
- exports2.isTabKey = isTabKey;
595
- var isNumberKey = /* @__PURE__ */ __name((key) => "1234567890".includes(key.name), "isNumberKey");
596
- exports2.isNumberKey = isNumberKey;
597
- var isEnterKey = /* @__PURE__ */ __name((key) => key.name === "enter" || key.name === "return", "isEnterKey");
598
- exports2.isEnterKey = isEnterKey;
599
- }
600
- });
601
-
602
- // node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/errors.js
603
- var require_errors = __commonJS({
604
- "node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/errors.js"(exports2) {
605
- "use strict";
606
- Object.defineProperty(exports2, "__esModule", { value: true });
607
- exports2.ValidationError = exports2.HookError = exports2.ExitPromptError = exports2.CancelPromptError = exports2.AbortPromptError = void 0;
608
- var AbortPromptError = class extends Error {
609
- static {
610
- __name(this, "AbortPromptError");
611
- }
612
- name = "AbortPromptError";
613
- message = "Prompt was aborted";
614
- constructor(options) {
615
- super();
616
- this.cause = options?.cause;
617
- }
618
- };
619
- exports2.AbortPromptError = AbortPromptError;
620
- var CancelPromptError = class extends Error {
621
- static {
622
- __name(this, "CancelPromptError");
623
- }
624
- name = "CancelPromptError";
625
- message = "Prompt was canceled";
626
- };
627
- exports2.CancelPromptError = CancelPromptError;
628
- var ExitPromptError = class extends Error {
629
- static {
630
- __name(this, "ExitPromptError");
631
- }
632
- name = "ExitPromptError";
633
- };
634
- exports2.ExitPromptError = ExitPromptError;
635
- var HookError = class extends Error {
636
- static {
637
- __name(this, "HookError");
638
- }
639
- name = "HookError";
640
- };
641
- exports2.HookError = HookError;
642
- var ValidationError = class extends Error {
643
- static {
644
- __name(this, "ValidationError");
645
- }
646
- name = "ValidationError";
647
- };
648
- exports2.ValidationError = ValidationError;
649
- }
650
- });
651
-
652
- // node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/hook-engine.js
653
- var require_hook_engine = __commonJS({
654
- "node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/hook-engine.js"(exports2) {
655
- "use strict";
656
- Object.defineProperty(exports2, "__esModule", { value: true });
657
- exports2.effectScheduler = void 0;
658
- exports2.withHooks = withHooks;
659
- exports2.readline = readline;
660
- exports2.withUpdates = withUpdates;
661
- exports2.withPointer = withPointer;
662
- exports2.handleChange = handleChange;
663
- var node_async_hooks_1 = require("node:async_hooks");
664
- var errors_ts_1 = require_errors();
665
- var hookStorage = new node_async_hooks_1.AsyncLocalStorage();
666
- function createStore(rl) {
667
- const store = {
668
- rl,
669
- hooks: [],
670
- hooksCleanup: [],
671
- hooksEffect: [],
672
- index: 0,
673
- handleChange() {
674
- }
675
- };
676
- return store;
677
- }
678
- __name(createStore, "createStore");
679
- function withHooks(rl, cb) {
680
- const store = createStore(rl);
681
- return hookStorage.run(store, () => {
682
- function cycle(render) {
683
- store.handleChange = () => {
684
- store.index = 0;
685
- render();
686
- };
687
- store.handleChange();
688
- }
689
- __name(cycle, "cycle");
690
- return cb(cycle);
691
- });
692
- }
693
- __name(withHooks, "withHooks");
694
- function getStore() {
695
- const store = hookStorage.getStore();
696
- if (!store) {
697
- throw new errors_ts_1.HookError("[Inquirer] Hook functions can only be called from within a prompt");
698
- }
699
- return store;
700
- }
701
- __name(getStore, "getStore");
702
- function readline() {
703
- return getStore().rl;
704
- }
705
- __name(readline, "readline");
706
- function withUpdates(fn) {
707
- const wrapped = /* @__PURE__ */ __name((...args) => {
708
- const store = getStore();
709
- let shouldUpdate = false;
710
- const oldHandleChange = store.handleChange;
711
- store.handleChange = () => {
712
- shouldUpdate = true;
713
- };
714
- const returnValue = fn(...args);
715
- if (shouldUpdate) {
716
- oldHandleChange();
717
- }
718
- store.handleChange = oldHandleChange;
719
- return returnValue;
720
- }, "wrapped");
721
- return node_async_hooks_1.AsyncResource.bind(wrapped);
722
- }
723
- __name(withUpdates, "withUpdates");
724
- function withPointer(cb) {
725
- const store = getStore();
726
- const { index } = store;
727
- const pointer = {
728
- get() {
729
- return store.hooks[index];
730
- },
731
- set(value) {
732
- store.hooks[index] = value;
733
- },
734
- initialized: index in store.hooks
735
- };
736
- const returnValue = cb(pointer);
737
- store.index++;
738
- return returnValue;
739
- }
740
- __name(withPointer, "withPointer");
741
- function handleChange() {
742
- getStore().handleChange();
743
- }
744
- __name(handleChange, "handleChange");
745
- exports2.effectScheduler = {
746
- queue(cb) {
747
- const store = getStore();
748
- const { index } = store;
749
- store.hooksEffect.push(() => {
750
- store.hooksCleanup[index]?.();
751
- const cleanFn = cb(readline());
752
- if (cleanFn != null && typeof cleanFn !== "function") {
753
- throw new errors_ts_1.ValidationError("useEffect return value must be a cleanup function or nothing.");
754
- }
755
- store.hooksCleanup[index] = cleanFn;
756
- });
757
- },
758
- run() {
759
- const store = getStore();
760
- withUpdates(() => {
761
- store.hooksEffect.forEach((effect) => {
762
- effect();
763
- });
764
- store.hooksEffect.length = 0;
765
- })();
766
- },
767
- clearAll() {
768
- const store = getStore();
769
- store.hooksCleanup.forEach((cleanFn) => {
770
- cleanFn?.();
771
- });
772
- store.hooksEffect.length = 0;
773
- store.hooksCleanup.length = 0;
774
- }
775
- };
776
- }
777
- });
778
-
779
- // node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/use-state.js
780
- var require_use_state = __commonJS({
781
- "node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/use-state.js"(exports2) {
782
- "use strict";
783
- Object.defineProperty(exports2, "__esModule", { value: true });
784
- exports2.useState = useState;
785
- var node_async_hooks_1 = require("node:async_hooks");
786
- var hook_engine_ts_1 = require_hook_engine();
787
- function useState(defaultValue) {
788
- return (0, hook_engine_ts_1.withPointer)((pointer) => {
789
- const setState = node_async_hooks_1.AsyncResource.bind(/* @__PURE__ */ __name(function setState2(newValue) {
790
- if (pointer.get() !== newValue) {
791
- pointer.set(newValue);
792
- (0, hook_engine_ts_1.handleChange)();
793
- }
794
- }, "setState"));
795
- if (pointer.initialized) {
796
- return [pointer.get(), setState];
797
- }
798
- const value = typeof defaultValue === "function" ? defaultValue() : defaultValue;
799
- pointer.set(value);
800
- return [value, setState];
801
- });
802
- }
803
- __name(useState, "useState");
804
- }
805
- });
806
-
807
- // node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/use-effect.js
808
- var require_use_effect = __commonJS({
809
- "node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/use-effect.js"(exports2) {
810
- "use strict";
811
- Object.defineProperty(exports2, "__esModule", { value: true });
812
- exports2.useEffect = useEffect;
813
- var hook_engine_ts_1 = require_hook_engine();
814
- function useEffect(cb, depArray) {
815
- (0, hook_engine_ts_1.withPointer)((pointer) => {
816
- const oldDeps = pointer.get();
817
- const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i) => !Object.is(dep, oldDeps[i]));
818
- if (hasChanged) {
819
- hook_engine_ts_1.effectScheduler.queue(cb);
820
- }
821
- pointer.set(depArray);
822
- });
823
- }
824
- __name(useEffect, "useEffect");
825
- }
826
- });
827
-
828
- // node_modules/.pnpm/@inquirer+figures@1.0.15/node_modules/@inquirer/figures/dist/commonjs/index.js
829
- var require_commonjs = __commonJS({
830
- "node_modules/.pnpm/@inquirer+figures@1.0.15/node_modules/@inquirer/figures/dist/commonjs/index.js"(exports2) {
831
- "use strict";
832
- var __importDefault = exports2 && exports2.__importDefault || function(mod) {
833
- return mod && mod.__esModule ? mod : { "default": mod };
834
- };
835
- Object.defineProperty(exports2, "__esModule", { value: true });
836
- exports2.replaceSymbols = exports2.fallbackSymbols = exports2.mainSymbols = void 0;
837
- var node_process_1 = __importDefault(require("node:process"));
838
- function isUnicodeSupported() {
839
- if (node_process_1.default.platform !== "win32") {
840
- return node_process_1.default.env["TERM"] !== "linux";
841
- }
842
- return Boolean(node_process_1.default.env["WT_SESSION"]) || // Windows Terminal
843
- Boolean(node_process_1.default.env["TERMINUS_SUBLIME"]) || // Terminus (<0.2.27)
844
- node_process_1.default.env["ConEmuTask"] === "{cmd::Cmder}" || // ConEmu and cmder
845
- node_process_1.default.env["TERM_PROGRAM"] === "Terminus-Sublime" || node_process_1.default.env["TERM_PROGRAM"] === "vscode" || node_process_1.default.env["TERM"] === "xterm-256color" || node_process_1.default.env["TERM"] === "alacritty" || node_process_1.default.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
846
- }
847
- __name(isUnicodeSupported, "isUnicodeSupported");
848
- var common = {
849
- circleQuestionMark: "(?)",
850
- questionMarkPrefix: "(?)",
851
- square: "█",
852
- squareDarkShade: "▓",
853
- squareMediumShade: "▒",
854
- squareLightShade: "░",
855
- squareTop: "▀",
856
- squareBottom: "▄",
857
- squareLeft: "▌",
858
- squareRight: "▐",
859
- squareCenter: "■",
860
- bullet: "●",
861
- dot: "․",
862
- ellipsis: "…",
863
- pointerSmall: "›",
864
- triangleUp: "▲",
865
- triangleUpSmall: "▴",
866
- triangleDown: "▼",
867
- triangleDownSmall: "▾",
868
- triangleLeftSmall: "◂",
869
- triangleRightSmall: "▸",
870
- home: "⌂",
871
- heart: "♥",
872
- musicNote: "♪",
873
- musicNoteBeamed: "♫",
874
- arrowUp: "↑",
875
- arrowDown: "↓",
876
- arrowLeft: "←",
877
- arrowRight: "→",
878
- arrowLeftRight: "↔",
879
- arrowUpDown: "↕",
880
- almostEqual: "≈",
881
- notEqual: "≠",
882
- lessOrEqual: "≤",
883
- greaterOrEqual: "≥",
884
- identical: "≡",
885
- infinity: "∞",
886
- subscriptZero: "₀",
887
- subscriptOne: "₁",
888
- subscriptTwo: "₂",
889
- subscriptThree: "₃",
890
- subscriptFour: "₄",
891
- subscriptFive: "₅",
892
- subscriptSix: "₆",
893
- subscriptSeven: "₇",
894
- subscriptEight: "₈",
895
- subscriptNine: "₉",
896
- oneHalf: "½",
897
- oneThird: "⅓",
898
- oneQuarter: "¼",
899
- oneFifth: "⅕",
900
- oneSixth: "⅙",
901
- oneEighth: "⅛",
902
- twoThirds: "⅔",
903
- twoFifths: "⅖",
904
- threeQuarters: "¾",
905
- threeFifths: "⅗",
906
- threeEighths: "⅜",
907
- fourFifths: "⅘",
908
- fiveSixths: "⅚",
909
- fiveEighths: "⅝",
910
- sevenEighths: "⅞",
911
- line: "─",
912
- lineBold: "━",
913
- lineDouble: "═",
914
- lineDashed0: "┄",
915
- lineDashed1: "┅",
916
- lineDashed2: "┈",
917
- lineDashed3: "┉",
918
- lineDashed4: "╌",
919
- lineDashed5: "╍",
920
- lineDashed6: "╴",
921
- lineDashed7: "╶",
922
- lineDashed8: "╸",
923
- lineDashed9: "╺",
924
- lineDashed10: "╼",
925
- lineDashed11: "╾",
926
- lineDashed12: "−",
927
- lineDashed13: "–",
928
- lineDashed14: "‐",
929
- lineDashed15: "⁃",
930
- lineVertical: "│",
931
- lineVerticalBold: "┃",
932
- lineVerticalDouble: "║",
933
- lineVerticalDashed0: "┆",
934
- lineVerticalDashed1: "┇",
935
- lineVerticalDashed2: "┊",
936
- lineVerticalDashed3: "┋",
937
- lineVerticalDashed4: "╎",
938
- lineVerticalDashed5: "╏",
939
- lineVerticalDashed6: "╵",
940
- lineVerticalDashed7: "╷",
941
- lineVerticalDashed8: "╹",
942
- lineVerticalDashed9: "╻",
943
- lineVerticalDashed10: "╽",
944
- lineVerticalDashed11: "╿",
945
- lineDownLeft: "┐",
946
- lineDownLeftArc: "╮",
947
- lineDownBoldLeftBold: "┓",
948
- lineDownBoldLeft: "┒",
949
- lineDownLeftBold: "┑",
950
- lineDownDoubleLeftDouble: "╗",
951
- lineDownDoubleLeft: "╖",
952
- lineDownLeftDouble: "╕",
953
- lineDownRight: "┌",
954
- lineDownRightArc: "╭",
955
- lineDownBoldRightBold: "┏",
956
- lineDownBoldRight: "┎",
957
- lineDownRightBold: "┍",
958
- lineDownDoubleRightDouble: "╔",
959
- lineDownDoubleRight: "╓",
960
- lineDownRightDouble: "╒",
961
- lineUpLeft: "┘",
962
- lineUpLeftArc: "╯",
963
- lineUpBoldLeftBold: "┛",
964
- lineUpBoldLeft: "┚",
965
- lineUpLeftBold: "┙",
966
- lineUpDoubleLeftDouble: "╝",
967
- lineUpDoubleLeft: "╜",
968
- lineUpLeftDouble: "╛",
969
- lineUpRight: "└",
970
- lineUpRightArc: "╰",
971
- lineUpBoldRightBold: "┗",
972
- lineUpBoldRight: "┖",
973
- lineUpRightBold: "┕",
974
- lineUpDoubleRightDouble: "╚",
975
- lineUpDoubleRight: "╙",
976
- lineUpRightDouble: "╘",
977
- lineUpDownLeft: "┤",
978
- lineUpBoldDownBoldLeftBold: "┫",
979
- lineUpBoldDownBoldLeft: "┨",
980
- lineUpDownLeftBold: "┥",
981
- lineUpBoldDownLeftBold: "┩",
982
- lineUpDownBoldLeftBold: "┪",
983
- lineUpDownBoldLeft: "┧",
984
- lineUpBoldDownLeft: "┦",
985
- lineUpDoubleDownDoubleLeftDouble: "╣",
986
- lineUpDoubleDownDoubleLeft: "╢",
987
- lineUpDownLeftDouble: "╡",
988
- lineUpDownRight: "├",
989
- lineUpBoldDownBoldRightBold: "┣",
990
- lineUpBoldDownBoldRight: "┠",
991
- lineUpDownRightBold: "┝",
992
- lineUpBoldDownRightBold: "┡",
993
- lineUpDownBoldRightBold: "┢",
994
- lineUpDownBoldRight: "┟",
995
- lineUpBoldDownRight: "┞",
996
- lineUpDoubleDownDoubleRightDouble: "╠",
997
- lineUpDoubleDownDoubleRight: "╟",
998
- lineUpDownRightDouble: "╞",
999
- lineDownLeftRight: "┬",
1000
- lineDownBoldLeftBoldRightBold: "┳",
1001
- lineDownLeftBoldRightBold: "┯",
1002
- lineDownBoldLeftRight: "┰",
1003
- lineDownBoldLeftBoldRight: "┱",
1004
- lineDownBoldLeftRightBold: "┲",
1005
- lineDownLeftRightBold: "┮",
1006
- lineDownLeftBoldRight: "┭",
1007
- lineDownDoubleLeftDoubleRightDouble: "╦",
1008
- lineDownDoubleLeftRight: "╥",
1009
- lineDownLeftDoubleRightDouble: "╤",
1010
- lineUpLeftRight: "┴",
1011
- lineUpBoldLeftBoldRightBold: "┻",
1012
- lineUpLeftBoldRightBold: "┷",
1013
- lineUpBoldLeftRight: "┸",
1014
- lineUpBoldLeftBoldRight: "┹",
1015
- lineUpBoldLeftRightBold: "┺",
1016
- lineUpLeftRightBold: "┶",
1017
- lineUpLeftBoldRight: "┵",
1018
- lineUpDoubleLeftDoubleRightDouble: "╩",
1019
- lineUpDoubleLeftRight: "╨",
1020
- lineUpLeftDoubleRightDouble: "╧",
1021
- lineUpDownLeftRight: "┼",
1022
- lineUpBoldDownBoldLeftBoldRightBold: "╋",
1023
- lineUpDownBoldLeftBoldRightBold: "╈",
1024
- lineUpBoldDownLeftBoldRightBold: "╇",
1025
- lineUpBoldDownBoldLeftRightBold: "╊",
1026
- lineUpBoldDownBoldLeftBoldRight: "╉",
1027
- lineUpBoldDownLeftRight: "╀",
1028
- lineUpDownBoldLeftRight: "╁",
1029
- lineUpDownLeftBoldRight: "┽",
1030
- lineUpDownLeftRightBold: "┾",
1031
- lineUpBoldDownBoldLeftRight: "╂",
1032
- lineUpDownLeftBoldRightBold: "┿",
1033
- lineUpBoldDownLeftBoldRight: "╃",
1034
- lineUpBoldDownLeftRightBold: "╄",
1035
- lineUpDownBoldLeftBoldRight: "╅",
1036
- lineUpDownBoldLeftRightBold: "╆",
1037
- lineUpDoubleDownDoubleLeftDoubleRightDouble: "╬",
1038
- lineUpDoubleDownDoubleLeftRight: "╫",
1039
- lineUpDownLeftDoubleRightDouble: "╪",
1040
- lineCross: "╳",
1041
- lineBackslash: "╲",
1042
- lineSlash: "╱"
1043
- };
1044
- var specialMainSymbols = {
1045
- tick: "✔",
1046
- info: "ℹ",
1047
- warning: "⚠",
1048
- cross: "✘",
1049
- squareSmall: "◻",
1050
- squareSmallFilled: "◼",
1051
- circle: "◯",
1052
- circleFilled: "◉",
1053
- circleDotted: "◌",
1054
- circleDouble: "◎",
1055
- circleCircle: "ⓞ",
1056
- circleCross: "ⓧ",
1057
- circlePipe: "Ⓘ",
1058
- radioOn: "◉",
1059
- radioOff: "◯",
1060
- checkboxOn: "☒",
1061
- checkboxOff: "☐",
1062
- checkboxCircleOn: "ⓧ",
1063
- checkboxCircleOff: "Ⓘ",
1064
- pointer: "❯",
1065
- triangleUpOutline: "△",
1066
- triangleLeft: "◀",
1067
- triangleRight: "▶",
1068
- lozenge: "◆",
1069
- lozengeOutline: "◇",
1070
- hamburger: "☰",
1071
- smiley: "㋡",
1072
- mustache: "෴",
1073
- star: "★",
1074
- play: "▶",
1075
- nodejs: "⬢",
1076
- oneSeventh: "⅐",
1077
- oneNinth: "⅑",
1078
- oneTenth: "⅒"
1079
- };
1080
- var specialFallbackSymbols = {
1081
- tick: "√",
1082
- info: "i",
1083
- warning: "‼",
1084
- cross: "×",
1085
- squareSmall: "□",
1086
- squareSmallFilled: "■",
1087
- circle: "( )",
1088
- circleFilled: "(*)",
1089
- circleDotted: "( )",
1090
- circleDouble: "( )",
1091
- circleCircle: "(○)",
1092
- circleCross: "(×)",
1093
- circlePipe: "(│)",
1094
- radioOn: "(*)",
1095
- radioOff: "( )",
1096
- checkboxOn: "[×]",
1097
- checkboxOff: "[ ]",
1098
- checkboxCircleOn: "(×)",
1099
- checkboxCircleOff: "( )",
1100
- pointer: ">",
1101
- triangleUpOutline: "∆",
1102
- triangleLeft: "◄",
1103
- triangleRight: "►",
1104
- lozenge: "♦",
1105
- lozengeOutline: "◊",
1106
- hamburger: "≡",
1107
- smiley: "☺",
1108
- mustache: "┌─┐",
1109
- star: "✶",
1110
- play: "►",
1111
- nodejs: "♦",
1112
- oneSeventh: "1/7",
1113
- oneNinth: "1/9",
1114
- oneTenth: "1/10"
1115
- };
1116
- exports2.mainSymbols = {
1117
- ...common,
1118
- ...specialMainSymbols
1119
- };
1120
- exports2.fallbackSymbols = {
1121
- ...common,
1122
- ...specialFallbackSymbols
1123
- };
1124
- var shouldUseMain = isUnicodeSupported();
1125
- var figures = shouldUseMain ? exports2.mainSymbols : exports2.fallbackSymbols;
1126
- exports2.default = figures;
1127
- var replacements = Object.entries(specialMainSymbols);
1128
- var replaceSymbols = /* @__PURE__ */ __name((string, { useFallback = !shouldUseMain } = {}) => {
1129
- if (useFallback) {
1130
- for (const [key, mainSymbol] of replacements) {
1131
- const fallbackSymbol = exports2.fallbackSymbols[key];
1132
- if (!fallbackSymbol) {
1133
- throw new Error(`Unable to find fallback for ${key}`);
1134
- }
1135
- string = string.replaceAll(mainSymbol, fallbackSymbol);
1136
- }
1137
- }
1138
- return string;
1139
- }, "replaceSymbols");
1140
- exports2.replaceSymbols = replaceSymbols;
1141
- }
1142
- });
1143
-
1144
- // node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/theme.js
1145
- var require_theme = __commonJS({
1146
- "node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/theme.js"(exports2) {
1147
- "use strict";
1148
- var __importDefault = exports2 && exports2.__importDefault || function(mod) {
1149
- return mod && mod.__esModule ? mod : { "default": mod };
1150
- };
1151
- Object.defineProperty(exports2, "__esModule", { value: true });
1152
- exports2.defaultTheme = void 0;
1153
- var yoctocolors_cjs_1 = __importDefault(require_yoctocolors_cjs());
1154
- var figures_1 = __importDefault(require_commonjs());
1155
- exports2.defaultTheme = {
1156
- prefix: {
1157
- idle: yoctocolors_cjs_1.default.blue("?"),
1158
- done: yoctocolors_cjs_1.default.green(figures_1.default.tick)
1159
- },
1160
- spinner: {
1161
- interval: 80,
1162
- frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => yoctocolors_cjs_1.default.yellow(frame))
1163
- },
1164
- style: {
1165
- answer: yoctocolors_cjs_1.default.cyan,
1166
- message: yoctocolors_cjs_1.default.bold,
1167
- error: /* @__PURE__ */ __name((text) => yoctocolors_cjs_1.default.red(`> ${text}`), "error"),
1168
- defaultAnswer: /* @__PURE__ */ __name((text) => yoctocolors_cjs_1.default.dim(`(${text})`), "defaultAnswer"),
1169
- help: yoctocolors_cjs_1.default.dim,
1170
- highlight: yoctocolors_cjs_1.default.cyan,
1171
- key: /* @__PURE__ */ __name((text) => yoctocolors_cjs_1.default.cyan(yoctocolors_cjs_1.default.bold(`<${text}>`)), "key")
1172
- }
1173
- };
1174
- }
1175
- });
1176
-
1177
- // node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/make-theme.js
1178
- var require_make_theme = __commonJS({
1179
- "node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/make-theme.js"(exports2) {
1180
- "use strict";
1181
- Object.defineProperty(exports2, "__esModule", { value: true });
1182
- exports2.makeTheme = makeTheme;
1183
- var theme_ts_1 = require_theme();
1184
- function isPlainObject(value) {
1185
- if (typeof value !== "object" || value === null)
1186
- return false;
1187
- let proto = value;
1188
- while (Object.getPrototypeOf(proto) !== null) {
1189
- proto = Object.getPrototypeOf(proto);
1190
- }
1191
- return Object.getPrototypeOf(value) === proto;
1192
- }
1193
- __name(isPlainObject, "isPlainObject");
1194
- function deepMerge(...objects) {
1195
- const output = {};
1196
- for (const obj of objects) {
1197
- for (const [key, value] of Object.entries(obj)) {
1198
- const prevValue = output[key];
1199
- output[key] = isPlainObject(prevValue) && isPlainObject(value) ? deepMerge(prevValue, value) : value;
1200
- }
1201
- }
1202
- return output;
1203
- }
1204
- __name(deepMerge, "deepMerge");
1205
- function makeTheme(...themes) {
1206
- const themesToMerge = [
1207
- theme_ts_1.defaultTheme,
1208
- ...themes.filter((theme) => theme != null)
1209
- ];
1210
- return deepMerge(...themesToMerge);
1211
- }
1212
- __name(makeTheme, "makeTheme");
1213
- }
1214
- });
1215
-
1216
- // node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/use-prefix.js
1217
- var require_use_prefix = __commonJS({
1218
- "node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/use-prefix.js"(exports2) {
1219
- "use strict";
1220
- Object.defineProperty(exports2, "__esModule", { value: true });
1221
- exports2.usePrefix = usePrefix;
1222
- var use_state_ts_1 = require_use_state();
1223
- var use_effect_ts_1 = require_use_effect();
1224
- var make_theme_ts_1 = require_make_theme();
1225
- function usePrefix({ status = "idle", theme }) {
1226
- const [showLoader, setShowLoader] = (0, use_state_ts_1.useState)(false);
1227
- const [tick, setTick] = (0, use_state_ts_1.useState)(0);
1228
- const { prefix, spinner } = (0, make_theme_ts_1.makeTheme)(theme);
1229
- (0, use_effect_ts_1.useEffect)(() => {
1230
- if (status === "loading") {
1231
- let tickInterval;
1232
- let inc = -1;
1233
- const delayTimeout = setTimeout(() => {
1234
- setShowLoader(true);
1235
- tickInterval = setInterval(() => {
1236
- inc = inc + 1;
1237
- setTick(inc % spinner.frames.length);
1238
- }, spinner.interval);
1239
- }, 300);
1240
- return () => {
1241
- clearTimeout(delayTimeout);
1242
- clearInterval(tickInterval);
1243
- };
1244
- } else {
1245
- setShowLoader(false);
1246
- }
1247
- }, [status]);
1248
- if (showLoader) {
1249
- return spinner.frames[tick];
1250
- }
1251
- const iconName = status === "loading" ? "idle" : status;
1252
- return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
1253
- }
1254
- __name(usePrefix, "usePrefix");
1255
- }
1256
- });
1257
-
1258
- // node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/use-memo.js
1259
- var require_use_memo = __commonJS({
1260
- "node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/use-memo.js"(exports2) {
1261
- "use strict";
1262
- Object.defineProperty(exports2, "__esModule", { value: true });
1263
- exports2.useMemo = useMemo;
1264
- var hook_engine_ts_1 = require_hook_engine();
1265
- function useMemo(fn, dependencies) {
1266
- return (0, hook_engine_ts_1.withPointer)((pointer) => {
1267
- const prev = pointer.get();
1268
- if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i) => dep !== dependencies[i])) {
1269
- const value = fn();
1270
- pointer.set({ value, dependencies });
1271
- return value;
1272
- }
1273
- return prev.value;
1274
- });
1275
- }
1276
- __name(useMemo, "useMemo");
1277
- }
1278
- });
1279
-
1280
- // node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/use-ref.js
1281
- var require_use_ref = __commonJS({
1282
- "node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/use-ref.js"(exports2) {
1283
- "use strict";
1284
- Object.defineProperty(exports2, "__esModule", { value: true });
1285
- exports2.useRef = useRef;
1286
- var use_state_ts_1 = require_use_state();
1287
- function useRef(val) {
1288
- return (0, use_state_ts_1.useState)({ current: val })[0];
1289
- }
1290
- __name(useRef, "useRef");
1291
- }
1292
- });
1293
-
1294
- // node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/use-keypress.js
1295
- var require_use_keypress = __commonJS({
1296
- "node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/use-keypress.js"(exports2) {
1297
- "use strict";
1298
- Object.defineProperty(exports2, "__esModule", { value: true });
1299
- exports2.useKeypress = useKeypress;
1300
- var use_ref_ts_1 = require_use_ref();
1301
- var use_effect_ts_1 = require_use_effect();
1302
- var hook_engine_ts_1 = require_hook_engine();
1303
- function useKeypress(userHandler) {
1304
- const signal = (0, use_ref_ts_1.useRef)(userHandler);
1305
- signal.current = userHandler;
1306
- (0, use_effect_ts_1.useEffect)((rl) => {
1307
- let ignore = false;
1308
- const handler = (0, hook_engine_ts_1.withUpdates)((_input, event) => {
1309
- if (ignore)
1310
- return;
1311
- void signal.current(event, rl);
1312
- });
1313
- rl.input.on("keypress", handler);
1314
- return () => {
1315
- ignore = true;
1316
- rl.input.removeListener("keypress", handler);
1317
- };
1318
- }, []);
1319
- }
1320
- __name(useKeypress, "useKeypress");
1321
- }
1322
- });
1323
-
1324
- // node_modules/.pnpm/cli-width@4.1.0/node_modules/cli-width/index.js
1325
- var require_cli_width = __commonJS({
1326
- "node_modules/.pnpm/cli-width@4.1.0/node_modules/cli-width/index.js"(exports2, module2) {
1327
- "use strict";
1328
- module2.exports = cliWidth;
1329
- function normalizeOpts(options) {
1330
- const defaultOpts = {
1331
- defaultWidth: 0,
1332
- output: process.stdout,
1333
- tty: require("tty")
1334
- };
1335
- if (!options) {
1336
- return defaultOpts;
1337
- }
1338
- Object.keys(defaultOpts).forEach(function(key) {
1339
- if (!options[key]) {
1340
- options[key] = defaultOpts[key];
1341
- }
1342
- });
1343
- return options;
1344
- }
1345
- __name(normalizeOpts, "normalizeOpts");
1346
- function cliWidth(options) {
1347
- const opts = normalizeOpts(options);
1348
- if (opts.output.getWindowSize) {
1349
- return opts.output.getWindowSize()[0] || opts.defaultWidth;
1350
- }
1351
- if (opts.tty.getWindowSize) {
1352
- return opts.tty.getWindowSize()[1] || opts.defaultWidth;
1353
- }
1354
- if (opts.output.columns) {
1355
- return opts.output.columns;
1356
- }
1357
- if (process.env.CLI_WIDTH) {
1358
- const width = parseInt(process.env.CLI_WIDTH, 10);
1359
- if (!isNaN(width) && width !== 0) {
1360
- return width;
1361
- }
1362
- }
1363
- return opts.defaultWidth;
1364
- }
1365
- __name(cliWidth, "cliWidth");
1366
- }
1367
- });
1368
-
1369
- // node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.js
1370
- function ansiRegex({ onlyFirst = false } = {}) {
1371
- const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
1372
- const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
1373
- const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
1374
- const pattern = `${osc}|${csi}`;
1375
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
1376
- }
1377
- var init_ansi_regex = __esm({
1378
- "node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.js"() {
1379
- __name(ansiRegex, "ansiRegex");
1380
- }
1381
- });
1382
-
1383
- // node_modules/.pnpm/strip-ansi@7.1.2/node_modules/strip-ansi/index.js
1384
- function stripAnsi(string) {
1385
- if (typeof string !== "string") {
1386
- throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
1387
- }
1388
- return string.replace(regex, "");
1389
- }
1390
- var regex;
1391
- var init_strip_ansi = __esm({
1392
- "node_modules/.pnpm/strip-ansi@7.1.2/node_modules/strip-ansi/index.js"() {
1393
- init_ansi_regex();
1394
- regex = ansiRegex();
1395
- __name(stripAnsi, "stripAnsi");
1396
- }
1397
- });
1398
-
1399
- // node_modules/.pnpm/get-east-asian-width@1.3.0/node_modules/get-east-asian-width/lookup.js
1400
- function isAmbiguous(x) {
1401
- return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
1402
- }
1403
- function isFullWidth(x) {
1404
- return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
1405
- }
1406
- function isWide(x) {
1407
- return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
1408
- }
1409
- var init_lookup = __esm({
1410
- "node_modules/.pnpm/get-east-asian-width@1.3.0/node_modules/get-east-asian-width/lookup.js"() {
1411
- __name(isAmbiguous, "isAmbiguous");
1412
- __name(isFullWidth, "isFullWidth");
1413
- __name(isWide, "isWide");
1414
- }
1415
- });
1416
-
1417
- // node_modules/.pnpm/get-east-asian-width@1.3.0/node_modules/get-east-asian-width/index.js
1418
- function validate(codePoint) {
1419
- if (!Number.isSafeInteger(codePoint)) {
1420
- throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
1421
- }
1422
- }
1423
- function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
1424
- validate(codePoint);
1425
- if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
1426
- return 2;
1427
- }
1428
- return 1;
1429
- }
1430
- var init_get_east_asian_width = __esm({
1431
- "node_modules/.pnpm/get-east-asian-width@1.3.0/node_modules/get-east-asian-width/index.js"() {
1432
- init_lookup();
1433
- __name(validate, "validate");
1434
- __name(eastAsianWidth, "eastAsianWidth");
1435
- }
1436
- });
1437
-
1438
- // node_modules/.pnpm/string-width@8.1.0/node_modules/string-width/index.js
1439
- function baseVisible(segment) {
1440
- return segment.replace(leadingNonPrintingRegex, "");
1441
- }
1442
- function isZeroWidthCluster(segment) {
1443
- return zeroWidthClusterRegex.test(segment);
1444
- }
1445
- function trailingHalfwidthWidth(segment, eastAsianWidthOptions) {
1446
- let extra = 0;
1447
- if (segment.length > 1) {
1448
- for (const char of segment.slice(1)) {
1449
- if (char >= "＀" && char <= "￯") {
1450
- extra += eastAsianWidth(char.codePointAt(0), eastAsianWidthOptions);
1451
- }
1452
- }
1453
- }
1454
- return extra;
1455
- }
1456
- function stringWidth(input2, options = {}) {
1457
- if (typeof input2 !== "string" || input2.length === 0) {
1458
- return 0;
1459
- }
1460
- const {
1461
- ambiguousIsNarrow = true,
1462
- countAnsiEscapeCodes = false
1463
- } = options;
1464
- let string = input2;
1465
- if (!countAnsiEscapeCodes) {
1466
- string = stripAnsi(string);
1467
- }
1468
- if (string.length === 0) {
1469
- return 0;
1470
- }
1471
- let width = 0;
1472
- const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
1473
- for (const { segment } of segmenter.segment(string)) {
1474
- if (isZeroWidthCluster(segment)) {
1475
- continue;
1476
- }
1477
- if (rgiEmojiRegex.test(segment)) {
1478
- width += 2;
1479
- continue;
1480
- }
1481
- const codePoint = baseVisible(segment).codePointAt(0);
1482
- width += eastAsianWidth(codePoint, eastAsianWidthOptions);
1483
- width += trailingHalfwidthWidth(segment, eastAsianWidthOptions);
1484
- }
1485
- return width;
1486
- }
1487
- var segmenter, zeroWidthClusterRegex, leadingNonPrintingRegex, rgiEmojiRegex;
1488
- var init_string_width = __esm({
1489
- "node_modules/.pnpm/string-width@8.1.0/node_modules/string-width/index.js"() {
1490
- init_strip_ansi();
1491
- init_get_east_asian_width();
1492
- segmenter = new Intl.Segmenter();
1493
- zeroWidthClusterRegex = new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Mark}|\\p{Surrogate})+$", "v");
1494
- leadingNonPrintingRegex = new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+", "v");
1495
- rgiEmojiRegex = new RegExp("^\\p{RGI_Emoji}$", "v");
1496
- __name(baseVisible, "baseVisible");
1497
- __name(isZeroWidthCluster, "isZeroWidthCluster");
1498
- __name(trailingHalfwidthWidth, "trailingHalfwidthWidth");
1499
- __name(stringWidth, "stringWidth");
1500
- }
1501
- });
1502
-
1503
- // node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.js
1504
- function assembleStyles() {
1505
- const codes = /* @__PURE__ */ new Map();
1506
- for (const [groupName, group] of Object.entries(styles)) {
1507
- for (const [styleName, style] of Object.entries(group)) {
1508
- styles[styleName] = {
1509
- open: `\x1B[${style[0]}m`,
1510
- close: `\x1B[${style[1]}m`
1511
- };
1512
- group[styleName] = styles[styleName];
1513
- codes.set(style[0], style[1]);
1514
- }
1515
- Object.defineProperty(styles, groupName, {
1516
- value: group,
1517
- enumerable: false
1518
- });
1519
- }
1520
- Object.defineProperty(styles, "codes", {
1521
- value: codes,
1522
- enumerable: false
1523
- });
1524
- styles.color.close = "\x1B[39m";
1525
- styles.bgColor.close = "\x1B[49m";
1526
- styles.color.ansi = wrapAnsi16();
1527
- styles.color.ansi256 = wrapAnsi256();
1528
- styles.color.ansi16m = wrapAnsi16m();
1529
- styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
1530
- styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
1531
- styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
1532
- Object.defineProperties(styles, {
1533
- rgbToAnsi256: {
1534
- value(red, green, blue) {
1535
- if (red === green && green === blue) {
1536
- if (red < 8) {
1537
- return 16;
1538
- }
1539
- if (red > 248) {
1540
- return 231;
1541
- }
1542
- return Math.round((red - 8) / 247 * 24) + 232;
1543
- }
1544
- return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
1545
- },
1546
- enumerable: false
1547
- },
1548
- hexToRgb: {
1549
- value(hex) {
1550
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
1551
- if (!matches) {
1552
- return [0, 0, 0];
1553
- }
1554
- let [colorString] = matches;
1555
- if (colorString.length === 3) {
1556
- colorString = [...colorString].map((character) => character + character).join("");
1557
- }
1558
- const integer = Number.parseInt(colorString, 16);
1559
- return [
1560
- /* eslint-disable no-bitwise */
1561
- integer >> 16 & 255,
1562
- integer >> 8 & 255,
1563
- integer & 255
1564
- /* eslint-enable no-bitwise */
1565
- ];
1566
- },
1567
- enumerable: false
1568
- },
1569
- hexToAnsi256: {
1570
- value: /* @__PURE__ */ __name((hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)), "value"),
1571
- enumerable: false
1572
- },
1573
- ansi256ToAnsi: {
1574
- value(code) {
1575
- if (code < 8) {
1576
- return 30 + code;
1577
- }
1578
- if (code < 16) {
1579
- return 90 + (code - 8);
1580
- }
1581
- let red;
1582
- let green;
1583
- let blue;
1584
- if (code >= 232) {
1585
- red = ((code - 232) * 10 + 8) / 255;
1586
- green = red;
1587
- blue = red;
1588
- } else {
1589
- code -= 16;
1590
- const remainder = code % 36;
1591
- red = Math.floor(code / 36) / 5;
1592
- green = Math.floor(remainder / 6) / 5;
1593
- blue = remainder % 6 / 5;
1594
- }
1595
- const value = Math.max(red, green, blue) * 2;
1596
- if (value === 0) {
1597
- return 30;
1598
- }
1599
- let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
1600
- if (value === 2) {
1601
- result += 60;
1602
- }
1603
- return result;
1604
- },
1605
- enumerable: false
1606
- },
1607
- rgbToAnsi: {
1608
- value: /* @__PURE__ */ __name((red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)), "value"),
1609
- enumerable: false
1610
- },
1611
- hexToAnsi: {
1612
- value: /* @__PURE__ */ __name((hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), "value"),
1613
- enumerable: false
1614
- }
1615
- });
1616
- return styles;
1617
- }
1618
- var ANSI_BACKGROUND_OFFSET, wrapAnsi16, wrapAnsi256, wrapAnsi16m, styles, modifierNames, foregroundColorNames, backgroundColorNames, colorNames, ansiStyles, ansi_styles_default;
1619
- var init_ansi_styles = __esm({
1620
- "node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.js"() {
1621
- ANSI_BACKGROUND_OFFSET = 10;
1622
- wrapAnsi16 = /* @__PURE__ */ __name((offset = 0) => (code) => `\x1B[${code + offset}m`, "wrapAnsi16");
1623
- wrapAnsi256 = /* @__PURE__ */ __name((offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`, "wrapAnsi256");
1624
- wrapAnsi16m = /* @__PURE__ */ __name((offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`, "wrapAnsi16m");
1625
- styles = {
1626
- modifier: {
1627
- reset: [0, 0],
1628
- // 21 isn't widely supported and 22 does the same thing
1629
- bold: [1, 22],
1630
- dim: [2, 22],
1631
- italic: [3, 23],
1632
- underline: [4, 24],
1633
- overline: [53, 55],
1634
- inverse: [7, 27],
1635
- hidden: [8, 28],
1636
- strikethrough: [9, 29]
1637
- },
1638
- color: {
1639
- black: [30, 39],
1640
- red: [31, 39],
1641
- green: [32, 39],
1642
- yellow: [33, 39],
1643
- blue: [34, 39],
1644
- magenta: [35, 39],
1645
- cyan: [36, 39],
1646
- white: [37, 39],
1647
- // Bright color
1648
- blackBright: [90, 39],
1649
- gray: [90, 39],
1650
- // Alias of `blackBright`
1651
- grey: [90, 39],
1652
- // Alias of `blackBright`
1653
- redBright: [91, 39],
1654
- greenBright: [92, 39],
1655
- yellowBright: [93, 39],
1656
- blueBright: [94, 39],
1657
- magentaBright: [95, 39],
1658
- cyanBright: [96, 39],
1659
- whiteBright: [97, 39]
1660
- },
1661
- bgColor: {
1662
- bgBlack: [40, 49],
1663
- bgRed: [41, 49],
1664
- bgGreen: [42, 49],
1665
- bgYellow: [43, 49],
1666
- bgBlue: [44, 49],
1667
- bgMagenta: [45, 49],
1668
- bgCyan: [46, 49],
1669
- bgWhite: [47, 49],
1670
- // Bright color
1671
- bgBlackBright: [100, 49],
1672
- bgGray: [100, 49],
1673
- // Alias of `bgBlackBright`
1674
- bgGrey: [100, 49],
1675
- // Alias of `bgBlackBright`
1676
- bgRedBright: [101, 49],
1677
- bgGreenBright: [102, 49],
1678
- bgYellowBright: [103, 49],
1679
- bgBlueBright: [104, 49],
1680
- bgMagentaBright: [105, 49],
1681
- bgCyanBright: [106, 49],
1682
- bgWhiteBright: [107, 49]
1683
- }
1684
- };
1685
- modifierNames = Object.keys(styles.modifier);
1686
- foregroundColorNames = Object.keys(styles.color);
1687
- backgroundColorNames = Object.keys(styles.bgColor);
1688
- colorNames = [...foregroundColorNames, ...backgroundColorNames];
1689
- __name(assembleStyles, "assembleStyles");
1690
- ansiStyles = assembleStyles();
1691
- ansi_styles_default = ansiStyles;
1692
- }
1693
- });
1694
-
1695
- // node_modules/.pnpm/wrap-ansi@9.0.2/node_modules/wrap-ansi/index.js
1696
- var wrap_ansi_exports = {};
1697
- __export(wrap_ansi_exports, {
1698
- default: () => wrapAnsi
1699
- });
1700
- function wrapAnsi(string, columns, options) {
1701
- return String(string).normalize().replaceAll("\r\n", "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
1702
- }
1703
- var ESCAPES, END_CODE, ANSI_ESCAPE_BELL, ANSI_CSI, ANSI_OSC, ANSI_SGR_TERMINATOR, ANSI_ESCAPE_LINK, wrapAnsiCode, wrapAnsiHyperlink, wordLengths, wrapWord, stringVisibleTrimSpacesRight, exec;
1704
- var init_wrap_ansi = __esm({
1705
- "node_modules/.pnpm/wrap-ansi@9.0.2/node_modules/wrap-ansi/index.js"() {
1706
- init_string_width();
1707
- init_strip_ansi();
1708
- init_ansi_styles();
1709
- ESCAPES = /* @__PURE__ */ new Set([
1710
- "\x1B",
1711
- "›"
1712
- ]);
1713
- END_CODE = 39;
1714
- ANSI_ESCAPE_BELL = "\x07";
1715
- ANSI_CSI = "[";
1716
- ANSI_OSC = "]";
1717
- ANSI_SGR_TERMINATOR = "m";
1718
- ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
1719
- wrapAnsiCode = /* @__PURE__ */ __name((code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`, "wrapAnsiCode");
1720
- wrapAnsiHyperlink = /* @__PURE__ */ __name((url) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`, "wrapAnsiHyperlink");
1721
- wordLengths = /* @__PURE__ */ __name((string) => string.split(" ").map((character) => stringWidth(character)), "wordLengths");
1722
- wrapWord = /* @__PURE__ */ __name((rows, word, columns) => {
1723
- const characters = [...word];
1724
- let isInsideEscape = false;
1725
- let isInsideLinkEscape = false;
1726
- let visible = stringWidth(stripAnsi(rows.at(-1)));
1727
- for (const [index, character] of characters.entries()) {
1728
- const characterLength = stringWidth(character);
1729
- if (visible + characterLength <= columns) {
1730
- rows[rows.length - 1] += character;
1731
- } else {
1732
- rows.push(character);
1733
- visible = 0;
1734
- }
1735
- if (ESCAPES.has(character)) {
1736
- isInsideEscape = true;
1737
- const ansiEscapeLinkCandidate = characters.slice(index + 1, index + 1 + ANSI_ESCAPE_LINK.length).join("");
1738
- isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK;
1739
- }
1740
- if (isInsideEscape) {
1741
- if (isInsideLinkEscape) {
1742
- if (character === ANSI_ESCAPE_BELL) {
1743
- isInsideEscape = false;
1744
- isInsideLinkEscape = false;
1745
- }
1746
- } else if (character === ANSI_SGR_TERMINATOR) {
1747
- isInsideEscape = false;
1748
- }
1749
- continue;
1750
- }
1751
- visible += characterLength;
1752
- if (visible === columns && index < characters.length - 1) {
1753
- rows.push("");
1754
- visible = 0;
1755
- }
1756
- }
1757
- if (!visible && rows.at(-1).length > 0 && rows.length > 1) {
1758
- rows[rows.length - 2] += rows.pop();
1759
- }
1760
- }, "wrapWord");
1761
- stringVisibleTrimSpacesRight = /* @__PURE__ */ __name((string) => {
1762
- const words = string.split(" ");
1763
- let last = words.length;
1764
- while (last > 0) {
1765
- if (stringWidth(words[last - 1]) > 0) {
1766
- break;
1767
- }
1768
- last--;
1769
- }
1770
- if (last === words.length) {
1771
- return string;
1772
- }
1773
- return words.slice(0, last).join(" ") + words.slice(last).join("");
1774
- }, "stringVisibleTrimSpacesRight");
1775
- exec = /* @__PURE__ */ __name((string, columns, options = {}) => {
1776
- if (options.trim !== false && string.trim() === "") {
1777
- return "";
1778
- }
1779
- let returnValue = "";
1780
- let escapeCode;
1781
- let escapeUrl;
1782
- const lengths = wordLengths(string);
1783
- let rows = [""];
1784
- for (const [index, word] of string.split(" ").entries()) {
1785
- if (options.trim !== false) {
1786
- rows[rows.length - 1] = rows.at(-1).trimStart();
1787
- }
1788
- let rowLength = stringWidth(rows.at(-1));
1789
- if (index !== 0) {
1790
- if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
1791
- rows.push("");
1792
- rowLength = 0;
1793
- }
1794
- if (rowLength > 0 || options.trim === false) {
1795
- rows[rows.length - 1] += " ";
1796
- rowLength++;
1797
- }
1798
- }
1799
- if (options.hard && lengths[index] > columns) {
1800
- const remainingColumns = columns - rowLength;
1801
- const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
1802
- const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
1803
- if (breaksStartingNextLine < breaksStartingThisLine) {
1804
- rows.push("");
1805
- }
1806
- wrapWord(rows, word, columns);
1807
- continue;
1808
- }
1809
- if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
1810
- if (options.wordWrap === false && rowLength < columns) {
1811
- wrapWord(rows, word, columns);
1812
- continue;
1813
- }
1814
- rows.push("");
1815
- }
1816
- if (rowLength + lengths[index] > columns && options.wordWrap === false) {
1817
- wrapWord(rows, word, columns);
1818
- continue;
1819
- }
1820
- rows[rows.length - 1] += word;
1821
- }
1822
- if (options.trim !== false) {
1823
- rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
1824
- }
1825
- const preString = rows.join("\n");
1826
- const pre = [...preString];
1827
- let preStringIndex = 0;
1828
- for (const [index, character] of pre.entries()) {
1829
- returnValue += character;
1830
- if (ESCAPES.has(character)) {
1831
- const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(preString.slice(preStringIndex)) || { groups: {} };
1832
- if (groups.code !== void 0) {
1833
- const code2 = Number.parseFloat(groups.code);
1834
- escapeCode = code2 === END_CODE ? void 0 : code2;
1835
- } else if (groups.uri !== void 0) {
1836
- escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
1837
- }
1838
- }
1839
- const code = ansi_styles_default.codes.get(Number(escapeCode));
1840
- if (pre[index + 1] === "\n") {
1841
- if (escapeUrl) {
1842
- returnValue += wrapAnsiHyperlink("");
1843
- }
1844
- if (escapeCode && code) {
1845
- returnValue += wrapAnsiCode(code);
1846
- }
1847
- } else if (character === "\n") {
1848
- if (escapeCode && code) {
1849
- returnValue += wrapAnsiCode(escapeCode);
1850
- }
1851
- if (escapeUrl) {
1852
- returnValue += wrapAnsiHyperlink(escapeUrl);
1853
- }
1854
- }
1855
- preStringIndex += character.length;
1856
- }
1857
- return returnValue;
1858
- }, "exec");
1859
- __name(wrapAnsi, "wrapAnsi");
1860
- }
1861
- });
1862
-
1863
- // node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/utils.js
1864
- var require_utils = __commonJS({
1865
- "node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/utils.js"(exports2) {
1866
- "use strict";
1867
- var __importDefault = exports2 && exports2.__importDefault || function(mod) {
1868
- return mod && mod.__esModule ? mod : { "default": mod };
1869
- };
1870
- Object.defineProperty(exports2, "__esModule", { value: true });
1871
- exports2.breakLines = breakLines;
1872
- exports2.readlineWidth = readlineWidth;
1873
- var cli_width_1 = __importDefault(require_cli_width());
1874
- var wrap_ansi_1 = __importDefault((init_wrap_ansi(), __toCommonJS(wrap_ansi_exports)));
1875
- var hook_engine_ts_1 = require_hook_engine();
1876
- function breakLines(content, width) {
1877
- return content.split("\n").flatMap((line) => (0, wrap_ansi_1.default)(line, width, { trim: false, hard: true }).split("\n").map((str) => str.trimEnd())).join("\n");
1878
- }
1879
- __name(breakLines, "breakLines");
1880
- function readlineWidth() {
1881
- return (0, cli_width_1.default)({ defaultWidth: 80, output: (0, hook_engine_ts_1.readline)().output });
1882
- }
1883
- __name(readlineWidth, "readlineWidth");
1884
- }
1885
- });
1886
-
1887
- // node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/pagination/use-pagination.js
1888
- var require_use_pagination = __commonJS({
1889
- "node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/pagination/use-pagination.js"(exports2) {
1890
- "use strict";
1891
- Object.defineProperty(exports2, "__esModule", { value: true });
1892
- exports2.usePagination = usePagination;
1893
- var use_ref_ts_1 = require_use_ref();
1894
- var utils_ts_1 = require_utils();
1895
- function usePointerPosition({ active, renderedItems, pageSize, loop }) {
1896
- const state = (0, use_ref_ts_1.useRef)({
1897
- lastPointer: active,
1898
- lastActive: void 0
1899
- });
1900
- const { lastPointer, lastActive } = state.current;
1901
- const middle = Math.floor(pageSize / 2);
1902
- const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
1903
- const defaultPointerPosition = renderedItems.slice(0, active).reduce((acc, item) => acc + item.length, 0);
1904
- let pointer = defaultPointerPosition;
1905
- if (renderedLength > pageSize) {
1906
- if (loop) {
1907
- pointer = lastPointer;
1908
- if (
1909
- // First render, skip this logic.
1910
- lastActive != null && // Only move the pointer down when the user moves down.
1911
- lastActive < active && // Check user didn't move up across page boundary.
1912
- active - lastActive < pageSize
1913
- ) {
1914
- pointer = Math.min(
1915
- // Furthest allowed position for the pointer is the middle of the list
1916
- middle,
1917
- Math.abs(active - lastActive) === 1 ? Math.min(
1918
- // Move the pointer at most the height of the last active item.
1919
- lastPointer + (renderedItems[lastActive]?.length ?? 0),
1920
- // If the user moved by one item, move the pointer to the natural position of the active item as
1921
- // long as it doesn't move the cursor up.
1922
- Math.max(defaultPointerPosition, lastPointer)
1923
- ) : (
1924
- // Otherwise, move the pointer down by the difference between the active and last active item.
1925
- lastPointer + active - lastActive
1926
- )
1927
- );
1928
- }
1929
- } else {
1930
- const spaceUnderActive = renderedItems.slice(active).reduce((acc, item) => acc + item.length, 0);
1931
- pointer = spaceUnderActive < pageSize - middle ? (
1932
- // If the active item is near the end of the list, progressively move the cursor towards the end.
1933
- pageSize - spaceUnderActive
1934
- ) : (
1935
- // Otherwise, progressively move the pointer to the middle of the list.
1936
- Math.min(defaultPointerPosition, middle)
1937
- );
1938
- }
1939
- }
1940
- state.current.lastPointer = pointer;
1941
- state.current.lastActive = active;
1942
- return pointer;
1943
- }
1944
- __name(usePointerPosition, "usePointerPosition");
1945
- function usePagination({ items, active, renderItem, pageSize, loop = true }) {
1946
- const width = (0, utils_ts_1.readlineWidth)();
1947
- const bound = /* @__PURE__ */ __name((num) => (num % items.length + items.length) % items.length, "bound");
1948
- const renderedItems = items.map((item, index) => {
1949
- if (item == null)
1950
- return [];
1951
- return (0, utils_ts_1.breakLines)(renderItem({ item, index, isActive: index === active }), width).split("\n");
1952
- });
1953
- const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
1954
- const renderItemAtIndex = /* @__PURE__ */ __name((index) => renderedItems[index] ?? [], "renderItemAtIndex");
1955
- const pointer = usePointerPosition({ active, renderedItems, pageSize, loop });
1956
- const activeItem = renderItemAtIndex(active).slice(0, pageSize);
1957
- const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length;
1958
- const pageBuffer = Array.from({ length: pageSize });
1959
- pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem);
1960
- const itemVisited = /* @__PURE__ */ new Set([active]);
1961
- let bufferPointer = activeItemPosition + activeItem.length;
1962
- let itemPointer = bound(active + 1);
1963
- while (bufferPointer < pageSize && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) {
1964
- const lines = renderItemAtIndex(itemPointer);
1965
- const linesToAdd = lines.slice(0, pageSize - bufferPointer);
1966
- pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd);
1967
- itemVisited.add(itemPointer);
1968
- bufferPointer += linesToAdd.length;
1969
- itemPointer = bound(itemPointer + 1);
1970
- }
1971
- bufferPointer = activeItemPosition - 1;
1972
- itemPointer = bound(active - 1);
1973
- while (bufferPointer >= 0 && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) {
1974
- const lines = renderItemAtIndex(itemPointer);
1975
- const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1));
1976
- pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd);
1977
- itemVisited.add(itemPointer);
1978
- bufferPointer -= linesToAdd.length;
1979
- itemPointer = bound(itemPointer - 1);
1980
- }
1981
- return pageBuffer.filter((line) => typeof line === "string").join("\n");
1982
- }
1983
- __name(usePagination, "usePagination");
1984
- }
1985
- });
1986
-
1987
- // node_modules/.pnpm/mute-stream@3.0.0/node_modules/mute-stream/lib/index.js
1988
- var require_lib = __commonJS({
1989
- "node_modules/.pnpm/mute-stream@3.0.0/node_modules/mute-stream/lib/index.js"(exports2, module2) {
1990
- var Stream = require("stream");
1991
- var MuteStream = class extends Stream {
1992
- static {
1993
- __name(this, "MuteStream");
1994
- }
1995
- #isTTY = null;
1996
- constructor(opts = {}) {
1997
- super(opts);
1998
- this.writable = this.readable = true;
1999
- this.muted = false;
2000
- this.on("pipe", this._onpipe);
2001
- this.replace = opts.replace;
2002
- this._prompt = opts.prompt || null;
2003
- this._hadControl = false;
2004
- }
2005
- #destSrc(key, def) {
2006
- if (this._dest) {
2007
- return this._dest[key];
2008
- }
2009
- if (this._src) {
2010
- return this._src[key];
2011
- }
2012
- return def;
2013
- }
2014
- #proxy(method, ...args) {
2015
- if (typeof this._dest?.[method] === "function") {
2016
- this._dest[method](...args);
2017
- }
2018
- if (typeof this._src?.[method] === "function") {
2019
- this._src[method](...args);
2020
- }
2021
- }
2022
- get isTTY() {
2023
- if (this.#isTTY !== null) {
2024
- return this.#isTTY;
2025
- }
2026
- return this.#destSrc("isTTY", false);
2027
- }
2028
- // basically just get replace the getter/setter with a regular value
2029
- set isTTY(val) {
2030
- this.#isTTY = val;
2031
- }
2032
- get rows() {
2033
- return this.#destSrc("rows");
2034
- }
2035
- get columns() {
2036
- return this.#destSrc("columns");
2037
- }
2038
- mute() {
2039
- this.muted = true;
2040
- }
2041
- unmute() {
2042
- this.muted = false;
2043
- }
2044
- _onpipe(src) {
2045
- this._src = src;
2046
- }
2047
- pipe(dest, options) {
2048
- this._dest = dest;
2049
- return super.pipe(dest, options);
2050
- }
2051
- pause() {
2052
- if (this._src) {
2053
- return this._src.pause();
2054
- }
2055
- }
2056
- resume() {
2057
- if (this._src) {
2058
- return this._src.resume();
2059
- }
2060
- }
2061
- write(c) {
2062
- if (this.muted) {
2063
- if (!this.replace) {
2064
- return true;
2065
- }
2066
- if (c.match(/^\u001b/)) {
2067
- if (c.indexOf(this._prompt) === 0) {
2068
- c = c.slice(this._prompt.length);
2069
- c = c.replace(/./g, this.replace);
2070
- c = this._prompt + c;
2071
- }
2072
- this._hadControl = true;
2073
- return this.emit("data", c);
2074
- } else {
2075
- if (this._prompt && this._hadControl && c.indexOf(this._prompt) === 0) {
2076
- this._hadControl = false;
2077
- this.emit("data", this._prompt);
2078
- c = c.slice(this._prompt.length);
2079
- }
2080
- c = c.toString().replace(/./g, this.replace);
2081
- }
2082
- }
2083
- this.emit("data", c);
2084
- }
2085
- end(c) {
2086
- if (this.muted) {
2087
- if (c && this.replace) {
2088
- c = c.toString().replace(/./g, this.replace);
2089
- } else {
2090
- c = null;
2091
- }
2092
- }
2093
- if (c) {
2094
- this.emit("data", c);
2095
- }
2096
- this.emit("end");
2097
- }
2098
- destroy(...args) {
2099
- return this.#proxy("destroy", ...args);
2100
- }
2101
- destroySoon(...args) {
2102
- return this.#proxy("destroySoon", ...args);
2103
- }
2104
- close(...args) {
2105
- return this.#proxy("close", ...args);
2106
- }
2107
- };
2108
- module2.exports = MuteStream;
2109
- }
2110
- });
2111
-
2112
- // node_modules/.pnpm/@inquirer+ansi@1.0.2/node_modules/@inquirer/ansi/dist/commonjs/index.js
2113
- var require_commonjs2 = __commonJS({
2114
- "node_modules/.pnpm/@inquirer+ansi@1.0.2/node_modules/@inquirer/ansi/dist/commonjs/index.js"(exports2) {
2115
- "use strict";
2116
- Object.defineProperty(exports2, "__esModule", { value: true });
2117
- exports2.eraseLines = exports2.cursorTo = exports2.cursorDown = exports2.cursorUp = exports2.cursorShow = exports2.cursorHide = exports2.cursorLeft = void 0;
2118
- var ESC = "\x1B[";
2119
- exports2.cursorLeft = ESC + "G";
2120
- exports2.cursorHide = ESC + "?25l";
2121
- exports2.cursorShow = ESC + "?25h";
2122
- var cursorUp = /* @__PURE__ */ __name((rows = 1) => rows > 0 ? `${ESC}${rows}A` : "", "cursorUp");
2123
- exports2.cursorUp = cursorUp;
2124
- var cursorDown = /* @__PURE__ */ __name((rows = 1) => rows > 0 ? `${ESC}${rows}B` : "", "cursorDown");
2125
- exports2.cursorDown = cursorDown;
2126
- var cursorTo = /* @__PURE__ */ __name((x, y) => {
2127
- if (typeof y === "number" && !Number.isNaN(y)) {
2128
- return `${ESC}${y + 1};${x + 1}H`;
2129
- }
2130
- return `${ESC}${x + 1}G`;
2131
- }, "cursorTo");
2132
- exports2.cursorTo = cursorTo;
2133
- var eraseLine = ESC + "2K";
2134
- var eraseLines = /* @__PURE__ */ __name((lines) => lines > 0 ? (eraseLine + (0, exports2.cursorUp)(1)).repeat(lines - 1) + eraseLine + exports2.cursorLeft : "", "eraseLines");
2135
- exports2.eraseLines = eraseLines;
2136
- }
2137
- });
2138
-
2139
- // node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/screen-manager.js
2140
- var require_screen_manager = __commonJS({
2141
- "node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/screen-manager.js"(exports2) {
2142
- "use strict";
2143
- Object.defineProperty(exports2, "__esModule", { value: true });
2144
- var node_util_1 = require("node:util");
2145
- var utils_ts_1 = require_utils();
2146
- var ansi_1 = require_commonjs2();
2147
- var height = /* @__PURE__ */ __name((content) => content.split("\n").length, "height");
2148
- var lastLine = /* @__PURE__ */ __name((content) => content.split("\n").pop() ?? "", "lastLine");
2149
- var ScreenManager = class {
2150
- static {
2151
- __name(this, "ScreenManager");
2152
- }
2153
- // These variables are keeping information to allow correct prompt re-rendering
2154
- height = 0;
2155
- extraLinesUnderPrompt = 0;
2156
- cursorPos;
2157
- rl;
2158
- constructor(rl) {
2159
- this.rl = rl;
2160
- this.cursorPos = rl.getCursorPos();
2161
- }
2162
- write(content) {
2163
- this.rl.output.unmute();
2164
- this.rl.output.write(content);
2165
- this.rl.output.mute();
2166
- }
2167
- render(content, bottomContent = "") {
2168
- const promptLine = lastLine(content);
2169
- const rawPromptLine = (0, node_util_1.stripVTControlCharacters)(promptLine);
2170
- let prompt = rawPromptLine;
2171
- if (this.rl.line.length > 0) {
2172
- prompt = prompt.slice(0, -this.rl.line.length);
2173
- }
2174
- this.rl.setPrompt(prompt);
2175
- this.cursorPos = this.rl.getCursorPos();
2176
- const width = (0, utils_ts_1.readlineWidth)();
2177
- content = (0, utils_ts_1.breakLines)(content, width);
2178
- bottomContent = (0, utils_ts_1.breakLines)(bottomContent, width);
2179
- if (rawPromptLine.length % width === 0) {
2180
- content += "\n";
2181
- }
2182
- let output = content + (bottomContent ? "\n" + bottomContent : "");
2183
- const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;
2184
- const bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0);
2185
- if (bottomContentHeight > 0)
2186
- output += (0, ansi_1.cursorUp)(bottomContentHeight);
2187
- output += (0, ansi_1.cursorTo)(this.cursorPos.cols);
2188
- this.write((0, ansi_1.cursorDown)(this.extraLinesUnderPrompt) + (0, ansi_1.eraseLines)(this.height) + output);
2189
- this.extraLinesUnderPrompt = bottomContentHeight;
2190
- this.height = height(output);
2191
- }
2192
- checkCursorPos() {
2193
- const cursorPos = this.rl.getCursorPos();
2194
- if (cursorPos.cols !== this.cursorPos.cols) {
2195
- this.write((0, ansi_1.cursorTo)(cursorPos.cols));
2196
- this.cursorPos = cursorPos;
2197
- }
2198
- }
2199
- done({ clearContent }) {
2200
- this.rl.setPrompt("");
2201
- let output = (0, ansi_1.cursorDown)(this.extraLinesUnderPrompt);
2202
- output += clearContent ? (0, ansi_1.eraseLines)(this.height) : "\n";
2203
- output += ansi_1.cursorShow;
2204
- this.write(output);
2205
- this.rl.close();
2206
- }
2207
- };
2208
- exports2.default = ScreenManager;
2209
- }
2210
- });
2211
-
2212
- // node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/promise-polyfill.js
2213
- var require_promise_polyfill = __commonJS({
2214
- "node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/promise-polyfill.js"(exports2) {
2215
- "use strict";
2216
- Object.defineProperty(exports2, "__esModule", { value: true });
2217
- exports2.PromisePolyfill = void 0;
2218
- var PromisePolyfill = class extends Promise {
2219
- static {
2220
- __name(this, "PromisePolyfill");
2221
- }
2222
- // Available starting from Node 22
2223
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers
2224
- static withResolver() {
2225
- let resolve;
2226
- let reject;
2227
- const promise = new Promise((res, rej) => {
2228
- resolve = res;
2229
- reject = rej;
2230
- });
2231
- return { promise, resolve, reject };
2232
- }
2233
- };
2234
- exports2.PromisePolyfill = PromisePolyfill;
2235
- }
2236
- });
2237
-
2238
- // node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/create-prompt.js
2239
- var require_create_prompt = __commonJS({
2240
- "node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/create-prompt.js"(exports2) {
2241
- "use strict";
2242
- var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
2243
- if (k2 === void 0) k2 = k;
2244
- var desc = Object.getOwnPropertyDescriptor(m, k);
2245
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
2246
- desc = { enumerable: true, get: /* @__PURE__ */ __name(function() {
2247
- return m[k];
2248
- }, "get") };
2249
- }
2250
- Object.defineProperty(o, k2, desc);
2251
- }) : (function(o, m, k, k2) {
2252
- if (k2 === void 0) k2 = k;
2253
- o[k2] = m[k];
2254
- }));
2255
- var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
2256
- Object.defineProperty(o, "default", { enumerable: true, value: v });
2257
- }) : function(o, v) {
2258
- o["default"] = v;
2259
- });
2260
- var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
2261
- var ownKeys = /* @__PURE__ */ __name(function(o) {
2262
- ownKeys = Object.getOwnPropertyNames || function(o2) {
2263
- var ar = [];
2264
- for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
2265
- return ar;
2266
- };
2267
- return ownKeys(o);
2268
- }, "ownKeys");
2269
- return function(mod) {
2270
- if (mod && mod.__esModule) return mod;
2271
- var result = {};
2272
- if (mod != null) {
2273
- for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
2274
- }
2275
- __setModuleDefault(result, mod);
2276
- return result;
2277
- };
2278
- })();
2279
- var __importDefault = exports2 && exports2.__importDefault || function(mod) {
2280
- return mod && mod.__esModule ? mod : { "default": mod };
2281
- };
2282
- Object.defineProperty(exports2, "__esModule", { value: true });
2283
- exports2.createPrompt = createPrompt;
2284
- var readline = __importStar(require("node:readline"));
2285
- var node_async_hooks_1 = require("node:async_hooks");
2286
- var mute_stream_1 = __importDefault(require_lib());
2287
- var signal_exit_1 = require_cjs();
2288
- var screen_manager_ts_1 = __importDefault(require_screen_manager());
2289
- var promise_polyfill_ts_1 = require_promise_polyfill();
2290
- var hook_engine_ts_1 = require_hook_engine();
2291
- var errors_ts_1 = require_errors();
2292
- function getCallSites() {
2293
- const _prepareStackTrace = Error.prepareStackTrace;
2294
- let result = [];
2295
- try {
2296
- Error.prepareStackTrace = (_, callSites) => {
2297
- const callSitesWithoutCurrent = callSites.slice(1);
2298
- result = callSitesWithoutCurrent;
2299
- return callSitesWithoutCurrent;
2300
- };
2301
- new Error().stack;
2302
- } catch {
2303
- return result;
2304
- }
2305
- Error.prepareStackTrace = _prepareStackTrace;
2306
- return result;
2307
- }
2308
- __name(getCallSites, "getCallSites");
2309
- function createPrompt(view) {
2310
- const callSites = getCallSites();
2311
- const prompt = /* @__PURE__ */ __name((config, context = {}) => {
2312
- const { input: input2 = process.stdin, signal } = context;
2313
- const cleanups = /* @__PURE__ */ new Set();
2314
- const output = new mute_stream_1.default();
2315
- output.pipe(context.output ?? process.stdout);
2316
- const rl = readline.createInterface({
2317
- terminal: true,
2318
- input: input2,
2319
- output
2320
- });
2321
- const screen = new screen_manager_ts_1.default(rl);
2322
- const { promise, resolve, reject } = promise_polyfill_ts_1.PromisePolyfill.withResolver();
2323
- const cancel = /* @__PURE__ */ __name(() => reject(new errors_ts_1.CancelPromptError()), "cancel");
2324
- if (signal) {
2325
- const abort = /* @__PURE__ */ __name(() => reject(new errors_ts_1.AbortPromptError({ cause: signal.reason })), "abort");
2326
- if (signal.aborted) {
2327
- abort();
2328
- return Object.assign(promise, { cancel });
2329
- }
2330
- signal.addEventListener("abort", abort);
2331
- cleanups.add(() => signal.removeEventListener("abort", abort));
2332
- }
2333
- cleanups.add((0, signal_exit_1.onExit)((code, signal2) => {
2334
- reject(new errors_ts_1.ExitPromptError(`User force closed the prompt with ${code} ${signal2}`));
2335
- }));
2336
- const sigint = /* @__PURE__ */ __name(() => reject(new errors_ts_1.ExitPromptError(`User force closed the prompt with SIGINT`)), "sigint");
2337
- rl.on("SIGINT", sigint);
2338
- cleanups.add(() => rl.removeListener("SIGINT", sigint));
2339
- const checkCursorPos = /* @__PURE__ */ __name(() => screen.checkCursorPos(), "checkCursorPos");
2340
- rl.input.on("keypress", checkCursorPos);
2341
- cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
2342
- return (0, hook_engine_ts_1.withHooks)(rl, (cycle) => {
2343
- const hooksCleanup = node_async_hooks_1.AsyncResource.bind(() => hook_engine_ts_1.effectScheduler.clearAll());
2344
- rl.on("close", hooksCleanup);
2345
- cleanups.add(() => rl.removeListener("close", hooksCleanup));
2346
- cycle(() => {
2347
- try {
2348
- const nextView = view(config, (value) => {
2349
- setImmediate(() => resolve(value));
2350
- });
2351
- if (nextView === void 0) {
2352
- const callerFilename = callSites[1]?.getFileName();
2353
- throw new Error(`Prompt functions must return a string.
2354
- at ${callerFilename}`);
2355
- }
2356
- const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
2357
- screen.render(content, bottomContent);
2358
- hook_engine_ts_1.effectScheduler.run();
2359
- } catch (error) {
2360
- reject(error);
2361
- }
2362
- });
2363
- return Object.assign(promise.then((answer) => {
2364
- hook_engine_ts_1.effectScheduler.clearAll();
2365
- return answer;
2366
- }, (error) => {
2367
- hook_engine_ts_1.effectScheduler.clearAll();
2368
- throw error;
2369
- }).finally(() => {
2370
- cleanups.forEach((cleanup) => cleanup());
2371
- screen.done({ clearContent: Boolean(context.clearPromptOnDone) });
2372
- output.end();
2373
- }).then(() => promise), { cancel });
2374
- });
2375
- }, "prompt");
2376
- return prompt;
2377
- }
2378
- __name(createPrompt, "createPrompt");
2379
- }
2380
- });
2381
-
2382
- // node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/Separator.js
2383
- var require_Separator = __commonJS({
2384
- "node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/lib/Separator.js"(exports2) {
2385
- "use strict";
2386
- var __importDefault = exports2 && exports2.__importDefault || function(mod) {
2387
- return mod && mod.__esModule ? mod : { "default": mod };
2388
- };
2389
- Object.defineProperty(exports2, "__esModule", { value: true });
2390
- exports2.Separator = void 0;
2391
- var yoctocolors_cjs_1 = __importDefault(require_yoctocolors_cjs());
2392
- var figures_1 = __importDefault(require_commonjs());
2393
- var Separator = class {
2394
- static {
2395
- __name(this, "Separator");
2396
- }
2397
- separator = yoctocolors_cjs_1.default.dim(Array.from({ length: 15 }).join(figures_1.default.line));
2398
- type = "separator";
2399
- constructor(separator) {
2400
- if (separator) {
2401
- this.separator = separator;
2402
- }
2403
- }
2404
- static isSeparator(choice) {
2405
- return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
2406
- }
2407
- };
2408
- exports2.Separator = Separator;
2409
- }
2410
- });
2411
-
2412
- // node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/index.js
2413
- var require_commonjs3 = __commonJS({
2414
- "node_modules/.pnpm/@inquirer+core@10.3.1_@types+node@24.9.2/node_modules/@inquirer/core/dist/commonjs/index.js"(exports2) {
2415
- "use strict";
2416
- var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
2417
- if (k2 === void 0) k2 = k;
2418
- var desc = Object.getOwnPropertyDescriptor(m, k);
2419
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
2420
- desc = { enumerable: true, get: /* @__PURE__ */ __name(function() {
2421
- return m[k];
2422
- }, "get") };
2423
- }
2424
- Object.defineProperty(o, k2, desc);
2425
- }) : (function(o, m, k, k2) {
2426
- if (k2 === void 0) k2 = k;
2427
- o[k2] = m[k];
2428
- }));
2429
- var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
2430
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
2431
- };
2432
- Object.defineProperty(exports2, "__esModule", { value: true });
2433
- exports2.Separator = exports2.createPrompt = exports2.usePagination = exports2.makeTheme = exports2.useKeypress = exports2.useRef = exports2.useMemo = exports2.useEffect = exports2.useState = exports2.usePrefix = exports2.isEnterKey = exports2.isNumberKey = exports2.isTabKey = exports2.isBackspaceKey = exports2.isSpaceKey = exports2.isDownKey = exports2.isUpKey = void 0;
2434
- var key_ts_1 = require_key();
2435
- Object.defineProperty(exports2, "isUpKey", { enumerable: true, get: /* @__PURE__ */ __name(function() {
2436
- return key_ts_1.isUpKey;
2437
- }, "get") });
2438
- Object.defineProperty(exports2, "isDownKey", { enumerable: true, get: /* @__PURE__ */ __name(function() {
2439
- return key_ts_1.isDownKey;
2440
- }, "get") });
2441
- Object.defineProperty(exports2, "isSpaceKey", { enumerable: true, get: /* @__PURE__ */ __name(function() {
2442
- return key_ts_1.isSpaceKey;
2443
- }, "get") });
2444
- Object.defineProperty(exports2, "isBackspaceKey", { enumerable: true, get: /* @__PURE__ */ __name(function() {
2445
- return key_ts_1.isBackspaceKey;
2446
- }, "get") });
2447
- Object.defineProperty(exports2, "isTabKey", { enumerable: true, get: /* @__PURE__ */ __name(function() {
2448
- return key_ts_1.isTabKey;
2449
- }, "get") });
2450
- Object.defineProperty(exports2, "isNumberKey", { enumerable: true, get: /* @__PURE__ */ __name(function() {
2451
- return key_ts_1.isNumberKey;
2452
- }, "get") });
2453
- Object.defineProperty(exports2, "isEnterKey", { enumerable: true, get: /* @__PURE__ */ __name(function() {
2454
- return key_ts_1.isEnterKey;
2455
- }, "get") });
2456
- __exportStar(require_errors(), exports2);
2457
- var use_prefix_ts_1 = require_use_prefix();
2458
- Object.defineProperty(exports2, "usePrefix", { enumerable: true, get: /* @__PURE__ */ __name(function() {
2459
- return use_prefix_ts_1.usePrefix;
2460
- }, "get") });
2461
- var use_state_ts_1 = require_use_state();
2462
- Object.defineProperty(exports2, "useState", { enumerable: true, get: /* @__PURE__ */ __name(function() {
2463
- return use_state_ts_1.useState;
2464
- }, "get") });
2465
- var use_effect_ts_1 = require_use_effect();
2466
- Object.defineProperty(exports2, "useEffect", { enumerable: true, get: /* @__PURE__ */ __name(function() {
2467
- return use_effect_ts_1.useEffect;
2468
- }, "get") });
2469
- var use_memo_ts_1 = require_use_memo();
2470
- Object.defineProperty(exports2, "useMemo", { enumerable: true, get: /* @__PURE__ */ __name(function() {
2471
- return use_memo_ts_1.useMemo;
2472
- }, "get") });
2473
- var use_ref_ts_1 = require_use_ref();
2474
- Object.defineProperty(exports2, "useRef", { enumerable: true, get: /* @__PURE__ */ __name(function() {
2475
- return use_ref_ts_1.useRef;
2476
- }, "get") });
2477
- var use_keypress_ts_1 = require_use_keypress();
2478
- Object.defineProperty(exports2, "useKeypress", { enumerable: true, get: /* @__PURE__ */ __name(function() {
2479
- return use_keypress_ts_1.useKeypress;
2480
- }, "get") });
2481
- var make_theme_ts_1 = require_make_theme();
2482
- Object.defineProperty(exports2, "makeTheme", { enumerable: true, get: /* @__PURE__ */ __name(function() {
2483
- return make_theme_ts_1.makeTheme;
2484
- }, "get") });
2485
- var use_pagination_ts_1 = require_use_pagination();
2486
- Object.defineProperty(exports2, "usePagination", { enumerable: true, get: /* @__PURE__ */ __name(function() {
2487
- return use_pagination_ts_1.usePagination;
2488
- }, "get") });
2489
- var create_prompt_ts_1 = require_create_prompt();
2490
- Object.defineProperty(exports2, "createPrompt", { enumerable: true, get: /* @__PURE__ */ __name(function() {
2491
- return create_prompt_ts_1.createPrompt;
2492
- }, "get") });
2493
- var Separator_ts_1 = require_Separator();
2494
- Object.defineProperty(exports2, "Separator", { enumerable: true, get: /* @__PURE__ */ __name(function() {
2495
- return Separator_ts_1.Separator;
2496
- }, "get") });
2497
- }
2498
- });
2499
-
2500
- // node_modules/.pnpm/@inquirer+checkbox@4.3.1_@types+node@24.9.2/node_modules/@inquirer/checkbox/dist/commonjs/index.js
2501
- var require_commonjs4 = __commonJS({
2502
- "node_modules/.pnpm/@inquirer+checkbox@4.3.1_@types+node@24.9.2/node_modules/@inquirer/checkbox/dist/commonjs/index.js"(exports2) {
2503
- "use strict";
2504
- var __importDefault = exports2 && exports2.__importDefault || function(mod) {
2505
- return mod && mod.__esModule ? mod : { "default": mod };
2506
- };
2507
- Object.defineProperty(exports2, "__esModule", { value: true });
2508
- exports2.Separator = void 0;
2509
- var core_1 = require_commonjs3();
2510
- var ansi_1 = require_commonjs2();
2511
- var yoctocolors_cjs_1 = __importDefault(require_yoctocolors_cjs());
2512
- var figures_1 = __importDefault(require_commonjs());
2513
- var checkboxTheme = {
2514
- icon: {
2515
- checked: yoctocolors_cjs_1.default.green(figures_1.default.circleFilled),
2516
- unchecked: figures_1.default.circle,
2517
- cursor: figures_1.default.pointer
2518
- },
2519
- style: {
2520
- disabledChoice: /* @__PURE__ */ __name((text) => yoctocolors_cjs_1.default.dim(`- ${text}`), "disabledChoice"),
2521
- renderSelectedChoices: /* @__PURE__ */ __name((selectedChoices) => selectedChoices.map((choice) => choice.short).join(", "), "renderSelectedChoices"),
2522
- description: /* @__PURE__ */ __name((text) => yoctocolors_cjs_1.default.cyan(text), "description"),
2523
- keysHelpTip: /* @__PURE__ */ __name((keys) => keys.map(([key, action]) => `${yoctocolors_cjs_1.default.bold(key)} ${yoctocolors_cjs_1.default.dim(action)}`).join(yoctocolors_cjs_1.default.dim(" • ")), "keysHelpTip")
2524
- },
2525
- helpMode: "always",
2526
- keybindings: []
2527
- };
2528
- function isSelectable(item) {
2529
- return !core_1.Separator.isSeparator(item) && !item.disabled;
2530
- }
2531
- __name(isSelectable, "isSelectable");
2532
- function isChecked(item) {
2533
- return isSelectable(item) && item.checked;
2534
- }
2535
- __name(isChecked, "isChecked");
2536
- function toggle(item) {
2537
- return isSelectable(item) ? { ...item, checked: !item.checked } : item;
2538
- }
2539
- __name(toggle, "toggle");
2540
- function check(checked) {
2541
- return function(item) {
2542
- return isSelectable(item) ? { ...item, checked } : item;
2543
- };
2544
- }
2545
- __name(check, "check");
2546
- function normalizeChoices(choices) {
2547
- return choices.map((choice) => {
2548
- if (core_1.Separator.isSeparator(choice))
2549
- return choice;
2550
- if (typeof choice === "string") {
2551
- return {
2552
- value: choice,
2553
- name: choice,
2554
- short: choice,
2555
- checkedName: choice,
2556
- disabled: false,
2557
- checked: false
2558
- };
2559
- }
2560
- const name = choice.name ?? String(choice.value);
2561
- const normalizedChoice = {
2562
- value: choice.value,
2563
- name,
2564
- short: choice.short ?? name,
2565
- checkedName: choice.checkedName ?? name,
2566
- disabled: choice.disabled ?? false,
2567
- checked: choice.checked ?? false
2568
- };
2569
- if (choice.description) {
2570
- normalizedChoice.description = choice.description;
2571
- }
2572
- return normalizedChoice;
2573
- });
2574
- }
2575
- __name(normalizeChoices, "normalizeChoices");
2576
- exports2.default = (0, core_1.createPrompt)((config, done) => {
2577
- const {
2578
- // eslint-disable-next-line @typescript-eslint/no-deprecated
2579
- instructions,
2580
- pageSize = 7,
2581
- loop = true,
2582
- required,
2583
- validate: validate2 = /* @__PURE__ */ __name(() => true, "validate")
2584
- } = config;
2585
- const shortcuts = { all: "a", invert: "i", ...config.shortcuts };
2586
- const theme = (0, core_1.makeTheme)(checkboxTheme, config.theme);
2587
- const { keybindings } = theme;
2588
- const [status, setStatus] = (0, core_1.useState)("idle");
2589
- const prefix = (0, core_1.usePrefix)({ status, theme });
2590
- const [items, setItems] = (0, core_1.useState)(normalizeChoices(config.choices));
2591
- const bounds = (0, core_1.useMemo)(() => {
2592
- const first = items.findIndex(isSelectable);
2593
- const last = items.findLastIndex(isSelectable);
2594
- if (first === -1) {
2595
- throw new core_1.ValidationError("[checkbox prompt] No selectable choices. All choices are disabled.");
2596
- }
2597
- return { first, last };
2598
- }, [items]);
2599
- const [active, setActive] = (0, core_1.useState)(bounds.first);
2600
- const [errorMsg, setError] = (0, core_1.useState)();
2601
- (0, core_1.useKeypress)(async (key) => {
2602
- if ((0, core_1.isEnterKey)(key)) {
2603
- const selection = items.filter(isChecked);
2604
- const isValid = await validate2([...selection]);
2605
- if (required && !items.some(isChecked)) {
2606
- setError("At least one choice must be selected");
2607
- } else if (isValid === true) {
2608
- setStatus("done");
2609
- done(selection.map((choice) => choice.value));
2610
- } else {
2611
- setError(isValid || "You must select a valid value");
2612
- }
2613
- } else if ((0, core_1.isUpKey)(key, keybindings) || (0, core_1.isDownKey)(key, keybindings)) {
2614
- if (loop || (0, core_1.isUpKey)(key, keybindings) && active !== bounds.first || (0, core_1.isDownKey)(key, keybindings) && active !== bounds.last) {
2615
- const offset = (0, core_1.isUpKey)(key, keybindings) ? -1 : 1;
2616
- let next = active;
2617
- do {
2618
- next = (next + offset + items.length) % items.length;
2619
- } while (!isSelectable(items[next]));
2620
- setActive(next);
2621
- }
2622
- } else if ((0, core_1.isSpaceKey)(key)) {
2623
- setError(void 0);
2624
- setItems(items.map((choice, i) => i === active ? toggle(choice) : choice));
2625
- } else if (key.name === shortcuts.all) {
2626
- const selectAll = items.some((choice) => isSelectable(choice) && !choice.checked);
2627
- setItems(items.map(check(selectAll)));
2628
- } else if (key.name === shortcuts.invert) {
2629
- setItems(items.map(toggle));
2630
- } else if ((0, core_1.isNumberKey)(key)) {
2631
- const selectedIndex = Number(key.name) - 1;
2632
- let selectableIndex = -1;
2633
- const position = items.findIndex((item) => {
2634
- if (core_1.Separator.isSeparator(item))
2635
- return false;
2636
- selectableIndex++;
2637
- return selectableIndex === selectedIndex;
2638
- });
2639
- const selectedItem = items[position];
2640
- if (selectedItem && isSelectable(selectedItem)) {
2641
- setActive(position);
2642
- setItems(items.map((choice, i) => i === position ? toggle(choice) : choice));
2643
- }
2644
- }
2645
- });
2646
- const message = theme.style.message(config.message, status);
2647
- let description;
2648
- const page = (0, core_1.usePagination)({
2649
- items,
2650
- active,
2651
- renderItem({ item, isActive }) {
2652
- if (core_1.Separator.isSeparator(item)) {
2653
- return ` ${item.separator}`;
2654
- }
2655
- if (item.disabled) {
2656
- const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
2657
- return theme.style.disabledChoice(`${item.name} ${disabledLabel}`);
2658
- }
2659
- if (isActive) {
2660
- description = item.description;
2661
- }
2662
- const checkbox2 = item.checked ? theme.icon.checked : theme.icon.unchecked;
2663
- const name = item.checked ? item.checkedName : item.name;
2664
- const color = isActive ? theme.style.highlight : (x) => x;
2665
- const cursor = isActive ? theme.icon.cursor : " ";
2666
- return color(`${cursor}${checkbox2} ${name}`);
2667
- },
2668
- pageSize,
2669
- loop
2670
- });
2671
- if (status === "done") {
2672
- const selection = items.filter(isChecked);
2673
- const answer = theme.style.answer(theme.style.renderSelectedChoices(selection, items));
2674
- return [prefix, message, answer].filter(Boolean).join(" ");
2675
- }
2676
- let helpLine;
2677
- if (theme.helpMode !== "never" && instructions !== false) {
2678
- if (typeof instructions === "string") {
2679
- helpLine = instructions;
2680
- } else {
2681
- const keys = [
2682
- ["↑↓", "navigate"],
2683
- ["space", "select"]
2684
- ];
2685
- if (shortcuts.all)
2686
- keys.push([shortcuts.all, "all"]);
2687
- if (shortcuts.invert)
2688
- keys.push([shortcuts.invert, "invert"]);
2689
- keys.push(["⏎", "submit"]);
2690
- helpLine = theme.style.keysHelpTip(keys);
2691
- }
2692
- }
2693
- const lines = [
2694
- [prefix, message].filter(Boolean).join(" "),
2695
- page,
2696
- " ",
2697
- description ? theme.style.description(description) : "",
2698
- errorMsg ? theme.style.error(errorMsg) : "",
2699
- helpLine
2700
- ].filter(Boolean).join("\n").trimEnd();
2701
- return `${lines}${ansi_1.cursorHide}`;
2702
- });
2703
- var core_2 = require_commonjs3();
2704
- Object.defineProperty(exports2, "Separator", { enumerable: true, get: /* @__PURE__ */ __name(function() {
2705
- return core_2.Separator;
2706
- }, "get") });
2707
- }
2708
- });
2709
-
2710
- // node_modules/.pnpm/@inquirer+confirm@5.1.16_@types+node@24.9.2/node_modules/@inquirer/confirm/dist/commonjs/index.js
2711
- var require_commonjs5 = __commonJS({
2712
- "node_modules/.pnpm/@inquirer+confirm@5.1.16_@types+node@24.9.2/node_modules/@inquirer/confirm/dist/commonjs/index.js"(exports2) {
2713
- "use strict";
2714
- Object.defineProperty(exports2, "__esModule", { value: true });
2715
- var core_1 = require_commonjs3();
2716
- function getBooleanValue(value, defaultValue) {
2717
- let answer = defaultValue !== false;
2718
- if (/^(y|yes)/i.test(value))
2719
- answer = true;
2720
- else if (/^(n|no)/i.test(value))
2721
- answer = false;
2722
- return answer;
2723
- }
2724
- __name(getBooleanValue, "getBooleanValue");
2725
- function boolToString(value) {
2726
- return value ? "Yes" : "No";
2727
- }
2728
- __name(boolToString, "boolToString");
2729
- exports2.default = (0, core_1.createPrompt)((config, done) => {
2730
- const { transformer = boolToString } = config;
2731
- const [status, setStatus] = (0, core_1.useState)("idle");
2732
- const [value, setValue] = (0, core_1.useState)("");
2733
- const theme = (0, core_1.makeTheme)(config.theme);
2734
- const prefix = (0, core_1.usePrefix)({ status, theme });
2735
- (0, core_1.useKeypress)((key, rl) => {
2736
- if (status !== "idle")
2737
- return;
2738
- if ((0, core_1.isEnterKey)(key)) {
2739
- const answer = getBooleanValue(value, config.default);
2740
- setValue(transformer(answer));
2741
- setStatus("done");
2742
- done(answer);
2743
- } else if ((0, core_1.isTabKey)(key)) {
2744
- const answer = boolToString(!getBooleanValue(value, config.default));
2745
- rl.clearLine(0);
2746
- rl.write(answer);
2747
- setValue(answer);
2748
- } else {
2749
- setValue(rl.line);
2750
- }
2751
- });
2752
- let formattedValue = value;
2753
- let defaultValue = "";
2754
- if (status === "done") {
2755
- formattedValue = theme.style.answer(value);
2756
- } else {
2757
- defaultValue = ` ${theme.style.defaultAnswer(config.default === false ? "y/N" : "Y/n")}`;
2758
- }
2759
- const message = theme.style.message(config.message, status);
2760
- return `${prefix} ${message}${defaultValue} ${formattedValue}`;
2761
- });
2762
- }
2763
- });
2764
-
2765
- // node_modules/.pnpm/@inquirer+input@4.2.2_@types+node@24.9.2/node_modules/@inquirer/input/dist/commonjs/index.js
2766
- var require_commonjs6 = __commonJS({
2767
- "node_modules/.pnpm/@inquirer+input@4.2.2_@types+node@24.9.2/node_modules/@inquirer/input/dist/commonjs/index.js"(exports2) {
2768
- "use strict";
2769
- Object.defineProperty(exports2, "__esModule", { value: true });
2770
- var core_1 = require_commonjs3();
2771
- var inputTheme = {
2772
- validationFailureMode: "keep"
2773
- };
2774
- exports2.default = (0, core_1.createPrompt)((config, done) => {
2775
- const { required, validate: validate2 = /* @__PURE__ */ __name(() => true, "validate"), prefill = "tab" } = config;
2776
- const theme = (0, core_1.makeTheme)(inputTheme, config.theme);
2777
- const [status, setStatus] = (0, core_1.useState)("idle");
2778
- const [defaultValue = "", setDefaultValue] = (0, core_1.useState)(config.default);
2779
- const [errorMsg, setError] = (0, core_1.useState)();
2780
- const [value, setValue] = (0, core_1.useState)("");
2781
- const prefix = (0, core_1.usePrefix)({ status, theme });
2782
- (0, core_1.useKeypress)(async (key, rl) => {
2783
- if (status !== "idle") {
2784
- return;
2785
- }
2786
- if ((0, core_1.isEnterKey)(key)) {
2787
- const answer = value || defaultValue;
2788
- setStatus("loading");
2789
- const isValid = required && !answer ? "You must provide a value" : await validate2(answer);
2790
- if (isValid === true) {
2791
- setValue(answer);
2792
- setStatus("done");
2793
- done(answer);
2794
- } else {
2795
- if (theme.validationFailureMode === "clear") {
2796
- setValue("");
2797
- } else {
2798
- rl.write(value);
2799
- }
2800
- setError(isValid || "You must provide a valid value");
2801
- setStatus("idle");
2802
- }
2803
- } else if ((0, core_1.isBackspaceKey)(key) && !value) {
2804
- setDefaultValue(void 0);
2805
- } else if ((0, core_1.isTabKey)(key) && !value) {
2806
- setDefaultValue(void 0);
2807
- rl.clearLine(0);
2808
- rl.write(defaultValue);
2809
- setValue(defaultValue);
2810
- } else {
2811
- setValue(rl.line);
2812
- setError(void 0);
2813
- }
2814
- });
2815
- (0, core_1.useEffect)((rl) => {
2816
- if (prefill === "editable" && defaultValue) {
2817
- rl.write(defaultValue);
2818
- setValue(defaultValue);
2819
- }
2820
- }, []);
2821
- const message = theme.style.message(config.message, status);
2822
- let formattedValue = value;
2823
- if (typeof config.transformer === "function") {
2824
- formattedValue = config.transformer(value, { isFinal: status === "done" });
2825
- } else if (status === "done") {
2826
- formattedValue = theme.style.answer(value);
2827
- }
2828
- let defaultStr;
2829
- if (defaultValue && status !== "done" && !value) {
2830
- defaultStr = theme.style.defaultAnswer(defaultValue);
2831
- }
2832
- let error = "";
2833
- if (errorMsg) {
2834
- error = theme.style.error(errorMsg);
2835
- }
2836
- return [
2837
- [prefix, message, defaultStr, formattedValue].filter((v) => v !== void 0).join(" "),
2838
- error
2839
- ];
2840
- });
2841
- }
2842
- });
2843
-
2844
- // node_modules/.pnpm/ansi-escapes@4.3.2/node_modules/ansi-escapes/index.js
2845
- var require_ansi_escapes = __commonJS({
2846
- "node_modules/.pnpm/ansi-escapes@4.3.2/node_modules/ansi-escapes/index.js"(exports2, module2) {
2847
- "use strict";
2848
- var ansiEscapes = module2.exports;
2849
- module2.exports.default = ansiEscapes;
2850
- var ESC = "\x1B[";
2851
- var OSC = "\x1B]";
2852
- var BEL = "\x07";
2853
- var SEP = ";";
2854
- var isTerminalApp = process.env.TERM_PROGRAM === "Apple_Terminal";
2855
- ansiEscapes.cursorTo = (x, y) => {
2856
- if (typeof x !== "number") {
2857
- throw new TypeError("The `x` argument is required");
2858
- }
2859
- if (typeof y !== "number") {
2860
- return ESC + (x + 1) + "G";
2861
- }
2862
- return ESC + (y + 1) + ";" + (x + 1) + "H";
2863
- };
2864
- ansiEscapes.cursorMove = (x, y) => {
2865
- if (typeof x !== "number") {
2866
- throw new TypeError("The `x` argument is required");
2867
- }
2868
- let ret = "";
2869
- if (x < 0) {
2870
- ret += ESC + -x + "D";
2871
- } else if (x > 0) {
2872
- ret += ESC + x + "C";
2873
- }
2874
- if (y < 0) {
2875
- ret += ESC + -y + "A";
2876
- } else if (y > 0) {
2877
- ret += ESC + y + "B";
2878
- }
2879
- return ret;
2880
- };
2881
- ansiEscapes.cursorUp = (count = 1) => ESC + count + "A";
2882
- ansiEscapes.cursorDown = (count = 1) => ESC + count + "B";
2883
- ansiEscapes.cursorForward = (count = 1) => ESC + count + "C";
2884
- ansiEscapes.cursorBackward = (count = 1) => ESC + count + "D";
2885
- ansiEscapes.cursorLeft = ESC + "G";
2886
- ansiEscapes.cursorSavePosition = isTerminalApp ? "\x1B7" : ESC + "s";
2887
- ansiEscapes.cursorRestorePosition = isTerminalApp ? "\x1B8" : ESC + "u";
2888
- ansiEscapes.cursorGetPosition = ESC + "6n";
2889
- ansiEscapes.cursorNextLine = ESC + "E";
2890
- ansiEscapes.cursorPrevLine = ESC + "F";
2891
- ansiEscapes.cursorHide = ESC + "?25l";
2892
- ansiEscapes.cursorShow = ESC + "?25h";
2893
- ansiEscapes.eraseLines = (count) => {
2894
- let clear = "";
2895
- for (let i = 0; i < count; i++) {
2896
- clear += ansiEscapes.eraseLine + (i < count - 1 ? ansiEscapes.cursorUp() : "");
2897
- }
2898
- if (count) {
2899
- clear += ansiEscapes.cursorLeft;
2900
- }
2901
- return clear;
2902
- };
2903
- ansiEscapes.eraseEndLine = ESC + "K";
2904
- ansiEscapes.eraseStartLine = ESC + "1K";
2905
- ansiEscapes.eraseLine = ESC + "2K";
2906
- ansiEscapes.eraseDown = ESC + "J";
2907
- ansiEscapes.eraseUp = ESC + "1J";
2908
- ansiEscapes.eraseScreen = ESC + "2J";
2909
- ansiEscapes.scrollUp = ESC + "S";
2910
- ansiEscapes.scrollDown = ESC + "T";
2911
- ansiEscapes.clearScreen = "\x1Bc";
2912
- ansiEscapes.clearTerminal = process.platform === "win32" ? `${ansiEscapes.eraseScreen}${ESC}0f` : (
2913
- // 1. Erases the screen (Only done in case `2` is not supported)
2914
- // 2. Erases the whole screen including scrollback buffer
2915
- // 3. Moves cursor to the top-left position
2916
- // More info: https://www.real-world-systems.com/docs/ANSIcode.html
2917
- `${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`
2918
- );
2919
- ansiEscapes.beep = BEL;
2920
- ansiEscapes.link = (text, url) => {
2921
- return [
2922
- OSC,
2923
- "8",
2924
- SEP,
2925
- SEP,
2926
- url,
2927
- BEL,
2928
- text,
2929
- OSC,
2930
- "8",
2931
- SEP,
2932
- SEP,
2933
- BEL
2934
- ].join("");
2935
- };
2936
- ansiEscapes.image = (buffer, options = {}) => {
2937
- let ret = `${OSC}1337;File=inline=1`;
2938
- if (options.width) {
2939
- ret += `;width=${options.width}`;
2940
- }
2941
- if (options.height) {
2942
- ret += `;height=${options.height}`;
2943
- }
2944
- if (options.preserveAspectRatio === false) {
2945
- ret += ";preserveAspectRatio=0";
2946
- }
2947
- return ret + ":" + buffer.toString("base64") + BEL;
2948
- };
2949
- ansiEscapes.iTerm = {
2950
- setCwd: /* @__PURE__ */ __name((cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`, "setCwd"),
2951
- annotation: /* @__PURE__ */ __name((message, options = {}) => {
2952
- let ret = `${OSC}1337;`;
2953
- const hasX = typeof options.x !== "undefined";
2954
- const hasY = typeof options.y !== "undefined";
2955
- if ((hasX || hasY) && !(hasX && hasY && typeof options.length !== "undefined")) {
2956
- throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");
2957
- }
2958
- message = message.replace(/\|/g, "");
2959
- ret += options.isHidden ? "AddHiddenAnnotation=" : "AddAnnotation=";
2960
- if (options.length > 0) {
2961
- ret += (hasX ? [message, options.length, options.x, options.y] : [options.length, message]).join("|");
2962
- } else {
2963
- ret += message;
2964
- }
2965
- return ret + BEL;
2966
- }, "annotation")
2967
- };
2968
- }
2969
- });
2970
-
2971
- // node_modules/.pnpm/@inquirer+password@4.0.18_@types+node@24.9.2/node_modules/@inquirer/password/dist/commonjs/index.js
2972
- var require_commonjs7 = __commonJS({
2973
- "node_modules/.pnpm/@inquirer+password@4.0.18_@types+node@24.9.2/node_modules/@inquirer/password/dist/commonjs/index.js"(exports2) {
2974
- "use strict";
2975
- var __importDefault = exports2 && exports2.__importDefault || function(mod) {
2976
- return mod && mod.__esModule ? mod : { "default": mod };
2977
- };
2978
- Object.defineProperty(exports2, "__esModule", { value: true });
2979
- var core_1 = require_commonjs3();
2980
- var ansi_escapes_1 = __importDefault(require_ansi_escapes());
2981
- exports2.default = (0, core_1.createPrompt)((config, done) => {
2982
- const { validate: validate2 = /* @__PURE__ */ __name(() => true, "validate") } = config;
2983
- const theme = (0, core_1.makeTheme)(config.theme);
2984
- const [status, setStatus] = (0, core_1.useState)("idle");
2985
- const [errorMsg, setError] = (0, core_1.useState)();
2986
- const [value, setValue] = (0, core_1.useState)("");
2987
- const prefix = (0, core_1.usePrefix)({ status, theme });
2988
- (0, core_1.useKeypress)(async (key, rl) => {
2989
- if (status !== "idle") {
2990
- return;
2991
- }
2992
- if ((0, core_1.isEnterKey)(key)) {
2993
- const answer = value;
2994
- setStatus("loading");
2995
- const isValid = await validate2(answer);
2996
- if (isValid === true) {
2997
- setValue(answer);
2998
- setStatus("done");
2999
- done(answer);
3000
- } else {
3001
- rl.write(value);
3002
- setError(isValid || "You must provide a valid value");
3003
- setStatus("idle");
3004
- }
3005
- } else {
3006
- setValue(rl.line);
3007
- setError(void 0);
3008
- }
3009
- });
3010
- const message = theme.style.message(config.message, status);
3011
- let formattedValue = "";
3012
- let helpTip;
3013
- if (config.mask) {
3014
- const maskChar = typeof config.mask === "string" ? config.mask : "*";
3015
- formattedValue = maskChar.repeat(value.length);
3016
- } else if (status !== "done") {
3017
- helpTip = `${theme.style.help("[input is masked]")}${ansi_escapes_1.default.cursorHide}`;
3018
- }
3019
- if (status === "done") {
3020
- formattedValue = theme.style.answer(formattedValue);
3021
- }
3022
- let error = "";
3023
- if (errorMsg) {
3024
- error = theme.style.error(errorMsg);
3025
- }
3026
- return [[prefix, message, config.mask ? formattedValue : helpTip].join(" "), error];
3027
- });
3028
- }
3029
- });
3030
-
3031
- // node_modules/.pnpm/@inquirer+search@3.1.1_@types+node@24.9.2/node_modules/@inquirer/search/dist/commonjs/index.js
3032
- var require_commonjs8 = __commonJS({
3033
- "node_modules/.pnpm/@inquirer+search@3.1.1_@types+node@24.9.2/node_modules/@inquirer/search/dist/commonjs/index.js"(exports2) {
3034
- "use strict";
3035
- var __importDefault = exports2 && exports2.__importDefault || function(mod) {
3036
- return mod && mod.__esModule ? mod : { "default": mod };
3037
- };
3038
- Object.defineProperty(exports2, "__esModule", { value: true });
3039
- exports2.Separator = void 0;
3040
- var core_1 = require_commonjs3();
3041
- var yoctocolors_cjs_1 = __importDefault(require_yoctocolors_cjs());
3042
- var figures_1 = __importDefault(require_commonjs());
3043
- var searchTheme = {
3044
- icon: { cursor: figures_1.default.pointer },
3045
- style: {
3046
- disabled: /* @__PURE__ */ __name((text) => yoctocolors_cjs_1.default.dim(`- ${text}`), "disabled"),
3047
- searchTerm: /* @__PURE__ */ __name((text) => yoctocolors_cjs_1.default.cyan(text), "searchTerm"),
3048
- description: /* @__PURE__ */ __name((text) => yoctocolors_cjs_1.default.cyan(text), "description")
3049
- },
3050
- helpMode: "auto"
3051
- };
3052
- function isSelectable(item) {
3053
- return !core_1.Separator.isSeparator(item) && !item.disabled;
3054
- }
3055
- __name(isSelectable, "isSelectable");
3056
- function normalizeChoices(choices) {
3057
- return choices.map((choice) => {
3058
- if (core_1.Separator.isSeparator(choice))
3059
- return choice;
3060
- if (typeof choice === "string") {
3061
- return {
3062
- value: choice,
3063
- name: choice,
3064
- short: choice,
3065
- disabled: false
3066
- };
3067
- }
3068
- const name = choice.name ?? String(choice.value);
3069
- const normalizedChoice = {
3070
- value: choice.value,
3071
- name,
3072
- short: choice.short ?? name,
3073
- disabled: choice.disabled ?? false
3074
- };
3075
- if (choice.description) {
3076
- normalizedChoice.description = choice.description;
3077
- }
3078
- return normalizedChoice;
3079
- });
3080
- }
3081
- __name(normalizeChoices, "normalizeChoices");
3082
- exports2.default = (0, core_1.createPrompt)((config, done) => {
3083
- const { pageSize = 7, validate: validate2 = /* @__PURE__ */ __name(() => true, "validate") } = config;
3084
- const theme = (0, core_1.makeTheme)(searchTheme, config.theme);
3085
- const firstRender = (0, core_1.useRef)(true);
3086
- const [status, setStatus] = (0, core_1.useState)("loading");
3087
- const [searchTerm, setSearchTerm] = (0, core_1.useState)("");
3088
- const [searchResults, setSearchResults] = (0, core_1.useState)([]);
3089
- const [searchError, setSearchError] = (0, core_1.useState)();
3090
- const prefix = (0, core_1.usePrefix)({ status, theme });
3091
- const bounds = (0, core_1.useMemo)(() => {
3092
- const first = searchResults.findIndex(isSelectable);
3093
- const last = searchResults.findLastIndex(isSelectable);
3094
- return { first, last };
3095
- }, [searchResults]);
3096
- const [active = bounds.first, setActive] = (0, core_1.useState)();
3097
- (0, core_1.useEffect)(() => {
3098
- const controller = new AbortController();
3099
- setStatus("loading");
3100
- setSearchError(void 0);
3101
- const fetchResults = /* @__PURE__ */ __name(async () => {
3102
- try {
3103
- const results = await config.source(searchTerm || void 0, {
3104
- signal: controller.signal
3105
- });
3106
- if (!controller.signal.aborted) {
3107
- setActive(void 0);
3108
- setSearchError(void 0);
3109
- setSearchResults(normalizeChoices(results));
3110
- setStatus("idle");
3111
- }
3112
- } catch (error2) {
3113
- if (!controller.signal.aborted && error2 instanceof Error) {
3114
- setSearchError(error2.message);
3115
- }
3116
- }
3117
- }, "fetchResults");
3118
- void fetchResults();
3119
- return () => {
3120
- controller.abort();
3121
- };
3122
- }, [searchTerm]);
3123
- const selectedChoice = searchResults[active];
3124
- (0, core_1.useKeypress)(async (key, rl) => {
3125
- if ((0, core_1.isEnterKey)(key)) {
3126
- if (selectedChoice) {
3127
- setStatus("loading");
3128
- const isValid = await validate2(selectedChoice.value);
3129
- setStatus("idle");
3130
- if (isValid === true) {
3131
- setStatus("done");
3132
- done(selectedChoice.value);
3133
- } else if (selectedChoice.name === searchTerm) {
3134
- setSearchError(isValid || "You must provide a valid value");
3135
- } else {
3136
- rl.write(selectedChoice.name);
3137
- setSearchTerm(selectedChoice.name);
3138
- }
3139
- } else {
3140
- rl.write(searchTerm);
3141
- }
3142
- } else if ((0, core_1.isTabKey)(key) && selectedChoice) {
3143
- rl.clearLine(0);
3144
- rl.write(selectedChoice.name);
3145
- setSearchTerm(selectedChoice.name);
3146
- } else if (status !== "loading" && ((0, core_1.isUpKey)(key) || (0, core_1.isDownKey)(key))) {
3147
- rl.clearLine(0);
3148
- if ((0, core_1.isUpKey)(key) && active !== bounds.first || (0, core_1.isDownKey)(key) && active !== bounds.last) {
3149
- const offset = (0, core_1.isUpKey)(key) ? -1 : 1;
3150
- let next = active;
3151
- do {
3152
- next = (next + offset + searchResults.length) % searchResults.length;
3153
- } while (!isSelectable(searchResults[next]));
3154
- setActive(next);
3155
- }
3156
- } else {
3157
- setSearchTerm(rl.line);
3158
- }
3159
- });
3160
- const message = theme.style.message(config.message, status);
3161
- if (active > 0) {
3162
- firstRender.current = false;
3163
- }
3164
- let helpTip = "";
3165
- if (searchResults.length > 1 && (theme.helpMode === "always" || theme.helpMode === "auto" && firstRender.current)) {
3166
- helpTip = searchResults.length > pageSize ? `
3167
- ${theme.style.help(`(${config.instructions?.pager ?? "Use arrow keys to reveal more choices"})`)}` : `
3168
- ${theme.style.help(`(${config.instructions?.navigation ?? "Use arrow keys"})`)}`;
3169
- }
3170
- const page = (0, core_1.usePagination)({
3171
- items: searchResults,
3172
- active,
3173
- renderItem({ item, isActive }) {
3174
- if (core_1.Separator.isSeparator(item)) {
3175
- return ` ${item.separator}`;
3176
- }
3177
- if (item.disabled) {
3178
- const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
3179
- return theme.style.disabled(`${item.name} ${disabledLabel}`);
3180
- }
3181
- const color = isActive ? theme.style.highlight : (x) => x;
3182
- const cursor = isActive ? theme.icon.cursor : ` `;
3183
- return color(`${cursor} ${item.name}`);
3184
- },
3185
- pageSize,
3186
- loop: false
3187
- });
3188
- let error;
3189
- if (searchError) {
3190
- error = theme.style.error(searchError);
3191
- } else if (searchResults.length === 0 && searchTerm !== "" && status === "idle") {
3192
- error = theme.style.error("No results found");
3193
- }
3194
- let searchStr;
3195
- if (status === "done" && selectedChoice) {
3196
- const answer = selectedChoice.short;
3197
- return `${prefix} ${message} ${theme.style.answer(answer)}`;
3198
- } else {
3199
- searchStr = theme.style.searchTerm(searchTerm);
3200
- }
3201
- const choiceDescription = selectedChoice?.description ? `
3202
- ${theme.style.description(selectedChoice.description)}` : ``;
3203
- return [
3204
- [prefix, message, searchStr].filter(Boolean).join(" "),
3205
- `${error ?? page}${helpTip}${choiceDescription}`
3206
- ];
3207
- });
3208
- var core_2 = require_commonjs3();
3209
- Object.defineProperty(exports2, "Separator", { enumerable: true, get: /* @__PURE__ */ __name(function() {
3210
- return core_2.Separator;
3211
- }, "get") });
3212
- }
3213
- });
3214
-
3215
- // node_modules/.pnpm/@inquirer+select@4.3.2_@types+node@24.9.2/node_modules/@inquirer/select/dist/commonjs/index.js
3216
- var require_commonjs9 = __commonJS({
3217
- "node_modules/.pnpm/@inquirer+select@4.3.2_@types+node@24.9.2/node_modules/@inquirer/select/dist/commonjs/index.js"(exports2) {
3218
- "use strict";
3219
- var __importDefault = exports2 && exports2.__importDefault || function(mod) {
3220
- return mod && mod.__esModule ? mod : { "default": mod };
3221
- };
3222
- Object.defineProperty(exports2, "__esModule", { value: true });
3223
- exports2.Separator = void 0;
3224
- var core_1 = require_commonjs3();
3225
- var yoctocolors_cjs_1 = __importDefault(require_yoctocolors_cjs());
3226
- var figures_1 = __importDefault(require_commonjs());
3227
- var ansi_escapes_1 = __importDefault(require_ansi_escapes());
3228
- var selectTheme = {
3229
- icon: { cursor: figures_1.default.pointer },
3230
- style: {
3231
- disabled: /* @__PURE__ */ __name((text) => yoctocolors_cjs_1.default.dim(`- ${text}`), "disabled"),
3232
- description: /* @__PURE__ */ __name((text) => yoctocolors_cjs_1.default.cyan(text), "description")
3233
- },
3234
- helpMode: "auto",
3235
- indexMode: "hidden"
3236
- };
3237
- function isSelectable(item) {
3238
- return !core_1.Separator.isSeparator(item) && !item.disabled;
3239
- }
3240
- __name(isSelectable, "isSelectable");
3241
- function normalizeChoices(choices) {
3242
- return choices.map((choice) => {
3243
- if (core_1.Separator.isSeparator(choice))
3244
- return choice;
3245
- if (typeof choice === "string") {
3246
- return {
3247
- value: choice,
3248
- name: choice,
3249
- short: choice,
3250
- disabled: false
3251
- };
3252
- }
3253
- const name = choice.name ?? String(choice.value);
3254
- const normalizedChoice = {
3255
- value: choice.value,
3256
- name,
3257
- short: choice.short ?? name,
3258
- disabled: choice.disabled ?? false
3259
- };
3260
- if (choice.description) {
3261
- normalizedChoice.description = choice.description;
3262
- }
3263
- return normalizedChoice;
3264
- });
3265
- }
3266
- __name(normalizeChoices, "normalizeChoices");
3267
- exports2.default = (0, core_1.createPrompt)((config, done) => {
3268
- const { loop = true, pageSize = 7 } = config;
3269
- const firstRender = (0, core_1.useRef)(true);
3270
- const theme = (0, core_1.makeTheme)(selectTheme, config.theme);
3271
- const [status, setStatus] = (0, core_1.useState)("idle");
3272
- const prefix = (0, core_1.usePrefix)({ status, theme });
3273
- const searchTimeoutRef = (0, core_1.useRef)();
3274
- const items = (0, core_1.useMemo)(() => normalizeChoices(config.choices), [config.choices]);
3275
- const bounds = (0, core_1.useMemo)(() => {
3276
- const first = items.findIndex(isSelectable);
3277
- const last = items.findLastIndex(isSelectable);
3278
- if (first === -1) {
3279
- throw new core_1.ValidationError("[select prompt] No selectable choices. All choices are disabled.");
3280
- }
3281
- return { first, last };
3282
- }, [items]);
3283
- const defaultItemIndex = (0, core_1.useMemo)(() => {
3284
- if (!("default" in config))
3285
- return -1;
3286
- return items.findIndex((item) => isSelectable(item) && item.value === config.default);
3287
- }, [config.default, items]);
3288
- const [active, setActive] = (0, core_1.useState)(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);
3289
- const selectedChoice = items[active];
3290
- (0, core_1.useKeypress)((key, rl) => {
3291
- clearTimeout(searchTimeoutRef.current);
3292
- if ((0, core_1.isEnterKey)(key)) {
3293
- setStatus("done");
3294
- done(selectedChoice.value);
3295
- } else if ((0, core_1.isUpKey)(key) || (0, core_1.isDownKey)(key)) {
3296
- rl.clearLine(0);
3297
- if (loop || (0, core_1.isUpKey)(key) && active !== bounds.first || (0, core_1.isDownKey)(key) && active !== bounds.last) {
3298
- const offset = (0, core_1.isUpKey)(key) ? -1 : 1;
3299
- let next = active;
3300
- do {
3301
- next = (next + offset + items.length) % items.length;
3302
- } while (!isSelectable(items[next]));
3303
- setActive(next);
3304
- }
3305
- } else if ((0, core_1.isNumberKey)(key) && !Number.isNaN(Number(rl.line))) {
3306
- const selectedIndex = Number(rl.line) - 1;
3307
- let selectableIndex = -1;
3308
- const position = items.findIndex((item2) => {
3309
- if (core_1.Separator.isSeparator(item2))
3310
- return false;
3311
- selectableIndex++;
3312
- return selectableIndex === selectedIndex;
3313
- });
3314
- const item = items[position];
3315
- if (item != null && isSelectable(item)) {
3316
- setActive(position);
3317
- }
3318
- searchTimeoutRef.current = setTimeout(() => {
3319
- rl.clearLine(0);
3320
- }, 700);
3321
- } else if ((0, core_1.isBackspaceKey)(key)) {
3322
- rl.clearLine(0);
3323
- } else {
3324
- const searchTerm = rl.line.toLowerCase();
3325
- const matchIndex = items.findIndex((item) => {
3326
- if (core_1.Separator.isSeparator(item) || !isSelectable(item))
3327
- return false;
3328
- return item.name.toLowerCase().startsWith(searchTerm);
3329
- });
3330
- if (matchIndex !== -1) {
3331
- setActive(matchIndex);
3332
- }
3333
- searchTimeoutRef.current = setTimeout(() => {
3334
- rl.clearLine(0);
3335
- }, 700);
3336
- }
3337
- });
3338
- (0, core_1.useEffect)(() => () => {
3339
- clearTimeout(searchTimeoutRef.current);
3340
- }, []);
3341
- const message = theme.style.message(config.message, status);
3342
- let helpTipTop = "";
3343
- let helpTipBottom = "";
3344
- if (theme.helpMode === "always" || theme.helpMode === "auto" && firstRender.current) {
3345
- firstRender.current = false;
3346
- if (items.length > pageSize) {
3347
- helpTipBottom = `
3348
- ${theme.style.help(`(${config.instructions?.pager ?? "Use arrow keys to reveal more choices"})`)}`;
3349
- } else {
3350
- helpTipTop = theme.style.help(`(${config.instructions?.navigation ?? "Use arrow keys"})`);
3351
- }
3352
- }
3353
- let separatorCount = 0;
3354
- const page = (0, core_1.usePagination)({
3355
- items,
3356
- active,
3357
- renderItem({ item, isActive, index }) {
3358
- if (core_1.Separator.isSeparator(item)) {
3359
- separatorCount++;
3360
- return ` ${item.separator}`;
3361
- }
3362
- const indexLabel = theme.indexMode === "number" ? `${index + 1 - separatorCount}. ` : "";
3363
- if (item.disabled) {
3364
- const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
3365
- return theme.style.disabled(`${indexLabel}${item.name} ${disabledLabel}`);
3366
- }
3367
- const color = isActive ? theme.style.highlight : (x) => x;
3368
- const cursor = isActive ? theme.icon.cursor : ` `;
3369
- return color(`${cursor} ${indexLabel}${item.name}`);
3370
- },
3371
- pageSize,
3372
- loop
3373
- });
3374
- if (status === "done") {
3375
- return `${prefix} ${message} ${theme.style.answer(selectedChoice.short)}`;
3376
- }
3377
- const choiceDescription = selectedChoice.description ? `
3378
- ${theme.style.description(selectedChoice.description)}` : ``;
3379
- return `${[prefix, message, helpTipTop].filter(Boolean).join(" ")}
3380
- ${page}${helpTipBottom}${choiceDescription}${ansi_escapes_1.default.cursorHide}`;
3381
- });
3382
- var core_2 = require_commonjs3();
3383
- Object.defineProperty(exports2, "Separator", { enumerable: true, get: /* @__PURE__ */ __name(function() {
3384
- return core_2.Separator;
3385
- }, "get") });
3386
- }
3387
- });
3388
-
3389
569
  // src/external/external-pack.js
3390
570
  var signalExit = require_cjs();
3391
571
  var supportsColor2 = (init_supports_color(), __toCommonJS(supports_color_exports));
3392
572
  var hasFlag3 = (init_has_flag(), __toCommonJS(has_flag_exports));
3393
573
  var yoctocolorsCjs = require_yoctocolors_cjs();
3394
- var checkbox = require_commonjs4();
3395
- var confirm = require_commonjs5();
3396
- var input = require_commonjs6();
3397
- var password = require_commonjs7();
3398
- var search = require_commonjs8();
3399
- var select = require_commonjs9();
3400
574
  module.exports = {
3401
- checkbox,
3402
- confirm,
3403
575
  hasFlag: hasFlag3,
3404
- input,
3405
- password,
3406
- search,
3407
- select,
3408
576
  signalExit,
3409
577
  supportsColor: supportsColor2,
3410
578
  yoctocolorsCjs