@darkrymit/crunes-cli 0.5.10 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/chunks/add-OWYVF3IE.js +22 -0
- package/dist/chunks/apply-OMEVXCHC.js +183 -0
- package/dist/chunks/args-32BVYW77.js +42 -0
- package/dist/chunks/benchmark-CLUBISCR.js +164 -0
- package/dist/chunks/browse-COH6IJEX.js +34 -0
- package/dist/chunks/check-BS6TZGRR.js +144 -0
- package/dist/chunks/chunk-2Q24YPGL.js +369 -0
- package/dist/chunks/chunk-3TM6B4E5.js +70 -0
- package/dist/chunks/chunk-67I2J474.js +153 -0
- package/dist/chunks/chunk-6XLT25GS.js +50 -0
- package/dist/chunks/chunk-BVY5LN7X.js +25091 -0
- package/dist/chunks/chunk-CGZL5SSH.js +926 -0
- package/dist/chunks/chunk-DMMC4X27.js +1836 -0
- package/dist/chunks/chunk-G3U4V32O.js +46 -0
- package/dist/chunks/chunk-GHQOK4L7.js +59 -0
- package/dist/chunks/chunk-H3BVJCIL.js +105 -0
- package/dist/chunks/chunk-HMU2J25D.js +63 -0
- package/dist/chunks/chunk-HOH7WZX4.js +95 -0
- package/dist/chunks/chunk-L72BG6DS.js +225 -0
- package/dist/chunks/chunk-NXSDVVTW.js +181 -0
- package/dist/chunks/chunk-QLDB3FO2.js +73059 -0
- package/dist/chunks/chunk-QMWGQXEZ.js +26 -0
- package/dist/chunks/chunk-TPK5AGRA.js +54 -0
- package/dist/chunks/chunk-UGN3FFEF.js +8379 -0
- package/dist/chunks/chunk-WCODTMDN.js +508 -0
- package/dist/chunks/chunk-XIXND2M4.js +296 -0
- package/dist/chunks/chunk-XXUNHQIB.js +129 -0
- package/dist/chunks/chunk-ZXIP4Z5V.js +281 -0
- package/dist/chunks/clear-Y5POLIMF.js +32 -0
- package/dist/chunks/completions-2MSEWWTG.js +232 -0
- package/dist/chunks/create-5FXQYCGM.js +165 -0
- package/dist/chunks/create-I6BNYZ5Q.js +247 -0
- package/dist/chunks/create-O3HMODSL.js +130 -0
- package/dist/chunks/delete-7CQFYIXS.js +40 -0
- package/dist/chunks/delete-UB5SXO5I.js +40 -0
- package/dist/chunks/disable-FCBW7WVG.js +47 -0
- package/dist/chunks/doctor-DS57HDLJ.js +53 -0
- package/dist/chunks/enable-IXRVUXJM.js +47 -0
- package/dist/chunks/esm-7MEWZCHY.js +5162 -0
- package/dist/chunks/globals-YCJ2DGWC.js +60 -0
- package/dist/chunks/init-WGKQVAZE.js +59 -0
- package/dist/chunks/install-BCTBOPBS.js +57 -0
- package/dist/chunks/intro-2UDWF6D4.js +1482 -0
- package/dist/chunks/kill-LWRXZVM5.js +37 -0
- package/dist/chunks/list-5DVVP7HX.js +50 -0
- package/dist/chunks/list-6WL5LGIZ.js +80 -0
- package/dist/chunks/list-NGOCMJXE.js +104 -0
- package/dist/chunks/list-TTKLNJKI.js +28 -0
- package/dist/chunks/list-WUAOSO3M.js +110 -0
- package/dist/chunks/list-YPI7YDKK.js +80 -0
- package/dist/chunks/list-ZBYPMUID.js +23 -0
- package/dist/chunks/manifest-7RVNKBOH.js +9 -0
- package/dist/chunks/output-RJ6JSNY7.js +12 -0
- package/dist/chunks/promise-DUSIQMA2.js +19400 -0
- package/dist/chunks/query-NY4SCO77.js +41 -0
- package/dist/chunks/registry-W5XFI5T6.js +16 -0
- package/dist/chunks/remove-WEAZFZCO.js +22 -0
- package/dist/chunks/run-I6TZX347.js +23 -0
- package/dist/chunks/run-MVIZQVJ6.js +36 -0
- package/dist/chunks/rune-TAX26NH2.js +76 -0
- package/dist/chunks/search-XENXL3GC.js +25 -0
- package/dist/chunks/uninstall-MX5PLGDI.js +49 -0
- package/dist/chunks/unset-KQOZYVTE.js +28 -0
- package/dist/chunks/update-7XDTVFZ3.js +39 -0
- package/dist/chunks/update-IEE54GPY.js +79 -0
- package/dist/chunks/utils-PO3ZK53L.js +50 -0
- package/dist/chunks/version-DIEA5FVV.js +145 -0
- package/dist/cli.js +3360 -125840
- package/package.json +23 -15
|
@@ -0,0 +1,926 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__commonJS,
|
|
3
|
+
__toESM,
|
|
4
|
+
init_require_shim
|
|
5
|
+
} from "./chunk-TPK5AGRA.js";
|
|
6
|
+
|
|
7
|
+
// node_modules/sisteransi/src/index.js
|
|
8
|
+
var require_src = __commonJS({
|
|
9
|
+
"node_modules/sisteransi/src/index.js"(exports, module) {
|
|
10
|
+
"use strict";
|
|
11
|
+
init_require_shim();
|
|
12
|
+
var ESC2 = "\x1B";
|
|
13
|
+
var CSI2 = `${ESC2}[`;
|
|
14
|
+
var beep = "\x07";
|
|
15
|
+
var cursor = {
|
|
16
|
+
to(x3, y) {
|
|
17
|
+
if (!y) return `${CSI2}${x3 + 1}G`;
|
|
18
|
+
return `${CSI2}${y + 1};${x3 + 1}H`;
|
|
19
|
+
},
|
|
20
|
+
move(x3, y) {
|
|
21
|
+
let ret = "";
|
|
22
|
+
if (x3 < 0) ret += `${CSI2}${-x3}D`;
|
|
23
|
+
else if (x3 > 0) ret += `${CSI2}${x3}C`;
|
|
24
|
+
if (y < 0) ret += `${CSI2}${-y}A`;
|
|
25
|
+
else if (y > 0) ret += `${CSI2}${y}B`;
|
|
26
|
+
return ret;
|
|
27
|
+
},
|
|
28
|
+
up: (count = 1) => `${CSI2}${count}A`,
|
|
29
|
+
down: (count = 1) => `${CSI2}${count}B`,
|
|
30
|
+
forward: (count = 1) => `${CSI2}${count}C`,
|
|
31
|
+
backward: (count = 1) => `${CSI2}${count}D`,
|
|
32
|
+
nextLine: (count = 1) => `${CSI2}E`.repeat(count),
|
|
33
|
+
prevLine: (count = 1) => `${CSI2}F`.repeat(count),
|
|
34
|
+
left: `${CSI2}G`,
|
|
35
|
+
hide: `${CSI2}?25l`,
|
|
36
|
+
show: `${CSI2}?25h`,
|
|
37
|
+
save: `${ESC2}7`,
|
|
38
|
+
restore: `${ESC2}8`
|
|
39
|
+
};
|
|
40
|
+
var scroll = {
|
|
41
|
+
up: (count = 1) => `${CSI2}S`.repeat(count),
|
|
42
|
+
down: (count = 1) => `${CSI2}T`.repeat(count)
|
|
43
|
+
};
|
|
44
|
+
var erase = {
|
|
45
|
+
screen: `${CSI2}2J`,
|
|
46
|
+
up: (count = 1) => `${CSI2}1J`.repeat(count),
|
|
47
|
+
down: (count = 1) => `${CSI2}J`.repeat(count),
|
|
48
|
+
line: `${CSI2}2K`,
|
|
49
|
+
lineEnd: `${CSI2}K`,
|
|
50
|
+
lineStart: `${CSI2}1K`,
|
|
51
|
+
lines(count) {
|
|
52
|
+
let clear = "";
|
|
53
|
+
for (let i = 0; i < count; i++)
|
|
54
|
+
clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
55
|
+
if (count)
|
|
56
|
+
clear += cursor.left;
|
|
57
|
+
return clear;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
module.exports = { cursor, scroll, erase, beep };
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// node_modules/@clack/core/dist/index.mjs
|
|
65
|
+
init_require_shim();
|
|
66
|
+
import { styleText as v } from "node:util";
|
|
67
|
+
import { stdout as x, stdin as D } from "node:process";
|
|
68
|
+
import G from "node:readline";
|
|
69
|
+
|
|
70
|
+
// node_modules/fast-wrap-ansi/lib/main.js
|
|
71
|
+
init_require_shim();
|
|
72
|
+
|
|
73
|
+
// node_modules/fast-string-width/dist/index.js
|
|
74
|
+
init_require_shim();
|
|
75
|
+
|
|
76
|
+
// node_modules/fast-string-truncated-width/dist/index.js
|
|
77
|
+
init_require_shim();
|
|
78
|
+
|
|
79
|
+
// node_modules/fast-string-truncated-width/dist/utils.js
|
|
80
|
+
init_require_shim();
|
|
81
|
+
var getCodePointsLength = /* @__PURE__ */ (() => {
|
|
82
|
+
const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
83
|
+
return (input) => {
|
|
84
|
+
let surrogatePairsNr = 0;
|
|
85
|
+
SURROGATE_PAIR_RE.lastIndex = 0;
|
|
86
|
+
while (SURROGATE_PAIR_RE.test(input)) {
|
|
87
|
+
surrogatePairsNr += 1;
|
|
88
|
+
}
|
|
89
|
+
return input.length - surrogatePairsNr;
|
|
90
|
+
};
|
|
91
|
+
})();
|
|
92
|
+
var isFullWidth = (x3) => {
|
|
93
|
+
return x3 === 12288 || x3 >= 65281 && x3 <= 65376 || x3 >= 65504 && x3 <= 65510;
|
|
94
|
+
};
|
|
95
|
+
var isWideNotCJKTNotEmoji = (x3) => {
|
|
96
|
+
return x3 === 8987 || x3 === 9001 || x3 >= 12272 && x3 <= 12287 || x3 >= 12289 && x3 <= 12350 || x3 >= 12441 && x3 <= 12543 || x3 >= 12549 && x3 <= 12591 || x3 >= 12593 && x3 <= 12686 || x3 >= 12688 && x3 <= 12771 || x3 >= 12783 && x3 <= 12830 || x3 >= 12832 && x3 <= 12871 || x3 >= 12880 && x3 <= 19903 || x3 >= 65040 && x3 <= 65049 || x3 >= 65072 && x3 <= 65106 || x3 >= 65108 && x3 <= 65126 || x3 >= 65128 && x3 <= 65131 || x3 >= 127488 && x3 <= 127490 || x3 >= 127504 && x3 <= 127547 || x3 >= 127552 && x3 <= 127560 || x3 >= 131072 && x3 <= 196605 || x3 >= 196608 && x3 <= 262141;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
// node_modules/fast-string-truncated-width/dist/index.js
|
|
100
|
+
var ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
|
|
101
|
+
var CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
102
|
+
var CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
|
|
103
|
+
var TAB_RE = /\t{1,1000}/y;
|
|
104
|
+
var EMOJI_RE = /[\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;
|
|
105
|
+
var LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
106
|
+
var MODIFIER_RE = /\p{M}+/gu;
|
|
107
|
+
var NO_TRUNCATION = { limit: Infinity, ellipsis: "" };
|
|
108
|
+
var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
|
|
109
|
+
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
110
|
+
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
111
|
+
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
|
|
112
|
+
const ANSI_WIDTH = 0;
|
|
113
|
+
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
114
|
+
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
115
|
+
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
116
|
+
const FULL_WIDTH_WIDTH = 2;
|
|
117
|
+
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
118
|
+
const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
|
|
119
|
+
const PARSE_BLOCKS = [
|
|
120
|
+
[LATIN_RE, REGULAR_WIDTH],
|
|
121
|
+
[ANSI_RE, ANSI_WIDTH],
|
|
122
|
+
[CONTROL_RE, CONTROL_WIDTH],
|
|
123
|
+
[TAB_RE, TAB_WIDTH],
|
|
124
|
+
[EMOJI_RE, EMOJI_WIDTH],
|
|
125
|
+
[CJKT_WIDE_RE, WIDE_WIDTH]
|
|
126
|
+
];
|
|
127
|
+
let indexPrev = 0;
|
|
128
|
+
let index = 0;
|
|
129
|
+
let length = input.length;
|
|
130
|
+
let lengthExtra = 0;
|
|
131
|
+
let truncationEnabled = false;
|
|
132
|
+
let truncationIndex = length;
|
|
133
|
+
let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);
|
|
134
|
+
let unmatchedStart = 0;
|
|
135
|
+
let unmatchedEnd = 0;
|
|
136
|
+
let width = 0;
|
|
137
|
+
let widthExtra = 0;
|
|
138
|
+
outer: while (true) {
|
|
139
|
+
if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
|
|
140
|
+
const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
|
|
141
|
+
lengthExtra = 0;
|
|
142
|
+
for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
|
|
143
|
+
const codePoint = char.codePointAt(0) || 0;
|
|
144
|
+
if (isFullWidth(codePoint)) {
|
|
145
|
+
widthExtra = FULL_WIDTH_WIDTH;
|
|
146
|
+
} else if (isWideNotCJKTNotEmoji(codePoint)) {
|
|
147
|
+
widthExtra = WIDE_WIDTH;
|
|
148
|
+
} else {
|
|
149
|
+
widthExtra = REGULAR_WIDTH;
|
|
150
|
+
}
|
|
151
|
+
if (width + widthExtra > truncationLimit) {
|
|
152
|
+
truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
|
|
153
|
+
}
|
|
154
|
+
if (width + widthExtra > LIMIT) {
|
|
155
|
+
truncationEnabled = true;
|
|
156
|
+
break outer;
|
|
157
|
+
}
|
|
158
|
+
lengthExtra += char.length;
|
|
159
|
+
width += widthExtra;
|
|
160
|
+
}
|
|
161
|
+
unmatchedStart = unmatchedEnd = 0;
|
|
162
|
+
}
|
|
163
|
+
if (index >= length) {
|
|
164
|
+
break outer;
|
|
165
|
+
}
|
|
166
|
+
for (let i = 0, l = PARSE_BLOCKS.length; i < l; i++) {
|
|
167
|
+
const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
|
|
168
|
+
BLOCK_RE.lastIndex = index;
|
|
169
|
+
if (BLOCK_RE.test(input)) {
|
|
170
|
+
lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
|
|
171
|
+
widthExtra = lengthExtra * BLOCK_WIDTH;
|
|
172
|
+
if (width + widthExtra > truncationLimit) {
|
|
173
|
+
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
|
|
174
|
+
}
|
|
175
|
+
if (width + widthExtra > LIMIT) {
|
|
176
|
+
truncationEnabled = true;
|
|
177
|
+
break outer;
|
|
178
|
+
}
|
|
179
|
+
width += widthExtra;
|
|
180
|
+
unmatchedStart = indexPrev;
|
|
181
|
+
unmatchedEnd = index;
|
|
182
|
+
index = indexPrev = BLOCK_RE.lastIndex;
|
|
183
|
+
continue outer;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
index += 1;
|
|
187
|
+
}
|
|
188
|
+
return {
|
|
189
|
+
width: truncationEnabled ? truncationLimit : width,
|
|
190
|
+
index: truncationEnabled ? truncationIndex : length,
|
|
191
|
+
truncated: truncationEnabled,
|
|
192
|
+
ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
var dist_default = getStringTruncatedWidth;
|
|
196
|
+
|
|
197
|
+
// node_modules/fast-string-width/dist/index.js
|
|
198
|
+
var NO_TRUNCATION2 = {
|
|
199
|
+
limit: Infinity,
|
|
200
|
+
ellipsis: "",
|
|
201
|
+
ellipsisWidth: 0
|
|
202
|
+
};
|
|
203
|
+
var fastStringWidth = (input, options = {}) => {
|
|
204
|
+
return dist_default(input, NO_TRUNCATION2, options).width;
|
|
205
|
+
};
|
|
206
|
+
var dist_default2 = fastStringWidth;
|
|
207
|
+
|
|
208
|
+
// node_modules/fast-wrap-ansi/lib/main.js
|
|
209
|
+
var ESC = "\x1B";
|
|
210
|
+
var CSI = "\x9B";
|
|
211
|
+
var END_CODE = 39;
|
|
212
|
+
var ANSI_ESCAPE_BELL = "\x07";
|
|
213
|
+
var ANSI_CSI = "[";
|
|
214
|
+
var ANSI_OSC = "]";
|
|
215
|
+
var ANSI_SGR_TERMINATOR = "m";
|
|
216
|
+
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
217
|
+
var GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
|
|
218
|
+
var getClosingCode = (openingCode) => {
|
|
219
|
+
if (openingCode >= 30 && openingCode <= 37)
|
|
220
|
+
return 39;
|
|
221
|
+
if (openingCode >= 90 && openingCode <= 97)
|
|
222
|
+
return 39;
|
|
223
|
+
if (openingCode >= 40 && openingCode <= 47)
|
|
224
|
+
return 49;
|
|
225
|
+
if (openingCode >= 100 && openingCode <= 107)
|
|
226
|
+
return 49;
|
|
227
|
+
if (openingCode === 1 || openingCode === 2)
|
|
228
|
+
return 22;
|
|
229
|
+
if (openingCode === 3)
|
|
230
|
+
return 23;
|
|
231
|
+
if (openingCode === 4)
|
|
232
|
+
return 24;
|
|
233
|
+
if (openingCode === 7)
|
|
234
|
+
return 27;
|
|
235
|
+
if (openingCode === 8)
|
|
236
|
+
return 28;
|
|
237
|
+
if (openingCode === 9)
|
|
238
|
+
return 29;
|
|
239
|
+
if (openingCode === 0)
|
|
240
|
+
return 0;
|
|
241
|
+
return void 0;
|
|
242
|
+
};
|
|
243
|
+
var wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
244
|
+
var wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
|
|
245
|
+
var wrapWord = (rows, word, columns) => {
|
|
246
|
+
const characters = word[Symbol.iterator]();
|
|
247
|
+
let isInsideEscape = false;
|
|
248
|
+
let isInsideLinkEscape = false;
|
|
249
|
+
let lastRow = rows.at(-1);
|
|
250
|
+
let visible = lastRow === void 0 ? 0 : dist_default2(lastRow);
|
|
251
|
+
let currentCharacter = characters.next();
|
|
252
|
+
let nextCharacter = characters.next();
|
|
253
|
+
let rawCharacterIndex = 0;
|
|
254
|
+
while (!currentCharacter.done) {
|
|
255
|
+
const character = currentCharacter.value;
|
|
256
|
+
const characterLength = dist_default2(character);
|
|
257
|
+
if (visible + characterLength <= columns) {
|
|
258
|
+
rows[rows.length - 1] += character;
|
|
259
|
+
} else {
|
|
260
|
+
rows.push(character);
|
|
261
|
+
visible = 0;
|
|
262
|
+
}
|
|
263
|
+
if (character === ESC || character === CSI) {
|
|
264
|
+
isInsideEscape = true;
|
|
265
|
+
isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
|
|
266
|
+
}
|
|
267
|
+
if (isInsideEscape) {
|
|
268
|
+
if (isInsideLinkEscape) {
|
|
269
|
+
if (character === ANSI_ESCAPE_BELL) {
|
|
270
|
+
isInsideEscape = false;
|
|
271
|
+
isInsideLinkEscape = false;
|
|
272
|
+
}
|
|
273
|
+
} else if (character === ANSI_SGR_TERMINATOR) {
|
|
274
|
+
isInsideEscape = false;
|
|
275
|
+
}
|
|
276
|
+
} else {
|
|
277
|
+
visible += characterLength;
|
|
278
|
+
if (visible === columns && !nextCharacter.done) {
|
|
279
|
+
rows.push("");
|
|
280
|
+
visible = 0;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
currentCharacter = nextCharacter;
|
|
284
|
+
nextCharacter = characters.next();
|
|
285
|
+
rawCharacterIndex += character.length;
|
|
286
|
+
}
|
|
287
|
+
lastRow = rows.at(-1);
|
|
288
|
+
if (!visible && lastRow !== void 0 && lastRow.length && rows.length > 1) {
|
|
289
|
+
rows[rows.length - 2] += rows.pop();
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
var stringVisibleTrimSpacesRight = (string) => {
|
|
293
|
+
const words = string.split(" ");
|
|
294
|
+
let last = words.length;
|
|
295
|
+
while (last) {
|
|
296
|
+
if (dist_default2(words[last - 1])) {
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
last--;
|
|
300
|
+
}
|
|
301
|
+
if (last === words.length) {
|
|
302
|
+
return string;
|
|
303
|
+
}
|
|
304
|
+
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
305
|
+
};
|
|
306
|
+
var exec = (string, columns, options = {}) => {
|
|
307
|
+
if (options.trim !== false && string.trim() === "") {
|
|
308
|
+
return "";
|
|
309
|
+
}
|
|
310
|
+
let returnValue = "";
|
|
311
|
+
let escapeCode;
|
|
312
|
+
let escapeUrl;
|
|
313
|
+
const words = string.split(" ");
|
|
314
|
+
let rows = [""];
|
|
315
|
+
let rowLength = 0;
|
|
316
|
+
for (let index = 0; index < words.length; index++) {
|
|
317
|
+
const word = words[index];
|
|
318
|
+
if (options.trim !== false) {
|
|
319
|
+
const row = rows.at(-1) ?? "";
|
|
320
|
+
const trimmed = row.trimStart();
|
|
321
|
+
if (row.length !== trimmed.length) {
|
|
322
|
+
rows[rows.length - 1] = trimmed;
|
|
323
|
+
rowLength = dist_default2(trimmed);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
if (index !== 0) {
|
|
327
|
+
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
328
|
+
rows.push("");
|
|
329
|
+
rowLength = 0;
|
|
330
|
+
}
|
|
331
|
+
if (rowLength || options.trim === false) {
|
|
332
|
+
rows[rows.length - 1] += " ";
|
|
333
|
+
rowLength++;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
const wordLength = dist_default2(word);
|
|
337
|
+
if (options.hard && wordLength > columns) {
|
|
338
|
+
const remainingColumns = columns - rowLength;
|
|
339
|
+
const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
|
|
340
|
+
const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);
|
|
341
|
+
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
342
|
+
rows.push("");
|
|
343
|
+
}
|
|
344
|
+
wrapWord(rows, word, columns);
|
|
345
|
+
rowLength = dist_default2(rows.at(-1) ?? "");
|
|
346
|
+
continue;
|
|
347
|
+
}
|
|
348
|
+
if (rowLength + wordLength > columns && rowLength && wordLength) {
|
|
349
|
+
if (options.wordWrap === false && rowLength < columns) {
|
|
350
|
+
wrapWord(rows, word, columns);
|
|
351
|
+
rowLength = dist_default2(rows.at(-1) ?? "");
|
|
352
|
+
continue;
|
|
353
|
+
}
|
|
354
|
+
rows.push("");
|
|
355
|
+
rowLength = 0;
|
|
356
|
+
}
|
|
357
|
+
if (rowLength + wordLength > columns && options.wordWrap === false) {
|
|
358
|
+
wrapWord(rows, word, columns);
|
|
359
|
+
rowLength = dist_default2(rows.at(-1) ?? "");
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
rows[rows.length - 1] += word;
|
|
363
|
+
rowLength += wordLength;
|
|
364
|
+
}
|
|
365
|
+
if (options.trim !== false) {
|
|
366
|
+
rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
367
|
+
}
|
|
368
|
+
const preString = rows.join("\n");
|
|
369
|
+
let inSurrogate = false;
|
|
370
|
+
for (let i = 0; i < preString.length; i++) {
|
|
371
|
+
const character = preString[i];
|
|
372
|
+
returnValue += character;
|
|
373
|
+
if (!inSurrogate) {
|
|
374
|
+
inSurrogate = character >= "\uD800" && character <= "\uDBFF";
|
|
375
|
+
if (inSurrogate) {
|
|
376
|
+
continue;
|
|
377
|
+
}
|
|
378
|
+
} else {
|
|
379
|
+
inSurrogate = false;
|
|
380
|
+
}
|
|
381
|
+
if (character === ESC || character === CSI) {
|
|
382
|
+
GROUP_REGEX.lastIndex = i + 1;
|
|
383
|
+
const groupsResult = GROUP_REGEX.exec(preString);
|
|
384
|
+
const groups = groupsResult?.groups;
|
|
385
|
+
if (groups?.code !== void 0) {
|
|
386
|
+
const code = Number.parseFloat(groups.code);
|
|
387
|
+
escapeCode = code === END_CODE ? void 0 : code;
|
|
388
|
+
} else if (groups?.uri !== void 0) {
|
|
389
|
+
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
if (preString[i + 1] === "\n") {
|
|
393
|
+
if (escapeUrl) {
|
|
394
|
+
returnValue += wrapAnsiHyperlink("");
|
|
395
|
+
}
|
|
396
|
+
const closingCode = escapeCode ? getClosingCode(escapeCode) : void 0;
|
|
397
|
+
if (escapeCode && closingCode) {
|
|
398
|
+
returnValue += wrapAnsiCode(closingCode);
|
|
399
|
+
}
|
|
400
|
+
} else if (character === "\n") {
|
|
401
|
+
if (escapeCode && getClosingCode(escapeCode)) {
|
|
402
|
+
returnValue += wrapAnsiCode(escapeCode);
|
|
403
|
+
}
|
|
404
|
+
if (escapeUrl) {
|
|
405
|
+
returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
return returnValue;
|
|
410
|
+
};
|
|
411
|
+
var CRLF_OR_LF = /\r?\n/;
|
|
412
|
+
function wrapAnsi(string, columns, options) {
|
|
413
|
+
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
// node_modules/@clack/core/dist/index.mjs
|
|
417
|
+
var import_sisteransi = __toESM(require_src(), 1);
|
|
418
|
+
function f(r, t, s) {
|
|
419
|
+
if (!s.some((o) => !o.disabled)) return r;
|
|
420
|
+
const e2 = r + t, i = Math.max(s.length - 1, 0), n = e2 < 0 ? i : e2 > i ? 0 : e2;
|
|
421
|
+
return s[n].disabled ? f(n, t < 0 ? -1 : 1, s) : n;
|
|
422
|
+
}
|
|
423
|
+
var K = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
424
|
+
var j = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
425
|
+
var h = { actions: new Set(K), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true, date: { monthNames: [...j], messages: { required: "Please enter a valid date", invalidMonth: "There are only 12 months in a year", invalidDay: (r, t) => `There are only ${r} days in ${t}`, afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`, beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}` } } };
|
|
426
|
+
function C(r, t) {
|
|
427
|
+
if (typeof r == "string") return h.aliases.get(r) === t;
|
|
428
|
+
for (const s of r) if (s !== void 0 && C(s, t)) return true;
|
|
429
|
+
return false;
|
|
430
|
+
}
|
|
431
|
+
function Y(r, t) {
|
|
432
|
+
if (r === t) return;
|
|
433
|
+
const s = r.split(`
|
|
434
|
+
`), e2 = t.split(`
|
|
435
|
+
`), i = Math.max(s.length, e2.length), n = [];
|
|
436
|
+
for (let o = 0; o < i; o++) s[o] !== e2[o] && n.push(o);
|
|
437
|
+
return { lines: n, numLinesBefore: s.length, numLinesAfter: e2.length, numLines: i };
|
|
438
|
+
}
|
|
439
|
+
var q = globalThis.process.platform.startsWith("win");
|
|
440
|
+
var k = /* @__PURE__ */ Symbol("clack:cancel");
|
|
441
|
+
function R(r) {
|
|
442
|
+
return r === k;
|
|
443
|
+
}
|
|
444
|
+
function w(r, t) {
|
|
445
|
+
const s = r;
|
|
446
|
+
s.isTTY && s.setRawMode(t);
|
|
447
|
+
}
|
|
448
|
+
var A = (r) => "columns" in r && typeof r.columns == "number" ? r.columns : 80;
|
|
449
|
+
var L = (r) => "rows" in r && typeof r.rows == "number" ? r.rows : 20;
|
|
450
|
+
function B(r, t, s, e2 = s, i = s, n) {
|
|
451
|
+
const o = A(r ?? x);
|
|
452
|
+
return wrapAnsi(t, o - s.length, { hard: true, trim: false }).split(`
|
|
453
|
+
`).map((u, a, l) => {
|
|
454
|
+
const c = n ? n(u, a) : u;
|
|
455
|
+
return a === 0 ? `${e2}${c}` : a === l.length - 1 ? `${i}${c}` : `${s}${c}`;
|
|
456
|
+
}).join(`
|
|
457
|
+
`);
|
|
458
|
+
}
|
|
459
|
+
function P(r, t) {
|
|
460
|
+
if ("~standard" in r) {
|
|
461
|
+
const s = r["~standard"].validate(t);
|
|
462
|
+
if (s instanceof Promise) throw new TypeError("Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic.");
|
|
463
|
+
return s.issues?.at(0)?.message;
|
|
464
|
+
}
|
|
465
|
+
return r(t);
|
|
466
|
+
}
|
|
467
|
+
var m = class {
|
|
468
|
+
input;
|
|
469
|
+
output;
|
|
470
|
+
_abortSignal;
|
|
471
|
+
rl;
|
|
472
|
+
opts;
|
|
473
|
+
_render;
|
|
474
|
+
_track = false;
|
|
475
|
+
_prevFrame = "";
|
|
476
|
+
_subscribers = /* @__PURE__ */ new Map();
|
|
477
|
+
_cursor = 0;
|
|
478
|
+
state = "initial";
|
|
479
|
+
error = "";
|
|
480
|
+
value;
|
|
481
|
+
userInput = "";
|
|
482
|
+
constructor(t, s = true) {
|
|
483
|
+
const { input: e2 = D, output: i = x, render: n, signal: o, ...u } = t;
|
|
484
|
+
this.opts = u, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = s, this._abortSignal = o, this.input = e2, this.output = i;
|
|
485
|
+
}
|
|
486
|
+
unsubscribe() {
|
|
487
|
+
this._subscribers.clear();
|
|
488
|
+
}
|
|
489
|
+
setSubscriber(t, s) {
|
|
490
|
+
const e2 = this._subscribers.get(t) ?? [];
|
|
491
|
+
e2.push(s), this._subscribers.set(t, e2);
|
|
492
|
+
}
|
|
493
|
+
on(t, s) {
|
|
494
|
+
this.setSubscriber(t, { cb: s });
|
|
495
|
+
}
|
|
496
|
+
once(t, s) {
|
|
497
|
+
this.setSubscriber(t, { cb: s, once: true });
|
|
498
|
+
}
|
|
499
|
+
emit(t, ...s) {
|
|
500
|
+
const e2 = this._subscribers.get(t) ?? [], i = [];
|
|
501
|
+
for (const n of e2) n.cb(...s), n.once && i.push(() => e2.splice(e2.indexOf(n), 1));
|
|
502
|
+
for (const n of i) n();
|
|
503
|
+
}
|
|
504
|
+
prompt() {
|
|
505
|
+
return new Promise((t) => {
|
|
506
|
+
if (this._abortSignal) {
|
|
507
|
+
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t(k);
|
|
508
|
+
this._abortSignal.addEventListener("abort", () => {
|
|
509
|
+
this.state = "cancel", this.close();
|
|
510
|
+
}, { once: true });
|
|
511
|
+
}
|
|
512
|
+
this.rl = G.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), w(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
513
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(this.value);
|
|
514
|
+
}), this.once("cancel", () => {
|
|
515
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(k);
|
|
516
|
+
});
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
_isActionKey(t, s) {
|
|
520
|
+
return t === " ";
|
|
521
|
+
}
|
|
522
|
+
_shouldSubmit(t, s) {
|
|
523
|
+
return true;
|
|
524
|
+
}
|
|
525
|
+
_setValue(t) {
|
|
526
|
+
this.value = t, this.emit("value", this.value);
|
|
527
|
+
}
|
|
528
|
+
_setUserInput(t, s) {
|
|
529
|
+
this.userInput = t ?? "", this.emit("userInput", this.userInput), s && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
|
|
530
|
+
}
|
|
531
|
+
_clearUserInput() {
|
|
532
|
+
this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
|
|
533
|
+
}
|
|
534
|
+
onKeypress(t, s) {
|
|
535
|
+
if (this._track && s.name !== "return" && (s.name && this._isActionKey(t, s) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), s?.name && (!this._track && h.aliases.has(s.name) && this.emit("cursor", h.aliases.get(s.name)), h.actions.has(s.name) && this.emit("cursor", s.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t, s), s?.name === "return" && this._shouldSubmit(t, s)) {
|
|
536
|
+
if (this.opts.validate) {
|
|
537
|
+
const e2 = P(this.opts.validate, this.value);
|
|
538
|
+
e2 && (this.error = e2 instanceof Error ? e2.message : e2, this.state = "error", this.rl?.write(this.userInput));
|
|
539
|
+
}
|
|
540
|
+
this.state !== "error" && (this.state = "submit");
|
|
541
|
+
}
|
|
542
|
+
C([t, s?.name, s?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
543
|
+
}
|
|
544
|
+
close() {
|
|
545
|
+
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
546
|
+
`), w(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
547
|
+
}
|
|
548
|
+
restoreCursor() {
|
|
549
|
+
const t = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
|
|
550
|
+
`).length - 1;
|
|
551
|
+
this.output.write(import_sisteransi.cursor.move(-999, t * -1));
|
|
552
|
+
}
|
|
553
|
+
render() {
|
|
554
|
+
const t = wrapAnsi(this._render(this) ?? "", process.stdout.columns, { hard: true, trim: false });
|
|
555
|
+
if (t !== this._prevFrame) {
|
|
556
|
+
if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
|
|
557
|
+
else {
|
|
558
|
+
const s = Y(this._prevFrame, t), e2 = L(this.output);
|
|
559
|
+
if (this.restoreCursor(), s) {
|
|
560
|
+
const i = Math.max(0, s.numLinesAfter - e2), n = Math.max(0, s.numLinesBefore - e2);
|
|
561
|
+
let o = s.lines.find((u) => u >= i);
|
|
562
|
+
if (o === void 0) {
|
|
563
|
+
this._prevFrame = t;
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
if (s.lines.length === 1) {
|
|
567
|
+
this.output.write(import_sisteransi.cursor.move(0, o - n)), this.output.write(import_sisteransi.erase.lines(1));
|
|
568
|
+
const u = t.split(`
|
|
569
|
+
`);
|
|
570
|
+
this.output.write(u[o]), this._prevFrame = t, this.output.write(import_sisteransi.cursor.move(0, u.length - o - 1));
|
|
571
|
+
return;
|
|
572
|
+
} else if (s.lines.length > 1) {
|
|
573
|
+
if (i < n) o = i;
|
|
574
|
+
else {
|
|
575
|
+
const a = o - n;
|
|
576
|
+
a > 0 && this.output.write(import_sisteransi.cursor.move(0, a));
|
|
577
|
+
}
|
|
578
|
+
this.output.write(import_sisteransi.erase.down());
|
|
579
|
+
const u = t.split(`
|
|
580
|
+
`).slice(o);
|
|
581
|
+
this.output.write(u.join(`
|
|
582
|
+
`)), this._prevFrame = t;
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
this.output.write(import_sisteransi.erase.down());
|
|
587
|
+
}
|
|
588
|
+
this.output.write(t), this.state === "initial" && (this.state = "active"), this._prevFrame = t;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
var Z = class extends m {
|
|
593
|
+
get cursor() {
|
|
594
|
+
return this.value ? 0 : 1;
|
|
595
|
+
}
|
|
596
|
+
get _value() {
|
|
597
|
+
return this.cursor === 0;
|
|
598
|
+
}
|
|
599
|
+
constructor(t) {
|
|
600
|
+
super(t, false), this.value = !!t.initialValue, this.on("userInput", () => {
|
|
601
|
+
this.value = this._value;
|
|
602
|
+
}), this.on("confirm", (s) => {
|
|
603
|
+
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = s, this.state = "submit", this.close();
|
|
604
|
+
}), this.on("cursor", () => {
|
|
605
|
+
this.value = !this.value;
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
};
|
|
609
|
+
var ht = class extends m {
|
|
610
|
+
options;
|
|
611
|
+
cursor = 0;
|
|
612
|
+
get _selectedValue() {
|
|
613
|
+
return this.options[this.cursor];
|
|
614
|
+
}
|
|
615
|
+
changeValue() {
|
|
616
|
+
this.value = this._selectedValue.value;
|
|
617
|
+
}
|
|
618
|
+
constructor(t) {
|
|
619
|
+
super(t, false), this.options = t.options;
|
|
620
|
+
const s = this.options.findIndex(({ value: i }) => i === t.initialValue), e2 = s === -1 ? 0 : s;
|
|
621
|
+
this.cursor = this.options[e2].disabled ? f(e2, 1, this.options) : e2, this.changeValue(), this.on("cursor", (i) => {
|
|
622
|
+
switch (i) {
|
|
623
|
+
case "left":
|
|
624
|
+
case "up":
|
|
625
|
+
this.cursor = f(this.cursor, -1, this.options);
|
|
626
|
+
break;
|
|
627
|
+
case "down":
|
|
628
|
+
case "right":
|
|
629
|
+
this.cursor = f(this.cursor, 1, this.options);
|
|
630
|
+
break;
|
|
631
|
+
}
|
|
632
|
+
this.changeValue();
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
};
|
|
636
|
+
var ct = class extends m {
|
|
637
|
+
get userInputWithCursor() {
|
|
638
|
+
if (this.state === "submit") return this.userInput;
|
|
639
|
+
const t = this.userInput;
|
|
640
|
+
if (this.cursor >= t.length) return `${this.userInput}\u2588`;
|
|
641
|
+
const s = t.slice(0, this.cursor), [e2, ...i] = t.slice(this.cursor);
|
|
642
|
+
return `${s}${v("inverse", e2)}${i.join("")}`;
|
|
643
|
+
}
|
|
644
|
+
get cursor() {
|
|
645
|
+
return this._cursor;
|
|
646
|
+
}
|
|
647
|
+
constructor(t) {
|
|
648
|
+
super({ ...t, initialUserInput: t.initialUserInput ?? t.initialValue }), this.on("userInput", (s) => {
|
|
649
|
+
this._setValue(s);
|
|
650
|
+
}), this.on("finalize", () => {
|
|
651
|
+
this.value || (this.value = t.defaultValue), this.value === void 0 && (this.value = "");
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
};
|
|
655
|
+
|
|
656
|
+
// node_modules/@clack/prompts/dist/index.mjs
|
|
657
|
+
init_require_shim();
|
|
658
|
+
import { styleText as e, stripVTControlCharacters as ot2 } from "node:util";
|
|
659
|
+
import V2 from "node:process";
|
|
660
|
+
var import_sisteransi2 = __toESM(require_src(), 1);
|
|
661
|
+
function se() {
|
|
662
|
+
return V2.platform !== "win32" ? V2.env.TERM !== "linux" : !!V2.env.CI || !!V2.env.WT_SESSION || !!V2.env.TERMINUS_SUBLIME || V2.env.ConEmuTask === "{cmd::Cmder}" || V2.env.TERM_PROGRAM === "Terminus-Sublime" || V2.env.TERM_PROGRAM === "vscode" || V2.env.TERM === "xterm-256color" || V2.env.TERM === "alacritty" || V2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
663
|
+
}
|
|
664
|
+
var tt = se();
|
|
665
|
+
var w2 = (t, i) => tt ? t : i;
|
|
666
|
+
var _t = w2("\u25C6", "*");
|
|
667
|
+
var ut2 = w2("\u25A0", "x");
|
|
668
|
+
var lt2 = w2("\u25B2", "x");
|
|
669
|
+
var H = w2("\u25C7", "o");
|
|
670
|
+
var ct2 = w2("\u250C", "T");
|
|
671
|
+
var $ = w2("\u2502", "|");
|
|
672
|
+
var x2 = w2("\u2514", "\u2014");
|
|
673
|
+
var xt = w2("\u2510", "T");
|
|
674
|
+
var Et = w2("\u2518", "\u2014");
|
|
675
|
+
var z2 = w2("\u25CF", ">");
|
|
676
|
+
var U = w2("\u25CB", " ");
|
|
677
|
+
var et = w2("\u25FB", "[\u2022]");
|
|
678
|
+
var K2 = w2("\u25FC", "[+]");
|
|
679
|
+
var Y2 = w2("\u25FB", "[ ]");
|
|
680
|
+
var Gt = w2("\u25AA", "\u2022");
|
|
681
|
+
var st = w2("\u2500", "-");
|
|
682
|
+
var $t = w2("\u256E", "+");
|
|
683
|
+
var Mt = w2("\u251C", "+");
|
|
684
|
+
var dt = w2("\u256F", "+");
|
|
685
|
+
var ht2 = w2("\u2570", "+");
|
|
686
|
+
var Ot = w2("\u256D", "+");
|
|
687
|
+
var pt = w2("\u25CF", "\u2022");
|
|
688
|
+
var mt = w2("\u25C6", "*");
|
|
689
|
+
var gt = w2("\u25B2", "!");
|
|
690
|
+
var yt = w2("\u25A0", "x");
|
|
691
|
+
var P2 = (t) => {
|
|
692
|
+
switch (t) {
|
|
693
|
+
case "initial":
|
|
694
|
+
case "active":
|
|
695
|
+
return e("cyan", _t);
|
|
696
|
+
case "cancel":
|
|
697
|
+
return e("red", ut2);
|
|
698
|
+
case "error":
|
|
699
|
+
return e("yellow", lt2);
|
|
700
|
+
case "submit":
|
|
701
|
+
return e("green", H);
|
|
702
|
+
}
|
|
703
|
+
};
|
|
704
|
+
var ft = (t) => {
|
|
705
|
+
switch (t) {
|
|
706
|
+
case "initial":
|
|
707
|
+
case "active":
|
|
708
|
+
return e("cyan", $);
|
|
709
|
+
case "cancel":
|
|
710
|
+
return e("red", $);
|
|
711
|
+
case "error":
|
|
712
|
+
return e("yellow", $);
|
|
713
|
+
case "submit":
|
|
714
|
+
return e("green", $);
|
|
715
|
+
}
|
|
716
|
+
};
|
|
717
|
+
var Pt = (t, i, s, r, u, n = false) => {
|
|
718
|
+
let a = i, c = 0;
|
|
719
|
+
if (n) for (let o = r - 1; o >= s && (a -= t[o].length, c++, !(a <= u)); o--) ;
|
|
720
|
+
else for (let o = s; o < r && (a -= t[o].length, c++, !(a <= u)); o++) ;
|
|
721
|
+
return { lineCount: a, removals: c };
|
|
722
|
+
};
|
|
723
|
+
var F = ({ cursor: t, options: i, style: s, output: r = process.stdout, maxItems: u = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: a = 4 }) => {
|
|
724
|
+
const c = A(r) - n, o = L(r), l = e("dim", "..."), d = Math.max(o - a, 0), g = Math.max(Math.min(u, d), 5);
|
|
725
|
+
let p2 = 0;
|
|
726
|
+
t >= g - 3 && (p2 = Math.max(Math.min(t - g + 3, i.length - g), 0));
|
|
727
|
+
let f2 = g < i.length && p2 > 0, h2 = g < i.length && p2 + g < i.length;
|
|
728
|
+
const I = Math.min(p2 + g, i.length), m2 = [];
|
|
729
|
+
let y = 0;
|
|
730
|
+
f2 && y++, h2 && y++;
|
|
731
|
+
const v2 = p2 + (f2 ? 1 : 0), C2 = I - (h2 ? 1 : 0);
|
|
732
|
+
for (let b = v2; b < C2; b++) {
|
|
733
|
+
const G2 = wrapAnsi(s(i[b], b === t), c, { hard: true, trim: false }).split(`
|
|
734
|
+
`);
|
|
735
|
+
m2.push(G2), y += G2.length;
|
|
736
|
+
}
|
|
737
|
+
if (y > d) {
|
|
738
|
+
let b = 0, G2 = 0, M = y;
|
|
739
|
+
const N = t - v2;
|
|
740
|
+
let O = d;
|
|
741
|
+
const j2 = () => Pt(m2, M, 0, N, O), k2 = () => Pt(m2, M, N + 1, m2.length, O, true);
|
|
742
|
+
f2 ? ({ lineCount: M, removals: b } = j2(), M > O && (h2 || (O -= 1), { lineCount: M, removals: G2 } = k2())) : (h2 || (O -= 1), { lineCount: M, removals: G2 } = k2(), M > O && (O -= 1, { lineCount: M, removals: b } = j2())), b > 0 && (f2 = true, m2.splice(0, b)), G2 > 0 && (h2 = true, m2.splice(m2.length - G2, G2));
|
|
743
|
+
}
|
|
744
|
+
const S = [];
|
|
745
|
+
f2 && S.push(l);
|
|
746
|
+
for (const b of m2) for (const G2 of b) S.push(G2);
|
|
747
|
+
return h2 && S.push(l), S;
|
|
748
|
+
};
|
|
749
|
+
var le = (t) => {
|
|
750
|
+
const i = t.active ?? "Yes", s = t.inactive ?? "No";
|
|
751
|
+
return new Z({ active: i, inactive: s, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue ?? true, render() {
|
|
752
|
+
const r = t.withGuide ?? h.withGuide, u = `${P2(this.state)} `, n = r ? `${e("gray", $)} ` : "", a = B(t.output, t.message, n, u), c = `${r ? `${e("gray", $)}
|
|
753
|
+
` : ""}${a}
|
|
754
|
+
`, o = this.value ? i : s;
|
|
755
|
+
switch (this.state) {
|
|
756
|
+
case "submit": {
|
|
757
|
+
const l = r ? `${e("gray", $)} ` : "";
|
|
758
|
+
return `${c}${l}${e("dim", o)}`;
|
|
759
|
+
}
|
|
760
|
+
case "cancel": {
|
|
761
|
+
const l = r ? `${e("gray", $)} ` : "";
|
|
762
|
+
return `${c}${l}${e(["strikethrough", "dim"], o)}${r ? `
|
|
763
|
+
${e("gray", $)}` : ""}`;
|
|
764
|
+
}
|
|
765
|
+
default: {
|
|
766
|
+
const l = r ? `${e("cyan", $)} ` : "", d = r ? e("cyan", x2) : "";
|
|
767
|
+
return `${c}${l}${this.value ? `${e("green", z2)} ${i}` : `${e("dim", U)} ${e("dim", i)}`}${t.vertical ? r ? `
|
|
768
|
+
${e("cyan", $)} ` : `
|
|
769
|
+
` : ` ${e("dim", "/")} `}${this.value ? `${e("dim", U)} ${e("dim", s)}` : `${e("green", z2)} ${s}`}
|
|
770
|
+
${d}
|
|
771
|
+
`;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
} }).prompt();
|
|
775
|
+
};
|
|
776
|
+
var R2 = { message: (t = [], { symbol: i = e("gray", $), secondarySymbol: s = e("gray", $), output: r = process.stdout, spacing: u = 1, withGuide: n } = {}) => {
|
|
777
|
+
const a = [], c = n ?? h.withGuide, o = c ? s : "", l = c ? `${i} ` : "", d = c ? `${s} ` : "";
|
|
778
|
+
for (let p2 = 0; p2 < u; p2++) a.push(o);
|
|
779
|
+
const g = Array.isArray(t) ? t : t.split(`
|
|
780
|
+
`);
|
|
781
|
+
if (g.length > 0) {
|
|
782
|
+
const [p2, ...f2] = g;
|
|
783
|
+
p2.length > 0 ? a.push(`${l}${p2}`) : a.push(c ? i : "");
|
|
784
|
+
for (const h2 of f2) h2.length > 0 ? a.push(`${d}${h2}`) : a.push(c ? s : "");
|
|
785
|
+
}
|
|
786
|
+
r.write(`${a.join(`
|
|
787
|
+
`)}
|
|
788
|
+
`);
|
|
789
|
+
}, info: (t, i) => {
|
|
790
|
+
R2.message(t, { ...i, symbol: e("blue", pt) });
|
|
791
|
+
}, success: (t, i) => {
|
|
792
|
+
R2.message(t, { ...i, symbol: e("green", mt) });
|
|
793
|
+
}, step: (t, i) => {
|
|
794
|
+
R2.message(t, { ...i, symbol: e("green", H) });
|
|
795
|
+
}, warn: (t, i) => {
|
|
796
|
+
R2.message(t, { ...i, symbol: e("yellow", gt) });
|
|
797
|
+
}, warning: (t, i) => {
|
|
798
|
+
R2.warn(t, i);
|
|
799
|
+
}, error: (t, i) => {
|
|
800
|
+
R2.message(t, { ...i, symbol: e("red", yt) });
|
|
801
|
+
} };
|
|
802
|
+
var ge = (t = "", i) => {
|
|
803
|
+
const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", x2)} ` : "";
|
|
804
|
+
s.write(`${r}${e("red", t)}
|
|
805
|
+
|
|
806
|
+
`);
|
|
807
|
+
};
|
|
808
|
+
var ye = (t = "", i) => {
|
|
809
|
+
const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", ct2)} ` : "";
|
|
810
|
+
s.write(`${r}${t}
|
|
811
|
+
`);
|
|
812
|
+
};
|
|
813
|
+
var fe = (t = "", i) => {
|
|
814
|
+
const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", $)}
|
|
815
|
+
${e("gray", x2)} ` : "";
|
|
816
|
+
s.write(`${r}${t}
|
|
817
|
+
|
|
818
|
+
`);
|
|
819
|
+
};
|
|
820
|
+
var be = (t) => e("dim", t);
|
|
821
|
+
var Se = (t, i, s) => {
|
|
822
|
+
const r = { hard: true, trim: false }, u = wrapAnsi(t, i, r).split(`
|
|
823
|
+
`), n = u.reduce((o, l) => Math.max(dist_default2(l), o), 0), a = u.map(s).reduce((o, l) => Math.max(dist_default2(l), o), 0), c = i - (a - n);
|
|
824
|
+
return wrapAnsi(t, c, r);
|
|
825
|
+
};
|
|
826
|
+
var Ce = (t = "", i = "", s) => {
|
|
827
|
+
const r = s?.output ?? V2.stdout, u = s?.withGuide ?? h.withGuide, n = s?.format ?? be, a = ["", ...Se(t, A(r) - 6, n).split(`
|
|
828
|
+
`).map(n), ""], c = dist_default2(i), o = Math.max(a.reduce((p2, f2) => {
|
|
829
|
+
const h2 = dist_default2(f2);
|
|
830
|
+
return h2 > p2 ? h2 : p2;
|
|
831
|
+
}, 0), c) + 2, l = a.map((p2) => `${e("gray", $)} ${p2}${" ".repeat(o - dist_default2(p2))}${e("gray", $)}`).join(`
|
|
832
|
+
`), d = u ? `${e("gray", $)}
|
|
833
|
+
` : "", g = u ? Mt : ht2;
|
|
834
|
+
r.write(`${d}${e("green", H)} ${e("reset", i)} ${e("gray", st.repeat(Math.max(o - c - 1, 1)) + $t)}
|
|
835
|
+
${l}
|
|
836
|
+
${e("gray", g + st.repeat(o + 2) + dt)}
|
|
837
|
+
`);
|
|
838
|
+
};
|
|
839
|
+
var Nt = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
|
|
840
|
+
var it2 = (t, i) => t.includes(`
|
|
841
|
+
`) ? t.split(`
|
|
842
|
+
`).map((s) => i(s)).join(`
|
|
843
|
+
`) : i(t);
|
|
844
|
+
var Ee = (t) => {
|
|
845
|
+
const i = (s, r) => {
|
|
846
|
+
const u = s.label ?? String(s.value);
|
|
847
|
+
switch (r) {
|
|
848
|
+
case "disabled":
|
|
849
|
+
return `${e("gray", U)} ${it2(u, (n) => e("gray", n))}${s.hint ? ` ${e("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
|
|
850
|
+
case "selected":
|
|
851
|
+
return `${it2(u, (n) => e("dim", n))}`;
|
|
852
|
+
case "active":
|
|
853
|
+
return `${e("green", z2)} ${u}${s.hint ? ` ${e("dim", `(${s.hint})`)}` : ""}`;
|
|
854
|
+
case "cancelled":
|
|
855
|
+
return `${it2(u, (n) => e(["strikethrough", "dim"], n))}`;
|
|
856
|
+
default:
|
|
857
|
+
return `${e("dim", U)} ${it2(u, (n) => e("dim", n))}`;
|
|
858
|
+
}
|
|
859
|
+
};
|
|
860
|
+
return new ht({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue, render() {
|
|
861
|
+
const s = t.withGuide ?? h.withGuide, r = `${P2(this.state)} `, u = `${ft(this.state)} `, n = B(t.output, t.message, u, r), a = `${s ? `${e("gray", $)}
|
|
862
|
+
` : ""}${n}
|
|
863
|
+
`;
|
|
864
|
+
switch (this.state) {
|
|
865
|
+
case "submit": {
|
|
866
|
+
const c = s ? `${e("gray", $)} ` : "", o = B(t.output, i(this.options[this.cursor], "selected"), c);
|
|
867
|
+
return `${a}${o}`;
|
|
868
|
+
}
|
|
869
|
+
case "cancel": {
|
|
870
|
+
const c = s ? `${e("gray", $)} ` : "", o = B(t.output, i(this.options[this.cursor], "cancelled"), c);
|
|
871
|
+
return `${a}${o}${s ? `
|
|
872
|
+
${e("gray", $)}` : ""}`;
|
|
873
|
+
}
|
|
874
|
+
default: {
|
|
875
|
+
const c = s ? `${e("cyan", $)} ` : "", o = s ? e("cyan", x2) : "", l = a.split(`
|
|
876
|
+
`).length, d = s ? 2 : 1;
|
|
877
|
+
return `${a}${c}${F({ output: t.output, cursor: this.cursor, options: this.options, maxItems: t.maxItems, columnPadding: c.length, rowPadding: l + d, style: (g, p2) => i(g, g.disabled ? "disabled" : p2 ? "active" : "inactive") }).join(`
|
|
878
|
+
${c}`)}
|
|
879
|
+
${o}
|
|
880
|
+
`;
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
} }).prompt();
|
|
884
|
+
};
|
|
885
|
+
var Bt = `${e("gray", $)} `;
|
|
886
|
+
var Re = (t) => new ct({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, output: t.output, signal: t.signal, input: t.input, render() {
|
|
887
|
+
const i = t?.withGuide ?? h.withGuide, s = `${`${i ? `${e("gray", $)}
|
|
888
|
+
` : ""}${P2(this.state)} `}${t.message}
|
|
889
|
+
`, r = t.placeholder ? e("inverse", t.placeholder[0]) + e("dim", t.placeholder.slice(1)) : e(["inverse", "hidden"], "_"), u = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
|
|
890
|
+
switch (this.state) {
|
|
891
|
+
case "error": {
|
|
892
|
+
const a = this.error ? ` ${e("yellow", this.error)}` : "", c = i ? `${e("yellow", $)} ` : "", o = i ? e("yellow", x2) : "";
|
|
893
|
+
return `${s.trim()}
|
|
894
|
+
${c}${u}
|
|
895
|
+
${o}${a}
|
|
896
|
+
`;
|
|
897
|
+
}
|
|
898
|
+
case "submit": {
|
|
899
|
+
const a = n ? ` ${e("dim", n)}` : "", c = i ? e("gray", $) : "";
|
|
900
|
+
return `${s}${c}${a}`;
|
|
901
|
+
}
|
|
902
|
+
case "cancel": {
|
|
903
|
+
const a = n ? ` ${e(["strikethrough", "dim"], n)}` : "", c = i ? e("gray", $) : "";
|
|
904
|
+
return `${s}${c}${a}${n.trim() ? `
|
|
905
|
+
${c}` : ""}`;
|
|
906
|
+
}
|
|
907
|
+
default: {
|
|
908
|
+
const a = i ? `${e("cyan", $)} ` : "", c = i ? e("cyan", x2) : "";
|
|
909
|
+
return `${s}${a}${u}
|
|
910
|
+
${c}
|
|
911
|
+
`;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
} }).prompt();
|
|
915
|
+
|
|
916
|
+
export {
|
|
917
|
+
R,
|
|
918
|
+
le,
|
|
919
|
+
R2,
|
|
920
|
+
ge,
|
|
921
|
+
ye,
|
|
922
|
+
fe,
|
|
923
|
+
Ce,
|
|
924
|
+
Ee,
|
|
925
|
+
Re
|
|
926
|
+
};
|