vk-typescript-cli 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/Jenkinsfile +48 -0
  2. package/README.md +300 -0
  3. package/bin/sf.js +438 -0
  4. package/eslint.config.js +90 -0
  5. package/gulpfile.js +157 -0
  6. package/lib/commander.js +3370 -0
  7. package/lib/inquirer-prompts.js +2038 -0
  8. package/license +13 -0
  9. package/package.json +43 -0
  10. package/smoke-test.mjs +38 -0
  11. package/src/commands/add.js +276 -0
  12. package/src/commands/info.js +82 -0
  13. package/src/commands/interactive.js +493 -0
  14. package/src/commands/mcp.js +135 -0
  15. package/src/commands/new.js +264 -0
  16. package/src/commands/skills.js +42 -0
  17. package/src/commands/theme.js +200 -0
  18. package/src/commands/upgrade.js +219 -0
  19. package/src/constants.js +161 -0
  20. package/src/generators/angular.js +878 -0
  21. package/src/generators/nextjs.js +817 -0
  22. package/src/generators/react.js +769 -0
  23. package/src/generators/typescript.js +258 -0
  24. package/src/generators/vue.js +800 -0
  25. package/src/templates/angular/chart.component.html +23 -0
  26. package/src/templates/angular/chart.component.ts +172 -0
  27. package/src/templates/angular/diagram.component.html +13 -0
  28. package/src/templates/angular/diagram.component.ts +224 -0
  29. package/src/templates/angular/docx-editor.component.html +18 -0
  30. package/src/templates/angular/docx-editor.component.ts +37 -0
  31. package/src/templates/angular/filemanager.component.html +4 -0
  32. package/src/templates/angular/filemanager.component.ts +47 -0
  33. package/src/templates/angular/gantt.component.html +32 -0
  34. package/src/templates/angular/gantt.component.ts +95 -0
  35. package/src/templates/angular/grid.component.html +12 -0
  36. package/src/templates/angular/grid.component.ts +58 -0
  37. package/src/templates/angular/pdf-viewer.component.html +9 -0
  38. package/src/templates/angular/pdf-viewer.component.ts +48 -0
  39. package/src/templates/angular/rte.component.html +7 -0
  40. package/src/templates/angular/rte.component.ts +13 -0
  41. package/src/templates/angular/scheduler.component.html +17 -0
  42. package/src/templates/angular/scheduler.component.ts +75 -0
  43. package/src/templates/angular/spreadsheet-editor.component.html +42 -0
  44. package/src/templates/angular/spreadsheet-editor.component.ts +61 -0
  45. package/src/templates/chart-template.js +20 -0
  46. package/src/templates/diagram-template.js +26 -0
  47. package/src/templates/docx-template.js +20 -0
  48. package/src/templates/filemanager-template.js +20 -0
  49. package/src/templates/gantt-template.js +20 -0
  50. package/src/templates/grid-template.js +20 -0
  51. package/src/templates/pdfviewer-template.js +20 -0
  52. package/src/templates/react/Chart.jsx +81 -0
  53. package/src/templates/react/Chart.tsx +81 -0
  54. package/src/templates/react/DOCXEditor.jsx +37 -0
  55. package/src/templates/react/DOCXEditor.tsx +37 -0
  56. package/src/templates/react/Diagram.jsx +192 -0
  57. package/src/templates/react/Diagram.tsx +195 -0
  58. package/src/templates/react/FileManager.jsx +13 -0
  59. package/src/templates/react/FileManager.tsx +13 -0
  60. package/src/templates/react/Gantt.jsx +89 -0
  61. package/src/templates/react/Gantt.tsx +89 -0
  62. package/src/templates/react/Grid.jsx +45 -0
  63. package/src/templates/react/Grid.tsx +45 -0
  64. package/src/templates/react/PDFViewer.jsx +16 -0
  65. package/src/templates/react/PDFViewer.tsx +16 -0
  66. package/src/templates/react/RTE.jsx +14 -0
  67. package/src/templates/react/RTE.tsx +14 -0
  68. package/src/templates/react/Scheduler.jsx +55 -0
  69. package/src/templates/react/Scheduler.tsx +55 -0
  70. package/src/templates/react/SpreadsheetEditor.jsx +96 -0
  71. package/src/templates/react/SpreadsheetEditor.tsx +98 -0
  72. package/src/templates/rte-template.js +26 -0
  73. package/src/templates/scheduler-template.js +20 -0
  74. package/src/templates/spreadheet-template.js +20 -0
  75. package/src/templates/typescript/RTE.ts +33 -0
  76. package/src/templates/typescript/SpreadsheetEditor.ts +39 -0
  77. package/src/templates/typescript/chart.ts +37 -0
  78. package/src/templates/typescript/diagram.ts +30 -0
  79. package/src/templates/typescript/docxeditor.ts +30 -0
  80. package/src/templates/typescript/filemanager.ts +41 -0
  81. package/src/templates/typescript/gantt.ts +88 -0
  82. package/src/templates/typescript/grid.ts +30 -0
  83. package/src/templates/typescript/pdfviewer.ts +8 -0
  84. package/src/templates/typescript/scheduler.ts +39 -0
  85. package/src/templates/vue/Chart.vue +257 -0
  86. package/src/templates/vue/ChartView.vue +7 -0
  87. package/src/templates/vue/DOCXEditor.vue +61 -0
  88. package/src/templates/vue/DOCXEditorView.vue +7 -0
  89. package/src/templates/vue/Diagram.vue +245 -0
  90. package/src/templates/vue/DiagramView.vue +7 -0
  91. package/src/templates/vue/FileManager.vue +58 -0
  92. package/src/templates/vue/FileManagerView.vue +7 -0
  93. package/src/templates/vue/Gantt.vue +129 -0
  94. package/src/templates/vue/GanttView.vue +7 -0
  95. package/src/templates/vue/Grid.vue +141 -0
  96. package/src/templates/vue/GridView.vue +7 -0
  97. package/src/templates/vue/PDFViewer.vue +58 -0
  98. package/src/templates/vue/PDFViewerView.vue +7 -0
  99. package/src/templates/vue/RTE.vue +27 -0
  100. package/src/templates/vue/RTEView.vue +7 -0
  101. package/src/templates/vue/Scheduler.vue +94 -0
  102. package/src/templates/vue/SchedulerView.vue +7 -0
  103. package/src/templates/vue/SpreadsheetEditor.vue +115 -0
  104. package/src/templates/vue/SpreadsheetEditorView.vue +7 -0
  105. package/src/utils/ansi-colors.js +38 -0
  106. package/src/utils/banner.js +179 -0
  107. package/src/utils/common.js +64 -0
  108. package/src/utils/config-generator.js +73 -0
  109. package/src/utils/folder-structure.js +26 -0
  110. package/src/utils/logger.js +19 -0
  111. package/src/utils/mcp-generator.js +122 -0
  112. package/src/utils/package-manager.js +128 -0
  113. package/src/utils/project-bootstrap.js +98 -0
  114. package/src/utils/project-detector.js +195 -0
  115. package/src/utils/prompt-utils.js +29 -0
  116. package/src/utils/run-command.js +110 -0
  117. package/src/utils/skills-installer.js +69 -0
  118. package/src/utils/template-file.js +35 -0
  119. package/src/utils/theme-loader.js +47 -0
@@ -0,0 +1,2038 @@
1
+ import { createRequire } from 'node:module';
2
+ const require = createRequire(import.meta.url);
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
10
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
11
+ }) : x)(function(x) {
12
+ if (typeof require !== "undefined") return require.apply(this, arguments);
13
+ throw Error('Dynamic require of "' + x + '" is not supported');
14
+ });
15
+ var __commonJS = (cb, mod) => function __require2() {
16
+ try {
17
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
+ } catch (e) {
19
+ throw mod = 0, e;
20
+ }
21
+ };
22
+ var __copyProps = (to, from, except, desc) => {
23
+ if (from && typeof from === "object" || typeof from === "function") {
24
+ for (let key of __getOwnPropNames(from))
25
+ if (!__hasOwnProp.call(to, key) && key !== except)
26
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
27
+ }
28
+ return to;
29
+ };
30
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
31
+ // If the importer is in node compatibility mode or this is not an ESM
32
+ // file that has been converted to a CommonJS file using a Babel-
33
+ // compatible transform (i.e. "__esModule" has not been set), then set
34
+ // "default" to the CommonJS "module.exports" for node compatibility.
35
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
36
+ mod
37
+ ));
38
+
39
+ // node_modules/cli-width/index.js
40
+ var require_cli_width = __commonJS({
41
+ "node_modules/cli-width/index.js"(exports, module) {
42
+ "use strict";
43
+ module.exports = cliWidth2;
44
+ function normalizeOpts(options) {
45
+ const defaultOpts = {
46
+ defaultWidth: 0,
47
+ output: process.stdout,
48
+ tty: __require("tty")
49
+ };
50
+ if (!options) {
51
+ return defaultOpts;
52
+ }
53
+ Object.keys(defaultOpts).forEach(function(key) {
54
+ if (!options[key]) {
55
+ options[key] = defaultOpts[key];
56
+ }
57
+ });
58
+ return options;
59
+ }
60
+ function cliWidth2(options) {
61
+ const opts = normalizeOpts(options);
62
+ if (opts.output.getWindowSize) {
63
+ return opts.output.getWindowSize()[0] || opts.defaultWidth;
64
+ }
65
+ if (opts.tty.getWindowSize) {
66
+ return opts.tty.getWindowSize()[1] || opts.defaultWidth;
67
+ }
68
+ if (opts.output.columns) {
69
+ return opts.output.columns;
70
+ }
71
+ if (process.env.CLI_WIDTH) {
72
+ const width = parseInt(process.env.CLI_WIDTH, 10);
73
+ if (!isNaN(width) && width !== 0) {
74
+ return width;
75
+ }
76
+ }
77
+ return opts.defaultWidth;
78
+ }
79
+ }
80
+ });
81
+
82
+ // node_modules/mute-stream/lib/index.js
83
+ var require_lib = __commonJS({
84
+ "node_modules/mute-stream/lib/index.js"(exports, module) {
85
+ var Stream = __require("stream");
86
+ var MuteStream2 = class extends Stream {
87
+ #isTTY = null;
88
+ constructor(opts = {}) {
89
+ super(opts);
90
+ this.writable = this.readable = true;
91
+ this.muted = false;
92
+ this.on("pipe", this._onpipe);
93
+ this.replace = opts.replace;
94
+ this._prompt = opts.prompt || null;
95
+ this._hadControl = false;
96
+ }
97
+ #destSrc(key, def) {
98
+ if (this._dest) {
99
+ return this._dest[key];
100
+ }
101
+ if (this._src) {
102
+ return this._src[key];
103
+ }
104
+ return def;
105
+ }
106
+ #proxy(method, ...args) {
107
+ if (typeof this._dest?.[method] === "function") {
108
+ this._dest[method](...args);
109
+ }
110
+ if (typeof this._src?.[method] === "function") {
111
+ this._src[method](...args);
112
+ }
113
+ }
114
+ get isTTY() {
115
+ if (this.#isTTY !== null) {
116
+ return this.#isTTY;
117
+ }
118
+ return this.#destSrc("isTTY", false);
119
+ }
120
+ // basically just get replace the getter/setter with a regular value
121
+ set isTTY(val) {
122
+ this.#isTTY = val;
123
+ }
124
+ get rows() {
125
+ return this.#destSrc("rows");
126
+ }
127
+ get columns() {
128
+ return this.#destSrc("columns");
129
+ }
130
+ mute() {
131
+ this.muted = true;
132
+ }
133
+ unmute() {
134
+ this.muted = false;
135
+ }
136
+ _onpipe(src) {
137
+ this._src = src;
138
+ }
139
+ pipe(dest, options) {
140
+ this._dest = dest;
141
+ return super.pipe(dest, options);
142
+ }
143
+ pause() {
144
+ if (this._src) {
145
+ return this._src.pause();
146
+ }
147
+ }
148
+ resume() {
149
+ if (this._src) {
150
+ return this._src.resume();
151
+ }
152
+ }
153
+ write(c) {
154
+ if (this.muted) {
155
+ if (!this.replace) {
156
+ return true;
157
+ }
158
+ if (c.match(/^\u001b/)) {
159
+ if (c.indexOf(this._prompt) === 0) {
160
+ c = c.slice(this._prompt.length);
161
+ c = c.replace(/./g, this.replace);
162
+ c = this._prompt + c;
163
+ }
164
+ this._hadControl = true;
165
+ return this.emit("data", c);
166
+ } else {
167
+ if (this._prompt && this._hadControl && c.indexOf(this._prompt) === 0) {
168
+ this._hadControl = false;
169
+ this.emit("data", this._prompt);
170
+ c = c.slice(this._prompt.length);
171
+ }
172
+ c = c.toString().replace(/./g, this.replace);
173
+ }
174
+ }
175
+ this.emit("data", c);
176
+ }
177
+ end(c) {
178
+ if (this.muted) {
179
+ if (c && this.replace) {
180
+ c = c.toString().replace(/./g, this.replace);
181
+ } else {
182
+ c = null;
183
+ }
184
+ }
185
+ if (c) {
186
+ this.emit("data", c);
187
+ }
188
+ this.emit("end");
189
+ }
190
+ destroy(...args) {
191
+ return this.#proxy("destroy", ...args);
192
+ }
193
+ destroySoon(...args) {
194
+ return this.#proxy("destroySoon", ...args);
195
+ }
196
+ close(...args) {
197
+ return this.#proxy("close", ...args);
198
+ }
199
+ };
200
+ module.exports = MuteStream2;
201
+ }
202
+ });
203
+
204
+ // node_modules/@inquirer/core/dist/lib/key.js
205
+ var keybindings = ["emacs", "vim"];
206
+ var keybindingLookup = new Set(keybindings);
207
+ function isKeybinding(value) {
208
+ return keybindingLookup.has(value);
209
+ }
210
+ function getDefaultKeybindings() {
211
+ const env = process.env["INQUIRER_KEYBINDINGS"];
212
+ if (!env)
213
+ return [];
214
+ return Array.from(new Set(env.toLowerCase().split(/[\s,]+/).filter(isKeybinding)));
215
+ }
216
+ var isUpKey = (key, keybindings2 = []) => (
217
+ // The up key
218
+ key.name === "up" || // Vim keybinding: hjkl keys map to left/down/up/right
219
+ keybindings2.includes("vim") && key.name === "k" || // Emacs keybinding: Ctrl+P means "previous" in Emacs navigation conventions
220
+ keybindings2.includes("emacs") && key.ctrl && key.name === "p"
221
+ );
222
+ var isDownKey = (key, keybindings2 = []) => (
223
+ // The down key
224
+ key.name === "down" || // Vim keybinding: hjkl keys map to left/down/up/right
225
+ keybindings2.includes("vim") && key.name === "j" || // Emacs keybinding: Ctrl+N means "next" in Emacs navigation conventions
226
+ keybindings2.includes("emacs") && key.ctrl && key.name === "n"
227
+ );
228
+ var isBackspaceKey = (key) => key.name === "backspace";
229
+ var isTabKey = (key) => key.name === "tab";
230
+ var isNumberKey = (key) => "1234567890".includes(key.name);
231
+ var isEnterKey = (key) => key.name === "enter" || key.name === "return";
232
+
233
+ // node_modules/@inquirer/core/dist/lib/errors.js
234
+ var AbortPromptError = class extends Error {
235
+ name = "AbortPromptError";
236
+ message = "Prompt was aborted";
237
+ constructor(options) {
238
+ super();
239
+ this.cause = options?.cause;
240
+ }
241
+ };
242
+ var CancelPromptError = class extends Error {
243
+ name = "CancelPromptError";
244
+ message = "Prompt was canceled";
245
+ };
246
+ var ExitPromptError = class extends Error {
247
+ name = "ExitPromptError";
248
+ };
249
+ var HookError = class extends Error {
250
+ name = "HookError";
251
+ };
252
+ var ValidationError = class extends Error {
253
+ name = "ValidationError";
254
+ };
255
+
256
+ // node_modules/@inquirer/core/dist/lib/use-state.js
257
+ import { AsyncResource as AsyncResource2 } from "node:async_hooks";
258
+
259
+ // node_modules/@inquirer/core/dist/lib/hook-engine.js
260
+ import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
261
+ var hookStorage = new AsyncLocalStorage();
262
+ function createStore(rl) {
263
+ const store = {
264
+ rl,
265
+ hooks: [],
266
+ hooksCleanup: [],
267
+ hooksEffect: [],
268
+ index: 0,
269
+ handleChange() {
270
+ }
271
+ };
272
+ return store;
273
+ }
274
+ function withHooks(rl, cb) {
275
+ const store = createStore(rl);
276
+ return hookStorage.run(store, () => {
277
+ function cycle(render) {
278
+ store.handleChange = () => {
279
+ store.index = 0;
280
+ render();
281
+ };
282
+ store.handleChange();
283
+ }
284
+ return cb(cycle);
285
+ });
286
+ }
287
+ function getStore() {
288
+ const store = hookStorage.getStore();
289
+ if (!store) {
290
+ throw new HookError("[Inquirer] Hook functions can only be called from within a prompt");
291
+ }
292
+ return store;
293
+ }
294
+ function readline() {
295
+ return getStore().rl;
296
+ }
297
+ function withUpdates(fn) {
298
+ const wrapped = (...args) => {
299
+ const store = getStore();
300
+ let shouldUpdate = false;
301
+ const oldHandleChange = store.handleChange;
302
+ store.handleChange = () => {
303
+ shouldUpdate = true;
304
+ };
305
+ const returnValue = fn(...args);
306
+ if (shouldUpdate) {
307
+ oldHandleChange();
308
+ }
309
+ store.handleChange = oldHandleChange;
310
+ return returnValue;
311
+ };
312
+ return AsyncResource.bind(wrapped);
313
+ }
314
+ function withPointer(cb) {
315
+ const store = getStore();
316
+ const { index } = store;
317
+ const pointer = {
318
+ get() {
319
+ return store.hooks[index];
320
+ },
321
+ set(value) {
322
+ store.hooks[index] = value;
323
+ },
324
+ initialized: index in store.hooks
325
+ };
326
+ const returnValue = cb(pointer);
327
+ store.index++;
328
+ return returnValue;
329
+ }
330
+ function handleChange() {
331
+ getStore().handleChange();
332
+ }
333
+ var effectScheduler = {
334
+ queue(cb) {
335
+ const store = getStore();
336
+ const { index } = store;
337
+ store.hooksEffect.push(() => {
338
+ store.hooksCleanup[index]?.();
339
+ const cleanFn = cb(readline());
340
+ if (cleanFn != null && typeof cleanFn !== "function") {
341
+ throw new ValidationError("useEffect return value must be a cleanup function or nothing.");
342
+ }
343
+ store.hooksCleanup[index] = cleanFn;
344
+ });
345
+ },
346
+ run() {
347
+ const store = getStore();
348
+ withUpdates(() => {
349
+ store.hooksEffect.forEach((effect) => {
350
+ effect();
351
+ });
352
+ store.hooksEffect.length = 0;
353
+ })();
354
+ },
355
+ clearAll() {
356
+ const store = getStore();
357
+ store.hooksCleanup.forEach((cleanFn) => {
358
+ cleanFn?.();
359
+ });
360
+ store.hooksEffect.length = 0;
361
+ store.hooksCleanup.length = 0;
362
+ }
363
+ };
364
+
365
+ // node_modules/@inquirer/core/dist/lib/use-state.js
366
+ function isFactory(value) {
367
+ return typeof value === "function";
368
+ }
369
+ function useState(defaultValue) {
370
+ return withPointer((pointer) => {
371
+ const setState = AsyncResource2.bind(function setState2(newValue) {
372
+ if (pointer.get() !== newValue) {
373
+ pointer.set(newValue);
374
+ handleChange();
375
+ }
376
+ });
377
+ if (pointer.initialized) {
378
+ return [pointer.get(), setState];
379
+ }
380
+ const value = isFactory(defaultValue) ? defaultValue() : defaultValue;
381
+ pointer.set(value);
382
+ return [value, setState];
383
+ });
384
+ }
385
+
386
+ // node_modules/@inquirer/core/dist/lib/use-effect.js
387
+ function useEffect(cb, depArray) {
388
+ withPointer((pointer) => {
389
+ const oldDeps = pointer.get();
390
+ const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i) => !Object.is(dep, oldDeps[i]));
391
+ if (hasChanged) {
392
+ effectScheduler.queue(cb);
393
+ }
394
+ pointer.set(depArray);
395
+ });
396
+ }
397
+
398
+ // node_modules/@inquirer/core/dist/lib/theme.js
399
+ import { styleText } from "node:util";
400
+
401
+ // node_modules/@inquirer/figures/dist/index.js
402
+ import process2 from "node:process";
403
+ function isUnicodeSupported() {
404
+ if (!process2.platform.startsWith("win")) {
405
+ return process2.env["TERM"] !== "linux";
406
+ }
407
+ return Boolean(process2.env["CI"]) || // CI environments generally support unicode
408
+ Boolean(process2.env["WT_SESSION"]) || // Windows Terminal
409
+ Boolean(process2.env["TERMINUS_SUBLIME"]) || // Terminus (<0.2.27)
410
+ process2.env["ConEmuTask"] === "{cmd::Cmder}" || // ConEmu and cmder
411
+ process2.env["TERM_PROGRAM"] === "Terminus-Sublime" || process2.env["TERM_PROGRAM"] === "vscode" || process2.env["TERM"] === "xterm-256color" || process2.env["TERM"] === "alacritty" || process2.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
412
+ }
413
+ var common = {
414
+ circleQuestionMark: "(?)",
415
+ questionMarkPrefix: "(?)",
416
+ square: "\u2588",
417
+ squareDarkShade: "\u2593",
418
+ squareMediumShade: "\u2592",
419
+ squareLightShade: "\u2591",
420
+ squareTop: "\u2580",
421
+ squareBottom: "\u2584",
422
+ squareLeft: "\u258C",
423
+ squareRight: "\u2590",
424
+ squareCenter: "\u25A0",
425
+ bullet: "\u25CF",
426
+ dot: "\u2024",
427
+ ellipsis: "\u2026",
428
+ pointerSmall: "\u203A",
429
+ triangleUp: "\u25B2",
430
+ triangleUpSmall: "\u25B4",
431
+ triangleDown: "\u25BC",
432
+ triangleDownSmall: "\u25BE",
433
+ triangleLeftSmall: "\u25C2",
434
+ triangleRightSmall: "\u25B8",
435
+ home: "\u2302",
436
+ heart: "\u2665",
437
+ musicNote: "\u266A",
438
+ musicNoteBeamed: "\u266B",
439
+ arrowUp: "\u2191",
440
+ arrowDown: "\u2193",
441
+ arrowLeft: "\u2190",
442
+ arrowRight: "\u2192",
443
+ arrowLeftRight: "\u2194",
444
+ arrowUpDown: "\u2195",
445
+ almostEqual: "\u2248",
446
+ notEqual: "\u2260",
447
+ lessOrEqual: "\u2264",
448
+ greaterOrEqual: "\u2265",
449
+ identical: "\u2261",
450
+ infinity: "\u221E",
451
+ subscriptZero: "\u2080",
452
+ subscriptOne: "\u2081",
453
+ subscriptTwo: "\u2082",
454
+ subscriptThree: "\u2083",
455
+ subscriptFour: "\u2084",
456
+ subscriptFive: "\u2085",
457
+ subscriptSix: "\u2086",
458
+ subscriptSeven: "\u2087",
459
+ subscriptEight: "\u2088",
460
+ subscriptNine: "\u2089",
461
+ oneHalf: "\xBD",
462
+ oneThird: "\u2153",
463
+ oneQuarter: "\xBC",
464
+ oneFifth: "\u2155",
465
+ oneSixth: "\u2159",
466
+ oneEighth: "\u215B",
467
+ twoThirds: "\u2154",
468
+ twoFifths: "\u2156",
469
+ threeQuarters: "\xBE",
470
+ threeFifths: "\u2157",
471
+ threeEighths: "\u215C",
472
+ fourFifths: "\u2158",
473
+ fiveSixths: "\u215A",
474
+ fiveEighths: "\u215D",
475
+ sevenEighths: "\u215E",
476
+ line: "\u2500",
477
+ lineBold: "\u2501",
478
+ lineDouble: "\u2550",
479
+ lineDashed0: "\u2504",
480
+ lineDashed1: "\u2505",
481
+ lineDashed2: "\u2508",
482
+ lineDashed3: "\u2509",
483
+ lineDashed4: "\u254C",
484
+ lineDashed5: "\u254D",
485
+ lineDashed6: "\u2574",
486
+ lineDashed7: "\u2576",
487
+ lineDashed8: "\u2578",
488
+ lineDashed9: "\u257A",
489
+ lineDashed10: "\u257C",
490
+ lineDashed11: "\u257E",
491
+ lineDashed12: "\u2212",
492
+ lineDashed13: "\u2013",
493
+ lineDashed14: "\u2010",
494
+ lineDashed15: "\u2043",
495
+ lineVertical: "\u2502",
496
+ lineVerticalBold: "\u2503",
497
+ lineVerticalDouble: "\u2551",
498
+ lineVerticalDashed0: "\u2506",
499
+ lineVerticalDashed1: "\u2507",
500
+ lineVerticalDashed2: "\u250A",
501
+ lineVerticalDashed3: "\u250B",
502
+ lineVerticalDashed4: "\u254E",
503
+ lineVerticalDashed5: "\u254F",
504
+ lineVerticalDashed6: "\u2575",
505
+ lineVerticalDashed7: "\u2577",
506
+ lineVerticalDashed8: "\u2579",
507
+ lineVerticalDashed9: "\u257B",
508
+ lineVerticalDashed10: "\u257D",
509
+ lineVerticalDashed11: "\u257F",
510
+ lineDownLeft: "\u2510",
511
+ lineDownLeftArc: "\u256E",
512
+ lineDownBoldLeftBold: "\u2513",
513
+ lineDownBoldLeft: "\u2512",
514
+ lineDownLeftBold: "\u2511",
515
+ lineDownDoubleLeftDouble: "\u2557",
516
+ lineDownDoubleLeft: "\u2556",
517
+ lineDownLeftDouble: "\u2555",
518
+ lineDownRight: "\u250C",
519
+ lineDownRightArc: "\u256D",
520
+ lineDownBoldRightBold: "\u250F",
521
+ lineDownBoldRight: "\u250E",
522
+ lineDownRightBold: "\u250D",
523
+ lineDownDoubleRightDouble: "\u2554",
524
+ lineDownDoubleRight: "\u2553",
525
+ lineDownRightDouble: "\u2552",
526
+ lineUpLeft: "\u2518",
527
+ lineUpLeftArc: "\u256F",
528
+ lineUpBoldLeftBold: "\u251B",
529
+ lineUpBoldLeft: "\u251A",
530
+ lineUpLeftBold: "\u2519",
531
+ lineUpDoubleLeftDouble: "\u255D",
532
+ lineUpDoubleLeft: "\u255C",
533
+ lineUpLeftDouble: "\u255B",
534
+ lineUpRight: "\u2514",
535
+ lineUpRightArc: "\u2570",
536
+ lineUpBoldRightBold: "\u2517",
537
+ lineUpBoldRight: "\u2516",
538
+ lineUpRightBold: "\u2515",
539
+ lineUpDoubleRightDouble: "\u255A",
540
+ lineUpDoubleRight: "\u2559",
541
+ lineUpRightDouble: "\u2558",
542
+ lineUpDownLeft: "\u2524",
543
+ lineUpBoldDownBoldLeftBold: "\u252B",
544
+ lineUpBoldDownBoldLeft: "\u2528",
545
+ lineUpDownLeftBold: "\u2525",
546
+ lineUpBoldDownLeftBold: "\u2529",
547
+ lineUpDownBoldLeftBold: "\u252A",
548
+ lineUpDownBoldLeft: "\u2527",
549
+ lineUpBoldDownLeft: "\u2526",
550
+ lineUpDoubleDownDoubleLeftDouble: "\u2563",
551
+ lineUpDoubleDownDoubleLeft: "\u2562",
552
+ lineUpDownLeftDouble: "\u2561",
553
+ lineUpDownRight: "\u251C",
554
+ lineUpBoldDownBoldRightBold: "\u2523",
555
+ lineUpBoldDownBoldRight: "\u2520",
556
+ lineUpDownRightBold: "\u251D",
557
+ lineUpBoldDownRightBold: "\u2521",
558
+ lineUpDownBoldRightBold: "\u2522",
559
+ lineUpDownBoldRight: "\u251F",
560
+ lineUpBoldDownRight: "\u251E",
561
+ lineUpDoubleDownDoubleRightDouble: "\u2560",
562
+ lineUpDoubleDownDoubleRight: "\u255F",
563
+ lineUpDownRightDouble: "\u255E",
564
+ lineDownLeftRight: "\u252C",
565
+ lineDownBoldLeftBoldRightBold: "\u2533",
566
+ lineDownLeftBoldRightBold: "\u252F",
567
+ lineDownBoldLeftRight: "\u2530",
568
+ lineDownBoldLeftBoldRight: "\u2531",
569
+ lineDownBoldLeftRightBold: "\u2532",
570
+ lineDownLeftRightBold: "\u252E",
571
+ lineDownLeftBoldRight: "\u252D",
572
+ lineDownDoubleLeftDoubleRightDouble: "\u2566",
573
+ lineDownDoubleLeftRight: "\u2565",
574
+ lineDownLeftDoubleRightDouble: "\u2564",
575
+ lineUpLeftRight: "\u2534",
576
+ lineUpBoldLeftBoldRightBold: "\u253B",
577
+ lineUpLeftBoldRightBold: "\u2537",
578
+ lineUpBoldLeftRight: "\u2538",
579
+ lineUpBoldLeftBoldRight: "\u2539",
580
+ lineUpBoldLeftRightBold: "\u253A",
581
+ lineUpLeftRightBold: "\u2536",
582
+ lineUpLeftBoldRight: "\u2535",
583
+ lineUpDoubleLeftDoubleRightDouble: "\u2569",
584
+ lineUpDoubleLeftRight: "\u2568",
585
+ lineUpLeftDoubleRightDouble: "\u2567",
586
+ lineUpDownLeftRight: "\u253C",
587
+ lineUpBoldDownBoldLeftBoldRightBold: "\u254B",
588
+ lineUpDownBoldLeftBoldRightBold: "\u2548",
589
+ lineUpBoldDownLeftBoldRightBold: "\u2547",
590
+ lineUpBoldDownBoldLeftRightBold: "\u254A",
591
+ lineUpBoldDownBoldLeftBoldRight: "\u2549",
592
+ lineUpBoldDownLeftRight: "\u2540",
593
+ lineUpDownBoldLeftRight: "\u2541",
594
+ lineUpDownLeftBoldRight: "\u253D",
595
+ lineUpDownLeftRightBold: "\u253E",
596
+ lineUpBoldDownBoldLeftRight: "\u2542",
597
+ lineUpDownLeftBoldRightBold: "\u253F",
598
+ lineUpBoldDownLeftBoldRight: "\u2543",
599
+ lineUpBoldDownLeftRightBold: "\u2544",
600
+ lineUpDownBoldLeftBoldRight: "\u2545",
601
+ lineUpDownBoldLeftRightBold: "\u2546",
602
+ lineUpDoubleDownDoubleLeftDoubleRightDouble: "\u256C",
603
+ lineUpDoubleDownDoubleLeftRight: "\u256B",
604
+ lineUpDownLeftDoubleRightDouble: "\u256A",
605
+ lineCross: "\u2573",
606
+ lineBackslash: "\u2572",
607
+ lineSlash: "\u2571"
608
+ };
609
+ var specialMainSymbols = {
610
+ tick: "\u2714",
611
+ info: "\u2139",
612
+ warning: "\u26A0",
613
+ cross: "\u2718",
614
+ squareSmall: "\u25FB",
615
+ squareSmallFilled: "\u25FC",
616
+ circle: "\u25EF",
617
+ circleFilled: "\u25C9",
618
+ circleDotted: "\u25CC",
619
+ circleDouble: "\u25CE",
620
+ circleCircle: "\u24DE",
621
+ circleCross: "\u24E7",
622
+ circlePipe: "\u24BE",
623
+ radioOn: "\u25C9",
624
+ radioOff: "\u25EF",
625
+ checkboxOn: "\u2612",
626
+ checkboxOff: "\u2610",
627
+ checkboxCircleOn: "\u24E7",
628
+ checkboxCircleOff: "\u24BE",
629
+ pointer: "\u276F",
630
+ triangleUpOutline: "\u25B3",
631
+ triangleLeft: "\u25C0",
632
+ triangleRight: "\u25B6",
633
+ lozenge: "\u25C6",
634
+ lozengeOutline: "\u25C7",
635
+ hamburger: "\u2630",
636
+ smiley: "\u32E1",
637
+ mustache: "\u0DF4",
638
+ star: "\u2605",
639
+ play: "\u25B6",
640
+ nodejs: "\u2B22",
641
+ oneSeventh: "\u2150",
642
+ oneNinth: "\u2151",
643
+ oneTenth: "\u2152"
644
+ };
645
+ var specialFallbackSymbols = {
646
+ tick: "\u221A",
647
+ info: "i",
648
+ warning: "\u203C",
649
+ cross: "\xD7",
650
+ squareSmall: "\u25A1",
651
+ squareSmallFilled: "\u25A0",
652
+ circle: "( )",
653
+ circleFilled: "(*)",
654
+ circleDotted: "( )",
655
+ circleDouble: "( )",
656
+ circleCircle: "(\u25CB)",
657
+ circleCross: "(\xD7)",
658
+ circlePipe: "(\u2502)",
659
+ radioOn: "(*)",
660
+ radioOff: "( )",
661
+ checkboxOn: "[\xD7]",
662
+ checkboxOff: "[ ]",
663
+ checkboxCircleOn: "(\xD7)",
664
+ checkboxCircleOff: "( )",
665
+ pointer: ">",
666
+ triangleUpOutline: "\u2206",
667
+ triangleLeft: "\u25C4",
668
+ triangleRight: "\u25BA",
669
+ lozenge: "\u2666",
670
+ lozengeOutline: "\u25CA",
671
+ hamburger: "\u2261",
672
+ smiley: "\u263A",
673
+ mustache: "\u250C\u2500\u2510",
674
+ star: "\u2736",
675
+ play: "\u25BA",
676
+ nodejs: "\u2666",
677
+ oneSeventh: "1/7",
678
+ oneNinth: "1/9",
679
+ oneTenth: "1/10"
680
+ };
681
+ var mainSymbols = {
682
+ ...common,
683
+ ...specialMainSymbols
684
+ };
685
+ var fallbackSymbols = {
686
+ ...common,
687
+ ...specialFallbackSymbols
688
+ };
689
+ var shouldUseMain = isUnicodeSupported();
690
+ var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
691
+ var dist_default = figures;
692
+ var replacements = Object.entries(specialMainSymbols);
693
+
694
+ // node_modules/@inquirer/core/dist/lib/theme.js
695
+ var defaultTheme = {
696
+ prefix: {
697
+ idle: styleText("blue", "?"),
698
+ done: styleText("green", dist_default.tick)
699
+ },
700
+ spinner: {
701
+ interval: 80,
702
+ frames: ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"].map((frame) => styleText("yellow", frame))
703
+ },
704
+ keybindings: [],
705
+ style: {
706
+ answer: (text) => styleText("cyan", text),
707
+ message: (text) => styleText("bold", text),
708
+ error: (text) => styleText("red", `> ${text}`),
709
+ defaultAnswer: (text) => styleText("dim", `(${text})`),
710
+ help: (text) => styleText("dim", text),
711
+ highlight: (text) => styleText("cyan", text),
712
+ key: (text) => styleText("cyan", styleText("bold", `<${text}>`))
713
+ }
714
+ };
715
+ function getDefaultTheme() {
716
+ return {
717
+ ...defaultTheme,
718
+ keybindings: getDefaultKeybindings()
719
+ };
720
+ }
721
+
722
+ // node_modules/@inquirer/core/dist/lib/make-theme.js
723
+ function isPlainObject(value) {
724
+ if (typeof value !== "object" || value === null)
725
+ return false;
726
+ let proto = value;
727
+ while (Object.getPrototypeOf(proto) !== null) {
728
+ proto = Object.getPrototypeOf(proto);
729
+ }
730
+ return Object.getPrototypeOf(value) === proto;
731
+ }
732
+ function deepMerge(...objects) {
733
+ const output = {};
734
+ for (const obj of objects) {
735
+ for (const [key, value] of Object.entries(obj)) {
736
+ const prevValue = output[key];
737
+ output[key] = isPlainObject(prevValue) && isPlainObject(value) ? deepMerge(prevValue, value) : value;
738
+ }
739
+ }
740
+ return output;
741
+ }
742
+ function makeTheme(...themes) {
743
+ const themesToMerge = [
744
+ getDefaultTheme(),
745
+ ...themes.filter((theme) => theme != null)
746
+ ];
747
+ return deepMerge(...themesToMerge);
748
+ }
749
+
750
+ // node_modules/@inquirer/core/dist/lib/use-prefix.js
751
+ function usePrefix({ status = "idle", theme }) {
752
+ const [showLoader, setShowLoader] = useState(false);
753
+ const [tick, setTick] = useState(0);
754
+ const { prefix, spinner } = makeTheme(theme);
755
+ useEffect(() => {
756
+ if (status === "loading") {
757
+ let tickInterval;
758
+ let inc = -1;
759
+ const delayTimeout = setTimeout(() => {
760
+ setShowLoader(true);
761
+ tickInterval = setInterval(() => {
762
+ inc = inc + 1;
763
+ setTick(inc % spinner.frames.length);
764
+ }, spinner.interval);
765
+ }, 300);
766
+ return () => {
767
+ clearTimeout(delayTimeout);
768
+ clearInterval(tickInterval);
769
+ };
770
+ } else {
771
+ setShowLoader(false);
772
+ }
773
+ }, [status]);
774
+ if (showLoader) {
775
+ return spinner.frames[tick];
776
+ }
777
+ const iconName = status === "loading" ? "idle" : status;
778
+ return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
779
+ }
780
+
781
+ // node_modules/@inquirer/core/dist/lib/use-memo.js
782
+ function useMemo(fn, dependencies) {
783
+ return withPointer((pointer) => {
784
+ const prev = pointer.get();
785
+ if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i) => dep !== dependencies[i])) {
786
+ const value = fn();
787
+ pointer.set({ value, dependencies });
788
+ return value;
789
+ }
790
+ return prev.value;
791
+ });
792
+ }
793
+
794
+ // node_modules/@inquirer/core/dist/lib/use-ref.js
795
+ function useRef(val) {
796
+ return useState({ current: val })[0];
797
+ }
798
+
799
+ // node_modules/@inquirer/core/dist/lib/use-keypress.js
800
+ function useKeypress(userHandler) {
801
+ const signal = useRef(userHandler);
802
+ signal.current = userHandler;
803
+ useEffect((rl) => {
804
+ let ignore = false;
805
+ const handler = withUpdates((_input, event) => {
806
+ if (ignore)
807
+ return;
808
+ void signal.current(event, rl);
809
+ });
810
+ rl.input.on("keypress", handler);
811
+ return () => {
812
+ ignore = true;
813
+ rl.input.removeListener("keypress", handler);
814
+ };
815
+ }, []);
816
+ }
817
+
818
+ // node_modules/@inquirer/core/dist/lib/utils.js
819
+ var import_cli_width = __toESM(require_cli_width(), 1);
820
+
821
+ // node_modules/fast-string-truncated-width/dist/utils.js
822
+ var getCodePointsLength = /* @__PURE__ */ (() => {
823
+ const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
824
+ return (input) => {
825
+ let surrogatePairsNr = 0;
826
+ SURROGATE_PAIR_RE.lastIndex = 0;
827
+ while (SURROGATE_PAIR_RE.test(input)) {
828
+ surrogatePairsNr += 1;
829
+ }
830
+ return input.length - surrogatePairsNr;
831
+ };
832
+ })();
833
+ var isFullWidth = (x) => {
834
+ return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
835
+ };
836
+ var isWideNotCJKTNotEmoji = (x) => {
837
+ return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
838
+ };
839
+
840
+ // node_modules/fast-string-truncated-width/dist/index.js
841
+ var ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
842
+ var CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
843
+ var CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
844
+ var TAB_RE = /\t{1,1000}/y;
845
+ var EMOJI_RE = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
846
+ var LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
847
+ var MODIFIER_RE = new RegExp("\\p{M}+", "gu");
848
+ var NO_TRUNCATION = { limit: Infinity, ellipsis: "" };
849
+ var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
850
+ const LIMIT = truncationOptions.limit ?? Infinity;
851
+ const ELLIPSIS = truncationOptions.ellipsis ?? "";
852
+ const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
853
+ const ANSI_WIDTH = 0;
854
+ const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
855
+ const TAB_WIDTH = widthOptions.tabWidth ?? 8;
856
+ const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
857
+ const FULL_WIDTH_WIDTH = 2;
858
+ const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
859
+ const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
860
+ const PARSE_BLOCKS = [
861
+ [LATIN_RE, REGULAR_WIDTH],
862
+ [ANSI_RE, ANSI_WIDTH],
863
+ [CONTROL_RE, CONTROL_WIDTH],
864
+ [TAB_RE, TAB_WIDTH],
865
+ [EMOJI_RE, EMOJI_WIDTH],
866
+ [CJKT_WIDE_RE, WIDE_WIDTH]
867
+ ];
868
+ let indexPrev = 0;
869
+ let index = 0;
870
+ let length = input.length;
871
+ let lengthExtra = 0;
872
+ let truncationEnabled = false;
873
+ let truncationIndex = length;
874
+ let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);
875
+ let unmatchedStart = 0;
876
+ let unmatchedEnd = 0;
877
+ let width = 0;
878
+ let widthExtra = 0;
879
+ outer: while (true) {
880
+ if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
881
+ const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
882
+ lengthExtra = 0;
883
+ for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
884
+ const codePoint = char.codePointAt(0) || 0;
885
+ if (isFullWidth(codePoint)) {
886
+ widthExtra = FULL_WIDTH_WIDTH;
887
+ } else if (isWideNotCJKTNotEmoji(codePoint)) {
888
+ widthExtra = WIDE_WIDTH;
889
+ } else {
890
+ widthExtra = REGULAR_WIDTH;
891
+ }
892
+ if (width + widthExtra > truncationLimit) {
893
+ truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
894
+ }
895
+ if (width + widthExtra > LIMIT) {
896
+ truncationEnabled = true;
897
+ break outer;
898
+ }
899
+ lengthExtra += char.length;
900
+ width += widthExtra;
901
+ }
902
+ unmatchedStart = unmatchedEnd = 0;
903
+ }
904
+ if (index >= length) {
905
+ break outer;
906
+ }
907
+ for (let i = 0, l = PARSE_BLOCKS.length; i < l; i++) {
908
+ const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
909
+ BLOCK_RE.lastIndex = index;
910
+ if (BLOCK_RE.test(input)) {
911
+ lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
912
+ widthExtra = lengthExtra * BLOCK_WIDTH;
913
+ if (width + widthExtra > truncationLimit) {
914
+ truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
915
+ }
916
+ if (width + widthExtra > LIMIT) {
917
+ truncationEnabled = true;
918
+ break outer;
919
+ }
920
+ width += widthExtra;
921
+ unmatchedStart = indexPrev;
922
+ unmatchedEnd = index;
923
+ index = indexPrev = BLOCK_RE.lastIndex;
924
+ continue outer;
925
+ }
926
+ }
927
+ index += 1;
928
+ }
929
+ return {
930
+ width: truncationEnabled ? truncationLimit : width,
931
+ index: truncationEnabled ? truncationIndex : length,
932
+ truncated: truncationEnabled,
933
+ ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
934
+ };
935
+ };
936
+ var dist_default2 = getStringTruncatedWidth;
937
+
938
+ // node_modules/fast-string-width/dist/index.js
939
+ var NO_TRUNCATION2 = {
940
+ limit: Infinity,
941
+ ellipsis: "",
942
+ ellipsisWidth: 0
943
+ };
944
+ var fastStringWidth = (input, options = {}) => {
945
+ return dist_default2(input, NO_TRUNCATION2, options).width;
946
+ };
947
+ var dist_default3 = fastStringWidth;
948
+
949
+ // node_modules/fast-wrap-ansi/lib/main.js
950
+ var ESC = "\x1B";
951
+ var CSI = "\x9B";
952
+ var END_CODE = 39;
953
+ var ANSI_ESCAPE_BELL = "\x07";
954
+ var ANSI_CSI = "[";
955
+ var ANSI_OSC = "]";
956
+ var ANSI_SGR_TERMINATOR = "m";
957
+ var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
958
+ var GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
959
+ var getClosingCode = (openingCode) => {
960
+ if (openingCode >= 30 && openingCode <= 37)
961
+ return 39;
962
+ if (openingCode >= 90 && openingCode <= 97)
963
+ return 39;
964
+ if (openingCode >= 40 && openingCode <= 47)
965
+ return 49;
966
+ if (openingCode >= 100 && openingCode <= 107)
967
+ return 49;
968
+ if (openingCode === 1 || openingCode === 2)
969
+ return 22;
970
+ if (openingCode === 3)
971
+ return 23;
972
+ if (openingCode === 4)
973
+ return 24;
974
+ if (openingCode === 7)
975
+ return 27;
976
+ if (openingCode === 8)
977
+ return 28;
978
+ if (openingCode === 9)
979
+ return 29;
980
+ if (openingCode === 0)
981
+ return 0;
982
+ return void 0;
983
+ };
984
+ var wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
985
+ var wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
986
+ var wrapWord = (rows, word, columns) => {
987
+ const characters = word[Symbol.iterator]();
988
+ let isInsideEscape = false;
989
+ let isInsideLinkEscape = false;
990
+ let lastRow = rows.at(-1);
991
+ let visible = lastRow === void 0 ? 0 : dist_default3(lastRow);
992
+ let currentCharacter = characters.next();
993
+ let nextCharacter = characters.next();
994
+ let rawCharacterIndex = 0;
995
+ while (!currentCharacter.done) {
996
+ const character = currentCharacter.value;
997
+ const characterLength = dist_default3(character);
998
+ if (visible + characterLength <= columns) {
999
+ rows[rows.length - 1] += character;
1000
+ } else {
1001
+ rows.push(character);
1002
+ visible = 0;
1003
+ }
1004
+ if (character === ESC || character === CSI) {
1005
+ isInsideEscape = true;
1006
+ isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
1007
+ }
1008
+ if (isInsideEscape) {
1009
+ if (isInsideLinkEscape) {
1010
+ if (character === ANSI_ESCAPE_BELL) {
1011
+ isInsideEscape = false;
1012
+ isInsideLinkEscape = false;
1013
+ }
1014
+ } else if (character === ANSI_SGR_TERMINATOR) {
1015
+ isInsideEscape = false;
1016
+ }
1017
+ } else {
1018
+ visible += characterLength;
1019
+ if (visible === columns && !nextCharacter.done) {
1020
+ rows.push("");
1021
+ visible = 0;
1022
+ }
1023
+ }
1024
+ currentCharacter = nextCharacter;
1025
+ nextCharacter = characters.next();
1026
+ rawCharacterIndex += character.length;
1027
+ }
1028
+ lastRow = rows.at(-1);
1029
+ if (!visible && lastRow !== void 0 && lastRow.length && rows.length > 1) {
1030
+ rows[rows.length - 2] += rows.pop();
1031
+ }
1032
+ };
1033
+ var stringVisibleTrimSpacesRight = (string) => {
1034
+ const words = string.split(" ");
1035
+ let last = words.length;
1036
+ while (last) {
1037
+ if (dist_default3(words[last - 1])) {
1038
+ break;
1039
+ }
1040
+ last--;
1041
+ }
1042
+ if (last === words.length) {
1043
+ return string;
1044
+ }
1045
+ return words.slice(0, last).join(" ") + words.slice(last).join("");
1046
+ };
1047
+ var exec = (string, columns, options = {}) => {
1048
+ if (options.trim !== false && string.trim() === "") {
1049
+ return "";
1050
+ }
1051
+ let returnValue = "";
1052
+ let escapeCode;
1053
+ let escapeUrl;
1054
+ const words = string.split(" ");
1055
+ let rows = [""];
1056
+ let rowLength = 0;
1057
+ for (let index = 0; index < words.length; index++) {
1058
+ const word = words[index];
1059
+ if (options.trim !== false) {
1060
+ const row = rows.at(-1) ?? "";
1061
+ const trimmed = row.trimStart();
1062
+ if (row.length !== trimmed.length) {
1063
+ rows[rows.length - 1] = trimmed;
1064
+ rowLength = dist_default3(trimmed);
1065
+ }
1066
+ }
1067
+ if (index !== 0) {
1068
+ if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
1069
+ rows.push("");
1070
+ rowLength = 0;
1071
+ }
1072
+ if (rowLength || options.trim === false) {
1073
+ rows[rows.length - 1] += " ";
1074
+ rowLength++;
1075
+ }
1076
+ }
1077
+ const wordLength = dist_default3(word);
1078
+ if (options.hard && wordLength > columns) {
1079
+ const remainingColumns = columns - rowLength;
1080
+ const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
1081
+ const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);
1082
+ if (breaksStartingNextLine < breaksStartingThisLine) {
1083
+ rows.push("");
1084
+ }
1085
+ wrapWord(rows, word, columns);
1086
+ rowLength = dist_default3(rows.at(-1) ?? "");
1087
+ continue;
1088
+ }
1089
+ if (rowLength + wordLength > columns && rowLength && wordLength) {
1090
+ if (options.wordWrap === false && rowLength < columns) {
1091
+ wrapWord(rows, word, columns);
1092
+ rowLength = dist_default3(rows.at(-1) ?? "");
1093
+ continue;
1094
+ }
1095
+ rows.push("");
1096
+ rowLength = 0;
1097
+ }
1098
+ if (rowLength + wordLength > columns && options.wordWrap === false) {
1099
+ wrapWord(rows, word, columns);
1100
+ rowLength = dist_default3(rows.at(-1) ?? "");
1101
+ continue;
1102
+ }
1103
+ rows[rows.length - 1] += word;
1104
+ rowLength += wordLength;
1105
+ }
1106
+ if (options.trim !== false) {
1107
+ rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
1108
+ }
1109
+ const preString = rows.join("\n");
1110
+ let inSurrogate = false;
1111
+ for (let i = 0; i < preString.length; i++) {
1112
+ const character = preString[i];
1113
+ returnValue += character;
1114
+ if (!inSurrogate) {
1115
+ inSurrogate = character >= "\uD800" && character <= "\uDBFF";
1116
+ if (inSurrogate) {
1117
+ continue;
1118
+ }
1119
+ } else {
1120
+ inSurrogate = false;
1121
+ }
1122
+ if (character === ESC || character === CSI) {
1123
+ GROUP_REGEX.lastIndex = i + 1;
1124
+ const groupsResult = GROUP_REGEX.exec(preString);
1125
+ const groups = groupsResult?.groups;
1126
+ if (groups?.code !== void 0) {
1127
+ const code = Number.parseFloat(groups.code);
1128
+ escapeCode = code === END_CODE ? void 0 : code;
1129
+ } else if (groups?.uri !== void 0) {
1130
+ escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
1131
+ }
1132
+ }
1133
+ if (preString[i + 1] === "\n") {
1134
+ if (escapeUrl) {
1135
+ returnValue += wrapAnsiHyperlink("");
1136
+ }
1137
+ const closingCode = escapeCode ? getClosingCode(escapeCode) : void 0;
1138
+ if (escapeCode && closingCode) {
1139
+ returnValue += wrapAnsiCode(closingCode);
1140
+ }
1141
+ } else if (character === "\n") {
1142
+ if (escapeCode && getClosingCode(escapeCode)) {
1143
+ returnValue += wrapAnsiCode(escapeCode);
1144
+ }
1145
+ if (escapeUrl) {
1146
+ returnValue += wrapAnsiHyperlink(escapeUrl);
1147
+ }
1148
+ }
1149
+ }
1150
+ return returnValue;
1151
+ };
1152
+ var CRLF_OR_LF = /\r?\n/;
1153
+ function wrapAnsi(string, columns, options) {
1154
+ return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
1155
+ }
1156
+
1157
+ // node_modules/@inquirer/core/dist/lib/utils.js
1158
+ function breakLines(content, width) {
1159
+ return content.split("\n").flatMap((line) => wrapAnsi(line, width, { trim: false, wordWrap: false }).split("\n").map((str) => str.trimEnd())).join("\n");
1160
+ }
1161
+ function readlineWidth() {
1162
+ return (0, import_cli_width.default)({ defaultWidth: 80, output: readline().output });
1163
+ }
1164
+
1165
+ // node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
1166
+ function usePointerPosition({ active, renderedItems, pageSize, loop }) {
1167
+ const state = useRef({
1168
+ lastPointer: active,
1169
+ lastActive: void 0
1170
+ });
1171
+ const { lastPointer, lastActive } = state.current;
1172
+ const middle = Math.floor(pageSize / 2);
1173
+ const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
1174
+ const defaultPointerPosition = renderedItems.slice(0, active).reduce((acc, item) => acc + item.length, 0);
1175
+ let pointer = defaultPointerPosition;
1176
+ if (renderedLength > pageSize) {
1177
+ if (loop) {
1178
+ pointer = lastPointer;
1179
+ if (
1180
+ // First render, skip this logic.
1181
+ lastActive != null && // Only move the pointer down when the user moves down.
1182
+ lastActive < active && // Check user didn't move up across page boundary.
1183
+ active - lastActive < pageSize
1184
+ ) {
1185
+ pointer = Math.min(
1186
+ // Furthest allowed position for the pointer is the middle of the list
1187
+ middle,
1188
+ Math.abs(active - lastActive) === 1 ? Math.min(
1189
+ // Move the pointer at most the height of the last active item.
1190
+ lastPointer + (renderedItems[lastActive]?.length ?? 0),
1191
+ // If the user moved by one item, move the pointer to the natural position of the active item as
1192
+ // long as it doesn't move the cursor up.
1193
+ Math.max(defaultPointerPosition, lastPointer)
1194
+ ) : (
1195
+ // Otherwise, move the pointer down by the difference between the active and last active item.
1196
+ lastPointer + active - lastActive
1197
+ )
1198
+ );
1199
+ }
1200
+ } else {
1201
+ const spaceUnderActive = renderedItems.slice(active).reduce((acc, item) => acc + item.length, 0);
1202
+ pointer = spaceUnderActive < pageSize - middle ? (
1203
+ // If the active item is near the end of the list, progressively move the cursor towards the end.
1204
+ pageSize - spaceUnderActive
1205
+ ) : (
1206
+ // Otherwise, progressively move the pointer to the middle of the list.
1207
+ Math.min(defaultPointerPosition, middle)
1208
+ );
1209
+ }
1210
+ }
1211
+ state.current.lastPointer = pointer;
1212
+ state.current.lastActive = active;
1213
+ return pointer;
1214
+ }
1215
+ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
1216
+ const width = readlineWidth();
1217
+ const bound = (num) => (num % items.length + items.length) % items.length;
1218
+ const renderedItems = items.map((item, index) => {
1219
+ if (item == null)
1220
+ return [];
1221
+ return breakLines(renderItem({ item, index, isActive: index === active }), width).split("\n");
1222
+ });
1223
+ const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
1224
+ const renderItemAtIndex = (index) => renderedItems[index] ?? [];
1225
+ const pointer = usePointerPosition({ active, renderedItems, pageSize, loop });
1226
+ const activeItem = renderItemAtIndex(active).slice(0, pageSize);
1227
+ const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length;
1228
+ const pageBuffer = Array.from({ length: pageSize });
1229
+ pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem);
1230
+ const itemVisited = /* @__PURE__ */ new Set([active]);
1231
+ let bufferPointer = activeItemPosition + activeItem.length;
1232
+ let itemPointer = bound(active + 1);
1233
+ while (bufferPointer < pageSize && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) {
1234
+ const lines = renderItemAtIndex(itemPointer);
1235
+ const linesToAdd = lines.slice(0, pageSize - bufferPointer);
1236
+ pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd);
1237
+ itemVisited.add(itemPointer);
1238
+ bufferPointer += linesToAdd.length;
1239
+ itemPointer = bound(itemPointer + 1);
1240
+ }
1241
+ bufferPointer = activeItemPosition - 1;
1242
+ itemPointer = bound(active - 1);
1243
+ while (bufferPointer >= 0 && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) {
1244
+ const lines = renderItemAtIndex(itemPointer);
1245
+ const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1));
1246
+ pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd);
1247
+ itemVisited.add(itemPointer);
1248
+ bufferPointer -= linesToAdd.length;
1249
+ itemPointer = bound(itemPointer - 1);
1250
+ }
1251
+ return pageBuffer.filter((line) => typeof line === "string").join("\n");
1252
+ }
1253
+
1254
+ // node_modules/@inquirer/core/dist/lib/create-prompt.js
1255
+ var import_mute_stream = __toESM(require_lib(), 1);
1256
+ import * as readline2 from "node:readline";
1257
+ import { AsyncResource as AsyncResource3 } from "node:async_hooks";
1258
+
1259
+ // node_modules/signal-exit/dist/mjs/signals.js
1260
+ var signals = [];
1261
+ signals.push("SIGHUP", "SIGINT", "SIGTERM");
1262
+ if (process.platform !== "win32") {
1263
+ signals.push(
1264
+ "SIGALRM",
1265
+ "SIGABRT",
1266
+ "SIGVTALRM",
1267
+ "SIGXCPU",
1268
+ "SIGXFSZ",
1269
+ "SIGUSR2",
1270
+ "SIGTRAP",
1271
+ "SIGSYS",
1272
+ "SIGQUIT",
1273
+ "SIGIOT"
1274
+ // should detect profiler and enable/disable accordingly.
1275
+ // see #21
1276
+ // 'SIGPROF'
1277
+ );
1278
+ }
1279
+ if (process.platform === "linux") {
1280
+ signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
1281
+ }
1282
+
1283
+ // node_modules/signal-exit/dist/mjs/index.js
1284
+ var processOk = (process4) => !!process4 && typeof process4 === "object" && typeof process4.removeListener === "function" && typeof process4.emit === "function" && typeof process4.reallyExit === "function" && typeof process4.listeners === "function" && typeof process4.kill === "function" && typeof process4.pid === "number" && typeof process4.on === "function";
1285
+ var kExitEmitter = /* @__PURE__ */ Symbol.for("signal-exit emitter");
1286
+ var global = globalThis;
1287
+ var ObjectDefineProperty = Object.defineProperty.bind(Object);
1288
+ var Emitter = class {
1289
+ emitted = {
1290
+ afterExit: false,
1291
+ exit: false
1292
+ };
1293
+ listeners = {
1294
+ afterExit: [],
1295
+ exit: []
1296
+ };
1297
+ count = 0;
1298
+ id = Math.random();
1299
+ constructor() {
1300
+ if (global[kExitEmitter]) {
1301
+ return global[kExitEmitter];
1302
+ }
1303
+ ObjectDefineProperty(global, kExitEmitter, {
1304
+ value: this,
1305
+ writable: false,
1306
+ enumerable: false,
1307
+ configurable: false
1308
+ });
1309
+ }
1310
+ on(ev, fn) {
1311
+ this.listeners[ev].push(fn);
1312
+ }
1313
+ removeListener(ev, fn) {
1314
+ const list = this.listeners[ev];
1315
+ const i = list.indexOf(fn);
1316
+ if (i === -1) {
1317
+ return;
1318
+ }
1319
+ if (i === 0 && list.length === 1) {
1320
+ list.length = 0;
1321
+ } else {
1322
+ list.splice(i, 1);
1323
+ }
1324
+ }
1325
+ emit(ev, code, signal) {
1326
+ if (this.emitted[ev]) {
1327
+ return false;
1328
+ }
1329
+ this.emitted[ev] = true;
1330
+ let ret = false;
1331
+ for (const fn of this.listeners[ev]) {
1332
+ ret = fn(code, signal) === true || ret;
1333
+ }
1334
+ if (ev === "exit") {
1335
+ ret = this.emit("afterExit", code, signal) || ret;
1336
+ }
1337
+ return ret;
1338
+ }
1339
+ };
1340
+ var SignalExitBase = class {
1341
+ };
1342
+ var signalExitWrap = (handler) => {
1343
+ return {
1344
+ onExit(cb, opts) {
1345
+ return handler.onExit(cb, opts);
1346
+ },
1347
+ load() {
1348
+ return handler.load();
1349
+ },
1350
+ unload() {
1351
+ return handler.unload();
1352
+ }
1353
+ };
1354
+ };
1355
+ var SignalExitFallback = class extends SignalExitBase {
1356
+ onExit() {
1357
+ return () => {
1358
+ };
1359
+ }
1360
+ load() {
1361
+ }
1362
+ unload() {
1363
+ }
1364
+ };
1365
+ var SignalExit = class extends SignalExitBase {
1366
+ // "SIGHUP" throws an `ENOSYS` error on Windows,
1367
+ // so use a supported signal instead
1368
+ /* c8 ignore start */
1369
+ #hupSig = process3.platform === "win32" ? "SIGINT" : "SIGHUP";
1370
+ /* c8 ignore stop */
1371
+ #emitter = new Emitter();
1372
+ #process;
1373
+ #originalProcessEmit;
1374
+ #originalProcessReallyExit;
1375
+ #sigListeners = {};
1376
+ #loaded = false;
1377
+ constructor(process4) {
1378
+ super();
1379
+ this.#process = process4;
1380
+ this.#sigListeners = {};
1381
+ for (const sig of signals) {
1382
+ this.#sigListeners[sig] = () => {
1383
+ const listeners = this.#process.listeners(sig);
1384
+ let { count } = this.#emitter;
1385
+ const p = process4;
1386
+ if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
1387
+ count += p.__signal_exit_emitter__.count;
1388
+ }
1389
+ if (listeners.length === count) {
1390
+ this.unload();
1391
+ const ret = this.#emitter.emit("exit", null, sig);
1392
+ const s = sig === "SIGHUP" ? this.#hupSig : sig;
1393
+ if (!ret)
1394
+ process4.kill(process4.pid, s);
1395
+ }
1396
+ };
1397
+ }
1398
+ this.#originalProcessReallyExit = process4.reallyExit;
1399
+ this.#originalProcessEmit = process4.emit;
1400
+ }
1401
+ onExit(cb, opts) {
1402
+ if (!processOk(this.#process)) {
1403
+ return () => {
1404
+ };
1405
+ }
1406
+ if (this.#loaded === false) {
1407
+ this.load();
1408
+ }
1409
+ const ev = opts?.alwaysLast ? "afterExit" : "exit";
1410
+ this.#emitter.on(ev, cb);
1411
+ return () => {
1412
+ this.#emitter.removeListener(ev, cb);
1413
+ if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
1414
+ this.unload();
1415
+ }
1416
+ };
1417
+ }
1418
+ load() {
1419
+ if (this.#loaded) {
1420
+ return;
1421
+ }
1422
+ this.#loaded = true;
1423
+ this.#emitter.count += 1;
1424
+ for (const sig of signals) {
1425
+ try {
1426
+ const fn = this.#sigListeners[sig];
1427
+ if (fn)
1428
+ this.#process.on(sig, fn);
1429
+ } catch (_) {
1430
+ }
1431
+ }
1432
+ this.#process.emit = (ev, ...a) => {
1433
+ return this.#processEmit(ev, ...a);
1434
+ };
1435
+ this.#process.reallyExit = (code) => {
1436
+ return this.#processReallyExit(code);
1437
+ };
1438
+ }
1439
+ unload() {
1440
+ if (!this.#loaded) {
1441
+ return;
1442
+ }
1443
+ this.#loaded = false;
1444
+ signals.forEach((sig) => {
1445
+ const listener = this.#sigListeners[sig];
1446
+ if (!listener) {
1447
+ throw new Error("Listener not defined for signal: " + sig);
1448
+ }
1449
+ try {
1450
+ this.#process.removeListener(sig, listener);
1451
+ } catch (_) {
1452
+ }
1453
+ });
1454
+ this.#process.emit = this.#originalProcessEmit;
1455
+ this.#process.reallyExit = this.#originalProcessReallyExit;
1456
+ this.#emitter.count -= 1;
1457
+ }
1458
+ #processReallyExit(code) {
1459
+ if (!processOk(this.#process)) {
1460
+ return 0;
1461
+ }
1462
+ this.#process.exitCode = code || 0;
1463
+ this.#emitter.emit("exit", this.#process.exitCode, null);
1464
+ return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
1465
+ }
1466
+ #processEmit(ev, ...args) {
1467
+ const og = this.#originalProcessEmit;
1468
+ if (ev === "exit" && processOk(this.#process)) {
1469
+ if (typeof args[0] === "number") {
1470
+ this.#process.exitCode = args[0];
1471
+ }
1472
+ const ret = og.call(this.#process, ev, ...args);
1473
+ this.#emitter.emit("exit", this.#process.exitCode, null);
1474
+ return ret;
1475
+ } else {
1476
+ return og.call(this.#process, ev, ...args);
1477
+ }
1478
+ }
1479
+ };
1480
+ var process3 = globalThis.process;
1481
+ var {
1482
+ /**
1483
+ * Called when the process is exiting, whether via signal, explicit
1484
+ * exit, or running out of stuff to do.
1485
+ *
1486
+ * If the global process object is not suitable for instrumentation,
1487
+ * then this will be a no-op.
1488
+ *
1489
+ * Returns a function that may be used to unload signal-exit.
1490
+ */
1491
+ onExit,
1492
+ /**
1493
+ * Load the listeners. Likely you never need to call this, unless
1494
+ * doing a rather deep integration with signal-exit functionality.
1495
+ * Mostly exposed for the benefit of testing.
1496
+ *
1497
+ * @internal
1498
+ */
1499
+ load,
1500
+ /**
1501
+ * Unload the listeners. Likely you never need to call this, unless
1502
+ * doing a rather deep integration with signal-exit functionality.
1503
+ * Mostly exposed for the benefit of testing.
1504
+ *
1505
+ * @internal
1506
+ */
1507
+ unload
1508
+ } = signalExitWrap(processOk(process3) ? new SignalExit(process3) : new SignalExitFallback());
1509
+
1510
+ // node_modules/@inquirer/core/dist/lib/screen-manager.js
1511
+ import { stripVTControlCharacters } from "node:util";
1512
+
1513
+ // node_modules/@inquirer/ansi/dist/index.js
1514
+ var ESC2 = "\x1B[";
1515
+ var cursorLeft = ESC2 + "G";
1516
+ var cursorHide = ESC2 + "?25l";
1517
+ var cursorShow = ESC2 + "?25h";
1518
+ var cursorUp = (rows = 1) => rows > 0 ? `${ESC2}${rows}A` : "";
1519
+ var cursorDown = (rows = 1) => rows > 0 ? `${ESC2}${rows}B` : "";
1520
+ var cursorTo = (x, y) => {
1521
+ if (typeof y === "number" && !Number.isNaN(y)) {
1522
+ return `${ESC2}${y + 1};${x + 1}H`;
1523
+ }
1524
+ return `${ESC2}${x + 1}G`;
1525
+ };
1526
+ var eraseLine = ESC2 + "2K";
1527
+ var eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
1528
+
1529
+ // node_modules/@inquirer/core/dist/lib/screen-manager.js
1530
+ var height = (content) => content.split("\n").length;
1531
+ var lastLine = (content) => content.split("\n").pop() ?? "";
1532
+ var ScreenManager = class {
1533
+ // These variables are keeping information to allow correct prompt re-rendering
1534
+ height = 0;
1535
+ extraLinesUnderPrompt = 0;
1536
+ cursorPos;
1537
+ rl;
1538
+ constructor(rl) {
1539
+ this.rl = rl;
1540
+ this.cursorPos = rl.getCursorPos();
1541
+ }
1542
+ write(content) {
1543
+ this.rl.output.unmute();
1544
+ this.rl.output.write(content);
1545
+ this.rl.output.mute();
1546
+ }
1547
+ render(content, bottomContent = "") {
1548
+ const promptLine = lastLine(content);
1549
+ const rawPromptLine = stripVTControlCharacters(promptLine);
1550
+ let prompt = rawPromptLine;
1551
+ if (this.rl.line.length > 0) {
1552
+ prompt = prompt.slice(0, -this.rl.line.length);
1553
+ }
1554
+ this.rl.setPrompt(prompt);
1555
+ this.cursorPos = this.rl.getCursorPos();
1556
+ const width = readlineWidth();
1557
+ content = breakLines(content, width);
1558
+ bottomContent = breakLines(bottomContent, width);
1559
+ if (rawPromptLine.length % width === 0) {
1560
+ content += "\n";
1561
+ }
1562
+ let output = content + (bottomContent ? "\n" + bottomContent : "");
1563
+ const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;
1564
+ const bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0);
1565
+ if (bottomContentHeight > 0)
1566
+ output += cursorUp(bottomContentHeight);
1567
+ output += cursorTo(this.cursorPos.cols);
1568
+ this.write(cursorDown(this.extraLinesUnderPrompt) + eraseLines(this.height) + output);
1569
+ this.extraLinesUnderPrompt = bottomContentHeight;
1570
+ this.height = height(output);
1571
+ }
1572
+ checkCursorPos() {
1573
+ const cursorPos = this.rl.getCursorPos();
1574
+ if (cursorPos.cols !== this.cursorPos.cols) {
1575
+ this.write(cursorTo(cursorPos.cols));
1576
+ this.cursorPos = cursorPos;
1577
+ }
1578
+ }
1579
+ done({ clearContent }) {
1580
+ this.rl.setPrompt("");
1581
+ let output = cursorDown(this.extraLinesUnderPrompt);
1582
+ output += clearContent ? eraseLines(this.height) : "\n";
1583
+ output += cursorLeft;
1584
+ output += cursorShow;
1585
+ this.write(output);
1586
+ this.rl.close();
1587
+ }
1588
+ };
1589
+
1590
+ // node_modules/@inquirer/core/dist/lib/promise-polyfill.js
1591
+ var PromisePolyfill = class extends Promise {
1592
+ // Available starting from Node 22
1593
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers
1594
+ static withResolver() {
1595
+ let resolve;
1596
+ let reject;
1597
+ const promise = new Promise((res, rej) => {
1598
+ resolve = res;
1599
+ reject = rej;
1600
+ });
1601
+ return { promise, resolve, reject };
1602
+ }
1603
+ };
1604
+
1605
+ // node_modules/@inquirer/core/dist/lib/create-prompt.js
1606
+ import path from "node:path";
1607
+ var nativeSetImmediate = globalThis.setImmediate;
1608
+ function getCallSites() {
1609
+ const savedPrepareStackTrace = Error.prepareStackTrace;
1610
+ let result = [];
1611
+ try {
1612
+ Error.prepareStackTrace = (_, callSites) => {
1613
+ const callSitesWithoutCurrent = callSites.slice(1);
1614
+ result = callSitesWithoutCurrent;
1615
+ return callSitesWithoutCurrent;
1616
+ };
1617
+ new Error().stack;
1618
+ } catch {
1619
+ return result;
1620
+ }
1621
+ Error.prepareStackTrace = savedPrepareStackTrace;
1622
+ return result;
1623
+ }
1624
+ function createPrompt(view) {
1625
+ const callSites = getCallSites();
1626
+ const prompt = (config, context = {}) => {
1627
+ const { input = process.stdin, signal } = context;
1628
+ const cleanups = /* @__PURE__ */ new Set();
1629
+ const output = new import_mute_stream.default();
1630
+ output.pipe(context.output ?? process.stdout);
1631
+ const rl = readline2.createInterface({
1632
+ terminal: true,
1633
+ input,
1634
+ output
1635
+ });
1636
+ output.mute();
1637
+ const screen = new ScreenManager(rl);
1638
+ const { promise, resolve, reject } = PromisePolyfill.withResolver();
1639
+ const cancel = () => reject(new CancelPromptError());
1640
+ if (signal) {
1641
+ const abort = () => reject(new AbortPromptError({ cause: signal.reason }));
1642
+ if (signal.aborted) {
1643
+ abort();
1644
+ return Object.assign(promise, { cancel });
1645
+ }
1646
+ signal.addEventListener("abort", abort);
1647
+ cleanups.add(() => signal.removeEventListener("abort", abort));
1648
+ }
1649
+ cleanups.add(onExit((code, signal2) => {
1650
+ reject(new ExitPromptError(`User force closed the prompt with ${code} ${signal2}`));
1651
+ }));
1652
+ const sigint = () => reject(new ExitPromptError(`User force closed the prompt with SIGINT`));
1653
+ rl.on("SIGINT", sigint);
1654
+ cleanups.add(() => rl.removeListener("SIGINT", sigint));
1655
+ return withHooks(rl, (cycle) => {
1656
+ const hooksCleanup = AsyncResource3.bind(() => effectScheduler.clearAll());
1657
+ rl.on("close", hooksCleanup);
1658
+ cleanups.add(() => rl.removeListener("close", hooksCleanup));
1659
+ const startCycle = () => {
1660
+ const checkCursorPos = () => screen.checkCursorPos();
1661
+ rl.input.on("keypress", checkCursorPos);
1662
+ cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
1663
+ let pendingDone = null;
1664
+ cycle(() => {
1665
+ let effectsSettled = false;
1666
+ try {
1667
+ const nextView = view(config, (value) => {
1668
+ if (effectsSettled) {
1669
+ resolve(value);
1670
+ } else {
1671
+ pendingDone = { value };
1672
+ }
1673
+ });
1674
+ if (nextView === void 0) {
1675
+ let callerFilename = callSites[1]?.getFileName();
1676
+ if (callerFilename && !callerFilename.startsWith("file://")) {
1677
+ callerFilename = path.resolve(callerFilename);
1678
+ }
1679
+ throw new Error(`Prompt functions must return a string.
1680
+ at ${callerFilename}`);
1681
+ }
1682
+ const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
1683
+ screen.render(content, bottomContent);
1684
+ effectScheduler.run();
1685
+ } catch (error) {
1686
+ reject(error);
1687
+ }
1688
+ effectsSettled = true;
1689
+ if (pendingDone !== null) {
1690
+ const { value } = pendingDone;
1691
+ pendingDone = null;
1692
+ resolve(value);
1693
+ }
1694
+ });
1695
+ };
1696
+ if ("readableFlowing" in input) {
1697
+ nativeSetImmediate(startCycle);
1698
+ } else {
1699
+ startCycle();
1700
+ }
1701
+ return Object.assign(promise.then((answer) => {
1702
+ effectScheduler.clearAll();
1703
+ return answer;
1704
+ }, (error) => {
1705
+ effectScheduler.clearAll();
1706
+ throw error;
1707
+ }).finally(() => {
1708
+ cleanups.forEach((cleanup) => cleanup());
1709
+ screen.done({ clearContent: Boolean(context.clearPromptOnDone) });
1710
+ output.end();
1711
+ }).then(() => promise), { cancel });
1712
+ });
1713
+ };
1714
+ return prompt;
1715
+ }
1716
+
1717
+ // node_modules/@inquirer/core/dist/lib/Separator.js
1718
+ import { styleText as styleText2 } from "node:util";
1719
+ var Separator = class {
1720
+ separator = styleText2("dim", Array.from({ length: 15 }).join(dist_default.line));
1721
+ type = "separator";
1722
+ constructor(separator) {
1723
+ if (separator) {
1724
+ this.separator = separator;
1725
+ }
1726
+ }
1727
+ static isSeparator(choice) {
1728
+ return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
1729
+ }
1730
+ };
1731
+
1732
+ // node_modules/@inquirer/confirm/dist/index.js
1733
+ function getBooleanValue(value, defaultValue) {
1734
+ let answer = defaultValue !== false;
1735
+ if (/^(y|yes)/i.test(value))
1736
+ answer = true;
1737
+ else if (/^(n|no)/i.test(value))
1738
+ answer = false;
1739
+ return answer;
1740
+ }
1741
+ function boolToString(value) {
1742
+ return value ? "Yes" : "No";
1743
+ }
1744
+ var dist_default4 = createPrompt((config, done) => {
1745
+ const { transformer = boolToString } = config;
1746
+ const [status, setStatus] = useState("idle");
1747
+ const [value, setValue] = useState("");
1748
+ const theme = makeTheme(config.theme);
1749
+ const prefix = usePrefix({ status, theme });
1750
+ useKeypress((key, rl) => {
1751
+ if (status !== "idle")
1752
+ return;
1753
+ if (isEnterKey(key)) {
1754
+ const answer = getBooleanValue(value, config.default);
1755
+ setValue(transformer(answer));
1756
+ setStatus("done");
1757
+ done(answer);
1758
+ } else if (isTabKey(key)) {
1759
+ const answer = boolToString(!getBooleanValue(value, config.default));
1760
+ rl.clearLine(0);
1761
+ rl.write(answer);
1762
+ setValue(answer);
1763
+ } else {
1764
+ setValue(rl.line);
1765
+ }
1766
+ });
1767
+ let formattedValue = value;
1768
+ let defaultValue = "";
1769
+ if (status === "done") {
1770
+ formattedValue = theme.style.answer(value);
1771
+ } else {
1772
+ defaultValue = ` ${theme.style.defaultAnswer(config.default === false ? "y/N" : "Y/n")}`;
1773
+ }
1774
+ const message = theme.style.message(config.message, status);
1775
+ return `${prefix} ${message}${defaultValue} ${formattedValue}`;
1776
+ });
1777
+
1778
+ // node_modules/@inquirer/input/dist/index.js
1779
+ var inputTheme = {
1780
+ validationFailureMode: "keep"
1781
+ };
1782
+ var dist_default5 = createPrompt((config, done) => {
1783
+ const { prefill = "tab" } = config;
1784
+ const theme = makeTheme(inputTheme, config.theme);
1785
+ const [status, setStatus] = useState("idle");
1786
+ const [defaultValue, setDefaultValue] = useState(String(config.default ?? ""));
1787
+ const [errorMsg, setError] = useState();
1788
+ const [value, setValue] = useState("");
1789
+ const prefix = usePrefix({ status, theme });
1790
+ async function validate(value2) {
1791
+ const { required, pattern, patternError = "Invalid input" } = config;
1792
+ if (required && !value2) {
1793
+ return "You must provide a value";
1794
+ }
1795
+ if (pattern && !pattern.test(value2)) {
1796
+ return patternError;
1797
+ }
1798
+ if (typeof config.validate === "function") {
1799
+ return await config.validate(value2) || "You must provide a valid value";
1800
+ }
1801
+ return true;
1802
+ }
1803
+ useKeypress(async (key, rl) => {
1804
+ if (status !== "idle") {
1805
+ return;
1806
+ }
1807
+ if (isEnterKey(key)) {
1808
+ const answer = value || defaultValue;
1809
+ setStatus("loading");
1810
+ const isValid = await validate(answer);
1811
+ if (isValid === true) {
1812
+ setValue(answer);
1813
+ setStatus("done");
1814
+ done(answer);
1815
+ } else {
1816
+ if (theme.validationFailureMode === "clear") {
1817
+ setValue("");
1818
+ } else {
1819
+ rl.write(value);
1820
+ }
1821
+ setError(isValid);
1822
+ setStatus("idle");
1823
+ }
1824
+ } else if (isBackspaceKey(key) && !value) {
1825
+ setDefaultValue("");
1826
+ } else if (isTabKey(key) && !value) {
1827
+ setDefaultValue("");
1828
+ rl.clearLine(0);
1829
+ rl.write(defaultValue);
1830
+ setValue(defaultValue);
1831
+ } else {
1832
+ setValue(rl.line);
1833
+ setError(void 0);
1834
+ }
1835
+ });
1836
+ useEffect((rl) => {
1837
+ if (prefill === "editable" && defaultValue) {
1838
+ rl.write(defaultValue);
1839
+ setValue(defaultValue);
1840
+ }
1841
+ }, []);
1842
+ const message = theme.style.message(config.message, status);
1843
+ let formattedValue = value;
1844
+ if (typeof config.transformer === "function") {
1845
+ formattedValue = config.transformer(value, { isFinal: status === "done" });
1846
+ } else if (status === "done") {
1847
+ formattedValue = theme.style.answer(value);
1848
+ }
1849
+ let defaultStr;
1850
+ if (defaultValue && status !== "done" && !value) {
1851
+ defaultStr = theme.style.defaultAnswer(defaultValue);
1852
+ }
1853
+ let error = "";
1854
+ if (errorMsg) {
1855
+ error = theme.style.error(errorMsg);
1856
+ }
1857
+ return [
1858
+ [prefix, message, defaultStr, formattedValue].filter((v) => v !== void 0).join(" "),
1859
+ error
1860
+ ];
1861
+ });
1862
+
1863
+ // node_modules/@inquirer/select/dist/index.js
1864
+ import { styleText as styleText3 } from "node:util";
1865
+ var selectTheme = {
1866
+ icon: { cursor: dist_default.pointer },
1867
+ style: {
1868
+ disabled: (text) => styleText3("dim", text),
1869
+ description: (text) => styleText3("cyan", text),
1870
+ keysHelpTip: (keys) => keys.map(([key, action]) => `${styleText3("bold", key)} ${styleText3("dim", action)}`).join(styleText3("dim", " \u2022 "))
1871
+ },
1872
+ i18n: { disabledError: "This option is disabled and cannot be selected." },
1873
+ indexMode: "hidden"
1874
+ };
1875
+ function isSelectable(item) {
1876
+ return !Separator.isSeparator(item) && !item.disabled;
1877
+ }
1878
+ function isNavigable(item) {
1879
+ return !Separator.isSeparator(item);
1880
+ }
1881
+ function normalizeChoices(choices) {
1882
+ return choices.map((choice) => {
1883
+ if (Separator.isSeparator(choice))
1884
+ return choice;
1885
+ if (typeof choice !== "object" || choice === null || !("value" in choice)) {
1886
+ const name2 = String(choice);
1887
+ return {
1888
+ value: choice,
1889
+ name: name2,
1890
+ short: name2,
1891
+ disabled: false
1892
+ };
1893
+ }
1894
+ const name = choice.name ?? String(choice.value);
1895
+ const normalizedChoice = {
1896
+ value: choice.value,
1897
+ name,
1898
+ short: choice.short ?? name,
1899
+ disabled: choice.disabled ?? false
1900
+ };
1901
+ if (choice.description) {
1902
+ normalizedChoice.description = choice.description;
1903
+ }
1904
+ return normalizedChoice;
1905
+ });
1906
+ }
1907
+ var dist_default6 = createPrompt((config, done) => {
1908
+ const { loop = true, pageSize = 7 } = config;
1909
+ const theme = makeTheme(selectTheme, config.theme);
1910
+ const { keybindings: keybindings2 } = theme;
1911
+ const [status, setStatus] = useState("idle");
1912
+ const prefix = usePrefix({ status, theme });
1913
+ const searchTimeoutRef = useRef();
1914
+ const searchEnabled = !keybindings2.includes("vim");
1915
+ const items = useMemo(() => normalizeChoices(config.choices), [config.choices]);
1916
+ const bounds = useMemo(() => {
1917
+ const first = items.findIndex(isNavigable);
1918
+ const last = items.findLastIndex(isNavigable);
1919
+ if (first === -1) {
1920
+ throw new ValidationError("[select prompt] No selectable choices. All choices are disabled.");
1921
+ }
1922
+ return { first, last };
1923
+ }, [items]);
1924
+ const defaultItemIndex = useMemo(() => {
1925
+ if (!("default" in config))
1926
+ return -1;
1927
+ return items.findIndex((item) => isSelectable(item) && item.value === config.default);
1928
+ }, [config.default, items]);
1929
+ const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);
1930
+ const selectedChoice = items[active];
1931
+ if (selectedChoice == null || Separator.isSeparator(selectedChoice)) {
1932
+ throw new Error("Active index does not point to a choice");
1933
+ }
1934
+ const [errorMsg, setError] = useState();
1935
+ useKeypress((key, rl) => {
1936
+ clearTimeout(searchTimeoutRef.current);
1937
+ if (errorMsg) {
1938
+ setError(void 0);
1939
+ }
1940
+ if (isEnterKey(key)) {
1941
+ if (selectedChoice.disabled) {
1942
+ setError(theme.i18n.disabledError);
1943
+ } else {
1944
+ setStatus("done");
1945
+ done(selectedChoice.value);
1946
+ }
1947
+ } else if (isUpKey(key, keybindings2) || isDownKey(key, keybindings2)) {
1948
+ rl.clearLine(0);
1949
+ if (loop || isUpKey(key, keybindings2) && active !== bounds.first || isDownKey(key, keybindings2) && active !== bounds.last) {
1950
+ const offset = isUpKey(key, keybindings2) ? -1 : 1;
1951
+ let next = active;
1952
+ do {
1953
+ next = (next + offset + items.length) % items.length;
1954
+ } while (!isNavigable(items[next]));
1955
+ setActive(next);
1956
+ }
1957
+ } else if (isNumberKey(key) && !Number.isNaN(Number(rl.line))) {
1958
+ const selectedIndex = Number(rl.line) - 1;
1959
+ let selectableIndex = -1;
1960
+ const position = items.findIndex((item2) => {
1961
+ if (Separator.isSeparator(item2))
1962
+ return false;
1963
+ selectableIndex++;
1964
+ return selectableIndex === selectedIndex;
1965
+ });
1966
+ const item = items[position];
1967
+ if (item != null && isSelectable(item)) {
1968
+ setActive(position);
1969
+ }
1970
+ searchTimeoutRef.current = setTimeout(() => {
1971
+ rl.clearLine(0);
1972
+ }, 700);
1973
+ } else if (isBackspaceKey(key)) {
1974
+ rl.clearLine(0);
1975
+ } else if (searchEnabled) {
1976
+ const searchTerm = rl.line.toLowerCase();
1977
+ const matchIndex = items.findIndex((item) => {
1978
+ if (Separator.isSeparator(item) || !isSelectable(item))
1979
+ return false;
1980
+ return item.name.toLowerCase().startsWith(searchTerm);
1981
+ });
1982
+ if (matchIndex !== -1) {
1983
+ setActive(matchIndex);
1984
+ }
1985
+ searchTimeoutRef.current = setTimeout(() => {
1986
+ rl.clearLine(0);
1987
+ }, 700);
1988
+ }
1989
+ });
1990
+ useEffect(() => () => {
1991
+ clearTimeout(searchTimeoutRef.current);
1992
+ }, []);
1993
+ const message = theme.style.message(config.message, status);
1994
+ const helpLine = theme.style.keysHelpTip([
1995
+ ["\u2191\u2193", "navigate"],
1996
+ ["\u23CE", "select"]
1997
+ ]);
1998
+ let separatorCount = 0;
1999
+ const page = usePagination({
2000
+ items,
2001
+ active,
2002
+ renderItem({ item, isActive, index }) {
2003
+ if (Separator.isSeparator(item)) {
2004
+ separatorCount++;
2005
+ return ` ${item.separator}`;
2006
+ }
2007
+ const cursor = isActive ? theme.icon.cursor : " ";
2008
+ const indexLabel = theme.indexMode === "number" ? `${index + 1 - separatorCount}. ` : "";
2009
+ if (item.disabled) {
2010
+ const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
2011
+ const disabledCursor = isActive ? theme.icon.cursor : "-";
2012
+ return theme.style.disabled(`${disabledCursor} ${indexLabel}${item.name} ${disabledLabel}`);
2013
+ }
2014
+ const color = isActive ? theme.style.highlight : (x) => x;
2015
+ return color(`${cursor} ${indexLabel}${item.name}`);
2016
+ },
2017
+ pageSize,
2018
+ loop
2019
+ });
2020
+ if (status === "done") {
2021
+ return [prefix, message, theme.style.answer(selectedChoice.short)].filter(Boolean).join(" ");
2022
+ }
2023
+ const { description } = selectedChoice;
2024
+ const lines = [
2025
+ [prefix, message].filter(Boolean).join(" "),
2026
+ page,
2027
+ " ",
2028
+ description ? theme.style.description(description) : "",
2029
+ errorMsg ? theme.style.error(errorMsg) : "",
2030
+ helpLine
2031
+ ].filter(Boolean).join("\n").trimEnd();
2032
+ return `${lines}${cursorHide}`;
2033
+ });
2034
+ export {
2035
+ dist_default4 as confirm,
2036
+ dist_default5 as input,
2037
+ dist_default6 as select
2038
+ };