ccstatusline-usage 2.3.16 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -0
- package/dist/ccstatusline.js +829 -924
- package/package.json +2 -2
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);
|
|
@@ -52710,7 +52556,7 @@ class OutputStyleWidget {
|
|
|
52710
52556
|
}
|
|
52711
52557
|
|
|
52712
52558
|
// src/utils/git.ts
|
|
52713
|
-
import {
|
|
52559
|
+
import { execFileSync } from "child_process";
|
|
52714
52560
|
function resolveGitCwd(context) {
|
|
52715
52561
|
const candidates = [
|
|
52716
52562
|
context.data?.cwd,
|
|
@@ -52725,13 +52571,18 @@ function resolveGitCwd(context) {
|
|
|
52725
52571
|
return;
|
|
52726
52572
|
}
|
|
52727
52573
|
function runGit(command, context) {
|
|
52574
|
+
const args = command.trim().split(/\s+/).filter(Boolean);
|
|
52575
|
+
return runGitArgs(args, context, command);
|
|
52576
|
+
}
|
|
52577
|
+
function runGitArgs(args, context, cacheCommand) {
|
|
52728
52578
|
const cwd2 = resolveGitCwd(context);
|
|
52729
|
-
const
|
|
52579
|
+
const cacheToken = cacheCommand ?? args.join("\x00");
|
|
52580
|
+
const cacheKey = `${cacheToken}|${cwd2 ?? ""}`;
|
|
52730
52581
|
if (gitCommandCache.has(cacheKey)) {
|
|
52731
52582
|
return gitCommandCache.get(cacheKey) ?? null;
|
|
52732
52583
|
}
|
|
52733
52584
|
try {
|
|
52734
|
-
const output =
|
|
52585
|
+
const output = execFileSync("git", args, {
|
|
52735
52586
|
encoding: "utf8",
|
|
52736
52587
|
stdio: ["pipe", "pipe", "ignore"],
|
|
52737
52588
|
...cwd2 ? { cwd: cwd2 } : {}
|
|
@@ -53290,7 +53141,7 @@ var init_GitRootDir = __esm(() => {
|
|
|
53290
53141
|
});
|
|
53291
53142
|
|
|
53292
53143
|
// src/utils/gh-pr-cache.ts
|
|
53293
|
-
import { execFileSync } from "child_process";
|
|
53144
|
+
import { execFileSync as execFileSync2 } from "child_process";
|
|
53294
53145
|
import {
|
|
53295
53146
|
existsSync as existsSync2,
|
|
53296
53147
|
mkdirSync,
|
|
@@ -53432,7 +53283,7 @@ function truncateTitle(title, maxWidth) {
|
|
|
53432
53283
|
var PR_CACHE_TTL = 30000, GH_TIMEOUT = 5000, DEFAULT_TITLE_MAX_WIDTH = 30, DEFAULT_PR_CACHE_DEPS;
|
|
53433
53284
|
var init_gh_pr_cache = __esm(() => {
|
|
53434
53285
|
DEFAULT_PR_CACHE_DEPS = {
|
|
53435
|
-
execFileSync,
|
|
53286
|
+
execFileSync: execFileSync2,
|
|
53436
53287
|
existsSync: existsSync2,
|
|
53437
53288
|
mkdirSync,
|
|
53438
53289
|
readFileSync: readFileSync2,
|
|
@@ -54110,7 +53961,7 @@ function parseRemoteUrl(url2) {
|
|
|
54110
53961
|
}
|
|
54111
53962
|
}
|
|
54112
53963
|
function getRemoteInfo(remoteName, context) {
|
|
54113
|
-
const url2 =
|
|
53964
|
+
const url2 = runGitArgs(["remote", "get-url", "--", remoteName], context, `remote get-url -- ${remoteName}`);
|
|
54114
53965
|
if (!url2) {
|
|
54115
53966
|
return null;
|
|
54116
53967
|
}
|
|
@@ -54717,8 +54568,8 @@ function createUnicodePropertyRegex(pattern) {
|
|
|
54717
54568
|
return null;
|
|
54718
54569
|
}
|
|
54719
54570
|
}
|
|
54720
|
-
function matchesUnicodeProperty(character,
|
|
54721
|
-
return
|
|
54571
|
+
function matchesUnicodeProperty(character, regex2) {
|
|
54572
|
+
return regex2?.test(character) ?? false;
|
|
54722
54573
|
}
|
|
54723
54574
|
function isVariationSelector(codePoint) {
|
|
54724
54575
|
return codePoint >= VARIATION_SELECTOR_START && codePoint <= VARIATION_SELECTOR_END || codePoint >= VARIATION_SELECTOR_SUPPLEMENT_START && codePoint <= VARIATION_SELECTOR_SUPPLEMENT_END;
|
|
@@ -54787,7 +54638,7 @@ function isZeroWidthStandaloneCluster(cluster) {
|
|
|
54787
54638
|
});
|
|
54788
54639
|
}
|
|
54789
54640
|
function shouldTreatClusterAsNarrowTextPictograph(cluster) {
|
|
54790
|
-
if (
|
|
54641
|
+
if (stringWidth(cluster) <= 1) {
|
|
54791
54642
|
return false;
|
|
54792
54643
|
}
|
|
54793
54644
|
const characters = Array.from(cluster);
|
|
@@ -54812,7 +54663,7 @@ function getClusterWidth(cluster) {
|
|
|
54812
54663
|
if (shouldTreatClusterAsNarrowTextPictograph(cluster)) {
|
|
54813
54664
|
return 1;
|
|
54814
54665
|
}
|
|
54815
|
-
return
|
|
54666
|
+
return stringWidth(cluster);
|
|
54816
54667
|
}
|
|
54817
54668
|
function getTextDisplayWidth(text) {
|
|
54818
54669
|
let width = 0;
|
|
@@ -54975,7 +54826,7 @@ function truncateStyledText(text, maxWidth, options = {}) {
|
|
|
54975
54826
|
}
|
|
54976
54827
|
const addEllipsis = options.ellipsis ?? true;
|
|
54977
54828
|
const ellipsis = addEllipsis ? "..." : "";
|
|
54978
|
-
const ellipsisWidth = addEllipsis ?
|
|
54829
|
+
const ellipsisWidth = addEllipsis ? stringWidth(ellipsis) : 0;
|
|
54979
54830
|
if (addEllipsis && maxWidth <= ellipsisWidth) {
|
|
54980
54831
|
return ".".repeat(maxWidth);
|
|
54981
54832
|
}
|
|
@@ -55029,7 +54880,7 @@ function truncateStyledText(text, maxWidth, options = {}) {
|
|
|
55029
54880
|
}
|
|
55030
54881
|
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
54882
|
var init_ansi = __esm(() => {
|
|
55032
|
-
|
|
54883
|
+
init_string_width();
|
|
55033
54884
|
SGR_REGEX = /\x1b\[[0-9;]*m/g;
|
|
55034
54885
|
EXTENDED_PICTOGRAPHIC_REGEX = createUnicodePropertyRegex("\\p{Extended_Pictographic}");
|
|
55035
54886
|
EMOJI_PRESENTATION_REGEX = createUnicodePropertyRegex("\\p{Emoji_Presentation}");
|
|
@@ -55186,8 +55037,8 @@ function getColorAnsiCode(colorName, colorLevel = "ansi16", isBackground = false
|
|
|
55186
55037
|
}
|
|
55187
55038
|
const colored = chalkFn("TEST");
|
|
55188
55039
|
const escapeChar = "\x1B";
|
|
55189
|
-
const
|
|
55190
|
-
const match =
|
|
55040
|
+
const ansiRegex3 = new RegExp(`^(${escapeChar.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\[[^m]+m)`);
|
|
55041
|
+
const match = ansiRegex3.exec(colored);
|
|
55191
55042
|
return match?.[1] ?? "";
|
|
55192
55043
|
}
|
|
55193
55044
|
function getColorDisplayName(colorName) {
|
|
@@ -55455,6 +55306,15 @@ function getContextConfig(modelIdentifier, contextWindowSize) {
|
|
|
55455
55306
|
if (!modelIdentifier) {
|
|
55456
55307
|
return defaultConfig;
|
|
55457
55308
|
}
|
|
55309
|
+
const normalizedModel = modelIdentifier.toLowerCase().trim();
|
|
55310
|
+
for (const [modelName, contextSize] of Object.entries(OPENCODE_MODEL_CONTEXT_MAP)) {
|
|
55311
|
+
if (normalizedModel.includes(modelName)) {
|
|
55312
|
+
return {
|
|
55313
|
+
maxTokens: contextSize,
|
|
55314
|
+
usableTokens: Math.floor(contextSize * USABLE_CONTEXT_RATIO)
|
|
55315
|
+
};
|
|
55316
|
+
}
|
|
55317
|
+
}
|
|
55458
55318
|
const inferredWindowSize = parseContextWindowSize(modelIdentifier);
|
|
55459
55319
|
if (inferredWindowSize !== null) {
|
|
55460
55320
|
return {
|
|
@@ -55464,7 +55324,24 @@ function getContextConfig(modelIdentifier, contextWindowSize) {
|
|
|
55464
55324
|
}
|
|
55465
55325
|
return defaultConfig;
|
|
55466
55326
|
}
|
|
55467
|
-
var DEFAULT_CONTEXT_WINDOW_SIZE = 200000, USABLE_CONTEXT_RATIO = 0.8;
|
|
55327
|
+
var DEFAULT_CONTEXT_WINDOW_SIZE = 200000, USABLE_CONTEXT_RATIO = 0.8, OPENCODE_MODEL_CONTEXT_MAP;
|
|
55328
|
+
var init_model_context = __esm(() => {
|
|
55329
|
+
OPENCODE_MODEL_CONTEXT_MAP = {
|
|
55330
|
+
"glm-5.1": 1e6,
|
|
55331
|
+
"glm-4.5": 1e6,
|
|
55332
|
+
"glm-4.0": 1e6,
|
|
55333
|
+
"mm-2.7": 1e6,
|
|
55334
|
+
"mm-2.5": 1e6,
|
|
55335
|
+
"kimi-k2.6": 1e6,
|
|
55336
|
+
"kimi-k2.5": 1e6,
|
|
55337
|
+
"owen-3.6": 1e6,
|
|
55338
|
+
"owen-3.5": 1e6,
|
|
55339
|
+
"qwen-2.5": 1e6,
|
|
55340
|
+
"qwen-2.0": 1e6,
|
|
55341
|
+
"qwen-1.5": 1e6,
|
|
55342
|
+
"qwen-1.0": 1e6
|
|
55343
|
+
};
|
|
55344
|
+
});
|
|
55468
55345
|
|
|
55469
55346
|
// src/utils/context-percentage.ts
|
|
55470
55347
|
function calculateContextPercentage(context) {
|
|
@@ -55479,10 +55356,12 @@ function calculateContextPercentage(context) {
|
|
|
55479
55356
|
const contextConfig = getContextConfig(modelIdentifier, contextWindowMetrics.windowSize);
|
|
55480
55357
|
return Math.min(100, context.tokenMetrics.contextLength / contextConfig.maxTokens * 100);
|
|
55481
55358
|
}
|
|
55482
|
-
var init_context_percentage = () => {
|
|
55359
|
+
var init_context_percentage = __esm(() => {
|
|
55360
|
+
init_model_context();
|
|
55361
|
+
});
|
|
55483
55362
|
|
|
55484
55363
|
// src/utils/terminal.ts
|
|
55485
|
-
import { execSync
|
|
55364
|
+
import { execSync } from "child_process";
|
|
55486
55365
|
import * as fs2 from "fs";
|
|
55487
55366
|
import * as path2 from "path";
|
|
55488
55367
|
function getPackageVersion() {
|
|
@@ -55506,7 +55385,7 @@ function getPackageVersion() {
|
|
|
55506
55385
|
function probeTerminalWidth() {
|
|
55507
55386
|
if (process.env.TMUX) {
|
|
55508
55387
|
try {
|
|
55509
|
-
const output =
|
|
55388
|
+
const output = execSync("tmux display-message -p '#{pane_width}'", { encoding: "utf8", stdio: ["pipe", "pipe", "ignore"], timeout: 2000 }).trim();
|
|
55510
55389
|
const parsed = parseInt(output, 10);
|
|
55511
55390
|
if (!isNaN(parsed) && parsed > 0)
|
|
55512
55391
|
return parsed;
|
|
@@ -55532,7 +55411,7 @@ function probeTerminalWidth() {
|
|
|
55532
55411
|
}
|
|
55533
55412
|
}
|
|
55534
55413
|
try {
|
|
55535
|
-
const width =
|
|
55414
|
+
const width = execSync("tput cols 2>/dev/null", {
|
|
55536
55415
|
encoding: "utf8",
|
|
55537
55416
|
stdio: ["pipe", "pipe", "ignore"]
|
|
55538
55417
|
}).trim();
|
|
@@ -55549,7 +55428,7 @@ function parsePositiveInteger(value) {
|
|
|
55549
55428
|
}
|
|
55550
55429
|
function getParentProcessId(pid) {
|
|
55551
55430
|
try {
|
|
55552
|
-
const parentPidOutput =
|
|
55431
|
+
const parentPidOutput = execSync(`ps -o ppid= -p ${pid}`, {
|
|
55553
55432
|
encoding: "utf8",
|
|
55554
55433
|
stdio: ["pipe", "pipe", "ignore"],
|
|
55555
55434
|
shell: "/bin/sh"
|
|
@@ -55561,7 +55440,7 @@ function getParentProcessId(pid) {
|
|
|
55561
55440
|
}
|
|
55562
55441
|
function getTTYForProcess(pid) {
|
|
55563
55442
|
try {
|
|
55564
|
-
const tty2 =
|
|
55443
|
+
const tty2 = execSync(`ps -o tty= -p ${pid}`, {
|
|
55565
55444
|
encoding: "utf8",
|
|
55566
55445
|
stdio: ["pipe", "pipe", "ignore"],
|
|
55567
55446
|
shell: "/bin/sh"
|
|
@@ -55576,7 +55455,7 @@ function getTTYForProcess(pid) {
|
|
|
55576
55455
|
}
|
|
55577
55456
|
function getWidthForTTY(tty2) {
|
|
55578
55457
|
try {
|
|
55579
|
-
const width =
|
|
55458
|
+
const width = execSync(`stty size < /dev/${tty2} | awk '{print $2}'`, {
|
|
55580
55459
|
encoding: "utf8",
|
|
55581
55460
|
stdio: ["pipe", "pipe", "ignore"],
|
|
55582
55461
|
shell: "/bin/sh"
|
|
@@ -55592,7 +55471,7 @@ function getTerminalWidth() {
|
|
|
55592
55471
|
function canDetectTerminalWidth() {
|
|
55593
55472
|
return probeTerminalWidth() !== null;
|
|
55594
55473
|
}
|
|
55595
|
-
var __dirname = "/Users/peter/Documents/Code/ccstatusline-usage/src/utils", PACKAGE_VERSION = "2.
|
|
55474
|
+
var __dirname = "/Users/peter/Documents/Code/ccstatusline-usage/src/utils", PACKAGE_VERSION = "2.4.0";
|
|
55596
55475
|
var init_terminal = () => {};
|
|
55597
55476
|
|
|
55598
55477
|
// src/utils/renderer.ts
|
|
@@ -56465,6 +56344,7 @@ class ContextPercentageWidget {
|
|
|
56465
56344
|
}
|
|
56466
56345
|
}
|
|
56467
56346
|
var init_ContextPercentage = __esm(() => {
|
|
56347
|
+
init_model_context();
|
|
56468
56348
|
init_context_inverse();
|
|
56469
56349
|
});
|
|
56470
56350
|
|
|
@@ -56525,6 +56405,7 @@ class ContextPercentageUsableWidget {
|
|
|
56525
56405
|
}
|
|
56526
56406
|
}
|
|
56527
56407
|
var init_ContextPercentageUsable = __esm(() => {
|
|
56408
|
+
init_model_context();
|
|
56528
56409
|
init_context_inverse();
|
|
56529
56410
|
});
|
|
56530
56411
|
|
|
@@ -56970,8 +56851,8 @@ var import_react27, jsx_dev_runtime, CustomTextEditor = ({ widget, onComplete, o
|
|
|
56970
56851
|
const [cursorPos, setCursorPos] = import_react27.useState(text.length);
|
|
56971
56852
|
const getGraphemes = (str) => {
|
|
56972
56853
|
if ("Segmenter" in Intl) {
|
|
56973
|
-
const
|
|
56974
|
-
return Array.from(
|
|
56854
|
+
const segmenter2 = new Intl.Segmenter(undefined, { granularity: "grapheme" });
|
|
56855
|
+
return Array.from(segmenter2.segment(str), (seg) => seg.segment);
|
|
56975
56856
|
}
|
|
56976
56857
|
return Array.from(str);
|
|
56977
56858
|
};
|
|
@@ -57130,8 +57011,8 @@ var import_react28, jsx_dev_runtime2, CustomSymbolEditor = ({ widget, onComplete
|
|
|
57130
57011
|
return "";
|
|
57131
57012
|
}
|
|
57132
57013
|
if ("Segmenter" in Intl) {
|
|
57133
|
-
const
|
|
57134
|
-
const segments = Array.from(
|
|
57014
|
+
const segmenter2 = new Intl.Segmenter(undefined, { granularity: "grapheme" });
|
|
57015
|
+
const segments = Array.from(segmenter2.segment(str));
|
|
57135
57016
|
return segments[0]?.segment ?? "";
|
|
57136
57017
|
}
|
|
57137
57018
|
return Array.from(str)[0] ?? "";
|
|
@@ -57180,7 +57061,7 @@ var init_CustomSymbol = __esm(async () => {
|
|
|
57180
57061
|
});
|
|
57181
57062
|
|
|
57182
57063
|
// src/widgets/CustomCommand.tsx
|
|
57183
|
-
import { execSync as
|
|
57064
|
+
import { execSync as execSync2 } from "child_process";
|
|
57184
57065
|
|
|
57185
57066
|
class CustomCommandWidget {
|
|
57186
57067
|
getDefaultColor() {
|
|
@@ -57227,7 +57108,7 @@ class CustomCommandWidget {
|
|
|
57227
57108
|
try {
|
|
57228
57109
|
const timeout = item.timeout ?? 1000;
|
|
57229
57110
|
const jsonInput = JSON.stringify(context.data);
|
|
57230
|
-
let output =
|
|
57111
|
+
let output = execSync2(item.commandPath, {
|
|
57231
57112
|
encoding: "utf8",
|
|
57232
57113
|
input: jsonInput,
|
|
57233
57114
|
timeout,
|
|
@@ -57552,7 +57433,7 @@ var require_ms = __commonJS((exports, module) => {
|
|
|
57552
57433
|
}
|
|
57553
57434
|
});
|
|
57554
57435
|
|
|
57555
|
-
// node_modules/
|
|
57436
|
+
// node_modules/debug/src/common.js
|
|
57556
57437
|
var require_common = __commonJS((exports, module) => {
|
|
57557
57438
|
function setup(env3) {
|
|
57558
57439
|
createDebug.debug = createDebug;
|
|
@@ -57727,7 +57608,7 @@ var require_common = __commonJS((exports, module) => {
|
|
|
57727
57608
|
module.exports = setup;
|
|
57728
57609
|
});
|
|
57729
57610
|
|
|
57730
|
-
// node_modules/
|
|
57611
|
+
// node_modules/debug/src/browser.js
|
|
57731
57612
|
var require_browser = __commonJS((exports, module) => {
|
|
57732
57613
|
exports.formatArgs = formatArgs;
|
|
57733
57614
|
exports.save = save;
|
|
@@ -57887,116 +57768,7 @@ var require_browser = __commonJS((exports, module) => {
|
|
|
57887
57768
|
};
|
|
57888
57769
|
});
|
|
57889
57770
|
|
|
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
|
|
57771
|
+
// node_modules/debug/src/node.js
|
|
58000
57772
|
var require_node = __commonJS((exports, module) => {
|
|
58001
57773
|
var tty2 = __require("tty");
|
|
58002
57774
|
var util = __require("util");
|
|
@@ -58009,7 +57781,7 @@ var require_node = __commonJS((exports, module) => {
|
|
|
58009
57781
|
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
57782
|
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
58011
57783
|
try {
|
|
58012
|
-
const supportsColor2 =
|
|
57784
|
+
const supportsColor2 = (()=>{throw new Error("Cannot require module "+"supports-color");})();
|
|
58013
57785
|
if (supportsColor2 && (supportsColor2.stderr || supportsColor2).level >= 2) {
|
|
58014
57786
|
exports.colors = [
|
|
58015
57787
|
20,
|
|
@@ -58167,7 +57939,7 @@ var require_node = __commonJS((exports, module) => {
|
|
|
58167
57939
|
};
|
|
58168
57940
|
});
|
|
58169
57941
|
|
|
58170
|
-
// node_modules/
|
|
57942
|
+
// node_modules/debug/src/index.js
|
|
58171
57943
|
var require_src = __commonJS((exports, module) => {
|
|
58172
57944
|
if (typeof process === "undefined" || process.type === "renderer" || false || process.__nwjs) {
|
|
58173
57945
|
module.exports = require_browser();
|
|
@@ -58177,125 +57949,17 @@ var require_src = __commonJS((exports, module) => {
|
|
|
58177
57949
|
});
|
|
58178
57950
|
|
|
58179
57951
|
// 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
|
-
});
|
|
57952
|
+
var init_helpers = () => {};
|
|
58250
57953
|
|
|
58251
57954
|
// 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 {
|
|
57955
|
+
import * as net from "net";
|
|
57956
|
+
import * as http from "http";
|
|
57957
|
+
import { Agent as HttpsAgent } from "https";
|
|
57958
|
+
var INTERNAL, Agent2;
|
|
57959
|
+
var init_dist4 = __esm(() => {
|
|
57960
|
+
init_helpers();
|
|
57961
|
+
INTERNAL = Symbol("AgentBaseInternalState");
|
|
57962
|
+
Agent2 = class Agent2 extends http.Agent {
|
|
58299
57963
|
constructor(opts) {
|
|
58300
57964
|
super(opts);
|
|
58301
57965
|
this[INTERNAL] = {};
|
|
@@ -58344,7 +58008,7 @@ var require_dist = __commonJS((exports) => {
|
|
|
58344
58008
|
getName(options) {
|
|
58345
58009
|
const secureEndpoint = this.isSecureEndpoint(options);
|
|
58346
58010
|
if (secureEndpoint) {
|
|
58347
|
-
return
|
|
58011
|
+
return HttpsAgent.prototype.getName.call(this, options);
|
|
58348
58012
|
}
|
|
58349
58013
|
return super.getName(options);
|
|
58350
58014
|
}
|
|
@@ -58395,170 +58059,139 @@ var require_dist = __commonJS((exports) => {
|
|
|
58395
58059
|
this[INTERNAL].protocol = v;
|
|
58396
58060
|
}
|
|
58397
58061
|
}
|
|
58398
|
-
}
|
|
58399
|
-
exports.Agent = Agent;
|
|
58062
|
+
};
|
|
58400
58063
|
});
|
|
58401
58064
|
|
|
58402
58065
|
// 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
|
|
58066
|
+
function parseProxyResponse(socket) {
|
|
58067
|
+
return new Promise((resolve, reject2) => {
|
|
58068
|
+
let buffersLength = 0;
|
|
58069
|
+
const buffers = [];
|
|
58070
|
+
function read() {
|
|
58071
|
+
const b = socket.read();
|
|
58072
|
+
if (b)
|
|
58073
|
+
ondata(b);
|
|
58074
|
+
else
|
|
58075
|
+
socket.once("readable", read);
|
|
58076
|
+
}
|
|
58077
|
+
function cleanup() {
|
|
58078
|
+
socket.removeListener("end", onend);
|
|
58079
|
+
socket.removeListener("error", onerror);
|
|
58080
|
+
socket.removeListener("readable", read);
|
|
58081
|
+
}
|
|
58082
|
+
function onend() {
|
|
58083
|
+
cleanup();
|
|
58084
|
+
debug("onend");
|
|
58085
|
+
reject2(new Error("Proxy connection ended before receiving CONNECT response"));
|
|
58086
|
+
}
|
|
58087
|
+
function onerror(err) {
|
|
58088
|
+
cleanup();
|
|
58089
|
+
debug("onerror %o", err);
|
|
58090
|
+
reject2(err);
|
|
58091
|
+
}
|
|
58092
|
+
function ondata(b) {
|
|
58093
|
+
buffers.push(b);
|
|
58094
|
+
buffersLength += b.length;
|
|
58095
|
+
const buffered = Buffer.concat(buffers, buffersLength);
|
|
58096
|
+
const endOfHeaders = buffered.indexOf(`\r
|
|
58442
58097
|
\r
|
|
58443
58098
|
`);
|
|
58444
|
-
|
|
58445
|
-
|
|
58446
|
-
|
|
58447
|
-
|
|
58448
|
-
|
|
58449
|
-
|
|
58099
|
+
if (endOfHeaders === -1) {
|
|
58100
|
+
debug("have not received end of HTTP headers yet...");
|
|
58101
|
+
read();
|
|
58102
|
+
return;
|
|
58103
|
+
}
|
|
58104
|
+
const headerParts = buffered.slice(0, endOfHeaders).toString("ascii").split(`\r
|
|
58450
58105
|
`);
|
|
58451
|
-
|
|
58452
|
-
|
|
58106
|
+
const firstLine = headerParts.shift();
|
|
58107
|
+
if (!firstLine) {
|
|
58108
|
+
socket.destroy();
|
|
58109
|
+
return reject2(new Error("No header received from proxy CONNECT response"));
|
|
58110
|
+
}
|
|
58111
|
+
const firstLineParts = firstLine.split(" ");
|
|
58112
|
+
const statusCode = +firstLineParts[1];
|
|
58113
|
+
const statusText = firstLineParts.slice(2).join(" ");
|
|
58114
|
+
const headers = {};
|
|
58115
|
+
for (const header of headerParts) {
|
|
58116
|
+
if (!header)
|
|
58117
|
+
continue;
|
|
58118
|
+
const firstColon = header.indexOf(":");
|
|
58119
|
+
if (firstColon === -1) {
|
|
58453
58120
|
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
|
-
}
|
|
58121
|
+
return reject2(new Error(`Invalid header from proxy CONNECT response: "${header}"`));
|
|
58122
|
+
}
|
|
58123
|
+
const key = header.slice(0, firstColon).toLowerCase();
|
|
58124
|
+
const value = header.slice(firstColon + 1).trimStart();
|
|
58125
|
+
const current = headers[key];
|
|
58126
|
+
if (typeof current === "string") {
|
|
58127
|
+
headers[key] = [current, value];
|
|
58128
|
+
} else if (Array.isArray(current)) {
|
|
58129
|
+
current.push(value);
|
|
58130
|
+
} else {
|
|
58131
|
+
headers[key] = value;
|
|
58478
58132
|
}
|
|
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
58133
|
}
|
|
58490
|
-
|
|
58491
|
-
|
|
58492
|
-
|
|
58493
|
-
|
|
58494
|
-
|
|
58495
|
-
|
|
58134
|
+
debug("got proxy server response: %o %o", firstLine, headers);
|
|
58135
|
+
cleanup();
|
|
58136
|
+
resolve({
|
|
58137
|
+
connect: {
|
|
58138
|
+
statusCode,
|
|
58139
|
+
statusText,
|
|
58140
|
+
headers
|
|
58141
|
+
},
|
|
58142
|
+
buffered
|
|
58143
|
+
});
|
|
58144
|
+
}
|
|
58145
|
+
socket.on("error", onerror);
|
|
58146
|
+
socket.on("end", onend);
|
|
58147
|
+
read();
|
|
58148
|
+
});
|
|
58149
|
+
}
|
|
58150
|
+
var import_debug, debug;
|
|
58151
|
+
var init_parse_proxy_response = __esm(() => {
|
|
58152
|
+
import_debug = __toESM(require_src(), 1);
|
|
58153
|
+
debug = import_debug.default("https-proxy-agent:parse-proxy-response");
|
|
58496
58154
|
});
|
|
58497
58155
|
|
|
58498
58156
|
// 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
|
-
};
|
|
58157
|
+
import * as net2 from "net";
|
|
58158
|
+
import * as tls from "tls";
|
|
58159
|
+
import assert2 from "assert";
|
|
58160
|
+
import { URL as URL2 } from "url";
|
|
58161
|
+
function resume(socket) {
|
|
58162
|
+
socket.resume();
|
|
58163
|
+
}
|
|
58164
|
+
function omit3(obj, ...keys2) {
|
|
58165
|
+
const ret = {};
|
|
58166
|
+
let key;
|
|
58167
|
+
for (key in obj) {
|
|
58168
|
+
if (!keys2.includes(key)) {
|
|
58169
|
+
ret[key] = obj[key];
|
|
58551
58170
|
}
|
|
58552
|
-
|
|
58553
|
-
|
|
58554
|
-
|
|
58555
|
-
|
|
58171
|
+
}
|
|
58172
|
+
return ret;
|
|
58173
|
+
}
|
|
58174
|
+
var import_debug2, debug2, setServernameFromNonIpHost = (options) => {
|
|
58175
|
+
if (options.servername === undefined && options.host && !net2.isIP(options.host)) {
|
|
58176
|
+
return {
|
|
58177
|
+
...options,
|
|
58178
|
+
servername: options.host
|
|
58179
|
+
};
|
|
58180
|
+
}
|
|
58181
|
+
return options;
|
|
58182
|
+
}, HttpsProxyAgent;
|
|
58183
|
+
var init_dist5 = __esm(() => {
|
|
58184
|
+
init_dist4();
|
|
58185
|
+
init_parse_proxy_response();
|
|
58186
|
+
import_debug2 = __toESM(require_src(), 1);
|
|
58187
|
+
debug2 = import_debug2.default("https-proxy-agent");
|
|
58188
|
+
HttpsProxyAgent = class HttpsProxyAgent extends Agent2 {
|
|
58556
58189
|
constructor(proxy, opts) {
|
|
58557
58190
|
super(opts);
|
|
58558
58191
|
this.options = { path: undefined };
|
|
58559
|
-
this.proxy = typeof proxy === "string" ? new
|
|
58192
|
+
this.proxy = typeof proxy === "string" ? new URL2(proxy) : proxy;
|
|
58560
58193
|
this.proxyHeaders = opts?.headers ?? {};
|
|
58561
|
-
|
|
58194
|
+
debug2("Creating new HttpsProxyAgent instance: %o", this.proxy.href);
|
|
58562
58195
|
const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
|
|
58563
58196
|
const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
|
|
58564
58197
|
this.connectOpts = {
|
|
@@ -58575,14 +58208,14 @@ var require_dist2 = __commonJS((exports) => {
|
|
|
58575
58208
|
}
|
|
58576
58209
|
let socket;
|
|
58577
58210
|
if (proxy.protocol === "https:") {
|
|
58578
|
-
|
|
58211
|
+
debug2("Creating `tls.Socket`: %o", this.connectOpts);
|
|
58579
58212
|
socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
|
|
58580
58213
|
} else {
|
|
58581
|
-
|
|
58582
|
-
socket =
|
|
58214
|
+
debug2("Creating `net.Socket`: %o", this.connectOpts);
|
|
58215
|
+
socket = net2.connect(this.connectOpts);
|
|
58583
58216
|
}
|
|
58584
58217
|
const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
|
|
58585
|
-
const host =
|
|
58218
|
+
const host = net2.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
|
|
58586
58219
|
let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r
|
|
58587
58220
|
`;
|
|
58588
58221
|
if (proxy.username || proxy.password) {
|
|
@@ -58597,16 +58230,16 @@ var require_dist2 = __commonJS((exports) => {
|
|
|
58597
58230
|
payload += `${name}: ${headers[name]}\r
|
|
58598
58231
|
`;
|
|
58599
58232
|
}
|
|
58600
|
-
const proxyResponsePromise =
|
|
58233
|
+
const proxyResponsePromise = parseProxyResponse(socket);
|
|
58601
58234
|
socket.write(`${payload}\r
|
|
58602
58235
|
`);
|
|
58603
|
-
const { connect, buffered } = await proxyResponsePromise;
|
|
58604
|
-
req.emit("proxyConnect",
|
|
58605
|
-
this.emit("proxyConnect",
|
|
58606
|
-
if (
|
|
58236
|
+
const { connect: connect3, buffered } = await proxyResponsePromise;
|
|
58237
|
+
req.emit("proxyConnect", connect3);
|
|
58238
|
+
this.emit("proxyConnect", connect3, req);
|
|
58239
|
+
if (connect3.statusCode === 200) {
|
|
58607
58240
|
req.once("socket", resume);
|
|
58608
58241
|
if (opts.secureEndpoint) {
|
|
58609
|
-
|
|
58242
|
+
debug2("Upgrading socket connection to TLS");
|
|
58610
58243
|
return tls.connect({
|
|
58611
58244
|
...omit3(setServernameFromNonIpHost(opts), "host", "path", "port"),
|
|
58612
58245
|
socket
|
|
@@ -58615,32 +58248,18 @@ var require_dist2 = __commonJS((exports) => {
|
|
|
58615
58248
|
return socket;
|
|
58616
58249
|
}
|
|
58617
58250
|
socket.destroy();
|
|
58618
|
-
const fakeSocket = new
|
|
58251
|
+
const fakeSocket = new net2.Socket({ writable: false });
|
|
58619
58252
|
fakeSocket.readable = true;
|
|
58620
58253
|
req.once("socket", (s) => {
|
|
58621
|
-
|
|
58622
|
-
(
|
|
58254
|
+
debug2("Replaying proxy buffer for failed request");
|
|
58255
|
+
assert2(s.listenerCount("data") > 0);
|
|
58623
58256
|
s.push(buffered);
|
|
58624
58257
|
s.push(null);
|
|
58625
58258
|
});
|
|
58626
58259
|
return fakeSocket;
|
|
58627
58260
|
}
|
|
58628
|
-
}
|
|
58261
|
+
};
|
|
58629
58262
|
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
58263
|
});
|
|
58645
58264
|
|
|
58646
58265
|
// src/utils/usage-types.ts
|
|
@@ -58653,7 +58272,7 @@ var init_usage_types = __esm(() => {
|
|
|
58653
58272
|
});
|
|
58654
58273
|
|
|
58655
58274
|
// src/utils/usage-fetch.ts
|
|
58656
|
-
import { execFileSync as
|
|
58275
|
+
import { execFileSync as execFileSync3 } from "child_process";
|
|
58657
58276
|
import * as fs3 from "fs";
|
|
58658
58277
|
import * as https from "https";
|
|
58659
58278
|
import * as os4 from "os";
|
|
@@ -58799,7 +58418,7 @@ function parseMacKeychainCredentialCandidates(rawDump, servicePrefix = MACOS_USA
|
|
|
58799
58418
|
}
|
|
58800
58419
|
function readMacKeychainSecret(service) {
|
|
58801
58420
|
try {
|
|
58802
|
-
return
|
|
58421
|
+
return execFileSync3("security", ["find-generic-password", "-s", service, "-w"], { encoding: "utf8", stdio: ["pipe", "pipe", "ignore"] }).trim();
|
|
58803
58422
|
} catch {
|
|
58804
58423
|
return null;
|
|
58805
58424
|
}
|
|
@@ -58810,7 +58429,7 @@ function readUsageTokenFromMacKeychainService(service) {
|
|
|
58810
58429
|
}
|
|
58811
58430
|
function listMacKeychainCredentialCandidates() {
|
|
58812
58431
|
try {
|
|
58813
|
-
const rawDump =
|
|
58432
|
+
const rawDump = execFileSync3("security", ["dump-keychain"], {
|
|
58814
58433
|
encoding: "utf8",
|
|
58815
58434
|
maxBuffer: MACOS_SECURITY_DUMP_MAX_BUFFER,
|
|
58816
58435
|
stdio: ["pipe", "pipe", "ignore"]
|
|
@@ -58924,7 +58543,7 @@ function getUsageApiRequestOptions(token) {
|
|
|
58924
58543
|
"anthropic-beta": "oauth-2025-04-20"
|
|
58925
58544
|
},
|
|
58926
58545
|
timeout: USAGE_API_TIMEOUT_MS,
|
|
58927
|
-
...proxyUrl ? { agent: new
|
|
58546
|
+
...proxyUrl ? { agent: new HttpsProxyAgent(proxyUrl) } : {}
|
|
58928
58547
|
};
|
|
58929
58548
|
} catch {
|
|
58930
58549
|
return null;
|
|
@@ -59031,12 +58650,12 @@ async function fetchUsageData() {
|
|
|
59031
58650
|
return getStaleUsageOrError("parse-error", now2);
|
|
59032
58651
|
}
|
|
59033
58652
|
}
|
|
59034
|
-
var
|
|
58653
|
+
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
58654
|
var init_usage_fetch = __esm(() => {
|
|
58655
|
+
init_dist5();
|
|
59036
58656
|
init_zod();
|
|
59037
58657
|
init_claude_settings();
|
|
59038
58658
|
init_usage_types();
|
|
59039
|
-
import_https_proxy_agent = __toESM(require_dist2(), 1);
|
|
59040
58659
|
CACHE_DIR = path3.join(os4.homedir(), ".cache", "ccstatusline");
|
|
59041
58660
|
CACHE_FILE = path3.join(CACHE_DIR, "usage.json");
|
|
59042
58661
|
LOCK_FILE = path3.join(CACHE_DIR, "usage.lock");
|
|
@@ -59056,7 +58675,8 @@ var init_usage_fetch = __esm(() => {
|
|
|
59056
58675
|
extraUsageLimit: exports_external.number().nullable().optional(),
|
|
59057
58676
|
extraUsageUsed: exports_external.number().nullable().optional(),
|
|
59058
58677
|
extraUsageUtilization: exports_external.number().nullable().optional(),
|
|
59059
|
-
error: exports_external.string().nullable().optional()
|
|
58678
|
+
error: exports_external.string().nullable().optional(),
|
|
58679
|
+
provider: exports_external.enum(["anthropic", "opencode"]).nullable().optional()
|
|
59060
58680
|
});
|
|
59061
58681
|
UsageApiResponseSchema = exports_external.object({
|
|
59062
58682
|
five_hour: exports_external.object({
|
|
@@ -59571,7 +59191,7 @@ var __require2, SLASHES_REGEX, WINDOWS_ROOT_DIR_REGEX, pushDirectory = (director
|
|
|
59571
59191
|
return this;
|
|
59572
59192
|
}
|
|
59573
59193
|
};
|
|
59574
|
-
var
|
|
59194
|
+
var init_dist6 = __esm(() => {
|
|
59575
59195
|
__require2 = /* @__PURE__ */ createRequire2(import.meta.url);
|
|
59576
59196
|
SLASHES_REGEX = /[\\/]/g;
|
|
59577
59197
|
WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
|
|
@@ -59582,10 +59202,11 @@ var init_dist4 = __esm(() => {
|
|
|
59582
59202
|
} catch {}
|
|
59583
59203
|
});
|
|
59584
59204
|
|
|
59585
|
-
// node_modules/picomatch/lib/constants.js
|
|
59205
|
+
// node_modules/tinyglobby/node_modules/picomatch/lib/constants.js
|
|
59586
59206
|
var require_constants3 = __commonJS((exports, module) => {
|
|
59587
59207
|
var WIN_SLASH = "\\\\/";
|
|
59588
59208
|
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
59209
|
+
var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
|
|
59589
59210
|
var DOT_LITERAL = "\\.";
|
|
59590
59211
|
var PLUS_LITERAL = "\\+";
|
|
59591
59212
|
var QMARK_LITERAL = "\\?";
|
|
@@ -59636,6 +59257,7 @@ var require_constants3 = __commonJS((exports, module) => {
|
|
|
59636
59257
|
SEP: "\\"
|
|
59637
59258
|
};
|
|
59638
59259
|
var POSIX_REGEX_SOURCE = {
|
|
59260
|
+
__proto__: null,
|
|
59639
59261
|
alnum: "a-zA-Z0-9",
|
|
59640
59262
|
alpha: "a-zA-Z",
|
|
59641
59263
|
ascii: "\\x00-\\x7F",
|
|
@@ -59652,6 +59274,7 @@ var require_constants3 = __commonJS((exports, module) => {
|
|
|
59652
59274
|
xdigit: "A-Fa-f0-9"
|
|
59653
59275
|
};
|
|
59654
59276
|
module.exports = {
|
|
59277
|
+
DEFAULT_MAX_EXTGLOB_RECURSION,
|
|
59655
59278
|
MAX_LENGTH: 1024 * 64,
|
|
59656
59279
|
POSIX_REGEX_SOURCE,
|
|
59657
59280
|
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
@@ -59724,7 +59347,7 @@ var require_constants3 = __commonJS((exports, module) => {
|
|
|
59724
59347
|
};
|
|
59725
59348
|
});
|
|
59726
59349
|
|
|
59727
|
-
// node_modules/picomatch/lib/utils.js
|
|
59350
|
+
// node_modules/tinyglobby/node_modules/picomatch/lib/utils.js
|
|
59728
59351
|
var require_utils = __commonJS((exports) => {
|
|
59729
59352
|
var {
|
|
59730
59353
|
REGEX_BACKSLASH,
|
|
@@ -59787,7 +59410,7 @@ var require_utils = __commonJS((exports) => {
|
|
|
59787
59410
|
};
|
|
59788
59411
|
});
|
|
59789
59412
|
|
|
59790
|
-
// node_modules/picomatch/lib/scan.js
|
|
59413
|
+
// node_modules/tinyglobby/node_modules/picomatch/lib/scan.js
|
|
59791
59414
|
var require_scan = __commonJS((exports, module) => {
|
|
59792
59415
|
var utils = require_utils();
|
|
59793
59416
|
var {
|
|
@@ -60102,7 +59725,7 @@ var require_scan = __commonJS((exports, module) => {
|
|
|
60102
59725
|
module.exports = scan;
|
|
60103
59726
|
});
|
|
60104
59727
|
|
|
60105
|
-
// node_modules/picomatch/lib/parse.js
|
|
59728
|
+
// node_modules/tinyglobby/node_modules/picomatch/lib/parse.js
|
|
60106
59729
|
var require_parse = __commonJS((exports, module) => {
|
|
60107
59730
|
var constants2 = require_constants3();
|
|
60108
59731
|
var utils = require_utils();
|
|
@@ -60129,6 +59752,213 @@ var require_parse = __commonJS((exports, module) => {
|
|
|
60129
59752
|
var syntaxError = (type, char) => {
|
|
60130
59753
|
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
60131
59754
|
};
|
|
59755
|
+
var splitTopLevel = (input) => {
|
|
59756
|
+
const parts = [];
|
|
59757
|
+
let bracket = 0;
|
|
59758
|
+
let paren = 0;
|
|
59759
|
+
let quote = 0;
|
|
59760
|
+
let value = "";
|
|
59761
|
+
let escaped = false;
|
|
59762
|
+
for (const ch of input) {
|
|
59763
|
+
if (escaped === true) {
|
|
59764
|
+
value += ch;
|
|
59765
|
+
escaped = false;
|
|
59766
|
+
continue;
|
|
59767
|
+
}
|
|
59768
|
+
if (ch === "\\") {
|
|
59769
|
+
value += ch;
|
|
59770
|
+
escaped = true;
|
|
59771
|
+
continue;
|
|
59772
|
+
}
|
|
59773
|
+
if (ch === '"') {
|
|
59774
|
+
quote = quote === 1 ? 0 : 1;
|
|
59775
|
+
value += ch;
|
|
59776
|
+
continue;
|
|
59777
|
+
}
|
|
59778
|
+
if (quote === 0) {
|
|
59779
|
+
if (ch === "[") {
|
|
59780
|
+
bracket++;
|
|
59781
|
+
} else if (ch === "]" && bracket > 0) {
|
|
59782
|
+
bracket--;
|
|
59783
|
+
} else if (bracket === 0) {
|
|
59784
|
+
if (ch === "(") {
|
|
59785
|
+
paren++;
|
|
59786
|
+
} else if (ch === ")" && paren > 0) {
|
|
59787
|
+
paren--;
|
|
59788
|
+
} else if (ch === "|" && paren === 0) {
|
|
59789
|
+
parts.push(value);
|
|
59790
|
+
value = "";
|
|
59791
|
+
continue;
|
|
59792
|
+
}
|
|
59793
|
+
}
|
|
59794
|
+
}
|
|
59795
|
+
value += ch;
|
|
59796
|
+
}
|
|
59797
|
+
parts.push(value);
|
|
59798
|
+
return parts;
|
|
59799
|
+
};
|
|
59800
|
+
var isPlainBranch = (branch) => {
|
|
59801
|
+
let escaped = false;
|
|
59802
|
+
for (const ch of branch) {
|
|
59803
|
+
if (escaped === true) {
|
|
59804
|
+
escaped = false;
|
|
59805
|
+
continue;
|
|
59806
|
+
}
|
|
59807
|
+
if (ch === "\\") {
|
|
59808
|
+
escaped = true;
|
|
59809
|
+
continue;
|
|
59810
|
+
}
|
|
59811
|
+
if (/[?*+@!()[\]{}]/.test(ch)) {
|
|
59812
|
+
return false;
|
|
59813
|
+
}
|
|
59814
|
+
}
|
|
59815
|
+
return true;
|
|
59816
|
+
};
|
|
59817
|
+
var normalizeSimpleBranch = (branch) => {
|
|
59818
|
+
let value = branch.trim();
|
|
59819
|
+
let changed = true;
|
|
59820
|
+
while (changed === true) {
|
|
59821
|
+
changed = false;
|
|
59822
|
+
if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
|
|
59823
|
+
value = value.slice(2, -1);
|
|
59824
|
+
changed = true;
|
|
59825
|
+
}
|
|
59826
|
+
}
|
|
59827
|
+
if (!isPlainBranch(value)) {
|
|
59828
|
+
return;
|
|
59829
|
+
}
|
|
59830
|
+
return value.replace(/\\(.)/g, "$1");
|
|
59831
|
+
};
|
|
59832
|
+
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
59833
|
+
const values2 = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
59834
|
+
for (let i = 0;i < values2.length; i++) {
|
|
59835
|
+
for (let j = i + 1;j < values2.length; j++) {
|
|
59836
|
+
const a = values2[i];
|
|
59837
|
+
const b = values2[j];
|
|
59838
|
+
const char = a[0];
|
|
59839
|
+
if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
|
|
59840
|
+
continue;
|
|
59841
|
+
}
|
|
59842
|
+
if (a === b || a.startsWith(b) || b.startsWith(a)) {
|
|
59843
|
+
return true;
|
|
59844
|
+
}
|
|
59845
|
+
}
|
|
59846
|
+
}
|
|
59847
|
+
return false;
|
|
59848
|
+
};
|
|
59849
|
+
var parseRepeatedExtglob = (pattern, requireEnd = true) => {
|
|
59850
|
+
if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") {
|
|
59851
|
+
return;
|
|
59852
|
+
}
|
|
59853
|
+
let bracket = 0;
|
|
59854
|
+
let paren = 0;
|
|
59855
|
+
let quote = 0;
|
|
59856
|
+
let escaped = false;
|
|
59857
|
+
for (let i = 1;i < pattern.length; i++) {
|
|
59858
|
+
const ch = pattern[i];
|
|
59859
|
+
if (escaped === true) {
|
|
59860
|
+
escaped = false;
|
|
59861
|
+
continue;
|
|
59862
|
+
}
|
|
59863
|
+
if (ch === "\\") {
|
|
59864
|
+
escaped = true;
|
|
59865
|
+
continue;
|
|
59866
|
+
}
|
|
59867
|
+
if (ch === '"') {
|
|
59868
|
+
quote = quote === 1 ? 0 : 1;
|
|
59869
|
+
continue;
|
|
59870
|
+
}
|
|
59871
|
+
if (quote === 1) {
|
|
59872
|
+
continue;
|
|
59873
|
+
}
|
|
59874
|
+
if (ch === "[") {
|
|
59875
|
+
bracket++;
|
|
59876
|
+
continue;
|
|
59877
|
+
}
|
|
59878
|
+
if (ch === "]" && bracket > 0) {
|
|
59879
|
+
bracket--;
|
|
59880
|
+
continue;
|
|
59881
|
+
}
|
|
59882
|
+
if (bracket > 0) {
|
|
59883
|
+
continue;
|
|
59884
|
+
}
|
|
59885
|
+
if (ch === "(") {
|
|
59886
|
+
paren++;
|
|
59887
|
+
continue;
|
|
59888
|
+
}
|
|
59889
|
+
if (ch === ")") {
|
|
59890
|
+
paren--;
|
|
59891
|
+
if (paren === 0) {
|
|
59892
|
+
if (requireEnd === true && i !== pattern.length - 1) {
|
|
59893
|
+
return;
|
|
59894
|
+
}
|
|
59895
|
+
return {
|
|
59896
|
+
type: pattern[0],
|
|
59897
|
+
body: pattern.slice(2, i),
|
|
59898
|
+
end: i
|
|
59899
|
+
};
|
|
59900
|
+
}
|
|
59901
|
+
}
|
|
59902
|
+
}
|
|
59903
|
+
};
|
|
59904
|
+
var getStarExtglobSequenceOutput = (pattern) => {
|
|
59905
|
+
let index = 0;
|
|
59906
|
+
const chars = [];
|
|
59907
|
+
while (index < pattern.length) {
|
|
59908
|
+
const match = parseRepeatedExtglob(pattern.slice(index), false);
|
|
59909
|
+
if (!match || match.type !== "*") {
|
|
59910
|
+
return;
|
|
59911
|
+
}
|
|
59912
|
+
const branches = splitTopLevel(match.body).map((branch2) => branch2.trim());
|
|
59913
|
+
if (branches.length !== 1) {
|
|
59914
|
+
return;
|
|
59915
|
+
}
|
|
59916
|
+
const branch = normalizeSimpleBranch(branches[0]);
|
|
59917
|
+
if (!branch || branch.length !== 1) {
|
|
59918
|
+
return;
|
|
59919
|
+
}
|
|
59920
|
+
chars.push(branch);
|
|
59921
|
+
index += match.end + 1;
|
|
59922
|
+
}
|
|
59923
|
+
if (chars.length < 1) {
|
|
59924
|
+
return;
|
|
59925
|
+
}
|
|
59926
|
+
const source = chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`;
|
|
59927
|
+
return `${source}*`;
|
|
59928
|
+
};
|
|
59929
|
+
var repeatedExtglobRecursion = (pattern) => {
|
|
59930
|
+
let depth = 0;
|
|
59931
|
+
let value = pattern.trim();
|
|
59932
|
+
let match = parseRepeatedExtglob(value);
|
|
59933
|
+
while (match) {
|
|
59934
|
+
depth++;
|
|
59935
|
+
value = match.body.trim();
|
|
59936
|
+
match = parseRepeatedExtglob(value);
|
|
59937
|
+
}
|
|
59938
|
+
return depth;
|
|
59939
|
+
};
|
|
59940
|
+
var analyzeRepeatedExtglob = (body, options) => {
|
|
59941
|
+
if (options.maxExtglobRecursion === false) {
|
|
59942
|
+
return { risky: false };
|
|
59943
|
+
}
|
|
59944
|
+
const max2 = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants2.DEFAULT_MAX_EXTGLOB_RECURSION;
|
|
59945
|
+
const branches = splitTopLevel(body).map((branch) => branch.trim());
|
|
59946
|
+
if (branches.length > 1) {
|
|
59947
|
+
if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
|
|
59948
|
+
return { risky: true };
|
|
59949
|
+
}
|
|
59950
|
+
}
|
|
59951
|
+
for (const branch of branches) {
|
|
59952
|
+
const safeOutput = getStarExtglobSequenceOutput(branch);
|
|
59953
|
+
if (safeOutput) {
|
|
59954
|
+
return { risky: true, safeOutput };
|
|
59955
|
+
}
|
|
59956
|
+
if (repeatedExtglobRecursion(branch) > max2) {
|
|
59957
|
+
return { risky: true };
|
|
59958
|
+
}
|
|
59959
|
+
}
|
|
59960
|
+
return { risky: false };
|
|
59961
|
+
};
|
|
60132
59962
|
var parse5 = (input, options) => {
|
|
60133
59963
|
if (typeof input !== "string") {
|
|
60134
59964
|
throw new TypeError("Expected a string");
|
|
@@ -60260,6 +60090,8 @@ var require_parse = __commonJS((exports, module) => {
|
|
|
60260
60090
|
token.prev = prev;
|
|
60261
60091
|
token.parens = state.parens;
|
|
60262
60092
|
token.output = state.output;
|
|
60093
|
+
token.startIndex = state.index;
|
|
60094
|
+
token.tokensIndex = tokens.length;
|
|
60263
60095
|
const output = (opts.capture ? "(" : "") + token.open;
|
|
60264
60096
|
increment("parens");
|
|
60265
60097
|
push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
|
|
@@ -60267,6 +60099,26 @@ var require_parse = __commonJS((exports, module) => {
|
|
|
60267
60099
|
extglobs.push(token);
|
|
60268
60100
|
};
|
|
60269
60101
|
const extglobClose = (token) => {
|
|
60102
|
+
const literal2 = input.slice(token.startIndex, state.index + 1);
|
|
60103
|
+
const body = input.slice(token.startIndex + 2, state.index);
|
|
60104
|
+
const analysis = analyzeRepeatedExtglob(body, opts);
|
|
60105
|
+
if ((token.type === "plus" || token.type === "star") && analysis.risky) {
|
|
60106
|
+
const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : undefined;
|
|
60107
|
+
const open = tokens[token.tokensIndex];
|
|
60108
|
+
open.type = "text";
|
|
60109
|
+
open.value = literal2;
|
|
60110
|
+
open.output = safeOutput || utils.escapeRegex(literal2);
|
|
60111
|
+
for (let i = token.tokensIndex + 1;i < tokens.length; i++) {
|
|
60112
|
+
tokens[i].value = "";
|
|
60113
|
+
tokens[i].output = "";
|
|
60114
|
+
delete tokens[i].suffix;
|
|
60115
|
+
}
|
|
60116
|
+
state.output = token.output + open.output;
|
|
60117
|
+
state.backtrack = true;
|
|
60118
|
+
push({ type: "paren", extglob: true, value, output: "" });
|
|
60119
|
+
decrement("parens");
|
|
60120
|
+
return;
|
|
60121
|
+
}
|
|
60270
60122
|
let output = token.close + (opts.capture ? ")" : "");
|
|
60271
60123
|
let rest2;
|
|
60272
60124
|
if (token.type === "negate") {
|
|
@@ -60875,7 +60727,7 @@ var require_parse = __commonJS((exports, module) => {
|
|
|
60875
60727
|
module.exports = parse5;
|
|
60876
60728
|
});
|
|
60877
60729
|
|
|
60878
|
-
// node_modules/picomatch/lib/picomatch.js
|
|
60730
|
+
// node_modules/tinyglobby/node_modules/picomatch/lib/picomatch.js
|
|
60879
60731
|
var require_picomatch = __commonJS((exports, module) => {
|
|
60880
60732
|
var scan = require_scan();
|
|
60881
60733
|
var parse5 = require_parse();
|
|
@@ -60901,17 +60753,17 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
60901
60753
|
}
|
|
60902
60754
|
const opts = options || {};
|
|
60903
60755
|
const posix = opts.windows;
|
|
60904
|
-
const
|
|
60905
|
-
const state =
|
|
60906
|
-
delete
|
|
60756
|
+
const regex2 = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
|
|
60757
|
+
const state = regex2.state;
|
|
60758
|
+
delete regex2.state;
|
|
60907
60759
|
let isIgnored = () => false;
|
|
60908
60760
|
if (opts.ignore) {
|
|
60909
60761
|
const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
60910
60762
|
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
60911
60763
|
}
|
|
60912
60764
|
const matcher = (input, returnObject = false) => {
|
|
60913
|
-
const { isMatch: isMatch2, match, output } = picomatch.test(input,
|
|
60914
|
-
const result2 = { glob, state, regex:
|
|
60765
|
+
const { isMatch: isMatch2, match, output } = picomatch.test(input, regex2, options, { glob, posix });
|
|
60766
|
+
const result2 = { glob, state, regex: regex2, posix, input, output, match, isMatch: isMatch2 };
|
|
60915
60767
|
if (typeof opts.onResult === "function") {
|
|
60916
60768
|
opts.onResult(result2);
|
|
60917
60769
|
}
|
|
@@ -60936,7 +60788,7 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
60936
60788
|
}
|
|
60937
60789
|
return matcher;
|
|
60938
60790
|
};
|
|
60939
|
-
picomatch.test = (input,
|
|
60791
|
+
picomatch.test = (input, regex2, options, { glob, posix } = {}) => {
|
|
60940
60792
|
if (typeof input !== "string") {
|
|
60941
60793
|
throw new TypeError("Expected input to be a string");
|
|
60942
60794
|
}
|
|
@@ -60953,16 +60805,16 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
60953
60805
|
}
|
|
60954
60806
|
if (match === false || opts.capture === true) {
|
|
60955
60807
|
if (opts.matchBase === true || opts.basename === true) {
|
|
60956
|
-
match = picomatch.matchBase(input,
|
|
60808
|
+
match = picomatch.matchBase(input, regex2, options, posix);
|
|
60957
60809
|
} else {
|
|
60958
|
-
match =
|
|
60810
|
+
match = regex2.exec(output);
|
|
60959
60811
|
}
|
|
60960
60812
|
}
|
|
60961
60813
|
return { isMatch: Boolean(match), match, output };
|
|
60962
60814
|
};
|
|
60963
60815
|
picomatch.matchBase = (input, glob, options) => {
|
|
60964
|
-
const
|
|
60965
|
-
return
|
|
60816
|
+
const regex2 = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
|
60817
|
+
return regex2.test(utils.basename(input));
|
|
60966
60818
|
};
|
|
60967
60819
|
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
60968
60820
|
picomatch.parse = (pattern, options) => {
|
|
@@ -60982,11 +60834,11 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
60982
60834
|
if (state && state.negated === true) {
|
|
60983
60835
|
source = `^(?!${source}).*$`;
|
|
60984
60836
|
}
|
|
60985
|
-
const
|
|
60837
|
+
const regex2 = picomatch.toRegex(source, options);
|
|
60986
60838
|
if (returnState === true) {
|
|
60987
|
-
|
|
60839
|
+
regex2.state = state;
|
|
60988
60840
|
}
|
|
60989
|
-
return
|
|
60841
|
+
return regex2;
|
|
60990
60842
|
};
|
|
60991
60843
|
picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
|
60992
60844
|
if (!input || typeof input !== "string") {
|
|
@@ -61015,7 +60867,7 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
61015
60867
|
module.exports = picomatch;
|
|
61016
60868
|
});
|
|
61017
60869
|
|
|
61018
|
-
// node_modules/picomatch/index.js
|
|
60870
|
+
// node_modules/tinyglobby/node_modules/picomatch/index.js
|
|
61019
60871
|
var require_picomatch2 = __commonJS((exports, module) => {
|
|
61020
60872
|
var pico = require_picomatch();
|
|
61021
60873
|
var utils = require_utils();
|
|
@@ -61030,20 +60882,20 @@ var require_picomatch2 = __commonJS((exports, module) => {
|
|
|
61030
60882
|
});
|
|
61031
60883
|
|
|
61032
60884
|
// node_modules/tinyglobby/dist/index.mjs
|
|
61033
|
-
import
|
|
61034
|
-
import
|
|
60885
|
+
import { readdir, readdirSync, realpath, realpathSync, stat, statSync as statSync3 } from "fs";
|
|
60886
|
+
import { isAbsolute, posix, resolve as resolve2 } from "path";
|
|
61035
60887
|
import { fileURLToPath } from "url";
|
|
61036
60888
|
function getPartialMatcher(patterns, options = {}) {
|
|
61037
60889
|
const patternsCount = patterns.length;
|
|
61038
60890
|
const patternsParts = Array(patternsCount);
|
|
61039
60891
|
const matchers = Array(patternsCount);
|
|
61040
|
-
|
|
61041
|
-
for (
|
|
60892
|
+
let i, j;
|
|
60893
|
+
for (i = 0;i < patternsCount; i++) {
|
|
61042
60894
|
const parts = splitPattern(patterns[i]);
|
|
61043
60895
|
patternsParts[i] = parts;
|
|
61044
60896
|
const partsCount = parts.length;
|
|
61045
60897
|
const partMatchers = Array(partsCount);
|
|
61046
|
-
for (
|
|
60898
|
+
for (j = 0;j < partsCount; j++)
|
|
61047
60899
|
partMatchers[j] = import_picomatch.default(parts[j], options);
|
|
61048
60900
|
matchers[i] = partMatchers;
|
|
61049
60901
|
}
|
|
@@ -61051,20 +60903,19 @@ function getPartialMatcher(patterns, options = {}) {
|
|
|
61051
60903
|
const inputParts = input.split("/");
|
|
61052
60904
|
if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input))
|
|
61053
60905
|
return true;
|
|
61054
|
-
for (
|
|
60906
|
+
for (i = 0;i < patternsCount; i++) {
|
|
61055
60907
|
const patternParts = patternsParts[i];
|
|
61056
60908
|
const matcher = matchers[i];
|
|
61057
60909
|
const inputPatternCount = inputParts.length;
|
|
61058
60910
|
const minParts = Math.min(inputPatternCount, patternParts.length);
|
|
61059
|
-
|
|
60911
|
+
j = 0;
|
|
61060
60912
|
while (j < minParts) {
|
|
61061
60913
|
const part = patternParts[j];
|
|
61062
60914
|
if (part.includes("/"))
|
|
61063
60915
|
return true;
|
|
61064
|
-
|
|
61065
|
-
if (!match)
|
|
60916
|
+
if (!matcher[j](inputParts[j]))
|
|
61066
60917
|
break;
|
|
61067
|
-
if (
|
|
60918
|
+
if (!options.noglobstar && part === "**")
|
|
61068
60919
|
return true;
|
|
61069
60920
|
j++;
|
|
61070
60921
|
}
|
|
@@ -61077,7 +60928,7 @@ function getPartialMatcher(patterns, options = {}) {
|
|
|
61077
60928
|
function buildFormat(cwd2, root, absolute) {
|
|
61078
60929
|
if (cwd2 === root || root.startsWith(`${cwd2}/`)) {
|
|
61079
60930
|
if (absolute) {
|
|
61080
|
-
const start =
|
|
60931
|
+
const start = cwd2.length + +!isRoot(cwd2);
|
|
61081
60932
|
return (p, isDir) => p.slice(start, isDir ? -1 : undefined) || ".";
|
|
61082
60933
|
}
|
|
61083
60934
|
const prefix = root.slice(cwd2.length + 1);
|
|
@@ -61101,15 +60952,13 @@ function buildRelative(cwd2, root) {
|
|
|
61101
60952
|
}
|
|
61102
60953
|
return (p) => {
|
|
61103
60954
|
const result2 = posix.relative(cwd2, `${root}/${p}`);
|
|
61104
|
-
|
|
61105
|
-
return `${result2}/`;
|
|
61106
|
-
return result2 || ".";
|
|
60955
|
+
return p[p.length - 1] === "/" && result2 !== "" ? `${result2}/` : result2 || ".";
|
|
61107
60956
|
};
|
|
61108
60957
|
}
|
|
61109
|
-
function splitPattern(
|
|
60958
|
+
function splitPattern(path4) {
|
|
61110
60959
|
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 : [
|
|
60960
|
+
const result2 = import_picomatch.default.scan(path4, splitPatternOptions);
|
|
60961
|
+
return ((_result$parts = result2.parts) === null || _result$parts === undefined ? undefined : _result$parts.length) ? result2.parts : [path4];
|
|
61113
60962
|
}
|
|
61114
60963
|
function isDynamicPattern(pattern, options) {
|
|
61115
60964
|
if ((options === null || options === undefined ? undefined : options.caseSensitiveMatch) === false)
|
|
@@ -61120,29 +60969,31 @@ function isDynamicPattern(pattern, options) {
|
|
|
61120
60969
|
function log(...tasks) {
|
|
61121
60970
|
console.log(`[tinyglobby ${(/* @__PURE__ */ new Date()).toLocaleTimeString("es")}]`, ...tasks);
|
|
61122
60971
|
}
|
|
61123
|
-
function
|
|
60972
|
+
function ensureStringArray(value) {
|
|
60973
|
+
return typeof value === "string" ? [value] : value !== null && value !== undefined ? value : [];
|
|
60974
|
+
}
|
|
60975
|
+
function normalizePattern(pattern, opts, props, isIgnore) {
|
|
60976
|
+
var _PARENT_DIRECTORY$exe;
|
|
60977
|
+
const cwd2 = opts.cwd;
|
|
61124
60978
|
let result2 = pattern;
|
|
61125
|
-
if (pattern.
|
|
60979
|
+
if (pattern[pattern.length - 1] === "/")
|
|
61126
60980
|
result2 = pattern.slice(0, -1);
|
|
61127
|
-
if (
|
|
60981
|
+
if (result2[result2.length - 1] !== "*" && opts.expandDirectories)
|
|
61128
60982
|
result2 += "/**";
|
|
61129
60983
|
const escapedCwd = escapePath(cwd2);
|
|
61130
|
-
|
|
61131
|
-
|
|
61132
|
-
else
|
|
61133
|
-
result2 = posix.normalize(result2);
|
|
61134
|
-
const parentDirectoryMatch = PARENT_DIRECTORY.exec(result2);
|
|
60984
|
+
result2 = isAbsolute(result2.replace(ESCAPING_BACKSLASHES, "")) ? posix.relative(escapedCwd, result2) : posix.normalize(result2);
|
|
60985
|
+
const parentDir = (_PARENT_DIRECTORY$exe = PARENT_DIRECTORY.exec(result2)) === null || _PARENT_DIRECTORY$exe === undefined ? undefined : _PARENT_DIRECTORY$exe[0];
|
|
61135
60986
|
const parts = splitPattern(result2);
|
|
61136
|
-
if (
|
|
61137
|
-
const n = (
|
|
60987
|
+
if (parentDir) {
|
|
60988
|
+
const n = (parentDir.length + 1) / 3;
|
|
61138
60989
|
let i = 0;
|
|
61139
60990
|
const cwdParts = escapedCwd.split("/");
|
|
61140
60991
|
while (i < n && parts[i + n] === cwdParts[cwdParts.length + i - n]) {
|
|
61141
60992
|
result2 = result2.slice(0, (n - i - 1) * 3) + result2.slice((n - i) * 3 + parts[i + n].length + 1) || ".";
|
|
61142
60993
|
i++;
|
|
61143
60994
|
}
|
|
61144
|
-
const potentialRoot = posix.join(cwd2,
|
|
61145
|
-
if (
|
|
60995
|
+
const potentialRoot = posix.join(cwd2, parentDir.slice(i * 3));
|
|
60996
|
+
if (potentialRoot[0] !== "." && props.root.length > potentialRoot.length) {
|
|
61146
60997
|
props.root = potentialRoot;
|
|
61147
60998
|
props.depthOffset = -n + i;
|
|
61148
60999
|
}
|
|
@@ -61158,7 +61009,7 @@ function normalizePattern(pattern, expandDirectories, cwd2, props, isIgnore) {
|
|
|
61158
61009
|
newCommonPath.pop();
|
|
61159
61010
|
break;
|
|
61160
61011
|
}
|
|
61161
|
-
if (part !== props.commonPath[i] || isDynamicPattern(part)
|
|
61012
|
+
if (i === parts.length - 1 || part !== props.commonPath[i] || isDynamicPattern(part))
|
|
61162
61013
|
break;
|
|
61163
61014
|
newCommonPath.push(part);
|
|
61164
61015
|
}
|
|
@@ -61168,162 +61019,138 @@ function normalizePattern(pattern, expandDirectories, cwd2, props, isIgnore) {
|
|
|
61168
61019
|
}
|
|
61169
61020
|
return result2;
|
|
61170
61021
|
}
|
|
61171
|
-
function processPatterns(
|
|
61172
|
-
if (typeof patterns === "string")
|
|
61173
|
-
patterns = [patterns];
|
|
61174
|
-
if (typeof ignore === "string")
|
|
61175
|
-
ignore = [ignore];
|
|
61022
|
+
function processPatterns(options, patterns, props) {
|
|
61176
61023
|
const matchPatterns = [];
|
|
61177
61024
|
const ignorePatterns = [];
|
|
61178
|
-
for (const pattern of ignore) {
|
|
61025
|
+
for (const pattern of options.ignore) {
|
|
61179
61026
|
if (!pattern)
|
|
61180
61027
|
continue;
|
|
61181
61028
|
if (pattern[0] !== "!" || pattern[1] === "(")
|
|
61182
|
-
ignorePatterns.push(normalizePattern(pattern,
|
|
61029
|
+
ignorePatterns.push(normalizePattern(pattern, options, props, true));
|
|
61183
61030
|
}
|
|
61184
61031
|
for (const pattern of patterns) {
|
|
61185
61032
|
if (!pattern)
|
|
61186
61033
|
continue;
|
|
61187
61034
|
if (pattern[0] !== "!" || pattern[1] === "(")
|
|
61188
|
-
matchPatterns.push(normalizePattern(pattern,
|
|
61035
|
+
matchPatterns.push(normalizePattern(pattern, options, props, false));
|
|
61189
61036
|
else if (pattern[1] !== "!" || pattern[2] === "(")
|
|
61190
|
-
ignorePatterns.push(normalizePattern(pattern.slice(1),
|
|
61037
|
+
ignorePatterns.push(normalizePattern(pattern.slice(1), options, props, true));
|
|
61191
61038
|
}
|
|
61192
61039
|
return {
|
|
61193
61040
|
match: matchPatterns,
|
|
61194
61041
|
ignore: ignorePatterns
|
|
61195
61042
|
};
|
|
61196
61043
|
}
|
|
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];
|
|
61044
|
+
function buildCrawler(options, patterns) {
|
|
61045
|
+
const cwd2 = options.cwd;
|
|
61228
61046
|
const props = {
|
|
61229
61047
|
root: cwd2,
|
|
61230
|
-
commonPath: null,
|
|
61231
61048
|
depthOffset: 0
|
|
61232
61049
|
};
|
|
61233
|
-
const processed = processPatterns(
|
|
61234
|
-
...options,
|
|
61235
|
-
patterns
|
|
61236
|
-
}, cwd2, props);
|
|
61050
|
+
const processed = processPatterns(options, patterns, props);
|
|
61237
61051
|
if (options.debug)
|
|
61238
61052
|
log("internal processing patterns:", processed);
|
|
61053
|
+
const { absolute, caseSensitiveMatch, debug: debug3, dot, followSymbolicLinks, onlyDirectories } = options;
|
|
61054
|
+
const root = props.root.replace(BACKSLASHES, "");
|
|
61239
61055
|
const matchOptions = {
|
|
61240
|
-
dot
|
|
61056
|
+
dot,
|
|
61241
61057
|
nobrace: options.braceExpansion === false,
|
|
61242
|
-
nocase:
|
|
61058
|
+
nocase: !caseSensitiveMatch,
|
|
61243
61059
|
noextglob: options.extglob === false,
|
|
61244
61060
|
noglobstar: options.globstar === false,
|
|
61245
61061
|
posix: true
|
|
61246
61062
|
};
|
|
61247
|
-
const matcher = import_picomatch.default(processed.match,
|
|
61248
|
-
...matchOptions,
|
|
61249
|
-
ignore: processed.ignore
|
|
61250
|
-
});
|
|
61063
|
+
const matcher = import_picomatch.default(processed.match, matchOptions);
|
|
61251
61064
|
const ignore = import_picomatch.default(processed.ignore, matchOptions);
|
|
61252
61065
|
const partialMatcher = getPartialMatcher(processed.match, matchOptions);
|
|
61253
|
-
const format = buildFormat(cwd2,
|
|
61254
|
-
const
|
|
61255
|
-
const
|
|
61256
|
-
|
|
61257
|
-
|
|
61258
|
-
|
|
61066
|
+
const format = buildFormat(cwd2, root, absolute);
|
|
61067
|
+
const excludeFormatter = absolute ? format : buildFormat(cwd2, root, true);
|
|
61068
|
+
const excludePredicate = (_, p) => {
|
|
61069
|
+
const relativePath = excludeFormatter(p, true);
|
|
61070
|
+
return relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
|
|
61071
|
+
};
|
|
61072
|
+
let maxDepth;
|
|
61073
|
+
if (options.deep !== undefined)
|
|
61074
|
+
maxDepth = Math.round(options.deep - props.depthOffset);
|
|
61075
|
+
const crawler = new Builder({
|
|
61076
|
+
filters: [debug3 ? (p, isDirectory) => {
|
|
61077
|
+
const path4 = format(p, isDirectory);
|
|
61078
|
+
const matches2 = matcher(path4) && !ignore(path4);
|
|
61259
61079
|
if (matches2)
|
|
61260
|
-
log(`matched ${
|
|
61080
|
+
log(`matched ${path4}`);
|
|
61261
61081
|
return matches2;
|
|
61262
|
-
} : (p, isDirectory) =>
|
|
61263
|
-
|
|
61264
|
-
|
|
61265
|
-
|
|
61266
|
-
|
|
61267
|
-
|
|
61268
|
-
|
|
61269
|
-
log(`crawling ${p}`);
|
|
61082
|
+
} : (p, isDirectory) => {
|
|
61083
|
+
const path4 = format(p, isDirectory);
|
|
61084
|
+
return matcher(path4) && !ignore(path4);
|
|
61085
|
+
}],
|
|
61086
|
+
exclude: debug3 ? (_, p) => {
|
|
61087
|
+
const skipped = excludePredicate(_, p);
|
|
61088
|
+
log(`${skipped ? "skipped" : "crawling"} ${p}`);
|
|
61270
61089
|
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,
|
|
61090
|
+
} : excludePredicate,
|
|
61091
|
+
fs: options.fs,
|
|
61283
61092
|
pathSeparator: "/",
|
|
61284
|
-
relativePaths:
|
|
61285
|
-
|
|
61093
|
+
relativePaths: !absolute,
|
|
61094
|
+
resolvePaths: absolute,
|
|
61095
|
+
includeBasePath: absolute,
|
|
61096
|
+
resolveSymlinks: followSymbolicLinks,
|
|
61097
|
+
excludeSymlinks: !followSymbolicLinks,
|
|
61098
|
+
excludeFiles: onlyDirectories,
|
|
61099
|
+
includeDirs: onlyDirectories || !options.onlyFiles,
|
|
61100
|
+
maxDepth,
|
|
61286
61101
|
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;
|
|
61102
|
+
}).crawl(root);
|
|
61306
61103
|
if (options.debug)
|
|
61307
|
-
log("internal properties:",
|
|
61308
|
-
|
|
61309
|
-
|
|
61104
|
+
log("internal properties:", {
|
|
61105
|
+
...props,
|
|
61106
|
+
root
|
|
61107
|
+
});
|
|
61108
|
+
return [crawler, cwd2 !== root && !absolute && buildRelative(cwd2, root)];
|
|
61109
|
+
}
|
|
61110
|
+
function formatPaths(paths, mapper) {
|
|
61111
|
+
if (mapper)
|
|
61112
|
+
for (let i = paths.length - 1;i >= 0; i--)
|
|
61113
|
+
paths[i] = mapper(paths[i]);
|
|
61114
|
+
return paths;
|
|
61310
61115
|
}
|
|
61311
|
-
function
|
|
61312
|
-
|
|
61116
|
+
function getOptions2(options) {
|
|
61117
|
+
const opts = {
|
|
61118
|
+
...defaultOptions,
|
|
61119
|
+
...options
|
|
61120
|
+
};
|
|
61121
|
+
opts.cwd = (opts.cwd instanceof URL ? fileURLToPath(opts.cwd) : resolve2(opts.cwd)).replace(BACKSLASHES, "/");
|
|
61122
|
+
opts.ignore = ensureStringArray(opts.ignore);
|
|
61123
|
+
opts.fs && (opts.fs = {
|
|
61124
|
+
readdir: opts.fs.readdir || readdir,
|
|
61125
|
+
readdirSync: opts.fs.readdirSync || readdirSync,
|
|
61126
|
+
realpath: opts.fs.realpath || realpath,
|
|
61127
|
+
realpathSync: opts.fs.realpathSync || realpathSync,
|
|
61128
|
+
stat: opts.fs.stat || stat,
|
|
61129
|
+
statSync: opts.fs.statSync || statSync3
|
|
61130
|
+
});
|
|
61131
|
+
if (opts.debug)
|
|
61132
|
+
log("globbing with options:", opts);
|
|
61133
|
+
return opts;
|
|
61134
|
+
}
|
|
61135
|
+
function getCrawler(globInput, inputOptions = {}) {
|
|
61136
|
+
var _ref;
|
|
61137
|
+
if (globInput && (inputOptions === null || inputOptions === undefined ? undefined : inputOptions.patterns))
|
|
61313
61138
|
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
|
-
|
|
61139
|
+
const isModern = isReadonlyArray(globInput) || typeof globInput === "string";
|
|
61140
|
+
const patterns = ensureStringArray((_ref = isModern ? globInput : globInput.patterns) !== null && _ref !== undefined ? _ref : "**/*");
|
|
61141
|
+
const options = getOptions2(isModern ? inputOptions : globInput);
|
|
61142
|
+
return patterns.length > 0 ? buildCrawler(options, patterns) : [];
|
|
61143
|
+
}
|
|
61144
|
+
function globSync(globInput, options) {
|
|
61145
|
+
const [crawler, relative2] = getCrawler(globInput, options);
|
|
61146
|
+
return crawler ? formatPaths(crawler.sync(), relative2) : [];
|
|
61147
|
+
}
|
|
61148
|
+
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;
|
|
61149
|
+
var init_dist7 = __esm(() => {
|
|
61150
|
+
init_dist6();
|
|
61325
61151
|
import_picomatch = __toESM(require_picomatch2(), 1);
|
|
61326
61152
|
isReadonlyArray = Array.isArray;
|
|
61153
|
+
BACKSLASHES = /\\/g;
|
|
61327
61154
|
isWin = process.platform === "win32";
|
|
61328
61155
|
ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
|
|
61329
61156
|
WIN32_ROOT_DIR = /^[A-Z]:\/$/i;
|
|
@@ -61334,7 +61161,14 @@ var init_dist5 = __esm(() => {
|
|
|
61334
61161
|
escapePath = isWin ? escapeWin32Path : escapePosixPath;
|
|
61335
61162
|
PARENT_DIRECTORY = /^(\/?\.\.)+/;
|
|
61336
61163
|
ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g;
|
|
61337
|
-
|
|
61164
|
+
defaultOptions = {
|
|
61165
|
+
caseSensitiveMatch: true,
|
|
61166
|
+
cwd: process.cwd(),
|
|
61167
|
+
debug: !!process.env.TINYGLOBBY_DEBUG,
|
|
61168
|
+
expandDirectories: true,
|
|
61169
|
+
followSymbolicLinks: true,
|
|
61170
|
+
onlyFiles: true
|
|
61171
|
+
};
|
|
61338
61172
|
});
|
|
61339
61173
|
|
|
61340
61174
|
// src/utils/jsonl-lines.ts
|
|
@@ -61367,7 +61201,7 @@ var init_jsonl_lines = __esm(() => {
|
|
|
61367
61201
|
|
|
61368
61202
|
// src/utils/jsonl-blocks.ts
|
|
61369
61203
|
import * as fs5 from "fs";
|
|
61370
|
-
import
|
|
61204
|
+
import path4 from "node:path";
|
|
61371
61205
|
function getBlockMetrics() {
|
|
61372
61206
|
const claudeDir = getClaudeConfigDir();
|
|
61373
61207
|
if (!claudeDir)
|
|
@@ -61381,7 +61215,7 @@ function getBlockMetrics() {
|
|
|
61381
61215
|
function findMostRecentBlockStartTime(rootDir, sessionDurationHours = 5) {
|
|
61382
61216
|
const sessionDurationMs = sessionDurationHours * 60 * 60 * 1000;
|
|
61383
61217
|
const now2 = new Date;
|
|
61384
|
-
const pattern =
|
|
61218
|
+
const pattern = path4.posix.join(rootDir.replace(/\\/g, "/"), "projects", "**", "*.jsonl");
|
|
61385
61219
|
const files = globSync([pattern], {
|
|
61386
61220
|
absolute: true,
|
|
61387
61221
|
cwd: rootDir
|
|
@@ -61389,7 +61223,7 @@ function findMostRecentBlockStartTime(rootDir, sessionDurationHours = 5) {
|
|
|
61389
61223
|
if (files.length === 0)
|
|
61390
61224
|
return null;
|
|
61391
61225
|
const filesWithStats = files.map((file2) => {
|
|
61392
|
-
const stats =
|
|
61226
|
+
const stats = statSync5(file2);
|
|
61393
61227
|
return { file: file2, mtime: stats.mtime };
|
|
61394
61228
|
});
|
|
61395
61229
|
filesWithStats.sort((a, b) => b.mtime.getTime() - a.mtime.getTime());
|
|
@@ -61507,26 +61341,26 @@ function floorToHour(timestamp) {
|
|
|
61507
61341
|
floored.setUTCMinutes(0, 0, 0);
|
|
61508
61342
|
return floored;
|
|
61509
61343
|
}
|
|
61510
|
-
var
|
|
61344
|
+
var statSync5;
|
|
61511
61345
|
var init_jsonl_blocks = __esm(() => {
|
|
61512
|
-
|
|
61346
|
+
init_dist7();
|
|
61513
61347
|
init_claude_settings();
|
|
61514
61348
|
init_jsonl_lines();
|
|
61515
|
-
|
|
61349
|
+
statSync5 = fs5.statSync;
|
|
61516
61350
|
});
|
|
61517
61351
|
|
|
61518
61352
|
// src/utils/jsonl-cache.ts
|
|
61519
61353
|
import * as fs6 from "fs";
|
|
61520
61354
|
import { createHash as createHash2 } from "node:crypto";
|
|
61521
61355
|
import os5 from "node:os";
|
|
61522
|
-
import
|
|
61356
|
+
import path5 from "node:path";
|
|
61523
61357
|
function normalizeConfigDir(configDir) {
|
|
61524
|
-
return
|
|
61358
|
+
return path5.resolve(configDir);
|
|
61525
61359
|
}
|
|
61526
61360
|
function getBlockCachePath(configDir = getClaudeConfigDir()) {
|
|
61527
61361
|
const normalizedConfigDir = normalizeConfigDir(configDir);
|
|
61528
61362
|
const configHash = createHash2("sha256").update(normalizedConfigDir).digest("hex").slice(0, 16);
|
|
61529
|
-
return
|
|
61363
|
+
return path5.join(os5.homedir(), ".cache", "ccstatusline", `block-cache-${configHash}.json`);
|
|
61530
61364
|
}
|
|
61531
61365
|
function readBlockCache(expectedConfigDir) {
|
|
61532
61366
|
try {
|
|
@@ -61561,7 +61395,7 @@ function writeBlockCache(startTime, configDir = getClaudeConfigDir()) {
|
|
|
61561
61395
|
try {
|
|
61562
61396
|
const normalizedConfigDir = normalizeConfigDir(configDir);
|
|
61563
61397
|
const cachePath = getBlockCachePath(normalizedConfigDir);
|
|
61564
|
-
const cacheDir =
|
|
61398
|
+
const cacheDir = path5.dirname(cachePath);
|
|
61565
61399
|
if (!existsSync6(cacheDir)) {
|
|
61566
61400
|
mkdirSync4(cacheDir, { recursive: true });
|
|
61567
61401
|
}
|
|
@@ -61604,7 +61438,7 @@ var init_jsonl_cache = __esm(() => {
|
|
|
61604
61438
|
|
|
61605
61439
|
// src/utils/jsonl-metrics.ts
|
|
61606
61440
|
import * as fs7 from "fs";
|
|
61607
|
-
import
|
|
61441
|
+
import path6 from "node:path";
|
|
61608
61442
|
function collectAgentIds(value, agentIds) {
|
|
61609
61443
|
if (!value || typeof value !== "object") {
|
|
61610
61444
|
return;
|
|
@@ -61900,11 +61734,11 @@ function getSubagentTranscriptPaths(transcriptPath, referencedAgentIds) {
|
|
|
61900
61734
|
if (referencedAgentIds.size === 0) {
|
|
61901
61735
|
return [];
|
|
61902
61736
|
}
|
|
61903
|
-
const transcriptDir =
|
|
61904
|
-
const transcriptStem =
|
|
61737
|
+
const transcriptDir = path6.dirname(transcriptPath);
|
|
61738
|
+
const transcriptStem = path6.parse(transcriptPath).name;
|
|
61905
61739
|
const candidateDirs = [
|
|
61906
|
-
|
|
61907
|
-
|
|
61740
|
+
path6.join(transcriptDir, "subagents"),
|
|
61741
|
+
path6.join(transcriptDir, transcriptStem, "subagents")
|
|
61908
61742
|
];
|
|
61909
61743
|
const seenPaths = new Set;
|
|
61910
61744
|
const matchedPaths = [];
|
|
@@ -61925,7 +61759,7 @@ function getSubagentTranscriptPaths(transcriptPath, referencedAgentIds) {
|
|
|
61925
61759
|
if (!referencedAgentIds.has(match[1])) {
|
|
61926
61760
|
continue;
|
|
61927
61761
|
}
|
|
61928
|
-
const fullPath =
|
|
61762
|
+
const fullPath = path6.join(subagentsDir, entry.name);
|
|
61929
61763
|
if (seenPaths.has(fullPath)) {
|
|
61930
61764
|
continue;
|
|
61931
61765
|
}
|
|
@@ -62467,27 +62301,27 @@ class CurrentWorkingDirWidget {
|
|
|
62467
62301
|
supportsColors(item) {
|
|
62468
62302
|
return true;
|
|
62469
62303
|
}
|
|
62470
|
-
abbreviateHomeDir(
|
|
62304
|
+
abbreviateHomeDir(path7) {
|
|
62471
62305
|
const homeDir = os6.homedir();
|
|
62472
|
-
if (
|
|
62306
|
+
if (path7 === homeDir) {
|
|
62473
62307
|
return "~";
|
|
62474
62308
|
}
|
|
62475
|
-
if (
|
|
62476
|
-
const boundaryChar =
|
|
62309
|
+
if (path7.startsWith(homeDir)) {
|
|
62310
|
+
const boundaryChar = path7[homeDir.length];
|
|
62477
62311
|
if (boundaryChar !== "/" && boundaryChar !== "\\") {
|
|
62478
|
-
return
|
|
62312
|
+
return path7;
|
|
62479
62313
|
}
|
|
62480
|
-
return "~" +
|
|
62314
|
+
return "~" + path7.slice(homeDir.length);
|
|
62481
62315
|
}
|
|
62482
|
-
return
|
|
62316
|
+
return path7;
|
|
62483
62317
|
}
|
|
62484
|
-
abbreviatePath(
|
|
62318
|
+
abbreviatePath(path7) {
|
|
62485
62319
|
const homeDir = os6.homedir();
|
|
62486
|
-
const useBackslash =
|
|
62320
|
+
const useBackslash = path7.includes("\\") && !path7.includes("/");
|
|
62487
62321
|
const sep2 = useBackslash ? "\\" : "/";
|
|
62488
|
-
let normalizedPath =
|
|
62489
|
-
if (
|
|
62490
|
-
normalizedPath = "~" +
|
|
62322
|
+
let normalizedPath = path7;
|
|
62323
|
+
if (path7.startsWith(homeDir)) {
|
|
62324
|
+
normalizedPath = "~" + path7.slice(homeDir.length);
|
|
62491
62325
|
}
|
|
62492
62326
|
const parts = normalizedPath.split(/[\\/]+/).filter((part) => part !== "");
|
|
62493
62327
|
const abbreviated = parts.map((part, index) => {
|
|
@@ -62616,7 +62450,7 @@ class ClaudeSessionIdWidget {
|
|
|
62616
62450
|
|
|
62617
62451
|
// src/widgets/ClaudeAccountEmail.ts
|
|
62618
62452
|
import * as fs8 from "fs";
|
|
62619
|
-
import * as
|
|
62453
|
+
import * as path7 from "path";
|
|
62620
62454
|
|
|
62621
62455
|
class ClaudeAccountEmailWidget {
|
|
62622
62456
|
getDefaultColor() {
|
|
@@ -62640,8 +62474,8 @@ class ClaudeAccountEmailWidget {
|
|
|
62640
62474
|
}
|
|
62641
62475
|
try {
|
|
62642
62476
|
const configDir = getClaudeConfigDir();
|
|
62643
|
-
const claudeJsonPath =
|
|
62644
|
-
const resolved =
|
|
62477
|
+
const claudeJsonPath = path7.join(configDir, "..", ".claude.json");
|
|
62478
|
+
const resolved = path7.resolve(claudeJsonPath);
|
|
62645
62479
|
if (!fs8.existsSync(resolved)) {
|
|
62646
62480
|
return null;
|
|
62647
62481
|
}
|
|
@@ -62998,7 +62832,7 @@ var init_TotalSpeed = __esm(async () => {
|
|
|
62998
62832
|
});
|
|
62999
62833
|
|
|
63000
62834
|
// src/widgets/FreeMemory.ts
|
|
63001
|
-
import { execSync as
|
|
62835
|
+
import { execSync as execSync3 } from "child_process";
|
|
63002
62836
|
import os7 from "os";
|
|
63003
62837
|
function formatBytes(bytes) {
|
|
63004
62838
|
const GB = 1024 ** 3;
|
|
@@ -63014,7 +62848,7 @@ function formatBytes(bytes) {
|
|
|
63014
62848
|
}
|
|
63015
62849
|
function getUsedMemoryMacOS() {
|
|
63016
62850
|
try {
|
|
63017
|
-
const output =
|
|
62851
|
+
const output = execSync3("vm_stat", { encoding: "utf8" });
|
|
63018
62852
|
const lines = output.split(`
|
|
63019
62853
|
`);
|
|
63020
62854
|
const firstLine = lines[0];
|
|
@@ -63136,6 +62970,61 @@ class SessionNameWidget {
|
|
|
63136
62970
|
}
|
|
63137
62971
|
var init_SessionName = () => {};
|
|
63138
62972
|
|
|
62973
|
+
// src/utils/usage/providers/anthropic.ts
|
|
62974
|
+
var anthropicProvider;
|
|
62975
|
+
var init_anthropic = __esm(() => {
|
|
62976
|
+
init_usage_fetch();
|
|
62977
|
+
anthropicProvider = {
|
|
62978
|
+
name: "anthropic",
|
|
62979
|
+
async fetchUsage() {
|
|
62980
|
+
const data = await fetchUsageData();
|
|
62981
|
+
return { ...data, provider: "anthropic" };
|
|
62982
|
+
}
|
|
62983
|
+
};
|
|
62984
|
+
});
|
|
62985
|
+
|
|
62986
|
+
// src/utils/usage/providers/null.ts
|
|
62987
|
+
var nullProvider;
|
|
62988
|
+
var init_null = __esm(() => {
|
|
62989
|
+
nullProvider = {
|
|
62990
|
+
name: "null",
|
|
62991
|
+
fetchUsage() {
|
|
62992
|
+
return Promise.resolve({ provider: null });
|
|
62993
|
+
}
|
|
62994
|
+
};
|
|
62995
|
+
});
|
|
62996
|
+
|
|
62997
|
+
// src/utils/usage/providers/opencode.ts
|
|
62998
|
+
var opencodeProvider;
|
|
62999
|
+
var init_opencode = __esm(() => {
|
|
63000
|
+
opencodeProvider = {
|
|
63001
|
+
name: "opencode",
|
|
63002
|
+
fetchUsage() {
|
|
63003
|
+
return Promise.resolve({ provider: "opencode" });
|
|
63004
|
+
}
|
|
63005
|
+
};
|
|
63006
|
+
});
|
|
63007
|
+
|
|
63008
|
+
// src/utils/usage/resolver.ts
|
|
63009
|
+
function resolveProvider(modelId) {
|
|
63010
|
+
if (!modelId)
|
|
63011
|
+
return nullProvider;
|
|
63012
|
+
const id = modelId.toLowerCase();
|
|
63013
|
+
if (ANTHROPIC_KEYWORDS.some((k) => id.includes(k)))
|
|
63014
|
+
return anthropicProvider;
|
|
63015
|
+
if (OPENCODE_PATTERN.test(id))
|
|
63016
|
+
return opencodeProvider;
|
|
63017
|
+
return nullProvider;
|
|
63018
|
+
}
|
|
63019
|
+
var OPENCODE_PATTERN, ANTHROPIC_KEYWORDS;
|
|
63020
|
+
var init_resolver = __esm(() => {
|
|
63021
|
+
init_anthropic();
|
|
63022
|
+
init_null();
|
|
63023
|
+
init_opencode();
|
|
63024
|
+
OPENCODE_PATTERN = /(?:^|[^a-z])(glm|kimi|minimax|mm-|qwen|owen|mimo)/i;
|
|
63025
|
+
ANTHROPIC_KEYWORDS = ["opus", "sonnet", "haiku"];
|
|
63026
|
+
});
|
|
63027
|
+
|
|
63139
63028
|
// src/widgets/ApiUsage.tsx
|
|
63140
63029
|
function getDisplaySize(context) {
|
|
63141
63030
|
const w = context.terminalWidth ?? 0;
|
|
@@ -63189,6 +63078,10 @@ function formatCents(cents) {
|
|
|
63189
63078
|
const symbol2 = getCurrencySymbol();
|
|
63190
63079
|
return `${symbol2}${(cents / 100).toFixed(2)}`;
|
|
63191
63080
|
}
|
|
63081
|
+
function getModelId(context) {
|
|
63082
|
+
const model = context.data?.model;
|
|
63083
|
+
return (typeof model === "string" ? model : model?.id) ?? "";
|
|
63084
|
+
}
|
|
63192
63085
|
|
|
63193
63086
|
class SessionUsageWidget {
|
|
63194
63087
|
getDefaultColor() {
|
|
@@ -63215,6 +63108,8 @@ class SessionUsageWidget {
|
|
|
63215
63108
|
if (data.sessionUsage === undefined)
|
|
63216
63109
|
return null;
|
|
63217
63110
|
const size2 = getDisplaySize(context);
|
|
63111
|
+
if (resolveProvider(getModelId(context)).name === "null")
|
|
63112
|
+
return null;
|
|
63218
63113
|
const extraUsed = data.extraUsageUsed;
|
|
63219
63114
|
const extraLimit = data.extraUsageLimit;
|
|
63220
63115
|
if (size2 !== "mobile" && data.extraUsageEnabled === true && extraUsed !== undefined && extraLimit !== undefined && data.sessionUsage >= 100 && (data.weeklyUsage === undefined || data.weeklyUsage < 100)) {
|
|
@@ -63256,6 +63151,8 @@ class WeeklyUsageWidget {
|
|
|
63256
63151
|
if (data.weeklyUsage === undefined)
|
|
63257
63152
|
return null;
|
|
63258
63153
|
const size2 = getDisplaySize(context);
|
|
63154
|
+
if (resolveProvider(getModelId(context)).name === "null")
|
|
63155
|
+
return null;
|
|
63259
63156
|
const extraUsed = data.extraUsageUsed;
|
|
63260
63157
|
const extraLimit = data.extraUsageLimit;
|
|
63261
63158
|
if (data.extraUsageEnabled === true && extraUsed !== undefined && extraLimit !== undefined && data.weeklyUsage >= 100) {
|
|
@@ -63294,8 +63191,9 @@ class ResetTimerWidget {
|
|
|
63294
63191
|
const data = context.usageData ?? {};
|
|
63295
63192
|
if (data.error)
|
|
63296
63193
|
return getUsageErrorMessage(data.error);
|
|
63297
|
-
|
|
63298
|
-
|
|
63194
|
+
if (resolveProvider(getModelId(context)).name === "null")
|
|
63195
|
+
return null;
|
|
63196
|
+
const modelId = getModelId(context);
|
|
63299
63197
|
const is1mModel = modelId.includes("[1m]");
|
|
63300
63198
|
const isOpus = modelId.includes("opus");
|
|
63301
63199
|
const isChargedModel = is1mModel && !isOpus;
|
|
@@ -63382,6 +63280,7 @@ class ContextBarWidget {
|
|
|
63382
63280
|
var DARK_RED_OPEN2 = "\x1B[38;2;204;0;0m", DARK_RED_CLOSE2 = "\x1B[39m", MOBILE_THRESHOLD = 134, MEDIUM_THRESHOLD2 = 178, MOBILE_BAR_WIDTH = 4, MEDIUM_BAR_WIDTH = 8, DEFAULT_BAR_WIDTH = 15;
|
|
63383
63281
|
var init_ApiUsage = __esm(() => {
|
|
63384
63282
|
init_usage();
|
|
63283
|
+
init_resolver();
|
|
63385
63284
|
});
|
|
63386
63285
|
|
|
63387
63286
|
// src/widgets/WeeklyResetTimer.ts
|
|
@@ -63955,11 +63854,11 @@ var init_ThinkingEffort = __esm(() => {
|
|
|
63955
63854
|
});
|
|
63956
63855
|
|
|
63957
63856
|
// src/widgets/Battery.ts
|
|
63958
|
-
import { execSync as
|
|
63857
|
+
import { execSync as execSync4 } from "child_process";
|
|
63959
63858
|
import { readFileSync as readFileSync11 } from "fs";
|
|
63960
63859
|
function getMacBatteryInfo() {
|
|
63961
63860
|
try {
|
|
63962
|
-
const output =
|
|
63861
|
+
const output = execSync4("pmset -g batt", { encoding: "utf-8", timeout: 2000 });
|
|
63963
63862
|
const match = /(\d+)%;\s*(charging|discharging|charged|finishing charge|AC attached)/i.exec(output);
|
|
63964
63863
|
const percentStr = match?.[1];
|
|
63965
63864
|
const stateStr = match?.[2];
|
|
@@ -64962,9 +64861,9 @@ var init_hooks = __esm(async () => {
|
|
|
64962
64861
|
// src/utils/config.ts
|
|
64963
64862
|
import * as fs10 from "fs";
|
|
64964
64863
|
import * as os8 from "os";
|
|
64965
|
-
import * as
|
|
64864
|
+
import * as path8 from "path";
|
|
64966
64865
|
function initConfigPath(filePath) {
|
|
64967
|
-
settingsPath = filePath ?
|
|
64866
|
+
settingsPath = filePath ? path8.resolve(filePath) : DEFAULT_SETTINGS_PATH;
|
|
64968
64867
|
}
|
|
64969
64868
|
function getConfigPath() {
|
|
64970
64869
|
return settingsPath;
|
|
@@ -64973,13 +64872,13 @@ function isCustomConfigPath() {
|
|
|
64973
64872
|
return settingsPath !== DEFAULT_SETTINGS_PATH;
|
|
64974
64873
|
}
|
|
64975
64874
|
function getSettingsPaths() {
|
|
64976
|
-
const configDir =
|
|
64977
|
-
const parsedPath =
|
|
64875
|
+
const configDir = path8.dirname(settingsPath);
|
|
64876
|
+
const parsedPath = path8.parse(settingsPath);
|
|
64978
64877
|
const backupBaseName = parsedPath.ext ? `${parsedPath.name}.bak` : `${parsedPath.base}.bak`;
|
|
64979
64878
|
return {
|
|
64980
64879
|
configDir,
|
|
64981
64880
|
settingsPath,
|
|
64982
|
-
settingsBackupPath:
|
|
64881
|
+
settingsBackupPath: path8.join(configDir, backupBaseName)
|
|
64983
64882
|
};
|
|
64984
64883
|
}
|
|
64985
64884
|
async function ensureDir(dir) {
|
|
@@ -65079,15 +64978,15 @@ var init_config = __esm(() => {
|
|
|
65079
64978
|
readFile3 = fs10.promises.readFile;
|
|
65080
64979
|
writeFile = fs10.promises.writeFile;
|
|
65081
64980
|
mkdir = fs10.promises.mkdir;
|
|
65082
|
-
DEFAULT_SETTINGS_PATH =
|
|
64981
|
+
DEFAULT_SETTINGS_PATH = path8.join(os8.homedir(), ".config", "ccstatusline", "settings.json");
|
|
65083
64982
|
settingsPath = DEFAULT_SETTINGS_PATH;
|
|
65084
64983
|
});
|
|
65085
64984
|
|
|
65086
64985
|
// src/utils/claude-settings.ts
|
|
65087
|
-
import { execSync as
|
|
64986
|
+
import { execSync as execSync5 } from "child_process";
|
|
65088
64987
|
import * as fs11 from "fs";
|
|
65089
64988
|
import * as os9 from "os";
|
|
65090
|
-
import * as
|
|
64989
|
+
import * as path9 from "path";
|
|
65091
64990
|
function isKnownCommand(command) {
|
|
65092
64991
|
const prefixes = [CCSTATUSLINE_COMMANDS.NPM, CCSTATUSLINE_COMMANDS.BUNX, CCSTATUSLINE_COMMANDS.SELF_MANAGED];
|
|
65093
64992
|
return prefixes.some((prefix) => command === prefix || command.startsWith(`${prefix} --config `)) || /(?:^|[\s"'\\/])ccstatusline\.ts(?=$|[\s"'])/.test(command);
|
|
@@ -65111,7 +65010,7 @@ function getClaudeConfigDir() {
|
|
|
65111
65010
|
const envConfigDir = process.env.CLAUDE_CONFIG_DIR;
|
|
65112
65011
|
if (envConfigDir) {
|
|
65113
65012
|
try {
|
|
65114
|
-
const resolvedPath =
|
|
65013
|
+
const resolvedPath = path9.resolve(envConfigDir);
|
|
65115
65014
|
if (fs11.existsSync(resolvedPath)) {
|
|
65116
65015
|
const stats = fs11.statSync(resolvedPath);
|
|
65117
65016
|
if (stats.isDirectory()) {
|
|
@@ -65122,10 +65021,10 @@ function getClaudeConfigDir() {
|
|
|
65122
65021
|
}
|
|
65123
65022
|
} catch {}
|
|
65124
65023
|
}
|
|
65125
|
-
return
|
|
65024
|
+
return path9.join(os9.homedir(), ".claude");
|
|
65126
65025
|
}
|
|
65127
65026
|
function getClaudeSettingsPath() {
|
|
65128
|
-
return
|
|
65027
|
+
return path9.join(getClaudeConfigDir(), "settings.json");
|
|
65129
65028
|
}
|
|
65130
65029
|
async function backupClaudeSettings(suffix = ".bak") {
|
|
65131
65030
|
const settingsPath2 = getClaudeSettingsPath();
|
|
@@ -65175,7 +65074,7 @@ async function loadClaudeSettings(options = {}) {
|
|
|
65175
65074
|
}
|
|
65176
65075
|
async function saveClaudeSettings(settings) {
|
|
65177
65076
|
const settingsPath2 = getClaudeSettingsPath();
|
|
65178
|
-
const dir =
|
|
65077
|
+
const dir = path9.dirname(settingsPath2);
|
|
65179
65078
|
await backupClaudeSettings();
|
|
65180
65079
|
await ensureDir(dir);
|
|
65181
65080
|
await writeFile2(settingsPath2, JSON.stringify(settings, null, 2), "utf-8");
|
|
@@ -65193,7 +65092,7 @@ async function isInstalled() {
|
|
|
65193
65092
|
function isBunxAvailable() {
|
|
65194
65093
|
try {
|
|
65195
65094
|
const command = process.platform === "win32" ? "where bunx" : "which bunx";
|
|
65196
|
-
|
|
65095
|
+
execSync5(command, { stdio: "ignore" });
|
|
65197
65096
|
return true;
|
|
65198
65097
|
} catch {
|
|
65199
65098
|
return false;
|
|
@@ -65201,7 +65100,7 @@ function isBunxAvailable() {
|
|
|
65201
65100
|
}
|
|
65202
65101
|
function getClaudeCodeVersion() {
|
|
65203
65102
|
try {
|
|
65204
|
-
const output =
|
|
65103
|
+
const output = execSync5("claude --version", { encoding: "utf-8", stdio: ["pipe", "pipe", "ignore"], timeout: 5000 }).trim();
|
|
65205
65104
|
const match = /^(\d+\.\d+\.\d+)/.exec(output);
|
|
65206
65105
|
return match?.[1] ?? null;
|
|
65207
65106
|
} catch {
|
|
@@ -66012,10 +65911,10 @@ function openExternalUrl(url2) {
|
|
|
66012
65911
|
}
|
|
66013
65912
|
|
|
66014
65913
|
// src/utils/powerline.ts
|
|
66015
|
-
import { execSync as
|
|
65914
|
+
import { execSync as execSync6 } from "child_process";
|
|
66016
65915
|
import * as fs12 from "fs";
|
|
66017
65916
|
import * as os11 from "os";
|
|
66018
|
-
import * as
|
|
65917
|
+
import * as path10 from "path";
|
|
66019
65918
|
var fontsInstalledThisSession = false;
|
|
66020
65919
|
function checkPowerlineFonts() {
|
|
66021
65920
|
if (process.env.DEBUG_FONT_INSTALL === "1" && !fontsInstalledThisSession) {
|
|
@@ -66035,20 +65934,20 @@ function checkPowerlineFonts() {
|
|
|
66035
65934
|
let fontPaths = [];
|
|
66036
65935
|
if (platform4 === "darwin") {
|
|
66037
65936
|
fontPaths = [
|
|
66038
|
-
|
|
65937
|
+
path10.join(os11.homedir(), "Library", "Fonts"),
|
|
66039
65938
|
"/Library/Fonts",
|
|
66040
65939
|
"/System/Library/Fonts"
|
|
66041
65940
|
];
|
|
66042
65941
|
} else if (platform4 === "linux") {
|
|
66043
65942
|
fontPaths = [
|
|
66044
|
-
|
|
66045
|
-
|
|
65943
|
+
path10.join(os11.homedir(), ".local", "share", "fonts"),
|
|
65944
|
+
path10.join(os11.homedir(), ".fonts"),
|
|
66046
65945
|
"/usr/share/fonts",
|
|
66047
65946
|
"/usr/local/share/fonts"
|
|
66048
65947
|
];
|
|
66049
65948
|
} else if (platform4 === "win32") {
|
|
66050
65949
|
fontPaths = [
|
|
66051
|
-
|
|
65950
|
+
path10.join(os11.homedir(), "AppData", "Local", "Microsoft", "Windows", "Fonts"),
|
|
66052
65951
|
"C:\\Windows\\Fonts"
|
|
66053
65952
|
];
|
|
66054
65953
|
}
|
|
@@ -66127,11 +66026,11 @@ async function installPowerlineFonts() {
|
|
|
66127
66026
|
const platform4 = os11.platform();
|
|
66128
66027
|
let fontDir;
|
|
66129
66028
|
if (platform4 === "darwin") {
|
|
66130
|
-
fontDir =
|
|
66029
|
+
fontDir = path10.join(os11.homedir(), "Library", "Fonts");
|
|
66131
66030
|
} else if (platform4 === "linux") {
|
|
66132
|
-
fontDir =
|
|
66031
|
+
fontDir = path10.join(os11.homedir(), ".local", "share", "fonts");
|
|
66133
66032
|
} else if (platform4 === "win32") {
|
|
66134
|
-
fontDir =
|
|
66033
|
+
fontDir = path10.join(os11.homedir(), "AppData", "Local", "Microsoft", "Windows", "Fonts");
|
|
66135
66034
|
} else {
|
|
66136
66035
|
return {
|
|
66137
66036
|
success: false,
|
|
@@ -66141,27 +66040,27 @@ async function installPowerlineFonts() {
|
|
|
66141
66040
|
if (!fs12.existsSync(fontDir)) {
|
|
66142
66041
|
fs12.mkdirSync(fontDir, { recursive: true });
|
|
66143
66042
|
}
|
|
66144
|
-
const tempDir =
|
|
66043
|
+
const tempDir = path10.join(os11.tmpdir(), `ccstatusline-powerline-fonts-${Date.now()}`);
|
|
66145
66044
|
try {
|
|
66146
66045
|
if (fs12.existsSync(tempDir)) {
|
|
66147
66046
|
fs12.rmSync(tempDir, { recursive: true, force: true });
|
|
66148
66047
|
}
|
|
66149
|
-
|
|
66048
|
+
execSync6(`git clone --depth=1 https://github.com/powerline/fonts.git "${tempDir}"`, {
|
|
66150
66049
|
stdio: "pipe",
|
|
66151
66050
|
encoding: "utf8"
|
|
66152
66051
|
});
|
|
66153
66052
|
if (platform4 === "darwin" || platform4 === "linux") {
|
|
66154
|
-
const installScript =
|
|
66053
|
+
const installScript = path10.join(tempDir, "install.sh");
|
|
66155
66054
|
if (fs12.existsSync(installScript)) {
|
|
66156
66055
|
fs12.chmodSync(installScript, 493);
|
|
66157
|
-
|
|
66056
|
+
execSync6(`cd "${tempDir}" && ./install.sh`, {
|
|
66158
66057
|
stdio: "pipe",
|
|
66159
66058
|
encoding: "utf8",
|
|
66160
66059
|
shell: "/bin/bash"
|
|
66161
66060
|
});
|
|
66162
66061
|
if (platform4 === "linux") {
|
|
66163
66062
|
try {
|
|
66164
|
-
|
|
66063
|
+
execSync6("fc-cache -f -v", {
|
|
66165
66064
|
stdio: "pipe",
|
|
66166
66065
|
encoding: "utf8"
|
|
66167
66066
|
});
|
|
@@ -66181,9 +66080,9 @@ async function installPowerlineFonts() {
|
|
|
66181
66080
|
let findFontFiles = function(dir) {
|
|
66182
66081
|
const files = fs12.readdirSync(dir);
|
|
66183
66082
|
for (const file2 of files) {
|
|
66184
|
-
const filePath =
|
|
66185
|
-
const
|
|
66186
|
-
if (
|
|
66083
|
+
const filePath = path10.join(dir, file2);
|
|
66084
|
+
const stat2 = fs12.statSync(filePath);
|
|
66085
|
+
if (stat2.isDirectory() && !file2.startsWith(".")) {
|
|
66187
66086
|
findFontFiles(filePath);
|
|
66188
66087
|
} else if (file2.endsWith(".ttf") || file2.endsWith(".otf")) {
|
|
66189
66088
|
if (filePath.toLowerCase().includes("powerline")) {
|
|
@@ -66196,8 +66095,8 @@ async function installPowerlineFonts() {
|
|
|
66196
66095
|
findFontFiles(tempDir);
|
|
66197
66096
|
let installedCount = 0;
|
|
66198
66097
|
for (const fontFile of fontFiles) {
|
|
66199
|
-
const fileName =
|
|
66200
|
-
const destPath =
|
|
66098
|
+
const fileName = path10.basename(fontFile);
|
|
66099
|
+
const destPath = path10.join(fontDir, fileName);
|
|
66201
66100
|
try {
|
|
66202
66101
|
fs12.copyFileSync(fontFile, destPath);
|
|
66203
66102
|
installedCount++;
|
|
@@ -71430,56 +71329,7 @@ var StatusJSONSchema = exports_external.looseObject({
|
|
|
71430
71329
|
// src/ccstatusline.ts
|
|
71431
71330
|
init_ansi();
|
|
71432
71331
|
init_colors();
|
|
71433
|
-
init_config();
|
|
71434
|
-
init_jsonl();
|
|
71435
|
-
await init_renderer2();
|
|
71436
71332
|
|
|
71437
|
-
// src/utils/skills.ts
|
|
71438
|
-
import * as fs13 from "fs";
|
|
71439
|
-
import * as os13 from "os";
|
|
71440
|
-
import * as path12 from "path";
|
|
71441
|
-
var EMPTY = { totalInvocations: 0, uniqueSkills: [], lastSkill: null };
|
|
71442
|
-
function getSkillsDir() {
|
|
71443
|
-
return path12.join(os13.homedir(), ".cache", "ccstatusline", "skills");
|
|
71444
|
-
}
|
|
71445
|
-
function getSkillsFilePath(sessionId) {
|
|
71446
|
-
return path12.join(getSkillsDir(), `skills-${sessionId}.jsonl`);
|
|
71447
|
-
}
|
|
71448
|
-
function getSkillsMetrics(sessionId) {
|
|
71449
|
-
const filePath = getSkillsFilePath(sessionId);
|
|
71450
|
-
if (!fs13.existsSync(filePath)) {
|
|
71451
|
-
return EMPTY;
|
|
71452
|
-
}
|
|
71453
|
-
try {
|
|
71454
|
-
const invocations = fs13.readFileSync(filePath, "utf-8").trim().split(`
|
|
71455
|
-
`).filter((line) => line.trim()).map((line) => {
|
|
71456
|
-
try {
|
|
71457
|
-
return JSON.parse(line);
|
|
71458
|
-
} catch {
|
|
71459
|
-
return null;
|
|
71460
|
-
}
|
|
71461
|
-
}).filter((e) => e !== null && typeof e.skill === "string" && typeof e.session_id === "string");
|
|
71462
|
-
if (invocations.length === 0) {
|
|
71463
|
-
return EMPTY;
|
|
71464
|
-
}
|
|
71465
|
-
const uniqueSkills = [];
|
|
71466
|
-
const seenSkills = new Set;
|
|
71467
|
-
for (let i = invocations.length - 1;i >= 0; i--) {
|
|
71468
|
-
const skill = invocations[i]?.skill;
|
|
71469
|
-
if (skill && !seenSkills.has(skill)) {
|
|
71470
|
-
seenSkills.add(skill);
|
|
71471
|
-
uniqueSkills.push(skill);
|
|
71472
|
-
}
|
|
71473
|
-
}
|
|
71474
|
-
return {
|
|
71475
|
-
totalInvocations: invocations.length,
|
|
71476
|
-
uniqueSkills,
|
|
71477
|
-
lastSkill: invocations[invocations.length - 1]?.skill ?? null
|
|
71478
|
-
};
|
|
71479
|
-
} catch {
|
|
71480
|
-
return EMPTY;
|
|
71481
|
-
}
|
|
71482
|
-
}
|
|
71483
71333
|
// src/utils/compact-renderer.ts
|
|
71484
71334
|
init_source();
|
|
71485
71335
|
init_ColorLevel();
|
|
@@ -71541,11 +71391,63 @@ function renderCompactOutput(preRenderedLines, settings, maxWidth) {
|
|
|
71541
71391
|
}
|
|
71542
71392
|
}
|
|
71543
71393
|
|
|
71394
|
+
// src/ccstatusline.ts
|
|
71395
|
+
init_config();
|
|
71396
|
+
init_jsonl();
|
|
71397
|
+
await init_renderer2();
|
|
71398
|
+
|
|
71399
|
+
// src/utils/skills.ts
|
|
71400
|
+
import * as fs13 from "fs";
|
|
71401
|
+
import * as os13 from "os";
|
|
71402
|
+
import * as path11 from "path";
|
|
71403
|
+
var EMPTY = { totalInvocations: 0, uniqueSkills: [], lastSkill: null };
|
|
71404
|
+
function getSkillsDir() {
|
|
71405
|
+
return path11.join(os13.homedir(), ".cache", "ccstatusline", "skills");
|
|
71406
|
+
}
|
|
71407
|
+
function getSkillsFilePath(sessionId) {
|
|
71408
|
+
return path11.join(getSkillsDir(), `skills-${sessionId}.jsonl`);
|
|
71409
|
+
}
|
|
71410
|
+
function getSkillsMetrics(sessionId) {
|
|
71411
|
+
const filePath = getSkillsFilePath(sessionId);
|
|
71412
|
+
if (!fs13.existsSync(filePath)) {
|
|
71413
|
+
return EMPTY;
|
|
71414
|
+
}
|
|
71415
|
+
try {
|
|
71416
|
+
const invocations = fs13.readFileSync(filePath, "utf-8").trim().split(`
|
|
71417
|
+
`).filter((line) => line.trim()).map((line) => {
|
|
71418
|
+
try {
|
|
71419
|
+
return JSON.parse(line);
|
|
71420
|
+
} catch {
|
|
71421
|
+
return null;
|
|
71422
|
+
}
|
|
71423
|
+
}).filter((e) => e !== null && typeof e.skill === "string" && typeof e.session_id === "string");
|
|
71424
|
+
if (invocations.length === 0) {
|
|
71425
|
+
return EMPTY;
|
|
71426
|
+
}
|
|
71427
|
+
const uniqueSkills = [];
|
|
71428
|
+
const seenSkills = new Set;
|
|
71429
|
+
for (let i = invocations.length - 1;i >= 0; i--) {
|
|
71430
|
+
const skill = invocations[i]?.skill;
|
|
71431
|
+
if (skill && !seenSkills.has(skill)) {
|
|
71432
|
+
seenSkills.add(skill);
|
|
71433
|
+
uniqueSkills.push(skill);
|
|
71434
|
+
}
|
|
71435
|
+
}
|
|
71436
|
+
return {
|
|
71437
|
+
totalInvocations: invocations.length,
|
|
71438
|
+
uniqueSkills,
|
|
71439
|
+
lastSkill: invocations[invocations.length - 1]?.skill ?? null
|
|
71440
|
+
};
|
|
71441
|
+
} catch {
|
|
71442
|
+
return EMPTY;
|
|
71443
|
+
}
|
|
71444
|
+
}
|
|
71445
|
+
|
|
71544
71446
|
// src/ccstatusline.ts
|
|
71545
71447
|
init_terminal();
|
|
71546
71448
|
|
|
71547
71449
|
// src/utils/usage-prefetch.ts
|
|
71548
|
-
|
|
71450
|
+
init_resolver();
|
|
71549
71451
|
var USAGE_WIDGET_TYPES = new Set([
|
|
71550
71452
|
"session-usage",
|
|
71551
71453
|
"weekly-usage",
|
|
@@ -71586,17 +71488,20 @@ async function prefetchUsageDataIfNeeded(lines, data) {
|
|
|
71586
71488
|
if (!hasUsageDependentWidgets(lines)) {
|
|
71587
71489
|
return null;
|
|
71588
71490
|
}
|
|
71491
|
+
const model = data?.model;
|
|
71492
|
+
const modelId = (typeof model === "string" ? model : model?.id) ?? "";
|
|
71493
|
+
const provider = resolveProvider(modelId);
|
|
71589
71494
|
const rateLimitsData = extractUsageDataFromRateLimits(data?.rate_limits);
|
|
71590
71495
|
if (hasCompleteRateLimitsUsageData(rateLimitsData)) {
|
|
71591
71496
|
if (hasExtraUsageDependentWidgets(lines)) {
|
|
71592
|
-
const apiData = await
|
|
71497
|
+
const apiData = await provider.fetchUsage();
|
|
71593
71498
|
if (apiData.error === undefined) {
|
|
71594
71499
|
return { ...rateLimitsData, extraUsageEnabled: apiData.extraUsageEnabled, extraUsageLimit: apiData.extraUsageLimit, extraUsageUsed: apiData.extraUsageUsed, extraUsageUtilization: apiData.extraUsageUtilization };
|
|
71595
71500
|
}
|
|
71596
71501
|
}
|
|
71597
71502
|
return rateLimitsData;
|
|
71598
71503
|
}
|
|
71599
|
-
return
|
|
71504
|
+
return provider.fetchUsage();
|
|
71600
71505
|
}
|
|
71601
71506
|
|
|
71602
71507
|
// src/ccstatusline.ts
|
|
@@ -71640,8 +71545,8 @@ async function ensureWindowsUtf8CodePage() {
|
|
|
71640
71545
|
return;
|
|
71641
71546
|
}
|
|
71642
71547
|
try {
|
|
71643
|
-
const { execFileSync:
|
|
71644
|
-
|
|
71548
|
+
const { execFileSync: execFileSync4 } = await import("child_process");
|
|
71549
|
+
execFileSync4("chcp.com", ["65001"], { stdio: "ignore" });
|
|
71645
71550
|
} catch {}
|
|
71646
71551
|
}
|
|
71647
71552
|
async function renderMultipleLines(data) {
|
|
@@ -71787,8 +71692,8 @@ async function handleHook() {
|
|
|
71787
71692
|
}
|
|
71788
71693
|
const filePath = getSkillsFilePath(sessionId);
|
|
71789
71694
|
const fs14 = await import("fs");
|
|
71790
|
-
const
|
|
71791
|
-
fs14.mkdirSync(
|
|
71695
|
+
const path12 = await import("path");
|
|
71696
|
+
fs14.mkdirSync(path12.dirname(filePath), { recursive: true });
|
|
71792
71697
|
const entry = JSON.stringify({
|
|
71793
71698
|
timestamp: new Date().toISOString(),
|
|
71794
71699
|
session_id: sessionId,
|