@socketsecurity/lib 5.19.0 → 5.20.1
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.
- package/CHANGELOG.md +44 -0
- package/dist/cache-with-ttl.d.ts +7 -0
- package/dist/cache-with-ttl.js +26 -7
- package/dist/constants/socket.js +1 -1
- package/dist/dlx/lockfile.js +4 -1
- package/dist/dlx/manifest.d.ts +10 -4
- package/dist/dlx/package.d.ts +1 -1
- package/dist/dlx/package.js +5 -2
- package/dist/external/@inquirer/checkbox.js +5 -0
- package/dist/external/@inquirer/confirm.js +5 -0
- package/dist/external/@inquirer/input.js +5 -0
- package/dist/external/@inquirer/password.js +5 -0
- package/dist/external/@inquirer/search.js +5 -0
- package/dist/external/@inquirer/select.js +5 -0
- package/dist/external/@npmcli/package-json/lib/read-package.js +40 -32
- package/dist/external/@npmcli/package-json/lib/sort.js +104 -92
- package/dist/external/@sinclair/typebox/value.js +9007 -0
- package/dist/external/@sinclair/typebox.js +7891 -0
- package/dist/external/external-pack.js +2749 -28
- package/dist/http-request.d.ts +0 -25
- package/dist/http-request.js +6 -5
- package/dist/ipc.js +43 -10
- package/dist/json/edit.d.ts +1 -1
- package/dist/memoization.js +6 -0
- package/dist/paths/packages.js +6 -2
- package/dist/promise-queue.js +1 -1
- package/dist/stdio/clear.d.ts +163 -0
- package/dist/stdio/clear.js +96 -0
- package/dist/stdio/progress.d.ts +152 -0
- package/dist/stdio/progress.js +217 -0
- package/dist/stdio/prompts.d.ts +196 -0
- package/dist/stdio/prompts.js +177 -0
- package/dist/tables.js +2 -3
- package/dist/validation/validate-schema.d.ts +124 -0
- package/dist/validation/validate-schema.js +108 -0
- package/package.json +25 -6
- package/dist/external/zod.js +0 -7825
- package/dist/zod.d.ts +0 -5
- package/dist/zod.js +0 -30
|
@@ -81,11 +81,11 @@ var require_cjs = __commonJS({
|
|
|
81
81
|
Object.defineProperty(exports2, "signals", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
82
82
|
return signals_js_1.signals;
|
|
83
83
|
}, "get") });
|
|
84
|
-
var
|
|
85
|
-
var
|
|
86
|
-
var
|
|
87
|
-
var
|
|
88
|
-
var
|
|
84
|
+
var processOk2 = /* @__PURE__ */ __name((process7) => !!process7 && typeof process7 === "object" && typeof process7.removeListener === "function" && typeof process7.emit === "function" && typeof process7.reallyExit === "function" && typeof process7.listeners === "function" && typeof process7.kill === "function" && typeof process7.pid === "number" && typeof process7.on === "function", "processOk");
|
|
85
|
+
var kExitEmitter2 = Symbol.for("signal-exit emitter");
|
|
86
|
+
var global2 = globalThis;
|
|
87
|
+
var ObjectDefineProperty2 = Object.defineProperty.bind(Object);
|
|
88
|
+
var Emitter2 = class {
|
|
89
89
|
static {
|
|
90
90
|
__name(this, "Emitter");
|
|
91
91
|
}
|
|
@@ -100,10 +100,10 @@ var require_cjs = __commonJS({
|
|
|
100
100
|
count = 0;
|
|
101
101
|
id = Math.random();
|
|
102
102
|
constructor() {
|
|
103
|
-
if (
|
|
104
|
-
return
|
|
103
|
+
if (global2[kExitEmitter2]) {
|
|
104
|
+
return global2[kExitEmitter2];
|
|
105
105
|
}
|
|
106
|
-
|
|
106
|
+
ObjectDefineProperty2(global2, kExitEmitter2, {
|
|
107
107
|
value: this,
|
|
108
108
|
writable: false,
|
|
109
109
|
enumerable: false,
|
|
@@ -140,12 +140,12 @@ var require_cjs = __commonJS({
|
|
|
140
140
|
return ret;
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
|
-
var
|
|
143
|
+
var SignalExitBase2 = class {
|
|
144
144
|
static {
|
|
145
145
|
__name(this, "SignalExitBase");
|
|
146
146
|
}
|
|
147
147
|
};
|
|
148
|
-
var
|
|
148
|
+
var signalExitWrap2 = /* @__PURE__ */ __name((handler) => {
|
|
149
149
|
return {
|
|
150
150
|
onExit(cb, opts) {
|
|
151
151
|
return handler.onExit(cb, opts);
|
|
@@ -158,7 +158,7 @@ var require_cjs = __commonJS({
|
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
160
|
}, "signalExitWrap");
|
|
161
|
-
var
|
|
161
|
+
var SignalExitFallback2 = class extends SignalExitBase2 {
|
|
162
162
|
static {
|
|
163
163
|
__name(this, "SignalExitFallback");
|
|
164
164
|
}
|
|
@@ -171,30 +171,30 @@ var require_cjs = __commonJS({
|
|
|
171
171
|
unload() {
|
|
172
172
|
}
|
|
173
173
|
};
|
|
174
|
-
var
|
|
174
|
+
var SignalExit2 = class extends SignalExitBase2 {
|
|
175
175
|
static {
|
|
176
176
|
__name(this, "SignalExit");
|
|
177
177
|
}
|
|
178
178
|
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
179
179
|
// so use a supported signal instead
|
|
180
180
|
/* c8 ignore start */
|
|
181
|
-
#hupSig =
|
|
181
|
+
#hupSig = process6.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
182
182
|
/* c8 ignore stop */
|
|
183
|
-
#emitter = new
|
|
183
|
+
#emitter = new Emitter2();
|
|
184
184
|
#process;
|
|
185
185
|
#originalProcessEmit;
|
|
186
186
|
#originalProcessReallyExit;
|
|
187
187
|
#sigListeners = {};
|
|
188
188
|
#loaded = false;
|
|
189
|
-
constructor(
|
|
189
|
+
constructor(process7) {
|
|
190
190
|
super();
|
|
191
|
-
this.#process =
|
|
191
|
+
this.#process = process7;
|
|
192
192
|
this.#sigListeners = {};
|
|
193
193
|
for (const sig of signals_js_1.signals) {
|
|
194
194
|
this.#sigListeners[sig] = () => {
|
|
195
195
|
const listeners = this.#process.listeners(sig);
|
|
196
196
|
let { count } = this.#emitter;
|
|
197
|
-
const p =
|
|
197
|
+
const p = process7;
|
|
198
198
|
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
|
|
199
199
|
count += p.__signal_exit_emitter__.count;
|
|
200
200
|
}
|
|
@@ -203,15 +203,15 @@ var require_cjs = __commonJS({
|
|
|
203
203
|
const ret = this.#emitter.emit("exit", null, sig);
|
|
204
204
|
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
205
205
|
if (!ret)
|
|
206
|
-
|
|
206
|
+
process7.kill(process7.pid, s);
|
|
207
207
|
}
|
|
208
208
|
};
|
|
209
209
|
}
|
|
210
|
-
this.#originalProcessReallyExit =
|
|
211
|
-
this.#originalProcessEmit =
|
|
210
|
+
this.#originalProcessReallyExit = process7.reallyExit;
|
|
211
|
+
this.#originalProcessEmit = process7.emit;
|
|
212
212
|
}
|
|
213
213
|
onExit(cb, opts) {
|
|
214
|
-
if (!
|
|
214
|
+
if (!processOk2(this.#process)) {
|
|
215
215
|
return () => {
|
|
216
216
|
};
|
|
217
217
|
}
|
|
@@ -268,7 +268,7 @@ var require_cjs = __commonJS({
|
|
|
268
268
|
this.#emitter.count -= 1;
|
|
269
269
|
}
|
|
270
270
|
#processReallyExit(code) {
|
|
271
|
-
if (!
|
|
271
|
+
if (!processOk2(this.#process)) {
|
|
272
272
|
return 0;
|
|
273
273
|
}
|
|
274
274
|
this.#process.exitCode = code || 0;
|
|
@@ -277,7 +277,7 @@ var require_cjs = __commonJS({
|
|
|
277
277
|
}
|
|
278
278
|
#processEmit(ev, ...args) {
|
|
279
279
|
const og = this.#originalProcessEmit;
|
|
280
|
-
if (ev === "exit" &&
|
|
280
|
+
if (ev === "exit" && processOk2(this.#process)) {
|
|
281
281
|
if (typeof args[0] === "number") {
|
|
282
282
|
this.#process.exitCode = args[0];
|
|
283
283
|
}
|
|
@@ -289,8 +289,8 @@ var require_cjs = __commonJS({
|
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
};
|
|
292
|
-
var
|
|
293
|
-
_a =
|
|
292
|
+
var process6 = globalThis.process;
|
|
293
|
+
_a = signalExitWrap2(processOk2(process6) ? new SignalExit2(process6) : new SignalExitFallback2()), /**
|
|
294
294
|
* Called when the process is exiting, whether via signal, explicit
|
|
295
295
|
* exit, or running out of stuff to do.
|
|
296
296
|
*
|
|
@@ -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 (
|
|
500
|
+
return (input2) => input2;
|
|
501
501
|
}
|
|
502
502
|
const openCode = `\x1B[${open}m`;
|
|
503
503
|
const closeCode = `\x1B[${close}m`;
|
|
504
|
-
return (
|
|
505
|
-
const string =
|
|
504
|
+
return (input2) => {
|
|
505
|
+
const string = input2 + "";
|
|
506
506
|
let index = string.indexOf(closeCode);
|
|
507
507
|
if (index === -1) {
|
|
508
508
|
return openCode + string + closeCode;
|
|
@@ -566,13 +566,2734 @@ var require_yoctocolors_cjs = __commonJS({
|
|
|
566
566
|
}
|
|
567
567
|
});
|
|
568
568
|
|
|
569
|
+
// node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/key.js
|
|
570
|
+
var isUpKey, isDownKey, isSpaceKey, isBackspaceKey, isTabKey, isNumberKey, isEnterKey;
|
|
571
|
+
var init_key = __esm({
|
|
572
|
+
"node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/key.js"() {
|
|
573
|
+
isUpKey = /* @__PURE__ */ __name((key, keybindings = []) => (
|
|
574
|
+
// The up key
|
|
575
|
+
key.name === "up" || // Vim keybinding: hjkl keys map to left/down/up/right
|
|
576
|
+
keybindings.includes("vim") && key.name === "k" || // Emacs keybinding: Ctrl+P means "previous" in Emacs navigation conventions
|
|
577
|
+
keybindings.includes("emacs") && key.ctrl && key.name === "p"
|
|
578
|
+
), "isUpKey");
|
|
579
|
+
isDownKey = /* @__PURE__ */ __name((key, keybindings = []) => (
|
|
580
|
+
// The down key
|
|
581
|
+
key.name === "down" || // Vim keybinding: hjkl keys map to left/down/up/right
|
|
582
|
+
keybindings.includes("vim") && key.name === "j" || // Emacs keybinding: Ctrl+N means "next" in Emacs navigation conventions
|
|
583
|
+
keybindings.includes("emacs") && key.ctrl && key.name === "n"
|
|
584
|
+
), "isDownKey");
|
|
585
|
+
isSpaceKey = /* @__PURE__ */ __name((key) => key.name === "space", "isSpaceKey");
|
|
586
|
+
isBackspaceKey = /* @__PURE__ */ __name((key) => key.name === "backspace", "isBackspaceKey");
|
|
587
|
+
isTabKey = /* @__PURE__ */ __name((key) => key.name === "tab", "isTabKey");
|
|
588
|
+
isNumberKey = /* @__PURE__ */ __name((key) => "1234567890".includes(key.name), "isNumberKey");
|
|
589
|
+
isEnterKey = /* @__PURE__ */ __name((key) => key.name === "enter" || key.name === "return", "isEnterKey");
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
|
|
593
|
+
// node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/errors.js
|
|
594
|
+
var AbortPromptError, CancelPromptError, ExitPromptError, HookError, ValidationError;
|
|
595
|
+
var init_errors = __esm({
|
|
596
|
+
"node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/errors.js"() {
|
|
597
|
+
AbortPromptError = class extends Error {
|
|
598
|
+
static {
|
|
599
|
+
__name(this, "AbortPromptError");
|
|
600
|
+
}
|
|
601
|
+
name = "AbortPromptError";
|
|
602
|
+
message = "Prompt was aborted";
|
|
603
|
+
constructor(options) {
|
|
604
|
+
super();
|
|
605
|
+
this.cause = options?.cause;
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
CancelPromptError = class extends Error {
|
|
609
|
+
static {
|
|
610
|
+
__name(this, "CancelPromptError");
|
|
611
|
+
}
|
|
612
|
+
name = "CancelPromptError";
|
|
613
|
+
message = "Prompt was canceled";
|
|
614
|
+
};
|
|
615
|
+
ExitPromptError = class extends Error {
|
|
616
|
+
static {
|
|
617
|
+
__name(this, "ExitPromptError");
|
|
618
|
+
}
|
|
619
|
+
name = "ExitPromptError";
|
|
620
|
+
};
|
|
621
|
+
HookError = class extends Error {
|
|
622
|
+
static {
|
|
623
|
+
__name(this, "HookError");
|
|
624
|
+
}
|
|
625
|
+
name = "HookError";
|
|
626
|
+
};
|
|
627
|
+
ValidationError = class extends Error {
|
|
628
|
+
static {
|
|
629
|
+
__name(this, "ValidationError");
|
|
630
|
+
}
|
|
631
|
+
name = "ValidationError";
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
});
|
|
635
|
+
|
|
636
|
+
// node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/hook-engine.js
|
|
637
|
+
function createStore(rl) {
|
|
638
|
+
const store = {
|
|
639
|
+
rl,
|
|
640
|
+
hooks: [],
|
|
641
|
+
hooksCleanup: [],
|
|
642
|
+
hooksEffect: [],
|
|
643
|
+
index: 0,
|
|
644
|
+
handleChange() {
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
return store;
|
|
648
|
+
}
|
|
649
|
+
function withHooks(rl, cb) {
|
|
650
|
+
const store = createStore(rl);
|
|
651
|
+
return hookStorage.run(store, () => {
|
|
652
|
+
function cycle(render) {
|
|
653
|
+
store.handleChange = () => {
|
|
654
|
+
store.index = 0;
|
|
655
|
+
render();
|
|
656
|
+
};
|
|
657
|
+
store.handleChange();
|
|
658
|
+
}
|
|
659
|
+
__name(cycle, "cycle");
|
|
660
|
+
return cb(cycle);
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
function getStore() {
|
|
664
|
+
const store = hookStorage.getStore();
|
|
665
|
+
if (!store) {
|
|
666
|
+
throw new HookError("[Inquirer] Hook functions can only be called from within a prompt");
|
|
667
|
+
}
|
|
668
|
+
return store;
|
|
669
|
+
}
|
|
670
|
+
function readline() {
|
|
671
|
+
return getStore().rl;
|
|
672
|
+
}
|
|
673
|
+
function withUpdates(fn) {
|
|
674
|
+
const wrapped = /* @__PURE__ */ __name((...args) => {
|
|
675
|
+
const store = getStore();
|
|
676
|
+
let shouldUpdate = false;
|
|
677
|
+
const oldHandleChange = store.handleChange;
|
|
678
|
+
store.handleChange = () => {
|
|
679
|
+
shouldUpdate = true;
|
|
680
|
+
};
|
|
681
|
+
const returnValue = fn(...args);
|
|
682
|
+
if (shouldUpdate) {
|
|
683
|
+
oldHandleChange();
|
|
684
|
+
}
|
|
685
|
+
store.handleChange = oldHandleChange;
|
|
686
|
+
return returnValue;
|
|
687
|
+
}, "wrapped");
|
|
688
|
+
return import_node_async_hooks.AsyncResource.bind(wrapped);
|
|
689
|
+
}
|
|
690
|
+
function withPointer(cb) {
|
|
691
|
+
const store = getStore();
|
|
692
|
+
const { index } = store;
|
|
693
|
+
const pointer = {
|
|
694
|
+
get() {
|
|
695
|
+
return store.hooks[index];
|
|
696
|
+
},
|
|
697
|
+
set(value) {
|
|
698
|
+
store.hooks[index] = value;
|
|
699
|
+
},
|
|
700
|
+
initialized: index in store.hooks
|
|
701
|
+
};
|
|
702
|
+
const returnValue = cb(pointer);
|
|
703
|
+
store.index++;
|
|
704
|
+
return returnValue;
|
|
705
|
+
}
|
|
706
|
+
function handleChange() {
|
|
707
|
+
getStore().handleChange();
|
|
708
|
+
}
|
|
709
|
+
var import_node_async_hooks, hookStorage, effectScheduler;
|
|
710
|
+
var init_hook_engine = __esm({
|
|
711
|
+
"node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/hook-engine.js"() {
|
|
712
|
+
import_node_async_hooks = require("node:async_hooks");
|
|
713
|
+
init_errors();
|
|
714
|
+
hookStorage = new import_node_async_hooks.AsyncLocalStorage();
|
|
715
|
+
__name(createStore, "createStore");
|
|
716
|
+
__name(withHooks, "withHooks");
|
|
717
|
+
__name(getStore, "getStore");
|
|
718
|
+
__name(readline, "readline");
|
|
719
|
+
__name(withUpdates, "withUpdates");
|
|
720
|
+
__name(withPointer, "withPointer");
|
|
721
|
+
__name(handleChange, "handleChange");
|
|
722
|
+
effectScheduler = {
|
|
723
|
+
queue(cb) {
|
|
724
|
+
const store = getStore();
|
|
725
|
+
const { index } = store;
|
|
726
|
+
store.hooksEffect.push(() => {
|
|
727
|
+
store.hooksCleanup[index]?.();
|
|
728
|
+
const cleanFn = cb(readline());
|
|
729
|
+
if (cleanFn != null && typeof cleanFn !== "function") {
|
|
730
|
+
throw new ValidationError("useEffect return value must be a cleanup function or nothing.");
|
|
731
|
+
}
|
|
732
|
+
store.hooksCleanup[index] = cleanFn;
|
|
733
|
+
});
|
|
734
|
+
},
|
|
735
|
+
run() {
|
|
736
|
+
const store = getStore();
|
|
737
|
+
withUpdates(() => {
|
|
738
|
+
store.hooksEffect.forEach((effect) => {
|
|
739
|
+
effect();
|
|
740
|
+
});
|
|
741
|
+
store.hooksEffect.length = 0;
|
|
742
|
+
})();
|
|
743
|
+
},
|
|
744
|
+
clearAll() {
|
|
745
|
+
const store = getStore();
|
|
746
|
+
store.hooksCleanup.forEach((cleanFn) => {
|
|
747
|
+
cleanFn?.();
|
|
748
|
+
});
|
|
749
|
+
store.hooksEffect.length = 0;
|
|
750
|
+
store.hooksCleanup.length = 0;
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
}
|
|
754
|
+
});
|
|
755
|
+
|
|
756
|
+
// node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
757
|
+
function isFactory(value) {
|
|
758
|
+
return typeof value === "function";
|
|
759
|
+
}
|
|
760
|
+
function useState(defaultValue) {
|
|
761
|
+
return withPointer((pointer) => {
|
|
762
|
+
const setState = import_node_async_hooks2.AsyncResource.bind(/* @__PURE__ */ __name(function setState2(newValue) {
|
|
763
|
+
if (pointer.get() !== newValue) {
|
|
764
|
+
pointer.set(newValue);
|
|
765
|
+
handleChange();
|
|
766
|
+
}
|
|
767
|
+
}, "setState"));
|
|
768
|
+
if (pointer.initialized) {
|
|
769
|
+
return [pointer.get(), setState];
|
|
770
|
+
}
|
|
771
|
+
const value = isFactory(defaultValue) ? defaultValue() : defaultValue;
|
|
772
|
+
pointer.set(value);
|
|
773
|
+
return [value, setState];
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
var import_node_async_hooks2;
|
|
777
|
+
var init_use_state = __esm({
|
|
778
|
+
"node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/use-state.js"() {
|
|
779
|
+
import_node_async_hooks2 = require("node:async_hooks");
|
|
780
|
+
init_hook_engine();
|
|
781
|
+
__name(isFactory, "isFactory");
|
|
782
|
+
__name(useState, "useState");
|
|
783
|
+
}
|
|
784
|
+
});
|
|
785
|
+
|
|
786
|
+
// node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/use-effect.js
|
|
787
|
+
function useEffect(cb, depArray) {
|
|
788
|
+
withPointer((pointer) => {
|
|
789
|
+
const oldDeps = pointer.get();
|
|
790
|
+
const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i) => !Object.is(dep, oldDeps[i]));
|
|
791
|
+
if (hasChanged) {
|
|
792
|
+
effectScheduler.queue(cb);
|
|
793
|
+
}
|
|
794
|
+
pointer.set(depArray);
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
var init_use_effect = __esm({
|
|
798
|
+
"node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/use-effect.js"() {
|
|
799
|
+
init_hook_engine();
|
|
800
|
+
__name(useEffect, "useEffect");
|
|
801
|
+
}
|
|
802
|
+
});
|
|
803
|
+
|
|
804
|
+
// node_modules/.pnpm/@inquirer+figures@2.0.5/node_modules/@inquirer/figures/dist/index.js
|
|
805
|
+
function isUnicodeSupported() {
|
|
806
|
+
if (!import_node_process2.default.platform.startsWith("win")) {
|
|
807
|
+
return import_node_process2.default.env["TERM"] !== "linux";
|
|
808
|
+
}
|
|
809
|
+
return Boolean(import_node_process2.default.env["CI"]) || // CI environments generally support unicode
|
|
810
|
+
Boolean(import_node_process2.default.env["WT_SESSION"]) || // Windows Terminal
|
|
811
|
+
Boolean(import_node_process2.default.env["TERMINUS_SUBLIME"]) || // Terminus (<0.2.27)
|
|
812
|
+
import_node_process2.default.env["ConEmuTask"] === "{cmd::Cmder}" || // ConEmu and cmder
|
|
813
|
+
import_node_process2.default.env["TERM_PROGRAM"] === "Terminus-Sublime" || import_node_process2.default.env["TERM_PROGRAM"] === "vscode" || import_node_process2.default.env["TERM"] === "xterm-256color" || import_node_process2.default.env["TERM"] === "alacritty" || import_node_process2.default.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
|
|
814
|
+
}
|
|
815
|
+
var import_node_process2, common, specialMainSymbols, specialFallbackSymbols, mainSymbols, fallbackSymbols, shouldUseMain, figures, dist_default, replacements;
|
|
816
|
+
var init_dist = __esm({
|
|
817
|
+
"node_modules/.pnpm/@inquirer+figures@2.0.5/node_modules/@inquirer/figures/dist/index.js"() {
|
|
818
|
+
import_node_process2 = __toESM(require("node:process"), 1);
|
|
819
|
+
__name(isUnicodeSupported, "isUnicodeSupported");
|
|
820
|
+
common = {
|
|
821
|
+
circleQuestionMark: "(?)",
|
|
822
|
+
questionMarkPrefix: "(?)",
|
|
823
|
+
square: "█",
|
|
824
|
+
squareDarkShade: "▓",
|
|
825
|
+
squareMediumShade: "▒",
|
|
826
|
+
squareLightShade: "░",
|
|
827
|
+
squareTop: "▀",
|
|
828
|
+
squareBottom: "▄",
|
|
829
|
+
squareLeft: "▌",
|
|
830
|
+
squareRight: "▐",
|
|
831
|
+
squareCenter: "■",
|
|
832
|
+
bullet: "●",
|
|
833
|
+
dot: "․",
|
|
834
|
+
ellipsis: "…",
|
|
835
|
+
pointerSmall: "›",
|
|
836
|
+
triangleUp: "▲",
|
|
837
|
+
triangleUpSmall: "▴",
|
|
838
|
+
triangleDown: "▼",
|
|
839
|
+
triangleDownSmall: "▾",
|
|
840
|
+
triangleLeftSmall: "◂",
|
|
841
|
+
triangleRightSmall: "▸",
|
|
842
|
+
home: "⌂",
|
|
843
|
+
heart: "♥",
|
|
844
|
+
musicNote: "♪",
|
|
845
|
+
musicNoteBeamed: "♫",
|
|
846
|
+
arrowUp: "↑",
|
|
847
|
+
arrowDown: "↓",
|
|
848
|
+
arrowLeft: "←",
|
|
849
|
+
arrowRight: "→",
|
|
850
|
+
arrowLeftRight: "↔",
|
|
851
|
+
arrowUpDown: "↕",
|
|
852
|
+
almostEqual: "≈",
|
|
853
|
+
notEqual: "≠",
|
|
854
|
+
lessOrEqual: "≤",
|
|
855
|
+
greaterOrEqual: "≥",
|
|
856
|
+
identical: "≡",
|
|
857
|
+
infinity: "∞",
|
|
858
|
+
subscriptZero: "₀",
|
|
859
|
+
subscriptOne: "₁",
|
|
860
|
+
subscriptTwo: "₂",
|
|
861
|
+
subscriptThree: "₃",
|
|
862
|
+
subscriptFour: "₄",
|
|
863
|
+
subscriptFive: "₅",
|
|
864
|
+
subscriptSix: "₆",
|
|
865
|
+
subscriptSeven: "₇",
|
|
866
|
+
subscriptEight: "₈",
|
|
867
|
+
subscriptNine: "₉",
|
|
868
|
+
oneHalf: "½",
|
|
869
|
+
oneThird: "⅓",
|
|
870
|
+
oneQuarter: "¼",
|
|
871
|
+
oneFifth: "⅕",
|
|
872
|
+
oneSixth: "⅙",
|
|
873
|
+
oneEighth: "⅛",
|
|
874
|
+
twoThirds: "⅔",
|
|
875
|
+
twoFifths: "⅖",
|
|
876
|
+
threeQuarters: "¾",
|
|
877
|
+
threeFifths: "⅗",
|
|
878
|
+
threeEighths: "⅜",
|
|
879
|
+
fourFifths: "⅘",
|
|
880
|
+
fiveSixths: "⅚",
|
|
881
|
+
fiveEighths: "⅝",
|
|
882
|
+
sevenEighths: "⅞",
|
|
883
|
+
line: "─",
|
|
884
|
+
lineBold: "━",
|
|
885
|
+
lineDouble: "═",
|
|
886
|
+
lineDashed0: "┄",
|
|
887
|
+
lineDashed1: "┅",
|
|
888
|
+
lineDashed2: "┈",
|
|
889
|
+
lineDashed3: "┉",
|
|
890
|
+
lineDashed4: "╌",
|
|
891
|
+
lineDashed5: "╍",
|
|
892
|
+
lineDashed6: "╴",
|
|
893
|
+
lineDashed7: "╶",
|
|
894
|
+
lineDashed8: "╸",
|
|
895
|
+
lineDashed9: "╺",
|
|
896
|
+
lineDashed10: "╼",
|
|
897
|
+
lineDashed11: "╾",
|
|
898
|
+
lineDashed12: "−",
|
|
899
|
+
lineDashed13: "–",
|
|
900
|
+
lineDashed14: "‐",
|
|
901
|
+
lineDashed15: "⁃",
|
|
902
|
+
lineVertical: "│",
|
|
903
|
+
lineVerticalBold: "┃",
|
|
904
|
+
lineVerticalDouble: "║",
|
|
905
|
+
lineVerticalDashed0: "┆",
|
|
906
|
+
lineVerticalDashed1: "┇",
|
|
907
|
+
lineVerticalDashed2: "┊",
|
|
908
|
+
lineVerticalDashed3: "┋",
|
|
909
|
+
lineVerticalDashed4: "╎",
|
|
910
|
+
lineVerticalDashed5: "╏",
|
|
911
|
+
lineVerticalDashed6: "╵",
|
|
912
|
+
lineVerticalDashed7: "╷",
|
|
913
|
+
lineVerticalDashed8: "╹",
|
|
914
|
+
lineVerticalDashed9: "╻",
|
|
915
|
+
lineVerticalDashed10: "╽",
|
|
916
|
+
lineVerticalDashed11: "╿",
|
|
917
|
+
lineDownLeft: "┐",
|
|
918
|
+
lineDownLeftArc: "╮",
|
|
919
|
+
lineDownBoldLeftBold: "┓",
|
|
920
|
+
lineDownBoldLeft: "┒",
|
|
921
|
+
lineDownLeftBold: "┑",
|
|
922
|
+
lineDownDoubleLeftDouble: "╗",
|
|
923
|
+
lineDownDoubleLeft: "╖",
|
|
924
|
+
lineDownLeftDouble: "╕",
|
|
925
|
+
lineDownRight: "┌",
|
|
926
|
+
lineDownRightArc: "╭",
|
|
927
|
+
lineDownBoldRightBold: "┏",
|
|
928
|
+
lineDownBoldRight: "┎",
|
|
929
|
+
lineDownRightBold: "┍",
|
|
930
|
+
lineDownDoubleRightDouble: "╔",
|
|
931
|
+
lineDownDoubleRight: "╓",
|
|
932
|
+
lineDownRightDouble: "╒",
|
|
933
|
+
lineUpLeft: "┘",
|
|
934
|
+
lineUpLeftArc: "╯",
|
|
935
|
+
lineUpBoldLeftBold: "┛",
|
|
936
|
+
lineUpBoldLeft: "┚",
|
|
937
|
+
lineUpLeftBold: "┙",
|
|
938
|
+
lineUpDoubleLeftDouble: "╝",
|
|
939
|
+
lineUpDoubleLeft: "╜",
|
|
940
|
+
lineUpLeftDouble: "╛",
|
|
941
|
+
lineUpRight: "└",
|
|
942
|
+
lineUpRightArc: "╰",
|
|
943
|
+
lineUpBoldRightBold: "┗",
|
|
944
|
+
lineUpBoldRight: "┖",
|
|
945
|
+
lineUpRightBold: "┕",
|
|
946
|
+
lineUpDoubleRightDouble: "╚",
|
|
947
|
+
lineUpDoubleRight: "╙",
|
|
948
|
+
lineUpRightDouble: "╘",
|
|
949
|
+
lineUpDownLeft: "┤",
|
|
950
|
+
lineUpBoldDownBoldLeftBold: "┫",
|
|
951
|
+
lineUpBoldDownBoldLeft: "┨",
|
|
952
|
+
lineUpDownLeftBold: "┥",
|
|
953
|
+
lineUpBoldDownLeftBold: "┩",
|
|
954
|
+
lineUpDownBoldLeftBold: "┪",
|
|
955
|
+
lineUpDownBoldLeft: "┧",
|
|
956
|
+
lineUpBoldDownLeft: "┦",
|
|
957
|
+
lineUpDoubleDownDoubleLeftDouble: "╣",
|
|
958
|
+
lineUpDoubleDownDoubleLeft: "╢",
|
|
959
|
+
lineUpDownLeftDouble: "╡",
|
|
960
|
+
lineUpDownRight: "├",
|
|
961
|
+
lineUpBoldDownBoldRightBold: "┣",
|
|
962
|
+
lineUpBoldDownBoldRight: "┠",
|
|
963
|
+
lineUpDownRightBold: "┝",
|
|
964
|
+
lineUpBoldDownRightBold: "┡",
|
|
965
|
+
lineUpDownBoldRightBold: "┢",
|
|
966
|
+
lineUpDownBoldRight: "┟",
|
|
967
|
+
lineUpBoldDownRight: "┞",
|
|
968
|
+
lineUpDoubleDownDoubleRightDouble: "╠",
|
|
969
|
+
lineUpDoubleDownDoubleRight: "╟",
|
|
970
|
+
lineUpDownRightDouble: "╞",
|
|
971
|
+
lineDownLeftRight: "┬",
|
|
972
|
+
lineDownBoldLeftBoldRightBold: "┳",
|
|
973
|
+
lineDownLeftBoldRightBold: "┯",
|
|
974
|
+
lineDownBoldLeftRight: "┰",
|
|
975
|
+
lineDownBoldLeftBoldRight: "┱",
|
|
976
|
+
lineDownBoldLeftRightBold: "┲",
|
|
977
|
+
lineDownLeftRightBold: "┮",
|
|
978
|
+
lineDownLeftBoldRight: "┭",
|
|
979
|
+
lineDownDoubleLeftDoubleRightDouble: "╦",
|
|
980
|
+
lineDownDoubleLeftRight: "╥",
|
|
981
|
+
lineDownLeftDoubleRightDouble: "╤",
|
|
982
|
+
lineUpLeftRight: "┴",
|
|
983
|
+
lineUpBoldLeftBoldRightBold: "┻",
|
|
984
|
+
lineUpLeftBoldRightBold: "┷",
|
|
985
|
+
lineUpBoldLeftRight: "┸",
|
|
986
|
+
lineUpBoldLeftBoldRight: "┹",
|
|
987
|
+
lineUpBoldLeftRightBold: "┺",
|
|
988
|
+
lineUpLeftRightBold: "┶",
|
|
989
|
+
lineUpLeftBoldRight: "┵",
|
|
990
|
+
lineUpDoubleLeftDoubleRightDouble: "╩",
|
|
991
|
+
lineUpDoubleLeftRight: "╨",
|
|
992
|
+
lineUpLeftDoubleRightDouble: "╧",
|
|
993
|
+
lineUpDownLeftRight: "┼",
|
|
994
|
+
lineUpBoldDownBoldLeftBoldRightBold: "╋",
|
|
995
|
+
lineUpDownBoldLeftBoldRightBold: "╈",
|
|
996
|
+
lineUpBoldDownLeftBoldRightBold: "╇",
|
|
997
|
+
lineUpBoldDownBoldLeftRightBold: "╊",
|
|
998
|
+
lineUpBoldDownBoldLeftBoldRight: "╉",
|
|
999
|
+
lineUpBoldDownLeftRight: "╀",
|
|
1000
|
+
lineUpDownBoldLeftRight: "╁",
|
|
1001
|
+
lineUpDownLeftBoldRight: "┽",
|
|
1002
|
+
lineUpDownLeftRightBold: "┾",
|
|
1003
|
+
lineUpBoldDownBoldLeftRight: "╂",
|
|
1004
|
+
lineUpDownLeftBoldRightBold: "┿",
|
|
1005
|
+
lineUpBoldDownLeftBoldRight: "╃",
|
|
1006
|
+
lineUpBoldDownLeftRightBold: "╄",
|
|
1007
|
+
lineUpDownBoldLeftBoldRight: "╅",
|
|
1008
|
+
lineUpDownBoldLeftRightBold: "╆",
|
|
1009
|
+
lineUpDoubleDownDoubleLeftDoubleRightDouble: "╬",
|
|
1010
|
+
lineUpDoubleDownDoubleLeftRight: "╫",
|
|
1011
|
+
lineUpDownLeftDoubleRightDouble: "╪",
|
|
1012
|
+
lineCross: "╳",
|
|
1013
|
+
lineBackslash: "╲",
|
|
1014
|
+
lineSlash: "╱"
|
|
1015
|
+
};
|
|
1016
|
+
specialMainSymbols = {
|
|
1017
|
+
tick: "✔",
|
|
1018
|
+
info: "ℹ",
|
|
1019
|
+
warning: "⚠",
|
|
1020
|
+
cross: "✘",
|
|
1021
|
+
squareSmall: "◻",
|
|
1022
|
+
squareSmallFilled: "◼",
|
|
1023
|
+
circle: "◯",
|
|
1024
|
+
circleFilled: "◉",
|
|
1025
|
+
circleDotted: "◌",
|
|
1026
|
+
circleDouble: "◎",
|
|
1027
|
+
circleCircle: "ⓞ",
|
|
1028
|
+
circleCross: "ⓧ",
|
|
1029
|
+
circlePipe: "Ⓘ",
|
|
1030
|
+
radioOn: "◉",
|
|
1031
|
+
radioOff: "◯",
|
|
1032
|
+
checkboxOn: "☒",
|
|
1033
|
+
checkboxOff: "☐",
|
|
1034
|
+
checkboxCircleOn: "ⓧ",
|
|
1035
|
+
checkboxCircleOff: "Ⓘ",
|
|
1036
|
+
pointer: "❯",
|
|
1037
|
+
triangleUpOutline: "△",
|
|
1038
|
+
triangleLeft: "◀",
|
|
1039
|
+
triangleRight: "▶",
|
|
1040
|
+
lozenge: "◆",
|
|
1041
|
+
lozengeOutline: "◇",
|
|
1042
|
+
hamburger: "☰",
|
|
1043
|
+
smiley: "㋡",
|
|
1044
|
+
mustache: "෴",
|
|
1045
|
+
star: "★",
|
|
1046
|
+
play: "▶",
|
|
1047
|
+
nodejs: "⬢",
|
|
1048
|
+
oneSeventh: "⅐",
|
|
1049
|
+
oneNinth: "⅑",
|
|
1050
|
+
oneTenth: "⅒"
|
|
1051
|
+
};
|
|
1052
|
+
specialFallbackSymbols = {
|
|
1053
|
+
tick: "√",
|
|
1054
|
+
info: "i",
|
|
1055
|
+
warning: "‼",
|
|
1056
|
+
cross: "×",
|
|
1057
|
+
squareSmall: "□",
|
|
1058
|
+
squareSmallFilled: "■",
|
|
1059
|
+
circle: "( )",
|
|
1060
|
+
circleFilled: "(*)",
|
|
1061
|
+
circleDotted: "( )",
|
|
1062
|
+
circleDouble: "( )",
|
|
1063
|
+
circleCircle: "(○)",
|
|
1064
|
+
circleCross: "(×)",
|
|
1065
|
+
circlePipe: "(│)",
|
|
1066
|
+
radioOn: "(*)",
|
|
1067
|
+
radioOff: "( )",
|
|
1068
|
+
checkboxOn: "[×]",
|
|
1069
|
+
checkboxOff: "[ ]",
|
|
1070
|
+
checkboxCircleOn: "(×)",
|
|
1071
|
+
checkboxCircleOff: "( )",
|
|
1072
|
+
pointer: ">",
|
|
1073
|
+
triangleUpOutline: "∆",
|
|
1074
|
+
triangleLeft: "◄",
|
|
1075
|
+
triangleRight: "►",
|
|
1076
|
+
lozenge: "♦",
|
|
1077
|
+
lozengeOutline: "◊",
|
|
1078
|
+
hamburger: "≡",
|
|
1079
|
+
smiley: "☺",
|
|
1080
|
+
mustache: "┌─┐",
|
|
1081
|
+
star: "✶",
|
|
1082
|
+
play: "►",
|
|
1083
|
+
nodejs: "♦",
|
|
1084
|
+
oneSeventh: "1/7",
|
|
1085
|
+
oneNinth: "1/9",
|
|
1086
|
+
oneTenth: "1/10"
|
|
1087
|
+
};
|
|
1088
|
+
mainSymbols = {
|
|
1089
|
+
...common,
|
|
1090
|
+
...specialMainSymbols
|
|
1091
|
+
};
|
|
1092
|
+
fallbackSymbols = {
|
|
1093
|
+
...common,
|
|
1094
|
+
...specialFallbackSymbols
|
|
1095
|
+
};
|
|
1096
|
+
shouldUseMain = isUnicodeSupported();
|
|
1097
|
+
figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
1098
|
+
dist_default = figures;
|
|
1099
|
+
replacements = Object.entries(specialMainSymbols);
|
|
1100
|
+
}
|
|
1101
|
+
});
|
|
1102
|
+
|
|
1103
|
+
// node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/theme.js
|
|
1104
|
+
var import_node_util, defaultTheme;
|
|
1105
|
+
var init_theme = __esm({
|
|
1106
|
+
"node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/theme.js"() {
|
|
1107
|
+
import_node_util = require("node:util");
|
|
1108
|
+
init_dist();
|
|
1109
|
+
defaultTheme = {
|
|
1110
|
+
prefix: {
|
|
1111
|
+
idle: (0, import_node_util.styleText)("blue", "?"),
|
|
1112
|
+
done: (0, import_node_util.styleText)("green", dist_default.tick)
|
|
1113
|
+
},
|
|
1114
|
+
spinner: {
|
|
1115
|
+
interval: 80,
|
|
1116
|
+
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => (0, import_node_util.styleText)("yellow", frame))
|
|
1117
|
+
},
|
|
1118
|
+
style: {
|
|
1119
|
+
answer: /* @__PURE__ */ __name((text) => (0, import_node_util.styleText)("cyan", text), "answer"),
|
|
1120
|
+
message: /* @__PURE__ */ __name((text) => (0, import_node_util.styleText)("bold", text), "message"),
|
|
1121
|
+
error: /* @__PURE__ */ __name((text) => (0, import_node_util.styleText)("red", `> ${text}`), "error"),
|
|
1122
|
+
defaultAnswer: /* @__PURE__ */ __name((text) => (0, import_node_util.styleText)("dim", `(${text})`), "defaultAnswer"),
|
|
1123
|
+
help: /* @__PURE__ */ __name((text) => (0, import_node_util.styleText)("dim", text), "help"),
|
|
1124
|
+
highlight: /* @__PURE__ */ __name((text) => (0, import_node_util.styleText)("cyan", text), "highlight"),
|
|
1125
|
+
key: /* @__PURE__ */ __name((text) => (0, import_node_util.styleText)("cyan", (0, import_node_util.styleText)("bold", `<${text}>`)), "key")
|
|
1126
|
+
}
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
});
|
|
1130
|
+
|
|
1131
|
+
// node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/make-theme.js
|
|
1132
|
+
function isPlainObject(value) {
|
|
1133
|
+
if (typeof value !== "object" || value === null)
|
|
1134
|
+
return false;
|
|
1135
|
+
let proto = value;
|
|
1136
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
|
1137
|
+
proto = Object.getPrototypeOf(proto);
|
|
1138
|
+
}
|
|
1139
|
+
return Object.getPrototypeOf(value) === proto;
|
|
1140
|
+
}
|
|
1141
|
+
function deepMerge(...objects) {
|
|
1142
|
+
const output = {};
|
|
1143
|
+
for (const obj of objects) {
|
|
1144
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
1145
|
+
const prevValue = output[key];
|
|
1146
|
+
output[key] = isPlainObject(prevValue) && isPlainObject(value) ? deepMerge(prevValue, value) : value;
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
return output;
|
|
1150
|
+
}
|
|
1151
|
+
function makeTheme(...themes) {
|
|
1152
|
+
const themesToMerge = [
|
|
1153
|
+
defaultTheme,
|
|
1154
|
+
...themes.filter((theme) => theme != null)
|
|
1155
|
+
];
|
|
1156
|
+
return deepMerge(...themesToMerge);
|
|
1157
|
+
}
|
|
1158
|
+
var init_make_theme = __esm({
|
|
1159
|
+
"node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/make-theme.js"() {
|
|
1160
|
+
init_theme();
|
|
1161
|
+
__name(isPlainObject, "isPlainObject");
|
|
1162
|
+
__name(deepMerge, "deepMerge");
|
|
1163
|
+
__name(makeTheme, "makeTheme");
|
|
1164
|
+
}
|
|
1165
|
+
});
|
|
1166
|
+
|
|
1167
|
+
// node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/use-prefix.js
|
|
1168
|
+
function usePrefix({ status = "idle", theme }) {
|
|
1169
|
+
const [showLoader, setShowLoader] = useState(false);
|
|
1170
|
+
const [tick, setTick] = useState(0);
|
|
1171
|
+
const { prefix, spinner } = makeTheme(theme);
|
|
1172
|
+
useEffect(() => {
|
|
1173
|
+
if (status === "loading") {
|
|
1174
|
+
let tickInterval;
|
|
1175
|
+
let inc = -1;
|
|
1176
|
+
const delayTimeout = setTimeout(() => {
|
|
1177
|
+
setShowLoader(true);
|
|
1178
|
+
tickInterval = setInterval(() => {
|
|
1179
|
+
inc = inc + 1;
|
|
1180
|
+
setTick(inc % spinner.frames.length);
|
|
1181
|
+
}, spinner.interval);
|
|
1182
|
+
}, 300);
|
|
1183
|
+
return () => {
|
|
1184
|
+
clearTimeout(delayTimeout);
|
|
1185
|
+
clearInterval(tickInterval);
|
|
1186
|
+
};
|
|
1187
|
+
} else {
|
|
1188
|
+
setShowLoader(false);
|
|
1189
|
+
}
|
|
1190
|
+
}, [status]);
|
|
1191
|
+
if (showLoader) {
|
|
1192
|
+
return spinner.frames[tick];
|
|
1193
|
+
}
|
|
1194
|
+
const iconName = status === "loading" ? "idle" : status;
|
|
1195
|
+
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
|
1196
|
+
}
|
|
1197
|
+
var init_use_prefix = __esm({
|
|
1198
|
+
"node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/use-prefix.js"() {
|
|
1199
|
+
init_use_state();
|
|
1200
|
+
init_use_effect();
|
|
1201
|
+
init_make_theme();
|
|
1202
|
+
__name(usePrefix, "usePrefix");
|
|
1203
|
+
}
|
|
1204
|
+
});
|
|
1205
|
+
|
|
1206
|
+
// node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/use-memo.js
|
|
1207
|
+
function useMemo(fn, dependencies) {
|
|
1208
|
+
return withPointer((pointer) => {
|
|
1209
|
+
const prev = pointer.get();
|
|
1210
|
+
if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i) => dep !== dependencies[i])) {
|
|
1211
|
+
const value = fn();
|
|
1212
|
+
pointer.set({ value, dependencies });
|
|
1213
|
+
return value;
|
|
1214
|
+
}
|
|
1215
|
+
return prev.value;
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
1218
|
+
var init_use_memo = __esm({
|
|
1219
|
+
"node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/use-memo.js"() {
|
|
1220
|
+
init_hook_engine();
|
|
1221
|
+
__name(useMemo, "useMemo");
|
|
1222
|
+
}
|
|
1223
|
+
});
|
|
1224
|
+
|
|
1225
|
+
// node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/use-ref.js
|
|
1226
|
+
function useRef(val) {
|
|
1227
|
+
return useState({ current: val })[0];
|
|
1228
|
+
}
|
|
1229
|
+
var init_use_ref = __esm({
|
|
1230
|
+
"node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/use-ref.js"() {
|
|
1231
|
+
init_use_state();
|
|
1232
|
+
__name(useRef, "useRef");
|
|
1233
|
+
}
|
|
1234
|
+
});
|
|
1235
|
+
|
|
1236
|
+
// node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/use-keypress.js
|
|
1237
|
+
function useKeypress(userHandler) {
|
|
1238
|
+
const signal = useRef(userHandler);
|
|
1239
|
+
signal.current = userHandler;
|
|
1240
|
+
useEffect((rl) => {
|
|
1241
|
+
let ignore = false;
|
|
1242
|
+
const handler = withUpdates((_input, event) => {
|
|
1243
|
+
if (ignore)
|
|
1244
|
+
return;
|
|
1245
|
+
void signal.current(event, rl);
|
|
1246
|
+
});
|
|
1247
|
+
rl.input.on("keypress", handler);
|
|
1248
|
+
return () => {
|
|
1249
|
+
ignore = true;
|
|
1250
|
+
rl.input.removeListener("keypress", handler);
|
|
1251
|
+
};
|
|
1252
|
+
}, []);
|
|
1253
|
+
}
|
|
1254
|
+
var init_use_keypress = __esm({
|
|
1255
|
+
"node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/use-keypress.js"() {
|
|
1256
|
+
init_use_ref();
|
|
1257
|
+
init_use_effect();
|
|
1258
|
+
init_hook_engine();
|
|
1259
|
+
__name(useKeypress, "useKeypress");
|
|
1260
|
+
}
|
|
1261
|
+
});
|
|
1262
|
+
|
|
1263
|
+
// node_modules/.pnpm/cli-width@4.1.0/node_modules/cli-width/index.js
|
|
1264
|
+
var require_cli_width = __commonJS({
|
|
1265
|
+
"node_modules/.pnpm/cli-width@4.1.0/node_modules/cli-width/index.js"(exports2, module2) {
|
|
1266
|
+
"use strict";
|
|
1267
|
+
module2.exports = cliWidth2;
|
|
1268
|
+
function normalizeOpts(options) {
|
|
1269
|
+
const defaultOpts = {
|
|
1270
|
+
defaultWidth: 0,
|
|
1271
|
+
output: process.stdout,
|
|
1272
|
+
tty: require("tty")
|
|
1273
|
+
};
|
|
1274
|
+
if (!options) {
|
|
1275
|
+
return defaultOpts;
|
|
1276
|
+
}
|
|
1277
|
+
Object.keys(defaultOpts).forEach(function(key) {
|
|
1278
|
+
if (!options[key]) {
|
|
1279
|
+
options[key] = defaultOpts[key];
|
|
1280
|
+
}
|
|
1281
|
+
});
|
|
1282
|
+
return options;
|
|
1283
|
+
}
|
|
1284
|
+
__name(normalizeOpts, "normalizeOpts");
|
|
1285
|
+
function cliWidth2(options) {
|
|
1286
|
+
const opts = normalizeOpts(options);
|
|
1287
|
+
if (opts.output.getWindowSize) {
|
|
1288
|
+
return opts.output.getWindowSize()[0] || opts.defaultWidth;
|
|
1289
|
+
}
|
|
1290
|
+
if (opts.tty.getWindowSize) {
|
|
1291
|
+
return opts.tty.getWindowSize()[1] || opts.defaultWidth;
|
|
1292
|
+
}
|
|
1293
|
+
if (opts.output.columns) {
|
|
1294
|
+
return opts.output.columns;
|
|
1295
|
+
}
|
|
1296
|
+
if (process.env.CLI_WIDTH) {
|
|
1297
|
+
const width = parseInt(process.env.CLI_WIDTH, 10);
|
|
1298
|
+
if (!isNaN(width) && width !== 0) {
|
|
1299
|
+
return width;
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
return opts.defaultWidth;
|
|
1303
|
+
}
|
|
1304
|
+
__name(cliWidth2, "cliWidth");
|
|
1305
|
+
}
|
|
1306
|
+
});
|
|
1307
|
+
|
|
1308
|
+
// node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
1309
|
+
var getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji;
|
|
1310
|
+
var init_utils = __esm({
|
|
1311
|
+
"node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js"() {
|
|
1312
|
+
getCodePointsLength = /* @__PURE__ */ (() => {
|
|
1313
|
+
const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
1314
|
+
return (input2) => {
|
|
1315
|
+
let surrogatePairsNr = 0;
|
|
1316
|
+
SURROGATE_PAIR_RE.lastIndex = 0;
|
|
1317
|
+
while (SURROGATE_PAIR_RE.test(input2)) {
|
|
1318
|
+
surrogatePairsNr += 1;
|
|
1319
|
+
}
|
|
1320
|
+
return input2.length - surrogatePairsNr;
|
|
1321
|
+
};
|
|
1322
|
+
})();
|
|
1323
|
+
isFullWidth = /* @__PURE__ */ __name((x) => {
|
|
1324
|
+
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
1325
|
+
}, "isFullWidth");
|
|
1326
|
+
isWideNotCJKTNotEmoji = /* @__PURE__ */ __name((x) => {
|
|
1327
|
+
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;
|
|
1328
|
+
}, "isWideNotCJKTNotEmoji");
|
|
1329
|
+
}
|
|
1330
|
+
});
|
|
1331
|
+
|
|
1332
|
+
// node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
|
|
1333
|
+
var ANSI_RE, CONTROL_RE, CJKT_WIDE_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default2;
|
|
1334
|
+
var init_dist2 = __esm({
|
|
1335
|
+
"node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js"() {
|
|
1336
|
+
init_utils();
|
|
1337
|
+
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
|
|
1338
|
+
CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
1339
|
+
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;
|
|
1340
|
+
TAB_RE = /\t{1,1000}/y;
|
|
1341
|
+
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");
|
|
1342
|
+
LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
1343
|
+
MODIFIER_RE = new RegExp("\\p{M}+", "gu");
|
|
1344
|
+
NO_TRUNCATION = { limit: Infinity, ellipsis: "" };
|
|
1345
|
+
getStringTruncatedWidth = /* @__PURE__ */ __name((input2, truncationOptions = {}, widthOptions = {}) => {
|
|
1346
|
+
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
1347
|
+
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
1348
|
+
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
|
|
1349
|
+
const ANSI_WIDTH = 0;
|
|
1350
|
+
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
1351
|
+
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
1352
|
+
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
1353
|
+
const FULL_WIDTH_WIDTH = 2;
|
|
1354
|
+
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
1355
|
+
const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
|
|
1356
|
+
const PARSE_BLOCKS = [
|
|
1357
|
+
[LATIN_RE, REGULAR_WIDTH],
|
|
1358
|
+
[ANSI_RE, ANSI_WIDTH],
|
|
1359
|
+
[CONTROL_RE, CONTROL_WIDTH],
|
|
1360
|
+
[TAB_RE, TAB_WIDTH],
|
|
1361
|
+
[EMOJI_RE, EMOJI_WIDTH],
|
|
1362
|
+
[CJKT_WIDE_RE, WIDE_WIDTH]
|
|
1363
|
+
];
|
|
1364
|
+
let indexPrev = 0;
|
|
1365
|
+
let index = 0;
|
|
1366
|
+
let length = input2.length;
|
|
1367
|
+
let lengthExtra = 0;
|
|
1368
|
+
let truncationEnabled = false;
|
|
1369
|
+
let truncationIndex = length;
|
|
1370
|
+
let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);
|
|
1371
|
+
let unmatchedStart = 0;
|
|
1372
|
+
let unmatchedEnd = 0;
|
|
1373
|
+
let width = 0;
|
|
1374
|
+
let widthExtra = 0;
|
|
1375
|
+
outer: while (true) {
|
|
1376
|
+
if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
|
|
1377
|
+
const unmatched = input2.slice(unmatchedStart, unmatchedEnd) || input2.slice(indexPrev, index);
|
|
1378
|
+
lengthExtra = 0;
|
|
1379
|
+
for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
|
|
1380
|
+
const codePoint = char.codePointAt(0) || 0;
|
|
1381
|
+
if (isFullWidth(codePoint)) {
|
|
1382
|
+
widthExtra = FULL_WIDTH_WIDTH;
|
|
1383
|
+
} else if (isWideNotCJKTNotEmoji(codePoint)) {
|
|
1384
|
+
widthExtra = WIDE_WIDTH;
|
|
1385
|
+
} else {
|
|
1386
|
+
widthExtra = REGULAR_WIDTH;
|
|
1387
|
+
}
|
|
1388
|
+
if (width + widthExtra > truncationLimit) {
|
|
1389
|
+
truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
|
|
1390
|
+
}
|
|
1391
|
+
if (width + widthExtra > LIMIT) {
|
|
1392
|
+
truncationEnabled = true;
|
|
1393
|
+
break outer;
|
|
1394
|
+
}
|
|
1395
|
+
lengthExtra += char.length;
|
|
1396
|
+
width += widthExtra;
|
|
1397
|
+
}
|
|
1398
|
+
unmatchedStart = unmatchedEnd = 0;
|
|
1399
|
+
}
|
|
1400
|
+
if (index >= length) {
|
|
1401
|
+
break outer;
|
|
1402
|
+
}
|
|
1403
|
+
for (let i = 0, l = PARSE_BLOCKS.length; i < l; i++) {
|
|
1404
|
+
const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
|
|
1405
|
+
BLOCK_RE.lastIndex = index;
|
|
1406
|
+
if (BLOCK_RE.test(input2)) {
|
|
1407
|
+
lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input2.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
|
|
1408
|
+
widthExtra = lengthExtra * BLOCK_WIDTH;
|
|
1409
|
+
if (width + widthExtra > truncationLimit) {
|
|
1410
|
+
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
|
|
1411
|
+
}
|
|
1412
|
+
if (width + widthExtra > LIMIT) {
|
|
1413
|
+
truncationEnabled = true;
|
|
1414
|
+
break outer;
|
|
1415
|
+
}
|
|
1416
|
+
width += widthExtra;
|
|
1417
|
+
unmatchedStart = indexPrev;
|
|
1418
|
+
unmatchedEnd = index;
|
|
1419
|
+
index = indexPrev = BLOCK_RE.lastIndex;
|
|
1420
|
+
continue outer;
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
index += 1;
|
|
1424
|
+
}
|
|
1425
|
+
return {
|
|
1426
|
+
width: truncationEnabled ? truncationLimit : width,
|
|
1427
|
+
index: truncationEnabled ? truncationIndex : length,
|
|
1428
|
+
truncated: truncationEnabled,
|
|
1429
|
+
ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
|
|
1430
|
+
};
|
|
1431
|
+
}, "getStringTruncatedWidth");
|
|
1432
|
+
dist_default2 = getStringTruncatedWidth;
|
|
1433
|
+
}
|
|
1434
|
+
});
|
|
1435
|
+
|
|
1436
|
+
// node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
|
|
1437
|
+
var NO_TRUNCATION2, fastStringWidth, dist_default3;
|
|
1438
|
+
var init_dist3 = __esm({
|
|
1439
|
+
"node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js"() {
|
|
1440
|
+
init_dist2();
|
|
1441
|
+
NO_TRUNCATION2 = {
|
|
1442
|
+
limit: Infinity,
|
|
1443
|
+
ellipsis: "",
|
|
1444
|
+
ellipsisWidth: 0
|
|
1445
|
+
};
|
|
1446
|
+
fastStringWidth = /* @__PURE__ */ __name((input2, options = {}) => {
|
|
1447
|
+
return dist_default2(input2, NO_TRUNCATION2, options).width;
|
|
1448
|
+
}, "fastStringWidth");
|
|
1449
|
+
dist_default3 = fastStringWidth;
|
|
1450
|
+
}
|
|
1451
|
+
});
|
|
1452
|
+
|
|
1453
|
+
// node_modules/.pnpm/fast-wrap-ansi@0.2.0/node_modules/fast-wrap-ansi/lib/main.js
|
|
1454
|
+
function wrapAnsi(string, columns, options) {
|
|
1455
|
+
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
1456
|
+
}
|
|
1457
|
+
var ESC, CSI, END_CODE, ANSI_ESCAPE_BELL, ANSI_CSI, ANSI_OSC, ANSI_SGR_TERMINATOR, ANSI_ESCAPE_LINK, GROUP_REGEX, getClosingCode, wrapAnsiCode, wrapAnsiHyperlink, wrapWord, stringVisibleTrimSpacesRight, exec, CRLF_OR_LF;
|
|
1458
|
+
var init_main = __esm({
|
|
1459
|
+
"node_modules/.pnpm/fast-wrap-ansi@0.2.0/node_modules/fast-wrap-ansi/lib/main.js"() {
|
|
1460
|
+
init_dist3();
|
|
1461
|
+
ESC = "\x1B";
|
|
1462
|
+
CSI = "";
|
|
1463
|
+
END_CODE = 39;
|
|
1464
|
+
ANSI_ESCAPE_BELL = "\x07";
|
|
1465
|
+
ANSI_CSI = "[";
|
|
1466
|
+
ANSI_OSC = "]";
|
|
1467
|
+
ANSI_SGR_TERMINATOR = "m";
|
|
1468
|
+
ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
1469
|
+
GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
|
|
1470
|
+
getClosingCode = /* @__PURE__ */ __name((openingCode) => {
|
|
1471
|
+
if (openingCode >= 30 && openingCode <= 37)
|
|
1472
|
+
return 39;
|
|
1473
|
+
if (openingCode >= 90 && openingCode <= 97)
|
|
1474
|
+
return 39;
|
|
1475
|
+
if (openingCode >= 40 && openingCode <= 47)
|
|
1476
|
+
return 49;
|
|
1477
|
+
if (openingCode >= 100 && openingCode <= 107)
|
|
1478
|
+
return 49;
|
|
1479
|
+
if (openingCode === 1 || openingCode === 2)
|
|
1480
|
+
return 22;
|
|
1481
|
+
if (openingCode === 3)
|
|
1482
|
+
return 23;
|
|
1483
|
+
if (openingCode === 4)
|
|
1484
|
+
return 24;
|
|
1485
|
+
if (openingCode === 7)
|
|
1486
|
+
return 27;
|
|
1487
|
+
if (openingCode === 8)
|
|
1488
|
+
return 28;
|
|
1489
|
+
if (openingCode === 9)
|
|
1490
|
+
return 29;
|
|
1491
|
+
if (openingCode === 0)
|
|
1492
|
+
return 0;
|
|
1493
|
+
return void 0;
|
|
1494
|
+
}, "getClosingCode");
|
|
1495
|
+
wrapAnsiCode = /* @__PURE__ */ __name((code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`, "wrapAnsiCode");
|
|
1496
|
+
wrapAnsiHyperlink = /* @__PURE__ */ __name((url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`, "wrapAnsiHyperlink");
|
|
1497
|
+
wrapWord = /* @__PURE__ */ __name((rows, word, columns) => {
|
|
1498
|
+
const characters = word[Symbol.iterator]();
|
|
1499
|
+
let isInsideEscape = false;
|
|
1500
|
+
let isInsideLinkEscape = false;
|
|
1501
|
+
let lastRow = rows.at(-1);
|
|
1502
|
+
let visible = lastRow === void 0 ? 0 : dist_default3(lastRow);
|
|
1503
|
+
let currentCharacter = characters.next();
|
|
1504
|
+
let nextCharacter = characters.next();
|
|
1505
|
+
let rawCharacterIndex = 0;
|
|
1506
|
+
while (!currentCharacter.done) {
|
|
1507
|
+
const character = currentCharacter.value;
|
|
1508
|
+
const characterLength = dist_default3(character);
|
|
1509
|
+
if (visible + characterLength <= columns) {
|
|
1510
|
+
rows[rows.length - 1] += character;
|
|
1511
|
+
} else {
|
|
1512
|
+
rows.push(character);
|
|
1513
|
+
visible = 0;
|
|
1514
|
+
}
|
|
1515
|
+
if (character === ESC || character === CSI) {
|
|
1516
|
+
isInsideEscape = true;
|
|
1517
|
+
isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
|
|
1518
|
+
}
|
|
1519
|
+
if (isInsideEscape) {
|
|
1520
|
+
if (isInsideLinkEscape) {
|
|
1521
|
+
if (character === ANSI_ESCAPE_BELL) {
|
|
1522
|
+
isInsideEscape = false;
|
|
1523
|
+
isInsideLinkEscape = false;
|
|
1524
|
+
}
|
|
1525
|
+
} else if (character === ANSI_SGR_TERMINATOR) {
|
|
1526
|
+
isInsideEscape = false;
|
|
1527
|
+
}
|
|
1528
|
+
} else {
|
|
1529
|
+
visible += characterLength;
|
|
1530
|
+
if (visible === columns && !nextCharacter.done) {
|
|
1531
|
+
rows.push("");
|
|
1532
|
+
visible = 0;
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
currentCharacter = nextCharacter;
|
|
1536
|
+
nextCharacter = characters.next();
|
|
1537
|
+
rawCharacterIndex += character.length;
|
|
1538
|
+
}
|
|
1539
|
+
lastRow = rows.at(-1);
|
|
1540
|
+
if (!visible && lastRow !== void 0 && lastRow.length && rows.length > 1) {
|
|
1541
|
+
rows[rows.length - 2] += rows.pop();
|
|
1542
|
+
}
|
|
1543
|
+
}, "wrapWord");
|
|
1544
|
+
stringVisibleTrimSpacesRight = /* @__PURE__ */ __name((string) => {
|
|
1545
|
+
const words = string.split(" ");
|
|
1546
|
+
let last = words.length;
|
|
1547
|
+
while (last) {
|
|
1548
|
+
if (dist_default3(words[last - 1])) {
|
|
1549
|
+
break;
|
|
1550
|
+
}
|
|
1551
|
+
last--;
|
|
1552
|
+
}
|
|
1553
|
+
if (last === words.length) {
|
|
1554
|
+
return string;
|
|
1555
|
+
}
|
|
1556
|
+
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
1557
|
+
}, "stringVisibleTrimSpacesRight");
|
|
1558
|
+
exec = /* @__PURE__ */ __name((string, columns, options = {}) => {
|
|
1559
|
+
if (options.trim !== false && string.trim() === "") {
|
|
1560
|
+
return "";
|
|
1561
|
+
}
|
|
1562
|
+
let returnValue = "";
|
|
1563
|
+
let escapeCode;
|
|
1564
|
+
let escapeUrl;
|
|
1565
|
+
const words = string.split(" ");
|
|
1566
|
+
let rows = [""];
|
|
1567
|
+
let rowLength = 0;
|
|
1568
|
+
for (let index = 0; index < words.length; index++) {
|
|
1569
|
+
const word = words[index];
|
|
1570
|
+
if (options.trim !== false) {
|
|
1571
|
+
const row = rows.at(-1) ?? "";
|
|
1572
|
+
const trimmed = row.trimStart();
|
|
1573
|
+
if (row.length !== trimmed.length) {
|
|
1574
|
+
rows[rows.length - 1] = trimmed;
|
|
1575
|
+
rowLength = dist_default3(trimmed);
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
if (index !== 0) {
|
|
1579
|
+
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
1580
|
+
rows.push("");
|
|
1581
|
+
rowLength = 0;
|
|
1582
|
+
}
|
|
1583
|
+
if (rowLength || options.trim === false) {
|
|
1584
|
+
rows[rows.length - 1] += " ";
|
|
1585
|
+
rowLength++;
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
const wordLength = dist_default3(word);
|
|
1589
|
+
if (options.hard && wordLength > columns) {
|
|
1590
|
+
const remainingColumns = columns - rowLength;
|
|
1591
|
+
const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
|
|
1592
|
+
const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);
|
|
1593
|
+
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
1594
|
+
rows.push("");
|
|
1595
|
+
}
|
|
1596
|
+
wrapWord(rows, word, columns);
|
|
1597
|
+
rowLength = dist_default3(rows.at(-1) ?? "");
|
|
1598
|
+
continue;
|
|
1599
|
+
}
|
|
1600
|
+
if (rowLength + wordLength > columns && rowLength && wordLength) {
|
|
1601
|
+
if (options.wordWrap === false && rowLength < columns) {
|
|
1602
|
+
wrapWord(rows, word, columns);
|
|
1603
|
+
rowLength = dist_default3(rows.at(-1) ?? "");
|
|
1604
|
+
continue;
|
|
1605
|
+
}
|
|
1606
|
+
rows.push("");
|
|
1607
|
+
rowLength = 0;
|
|
1608
|
+
}
|
|
1609
|
+
if (rowLength + wordLength > columns && options.wordWrap === false) {
|
|
1610
|
+
wrapWord(rows, word, columns);
|
|
1611
|
+
rowLength = dist_default3(rows.at(-1) ?? "");
|
|
1612
|
+
continue;
|
|
1613
|
+
}
|
|
1614
|
+
rows[rows.length - 1] += word;
|
|
1615
|
+
rowLength += wordLength;
|
|
1616
|
+
}
|
|
1617
|
+
if (options.trim !== false) {
|
|
1618
|
+
rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
1619
|
+
}
|
|
1620
|
+
const preString = rows.join("\n");
|
|
1621
|
+
let inSurrogate = false;
|
|
1622
|
+
for (let i = 0; i < preString.length; i++) {
|
|
1623
|
+
const character = preString[i];
|
|
1624
|
+
returnValue += character;
|
|
1625
|
+
if (!inSurrogate) {
|
|
1626
|
+
inSurrogate = character >= "\uD800" && character <= "\uDBFF";
|
|
1627
|
+
if (inSurrogate) {
|
|
1628
|
+
continue;
|
|
1629
|
+
}
|
|
1630
|
+
} else {
|
|
1631
|
+
inSurrogate = false;
|
|
1632
|
+
}
|
|
1633
|
+
if (character === ESC || character === CSI) {
|
|
1634
|
+
GROUP_REGEX.lastIndex = i + 1;
|
|
1635
|
+
const groupsResult = GROUP_REGEX.exec(preString);
|
|
1636
|
+
const groups = groupsResult?.groups;
|
|
1637
|
+
if (groups?.code !== void 0) {
|
|
1638
|
+
const code = Number.parseFloat(groups.code);
|
|
1639
|
+
escapeCode = code === END_CODE ? void 0 : code;
|
|
1640
|
+
} else if (groups?.uri !== void 0) {
|
|
1641
|
+
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
if (preString[i + 1] === "\n") {
|
|
1645
|
+
if (escapeUrl) {
|
|
1646
|
+
returnValue += wrapAnsiHyperlink("");
|
|
1647
|
+
}
|
|
1648
|
+
const closingCode = escapeCode ? getClosingCode(escapeCode) : void 0;
|
|
1649
|
+
if (escapeCode && closingCode) {
|
|
1650
|
+
returnValue += wrapAnsiCode(closingCode);
|
|
1651
|
+
}
|
|
1652
|
+
} else if (character === "\n") {
|
|
1653
|
+
if (escapeCode && getClosingCode(escapeCode)) {
|
|
1654
|
+
returnValue += wrapAnsiCode(escapeCode);
|
|
1655
|
+
}
|
|
1656
|
+
if (escapeUrl) {
|
|
1657
|
+
returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
return returnValue;
|
|
1662
|
+
}, "exec");
|
|
1663
|
+
CRLF_OR_LF = /\r?\n/;
|
|
1664
|
+
__name(wrapAnsi, "wrapAnsi");
|
|
1665
|
+
}
|
|
1666
|
+
});
|
|
1667
|
+
|
|
1668
|
+
// node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/utils.js
|
|
1669
|
+
function breakLines(content, width) {
|
|
1670
|
+
return content.split("\n").flatMap((line) => wrapAnsi(line, width, { trim: false, hard: true }).split("\n").map((str) => str.trimEnd())).join("\n");
|
|
1671
|
+
}
|
|
1672
|
+
function readlineWidth() {
|
|
1673
|
+
return (0, import_cli_width.default)({ defaultWidth: 80, output: readline().output });
|
|
1674
|
+
}
|
|
1675
|
+
var import_cli_width;
|
|
1676
|
+
var init_utils2 = __esm({
|
|
1677
|
+
"node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/utils.js"() {
|
|
1678
|
+
import_cli_width = __toESM(require_cli_width(), 1);
|
|
1679
|
+
init_main();
|
|
1680
|
+
init_hook_engine();
|
|
1681
|
+
__name(breakLines, "breakLines");
|
|
1682
|
+
__name(readlineWidth, "readlineWidth");
|
|
1683
|
+
}
|
|
1684
|
+
});
|
|
1685
|
+
|
|
1686
|
+
// node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
|
|
1687
|
+
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
1688
|
+
const state = useRef({
|
|
1689
|
+
lastPointer: active,
|
|
1690
|
+
lastActive: void 0
|
|
1691
|
+
});
|
|
1692
|
+
const { lastPointer, lastActive } = state.current;
|
|
1693
|
+
const middle = Math.floor(pageSize / 2);
|
|
1694
|
+
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
|
1695
|
+
const defaultPointerPosition = renderedItems.slice(0, active).reduce((acc, item) => acc + item.length, 0);
|
|
1696
|
+
let pointer = defaultPointerPosition;
|
|
1697
|
+
if (renderedLength > pageSize) {
|
|
1698
|
+
if (loop) {
|
|
1699
|
+
pointer = lastPointer;
|
|
1700
|
+
if (
|
|
1701
|
+
// First render, skip this logic.
|
|
1702
|
+
lastActive != null && // Only move the pointer down when the user moves down.
|
|
1703
|
+
lastActive < active && // Check user didn't move up across page boundary.
|
|
1704
|
+
active - lastActive < pageSize
|
|
1705
|
+
) {
|
|
1706
|
+
pointer = Math.min(
|
|
1707
|
+
// Furthest allowed position for the pointer is the middle of the list
|
|
1708
|
+
middle,
|
|
1709
|
+
Math.abs(active - lastActive) === 1 ? Math.min(
|
|
1710
|
+
// Move the pointer at most the height of the last active item.
|
|
1711
|
+
lastPointer + (renderedItems[lastActive]?.length ?? 0),
|
|
1712
|
+
// If the user moved by one item, move the pointer to the natural position of the active item as
|
|
1713
|
+
// long as it doesn't move the cursor up.
|
|
1714
|
+
Math.max(defaultPointerPosition, lastPointer)
|
|
1715
|
+
) : (
|
|
1716
|
+
// Otherwise, move the pointer down by the difference between the active and last active item.
|
|
1717
|
+
lastPointer + active - lastActive
|
|
1718
|
+
)
|
|
1719
|
+
);
|
|
1720
|
+
}
|
|
1721
|
+
} else {
|
|
1722
|
+
const spaceUnderActive = renderedItems.slice(active).reduce((acc, item) => acc + item.length, 0);
|
|
1723
|
+
pointer = spaceUnderActive < pageSize - middle ? (
|
|
1724
|
+
// If the active item is near the end of the list, progressively move the cursor towards the end.
|
|
1725
|
+
pageSize - spaceUnderActive
|
|
1726
|
+
) : (
|
|
1727
|
+
// Otherwise, progressively move the pointer to the middle of the list.
|
|
1728
|
+
Math.min(defaultPointerPosition, middle)
|
|
1729
|
+
);
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
state.current.lastPointer = pointer;
|
|
1733
|
+
state.current.lastActive = active;
|
|
1734
|
+
return pointer;
|
|
1735
|
+
}
|
|
1736
|
+
function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
1737
|
+
const width = readlineWidth();
|
|
1738
|
+
const bound = /* @__PURE__ */ __name((num) => (num % items.length + items.length) % items.length, "bound");
|
|
1739
|
+
const renderedItems = items.map((item, index) => {
|
|
1740
|
+
if (item == null)
|
|
1741
|
+
return [];
|
|
1742
|
+
return breakLines(renderItem({ item, index, isActive: index === active }), width).split("\n");
|
|
1743
|
+
});
|
|
1744
|
+
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
|
1745
|
+
const renderItemAtIndex = /* @__PURE__ */ __name((index) => renderedItems[index] ?? [], "renderItemAtIndex");
|
|
1746
|
+
const pointer = usePointerPosition({ active, renderedItems, pageSize, loop });
|
|
1747
|
+
const activeItem = renderItemAtIndex(active).slice(0, pageSize);
|
|
1748
|
+
const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length;
|
|
1749
|
+
const pageBuffer = Array.from({ length: pageSize });
|
|
1750
|
+
pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem);
|
|
1751
|
+
const itemVisited = /* @__PURE__ */ new Set([active]);
|
|
1752
|
+
let bufferPointer = activeItemPosition + activeItem.length;
|
|
1753
|
+
let itemPointer = bound(active + 1);
|
|
1754
|
+
while (bufferPointer < pageSize && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) {
|
|
1755
|
+
const lines = renderItemAtIndex(itemPointer);
|
|
1756
|
+
const linesToAdd = lines.slice(0, pageSize - bufferPointer);
|
|
1757
|
+
pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd);
|
|
1758
|
+
itemVisited.add(itemPointer);
|
|
1759
|
+
bufferPointer += linesToAdd.length;
|
|
1760
|
+
itemPointer = bound(itemPointer + 1);
|
|
1761
|
+
}
|
|
1762
|
+
bufferPointer = activeItemPosition - 1;
|
|
1763
|
+
itemPointer = bound(active - 1);
|
|
1764
|
+
while (bufferPointer >= 0 && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) {
|
|
1765
|
+
const lines = renderItemAtIndex(itemPointer);
|
|
1766
|
+
const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1));
|
|
1767
|
+
pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd);
|
|
1768
|
+
itemVisited.add(itemPointer);
|
|
1769
|
+
bufferPointer -= linesToAdd.length;
|
|
1770
|
+
itemPointer = bound(itemPointer - 1);
|
|
1771
|
+
}
|
|
1772
|
+
return pageBuffer.filter((line) => typeof line === "string").join("\n");
|
|
1773
|
+
}
|
|
1774
|
+
var init_use_pagination = __esm({
|
|
1775
|
+
"node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js"() {
|
|
1776
|
+
init_use_ref();
|
|
1777
|
+
init_utils2();
|
|
1778
|
+
__name(usePointerPosition, "usePointerPosition");
|
|
1779
|
+
__name(usePagination, "usePagination");
|
|
1780
|
+
}
|
|
1781
|
+
});
|
|
1782
|
+
|
|
1783
|
+
// node_modules/.pnpm/mute-stream@3.0.0/node_modules/mute-stream/lib/index.js
|
|
1784
|
+
var require_lib = __commonJS({
|
|
1785
|
+
"node_modules/.pnpm/mute-stream@3.0.0/node_modules/mute-stream/lib/index.js"(exports2, module2) {
|
|
1786
|
+
var Stream = require("stream");
|
|
1787
|
+
var MuteStream2 = class extends Stream {
|
|
1788
|
+
static {
|
|
1789
|
+
__name(this, "MuteStream");
|
|
1790
|
+
}
|
|
1791
|
+
#isTTY = null;
|
|
1792
|
+
constructor(opts = {}) {
|
|
1793
|
+
super(opts);
|
|
1794
|
+
this.writable = this.readable = true;
|
|
1795
|
+
this.muted = false;
|
|
1796
|
+
this.on("pipe", this._onpipe);
|
|
1797
|
+
this.replace = opts.replace;
|
|
1798
|
+
this._prompt = opts.prompt || null;
|
|
1799
|
+
this._hadControl = false;
|
|
1800
|
+
}
|
|
1801
|
+
#destSrc(key, def) {
|
|
1802
|
+
if (this._dest) {
|
|
1803
|
+
return this._dest[key];
|
|
1804
|
+
}
|
|
1805
|
+
if (this._src) {
|
|
1806
|
+
return this._src[key];
|
|
1807
|
+
}
|
|
1808
|
+
return def;
|
|
1809
|
+
}
|
|
1810
|
+
#proxy(method, ...args) {
|
|
1811
|
+
if (typeof this._dest?.[method] === "function") {
|
|
1812
|
+
this._dest[method](...args);
|
|
1813
|
+
}
|
|
1814
|
+
if (typeof this._src?.[method] === "function") {
|
|
1815
|
+
this._src[method](...args);
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
get isTTY() {
|
|
1819
|
+
if (this.#isTTY !== null) {
|
|
1820
|
+
return this.#isTTY;
|
|
1821
|
+
}
|
|
1822
|
+
return this.#destSrc("isTTY", false);
|
|
1823
|
+
}
|
|
1824
|
+
// basically just get replace the getter/setter with a regular value
|
|
1825
|
+
set isTTY(val) {
|
|
1826
|
+
this.#isTTY = val;
|
|
1827
|
+
}
|
|
1828
|
+
get rows() {
|
|
1829
|
+
return this.#destSrc("rows");
|
|
1830
|
+
}
|
|
1831
|
+
get columns() {
|
|
1832
|
+
return this.#destSrc("columns");
|
|
1833
|
+
}
|
|
1834
|
+
mute() {
|
|
1835
|
+
this.muted = true;
|
|
1836
|
+
}
|
|
1837
|
+
unmute() {
|
|
1838
|
+
this.muted = false;
|
|
1839
|
+
}
|
|
1840
|
+
_onpipe(src) {
|
|
1841
|
+
this._src = src;
|
|
1842
|
+
}
|
|
1843
|
+
pipe(dest, options) {
|
|
1844
|
+
this._dest = dest;
|
|
1845
|
+
return super.pipe(dest, options);
|
|
1846
|
+
}
|
|
1847
|
+
pause() {
|
|
1848
|
+
if (this._src) {
|
|
1849
|
+
return this._src.pause();
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
resume() {
|
|
1853
|
+
if (this._src) {
|
|
1854
|
+
return this._src.resume();
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1857
|
+
write(c) {
|
|
1858
|
+
if (this.muted) {
|
|
1859
|
+
if (!this.replace) {
|
|
1860
|
+
return true;
|
|
1861
|
+
}
|
|
1862
|
+
if (c.match(/^\u001b/)) {
|
|
1863
|
+
if (c.indexOf(this._prompt) === 0) {
|
|
1864
|
+
c = c.slice(this._prompt.length);
|
|
1865
|
+
c = c.replace(/./g, this.replace);
|
|
1866
|
+
c = this._prompt + c;
|
|
1867
|
+
}
|
|
1868
|
+
this._hadControl = true;
|
|
1869
|
+
return this.emit("data", c);
|
|
1870
|
+
} else {
|
|
1871
|
+
if (this._prompt && this._hadControl && c.indexOf(this._prompt) === 0) {
|
|
1872
|
+
this._hadControl = false;
|
|
1873
|
+
this.emit("data", this._prompt);
|
|
1874
|
+
c = c.slice(this._prompt.length);
|
|
1875
|
+
}
|
|
1876
|
+
c = c.toString().replace(/./g, this.replace);
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
this.emit("data", c);
|
|
1880
|
+
}
|
|
1881
|
+
end(c) {
|
|
1882
|
+
if (this.muted) {
|
|
1883
|
+
if (c && this.replace) {
|
|
1884
|
+
c = c.toString().replace(/./g, this.replace);
|
|
1885
|
+
} else {
|
|
1886
|
+
c = null;
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
if (c) {
|
|
1890
|
+
this.emit("data", c);
|
|
1891
|
+
}
|
|
1892
|
+
this.emit("end");
|
|
1893
|
+
}
|
|
1894
|
+
destroy(...args) {
|
|
1895
|
+
return this.#proxy("destroy", ...args);
|
|
1896
|
+
}
|
|
1897
|
+
destroySoon(...args) {
|
|
1898
|
+
return this.#proxy("destroySoon", ...args);
|
|
1899
|
+
}
|
|
1900
|
+
close(...args) {
|
|
1901
|
+
return this.#proxy("close", ...args);
|
|
1902
|
+
}
|
|
1903
|
+
};
|
|
1904
|
+
module2.exports = MuteStream2;
|
|
1905
|
+
}
|
|
1906
|
+
});
|
|
1907
|
+
|
|
1908
|
+
// node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
1909
|
+
var signals;
|
|
1910
|
+
var init_signals = __esm({
|
|
1911
|
+
"node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js"() {
|
|
1912
|
+
signals = [];
|
|
1913
|
+
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
1914
|
+
if (process.platform !== "win32") {
|
|
1915
|
+
signals.push(
|
|
1916
|
+
"SIGALRM",
|
|
1917
|
+
"SIGABRT",
|
|
1918
|
+
"SIGVTALRM",
|
|
1919
|
+
"SIGXCPU",
|
|
1920
|
+
"SIGXFSZ",
|
|
1921
|
+
"SIGUSR2",
|
|
1922
|
+
"SIGTRAP",
|
|
1923
|
+
"SIGSYS",
|
|
1924
|
+
"SIGQUIT",
|
|
1925
|
+
"SIGIOT"
|
|
1926
|
+
// should detect profiler and enable/disable accordingly.
|
|
1927
|
+
// see #21
|
|
1928
|
+
// 'SIGPROF'
|
|
1929
|
+
);
|
|
1930
|
+
}
|
|
1931
|
+
if (process.platform === "linux") {
|
|
1932
|
+
signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
});
|
|
1936
|
+
|
|
1937
|
+
// node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
|
|
1938
|
+
var processOk, kExitEmitter, global, ObjectDefineProperty, Emitter, SignalExitBase, signalExitWrap, SignalExitFallback, SignalExit, process5, onExit, load, unload;
|
|
1939
|
+
var init_mjs = __esm({
|
|
1940
|
+
"node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js"() {
|
|
1941
|
+
init_signals();
|
|
1942
|
+
processOk = /* @__PURE__ */ __name((process6) => !!process6 && typeof process6 === "object" && typeof process6.removeListener === "function" && typeof process6.emit === "function" && typeof process6.reallyExit === "function" && typeof process6.listeners === "function" && typeof process6.kill === "function" && typeof process6.pid === "number" && typeof process6.on === "function", "processOk");
|
|
1943
|
+
kExitEmitter = Symbol.for("signal-exit emitter");
|
|
1944
|
+
global = globalThis;
|
|
1945
|
+
ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
1946
|
+
Emitter = class {
|
|
1947
|
+
static {
|
|
1948
|
+
__name(this, "Emitter");
|
|
1949
|
+
}
|
|
1950
|
+
emitted = {
|
|
1951
|
+
afterExit: false,
|
|
1952
|
+
exit: false
|
|
1953
|
+
};
|
|
1954
|
+
listeners = {
|
|
1955
|
+
afterExit: [],
|
|
1956
|
+
exit: []
|
|
1957
|
+
};
|
|
1958
|
+
count = 0;
|
|
1959
|
+
id = Math.random();
|
|
1960
|
+
constructor() {
|
|
1961
|
+
if (global[kExitEmitter]) {
|
|
1962
|
+
return global[kExitEmitter];
|
|
1963
|
+
}
|
|
1964
|
+
ObjectDefineProperty(global, kExitEmitter, {
|
|
1965
|
+
value: this,
|
|
1966
|
+
writable: false,
|
|
1967
|
+
enumerable: false,
|
|
1968
|
+
configurable: false
|
|
1969
|
+
});
|
|
1970
|
+
}
|
|
1971
|
+
on(ev, fn) {
|
|
1972
|
+
this.listeners[ev].push(fn);
|
|
1973
|
+
}
|
|
1974
|
+
removeListener(ev, fn) {
|
|
1975
|
+
const list = this.listeners[ev];
|
|
1976
|
+
const i = list.indexOf(fn);
|
|
1977
|
+
if (i === -1) {
|
|
1978
|
+
return;
|
|
1979
|
+
}
|
|
1980
|
+
if (i === 0 && list.length === 1) {
|
|
1981
|
+
list.length = 0;
|
|
1982
|
+
} else {
|
|
1983
|
+
list.splice(i, 1);
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
emit(ev, code, signal) {
|
|
1987
|
+
if (this.emitted[ev]) {
|
|
1988
|
+
return false;
|
|
1989
|
+
}
|
|
1990
|
+
this.emitted[ev] = true;
|
|
1991
|
+
let ret = false;
|
|
1992
|
+
for (const fn of this.listeners[ev]) {
|
|
1993
|
+
ret = fn(code, signal) === true || ret;
|
|
1994
|
+
}
|
|
1995
|
+
if (ev === "exit") {
|
|
1996
|
+
ret = this.emit("afterExit", code, signal) || ret;
|
|
1997
|
+
}
|
|
1998
|
+
return ret;
|
|
1999
|
+
}
|
|
2000
|
+
};
|
|
2001
|
+
SignalExitBase = class {
|
|
2002
|
+
static {
|
|
2003
|
+
__name(this, "SignalExitBase");
|
|
2004
|
+
}
|
|
2005
|
+
};
|
|
2006
|
+
signalExitWrap = /* @__PURE__ */ __name((handler) => {
|
|
2007
|
+
return {
|
|
2008
|
+
onExit(cb, opts) {
|
|
2009
|
+
return handler.onExit(cb, opts);
|
|
2010
|
+
},
|
|
2011
|
+
load() {
|
|
2012
|
+
return handler.load();
|
|
2013
|
+
},
|
|
2014
|
+
unload() {
|
|
2015
|
+
return handler.unload();
|
|
2016
|
+
}
|
|
2017
|
+
};
|
|
2018
|
+
}, "signalExitWrap");
|
|
2019
|
+
SignalExitFallback = class extends SignalExitBase {
|
|
2020
|
+
static {
|
|
2021
|
+
__name(this, "SignalExitFallback");
|
|
2022
|
+
}
|
|
2023
|
+
onExit() {
|
|
2024
|
+
return () => {
|
|
2025
|
+
};
|
|
2026
|
+
}
|
|
2027
|
+
load() {
|
|
2028
|
+
}
|
|
2029
|
+
unload() {
|
|
2030
|
+
}
|
|
2031
|
+
};
|
|
2032
|
+
SignalExit = class extends SignalExitBase {
|
|
2033
|
+
static {
|
|
2034
|
+
__name(this, "SignalExit");
|
|
2035
|
+
}
|
|
2036
|
+
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
2037
|
+
// so use a supported signal instead
|
|
2038
|
+
/* c8 ignore start */
|
|
2039
|
+
#hupSig = process5.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
2040
|
+
/* c8 ignore stop */
|
|
2041
|
+
#emitter = new Emitter();
|
|
2042
|
+
#process;
|
|
2043
|
+
#originalProcessEmit;
|
|
2044
|
+
#originalProcessReallyExit;
|
|
2045
|
+
#sigListeners = {};
|
|
2046
|
+
#loaded = false;
|
|
2047
|
+
constructor(process6) {
|
|
2048
|
+
super();
|
|
2049
|
+
this.#process = process6;
|
|
2050
|
+
this.#sigListeners = {};
|
|
2051
|
+
for (const sig of signals) {
|
|
2052
|
+
this.#sigListeners[sig] = () => {
|
|
2053
|
+
const listeners = this.#process.listeners(sig);
|
|
2054
|
+
let { count } = this.#emitter;
|
|
2055
|
+
const p = process6;
|
|
2056
|
+
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
|
|
2057
|
+
count += p.__signal_exit_emitter__.count;
|
|
2058
|
+
}
|
|
2059
|
+
if (listeners.length === count) {
|
|
2060
|
+
this.unload();
|
|
2061
|
+
const ret = this.#emitter.emit("exit", null, sig);
|
|
2062
|
+
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
2063
|
+
if (!ret)
|
|
2064
|
+
process6.kill(process6.pid, s);
|
|
2065
|
+
}
|
|
2066
|
+
};
|
|
2067
|
+
}
|
|
2068
|
+
this.#originalProcessReallyExit = process6.reallyExit;
|
|
2069
|
+
this.#originalProcessEmit = process6.emit;
|
|
2070
|
+
}
|
|
2071
|
+
onExit(cb, opts) {
|
|
2072
|
+
if (!processOk(this.#process)) {
|
|
2073
|
+
return () => {
|
|
2074
|
+
};
|
|
2075
|
+
}
|
|
2076
|
+
if (this.#loaded === false) {
|
|
2077
|
+
this.load();
|
|
2078
|
+
}
|
|
2079
|
+
const ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
2080
|
+
this.#emitter.on(ev, cb);
|
|
2081
|
+
return () => {
|
|
2082
|
+
this.#emitter.removeListener(ev, cb);
|
|
2083
|
+
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
|
|
2084
|
+
this.unload();
|
|
2085
|
+
}
|
|
2086
|
+
};
|
|
2087
|
+
}
|
|
2088
|
+
load() {
|
|
2089
|
+
if (this.#loaded) {
|
|
2090
|
+
return;
|
|
2091
|
+
}
|
|
2092
|
+
this.#loaded = true;
|
|
2093
|
+
this.#emitter.count += 1;
|
|
2094
|
+
for (const sig of signals) {
|
|
2095
|
+
try {
|
|
2096
|
+
const fn = this.#sigListeners[sig];
|
|
2097
|
+
if (fn)
|
|
2098
|
+
this.#process.on(sig, fn);
|
|
2099
|
+
} catch (_) {
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
this.#process.emit = (ev, ...a) => {
|
|
2103
|
+
return this.#processEmit(ev, ...a);
|
|
2104
|
+
};
|
|
2105
|
+
this.#process.reallyExit = (code) => {
|
|
2106
|
+
return this.#processReallyExit(code);
|
|
2107
|
+
};
|
|
2108
|
+
}
|
|
2109
|
+
unload() {
|
|
2110
|
+
if (!this.#loaded) {
|
|
2111
|
+
return;
|
|
2112
|
+
}
|
|
2113
|
+
this.#loaded = false;
|
|
2114
|
+
signals.forEach((sig) => {
|
|
2115
|
+
const listener = this.#sigListeners[sig];
|
|
2116
|
+
if (!listener) {
|
|
2117
|
+
throw new Error("Listener not defined for signal: " + sig);
|
|
2118
|
+
}
|
|
2119
|
+
try {
|
|
2120
|
+
this.#process.removeListener(sig, listener);
|
|
2121
|
+
} catch (_) {
|
|
2122
|
+
}
|
|
2123
|
+
});
|
|
2124
|
+
this.#process.emit = this.#originalProcessEmit;
|
|
2125
|
+
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
2126
|
+
this.#emitter.count -= 1;
|
|
2127
|
+
}
|
|
2128
|
+
#processReallyExit(code) {
|
|
2129
|
+
if (!processOk(this.#process)) {
|
|
2130
|
+
return 0;
|
|
2131
|
+
}
|
|
2132
|
+
this.#process.exitCode = code || 0;
|
|
2133
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
2134
|
+
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
|
2135
|
+
}
|
|
2136
|
+
#processEmit(ev, ...args) {
|
|
2137
|
+
const og = this.#originalProcessEmit;
|
|
2138
|
+
if (ev === "exit" && processOk(this.#process)) {
|
|
2139
|
+
if (typeof args[0] === "number") {
|
|
2140
|
+
this.#process.exitCode = args[0];
|
|
2141
|
+
}
|
|
2142
|
+
const ret = og.call(this.#process, ev, ...args);
|
|
2143
|
+
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
2144
|
+
return ret;
|
|
2145
|
+
} else {
|
|
2146
|
+
return og.call(this.#process, ev, ...args);
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
};
|
|
2150
|
+
process5 = globalThis.process;
|
|
2151
|
+
({
|
|
2152
|
+
onExit: (
|
|
2153
|
+
/**
|
|
2154
|
+
* Called when the process is exiting, whether via signal, explicit
|
|
2155
|
+
* exit, or running out of stuff to do.
|
|
2156
|
+
*
|
|
2157
|
+
* If the global process object is not suitable for instrumentation,
|
|
2158
|
+
* then this will be a no-op.
|
|
2159
|
+
*
|
|
2160
|
+
* Returns a function that may be used to unload signal-exit.
|
|
2161
|
+
*/
|
|
2162
|
+
onExit
|
|
2163
|
+
),
|
|
2164
|
+
load: (
|
|
2165
|
+
/**
|
|
2166
|
+
* Load the listeners. Likely you never need to call this, unless
|
|
2167
|
+
* doing a rather deep integration with signal-exit functionality.
|
|
2168
|
+
* Mostly exposed for the benefit of testing.
|
|
2169
|
+
*
|
|
2170
|
+
* @internal
|
|
2171
|
+
*/
|
|
2172
|
+
load
|
|
2173
|
+
),
|
|
2174
|
+
unload: (
|
|
2175
|
+
/**
|
|
2176
|
+
* Unload the listeners. Likely you never need to call this, unless
|
|
2177
|
+
* doing a rather deep integration with signal-exit functionality.
|
|
2178
|
+
* Mostly exposed for the benefit of testing.
|
|
2179
|
+
*
|
|
2180
|
+
* @internal
|
|
2181
|
+
*/
|
|
2182
|
+
unload
|
|
2183
|
+
)
|
|
2184
|
+
} = signalExitWrap(processOk(process5) ? new SignalExit(process5) : new SignalExitFallback()));
|
|
2185
|
+
}
|
|
2186
|
+
});
|
|
2187
|
+
|
|
2188
|
+
// node_modules/.pnpm/@inquirer+ansi@2.0.5/node_modules/@inquirer/ansi/dist/index.js
|
|
2189
|
+
var ESC2, cursorLeft, cursorHide, cursorShow, cursorUp, cursorDown, cursorTo, eraseLine, eraseLines;
|
|
2190
|
+
var init_dist4 = __esm({
|
|
2191
|
+
"node_modules/.pnpm/@inquirer+ansi@2.0.5/node_modules/@inquirer/ansi/dist/index.js"() {
|
|
2192
|
+
ESC2 = "\x1B[";
|
|
2193
|
+
cursorLeft = ESC2 + "G";
|
|
2194
|
+
cursorHide = ESC2 + "?25l";
|
|
2195
|
+
cursorShow = ESC2 + "?25h";
|
|
2196
|
+
cursorUp = /* @__PURE__ */ __name((rows = 1) => rows > 0 ? `${ESC2}${rows}A` : "", "cursorUp");
|
|
2197
|
+
cursorDown = /* @__PURE__ */ __name((rows = 1) => rows > 0 ? `${ESC2}${rows}B` : "", "cursorDown");
|
|
2198
|
+
cursorTo = /* @__PURE__ */ __name((x, y) => {
|
|
2199
|
+
if (typeof y === "number" && !Number.isNaN(y)) {
|
|
2200
|
+
return `${ESC2}${y + 1};${x + 1}H`;
|
|
2201
|
+
}
|
|
2202
|
+
return `${ESC2}${x + 1}G`;
|
|
2203
|
+
}, "cursorTo");
|
|
2204
|
+
eraseLine = ESC2 + "2K";
|
|
2205
|
+
eraseLines = /* @__PURE__ */ __name((lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "", "eraseLines");
|
|
2206
|
+
}
|
|
2207
|
+
});
|
|
2208
|
+
|
|
2209
|
+
// node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
2210
|
+
var import_node_util2, height, lastLine, ScreenManager;
|
|
2211
|
+
var init_screen_manager = __esm({
|
|
2212
|
+
"node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/screen-manager.js"() {
|
|
2213
|
+
import_node_util2 = require("node:util");
|
|
2214
|
+
init_utils2();
|
|
2215
|
+
init_dist4();
|
|
2216
|
+
height = /* @__PURE__ */ __name((content) => content.split("\n").length, "height");
|
|
2217
|
+
lastLine = /* @__PURE__ */ __name((content) => content.split("\n").pop() ?? "", "lastLine");
|
|
2218
|
+
ScreenManager = class {
|
|
2219
|
+
static {
|
|
2220
|
+
__name(this, "ScreenManager");
|
|
2221
|
+
}
|
|
2222
|
+
// These variables are keeping information to allow correct prompt re-rendering
|
|
2223
|
+
height = 0;
|
|
2224
|
+
extraLinesUnderPrompt = 0;
|
|
2225
|
+
cursorPos;
|
|
2226
|
+
rl;
|
|
2227
|
+
constructor(rl) {
|
|
2228
|
+
this.rl = rl;
|
|
2229
|
+
this.cursorPos = rl.getCursorPos();
|
|
2230
|
+
}
|
|
2231
|
+
write(content) {
|
|
2232
|
+
this.rl.output.unmute();
|
|
2233
|
+
this.rl.output.write(content);
|
|
2234
|
+
this.rl.output.mute();
|
|
2235
|
+
}
|
|
2236
|
+
render(content, bottomContent = "") {
|
|
2237
|
+
const promptLine = lastLine(content);
|
|
2238
|
+
const rawPromptLine = (0, import_node_util2.stripVTControlCharacters)(promptLine);
|
|
2239
|
+
let prompt = rawPromptLine;
|
|
2240
|
+
if (this.rl.line.length > 0) {
|
|
2241
|
+
prompt = prompt.slice(0, -this.rl.line.length);
|
|
2242
|
+
}
|
|
2243
|
+
this.rl.setPrompt(prompt);
|
|
2244
|
+
this.cursorPos = this.rl.getCursorPos();
|
|
2245
|
+
const width = readlineWidth();
|
|
2246
|
+
content = breakLines(content, width);
|
|
2247
|
+
bottomContent = breakLines(bottomContent, width);
|
|
2248
|
+
if (rawPromptLine.length % width === 0) {
|
|
2249
|
+
content += "\n";
|
|
2250
|
+
}
|
|
2251
|
+
let output = content + (bottomContent ? "\n" + bottomContent : "");
|
|
2252
|
+
const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;
|
|
2253
|
+
const bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0);
|
|
2254
|
+
if (bottomContentHeight > 0)
|
|
2255
|
+
output += cursorUp(bottomContentHeight);
|
|
2256
|
+
output += cursorTo(this.cursorPos.cols);
|
|
2257
|
+
this.write(cursorDown(this.extraLinesUnderPrompt) + eraseLines(this.height) + output);
|
|
2258
|
+
this.extraLinesUnderPrompt = bottomContentHeight;
|
|
2259
|
+
this.height = height(output);
|
|
2260
|
+
}
|
|
2261
|
+
checkCursorPos() {
|
|
2262
|
+
const cursorPos = this.rl.getCursorPos();
|
|
2263
|
+
if (cursorPos.cols !== this.cursorPos.cols) {
|
|
2264
|
+
this.write(cursorTo(cursorPos.cols));
|
|
2265
|
+
this.cursorPos = cursorPos;
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
done({ clearContent }) {
|
|
2269
|
+
this.rl.setPrompt("");
|
|
2270
|
+
let output = cursorDown(this.extraLinesUnderPrompt);
|
|
2271
|
+
output += clearContent ? eraseLines(this.height) : "\n";
|
|
2272
|
+
output += cursorShow;
|
|
2273
|
+
this.write(output);
|
|
2274
|
+
this.rl.close();
|
|
2275
|
+
}
|
|
2276
|
+
};
|
|
2277
|
+
}
|
|
2278
|
+
});
|
|
2279
|
+
|
|
2280
|
+
// node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
|
|
2281
|
+
var PromisePolyfill;
|
|
2282
|
+
var init_promise_polyfill = __esm({
|
|
2283
|
+
"node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/promise-polyfill.js"() {
|
|
2284
|
+
PromisePolyfill = class extends Promise {
|
|
2285
|
+
static {
|
|
2286
|
+
__name(this, "PromisePolyfill");
|
|
2287
|
+
}
|
|
2288
|
+
// Available starting from Node 22
|
|
2289
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers
|
|
2290
|
+
static withResolver() {
|
|
2291
|
+
let resolve;
|
|
2292
|
+
let reject;
|
|
2293
|
+
const promise = new Promise((res, rej) => {
|
|
2294
|
+
resolve = res;
|
|
2295
|
+
reject = rej;
|
|
2296
|
+
});
|
|
2297
|
+
return { promise, resolve, reject };
|
|
2298
|
+
}
|
|
2299
|
+
};
|
|
2300
|
+
}
|
|
2301
|
+
});
|
|
2302
|
+
|
|
2303
|
+
// node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
2304
|
+
function getCallSites() {
|
|
2305
|
+
const _prepareStackTrace = Error.prepareStackTrace;
|
|
2306
|
+
let result = [];
|
|
2307
|
+
try {
|
|
2308
|
+
Error.prepareStackTrace = (_, callSites) => {
|
|
2309
|
+
const callSitesWithoutCurrent = callSites.slice(1);
|
|
2310
|
+
result = callSitesWithoutCurrent;
|
|
2311
|
+
return callSitesWithoutCurrent;
|
|
2312
|
+
};
|
|
2313
|
+
new Error().stack;
|
|
2314
|
+
} catch {
|
|
2315
|
+
return result;
|
|
2316
|
+
}
|
|
2317
|
+
Error.prepareStackTrace = _prepareStackTrace;
|
|
2318
|
+
return result;
|
|
2319
|
+
}
|
|
2320
|
+
function createPrompt(view) {
|
|
2321
|
+
const callSites = getCallSites();
|
|
2322
|
+
const prompt = /* @__PURE__ */ __name((config, context = {}) => {
|
|
2323
|
+
const { input: input2 = process.stdin, signal } = context;
|
|
2324
|
+
const cleanups = /* @__PURE__ */ new Set();
|
|
2325
|
+
const output = new import_mute_stream.default();
|
|
2326
|
+
output.pipe(context.output ?? process.stdout);
|
|
2327
|
+
output.mute();
|
|
2328
|
+
const rl = readline2.createInterface({
|
|
2329
|
+
terminal: true,
|
|
2330
|
+
input: input2,
|
|
2331
|
+
output
|
|
2332
|
+
});
|
|
2333
|
+
const screen = new ScreenManager(rl);
|
|
2334
|
+
const { promise, resolve, reject } = PromisePolyfill.withResolver();
|
|
2335
|
+
const cancel = /* @__PURE__ */ __name(() => reject(new CancelPromptError()), "cancel");
|
|
2336
|
+
if (signal) {
|
|
2337
|
+
const abort = /* @__PURE__ */ __name(() => reject(new AbortPromptError({ cause: signal.reason })), "abort");
|
|
2338
|
+
if (signal.aborted) {
|
|
2339
|
+
abort();
|
|
2340
|
+
return Object.assign(promise, { cancel });
|
|
2341
|
+
}
|
|
2342
|
+
signal.addEventListener("abort", abort);
|
|
2343
|
+
cleanups.add(() => signal.removeEventListener("abort", abort));
|
|
2344
|
+
}
|
|
2345
|
+
cleanups.add(onExit((code, signal2) => {
|
|
2346
|
+
reject(new ExitPromptError(`User force closed the prompt with ${code} ${signal2}`));
|
|
2347
|
+
}));
|
|
2348
|
+
const sigint = /* @__PURE__ */ __name(() => reject(new ExitPromptError(`User force closed the prompt with SIGINT`)), "sigint");
|
|
2349
|
+
rl.on("SIGINT", sigint);
|
|
2350
|
+
cleanups.add(() => rl.removeListener("SIGINT", sigint));
|
|
2351
|
+
return withHooks(rl, (cycle) => {
|
|
2352
|
+
const hooksCleanup = import_node_async_hooks3.AsyncResource.bind(() => effectScheduler.clearAll());
|
|
2353
|
+
rl.on("close", hooksCleanup);
|
|
2354
|
+
cleanups.add(() => rl.removeListener("close", hooksCleanup));
|
|
2355
|
+
const startCycle = /* @__PURE__ */ __name(() => {
|
|
2356
|
+
const checkCursorPos = /* @__PURE__ */ __name(() => screen.checkCursorPos(), "checkCursorPos");
|
|
2357
|
+
rl.input.on("keypress", checkCursorPos);
|
|
2358
|
+
cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
|
|
2359
|
+
let pendingDone = null;
|
|
2360
|
+
cycle(() => {
|
|
2361
|
+
let effectsSettled = false;
|
|
2362
|
+
try {
|
|
2363
|
+
const nextView = view(config, (value) => {
|
|
2364
|
+
if (effectsSettled) {
|
|
2365
|
+
resolve(value);
|
|
2366
|
+
} else {
|
|
2367
|
+
pendingDone = { value };
|
|
2368
|
+
}
|
|
2369
|
+
});
|
|
2370
|
+
if (nextView === void 0) {
|
|
2371
|
+
let callerFilename = callSites[1]?.getFileName();
|
|
2372
|
+
if (callerFilename && !callerFilename.startsWith("file://")) {
|
|
2373
|
+
callerFilename = import_node_path.default.resolve(callerFilename);
|
|
2374
|
+
}
|
|
2375
|
+
throw new Error(`Prompt functions must return a string.
|
|
2376
|
+
at ${callerFilename}`);
|
|
2377
|
+
}
|
|
2378
|
+
const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
|
|
2379
|
+
screen.render(content, bottomContent);
|
|
2380
|
+
effectScheduler.run();
|
|
2381
|
+
} catch (error) {
|
|
2382
|
+
reject(error);
|
|
2383
|
+
}
|
|
2384
|
+
effectsSettled = true;
|
|
2385
|
+
if (pendingDone !== null) {
|
|
2386
|
+
const { value } = pendingDone;
|
|
2387
|
+
pendingDone = null;
|
|
2388
|
+
resolve(value);
|
|
2389
|
+
}
|
|
2390
|
+
});
|
|
2391
|
+
}, "startCycle");
|
|
2392
|
+
if ("readableFlowing" in input2) {
|
|
2393
|
+
nativeSetImmediate(startCycle);
|
|
2394
|
+
} else {
|
|
2395
|
+
startCycle();
|
|
2396
|
+
}
|
|
2397
|
+
return Object.assign(promise.then((answer) => {
|
|
2398
|
+
effectScheduler.clearAll();
|
|
2399
|
+
return answer;
|
|
2400
|
+
}, (error) => {
|
|
2401
|
+
effectScheduler.clearAll();
|
|
2402
|
+
throw error;
|
|
2403
|
+
}).finally(() => {
|
|
2404
|
+
cleanups.forEach((cleanup) => cleanup());
|
|
2405
|
+
screen.done({ clearContent: Boolean(context.clearPromptOnDone) });
|
|
2406
|
+
output.end();
|
|
2407
|
+
}).then(() => promise), { cancel });
|
|
2408
|
+
});
|
|
2409
|
+
}, "prompt");
|
|
2410
|
+
return prompt;
|
|
2411
|
+
}
|
|
2412
|
+
var readline2, import_node_async_hooks3, import_mute_stream, import_node_path, nativeSetImmediate;
|
|
2413
|
+
var init_create_prompt = __esm({
|
|
2414
|
+
"node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/create-prompt.js"() {
|
|
2415
|
+
readline2 = __toESM(require("node:readline"), 1);
|
|
2416
|
+
import_node_async_hooks3 = require("node:async_hooks");
|
|
2417
|
+
import_mute_stream = __toESM(require_lib(), 1);
|
|
2418
|
+
init_mjs();
|
|
2419
|
+
init_screen_manager();
|
|
2420
|
+
init_promise_polyfill();
|
|
2421
|
+
init_hook_engine();
|
|
2422
|
+
init_errors();
|
|
2423
|
+
import_node_path = __toESM(require("node:path"), 1);
|
|
2424
|
+
nativeSetImmediate = globalThis.setImmediate;
|
|
2425
|
+
__name(getCallSites, "getCallSites");
|
|
2426
|
+
__name(createPrompt, "createPrompt");
|
|
2427
|
+
}
|
|
2428
|
+
});
|
|
2429
|
+
|
|
2430
|
+
// node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/Separator.js
|
|
2431
|
+
var import_node_util3, Separator;
|
|
2432
|
+
var init_Separator = __esm({
|
|
2433
|
+
"node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/lib/Separator.js"() {
|
|
2434
|
+
import_node_util3 = require("node:util");
|
|
2435
|
+
init_dist();
|
|
2436
|
+
Separator = class {
|
|
2437
|
+
static {
|
|
2438
|
+
__name(this, "Separator");
|
|
2439
|
+
}
|
|
2440
|
+
separator = (0, import_node_util3.styleText)("dim", Array.from({ length: 15 }).join(dist_default.line));
|
|
2441
|
+
type = "separator";
|
|
2442
|
+
constructor(separator) {
|
|
2443
|
+
if (separator) {
|
|
2444
|
+
this.separator = separator;
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
static isSeparator(choice) {
|
|
2448
|
+
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
|
2449
|
+
}
|
|
2450
|
+
};
|
|
2451
|
+
}
|
|
2452
|
+
});
|
|
2453
|
+
|
|
2454
|
+
// node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/index.js
|
|
2455
|
+
var init_dist5 = __esm({
|
|
2456
|
+
"node_modules/.pnpm/@inquirer+core@11.1.8_@types+node@24.9.2/node_modules/@inquirer/core/dist/index.js"() {
|
|
2457
|
+
init_key();
|
|
2458
|
+
init_errors();
|
|
2459
|
+
init_use_prefix();
|
|
2460
|
+
init_use_state();
|
|
2461
|
+
init_use_effect();
|
|
2462
|
+
init_use_memo();
|
|
2463
|
+
init_use_ref();
|
|
2464
|
+
init_use_keypress();
|
|
2465
|
+
init_make_theme();
|
|
2466
|
+
init_use_pagination();
|
|
2467
|
+
init_create_prompt();
|
|
2468
|
+
init_Separator();
|
|
2469
|
+
}
|
|
2470
|
+
});
|
|
2471
|
+
|
|
2472
|
+
// node_modules/.pnpm/@inquirer+checkbox@5.1.3_@types+node@24.9.2/node_modules/@inquirer/checkbox/dist/index.js
|
|
2473
|
+
var dist_exports = {};
|
|
2474
|
+
__export(dist_exports, {
|
|
2475
|
+
Separator: () => Separator,
|
|
2476
|
+
default: () => dist_default4
|
|
2477
|
+
});
|
|
2478
|
+
function isSelectable(item) {
|
|
2479
|
+
return !Separator.isSeparator(item) && !item.disabled;
|
|
2480
|
+
}
|
|
2481
|
+
function isNavigable(item) {
|
|
2482
|
+
return !Separator.isSeparator(item);
|
|
2483
|
+
}
|
|
2484
|
+
function isChecked(item) {
|
|
2485
|
+
return !Separator.isSeparator(item) && item.checked;
|
|
2486
|
+
}
|
|
2487
|
+
function toggle(item) {
|
|
2488
|
+
return isSelectable(item) ? { ...item, checked: !item.checked } : item;
|
|
2489
|
+
}
|
|
2490
|
+
function check(checked) {
|
|
2491
|
+
return function(item) {
|
|
2492
|
+
return isSelectable(item) ? { ...item, checked } : item;
|
|
2493
|
+
};
|
|
2494
|
+
}
|
|
2495
|
+
function normalizeChoices(choices) {
|
|
2496
|
+
return choices.map((choice) => {
|
|
2497
|
+
if (Separator.isSeparator(choice))
|
|
2498
|
+
return choice;
|
|
2499
|
+
if (typeof choice !== "object" || choice === null || !("value" in choice)) {
|
|
2500
|
+
const name2 = String(choice);
|
|
2501
|
+
return {
|
|
2502
|
+
value: choice,
|
|
2503
|
+
name: name2,
|
|
2504
|
+
short: name2,
|
|
2505
|
+
checkedName: name2,
|
|
2506
|
+
disabled: false,
|
|
2507
|
+
checked: false
|
|
2508
|
+
};
|
|
2509
|
+
}
|
|
2510
|
+
const name = choice.name ?? String(choice.value);
|
|
2511
|
+
const normalizedChoice = {
|
|
2512
|
+
value: choice.value,
|
|
2513
|
+
name,
|
|
2514
|
+
short: choice.short ?? name,
|
|
2515
|
+
checkedName: choice.checkedName ?? name,
|
|
2516
|
+
disabled: choice.disabled ?? false,
|
|
2517
|
+
checked: choice.checked ?? false
|
|
2518
|
+
};
|
|
2519
|
+
if (choice.description) {
|
|
2520
|
+
normalizedChoice.description = choice.description;
|
|
2521
|
+
}
|
|
2522
|
+
return normalizedChoice;
|
|
2523
|
+
});
|
|
2524
|
+
}
|
|
2525
|
+
var import_node_util4, checkboxTheme, dist_default4;
|
|
2526
|
+
var init_dist6 = __esm({
|
|
2527
|
+
"node_modules/.pnpm/@inquirer+checkbox@5.1.3_@types+node@24.9.2/node_modules/@inquirer/checkbox/dist/index.js"() {
|
|
2528
|
+
init_dist5();
|
|
2529
|
+
init_dist4();
|
|
2530
|
+
import_node_util4 = require("node:util");
|
|
2531
|
+
init_dist();
|
|
2532
|
+
init_dist5();
|
|
2533
|
+
checkboxTheme = {
|
|
2534
|
+
icon: {
|
|
2535
|
+
checked: (0, import_node_util4.styleText)("green", dist_default.circleFilled),
|
|
2536
|
+
unchecked: dist_default.circle,
|
|
2537
|
+
cursor: dist_default.pointer,
|
|
2538
|
+
disabledChecked: (0, import_node_util4.styleText)("green", dist_default.circleDouble),
|
|
2539
|
+
disabledUnchecked: "-"
|
|
2540
|
+
},
|
|
2541
|
+
style: {
|
|
2542
|
+
disabled: /* @__PURE__ */ __name((text) => (0, import_node_util4.styleText)("dim", text), "disabled"),
|
|
2543
|
+
renderSelectedChoices: /* @__PURE__ */ __name((selectedChoices) => selectedChoices.map((choice) => choice.short).join(", "), "renderSelectedChoices"),
|
|
2544
|
+
description: /* @__PURE__ */ __name((text) => (0, import_node_util4.styleText)("cyan", text), "description"),
|
|
2545
|
+
keysHelpTip: /* @__PURE__ */ __name((keys) => keys.map(([key, action]) => `${(0, import_node_util4.styleText)("bold", key)} ${(0, import_node_util4.styleText)("dim", action)}`).join((0, import_node_util4.styleText)("dim", " • ")), "keysHelpTip")
|
|
2546
|
+
},
|
|
2547
|
+
i18n: { disabledError: "This option is disabled and cannot be toggled." },
|
|
2548
|
+
keybindings: []
|
|
2549
|
+
};
|
|
2550
|
+
__name(isSelectable, "isSelectable");
|
|
2551
|
+
__name(isNavigable, "isNavigable");
|
|
2552
|
+
__name(isChecked, "isChecked");
|
|
2553
|
+
__name(toggle, "toggle");
|
|
2554
|
+
__name(check, "check");
|
|
2555
|
+
__name(normalizeChoices, "normalizeChoices");
|
|
2556
|
+
dist_default4 = createPrompt((config, done) => {
|
|
2557
|
+
const { pageSize = 7, loop = true, required, validate = /* @__PURE__ */ __name(() => true, "validate") } = config;
|
|
2558
|
+
const shortcuts = { all: "a", invert: "i", ...config.shortcuts };
|
|
2559
|
+
const theme = makeTheme(checkboxTheme, config.theme);
|
|
2560
|
+
const { keybindings } = theme;
|
|
2561
|
+
const [status, setStatus] = useState("idle");
|
|
2562
|
+
const prefix = usePrefix({ status, theme });
|
|
2563
|
+
const [items, setItems] = useState(normalizeChoices(config.choices));
|
|
2564
|
+
const bounds = useMemo(() => {
|
|
2565
|
+
const first = items.findIndex(isNavigable);
|
|
2566
|
+
const last = items.findLastIndex(isNavigable);
|
|
2567
|
+
if (first === -1) {
|
|
2568
|
+
throw new ValidationError("[checkbox prompt] No selectable choices. All choices are disabled.");
|
|
2569
|
+
}
|
|
2570
|
+
return { first, last };
|
|
2571
|
+
}, [items]);
|
|
2572
|
+
const [active, setActive] = useState(bounds.first);
|
|
2573
|
+
const [errorMsg, setError] = useState();
|
|
2574
|
+
useKeypress(async (key) => {
|
|
2575
|
+
if (isEnterKey(key)) {
|
|
2576
|
+
const selection = items.filter(isChecked);
|
|
2577
|
+
const isValid = await validate([...selection]);
|
|
2578
|
+
if (required && !selection.length) {
|
|
2579
|
+
setError("At least one choice must be selected");
|
|
2580
|
+
} else if (isValid === true) {
|
|
2581
|
+
setStatus("done");
|
|
2582
|
+
done(selection.map((choice) => choice.value));
|
|
2583
|
+
} else {
|
|
2584
|
+
setError(isValid || "You must select a valid value");
|
|
2585
|
+
}
|
|
2586
|
+
} else if (isUpKey(key, keybindings) || isDownKey(key, keybindings)) {
|
|
2587
|
+
if (errorMsg) {
|
|
2588
|
+
setError(void 0);
|
|
2589
|
+
}
|
|
2590
|
+
if (loop || isUpKey(key, keybindings) && active !== bounds.first || isDownKey(key, keybindings) && active !== bounds.last) {
|
|
2591
|
+
const offset = isUpKey(key, keybindings) ? -1 : 1;
|
|
2592
|
+
let next = active;
|
|
2593
|
+
do {
|
|
2594
|
+
next = (next + offset + items.length) % items.length;
|
|
2595
|
+
} while (!isNavigable(items[next]));
|
|
2596
|
+
setActive(next);
|
|
2597
|
+
}
|
|
2598
|
+
} else if (isSpaceKey(key)) {
|
|
2599
|
+
const activeItem = items[active];
|
|
2600
|
+
if (activeItem && !Separator.isSeparator(activeItem)) {
|
|
2601
|
+
if (activeItem.disabled) {
|
|
2602
|
+
setError(theme.i18n.disabledError);
|
|
2603
|
+
} else {
|
|
2604
|
+
setError(void 0);
|
|
2605
|
+
setItems(items.map((choice, i) => i === active ? toggle(choice) : choice));
|
|
2606
|
+
}
|
|
2607
|
+
}
|
|
2608
|
+
} else if (key.name === shortcuts.all) {
|
|
2609
|
+
const selectAll = items.some((choice) => isSelectable(choice) && !choice.checked);
|
|
2610
|
+
setItems(items.map(check(selectAll)));
|
|
2611
|
+
} else if (key.name === shortcuts.invert) {
|
|
2612
|
+
setItems(items.map(toggle));
|
|
2613
|
+
} else if (isNumberKey(key)) {
|
|
2614
|
+
const selectedIndex = Number(key.name) - 1;
|
|
2615
|
+
let selectableIndex = -1;
|
|
2616
|
+
const position = items.findIndex((item) => {
|
|
2617
|
+
if (Separator.isSeparator(item))
|
|
2618
|
+
return false;
|
|
2619
|
+
selectableIndex++;
|
|
2620
|
+
return selectableIndex === selectedIndex;
|
|
2621
|
+
});
|
|
2622
|
+
const selectedItem = items[position];
|
|
2623
|
+
if (selectedItem && isSelectable(selectedItem)) {
|
|
2624
|
+
setActive(position);
|
|
2625
|
+
setItems(items.map((choice, i) => i === position ? toggle(choice) : choice));
|
|
2626
|
+
}
|
|
2627
|
+
}
|
|
2628
|
+
});
|
|
2629
|
+
const message = theme.style.message(config.message, status);
|
|
2630
|
+
let description;
|
|
2631
|
+
const page = usePagination({
|
|
2632
|
+
items,
|
|
2633
|
+
active,
|
|
2634
|
+
renderItem({ item, isActive }) {
|
|
2635
|
+
if (Separator.isSeparator(item)) {
|
|
2636
|
+
return ` ${item.separator}`;
|
|
2637
|
+
}
|
|
2638
|
+
const cursor = isActive ? theme.icon.cursor : " ";
|
|
2639
|
+
if (item.disabled) {
|
|
2640
|
+
const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
|
|
2641
|
+
const checkbox3 = item.checked ? theme.icon.disabledChecked : theme.icon.disabledUnchecked;
|
|
2642
|
+
return theme.style.disabled(`${cursor}${checkbox3} ${item.name} ${disabledLabel}`);
|
|
2643
|
+
}
|
|
2644
|
+
if (isActive) {
|
|
2645
|
+
description = item.description;
|
|
2646
|
+
}
|
|
2647
|
+
const checkbox2 = item.checked ? theme.icon.checked : theme.icon.unchecked;
|
|
2648
|
+
const name = item.checked ? item.checkedName : item.name;
|
|
2649
|
+
const color = isActive ? theme.style.highlight : (x) => x;
|
|
2650
|
+
return color(`${cursor}${checkbox2} ${name}`);
|
|
2651
|
+
},
|
|
2652
|
+
pageSize,
|
|
2653
|
+
loop
|
|
2654
|
+
});
|
|
2655
|
+
if (status === "done") {
|
|
2656
|
+
const selection = items.filter(isChecked);
|
|
2657
|
+
const answer = theme.style.answer(theme.style.renderSelectedChoices(selection, items));
|
|
2658
|
+
return [prefix, message, answer].filter(Boolean).join(" ");
|
|
2659
|
+
}
|
|
2660
|
+
const keys = [
|
|
2661
|
+
["↑↓", "navigate"],
|
|
2662
|
+
["space", "select"]
|
|
2663
|
+
];
|
|
2664
|
+
if (shortcuts.all)
|
|
2665
|
+
keys.push([shortcuts.all, "all"]);
|
|
2666
|
+
if (shortcuts.invert)
|
|
2667
|
+
keys.push([shortcuts.invert, "invert"]);
|
|
2668
|
+
keys.push(["⏎", "submit"]);
|
|
2669
|
+
const helpLine = theme.style.keysHelpTip(keys);
|
|
2670
|
+
const lines = [
|
|
2671
|
+
[prefix, message].filter(Boolean).join(" "),
|
|
2672
|
+
page,
|
|
2673
|
+
" ",
|
|
2674
|
+
description ? theme.style.description(description) : "",
|
|
2675
|
+
errorMsg ? theme.style.error(errorMsg) : "",
|
|
2676
|
+
helpLine
|
|
2677
|
+
].filter(Boolean).join("\n").trimEnd();
|
|
2678
|
+
return `${lines}${cursorHide}`;
|
|
2679
|
+
});
|
|
2680
|
+
}
|
|
2681
|
+
});
|
|
2682
|
+
|
|
2683
|
+
// node_modules/.pnpm/@inquirer+confirm@6.0.11_@types+node@24.9.2/node_modules/@inquirer/confirm/dist/index.js
|
|
2684
|
+
var dist_exports2 = {};
|
|
2685
|
+
__export(dist_exports2, {
|
|
2686
|
+
default: () => dist_default5
|
|
2687
|
+
});
|
|
2688
|
+
function getBooleanValue(value, defaultValue) {
|
|
2689
|
+
let answer = defaultValue !== false;
|
|
2690
|
+
if (/^(y|yes)/i.test(value))
|
|
2691
|
+
answer = true;
|
|
2692
|
+
else if (/^(n|no)/i.test(value))
|
|
2693
|
+
answer = false;
|
|
2694
|
+
return answer;
|
|
2695
|
+
}
|
|
2696
|
+
function boolToString(value) {
|
|
2697
|
+
return value ? "Yes" : "No";
|
|
2698
|
+
}
|
|
2699
|
+
var dist_default5;
|
|
2700
|
+
var init_dist7 = __esm({
|
|
2701
|
+
"node_modules/.pnpm/@inquirer+confirm@6.0.11_@types+node@24.9.2/node_modules/@inquirer/confirm/dist/index.js"() {
|
|
2702
|
+
init_dist5();
|
|
2703
|
+
__name(getBooleanValue, "getBooleanValue");
|
|
2704
|
+
__name(boolToString, "boolToString");
|
|
2705
|
+
dist_default5 = createPrompt((config, done) => {
|
|
2706
|
+
const { transformer = boolToString } = config;
|
|
2707
|
+
const [status, setStatus] = useState("idle");
|
|
2708
|
+
const [value, setValue] = useState("");
|
|
2709
|
+
const theme = makeTheme(config.theme);
|
|
2710
|
+
const prefix = usePrefix({ status, theme });
|
|
2711
|
+
useKeypress((key, rl) => {
|
|
2712
|
+
if (status !== "idle")
|
|
2713
|
+
return;
|
|
2714
|
+
if (isEnterKey(key)) {
|
|
2715
|
+
const answer = getBooleanValue(value, config.default);
|
|
2716
|
+
setValue(transformer(answer));
|
|
2717
|
+
setStatus("done");
|
|
2718
|
+
done(answer);
|
|
2719
|
+
} else if (isTabKey(key)) {
|
|
2720
|
+
const answer = boolToString(!getBooleanValue(value, config.default));
|
|
2721
|
+
rl.clearLine(0);
|
|
2722
|
+
rl.write(answer);
|
|
2723
|
+
setValue(answer);
|
|
2724
|
+
} else {
|
|
2725
|
+
setValue(rl.line);
|
|
2726
|
+
}
|
|
2727
|
+
});
|
|
2728
|
+
let formattedValue = value;
|
|
2729
|
+
let defaultValue = "";
|
|
2730
|
+
if (status === "done") {
|
|
2731
|
+
formattedValue = theme.style.answer(value);
|
|
2732
|
+
} else {
|
|
2733
|
+
defaultValue = ` ${theme.style.defaultAnswer(config.default === false ? "y/N" : "Y/n")}`;
|
|
2734
|
+
}
|
|
2735
|
+
const message = theme.style.message(config.message, status);
|
|
2736
|
+
return `${prefix} ${message}${defaultValue} ${formattedValue}`;
|
|
2737
|
+
});
|
|
2738
|
+
}
|
|
2739
|
+
});
|
|
2740
|
+
|
|
2741
|
+
// node_modules/.pnpm/@inquirer+input@5.0.11_@types+node@24.9.2/node_modules/@inquirer/input/dist/index.js
|
|
2742
|
+
var dist_exports3 = {};
|
|
2743
|
+
__export(dist_exports3, {
|
|
2744
|
+
default: () => dist_default6
|
|
2745
|
+
});
|
|
2746
|
+
var inputTheme, dist_default6;
|
|
2747
|
+
var init_dist8 = __esm({
|
|
2748
|
+
"node_modules/.pnpm/@inquirer+input@5.0.11_@types+node@24.9.2/node_modules/@inquirer/input/dist/index.js"() {
|
|
2749
|
+
init_dist5();
|
|
2750
|
+
inputTheme = {
|
|
2751
|
+
validationFailureMode: "keep"
|
|
2752
|
+
};
|
|
2753
|
+
dist_default6 = createPrompt((config, done) => {
|
|
2754
|
+
const { prefill = "tab" } = config;
|
|
2755
|
+
const theme = makeTheme(inputTheme, config.theme);
|
|
2756
|
+
const [status, setStatus] = useState("idle");
|
|
2757
|
+
const [defaultValue, setDefaultValue] = useState(String(config.default ?? ""));
|
|
2758
|
+
const [errorMsg, setError] = useState();
|
|
2759
|
+
const [value, setValue] = useState("");
|
|
2760
|
+
const prefix = usePrefix({ status, theme });
|
|
2761
|
+
async function validate(value2) {
|
|
2762
|
+
const { required, pattern, patternError = "Invalid input" } = config;
|
|
2763
|
+
if (required && !value2) {
|
|
2764
|
+
return "You must provide a value";
|
|
2765
|
+
}
|
|
2766
|
+
if (pattern && !pattern.test(value2)) {
|
|
2767
|
+
return patternError;
|
|
2768
|
+
}
|
|
2769
|
+
if (typeof config.validate === "function") {
|
|
2770
|
+
return await config.validate(value2) || "You must provide a valid value";
|
|
2771
|
+
}
|
|
2772
|
+
return true;
|
|
2773
|
+
}
|
|
2774
|
+
__name(validate, "validate");
|
|
2775
|
+
useKeypress(async (key, rl) => {
|
|
2776
|
+
if (status !== "idle") {
|
|
2777
|
+
return;
|
|
2778
|
+
}
|
|
2779
|
+
if (isEnterKey(key)) {
|
|
2780
|
+
const answer = value || defaultValue;
|
|
2781
|
+
setStatus("loading");
|
|
2782
|
+
const isValid = await validate(answer);
|
|
2783
|
+
if (isValid === true) {
|
|
2784
|
+
setValue(answer);
|
|
2785
|
+
setStatus("done");
|
|
2786
|
+
done(answer);
|
|
2787
|
+
} else {
|
|
2788
|
+
if (theme.validationFailureMode === "clear") {
|
|
2789
|
+
setValue("");
|
|
2790
|
+
} else {
|
|
2791
|
+
rl.write(value);
|
|
2792
|
+
}
|
|
2793
|
+
setError(isValid);
|
|
2794
|
+
setStatus("idle");
|
|
2795
|
+
}
|
|
2796
|
+
} else if (isBackspaceKey(key) && !value) {
|
|
2797
|
+
setDefaultValue("");
|
|
2798
|
+
} else if (isTabKey(key) && !value) {
|
|
2799
|
+
setDefaultValue("");
|
|
2800
|
+
rl.clearLine(0);
|
|
2801
|
+
rl.write(defaultValue);
|
|
2802
|
+
setValue(defaultValue);
|
|
2803
|
+
} else {
|
|
2804
|
+
setValue(rl.line);
|
|
2805
|
+
setError(void 0);
|
|
2806
|
+
}
|
|
2807
|
+
});
|
|
2808
|
+
useEffect((rl) => {
|
|
2809
|
+
if (prefill === "editable" && defaultValue) {
|
|
2810
|
+
rl.write(defaultValue);
|
|
2811
|
+
setValue(defaultValue);
|
|
2812
|
+
}
|
|
2813
|
+
}, []);
|
|
2814
|
+
const message = theme.style.message(config.message, status);
|
|
2815
|
+
let formattedValue = value;
|
|
2816
|
+
if (typeof config.transformer === "function") {
|
|
2817
|
+
formattedValue = config.transformer(value, { isFinal: status === "done" });
|
|
2818
|
+
} else if (status === "done") {
|
|
2819
|
+
formattedValue = theme.style.answer(value);
|
|
2820
|
+
}
|
|
2821
|
+
let defaultStr;
|
|
2822
|
+
if (defaultValue && status !== "done" && !value) {
|
|
2823
|
+
defaultStr = theme.style.defaultAnswer(defaultValue);
|
|
2824
|
+
}
|
|
2825
|
+
let error = "";
|
|
2826
|
+
if (errorMsg) {
|
|
2827
|
+
error = theme.style.error(errorMsg);
|
|
2828
|
+
}
|
|
2829
|
+
return [
|
|
2830
|
+
[prefix, message, defaultStr, formattedValue].filter((v) => v !== void 0).join(" "),
|
|
2831
|
+
error
|
|
2832
|
+
];
|
|
2833
|
+
});
|
|
2834
|
+
}
|
|
2835
|
+
});
|
|
2836
|
+
|
|
2837
|
+
// node_modules/.pnpm/@inquirer+password@5.0.11_@types+node@24.9.2/node_modules/@inquirer/password/dist/index.js
|
|
2838
|
+
var dist_exports4 = {};
|
|
2839
|
+
__export(dist_exports4, {
|
|
2840
|
+
default: () => dist_default7
|
|
2841
|
+
});
|
|
2842
|
+
var passwordTheme, dist_default7;
|
|
2843
|
+
var init_dist9 = __esm({
|
|
2844
|
+
"node_modules/.pnpm/@inquirer+password@5.0.11_@types+node@24.9.2/node_modules/@inquirer/password/dist/index.js"() {
|
|
2845
|
+
init_dist5();
|
|
2846
|
+
init_dist4();
|
|
2847
|
+
passwordTheme = {
|
|
2848
|
+
style: {
|
|
2849
|
+
maskedText: "[input is masked]"
|
|
2850
|
+
}
|
|
2851
|
+
};
|
|
2852
|
+
dist_default7 = createPrompt((config, done) => {
|
|
2853
|
+
const { validate = /* @__PURE__ */ __name(() => true, "validate") } = config;
|
|
2854
|
+
const theme = makeTheme(passwordTheme, config.theme);
|
|
2855
|
+
const [status, setStatus] = useState("idle");
|
|
2856
|
+
const [errorMsg, setError] = useState();
|
|
2857
|
+
const [value, setValue] = useState("");
|
|
2858
|
+
const prefix = usePrefix({ status, theme });
|
|
2859
|
+
useKeypress(async (key, rl) => {
|
|
2860
|
+
if (status !== "idle") {
|
|
2861
|
+
return;
|
|
2862
|
+
}
|
|
2863
|
+
if (isEnterKey(key)) {
|
|
2864
|
+
const answer = value;
|
|
2865
|
+
setStatus("loading");
|
|
2866
|
+
const isValid = await validate(answer);
|
|
2867
|
+
if (isValid === true) {
|
|
2868
|
+
setValue(answer);
|
|
2869
|
+
setStatus("done");
|
|
2870
|
+
done(answer);
|
|
2871
|
+
} else {
|
|
2872
|
+
rl.write(value);
|
|
2873
|
+
setError(isValid || "You must provide a valid value");
|
|
2874
|
+
setStatus("idle");
|
|
2875
|
+
}
|
|
2876
|
+
} else {
|
|
2877
|
+
setValue(rl.line);
|
|
2878
|
+
setError(void 0);
|
|
2879
|
+
}
|
|
2880
|
+
});
|
|
2881
|
+
const message = theme.style.message(config.message, status);
|
|
2882
|
+
let formattedValue = "";
|
|
2883
|
+
let helpTip;
|
|
2884
|
+
if (config.mask) {
|
|
2885
|
+
const maskChar = typeof config.mask === "string" ? config.mask : "*";
|
|
2886
|
+
formattedValue = maskChar.repeat(value.length);
|
|
2887
|
+
} else if (status !== "done") {
|
|
2888
|
+
helpTip = `${theme.style.help(theme.style.maskedText)}${cursorHide}`;
|
|
2889
|
+
}
|
|
2890
|
+
if (status === "done") {
|
|
2891
|
+
formattedValue = theme.style.answer(formattedValue);
|
|
2892
|
+
}
|
|
2893
|
+
let error = "";
|
|
2894
|
+
if (errorMsg) {
|
|
2895
|
+
error = theme.style.error(errorMsg);
|
|
2896
|
+
}
|
|
2897
|
+
return [[prefix, message, config.mask ? formattedValue : helpTip].join(" "), error];
|
|
2898
|
+
});
|
|
2899
|
+
}
|
|
2900
|
+
});
|
|
2901
|
+
|
|
2902
|
+
// node_modules/.pnpm/@inquirer+search@4.1.7_@types+node@24.9.2/node_modules/@inquirer/search/dist/index.js
|
|
2903
|
+
var dist_exports5 = {};
|
|
2904
|
+
__export(dist_exports5, {
|
|
2905
|
+
Separator: () => Separator,
|
|
2906
|
+
default: () => dist_default8
|
|
2907
|
+
});
|
|
2908
|
+
function isSelectable2(item) {
|
|
2909
|
+
return !Separator.isSeparator(item) && !item.disabled;
|
|
2910
|
+
}
|
|
2911
|
+
function normalizeChoices2(choices) {
|
|
2912
|
+
return choices.map((choice) => {
|
|
2913
|
+
if (Separator.isSeparator(choice))
|
|
2914
|
+
return choice;
|
|
2915
|
+
if (typeof choice !== "object" || choice === null || !("value" in choice)) {
|
|
2916
|
+
const name2 = String(choice);
|
|
2917
|
+
return {
|
|
2918
|
+
value: choice,
|
|
2919
|
+
name: name2,
|
|
2920
|
+
short: name2,
|
|
2921
|
+
disabled: false
|
|
2922
|
+
};
|
|
2923
|
+
}
|
|
2924
|
+
const name = choice.name ?? String(choice.value);
|
|
2925
|
+
const normalizedChoice = {
|
|
2926
|
+
value: choice.value,
|
|
2927
|
+
name,
|
|
2928
|
+
short: choice.short ?? name,
|
|
2929
|
+
disabled: choice.disabled ?? false
|
|
2930
|
+
};
|
|
2931
|
+
if (choice.description) {
|
|
2932
|
+
normalizedChoice.description = choice.description;
|
|
2933
|
+
}
|
|
2934
|
+
return normalizedChoice;
|
|
2935
|
+
});
|
|
2936
|
+
}
|
|
2937
|
+
var import_node_util5, searchTheme, dist_default8;
|
|
2938
|
+
var init_dist10 = __esm({
|
|
2939
|
+
"node_modules/.pnpm/@inquirer+search@4.1.7_@types+node@24.9.2/node_modules/@inquirer/search/dist/index.js"() {
|
|
2940
|
+
init_dist5();
|
|
2941
|
+
import_node_util5 = require("node:util");
|
|
2942
|
+
init_dist();
|
|
2943
|
+
init_dist5();
|
|
2944
|
+
searchTheme = {
|
|
2945
|
+
icon: { cursor: dist_default.pointer },
|
|
2946
|
+
style: {
|
|
2947
|
+
disabled: /* @__PURE__ */ __name((text) => (0, import_node_util5.styleText)("dim", `- ${text}`), "disabled"),
|
|
2948
|
+
searchTerm: /* @__PURE__ */ __name((text) => (0, import_node_util5.styleText)("cyan", text), "searchTerm"),
|
|
2949
|
+
description: /* @__PURE__ */ __name((text) => (0, import_node_util5.styleText)("cyan", text), "description"),
|
|
2950
|
+
keysHelpTip: /* @__PURE__ */ __name((keys) => keys.map(([key, action]) => `${(0, import_node_util5.styleText)("bold", key)} ${(0, import_node_util5.styleText)("dim", action)}`).join((0, import_node_util5.styleText)("dim", " • ")), "keysHelpTip")
|
|
2951
|
+
}
|
|
2952
|
+
};
|
|
2953
|
+
__name(isSelectable2, "isSelectable");
|
|
2954
|
+
__name(normalizeChoices2, "normalizeChoices");
|
|
2955
|
+
dist_default8 = createPrompt((config, done) => {
|
|
2956
|
+
const { pageSize = 7, validate = /* @__PURE__ */ __name(() => true, "validate") } = config;
|
|
2957
|
+
const theme = makeTheme(searchTheme, config.theme);
|
|
2958
|
+
const [status, setStatus] = useState("loading");
|
|
2959
|
+
const [searchTerm, setSearchTerm] = useState("");
|
|
2960
|
+
const [searchResults, setSearchResults] = useState([]);
|
|
2961
|
+
const [searchError, setSearchError] = useState();
|
|
2962
|
+
const defaultApplied = useRef(false);
|
|
2963
|
+
const prefix = usePrefix({ status, theme });
|
|
2964
|
+
const bounds = useMemo(() => {
|
|
2965
|
+
const first = searchResults.findIndex(isSelectable2);
|
|
2966
|
+
const last = searchResults.findLastIndex(isSelectable2);
|
|
2967
|
+
return { first, last };
|
|
2968
|
+
}, [searchResults]);
|
|
2969
|
+
const [active = bounds.first, setActive] = useState();
|
|
2970
|
+
useEffect(() => {
|
|
2971
|
+
const controller = new AbortController();
|
|
2972
|
+
setStatus("loading");
|
|
2973
|
+
setSearchError(void 0);
|
|
2974
|
+
const fetchResults = /* @__PURE__ */ __name(async () => {
|
|
2975
|
+
try {
|
|
2976
|
+
const results = await config.source(searchTerm || void 0, {
|
|
2977
|
+
signal: controller.signal
|
|
2978
|
+
});
|
|
2979
|
+
if (!controller.signal.aborted) {
|
|
2980
|
+
const normalized = normalizeChoices2(results);
|
|
2981
|
+
let initialActive;
|
|
2982
|
+
if (!defaultApplied.current && "default" in config) {
|
|
2983
|
+
const defaultIndex = normalized.findIndex((item) => isSelectable2(item) && item.value === config.default);
|
|
2984
|
+
initialActive = defaultIndex === -1 ? void 0 : defaultIndex;
|
|
2985
|
+
defaultApplied.current = true;
|
|
2986
|
+
}
|
|
2987
|
+
setActive(initialActive);
|
|
2988
|
+
setSearchError(void 0);
|
|
2989
|
+
setSearchResults(normalized);
|
|
2990
|
+
setStatus("idle");
|
|
2991
|
+
}
|
|
2992
|
+
} catch (error2) {
|
|
2993
|
+
if (!controller.signal.aborted && error2 instanceof Error) {
|
|
2994
|
+
setSearchError(error2.message);
|
|
2995
|
+
}
|
|
2996
|
+
}
|
|
2997
|
+
}, "fetchResults");
|
|
2998
|
+
void fetchResults();
|
|
2999
|
+
return () => {
|
|
3000
|
+
controller.abort();
|
|
3001
|
+
};
|
|
3002
|
+
}, [searchTerm]);
|
|
3003
|
+
const selectedChoice = searchResults[active];
|
|
3004
|
+
useKeypress(async (key, rl) => {
|
|
3005
|
+
if (isEnterKey(key)) {
|
|
3006
|
+
if (selectedChoice) {
|
|
3007
|
+
setStatus("loading");
|
|
3008
|
+
const isValid = await validate(selectedChoice.value);
|
|
3009
|
+
setStatus("idle");
|
|
3010
|
+
if (isValid === true) {
|
|
3011
|
+
setStatus("done");
|
|
3012
|
+
done(selectedChoice.value);
|
|
3013
|
+
} else if (selectedChoice.name === searchTerm) {
|
|
3014
|
+
setSearchError(isValid || "You must provide a valid value");
|
|
3015
|
+
} else {
|
|
3016
|
+
rl.write(selectedChoice.name);
|
|
3017
|
+
setSearchTerm(selectedChoice.name);
|
|
3018
|
+
}
|
|
3019
|
+
} else {
|
|
3020
|
+
rl.write(searchTerm);
|
|
3021
|
+
}
|
|
3022
|
+
} else if (isTabKey(key) && selectedChoice) {
|
|
3023
|
+
rl.clearLine(0);
|
|
3024
|
+
rl.write(selectedChoice.name);
|
|
3025
|
+
setSearchTerm(selectedChoice.name);
|
|
3026
|
+
} else if (status !== "loading" && (isUpKey(key) || isDownKey(key))) {
|
|
3027
|
+
rl.clearLine(0);
|
|
3028
|
+
if (isUpKey(key) && active !== bounds.first || isDownKey(key) && active !== bounds.last) {
|
|
3029
|
+
const offset = isUpKey(key) ? -1 : 1;
|
|
3030
|
+
let next = active;
|
|
3031
|
+
do {
|
|
3032
|
+
next = (next + offset + searchResults.length) % searchResults.length;
|
|
3033
|
+
} while (!isSelectable2(searchResults[next]));
|
|
3034
|
+
setActive(next);
|
|
3035
|
+
}
|
|
3036
|
+
} else {
|
|
3037
|
+
setSearchTerm(rl.line);
|
|
3038
|
+
}
|
|
3039
|
+
});
|
|
3040
|
+
const message = theme.style.message(config.message, status);
|
|
3041
|
+
const helpLine = theme.style.keysHelpTip([
|
|
3042
|
+
["↑↓", "navigate"],
|
|
3043
|
+
["⏎", "select"]
|
|
3044
|
+
]);
|
|
3045
|
+
const page = usePagination({
|
|
3046
|
+
items: searchResults,
|
|
3047
|
+
active,
|
|
3048
|
+
renderItem({ item, isActive }) {
|
|
3049
|
+
if (Separator.isSeparator(item)) {
|
|
3050
|
+
return ` ${item.separator}`;
|
|
3051
|
+
}
|
|
3052
|
+
if (item.disabled) {
|
|
3053
|
+
const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
|
|
3054
|
+
return theme.style.disabled(`${item.name} ${disabledLabel}`);
|
|
3055
|
+
}
|
|
3056
|
+
const color = isActive ? theme.style.highlight : (x) => x;
|
|
3057
|
+
const cursor = isActive ? theme.icon.cursor : ` `;
|
|
3058
|
+
return color(`${cursor} ${item.name}`);
|
|
3059
|
+
},
|
|
3060
|
+
pageSize,
|
|
3061
|
+
loop: false
|
|
3062
|
+
});
|
|
3063
|
+
let error;
|
|
3064
|
+
if (searchError) {
|
|
3065
|
+
error = theme.style.error(searchError);
|
|
3066
|
+
} else if (searchResults.length === 0 && searchTerm !== "" && status === "idle") {
|
|
3067
|
+
error = theme.style.error("No results found");
|
|
3068
|
+
}
|
|
3069
|
+
let searchStr;
|
|
3070
|
+
if (status === "done" && selectedChoice) {
|
|
3071
|
+
return [prefix, message, theme.style.answer(selectedChoice.short)].filter(Boolean).join(" ").trimEnd();
|
|
3072
|
+
} else {
|
|
3073
|
+
searchStr = theme.style.searchTerm(searchTerm);
|
|
3074
|
+
}
|
|
3075
|
+
const description = selectedChoice?.description;
|
|
3076
|
+
const header = [prefix, message, searchStr].filter(Boolean).join(" ").trimEnd();
|
|
3077
|
+
const body = [
|
|
3078
|
+
error ?? page,
|
|
3079
|
+
" ",
|
|
3080
|
+
description ? theme.style.description(description) : "",
|
|
3081
|
+
helpLine
|
|
3082
|
+
].filter(Boolean).join("\n").trimEnd();
|
|
3083
|
+
return [header, body];
|
|
3084
|
+
});
|
|
3085
|
+
}
|
|
3086
|
+
});
|
|
3087
|
+
|
|
3088
|
+
// node_modules/.pnpm/@inquirer+select@5.1.3_@types+node@24.9.2/node_modules/@inquirer/select/dist/index.js
|
|
3089
|
+
var dist_exports6 = {};
|
|
3090
|
+
__export(dist_exports6, {
|
|
3091
|
+
Separator: () => Separator,
|
|
3092
|
+
default: () => dist_default9
|
|
3093
|
+
});
|
|
3094
|
+
function isSelectable3(item) {
|
|
3095
|
+
return !Separator.isSeparator(item) && !item.disabled;
|
|
3096
|
+
}
|
|
3097
|
+
function isNavigable2(item) {
|
|
3098
|
+
return !Separator.isSeparator(item);
|
|
3099
|
+
}
|
|
3100
|
+
function normalizeChoices3(choices) {
|
|
3101
|
+
return choices.map((choice) => {
|
|
3102
|
+
if (Separator.isSeparator(choice))
|
|
3103
|
+
return choice;
|
|
3104
|
+
if (typeof choice !== "object" || choice === null || !("value" in choice)) {
|
|
3105
|
+
const name2 = String(choice);
|
|
3106
|
+
return {
|
|
3107
|
+
value: choice,
|
|
3108
|
+
name: name2,
|
|
3109
|
+
short: name2,
|
|
3110
|
+
disabled: false
|
|
3111
|
+
};
|
|
3112
|
+
}
|
|
3113
|
+
const name = choice.name ?? String(choice.value);
|
|
3114
|
+
const normalizedChoice = {
|
|
3115
|
+
value: choice.value,
|
|
3116
|
+
name,
|
|
3117
|
+
short: choice.short ?? name,
|
|
3118
|
+
disabled: choice.disabled ?? false
|
|
3119
|
+
};
|
|
3120
|
+
if (choice.description) {
|
|
3121
|
+
normalizedChoice.description = choice.description;
|
|
3122
|
+
}
|
|
3123
|
+
return normalizedChoice;
|
|
3124
|
+
});
|
|
3125
|
+
}
|
|
3126
|
+
var import_node_util6, selectTheme, dist_default9;
|
|
3127
|
+
var init_dist11 = __esm({
|
|
3128
|
+
"node_modules/.pnpm/@inquirer+select@5.1.3_@types+node@24.9.2/node_modules/@inquirer/select/dist/index.js"() {
|
|
3129
|
+
init_dist5();
|
|
3130
|
+
init_dist4();
|
|
3131
|
+
import_node_util6 = require("node:util");
|
|
3132
|
+
init_dist();
|
|
3133
|
+
init_dist5();
|
|
3134
|
+
selectTheme = {
|
|
3135
|
+
icon: { cursor: dist_default.pointer },
|
|
3136
|
+
style: {
|
|
3137
|
+
disabled: /* @__PURE__ */ __name((text) => (0, import_node_util6.styleText)("dim", text), "disabled"),
|
|
3138
|
+
description: /* @__PURE__ */ __name((text) => (0, import_node_util6.styleText)("cyan", text), "description"),
|
|
3139
|
+
keysHelpTip: /* @__PURE__ */ __name((keys) => keys.map(([key, action]) => `${(0, import_node_util6.styleText)("bold", key)} ${(0, import_node_util6.styleText)("dim", action)}`).join((0, import_node_util6.styleText)("dim", " • ")), "keysHelpTip")
|
|
3140
|
+
},
|
|
3141
|
+
i18n: { disabledError: "This option is disabled and cannot be selected." },
|
|
3142
|
+
indexMode: "hidden",
|
|
3143
|
+
keybindings: []
|
|
3144
|
+
};
|
|
3145
|
+
__name(isSelectable3, "isSelectable");
|
|
3146
|
+
__name(isNavigable2, "isNavigable");
|
|
3147
|
+
__name(normalizeChoices3, "normalizeChoices");
|
|
3148
|
+
dist_default9 = createPrompt((config, done) => {
|
|
3149
|
+
const { loop = true, pageSize = 7 } = config;
|
|
3150
|
+
const theme = makeTheme(selectTheme, config.theme);
|
|
3151
|
+
const { keybindings } = theme;
|
|
3152
|
+
const [status, setStatus] = useState("idle");
|
|
3153
|
+
const prefix = usePrefix({ status, theme });
|
|
3154
|
+
const searchTimeoutRef = useRef();
|
|
3155
|
+
const searchEnabled = !keybindings.includes("vim");
|
|
3156
|
+
const items = useMemo(() => normalizeChoices3(config.choices), [config.choices]);
|
|
3157
|
+
const bounds = useMemo(() => {
|
|
3158
|
+
const first = items.findIndex(isNavigable2);
|
|
3159
|
+
const last = items.findLastIndex(isNavigable2);
|
|
3160
|
+
if (first === -1) {
|
|
3161
|
+
throw new ValidationError("[select prompt] No selectable choices. All choices are disabled.");
|
|
3162
|
+
}
|
|
3163
|
+
return { first, last };
|
|
3164
|
+
}, [items]);
|
|
3165
|
+
const defaultItemIndex = useMemo(() => {
|
|
3166
|
+
if (!("default" in config))
|
|
3167
|
+
return -1;
|
|
3168
|
+
return items.findIndex((item) => isSelectable3(item) && item.value === config.default);
|
|
3169
|
+
}, [config.default, items]);
|
|
3170
|
+
const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);
|
|
3171
|
+
const selectedChoice = items[active];
|
|
3172
|
+
if (selectedChoice == null || Separator.isSeparator(selectedChoice)) {
|
|
3173
|
+
throw new Error("Active index does not point to a choice");
|
|
3174
|
+
}
|
|
3175
|
+
const [errorMsg, setError] = useState();
|
|
3176
|
+
useKeypress((key, rl) => {
|
|
3177
|
+
clearTimeout(searchTimeoutRef.current);
|
|
3178
|
+
if (errorMsg) {
|
|
3179
|
+
setError(void 0);
|
|
3180
|
+
}
|
|
3181
|
+
if (isEnterKey(key)) {
|
|
3182
|
+
if (selectedChoice.disabled) {
|
|
3183
|
+
setError(theme.i18n.disabledError);
|
|
3184
|
+
} else {
|
|
3185
|
+
setStatus("done");
|
|
3186
|
+
done(selectedChoice.value);
|
|
3187
|
+
}
|
|
3188
|
+
} else if (isUpKey(key, keybindings) || isDownKey(key, keybindings)) {
|
|
3189
|
+
rl.clearLine(0);
|
|
3190
|
+
if (loop || isUpKey(key, keybindings) && active !== bounds.first || isDownKey(key, keybindings) && active !== bounds.last) {
|
|
3191
|
+
const offset = isUpKey(key, keybindings) ? -1 : 1;
|
|
3192
|
+
let next = active;
|
|
3193
|
+
do {
|
|
3194
|
+
next = (next + offset + items.length) % items.length;
|
|
3195
|
+
} while (!isNavigable2(items[next]));
|
|
3196
|
+
setActive(next);
|
|
3197
|
+
}
|
|
3198
|
+
} else if (isNumberKey(key) && !Number.isNaN(Number(rl.line))) {
|
|
3199
|
+
const selectedIndex = Number(rl.line) - 1;
|
|
3200
|
+
let selectableIndex = -1;
|
|
3201
|
+
const position = items.findIndex((item2) => {
|
|
3202
|
+
if (Separator.isSeparator(item2))
|
|
3203
|
+
return false;
|
|
3204
|
+
selectableIndex++;
|
|
3205
|
+
return selectableIndex === selectedIndex;
|
|
3206
|
+
});
|
|
3207
|
+
const item = items[position];
|
|
3208
|
+
if (item != null && isSelectable3(item)) {
|
|
3209
|
+
setActive(position);
|
|
3210
|
+
}
|
|
3211
|
+
searchTimeoutRef.current = setTimeout(() => {
|
|
3212
|
+
rl.clearLine(0);
|
|
3213
|
+
}, 700);
|
|
3214
|
+
} else if (isBackspaceKey(key)) {
|
|
3215
|
+
rl.clearLine(0);
|
|
3216
|
+
} else if (searchEnabled) {
|
|
3217
|
+
const searchTerm = rl.line.toLowerCase();
|
|
3218
|
+
const matchIndex = items.findIndex((item) => {
|
|
3219
|
+
if (Separator.isSeparator(item) || !isSelectable3(item))
|
|
3220
|
+
return false;
|
|
3221
|
+
return item.name.toLowerCase().startsWith(searchTerm);
|
|
3222
|
+
});
|
|
3223
|
+
if (matchIndex !== -1) {
|
|
3224
|
+
setActive(matchIndex);
|
|
3225
|
+
}
|
|
3226
|
+
searchTimeoutRef.current = setTimeout(() => {
|
|
3227
|
+
rl.clearLine(0);
|
|
3228
|
+
}, 700);
|
|
3229
|
+
}
|
|
3230
|
+
});
|
|
3231
|
+
useEffect(() => () => {
|
|
3232
|
+
clearTimeout(searchTimeoutRef.current);
|
|
3233
|
+
}, []);
|
|
3234
|
+
const message = theme.style.message(config.message, status);
|
|
3235
|
+
const helpLine = theme.style.keysHelpTip([
|
|
3236
|
+
["↑↓", "navigate"],
|
|
3237
|
+
["⏎", "select"]
|
|
3238
|
+
]);
|
|
3239
|
+
let separatorCount = 0;
|
|
3240
|
+
const page = usePagination({
|
|
3241
|
+
items,
|
|
3242
|
+
active,
|
|
3243
|
+
renderItem({ item, isActive, index }) {
|
|
3244
|
+
if (Separator.isSeparator(item)) {
|
|
3245
|
+
separatorCount++;
|
|
3246
|
+
return ` ${item.separator}`;
|
|
3247
|
+
}
|
|
3248
|
+
const cursor = isActive ? theme.icon.cursor : " ";
|
|
3249
|
+
const indexLabel = theme.indexMode === "number" ? `${index + 1 - separatorCount}. ` : "";
|
|
3250
|
+
if (item.disabled) {
|
|
3251
|
+
const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
|
|
3252
|
+
const disabledCursor = isActive ? theme.icon.cursor : "-";
|
|
3253
|
+
return theme.style.disabled(`${disabledCursor} ${indexLabel}${item.name} ${disabledLabel}`);
|
|
3254
|
+
}
|
|
3255
|
+
const color = isActive ? theme.style.highlight : (x) => x;
|
|
3256
|
+
return color(`${cursor} ${indexLabel}${item.name}`);
|
|
3257
|
+
},
|
|
3258
|
+
pageSize,
|
|
3259
|
+
loop
|
|
3260
|
+
});
|
|
3261
|
+
if (status === "done") {
|
|
3262
|
+
return [prefix, message, theme.style.answer(selectedChoice.short)].filter(Boolean).join(" ");
|
|
3263
|
+
}
|
|
3264
|
+
const { description } = selectedChoice;
|
|
3265
|
+
const lines = [
|
|
3266
|
+
[prefix, message].filter(Boolean).join(" "),
|
|
3267
|
+
page,
|
|
3268
|
+
" ",
|
|
3269
|
+
description ? theme.style.description(description) : "",
|
|
3270
|
+
errorMsg ? theme.style.error(errorMsg) : "",
|
|
3271
|
+
helpLine
|
|
3272
|
+
].filter(Boolean).join("\n").trimEnd();
|
|
3273
|
+
return `${lines}${cursorHide}`;
|
|
3274
|
+
});
|
|
3275
|
+
}
|
|
3276
|
+
});
|
|
3277
|
+
|
|
569
3278
|
// src/external/external-pack.js
|
|
570
3279
|
var signalExit = require_cjs();
|
|
571
3280
|
var supportsColor2 = (init_supports_color(), __toCommonJS(supports_color_exports));
|
|
572
3281
|
var hasFlag3 = (init_has_flag(), __toCommonJS(has_flag_exports));
|
|
573
3282
|
var yoctocolorsCjs = require_yoctocolors_cjs();
|
|
3283
|
+
var checkbox = (init_dist6(), __toCommonJS(dist_exports));
|
|
3284
|
+
var confirm = (init_dist7(), __toCommonJS(dist_exports2));
|
|
3285
|
+
var input = (init_dist8(), __toCommonJS(dist_exports3));
|
|
3286
|
+
var password = (init_dist9(), __toCommonJS(dist_exports4));
|
|
3287
|
+
var search = (init_dist10(), __toCommonJS(dist_exports5));
|
|
3288
|
+
var select = (init_dist11(), __toCommonJS(dist_exports6));
|
|
574
3289
|
module.exports = {
|
|
3290
|
+
checkbox,
|
|
3291
|
+
confirm,
|
|
575
3292
|
hasFlag: hasFlag3,
|
|
3293
|
+
input,
|
|
3294
|
+
password,
|
|
3295
|
+
search,
|
|
3296
|
+
select,
|
|
576
3297
|
signalExit,
|
|
577
3298
|
supportsColor: supportsColor2,
|
|
578
3299
|
yoctocolorsCjs
|