ccstatusline 2.2.4 → 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/ccstatusline.js +561 -259
- package/package.json +6 -5
package/dist/ccstatusline.js
CHANGED
|
@@ -13487,89 +13487,6 @@ var init_strip_ansi2 = __esm(() => {
|
|
|
13487
13487
|
regex2 = ansiRegex2();
|
|
13488
13488
|
});
|
|
13489
13489
|
|
|
13490
|
-
// node_modules/wrap-ansi/node_modules/string-width/node_modules/get-east-asian-width/lookup.js
|
|
13491
|
-
function isAmbiguous2(x) {
|
|
13492
|
-
return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
|
|
13493
|
-
}
|
|
13494
|
-
function isFullWidth2(x) {
|
|
13495
|
-
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
13496
|
-
}
|
|
13497
|
-
function isWide2(x) {
|
|
13498
|
-
return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
13499
|
-
}
|
|
13500
|
-
var init_lookup2 = () => {};
|
|
13501
|
-
|
|
13502
|
-
// node_modules/wrap-ansi/node_modules/string-width/node_modules/get-east-asian-width/index.js
|
|
13503
|
-
function validate2(codePoint) {
|
|
13504
|
-
if (!Number.isSafeInteger(codePoint)) {
|
|
13505
|
-
throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
13506
|
-
}
|
|
13507
|
-
}
|
|
13508
|
-
function eastAsianWidth2(codePoint, { ambiguousAsWide = false } = {}) {
|
|
13509
|
-
validate2(codePoint);
|
|
13510
|
-
if (isFullWidth2(codePoint) || isWide2(codePoint) || ambiguousAsWide && isAmbiguous2(codePoint)) {
|
|
13511
|
-
return 2;
|
|
13512
|
-
}
|
|
13513
|
-
return 1;
|
|
13514
|
-
}
|
|
13515
|
-
var init_get_east_asian_width2 = __esm(() => {
|
|
13516
|
-
init_lookup2();
|
|
13517
|
-
});
|
|
13518
|
-
|
|
13519
|
-
// node_modules/wrap-ansi/node_modules/string-width/index.js
|
|
13520
|
-
function stringWidth2(string, options = {}) {
|
|
13521
|
-
if (typeof string !== "string" || string.length === 0) {
|
|
13522
|
-
return 0;
|
|
13523
|
-
}
|
|
13524
|
-
const {
|
|
13525
|
-
ambiguousIsNarrow = true,
|
|
13526
|
-
countAnsiEscapeCodes = false
|
|
13527
|
-
} = options;
|
|
13528
|
-
if (!countAnsiEscapeCodes) {
|
|
13529
|
-
string = stripAnsi2(string);
|
|
13530
|
-
}
|
|
13531
|
-
if (string.length === 0) {
|
|
13532
|
-
return 0;
|
|
13533
|
-
}
|
|
13534
|
-
let width = 0;
|
|
13535
|
-
const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
|
|
13536
|
-
for (const { segment: character } of segmenter2.segment(string)) {
|
|
13537
|
-
const codePoint = character.codePointAt(0);
|
|
13538
|
-
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
|
|
13539
|
-
continue;
|
|
13540
|
-
}
|
|
13541
|
-
if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
|
|
13542
|
-
continue;
|
|
13543
|
-
}
|
|
13544
|
-
if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
|
|
13545
|
-
continue;
|
|
13546
|
-
}
|
|
13547
|
-
if (codePoint >= 55296 && codePoint <= 57343) {
|
|
13548
|
-
continue;
|
|
13549
|
-
}
|
|
13550
|
-
if (codePoint >= 65024 && codePoint <= 65039) {
|
|
13551
|
-
continue;
|
|
13552
|
-
}
|
|
13553
|
-
if (defaultIgnorableCodePointRegex2.test(character)) {
|
|
13554
|
-
continue;
|
|
13555
|
-
}
|
|
13556
|
-
if (import_emoji_regex2.default().test(character)) {
|
|
13557
|
-
width += 2;
|
|
13558
|
-
continue;
|
|
13559
|
-
}
|
|
13560
|
-
width += eastAsianWidth2(codePoint, eastAsianWidthOptions);
|
|
13561
|
-
}
|
|
13562
|
-
return width;
|
|
13563
|
-
}
|
|
13564
|
-
var import_emoji_regex2, segmenter2, defaultIgnorableCodePointRegex2;
|
|
13565
|
-
var init_string_width2 = __esm(() => {
|
|
13566
|
-
init_strip_ansi2();
|
|
13567
|
-
init_get_east_asian_width2();
|
|
13568
|
-
import_emoji_regex2 = __toESM(require_emoji_regex(), 1);
|
|
13569
|
-
segmenter2 = new Intl.Segmenter;
|
|
13570
|
-
defaultIgnorableCodePointRegex2 = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
13571
|
-
});
|
|
13572
|
-
|
|
13573
13490
|
// node_modules/wrap-ansi/node_modules/ansi-styles/index.js
|
|
13574
13491
|
function assembleStyles2() {
|
|
13575
13492
|
const codes = new Map;
|
|
@@ -13754,13 +13671,13 @@ function wrapAnsi(string, columns, options) {
|
|
|
13754
13671
|
`).map((line) => exec(line, columns, options)).join(`
|
|
13755
13672
|
`);
|
|
13756
13673
|
}
|
|
13757
|
-
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) =>
|
|
13674
|
+
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) => {
|
|
13758
13675
|
const characters = [...word];
|
|
13759
13676
|
let isInsideEscape = false;
|
|
13760
13677
|
let isInsideLinkEscape = false;
|
|
13761
|
-
let visible =
|
|
13678
|
+
let visible = stringWidth(stripAnsi2(rows.at(-1)));
|
|
13762
13679
|
for (const [index, character] of characters.entries()) {
|
|
13763
|
-
const characterLength =
|
|
13680
|
+
const characterLength = stringWidth(character);
|
|
13764
13681
|
if (visible + characterLength <= columns) {
|
|
13765
13682
|
rows[rows.length - 1] += character;
|
|
13766
13683
|
} else {
|
|
@@ -13796,7 +13713,7 @@ var ESCAPES, END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_CSI = "[", ANSI_OSC
|
|
|
13796
13713
|
const words2 = string.split(" ");
|
|
13797
13714
|
let last2 = words2.length;
|
|
13798
13715
|
while (last2 > 0) {
|
|
13799
|
-
if (
|
|
13716
|
+
if (stringWidth(words2[last2 - 1]) > 0) {
|
|
13800
13717
|
break;
|
|
13801
13718
|
}
|
|
13802
13719
|
last2--;
|
|
@@ -13818,7 +13735,7 @@ var ESCAPES, END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_CSI = "[", ANSI_OSC
|
|
|
13818
13735
|
if (options.trim !== false) {
|
|
13819
13736
|
rows[rows.length - 1] = rows.at(-1).trimStart();
|
|
13820
13737
|
}
|
|
13821
|
-
let rowLength =
|
|
13738
|
+
let rowLength = stringWidth(rows.at(-1));
|
|
13822
13739
|
if (index !== 0) {
|
|
13823
13740
|
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
13824
13741
|
rows.push("");
|
|
@@ -13893,7 +13810,7 @@ var ESCAPES, END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_CSI = "[", ANSI_OSC
|
|
|
13893
13810
|
return returnValue;
|
|
13894
13811
|
};
|
|
13895
13812
|
var init_wrap_ansi = __esm(() => {
|
|
13896
|
-
|
|
13813
|
+
init_string_width();
|
|
13897
13814
|
init_strip_ansi2();
|
|
13898
13815
|
init_ansi_styles2();
|
|
13899
13816
|
ESCAPES = new Set([
|
|
@@ -20491,7 +20408,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
20491
20408
|
}
|
|
20492
20409
|
return 0;
|
|
20493
20410
|
};
|
|
20494
|
-
var
|
|
20411
|
+
var validate2 = function validate3(version) {
|
|
20495
20412
|
return typeof version === "string" && /^[v\d]/.test(version) && semver.test(version);
|
|
20496
20413
|
};
|
|
20497
20414
|
var compare = function compare2(v1, v2, operator) {
|
|
@@ -35007,12 +34924,12 @@ function findWideFastPathRange(ranges) {
|
|
|
35007
34924
|
}
|
|
35008
34925
|
return [fastPathStart, fastPathEnd];
|
|
35009
34926
|
}
|
|
35010
|
-
var minimumAmbiguousCodePoint, maximumAmbiguousCodePoint, minimumFullWidthCodePoint, maximumFullWidthCodePoint, minimumHalfWidthCodePoint, maximumHalfWidthCodePoint, minimumNarrowCodePoint, maximumNarrowCodePoint, minimumWideCodePoint, maximumWideCodePoint, commonCjkCodePoint = 19968, wideFastPathStart, wideFastPathEnd,
|
|
34927
|
+
var minimumAmbiguousCodePoint, maximumAmbiguousCodePoint, minimumFullWidthCodePoint, maximumFullWidthCodePoint, minimumHalfWidthCodePoint, maximumHalfWidthCodePoint, minimumNarrowCodePoint, maximumNarrowCodePoint, minimumWideCodePoint, maximumWideCodePoint, commonCjkCodePoint = 19968, wideFastPathStart, wideFastPathEnd, isFullWidth2 = (codePoint) => {
|
|
35011
34928
|
if (codePoint < minimumFullWidthCodePoint || codePoint > maximumFullWidthCodePoint) {
|
|
35012
34929
|
return false;
|
|
35013
34930
|
}
|
|
35014
34931
|
return isInRange(fullwidthRanges, codePoint);
|
|
35015
|
-
},
|
|
34932
|
+
}, isWide2 = (codePoint) => {
|
|
35016
34933
|
if (codePoint >= wideFastPathStart && codePoint <= wideFastPathEnd) {
|
|
35017
34934
|
return true;
|
|
35018
34935
|
}
|
|
@@ -35021,7 +34938,7 @@ var minimumAmbiguousCodePoint, maximumAmbiguousCodePoint, minimumFullWidthCodePo
|
|
|
35021
34938
|
}
|
|
35022
34939
|
return isInRange(wideRanges, codePoint);
|
|
35023
34940
|
};
|
|
35024
|
-
var
|
|
34941
|
+
var init_lookup2 = __esm(() => {
|
|
35025
34942
|
init_lookup_data();
|
|
35026
34943
|
minimumAmbiguousCodePoint = ambiguousRanges[0];
|
|
35027
34944
|
maximumAmbiguousCodePoint = ambiguousRanges.at(-1);
|
|
@@ -35037,8 +34954,8 @@ var init_lookup3 = __esm(() => {
|
|
|
35037
34954
|
});
|
|
35038
34955
|
|
|
35039
34956
|
// node_modules/slice-ansi/node_modules/is-fullwidth-code-point/node_modules/get-east-asian-width/index.js
|
|
35040
|
-
var
|
|
35041
|
-
|
|
34957
|
+
var init_get_east_asian_width2 = __esm(() => {
|
|
34958
|
+
init_lookup2();
|
|
35042
34959
|
});
|
|
35043
34960
|
|
|
35044
34961
|
// node_modules/slice-ansi/node_modules/is-fullwidth-code-point/index.js
|
|
@@ -35046,10 +34963,10 @@ function isFullwidthCodePoint2(codePoint) {
|
|
|
35046
34963
|
if (!Number.isInteger(codePoint)) {
|
|
35047
34964
|
return false;
|
|
35048
34965
|
}
|
|
35049
|
-
return
|
|
34966
|
+
return isFullWidth2(codePoint) || isWide2(codePoint);
|
|
35050
34967
|
}
|
|
35051
34968
|
var init_is_fullwidth_code_point = __esm(() => {
|
|
35052
|
-
|
|
34969
|
+
init_get_east_asian_width2();
|
|
35053
34970
|
});
|
|
35054
34971
|
|
|
35055
34972
|
// node_modules/slice-ansi/index.js
|
|
@@ -35108,15 +35025,15 @@ function tokenize(string, endCharacter = Number.POSITIVE_INFINITY) {
|
|
|
35108
35025
|
continue;
|
|
35109
35026
|
}
|
|
35110
35027
|
}
|
|
35111
|
-
const
|
|
35028
|
+
const isFullWidth3 = isFullwidthCodePoint2(codePoint);
|
|
35112
35029
|
const character = String.fromCodePoint(codePoint);
|
|
35113
35030
|
returnValue.push({
|
|
35114
35031
|
type: "character",
|
|
35115
35032
|
value: character,
|
|
35116
|
-
isFullWidth:
|
|
35033
|
+
isFullWidth: isFullWidth3
|
|
35117
35034
|
});
|
|
35118
35035
|
index += character.length;
|
|
35119
|
-
visibleCount +=
|
|
35036
|
+
visibleCount += isFullWidth3 ? 2 : character.length;
|
|
35120
35037
|
if (visibleCount >= endCharacter) {
|
|
35121
35038
|
break;
|
|
35122
35039
|
}
|
|
@@ -37479,7 +37396,7 @@ var require_factoryWithTypeCheckers = __commonJS((exports, module) => {
|
|
|
37479
37396
|
this.stack = "";
|
|
37480
37397
|
}
|
|
37481
37398
|
PropTypeError.prototype = Error.prototype;
|
|
37482
|
-
function createChainableTypeChecker(
|
|
37399
|
+
function createChainableTypeChecker(validate2) {
|
|
37483
37400
|
if (true) {
|
|
37484
37401
|
var manualPropTypeCallCache = {};
|
|
37485
37402
|
var manualPropTypeWarningCount = 0;
|
|
@@ -37510,7 +37427,7 @@ var require_factoryWithTypeCheckers = __commonJS((exports, module) => {
|
|
|
37510
37427
|
}
|
|
37511
37428
|
return null;
|
|
37512
37429
|
} else {
|
|
37513
|
-
return
|
|
37430
|
+
return validate2(props, propName, componentName, location, propFullName);
|
|
37514
37431
|
}
|
|
37515
37432
|
}
|
|
37516
37433
|
var chainedCheckType = checkType.bind(null, false);
|
|
@@ -37518,7 +37435,7 @@ var require_factoryWithTypeCheckers = __commonJS((exports, module) => {
|
|
|
37518
37435
|
return chainedCheckType;
|
|
37519
37436
|
}
|
|
37520
37437
|
function createPrimitiveTypeChecker(expectedType) {
|
|
37521
|
-
function
|
|
37438
|
+
function validate2(props, propName, componentName, location, propFullName, secret) {
|
|
37522
37439
|
var propValue = props[propName];
|
|
37523
37440
|
var propType = getPropType(propValue);
|
|
37524
37441
|
if (propType !== expectedType) {
|
|
@@ -37527,13 +37444,13 @@ var require_factoryWithTypeCheckers = __commonJS((exports, module) => {
|
|
|
37527
37444
|
}
|
|
37528
37445
|
return null;
|
|
37529
37446
|
}
|
|
37530
|
-
return createChainableTypeChecker(
|
|
37447
|
+
return createChainableTypeChecker(validate2);
|
|
37531
37448
|
}
|
|
37532
37449
|
function createAnyTypeChecker() {
|
|
37533
37450
|
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
37534
37451
|
}
|
|
37535
37452
|
function createArrayOfTypeChecker(typeChecker) {
|
|
37536
|
-
function
|
|
37453
|
+
function validate2(props, propName, componentName, location, propFullName) {
|
|
37537
37454
|
if (typeof typeChecker !== "function") {
|
|
37538
37455
|
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
|
|
37539
37456
|
}
|
|
@@ -37550,10 +37467,10 @@ var require_factoryWithTypeCheckers = __commonJS((exports, module) => {
|
|
|
37550
37467
|
}
|
|
37551
37468
|
return null;
|
|
37552
37469
|
}
|
|
37553
|
-
return createChainableTypeChecker(
|
|
37470
|
+
return createChainableTypeChecker(validate2);
|
|
37554
37471
|
}
|
|
37555
37472
|
function createElementTypeChecker() {
|
|
37556
|
-
function
|
|
37473
|
+
function validate2(props, propName, componentName, location, propFullName) {
|
|
37557
37474
|
var propValue = props[propName];
|
|
37558
37475
|
if (!isValidElement(propValue)) {
|
|
37559
37476
|
var propType = getPropType(propValue);
|
|
@@ -37561,10 +37478,10 @@ var require_factoryWithTypeCheckers = __commonJS((exports, module) => {
|
|
|
37561
37478
|
}
|
|
37562
37479
|
return null;
|
|
37563
37480
|
}
|
|
37564
|
-
return createChainableTypeChecker(
|
|
37481
|
+
return createChainableTypeChecker(validate2);
|
|
37565
37482
|
}
|
|
37566
37483
|
function createElementTypeTypeChecker() {
|
|
37567
|
-
function
|
|
37484
|
+
function validate2(props, propName, componentName, location, propFullName) {
|
|
37568
37485
|
var propValue = props[propName];
|
|
37569
37486
|
if (!ReactIs.isValidElementType(propValue)) {
|
|
37570
37487
|
var propType = getPropType(propValue);
|
|
@@ -37572,10 +37489,10 @@ var require_factoryWithTypeCheckers = __commonJS((exports, module) => {
|
|
|
37572
37489
|
}
|
|
37573
37490
|
return null;
|
|
37574
37491
|
}
|
|
37575
|
-
return createChainableTypeChecker(
|
|
37492
|
+
return createChainableTypeChecker(validate2);
|
|
37576
37493
|
}
|
|
37577
37494
|
function createInstanceTypeChecker(expectedClass) {
|
|
37578
|
-
function
|
|
37495
|
+
function validate2(props, propName, componentName, location, propFullName) {
|
|
37579
37496
|
if (!(props[propName] instanceof expectedClass)) {
|
|
37580
37497
|
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
37581
37498
|
var actualClassName = getClassName(props[propName]);
|
|
@@ -37583,7 +37500,7 @@ var require_factoryWithTypeCheckers = __commonJS((exports, module) => {
|
|
|
37583
37500
|
}
|
|
37584
37501
|
return null;
|
|
37585
37502
|
}
|
|
37586
|
-
return createChainableTypeChecker(
|
|
37503
|
+
return createChainableTypeChecker(validate2);
|
|
37587
37504
|
}
|
|
37588
37505
|
function createEnumTypeChecker(expectedValues) {
|
|
37589
37506
|
if (!Array.isArray(expectedValues)) {
|
|
@@ -37596,7 +37513,7 @@ var require_factoryWithTypeCheckers = __commonJS((exports, module) => {
|
|
|
37596
37513
|
}
|
|
37597
37514
|
return emptyFunctionThatReturnsNull;
|
|
37598
37515
|
}
|
|
37599
|
-
function
|
|
37516
|
+
function validate2(props, propName, componentName, location, propFullName) {
|
|
37600
37517
|
var propValue = props[propName];
|
|
37601
37518
|
for (var i = 0;i < expectedValues.length; i++) {
|
|
37602
37519
|
if (is(propValue, expectedValues[i])) {
|
|
@@ -37612,10 +37529,10 @@ var require_factoryWithTypeCheckers = __commonJS((exports, module) => {
|
|
|
37612
37529
|
});
|
|
37613
37530
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
|
|
37614
37531
|
}
|
|
37615
|
-
return createChainableTypeChecker(
|
|
37532
|
+
return createChainableTypeChecker(validate2);
|
|
37616
37533
|
}
|
|
37617
37534
|
function createObjectOfTypeChecker(typeChecker) {
|
|
37618
|
-
function
|
|
37535
|
+
function validate2(props, propName, componentName, location, propFullName) {
|
|
37619
37536
|
if (typeof typeChecker !== "function") {
|
|
37620
37537
|
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
|
|
37621
37538
|
}
|
|
@@ -37634,7 +37551,7 @@ var require_factoryWithTypeCheckers = __commonJS((exports, module) => {
|
|
|
37634
37551
|
}
|
|
37635
37552
|
return null;
|
|
37636
37553
|
}
|
|
37637
|
-
return createChainableTypeChecker(
|
|
37554
|
+
return createChainableTypeChecker(validate2);
|
|
37638
37555
|
}
|
|
37639
37556
|
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
37640
37557
|
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
@@ -37648,7 +37565,7 @@ var require_factoryWithTypeCheckers = __commonJS((exports, module) => {
|
|
|
37648
37565
|
return emptyFunctionThatReturnsNull;
|
|
37649
37566
|
}
|
|
37650
37567
|
}
|
|
37651
|
-
function
|
|
37568
|
+
function validate2(props, propName, componentName, location, propFullName) {
|
|
37652
37569
|
var expectedTypes = [];
|
|
37653
37570
|
for (var i2 = 0;i2 < arrayOfTypeCheckers.length; i2++) {
|
|
37654
37571
|
var checker2 = arrayOfTypeCheckers[i2];
|
|
@@ -37663,22 +37580,22 @@ var require_factoryWithTypeCheckers = __commonJS((exports, module) => {
|
|
|
37663
37580
|
var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
|
|
37664
37581
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
|
|
37665
37582
|
}
|
|
37666
|
-
return createChainableTypeChecker(
|
|
37583
|
+
return createChainableTypeChecker(validate2);
|
|
37667
37584
|
}
|
|
37668
37585
|
function createNodeChecker() {
|
|
37669
|
-
function
|
|
37586
|
+
function validate2(props, propName, componentName, location, propFullName) {
|
|
37670
37587
|
if (!isNode2(props[propName])) {
|
|
37671
37588
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
|
|
37672
37589
|
}
|
|
37673
37590
|
return null;
|
|
37674
37591
|
}
|
|
37675
|
-
return createChainableTypeChecker(
|
|
37592
|
+
return createChainableTypeChecker(validate2);
|
|
37676
37593
|
}
|
|
37677
37594
|
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
37678
37595
|
return new PropTypeError((componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; " + "it must be a function, usually from the `prop-types` package, but received `" + type + "`.");
|
|
37679
37596
|
}
|
|
37680
37597
|
function createShapeTypeChecker(shapeTypes) {
|
|
37681
|
-
function
|
|
37598
|
+
function validate2(props, propName, componentName, location, propFullName) {
|
|
37682
37599
|
var propValue = props[propName];
|
|
37683
37600
|
var propType = getPropType(propValue);
|
|
37684
37601
|
if (propType !== "object") {
|
|
@@ -37696,10 +37613,10 @@ var require_factoryWithTypeCheckers = __commonJS((exports, module) => {
|
|
|
37696
37613
|
}
|
|
37697
37614
|
return null;
|
|
37698
37615
|
}
|
|
37699
|
-
return createChainableTypeChecker(
|
|
37616
|
+
return createChainableTypeChecker(validate2);
|
|
37700
37617
|
}
|
|
37701
37618
|
function createStrictShapeTypeChecker(shapeTypes) {
|
|
37702
|
-
function
|
|
37619
|
+
function validate2(props, propName, componentName, location, propFullName) {
|
|
37703
37620
|
var propValue = props[propName];
|
|
37704
37621
|
var propType = getPropType(propValue);
|
|
37705
37622
|
if (propType !== "object") {
|
|
@@ -37723,7 +37640,7 @@ Valid keys: ` + JSON.stringify(Object.keys(shapeTypes), null, " "));
|
|
|
37723
37640
|
}
|
|
37724
37641
|
return null;
|
|
37725
37642
|
}
|
|
37726
|
-
return createChainableTypeChecker(
|
|
37643
|
+
return createChainableTypeChecker(validate2);
|
|
37727
37644
|
}
|
|
37728
37645
|
function isNode2(propValue) {
|
|
37729
37646
|
switch (typeof propValue) {
|
|
@@ -54947,6 +54864,75 @@ function getGitChangeCounts(context) {
|
|
|
54947
54864
|
}
|
|
54948
54865
|
var init_git = () => {};
|
|
54949
54866
|
|
|
54867
|
+
// src/utils/hyperlink.ts
|
|
54868
|
+
function renderOsc8Link(url2, text) {
|
|
54869
|
+
return `\x1B]8;;${url2}\x1B\\${text}\x1B]8;;\x1B\\`;
|
|
54870
|
+
}
|
|
54871
|
+
function parseGitHubRepositoryPath(pathname) {
|
|
54872
|
+
const trimmedPath = pathname.replace(/^\/+|\/+$/g, "").replace(/\.git$/, "");
|
|
54873
|
+
const segments = trimmedPath.split("/").filter(Boolean);
|
|
54874
|
+
if (segments.length !== 2) {
|
|
54875
|
+
return null;
|
|
54876
|
+
}
|
|
54877
|
+
return `${segments[0]}/${segments[1]}`;
|
|
54878
|
+
}
|
|
54879
|
+
function parseGitHubBaseUrl(remoteUrl) {
|
|
54880
|
+
const trimmed = remoteUrl.trim();
|
|
54881
|
+
if (trimmed.length === 0) {
|
|
54882
|
+
return null;
|
|
54883
|
+
}
|
|
54884
|
+
const sshMatch = /^(?:[^@]+@)?github\.com:([^/]+\/[^/]+?)(?:\.git)?\/?$/.exec(trimmed);
|
|
54885
|
+
if (sshMatch?.[1]) {
|
|
54886
|
+
return `https://github.com/${sshMatch[1]}`;
|
|
54887
|
+
}
|
|
54888
|
+
try {
|
|
54889
|
+
const parsedUrl = new URL(trimmed);
|
|
54890
|
+
const supportedProtocols = new Set([
|
|
54891
|
+
"http:",
|
|
54892
|
+
"https:",
|
|
54893
|
+
"ssh:",
|
|
54894
|
+
"git:"
|
|
54895
|
+
]);
|
|
54896
|
+
if (parsedUrl.hostname.toLowerCase() !== "github.com" || !supportedProtocols.has(parsedUrl.protocol)) {
|
|
54897
|
+
return null;
|
|
54898
|
+
}
|
|
54899
|
+
const repoPath = parseGitHubRepositoryPath(parsedUrl.pathname);
|
|
54900
|
+
if (!repoPath) {
|
|
54901
|
+
return null;
|
|
54902
|
+
}
|
|
54903
|
+
return `https://github.com/${repoPath}`;
|
|
54904
|
+
} catch {
|
|
54905
|
+
return null;
|
|
54906
|
+
}
|
|
54907
|
+
}
|
|
54908
|
+
function encodeGitRefForUrlPath(ref) {
|
|
54909
|
+
return ref.split("/").map((segment) => encodeURIComponent(segment)).join("/");
|
|
54910
|
+
}
|
|
54911
|
+
function encodeFilePathForUri(path) {
|
|
54912
|
+
return path.replace(/\\/g, "/").split("/").map((segment) => encodeURIComponent(segment)).join("/");
|
|
54913
|
+
}
|
|
54914
|
+
function buildIdeFileUrl(filePath, ideLinkMode) {
|
|
54915
|
+
const normalizedPath = filePath.replace(/\\/g, "/");
|
|
54916
|
+
const uncMatch = /^\/\/([^/]+)(\/.*)?$/.exec(normalizedPath);
|
|
54917
|
+
if (uncMatch?.[1]) {
|
|
54918
|
+
const encodedPath = encodeFilePathForUri(uncMatch[2] ?? "/");
|
|
54919
|
+
return `${ideLinkMode}://file//${uncMatch[1]}${encodedPath}`;
|
|
54920
|
+
}
|
|
54921
|
+
const driveMatch = /^([A-Za-z]:)(\/.*)?$/.exec(normalizedPath);
|
|
54922
|
+
if (driveMatch?.[1]) {
|
|
54923
|
+
const encodedPath = encodeFilePathForUri(driveMatch[2] ?? "/");
|
|
54924
|
+
return `${ideLinkMode}://file/${driveMatch[1]}${encodedPath}`;
|
|
54925
|
+
}
|
|
54926
|
+
return `${ideLinkMode}://file${encodeFilePathForUri(normalizedPath)}`;
|
|
54927
|
+
}
|
|
54928
|
+
var IDE_LINK_MODES;
|
|
54929
|
+
var init_hyperlink = __esm(() => {
|
|
54930
|
+
IDE_LINK_MODES = [
|
|
54931
|
+
"vscode",
|
|
54932
|
+
"cursor"
|
|
54933
|
+
];
|
|
54934
|
+
});
|
|
54935
|
+
|
|
54950
54936
|
// src/widgets/shared/editor-display.ts
|
|
54951
54937
|
function makeModifierText(modifiers) {
|
|
54952
54938
|
return modifiers.length > 0 ? `(${modifiers.join(", ")})` : undefined;
|
|
@@ -54965,6 +54951,13 @@ function toggleMetadataFlag(item, key) {
|
|
|
54965
54951
|
}
|
|
54966
54952
|
};
|
|
54967
54953
|
}
|
|
54954
|
+
function removeMetadataKeys(item, keys2) {
|
|
54955
|
+
const nextMetadata = Object.fromEntries(Object.entries(item.metadata ?? {}).filter(([key]) => !keys2.includes(key)));
|
|
54956
|
+
return {
|
|
54957
|
+
...item,
|
|
54958
|
+
metadata: Object.keys(nextMetadata).length > 0 ? nextMetadata : undefined
|
|
54959
|
+
};
|
|
54960
|
+
}
|
|
54968
54961
|
|
|
54969
54962
|
// src/widgets/shared/git-no-git.ts
|
|
54970
54963
|
function isHideNoGitEnabled(item) {
|
|
@@ -55006,32 +54999,56 @@ class GitBranchWidget {
|
|
|
55006
54999
|
return "Git";
|
|
55007
55000
|
}
|
|
55008
55001
|
getEditorDisplay(item) {
|
|
55002
|
+
const isLink = isMetadataFlagEnabled(item, LINK_KEY);
|
|
55003
|
+
const modifiers = [];
|
|
55004
|
+
const noGitText = getHideNoGitModifierText(item);
|
|
55005
|
+
if (noGitText)
|
|
55006
|
+
modifiers.push("hide 'no git'");
|
|
55007
|
+
if (isLink)
|
|
55008
|
+
modifiers.push("GitHub link");
|
|
55009
55009
|
return {
|
|
55010
55010
|
displayText: this.getDisplayName(),
|
|
55011
|
-
modifierText:
|
|
55011
|
+
modifierText: makeModifierText(modifiers)
|
|
55012
55012
|
};
|
|
55013
55013
|
}
|
|
55014
55014
|
handleEditorAction(action, item) {
|
|
55015
|
+
if (action === TOGGLE_LINK_ACTION) {
|
|
55016
|
+
return toggleMetadataFlag(item, LINK_KEY);
|
|
55017
|
+
}
|
|
55015
55018
|
return handleToggleNoGitAction(action, item);
|
|
55016
55019
|
}
|
|
55017
55020
|
render(item, context, settings) {
|
|
55018
55021
|
const hideNoGit = isHideNoGitEnabled(item);
|
|
55022
|
+
const isLink = isMetadataFlagEnabled(item, LINK_KEY);
|
|
55019
55023
|
if (context.isPreview) {
|
|
55020
|
-
|
|
55024
|
+
const text = item.rawValue ? "main" : "⎇ main";
|
|
55025
|
+
return isLink ? renderOsc8Link("https://github.com/owner/repo/tree/main", text) : text;
|
|
55021
55026
|
}
|
|
55022
55027
|
if (!isInsideGitWorkTree(context)) {
|
|
55023
55028
|
return hideNoGit ? null : "⎇ no git";
|
|
55024
55029
|
}
|
|
55025
55030
|
const branch = this.getGitBranch(context);
|
|
55026
|
-
if (branch)
|
|
55027
|
-
return
|
|
55028
|
-
|
|
55031
|
+
if (!branch) {
|
|
55032
|
+
return hideNoGit ? null : "⎇ no git";
|
|
55033
|
+
}
|
|
55034
|
+
const displayText = item.rawValue ? branch : `⎇ ${branch}`;
|
|
55035
|
+
if (isLink) {
|
|
55036
|
+
const remoteUrl = runGit("remote get-url origin", context);
|
|
55037
|
+
const baseUrl = remoteUrl ? parseGitHubBaseUrl(remoteUrl) : null;
|
|
55038
|
+
if (baseUrl) {
|
|
55039
|
+
return renderOsc8Link(`${baseUrl}/tree/${encodeGitRefForUrlPath(branch)}`, displayText);
|
|
55040
|
+
}
|
|
55041
|
+
}
|
|
55042
|
+
return displayText;
|
|
55029
55043
|
}
|
|
55030
55044
|
getGitBranch(context) {
|
|
55031
55045
|
return runGit("branch --show-current", context);
|
|
55032
55046
|
}
|
|
55033
55047
|
getCustomKeybinds() {
|
|
55034
|
-
return
|
|
55048
|
+
return [
|
|
55049
|
+
...getHideNoGitKeybinds(),
|
|
55050
|
+
{ key: "l", label: "(l)ink to GitHub", action: TOGGLE_LINK_ACTION }
|
|
55051
|
+
];
|
|
55035
55052
|
}
|
|
55036
55053
|
supportsRawValue() {
|
|
55037
55054
|
return true;
|
|
@@ -55040,8 +55057,10 @@ class GitBranchWidget {
|
|
|
55040
55057
|
return true;
|
|
55041
55058
|
}
|
|
55042
55059
|
}
|
|
55060
|
+
var LINK_KEY = "linkToGitHub", TOGGLE_LINK_ACTION = "toggle-link";
|
|
55043
55061
|
var init_GitBranch = __esm(() => {
|
|
55044
55062
|
init_git();
|
|
55063
|
+
init_hyperlink();
|
|
55045
55064
|
init_git_no_git();
|
|
55046
55065
|
});
|
|
55047
55066
|
|
|
@@ -55207,27 +55226,43 @@ class GitRootDirWidget {
|
|
|
55207
55226
|
return "Git";
|
|
55208
55227
|
}
|
|
55209
55228
|
getEditorDisplay(item) {
|
|
55229
|
+
const ideLinkMode = this.getIdeLinkMode(item);
|
|
55230
|
+
const modifiers = [];
|
|
55231
|
+
const noGitText = getHideNoGitModifierText(item);
|
|
55232
|
+
if (noGitText)
|
|
55233
|
+
modifiers.push("hide 'no git'");
|
|
55234
|
+
if (ideLinkMode)
|
|
55235
|
+
modifiers.push(IDE_LINK_LABELS[ideLinkMode]);
|
|
55210
55236
|
return {
|
|
55211
55237
|
displayText: this.getDisplayName(),
|
|
55212
|
-
modifierText:
|
|
55238
|
+
modifierText: makeModifierText(modifiers)
|
|
55213
55239
|
};
|
|
55214
55240
|
}
|
|
55215
55241
|
handleEditorAction(action, item) {
|
|
55242
|
+
if (action === TOGGLE_LINK_ACTION2) {
|
|
55243
|
+
return this.cycleIdeLinkMode(item);
|
|
55244
|
+
}
|
|
55216
55245
|
return handleToggleNoGitAction(action, item);
|
|
55217
55246
|
}
|
|
55218
55247
|
render(item, context, _settings) {
|
|
55219
55248
|
const hideNoGit = isHideNoGitEnabled(item);
|
|
55249
|
+
const ideLinkMode = this.getIdeLinkMode(item);
|
|
55220
55250
|
if (context.isPreview) {
|
|
55221
|
-
|
|
55251
|
+
const name2 = "my-repo";
|
|
55252
|
+
return ideLinkMode ? renderOsc8Link(buildIdeFileUrl("/Users/example/my-repo", ideLinkMode), name2) : name2;
|
|
55222
55253
|
}
|
|
55223
55254
|
if (!isInsideGitWorkTree(context)) {
|
|
55224
55255
|
return hideNoGit ? null : "no git";
|
|
55225
55256
|
}
|
|
55226
55257
|
const rootDir = this.getGitRootDir(context);
|
|
55227
|
-
if (rootDir) {
|
|
55228
|
-
return
|
|
55258
|
+
if (!rootDir) {
|
|
55259
|
+
return hideNoGit ? null : "no git";
|
|
55229
55260
|
}
|
|
55230
|
-
|
|
55261
|
+
const name = this.getRootDirName(rootDir);
|
|
55262
|
+
if (ideLinkMode) {
|
|
55263
|
+
return renderOsc8Link(buildIdeFileUrl(rootDir, ideLinkMode), name);
|
|
55264
|
+
}
|
|
55265
|
+
return name;
|
|
55231
55266
|
}
|
|
55232
55267
|
getGitRootDir(context) {
|
|
55233
55268
|
return runGit("rev-parse --show-toplevel", context);
|
|
@@ -55240,7 +55275,10 @@ class GitRootDirWidget {
|
|
|
55240
55275
|
return lastPart && lastPart.length > 0 ? lastPart : normalizedRootDir;
|
|
55241
55276
|
}
|
|
55242
55277
|
getCustomKeybinds() {
|
|
55243
|
-
return
|
|
55278
|
+
return [
|
|
55279
|
+
...getHideNoGitKeybinds(),
|
|
55280
|
+
{ key: "l", label: "(l)ink to IDE", action: TOGGLE_LINK_ACTION2 }
|
|
55281
|
+
];
|
|
55244
55282
|
}
|
|
55245
55283
|
supportsRawValue() {
|
|
55246
55284
|
return false;
|
|
@@ -55248,10 +55286,43 @@ class GitRootDirWidget {
|
|
|
55248
55286
|
supportsColors(item) {
|
|
55249
55287
|
return true;
|
|
55250
55288
|
}
|
|
55289
|
+
getIdeLinkMode(item) {
|
|
55290
|
+
const configuredMode = item.metadata?.[IDE_LINK_KEY];
|
|
55291
|
+
if (configuredMode && IDE_LINK_MODES.includes(configuredMode)) {
|
|
55292
|
+
return configuredMode;
|
|
55293
|
+
}
|
|
55294
|
+
if (isMetadataFlagEnabled(item, LEGACY_CURSOR_LINK_KEY)) {
|
|
55295
|
+
return "cursor";
|
|
55296
|
+
}
|
|
55297
|
+
return null;
|
|
55298
|
+
}
|
|
55299
|
+
cycleIdeLinkMode(item) {
|
|
55300
|
+
const currentMode = this.getIdeLinkMode(item);
|
|
55301
|
+
const currentIndex = currentMode ? IDE_LINK_MODES.indexOf(currentMode) : -1;
|
|
55302
|
+
const nextMode = currentIndex === IDE_LINK_MODES.length - 1 ? null : IDE_LINK_MODES[currentIndex + 1] ?? null;
|
|
55303
|
+
const {
|
|
55304
|
+
[IDE_LINK_KEY]: removedIdeLink,
|
|
55305
|
+
[LEGACY_CURSOR_LINK_KEY]: removedLegacyLink,
|
|
55306
|
+
...restMetadata
|
|
55307
|
+
} = item.metadata ?? {};
|
|
55308
|
+
return {
|
|
55309
|
+
...item,
|
|
55310
|
+
metadata: nextMode ? {
|
|
55311
|
+
...restMetadata,
|
|
55312
|
+
[IDE_LINK_KEY]: nextMode
|
|
55313
|
+
} : Object.keys(restMetadata).length > 0 ? restMetadata : undefined
|
|
55314
|
+
};
|
|
55315
|
+
}
|
|
55251
55316
|
}
|
|
55317
|
+
var IDE_LINK_KEY = "linkToIDE", LEGACY_CURSOR_LINK_KEY = "linkToCursor", TOGGLE_LINK_ACTION2 = "toggle-link", IDE_LINK_LABELS;
|
|
55252
55318
|
var init_GitRootDir = __esm(() => {
|
|
55253
55319
|
init_git();
|
|
55320
|
+
init_hyperlink();
|
|
55254
55321
|
init_git_no_git();
|
|
55322
|
+
IDE_LINK_LABELS = {
|
|
55323
|
+
vscode: "link-vscode",
|
|
55324
|
+
cursor: "link-cursor"
|
|
55325
|
+
};
|
|
55255
55326
|
});
|
|
55256
55327
|
|
|
55257
55328
|
// src/widgets/GitWorktree.ts
|
|
@@ -56103,7 +56174,7 @@ function getTerminalWidth() {
|
|
|
56103
56174
|
function canDetectTerminalWidth() {
|
|
56104
56175
|
return probeTerminalWidth() !== null;
|
|
56105
56176
|
}
|
|
56106
|
-
var __dirname = "/Users/sirmalloc/Projects/Personal/ccstatusline/src/utils", PACKAGE_VERSION = "2.2.
|
|
56177
|
+
var __dirname = "/Users/sirmalloc/Projects/Personal/ccstatusline/src/utils", PACKAGE_VERSION = "2.2.6";
|
|
56107
56178
|
var init_terminal = () => {};
|
|
56108
56179
|
|
|
56109
56180
|
// src/utils/renderer.ts
|
|
@@ -56190,9 +56261,9 @@ function renderPowerlineStatusLine(widgets, settings, context, lineIndex = 0, gl
|
|
|
56190
56261
|
}
|
|
56191
56262
|
const actualPreRenderedIndex = preRenderedIndices[i];
|
|
56192
56263
|
const preRendered = actualPreRenderedIndex !== undefined ? preRenderedWidgets[actualPreRenderedIndex] : undefined;
|
|
56264
|
+
const widgetImpl = getWidget(widget.type);
|
|
56193
56265
|
if (preRendered?.content) {
|
|
56194
56266
|
widgetText = preRendered.content;
|
|
56195
|
-
const widgetImpl = getWidget(widget.type);
|
|
56196
56267
|
if (widgetImpl) {
|
|
56197
56268
|
defaultColor = widgetImpl.getDefaultColor();
|
|
56198
56269
|
}
|
|
@@ -56314,7 +56385,7 @@ function renderPowerlineStatusLine(widgets, settings, context, lineIndex = 0, gl
|
|
|
56314
56385
|
const separatorIndex = Math.min(globalIndex, separators.length - 1);
|
|
56315
56386
|
const separator = separators[separatorIndex] ?? "";
|
|
56316
56387
|
const shouldInvert = invertBgs[separatorIndex] ?? false;
|
|
56317
|
-
let separatorOutput
|
|
56388
|
+
let separatorOutput;
|
|
56318
56389
|
const sameBackground = widget.bgColor && nextWidget.bgColor && widget.bgColor === nextWidget.bgColor;
|
|
56319
56390
|
if (shouldInvert) {
|
|
56320
56391
|
if (widget.bgColor && nextWidget.bgColor) {
|
|
@@ -56628,7 +56699,7 @@ function renderStatusLine(widgets, settings, context, preRenderedWidgets, preCal
|
|
|
56628
56699
|
}
|
|
56629
56700
|
}
|
|
56630
56701
|
});
|
|
56631
|
-
let statusLine
|
|
56702
|
+
let statusLine;
|
|
56632
56703
|
if (hasFlexSeparator && terminalWidth) {
|
|
56633
56704
|
const parts = [[]];
|
|
56634
56705
|
let currentPart = 0;
|
|
@@ -57465,8 +57536,8 @@ var import_react27, jsx_dev_runtime, CustomTextEditor = ({ widget, onComplete, o
|
|
|
57465
57536
|
const [cursorPos, setCursorPos] = import_react27.useState(text.length);
|
|
57466
57537
|
const getGraphemes = (str) => {
|
|
57467
57538
|
if ("Segmenter" in Intl) {
|
|
57468
|
-
const
|
|
57469
|
-
return Array.from(
|
|
57539
|
+
const segmenter2 = new Intl.Segmenter(undefined, { granularity: "grapheme" });
|
|
57540
|
+
return Array.from(segmenter2.segment(str), (seg) => seg.segment);
|
|
57470
57541
|
}
|
|
57471
57542
|
return Array.from(str);
|
|
57472
57543
|
};
|
|
@@ -58943,7 +59014,7 @@ var init_usage_types = __esm(() => {
|
|
|
58943
59014
|
});
|
|
58944
59015
|
|
|
58945
59016
|
// src/utils/usage-fetch.ts
|
|
58946
|
-
import {
|
|
59017
|
+
import { execFileSync } from "child_process";
|
|
58947
59018
|
import * as fs3 from "fs";
|
|
58948
59019
|
import * as https from "https";
|
|
58949
59020
|
import * as os3 from "os";
|
|
@@ -59019,33 +59090,121 @@ function getStaleUsageOrError(error48, now2, errorCacheMaxAge = LOCK_MAX_AGE) {
|
|
|
59019
59090
|
}
|
|
59020
59091
|
return setCachedUsageError(error48, now2, errorCacheMaxAge);
|
|
59021
59092
|
}
|
|
59022
|
-
function
|
|
59023
|
-
const
|
|
59024
|
-
|
|
59025
|
-
|
|
59093
|
+
function normalizeSecurityTimedateValue(rawValue) {
|
|
59094
|
+
const cleaned = rawValue.replace(/\\000/g, "").replace(/\0/g, "").trim();
|
|
59095
|
+
return /^\d{14}Z$/.test(cleaned) ? cleaned : null;
|
|
59096
|
+
}
|
|
59097
|
+
function decodeHexAscii(rawHex) {
|
|
59098
|
+
if (rawHex.length === 0 || rawHex.length % 2 !== 0) {
|
|
59099
|
+
return null;
|
|
59026
59100
|
}
|
|
59027
|
-
|
|
59028
|
-
|
|
59029
|
-
|
|
59030
|
-
|
|
59031
|
-
|
|
59032
|
-
if (token2) {
|
|
59033
|
-
cachedUsageToken = token2;
|
|
59034
|
-
usageTokenCacheTime = now2;
|
|
59035
|
-
}
|
|
59036
|
-
return token2;
|
|
59101
|
+
let decoded = "";
|
|
59102
|
+
for (let i = 0;i < rawHex.length; i += 2) {
|
|
59103
|
+
const byte = Number.parseInt(rawHex.slice(i, i + 2), 16);
|
|
59104
|
+
if (Number.isNaN(byte)) {
|
|
59105
|
+
return null;
|
|
59037
59106
|
}
|
|
59038
|
-
|
|
59039
|
-
|
|
59107
|
+
decoded += String.fromCharCode(byte);
|
|
59108
|
+
}
|
|
59109
|
+
return decoded;
|
|
59110
|
+
}
|
|
59111
|
+
function parseModifiedTimeFromKeychainBlock(block) {
|
|
59112
|
+
const quotedMatch = /"mdat"<timedate>=(?:0x[0-9A-Fa-f]+\s+)?"([^"]+)"/.exec(block);
|
|
59113
|
+
if (quotedMatch?.[1]) {
|
|
59114
|
+
const parsed = normalizeSecurityTimedateValue(quotedMatch[1]);
|
|
59115
|
+
if (parsed !== null) {
|
|
59116
|
+
return parsed;
|
|
59117
|
+
}
|
|
59118
|
+
}
|
|
59119
|
+
const hexMatch = /"mdat"<timedate>=0x([0-9A-Fa-f]+)/.exec(block);
|
|
59120
|
+
if (!hexMatch?.[1]) {
|
|
59121
|
+
return null;
|
|
59122
|
+
}
|
|
59123
|
+
const decoded = decodeHexAscii(hexMatch[1]);
|
|
59124
|
+
return decoded ? normalizeSecurityTimedateValue(decoded) : null;
|
|
59125
|
+
}
|
|
59126
|
+
function sortMacKeychainCredentialCandidates(a, b) {
|
|
59127
|
+
if (a.modifiedAt !== null && b.modifiedAt !== null && a.modifiedAt !== b.modifiedAt) {
|
|
59128
|
+
return b.modifiedAt.localeCompare(a.modifiedAt);
|
|
59129
|
+
}
|
|
59130
|
+
if (a.modifiedAt !== null && b.modifiedAt === null) {
|
|
59131
|
+
return -1;
|
|
59132
|
+
}
|
|
59133
|
+
if (a.modifiedAt === null && b.modifiedAt !== null) {
|
|
59134
|
+
return 1;
|
|
59135
|
+
}
|
|
59136
|
+
return a.order - b.order;
|
|
59137
|
+
}
|
|
59138
|
+
function parseMacKeychainCredentialCandidates(rawDump, servicePrefix = MACOS_USAGE_CREDENTIALS_SERVICE) {
|
|
59139
|
+
const blocks = rawDump.split(/(?=^keychain:\s)/m).filter((block) => block.trim().length > 0);
|
|
59140
|
+
const dedupedCandidates = new Map;
|
|
59141
|
+
let order = 0;
|
|
59142
|
+
for (const block of blocks) {
|
|
59143
|
+
const serviceMatch = /"svce"<blob>="([^"]+)"/.exec(block);
|
|
59144
|
+
const service = serviceMatch?.[1];
|
|
59145
|
+
if (!service || !service.startsWith(servicePrefix) || service === MACOS_USAGE_CREDENTIALS_SERVICE) {
|
|
59146
|
+
continue;
|
|
59147
|
+
}
|
|
59148
|
+
const candidate = {
|
|
59149
|
+
modifiedAt: parseModifiedTimeFromKeychainBlock(block),
|
|
59150
|
+
order,
|
|
59151
|
+
service
|
|
59152
|
+
};
|
|
59153
|
+
order += 1;
|
|
59154
|
+
const existing = dedupedCandidates.get(service);
|
|
59155
|
+
if (!existing || sortMacKeychainCredentialCandidates(candidate, existing) < 0) {
|
|
59156
|
+
dedupedCandidates.set(service, candidate);
|
|
59157
|
+
}
|
|
59158
|
+
}
|
|
59159
|
+
return [...dedupedCandidates.values()].sort(sortMacKeychainCredentialCandidates).map((candidate) => candidate.service);
|
|
59160
|
+
}
|
|
59161
|
+
function readMacKeychainSecret(service) {
|
|
59162
|
+
try {
|
|
59163
|
+
return execFileSync("security", ["find-generic-password", "-s", service, "-w"], { encoding: "utf8", stdio: ["pipe", "pipe", "ignore"] }).trim();
|
|
59164
|
+
} catch {
|
|
59165
|
+
return null;
|
|
59166
|
+
}
|
|
59167
|
+
}
|
|
59168
|
+
function readUsageTokenFromMacKeychainService(service) {
|
|
59169
|
+
const secret = readMacKeychainSecret(service);
|
|
59170
|
+
return secret ? parseUsageAccessToken(secret) : null;
|
|
59171
|
+
}
|
|
59172
|
+
function listMacKeychainCredentialCandidates() {
|
|
59173
|
+
try {
|
|
59174
|
+
const rawDump = execFileSync("security", ["dump-keychain"], {
|
|
59175
|
+
encoding: "utf8",
|
|
59176
|
+
maxBuffer: MACOS_SECURITY_DUMP_MAX_BUFFER,
|
|
59177
|
+
stdio: ["pipe", "pipe", "ignore"]
|
|
59178
|
+
});
|
|
59179
|
+
return parseMacKeychainCredentialCandidates(rawDump);
|
|
59180
|
+
} catch {
|
|
59181
|
+
return [];
|
|
59182
|
+
}
|
|
59183
|
+
}
|
|
59184
|
+
function readUsageTokenFromMacKeychainCandidates() {
|
|
59185
|
+
const candidates = listMacKeychainCredentialCandidates();
|
|
59186
|
+
for (const service of candidates) {
|
|
59187
|
+
const token = readUsageTokenFromMacKeychainService(service);
|
|
59040
59188
|
if (token) {
|
|
59041
|
-
|
|
59042
|
-
usageTokenCacheTime = now2;
|
|
59189
|
+
return token;
|
|
59043
59190
|
}
|
|
59044
|
-
|
|
59191
|
+
}
|
|
59192
|
+
return null;
|
|
59193
|
+
}
|
|
59194
|
+
function readUsageTokenFromCredentialsFile() {
|
|
59195
|
+
try {
|
|
59196
|
+
const credFile = path2.join(getClaudeConfigDir(), ".credentials.json");
|
|
59197
|
+
return parseUsageAccessToken(fs3.readFileSync(credFile, "utf8"));
|
|
59045
59198
|
} catch {
|
|
59046
59199
|
return null;
|
|
59047
59200
|
}
|
|
59048
59201
|
}
|
|
59202
|
+
function getUsageToken() {
|
|
59203
|
+
if (process.platform !== "darwin") {
|
|
59204
|
+
return readUsageTokenFromCredentialsFile();
|
|
59205
|
+
}
|
|
59206
|
+
return readUsageTokenFromMacKeychainService(MACOS_USAGE_CREDENTIALS_SERVICE) ?? readUsageTokenFromMacKeychainCandidates() ?? readUsageTokenFromCredentialsFile();
|
|
59207
|
+
}
|
|
59049
59208
|
function readStaleUsageCache() {
|
|
59050
59209
|
try {
|
|
59051
59210
|
return parseCachedUsageData(fs3.readFileSync(CACHE_FILE, "utf8"));
|
|
@@ -59233,7 +59392,7 @@ async function fetchUsageData() {
|
|
|
59233
59392
|
return getStaleUsageOrError("parse-error", now2);
|
|
59234
59393
|
}
|
|
59235
59394
|
}
|
|
59236
|
-
var import_https_proxy_agent, CACHE_DIR, CACHE_FILE, LOCK_FILE, CACHE_MAX_AGE = 180, LOCK_MAX_AGE = 30, DEFAULT_RATE_LIMIT_BACKOFF = 300,
|
|
59395
|
+
var import_https_proxy_agent, 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;
|
|
59237
59396
|
var init_usage_fetch = __esm(() => {
|
|
59238
59397
|
init_zod();
|
|
59239
59398
|
init_claude_settings();
|
|
@@ -59242,6 +59401,7 @@ var init_usage_fetch = __esm(() => {
|
|
|
59242
59401
|
CACHE_DIR = path2.join(os3.homedir(), ".cache", "ccstatusline");
|
|
59243
59402
|
CACHE_FILE = path2.join(CACHE_DIR, "usage.json");
|
|
59244
59403
|
LOCK_FILE = path2.join(CACHE_DIR, "usage.lock");
|
|
59404
|
+
MACOS_SECURITY_DUMP_MAX_BUFFER = 8 * 1024 * 1024;
|
|
59245
59405
|
UsageCredentialsSchema = exports_external.object({ claudeAiOauth: exports_external.object({ accessToken: exports_external.string().nullable().optional() }).optional() });
|
|
59246
59406
|
UsageLockErrorSchema = exports_external.enum(["timeout", "rate-limited"]);
|
|
59247
59407
|
UsageLockSchema = exports_external.object({
|
|
@@ -62289,17 +62449,16 @@ function getWeeklyUsageWindowFromResetAt(weeklyResetAt, nowMs = Date.now()) {
|
|
|
62289
62449
|
function resolveWeeklyUsageWindow(usageData, nowMs = Date.now()) {
|
|
62290
62450
|
return getWeeklyUsageWindowFromResetAt(usageData.weeklyResetAt, nowMs);
|
|
62291
62451
|
}
|
|
62292
|
-
function formatUsageDuration(durationMs, compact2 = false) {
|
|
62452
|
+
function formatUsageDuration(durationMs, compact2 = false, useDays = true) {
|
|
62293
62453
|
const clampedMs = Math.max(0, durationMs);
|
|
62294
|
-
const
|
|
62295
|
-
const
|
|
62296
|
-
|
|
62297
|
-
|
|
62298
|
-
|
|
62299
|
-
|
|
62300
|
-
|
|
62301
|
-
|
|
62302
|
-
return `${elapsedHours}hr ${elapsedMinutes}m`;
|
|
62454
|
+
const totalHours = Math.floor(clampedMs / (1000 * 60 * 60));
|
|
62455
|
+
const m = Math.floor(clampedMs % (1000 * 60 * 60) / (1000 * 60));
|
|
62456
|
+
const hLabel = compact2 ? "h" : "hr";
|
|
62457
|
+
const sep2 = compact2 ? "" : " ";
|
|
62458
|
+
const d = useDays ? Math.floor(totalHours / 24) : 0;
|
|
62459
|
+
const h = useDays ? totalHours % 24 : totalHours;
|
|
62460
|
+
const parts = [d > 0 && `${d}d`, h > 0 && `${h}${hLabel}`, m > 0 && `${m}m`].filter(Boolean);
|
|
62461
|
+
return parts.length > 0 ? parts.join(sep2) : "0m";
|
|
62303
62462
|
}
|
|
62304
62463
|
function getUsageErrorMessage(error48) {
|
|
62305
62464
|
switch (error48) {
|
|
@@ -62366,30 +62525,49 @@ function getUsageDisplayModifierText(item, options = {}) {
|
|
|
62366
62525
|
if (isUsageInverted(item)) {
|
|
62367
62526
|
modifiers.push("inverted");
|
|
62368
62527
|
}
|
|
62369
|
-
if (options.includeCompact && isUsageCompact(item)) {
|
|
62528
|
+
if (options.includeCompact && !isUsageProgressMode(mode) && isUsageCompact(item)) {
|
|
62370
62529
|
modifiers.push("compact");
|
|
62371
62530
|
}
|
|
62372
62531
|
return makeModifierText(modifiers);
|
|
62373
62532
|
}
|
|
62374
|
-
function cycleUsageDisplayMode(item) {
|
|
62533
|
+
function cycleUsageDisplayMode(item, disabledInProgressKeys = []) {
|
|
62375
62534
|
const currentMode = getUsageDisplayMode(item);
|
|
62376
62535
|
const nextMode = currentMode === "time" ? "progress" : currentMode === "progress" ? "progress-short" : "time";
|
|
62536
|
+
const nextItem = removeMetadataKeys(item, nextMode === "time" ? ["invert"] : disabledInProgressKeys);
|
|
62377
62537
|
const nextMetadata = {
|
|
62378
|
-
...
|
|
62538
|
+
...nextItem.metadata ?? {},
|
|
62379
62539
|
display: nextMode
|
|
62380
62540
|
};
|
|
62381
|
-
if (nextMode === "time") {
|
|
62382
|
-
delete nextMetadata.invert;
|
|
62383
|
-
}
|
|
62384
62541
|
return {
|
|
62385
|
-
...
|
|
62542
|
+
...nextItem,
|
|
62386
62543
|
metadata: nextMetadata
|
|
62387
62544
|
};
|
|
62388
62545
|
}
|
|
62389
62546
|
function toggleUsageInverted(item) {
|
|
62390
62547
|
return toggleMetadataFlag(item, "invert");
|
|
62391
62548
|
}
|
|
62392
|
-
|
|
62549
|
+
function getUsagePercentCustomKeybinds(item) {
|
|
62550
|
+
const keybinds = [PROGRESS_TOGGLE_KEYBIND];
|
|
62551
|
+
if (item && isUsageProgressMode(getUsageDisplayMode(item))) {
|
|
62552
|
+
keybinds.push(INVERT_TOGGLE_KEYBIND);
|
|
62553
|
+
}
|
|
62554
|
+
return keybinds;
|
|
62555
|
+
}
|
|
62556
|
+
function getUsageTimerCustomKeybinds(item) {
|
|
62557
|
+
const keybinds = [PROGRESS_TOGGLE_KEYBIND];
|
|
62558
|
+
if (item && isUsageProgressMode(getUsageDisplayMode(item))) {
|
|
62559
|
+
keybinds.push(INVERT_TOGGLE_KEYBIND);
|
|
62560
|
+
} else {
|
|
62561
|
+
keybinds.push(COMPACT_TOGGLE_KEYBIND);
|
|
62562
|
+
}
|
|
62563
|
+
return keybinds;
|
|
62564
|
+
}
|
|
62565
|
+
var PROGRESS_TOGGLE_KEYBIND, INVERT_TOGGLE_KEYBIND, COMPACT_TOGGLE_KEYBIND;
|
|
62566
|
+
var init_usage_display = __esm(() => {
|
|
62567
|
+
PROGRESS_TOGGLE_KEYBIND = { key: "p", label: "(p)rogress toggle", action: "toggle-progress" };
|
|
62568
|
+
INVERT_TOGGLE_KEYBIND = { key: "v", label: "in(v)ert fill", action: "toggle-invert" };
|
|
62569
|
+
COMPACT_TOGGLE_KEYBIND = { key: "s", label: "(s)hort time", action: "toggle-compact" };
|
|
62570
|
+
});
|
|
62393
62571
|
|
|
62394
62572
|
// src/widgets/BlockTimer.ts
|
|
62395
62573
|
function makeTimerProgressBar(percent, width) {
|
|
@@ -62420,7 +62598,7 @@ class BlockTimerWidget {
|
|
|
62420
62598
|
}
|
|
62421
62599
|
handleEditorAction(action, item) {
|
|
62422
62600
|
if (action === "toggle-progress") {
|
|
62423
|
-
return cycleUsageDisplayMode(item);
|
|
62601
|
+
return cycleUsageDisplayMode(item, ["compact"]);
|
|
62424
62602
|
}
|
|
62425
62603
|
if (action === "toggle-invert") {
|
|
62426
62604
|
return toggleUsageInverted(item);
|
|
@@ -62463,12 +62641,8 @@ class BlockTimerWidget {
|
|
|
62463
62641
|
const elapsedTime = formatUsageDuration(window2.elapsedMs, compact2);
|
|
62464
62642
|
return formatRawOrLabeledValue(item, "Block: ", elapsedTime);
|
|
62465
62643
|
}
|
|
62466
|
-
getCustomKeybinds() {
|
|
62467
|
-
return
|
|
62468
|
-
{ key: "p", label: "(p)rogress toggle", action: "toggle-progress" },
|
|
62469
|
-
{ key: "v", label: "in(v)ert fill", action: "toggle-invert" },
|
|
62470
|
-
{ key: "s", label: "(s)hort time", action: "toggle-compact" }
|
|
62471
|
-
];
|
|
62644
|
+
getCustomKeybinds(item) {
|
|
62645
|
+
return getUsageTimerCustomKeybinds(item);
|
|
62472
62646
|
}
|
|
62473
62647
|
supportsRawValue() {
|
|
62474
62648
|
return true;
|
|
@@ -63103,7 +63277,7 @@ var init_TotalSpeed = __esm(async () => {
|
|
|
63103
63277
|
});
|
|
63104
63278
|
|
|
63105
63279
|
// src/widgets/FreeMemory.ts
|
|
63106
|
-
import { execSync as
|
|
63280
|
+
import { execSync as execSync4 } from "child_process";
|
|
63107
63281
|
import os6 from "os";
|
|
63108
63282
|
function formatBytes(bytes) {
|
|
63109
63283
|
const GB = 1024 ** 3;
|
|
@@ -63119,7 +63293,7 @@ function formatBytes(bytes) {
|
|
|
63119
63293
|
}
|
|
63120
63294
|
function getUsedMemoryMacOS() {
|
|
63121
63295
|
try {
|
|
63122
|
-
const output =
|
|
63296
|
+
const output = execSync4("vm_stat", { encoding: "utf8" });
|
|
63123
63297
|
const lines = output.split(`
|
|
63124
63298
|
`);
|
|
63125
63299
|
const firstLine = lines[0];
|
|
@@ -63297,11 +63471,8 @@ class SessionUsageWidget {
|
|
|
63297
63471
|
}
|
|
63298
63472
|
return formatRawOrLabeledValue(item, "Session: ", `${percent.toFixed(1)}%`);
|
|
63299
63473
|
}
|
|
63300
|
-
getCustomKeybinds() {
|
|
63301
|
-
return
|
|
63302
|
-
{ key: "p", label: "(p)rogress toggle", action: "toggle-progress" },
|
|
63303
|
-
{ key: "v", label: "in(v)ert fill", action: "toggle-invert" }
|
|
63304
|
-
];
|
|
63474
|
+
getCustomKeybinds(item) {
|
|
63475
|
+
return getUsagePercentCustomKeybinds(item);
|
|
63305
63476
|
}
|
|
63306
63477
|
supportsRawValue() {
|
|
63307
63478
|
return true;
|
|
@@ -63371,11 +63542,8 @@ class WeeklyUsageWidget {
|
|
|
63371
63542
|
}
|
|
63372
63543
|
return formatRawOrLabeledValue(item, "Weekly: ", `${percent.toFixed(1)}%`);
|
|
63373
63544
|
}
|
|
63374
|
-
getCustomKeybinds() {
|
|
63375
|
-
return
|
|
63376
|
-
{ key: "p", label: "(p)rogress toggle", action: "toggle-progress" },
|
|
63377
|
-
{ key: "v", label: "in(v)ert fill", action: "toggle-invert" }
|
|
63378
|
-
];
|
|
63545
|
+
getCustomKeybinds(item) {
|
|
63546
|
+
return getUsagePercentCustomKeybinds(item);
|
|
63379
63547
|
}
|
|
63380
63548
|
supportsRawValue() {
|
|
63381
63549
|
return true;
|
|
@@ -63418,7 +63586,7 @@ class BlockResetTimerWidget {
|
|
|
63418
63586
|
}
|
|
63419
63587
|
handleEditorAction(action, item) {
|
|
63420
63588
|
if (action === "toggle-progress") {
|
|
63421
|
-
return cycleUsageDisplayMode(item);
|
|
63589
|
+
return cycleUsageDisplayMode(item, ["compact"]);
|
|
63422
63590
|
}
|
|
63423
63591
|
if (action === "toggle-invert") {
|
|
63424
63592
|
return toggleUsageInverted(item);
|
|
@@ -63459,12 +63627,8 @@ class BlockResetTimerWidget {
|
|
|
63459
63627
|
const remainingTime = formatUsageDuration(window2.remainingMs, compact2);
|
|
63460
63628
|
return formatRawOrLabeledValue(item, "Reset: ", remainingTime);
|
|
63461
63629
|
}
|
|
63462
|
-
getCustomKeybinds() {
|
|
63463
|
-
return
|
|
63464
|
-
{ key: "p", label: "(p)rogress toggle", action: "toggle-progress" },
|
|
63465
|
-
{ key: "v", label: "in(v)ert fill", action: "toggle-invert" },
|
|
63466
|
-
{ key: "s", label: "(s)hort time", action: "toggle-compact" }
|
|
63467
|
-
];
|
|
63630
|
+
getCustomKeybinds(item) {
|
|
63631
|
+
return getUsageTimerCustomKeybinds(item);
|
|
63468
63632
|
}
|
|
63469
63633
|
supportsRawValue() {
|
|
63470
63634
|
return true;
|
|
@@ -63485,6 +63649,33 @@ function makeTimerProgressBar3(percent, width) {
|
|
|
63485
63649
|
const emptyWidth = width - filledWidth;
|
|
63486
63650
|
return "█".repeat(filledWidth) + "░".repeat(emptyWidth);
|
|
63487
63651
|
}
|
|
63652
|
+
function isWeeklyResetHoursOnly(item) {
|
|
63653
|
+
return isMetadataFlagEnabled(item, "hours");
|
|
63654
|
+
}
|
|
63655
|
+
function toggleWeeklyResetHoursOnly(item) {
|
|
63656
|
+
return toggleMetadataFlag(item, "hours");
|
|
63657
|
+
}
|
|
63658
|
+
function getWeeklyResetModifierText(item) {
|
|
63659
|
+
const displayMode = getUsageDisplayMode(item);
|
|
63660
|
+
const modifiers = [];
|
|
63661
|
+
if (displayMode === "progress") {
|
|
63662
|
+
modifiers.push("progress bar");
|
|
63663
|
+
} else if (displayMode === "progress-short") {
|
|
63664
|
+
modifiers.push("short bar");
|
|
63665
|
+
}
|
|
63666
|
+
if (isUsageInverted(item)) {
|
|
63667
|
+
modifiers.push("inverted");
|
|
63668
|
+
}
|
|
63669
|
+
if (!isUsageProgressMode(displayMode)) {
|
|
63670
|
+
if (isUsageCompact(item)) {
|
|
63671
|
+
modifiers.push("compact");
|
|
63672
|
+
}
|
|
63673
|
+
if (isWeeklyResetHoursOnly(item)) {
|
|
63674
|
+
modifiers.push("hours only");
|
|
63675
|
+
}
|
|
63676
|
+
}
|
|
63677
|
+
return makeModifierText(modifiers);
|
|
63678
|
+
}
|
|
63488
63679
|
|
|
63489
63680
|
class WeeklyResetTimerWidget {
|
|
63490
63681
|
getDefaultColor() {
|
|
@@ -63502,12 +63693,12 @@ class WeeklyResetTimerWidget {
|
|
|
63502
63693
|
getEditorDisplay(item) {
|
|
63503
63694
|
return {
|
|
63504
63695
|
displayText: this.getDisplayName(),
|
|
63505
|
-
modifierText:
|
|
63696
|
+
modifierText: getWeeklyResetModifierText(item)
|
|
63506
63697
|
};
|
|
63507
63698
|
}
|
|
63508
63699
|
handleEditorAction(action, item) {
|
|
63509
63700
|
if (action === "toggle-progress") {
|
|
63510
|
-
return cycleUsageDisplayMode(item);
|
|
63701
|
+
return cycleUsageDisplayMode(item, ["compact", "hours"]);
|
|
63511
63702
|
}
|
|
63512
63703
|
if (action === "toggle-invert") {
|
|
63513
63704
|
return toggleUsageInverted(item);
|
|
@@ -63515,12 +63706,16 @@ class WeeklyResetTimerWidget {
|
|
|
63515
63706
|
if (action === "toggle-compact") {
|
|
63516
63707
|
return toggleUsageCompact(item);
|
|
63517
63708
|
}
|
|
63709
|
+
if (action === "toggle-hours") {
|
|
63710
|
+
return toggleWeeklyResetHoursOnly(item);
|
|
63711
|
+
}
|
|
63518
63712
|
return null;
|
|
63519
63713
|
}
|
|
63520
63714
|
render(item, context, settings) {
|
|
63521
63715
|
const displayMode = getUsageDisplayMode(item);
|
|
63522
63716
|
const inverted = isUsageInverted(item);
|
|
63523
63717
|
const compact2 = isUsageCompact(item);
|
|
63718
|
+
const useDays = !isWeeklyResetHoursOnly(item);
|
|
63524
63719
|
if (context.isPreview) {
|
|
63525
63720
|
const previewPercent = inverted ? 90 : 10;
|
|
63526
63721
|
if (isUsageProgressMode(displayMode)) {
|
|
@@ -63528,7 +63723,7 @@ class WeeklyResetTimerWidget {
|
|
|
63528
63723
|
const progressBar = makeTimerProgressBar3(previewPercent, barWidth);
|
|
63529
63724
|
return formatRawOrLabeledValue(item, "Weekly Reset ", `[${progressBar}] ${previewPercent.toFixed(1)}%`);
|
|
63530
63725
|
}
|
|
63531
|
-
return formatRawOrLabeledValue(item, "Weekly Reset: ", compact2
|
|
63726
|
+
return formatRawOrLabeledValue(item, "Weekly Reset: ", formatUsageDuration(WEEKLY_PREVIEW_DURATION_MS, compact2, useDays));
|
|
63532
63727
|
}
|
|
63533
63728
|
const usageData = context.usageData ?? {};
|
|
63534
63729
|
const window2 = resolveWeeklyUsageWindow(usageData);
|
|
@@ -63545,15 +63740,15 @@ class WeeklyResetTimerWidget {
|
|
|
63545
63740
|
const percentage = percent.toFixed(1);
|
|
63546
63741
|
return formatRawOrLabeledValue(item, "Weekly Reset ", `[${progressBar}] ${percentage}%`);
|
|
63547
63742
|
}
|
|
63548
|
-
const remainingTime = formatUsageDuration(window2.remainingMs, compact2);
|
|
63743
|
+
const remainingTime = formatUsageDuration(window2.remainingMs, compact2, useDays);
|
|
63549
63744
|
return formatRawOrLabeledValue(item, "Weekly Reset: ", remainingTime);
|
|
63550
63745
|
}
|
|
63551
|
-
getCustomKeybinds() {
|
|
63552
|
-
|
|
63553
|
-
|
|
63554
|
-
{ key: "
|
|
63555
|
-
|
|
63556
|
-
|
|
63746
|
+
getCustomKeybinds(item) {
|
|
63747
|
+
const keybinds = getUsageTimerCustomKeybinds(item);
|
|
63748
|
+
if (!item || !isUsageProgressMode(getUsageDisplayMode(item))) {
|
|
63749
|
+
keybinds.push({ key: "h", label: "(h)ours only", action: "toggle-hours" });
|
|
63750
|
+
}
|
|
63751
|
+
return keybinds;
|
|
63557
63752
|
}
|
|
63558
63753
|
supportsRawValue() {
|
|
63559
63754
|
return true;
|
|
@@ -63562,9 +63757,11 @@ class WeeklyResetTimerWidget {
|
|
|
63562
63757
|
return true;
|
|
63563
63758
|
}
|
|
63564
63759
|
}
|
|
63760
|
+
var WEEKLY_PREVIEW_DURATION_MS;
|
|
63565
63761
|
var init_WeeklyResetTimer = __esm(() => {
|
|
63566
63762
|
init_usage();
|
|
63567
63763
|
init_usage_display();
|
|
63764
|
+
WEEKLY_PREVIEW_DURATION_MS = 36.5 * 60 * 60 * 1000;
|
|
63568
63765
|
});
|
|
63569
63766
|
|
|
63570
63767
|
// src/widgets/ContextBar.ts
|
|
@@ -63690,9 +63887,6 @@ function buildMetadata(widget, urlValue, textValue) {
|
|
|
63690
63887
|
metadata
|
|
63691
63888
|
};
|
|
63692
63889
|
}
|
|
63693
|
-
function renderOsc8Link(url2, text) {
|
|
63694
|
-
return `\x1B]8;;${url2}\x1B\\${text}\x1B]8;;\x1B\\`;
|
|
63695
|
-
}
|
|
63696
63890
|
function getLinkLabel(item) {
|
|
63697
63891
|
const url2 = item.metadata?.url?.trim() ?? "";
|
|
63698
63892
|
const metadataText = item.metadata?.text?.trim();
|
|
@@ -63846,6 +64040,7 @@ var import_react31, jsx_dev_runtime5, LinkEditor = ({ widget, onComplete, onCanc
|
|
|
63846
64040
|
}, undefined, true, undefined, this);
|
|
63847
64041
|
};
|
|
63848
64042
|
var init_Link = __esm(async () => {
|
|
64043
|
+
init_hyperlink();
|
|
63849
64044
|
init_input_guards();
|
|
63850
64045
|
await init_build2();
|
|
63851
64046
|
import_react31 = __toESM(require_react(), 1);
|
|
@@ -63902,12 +64097,15 @@ class SkillsWidget {
|
|
|
63902
64097
|
{ event: "UserPromptSubmit" }
|
|
63903
64098
|
];
|
|
63904
64099
|
}
|
|
63905
|
-
getCustomKeybinds() {
|
|
63906
|
-
|
|
64100
|
+
getCustomKeybinds(item) {
|
|
64101
|
+
const keybinds = [
|
|
63907
64102
|
{ key: "v", label: "(v)iew: last/count/list", action: "cycle-mode" },
|
|
63908
|
-
{ key: "h", label: "(h)ide when empty", action: TOGGLE_HIDE_EMPTY_ACTION }
|
|
63909
|
-
{ key: "l", label: "(l)imit", action: EDIT_LIST_LIMIT_ACTION }
|
|
64103
|
+
{ key: "h", label: "(h)ide when empty", action: TOGGLE_HIDE_EMPTY_ACTION }
|
|
63910
64104
|
];
|
|
64105
|
+
if (item && this.getMode(item) === "list") {
|
|
64106
|
+
keybinds.push({ key: "l", label: "(l)imit", action: EDIT_LIST_LIMIT_ACTION });
|
|
64107
|
+
}
|
|
64108
|
+
return keybinds;
|
|
63911
64109
|
}
|
|
63912
64110
|
getEditorDisplay(item) {
|
|
63913
64111
|
const modifiers = [MODE_LABELS[this.getMode(item)]];
|
|
@@ -63925,7 +64123,8 @@ class SkillsWidget {
|
|
|
63925
64123
|
handleEditorAction(action, item) {
|
|
63926
64124
|
if (action === "cycle-mode") {
|
|
63927
64125
|
const next = MODES[(MODES.indexOf(this.getMode(item)) + 1) % MODES.length] ?? "current";
|
|
63928
|
-
|
|
64126
|
+
const nextItem = next === "list" ? item : removeMetadataKeys(item, [LIST_LIMIT_KEY]);
|
|
64127
|
+
return { ...nextItem, metadata: { ...nextItem.metadata, mode: next } };
|
|
63929
64128
|
}
|
|
63930
64129
|
if (action === TOGGLE_HIDE_EMPTY_ACTION) {
|
|
63931
64130
|
return toggleMetadataFlag(item, HIDE_WHEN_EMPTY_KEY);
|
|
@@ -64102,6 +64301,124 @@ var init_ThinkingEffort = __esm(() => {
|
|
|
64102
64301
|
init_jsonl();
|
|
64103
64302
|
});
|
|
64104
64303
|
|
|
64304
|
+
// src/widgets/VimMode.ts
|
|
64305
|
+
function getFormat(item) {
|
|
64306
|
+
const f = item.metadata?.format;
|
|
64307
|
+
return FORMATS.includes(f ?? "") ? f : DEFAULT_FORMAT;
|
|
64308
|
+
}
|
|
64309
|
+
function setFormat(item, format) {
|
|
64310
|
+
if (format === DEFAULT_FORMAT) {
|
|
64311
|
+
const { format: removedFormat, ...restMetadata } = item.metadata ?? {};
|
|
64312
|
+
return {
|
|
64313
|
+
...item,
|
|
64314
|
+
metadata: Object.keys(restMetadata).length > 0 ? restMetadata : undefined
|
|
64315
|
+
};
|
|
64316
|
+
}
|
|
64317
|
+
return {
|
|
64318
|
+
...item,
|
|
64319
|
+
metadata: {
|
|
64320
|
+
...item.metadata ?? {},
|
|
64321
|
+
format
|
|
64322
|
+
}
|
|
64323
|
+
};
|
|
64324
|
+
}
|
|
64325
|
+
function isNerdFontEnabled(item) {
|
|
64326
|
+
return item.metadata?.[NERD_FONT_METADATA_KEY] === "true";
|
|
64327
|
+
}
|
|
64328
|
+
function toggleNerdFont(item) {
|
|
64329
|
+
if (!isNerdFontEnabled(item)) {
|
|
64330
|
+
return {
|
|
64331
|
+
...item,
|
|
64332
|
+
metadata: {
|
|
64333
|
+
...item.metadata ?? {},
|
|
64334
|
+
[NERD_FONT_METADATA_KEY]: "true"
|
|
64335
|
+
}
|
|
64336
|
+
};
|
|
64337
|
+
}
|
|
64338
|
+
const { [NERD_FONT_METADATA_KEY]: removedNerdFont, ...restMetadata } = item.metadata ?? {};
|
|
64339
|
+
return {
|
|
64340
|
+
...item,
|
|
64341
|
+
metadata: Object.keys(restMetadata).length > 0 ? restMetadata : undefined
|
|
64342
|
+
};
|
|
64343
|
+
}
|
|
64344
|
+
function formatMode(mode, format, icon) {
|
|
64345
|
+
const letter = mode === "NORMAL" ? "N" : mode === "INSERT" ? "I" : mode[0] ?? mode;
|
|
64346
|
+
switch (format) {
|
|
64347
|
+
case "icon-dash-letter":
|
|
64348
|
+
return `${icon}-${letter}`;
|
|
64349
|
+
case "icon-letter":
|
|
64350
|
+
return `${icon} ${letter}`;
|
|
64351
|
+
case "icon":
|
|
64352
|
+
return icon;
|
|
64353
|
+
case "letter":
|
|
64354
|
+
return letter;
|
|
64355
|
+
case "word":
|
|
64356
|
+
return mode;
|
|
64357
|
+
}
|
|
64358
|
+
}
|
|
64359
|
+
|
|
64360
|
+
class VimModeWidget {
|
|
64361
|
+
getDefaultColor() {
|
|
64362
|
+
return "green";
|
|
64363
|
+
}
|
|
64364
|
+
getDescription() {
|
|
64365
|
+
return "Displays current vim editor mode";
|
|
64366
|
+
}
|
|
64367
|
+
getDisplayName() {
|
|
64368
|
+
return "Vim Mode";
|
|
64369
|
+
}
|
|
64370
|
+
getCategory() {
|
|
64371
|
+
return "Core";
|
|
64372
|
+
}
|
|
64373
|
+
getEditorDisplay(item) {
|
|
64374
|
+
const modifiers = [getFormat(item)];
|
|
64375
|
+
if (isNerdFontEnabled(item)) {
|
|
64376
|
+
modifiers.push("nerd font");
|
|
64377
|
+
}
|
|
64378
|
+
return {
|
|
64379
|
+
displayText: this.getDisplayName(),
|
|
64380
|
+
modifierText: `(${modifiers.join(", ")})`
|
|
64381
|
+
};
|
|
64382
|
+
}
|
|
64383
|
+
handleEditorAction(action, item) {
|
|
64384
|
+
if (action === CYCLE_FORMAT_ACTION) {
|
|
64385
|
+
const currentFormat = getFormat(item);
|
|
64386
|
+
const nextFormat = FORMATS[(FORMATS.indexOf(currentFormat) + 1) % FORMATS.length] ?? DEFAULT_FORMAT;
|
|
64387
|
+
return setFormat(item, nextFormat);
|
|
64388
|
+
}
|
|
64389
|
+
if (action === TOGGLE_NERD_FONT_ACTION) {
|
|
64390
|
+
return toggleNerdFont(item);
|
|
64391
|
+
}
|
|
64392
|
+
return null;
|
|
64393
|
+
}
|
|
64394
|
+
render(item, context, _settings) {
|
|
64395
|
+
const format = getFormat(item);
|
|
64396
|
+
const icon = isNerdFontEnabled(item) ? VIM_NERD_FONT_ICON : VIM_ICON;
|
|
64397
|
+
if (context.isPreview)
|
|
64398
|
+
return formatMode("NORMAL", format, icon);
|
|
64399
|
+
const mode = context.data?.vim?.mode;
|
|
64400
|
+
if (mode === undefined)
|
|
64401
|
+
return null;
|
|
64402
|
+
return formatMode(mode, format, icon);
|
|
64403
|
+
}
|
|
64404
|
+
getCustomKeybinds() {
|
|
64405
|
+
return [
|
|
64406
|
+
{ key: "f", label: "(f)ormat", action: CYCLE_FORMAT_ACTION },
|
|
64407
|
+
{ key: "n", label: "(n)erd font", action: TOGGLE_NERD_FONT_ACTION }
|
|
64408
|
+
];
|
|
64409
|
+
}
|
|
64410
|
+
supportsRawValue() {
|
|
64411
|
+
return false;
|
|
64412
|
+
}
|
|
64413
|
+
supportsColors(_item) {
|
|
64414
|
+
return true;
|
|
64415
|
+
}
|
|
64416
|
+
}
|
|
64417
|
+
var VIM_ICON = "v", VIM_NERD_FONT_ICON = "", FORMATS, DEFAULT_FORMAT = "icon-dash-letter", CYCLE_FORMAT_ACTION = "cycle-format", TOGGLE_NERD_FONT_ACTION = "toggle-nerd-font", NERD_FONT_METADATA_KEY = "nerdFont";
|
|
64418
|
+
var init_VimMode = __esm(() => {
|
|
64419
|
+
FORMATS = ["icon-dash-letter", "icon-letter", "icon", "letter", "word"];
|
|
64420
|
+
});
|
|
64421
|
+
|
|
64105
64422
|
// src/widgets/index.ts
|
|
64106
64423
|
var init_widgets = __esm(async () => {
|
|
64107
64424
|
init_GitBranch();
|
|
@@ -64122,6 +64439,7 @@ var init_widgets = __esm(async () => {
|
|
|
64122
64439
|
init_WeeklyResetTimer();
|
|
64123
64440
|
init_ContextBar();
|
|
64124
64441
|
init_ThinkingEffort();
|
|
64442
|
+
init_VimMode();
|
|
64125
64443
|
await __promiseAll([
|
|
64126
64444
|
init_TokensInput(),
|
|
64127
64445
|
init_TokensOutput(),
|
|
@@ -64180,7 +64498,8 @@ var init_widget_manifest = __esm(async () => {
|
|
|
64180
64498
|
{ type: "weekly-reset-timer", create: () => new WeeklyResetTimerWidget },
|
|
64181
64499
|
{ type: "context-bar", create: () => new ContextBarWidget },
|
|
64182
64500
|
{ type: "skills", create: () => new SkillsWidget },
|
|
64183
|
-
{ type: "thinking-effort", create: () => new ThinkingEffortWidget }
|
|
64501
|
+
{ type: "thinking-effort", create: () => new ThinkingEffortWidget },
|
|
64502
|
+
{ type: "vim-mode", create: () => new VimModeWidget }
|
|
64184
64503
|
];
|
|
64185
64504
|
LAYOUT_WIDGET_MANIFEST = [
|
|
64186
64505
|
{
|
|
@@ -64489,7 +64808,7 @@ var init_config = __esm(() => {
|
|
|
64489
64808
|
});
|
|
64490
64809
|
|
|
64491
64810
|
// src/utils/claude-settings.ts
|
|
64492
|
-
import { execSync as
|
|
64811
|
+
import { execSync as execSync5 } from "child_process";
|
|
64493
64812
|
import * as fs10 from "fs";
|
|
64494
64813
|
import * as os8 from "os";
|
|
64495
64814
|
import * as path8 from "path";
|
|
@@ -64598,7 +64917,7 @@ async function isInstalled() {
|
|
|
64598
64917
|
function isBunxAvailable() {
|
|
64599
64918
|
try {
|
|
64600
64919
|
const command = process.platform === "win32" ? "where bunx" : "which bunx";
|
|
64601
|
-
|
|
64920
|
+
execSync5(command, { stdio: "ignore" });
|
|
64602
64921
|
return true;
|
|
64603
64922
|
} catch {
|
|
64604
64923
|
return false;
|
|
@@ -65195,7 +65514,7 @@ function openExternalUrl(url2) {
|
|
|
65195
65514
|
}
|
|
65196
65515
|
|
|
65197
65516
|
// src/utils/powerline.ts
|
|
65198
|
-
import { execSync as
|
|
65517
|
+
import { execSync as execSync6 } from "child_process";
|
|
65199
65518
|
import * as fs11 from "fs";
|
|
65200
65519
|
import * as os10 from "os";
|
|
65201
65520
|
import * as path9 from "path";
|
|
@@ -65329,7 +65648,7 @@ async function installPowerlineFonts() {
|
|
|
65329
65648
|
if (fs11.existsSync(tempDir)) {
|
|
65330
65649
|
fs11.rmSync(tempDir, { recursive: true, force: true });
|
|
65331
65650
|
}
|
|
65332
|
-
|
|
65651
|
+
execSync6(`git clone --depth=1 https://github.com/powerline/fonts.git "${tempDir}"`, {
|
|
65333
65652
|
stdio: "pipe",
|
|
65334
65653
|
encoding: "utf8"
|
|
65335
65654
|
});
|
|
@@ -65337,14 +65656,14 @@ async function installPowerlineFonts() {
|
|
|
65337
65656
|
const installScript = path9.join(tempDir, "install.sh");
|
|
65338
65657
|
if (fs11.existsSync(installScript)) {
|
|
65339
65658
|
fs11.chmodSync(installScript, 493);
|
|
65340
|
-
|
|
65659
|
+
execSync6(`cd "${tempDir}" && ./install.sh`, {
|
|
65341
65660
|
stdio: "pipe",
|
|
65342
65661
|
encoding: "utf8",
|
|
65343
65662
|
shell: "/bin/bash"
|
|
65344
65663
|
});
|
|
65345
65664
|
if (platform4 === "linux") {
|
|
65346
65665
|
try {
|
|
65347
|
-
|
|
65666
|
+
execSync6("fc-cache -f -v", {
|
|
65348
65667
|
stdio: "pipe",
|
|
65349
65668
|
encoding: "utf8"
|
|
65350
65669
|
});
|
|
@@ -67322,7 +67641,7 @@ function handleNormalInputMode({
|
|
|
67322
67641
|
setMoveMode,
|
|
67323
67642
|
setShowClearConfirm,
|
|
67324
67643
|
openWidgetPicker,
|
|
67325
|
-
|
|
67644
|
+
getCustomKeybindsForWidget,
|
|
67326
67645
|
setCustomEditorWidget
|
|
67327
67646
|
}) {
|
|
67328
67647
|
if (key.upArrow && widgets.length > 0) {
|
|
@@ -67399,7 +67718,7 @@ function handleNormalInputMode({
|
|
|
67399
67718
|
if (!widgetImpl?.getCustomKeybinds) {
|
|
67400
67719
|
return;
|
|
67401
67720
|
}
|
|
67402
|
-
const customKeybinds =
|
|
67721
|
+
const customKeybinds = getCustomKeybindsForWidget(widgetImpl, currentWidget);
|
|
67403
67722
|
const matchedKeybind = customKeybinds.find((kb) => kb.key === input);
|
|
67404
67723
|
if (matchedKeybind && !key.ctrl) {
|
|
67405
67724
|
if (widgetImpl.handleEditorAction) {
|
|
@@ -67419,24 +67738,6 @@ function handleNormalInputMode({
|
|
|
67419
67738
|
}
|
|
67420
67739
|
}
|
|
67421
67740
|
|
|
67422
|
-
// src/tui/components/items-editor/keybind-visibility.ts
|
|
67423
|
-
function isProgressMode(widget) {
|
|
67424
|
-
const mode = widget.metadata?.display;
|
|
67425
|
-
return mode === "progress" || mode === "progress-short";
|
|
67426
|
-
}
|
|
67427
|
-
function shouldShowCustomKeybind(widget, keybind) {
|
|
67428
|
-
if (keybind.action === "edit-list-limit") {
|
|
67429
|
-
return widget.type === "skills" && widget.metadata?.mode === "list";
|
|
67430
|
-
}
|
|
67431
|
-
if (keybind.action === "toggle-invert") {
|
|
67432
|
-
return isProgressMode(widget);
|
|
67433
|
-
}
|
|
67434
|
-
if (keybind.action === "toggle-compact") {
|
|
67435
|
-
return !isProgressMode(widget);
|
|
67436
|
-
}
|
|
67437
|
-
return true;
|
|
67438
|
-
}
|
|
67439
|
-
|
|
67440
67741
|
// src/tui/components/ItemsEditor.tsx
|
|
67441
67742
|
var jsx_dev_runtime12 = __toESM(require_jsx_dev_runtime(), 1);
|
|
67442
67743
|
var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
@@ -67473,11 +67774,11 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
67473
67774
|
const handleEditorCancel = () => {
|
|
67474
67775
|
setCustomEditorWidget(null);
|
|
67475
67776
|
};
|
|
67476
|
-
const
|
|
67777
|
+
const getCustomKeybindsForWidget = (widgetImpl, widget) => {
|
|
67477
67778
|
if (!widgetImpl.getCustomKeybinds) {
|
|
67478
67779
|
return [];
|
|
67479
67780
|
}
|
|
67480
|
-
return widgetImpl.getCustomKeybinds(
|
|
67781
|
+
return widgetImpl.getCustomKeybinds(widget);
|
|
67481
67782
|
};
|
|
67482
67783
|
const openWidgetPicker = (action) => {
|
|
67483
67784
|
if (widgetCatalog.length === 0) {
|
|
@@ -67562,7 +67863,7 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
67562
67863
|
setMoveMode,
|
|
67563
67864
|
setShowClearConfirm,
|
|
67564
67865
|
openWidgetPicker,
|
|
67565
|
-
|
|
67866
|
+
getCustomKeybindsForWidget,
|
|
67566
67867
|
setCustomEditorWidget
|
|
67567
67868
|
});
|
|
67568
67869
|
});
|
|
@@ -67599,7 +67900,7 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
67599
67900
|
const widgetImpl = getWidget(currentWidget.type);
|
|
67600
67901
|
if (widgetImpl) {
|
|
67601
67902
|
canToggleRaw = widgetImpl.supportsRawValue();
|
|
67602
|
-
customKeybinds =
|
|
67903
|
+
customKeybinds = getCustomKeybindsForWidget(widgetImpl, currentWidget);
|
|
67603
67904
|
} else {
|
|
67604
67905
|
canToggleRaw = false;
|
|
67605
67906
|
}
|
|
@@ -70307,7 +70608,8 @@ var StatusJSONSchema = exports_external.looseObject({
|
|
|
70307
70608
|
]).nullable().optional(),
|
|
70308
70609
|
used_percentage: CoercedNumberSchema.nullable().optional(),
|
|
70309
70610
|
remaining_percentage: CoercedNumberSchema.nullable().optional()
|
|
70310
|
-
}).nullable().optional()
|
|
70611
|
+
}).nullable().optional(),
|
|
70612
|
+
vim: exports_external.object({ mode: exports_external.string().optional() }).nullable().optional()
|
|
70311
70613
|
});
|
|
70312
70614
|
|
|
70313
70615
|
// src/ccstatusline.ts
|
|
@@ -70414,8 +70716,8 @@ async function ensureWindowsUtf8CodePage() {
|
|
|
70414
70716
|
return;
|
|
70415
70717
|
}
|
|
70416
70718
|
try {
|
|
70417
|
-
const { execFileSync } = await import("child_process");
|
|
70418
|
-
|
|
70719
|
+
const { execFileSync: execFileSync2 } = await import("child_process");
|
|
70720
|
+
execFileSync2("chcp.com", ["65001"], { stdio: "ignore" });
|
|
70419
70721
|
} catch {}
|
|
70420
70722
|
}
|
|
70421
70723
|
async function renderMultipleLines(data) {
|