truecourse 0.2.2 → 0.2.4
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/cli.mjs +1236 -933
- package/package.json +2 -2
- package/server.mjs +30 -4
package/cli.mjs
CHANGED
|
@@ -6,11 +6,11 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __require = /* @__PURE__ */ ((
|
|
10
|
-
get: (
|
|
11
|
-
}) :
|
|
9
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
10
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
11
|
+
}) : x)(function(x) {
|
|
12
12
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
13
|
-
throw Error('Dynamic require of "' +
|
|
13
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
14
14
|
});
|
|
15
15
|
var __esm = (fn, res) => function __init() {
|
|
16
16
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
@@ -225,8 +225,8 @@ var require_help = __commonJS({
|
|
|
225
225
|
visibleCommands.push(helpCommand);
|
|
226
226
|
}
|
|
227
227
|
if (this.sortSubcommands) {
|
|
228
|
-
visibleCommands.sort((
|
|
229
|
-
return
|
|
228
|
+
visibleCommands.sort((a, b) => {
|
|
229
|
+
return a.name().localeCompare(b.name());
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
232
|
return visibleCommands;
|
|
@@ -238,11 +238,11 @@ var require_help = __commonJS({
|
|
|
238
238
|
* @param {Option} b
|
|
239
239
|
* @returns {number}
|
|
240
240
|
*/
|
|
241
|
-
compareOptions(
|
|
241
|
+
compareOptions(a, b) {
|
|
242
242
|
const getSortKey = (option) => {
|
|
243
243
|
return option.short ? option.short.replace(/^-/, "") : option.long.replace(/^--/, "");
|
|
244
244
|
};
|
|
245
|
-
return getSortKey(
|
|
245
|
+
return getSortKey(a).localeCompare(getSortKey(b));
|
|
246
246
|
}
|
|
247
247
|
/**
|
|
248
248
|
* Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.
|
|
@@ -891,38 +891,38 @@ var require_option = __commonJS({
|
|
|
891
891
|
var require_suggestSimilar = __commonJS({
|
|
892
892
|
"node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/suggestSimilar.js"(exports) {
|
|
893
893
|
var maxDistance = 3;
|
|
894
|
-
function editDistance(
|
|
895
|
-
if (Math.abs(
|
|
896
|
-
return Math.max(
|
|
897
|
-
const
|
|
898
|
-
for (let i = 0; i <=
|
|
899
|
-
|
|
900
|
-
}
|
|
901
|
-
for (let
|
|
902
|
-
|
|
903
|
-
}
|
|
904
|
-
for (let
|
|
905
|
-
for (let i = 1; i <=
|
|
894
|
+
function editDistance(a, b) {
|
|
895
|
+
if (Math.abs(a.length - b.length) > maxDistance)
|
|
896
|
+
return Math.max(a.length, b.length);
|
|
897
|
+
const d3 = [];
|
|
898
|
+
for (let i = 0; i <= a.length; i++) {
|
|
899
|
+
d3[i] = [i];
|
|
900
|
+
}
|
|
901
|
+
for (let j2 = 0; j2 <= b.length; j2++) {
|
|
902
|
+
d3[0][j2] = j2;
|
|
903
|
+
}
|
|
904
|
+
for (let j2 = 1; j2 <= b.length; j2++) {
|
|
905
|
+
for (let i = 1; i <= a.length; i++) {
|
|
906
906
|
let cost = 1;
|
|
907
|
-
if (
|
|
907
|
+
if (a[i - 1] === b[j2 - 1]) {
|
|
908
908
|
cost = 0;
|
|
909
909
|
} else {
|
|
910
910
|
cost = 1;
|
|
911
911
|
}
|
|
912
|
-
|
|
913
|
-
|
|
912
|
+
d3[i][j2] = Math.min(
|
|
913
|
+
d3[i - 1][j2] + 1,
|
|
914
914
|
// deletion
|
|
915
|
-
|
|
915
|
+
d3[i][j2 - 1] + 1,
|
|
916
916
|
// insertion
|
|
917
|
-
|
|
917
|
+
d3[i - 1][j2 - 1] + cost
|
|
918
918
|
// substitution
|
|
919
919
|
);
|
|
920
|
-
if (i > 1 &&
|
|
921
|
-
|
|
920
|
+
if (i > 1 && j2 > 1 && a[i - 1] === b[j2 - 2] && a[i - 2] === b[j2 - 1]) {
|
|
921
|
+
d3[i][j2] = Math.min(d3[i][j2], d3[i - 2][j2 - 2] + 1);
|
|
922
922
|
}
|
|
923
923
|
}
|
|
924
924
|
}
|
|
925
|
-
return
|
|
925
|
+
return d3[a.length][b.length];
|
|
926
926
|
}
|
|
927
927
|
function suggestSimilar(word, candidates) {
|
|
928
928
|
if (!candidates || candidates.length === 0) return "";
|
|
@@ -949,7 +949,7 @@ var require_suggestSimilar = __commonJS({
|
|
|
949
949
|
}
|
|
950
950
|
}
|
|
951
951
|
});
|
|
952
|
-
similar.sort((
|
|
952
|
+
similar.sort((a, b) => a.localeCompare(b));
|
|
953
953
|
if (searchingOptions) {
|
|
954
954
|
similar = similar.map((candidate) => `--${candidate}`);
|
|
955
955
|
}
|
|
@@ -1579,8 +1579,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1579
1579
|
} else if (fn instanceof RegExp) {
|
|
1580
1580
|
const regex = fn;
|
|
1581
1581
|
fn = (val, def) => {
|
|
1582
|
-
const
|
|
1583
|
-
return
|
|
1582
|
+
const m = regex.exec(val);
|
|
1583
|
+
return m ? m[0] : def;
|
|
1584
1584
|
};
|
|
1585
1585
|
option.default(defaultValue).argParser(fn);
|
|
1586
1586
|
} else {
|
|
@@ -2097,8 +2097,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2097
2097
|
if (index < this.args.length) {
|
|
2098
2098
|
value2 = this.args.slice(index);
|
|
2099
2099
|
if (declaredArg.parseArg) {
|
|
2100
|
-
value2 = value2.reduce((processed,
|
|
2101
|
-
return myParseArg(declaredArg,
|
|
2100
|
+
value2 = value2.reduce((processed, v) => {
|
|
2101
|
+
return myParseArg(declaredArg, v, processed);
|
|
2102
2102
|
}, declaredArg.defaultValue);
|
|
2103
2103
|
}
|
|
2104
2104
|
} else if (value2 === void 0) {
|
|
@@ -3032,49 +3032,451 @@ var require_commander = __commonJS({
|
|
|
3032
3032
|
}
|
|
3033
3033
|
});
|
|
3034
3034
|
|
|
3035
|
+
// node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js
|
|
3036
|
+
var isAmbiguous, isFullWidth, isWide;
|
|
3037
|
+
var init_utils = __esm({
|
|
3038
|
+
"node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js"() {
|
|
3039
|
+
isAmbiguous = (x) => {
|
|
3040
|
+
return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
|
|
3041
|
+
};
|
|
3042
|
+
isFullWidth = (x) => {
|
|
3043
|
+
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
3044
|
+
};
|
|
3045
|
+
isWide = (x) => {
|
|
3046
|
+
return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9800 && x <= 9811 || x === 9855 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 19968 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101632 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129672 || x >= 129680 && x <= 129725 || x >= 129727 && x <= 129733 || x >= 129742 && x <= 129755 || x >= 129760 && x <= 129768 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
3047
|
+
};
|
|
3048
|
+
}
|
|
3049
|
+
});
|
|
3050
|
+
|
|
3051
|
+
// node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js
|
|
3052
|
+
var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
|
|
3053
|
+
var init_dist = __esm({
|
|
3054
|
+
"node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js"() {
|
|
3055
|
+
init_utils();
|
|
3056
|
+
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
|
|
3057
|
+
CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
3058
|
+
TAB_RE = /\t{1,1000}/y;
|
|
3059
|
+
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");
|
|
3060
|
+
LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
3061
|
+
MODIFIER_RE = new RegExp("\\p{M}+", "gu");
|
|
3062
|
+
NO_TRUNCATION = { limit: Infinity, ellipsis: "" };
|
|
3063
|
+
getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
|
|
3064
|
+
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
3065
|
+
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
3066
|
+
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
|
|
3067
|
+
const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;
|
|
3068
|
+
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
3069
|
+
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
3070
|
+
const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
|
|
3071
|
+
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
3072
|
+
const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;
|
|
3073
|
+
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
3074
|
+
const WIDE_WIDTH = widthOptions.wideWidth ?? 2;
|
|
3075
|
+
let indexPrev = 0;
|
|
3076
|
+
let index = 0;
|
|
3077
|
+
let length = input.length;
|
|
3078
|
+
let lengthExtra = 0;
|
|
3079
|
+
let truncationEnabled = false;
|
|
3080
|
+
let truncationIndex = length;
|
|
3081
|
+
let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);
|
|
3082
|
+
let unmatchedStart = 0;
|
|
3083
|
+
let unmatchedEnd = 0;
|
|
3084
|
+
let width = 0;
|
|
3085
|
+
let widthExtra = 0;
|
|
3086
|
+
outer: while (true) {
|
|
3087
|
+
if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
|
|
3088
|
+
const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
|
|
3089
|
+
lengthExtra = 0;
|
|
3090
|
+
for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
|
|
3091
|
+
const codePoint = char.codePointAt(0) || 0;
|
|
3092
|
+
if (isFullWidth(codePoint)) {
|
|
3093
|
+
widthExtra = FULL_WIDTH_WIDTH;
|
|
3094
|
+
} else if (isWide(codePoint)) {
|
|
3095
|
+
widthExtra = WIDE_WIDTH;
|
|
3096
|
+
} else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {
|
|
3097
|
+
widthExtra = AMBIGUOUS_WIDTH;
|
|
3098
|
+
} else {
|
|
3099
|
+
widthExtra = REGULAR_WIDTH;
|
|
3100
|
+
}
|
|
3101
|
+
if (width + widthExtra > truncationLimit) {
|
|
3102
|
+
truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
|
|
3103
|
+
}
|
|
3104
|
+
if (width + widthExtra > LIMIT) {
|
|
3105
|
+
truncationEnabled = true;
|
|
3106
|
+
break outer;
|
|
3107
|
+
}
|
|
3108
|
+
lengthExtra += char.length;
|
|
3109
|
+
width += widthExtra;
|
|
3110
|
+
}
|
|
3111
|
+
unmatchedStart = unmatchedEnd = 0;
|
|
3112
|
+
}
|
|
3113
|
+
if (index >= length)
|
|
3114
|
+
break;
|
|
3115
|
+
LATIN_RE.lastIndex = index;
|
|
3116
|
+
if (LATIN_RE.test(input)) {
|
|
3117
|
+
lengthExtra = LATIN_RE.lastIndex - index;
|
|
3118
|
+
widthExtra = lengthExtra * REGULAR_WIDTH;
|
|
3119
|
+
if (width + widthExtra > truncationLimit) {
|
|
3120
|
+
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
|
|
3121
|
+
}
|
|
3122
|
+
if (width + widthExtra > LIMIT) {
|
|
3123
|
+
truncationEnabled = true;
|
|
3124
|
+
break;
|
|
3125
|
+
}
|
|
3126
|
+
width += widthExtra;
|
|
3127
|
+
unmatchedStart = indexPrev;
|
|
3128
|
+
unmatchedEnd = index;
|
|
3129
|
+
index = indexPrev = LATIN_RE.lastIndex;
|
|
3130
|
+
continue;
|
|
3131
|
+
}
|
|
3132
|
+
ANSI_RE.lastIndex = index;
|
|
3133
|
+
if (ANSI_RE.test(input)) {
|
|
3134
|
+
if (width + ANSI_WIDTH > truncationLimit) {
|
|
3135
|
+
truncationIndex = Math.min(truncationIndex, index);
|
|
3136
|
+
}
|
|
3137
|
+
if (width + ANSI_WIDTH > LIMIT) {
|
|
3138
|
+
truncationEnabled = true;
|
|
3139
|
+
break;
|
|
3140
|
+
}
|
|
3141
|
+
width += ANSI_WIDTH;
|
|
3142
|
+
unmatchedStart = indexPrev;
|
|
3143
|
+
unmatchedEnd = index;
|
|
3144
|
+
index = indexPrev = ANSI_RE.lastIndex;
|
|
3145
|
+
continue;
|
|
3146
|
+
}
|
|
3147
|
+
CONTROL_RE.lastIndex = index;
|
|
3148
|
+
if (CONTROL_RE.test(input)) {
|
|
3149
|
+
lengthExtra = CONTROL_RE.lastIndex - index;
|
|
3150
|
+
widthExtra = lengthExtra * CONTROL_WIDTH;
|
|
3151
|
+
if (width + widthExtra > truncationLimit) {
|
|
3152
|
+
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
|
|
3153
|
+
}
|
|
3154
|
+
if (width + widthExtra > LIMIT) {
|
|
3155
|
+
truncationEnabled = true;
|
|
3156
|
+
break;
|
|
3157
|
+
}
|
|
3158
|
+
width += widthExtra;
|
|
3159
|
+
unmatchedStart = indexPrev;
|
|
3160
|
+
unmatchedEnd = index;
|
|
3161
|
+
index = indexPrev = CONTROL_RE.lastIndex;
|
|
3162
|
+
continue;
|
|
3163
|
+
}
|
|
3164
|
+
TAB_RE.lastIndex = index;
|
|
3165
|
+
if (TAB_RE.test(input)) {
|
|
3166
|
+
lengthExtra = TAB_RE.lastIndex - index;
|
|
3167
|
+
widthExtra = lengthExtra * TAB_WIDTH;
|
|
3168
|
+
if (width + widthExtra > truncationLimit) {
|
|
3169
|
+
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
|
|
3170
|
+
}
|
|
3171
|
+
if (width + widthExtra > LIMIT) {
|
|
3172
|
+
truncationEnabled = true;
|
|
3173
|
+
break;
|
|
3174
|
+
}
|
|
3175
|
+
width += widthExtra;
|
|
3176
|
+
unmatchedStart = indexPrev;
|
|
3177
|
+
unmatchedEnd = index;
|
|
3178
|
+
index = indexPrev = TAB_RE.lastIndex;
|
|
3179
|
+
continue;
|
|
3180
|
+
}
|
|
3181
|
+
EMOJI_RE.lastIndex = index;
|
|
3182
|
+
if (EMOJI_RE.test(input)) {
|
|
3183
|
+
if (width + EMOJI_WIDTH > truncationLimit) {
|
|
3184
|
+
truncationIndex = Math.min(truncationIndex, index);
|
|
3185
|
+
}
|
|
3186
|
+
if (width + EMOJI_WIDTH > LIMIT) {
|
|
3187
|
+
truncationEnabled = true;
|
|
3188
|
+
break;
|
|
3189
|
+
}
|
|
3190
|
+
width += EMOJI_WIDTH;
|
|
3191
|
+
unmatchedStart = indexPrev;
|
|
3192
|
+
unmatchedEnd = index;
|
|
3193
|
+
index = indexPrev = EMOJI_RE.lastIndex;
|
|
3194
|
+
continue;
|
|
3195
|
+
}
|
|
3196
|
+
index += 1;
|
|
3197
|
+
}
|
|
3198
|
+
return {
|
|
3199
|
+
width: truncationEnabled ? truncationLimit : width,
|
|
3200
|
+
index: truncationEnabled ? truncationIndex : length,
|
|
3201
|
+
truncated: truncationEnabled,
|
|
3202
|
+
ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
|
|
3203
|
+
};
|
|
3204
|
+
};
|
|
3205
|
+
dist_default = getStringTruncatedWidth;
|
|
3206
|
+
}
|
|
3207
|
+
});
|
|
3208
|
+
|
|
3209
|
+
// node_modules/.pnpm/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js
|
|
3210
|
+
var NO_TRUNCATION2, fastStringWidth, dist_default2;
|
|
3211
|
+
var init_dist2 = __esm({
|
|
3212
|
+
"node_modules/.pnpm/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js"() {
|
|
3213
|
+
init_dist();
|
|
3214
|
+
NO_TRUNCATION2 = {
|
|
3215
|
+
limit: Infinity,
|
|
3216
|
+
ellipsis: "",
|
|
3217
|
+
ellipsisWidth: 0
|
|
3218
|
+
};
|
|
3219
|
+
fastStringWidth = (input, options = {}) => {
|
|
3220
|
+
return dist_default(input, NO_TRUNCATION2, options).width;
|
|
3221
|
+
};
|
|
3222
|
+
dist_default2 = fastStringWidth;
|
|
3223
|
+
}
|
|
3224
|
+
});
|
|
3225
|
+
|
|
3226
|
+
// node_modules/.pnpm/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js
|
|
3227
|
+
function wrapAnsi(string, columns, options) {
|
|
3228
|
+
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
3229
|
+
}
|
|
3230
|
+
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;
|
|
3231
|
+
var init_main = __esm({
|
|
3232
|
+
"node_modules/.pnpm/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js"() {
|
|
3233
|
+
init_dist2();
|
|
3234
|
+
ESC = "\x1B";
|
|
3235
|
+
CSI = "\x9B";
|
|
3236
|
+
END_CODE = 39;
|
|
3237
|
+
ANSI_ESCAPE_BELL = "\x07";
|
|
3238
|
+
ANSI_CSI = "[";
|
|
3239
|
+
ANSI_OSC = "]";
|
|
3240
|
+
ANSI_SGR_TERMINATOR = "m";
|
|
3241
|
+
ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
3242
|
+
GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
|
|
3243
|
+
getClosingCode = (openingCode) => {
|
|
3244
|
+
if (openingCode >= 30 && openingCode <= 37)
|
|
3245
|
+
return 39;
|
|
3246
|
+
if (openingCode >= 90 && openingCode <= 97)
|
|
3247
|
+
return 39;
|
|
3248
|
+
if (openingCode >= 40 && openingCode <= 47)
|
|
3249
|
+
return 49;
|
|
3250
|
+
if (openingCode >= 100 && openingCode <= 107)
|
|
3251
|
+
return 49;
|
|
3252
|
+
if (openingCode === 1 || openingCode === 2)
|
|
3253
|
+
return 22;
|
|
3254
|
+
if (openingCode === 3)
|
|
3255
|
+
return 23;
|
|
3256
|
+
if (openingCode === 4)
|
|
3257
|
+
return 24;
|
|
3258
|
+
if (openingCode === 7)
|
|
3259
|
+
return 27;
|
|
3260
|
+
if (openingCode === 8)
|
|
3261
|
+
return 28;
|
|
3262
|
+
if (openingCode === 9)
|
|
3263
|
+
return 29;
|
|
3264
|
+
if (openingCode === 0)
|
|
3265
|
+
return 0;
|
|
3266
|
+
return void 0;
|
|
3267
|
+
};
|
|
3268
|
+
wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
3269
|
+
wrapAnsiHyperlink = (url2) => `${ESC}${ANSI_ESCAPE_LINK}${url2}${ANSI_ESCAPE_BELL}`;
|
|
3270
|
+
wrapWord = (rows, word, columns) => {
|
|
3271
|
+
const characters = word[Symbol.iterator]();
|
|
3272
|
+
let isInsideEscape = false;
|
|
3273
|
+
let isInsideLinkEscape = false;
|
|
3274
|
+
let lastRow = rows.at(-1);
|
|
3275
|
+
let visible = lastRow === void 0 ? 0 : dist_default2(lastRow);
|
|
3276
|
+
let currentCharacter = characters.next();
|
|
3277
|
+
let nextCharacter = characters.next();
|
|
3278
|
+
let rawCharacterIndex = 0;
|
|
3279
|
+
while (!currentCharacter.done) {
|
|
3280
|
+
const character = currentCharacter.value;
|
|
3281
|
+
const characterLength = dist_default2(character);
|
|
3282
|
+
if (visible + characterLength <= columns) {
|
|
3283
|
+
rows[rows.length - 1] += character;
|
|
3284
|
+
} else {
|
|
3285
|
+
rows.push(character);
|
|
3286
|
+
visible = 0;
|
|
3287
|
+
}
|
|
3288
|
+
if (character === ESC || character === CSI) {
|
|
3289
|
+
isInsideEscape = true;
|
|
3290
|
+
isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
|
|
3291
|
+
}
|
|
3292
|
+
if (isInsideEscape) {
|
|
3293
|
+
if (isInsideLinkEscape) {
|
|
3294
|
+
if (character === ANSI_ESCAPE_BELL) {
|
|
3295
|
+
isInsideEscape = false;
|
|
3296
|
+
isInsideLinkEscape = false;
|
|
3297
|
+
}
|
|
3298
|
+
} else if (character === ANSI_SGR_TERMINATOR) {
|
|
3299
|
+
isInsideEscape = false;
|
|
3300
|
+
}
|
|
3301
|
+
} else {
|
|
3302
|
+
visible += characterLength;
|
|
3303
|
+
if (visible === columns && !nextCharacter.done) {
|
|
3304
|
+
rows.push("");
|
|
3305
|
+
visible = 0;
|
|
3306
|
+
}
|
|
3307
|
+
}
|
|
3308
|
+
currentCharacter = nextCharacter;
|
|
3309
|
+
nextCharacter = characters.next();
|
|
3310
|
+
rawCharacterIndex += character.length;
|
|
3311
|
+
}
|
|
3312
|
+
lastRow = rows.at(-1);
|
|
3313
|
+
if (!visible && lastRow !== void 0 && lastRow.length && rows.length > 1) {
|
|
3314
|
+
rows[rows.length - 2] += rows.pop();
|
|
3315
|
+
}
|
|
3316
|
+
};
|
|
3317
|
+
stringVisibleTrimSpacesRight = (string) => {
|
|
3318
|
+
const words = string.split(" ");
|
|
3319
|
+
let last = words.length;
|
|
3320
|
+
while (last) {
|
|
3321
|
+
if (dist_default2(words[last - 1])) {
|
|
3322
|
+
break;
|
|
3323
|
+
}
|
|
3324
|
+
last--;
|
|
3325
|
+
}
|
|
3326
|
+
if (last === words.length) {
|
|
3327
|
+
return string;
|
|
3328
|
+
}
|
|
3329
|
+
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
3330
|
+
};
|
|
3331
|
+
exec = (string, columns, options = {}) => {
|
|
3332
|
+
if (options.trim !== false && string.trim() === "") {
|
|
3333
|
+
return "";
|
|
3334
|
+
}
|
|
3335
|
+
let returnValue = "";
|
|
3336
|
+
let escapeCode;
|
|
3337
|
+
let escapeUrl;
|
|
3338
|
+
const words = string.split(" ");
|
|
3339
|
+
let rows = [""];
|
|
3340
|
+
let rowLength = 0;
|
|
3341
|
+
for (let index = 0; index < words.length; index++) {
|
|
3342
|
+
const word = words[index];
|
|
3343
|
+
if (options.trim !== false) {
|
|
3344
|
+
const row = rows.at(-1) ?? "";
|
|
3345
|
+
const trimmed = row.trimStart();
|
|
3346
|
+
if (row.length !== trimmed.length) {
|
|
3347
|
+
rows[rows.length - 1] = trimmed;
|
|
3348
|
+
rowLength = dist_default2(trimmed);
|
|
3349
|
+
}
|
|
3350
|
+
}
|
|
3351
|
+
if (index !== 0) {
|
|
3352
|
+
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
3353
|
+
rows.push("");
|
|
3354
|
+
rowLength = 0;
|
|
3355
|
+
}
|
|
3356
|
+
if (rowLength || options.trim === false) {
|
|
3357
|
+
rows[rows.length - 1] += " ";
|
|
3358
|
+
rowLength++;
|
|
3359
|
+
}
|
|
3360
|
+
}
|
|
3361
|
+
const wordLength = dist_default2(word);
|
|
3362
|
+
if (options.hard && wordLength > columns) {
|
|
3363
|
+
const remainingColumns = columns - rowLength;
|
|
3364
|
+
const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
|
|
3365
|
+
const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);
|
|
3366
|
+
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
3367
|
+
rows.push("");
|
|
3368
|
+
}
|
|
3369
|
+
wrapWord(rows, word, columns);
|
|
3370
|
+
rowLength = dist_default2(rows.at(-1) ?? "");
|
|
3371
|
+
continue;
|
|
3372
|
+
}
|
|
3373
|
+
if (rowLength + wordLength > columns && rowLength && wordLength) {
|
|
3374
|
+
if (options.wordWrap === false && rowLength < columns) {
|
|
3375
|
+
wrapWord(rows, word, columns);
|
|
3376
|
+
rowLength = dist_default2(rows.at(-1) ?? "");
|
|
3377
|
+
continue;
|
|
3378
|
+
}
|
|
3379
|
+
rows.push("");
|
|
3380
|
+
rowLength = 0;
|
|
3381
|
+
}
|
|
3382
|
+
if (rowLength + wordLength > columns && options.wordWrap === false) {
|
|
3383
|
+
wrapWord(rows, word, columns);
|
|
3384
|
+
rowLength = dist_default2(rows.at(-1) ?? "");
|
|
3385
|
+
continue;
|
|
3386
|
+
}
|
|
3387
|
+
rows[rows.length - 1] += word;
|
|
3388
|
+
rowLength += wordLength;
|
|
3389
|
+
}
|
|
3390
|
+
if (options.trim !== false) {
|
|
3391
|
+
rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
3392
|
+
}
|
|
3393
|
+
const preString = rows.join("\n");
|
|
3394
|
+
let inSurrogate = false;
|
|
3395
|
+
for (let i = 0; i < preString.length; i++) {
|
|
3396
|
+
const character = preString[i];
|
|
3397
|
+
returnValue += character;
|
|
3398
|
+
if (!inSurrogate) {
|
|
3399
|
+
inSurrogate = character >= "\uD800" && character <= "\uDBFF";
|
|
3400
|
+
} else {
|
|
3401
|
+
continue;
|
|
3402
|
+
}
|
|
3403
|
+
if (character === ESC || character === CSI) {
|
|
3404
|
+
GROUP_REGEX.lastIndex = i + 1;
|
|
3405
|
+
const groupsResult = GROUP_REGEX.exec(preString);
|
|
3406
|
+
const groups = groupsResult?.groups;
|
|
3407
|
+
if (groups?.code !== void 0) {
|
|
3408
|
+
const code = Number.parseFloat(groups.code);
|
|
3409
|
+
escapeCode = code === END_CODE ? void 0 : code;
|
|
3410
|
+
} else if (groups?.uri !== void 0) {
|
|
3411
|
+
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
3412
|
+
}
|
|
3413
|
+
}
|
|
3414
|
+
if (preString[i + 1] === "\n") {
|
|
3415
|
+
if (escapeUrl) {
|
|
3416
|
+
returnValue += wrapAnsiHyperlink("");
|
|
3417
|
+
}
|
|
3418
|
+
const closingCode = escapeCode ? getClosingCode(escapeCode) : void 0;
|
|
3419
|
+
if (escapeCode && closingCode) {
|
|
3420
|
+
returnValue += wrapAnsiCode(closingCode);
|
|
3421
|
+
}
|
|
3422
|
+
} else if (character === "\n") {
|
|
3423
|
+
if (escapeCode && getClosingCode(escapeCode)) {
|
|
3424
|
+
returnValue += wrapAnsiCode(escapeCode);
|
|
3425
|
+
}
|
|
3426
|
+
if (escapeUrl) {
|
|
3427
|
+
returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
3428
|
+
}
|
|
3429
|
+
}
|
|
3430
|
+
}
|
|
3431
|
+
return returnValue;
|
|
3432
|
+
};
|
|
3433
|
+
CRLF_OR_LF = /\r?\n/;
|
|
3434
|
+
}
|
|
3435
|
+
});
|
|
3436
|
+
|
|
3035
3437
|
// node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
|
3036
3438
|
var require_src = __commonJS({
|
|
3037
3439
|
"node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports, module) {
|
|
3038
3440
|
"use strict";
|
|
3039
|
-
var
|
|
3040
|
-
var
|
|
3441
|
+
var ESC2 = "\x1B";
|
|
3442
|
+
var CSI2 = `${ESC2}[`;
|
|
3041
3443
|
var beep = "\x07";
|
|
3042
3444
|
var cursor = {
|
|
3043
|
-
to(
|
|
3044
|
-
if (!
|
|
3045
|
-
return `${
|
|
3445
|
+
to(x, y2) {
|
|
3446
|
+
if (!y2) return `${CSI2}${x + 1}G`;
|
|
3447
|
+
return `${CSI2}${y2 + 1};${x + 1}H`;
|
|
3046
3448
|
},
|
|
3047
|
-
move(
|
|
3449
|
+
move(x, y2) {
|
|
3048
3450
|
let ret = "";
|
|
3049
|
-
if (
|
|
3050
|
-
else if (
|
|
3051
|
-
if (
|
|
3052
|
-
else if (
|
|
3451
|
+
if (x < 0) ret += `${CSI2}${-x}D`;
|
|
3452
|
+
else if (x > 0) ret += `${CSI2}${x}C`;
|
|
3453
|
+
if (y2 < 0) ret += `${CSI2}${-y2}A`;
|
|
3454
|
+
else if (y2 > 0) ret += `${CSI2}${y2}B`;
|
|
3053
3455
|
return ret;
|
|
3054
3456
|
},
|
|
3055
|
-
up: (count = 1) => `${
|
|
3056
|
-
down: (count = 1) => `${
|
|
3057
|
-
forward: (count = 1) => `${
|
|
3058
|
-
backward: (count = 1) => `${
|
|
3059
|
-
nextLine: (count = 1) => `${
|
|
3060
|
-
prevLine: (count = 1) => `${
|
|
3061
|
-
left: `${
|
|
3062
|
-
hide: `${
|
|
3063
|
-
show: `${
|
|
3064
|
-
save: `${
|
|
3065
|
-
restore: `${
|
|
3457
|
+
up: (count = 1) => `${CSI2}${count}A`,
|
|
3458
|
+
down: (count = 1) => `${CSI2}${count}B`,
|
|
3459
|
+
forward: (count = 1) => `${CSI2}${count}C`,
|
|
3460
|
+
backward: (count = 1) => `${CSI2}${count}D`,
|
|
3461
|
+
nextLine: (count = 1) => `${CSI2}E`.repeat(count),
|
|
3462
|
+
prevLine: (count = 1) => `${CSI2}F`.repeat(count),
|
|
3463
|
+
left: `${CSI2}G`,
|
|
3464
|
+
hide: `${CSI2}?25l`,
|
|
3465
|
+
show: `${CSI2}?25h`,
|
|
3466
|
+
save: `${ESC2}7`,
|
|
3467
|
+
restore: `${ESC2}8`
|
|
3066
3468
|
};
|
|
3067
3469
|
var scroll = {
|
|
3068
|
-
up: (count = 1) => `${
|
|
3069
|
-
down: (count = 1) => `${
|
|
3470
|
+
up: (count = 1) => `${CSI2}S`.repeat(count),
|
|
3471
|
+
down: (count = 1) => `${CSI2}T`.repeat(count)
|
|
3070
3472
|
};
|
|
3071
3473
|
var erase = {
|
|
3072
|
-
screen: `${
|
|
3073
|
-
up: (count = 1) => `${
|
|
3074
|
-
down: (count = 1) => `${
|
|
3075
|
-
line: `${
|
|
3076
|
-
lineEnd: `${
|
|
3077
|
-
lineStart: `${
|
|
3474
|
+
screen: `${CSI2}2J`,
|
|
3475
|
+
up: (count = 1) => `${CSI2}1J`.repeat(count),
|
|
3476
|
+
down: (count = 1) => `${CSI2}J`.repeat(count),
|
|
3477
|
+
line: `${CSI2}2K`,
|
|
3478
|
+
lineEnd: `${CSI2}K`,
|
|
3479
|
+
lineStart: `${CSI2}1K`,
|
|
3078
3480
|
lines(count) {
|
|
3079
3481
|
let clear = "";
|
|
3080
3482
|
for (let i = 0; i < count; i++)
|
|
@@ -3088,678 +3490,564 @@ var require_src = __commonJS({
|
|
|
3088
3490
|
}
|
|
3089
3491
|
});
|
|
3090
3492
|
|
|
3091
|
-
// node_modules/.pnpm
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
};
|
|
3102
|
-
var replaceClose = (string, close, replace, index) => {
|
|
3103
|
-
let result = "", cursor = 0;
|
|
3104
|
-
do {
|
|
3105
|
-
result += string.substring(cursor, index) + replace;
|
|
3106
|
-
cursor = index + close.length;
|
|
3107
|
-
index = string.indexOf(close, cursor);
|
|
3108
|
-
} while (~index);
|
|
3109
|
-
return result + string.substring(cursor);
|
|
3110
|
-
};
|
|
3111
|
-
var createColors = (enabled = isColorSupported) => {
|
|
3112
|
-
let f2 = enabled ? formatter : () => String;
|
|
3113
|
-
return {
|
|
3114
|
-
isColorSupported: enabled,
|
|
3115
|
-
reset: f2("\x1B[0m", "\x1B[0m"),
|
|
3116
|
-
bold: f2("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
3117
|
-
dim: f2("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
3118
|
-
italic: f2("\x1B[3m", "\x1B[23m"),
|
|
3119
|
-
underline: f2("\x1B[4m", "\x1B[24m"),
|
|
3120
|
-
inverse: f2("\x1B[7m", "\x1B[27m"),
|
|
3121
|
-
hidden: f2("\x1B[8m", "\x1B[28m"),
|
|
3122
|
-
strikethrough: f2("\x1B[9m", "\x1B[29m"),
|
|
3123
|
-
black: f2("\x1B[30m", "\x1B[39m"),
|
|
3124
|
-
red: f2("\x1B[31m", "\x1B[39m"),
|
|
3125
|
-
green: f2("\x1B[32m", "\x1B[39m"),
|
|
3126
|
-
yellow: f2("\x1B[33m", "\x1B[39m"),
|
|
3127
|
-
blue: f2("\x1B[34m", "\x1B[39m"),
|
|
3128
|
-
magenta: f2("\x1B[35m", "\x1B[39m"),
|
|
3129
|
-
cyan: f2("\x1B[36m", "\x1B[39m"),
|
|
3130
|
-
white: f2("\x1B[37m", "\x1B[39m"),
|
|
3131
|
-
gray: f2("\x1B[90m", "\x1B[39m"),
|
|
3132
|
-
bgBlack: f2("\x1B[40m", "\x1B[49m"),
|
|
3133
|
-
bgRed: f2("\x1B[41m", "\x1B[49m"),
|
|
3134
|
-
bgGreen: f2("\x1B[42m", "\x1B[49m"),
|
|
3135
|
-
bgYellow: f2("\x1B[43m", "\x1B[49m"),
|
|
3136
|
-
bgBlue: f2("\x1B[44m", "\x1B[49m"),
|
|
3137
|
-
bgMagenta: f2("\x1B[45m", "\x1B[49m"),
|
|
3138
|
-
bgCyan: f2("\x1B[46m", "\x1B[49m"),
|
|
3139
|
-
bgWhite: f2("\x1B[47m", "\x1B[49m"),
|
|
3140
|
-
blackBright: f2("\x1B[90m", "\x1B[39m"),
|
|
3141
|
-
redBright: f2("\x1B[91m", "\x1B[39m"),
|
|
3142
|
-
greenBright: f2("\x1B[92m", "\x1B[39m"),
|
|
3143
|
-
yellowBright: f2("\x1B[93m", "\x1B[39m"),
|
|
3144
|
-
blueBright: f2("\x1B[94m", "\x1B[39m"),
|
|
3145
|
-
magentaBright: f2("\x1B[95m", "\x1B[39m"),
|
|
3146
|
-
cyanBright: f2("\x1B[96m", "\x1B[39m"),
|
|
3147
|
-
whiteBright: f2("\x1B[97m", "\x1B[39m"),
|
|
3148
|
-
bgBlackBright: f2("\x1B[100m", "\x1B[49m"),
|
|
3149
|
-
bgRedBright: f2("\x1B[101m", "\x1B[49m"),
|
|
3150
|
-
bgGreenBright: f2("\x1B[102m", "\x1B[49m"),
|
|
3151
|
-
bgYellowBright: f2("\x1B[103m", "\x1B[49m"),
|
|
3152
|
-
bgBlueBright: f2("\x1B[104m", "\x1B[49m"),
|
|
3153
|
-
bgMagentaBright: f2("\x1B[105m", "\x1B[49m"),
|
|
3154
|
-
bgCyanBright: f2("\x1B[106m", "\x1B[49m"),
|
|
3155
|
-
bgWhiteBright: f2("\x1B[107m", "\x1B[49m")
|
|
3156
|
-
};
|
|
3157
|
-
};
|
|
3158
|
-
module.exports = createColors();
|
|
3159
|
-
module.exports.createColors = createColors;
|
|
3160
|
-
}
|
|
3161
|
-
});
|
|
3162
|
-
|
|
3163
|
-
// node_modules/.pnpm/@clack+core@0.4.1/node_modules/@clack/core/dist/index.mjs
|
|
3164
|
-
import { stdin as $, stdout as j } from "node:process";
|
|
3165
|
-
import * as f from "node:readline";
|
|
3166
|
-
import M from "node:readline";
|
|
3167
|
-
import { WriteStream as U } from "node:tty";
|
|
3168
|
-
function J({ onlyFirst: t = false } = {}) {
|
|
3169
|
-
const F = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
3170
|
-
return new RegExp(F, t ? void 0 : "g");
|
|
3171
|
-
}
|
|
3172
|
-
function T(t) {
|
|
3173
|
-
if (typeof t != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
|
|
3174
|
-
return t.replace(Q, "");
|
|
3175
|
-
}
|
|
3176
|
-
function O(t) {
|
|
3177
|
-
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
3178
|
-
}
|
|
3179
|
-
function A(t, u2 = {}) {
|
|
3180
|
-
if (typeof t != "string" || t.length === 0 || (u2 = { ambiguousIsNarrow: true, ...u2 }, t = T(t), t.length === 0)) return 0;
|
|
3181
|
-
t = t.replace(FD(), " ");
|
|
3182
|
-
const F = u2.ambiguousIsNarrow ? 1 : 2;
|
|
3183
|
-
let e2 = 0;
|
|
3184
|
-
for (const s of t) {
|
|
3185
|
-
const i = s.codePointAt(0);
|
|
3186
|
-
if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879) continue;
|
|
3187
|
-
switch (DD.eastAsianWidth(s)) {
|
|
3188
|
-
case "F":
|
|
3189
|
-
case "W":
|
|
3190
|
-
e2 += 2;
|
|
3191
|
-
break;
|
|
3192
|
-
case "A":
|
|
3193
|
-
e2 += F;
|
|
3194
|
-
break;
|
|
3195
|
-
default:
|
|
3196
|
-
e2 += 1;
|
|
3197
|
-
}
|
|
3198
|
-
}
|
|
3199
|
-
return e2;
|
|
3493
|
+
// node_modules/.pnpm/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs
|
|
3494
|
+
import { styleText as y } from "node:util";
|
|
3495
|
+
import { stdout as S, stdin as $ } from "node:process";
|
|
3496
|
+
import * as _ from "node:readline";
|
|
3497
|
+
import P from "node:readline";
|
|
3498
|
+
import { ReadStream as D } from "node:tty";
|
|
3499
|
+
function d(r, t2, e) {
|
|
3500
|
+
if (!e.some((o) => !o.disabled)) return r;
|
|
3501
|
+
const s = r + t2, i = Math.max(e.length - 1, 0), n = s < 0 ? i : s > i ? 0 : s;
|
|
3502
|
+
return e[n].disabled ? d(n, t2 < 0 ? -1 : 1, e) : n;
|
|
3200
3503
|
}
|
|
3201
|
-
function
|
|
3202
|
-
|
|
3203
|
-
for (const
|
|
3204
|
-
for (const [e2, s] of Object.entries(F)) r[e2] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, F[e2] = r[e2], t.set(s[0], s[1]);
|
|
3205
|
-
Object.defineProperty(r, u2, { value: F, enumerable: false });
|
|
3206
|
-
}
|
|
3207
|
-
return Object.defineProperty(r, "codes", { value: t, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = L(), r.color.ansi256 = N(), r.color.ansi16m = I(), r.bgColor.ansi = L(m), r.bgColor.ansi256 = N(m), r.bgColor.ansi16m = I(m), Object.defineProperties(r, { rgbToAnsi256: { value: (u2, F, e2) => u2 === F && F === e2 ? u2 < 8 ? 16 : u2 > 248 ? 231 : Math.round((u2 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u2 / 255 * 5) + 6 * Math.round(F / 255 * 5) + Math.round(e2 / 255 * 5), enumerable: false }, hexToRgb: { value: (u2) => {
|
|
3208
|
-
const F = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u2.toString(16));
|
|
3209
|
-
if (!F) return [0, 0, 0];
|
|
3210
|
-
let [e2] = F;
|
|
3211
|
-
e2.length === 3 && (e2 = [...e2].map((i) => i + i).join(""));
|
|
3212
|
-
const s = Number.parseInt(e2, 16);
|
|
3213
|
-
return [s >> 16 & 255, s >> 8 & 255, s & 255];
|
|
3214
|
-
}, enumerable: false }, hexToAnsi256: { value: (u2) => r.rgbToAnsi256(...r.hexToRgb(u2)), enumerable: false }, ansi256ToAnsi: { value: (u2) => {
|
|
3215
|
-
if (u2 < 8) return 30 + u2;
|
|
3216
|
-
if (u2 < 16) return 90 + (u2 - 8);
|
|
3217
|
-
let F, e2, s;
|
|
3218
|
-
if (u2 >= 232) F = ((u2 - 232) * 10 + 8) / 255, e2 = F, s = F;
|
|
3219
|
-
else {
|
|
3220
|
-
u2 -= 16;
|
|
3221
|
-
const C = u2 % 36;
|
|
3222
|
-
F = Math.floor(u2 / 36) / 5, e2 = Math.floor(C / 6) / 5, s = C % 6 / 5;
|
|
3223
|
-
}
|
|
3224
|
-
const i = Math.max(F, e2, s) * 2;
|
|
3225
|
-
if (i === 0) return 30;
|
|
3226
|
-
let D = 30 + (Math.round(s) << 2 | Math.round(e2) << 1 | Math.round(F));
|
|
3227
|
-
return i === 2 && (D += 60), D;
|
|
3228
|
-
}, enumerable: false }, rgbToAnsi: { value: (u2, F, e2) => r.ansi256ToAnsi(r.rgbToAnsi256(u2, F, e2)), enumerable: false }, hexToAnsi: { value: (u2) => r.ansi256ToAnsi(r.hexToAnsi256(u2)), enumerable: false } }), r;
|
|
3229
|
-
}
|
|
3230
|
-
function G(t, u2, F) {
|
|
3231
|
-
return String(t).normalize().replace(/\r\n/g, `
|
|
3232
|
-
`).split(`
|
|
3233
|
-
`).map((e2) => oD(e2, u2, F)).join(`
|
|
3234
|
-
`);
|
|
3235
|
-
}
|
|
3236
|
-
function k(t, u2) {
|
|
3237
|
-
if (typeof t == "string") return c.aliases.get(t) === u2;
|
|
3238
|
-
for (const F of t) if (F !== void 0 && k(F, u2)) return true;
|
|
3504
|
+
function V(r, t2) {
|
|
3505
|
+
if (typeof r == "string") return u.aliases.get(r) === t2;
|
|
3506
|
+
for (const e of r) if (e !== void 0 && V(e, t2)) return true;
|
|
3239
3507
|
return false;
|
|
3240
3508
|
}
|
|
3241
|
-
function
|
|
3242
|
-
if (
|
|
3243
|
-
const
|
|
3244
|
-
`),
|
|
3245
|
-
`), s = [];
|
|
3246
|
-
for (let
|
|
3247
|
-
return s;
|
|
3509
|
+
function j(r, t2) {
|
|
3510
|
+
if (r === t2) return;
|
|
3511
|
+
const e = r.split(`
|
|
3512
|
+
`), s = t2.split(`
|
|
3513
|
+
`), i = Math.max(e.length, s.length), n = [];
|
|
3514
|
+
for (let o = 0; o < i; o++) e[o] !== s[o] && n.push(o);
|
|
3515
|
+
return { lines: n, numLinesBefore: e.length, numLinesAfter: s.length, numLines: i };
|
|
3248
3516
|
}
|
|
3249
|
-
function
|
|
3250
|
-
return
|
|
3517
|
+
function q(r) {
|
|
3518
|
+
return r === C;
|
|
3251
3519
|
}
|
|
3252
|
-
function
|
|
3253
|
-
const
|
|
3254
|
-
|
|
3520
|
+
function w(r, t2) {
|
|
3521
|
+
const e = r;
|
|
3522
|
+
e.isTTY && e.setRawMode(t2);
|
|
3255
3523
|
}
|
|
3256
|
-
function
|
|
3257
|
-
const
|
|
3258
|
-
|
|
3259
|
-
const
|
|
3260
|
-
const
|
|
3261
|
-
if (
|
|
3262
|
-
|
|
3524
|
+
function z({ input: r = $, output: t2 = S, overwrite: e = true, hideCursor: s = true } = {}) {
|
|
3525
|
+
const i = _.createInterface({ input: r, output: t2, prompt: "", tabSize: 1 });
|
|
3526
|
+
_.emitKeypressEvents(r, i), r instanceof D && r.isTTY && r.setRawMode(true);
|
|
3527
|
+
const n = (o, { name: a, sequence: h }) => {
|
|
3528
|
+
const l = String(o);
|
|
3529
|
+
if (V([l, a, h], "cancel")) {
|
|
3530
|
+
s && t2.write(import_sisteransi.cursor.show), process.exit(0);
|
|
3263
3531
|
return;
|
|
3264
3532
|
}
|
|
3265
|
-
if (!
|
|
3266
|
-
const
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3533
|
+
if (!e) return;
|
|
3534
|
+
const f = a === "return" ? 0 : -1, v = a === "return" ? -1 : 0;
|
|
3535
|
+
_.moveCursor(t2, f, v, () => {
|
|
3536
|
+
_.clearLine(t2, 1, () => {
|
|
3537
|
+
r.once("keypress", n);
|
|
3270
3538
|
});
|
|
3271
3539
|
});
|
|
3272
3540
|
};
|
|
3273
|
-
return
|
|
3274
|
-
|
|
3541
|
+
return s && t2.write(import_sisteransi.cursor.hide), r.once("keypress", n), () => {
|
|
3542
|
+
r.off("keypress", n), s && t2.write(import_sisteransi.cursor.show), r instanceof D && r.isTTY && !Y && r.setRawMode(false), i.terminal = false, i.close();
|
|
3275
3543
|
};
|
|
3276
3544
|
}
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3545
|
+
function R(r, t2, e, s = e) {
|
|
3546
|
+
const i = O(r ?? S);
|
|
3547
|
+
return wrapAnsi(t2, i - e.length, { hard: true, trim: false }).split(`
|
|
3548
|
+
`).map((n, o) => `${o === 0 ? s : e}${n}`).join(`
|
|
3549
|
+
`);
|
|
3550
|
+
}
|
|
3551
|
+
var import_sisteransi, E, G, u, Y, C, O, A, p, Q, nt, at;
|
|
3552
|
+
var init_dist3 = __esm({
|
|
3553
|
+
"node_modules/.pnpm/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs"() {
|
|
3554
|
+
init_main();
|
|
3280
3555
|
import_sisteransi = __toESM(require_src(), 1);
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
(
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
}
|
|
3307
|
-
return D;
|
|
3308
|
-
};
|
|
3309
|
-
})(P);
|
|
3310
|
-
X = P.exports;
|
|
3311
|
-
DD = O(X);
|
|
3312
|
-
uD = function() {
|
|
3313
|
-
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
|
|
3314
|
-
};
|
|
3315
|
-
FD = O(uD);
|
|
3316
|
-
m = 10;
|
|
3317
|
-
L = (t = 0) => (u2) => `\x1B[${u2 + t}m`;
|
|
3318
|
-
N = (t = 0) => (u2) => `\x1B[${38 + t};5;${u2}m`;
|
|
3319
|
-
I = (t = 0) => (u2, F, e2) => `\x1B[${38 + t};2;${u2};${F};${e2}m`;
|
|
3320
|
-
r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
|
|
3321
|
-
Object.keys(r.modifier);
|
|
3322
|
-
tD = Object.keys(r.color);
|
|
3323
|
-
eD = Object.keys(r.bgColor);
|
|
3324
|
-
[...tD, ...eD];
|
|
3325
|
-
iD = sD();
|
|
3326
|
-
v = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
|
|
3327
|
-
CD = 39;
|
|
3328
|
-
w = "\x07";
|
|
3329
|
-
W = "[";
|
|
3330
|
-
rD = "]";
|
|
3331
|
-
R = "m";
|
|
3332
|
-
y = `${rD}8;;`;
|
|
3333
|
-
V = (t) => `${v.values().next().value}${W}${t}${R}`;
|
|
3334
|
-
z = (t) => `${v.values().next().value}${y}${t}${w}`;
|
|
3335
|
-
ED = (t) => t.split(" ").map((u2) => A(u2));
|
|
3336
|
-
_ = (t, u2, F) => {
|
|
3337
|
-
const e2 = [...u2];
|
|
3338
|
-
let s = false, i = false, D = A(T(t[t.length - 1]));
|
|
3339
|
-
for (const [C, o] of e2.entries()) {
|
|
3340
|
-
const E2 = A(o);
|
|
3341
|
-
if (D + E2 <= F ? t[t.length - 1] += o : (t.push(o), D = 0), v.has(o) && (s = true, i = e2.slice(C + 1).join("").startsWith(y)), s) {
|
|
3342
|
-
i ? o === w && (s = false, i = false) : o === R && (s = false);
|
|
3343
|
-
continue;
|
|
3344
|
-
}
|
|
3345
|
-
D += E2, D === F && C < e2.length - 1 && (t.push(""), D = 0);
|
|
3346
|
-
}
|
|
3347
|
-
!D && t[t.length - 1].length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
|
|
3348
|
-
};
|
|
3349
|
-
nD = (t) => {
|
|
3350
|
-
const u2 = t.split(" ");
|
|
3351
|
-
let F = u2.length;
|
|
3352
|
-
for (; F > 0 && !(A(u2[F - 1]) > 0); ) F--;
|
|
3353
|
-
return F === u2.length ? t : u2.slice(0, F).join(" ") + u2.slice(F).join("");
|
|
3354
|
-
};
|
|
3355
|
-
oD = (t, u2, F = {}) => {
|
|
3356
|
-
if (F.trim !== false && t.trim() === "") return "";
|
|
3357
|
-
let e2 = "", s, i;
|
|
3358
|
-
const D = ED(t);
|
|
3359
|
-
let C = [""];
|
|
3360
|
-
for (const [E2, a2] of t.split(" ").entries()) {
|
|
3361
|
-
F.trim !== false && (C[C.length - 1] = C[C.length - 1].trimStart());
|
|
3362
|
-
let n = A(C[C.length - 1]);
|
|
3363
|
-
if (E2 !== 0 && (n >= u2 && (F.wordWrap === false || F.trim === false) && (C.push(""), n = 0), (n > 0 || F.trim === false) && (C[C.length - 1] += " ", n++)), F.hard && D[E2] > u2) {
|
|
3364
|
-
const B2 = u2 - n, p2 = 1 + Math.floor((D[E2] - B2 - 1) / u2);
|
|
3365
|
-
Math.floor((D[E2] - 1) / u2) < p2 && C.push(""), _(C, a2, u2);
|
|
3366
|
-
continue;
|
|
3367
|
-
}
|
|
3368
|
-
if (n + D[E2] > u2 && n > 0 && D[E2] > 0) {
|
|
3369
|
-
if (F.wordWrap === false && n < u2) {
|
|
3370
|
-
_(C, a2, u2);
|
|
3371
|
-
continue;
|
|
3372
|
-
}
|
|
3373
|
-
C.push("");
|
|
3374
|
-
}
|
|
3375
|
-
if (n + D[E2] > u2 && F.wordWrap === false) {
|
|
3376
|
-
_(C, a2, u2);
|
|
3377
|
-
continue;
|
|
3378
|
-
}
|
|
3379
|
-
C[C.length - 1] += a2;
|
|
3380
|
-
}
|
|
3381
|
-
F.trim !== false && (C = C.map((E2) => nD(E2)));
|
|
3382
|
-
const o = [...C.join(`
|
|
3383
|
-
`)];
|
|
3384
|
-
for (const [E2, a2] of o.entries()) {
|
|
3385
|
-
if (e2 += a2, v.has(a2)) {
|
|
3386
|
-
const { groups: B2 } = new RegExp(`(?:\\${W}(?<code>\\d+)m|\\${y}(?<uri>.*)${w})`).exec(o.slice(E2).join("")) || { groups: {} };
|
|
3387
|
-
if (B2.code !== void 0) {
|
|
3388
|
-
const p2 = Number.parseFloat(B2.code);
|
|
3389
|
-
s = p2 === CD ? void 0 : p2;
|
|
3390
|
-
} else B2.uri !== void 0 && (i = B2.uri.length === 0 ? void 0 : B2.uri);
|
|
3391
|
-
}
|
|
3392
|
-
const n = iD.codes.get(Number(s));
|
|
3393
|
-
o[E2 + 1] === `
|
|
3394
|
-
` ? (i && (e2 += z("")), s && n && (e2 += V(n))) : a2 === `
|
|
3395
|
-
` && (s && n && (e2 += V(s)), i && (e2 += z(i)));
|
|
3396
|
-
}
|
|
3397
|
-
return e2;
|
|
3398
|
-
};
|
|
3399
|
-
aD = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
3400
|
-
c = { actions: new Set(aD), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]) };
|
|
3401
|
-
xD = globalThis.process.platform.startsWith("win");
|
|
3402
|
-
S = Symbol("clack:cancel");
|
|
3403
|
-
AD = Object.defineProperty;
|
|
3404
|
-
pD = (t, u2, F) => u2 in t ? AD(t, u2, { enumerable: true, configurable: true, writable: true, value: F }) : t[u2] = F;
|
|
3405
|
-
h = (t, u2, F) => (pD(t, typeof u2 != "symbol" ? u2 + "" : u2, F), F);
|
|
3406
|
-
x = class {
|
|
3407
|
-
constructor(u2, F = true) {
|
|
3408
|
-
h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", false), h(this, "_prevFrame", ""), h(this, "_subscribers", /* @__PURE__ */ new Map()), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
|
|
3409
|
-
const { input: e2 = $, output: s = j, render: i, signal: D, ...C } = u2;
|
|
3410
|
-
this.opts = C, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i.bind(this), this._track = F, this._abortSignal = D, this.input = e2, this.output = s;
|
|
3556
|
+
E = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
3557
|
+
G = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
3558
|
+
u = { actions: new Set(E), 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: [...G], messages: { required: "Please enter a valid date", invalidMonth: "There are only 12 months in a year", invalidDay: (r, t2) => `There are only ${r} days in ${t2}`, 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)}` } } };
|
|
3559
|
+
Y = globalThis.process.platform.startsWith("win");
|
|
3560
|
+
C = Symbol("clack:cancel");
|
|
3561
|
+
O = (r) => "columns" in r && typeof r.columns == "number" ? r.columns : 80;
|
|
3562
|
+
A = (r) => "rows" in r && typeof r.rows == "number" ? r.rows : 20;
|
|
3563
|
+
p = class {
|
|
3564
|
+
input;
|
|
3565
|
+
output;
|
|
3566
|
+
_abortSignal;
|
|
3567
|
+
rl;
|
|
3568
|
+
opts;
|
|
3569
|
+
_render;
|
|
3570
|
+
_track = false;
|
|
3571
|
+
_prevFrame = "";
|
|
3572
|
+
_subscribers = /* @__PURE__ */ new Map();
|
|
3573
|
+
_cursor = 0;
|
|
3574
|
+
state = "initial";
|
|
3575
|
+
error = "";
|
|
3576
|
+
value;
|
|
3577
|
+
userInput = "";
|
|
3578
|
+
constructor(t2, e = true) {
|
|
3579
|
+
const { input: s = $, output: i = S, render: n, signal: o, ...a } = t2;
|
|
3580
|
+
this.opts = a, 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 = e, this._abortSignal = o, this.input = s, this.output = i;
|
|
3411
3581
|
}
|
|
3412
3582
|
unsubscribe() {
|
|
3413
3583
|
this._subscribers.clear();
|
|
3414
3584
|
}
|
|
3415
|
-
setSubscriber(
|
|
3416
|
-
const
|
|
3417
|
-
|
|
3585
|
+
setSubscriber(t2, e) {
|
|
3586
|
+
const s = this._subscribers.get(t2) ?? [];
|
|
3587
|
+
s.push(e), this._subscribers.set(t2, s);
|
|
3418
3588
|
}
|
|
3419
|
-
on(
|
|
3420
|
-
this.setSubscriber(
|
|
3589
|
+
on(t2, e) {
|
|
3590
|
+
this.setSubscriber(t2, { cb: e });
|
|
3421
3591
|
}
|
|
3422
|
-
once(
|
|
3423
|
-
this.setSubscriber(
|
|
3592
|
+
once(t2, e) {
|
|
3593
|
+
this.setSubscriber(t2, { cb: e, once: true });
|
|
3424
3594
|
}
|
|
3425
|
-
emit(
|
|
3426
|
-
const
|
|
3427
|
-
for (const
|
|
3428
|
-
for (const
|
|
3595
|
+
emit(t2, ...e) {
|
|
3596
|
+
const s = this._subscribers.get(t2) ?? [], i = [];
|
|
3597
|
+
for (const n of s) n.cb(...e), n.once && i.push(() => s.splice(s.indexOf(n), 1));
|
|
3598
|
+
for (const n of i) n();
|
|
3429
3599
|
}
|
|
3430
3600
|
prompt() {
|
|
3431
|
-
return new Promise((
|
|
3601
|
+
return new Promise((t2) => {
|
|
3432
3602
|
if (this._abortSignal) {
|
|
3433
|
-
if (this._abortSignal.aborted) return this.state = "cancel", this.close(),
|
|
3603
|
+
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t2(C);
|
|
3434
3604
|
this._abortSignal.addEventListener("abort", () => {
|
|
3435
3605
|
this.state = "cancel", this.close();
|
|
3436
3606
|
}, { once: true });
|
|
3437
3607
|
}
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D();
|
|
3441
|
-
}, this.input.pipe(e2), this.rl = M.createInterface({ input: this.input, output: e2, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), M.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), d(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
3442
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), d(this.input, false), u2(this.value);
|
|
3608
|
+
this.rl = P.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", () => {
|
|
3609
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t2(this.value);
|
|
3443
3610
|
}), this.once("cancel", () => {
|
|
3444
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render),
|
|
3611
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t2(C);
|
|
3445
3612
|
});
|
|
3446
3613
|
});
|
|
3447
3614
|
}
|
|
3448
|
-
|
|
3449
|
-
|
|
3615
|
+
_isActionKey(t2, e) {
|
|
3616
|
+
return t2 === " ";
|
|
3617
|
+
}
|
|
3618
|
+
_setValue(t2) {
|
|
3619
|
+
this.value = t2, this.emit("value", this.value);
|
|
3620
|
+
}
|
|
3621
|
+
_setUserInput(t2, e) {
|
|
3622
|
+
this.userInput = t2 ?? "", this.emit("userInput", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
|
|
3623
|
+
}
|
|
3624
|
+
_clearUserInput() {
|
|
3625
|
+
this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
|
|
3626
|
+
}
|
|
3627
|
+
onKeypress(t2, e) {
|
|
3628
|
+
if (this._track && e.name !== "return" && (e.name && this._isActionKey(t2, e) && 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"), e?.name && (!this._track && u.aliases.has(e.name) && this.emit("cursor", u.aliases.get(e.name)), u.actions.has(e.name) && this.emit("cursor", e.name)), t2 && (t2.toLowerCase() === "y" || t2.toLowerCase() === "n") && this.emit("confirm", t2.toLowerCase() === "y"), this.emit("key", t2?.toLowerCase(), e), e?.name === "return") {
|
|
3450
3629
|
if (this.opts.validate) {
|
|
3451
|
-
const
|
|
3452
|
-
|
|
3630
|
+
const s = this.opts.validate(this.value);
|
|
3631
|
+
s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
|
|
3453
3632
|
}
|
|
3454
3633
|
this.state !== "error" && (this.state = "submit");
|
|
3455
3634
|
}
|
|
3456
|
-
|
|
3635
|
+
V([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
3457
3636
|
}
|
|
3458
3637
|
close() {
|
|
3459
3638
|
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
3460
|
-
`),
|
|
3639
|
+
`), w(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
3461
3640
|
}
|
|
3462
3641
|
restoreCursor() {
|
|
3463
|
-
const
|
|
3642
|
+
const t2 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
|
|
3464
3643
|
`).length - 1;
|
|
3465
|
-
this.output.write(import_sisteransi.cursor.move(-999,
|
|
3644
|
+
this.output.write(import_sisteransi.cursor.move(-999, t2 * -1));
|
|
3466
3645
|
}
|
|
3467
3646
|
render() {
|
|
3468
|
-
const
|
|
3469
|
-
if (
|
|
3647
|
+
const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, { hard: true, trim: false });
|
|
3648
|
+
if (t2 !== this._prevFrame) {
|
|
3470
3649
|
if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
|
|
3471
3650
|
else {
|
|
3472
|
-
const
|
|
3473
|
-
if (this.restoreCursor(),
|
|
3474
|
-
const
|
|
3475
|
-
|
|
3476
|
-
|
|
3651
|
+
const e = j(this._prevFrame, t2), s = A(this.output);
|
|
3652
|
+
if (this.restoreCursor(), e) {
|
|
3653
|
+
const i = Math.max(0, e.numLinesAfter - s), n = Math.max(0, e.numLinesBefore - s);
|
|
3654
|
+
let o = e.lines.find((a) => a >= i);
|
|
3655
|
+
if (o === void 0) {
|
|
3656
|
+
this._prevFrame = t2;
|
|
3657
|
+
return;
|
|
3658
|
+
}
|
|
3659
|
+
if (e.lines.length === 1) {
|
|
3660
|
+
this.output.write(import_sisteransi.cursor.move(0, o - n)), this.output.write(import_sisteransi.erase.lines(1));
|
|
3661
|
+
const a = t2.split(`
|
|
3477
3662
|
`);
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3663
|
+
this.output.write(a[o]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, a.length - o - 1));
|
|
3664
|
+
return;
|
|
3665
|
+
} else if (e.lines.length > 1) {
|
|
3666
|
+
if (i < n) o = i;
|
|
3667
|
+
else {
|
|
3668
|
+
const h = o - n;
|
|
3669
|
+
h > 0 && this.output.write(import_sisteransi.cursor.move(0, h));
|
|
3670
|
+
}
|
|
3671
|
+
this.output.write(import_sisteransi.erase.down());
|
|
3672
|
+
const a = t2.split(`
|
|
3673
|
+
`).slice(o);
|
|
3674
|
+
this.output.write(a.join(`
|
|
3675
|
+
`)), this._prevFrame = t2;
|
|
3676
|
+
return;
|
|
3677
|
+
}
|
|
3489
3678
|
}
|
|
3490
3679
|
this.output.write(import_sisteransi.erase.down());
|
|
3491
3680
|
}
|
|
3492
|
-
this.output.write(
|
|
3681
|
+
this.output.write(t2), this.state === "initial" && (this.state = "active"), this._prevFrame = t2;
|
|
3493
3682
|
}
|
|
3494
3683
|
}
|
|
3495
3684
|
};
|
|
3496
|
-
|
|
3685
|
+
Q = class extends p {
|
|
3497
3686
|
get cursor() {
|
|
3498
3687
|
return this.value ? 0 : 1;
|
|
3499
3688
|
}
|
|
3500
3689
|
get _value() {
|
|
3501
3690
|
return this.cursor === 0;
|
|
3502
3691
|
}
|
|
3503
|
-
constructor(
|
|
3504
|
-
super(
|
|
3692
|
+
constructor(t2) {
|
|
3693
|
+
super(t2, false), this.value = !!t2.initialValue, this.on("userInput", () => {
|
|
3505
3694
|
this.value = this._value;
|
|
3506
|
-
}), this.on("confirm", (
|
|
3507
|
-
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value =
|
|
3695
|
+
}), this.on("confirm", (e) => {
|
|
3696
|
+
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = e, this.state = "submit", this.close();
|
|
3508
3697
|
}), this.on("cursor", () => {
|
|
3509
3698
|
this.value = !this.value;
|
|
3510
3699
|
});
|
|
3511
3700
|
}
|
|
3512
3701
|
};
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3702
|
+
nt = class extends p {
|
|
3703
|
+
options;
|
|
3704
|
+
cursor = 0;
|
|
3705
|
+
get _selectedValue() {
|
|
3706
|
+
return this.options[this.cursor];
|
|
3707
|
+
}
|
|
3708
|
+
changeValue() {
|
|
3709
|
+
this.value = this._selectedValue.value;
|
|
3710
|
+
}
|
|
3711
|
+
constructor(t2) {
|
|
3712
|
+
super(t2, false), this.options = t2.options;
|
|
3713
|
+
const e = this.options.findIndex(({ value: i }) => i === t2.initialValue), s = e === -1 ? 0 : e;
|
|
3714
|
+
this.cursor = this.options[s].disabled ? d(s, 1, this.options) : s, this.changeValue(), this.on("cursor", (i) => {
|
|
3715
|
+
switch (i) {
|
|
3520
3716
|
case "left":
|
|
3521
3717
|
case "up":
|
|
3522
|
-
this.cursor = this.cursor
|
|
3718
|
+
this.cursor = d(this.cursor, -1, this.options);
|
|
3523
3719
|
break;
|
|
3524
3720
|
case "down":
|
|
3525
3721
|
case "right":
|
|
3526
|
-
this.cursor = this.cursor
|
|
3722
|
+
this.cursor = d(this.cursor, 1, this.options);
|
|
3527
3723
|
break;
|
|
3528
3724
|
}
|
|
3529
3725
|
this.changeValue();
|
|
3530
3726
|
});
|
|
3531
3727
|
}
|
|
3532
|
-
get _value() {
|
|
3533
|
-
return this.options[this.cursor];
|
|
3534
|
-
}
|
|
3535
|
-
changeValue() {
|
|
3536
|
-
this.value = this._value.value;
|
|
3537
|
-
}
|
|
3538
3728
|
};
|
|
3539
|
-
|
|
3540
|
-
get
|
|
3541
|
-
if (this.state === "submit") return this.
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3729
|
+
at = class extends p {
|
|
3730
|
+
get userInputWithCursor() {
|
|
3731
|
+
if (this.state === "submit") return this.userInput;
|
|
3732
|
+
const t2 = this.userInput;
|
|
3733
|
+
if (this.cursor >= t2.length) return `${this.userInput}\u2588`;
|
|
3734
|
+
const e = t2.slice(0, this.cursor), [s, ...i] = t2.slice(this.cursor);
|
|
3735
|
+
return `${e}${y("inverse", s)}${i.join("")}`;
|
|
3545
3736
|
}
|
|
3546
3737
|
get cursor() {
|
|
3547
3738
|
return this._cursor;
|
|
3548
3739
|
}
|
|
3549
|
-
constructor(
|
|
3550
|
-
super(
|
|
3551
|
-
this.
|
|
3740
|
+
constructor(t2) {
|
|
3741
|
+
super({ ...t2, initialUserInput: t2.initialUserInput ?? t2.initialValue }), this.on("userInput", (e) => {
|
|
3742
|
+
this._setValue(e);
|
|
3743
|
+
}), this.on("finalize", () => {
|
|
3744
|
+
this.value || (this.value = t2.defaultValue), this.value === void 0 && (this.value = "");
|
|
3552
3745
|
});
|
|
3553
3746
|
}
|
|
3554
3747
|
};
|
|
3555
3748
|
}
|
|
3556
3749
|
});
|
|
3557
3750
|
|
|
3558
|
-
// node_modules/.pnpm/@clack+prompts@
|
|
3559
|
-
import
|
|
3560
|
-
|
|
3561
|
-
|
|
3751
|
+
// node_modules/.pnpm/@clack+prompts@1.2.0/node_modules/@clack/prompts/dist/index.mjs
|
|
3752
|
+
import { styleText as t, stripVTControlCharacters as ne } from "node:util";
|
|
3753
|
+
import P2 from "node:process";
|
|
3754
|
+
function Ze() {
|
|
3755
|
+
return P2.platform !== "win32" ? P2.env.TERM !== "linux" : !!P2.env.CI || !!P2.env.WT_SESSION || !!P2.env.TERMINUS_SUBLIME || P2.env.ConEmuTask === "{cmd::Cmder}" || P2.env.TERM_PROGRAM === "Terminus-Sublime" || P2.env.TERM_PROGRAM === "vscode" || P2.env.TERM === "xterm-256color" || P2.env.TERM === "alacritty" || P2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
3562
3756
|
}
|
|
3563
|
-
var
|
|
3564
|
-
var
|
|
3565
|
-
"node_modules/.pnpm/@clack+prompts@
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3757
|
+
var import_sisteransi2, ee, ae, w2, _e, oe, ue, F, le, d2, E2, Ie, Ee, z2, H2, te, U, J, xe, se, ce, Ge, $e, de, Oe, he, pe, me, ge, V2, ye, et2, Y2, ot2, O2, pt, mt, gt, Ct, fe, Ve, re, _t, je, Ot;
|
|
3758
|
+
var init_dist4 = __esm({
|
|
3759
|
+
"node_modules/.pnpm/@clack+prompts@1.2.0/node_modules/@clack/prompts/dist/index.mjs"() {
|
|
3760
|
+
init_dist3();
|
|
3761
|
+
init_dist3();
|
|
3762
|
+
init_main();
|
|
3763
|
+
init_dist2();
|
|
3569
3764
|
import_sisteransi2 = __toESM(require_src(), 1);
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3765
|
+
ee = Ze();
|
|
3766
|
+
ae = () => process.env.CI === "true";
|
|
3767
|
+
w2 = (e, i) => ee ? e : i;
|
|
3768
|
+
_e = w2("\u25C6", "*");
|
|
3769
|
+
oe = w2("\u25A0", "x");
|
|
3770
|
+
ue = w2("\u25B2", "x");
|
|
3771
|
+
F = w2("\u25C7", "o");
|
|
3772
|
+
le = w2("\u250C", "T");
|
|
3773
|
+
d2 = w2("\u2502", "|");
|
|
3774
|
+
E2 = w2("\u2514", "\u2014");
|
|
3775
|
+
Ie = w2("\u2510", "T");
|
|
3776
|
+
Ee = w2("\u2518", "\u2014");
|
|
3777
|
+
z2 = w2("\u25CF", ">");
|
|
3778
|
+
H2 = w2("\u25CB", " ");
|
|
3779
|
+
te = w2("\u25FB", "[\u2022]");
|
|
3780
|
+
U = w2("\u25FC", "[+]");
|
|
3781
|
+
J = w2("\u25FB", "[ ]");
|
|
3782
|
+
xe = w2("\u25AA", "\u2022");
|
|
3783
|
+
se = w2("\u2500", "-");
|
|
3784
|
+
ce = w2("\u256E", "+");
|
|
3785
|
+
Ge = w2("\u251C", "+");
|
|
3786
|
+
$e = w2("\u256F", "+");
|
|
3787
|
+
de = w2("\u2570", "+");
|
|
3788
|
+
Oe = w2("\u256D", "+");
|
|
3789
|
+
he = w2("\u25CF", "\u2022");
|
|
3790
|
+
pe = w2("\u25C6", "*");
|
|
3791
|
+
me = w2("\u25B2", "!");
|
|
3792
|
+
ge = w2("\u25A0", "x");
|
|
3793
|
+
V2 = (e) => {
|
|
3794
|
+
switch (e) {
|
|
3595
3795
|
case "initial":
|
|
3596
3796
|
case "active":
|
|
3597
|
-
return
|
|
3797
|
+
return t("cyan", _e);
|
|
3598
3798
|
case "cancel":
|
|
3599
|
-
return
|
|
3799
|
+
return t("red", oe);
|
|
3600
3800
|
case "error":
|
|
3601
|
-
return
|
|
3801
|
+
return t("yellow", ue);
|
|
3602
3802
|
case "submit":
|
|
3603
|
-
return
|
|
3803
|
+
return t("green", F);
|
|
3604
3804
|
}
|
|
3605
3805
|
};
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
return I2 || x2 ? import_picocolors2.default.dim("...") : i(w2, b2 + l2 === n);
|
|
3614
|
-
});
|
|
3615
|
-
};
|
|
3616
|
-
ue = (s) => new PD({ validate: s.validate, placeholder: s.placeholder, defaultValue: s.defaultValue, initialValue: s.initialValue, render() {
|
|
3617
|
-
const n = `${import_picocolors2.default.gray(a)}
|
|
3618
|
-
${y2(this.state)} ${s.message}
|
|
3619
|
-
`, t = s.placeholder ? import_picocolors2.default.inverse(s.placeholder[0]) + import_picocolors2.default.dim(s.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), i = this.value ? this.valueWithCursor : t;
|
|
3620
|
-
switch (this.state) {
|
|
3806
|
+
ye = (e) => {
|
|
3807
|
+
switch (e) {
|
|
3808
|
+
case "initial":
|
|
3809
|
+
case "active":
|
|
3810
|
+
return t("cyan", d2);
|
|
3811
|
+
case "cancel":
|
|
3812
|
+
return t("red", d2);
|
|
3621
3813
|
case "error":
|
|
3622
|
-
return
|
|
3623
|
-
${import_picocolors2.default.yellow(a)} ${i}
|
|
3624
|
-
${import_picocolors2.default.yellow(m2)} ${import_picocolors2.default.yellow(this.error)}
|
|
3625
|
-
`;
|
|
3814
|
+
return t("yellow", d2);
|
|
3626
3815
|
case "submit":
|
|
3627
|
-
return
|
|
3628
|
-
case "cancel":
|
|
3629
|
-
return `${n}${import_picocolors2.default.gray(a)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
|
|
3630
|
-
${import_picocolors2.default.gray(a)}` : ""}`;
|
|
3631
|
-
default:
|
|
3632
|
-
return `${n}${import_picocolors2.default.cyan(a)} ${i}
|
|
3633
|
-
${import_picocolors2.default.cyan(m2)}
|
|
3634
|
-
`;
|
|
3816
|
+
return t("green", d2);
|
|
3635
3817
|
}
|
|
3636
|
-
} }).prompt();
|
|
3637
|
-
me = (s) => {
|
|
3638
|
-
const n = s.active ?? "Yes", t = s.inactive ?? "No";
|
|
3639
|
-
return new fD({ active: n, inactive: t, initialValue: s.initialValue ?? true, render() {
|
|
3640
|
-
const i = `${import_picocolors2.default.gray(a)}
|
|
3641
|
-
${y2(this.state)} ${s.message}
|
|
3642
|
-
`, r2 = this.value ? n : t;
|
|
3643
|
-
switch (this.state) {
|
|
3644
|
-
case "submit":
|
|
3645
|
-
return `${i}${import_picocolors2.default.gray(a)} ${import_picocolors2.default.dim(r2)}`;
|
|
3646
|
-
case "cancel":
|
|
3647
|
-
return `${i}${import_picocolors2.default.gray(a)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(r2))}
|
|
3648
|
-
${import_picocolors2.default.gray(a)}`;
|
|
3649
|
-
default:
|
|
3650
|
-
return `${i}${import_picocolors2.default.cyan(a)} ${this.value ? `${import_picocolors2.default.green(j2)} ${n}` : `${import_picocolors2.default.dim(R2)} ${import_picocolors2.default.dim(n)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(R2)} ${import_picocolors2.default.dim(t)}` : `${import_picocolors2.default.green(j2)} ${t}`}
|
|
3651
|
-
${import_picocolors2.default.cyan(m2)}
|
|
3652
|
-
`;
|
|
3653
|
-
}
|
|
3654
|
-
} }).prompt();
|
|
3655
3818
|
};
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3819
|
+
et2 = (e, i, s, r, u2) => {
|
|
3820
|
+
let n = i, o = 0;
|
|
3821
|
+
for (let c2 = s; c2 < r; c2++) {
|
|
3822
|
+
const a = e[c2];
|
|
3823
|
+
if (n = n - a.length, o++, n <= u2) break;
|
|
3824
|
+
}
|
|
3825
|
+
return { lineCount: n, removals: o };
|
|
3826
|
+
};
|
|
3827
|
+
Y2 = ({ cursor: e, options: i, style: s, output: r = process.stdout, maxItems: u2 = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: o = 4 }) => {
|
|
3828
|
+
const c2 = O(r) - n, a = A(r), l = t("dim", "..."), $2 = Math.max(a - o, 0), y2 = Math.max(Math.min(u2, $2), 5);
|
|
3829
|
+
let p2 = 0;
|
|
3830
|
+
e >= y2 - 3 && (p2 = Math.max(Math.min(e - y2 + 3, i.length - y2), 0));
|
|
3831
|
+
let m = y2 < i.length && p2 > 0, g = y2 < i.length && p2 + y2 < i.length;
|
|
3832
|
+
const S2 = Math.min(p2 + y2, i.length), h = [];
|
|
3833
|
+
let f = 0;
|
|
3834
|
+
m && f++, g && f++;
|
|
3835
|
+
const v = p2 + (m ? 1 : 0), T = S2 - (g ? 1 : 0);
|
|
3836
|
+
for (let b = v; b < T; b++) {
|
|
3837
|
+
const x = wrapAnsi(s(i[b], b === e), c2, { hard: true, trim: false }).split(`
|
|
3838
|
+
`);
|
|
3839
|
+
h.push(x), f += x.length;
|
|
3840
|
+
}
|
|
3841
|
+
if (f > $2) {
|
|
3842
|
+
let b = 0, x = 0, G2 = f;
|
|
3843
|
+
const M2 = e - v, R2 = (j2, D2) => et2(h, G2, j2, D2, $2);
|
|
3844
|
+
m ? ({ lineCount: G2, removals: b } = R2(0, M2), G2 > $2 && ({ lineCount: G2, removals: x } = R2(M2 + 1, h.length))) : ({ lineCount: G2, removals: x } = R2(M2 + 1, h.length), G2 > $2 && ({ lineCount: G2, removals: b } = R2(0, M2))), b > 0 && (m = true, h.splice(0, b)), x > 0 && (g = true, h.splice(h.length - x, x));
|
|
3845
|
+
}
|
|
3846
|
+
const C2 = [];
|
|
3847
|
+
m && C2.push(l);
|
|
3848
|
+
for (const b of h) for (const x of b) C2.push(x);
|
|
3849
|
+
return g && C2.push(l), C2;
|
|
3850
|
+
};
|
|
3851
|
+
ot2 = (e) => {
|
|
3852
|
+
const i = e.active ?? "Yes", s = e.inactive ?? "No";
|
|
3853
|
+
return new Q({ active: i, inactive: s, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue ?? true, render() {
|
|
3854
|
+
const r = e.withGuide ?? u.withGuide, u2 = `${V2(this.state)} `, n = r ? `${t("gray", d2)} ` : "", o = R(e.output, e.message, n, u2), c2 = `${r ? `${t("gray", d2)}
|
|
3855
|
+
` : ""}${o}
|
|
3856
|
+
`, a = this.value ? i : s;
|
|
3674
3857
|
switch (this.state) {
|
|
3675
|
-
case "submit":
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
return `${
|
|
3682
|
-
${
|
|
3683
|
-
|
|
3858
|
+
case "submit": {
|
|
3859
|
+
const l = r ? `${t("gray", d2)} ` : "";
|
|
3860
|
+
return `${c2}${l}${t("dim", a)}`;
|
|
3861
|
+
}
|
|
3862
|
+
case "cancel": {
|
|
3863
|
+
const l = r ? `${t("gray", d2)} ` : "";
|
|
3864
|
+
return `${c2}${l}${t(["strikethrough", "dim"], a)}${r ? `
|
|
3865
|
+
${t("gray", d2)}` : ""}`;
|
|
3866
|
+
}
|
|
3867
|
+
default: {
|
|
3868
|
+
const l = r ? `${t("cyan", d2)} ` : "", $2 = r ? t("cyan", E2) : "";
|
|
3869
|
+
return `${c2}${l}${this.value ? `${t("green", z2)} ${i}` : `${t("dim", H2)} ${t("dim", i)}`}${e.vertical ? r ? `
|
|
3870
|
+
${t("cyan", d2)} ` : `
|
|
3871
|
+
` : ` ${t("dim", "/")} `}${this.value ? `${t("dim", H2)} ${t("dim", s)}` : `${t("green", z2)} ${s}`}
|
|
3872
|
+
${$2}
|
|
3684
3873
|
`;
|
|
3874
|
+
}
|
|
3685
3875
|
}
|
|
3686
3876
|
} }).prompt();
|
|
3687
3877
|
};
|
|
3688
|
-
|
|
3689
|
-
|
|
3878
|
+
O2 = { message: (e = [], { symbol: i = t("gray", d2), secondarySymbol: s = t("gray", d2), output: r = process.stdout, spacing: u2 = 1, withGuide: n } = {}) => {
|
|
3879
|
+
const o = [], c2 = n ?? u.withGuide, a = c2 ? s : "", l = c2 ? `${i} ` : "", $2 = c2 ? `${s} ` : "";
|
|
3880
|
+
for (let p2 = 0; p2 < u2; p2++) o.push(a);
|
|
3881
|
+
const y2 = Array.isArray(e) ? e : e.split(`
|
|
3882
|
+
`);
|
|
3883
|
+
if (y2.length > 0) {
|
|
3884
|
+
const [p2, ...m] = y2;
|
|
3885
|
+
p2.length > 0 ? o.push(`${l}${p2}`) : o.push(c2 ? i : "");
|
|
3886
|
+
for (const g of m) g.length > 0 ? o.push(`${$2}${g}`) : o.push(c2 ? s : "");
|
|
3887
|
+
}
|
|
3888
|
+
r.write(`${o.join(`
|
|
3889
|
+
`)}
|
|
3890
|
+
`);
|
|
3891
|
+
}, info: (e, i) => {
|
|
3892
|
+
O2.message(e, { ...i, symbol: t("blue", he) });
|
|
3893
|
+
}, success: (e, i) => {
|
|
3894
|
+
O2.message(e, { ...i, symbol: t("green", pe) });
|
|
3895
|
+
}, step: (e, i) => {
|
|
3896
|
+
O2.message(e, { ...i, symbol: t("green", F) });
|
|
3897
|
+
}, warn: (e, i) => {
|
|
3898
|
+
O2.message(e, { ...i, symbol: t("yellow", me) });
|
|
3899
|
+
}, warning: (e, i) => {
|
|
3900
|
+
O2.warn(e, i);
|
|
3901
|
+
}, error: (e, i) => {
|
|
3902
|
+
O2.message(e, { ...i, symbol: t("red", ge) });
|
|
3903
|
+
} };
|
|
3904
|
+
pt = (e = "", i) => {
|
|
3905
|
+
const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", E2)} ` : "";
|
|
3906
|
+
s.write(`${r}${t("red", e)}
|
|
3690
3907
|
|
|
3691
3908
|
`);
|
|
3692
3909
|
};
|
|
3693
|
-
|
|
3694
|
-
process.stdout.
|
|
3910
|
+
mt = (e = "", i) => {
|
|
3911
|
+
const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", le)} ` : "";
|
|
3912
|
+
s.write(`${r}${e}
|
|
3695
3913
|
`);
|
|
3696
3914
|
};
|
|
3697
|
-
|
|
3698
|
-
process.stdout.
|
|
3699
|
-
${
|
|
3915
|
+
gt = (e = "", i) => {
|
|
3916
|
+
const s = i?.output ?? process.stdout, r = i?.withGuide ?? u.withGuide ? `${t("gray", d2)}
|
|
3917
|
+
${t("gray", E2)} ` : "";
|
|
3918
|
+
s.write(`${r}${e}
|
|
3700
3919
|
|
|
3701
3920
|
`);
|
|
3702
3921
|
};
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
}, step: (s) => {
|
|
3718
|
-
v2.message(s, { symbol: import_picocolors2.default.green(S2) });
|
|
3719
|
-
}, warn: (s) => {
|
|
3720
|
-
v2.message(s, { symbol: import_picocolors2.default.yellow(ce) });
|
|
3721
|
-
}, warning: (s) => {
|
|
3722
|
-
v2.warn(s);
|
|
3723
|
-
}, error: (s) => {
|
|
3724
|
-
v2.message(s, { symbol: import_picocolors2.default.red(le) });
|
|
3725
|
-
} };
|
|
3726
|
-
L2 = () => {
|
|
3727
|
-
const s = E ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], n = E ? 80 : 120, t = process.env.CI === "true";
|
|
3728
|
-
let i, r2, c2 = false, o = "", l2;
|
|
3729
|
-
const $2 = (h2) => {
|
|
3730
|
-
const g2 = h2 > 1 ? "Something went wrong" : "Canceled";
|
|
3731
|
-
c2 && P2(g2, h2);
|
|
3732
|
-
}, d2 = () => $2(2), w2 = () => $2(1), b2 = () => {
|
|
3733
|
-
process.on("uncaughtExceptionMonitor", d2), process.on("unhandledRejection", d2), process.on("SIGINT", w2), process.on("SIGTERM", w2), process.on("exit", $2);
|
|
3734
|
-
}, C = () => {
|
|
3735
|
-
process.removeListener("uncaughtExceptionMonitor", d2), process.removeListener("unhandledRejection", d2), process.removeListener("SIGINT", w2), process.removeListener("SIGTERM", w2), process.removeListener("exit", $2);
|
|
3736
|
-
}, I2 = () => {
|
|
3737
|
-
if (l2 === void 0) return;
|
|
3738
|
-
t && process.stdout.write(`
|
|
3922
|
+
Ct = (e) => t("magenta", e);
|
|
3923
|
+
fe = ({ indicator: e = "dots", onCancel: i, output: s = process.stdout, cancelMessage: r, errorMessage: u2, frames: n = ee ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], delay: o = ee ? 80 : 120, signal: c2, ...a } = {}) => {
|
|
3924
|
+
const l = ae();
|
|
3925
|
+
let $2, y2, p2 = false, m = false, g = "", S2, h = performance.now();
|
|
3926
|
+
const f = O(s), v = a?.styleFrame ?? Ct, T = (_2) => {
|
|
3927
|
+
const A2 = _2 > 1 ? u2 ?? u.messages.error : r ?? u.messages.cancel;
|
|
3928
|
+
m = _2 === 1, p2 && (W(A2, _2), m && typeof i == "function" && i());
|
|
3929
|
+
}, C2 = () => T(2), b = () => T(1), x = () => {
|
|
3930
|
+
process.on("uncaughtExceptionMonitor", C2), process.on("unhandledRejection", C2), process.on("SIGINT", b), process.on("SIGTERM", b), process.on("exit", T), c2 && c2.addEventListener("abort", b);
|
|
3931
|
+
}, G2 = () => {
|
|
3932
|
+
process.removeListener("uncaughtExceptionMonitor", C2), process.removeListener("unhandledRejection", C2), process.removeListener("SIGINT", b), process.removeListener("SIGTERM", b), process.removeListener("exit", T), c2 && c2.removeEventListener("abort", b);
|
|
3933
|
+
}, M2 = () => {
|
|
3934
|
+
if (S2 === void 0) return;
|
|
3935
|
+
l && s.write(`
|
|
3739
3936
|
`);
|
|
3740
|
-
const
|
|
3937
|
+
const _2 = wrapAnsi(S2, f, { hard: true, trim: false }).split(`
|
|
3741
3938
|
`);
|
|
3742
|
-
|
|
3743
|
-
},
|
|
3744
|
-
|
|
3939
|
+
_2.length > 1 && s.write(import_sisteransi2.cursor.up(_2.length - 1)), s.write(import_sisteransi2.cursor.to(0)), s.write(import_sisteransi2.erase.down());
|
|
3940
|
+
}, R2 = (_2) => _2.replace(/\.+$/, ""), j2 = (_2) => {
|
|
3941
|
+
const A2 = (performance.now() - _2) / 1e3, k = Math.floor(A2 / 60), L = Math.floor(A2 % 60);
|
|
3942
|
+
return k > 0 ? `[${k}m ${L}s]` : `[${L}s]`;
|
|
3943
|
+
}, D2 = a.withGuide ?? u.withGuide, ie = (_2 = "") => {
|
|
3944
|
+
p2 = true, $2 = z({ output: s }), g = R2(_2), h = performance.now(), D2 && s.write(`${t("gray", d2)}
|
|
3745
3945
|
`);
|
|
3746
|
-
let
|
|
3747
|
-
|
|
3748
|
-
if (
|
|
3749
|
-
|
|
3750
|
-
const
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3946
|
+
let A2 = 0, k = 0;
|
|
3947
|
+
x(), y2 = setInterval(() => {
|
|
3948
|
+
if (l && g === S2) return;
|
|
3949
|
+
M2(), S2 = g;
|
|
3950
|
+
const L = v(n[A2]);
|
|
3951
|
+
let Z;
|
|
3952
|
+
if (l) Z = `${L} ${g}...`;
|
|
3953
|
+
else if (e === "timer") Z = `${L} ${g} ${j2(h)}`;
|
|
3954
|
+
else {
|
|
3955
|
+
const Be = ".".repeat(Math.floor(k)).slice(0, 3);
|
|
3956
|
+
Z = `${L} ${g}${Be}`;
|
|
3957
|
+
}
|
|
3958
|
+
const Ne = wrapAnsi(Z, f, { hard: true, trim: false });
|
|
3959
|
+
s.write(Ne), A2 = A2 + 1 < n.length ? A2 + 1 : 0, k = k < 4 ? k + 0.125 : 0;
|
|
3960
|
+
}, o);
|
|
3961
|
+
}, W = (_2 = "", A2 = 0, k = false) => {
|
|
3962
|
+
if (!p2) return;
|
|
3963
|
+
p2 = false, clearInterval(y2), M2();
|
|
3964
|
+
const L = A2 === 0 ? t("green", F) : A2 === 1 ? t("red", oe) : t("red", ue);
|
|
3965
|
+
g = _2 ?? g, k || (e === "timer" ? s.write(`${L} ${g} ${j2(h)}
|
|
3966
|
+
`) : s.write(`${L} ${g}
|
|
3967
|
+
`)), G2(), $2();
|
|
3758
3968
|
};
|
|
3759
|
-
return { start:
|
|
3760
|
-
|
|
3969
|
+
return { start: ie, stop: (_2 = "") => W(_2, 0), message: (_2 = "") => {
|
|
3970
|
+
g = R2(_2 ?? g);
|
|
3971
|
+
}, cancel: (_2 = "") => W(_2, 1), error: (_2 = "") => W(_2, 2), clear: () => W("", 0, true), get isCancelled() {
|
|
3972
|
+
return m;
|
|
3761
3973
|
} };
|
|
3762
3974
|
};
|
|
3975
|
+
Ve = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
|
|
3976
|
+
re = (e, i) => e.includes(`
|
|
3977
|
+
`) ? e.split(`
|
|
3978
|
+
`).map((s) => i(s)).join(`
|
|
3979
|
+
`) : i(e);
|
|
3980
|
+
_t = (e) => {
|
|
3981
|
+
const i = (s, r) => {
|
|
3982
|
+
const u2 = s.label ?? String(s.value);
|
|
3983
|
+
switch (r) {
|
|
3984
|
+
case "disabled":
|
|
3985
|
+
return `${t("gray", H2)} ${re(u2, (n) => t("gray", n))}${s.hint ? ` ${t("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
|
|
3986
|
+
case "selected":
|
|
3987
|
+
return `${re(u2, (n) => t("dim", n))}`;
|
|
3988
|
+
case "active":
|
|
3989
|
+
return `${t("green", z2)} ${u2}${s.hint ? ` ${t("dim", `(${s.hint})`)}` : ""}`;
|
|
3990
|
+
case "cancelled":
|
|
3991
|
+
return `${re(u2, (n) => t(["strikethrough", "dim"], n))}`;
|
|
3992
|
+
default:
|
|
3993
|
+
return `${t("dim", H2)} ${re(u2, (n) => t("dim", n))}`;
|
|
3994
|
+
}
|
|
3995
|
+
};
|
|
3996
|
+
return new nt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, render() {
|
|
3997
|
+
const s = e.withGuide ?? u.withGuide, r = `${V2(this.state)} `, u2 = `${ye(this.state)} `, n = R(e.output, e.message, u2, r), o = `${s ? `${t("gray", d2)}
|
|
3998
|
+
` : ""}${n}
|
|
3999
|
+
`;
|
|
4000
|
+
switch (this.state) {
|
|
4001
|
+
case "submit": {
|
|
4002
|
+
const c2 = s ? `${t("gray", d2)} ` : "", a = R(e.output, i(this.options[this.cursor], "selected"), c2);
|
|
4003
|
+
return `${o}${a}`;
|
|
4004
|
+
}
|
|
4005
|
+
case "cancel": {
|
|
4006
|
+
const c2 = s ? `${t("gray", d2)} ` : "", a = R(e.output, i(this.options[this.cursor], "cancelled"), c2);
|
|
4007
|
+
return `${o}${a}${s ? `
|
|
4008
|
+
${t("gray", d2)}` : ""}`;
|
|
4009
|
+
}
|
|
4010
|
+
default: {
|
|
4011
|
+
const c2 = s ? `${t("cyan", d2)} ` : "", a = s ? t("cyan", E2) : "", l = o.split(`
|
|
4012
|
+
`).length, $2 = s ? 2 : 1;
|
|
4013
|
+
return `${o}${c2}${Y2({ output: e.output, cursor: this.cursor, options: this.options, maxItems: e.maxItems, columnPadding: c2.length, rowPadding: l + $2, style: (y2, p2) => i(y2, y2.disabled ? "disabled" : p2 ? "active" : "inactive") }).join(`
|
|
4014
|
+
${c2}`)}
|
|
4015
|
+
${a}
|
|
4016
|
+
`;
|
|
4017
|
+
}
|
|
4018
|
+
}
|
|
4019
|
+
} }).prompt();
|
|
4020
|
+
};
|
|
4021
|
+
je = `${t("gray", d2)} `;
|
|
4022
|
+
Ot = (e) => new at({ validate: e.validate, placeholder: e.placeholder, defaultValue: e.defaultValue, initialValue: e.initialValue, output: e.output, signal: e.signal, input: e.input, render() {
|
|
4023
|
+
const i = e?.withGuide ?? u.withGuide, s = `${`${i ? `${t("gray", d2)}
|
|
4024
|
+
` : ""}${V2(this.state)} `}${e.message}
|
|
4025
|
+
`, r = e.placeholder ? t("inverse", e.placeholder[0]) + t("dim", e.placeholder.slice(1)) : t(["inverse", "hidden"], "_"), u2 = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
|
|
4026
|
+
switch (this.state) {
|
|
4027
|
+
case "error": {
|
|
4028
|
+
const o = this.error ? ` ${t("yellow", this.error)}` : "", c2 = i ? `${t("yellow", d2)} ` : "", a = i ? t("yellow", E2) : "";
|
|
4029
|
+
return `${s.trim()}
|
|
4030
|
+
${c2}${u2}
|
|
4031
|
+
${a}${o}
|
|
4032
|
+
`;
|
|
4033
|
+
}
|
|
4034
|
+
case "submit": {
|
|
4035
|
+
const o = n ? ` ${t("dim", n)}` : "", c2 = i ? t("gray", d2) : "";
|
|
4036
|
+
return `${s}${c2}${o}`;
|
|
4037
|
+
}
|
|
4038
|
+
case "cancel": {
|
|
4039
|
+
const o = n ? ` ${t(["strikethrough", "dim"], n)}` : "", c2 = i ? t("gray", d2) : "";
|
|
4040
|
+
return `${s}${c2}${o}${n.trim() ? `
|
|
4041
|
+
${c2}` : ""}`;
|
|
4042
|
+
}
|
|
4043
|
+
default: {
|
|
4044
|
+
const o = i ? `${t("cyan", d2)} ` : "", c2 = i ? t("cyan", E2) : "";
|
|
4045
|
+
return `${s}${o}${u2}
|
|
4046
|
+
${c2}
|
|
4047
|
+
`;
|
|
4048
|
+
}
|
|
4049
|
+
}
|
|
4050
|
+
} }).prompt();
|
|
3763
4051
|
}
|
|
3764
4052
|
});
|
|
3765
4053
|
|
|
@@ -3940,8 +4228,8 @@ var require_XMLHttpRequest = __commonJS({
|
|
|
3940
4228
|
this.responseText = this.response.toString("utf8");
|
|
3941
4229
|
this.status = 200;
|
|
3942
4230
|
setState(self.DONE);
|
|
3943
|
-
} catch (
|
|
3944
|
-
this.handleError(
|
|
4231
|
+
} catch (e) {
|
|
4232
|
+
this.handleError(e, e.errno || -1);
|
|
3945
4233
|
}
|
|
3946
4234
|
}
|
|
3947
4235
|
return;
|
|
@@ -3964,8 +4252,8 @@ var require_XMLHttpRequest = __commonJS({
|
|
|
3964
4252
|
} else if (data) {
|
|
3965
4253
|
headers["Content-Length"] = Buffer.isBuffer(data) ? data.length : Buffer.byteLength(data);
|
|
3966
4254
|
var headersKeys = Object.keys(headers);
|
|
3967
|
-
if (!headersKeys.some(function(
|
|
3968
|
-
return
|
|
4255
|
+
if (!headersKeys.some(function(h) {
|
|
4256
|
+
return h.toLowerCase() === "content-type";
|
|
3969
4257
|
})) {
|
|
3970
4258
|
headers["Content-Type"] = "text/plain;charset=UTF-8";
|
|
3971
4259
|
}
|
|
@@ -4310,16 +4598,16 @@ function concatChunks(chunks, size) {
|
|
|
4310
4598
|
return chunks.shift();
|
|
4311
4599
|
}
|
|
4312
4600
|
const buffer = new Uint8Array(size);
|
|
4313
|
-
let
|
|
4601
|
+
let j2 = 0;
|
|
4314
4602
|
for (let i = 0; i < size; i++) {
|
|
4315
|
-
buffer[i] = chunks[0][
|
|
4316
|
-
if (
|
|
4603
|
+
buffer[i] = chunks[0][j2++];
|
|
4604
|
+
if (j2 === chunks[0].length) {
|
|
4317
4605
|
chunks.shift();
|
|
4318
|
-
|
|
4606
|
+
j2 = 0;
|
|
4319
4607
|
}
|
|
4320
4608
|
}
|
|
4321
|
-
if (chunks.length &&
|
|
4322
|
-
chunks[0] = chunks[0].slice(
|
|
4609
|
+
if (chunks.length && j2 < chunks[0].length) {
|
|
4610
|
+
chunks[0] = chunks[0].slice(j2);
|
|
4323
4611
|
}
|
|
4324
4612
|
return buffer;
|
|
4325
4613
|
}
|
|
@@ -4520,8 +4808,8 @@ function parse(setCookieString) {
|
|
|
4520
4808
|
name,
|
|
4521
4809
|
value: value2
|
|
4522
4810
|
};
|
|
4523
|
-
for (let
|
|
4524
|
-
const subParts = parts2[
|
|
4811
|
+
for (let j2 = 1; j2 < parts2.length; j2++) {
|
|
4812
|
+
const subParts = parts2[j2].split("=");
|
|
4525
4813
|
if (subParts.length !== 2) {
|
|
4526
4814
|
continue;
|
|
4527
4815
|
}
|
|
@@ -4593,9 +4881,9 @@ var init_globals_node = __esm({
|
|
|
4593
4881
|
|
|
4594
4882
|
// node_modules/.pnpm/engine.io-client@6.6.4/node_modules/engine.io-client/build/esm-debug/util.js
|
|
4595
4883
|
function pick(obj, ...attr) {
|
|
4596
|
-
return attr.reduce((acc,
|
|
4597
|
-
if (obj.hasOwnProperty(
|
|
4598
|
-
acc[
|
|
4884
|
+
return attr.reduce((acc, k) => {
|
|
4885
|
+
if (obj.hasOwnProperty(k)) {
|
|
4886
|
+
acc[k] = obj[k];
|
|
4599
4887
|
}
|
|
4600
4888
|
return acc;
|
|
4601
4889
|
}, {});
|
|
@@ -4617,7 +4905,7 @@ function byteLength(obj) {
|
|
|
4617
4905
|
}
|
|
4618
4906
|
function utf8Length(str) {
|
|
4619
4907
|
let c2 = 0, length = 0;
|
|
4620
|
-
for (let i = 0,
|
|
4908
|
+
for (let i = 0, l = str.length; i < l; i++) {
|
|
4621
4909
|
c2 = str.charCodeAt(i);
|
|
4622
4910
|
if (c2 < 128) {
|
|
4623
4911
|
length += 1;
|
|
@@ -4660,7 +4948,7 @@ function encode(obj) {
|
|
|
4660
4948
|
function decode(qs) {
|
|
4661
4949
|
let qry = {};
|
|
4662
4950
|
let pairs = qs.split("&");
|
|
4663
|
-
for (let i = 0,
|
|
4951
|
+
for (let i = 0, l = pairs.length; i < l; i++) {
|
|
4664
4952
|
let pair = pairs[i].split("=");
|
|
4665
4953
|
qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
|
|
4666
4954
|
}
|
|
@@ -4675,11 +4963,11 @@ var init_parseqs = __esm({
|
|
|
4675
4963
|
var require_ms = __commonJS({
|
|
4676
4964
|
"node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports, module) {
|
|
4677
4965
|
var s = 1e3;
|
|
4678
|
-
var
|
|
4679
|
-
var
|
|
4680
|
-
var
|
|
4681
|
-
var
|
|
4682
|
-
var
|
|
4966
|
+
var m = s * 60;
|
|
4967
|
+
var h = m * 60;
|
|
4968
|
+
var d3 = h * 24;
|
|
4969
|
+
var w3 = d3 * 7;
|
|
4970
|
+
var y2 = d3 * 365.25;
|
|
4683
4971
|
module.exports = function(val, options) {
|
|
4684
4972
|
options = options || {};
|
|
4685
4973
|
var type = typeof val;
|
|
@@ -4711,27 +4999,27 @@ var require_ms = __commonJS({
|
|
|
4711
4999
|
case "yrs":
|
|
4712
5000
|
case "yr":
|
|
4713
5001
|
case "y":
|
|
4714
|
-
return n *
|
|
5002
|
+
return n * y2;
|
|
4715
5003
|
case "weeks":
|
|
4716
5004
|
case "week":
|
|
4717
5005
|
case "w":
|
|
4718
|
-
return n *
|
|
5006
|
+
return n * w3;
|
|
4719
5007
|
case "days":
|
|
4720
5008
|
case "day":
|
|
4721
5009
|
case "d":
|
|
4722
|
-
return n *
|
|
5010
|
+
return n * d3;
|
|
4723
5011
|
case "hours":
|
|
4724
5012
|
case "hour":
|
|
4725
5013
|
case "hrs":
|
|
4726
5014
|
case "hr":
|
|
4727
5015
|
case "h":
|
|
4728
|
-
return n *
|
|
5016
|
+
return n * h;
|
|
4729
5017
|
case "minutes":
|
|
4730
5018
|
case "minute":
|
|
4731
5019
|
case "mins":
|
|
4732
5020
|
case "min":
|
|
4733
5021
|
case "m":
|
|
4734
|
-
return n *
|
|
5022
|
+
return n * m;
|
|
4735
5023
|
case "seconds":
|
|
4736
5024
|
case "second":
|
|
4737
5025
|
case "secs":
|
|
@@ -4750,14 +5038,14 @@ var require_ms = __commonJS({
|
|
|
4750
5038
|
}
|
|
4751
5039
|
function fmtShort(ms) {
|
|
4752
5040
|
var msAbs = Math.abs(ms);
|
|
4753
|
-
if (msAbs >=
|
|
4754
|
-
return Math.round(ms /
|
|
5041
|
+
if (msAbs >= d3) {
|
|
5042
|
+
return Math.round(ms / d3) + "d";
|
|
4755
5043
|
}
|
|
4756
|
-
if (msAbs >=
|
|
4757
|
-
return Math.round(ms /
|
|
5044
|
+
if (msAbs >= h) {
|
|
5045
|
+
return Math.round(ms / h) + "h";
|
|
4758
5046
|
}
|
|
4759
|
-
if (msAbs >=
|
|
4760
|
-
return Math.round(ms /
|
|
5047
|
+
if (msAbs >= m) {
|
|
5048
|
+
return Math.round(ms / m) + "m";
|
|
4761
5049
|
}
|
|
4762
5050
|
if (msAbs >= s) {
|
|
4763
5051
|
return Math.round(ms / s) + "s";
|
|
@@ -4766,14 +5054,14 @@ var require_ms = __commonJS({
|
|
|
4766
5054
|
}
|
|
4767
5055
|
function fmtLong(ms) {
|
|
4768
5056
|
var msAbs = Math.abs(ms);
|
|
4769
|
-
if (msAbs >=
|
|
4770
|
-
return plural(ms, msAbs,
|
|
5057
|
+
if (msAbs >= d3) {
|
|
5058
|
+
return plural(ms, msAbs, d3, "day");
|
|
4771
5059
|
}
|
|
4772
|
-
if (msAbs >=
|
|
4773
|
-
return plural(ms, msAbs,
|
|
5060
|
+
if (msAbs >= h) {
|
|
5061
|
+
return plural(ms, msAbs, h, "hour");
|
|
4774
5062
|
}
|
|
4775
|
-
if (msAbs >=
|
|
4776
|
-
return plural(ms, msAbs,
|
|
5063
|
+
if (msAbs >= m) {
|
|
5064
|
+
return plural(ms, msAbs, m, "minute");
|
|
4777
5065
|
}
|
|
4778
5066
|
if (msAbs >= s) {
|
|
4779
5067
|
return plural(ms, msAbs, s, "second");
|
|
@@ -4871,8 +5159,8 @@ var require_common = __commonJS({
|
|
|
4871
5159
|
}
|
|
4872
5160
|
return enabledCache;
|
|
4873
5161
|
},
|
|
4874
|
-
set: (
|
|
4875
|
-
enableOverride =
|
|
5162
|
+
set: (v) => {
|
|
5163
|
+
enableOverride = v;
|
|
4876
5164
|
}
|
|
4877
5165
|
});
|
|
4878
5166
|
if (typeof createDebug.init === "function") {
|
|
@@ -5066,11 +5354,11 @@ var require_browser = __commonJS({
|
|
|
5066
5354
|
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
5067
5355
|
return false;
|
|
5068
5356
|
}
|
|
5069
|
-
let
|
|
5357
|
+
let m;
|
|
5070
5358
|
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
5071
5359
|
typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
5072
5360
|
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
5073
|
-
typeof navigator !== "undefined" && navigator.userAgent && (
|
|
5361
|
+
typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
|
|
5074
5362
|
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
5075
5363
|
}
|
|
5076
5364
|
function formatArgs(args) {
|
|
@@ -5106,15 +5394,15 @@ var require_browser = __commonJS({
|
|
|
5106
5394
|
}
|
|
5107
5395
|
}
|
|
5108
5396
|
function load() {
|
|
5109
|
-
let
|
|
5397
|
+
let r;
|
|
5110
5398
|
try {
|
|
5111
|
-
|
|
5399
|
+
r = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
|
|
5112
5400
|
} catch (error) {
|
|
5113
5401
|
}
|
|
5114
|
-
if (!
|
|
5115
|
-
|
|
5402
|
+
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
5403
|
+
r = process.env.DEBUG;
|
|
5116
5404
|
}
|
|
5117
|
-
return
|
|
5405
|
+
return r;
|
|
5118
5406
|
}
|
|
5119
5407
|
function localstorage() {
|
|
5120
5408
|
try {
|
|
@@ -5124,9 +5412,9 @@ var require_browser = __commonJS({
|
|
|
5124
5412
|
}
|
|
5125
5413
|
module.exports = require_common()(exports);
|
|
5126
5414
|
var { formatters } = module.exports;
|
|
5127
|
-
formatters.j = function(
|
|
5415
|
+
formatters.j = function(v) {
|
|
5128
5416
|
try {
|
|
5129
|
-
return JSON.stringify(
|
|
5417
|
+
return JSON.stringify(v);
|
|
5130
5418
|
} catch (error) {
|
|
5131
5419
|
return "[UnexpectedJSONParseError]: " + error.message;
|
|
5132
5420
|
}
|
|
@@ -5238,8 +5526,8 @@ var require_node = __commonJS({
|
|
|
5238
5526
|
exports.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
5239
5527
|
return /^debug_/i.test(key);
|
|
5240
5528
|
}).reduce((obj, key) => {
|
|
5241
|
-
const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_2,
|
|
5242
|
-
return
|
|
5529
|
+
const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_2, k) => {
|
|
5530
|
+
return k.toUpperCase();
|
|
5243
5531
|
});
|
|
5244
5532
|
let val = process.env[key];
|
|
5245
5533
|
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
@@ -5297,13 +5585,13 @@ var require_node = __commonJS({
|
|
|
5297
5585
|
}
|
|
5298
5586
|
module.exports = require_common()(exports);
|
|
5299
5587
|
var { formatters } = module.exports;
|
|
5300
|
-
formatters.o = function(
|
|
5588
|
+
formatters.o = function(v) {
|
|
5301
5589
|
this.inspectOpts.colors = this.useColors;
|
|
5302
|
-
return util.inspect(
|
|
5590
|
+
return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
|
|
5303
5591
|
};
|
|
5304
|
-
formatters.O = function(
|
|
5592
|
+
formatters.O = function(v) {
|
|
5305
5593
|
this.inspectOpts.colors = this.useColors;
|
|
5306
|
-
return util.inspect(
|
|
5594
|
+
return util.inspect(v, this.inspectOpts);
|
|
5307
5595
|
};
|
|
5308
5596
|
}
|
|
5309
5597
|
});
|
|
@@ -5644,12 +5932,12 @@ function newRequest(opts) {
|
|
|
5644
5932
|
if ("undefined" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {
|
|
5645
5933
|
return new XMLHttpRequest();
|
|
5646
5934
|
}
|
|
5647
|
-
} catch (
|
|
5935
|
+
} catch (e) {
|
|
5648
5936
|
}
|
|
5649
5937
|
if (!xdomain) {
|
|
5650
5938
|
try {
|
|
5651
5939
|
return new globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP");
|
|
5652
|
-
} catch (
|
|
5940
|
+
} catch (e) {
|
|
5653
5941
|
}
|
|
5654
5942
|
}
|
|
5655
5943
|
}
|
|
@@ -5752,17 +6040,17 @@ var init_polling_xhr = __esm({
|
|
|
5752
6040
|
}
|
|
5753
6041
|
}
|
|
5754
6042
|
}
|
|
5755
|
-
} catch (
|
|
6043
|
+
} catch (e) {
|
|
5756
6044
|
}
|
|
5757
6045
|
if ("POST" === this._method) {
|
|
5758
6046
|
try {
|
|
5759
6047
|
xhr.setRequestHeader("Content-type", "text/plain;charset=UTF-8");
|
|
5760
|
-
} catch (
|
|
6048
|
+
} catch (e) {
|
|
5761
6049
|
}
|
|
5762
6050
|
}
|
|
5763
6051
|
try {
|
|
5764
6052
|
xhr.setRequestHeader("Accept", "*/*");
|
|
5765
|
-
} catch (
|
|
6053
|
+
} catch (e) {
|
|
5766
6054
|
}
|
|
5767
6055
|
(_a = this._opts.cookieJar) === null || _a === void 0 ? void 0 : _a.addCookies(xhr);
|
|
5768
6056
|
if ("withCredentials" in xhr) {
|
|
@@ -5791,9 +6079,9 @@ var init_polling_xhr = __esm({
|
|
|
5791
6079
|
};
|
|
5792
6080
|
debug3("xhr data %s", this._data);
|
|
5793
6081
|
xhr.send(this._data);
|
|
5794
|
-
} catch (
|
|
6082
|
+
} catch (e) {
|
|
5795
6083
|
this.setTimeoutFn(() => {
|
|
5796
|
-
this._onError(
|
|
6084
|
+
this._onError(e);
|
|
5797
6085
|
}, 0);
|
|
5798
6086
|
return;
|
|
5799
6087
|
}
|
|
@@ -5824,7 +6112,7 @@ var init_polling_xhr = __esm({
|
|
|
5824
6112
|
if (fromError) {
|
|
5825
6113
|
try {
|
|
5826
6114
|
this._xhr.abort();
|
|
5827
|
-
} catch (
|
|
6115
|
+
} catch (e) {
|
|
5828
6116
|
}
|
|
5829
6117
|
}
|
|
5830
6118
|
if (typeof document !== "undefined") {
|
|
@@ -5981,7 +6269,7 @@ var require_buffer_util = __commonJS({
|
|
|
5981
6269
|
if (buffer.length < 32) _unmask(buffer, mask);
|
|
5982
6270
|
else bufferUtil.unmask(buffer, mask);
|
|
5983
6271
|
};
|
|
5984
|
-
} catch (
|
|
6272
|
+
} catch (e) {
|
|
5985
6273
|
}
|
|
5986
6274
|
}
|
|
5987
6275
|
}
|
|
@@ -6615,7 +6903,7 @@ var require_validation = __commonJS({
|
|
|
6615
6903
|
module.exports.isValidUTF8 = function(buf) {
|
|
6616
6904
|
return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
|
|
6617
6905
|
};
|
|
6618
|
-
} catch (
|
|
6906
|
+
} catch (e) {
|
|
6619
6907
|
}
|
|
6620
6908
|
}
|
|
6621
6909
|
}
|
|
@@ -8070,10 +8358,10 @@ var require_extension = __commonJS({
|
|
|
8070
8358
|
if (!Array.isArray(configurations)) configurations = [configurations];
|
|
8071
8359
|
return configurations.map((params) => {
|
|
8072
8360
|
return [extension].concat(
|
|
8073
|
-
Object.keys(params).map((
|
|
8074
|
-
let values = params[
|
|
8361
|
+
Object.keys(params).map((k) => {
|
|
8362
|
+
let values = params[k];
|
|
8075
8363
|
if (!Array.isArray(values)) values = [values];
|
|
8076
|
-
return values.map((
|
|
8364
|
+
return values.map((v) => v === true ? k : `${k}=${v}`).join("; ");
|
|
8077
8365
|
})
|
|
8078
8366
|
).join("; ");
|
|
8079
8367
|
}).join(", ");
|
|
@@ -8589,7 +8877,7 @@ var require_websocket = __commonJS({
|
|
|
8589
8877
|
} else {
|
|
8590
8878
|
try {
|
|
8591
8879
|
parsedUrl = new URL(address);
|
|
8592
|
-
} catch (
|
|
8880
|
+
} catch (e) {
|
|
8593
8881
|
throw new SyntaxError(`Invalid URL: ${address}`);
|
|
8594
8882
|
}
|
|
8595
8883
|
}
|
|
@@ -8726,7 +9014,7 @@ var require_websocket = __commonJS({
|
|
|
8726
9014
|
let addr;
|
|
8727
9015
|
try {
|
|
8728
9016
|
addr = new URL(location2, address);
|
|
8729
|
-
} catch (
|
|
9017
|
+
} catch (e) {
|
|
8730
9018
|
const err = new SyntaxError(`Invalid URL: ${location2}`);
|
|
8731
9019
|
emitErrorAndClose(websocket, err);
|
|
8732
9020
|
return;
|
|
@@ -9483,7 +9771,7 @@ var require_websocket_server = __commonJS({
|
|
|
9483
9771
|
socket.once("finish", socket.destroy);
|
|
9484
9772
|
socket.end(
|
|
9485
9773
|
`HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\r
|
|
9486
|
-
` + Object.keys(headers).map((
|
|
9774
|
+
` + Object.keys(headers).map((h) => `${h}: ${headers[h]}`).join("\r\n") + "\r\n\r\n" + message
|
|
9487
9775
|
);
|
|
9488
9776
|
}
|
|
9489
9777
|
function abortHandshakeOrEmitwsClientError(server, req, socket, code, message, headers) {
|
|
@@ -9557,7 +9845,7 @@ var init_websocket = __esm({
|
|
|
9557
9845
|
context: closeEvent
|
|
9558
9846
|
});
|
|
9559
9847
|
this.ws.onmessage = (ev) => this.onData(ev.data);
|
|
9560
|
-
this.ws.onerror = (
|
|
9848
|
+
this.ws.onerror = (e) => this.onError("websocket error", e);
|
|
9561
9849
|
}
|
|
9562
9850
|
write(packets) {
|
|
9563
9851
|
this.writable = false;
|
|
@@ -9567,7 +9855,7 @@ var init_websocket = __esm({
|
|
|
9567
9855
|
encodePacket(packet, this.supportsBinary, (data) => {
|
|
9568
9856
|
try {
|
|
9569
9857
|
this.doWrite(packet, data);
|
|
9570
|
-
} catch (
|
|
9858
|
+
} catch (e) {
|
|
9571
9859
|
debug4("websocket closed before onclose event");
|
|
9572
9860
|
}
|
|
9573
9861
|
if (lastPacket) {
|
|
@@ -9744,15 +10032,15 @@ function parse2(str) {
|
|
|
9744
10032
|
if (str.length > 8e3) {
|
|
9745
10033
|
throw "URI too long";
|
|
9746
10034
|
}
|
|
9747
|
-
const src = str,
|
|
9748
|
-
if (
|
|
9749
|
-
str = str.substring(0,
|
|
10035
|
+
const src = str, b = str.indexOf("["), e = str.indexOf("]");
|
|
10036
|
+
if (b != -1 && e != -1) {
|
|
10037
|
+
str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ";") + str.substring(e, str.length);
|
|
9750
10038
|
}
|
|
9751
|
-
let
|
|
10039
|
+
let m = re2.exec(str || ""), uri = {}, i = 14;
|
|
9752
10040
|
while (i--) {
|
|
9753
|
-
uri[parts[i]] =
|
|
10041
|
+
uri[parts[i]] = m[i] || "";
|
|
9754
10042
|
}
|
|
9755
|
-
if (
|
|
10043
|
+
if (b != -1 && e != -1) {
|
|
9756
10044
|
uri.source = src;
|
|
9757
10045
|
uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ":");
|
|
9758
10046
|
uri.authority = uri.authority.replace("[", "").replace("]", "").replace(/;/g, ":");
|
|
@@ -9864,10 +10152,10 @@ var init_socket = __esm({
|
|
|
9864
10152
|
this.port = opts.port || (typeof location !== "undefined" && location.port ? location.port : this.secure ? "443" : "80");
|
|
9865
10153
|
this.transports = [];
|
|
9866
10154
|
this._transportsByName = {};
|
|
9867
|
-
opts.transports.forEach((
|
|
9868
|
-
const transportName =
|
|
10155
|
+
opts.transports.forEach((t2) => {
|
|
10156
|
+
const transportName = t2.prototype.name;
|
|
9869
10157
|
this.transports.push(transportName);
|
|
9870
|
-
this._transportsByName[transportName] =
|
|
10158
|
+
this._transportsByName[transportName] = t2;
|
|
9871
10159
|
});
|
|
9872
10160
|
this.opts = Object.assign({
|
|
9873
10161
|
path: "/engine.io",
|
|
@@ -10404,7 +10692,7 @@ var init_socket = __esm({
|
|
|
10404
10692
|
constructor(uri, opts = {}) {
|
|
10405
10693
|
const o = typeof uri === "object" ? uri : opts;
|
|
10406
10694
|
if (!o.transports || o.transports && typeof o.transports[0] === "string") {
|
|
10407
|
-
o.transports = (o.transports || ["polling", "websocket", "webtransport"]).map((transportName) => transports[transportName]).filter((
|
|
10695
|
+
o.transports = (o.transports || ["polling", "websocket", "webtransport"]).map((transportName) => transports[transportName]).filter((t2) => !!t2);
|
|
10408
10696
|
}
|
|
10409
10697
|
super(uri, o);
|
|
10410
10698
|
}
|
|
@@ -10497,7 +10785,7 @@ function hasBinary(obj, toJSON) {
|
|
|
10497
10785
|
return false;
|
|
10498
10786
|
}
|
|
10499
10787
|
if (Array.isArray(obj)) {
|
|
10500
|
-
for (let i = 0,
|
|
10788
|
+
for (let i = 0, l = obj.length; i < l; i++) {
|
|
10501
10789
|
if (hasBinary(obj[i])) {
|
|
10502
10790
|
return true;
|
|
10503
10791
|
}
|
|
@@ -10839,7 +11127,7 @@ var init_esm_debug2 = __esm({
|
|
|
10839
11127
|
tryParse(str) {
|
|
10840
11128
|
try {
|
|
10841
11129
|
return JSON.parse(str, this.reviver);
|
|
10842
|
-
} catch (
|
|
11130
|
+
} catch (e) {
|
|
10843
11131
|
return false;
|
|
10844
11132
|
}
|
|
10845
11133
|
}
|
|
@@ -11802,49 +12090,49 @@ var init_manager = __esm({
|
|
|
11802
12090
|
if (this._autoConnect)
|
|
11803
12091
|
this.open();
|
|
11804
12092
|
}
|
|
11805
|
-
reconnection(
|
|
12093
|
+
reconnection(v) {
|
|
11806
12094
|
if (!arguments.length)
|
|
11807
12095
|
return this._reconnection;
|
|
11808
|
-
this._reconnection = !!
|
|
11809
|
-
if (!
|
|
12096
|
+
this._reconnection = !!v;
|
|
12097
|
+
if (!v) {
|
|
11810
12098
|
this.skipReconnect = true;
|
|
11811
12099
|
}
|
|
11812
12100
|
return this;
|
|
11813
12101
|
}
|
|
11814
|
-
reconnectionAttempts(
|
|
11815
|
-
if (
|
|
12102
|
+
reconnectionAttempts(v) {
|
|
12103
|
+
if (v === void 0)
|
|
11816
12104
|
return this._reconnectionAttempts;
|
|
11817
|
-
this._reconnectionAttempts =
|
|
12105
|
+
this._reconnectionAttempts = v;
|
|
11818
12106
|
return this;
|
|
11819
12107
|
}
|
|
11820
|
-
reconnectionDelay(
|
|
12108
|
+
reconnectionDelay(v) {
|
|
11821
12109
|
var _a;
|
|
11822
|
-
if (
|
|
12110
|
+
if (v === void 0)
|
|
11823
12111
|
return this._reconnectionDelay;
|
|
11824
|
-
this._reconnectionDelay =
|
|
11825
|
-
(_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMin(
|
|
12112
|
+
this._reconnectionDelay = v;
|
|
12113
|
+
(_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMin(v);
|
|
11826
12114
|
return this;
|
|
11827
12115
|
}
|
|
11828
|
-
randomizationFactor(
|
|
12116
|
+
randomizationFactor(v) {
|
|
11829
12117
|
var _a;
|
|
11830
|
-
if (
|
|
12118
|
+
if (v === void 0)
|
|
11831
12119
|
return this._randomizationFactor;
|
|
11832
|
-
this._randomizationFactor =
|
|
11833
|
-
(_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setJitter(
|
|
12120
|
+
this._randomizationFactor = v;
|
|
12121
|
+
(_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setJitter(v);
|
|
11834
12122
|
return this;
|
|
11835
12123
|
}
|
|
11836
|
-
reconnectionDelayMax(
|
|
12124
|
+
reconnectionDelayMax(v) {
|
|
11837
12125
|
var _a;
|
|
11838
|
-
if (
|
|
12126
|
+
if (v === void 0)
|
|
11839
12127
|
return this._reconnectionDelayMax;
|
|
11840
|
-
this._reconnectionDelayMax =
|
|
11841
|
-
(_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMax(
|
|
12128
|
+
this._reconnectionDelayMax = v;
|
|
12129
|
+
(_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMax(v);
|
|
11842
12130
|
return this;
|
|
11843
12131
|
}
|
|
11844
|
-
timeout(
|
|
12132
|
+
timeout(v) {
|
|
11845
12133
|
if (!arguments.length)
|
|
11846
12134
|
return this._timeout;
|
|
11847
|
-
this._timeout =
|
|
12135
|
+
this._timeout = v;
|
|
11848
12136
|
return this;
|
|
11849
12137
|
}
|
|
11850
12138
|
/**
|
|
@@ -11956,8 +12244,8 @@ var init_manager = __esm({
|
|
|
11956
12244
|
ondata(data) {
|
|
11957
12245
|
try {
|
|
11958
12246
|
this.decoder.add(data);
|
|
11959
|
-
} catch (
|
|
11960
|
-
this.onclose("parse error",
|
|
12247
|
+
} catch (e) {
|
|
12248
|
+
this.onclose("parse error", e);
|
|
11961
12249
|
}
|
|
11962
12250
|
}
|
|
11963
12251
|
/**
|
|
@@ -12228,8 +12516,8 @@ function buildPlist(serverPath, logPath, envVars) {
|
|
|
12228
12516
|
const stderrPath = path.join(path.dirname(logPath), "truecourse.error.log");
|
|
12229
12517
|
let envSection = "";
|
|
12230
12518
|
if (Object.keys(envVars).length > 0) {
|
|
12231
|
-
const entries = Object.entries(envVars).map(([
|
|
12232
|
-
<string>${escapeXml(
|
|
12519
|
+
const entries = Object.entries(envVars).map(([k, v]) => ` <key>${escapeXml(k)}</key>
|
|
12520
|
+
<string>${escapeXml(v)}</string>`).join("\n");
|
|
12233
12521
|
envSection = `
|
|
12234
12522
|
<key>EnvironmentVariables</key>
|
|
12235
12523
|
<dict>
|
|
@@ -12636,7 +12924,7 @@ async function healthcheck() {
|
|
|
12636
12924
|
if (res.ok) return true;
|
|
12637
12925
|
} catch {
|
|
12638
12926
|
}
|
|
12639
|
-
await new Promise((
|
|
12927
|
+
await new Promise((r) => setTimeout(r, 500));
|
|
12640
12928
|
}
|
|
12641
12929
|
return false;
|
|
12642
12930
|
}
|
|
@@ -12648,28 +12936,28 @@ async function startServiceMode(openBrowser) {
|
|
|
12648
12936
|
const url2 = getServerUrl();
|
|
12649
12937
|
const { running } = await platform.status();
|
|
12650
12938
|
if (running) {
|
|
12651
|
-
|
|
12939
|
+
O2.info(`TrueCourse is already running at ${url2}`);
|
|
12652
12940
|
return;
|
|
12653
12941
|
}
|
|
12654
12942
|
const installed = await platform.isInstalled();
|
|
12655
12943
|
if (installed) {
|
|
12656
12944
|
rotateLogs(logDir);
|
|
12657
12945
|
rotateErrorLogs(logDir);
|
|
12658
|
-
|
|
12946
|
+
O2.step("Starting background service...");
|
|
12659
12947
|
await platform.start();
|
|
12660
12948
|
} else {
|
|
12661
12949
|
rotateLogs(logDir);
|
|
12662
12950
|
rotateErrorLogs(logDir);
|
|
12663
|
-
|
|
12951
|
+
O2.step("Installing and starting background service...");
|
|
12664
12952
|
await platform.install(serverPath, logPath);
|
|
12665
12953
|
}
|
|
12666
12954
|
const healthy = await healthcheck();
|
|
12667
12955
|
if (healthy) {
|
|
12668
|
-
|
|
12956
|
+
O2.success(`TrueCourse is running at ${url2}`);
|
|
12669
12957
|
if (openBrowser) openInBrowser(url2);
|
|
12670
12958
|
} else {
|
|
12671
|
-
|
|
12672
|
-
|
|
12959
|
+
O2.warn("Service started but server hasn't responded yet.");
|
|
12960
|
+
O2.info("Check logs with: truecourse service logs");
|
|
12673
12961
|
}
|
|
12674
12962
|
}
|
|
12675
12963
|
function getServerProcess() {
|
|
@@ -12678,7 +12966,7 @@ function getServerProcess() {
|
|
|
12678
12966
|
function startConsoleMode(openBrowser) {
|
|
12679
12967
|
const serverPath = getServerPath();
|
|
12680
12968
|
const url2 = getServerUrl();
|
|
12681
|
-
|
|
12969
|
+
O2.step("Starting server (embedded PostgreSQL starts automatically)...");
|
|
12682
12970
|
const serverProcess = _serverProcess = spawn2(
|
|
12683
12971
|
process.execPath,
|
|
12684
12972
|
[serverPath],
|
|
@@ -12694,7 +12982,7 @@ function startConsoleMode(openBrowser) {
|
|
|
12694
12982
|
serverProcess.stdout?.on("data", forwardOutput);
|
|
12695
12983
|
serverProcess.stderr?.on("data", forwardOutput);
|
|
12696
12984
|
serverProcess.on("error", (error) => {
|
|
12697
|
-
|
|
12985
|
+
O2.error(`Failed to start server: ${error.message}`);
|
|
12698
12986
|
process.exit(1);
|
|
12699
12987
|
});
|
|
12700
12988
|
serverProcess.on("close", (code) => {
|
|
@@ -12714,14 +13002,14 @@ function startConsoleMode(openBrowser) {
|
|
|
12714
13002
|
}
|
|
12715
13003
|
}
|
|
12716
13004
|
async function runStart({ openBrowser = true } = {}) {
|
|
12717
|
-
|
|
13005
|
+
mt("Starting TrueCourse");
|
|
12718
13006
|
const config = readConfig();
|
|
12719
13007
|
if (config.runMode === "service") {
|
|
12720
13008
|
try {
|
|
12721
13009
|
await startServiceMode(openBrowser);
|
|
12722
13010
|
} catch (error) {
|
|
12723
|
-
|
|
12724
|
-
|
|
13011
|
+
O2.error(`Service mode failed: ${error.message}`);
|
|
13012
|
+
O2.info("Falling back to console mode. Reconfigure with: truecourse setup");
|
|
12725
13013
|
startConsoleMode(openBrowser);
|
|
12726
13014
|
}
|
|
12727
13015
|
} else {
|
|
@@ -12732,7 +13020,7 @@ var __dirname, _serverProcess;
|
|
|
12732
13020
|
var init_start = __esm({
|
|
12733
13021
|
"tools/cli/src/commands/start.ts"() {
|
|
12734
13022
|
"use strict";
|
|
12735
|
-
|
|
13023
|
+
init_dist4();
|
|
12736
13024
|
init_helpers();
|
|
12737
13025
|
init_platform();
|
|
12738
13026
|
init_logs();
|
|
@@ -12760,7 +13048,7 @@ __export(helpers_exports, {
|
|
|
12760
13048
|
severityIcon: () => severityIcon,
|
|
12761
13049
|
writeConfig: () => writeConfig
|
|
12762
13050
|
});
|
|
12763
|
-
import { exec } from "node:child_process";
|
|
13051
|
+
import { exec as exec2 } from "node:child_process";
|
|
12764
13052
|
import { cpSync, existsSync } from "node:fs";
|
|
12765
13053
|
import fs5 from "node:fs";
|
|
12766
13054
|
import path5 from "node:path";
|
|
@@ -12817,9 +13105,9 @@ async function ensureServer() {
|
|
|
12817
13105
|
if (res.ok) return true;
|
|
12818
13106
|
} catch {
|
|
12819
13107
|
}
|
|
12820
|
-
await new Promise((
|
|
13108
|
+
await new Promise((r) => setTimeout(r, 500));
|
|
12821
13109
|
}
|
|
12822
|
-
|
|
13110
|
+
O2.error("Server failed to start. Check logs with: truecourse service logs");
|
|
12823
13111
|
process.exit(1);
|
|
12824
13112
|
}
|
|
12825
13113
|
}
|
|
@@ -12840,7 +13128,7 @@ async function ensureRepo() {
|
|
|
12840
13128
|
} catch {
|
|
12841
13129
|
if (body) message = body;
|
|
12842
13130
|
}
|
|
12843
|
-
|
|
13131
|
+
O2.error(message);
|
|
12844
13132
|
process.exit(1);
|
|
12845
13133
|
}
|
|
12846
13134
|
const repo = await res.json();
|
|
@@ -12874,18 +13162,18 @@ function severityIcon(severity) {
|
|
|
12874
13162
|
}
|
|
12875
13163
|
function severityColor(severity) {
|
|
12876
13164
|
const s = severity.toLowerCase();
|
|
12877
|
-
if (s === "critical") return (
|
|
12878
|
-
if (s === "high") return (
|
|
12879
|
-
if (s === "medium") return (
|
|
12880
|
-
return (
|
|
13165
|
+
if (s === "critical") return (t2) => `\x1B[91m${t2}\x1B[0m`;
|
|
13166
|
+
if (s === "high") return (t2) => `\x1B[31m${t2}\x1B[0m`;
|
|
13167
|
+
if (s === "medium") return (t2) => `\x1B[33m${t2}\x1B[0m`;
|
|
13168
|
+
return (t2) => `\x1B[36m${t2}\x1B[0m`;
|
|
12881
13169
|
}
|
|
12882
|
-
function buildTargetPath(
|
|
13170
|
+
function buildTargetPath(v) {
|
|
12883
13171
|
const parts2 = [];
|
|
12884
|
-
if (
|
|
12885
|
-
if (
|
|
12886
|
-
if (
|
|
12887
|
-
if (
|
|
12888
|
-
if (
|
|
13172
|
+
if (v.targetServiceName) parts2.push(v.targetServiceName);
|
|
13173
|
+
if (v.targetDatabaseName) parts2.push(v.targetDatabaseName);
|
|
13174
|
+
if (v.targetModuleName) parts2.push(v.targetModuleName);
|
|
13175
|
+
if (v.targetMethodName) parts2.push(v.targetMethodName);
|
|
13176
|
+
if (v.targetTable) parts2.push(`table: ${v.targetTable}`);
|
|
12889
13177
|
return parts2.join(" :: ");
|
|
12890
13178
|
}
|
|
12891
13179
|
function wrapText(text, indent, maxWidth) {
|
|
@@ -12901,30 +13189,30 @@ function wrapText(text, indent, maxWidth) {
|
|
|
12901
13189
|
}
|
|
12902
13190
|
}
|
|
12903
13191
|
if (line) lines.push(line);
|
|
12904
|
-
return lines.map((
|
|
13192
|
+
return lines.map((l, i) => i === 0 ? l : `${indent}${l}`).join("\n");
|
|
12905
13193
|
}
|
|
12906
13194
|
function renderViolations(violations) {
|
|
12907
13195
|
if (violations.length === 0) {
|
|
12908
|
-
|
|
13196
|
+
O2.info("No violations found. Run `truecourse analyze` first.");
|
|
12909
13197
|
return;
|
|
12910
13198
|
}
|
|
12911
13199
|
console.log("");
|
|
12912
13200
|
const counts = {};
|
|
12913
|
-
for (const
|
|
12914
|
-
const sev =
|
|
13201
|
+
for (const v of violations) {
|
|
13202
|
+
const sev = v.severity.toLowerCase();
|
|
12915
13203
|
counts[sev] = (counts[sev] || 0) + 1;
|
|
12916
|
-
const icon = severityIcon(
|
|
12917
|
-
const color = severityColor(
|
|
12918
|
-
const label =
|
|
12919
|
-
const target = buildTargetPath(
|
|
12920
|
-
console.log(` ${color(`${icon} ${label}`)} ${
|
|
13204
|
+
const icon = severityIcon(v.severity);
|
|
13205
|
+
const color = severityColor(v.severity);
|
|
13206
|
+
const label = v.severity.toUpperCase();
|
|
13207
|
+
const target = buildTargetPath(v);
|
|
13208
|
+
console.log(` ${color(`${icon} ${label}`)} ${v.title}`);
|
|
12921
13209
|
if (target) {
|
|
12922
13210
|
console.log(` ${target}`);
|
|
12923
13211
|
}
|
|
12924
|
-
if (
|
|
13212
|
+
if (v.fixPrompt) {
|
|
12925
13213
|
const indent = " ";
|
|
12926
13214
|
console.log("");
|
|
12927
|
-
console.log(` Fix: ${wrapText(
|
|
13215
|
+
console.log(` Fix: ${wrapText(v.fixPrompt, indent + " ", 60)}`);
|
|
12928
13216
|
}
|
|
12929
13217
|
console.log("");
|
|
12930
13218
|
}
|
|
@@ -12936,16 +13224,24 @@ function renderViolations(violations) {
|
|
|
12936
13224
|
console.log(` ${violations.length} violations (${parts2.join(", ")})`);
|
|
12937
13225
|
console.log("");
|
|
12938
13226
|
}
|
|
12939
|
-
function renderViolationsSummary(violations) {
|
|
12940
|
-
|
|
12941
|
-
|
|
13227
|
+
function renderViolationsSummary(violations, codeSummary) {
|
|
13228
|
+
const codeTotal = codeSummary?.total ?? 0;
|
|
13229
|
+
const totalCount = violations.length + codeTotal;
|
|
13230
|
+
if (totalCount === 0) {
|
|
13231
|
+
O2.info("No violations found.");
|
|
12942
13232
|
return;
|
|
12943
13233
|
}
|
|
12944
13234
|
const counts = {};
|
|
12945
|
-
for (const
|
|
12946
|
-
const sev =
|
|
13235
|
+
for (const v of violations) {
|
|
13236
|
+
const sev = v.severity.toLowerCase();
|
|
12947
13237
|
counts[sev] = (counts[sev] || 0) + 1;
|
|
12948
13238
|
}
|
|
13239
|
+
if (codeSummary) {
|
|
13240
|
+
for (const [sev, c2] of Object.entries(codeSummary.bySeverity)) {
|
|
13241
|
+
const key = sev.toLowerCase();
|
|
13242
|
+
counts[key] = (counts[key] || 0) + c2;
|
|
13243
|
+
}
|
|
13244
|
+
}
|
|
12949
13245
|
const parts2 = [];
|
|
12950
13246
|
for (const sev of ["critical", "high", "medium", "low", "info"]) {
|
|
12951
13247
|
if (counts[sev]) {
|
|
@@ -12954,15 +13250,18 @@ function renderViolationsSummary(violations) {
|
|
|
12954
13250
|
}
|
|
12955
13251
|
}
|
|
12956
13252
|
console.log("");
|
|
12957
|
-
console.log(` ${
|
|
13253
|
+
console.log(` ${totalCount} violations (${parts2.join(", ")})`);
|
|
13254
|
+
if (codeTotal > 0) {
|
|
13255
|
+
console.log(` \u251C ${violations.length} architecture \xB7 ${codeTotal} code`);
|
|
13256
|
+
}
|
|
12958
13257
|
console.log("");
|
|
12959
|
-
|
|
13258
|
+
O2.info("Run `truecourse list` to see full details.");
|
|
12960
13259
|
}
|
|
12961
13260
|
function renderDiffResults(result) {
|
|
12962
13261
|
console.log("");
|
|
12963
|
-
const modified = result.changedFiles.filter((
|
|
12964
|
-
const newFiles = result.changedFiles.filter((
|
|
12965
|
-
const deleted = result.changedFiles.filter((
|
|
13262
|
+
const modified = result.changedFiles.filter((f) => f.status === "modified").length;
|
|
13263
|
+
const newFiles = result.changedFiles.filter((f) => f.status === "new").length;
|
|
13264
|
+
const deleted = result.changedFiles.filter((f) => f.status === "deleted").length;
|
|
12966
13265
|
const fileParts = [];
|
|
12967
13266
|
if (modified) fileParts.push(`${modified} modified`);
|
|
12968
13267
|
if (newFiles) fileParts.push(`${newFiles} new`);
|
|
@@ -12976,19 +13275,19 @@ function renderDiffResults(result) {
|
|
|
12976
13275
|
if (result.newViolations.length > 0) {
|
|
12977
13276
|
console.log(` NEW ISSUES (${result.newViolations.length})`);
|
|
12978
13277
|
console.log(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
|
|
12979
|
-
for (const
|
|
12980
|
-
const icon = severityIcon(
|
|
12981
|
-
const color = severityColor(
|
|
12982
|
-
const label =
|
|
12983
|
-
const target = buildTargetPath(
|
|
12984
|
-
console.log(` ${color(`${icon} ${label}`)} ${
|
|
13278
|
+
for (const v of result.newViolations) {
|
|
13279
|
+
const icon = severityIcon(v.severity);
|
|
13280
|
+
const color = severityColor(v.severity);
|
|
13281
|
+
const label = v.severity.toUpperCase();
|
|
13282
|
+
const target = buildTargetPath(v);
|
|
13283
|
+
console.log(` ${color(`${icon} ${label}`)} ${v.title}`);
|
|
12985
13284
|
if (target) {
|
|
12986
13285
|
console.log(` ${target}`);
|
|
12987
13286
|
}
|
|
12988
|
-
if (
|
|
13287
|
+
if (v.fixPrompt) {
|
|
12989
13288
|
const indent = " ";
|
|
12990
13289
|
console.log("");
|
|
12991
|
-
console.log(` Fix: ${wrapText(
|
|
13290
|
+
console.log(` Fix: ${wrapText(v.fixPrompt, indent + " ", 60)}`);
|
|
12992
13291
|
}
|
|
12993
13292
|
console.log("");
|
|
12994
13293
|
}
|
|
@@ -13001,11 +13300,11 @@ function renderDiffResults(result) {
|
|
|
13001
13300
|
if (result.resolvedViolations.length > 0) {
|
|
13002
13301
|
console.log(` RESOLVED (${result.resolvedViolations.length})`);
|
|
13003
13302
|
console.log(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
|
|
13004
|
-
for (const
|
|
13005
|
-
const target = buildTargetPath(
|
|
13006
|
-
const color = severityColor(
|
|
13007
|
-
const label =
|
|
13008
|
-
console.log(` ${color(`\u2714 ${label}`)} ${
|
|
13303
|
+
for (const v of result.resolvedViolations) {
|
|
13304
|
+
const target = buildTargetPath(v);
|
|
13305
|
+
const color = severityColor(v.severity);
|
|
13306
|
+
const label = v.severity.toUpperCase();
|
|
13307
|
+
console.log(` ${color(`\u2714 ${label}`)} ${v.title}`);
|
|
13009
13308
|
if (target) {
|
|
13010
13309
|
console.log(` ${target}`);
|
|
13011
13310
|
}
|
|
@@ -13023,9 +13322,9 @@ function renderDiffResults(result) {
|
|
|
13023
13322
|
}
|
|
13024
13323
|
function renderDiffResultsSummary(result) {
|
|
13025
13324
|
console.log("");
|
|
13026
|
-
const modified = result.changedFiles.filter((
|
|
13027
|
-
const newFiles = result.changedFiles.filter((
|
|
13028
|
-
const deleted = result.changedFiles.filter((
|
|
13325
|
+
const modified = result.changedFiles.filter((f) => f.status === "modified").length;
|
|
13326
|
+
const newFiles = result.changedFiles.filter((f) => f.status === "new").length;
|
|
13327
|
+
const deleted = result.changedFiles.filter((f) => f.status === "deleted").length;
|
|
13029
13328
|
const fileParts = [];
|
|
13030
13329
|
if (modified) fileParts.push(`${modified} modified`);
|
|
13031
13330
|
if (newFiles) fileParts.push(`${newFiles} new`);
|
|
@@ -13038,38 +13337,38 @@ function renderDiffResultsSummary(result) {
|
|
|
13038
13337
|
}
|
|
13039
13338
|
console.log(` Summary: ${result.summary.newCount} new issues, ${result.summary.resolvedCount} resolved`);
|
|
13040
13339
|
console.log("");
|
|
13041
|
-
|
|
13340
|
+
O2.info("Run `truecourse list --diff` to see full details.");
|
|
13042
13341
|
}
|
|
13043
13342
|
function openInBrowser(url2) {
|
|
13044
13343
|
console.log(` Opening ${url2}`);
|
|
13045
13344
|
const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
13046
|
-
|
|
13345
|
+
exec2(`${cmd} ${url2}`);
|
|
13047
13346
|
}
|
|
13048
13347
|
async function promptInstallSkills(repoPath) {
|
|
13049
|
-
const installSkills = await
|
|
13348
|
+
const installSkills = await ot2({
|
|
13050
13349
|
message: "Would you like to install Claude Code skills?"
|
|
13051
13350
|
});
|
|
13052
|
-
if (
|
|
13351
|
+
if (q(installSkills) || !installSkills) return;
|
|
13053
13352
|
const __dirname3 = dirname(fileURLToPath2(import.meta.url));
|
|
13054
13353
|
const srcPath = resolve(__dirname3, "..", "..", "skills", "truecourse");
|
|
13055
13354
|
const distPath = resolve(__dirname3, "skills", "truecourse");
|
|
13056
13355
|
const skillsSrc = existsSync(srcPath) ? srcPath : distPath;
|
|
13057
13356
|
if (!existsSync(skillsSrc)) {
|
|
13058
|
-
|
|
13357
|
+
O2.warn("Skills directory not found in package \u2014 skipping.");
|
|
13059
13358
|
return;
|
|
13060
13359
|
}
|
|
13061
13360
|
const skillsDest = resolve(repoPath, ".claude", "skills");
|
|
13062
13361
|
cpSync(skillsSrc, skillsDest, { recursive: true });
|
|
13063
|
-
|
|
13064
|
-
|
|
13065
|
-
|
|
13066
|
-
|
|
13362
|
+
O2.success("Installed Claude Code skills:");
|
|
13363
|
+
O2.message(" - truecourse-analyze (run analysis)");
|
|
13364
|
+
O2.message(" - truecourse-list (list violations)");
|
|
13365
|
+
O2.message(" - truecourse-fix (apply fixes)");
|
|
13067
13366
|
}
|
|
13068
13367
|
var DEFAULT_PORT, DEFAULT_CONFIG;
|
|
13069
13368
|
var init_helpers = __esm({
|
|
13070
13369
|
"tools/cli/src/commands/helpers.ts"() {
|
|
13071
13370
|
"use strict";
|
|
13072
|
-
|
|
13371
|
+
init_dist4();
|
|
13073
13372
|
init_esm_debug3();
|
|
13074
13373
|
DEFAULT_PORT = 3001;
|
|
13075
13374
|
DEFAULT_CONFIG = { runMode: "console" };
|
|
@@ -13113,8 +13412,8 @@ function buildEnvContents(config) {
|
|
|
13113
13412
|
return lines.join("\n");
|
|
13114
13413
|
}
|
|
13115
13414
|
async function runSetup() {
|
|
13116
|
-
|
|
13117
|
-
const provider = await
|
|
13415
|
+
mt("Welcome to TrueCourse");
|
|
13416
|
+
const provider = await _t({
|
|
13118
13417
|
message: "Which LLM provider would you like to use?",
|
|
13119
13418
|
options: [
|
|
13120
13419
|
{ value: "claude-code", label: "Claude Code CLI \u2014 no API key needed (Recommended)" },
|
|
@@ -13123,8 +13422,8 @@ async function runSetup() {
|
|
|
13123
13422
|
{ value: "skip", label: "Skip for now" }
|
|
13124
13423
|
]
|
|
13125
13424
|
});
|
|
13126
|
-
if (
|
|
13127
|
-
|
|
13425
|
+
if (q(provider)) {
|
|
13426
|
+
pt("Setup cancelled.");
|
|
13128
13427
|
process.exit(0);
|
|
13129
13428
|
}
|
|
13130
13429
|
const config = {};
|
|
@@ -13135,13 +13434,13 @@ async function runSetup() {
|
|
|
13135
13434
|
try {
|
|
13136
13435
|
execSync4("which claude", { stdio: "ignore" });
|
|
13137
13436
|
} catch {
|
|
13138
|
-
|
|
13437
|
+
O2.error("Claude Code CLI not found on PATH. Install it first: https://docs.anthropic.com/en/docs/claude-code");
|
|
13139
13438
|
process.exit(1);
|
|
13140
13439
|
}
|
|
13141
|
-
|
|
13440
|
+
O2.success("Claude Code CLI detected.");
|
|
13142
13441
|
}
|
|
13143
13442
|
if (provider === "anthropic") {
|
|
13144
|
-
const anthropicKey = await
|
|
13443
|
+
const anthropicKey = await Ot({
|
|
13145
13444
|
message: "Enter your Anthropic API key:",
|
|
13146
13445
|
placeholder: "sk-ant-...",
|
|
13147
13446
|
validate(value2) {
|
|
@@ -13150,14 +13449,14 @@ async function runSetup() {
|
|
|
13150
13449
|
}
|
|
13151
13450
|
}
|
|
13152
13451
|
});
|
|
13153
|
-
if (
|
|
13154
|
-
|
|
13452
|
+
if (q(anthropicKey)) {
|
|
13453
|
+
pt("Setup cancelled.");
|
|
13155
13454
|
process.exit(0);
|
|
13156
13455
|
}
|
|
13157
13456
|
config.anthropicKey = anthropicKey;
|
|
13158
13457
|
}
|
|
13159
13458
|
if (provider === "openai") {
|
|
13160
|
-
const openaiKey = await
|
|
13459
|
+
const openaiKey = await Ot({
|
|
13161
13460
|
message: "Enter your OpenAI API key:",
|
|
13162
13461
|
placeholder: "sk-...",
|
|
13163
13462
|
validate(value2) {
|
|
@@ -13166,34 +13465,34 @@ async function runSetup() {
|
|
|
13166
13465
|
}
|
|
13167
13466
|
}
|
|
13168
13467
|
});
|
|
13169
|
-
if (
|
|
13170
|
-
|
|
13468
|
+
if (q(openaiKey)) {
|
|
13469
|
+
pt("Setup cancelled.");
|
|
13171
13470
|
process.exit(0);
|
|
13172
13471
|
}
|
|
13173
13472
|
config.openaiKey = openaiKey;
|
|
13174
13473
|
}
|
|
13175
13474
|
if (provider === "anthropic" || provider === "openai") {
|
|
13176
13475
|
const defaultModel = DEFAULT_MODELS[provider];
|
|
13177
|
-
const model = await
|
|
13476
|
+
const model = await Ot({
|
|
13178
13477
|
message: `Enter the model to use (default: ${defaultModel}):`,
|
|
13179
13478
|
placeholder: defaultModel
|
|
13180
13479
|
});
|
|
13181
|
-
if (
|
|
13182
|
-
|
|
13480
|
+
if (q(model)) {
|
|
13481
|
+
pt("Setup cancelled.");
|
|
13183
13482
|
process.exit(0);
|
|
13184
13483
|
}
|
|
13185
13484
|
config.model = model?.trim() || defaultModel;
|
|
13186
13485
|
}
|
|
13187
|
-
const useLangfuse = provider !== "claude-code" && await
|
|
13486
|
+
const useLangfuse = provider !== "claude-code" && await ot2({
|
|
13188
13487
|
message: "Would you like to enable Langfuse tracing?",
|
|
13189
13488
|
initialValue: false
|
|
13190
13489
|
});
|
|
13191
|
-
if (
|
|
13192
|
-
|
|
13490
|
+
if (q(useLangfuse)) {
|
|
13491
|
+
pt("Setup cancelled.");
|
|
13193
13492
|
process.exit(0);
|
|
13194
13493
|
}
|
|
13195
13494
|
if (useLangfuse) {
|
|
13196
|
-
const langfusePublicKey = await
|
|
13495
|
+
const langfusePublicKey = await Ot({
|
|
13197
13496
|
message: "Enter your Langfuse public key:",
|
|
13198
13497
|
placeholder: "pk-lf-...",
|
|
13199
13498
|
validate(value2) {
|
|
@@ -13202,11 +13501,11 @@ async function runSetup() {
|
|
|
13202
13501
|
}
|
|
13203
13502
|
}
|
|
13204
13503
|
});
|
|
13205
|
-
if (
|
|
13206
|
-
|
|
13504
|
+
if (q(langfusePublicKey)) {
|
|
13505
|
+
pt("Setup cancelled.");
|
|
13207
13506
|
process.exit(0);
|
|
13208
13507
|
}
|
|
13209
|
-
const langfuseSecretKey = await
|
|
13508
|
+
const langfuseSecretKey = await Ot({
|
|
13210
13509
|
message: "Enter your Langfuse secret key:",
|
|
13211
13510
|
placeholder: "sk-lf-...",
|
|
13212
13511
|
validate(value2) {
|
|
@@ -13215,8 +13514,8 @@ async function runSetup() {
|
|
|
13215
13514
|
}
|
|
13216
13515
|
}
|
|
13217
13516
|
});
|
|
13218
|
-
if (
|
|
13219
|
-
|
|
13517
|
+
if (q(langfuseSecretKey)) {
|
|
13518
|
+
pt("Setup cancelled.");
|
|
13220
13519
|
process.exit(0);
|
|
13221
13520
|
}
|
|
13222
13521
|
config.langfusePublicKey = langfusePublicKey;
|
|
@@ -13226,32 +13525,32 @@ async function runSetup() {
|
|
|
13226
13525
|
fs6.mkdirSync(configDir, { recursive: true });
|
|
13227
13526
|
const envPath = path6.join(configDir, ".env");
|
|
13228
13527
|
fs6.writeFileSync(envPath, buildEnvContents(config), "utf-8");
|
|
13229
|
-
|
|
13230
|
-
const runMode = await
|
|
13528
|
+
O2.success(`Configuration saved to ${envPath}`);
|
|
13529
|
+
const runMode = await _t({
|
|
13231
13530
|
message: "How would you like to run TrueCourse?",
|
|
13232
13531
|
options: [
|
|
13233
13532
|
{ value: "service", label: "Background service (Recommended)" },
|
|
13234
13533
|
{ value: "console", label: "Console (keep terminal open)" }
|
|
13235
13534
|
]
|
|
13236
13535
|
});
|
|
13237
|
-
if (
|
|
13238
|
-
|
|
13536
|
+
if (q(runMode)) {
|
|
13537
|
+
pt("Setup cancelled.");
|
|
13239
13538
|
process.exit(0);
|
|
13240
13539
|
}
|
|
13241
13540
|
const { writeConfig: writeConfig2 } = await Promise.resolve().then(() => (init_helpers(), helpers_exports));
|
|
13242
13541
|
writeConfig2({ runMode });
|
|
13243
13542
|
if (runMode === "service") {
|
|
13244
|
-
|
|
13543
|
+
O2.info("Background service selected. Run `truecourse start` to install and start the service.");
|
|
13245
13544
|
}
|
|
13246
|
-
|
|
13247
|
-
|
|
13248
|
-
|
|
13545
|
+
O2.info("Embedded PostgreSQL will start automatically when the server runs.");
|
|
13546
|
+
O2.info("Database migrations are applied on server startup.");
|
|
13547
|
+
gt("Setup complete!");
|
|
13249
13548
|
}
|
|
13250
13549
|
var DEFAULT_MODELS;
|
|
13251
13550
|
var init_setup = __esm({
|
|
13252
13551
|
"tools/cli/src/commands/setup.ts"() {
|
|
13253
13552
|
"use strict";
|
|
13254
|
-
|
|
13553
|
+
init_dist4();
|
|
13255
13554
|
DEFAULT_MODELS = {
|
|
13256
13555
|
anthropic: "claude-sonnet-4-20250514",
|
|
13257
13556
|
openai: "gpt-5.3-codex"
|
|
@@ -13265,12 +13564,12 @@ __export(code_review_exports, {
|
|
|
13265
13564
|
runCodeReviewCmd: () => runCodeReviewCmd
|
|
13266
13565
|
});
|
|
13267
13566
|
async function runCodeReviewCmd({ noAutostart = false, diff = false } = {}) {
|
|
13268
|
-
|
|
13567
|
+
mt(diff ? "Running code review (diff mode)" : "Running code review");
|
|
13269
13568
|
if (noAutostart) {
|
|
13270
13569
|
const url2 = getServerUrl();
|
|
13271
13570
|
const res = await fetch(`${url2}/api/health`).catch(() => null);
|
|
13272
13571
|
if (!res?.ok) {
|
|
13273
|
-
|
|
13572
|
+
O2.error("Server is not running. Start it with: truecourse start");
|
|
13274
13573
|
process.exit(1);
|
|
13275
13574
|
}
|
|
13276
13575
|
} else {
|
|
@@ -13282,31 +13581,31 @@ async function runCodeReviewCmd({ noAutostart = false, diff = false } = {}) {
|
|
|
13282
13581
|
if (diff) {
|
|
13283
13582
|
const diffRes = await fetch(`${serverUrl}/api/repos/${repo.id}/diff-check`);
|
|
13284
13583
|
if (!diffRes.ok) {
|
|
13285
|
-
|
|
13584
|
+
O2.error("Failed to fetch diff check");
|
|
13286
13585
|
process.exit(1);
|
|
13287
13586
|
}
|
|
13288
13587
|
const diffResult = await diffRes.json();
|
|
13289
13588
|
if (!diffResult?.diffAnalysisId) {
|
|
13290
|
-
|
|
13589
|
+
O2.error("No diff analysis found. Run 'truecourse analyze --diff' first.");
|
|
13291
13590
|
process.exit(1);
|
|
13292
13591
|
}
|
|
13293
13592
|
analysisId = diffResult.diffAnalysisId;
|
|
13294
|
-
|
|
13593
|
+
O2.info(`Running code review on diff analysis (${analysisId.slice(0, 8)})`);
|
|
13295
13594
|
} else {
|
|
13296
13595
|
const analysesRes = await fetch(`${serverUrl}/api/repos/${repo.id}/analyses`);
|
|
13297
13596
|
if (!analysesRes.ok) {
|
|
13298
|
-
|
|
13597
|
+
O2.error("Failed to fetch analyses");
|
|
13299
13598
|
process.exit(1);
|
|
13300
13599
|
}
|
|
13301
13600
|
const analyses = await analysesRes.json();
|
|
13302
13601
|
if (analyses.length === 0) {
|
|
13303
|
-
|
|
13602
|
+
O2.error("No analysis found. Run 'truecourse analyze' first.");
|
|
13304
13603
|
process.exit(1);
|
|
13305
13604
|
}
|
|
13306
13605
|
analysisId = analyses[0].id;
|
|
13307
|
-
|
|
13606
|
+
O2.info(`Running code review on latest analysis (${analysisId.slice(0, 8)})`);
|
|
13308
13607
|
}
|
|
13309
|
-
const spinner =
|
|
13608
|
+
const spinner = fe();
|
|
13310
13609
|
spinner.start("Running code review...");
|
|
13311
13610
|
const socket = connectSocket(repo.id);
|
|
13312
13611
|
return new Promise((resolve2) => {
|
|
@@ -13316,14 +13615,14 @@ async function runCodeReviewCmd({ noAutostart = false, diff = false } = {}) {
|
|
|
13316
13615
|
resolved = true;
|
|
13317
13616
|
spinner.stop("Code review complete");
|
|
13318
13617
|
socket.disconnect();
|
|
13319
|
-
|
|
13618
|
+
gt("Done");
|
|
13320
13619
|
resolve2();
|
|
13321
13620
|
};
|
|
13322
13621
|
socket.on("code-review:ready", () => done());
|
|
13323
13622
|
const timeout = setTimeout(() => {
|
|
13324
13623
|
spinner.stop("Code review timed out");
|
|
13325
13624
|
socket.disconnect();
|
|
13326
|
-
|
|
13625
|
+
gt("Timed out waiting for code review");
|
|
13327
13626
|
resolve2();
|
|
13328
13627
|
}, 15 * 60 * 1e3);
|
|
13329
13628
|
socket.on("code-review:ready", () => clearTimeout(timeout));
|
|
@@ -13335,7 +13634,7 @@ async function runCodeReviewCmd({ noAutostart = false, diff = false } = {}) {
|
|
|
13335
13634
|
spinner.stop("Failed to start code review");
|
|
13336
13635
|
clearTimeout(timeout);
|
|
13337
13636
|
socket.disconnect();
|
|
13338
|
-
|
|
13637
|
+
gt("Failed");
|
|
13339
13638
|
resolve2();
|
|
13340
13639
|
}
|
|
13341
13640
|
});
|
|
@@ -13344,7 +13643,7 @@ async function runCodeReviewCmd({ noAutostart = false, diff = false } = {}) {
|
|
|
13344
13643
|
var init_code_review = __esm({
|
|
13345
13644
|
"tools/cli/src/commands/code-review.ts"() {
|
|
13346
13645
|
"use strict";
|
|
13347
|
-
|
|
13646
|
+
init_dist4();
|
|
13348
13647
|
init_helpers();
|
|
13349
13648
|
}
|
|
13350
13649
|
});
|
|
@@ -13367,7 +13666,7 @@ var {
|
|
|
13367
13666
|
} = import_index.default;
|
|
13368
13667
|
|
|
13369
13668
|
// tools/cli/src/index.ts
|
|
13370
|
-
|
|
13669
|
+
init_dist4();
|
|
13371
13670
|
init_setup();
|
|
13372
13671
|
init_start();
|
|
13373
13672
|
import fs8 from "node:fs";
|
|
@@ -13375,13 +13674,13 @@ import path9 from "node:path";
|
|
|
13375
13674
|
import os7 from "node:os";
|
|
13376
13675
|
|
|
13377
13676
|
// tools/cli/src/commands/add.ts
|
|
13378
|
-
|
|
13677
|
+
init_dist4();
|
|
13379
13678
|
init_helpers();
|
|
13380
13679
|
async function runAdd() {
|
|
13381
13680
|
const repoPath = process.cwd();
|
|
13382
13681
|
const serverUrl = getServerUrl();
|
|
13383
|
-
|
|
13384
|
-
|
|
13682
|
+
mt("Adding repository to TrueCourse");
|
|
13683
|
+
O2.step(repoPath);
|
|
13385
13684
|
try {
|
|
13386
13685
|
const res = await fetch(`${serverUrl}/api/repos`, {
|
|
13387
13686
|
method: "POST",
|
|
@@ -13397,33 +13696,33 @@ async function runAdd() {
|
|
|
13397
13696
|
} catch {
|
|
13398
13697
|
if (body) message = body;
|
|
13399
13698
|
}
|
|
13400
|
-
|
|
13699
|
+
O2.error(message);
|
|
13401
13700
|
process.exit(1);
|
|
13402
13701
|
}
|
|
13403
13702
|
const repo = await res.json();
|
|
13404
13703
|
const repoUrl = `${serverUrl}/repos/${repo.id}`;
|
|
13405
|
-
|
|
13704
|
+
O2.success(`Repository "${repo.name}" added`);
|
|
13406
13705
|
await promptInstallSkills(repoPath);
|
|
13407
|
-
|
|
13706
|
+
gt(`Open ${repoUrl}`);
|
|
13408
13707
|
} catch (err) {
|
|
13409
13708
|
const message = err instanceof Error ? err.message : String(err);
|
|
13410
13709
|
if (message.includes("ECONNREFUSED") || message.includes("fetch failed")) {
|
|
13411
|
-
|
|
13710
|
+
O2.error(
|
|
13412
13711
|
"Could not connect to TrueCourse server. Is it running?\n Start it with: npx truecourse start"
|
|
13413
13712
|
);
|
|
13414
13713
|
} else {
|
|
13415
|
-
|
|
13714
|
+
O2.error(message);
|
|
13416
13715
|
}
|
|
13417
13716
|
process.exit(1);
|
|
13418
13717
|
}
|
|
13419
13718
|
}
|
|
13420
13719
|
|
|
13421
13720
|
// tools/cli/src/commands/analyze.ts
|
|
13422
|
-
|
|
13721
|
+
init_dist4();
|
|
13423
13722
|
init_helpers();
|
|
13424
13723
|
|
|
13425
13724
|
// tools/cli/src/telemetry.ts
|
|
13426
|
-
|
|
13725
|
+
init_dist4();
|
|
13427
13726
|
import fs7 from "node:fs";
|
|
13428
13727
|
import path7 from "node:path";
|
|
13429
13728
|
import os6 from "node:os";
|
|
@@ -13475,7 +13774,7 @@ function showFirstRunNotice() {
|
|
|
13475
13774
|
try {
|
|
13476
13775
|
const config = readTelemetryConfig();
|
|
13477
13776
|
if (!config.enabled || config.noticeShown) return;
|
|
13478
|
-
|
|
13777
|
+
O2.info(
|
|
13479
13778
|
"TrueCourse collects anonymous usage data to improve the product. Run `npx truecourse telemetry disable` to opt out."
|
|
13480
13779
|
);
|
|
13481
13780
|
writeTelemetryConfig({ noticeShown: true });
|
|
@@ -13486,7 +13785,7 @@ function showFirstRunNotice() {
|
|
|
13486
13785
|
// tools/cli/src/commands/analyze.ts
|
|
13487
13786
|
var TIMEOUT_MS = 15 * 60 * 1e3;
|
|
13488
13787
|
async function runAnalyze({ noAutostart = false, codeReview = false, deterministicOnly = false } = {}) {
|
|
13489
|
-
|
|
13788
|
+
mt("Analyzing repository");
|
|
13490
13789
|
showFirstRunNotice();
|
|
13491
13790
|
if (noAutostart) {
|
|
13492
13791
|
const url2 = getServerUrl();
|
|
@@ -13494,16 +13793,16 @@ async function runAnalyze({ noAutostart = false, codeReview = false, determinist
|
|
|
13494
13793
|
const res = await fetch(`${url2}/api/health`);
|
|
13495
13794
|
if (!res.ok) throw new Error();
|
|
13496
13795
|
} catch {
|
|
13497
|
-
|
|
13796
|
+
O2.error("TrueCourse server is not running. Start it with: npx truecourse start");
|
|
13498
13797
|
process.exit(1);
|
|
13499
13798
|
}
|
|
13500
13799
|
}
|
|
13501
13800
|
const firstRun = noAutostart ? false : await ensureServer();
|
|
13502
13801
|
const repo = await ensureRepo();
|
|
13503
|
-
|
|
13802
|
+
O2.step(`Repository: ${repo.name}`);
|
|
13504
13803
|
const serverUrl = getServerUrl();
|
|
13505
13804
|
const socket = connectSocket(repo.id);
|
|
13506
|
-
const spinner =
|
|
13805
|
+
const spinner = fe();
|
|
13507
13806
|
spinner.start("Starting analysis...");
|
|
13508
13807
|
let canceled = false;
|
|
13509
13808
|
const onSigint = () => {
|
|
@@ -13551,11 +13850,11 @@ async function runAnalyze({ noAutostart = false, codeReview = false, determinist
|
|
|
13551
13850
|
method: "POST",
|
|
13552
13851
|
headers: { "Content-Type": "application/json" },
|
|
13553
13852
|
body: JSON.stringify({ codeReview, deterministicOnly })
|
|
13554
|
-
}).then((
|
|
13555
|
-
if (!
|
|
13853
|
+
}).then((res) => {
|
|
13854
|
+
if (!res.ok) {
|
|
13556
13855
|
clearTimeout(timeout);
|
|
13557
|
-
|
|
13558
|
-
let msg = `Server returned ${
|
|
13856
|
+
res.text().then((body) => {
|
|
13857
|
+
let msg = `Server returned ${res.status}`;
|
|
13559
13858
|
try {
|
|
13560
13859
|
const json = JSON.parse(body);
|
|
13561
13860
|
if (json.error) msg = json.error;
|
|
@@ -13571,31 +13870,35 @@ async function runAnalyze({ noAutostart = false, codeReview = false, determinist
|
|
|
13571
13870
|
});
|
|
13572
13871
|
});
|
|
13573
13872
|
spinner.stop("Analysis complete");
|
|
13574
|
-
const
|
|
13575
|
-
|
|
13576
|
-
|
|
13873
|
+
const [archRes, codeRes] = await Promise.all([
|
|
13874
|
+
fetch(`${serverUrl}/api/repos/${repo.id}/violations`),
|
|
13875
|
+
fetch(`${serverUrl}/api/repos/${repo.id}/code-violations/summary`)
|
|
13876
|
+
]);
|
|
13877
|
+
if (!archRes.ok) {
|
|
13878
|
+
O2.error(`Failed to fetch violations: ${archRes.status}`);
|
|
13577
13879
|
process.exit(1);
|
|
13578
13880
|
}
|
|
13579
|
-
const violations = await
|
|
13580
|
-
|
|
13881
|
+
const violations = await archRes.json();
|
|
13882
|
+
const codeSummary = codeRes.ok ? await codeRes.json() : void 0;
|
|
13883
|
+
renderViolationsSummary(violations, codeSummary);
|
|
13581
13884
|
if (!deterministicOnly) {
|
|
13582
|
-
|
|
13885
|
+
O2.info("Code review running in background \u2014 results will appear in the dashboard");
|
|
13583
13886
|
}
|
|
13584
13887
|
const repoUrl = `${serverUrl}/repos/${repo.id}`;
|
|
13585
13888
|
if (firstRun) {
|
|
13586
13889
|
openInBrowser(repoUrl);
|
|
13587
|
-
|
|
13890
|
+
gt("Analysis complete \u2014 opened in browser");
|
|
13588
13891
|
} else {
|
|
13589
|
-
|
|
13892
|
+
gt(`Analysis complete \u2014 open ${repoUrl}`);
|
|
13590
13893
|
}
|
|
13591
13894
|
} catch (err) {
|
|
13592
13895
|
const message = err instanceof Error ? err.message : String(err);
|
|
13593
13896
|
if (message === "CANCELED") {
|
|
13594
13897
|
spinner.stop("Analysis cancelled");
|
|
13595
|
-
|
|
13898
|
+
gt("Analysis cancelled");
|
|
13596
13899
|
} else {
|
|
13597
13900
|
spinner.stop("Analysis failed");
|
|
13598
|
-
|
|
13901
|
+
O2.error(message);
|
|
13599
13902
|
process.exit(1);
|
|
13600
13903
|
}
|
|
13601
13904
|
} finally {
|
|
@@ -13604,7 +13907,7 @@ async function runAnalyze({ noAutostart = false, codeReview = false, determinist
|
|
|
13604
13907
|
}
|
|
13605
13908
|
}
|
|
13606
13909
|
async function runAnalyzeDiff({ noAutostart = false } = {}) {
|
|
13607
|
-
|
|
13910
|
+
mt("Running diff check");
|
|
13608
13911
|
showFirstRunNotice();
|
|
13609
13912
|
if (noAutostart) {
|
|
13610
13913
|
const url2 = getServerUrl();
|
|
@@ -13612,17 +13915,17 @@ async function runAnalyzeDiff({ noAutostart = false } = {}) {
|
|
|
13612
13915
|
const res = await fetch(`${url2}/api/health`);
|
|
13613
13916
|
if (!res.ok) throw new Error();
|
|
13614
13917
|
} catch {
|
|
13615
|
-
|
|
13918
|
+
O2.error("TrueCourse server is not running. Start it with: npx truecourse start");
|
|
13616
13919
|
process.exit(1);
|
|
13617
13920
|
}
|
|
13618
13921
|
} else {
|
|
13619
13922
|
await ensureServer();
|
|
13620
13923
|
}
|
|
13621
13924
|
const repo = await ensureRepo();
|
|
13622
|
-
|
|
13925
|
+
O2.step(`Repository: ${repo.name}`);
|
|
13623
13926
|
const serverUrl = getServerUrl();
|
|
13624
13927
|
const socket = connectSocket(repo.id);
|
|
13625
|
-
const spinner =
|
|
13928
|
+
const spinner = fe();
|
|
13626
13929
|
spinner.start("Checking changes...");
|
|
13627
13930
|
socket.on("analysis:progress", (data) => {
|
|
13628
13931
|
const detail = data.detail ? ` \u2014 ${data.detail}` : "";
|
|
@@ -13651,7 +13954,7 @@ async function runAnalyzeDiff({ noAutostart = false } = {}) {
|
|
|
13651
13954
|
} catch (err) {
|
|
13652
13955
|
spinner.stop("Diff check failed");
|
|
13653
13956
|
const message = err instanceof Error ? err.message : String(err);
|
|
13654
|
-
|
|
13957
|
+
O2.error(message);
|
|
13655
13958
|
process.exit(1);
|
|
13656
13959
|
} finally {
|
|
13657
13960
|
socket.disconnect();
|
|
@@ -13659,44 +13962,44 @@ async function runAnalyzeDiff({ noAutostart = false } = {}) {
|
|
|
13659
13962
|
}
|
|
13660
13963
|
|
|
13661
13964
|
// tools/cli/src/commands/list.ts
|
|
13662
|
-
|
|
13965
|
+
init_dist4();
|
|
13663
13966
|
init_helpers();
|
|
13664
13967
|
async function runList() {
|
|
13665
|
-
|
|
13968
|
+
mt("Violations");
|
|
13666
13969
|
await ensureServer();
|
|
13667
13970
|
const repo = await ensureRepo();
|
|
13668
13971
|
const serverUrl = getServerUrl();
|
|
13669
13972
|
const res = await fetch(`${serverUrl}/api/repos/${repo.id}/violations`);
|
|
13670
13973
|
if (!res.ok) {
|
|
13671
|
-
|
|
13974
|
+
O2.error(`Failed to fetch violations: ${res.status}`);
|
|
13672
13975
|
process.exit(1);
|
|
13673
13976
|
}
|
|
13674
13977
|
const violations = await res.json();
|
|
13675
13978
|
renderViolations(violations);
|
|
13676
13979
|
}
|
|
13677
13980
|
async function runListDiff() {
|
|
13678
|
-
|
|
13981
|
+
mt("Diff check results");
|
|
13679
13982
|
await ensureServer();
|
|
13680
13983
|
const repo = await ensureRepo();
|
|
13681
13984
|
const serverUrl = getServerUrl();
|
|
13682
13985
|
const res = await fetch(`${serverUrl}/api/repos/${repo.id}/diff-check`);
|
|
13683
13986
|
if (!res.ok) {
|
|
13684
|
-
|
|
13987
|
+
O2.error(`Failed to fetch diff check results: ${res.status}`);
|
|
13685
13988
|
process.exit(1);
|
|
13686
13989
|
}
|
|
13687
13990
|
const result = await res.json();
|
|
13688
13991
|
if (!result) {
|
|
13689
|
-
|
|
13992
|
+
O2.info("No diff check found. Run `truecourse analyze --diff` first.");
|
|
13690
13993
|
return;
|
|
13691
13994
|
}
|
|
13692
13995
|
if (result.isStale) {
|
|
13693
|
-
|
|
13996
|
+
O2.warn("Results may be stale \u2014 baseline analysis has changed.");
|
|
13694
13997
|
}
|
|
13695
13998
|
renderDiffResults(result);
|
|
13696
13999
|
}
|
|
13697
14000
|
|
|
13698
14001
|
// tools/cli/src/commands/service/index.ts
|
|
13699
|
-
|
|
14002
|
+
init_dist4();
|
|
13700
14003
|
init_platform();
|
|
13701
14004
|
init_logs();
|
|
13702
14005
|
init_helpers();
|
|
@@ -13714,14 +14017,14 @@ async function healthcheck2() {
|
|
|
13714
14017
|
if (res.ok) return true;
|
|
13715
14018
|
} catch {
|
|
13716
14019
|
}
|
|
13717
|
-
await new Promise((
|
|
14020
|
+
await new Promise((r) => setTimeout(r, 500));
|
|
13718
14021
|
}
|
|
13719
14022
|
return false;
|
|
13720
14023
|
}
|
|
13721
14024
|
function registerServiceCommand(program3) {
|
|
13722
14025
|
const service = program3.command("service").description("Manage TrueCourse as a background service");
|
|
13723
14026
|
service.command("install").description("Install and start TrueCourse as a background service").action(async () => {
|
|
13724
|
-
|
|
14027
|
+
mt("Installing TrueCourse service");
|
|
13725
14028
|
const platform = getPlatform();
|
|
13726
14029
|
const serverPath = getServerPath2();
|
|
13727
14030
|
const logDir = getLogDir();
|
|
@@ -13731,75 +14034,75 @@ function registerServiceCommand(program3) {
|
|
|
13731
14034
|
try {
|
|
13732
14035
|
const installed = await platform.isInstalled();
|
|
13733
14036
|
if (installed) {
|
|
13734
|
-
|
|
14037
|
+
O2.warn("Service is already installed. Use `truecourse service start` to start it.");
|
|
13735
14038
|
return;
|
|
13736
14039
|
}
|
|
13737
|
-
|
|
14040
|
+
O2.step("Installing service...");
|
|
13738
14041
|
await platform.install(serverPath, logPath);
|
|
13739
|
-
|
|
14042
|
+
O2.step("Waiting for server to start...");
|
|
13740
14043
|
const healthy = await healthcheck2();
|
|
13741
14044
|
if (healthy) {
|
|
13742
14045
|
writeConfig({ runMode: "service" });
|
|
13743
14046
|
const url2 = getServerUrl();
|
|
13744
|
-
|
|
14047
|
+
O2.success(`TrueCourse is running at ${url2}`);
|
|
13745
14048
|
} else {
|
|
13746
|
-
|
|
13747
|
-
|
|
14049
|
+
O2.warn("Service installed but server hasn't responded yet.");
|
|
14050
|
+
O2.info("Check logs with: truecourse service logs");
|
|
13748
14051
|
}
|
|
13749
14052
|
} catch (error) {
|
|
13750
|
-
|
|
14053
|
+
O2.error(`Failed to install service: ${error.message}`);
|
|
13751
14054
|
process.exit(1);
|
|
13752
14055
|
}
|
|
13753
|
-
|
|
14056
|
+
gt("Service installed");
|
|
13754
14057
|
});
|
|
13755
14058
|
service.command("uninstall").description("Stop and remove the TrueCourse background service").action(async () => {
|
|
13756
|
-
|
|
14059
|
+
mt("Uninstalling TrueCourse service");
|
|
13757
14060
|
const platform = getPlatform();
|
|
13758
14061
|
try {
|
|
13759
14062
|
const installed = await platform.isInstalled();
|
|
13760
14063
|
if (!installed) {
|
|
13761
|
-
|
|
14064
|
+
O2.warn("Service is not installed.");
|
|
13762
14065
|
return;
|
|
13763
14066
|
}
|
|
13764
|
-
|
|
14067
|
+
O2.step("Stopping and removing service...");
|
|
13765
14068
|
await platform.uninstall();
|
|
13766
14069
|
writeConfig({ runMode: "console" });
|
|
13767
|
-
|
|
14070
|
+
O2.success("Service removed. TrueCourse will run in console mode.");
|
|
13768
14071
|
} catch (error) {
|
|
13769
|
-
|
|
14072
|
+
O2.error(`Failed to uninstall service: ${error.message}`);
|
|
13770
14073
|
process.exit(1);
|
|
13771
14074
|
}
|
|
13772
|
-
|
|
14075
|
+
gt("Service uninstalled");
|
|
13773
14076
|
});
|
|
13774
14077
|
service.command("start").description("Start the TrueCourse background service").action(async () => {
|
|
13775
14078
|
const platform = getPlatform();
|
|
13776
14079
|
try {
|
|
13777
14080
|
const installed = await platform.isInstalled();
|
|
13778
14081
|
if (!installed) {
|
|
13779
|
-
|
|
14082
|
+
O2.error("Service is not installed. Run `truecourse service install` first.");
|
|
13780
14083
|
process.exit(1);
|
|
13781
14084
|
}
|
|
13782
14085
|
const { running } = await platform.status();
|
|
13783
14086
|
if (running) {
|
|
13784
14087
|
const url2 = getServerUrl();
|
|
13785
|
-
|
|
14088
|
+
O2.info(`TrueCourse is already running at ${url2}`);
|
|
13786
14089
|
return;
|
|
13787
14090
|
}
|
|
13788
14091
|
const logDir = getLogDir();
|
|
13789
14092
|
rotateLogs(logDir);
|
|
13790
14093
|
rotateErrorLogs(logDir);
|
|
13791
|
-
|
|
14094
|
+
O2.step("Starting service...");
|
|
13792
14095
|
await platform.start();
|
|
13793
14096
|
const healthy = await healthcheck2();
|
|
13794
14097
|
if (healthy) {
|
|
13795
14098
|
const url2 = getServerUrl();
|
|
13796
|
-
|
|
14099
|
+
O2.success(`TrueCourse is running at ${url2}`);
|
|
13797
14100
|
} else {
|
|
13798
|
-
|
|
13799
|
-
|
|
14101
|
+
O2.warn("Service started but server hasn't responded yet.");
|
|
14102
|
+
O2.info("Check logs with: truecourse service logs");
|
|
13800
14103
|
}
|
|
13801
14104
|
} catch (error) {
|
|
13802
|
-
|
|
14105
|
+
O2.error(`Failed to start service: ${error.message}`);
|
|
13803
14106
|
process.exit(1);
|
|
13804
14107
|
}
|
|
13805
14108
|
});
|
|
@@ -13808,14 +14111,14 @@ function registerServiceCommand(program3) {
|
|
|
13808
14111
|
try {
|
|
13809
14112
|
const { running } = await platform.status();
|
|
13810
14113
|
if (!running) {
|
|
13811
|
-
|
|
14114
|
+
O2.info("Service is not running.");
|
|
13812
14115
|
return;
|
|
13813
14116
|
}
|
|
13814
|
-
|
|
14117
|
+
O2.step("Stopping service...");
|
|
13815
14118
|
await platform.stop();
|
|
13816
|
-
|
|
14119
|
+
O2.success("Service stopped.");
|
|
13817
14120
|
} catch (error) {
|
|
13818
|
-
|
|
14121
|
+
O2.error(`Failed to stop service: ${error.message}`);
|
|
13819
14122
|
process.exit(1);
|
|
13820
14123
|
}
|
|
13821
14124
|
});
|
|
@@ -13824,29 +14127,29 @@ function registerServiceCommand(program3) {
|
|
|
13824
14127
|
try {
|
|
13825
14128
|
const installed = await platform.isInstalled();
|
|
13826
14129
|
if (!installed) {
|
|
13827
|
-
|
|
14130
|
+
O2.info("Service is not installed.");
|
|
13828
14131
|
return;
|
|
13829
14132
|
}
|
|
13830
14133
|
const { running, pid } = await platform.status();
|
|
13831
14134
|
if (running) {
|
|
13832
14135
|
const pidInfo = pid ? ` (PID: ${pid})` : "";
|
|
13833
|
-
|
|
14136
|
+
O2.success(`Service is running${pidInfo}`);
|
|
13834
14137
|
const url2 = getServerUrl();
|
|
13835
14138
|
try {
|
|
13836
14139
|
const res = await fetch(`${url2}/api/health`);
|
|
13837
14140
|
if (res.ok) {
|
|
13838
|
-
|
|
14141
|
+
O2.info(`Server is healthy at ${url2}`);
|
|
13839
14142
|
} else {
|
|
13840
|
-
|
|
14143
|
+
O2.warn(`Server returned status ${res.status}`);
|
|
13841
14144
|
}
|
|
13842
14145
|
} catch {
|
|
13843
|
-
|
|
14146
|
+
O2.warn("Service process is running but server is not responding.");
|
|
13844
14147
|
}
|
|
13845
14148
|
} else {
|
|
13846
|
-
|
|
14149
|
+
O2.info("Service is installed but not running.");
|
|
13847
14150
|
}
|
|
13848
14151
|
} catch (error) {
|
|
13849
|
-
|
|
14152
|
+
O2.error(`Failed to get status: ${error.message}`);
|
|
13850
14153
|
process.exit(1);
|
|
13851
14154
|
}
|
|
13852
14155
|
});
|
|
@@ -13894,34 +14197,34 @@ program2.command("stop").description("Stop the TrueCourse background service").a
|
|
|
13894
14197
|
const platform = getPlatform();
|
|
13895
14198
|
const { running } = await platform.status();
|
|
13896
14199
|
if (running) {
|
|
13897
|
-
|
|
14200
|
+
O2.step("Stopping background service...");
|
|
13898
14201
|
await platform.stop();
|
|
13899
|
-
|
|
14202
|
+
O2.success("Service stopped.");
|
|
13900
14203
|
} else {
|
|
13901
|
-
|
|
14204
|
+
O2.info("Service is not running.");
|
|
13902
14205
|
}
|
|
13903
14206
|
} else {
|
|
13904
|
-
|
|
13905
|
-
|
|
14207
|
+
O2.info("TrueCourse is running in console mode.");
|
|
14208
|
+
O2.info("Press Ctrl+C in the terminal where TrueCourse is running.");
|
|
13906
14209
|
}
|
|
13907
14210
|
});
|
|
13908
14211
|
var telemetryCmd = program2.command("telemetry").description("Manage anonymous usage telemetry");
|
|
13909
14212
|
telemetryCmd.command("enable").description("Enable anonymous usage telemetry").action(() => {
|
|
13910
14213
|
writeTelemetryConfig({ enabled: true });
|
|
13911
|
-
|
|
14214
|
+
O2.success("Telemetry enabled. Thank you for helping improve TrueCourse!");
|
|
13912
14215
|
});
|
|
13913
14216
|
telemetryCmd.command("disable").description("Disable anonymous usage telemetry").action(() => {
|
|
13914
14217
|
writeTelemetryConfig({ enabled: false });
|
|
13915
|
-
|
|
14218
|
+
O2.success("Telemetry disabled. No data will be collected.");
|
|
13916
14219
|
});
|
|
13917
14220
|
telemetryCmd.command("status").description("Show current telemetry status").action(() => {
|
|
13918
14221
|
const config = readTelemetryConfig();
|
|
13919
14222
|
if (process.env.CI === "true") {
|
|
13920
|
-
|
|
14223
|
+
O2.info("Telemetry is automatically disabled in CI environments.");
|
|
13921
14224
|
} else if (config.enabled) {
|
|
13922
|
-
|
|
14225
|
+
O2.info("Telemetry is enabled.");
|
|
13923
14226
|
} else {
|
|
13924
|
-
|
|
14227
|
+
O2.info("Telemetry is disabled.");
|
|
13925
14228
|
}
|
|
13926
14229
|
});
|
|
13927
14230
|
program2.action(async () => {
|