ccstatusline-usage 2.3.16 → 2.3.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/ccstatusline.js +662 -842
- package/package.json +1 -1
package/dist/ccstatusline.js
CHANGED
|
@@ -1355,7 +1355,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
|
|
|
1355
1355
|
exports.useTransition = function() {
|
|
1356
1356
|
return resolveDispatcher().useTransition();
|
|
1357
1357
|
};
|
|
1358
|
-
exports.version = "19.2.
|
|
1358
|
+
exports.version = "19.2.5";
|
|
1359
1359
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1360
1360
|
})();
|
|
1361
1361
|
});
|
|
@@ -13433,6 +13433,7 @@ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
|
13433
13433
|
}
|
|
13434
13434
|
var init_get_east_asian_width = __esm(() => {
|
|
13435
13435
|
init_lookup();
|
|
13436
|
+
init_lookup();
|
|
13436
13437
|
});
|
|
13437
13438
|
|
|
13438
13439
|
// node_modules/emoji-regex/index.js
|
|
@@ -13442,7 +13443,7 @@ var require_emoji_regex = __commonJS((exports, module) => {
|
|
|
13442
13443
|
};
|
|
13443
13444
|
});
|
|
13444
13445
|
|
|
13445
|
-
// node_modules/
|
|
13446
|
+
// node_modules/string-width/index.js
|
|
13446
13447
|
function stringWidth(string, options = {}) {
|
|
13447
13448
|
if (typeof string !== "string" || string.length === 0) {
|
|
13448
13449
|
return 0;
|
|
@@ -13534,82 +13535,6 @@ var init_measure_text = __esm(() => {
|
|
|
13534
13535
|
measure_text_default = measureText;
|
|
13535
13536
|
});
|
|
13536
13537
|
|
|
13537
|
-
// node_modules/string-width/node_modules/strip-ansi/node_modules/ansi-regex/index.js
|
|
13538
|
-
function ansiRegex2({ onlyFirst = false } = {}) {
|
|
13539
|
-
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
13540
|
-
const pattern = [
|
|
13541
|
-
`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${ST})`,
|
|
13542
|
-
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"
|
|
13543
|
-
].join("|");
|
|
13544
|
-
return new RegExp(pattern, onlyFirst ? undefined : "g");
|
|
13545
|
-
}
|
|
13546
|
-
|
|
13547
|
-
// node_modules/string-width/node_modules/strip-ansi/index.js
|
|
13548
|
-
function stripAnsi2(string) {
|
|
13549
|
-
if (typeof string !== "string") {
|
|
13550
|
-
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
13551
|
-
}
|
|
13552
|
-
return string.replace(regex2, "");
|
|
13553
|
-
}
|
|
13554
|
-
var regex2;
|
|
13555
|
-
var init_strip_ansi2 = __esm(() => {
|
|
13556
|
-
regex2 = ansiRegex2();
|
|
13557
|
-
});
|
|
13558
|
-
|
|
13559
|
-
// node_modules/string-width/index.js
|
|
13560
|
-
function stringWidth2(string, options = {}) {
|
|
13561
|
-
if (typeof string !== "string" || string.length === 0) {
|
|
13562
|
-
return 0;
|
|
13563
|
-
}
|
|
13564
|
-
const {
|
|
13565
|
-
ambiguousIsNarrow = true,
|
|
13566
|
-
countAnsiEscapeCodes = false
|
|
13567
|
-
} = options;
|
|
13568
|
-
if (!countAnsiEscapeCodes) {
|
|
13569
|
-
string = stripAnsi2(string);
|
|
13570
|
-
}
|
|
13571
|
-
if (string.length === 0) {
|
|
13572
|
-
return 0;
|
|
13573
|
-
}
|
|
13574
|
-
let width = 0;
|
|
13575
|
-
const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
|
|
13576
|
-
for (const { segment: character } of segmenter2.segment(string)) {
|
|
13577
|
-
const codePoint = character.codePointAt(0);
|
|
13578
|
-
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
|
|
13579
|
-
continue;
|
|
13580
|
-
}
|
|
13581
|
-
if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
|
|
13582
|
-
continue;
|
|
13583
|
-
}
|
|
13584
|
-
if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
|
|
13585
|
-
continue;
|
|
13586
|
-
}
|
|
13587
|
-
if (codePoint >= 55296 && codePoint <= 57343) {
|
|
13588
|
-
continue;
|
|
13589
|
-
}
|
|
13590
|
-
if (codePoint >= 65024 && codePoint <= 65039) {
|
|
13591
|
-
continue;
|
|
13592
|
-
}
|
|
13593
|
-
if (defaultIgnorableCodePointRegex2.test(character)) {
|
|
13594
|
-
continue;
|
|
13595
|
-
}
|
|
13596
|
-
if (import_emoji_regex2.default().test(character)) {
|
|
13597
|
-
width += 2;
|
|
13598
|
-
continue;
|
|
13599
|
-
}
|
|
13600
|
-
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
13601
|
-
}
|
|
13602
|
-
return width;
|
|
13603
|
-
}
|
|
13604
|
-
var import_emoji_regex2, segmenter2, defaultIgnorableCodePointRegex2;
|
|
13605
|
-
var init_string_width2 = __esm(() => {
|
|
13606
|
-
init_strip_ansi2();
|
|
13607
|
-
init_get_east_asian_width();
|
|
13608
|
-
import_emoji_regex2 = __toESM(require_emoji_regex(), 1);
|
|
13609
|
-
segmenter2 = new Intl.Segmenter;
|
|
13610
|
-
defaultIgnorableCodePointRegex2 = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
13611
|
-
});
|
|
13612
|
-
|
|
13613
13538
|
// node_modules/ansi-styles/index.js
|
|
13614
13539
|
function assembleStyles2() {
|
|
13615
13540
|
const codes = new Map;
|
|
@@ -13794,13 +13719,13 @@ function wrapAnsi(string, columns, options) {
|
|
|
13794
13719
|
`).map((line) => exec(line, columns, options)).join(`
|
|
13795
13720
|
`);
|
|
13796
13721
|
}
|
|
13797
|
-
var ESCAPES, END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_CSI = "[", ANSI_OSC = "]", ANSI_SGR_TERMINATOR = "m", ANSI_ESCAPE_LINK, wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`, wrapAnsiHyperlink = (url) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`, wordLengths = (string) => string.split(" ").map((character) =>
|
|
13722
|
+
var ESCAPES, END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_CSI = "[", ANSI_OSC = "]", ANSI_SGR_TERMINATOR = "m", ANSI_ESCAPE_LINK, wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`, wrapAnsiHyperlink = (url) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`, wordLengths = (string) => string.split(" ").map((character) => stringWidth(character)), wrapWord = (rows, word, columns) => {
|
|
13798
13723
|
const characters = [...word];
|
|
13799
13724
|
let isInsideEscape = false;
|
|
13800
13725
|
let isInsideLinkEscape = false;
|
|
13801
|
-
let visible =
|
|
13726
|
+
let visible = stringWidth(stripAnsi(rows.at(-1)));
|
|
13802
13727
|
for (const [index, character] of characters.entries()) {
|
|
13803
|
-
const characterLength =
|
|
13728
|
+
const characterLength = stringWidth(character);
|
|
13804
13729
|
if (visible + characterLength <= columns) {
|
|
13805
13730
|
rows[rows.length - 1] += character;
|
|
13806
13731
|
} else {
|
|
@@ -13836,7 +13761,7 @@ var ESCAPES, END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_CSI = "[", ANSI_OSC
|
|
|
13836
13761
|
const words2 = string.split(" ");
|
|
13837
13762
|
let last2 = words2.length;
|
|
13838
13763
|
while (last2 > 0) {
|
|
13839
|
-
if (
|
|
13764
|
+
if (stringWidth(words2[last2 - 1]) > 0) {
|
|
13840
13765
|
break;
|
|
13841
13766
|
}
|
|
13842
13767
|
last2--;
|
|
@@ -13858,7 +13783,7 @@ var ESCAPES, END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_CSI = "[", ANSI_OSC
|
|
|
13858
13783
|
if (options.trim !== false) {
|
|
13859
13784
|
rows[rows.length - 1] = rows.at(-1).trimStart();
|
|
13860
13785
|
}
|
|
13861
|
-
let rowLength =
|
|
13786
|
+
let rowLength = stringWidth(rows.at(-1));
|
|
13862
13787
|
if (index !== 0) {
|
|
13863
13788
|
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
13864
13789
|
rows.push("");
|
|
@@ -13933,7 +13858,7 @@ var ESCAPES, END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_CSI = "[", ANSI_OSC
|
|
|
13933
13858
|
return returnValue;
|
|
13934
13859
|
};
|
|
13935
13860
|
var init_wrap_ansi = __esm(() => {
|
|
13936
|
-
|
|
13861
|
+
init_string_width();
|
|
13937
13862
|
init_strip_ansi();
|
|
13938
13863
|
init_ansi_styles2();
|
|
13939
13864
|
ESCAPES = new Set([
|
|
@@ -14069,7 +13994,7 @@ function cliTruncate(text, columns, options = {}) {
|
|
|
14069
13994
|
if (columns === 1) {
|
|
14070
13995
|
return truncationCharacter;
|
|
14071
13996
|
}
|
|
14072
|
-
const length =
|
|
13997
|
+
const length = stringWidth(text);
|
|
14073
13998
|
if (length <= columns) {
|
|
14074
13999
|
return text;
|
|
14075
14000
|
}
|
|
@@ -14081,7 +14006,7 @@ function cliTruncate(text, columns, options = {}) {
|
|
|
14081
14006
|
if (space === true) {
|
|
14082
14007
|
truncationCharacter += " ";
|
|
14083
14008
|
}
|
|
14084
|
-
return truncationCharacter + sliceAnsi(text, length - columns +
|
|
14009
|
+
return truncationCharacter + sliceAnsi(text, length - columns + stringWidth(truncationCharacter), length);
|
|
14085
14010
|
}
|
|
14086
14011
|
if (position === "middle") {
|
|
14087
14012
|
if (space === true) {
|
|
@@ -14093,7 +14018,7 @@ function cliTruncate(text, columns, options = {}) {
|
|
|
14093
14018
|
const spaceNearSecondBreakPoint = getIndexOfNearestSpace(text, length - (columns - half) + 1, true);
|
|
14094
14019
|
return sliceAnsi(text, 0, spaceNearFirstBreakPoint) + truncationCharacter + sliceAnsi(text, spaceNearSecondBreakPoint, length).trim();
|
|
14095
14020
|
}
|
|
14096
|
-
return sliceAnsi(text, 0, half) + truncationCharacter + sliceAnsi(text, length - (columns - half) +
|
|
14021
|
+
return sliceAnsi(text, 0, half) + truncationCharacter + sliceAnsi(text, length - (columns - half) + stringWidth(truncationCharacter), length);
|
|
14097
14022
|
}
|
|
14098
14023
|
if (position === "end") {
|
|
14099
14024
|
if (preferTruncationOnSpace) {
|
|
@@ -14103,13 +14028,13 @@ function cliTruncate(text, columns, options = {}) {
|
|
|
14103
14028
|
if (space === true) {
|
|
14104
14029
|
truncationCharacter = ` ${truncationCharacter}`;
|
|
14105
14030
|
}
|
|
14106
|
-
return sliceAnsi(text, 0, columns -
|
|
14031
|
+
return sliceAnsi(text, 0, columns - stringWidth(truncationCharacter)) + truncationCharacter;
|
|
14107
14032
|
}
|
|
14108
14033
|
throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${position}`);
|
|
14109
14034
|
}
|
|
14110
14035
|
var init_cli_truncate = __esm(() => {
|
|
14111
14036
|
init_slice_ansi();
|
|
14112
|
-
|
|
14037
|
+
init_string_width();
|
|
14113
14038
|
});
|
|
14114
14039
|
|
|
14115
14040
|
// node_modules/ink/build/wrap-text.js
|
|
@@ -34475,8 +34400,8 @@ function indentString(string, count = 1, options = {}) {
|
|
|
34475
34400
|
if (count === 0) {
|
|
34476
34401
|
return string;
|
|
34477
34402
|
}
|
|
34478
|
-
const
|
|
34479
|
-
return string.replace(
|
|
34403
|
+
const regex2 = includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
|
|
34404
|
+
return string.replace(regex2, indent.repeat(count));
|
|
34480
34405
|
}
|
|
34481
34406
|
|
|
34482
34407
|
// node_modules/ink/build/get-max-width.js
|
|
@@ -34582,7 +34507,7 @@ var require_cli_boxes = __commonJS((exports, module) => {
|
|
|
34582
34507
|
});
|
|
34583
34508
|
|
|
34584
34509
|
// node_modules/ink/build/colorize.js
|
|
34585
|
-
var rgbRegex,
|
|
34510
|
+
var rgbRegex, ansiRegex2, isNamedColor = (color) => {
|
|
34586
34511
|
return color in source_default;
|
|
34587
34512
|
}, colorize = (str, color, type) => {
|
|
34588
34513
|
if (!color) {
|
|
@@ -34599,7 +34524,7 @@ var rgbRegex, ansiRegex3, isNamedColor = (color) => {
|
|
|
34599
34524
|
return type === "foreground" ? source_default.hex(color)(str) : source_default.bgHex(color)(str);
|
|
34600
34525
|
}
|
|
34601
34526
|
if (color.startsWith("ansi256")) {
|
|
34602
|
-
const matches2 =
|
|
34527
|
+
const matches2 = ansiRegex2.exec(color);
|
|
34603
34528
|
if (!matches2) {
|
|
34604
34529
|
return str;
|
|
34605
34530
|
}
|
|
@@ -34621,7 +34546,7 @@ var rgbRegex, ansiRegex3, isNamedColor = (color) => {
|
|
|
34621
34546
|
var init_colorize = __esm(() => {
|
|
34622
34547
|
init_source();
|
|
34623
34548
|
rgbRegex = /^rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/;
|
|
34624
|
-
|
|
34549
|
+
ansiRegex2 = /^ansi256\(\s?(\d+)\s?\)$/;
|
|
34625
34550
|
colorize_default = colorize;
|
|
34626
34551
|
});
|
|
34627
34552
|
|
|
@@ -34831,94 +34756,15 @@ var init_render_node_to_output = __esm(async () => {
|
|
|
34831
34756
|
render_node_to_output_default = renderNodeToOutput;
|
|
34832
34757
|
});
|
|
34833
34758
|
|
|
34834
|
-
// node_modules/slice-ansi/node_modules/is-fullwidth-code-point/node_modules/get-east-asian-width/lookup-data.js
|
|
34835
|
-
var ambiguousRanges2, fullwidthRanges2, halfwidthRanges2, narrowRanges2, wideRanges2;
|
|
34836
|
-
var init_lookup_data2 = __esm(() => {
|
|
34837
|
-
ambiguousRanges2 = [161, 161, 164, 164, 167, 168, 170, 170, 173, 174, 176, 180, 182, 186, 188, 191, 198, 198, 208, 208, 215, 216, 222, 225, 230, 230, 232, 234, 236, 237, 240, 240, 242, 243, 247, 250, 252, 252, 254, 254, 257, 257, 273, 273, 275, 275, 283, 283, 294, 295, 299, 299, 305, 307, 312, 312, 319, 322, 324, 324, 328, 331, 333, 333, 338, 339, 358, 359, 363, 363, 462, 462, 464, 464, 466, 466, 468, 468, 470, 470, 472, 472, 474, 474, 476, 476, 593, 593, 609, 609, 708, 708, 711, 711, 713, 715, 717, 717, 720, 720, 728, 731, 733, 733, 735, 735, 768, 879, 913, 929, 931, 937, 945, 961, 963, 969, 1025, 1025, 1040, 1103, 1105, 1105, 8208, 8208, 8211, 8214, 8216, 8217, 8220, 8221, 8224, 8226, 8228, 8231, 8240, 8240, 8242, 8243, 8245, 8245, 8251, 8251, 8254, 8254, 8308, 8308, 8319, 8319, 8321, 8324, 8364, 8364, 8451, 8451, 8453, 8453, 8457, 8457, 8467, 8467, 8470, 8470, 8481, 8482, 8486, 8486, 8491, 8491, 8531, 8532, 8539, 8542, 8544, 8555, 8560, 8569, 8585, 8585, 8592, 8601, 8632, 8633, 8658, 8658, 8660, 8660, 8679, 8679, 8704, 8704, 8706, 8707, 8711, 8712, 8715, 8715, 8719, 8719, 8721, 8721, 8725, 8725, 8730, 8730, 8733, 8736, 8739, 8739, 8741, 8741, 8743, 8748, 8750, 8750, 8756, 8759, 8764, 8765, 8776, 8776, 8780, 8780, 8786, 8786, 8800, 8801, 8804, 8807, 8810, 8811, 8814, 8815, 8834, 8835, 8838, 8839, 8853, 8853, 8857, 8857, 8869, 8869, 8895, 8895, 8978, 8978, 9312, 9449, 9451, 9547, 9552, 9587, 9600, 9615, 9618, 9621, 9632, 9633, 9635, 9641, 9650, 9651, 9654, 9655, 9660, 9661, 9664, 9665, 9670, 9672, 9675, 9675, 9678, 9681, 9698, 9701, 9711, 9711, 9733, 9734, 9737, 9737, 9742, 9743, 9756, 9756, 9758, 9758, 9792, 9792, 9794, 9794, 9824, 9825, 9827, 9829, 9831, 9834, 9836, 9837, 9839, 9839, 9886, 9887, 9919, 9919, 9926, 9933, 9935, 9939, 9941, 9953, 9955, 9955, 9960, 9961, 9963, 9969, 9972, 9972, 9974, 9977, 9979, 9980, 9982, 9983, 10045, 10045, 10102, 10111, 11094, 11097, 12872, 12879, 57344, 63743, 65024, 65039, 65533, 65533, 127232, 127242, 127248, 127277, 127280, 127337, 127344, 127373, 127375, 127376, 127387, 127404, 917760, 917999, 983040, 1048573, 1048576, 1114109];
|
|
34838
|
-
fullwidthRanges2 = [12288, 12288, 65281, 65376, 65504, 65510];
|
|
34839
|
-
halfwidthRanges2 = [8361, 8361, 65377, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65512, 65518];
|
|
34840
|
-
narrowRanges2 = [32, 126, 162, 163, 165, 166, 172, 172, 175, 175, 10214, 10221, 10629, 10630];
|
|
34841
|
-
wideRanges2 = [4352, 4447, 8986, 8987, 9001, 9002, 9193, 9196, 9200, 9200, 9203, 9203, 9725, 9726, 9748, 9749, 9776, 9783, 9800, 9811, 9855, 9855, 9866, 9871, 9875, 9875, 9889, 9889, 9898, 9899, 9917, 9918, 9924, 9925, 9934, 9934, 9940, 9940, 9962, 9962, 9970, 9971, 9973, 9973, 9978, 9978, 9981, 9981, 9989, 9989, 9994, 9995, 10024, 10024, 10060, 10060, 10062, 10062, 10067, 10069, 10071, 10071, 10133, 10135, 10160, 10160, 10175, 10175, 11035, 11036, 11088, 11088, 11093, 11093, 11904, 11929, 11931, 12019, 12032, 12245, 12272, 12287, 12289, 12350, 12353, 12438, 12441, 12543, 12549, 12591, 12593, 12686, 12688, 12773, 12783, 12830, 12832, 12871, 12880, 42124, 42128, 42182, 43360, 43388, 44032, 55203, 63744, 64255, 65040, 65049, 65072, 65106, 65108, 65126, 65128, 65131, 94176, 94180, 94192, 94198, 94208, 101589, 101631, 101662, 101760, 101874, 110576, 110579, 110581, 110587, 110589, 110590, 110592, 110882, 110898, 110898, 110928, 110930, 110933, 110933, 110948, 110951, 110960, 111355, 119552, 119638, 119648, 119670, 126980, 126980, 127183, 127183, 127374, 127374, 127377, 127386, 127488, 127490, 127504, 127547, 127552, 127560, 127568, 127569, 127584, 127589, 127744, 127776, 127789, 127797, 127799, 127868, 127870, 127891, 127904, 127946, 127951, 127955, 127968, 127984, 127988, 127988, 127992, 128062, 128064, 128064, 128066, 128252, 128255, 128317, 128331, 128334, 128336, 128359, 128378, 128378, 128405, 128406, 128420, 128420, 128507, 128591, 128640, 128709, 128716, 128716, 128720, 128722, 128725, 128728, 128732, 128735, 128747, 128748, 128756, 128764, 128992, 129003, 129008, 129008, 129292, 129338, 129340, 129349, 129351, 129535, 129648, 129660, 129664, 129674, 129678, 129734, 129736, 129736, 129741, 129756, 129759, 129770, 129775, 129784, 131072, 196605, 196608, 262141];
|
|
34842
|
-
});
|
|
34843
|
-
|
|
34844
|
-
// node_modules/slice-ansi/node_modules/is-fullwidth-code-point/node_modules/get-east-asian-width/utilities.js
|
|
34845
|
-
var isInRange2 = (ranges, codePoint) => {
|
|
34846
|
-
let low = 0;
|
|
34847
|
-
let high = Math.floor(ranges.length / 2) - 1;
|
|
34848
|
-
while (low <= high) {
|
|
34849
|
-
const mid = Math.floor((low + high) / 2);
|
|
34850
|
-
const i = mid * 2;
|
|
34851
|
-
if (codePoint < ranges[i]) {
|
|
34852
|
-
high = mid - 1;
|
|
34853
|
-
} else if (codePoint > ranges[i + 1]) {
|
|
34854
|
-
low = mid + 1;
|
|
34855
|
-
} else {
|
|
34856
|
-
return true;
|
|
34857
|
-
}
|
|
34858
|
-
}
|
|
34859
|
-
return false;
|
|
34860
|
-
};
|
|
34861
|
-
|
|
34862
|
-
// node_modules/slice-ansi/node_modules/is-fullwidth-code-point/node_modules/get-east-asian-width/lookup.js
|
|
34863
|
-
function findWideFastPathRange2(ranges) {
|
|
34864
|
-
let fastPathStart = ranges[0];
|
|
34865
|
-
let fastPathEnd = ranges[1];
|
|
34866
|
-
for (let index = 0;index < ranges.length; index += 2) {
|
|
34867
|
-
const start = ranges[index];
|
|
34868
|
-
const end = ranges[index + 1];
|
|
34869
|
-
if (commonCjkCodePoint2 >= start && commonCjkCodePoint2 <= end) {
|
|
34870
|
-
return [start, end];
|
|
34871
|
-
}
|
|
34872
|
-
if (end - start > fastPathEnd - fastPathStart) {
|
|
34873
|
-
fastPathStart = start;
|
|
34874
|
-
fastPathEnd = end;
|
|
34875
|
-
}
|
|
34876
|
-
}
|
|
34877
|
-
return [fastPathStart, fastPathEnd];
|
|
34878
|
-
}
|
|
34879
|
-
var minimumAmbiguousCodePoint2, maximumAmbiguousCodePoint2, minimumFullWidthCodePoint2, maximumFullWidthCodePoint2, minimumHalfWidthCodePoint2, maximumHalfWidthCodePoint2, minimumNarrowCodePoint2, maximumNarrowCodePoint2, minimumWideCodePoint2, maximumWideCodePoint2, commonCjkCodePoint2 = 19968, wideFastPathStart2, wideFastPathEnd2, isFullWidth2 = (codePoint) => {
|
|
34880
|
-
if (codePoint < minimumFullWidthCodePoint2 || codePoint > maximumFullWidthCodePoint2) {
|
|
34881
|
-
return false;
|
|
34882
|
-
}
|
|
34883
|
-
return isInRange2(fullwidthRanges2, codePoint);
|
|
34884
|
-
}, isWide2 = (codePoint) => {
|
|
34885
|
-
if (codePoint >= wideFastPathStart2 && codePoint <= wideFastPathEnd2) {
|
|
34886
|
-
return true;
|
|
34887
|
-
}
|
|
34888
|
-
if (codePoint < minimumWideCodePoint2 || codePoint > maximumWideCodePoint2) {
|
|
34889
|
-
return false;
|
|
34890
|
-
}
|
|
34891
|
-
return isInRange2(wideRanges2, codePoint);
|
|
34892
|
-
};
|
|
34893
|
-
var init_lookup2 = __esm(() => {
|
|
34894
|
-
init_lookup_data2();
|
|
34895
|
-
minimumAmbiguousCodePoint2 = ambiguousRanges2[0];
|
|
34896
|
-
maximumAmbiguousCodePoint2 = ambiguousRanges2.at(-1);
|
|
34897
|
-
minimumFullWidthCodePoint2 = fullwidthRanges2[0];
|
|
34898
|
-
maximumFullWidthCodePoint2 = fullwidthRanges2.at(-1);
|
|
34899
|
-
minimumHalfWidthCodePoint2 = halfwidthRanges2[0];
|
|
34900
|
-
maximumHalfWidthCodePoint2 = halfwidthRanges2.at(-1);
|
|
34901
|
-
minimumNarrowCodePoint2 = narrowRanges2[0];
|
|
34902
|
-
maximumNarrowCodePoint2 = narrowRanges2.at(-1);
|
|
34903
|
-
minimumWideCodePoint2 = wideRanges2[0];
|
|
34904
|
-
maximumWideCodePoint2 = wideRanges2.at(-1);
|
|
34905
|
-
[wideFastPathStart2, wideFastPathEnd2] = findWideFastPathRange2(wideRanges2);
|
|
34906
|
-
});
|
|
34907
|
-
|
|
34908
|
-
// node_modules/slice-ansi/node_modules/is-fullwidth-code-point/node_modules/get-east-asian-width/index.js
|
|
34909
|
-
var init_get_east_asian_width2 = __esm(() => {
|
|
34910
|
-
init_lookup2();
|
|
34911
|
-
});
|
|
34912
|
-
|
|
34913
34759
|
// node_modules/slice-ansi/node_modules/is-fullwidth-code-point/index.js
|
|
34914
34760
|
function isFullwidthCodePoint2(codePoint) {
|
|
34915
34761
|
if (!Number.isInteger(codePoint)) {
|
|
34916
34762
|
return false;
|
|
34917
34763
|
}
|
|
34918
|
-
return
|
|
34764
|
+
return isFullWidth(codePoint) || isWide(codePoint);
|
|
34919
34765
|
}
|
|
34920
34766
|
var init_is_fullwidth_code_point = __esm(() => {
|
|
34921
|
-
|
|
34767
|
+
init_get_east_asian_width();
|
|
34922
34768
|
});
|
|
34923
34769
|
|
|
34924
34770
|
// node_modules/slice-ansi/index.js
|
|
@@ -34977,15 +34823,15 @@ function tokenize(string, endCharacter = Number.POSITIVE_INFINITY) {
|
|
|
34977
34823
|
continue;
|
|
34978
34824
|
}
|
|
34979
34825
|
}
|
|
34980
|
-
const
|
|
34826
|
+
const isFullWidth2 = isFullwidthCodePoint2(codePoint);
|
|
34981
34827
|
const character = String.fromCodePoint(codePoint);
|
|
34982
34828
|
returnValue.push({
|
|
34983
34829
|
type: "character",
|
|
34984
34830
|
value: character,
|
|
34985
|
-
isFullWidth:
|
|
34831
|
+
isFullWidth: isFullWidth2
|
|
34986
34832
|
});
|
|
34987
34833
|
index += character.length;
|
|
34988
|
-
visibleCount +=
|
|
34834
|
+
visibleCount += isFullWidth2 ? 2 : character.length;
|
|
34989
34835
|
if (visibleCount >= endCharacter) {
|
|
34990
34836
|
break;
|
|
34991
34837
|
}
|
|
@@ -35338,7 +35184,7 @@ class Output {
|
|
|
35338
35184
|
if (clipHorizontally) {
|
|
35339
35185
|
lines = lines.map((line) => {
|
|
35340
35186
|
const from = x < clip.x1 ? clip.x1 - x : 0;
|
|
35341
|
-
const width =
|
|
35187
|
+
const width = stringWidth(line);
|
|
35342
35188
|
const to = x + width > clip.x2 ? clip.x2 - x : width;
|
|
35343
35189
|
return sliceAnsi2(line, from, to);
|
|
35344
35190
|
});
|
|
@@ -35397,7 +35243,7 @@ class Output {
|
|
|
35397
35243
|
}
|
|
35398
35244
|
var init_output = __esm(() => {
|
|
35399
35245
|
init_slice_ansi2();
|
|
35400
|
-
|
|
35246
|
+
init_string_width();
|
|
35401
35247
|
init_widest_line();
|
|
35402
35248
|
init_build();
|
|
35403
35249
|
});
|
|
@@ -39501,8 +39347,8 @@ function emoji() {
|
|
|
39501
39347
|
}
|
|
39502
39348
|
function timeSource(args) {
|
|
39503
39349
|
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
39504
|
-
const
|
|
39505
|
-
return
|
|
39350
|
+
const regex2 = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
39351
|
+
return regex2;
|
|
39506
39352
|
}
|
|
39507
39353
|
function time(args) {
|
|
39508
39354
|
return new RegExp(`^${timeSource(args)}$`);
|
|
@@ -39531,8 +39377,8 @@ var cuid, cuid2, ulid, xid, ksuid, nanoid, duration, extendedDuration, guid, uui
|
|
|
39531
39377
|
const escapedDelim = escapeRegex(delimiter ?? ":");
|
|
39532
39378
|
return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);
|
|
39533
39379
|
}, cidrv4, cidrv6, base64, base64url, hostname, domain, e164, dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`, date, string = (params) => {
|
|
39534
|
-
const
|
|
39535
|
-
return new RegExp(`^${
|
|
39380
|
+
const regex2 = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
39381
|
+
return new RegExp(`^${regex2}$`);
|
|
39536
39382
|
}, bigint, integer, number, boolean, _null, _undefined, lowercase, uppercase, hex, md5_hex, md5_base64, md5_base64url, sha1_hex, sha1_base64, sha1_base64url, sha256_hex, sha256_base64, sha256_base64url, sha384_hex, sha384_base64, sha384_base64url, sha512_hex, sha512_base64, sha512_base64url;
|
|
39537
39383
|
var init_regexes = __esm(() => {
|
|
39538
39384
|
init_util();
|
|
@@ -49321,9 +49167,9 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
49321
49167
|
json.pattern = regexes[0].source;
|
|
49322
49168
|
else if (regexes.length > 1) {
|
|
49323
49169
|
json.allOf = [
|
|
49324
|
-
...regexes.map((
|
|
49170
|
+
...regexes.map((regex2) => ({
|
|
49325
49171
|
...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
|
|
49326
|
-
pattern:
|
|
49172
|
+
pattern: regex2.source
|
|
49327
49173
|
}))
|
|
49328
49174
|
];
|
|
49329
49175
|
}
|
|
@@ -50538,10 +50384,10 @@ function hex2(_params) {
|
|
|
50538
50384
|
function hash(alg, params) {
|
|
50539
50385
|
const enc = params?.enc ?? "hex";
|
|
50540
50386
|
const format = `${alg}_${enc}`;
|
|
50541
|
-
const
|
|
50542
|
-
if (!
|
|
50387
|
+
const regex2 = exports_regexes[format];
|
|
50388
|
+
if (!regex2)
|
|
50543
50389
|
throw new Error(`Unrecognized hash format: ${format}`);
|
|
50544
|
-
return _stringFormat(ZodCustomStringFormat, format,
|
|
50390
|
+
return _stringFormat(ZodCustomStringFormat, format, regex2, params);
|
|
50545
50391
|
}
|
|
50546
50392
|
function number2(params) {
|
|
50547
50393
|
return _number(ZodNumber, params);
|
|
@@ -54717,8 +54563,8 @@ function createUnicodePropertyRegex(pattern) {
|
|
|
54717
54563
|
return null;
|
|
54718
54564
|
}
|
|
54719
54565
|
}
|
|
54720
|
-
function matchesUnicodeProperty(character,
|
|
54721
|
-
return
|
|
54566
|
+
function matchesUnicodeProperty(character, regex2) {
|
|
54567
|
+
return regex2?.test(character) ?? false;
|
|
54722
54568
|
}
|
|
54723
54569
|
function isVariationSelector(codePoint) {
|
|
54724
54570
|
return codePoint >= VARIATION_SELECTOR_START && codePoint <= VARIATION_SELECTOR_END || codePoint >= VARIATION_SELECTOR_SUPPLEMENT_START && codePoint <= VARIATION_SELECTOR_SUPPLEMENT_END;
|
|
@@ -54787,7 +54633,7 @@ function isZeroWidthStandaloneCluster(cluster) {
|
|
|
54787
54633
|
});
|
|
54788
54634
|
}
|
|
54789
54635
|
function shouldTreatClusterAsNarrowTextPictograph(cluster) {
|
|
54790
|
-
if (
|
|
54636
|
+
if (stringWidth(cluster) <= 1) {
|
|
54791
54637
|
return false;
|
|
54792
54638
|
}
|
|
54793
54639
|
const characters = Array.from(cluster);
|
|
@@ -54812,7 +54658,7 @@ function getClusterWidth(cluster) {
|
|
|
54812
54658
|
if (shouldTreatClusterAsNarrowTextPictograph(cluster)) {
|
|
54813
54659
|
return 1;
|
|
54814
54660
|
}
|
|
54815
|
-
return
|
|
54661
|
+
return stringWidth(cluster);
|
|
54816
54662
|
}
|
|
54817
54663
|
function getTextDisplayWidth(text) {
|
|
54818
54664
|
let width = 0;
|
|
@@ -54975,7 +54821,7 @@ function truncateStyledText(text, maxWidth, options = {}) {
|
|
|
54975
54821
|
}
|
|
54976
54822
|
const addEllipsis = options.ellipsis ?? true;
|
|
54977
54823
|
const ellipsis = addEllipsis ? "..." : "";
|
|
54978
|
-
const ellipsisWidth = addEllipsis ?
|
|
54824
|
+
const ellipsisWidth = addEllipsis ? stringWidth(ellipsis) : 0;
|
|
54979
54825
|
if (addEllipsis && maxWidth <= ellipsisWidth) {
|
|
54980
54826
|
return ".".repeat(maxWidth);
|
|
54981
54827
|
}
|
|
@@ -55029,7 +54875,7 @@ function truncateStyledText(text, maxWidth, options = {}) {
|
|
|
55029
54875
|
}
|
|
55030
54876
|
var ESC2 = "\x1B", BEL2 = "\x07", C1_CSI = "", C1_OSC = "", ST = "", ZERO_WIDTH_JOINER = 8205, COMBINING_ENCLOSING_KEYCAP = 8419, VARIATION_SELECTOR_START = 65024, VARIATION_SELECTOR_END = 65039, VARIATION_SELECTOR_SUPPLEMENT_START = 917760, VARIATION_SELECTOR_SUPPLEMENT_END = 917999, REGIONAL_INDICATOR_START = 127462, REGIONAL_INDICATOR_END = 127487, SGR_REGEX, EXTENDED_PICTOGRAPHIC_REGEX, EMOJI_PRESENTATION_REGEX, EMOJI_MODIFIER_REGEX, COMBINING_MARK_REGEX;
|
|
55031
54877
|
var init_ansi = __esm(() => {
|
|
55032
|
-
|
|
54878
|
+
init_string_width();
|
|
55033
54879
|
SGR_REGEX = /\x1b\[[0-9;]*m/g;
|
|
55034
54880
|
EXTENDED_PICTOGRAPHIC_REGEX = createUnicodePropertyRegex("\\p{Extended_Pictographic}");
|
|
55035
54881
|
EMOJI_PRESENTATION_REGEX = createUnicodePropertyRegex("\\p{Emoji_Presentation}");
|
|
@@ -55186,8 +55032,8 @@ function getColorAnsiCode(colorName, colorLevel = "ansi16", isBackground = false
|
|
|
55186
55032
|
}
|
|
55187
55033
|
const colored = chalkFn("TEST");
|
|
55188
55034
|
const escapeChar = "\x1B";
|
|
55189
|
-
const
|
|
55190
|
-
const match =
|
|
55035
|
+
const ansiRegex3 = new RegExp(`^(${escapeChar.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\[[^m]+m)`);
|
|
55036
|
+
const match = ansiRegex3.exec(colored);
|
|
55191
55037
|
return match?.[1] ?? "";
|
|
55192
55038
|
}
|
|
55193
55039
|
function getColorDisplayName(colorName) {
|
|
@@ -55592,7 +55438,7 @@ function getTerminalWidth() {
|
|
|
55592
55438
|
function canDetectTerminalWidth() {
|
|
55593
55439
|
return probeTerminalWidth() !== null;
|
|
55594
55440
|
}
|
|
55595
|
-
var __dirname = "/Users/peter/Documents/Code/ccstatusline-usage/src/utils", PACKAGE_VERSION = "2.3.
|
|
55441
|
+
var __dirname = "/Users/peter/Documents/Code/ccstatusline-usage/src/utils", PACKAGE_VERSION = "2.3.17";
|
|
55596
55442
|
var init_terminal = () => {};
|
|
55597
55443
|
|
|
55598
55444
|
// src/utils/renderer.ts
|
|
@@ -56970,8 +56816,8 @@ var import_react27, jsx_dev_runtime, CustomTextEditor = ({ widget, onComplete, o
|
|
|
56970
56816
|
const [cursorPos, setCursorPos] = import_react27.useState(text.length);
|
|
56971
56817
|
const getGraphemes = (str) => {
|
|
56972
56818
|
if ("Segmenter" in Intl) {
|
|
56973
|
-
const
|
|
56974
|
-
return Array.from(
|
|
56819
|
+
const segmenter2 = new Intl.Segmenter(undefined, { granularity: "grapheme" });
|
|
56820
|
+
return Array.from(segmenter2.segment(str), (seg) => seg.segment);
|
|
56975
56821
|
}
|
|
56976
56822
|
return Array.from(str);
|
|
56977
56823
|
};
|
|
@@ -57130,8 +56976,8 @@ var import_react28, jsx_dev_runtime2, CustomSymbolEditor = ({ widget, onComplete
|
|
|
57130
56976
|
return "";
|
|
57131
56977
|
}
|
|
57132
56978
|
if ("Segmenter" in Intl) {
|
|
57133
|
-
const
|
|
57134
|
-
const segments = Array.from(
|
|
56979
|
+
const segmenter2 = new Intl.Segmenter(undefined, { granularity: "grapheme" });
|
|
56980
|
+
const segments = Array.from(segmenter2.segment(str));
|
|
57135
56981
|
return segments[0]?.segment ?? "";
|
|
57136
56982
|
}
|
|
57137
56983
|
return Array.from(str)[0] ?? "";
|
|
@@ -57552,7 +57398,7 @@ var require_ms = __commonJS((exports, module) => {
|
|
|
57552
57398
|
}
|
|
57553
57399
|
});
|
|
57554
57400
|
|
|
57555
|
-
// node_modules/
|
|
57401
|
+
// node_modules/debug/src/common.js
|
|
57556
57402
|
var require_common = __commonJS((exports, module) => {
|
|
57557
57403
|
function setup(env3) {
|
|
57558
57404
|
createDebug.debug = createDebug;
|
|
@@ -57727,7 +57573,7 @@ var require_common = __commonJS((exports, module) => {
|
|
|
57727
57573
|
module.exports = setup;
|
|
57728
57574
|
});
|
|
57729
57575
|
|
|
57730
|
-
// node_modules/
|
|
57576
|
+
// node_modules/debug/src/browser.js
|
|
57731
57577
|
var require_browser = __commonJS((exports, module) => {
|
|
57732
57578
|
exports.formatArgs = formatArgs;
|
|
57733
57579
|
exports.save = save;
|
|
@@ -57887,116 +57733,7 @@ var require_browser = __commonJS((exports, module) => {
|
|
|
57887
57733
|
};
|
|
57888
57734
|
});
|
|
57889
57735
|
|
|
57890
|
-
// node_modules/
|
|
57891
|
-
var require_has_flag = __commonJS((exports, module) => {
|
|
57892
|
-
module.exports = (flag, argv = process.argv) => {
|
|
57893
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
57894
|
-
const position = argv.indexOf(prefix + flag);
|
|
57895
|
-
const terminatorPosition = argv.indexOf("--");
|
|
57896
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
57897
|
-
};
|
|
57898
|
-
});
|
|
57899
|
-
|
|
57900
|
-
// node_modules/supports-color/index.js
|
|
57901
|
-
var require_supports_color = __commonJS((exports, module) => {
|
|
57902
|
-
var os4 = __require("os");
|
|
57903
|
-
var tty2 = __require("tty");
|
|
57904
|
-
var hasFlag2 = require_has_flag();
|
|
57905
|
-
var { env: env3 } = process;
|
|
57906
|
-
var forceColor;
|
|
57907
|
-
if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) {
|
|
57908
|
-
forceColor = 0;
|
|
57909
|
-
} else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) {
|
|
57910
|
-
forceColor = 1;
|
|
57911
|
-
}
|
|
57912
|
-
if ("FORCE_COLOR" in env3) {
|
|
57913
|
-
if (env3.FORCE_COLOR === "true") {
|
|
57914
|
-
forceColor = 1;
|
|
57915
|
-
} else if (env3.FORCE_COLOR === "false") {
|
|
57916
|
-
forceColor = 0;
|
|
57917
|
-
} else {
|
|
57918
|
-
forceColor = env3.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env3.FORCE_COLOR, 10), 3);
|
|
57919
|
-
}
|
|
57920
|
-
}
|
|
57921
|
-
function translateLevel2(level) {
|
|
57922
|
-
if (level === 0) {
|
|
57923
|
-
return false;
|
|
57924
|
-
}
|
|
57925
|
-
return {
|
|
57926
|
-
level,
|
|
57927
|
-
hasBasic: true,
|
|
57928
|
-
has256: level >= 2,
|
|
57929
|
-
has16m: level >= 3
|
|
57930
|
-
};
|
|
57931
|
-
}
|
|
57932
|
-
function supportsColor2(haveStream, streamIsTTY) {
|
|
57933
|
-
if (forceColor === 0) {
|
|
57934
|
-
return 0;
|
|
57935
|
-
}
|
|
57936
|
-
if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) {
|
|
57937
|
-
return 3;
|
|
57938
|
-
}
|
|
57939
|
-
if (hasFlag2("color=256")) {
|
|
57940
|
-
return 2;
|
|
57941
|
-
}
|
|
57942
|
-
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
57943
|
-
return 0;
|
|
57944
|
-
}
|
|
57945
|
-
const min2 = forceColor || 0;
|
|
57946
|
-
if (env3.TERM === "dumb") {
|
|
57947
|
-
return min2;
|
|
57948
|
-
}
|
|
57949
|
-
if (process.platform === "win32") {
|
|
57950
|
-
const osRelease = os4.release().split(".");
|
|
57951
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
57952
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
57953
|
-
}
|
|
57954
|
-
return 1;
|
|
57955
|
-
}
|
|
57956
|
-
if ("CI" in env3) {
|
|
57957
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => (sign in env3)) || env3.CI_NAME === "codeship") {
|
|
57958
|
-
return 1;
|
|
57959
|
-
}
|
|
57960
|
-
return min2;
|
|
57961
|
-
}
|
|
57962
|
-
if ("TEAMCITY_VERSION" in env3) {
|
|
57963
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env3.TEAMCITY_VERSION) ? 1 : 0;
|
|
57964
|
-
}
|
|
57965
|
-
if (env3.COLORTERM === "truecolor") {
|
|
57966
|
-
return 3;
|
|
57967
|
-
}
|
|
57968
|
-
if ("TERM_PROGRAM" in env3) {
|
|
57969
|
-
const version2 = parseInt((env3.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
57970
|
-
switch (env3.TERM_PROGRAM) {
|
|
57971
|
-
case "iTerm.app":
|
|
57972
|
-
return version2 >= 3 ? 3 : 2;
|
|
57973
|
-
case "Apple_Terminal":
|
|
57974
|
-
return 2;
|
|
57975
|
-
}
|
|
57976
|
-
}
|
|
57977
|
-
if (/-256(color)?$/i.test(env3.TERM)) {
|
|
57978
|
-
return 2;
|
|
57979
|
-
}
|
|
57980
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env3.TERM)) {
|
|
57981
|
-
return 1;
|
|
57982
|
-
}
|
|
57983
|
-
if ("COLORTERM" in env3) {
|
|
57984
|
-
return 1;
|
|
57985
|
-
}
|
|
57986
|
-
return min2;
|
|
57987
|
-
}
|
|
57988
|
-
function getSupportLevel(stream) {
|
|
57989
|
-
const level = supportsColor2(stream, stream && stream.isTTY);
|
|
57990
|
-
return translateLevel2(level);
|
|
57991
|
-
}
|
|
57992
|
-
module.exports = {
|
|
57993
|
-
supportsColor: getSupportLevel,
|
|
57994
|
-
stdout: translateLevel2(supportsColor2(true, tty2.isatty(1))),
|
|
57995
|
-
stderr: translateLevel2(supportsColor2(true, tty2.isatty(2)))
|
|
57996
|
-
};
|
|
57997
|
-
});
|
|
57998
|
-
|
|
57999
|
-
// node_modules/https-proxy-agent/node_modules/debug/src/node.js
|
|
57736
|
+
// node_modules/debug/src/node.js
|
|
58000
57737
|
var require_node = __commonJS((exports, module) => {
|
|
58001
57738
|
var tty2 = __require("tty");
|
|
58002
57739
|
var util = __require("util");
|
|
@@ -58009,7 +57746,7 @@ var require_node = __commonJS((exports, module) => {
|
|
|
58009
57746
|
exports.destroy = util.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
58010
57747
|
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
58011
57748
|
try {
|
|
58012
|
-
const supportsColor2 =
|
|
57749
|
+
const supportsColor2 = (()=>{throw new Error("Cannot require module "+"supports-color");})();
|
|
58013
57750
|
if (supportsColor2 && (supportsColor2.stderr || supportsColor2).level >= 2) {
|
|
58014
57751
|
exports.colors = [
|
|
58015
57752
|
20,
|
|
@@ -58167,7 +57904,7 @@ var require_node = __commonJS((exports, module) => {
|
|
|
58167
57904
|
};
|
|
58168
57905
|
});
|
|
58169
57906
|
|
|
58170
|
-
// node_modules/
|
|
57907
|
+
// node_modules/debug/src/index.js
|
|
58171
57908
|
var require_src = __commonJS((exports, module) => {
|
|
58172
57909
|
if (typeof process === "undefined" || process.type === "renderer" || false || process.__nwjs) {
|
|
58173
57910
|
module.exports = require_browser();
|
|
@@ -58177,125 +57914,17 @@ var require_src = __commonJS((exports, module) => {
|
|
|
58177
57914
|
});
|
|
58178
57915
|
|
|
58179
57916
|
// node_modules/agent-base/dist/helpers.js
|
|
58180
|
-
var
|
|
58181
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
58182
|
-
if (k2 === undefined)
|
|
58183
|
-
k2 = k;
|
|
58184
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
58185
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
58186
|
-
desc = { enumerable: true, get: function() {
|
|
58187
|
-
return m[k];
|
|
58188
|
-
} };
|
|
58189
|
-
}
|
|
58190
|
-
Object.defineProperty(o, k2, desc);
|
|
58191
|
-
} : function(o, m, k, k2) {
|
|
58192
|
-
if (k2 === undefined)
|
|
58193
|
-
k2 = k;
|
|
58194
|
-
o[k2] = m[k];
|
|
58195
|
-
});
|
|
58196
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
58197
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
58198
|
-
} : function(o, v) {
|
|
58199
|
-
o["default"] = v;
|
|
58200
|
-
});
|
|
58201
|
-
var __importStar = exports && exports.__importStar || function(mod) {
|
|
58202
|
-
if (mod && mod.__esModule)
|
|
58203
|
-
return mod;
|
|
58204
|
-
var result2 = {};
|
|
58205
|
-
if (mod != null) {
|
|
58206
|
-
for (var k in mod)
|
|
58207
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
58208
|
-
__createBinding(result2, mod, k);
|
|
58209
|
-
}
|
|
58210
|
-
__setModuleDefault(result2, mod);
|
|
58211
|
-
return result2;
|
|
58212
|
-
};
|
|
58213
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58214
|
-
exports.req = exports.json = exports.toBuffer = undefined;
|
|
58215
|
-
var http = __importStar(__require("http"));
|
|
58216
|
-
var https = __importStar(__require("https"));
|
|
58217
|
-
async function toBuffer(stream) {
|
|
58218
|
-
let length = 0;
|
|
58219
|
-
const chunks = [];
|
|
58220
|
-
for await (const chunk2 of stream) {
|
|
58221
|
-
length += chunk2.length;
|
|
58222
|
-
chunks.push(chunk2);
|
|
58223
|
-
}
|
|
58224
|
-
return Buffer.concat(chunks, length);
|
|
58225
|
-
}
|
|
58226
|
-
exports.toBuffer = toBuffer;
|
|
58227
|
-
async function json2(stream) {
|
|
58228
|
-
const buf = await toBuffer(stream);
|
|
58229
|
-
const str = buf.toString("utf8");
|
|
58230
|
-
try {
|
|
58231
|
-
return JSON.parse(str);
|
|
58232
|
-
} catch (_err) {
|
|
58233
|
-
const err = _err;
|
|
58234
|
-
err.message += ` (input: ${str})`;
|
|
58235
|
-
throw err;
|
|
58236
|
-
}
|
|
58237
|
-
}
|
|
58238
|
-
exports.json = json2;
|
|
58239
|
-
function req(url2, opts = {}) {
|
|
58240
|
-
const href = typeof url2 === "string" ? url2 : url2.href;
|
|
58241
|
-
const req2 = (href.startsWith("https:") ? https : http).request(url2, opts);
|
|
58242
|
-
const promise2 = new Promise((resolve, reject2) => {
|
|
58243
|
-
req2.once("response", resolve).once("error", reject2).end();
|
|
58244
|
-
});
|
|
58245
|
-
req2.then = promise2.then.bind(promise2);
|
|
58246
|
-
return req2;
|
|
58247
|
-
}
|
|
58248
|
-
exports.req = req;
|
|
58249
|
-
});
|
|
57917
|
+
var init_helpers = () => {};
|
|
58250
57918
|
|
|
58251
57919
|
// node_modules/agent-base/dist/index.js
|
|
58252
|
-
|
|
58253
|
-
|
|
58254
|
-
|
|
58255
|
-
|
|
58256
|
-
|
|
58257
|
-
|
|
58258
|
-
|
|
58259
|
-
|
|
58260
|
-
} };
|
|
58261
|
-
}
|
|
58262
|
-
Object.defineProperty(o, k2, desc);
|
|
58263
|
-
} : function(o, m, k, k2) {
|
|
58264
|
-
if (k2 === undefined)
|
|
58265
|
-
k2 = k;
|
|
58266
|
-
o[k2] = m[k];
|
|
58267
|
-
});
|
|
58268
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
58269
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
58270
|
-
} : function(o, v) {
|
|
58271
|
-
o["default"] = v;
|
|
58272
|
-
});
|
|
58273
|
-
var __importStar = exports && exports.__importStar || function(mod) {
|
|
58274
|
-
if (mod && mod.__esModule)
|
|
58275
|
-
return mod;
|
|
58276
|
-
var result2 = {};
|
|
58277
|
-
if (mod != null) {
|
|
58278
|
-
for (var k in mod)
|
|
58279
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
58280
|
-
__createBinding(result2, mod, k);
|
|
58281
|
-
}
|
|
58282
|
-
__setModuleDefault(result2, mod);
|
|
58283
|
-
return result2;
|
|
58284
|
-
};
|
|
58285
|
-
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
58286
|
-
for (var p in m)
|
|
58287
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p))
|
|
58288
|
-
__createBinding(exports2, m, p);
|
|
58289
|
-
};
|
|
58290
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58291
|
-
exports.Agent = undefined;
|
|
58292
|
-
var net = __importStar(__require("net"));
|
|
58293
|
-
var http = __importStar(__require("http"));
|
|
58294
|
-
var https_1 = __require("https");
|
|
58295
|
-
__exportStar(require_helpers(), exports);
|
|
58296
|
-
var INTERNAL = Symbol("AgentBaseInternalState");
|
|
58297
|
-
|
|
58298
|
-
class Agent extends http.Agent {
|
|
57920
|
+
import * as net from "net";
|
|
57921
|
+
import * as http from "http";
|
|
57922
|
+
import { Agent as HttpsAgent } from "https";
|
|
57923
|
+
var INTERNAL, Agent2;
|
|
57924
|
+
var init_dist4 = __esm(() => {
|
|
57925
|
+
init_helpers();
|
|
57926
|
+
INTERNAL = Symbol("AgentBaseInternalState");
|
|
57927
|
+
Agent2 = class Agent2 extends http.Agent {
|
|
58299
57928
|
constructor(opts) {
|
|
58300
57929
|
super(opts);
|
|
58301
57930
|
this[INTERNAL] = {};
|
|
@@ -58344,7 +57973,7 @@ var require_dist = __commonJS((exports) => {
|
|
|
58344
57973
|
getName(options) {
|
|
58345
57974
|
const secureEndpoint = this.isSecureEndpoint(options);
|
|
58346
57975
|
if (secureEndpoint) {
|
|
58347
|
-
return
|
|
57976
|
+
return HttpsAgent.prototype.getName.call(this, options);
|
|
58348
57977
|
}
|
|
58349
57978
|
return super.getName(options);
|
|
58350
57979
|
}
|
|
@@ -58395,170 +58024,139 @@ var require_dist = __commonJS((exports) => {
|
|
|
58395
58024
|
this[INTERNAL].protocol = v;
|
|
58396
58025
|
}
|
|
58397
58026
|
}
|
|
58398
|
-
}
|
|
58399
|
-
exports.Agent = Agent;
|
|
58027
|
+
};
|
|
58400
58028
|
});
|
|
58401
58029
|
|
|
58402
58030
|
// node_modules/https-proxy-agent/dist/parse-proxy-response.js
|
|
58403
|
-
|
|
58404
|
-
|
|
58405
|
-
|
|
58406
|
-
|
|
58407
|
-
|
|
58408
|
-
|
|
58409
|
-
|
|
58410
|
-
|
|
58411
|
-
|
|
58412
|
-
|
|
58413
|
-
|
|
58414
|
-
|
|
58415
|
-
|
|
58416
|
-
|
|
58417
|
-
|
|
58418
|
-
|
|
58419
|
-
|
|
58420
|
-
|
|
58421
|
-
|
|
58422
|
-
|
|
58423
|
-
|
|
58424
|
-
|
|
58425
|
-
|
|
58426
|
-
|
|
58427
|
-
|
|
58428
|
-
|
|
58429
|
-
|
|
58430
|
-
|
|
58431
|
-
|
|
58432
|
-
|
|
58433
|
-
|
|
58434
|
-
debug("onerror %o", err);
|
|
58435
|
-
reject2(err);
|
|
58436
|
-
}
|
|
58437
|
-
function ondata(b) {
|
|
58438
|
-
buffers.push(b);
|
|
58439
|
-
buffersLength += b.length;
|
|
58440
|
-
const buffered = Buffer.concat(buffers, buffersLength);
|
|
58441
|
-
const endOfHeaders = buffered.indexOf(`\r
|
|
58031
|
+
function parseProxyResponse(socket) {
|
|
58032
|
+
return new Promise((resolve, reject2) => {
|
|
58033
|
+
let buffersLength = 0;
|
|
58034
|
+
const buffers = [];
|
|
58035
|
+
function read() {
|
|
58036
|
+
const b = socket.read();
|
|
58037
|
+
if (b)
|
|
58038
|
+
ondata(b);
|
|
58039
|
+
else
|
|
58040
|
+
socket.once("readable", read);
|
|
58041
|
+
}
|
|
58042
|
+
function cleanup() {
|
|
58043
|
+
socket.removeListener("end", onend);
|
|
58044
|
+
socket.removeListener("error", onerror);
|
|
58045
|
+
socket.removeListener("readable", read);
|
|
58046
|
+
}
|
|
58047
|
+
function onend() {
|
|
58048
|
+
cleanup();
|
|
58049
|
+
debug("onend");
|
|
58050
|
+
reject2(new Error("Proxy connection ended before receiving CONNECT response"));
|
|
58051
|
+
}
|
|
58052
|
+
function onerror(err) {
|
|
58053
|
+
cleanup();
|
|
58054
|
+
debug("onerror %o", err);
|
|
58055
|
+
reject2(err);
|
|
58056
|
+
}
|
|
58057
|
+
function ondata(b) {
|
|
58058
|
+
buffers.push(b);
|
|
58059
|
+
buffersLength += b.length;
|
|
58060
|
+
const buffered = Buffer.concat(buffers, buffersLength);
|
|
58061
|
+
const endOfHeaders = buffered.indexOf(`\r
|
|
58442
58062
|
\r
|
|
58443
58063
|
`);
|
|
58444
|
-
|
|
58445
|
-
|
|
58446
|
-
|
|
58447
|
-
|
|
58448
|
-
|
|
58449
|
-
|
|
58064
|
+
if (endOfHeaders === -1) {
|
|
58065
|
+
debug("have not received end of HTTP headers yet...");
|
|
58066
|
+
read();
|
|
58067
|
+
return;
|
|
58068
|
+
}
|
|
58069
|
+
const headerParts = buffered.slice(0, endOfHeaders).toString("ascii").split(`\r
|
|
58450
58070
|
`);
|
|
58451
|
-
|
|
58452
|
-
|
|
58071
|
+
const firstLine = headerParts.shift();
|
|
58072
|
+
if (!firstLine) {
|
|
58073
|
+
socket.destroy();
|
|
58074
|
+
return reject2(new Error("No header received from proxy CONNECT response"));
|
|
58075
|
+
}
|
|
58076
|
+
const firstLineParts = firstLine.split(" ");
|
|
58077
|
+
const statusCode = +firstLineParts[1];
|
|
58078
|
+
const statusText = firstLineParts.slice(2).join(" ");
|
|
58079
|
+
const headers = {};
|
|
58080
|
+
for (const header of headerParts) {
|
|
58081
|
+
if (!header)
|
|
58082
|
+
continue;
|
|
58083
|
+
const firstColon = header.indexOf(":");
|
|
58084
|
+
if (firstColon === -1) {
|
|
58453
58085
|
socket.destroy();
|
|
58454
|
-
return reject2(new Error(
|
|
58455
|
-
}
|
|
58456
|
-
const
|
|
58457
|
-
const
|
|
58458
|
-
const
|
|
58459
|
-
|
|
58460
|
-
|
|
58461
|
-
|
|
58462
|
-
|
|
58463
|
-
|
|
58464
|
-
|
|
58465
|
-
socket.destroy();
|
|
58466
|
-
return reject2(new Error(`Invalid header from proxy CONNECT response: "${header}"`));
|
|
58467
|
-
}
|
|
58468
|
-
const key = header.slice(0, firstColon).toLowerCase();
|
|
58469
|
-
const value = header.slice(firstColon + 1).trimStart();
|
|
58470
|
-
const current = headers[key];
|
|
58471
|
-
if (typeof current === "string") {
|
|
58472
|
-
headers[key] = [current, value];
|
|
58473
|
-
} else if (Array.isArray(current)) {
|
|
58474
|
-
current.push(value);
|
|
58475
|
-
} else {
|
|
58476
|
-
headers[key] = value;
|
|
58477
|
-
}
|
|
58086
|
+
return reject2(new Error(`Invalid header from proxy CONNECT response: "${header}"`));
|
|
58087
|
+
}
|
|
58088
|
+
const key = header.slice(0, firstColon).toLowerCase();
|
|
58089
|
+
const value = header.slice(firstColon + 1).trimStart();
|
|
58090
|
+
const current = headers[key];
|
|
58091
|
+
if (typeof current === "string") {
|
|
58092
|
+
headers[key] = [current, value];
|
|
58093
|
+
} else if (Array.isArray(current)) {
|
|
58094
|
+
current.push(value);
|
|
58095
|
+
} else {
|
|
58096
|
+
headers[key] = value;
|
|
58478
58097
|
}
|
|
58479
|
-
debug("got proxy server response: %o %o", firstLine, headers);
|
|
58480
|
-
cleanup();
|
|
58481
|
-
resolve({
|
|
58482
|
-
connect: {
|
|
58483
|
-
statusCode,
|
|
58484
|
-
statusText,
|
|
58485
|
-
headers
|
|
58486
|
-
},
|
|
58487
|
-
buffered
|
|
58488
|
-
});
|
|
58489
58098
|
}
|
|
58490
|
-
|
|
58491
|
-
|
|
58492
|
-
|
|
58493
|
-
|
|
58494
|
-
|
|
58495
|
-
|
|
58099
|
+
debug("got proxy server response: %o %o", firstLine, headers);
|
|
58100
|
+
cleanup();
|
|
58101
|
+
resolve({
|
|
58102
|
+
connect: {
|
|
58103
|
+
statusCode,
|
|
58104
|
+
statusText,
|
|
58105
|
+
headers
|
|
58106
|
+
},
|
|
58107
|
+
buffered
|
|
58108
|
+
});
|
|
58109
|
+
}
|
|
58110
|
+
socket.on("error", onerror);
|
|
58111
|
+
socket.on("end", onend);
|
|
58112
|
+
read();
|
|
58113
|
+
});
|
|
58114
|
+
}
|
|
58115
|
+
var import_debug, debug;
|
|
58116
|
+
var init_parse_proxy_response = __esm(() => {
|
|
58117
|
+
import_debug = __toESM(require_src(), 1);
|
|
58118
|
+
debug = import_debug.default("https-proxy-agent:parse-proxy-response");
|
|
58496
58119
|
});
|
|
58497
58120
|
|
|
58498
58121
|
// node_modules/https-proxy-agent/dist/index.js
|
|
58499
|
-
|
|
58500
|
-
|
|
58501
|
-
|
|
58502
|
-
|
|
58503
|
-
|
|
58504
|
-
|
|
58505
|
-
|
|
58506
|
-
|
|
58507
|
-
|
|
58508
|
-
|
|
58509
|
-
|
|
58510
|
-
|
|
58511
|
-
|
|
58512
|
-
k2 = k;
|
|
58513
|
-
o[k2] = m[k];
|
|
58514
|
-
});
|
|
58515
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
58516
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
58517
|
-
} : function(o, v) {
|
|
58518
|
-
o["default"] = v;
|
|
58519
|
-
});
|
|
58520
|
-
var __importStar = exports && exports.__importStar || function(mod) {
|
|
58521
|
-
if (mod && mod.__esModule)
|
|
58522
|
-
return mod;
|
|
58523
|
-
var result2 = {};
|
|
58524
|
-
if (mod != null) {
|
|
58525
|
-
for (var k in mod)
|
|
58526
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
58527
|
-
__createBinding(result2, mod, k);
|
|
58528
|
-
}
|
|
58529
|
-
__setModuleDefault(result2, mod);
|
|
58530
|
-
return result2;
|
|
58531
|
-
};
|
|
58532
|
-
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
58533
|
-
return mod && mod.__esModule ? mod : { default: mod };
|
|
58534
|
-
};
|
|
58535
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58536
|
-
exports.HttpsProxyAgent = undefined;
|
|
58537
|
-
var net = __importStar(__require("net"));
|
|
58538
|
-
var tls = __importStar(__require("tls"));
|
|
58539
|
-
var assert_1 = __importDefault(__require("assert"));
|
|
58540
|
-
var debug_1 = __importDefault(require_src());
|
|
58541
|
-
var agent_base_1 = require_dist();
|
|
58542
|
-
var url_1 = __require("url");
|
|
58543
|
-
var parse_proxy_response_1 = require_parse_proxy_response();
|
|
58544
|
-
var debug = (0, debug_1.default)("https-proxy-agent");
|
|
58545
|
-
var setServernameFromNonIpHost = (options) => {
|
|
58546
|
-
if (options.servername === undefined && options.host && !net.isIP(options.host)) {
|
|
58547
|
-
return {
|
|
58548
|
-
...options,
|
|
58549
|
-
servername: options.host
|
|
58550
|
-
};
|
|
58122
|
+
import * as net2 from "net";
|
|
58123
|
+
import * as tls from "tls";
|
|
58124
|
+
import assert2 from "assert";
|
|
58125
|
+
import { URL as URL2 } from "url";
|
|
58126
|
+
function resume(socket) {
|
|
58127
|
+
socket.resume();
|
|
58128
|
+
}
|
|
58129
|
+
function omit3(obj, ...keys2) {
|
|
58130
|
+
const ret = {};
|
|
58131
|
+
let key;
|
|
58132
|
+
for (key in obj) {
|
|
58133
|
+
if (!keys2.includes(key)) {
|
|
58134
|
+
ret[key] = obj[key];
|
|
58551
58135
|
}
|
|
58552
|
-
|
|
58553
|
-
|
|
58554
|
-
|
|
58555
|
-
|
|
58136
|
+
}
|
|
58137
|
+
return ret;
|
|
58138
|
+
}
|
|
58139
|
+
var import_debug2, debug2, setServernameFromNonIpHost = (options) => {
|
|
58140
|
+
if (options.servername === undefined && options.host && !net2.isIP(options.host)) {
|
|
58141
|
+
return {
|
|
58142
|
+
...options,
|
|
58143
|
+
servername: options.host
|
|
58144
|
+
};
|
|
58145
|
+
}
|
|
58146
|
+
return options;
|
|
58147
|
+
}, HttpsProxyAgent;
|
|
58148
|
+
var init_dist5 = __esm(() => {
|
|
58149
|
+
init_dist4();
|
|
58150
|
+
init_parse_proxy_response();
|
|
58151
|
+
import_debug2 = __toESM(require_src(), 1);
|
|
58152
|
+
debug2 = import_debug2.default("https-proxy-agent");
|
|
58153
|
+
HttpsProxyAgent = class HttpsProxyAgent extends Agent2 {
|
|
58556
58154
|
constructor(proxy, opts) {
|
|
58557
58155
|
super(opts);
|
|
58558
58156
|
this.options = { path: undefined };
|
|
58559
|
-
this.proxy = typeof proxy === "string" ? new
|
|
58157
|
+
this.proxy = typeof proxy === "string" ? new URL2(proxy) : proxy;
|
|
58560
58158
|
this.proxyHeaders = opts?.headers ?? {};
|
|
58561
|
-
|
|
58159
|
+
debug2("Creating new HttpsProxyAgent instance: %o", this.proxy.href);
|
|
58562
58160
|
const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
|
|
58563
58161
|
const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
|
|
58564
58162
|
this.connectOpts = {
|
|
@@ -58575,14 +58173,14 @@ var require_dist2 = __commonJS((exports) => {
|
|
|
58575
58173
|
}
|
|
58576
58174
|
let socket;
|
|
58577
58175
|
if (proxy.protocol === "https:") {
|
|
58578
|
-
|
|
58176
|
+
debug2("Creating `tls.Socket`: %o", this.connectOpts);
|
|
58579
58177
|
socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
|
|
58580
58178
|
} else {
|
|
58581
|
-
|
|
58582
|
-
socket =
|
|
58179
|
+
debug2("Creating `net.Socket`: %o", this.connectOpts);
|
|
58180
|
+
socket = net2.connect(this.connectOpts);
|
|
58583
58181
|
}
|
|
58584
58182
|
const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
|
|
58585
|
-
const host =
|
|
58183
|
+
const host = net2.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
|
|
58586
58184
|
let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r
|
|
58587
58185
|
`;
|
|
58588
58186
|
if (proxy.username || proxy.password) {
|
|
@@ -58597,16 +58195,16 @@ var require_dist2 = __commonJS((exports) => {
|
|
|
58597
58195
|
payload += `${name}: ${headers[name]}\r
|
|
58598
58196
|
`;
|
|
58599
58197
|
}
|
|
58600
|
-
const proxyResponsePromise =
|
|
58198
|
+
const proxyResponsePromise = parseProxyResponse(socket);
|
|
58601
58199
|
socket.write(`${payload}\r
|
|
58602
58200
|
`);
|
|
58603
|
-
const { connect, buffered } = await proxyResponsePromise;
|
|
58604
|
-
req.emit("proxyConnect",
|
|
58605
|
-
this.emit("proxyConnect",
|
|
58606
|
-
if (
|
|
58201
|
+
const { connect: connect3, buffered } = await proxyResponsePromise;
|
|
58202
|
+
req.emit("proxyConnect", connect3);
|
|
58203
|
+
this.emit("proxyConnect", connect3, req);
|
|
58204
|
+
if (connect3.statusCode === 200) {
|
|
58607
58205
|
req.once("socket", resume);
|
|
58608
58206
|
if (opts.secureEndpoint) {
|
|
58609
|
-
|
|
58207
|
+
debug2("Upgrading socket connection to TLS");
|
|
58610
58208
|
return tls.connect({
|
|
58611
58209
|
...omit3(setServernameFromNonIpHost(opts), "host", "path", "port"),
|
|
58612
58210
|
socket
|
|
@@ -58615,32 +58213,18 @@ var require_dist2 = __commonJS((exports) => {
|
|
|
58615
58213
|
return socket;
|
|
58616
58214
|
}
|
|
58617
58215
|
socket.destroy();
|
|
58618
|
-
const fakeSocket = new
|
|
58216
|
+
const fakeSocket = new net2.Socket({ writable: false });
|
|
58619
58217
|
fakeSocket.readable = true;
|
|
58620
58218
|
req.once("socket", (s) => {
|
|
58621
|
-
|
|
58622
|
-
(
|
|
58219
|
+
debug2("Replaying proxy buffer for failed request");
|
|
58220
|
+
assert2(s.listenerCount("data") > 0);
|
|
58623
58221
|
s.push(buffered);
|
|
58624
58222
|
s.push(null);
|
|
58625
58223
|
});
|
|
58626
58224
|
return fakeSocket;
|
|
58627
58225
|
}
|
|
58628
|
-
}
|
|
58226
|
+
};
|
|
58629
58227
|
HttpsProxyAgent.protocols = ["http", "https"];
|
|
58630
|
-
exports.HttpsProxyAgent = HttpsProxyAgent;
|
|
58631
|
-
function resume(socket) {
|
|
58632
|
-
socket.resume();
|
|
58633
|
-
}
|
|
58634
|
-
function omit3(obj, ...keys2) {
|
|
58635
|
-
const ret = {};
|
|
58636
|
-
let key;
|
|
58637
|
-
for (key in obj) {
|
|
58638
|
-
if (!keys2.includes(key)) {
|
|
58639
|
-
ret[key] = obj[key];
|
|
58640
|
-
}
|
|
58641
|
-
}
|
|
58642
|
-
return ret;
|
|
58643
|
-
}
|
|
58644
58228
|
});
|
|
58645
58229
|
|
|
58646
58230
|
// src/utils/usage-types.ts
|
|
@@ -58924,7 +58508,7 @@ function getUsageApiRequestOptions(token) {
|
|
|
58924
58508
|
"anthropic-beta": "oauth-2025-04-20"
|
|
58925
58509
|
},
|
|
58926
58510
|
timeout: USAGE_API_TIMEOUT_MS,
|
|
58927
|
-
...proxyUrl ? { agent: new
|
|
58511
|
+
...proxyUrl ? { agent: new HttpsProxyAgent(proxyUrl) } : {}
|
|
58928
58512
|
};
|
|
58929
58513
|
} catch {
|
|
58930
58514
|
return null;
|
|
@@ -59031,12 +58615,12 @@ async function fetchUsageData() {
|
|
|
59031
58615
|
return getStaleUsageOrError("parse-error", now2);
|
|
59032
58616
|
}
|
|
59033
58617
|
}
|
|
59034
|
-
var
|
|
58618
|
+
var CACHE_DIR, CACHE_FILE, LOCK_FILE, CACHE_MAX_AGE = 180, LOCK_MAX_AGE = 30, DEFAULT_RATE_LIMIT_BACKOFF = 300, MACOS_USAGE_CREDENTIALS_SERVICE = "Claude Code-credentials", MACOS_SECURITY_DUMP_MAX_BUFFER, UsageCredentialsSchema, UsageLockErrorSchema, UsageLockSchema, CachedUsageDataSchema, UsageApiResponseSchema, cachedUsageData = null, usageCacheTime = 0, usageErrorCacheMaxAge, USAGE_API_HOST = "api.anthropic.com", USAGE_API_PATH = "/api/oauth/usage", USAGE_API_TIMEOUT_MS = 5000;
|
|
59035
58619
|
var init_usage_fetch = __esm(() => {
|
|
58620
|
+
init_dist5();
|
|
59036
58621
|
init_zod();
|
|
59037
58622
|
init_claude_settings();
|
|
59038
58623
|
init_usage_types();
|
|
59039
|
-
import_https_proxy_agent = __toESM(require_dist2(), 1);
|
|
59040
58624
|
CACHE_DIR = path3.join(os4.homedir(), ".cache", "ccstatusline");
|
|
59041
58625
|
CACHE_FILE = path3.join(CACHE_DIR, "usage.json");
|
|
59042
58626
|
LOCK_FILE = path3.join(CACHE_DIR, "usage.lock");
|
|
@@ -59571,7 +59155,7 @@ var __require2, SLASHES_REGEX, WINDOWS_ROOT_DIR_REGEX, pushDirectory = (director
|
|
|
59571
59155
|
return this;
|
|
59572
59156
|
}
|
|
59573
59157
|
};
|
|
59574
|
-
var
|
|
59158
|
+
var init_dist6 = __esm(() => {
|
|
59575
59159
|
__require2 = /* @__PURE__ */ createRequire2(import.meta.url);
|
|
59576
59160
|
SLASHES_REGEX = /[\\/]/g;
|
|
59577
59161
|
WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
|
|
@@ -59582,10 +59166,11 @@ var init_dist4 = __esm(() => {
|
|
|
59582
59166
|
} catch {}
|
|
59583
59167
|
});
|
|
59584
59168
|
|
|
59585
|
-
// node_modules/picomatch/lib/constants.js
|
|
59169
|
+
// node_modules/tinyglobby/node_modules/picomatch/lib/constants.js
|
|
59586
59170
|
var require_constants3 = __commonJS((exports, module) => {
|
|
59587
59171
|
var WIN_SLASH = "\\\\/";
|
|
59588
59172
|
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
59173
|
+
var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
|
|
59589
59174
|
var DOT_LITERAL = "\\.";
|
|
59590
59175
|
var PLUS_LITERAL = "\\+";
|
|
59591
59176
|
var QMARK_LITERAL = "\\?";
|
|
@@ -59636,6 +59221,7 @@ var require_constants3 = __commonJS((exports, module) => {
|
|
|
59636
59221
|
SEP: "\\"
|
|
59637
59222
|
};
|
|
59638
59223
|
var POSIX_REGEX_SOURCE = {
|
|
59224
|
+
__proto__: null,
|
|
59639
59225
|
alnum: "a-zA-Z0-9",
|
|
59640
59226
|
alpha: "a-zA-Z",
|
|
59641
59227
|
ascii: "\\x00-\\x7F",
|
|
@@ -59652,6 +59238,7 @@ var require_constants3 = __commonJS((exports, module) => {
|
|
|
59652
59238
|
xdigit: "A-Fa-f0-9"
|
|
59653
59239
|
};
|
|
59654
59240
|
module.exports = {
|
|
59241
|
+
DEFAULT_MAX_EXTGLOB_RECURSION,
|
|
59655
59242
|
MAX_LENGTH: 1024 * 64,
|
|
59656
59243
|
POSIX_REGEX_SOURCE,
|
|
59657
59244
|
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
@@ -59724,7 +59311,7 @@ var require_constants3 = __commonJS((exports, module) => {
|
|
|
59724
59311
|
};
|
|
59725
59312
|
});
|
|
59726
59313
|
|
|
59727
|
-
// node_modules/picomatch/lib/utils.js
|
|
59314
|
+
// node_modules/tinyglobby/node_modules/picomatch/lib/utils.js
|
|
59728
59315
|
var require_utils = __commonJS((exports) => {
|
|
59729
59316
|
var {
|
|
59730
59317
|
REGEX_BACKSLASH,
|
|
@@ -59787,7 +59374,7 @@ var require_utils = __commonJS((exports) => {
|
|
|
59787
59374
|
};
|
|
59788
59375
|
});
|
|
59789
59376
|
|
|
59790
|
-
// node_modules/picomatch/lib/scan.js
|
|
59377
|
+
// node_modules/tinyglobby/node_modules/picomatch/lib/scan.js
|
|
59791
59378
|
var require_scan = __commonJS((exports, module) => {
|
|
59792
59379
|
var utils = require_utils();
|
|
59793
59380
|
var {
|
|
@@ -60102,7 +59689,7 @@ var require_scan = __commonJS((exports, module) => {
|
|
|
60102
59689
|
module.exports = scan;
|
|
60103
59690
|
});
|
|
60104
59691
|
|
|
60105
|
-
// node_modules/picomatch/lib/parse.js
|
|
59692
|
+
// node_modules/tinyglobby/node_modules/picomatch/lib/parse.js
|
|
60106
59693
|
var require_parse = __commonJS((exports, module) => {
|
|
60107
59694
|
var constants2 = require_constants3();
|
|
60108
59695
|
var utils = require_utils();
|
|
@@ -60129,6 +59716,213 @@ var require_parse = __commonJS((exports, module) => {
|
|
|
60129
59716
|
var syntaxError = (type, char) => {
|
|
60130
59717
|
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
60131
59718
|
};
|
|
59719
|
+
var splitTopLevel = (input) => {
|
|
59720
|
+
const parts = [];
|
|
59721
|
+
let bracket = 0;
|
|
59722
|
+
let paren = 0;
|
|
59723
|
+
let quote = 0;
|
|
59724
|
+
let value = "";
|
|
59725
|
+
let escaped = false;
|
|
59726
|
+
for (const ch of input) {
|
|
59727
|
+
if (escaped === true) {
|
|
59728
|
+
value += ch;
|
|
59729
|
+
escaped = false;
|
|
59730
|
+
continue;
|
|
59731
|
+
}
|
|
59732
|
+
if (ch === "\\") {
|
|
59733
|
+
value += ch;
|
|
59734
|
+
escaped = true;
|
|
59735
|
+
continue;
|
|
59736
|
+
}
|
|
59737
|
+
if (ch === '"') {
|
|
59738
|
+
quote = quote === 1 ? 0 : 1;
|
|
59739
|
+
value += ch;
|
|
59740
|
+
continue;
|
|
59741
|
+
}
|
|
59742
|
+
if (quote === 0) {
|
|
59743
|
+
if (ch === "[") {
|
|
59744
|
+
bracket++;
|
|
59745
|
+
} else if (ch === "]" && bracket > 0) {
|
|
59746
|
+
bracket--;
|
|
59747
|
+
} else if (bracket === 0) {
|
|
59748
|
+
if (ch === "(") {
|
|
59749
|
+
paren++;
|
|
59750
|
+
} else if (ch === ")" && paren > 0) {
|
|
59751
|
+
paren--;
|
|
59752
|
+
} else if (ch === "|" && paren === 0) {
|
|
59753
|
+
parts.push(value);
|
|
59754
|
+
value = "";
|
|
59755
|
+
continue;
|
|
59756
|
+
}
|
|
59757
|
+
}
|
|
59758
|
+
}
|
|
59759
|
+
value += ch;
|
|
59760
|
+
}
|
|
59761
|
+
parts.push(value);
|
|
59762
|
+
return parts;
|
|
59763
|
+
};
|
|
59764
|
+
var isPlainBranch = (branch) => {
|
|
59765
|
+
let escaped = false;
|
|
59766
|
+
for (const ch of branch) {
|
|
59767
|
+
if (escaped === true) {
|
|
59768
|
+
escaped = false;
|
|
59769
|
+
continue;
|
|
59770
|
+
}
|
|
59771
|
+
if (ch === "\\") {
|
|
59772
|
+
escaped = true;
|
|
59773
|
+
continue;
|
|
59774
|
+
}
|
|
59775
|
+
if (/[?*+@!()[\]{}]/.test(ch)) {
|
|
59776
|
+
return false;
|
|
59777
|
+
}
|
|
59778
|
+
}
|
|
59779
|
+
return true;
|
|
59780
|
+
};
|
|
59781
|
+
var normalizeSimpleBranch = (branch) => {
|
|
59782
|
+
let value = branch.trim();
|
|
59783
|
+
let changed = true;
|
|
59784
|
+
while (changed === true) {
|
|
59785
|
+
changed = false;
|
|
59786
|
+
if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
|
|
59787
|
+
value = value.slice(2, -1);
|
|
59788
|
+
changed = true;
|
|
59789
|
+
}
|
|
59790
|
+
}
|
|
59791
|
+
if (!isPlainBranch(value)) {
|
|
59792
|
+
return;
|
|
59793
|
+
}
|
|
59794
|
+
return value.replace(/\\(.)/g, "$1");
|
|
59795
|
+
};
|
|
59796
|
+
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
59797
|
+
const values2 = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
59798
|
+
for (let i = 0;i < values2.length; i++) {
|
|
59799
|
+
for (let j = i + 1;j < values2.length; j++) {
|
|
59800
|
+
const a = values2[i];
|
|
59801
|
+
const b = values2[j];
|
|
59802
|
+
const char = a[0];
|
|
59803
|
+
if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
|
|
59804
|
+
continue;
|
|
59805
|
+
}
|
|
59806
|
+
if (a === b || a.startsWith(b) || b.startsWith(a)) {
|
|
59807
|
+
return true;
|
|
59808
|
+
}
|
|
59809
|
+
}
|
|
59810
|
+
}
|
|
59811
|
+
return false;
|
|
59812
|
+
};
|
|
59813
|
+
var parseRepeatedExtglob = (pattern, requireEnd = true) => {
|
|
59814
|
+
if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") {
|
|
59815
|
+
return;
|
|
59816
|
+
}
|
|
59817
|
+
let bracket = 0;
|
|
59818
|
+
let paren = 0;
|
|
59819
|
+
let quote = 0;
|
|
59820
|
+
let escaped = false;
|
|
59821
|
+
for (let i = 1;i < pattern.length; i++) {
|
|
59822
|
+
const ch = pattern[i];
|
|
59823
|
+
if (escaped === true) {
|
|
59824
|
+
escaped = false;
|
|
59825
|
+
continue;
|
|
59826
|
+
}
|
|
59827
|
+
if (ch === "\\") {
|
|
59828
|
+
escaped = true;
|
|
59829
|
+
continue;
|
|
59830
|
+
}
|
|
59831
|
+
if (ch === '"') {
|
|
59832
|
+
quote = quote === 1 ? 0 : 1;
|
|
59833
|
+
continue;
|
|
59834
|
+
}
|
|
59835
|
+
if (quote === 1) {
|
|
59836
|
+
continue;
|
|
59837
|
+
}
|
|
59838
|
+
if (ch === "[") {
|
|
59839
|
+
bracket++;
|
|
59840
|
+
continue;
|
|
59841
|
+
}
|
|
59842
|
+
if (ch === "]" && bracket > 0) {
|
|
59843
|
+
bracket--;
|
|
59844
|
+
continue;
|
|
59845
|
+
}
|
|
59846
|
+
if (bracket > 0) {
|
|
59847
|
+
continue;
|
|
59848
|
+
}
|
|
59849
|
+
if (ch === "(") {
|
|
59850
|
+
paren++;
|
|
59851
|
+
continue;
|
|
59852
|
+
}
|
|
59853
|
+
if (ch === ")") {
|
|
59854
|
+
paren--;
|
|
59855
|
+
if (paren === 0) {
|
|
59856
|
+
if (requireEnd === true && i !== pattern.length - 1) {
|
|
59857
|
+
return;
|
|
59858
|
+
}
|
|
59859
|
+
return {
|
|
59860
|
+
type: pattern[0],
|
|
59861
|
+
body: pattern.slice(2, i),
|
|
59862
|
+
end: i
|
|
59863
|
+
};
|
|
59864
|
+
}
|
|
59865
|
+
}
|
|
59866
|
+
}
|
|
59867
|
+
};
|
|
59868
|
+
var getStarExtglobSequenceOutput = (pattern) => {
|
|
59869
|
+
let index = 0;
|
|
59870
|
+
const chars = [];
|
|
59871
|
+
while (index < pattern.length) {
|
|
59872
|
+
const match = parseRepeatedExtglob(pattern.slice(index), false);
|
|
59873
|
+
if (!match || match.type !== "*") {
|
|
59874
|
+
return;
|
|
59875
|
+
}
|
|
59876
|
+
const branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
|
|
59877
|
+
if (branches.length !== 1) {
|
|
59878
|
+
return;
|
|
59879
|
+
}
|
|
59880
|
+
const branch = normalizeSimpleBranch(branches[0]);
|
|
59881
|
+
if (!branch || branch.length !== 1) {
|
|
59882
|
+
return;
|
|
59883
|
+
}
|
|
59884
|
+
chars.push(branch);
|
|
59885
|
+
index += match.end + 1;
|
|
59886
|
+
}
|
|
59887
|
+
if (chars.length < 1) {
|
|
59888
|
+
return;
|
|
59889
|
+
}
|
|
59890
|
+
const source = chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`;
|
|
59891
|
+
return `${source}*`;
|
|
59892
|
+
};
|
|
59893
|
+
var repeatedExtglobRecursion = (pattern) => {
|
|
59894
|
+
let depth = 0;
|
|
59895
|
+
let value = pattern.trim();
|
|
59896
|
+
let match = parseRepeatedExtglob(value);
|
|
59897
|
+
while (match) {
|
|
59898
|
+
depth++;
|
|
59899
|
+
value = match.body.trim();
|
|
59900
|
+
match = parseRepeatedExtglob(value);
|
|
59901
|
+
}
|
|
59902
|
+
return depth;
|
|
59903
|
+
};
|
|
59904
|
+
var analyzeRepeatedExtglob = (body, options) => {
|
|
59905
|
+
if (options.maxExtglobRecursion === false) {
|
|
59906
|
+
return { risky: false };
|
|
59907
|
+
}
|
|
59908
|
+
const max2 = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants2.DEFAULT_MAX_EXTGLOB_RECURSION;
|
|
59909
|
+
const branches = splitTopLevel(body).map((branch) => branch.trim());
|
|
59910
|
+
if (branches.length > 1) {
|
|
59911
|
+
if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
|
|
59912
|
+
return { risky: true };
|
|
59913
|
+
}
|
|
59914
|
+
}
|
|
59915
|
+
for (const branch of branches) {
|
|
59916
|
+
const safeOutput = getStarExtglobSequenceOutput(branch);
|
|
59917
|
+
if (safeOutput) {
|
|
59918
|
+
return { risky: true, safeOutput };
|
|
59919
|
+
}
|
|
59920
|
+
if (repeatedExtglobRecursion(branch) > max2) {
|
|
59921
|
+
return { risky: true };
|
|
59922
|
+
}
|
|
59923
|
+
}
|
|
59924
|
+
return { risky: false };
|
|
59925
|
+
};
|
|
60132
59926
|
var parse5 = (input, options) => {
|
|
60133
59927
|
if (typeof input !== "string") {
|
|
60134
59928
|
throw new TypeError("Expected a string");
|
|
@@ -60260,6 +60054,8 @@ var require_parse = __commonJS((exports, module) => {
|
|
|
60260
60054
|
token.prev = prev;
|
|
60261
60055
|
token.parens = state.parens;
|
|
60262
60056
|
token.output = state.output;
|
|
60057
|
+
token.startIndex = state.index;
|
|
60058
|
+
token.tokensIndex = tokens.length;
|
|
60263
60059
|
const output = (opts.capture ? "(" : "") + token.open;
|
|
60264
60060
|
increment("parens");
|
|
60265
60061
|
push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
|
|
@@ -60267,6 +60063,26 @@ var require_parse = __commonJS((exports, module) => {
|
|
|
60267
60063
|
extglobs.push(token);
|
|
60268
60064
|
};
|
|
60269
60065
|
const extglobClose = (token) => {
|
|
60066
|
+
const literal2 = input.slice(token.startIndex, state.index + 1);
|
|
60067
|
+
const body = input.slice(token.startIndex + 2, state.index);
|
|
60068
|
+
const analysis = analyzeRepeatedExtglob(body, opts);
|
|
60069
|
+
if ((token.type === "plus" || token.type === "star") && analysis.risky) {
|
|
60070
|
+
const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : undefined;
|
|
60071
|
+
const open = tokens[token.tokensIndex];
|
|
60072
|
+
open.type = "text";
|
|
60073
|
+
open.value = literal2;
|
|
60074
|
+
open.output = safeOutput || utils.escapeRegex(literal2);
|
|
60075
|
+
for (let i = token.tokensIndex + 1;i < tokens.length; i++) {
|
|
60076
|
+
tokens[i].value = "";
|
|
60077
|
+
tokens[i].output = "";
|
|
60078
|
+
delete tokens[i].suffix;
|
|
60079
|
+
}
|
|
60080
|
+
state.output = token.output + open.output;
|
|
60081
|
+
state.backtrack = true;
|
|
60082
|
+
push({ type: "paren", extglob: true, value, output: "" });
|
|
60083
|
+
decrement("parens");
|
|
60084
|
+
return;
|
|
60085
|
+
}
|
|
60270
60086
|
let output = token.close + (opts.capture ? ")" : "");
|
|
60271
60087
|
let rest2;
|
|
60272
60088
|
if (token.type === "negate") {
|
|
@@ -60875,7 +60691,7 @@ var require_parse = __commonJS((exports, module) => {
|
|
|
60875
60691
|
module.exports = parse5;
|
|
60876
60692
|
});
|
|
60877
60693
|
|
|
60878
|
-
// node_modules/picomatch/lib/picomatch.js
|
|
60694
|
+
// node_modules/tinyglobby/node_modules/picomatch/lib/picomatch.js
|
|
60879
60695
|
var require_picomatch = __commonJS((exports, module) => {
|
|
60880
60696
|
var scan = require_scan();
|
|
60881
60697
|
var parse5 = require_parse();
|
|
@@ -60901,17 +60717,17 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
60901
60717
|
}
|
|
60902
60718
|
const opts = options || {};
|
|
60903
60719
|
const posix = opts.windows;
|
|
60904
|
-
const
|
|
60905
|
-
const state =
|
|
60906
|
-
delete
|
|
60720
|
+
const regex2 = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
|
|
60721
|
+
const state = regex2.state;
|
|
60722
|
+
delete regex2.state;
|
|
60907
60723
|
let isIgnored = () => false;
|
|
60908
60724
|
if (opts.ignore) {
|
|
60909
60725
|
const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
60910
60726
|
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
60911
60727
|
}
|
|
60912
60728
|
const matcher = (input, returnObject = false) => {
|
|
60913
|
-
const { isMatch: isMatch2, match, output } = picomatch.test(input,
|
|
60914
|
-
const result2 = { glob, state, regex:
|
|
60729
|
+
const { isMatch: isMatch2, match, output } = picomatch.test(input, regex2, options, { glob, posix });
|
|
60730
|
+
const result2 = { glob, state, regex: regex2, posix, input, output, match, isMatch: isMatch2 };
|
|
60915
60731
|
if (typeof opts.onResult === "function") {
|
|
60916
60732
|
opts.onResult(result2);
|
|
60917
60733
|
}
|
|
@@ -60936,7 +60752,7 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
60936
60752
|
}
|
|
60937
60753
|
return matcher;
|
|
60938
60754
|
};
|
|
60939
|
-
picomatch.test = (input,
|
|
60755
|
+
picomatch.test = (input, regex2, options, { glob, posix } = {}) => {
|
|
60940
60756
|
if (typeof input !== "string") {
|
|
60941
60757
|
throw new TypeError("Expected input to be a string");
|
|
60942
60758
|
}
|
|
@@ -60953,16 +60769,16 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
60953
60769
|
}
|
|
60954
60770
|
if (match === false || opts.capture === true) {
|
|
60955
60771
|
if (opts.matchBase === true || opts.basename === true) {
|
|
60956
|
-
match = picomatch.matchBase(input,
|
|
60772
|
+
match = picomatch.matchBase(input, regex2, options, posix);
|
|
60957
60773
|
} else {
|
|
60958
|
-
match =
|
|
60774
|
+
match = regex2.exec(output);
|
|
60959
60775
|
}
|
|
60960
60776
|
}
|
|
60961
60777
|
return { isMatch: Boolean(match), match, output };
|
|
60962
60778
|
};
|
|
60963
60779
|
picomatch.matchBase = (input, glob, options) => {
|
|
60964
|
-
const
|
|
60965
|
-
return
|
|
60780
|
+
const regex2 = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
|
60781
|
+
return regex2.test(utils.basename(input));
|
|
60966
60782
|
};
|
|
60967
60783
|
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
60968
60784
|
picomatch.parse = (pattern, options) => {
|
|
@@ -60982,11 +60798,11 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
60982
60798
|
if (state && state.negated === true) {
|
|
60983
60799
|
source = `^(?!${source}).*$`;
|
|
60984
60800
|
}
|
|
60985
|
-
const
|
|
60801
|
+
const regex2 = picomatch.toRegex(source, options);
|
|
60986
60802
|
if (returnState === true) {
|
|
60987
|
-
|
|
60803
|
+
regex2.state = state;
|
|
60988
60804
|
}
|
|
60989
|
-
return
|
|
60805
|
+
return regex2;
|
|
60990
60806
|
};
|
|
60991
60807
|
picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
|
60992
60808
|
if (!input || typeof input !== "string") {
|
|
@@ -61015,7 +60831,7 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
61015
60831
|
module.exports = picomatch;
|
|
61016
60832
|
});
|
|
61017
60833
|
|
|
61018
|
-
// node_modules/picomatch/index.js
|
|
60834
|
+
// node_modules/tinyglobby/node_modules/picomatch/index.js
|
|
61019
60835
|
var require_picomatch2 = __commonJS((exports, module) => {
|
|
61020
60836
|
var pico = require_picomatch();
|
|
61021
60837
|
var utils = require_utils();
|
|
@@ -61030,20 +60846,20 @@ var require_picomatch2 = __commonJS((exports, module) => {
|
|
|
61030
60846
|
});
|
|
61031
60847
|
|
|
61032
60848
|
// node_modules/tinyglobby/dist/index.mjs
|
|
61033
|
-
import
|
|
61034
|
-
import
|
|
60849
|
+
import { readdir, readdirSync, realpath, realpathSync, stat, statSync as statSync3 } from "fs";
|
|
60850
|
+
import { isAbsolute, posix, resolve as resolve2 } from "path";
|
|
61035
60851
|
import { fileURLToPath } from "url";
|
|
61036
60852
|
function getPartialMatcher(patterns, options = {}) {
|
|
61037
60853
|
const patternsCount = patterns.length;
|
|
61038
60854
|
const patternsParts = Array(patternsCount);
|
|
61039
60855
|
const matchers = Array(patternsCount);
|
|
61040
|
-
|
|
61041
|
-
for (
|
|
60856
|
+
let i, j;
|
|
60857
|
+
for (i = 0;i < patternsCount; i++) {
|
|
61042
60858
|
const parts = splitPattern(patterns[i]);
|
|
61043
60859
|
patternsParts[i] = parts;
|
|
61044
60860
|
const partsCount = parts.length;
|
|
61045
60861
|
const partMatchers = Array(partsCount);
|
|
61046
|
-
for (
|
|
60862
|
+
for (j = 0;j < partsCount; j++)
|
|
61047
60863
|
partMatchers[j] = import_picomatch.default(parts[j], options);
|
|
61048
60864
|
matchers[i] = partMatchers;
|
|
61049
60865
|
}
|
|
@@ -61051,20 +60867,19 @@ function getPartialMatcher(patterns, options = {}) {
|
|
|
61051
60867
|
const inputParts = input.split("/");
|
|
61052
60868
|
if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input))
|
|
61053
60869
|
return true;
|
|
61054
|
-
for (
|
|
60870
|
+
for (i = 0;i < patternsCount; i++) {
|
|
61055
60871
|
const patternParts = patternsParts[i];
|
|
61056
60872
|
const matcher = matchers[i];
|
|
61057
60873
|
const inputPatternCount = inputParts.length;
|
|
61058
60874
|
const minParts = Math.min(inputPatternCount, patternParts.length);
|
|
61059
|
-
|
|
60875
|
+
j = 0;
|
|
61060
60876
|
while (j < minParts) {
|
|
61061
60877
|
const part = patternParts[j];
|
|
61062
60878
|
if (part.includes("/"))
|
|
61063
60879
|
return true;
|
|
61064
|
-
|
|
61065
|
-
if (!match)
|
|
60880
|
+
if (!matcher[j](inputParts[j]))
|
|
61066
60881
|
break;
|
|
61067
|
-
if (
|
|
60882
|
+
if (!options.noglobstar && part === "**")
|
|
61068
60883
|
return true;
|
|
61069
60884
|
j++;
|
|
61070
60885
|
}
|
|
@@ -61077,7 +60892,7 @@ function getPartialMatcher(patterns, options = {}) {
|
|
|
61077
60892
|
function buildFormat(cwd2, root, absolute) {
|
|
61078
60893
|
if (cwd2 === root || root.startsWith(`${cwd2}/`)) {
|
|
61079
60894
|
if (absolute) {
|
|
61080
|
-
const start =
|
|
60895
|
+
const start = cwd2.length + +!isRoot(cwd2);
|
|
61081
60896
|
return (p, isDir) => p.slice(start, isDir ? -1 : undefined) || ".";
|
|
61082
60897
|
}
|
|
61083
60898
|
const prefix = root.slice(cwd2.length + 1);
|
|
@@ -61101,15 +60916,13 @@ function buildRelative(cwd2, root) {
|
|
|
61101
60916
|
}
|
|
61102
60917
|
return (p) => {
|
|
61103
60918
|
const result2 = posix.relative(cwd2, `${root}/${p}`);
|
|
61104
|
-
|
|
61105
|
-
return `${result2}/`;
|
|
61106
|
-
return result2 || ".";
|
|
60919
|
+
return p[p.length - 1] === "/" && result2 !== "" ? `${result2}/` : result2 || ".";
|
|
61107
60920
|
};
|
|
61108
60921
|
}
|
|
61109
|
-
function splitPattern(
|
|
60922
|
+
function splitPattern(path4) {
|
|
61110
60923
|
var _result$parts;
|
|
61111
|
-
const result2 = import_picomatch.default.scan(
|
|
61112
|
-
return ((_result$parts = result2.parts) === null || _result$parts === undefined ? undefined : _result$parts.length) ? result2.parts : [
|
|
60924
|
+
const result2 = import_picomatch.default.scan(path4, splitPatternOptions);
|
|
60925
|
+
return ((_result$parts = result2.parts) === null || _result$parts === undefined ? undefined : _result$parts.length) ? result2.parts : [path4];
|
|
61113
60926
|
}
|
|
61114
60927
|
function isDynamicPattern(pattern, options) {
|
|
61115
60928
|
if ((options === null || options === undefined ? undefined : options.caseSensitiveMatch) === false)
|
|
@@ -61120,29 +60933,31 @@ function isDynamicPattern(pattern, options) {
|
|
|
61120
60933
|
function log(...tasks) {
|
|
61121
60934
|
console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString("es")}]`, ...tasks);
|
|
61122
60935
|
}
|
|
61123
|
-
function
|
|
60936
|
+
function ensureStringArray(value) {
|
|
60937
|
+
return typeof value === "string" ? [value] : value !== null && value !== undefined ? value : [];
|
|
60938
|
+
}
|
|
60939
|
+
function normalizePattern(pattern, opts, props, isIgnore) {
|
|
60940
|
+
var _PARENT_DIRECTORY$exe;
|
|
60941
|
+
const cwd2 = opts.cwd;
|
|
61124
60942
|
let result2 = pattern;
|
|
61125
|
-
if (pattern.
|
|
60943
|
+
if (pattern[pattern.length - 1] === "/")
|
|
61126
60944
|
result2 = pattern.slice(0, -1);
|
|
61127
|
-
if (
|
|
60945
|
+
if (result2[result2.length - 1] !== "*" && opts.expandDirectories)
|
|
61128
60946
|
result2 += "/**";
|
|
61129
60947
|
const escapedCwd = escapePath(cwd2);
|
|
61130
|
-
|
|
61131
|
-
|
|
61132
|
-
else
|
|
61133
|
-
result2 = posix.normalize(result2);
|
|
61134
|
-
const parentDirectoryMatch = PARENT_DIRECTORY.exec(result2);
|
|
60948
|
+
result2 = isAbsolute(result2.replace(ESCAPING_BACKSLASHES, "")) ? posix.relative(escapedCwd, result2) : posix.normalize(result2);
|
|
60949
|
+
const parentDir = (_PARENT_DIRECTORY$exe = PARENT_DIRECTORY.exec(result2)) === null || _PARENT_DIRECTORY$exe === undefined ? undefined : _PARENT_DIRECTORY$exe[0];
|
|
61135
60950
|
const parts = splitPattern(result2);
|
|
61136
|
-
if (
|
|
61137
|
-
const n = (
|
|
60951
|
+
if (parentDir) {
|
|
60952
|
+
const n = (parentDir.length + 1) / 3;
|
|
61138
60953
|
let i = 0;
|
|
61139
60954
|
const cwdParts = escapedCwd.split("/");
|
|
61140
60955
|
while (i < n && parts[i + n] === cwdParts[cwdParts.length + i - n]) {
|
|
61141
60956
|
result2 = result2.slice(0, (n - i - 1) * 3) + result2.slice((n - i) * 3 + parts[i + n].length + 1) || ".";
|
|
61142
60957
|
i++;
|
|
61143
60958
|
}
|
|
61144
|
-
const potentialRoot = posix.join(cwd2,
|
|
61145
|
-
if (
|
|
60959
|
+
const potentialRoot = posix.join(cwd2, parentDir.slice(i * 3));
|
|
60960
|
+
if (potentialRoot[0] !== "." && props.root.length > potentialRoot.length) {
|
|
61146
60961
|
props.root = potentialRoot;
|
|
61147
60962
|
props.depthOffset = -n + i;
|
|
61148
60963
|
}
|
|
@@ -61158,7 +60973,7 @@ function normalizePattern(pattern, expandDirectories, cwd2, props, isIgnore) {
|
|
|
61158
60973
|
newCommonPath.pop();
|
|
61159
60974
|
break;
|
|
61160
60975
|
}
|
|
61161
|
-
if (part !== props.commonPath[i] || isDynamicPattern(part)
|
|
60976
|
+
if (i === parts.length - 1 || part !== props.commonPath[i] || isDynamicPattern(part))
|
|
61162
60977
|
break;
|
|
61163
60978
|
newCommonPath.push(part);
|
|
61164
60979
|
}
|
|
@@ -61168,162 +60983,138 @@ function normalizePattern(pattern, expandDirectories, cwd2, props, isIgnore) {
|
|
|
61168
60983
|
}
|
|
61169
60984
|
return result2;
|
|
61170
60985
|
}
|
|
61171
|
-
function processPatterns(
|
|
61172
|
-
if (typeof patterns === "string")
|
|
61173
|
-
patterns = [patterns];
|
|
61174
|
-
if (typeof ignore === "string")
|
|
61175
|
-
ignore = [ignore];
|
|
60986
|
+
function processPatterns(options, patterns, props) {
|
|
61176
60987
|
const matchPatterns = [];
|
|
61177
60988
|
const ignorePatterns = [];
|
|
61178
|
-
for (const pattern of ignore) {
|
|
60989
|
+
for (const pattern of options.ignore) {
|
|
61179
60990
|
if (!pattern)
|
|
61180
60991
|
continue;
|
|
61181
60992
|
if (pattern[0] !== "!" || pattern[1] === "(")
|
|
61182
|
-
ignorePatterns.push(normalizePattern(pattern,
|
|
60993
|
+
ignorePatterns.push(normalizePattern(pattern, options, props, true));
|
|
61183
60994
|
}
|
|
61184
60995
|
for (const pattern of patterns) {
|
|
61185
60996
|
if (!pattern)
|
|
61186
60997
|
continue;
|
|
61187
60998
|
if (pattern[0] !== "!" || pattern[1] === "(")
|
|
61188
|
-
matchPatterns.push(normalizePattern(pattern,
|
|
60999
|
+
matchPatterns.push(normalizePattern(pattern, options, props, false));
|
|
61189
61000
|
else if (pattern[1] !== "!" || pattern[2] === "(")
|
|
61190
|
-
ignorePatterns.push(normalizePattern(pattern.slice(1),
|
|
61001
|
+
ignorePatterns.push(normalizePattern(pattern.slice(1), options, props, true));
|
|
61191
61002
|
}
|
|
61192
61003
|
return {
|
|
61193
61004
|
match: matchPatterns,
|
|
61194
61005
|
ignore: ignorePatterns
|
|
61195
61006
|
};
|
|
61196
61007
|
}
|
|
61197
|
-
function
|
|
61198
|
-
|
|
61199
|
-
const path$1 = paths[i];
|
|
61200
|
-
paths[i] = relative2(path$1);
|
|
61201
|
-
}
|
|
61202
|
-
return paths;
|
|
61203
|
-
}
|
|
61204
|
-
function normalizeCwd(cwd2) {
|
|
61205
|
-
if (!cwd2)
|
|
61206
|
-
return process.cwd().replace(BACKSLASHES, "/");
|
|
61207
|
-
if (cwd2 instanceof URL)
|
|
61208
|
-
return fileURLToPath(cwd2).replace(BACKSLASHES, "/");
|
|
61209
|
-
return path4.resolve(cwd2).replace(BACKSLASHES, "/");
|
|
61210
|
-
}
|
|
61211
|
-
function getCrawler(patterns, inputOptions = {}) {
|
|
61212
|
-
const options = process.env.TINYGLOBBY_DEBUG ? {
|
|
61213
|
-
...inputOptions,
|
|
61214
|
-
debug: true
|
|
61215
|
-
} : inputOptions;
|
|
61216
|
-
const cwd2 = normalizeCwd(options.cwd);
|
|
61217
|
-
if (options.debug)
|
|
61218
|
-
log("globbing with:", {
|
|
61219
|
-
patterns,
|
|
61220
|
-
options,
|
|
61221
|
-
cwd: cwd2
|
|
61222
|
-
});
|
|
61223
|
-
if (Array.isArray(patterns) && patterns.length === 0)
|
|
61224
|
-
return [{
|
|
61225
|
-
sync: () => [],
|
|
61226
|
-
withPromise: async () => []
|
|
61227
|
-
}, false];
|
|
61008
|
+
function buildCrawler(options, patterns) {
|
|
61009
|
+
const cwd2 = options.cwd;
|
|
61228
61010
|
const props = {
|
|
61229
61011
|
root: cwd2,
|
|
61230
|
-
commonPath: null,
|
|
61231
61012
|
depthOffset: 0
|
|
61232
61013
|
};
|
|
61233
|
-
const processed = processPatterns(
|
|
61234
|
-
...options,
|
|
61235
|
-
patterns
|
|
61236
|
-
}, cwd2, props);
|
|
61014
|
+
const processed = processPatterns(options, patterns, props);
|
|
61237
61015
|
if (options.debug)
|
|
61238
61016
|
log("internal processing patterns:", processed);
|
|
61017
|
+
const { absolute, caseSensitiveMatch, debug: debug3, dot, followSymbolicLinks, onlyDirectories } = options;
|
|
61018
|
+
const root = props.root.replace(BACKSLASHES, "");
|
|
61239
61019
|
const matchOptions = {
|
|
61240
|
-
dot
|
|
61020
|
+
dot,
|
|
61241
61021
|
nobrace: options.braceExpansion === false,
|
|
61242
|
-
nocase:
|
|
61022
|
+
nocase: !caseSensitiveMatch,
|
|
61243
61023
|
noextglob: options.extglob === false,
|
|
61244
61024
|
noglobstar: options.globstar === false,
|
|
61245
61025
|
posix: true
|
|
61246
61026
|
};
|
|
61247
|
-
const matcher = import_picomatch.default(processed.match,
|
|
61248
|
-
...matchOptions,
|
|
61249
|
-
ignore: processed.ignore
|
|
61250
|
-
});
|
|
61027
|
+
const matcher = import_picomatch.default(processed.match, matchOptions);
|
|
61251
61028
|
const ignore = import_picomatch.default(processed.ignore, matchOptions);
|
|
61252
61029
|
const partialMatcher = getPartialMatcher(processed.match, matchOptions);
|
|
61253
|
-
const format = buildFormat(cwd2,
|
|
61254
|
-
const
|
|
61255
|
-
const
|
|
61256
|
-
|
|
61257
|
-
|
|
61258
|
-
|
|
61030
|
+
const format = buildFormat(cwd2, root, absolute);
|
|
61031
|
+
const excludeFormatter = absolute ? format : buildFormat(cwd2, root, true);
|
|
61032
|
+
const excludePredicate = (_, p) => {
|
|
61033
|
+
const relativePath = excludeFormatter(p, true);
|
|
61034
|
+
return relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
|
|
61035
|
+
};
|
|
61036
|
+
let maxDepth;
|
|
61037
|
+
if (options.deep !== undefined)
|
|
61038
|
+
maxDepth = Math.round(options.deep - props.depthOffset);
|
|
61039
|
+
const crawler = new Builder({
|
|
61040
|
+
filters: [debug3 ? (p, isDirectory) => {
|
|
61041
|
+
const path4 = format(p, isDirectory);
|
|
61042
|
+
const matches2 = matcher(path4) && !ignore(path4);
|
|
61259
61043
|
if (matches2)
|
|
61260
|
-
log(`matched ${
|
|
61044
|
+
log(`matched ${path4}`);
|
|
61261
61045
|
return matches2;
|
|
61262
|
-
} : (p, isDirectory) =>
|
|
61263
|
-
|
|
61264
|
-
|
|
61265
|
-
|
|
61266
|
-
|
|
61267
|
-
|
|
61268
|
-
|
|
61269
|
-
log(`crawling ${p}`);
|
|
61046
|
+
} : (p, isDirectory) => {
|
|
61047
|
+
const path4 = format(p, isDirectory);
|
|
61048
|
+
return matcher(path4) && !ignore(path4);
|
|
61049
|
+
}],
|
|
61050
|
+
exclude: debug3 ? (_, p) => {
|
|
61051
|
+
const skipped = excludePredicate(_, p);
|
|
61052
|
+
log(`${skipped ? "skipped" : "crawling"} ${p}`);
|
|
61270
61053
|
return skipped;
|
|
61271
|
-
} :
|
|
61272
|
-
|
|
61273
|
-
return relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
|
|
61274
|
-
},
|
|
61275
|
-
fs: options.fs ? {
|
|
61276
|
-
readdir: options.fs.readdir || nativeFs2.readdir,
|
|
61277
|
-
readdirSync: options.fs.readdirSync || nativeFs2.readdirSync,
|
|
61278
|
-
realpath: options.fs.realpath || nativeFs2.realpath,
|
|
61279
|
-
realpathSync: options.fs.realpathSync || nativeFs2.realpathSync,
|
|
61280
|
-
stat: options.fs.stat || nativeFs2.stat,
|
|
61281
|
-
statSync: options.fs.statSync || nativeFs2.statSync
|
|
61282
|
-
} : undefined,
|
|
61054
|
+
} : excludePredicate,
|
|
61055
|
+
fs: options.fs,
|
|
61283
61056
|
pathSeparator: "/",
|
|
61284
|
-
relativePaths:
|
|
61285
|
-
|
|
61057
|
+
relativePaths: !absolute,
|
|
61058
|
+
resolvePaths: absolute,
|
|
61059
|
+
includeBasePath: absolute,
|
|
61060
|
+
resolveSymlinks: followSymbolicLinks,
|
|
61061
|
+
excludeSymlinks: !followSymbolicLinks,
|
|
61062
|
+
excludeFiles: onlyDirectories,
|
|
61063
|
+
includeDirs: onlyDirectories || !options.onlyFiles,
|
|
61064
|
+
maxDepth,
|
|
61286
61065
|
signal: options.signal
|
|
61287
|
-
};
|
|
61288
|
-
if (options.deep !== undefined)
|
|
61289
|
-
fdirOptions.maxDepth = Math.round(options.deep - props.depthOffset);
|
|
61290
|
-
if (options.absolute) {
|
|
61291
|
-
fdirOptions.relativePaths = false;
|
|
61292
|
-
fdirOptions.resolvePaths = true;
|
|
61293
|
-
fdirOptions.includeBasePath = true;
|
|
61294
|
-
}
|
|
61295
|
-
if (options.followSymbolicLinks === false) {
|
|
61296
|
-
fdirOptions.resolveSymlinks = false;
|
|
61297
|
-
fdirOptions.excludeSymlinks = true;
|
|
61298
|
-
}
|
|
61299
|
-
if (options.onlyDirectories) {
|
|
61300
|
-
fdirOptions.excludeFiles = true;
|
|
61301
|
-
fdirOptions.includeDirs = true;
|
|
61302
|
-
} else if (options.onlyFiles === false)
|
|
61303
|
-
fdirOptions.includeDirs = true;
|
|
61304
|
-
props.root = props.root.replace(BACKSLASHES, "");
|
|
61305
|
-
const root = props.root;
|
|
61066
|
+
}).crawl(root);
|
|
61306
61067
|
if (options.debug)
|
|
61307
|
-
log("internal properties:",
|
|
61308
|
-
|
|
61309
|
-
|
|
61068
|
+
log("internal properties:", {
|
|
61069
|
+
...props,
|
|
61070
|
+
root
|
|
61071
|
+
});
|
|
61072
|
+
return [crawler, cwd2 !== root && !absolute && buildRelative(cwd2, root)];
|
|
61310
61073
|
}
|
|
61311
|
-
function
|
|
61312
|
-
if (
|
|
61074
|
+
function formatPaths(paths, mapper) {
|
|
61075
|
+
if (mapper)
|
|
61076
|
+
for (let i = paths.length - 1;i >= 0; i--)
|
|
61077
|
+
paths[i] = mapper(paths[i]);
|
|
61078
|
+
return paths;
|
|
61079
|
+
}
|
|
61080
|
+
function getOptions2(options) {
|
|
61081
|
+
const opts = {
|
|
61082
|
+
...defaultOptions,
|
|
61083
|
+
...options
|
|
61084
|
+
};
|
|
61085
|
+
opts.cwd = (opts.cwd instanceof URL ? fileURLToPath(opts.cwd) : resolve2(opts.cwd)).replace(BACKSLASHES, "/");
|
|
61086
|
+
opts.ignore = ensureStringArray(opts.ignore);
|
|
61087
|
+
opts.fs && (opts.fs = {
|
|
61088
|
+
readdir: opts.fs.readdir || readdir,
|
|
61089
|
+
readdirSync: opts.fs.readdirSync || readdirSync,
|
|
61090
|
+
realpath: opts.fs.realpath || realpath,
|
|
61091
|
+
realpathSync: opts.fs.realpathSync || realpathSync,
|
|
61092
|
+
stat: opts.fs.stat || stat,
|
|
61093
|
+
statSync: opts.fs.statSync || statSync3
|
|
61094
|
+
});
|
|
61095
|
+
if (opts.debug)
|
|
61096
|
+
log("globbing with options:", opts);
|
|
61097
|
+
return opts;
|
|
61098
|
+
}
|
|
61099
|
+
function getCrawler(globInput, inputOptions = {}) {
|
|
61100
|
+
var _ref;
|
|
61101
|
+
if (globInput && (inputOptions === null || inputOptions === undefined ? undefined : inputOptions.patterns))
|
|
61313
61102
|
throw new Error("Cannot pass patterns as both an argument and an option");
|
|
61314
|
-
const isModern = isReadonlyArray(
|
|
61315
|
-
const
|
|
61316
|
-
const
|
|
61317
|
-
|
|
61318
|
-
|
|
61319
|
-
|
|
61320
|
-
|
|
61321
|
-
|
|
61322
|
-
|
|
61323
|
-
var
|
|
61324
|
-
|
|
61103
|
+
const isModern = isReadonlyArray(globInput) || typeof globInput === "string";
|
|
61104
|
+
const patterns = ensureStringArray((_ref = isModern ? globInput : globInput.patterns) !== null && _ref !== undefined ? _ref : "**/*");
|
|
61105
|
+
const options = getOptions2(isModern ? inputOptions : globInput);
|
|
61106
|
+
return patterns.length > 0 ? buildCrawler(options, patterns) : [];
|
|
61107
|
+
}
|
|
61108
|
+
function globSync(globInput, options) {
|
|
61109
|
+
const [crawler, relative2] = getCrawler(globInput, options);
|
|
61110
|
+
return crawler ? formatPaths(crawler.sync(), relative2) : [];
|
|
61111
|
+
}
|
|
61112
|
+
var import_picomatch, isReadonlyArray, BACKSLASHES, isWin, ONLY_PARENT_DIRECTORIES, WIN32_ROOT_DIR, isRoot, splitPatternOptions, POSIX_UNESCAPED_GLOB_SYMBOLS, WIN32_UNESCAPED_GLOB_SYMBOLS, escapePosixPath = (path4) => path4.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&"), escapeWin32Path = (path4) => path4.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&"), escapePath, PARENT_DIRECTORY, ESCAPING_BACKSLASHES, defaultOptions;
|
|
61113
|
+
var init_dist7 = __esm(() => {
|
|
61114
|
+
init_dist6();
|
|
61325
61115
|
import_picomatch = __toESM(require_picomatch2(), 1);
|
|
61326
61116
|
isReadonlyArray = Array.isArray;
|
|
61117
|
+
BACKSLASHES = /\\/g;
|
|
61327
61118
|
isWin = process.platform === "win32";
|
|
61328
61119
|
ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
|
|
61329
61120
|
WIN32_ROOT_DIR = /^[A-Z]:\/$/i;
|
|
@@ -61334,7 +61125,14 @@ var init_dist5 = __esm(() => {
|
|
|
61334
61125
|
escapePath = isWin ? escapeWin32Path : escapePosixPath;
|
|
61335
61126
|
PARENT_DIRECTORY = /^(\/?\.\.)+/;
|
|
61336
61127
|
ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g;
|
|
61337
|
-
|
|
61128
|
+
defaultOptions = {
|
|
61129
|
+
caseSensitiveMatch: true,
|
|
61130
|
+
cwd: process.cwd(),
|
|
61131
|
+
debug: !!process.env.TINYGLOBBY_DEBUG,
|
|
61132
|
+
expandDirectories: true,
|
|
61133
|
+
followSymbolicLinks: true,
|
|
61134
|
+
onlyFiles: true
|
|
61135
|
+
};
|
|
61338
61136
|
});
|
|
61339
61137
|
|
|
61340
61138
|
// src/utils/jsonl-lines.ts
|
|
@@ -61367,7 +61165,7 @@ var init_jsonl_lines = __esm(() => {
|
|
|
61367
61165
|
|
|
61368
61166
|
// src/utils/jsonl-blocks.ts
|
|
61369
61167
|
import * as fs5 from "fs";
|
|
61370
|
-
import
|
|
61168
|
+
import path4 from "node:path";
|
|
61371
61169
|
function getBlockMetrics() {
|
|
61372
61170
|
const claudeDir = getClaudeConfigDir();
|
|
61373
61171
|
if (!claudeDir)
|
|
@@ -61381,7 +61179,7 @@ function getBlockMetrics() {
|
|
|
61381
61179
|
function findMostRecentBlockStartTime(rootDir, sessionDurationHours = 5) {
|
|
61382
61180
|
const sessionDurationMs = sessionDurationHours * 60 * 60 * 1000;
|
|
61383
61181
|
const now2 = new Date;
|
|
61384
|
-
const pattern =
|
|
61182
|
+
const pattern = path4.posix.join(rootDir.replace(/\\/g, "/"), "projects", "**", "*.jsonl");
|
|
61385
61183
|
const files = globSync([pattern], {
|
|
61386
61184
|
absolute: true,
|
|
61387
61185
|
cwd: rootDir
|
|
@@ -61389,7 +61187,7 @@ function findMostRecentBlockStartTime(rootDir, sessionDurationHours = 5) {
|
|
|
61389
61187
|
if (files.length === 0)
|
|
61390
61188
|
return null;
|
|
61391
61189
|
const filesWithStats = files.map((file2) => {
|
|
61392
|
-
const stats =
|
|
61190
|
+
const stats = statSync5(file2);
|
|
61393
61191
|
return { file: file2, mtime: stats.mtime };
|
|
61394
61192
|
});
|
|
61395
61193
|
filesWithStats.sort((a, b) => b.mtime.getTime() - a.mtime.getTime());
|
|
@@ -61507,26 +61305,26 @@ function floorToHour(timestamp) {
|
|
|
61507
61305
|
floored.setUTCMinutes(0, 0, 0);
|
|
61508
61306
|
return floored;
|
|
61509
61307
|
}
|
|
61510
|
-
var
|
|
61308
|
+
var statSync5;
|
|
61511
61309
|
var init_jsonl_blocks = __esm(() => {
|
|
61512
|
-
|
|
61310
|
+
init_dist7();
|
|
61513
61311
|
init_claude_settings();
|
|
61514
61312
|
init_jsonl_lines();
|
|
61515
|
-
|
|
61313
|
+
statSync5 = fs5.statSync;
|
|
61516
61314
|
});
|
|
61517
61315
|
|
|
61518
61316
|
// src/utils/jsonl-cache.ts
|
|
61519
61317
|
import * as fs6 from "fs";
|
|
61520
61318
|
import { createHash as createHash2 } from "node:crypto";
|
|
61521
61319
|
import os5 from "node:os";
|
|
61522
|
-
import
|
|
61320
|
+
import path5 from "node:path";
|
|
61523
61321
|
function normalizeConfigDir(configDir) {
|
|
61524
|
-
return
|
|
61322
|
+
return path5.resolve(configDir);
|
|
61525
61323
|
}
|
|
61526
61324
|
function getBlockCachePath(configDir = getClaudeConfigDir()) {
|
|
61527
61325
|
const normalizedConfigDir = normalizeConfigDir(configDir);
|
|
61528
61326
|
const configHash = createHash2("sha256").update(normalizedConfigDir).digest("hex").slice(0, 16);
|
|
61529
|
-
return
|
|
61327
|
+
return path5.join(os5.homedir(), ".cache", "ccstatusline", `block-cache-${configHash}.json`);
|
|
61530
61328
|
}
|
|
61531
61329
|
function readBlockCache(expectedConfigDir) {
|
|
61532
61330
|
try {
|
|
@@ -61561,7 +61359,7 @@ function writeBlockCache(startTime, configDir = getClaudeConfigDir()) {
|
|
|
61561
61359
|
try {
|
|
61562
61360
|
const normalizedConfigDir = normalizeConfigDir(configDir);
|
|
61563
61361
|
const cachePath = getBlockCachePath(normalizedConfigDir);
|
|
61564
|
-
const cacheDir =
|
|
61362
|
+
const cacheDir = path5.dirname(cachePath);
|
|
61565
61363
|
if (!existsSync6(cacheDir)) {
|
|
61566
61364
|
mkdirSync4(cacheDir, { recursive: true });
|
|
61567
61365
|
}
|
|
@@ -61604,7 +61402,7 @@ var init_jsonl_cache = __esm(() => {
|
|
|
61604
61402
|
|
|
61605
61403
|
// src/utils/jsonl-metrics.ts
|
|
61606
61404
|
import * as fs7 from "fs";
|
|
61607
|
-
import
|
|
61405
|
+
import path6 from "node:path";
|
|
61608
61406
|
function collectAgentIds(value, agentIds) {
|
|
61609
61407
|
if (!value || typeof value !== "object") {
|
|
61610
61408
|
return;
|
|
@@ -61900,11 +61698,11 @@ function getSubagentTranscriptPaths(transcriptPath, referencedAgentIds) {
|
|
|
61900
61698
|
if (referencedAgentIds.size === 0) {
|
|
61901
61699
|
return [];
|
|
61902
61700
|
}
|
|
61903
|
-
const transcriptDir =
|
|
61904
|
-
const transcriptStem =
|
|
61701
|
+
const transcriptDir = path6.dirname(transcriptPath);
|
|
61702
|
+
const transcriptStem = path6.parse(transcriptPath).name;
|
|
61905
61703
|
const candidateDirs = [
|
|
61906
|
-
|
|
61907
|
-
|
|
61704
|
+
path6.join(transcriptDir, "subagents"),
|
|
61705
|
+
path6.join(transcriptDir, transcriptStem, "subagents")
|
|
61908
61706
|
];
|
|
61909
61707
|
const seenPaths = new Set;
|
|
61910
61708
|
const matchedPaths = [];
|
|
@@ -61925,7 +61723,7 @@ function getSubagentTranscriptPaths(transcriptPath, referencedAgentIds) {
|
|
|
61925
61723
|
if (!referencedAgentIds.has(match[1])) {
|
|
61926
61724
|
continue;
|
|
61927
61725
|
}
|
|
61928
|
-
const fullPath =
|
|
61726
|
+
const fullPath = path6.join(subagentsDir, entry.name);
|
|
61929
61727
|
if (seenPaths.has(fullPath)) {
|
|
61930
61728
|
continue;
|
|
61931
61729
|
}
|
|
@@ -62467,27 +62265,27 @@ class CurrentWorkingDirWidget {
|
|
|
62467
62265
|
supportsColors(item) {
|
|
62468
62266
|
return true;
|
|
62469
62267
|
}
|
|
62470
|
-
abbreviateHomeDir(
|
|
62268
|
+
abbreviateHomeDir(path7) {
|
|
62471
62269
|
const homeDir = os6.homedir();
|
|
62472
|
-
if (
|
|
62270
|
+
if (path7 === homeDir) {
|
|
62473
62271
|
return "~";
|
|
62474
62272
|
}
|
|
62475
|
-
if (
|
|
62476
|
-
const boundaryChar =
|
|
62273
|
+
if (path7.startsWith(homeDir)) {
|
|
62274
|
+
const boundaryChar = path7[homeDir.length];
|
|
62477
62275
|
if (boundaryChar !== "/" && boundaryChar !== "\\") {
|
|
62478
|
-
return
|
|
62276
|
+
return path7;
|
|
62479
62277
|
}
|
|
62480
|
-
return "~" +
|
|
62278
|
+
return "~" + path7.slice(homeDir.length);
|
|
62481
62279
|
}
|
|
62482
|
-
return
|
|
62280
|
+
return path7;
|
|
62483
62281
|
}
|
|
62484
|
-
abbreviatePath(
|
|
62282
|
+
abbreviatePath(path7) {
|
|
62485
62283
|
const homeDir = os6.homedir();
|
|
62486
|
-
const useBackslash =
|
|
62284
|
+
const useBackslash = path7.includes("\\") && !path7.includes("/");
|
|
62487
62285
|
const sep2 = useBackslash ? "\\" : "/";
|
|
62488
|
-
let normalizedPath =
|
|
62489
|
-
if (
|
|
62490
|
-
normalizedPath = "~" +
|
|
62286
|
+
let normalizedPath = path7;
|
|
62287
|
+
if (path7.startsWith(homeDir)) {
|
|
62288
|
+
normalizedPath = "~" + path7.slice(homeDir.length);
|
|
62491
62289
|
}
|
|
62492
62290
|
const parts = normalizedPath.split(/[\\/]+/).filter((part) => part !== "");
|
|
62493
62291
|
const abbreviated = parts.map((part, index) => {
|
|
@@ -62616,7 +62414,7 @@ class ClaudeSessionIdWidget {
|
|
|
62616
62414
|
|
|
62617
62415
|
// src/widgets/ClaudeAccountEmail.ts
|
|
62618
62416
|
import * as fs8 from "fs";
|
|
62619
|
-
import * as
|
|
62417
|
+
import * as path7 from "path";
|
|
62620
62418
|
|
|
62621
62419
|
class ClaudeAccountEmailWidget {
|
|
62622
62420
|
getDefaultColor() {
|
|
@@ -62640,8 +62438,8 @@ class ClaudeAccountEmailWidget {
|
|
|
62640
62438
|
}
|
|
62641
62439
|
try {
|
|
62642
62440
|
const configDir = getClaudeConfigDir();
|
|
62643
|
-
const claudeJsonPath =
|
|
62644
|
-
const resolved =
|
|
62441
|
+
const claudeJsonPath = path7.join(configDir, "..", ".claude.json");
|
|
62442
|
+
const resolved = path7.resolve(claudeJsonPath);
|
|
62645
62443
|
if (!fs8.existsSync(resolved)) {
|
|
62646
62444
|
return null;
|
|
62647
62445
|
}
|
|
@@ -63189,6 +62987,21 @@ function formatCents(cents) {
|
|
|
63189
62987
|
const symbol2 = getCurrencySymbol();
|
|
63190
62988
|
return `${symbol2}${(cents / 100).toFixed(2)}`;
|
|
63191
62989
|
}
|
|
62990
|
+
function getModelId(context) {
|
|
62991
|
+
const model = context.data?.model;
|
|
62992
|
+
return (typeof model === "string" ? model : model?.id) ?? "";
|
|
62993
|
+
}
|
|
62994
|
+
function isLocalModel(context) {
|
|
62995
|
+
const modelId = getModelId(context);
|
|
62996
|
+
if (modelId === "")
|
|
62997
|
+
return false;
|
|
62998
|
+
return !(modelId.includes("opus") || modelId.includes("sonnet") || modelId.includes("haiku"));
|
|
62999
|
+
}
|
|
63000
|
+
function renderLocalUsageFallback(label, shortLabel, size2) {
|
|
63001
|
+
if (size2 === "mobile")
|
|
63002
|
+
return `${shortLabel}: [░░░░] -.0%`;
|
|
63003
|
+
return `${label}: [░░░░░░░░░░░░░░░] -.0%`;
|
|
63004
|
+
}
|
|
63192
63005
|
|
|
63193
63006
|
class SessionUsageWidget {
|
|
63194
63007
|
getDefaultColor() {
|
|
@@ -63215,6 +63028,8 @@ class SessionUsageWidget {
|
|
|
63215
63028
|
if (data.sessionUsage === undefined)
|
|
63216
63029
|
return null;
|
|
63217
63030
|
const size2 = getDisplaySize(context);
|
|
63031
|
+
if (isLocalModel(context))
|
|
63032
|
+
return renderLocalUsageFallback("Session", "S", size2);
|
|
63218
63033
|
const extraUsed = data.extraUsageUsed;
|
|
63219
63034
|
const extraLimit = data.extraUsageLimit;
|
|
63220
63035
|
if (size2 !== "mobile" && data.extraUsageEnabled === true && extraUsed !== undefined && extraLimit !== undefined && data.sessionUsage >= 100 && (data.weeklyUsage === undefined || data.weeklyUsage < 100)) {
|
|
@@ -63256,6 +63071,8 @@ class WeeklyUsageWidget {
|
|
|
63256
63071
|
if (data.weeklyUsage === undefined)
|
|
63257
63072
|
return null;
|
|
63258
63073
|
const size2 = getDisplaySize(context);
|
|
63074
|
+
if (isLocalModel(context))
|
|
63075
|
+
return renderLocalUsageFallback("Weekly", "W", size2);
|
|
63259
63076
|
const extraUsed = data.extraUsageUsed;
|
|
63260
63077
|
const extraLimit = data.extraUsageLimit;
|
|
63261
63078
|
if (data.extraUsageEnabled === true && extraUsed !== undefined && extraLimit !== undefined && data.weeklyUsage >= 100) {
|
|
@@ -63294,8 +63111,9 @@ class ResetTimerWidget {
|
|
|
63294
63111
|
const data = context.usageData ?? {};
|
|
63295
63112
|
if (data.error)
|
|
63296
63113
|
return getUsageErrorMessage(data.error);
|
|
63297
|
-
|
|
63298
|
-
|
|
63114
|
+
if (isLocalModel(context))
|
|
63115
|
+
return "-:00 hr";
|
|
63116
|
+
const modelId = getModelId(context);
|
|
63299
63117
|
const is1mModel = modelId.includes("[1m]");
|
|
63300
63118
|
const isOpus = modelId.includes("opus");
|
|
63301
63119
|
const isChargedModel = is1mModel && !isOpus;
|
|
@@ -63353,6 +63171,8 @@ class ContextBarWidget {
|
|
|
63353
63171
|
const cw = context.data?.context_window;
|
|
63354
63172
|
if (!cw)
|
|
63355
63173
|
return null;
|
|
63174
|
+
if (isLocalModel(context) && !getModelId(context).includes("qwen"))
|
|
63175
|
+
return renderLocalUsageFallback("Context", "C", getDisplaySize(context));
|
|
63356
63176
|
const total = Number(cw.context_window_size) || 200000;
|
|
63357
63177
|
let used = 0;
|
|
63358
63178
|
if (typeof cw.current_usage === "number") {
|
|
@@ -64962,9 +64782,9 @@ var init_hooks = __esm(async () => {
|
|
|
64962
64782
|
// src/utils/config.ts
|
|
64963
64783
|
import * as fs10 from "fs";
|
|
64964
64784
|
import * as os8 from "os";
|
|
64965
|
-
import * as
|
|
64785
|
+
import * as path8 from "path";
|
|
64966
64786
|
function initConfigPath(filePath) {
|
|
64967
|
-
settingsPath = filePath ?
|
|
64787
|
+
settingsPath = filePath ? path8.resolve(filePath) : DEFAULT_SETTINGS_PATH;
|
|
64968
64788
|
}
|
|
64969
64789
|
function getConfigPath() {
|
|
64970
64790
|
return settingsPath;
|
|
@@ -64973,13 +64793,13 @@ function isCustomConfigPath() {
|
|
|
64973
64793
|
return settingsPath !== DEFAULT_SETTINGS_PATH;
|
|
64974
64794
|
}
|
|
64975
64795
|
function getSettingsPaths() {
|
|
64976
|
-
const configDir =
|
|
64977
|
-
const parsedPath =
|
|
64796
|
+
const configDir = path8.dirname(settingsPath);
|
|
64797
|
+
const parsedPath = path8.parse(settingsPath);
|
|
64978
64798
|
const backupBaseName = parsedPath.ext ? `${parsedPath.name}.bak` : `${parsedPath.base}.bak`;
|
|
64979
64799
|
return {
|
|
64980
64800
|
configDir,
|
|
64981
64801
|
settingsPath,
|
|
64982
|
-
settingsBackupPath:
|
|
64802
|
+
settingsBackupPath: path8.join(configDir, backupBaseName)
|
|
64983
64803
|
};
|
|
64984
64804
|
}
|
|
64985
64805
|
async function ensureDir(dir) {
|
|
@@ -65079,7 +64899,7 @@ var init_config = __esm(() => {
|
|
|
65079
64899
|
readFile3 = fs10.promises.readFile;
|
|
65080
64900
|
writeFile = fs10.promises.writeFile;
|
|
65081
64901
|
mkdir = fs10.promises.mkdir;
|
|
65082
|
-
DEFAULT_SETTINGS_PATH =
|
|
64902
|
+
DEFAULT_SETTINGS_PATH = path8.join(os8.homedir(), ".config", "ccstatusline", "settings.json");
|
|
65083
64903
|
settingsPath = DEFAULT_SETTINGS_PATH;
|
|
65084
64904
|
});
|
|
65085
64905
|
|
|
@@ -65087,7 +64907,7 @@ var init_config = __esm(() => {
|
|
|
65087
64907
|
import { execSync as execSync6 } from "child_process";
|
|
65088
64908
|
import * as fs11 from "fs";
|
|
65089
64909
|
import * as os9 from "os";
|
|
65090
|
-
import * as
|
|
64910
|
+
import * as path9 from "path";
|
|
65091
64911
|
function isKnownCommand(command) {
|
|
65092
64912
|
const prefixes = [CCSTATUSLINE_COMMANDS.NPM, CCSTATUSLINE_COMMANDS.BUNX, CCSTATUSLINE_COMMANDS.SELF_MANAGED];
|
|
65093
64913
|
return prefixes.some((prefix) => command === prefix || command.startsWith(`${prefix} --config `)) || /(?:^|[\s"'\\/])ccstatusline\.ts(?=$|[\s"'])/.test(command);
|
|
@@ -65111,7 +64931,7 @@ function getClaudeConfigDir() {
|
|
|
65111
64931
|
const envConfigDir = process.env.CLAUDE_CONFIG_DIR;
|
|
65112
64932
|
if (envConfigDir) {
|
|
65113
64933
|
try {
|
|
65114
|
-
const resolvedPath =
|
|
64934
|
+
const resolvedPath = path9.resolve(envConfigDir);
|
|
65115
64935
|
if (fs11.existsSync(resolvedPath)) {
|
|
65116
64936
|
const stats = fs11.statSync(resolvedPath);
|
|
65117
64937
|
if (stats.isDirectory()) {
|
|
@@ -65122,10 +64942,10 @@ function getClaudeConfigDir() {
|
|
|
65122
64942
|
}
|
|
65123
64943
|
} catch {}
|
|
65124
64944
|
}
|
|
65125
|
-
return
|
|
64945
|
+
return path9.join(os9.homedir(), ".claude");
|
|
65126
64946
|
}
|
|
65127
64947
|
function getClaudeSettingsPath() {
|
|
65128
|
-
return
|
|
64948
|
+
return path9.join(getClaudeConfigDir(), "settings.json");
|
|
65129
64949
|
}
|
|
65130
64950
|
async function backupClaudeSettings(suffix = ".bak") {
|
|
65131
64951
|
const settingsPath2 = getClaudeSettingsPath();
|
|
@@ -65175,7 +64995,7 @@ async function loadClaudeSettings(options = {}) {
|
|
|
65175
64995
|
}
|
|
65176
64996
|
async function saveClaudeSettings(settings) {
|
|
65177
64997
|
const settingsPath2 = getClaudeSettingsPath();
|
|
65178
|
-
const dir =
|
|
64998
|
+
const dir = path9.dirname(settingsPath2);
|
|
65179
64999
|
await backupClaudeSettings();
|
|
65180
65000
|
await ensureDir(dir);
|
|
65181
65001
|
await writeFile2(settingsPath2, JSON.stringify(settings, null, 2), "utf-8");
|
|
@@ -66015,7 +65835,7 @@ function openExternalUrl(url2) {
|
|
|
66015
65835
|
import { execSync as execSync7 } from "child_process";
|
|
66016
65836
|
import * as fs12 from "fs";
|
|
66017
65837
|
import * as os11 from "os";
|
|
66018
|
-
import * as
|
|
65838
|
+
import * as path10 from "path";
|
|
66019
65839
|
var fontsInstalledThisSession = false;
|
|
66020
65840
|
function checkPowerlineFonts() {
|
|
66021
65841
|
if (process.env.DEBUG_FONT_INSTALL === "1" && !fontsInstalledThisSession) {
|
|
@@ -66035,20 +65855,20 @@ function checkPowerlineFonts() {
|
|
|
66035
65855
|
let fontPaths = [];
|
|
66036
65856
|
if (platform4 === "darwin") {
|
|
66037
65857
|
fontPaths = [
|
|
66038
|
-
|
|
65858
|
+
path10.join(os11.homedir(), "Library", "Fonts"),
|
|
66039
65859
|
"/Library/Fonts",
|
|
66040
65860
|
"/System/Library/Fonts"
|
|
66041
65861
|
];
|
|
66042
65862
|
} else if (platform4 === "linux") {
|
|
66043
65863
|
fontPaths = [
|
|
66044
|
-
|
|
66045
|
-
|
|
65864
|
+
path10.join(os11.homedir(), ".local", "share", "fonts"),
|
|
65865
|
+
path10.join(os11.homedir(), ".fonts"),
|
|
66046
65866
|
"/usr/share/fonts",
|
|
66047
65867
|
"/usr/local/share/fonts"
|
|
66048
65868
|
];
|
|
66049
65869
|
} else if (platform4 === "win32") {
|
|
66050
65870
|
fontPaths = [
|
|
66051
|
-
|
|
65871
|
+
path10.join(os11.homedir(), "AppData", "Local", "Microsoft", "Windows", "Fonts"),
|
|
66052
65872
|
"C:\\Windows\\Fonts"
|
|
66053
65873
|
];
|
|
66054
65874
|
}
|
|
@@ -66127,11 +65947,11 @@ async function installPowerlineFonts() {
|
|
|
66127
65947
|
const platform4 = os11.platform();
|
|
66128
65948
|
let fontDir;
|
|
66129
65949
|
if (platform4 === "darwin") {
|
|
66130
|
-
fontDir =
|
|
65950
|
+
fontDir = path10.join(os11.homedir(), "Library", "Fonts");
|
|
66131
65951
|
} else if (platform4 === "linux") {
|
|
66132
|
-
fontDir =
|
|
65952
|
+
fontDir = path10.join(os11.homedir(), ".local", "share", "fonts");
|
|
66133
65953
|
} else if (platform4 === "win32") {
|
|
66134
|
-
fontDir =
|
|
65954
|
+
fontDir = path10.join(os11.homedir(), "AppData", "Local", "Microsoft", "Windows", "Fonts");
|
|
66135
65955
|
} else {
|
|
66136
65956
|
return {
|
|
66137
65957
|
success: false,
|
|
@@ -66141,7 +65961,7 @@ async function installPowerlineFonts() {
|
|
|
66141
65961
|
if (!fs12.existsSync(fontDir)) {
|
|
66142
65962
|
fs12.mkdirSync(fontDir, { recursive: true });
|
|
66143
65963
|
}
|
|
66144
|
-
const tempDir =
|
|
65964
|
+
const tempDir = path10.join(os11.tmpdir(), `ccstatusline-powerline-fonts-${Date.now()}`);
|
|
66145
65965
|
try {
|
|
66146
65966
|
if (fs12.existsSync(tempDir)) {
|
|
66147
65967
|
fs12.rmSync(tempDir, { recursive: true, force: true });
|
|
@@ -66151,7 +65971,7 @@ async function installPowerlineFonts() {
|
|
|
66151
65971
|
encoding: "utf8"
|
|
66152
65972
|
});
|
|
66153
65973
|
if (platform4 === "darwin" || platform4 === "linux") {
|
|
66154
|
-
const installScript =
|
|
65974
|
+
const installScript = path10.join(tempDir, "install.sh");
|
|
66155
65975
|
if (fs12.existsSync(installScript)) {
|
|
66156
65976
|
fs12.chmodSync(installScript, 493);
|
|
66157
65977
|
execSync7(`cd "${tempDir}" && ./install.sh`, {
|
|
@@ -66181,9 +66001,9 @@ async function installPowerlineFonts() {
|
|
|
66181
66001
|
let findFontFiles = function(dir) {
|
|
66182
66002
|
const files = fs12.readdirSync(dir);
|
|
66183
66003
|
for (const file2 of files) {
|
|
66184
|
-
const filePath =
|
|
66185
|
-
const
|
|
66186
|
-
if (
|
|
66004
|
+
const filePath = path10.join(dir, file2);
|
|
66005
|
+
const stat2 = fs12.statSync(filePath);
|
|
66006
|
+
if (stat2.isDirectory() && !file2.startsWith(".")) {
|
|
66187
66007
|
findFontFiles(filePath);
|
|
66188
66008
|
} else if (file2.endsWith(".ttf") || file2.endsWith(".otf")) {
|
|
66189
66009
|
if (filePath.toLowerCase().includes("powerline")) {
|
|
@@ -66196,8 +66016,8 @@ async function installPowerlineFonts() {
|
|
|
66196
66016
|
findFontFiles(tempDir);
|
|
66197
66017
|
let installedCount = 0;
|
|
66198
66018
|
for (const fontFile of fontFiles) {
|
|
66199
|
-
const fileName =
|
|
66200
|
-
const destPath =
|
|
66019
|
+
const fileName = path10.basename(fontFile);
|
|
66020
|
+
const destPath = path10.join(fontDir, fileName);
|
|
66201
66021
|
try {
|
|
66202
66022
|
fs12.copyFileSync(fontFile, destPath);
|
|
66203
66023
|
installedCount++;
|
|
@@ -71437,13 +71257,13 @@ await init_renderer2();
|
|
|
71437
71257
|
// src/utils/skills.ts
|
|
71438
71258
|
import * as fs13 from "fs";
|
|
71439
71259
|
import * as os13 from "os";
|
|
71440
|
-
import * as
|
|
71260
|
+
import * as path11 from "path";
|
|
71441
71261
|
var EMPTY = { totalInvocations: 0, uniqueSkills: [], lastSkill: null };
|
|
71442
71262
|
function getSkillsDir() {
|
|
71443
|
-
return
|
|
71263
|
+
return path11.join(os13.homedir(), ".cache", "ccstatusline", "skills");
|
|
71444
71264
|
}
|
|
71445
71265
|
function getSkillsFilePath(sessionId) {
|
|
71446
|
-
return
|
|
71266
|
+
return path11.join(getSkillsDir(), `skills-${sessionId}.jsonl`);
|
|
71447
71267
|
}
|
|
71448
71268
|
function getSkillsMetrics(sessionId) {
|
|
71449
71269
|
const filePath = getSkillsFilePath(sessionId);
|
|
@@ -71787,8 +71607,8 @@ async function handleHook() {
|
|
|
71787
71607
|
}
|
|
71788
71608
|
const filePath = getSkillsFilePath(sessionId);
|
|
71789
71609
|
const fs14 = await import("fs");
|
|
71790
|
-
const
|
|
71791
|
-
fs14.mkdirSync(
|
|
71610
|
+
const path12 = await import("path");
|
|
71611
|
+
fs14.mkdirSync(path12.dirname(filePath), { recursive: true });
|
|
71792
71612
|
const entry = JSON.stringify({
|
|
71793
71613
|
timestamp: new Date().toISOString(),
|
|
71794
71614
|
session_id: sessionId,
|