ccstatusline 2.2.15 → 2.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/ccstatusline.js +214 -254
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,9 +47,10 @@
|
|
|
47
47
|
|
|
48
48
|
## 🆕 Recent Updates
|
|
49
49
|
|
|
50
|
-
### v2.2.14 - Version pinning
|
|
50
|
+
### v2.2.14 - v2.2.16 - Version pinning and npm trusted publishing with provenance attestation
|
|
51
51
|
|
|
52
52
|
- **📌 Version pinning support** - Added support for pinned global installs so Claude Code can keep running a specific ccstatusline version.
|
|
53
|
+
- **🔐 npm provenance attestations** - Published packages now use trusted publishing provenance so users can verify where releases were built while avoiding long-lived npm publish tokens.
|
|
53
54
|
- **🔄 Moving from auto-update installs** - If you currently use an auto-updating install, use the TUI uninstall option first, then reinstall to go through the version pinning flow. Your ccstatusline settings are preserved when uninstalling.
|
|
54
55
|
|
|
55
56
|
### v2.2.13 - Weekly model usage, voice status, hooks, and docs
|
package/dist/ccstatusline.js
CHANGED
|
@@ -9713,7 +9713,7 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet
|
|
|
9713
9713
|
offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
|
|
9714
9714
|
offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden;
|
|
9715
9715
|
commitReconciliationEffects(finishedWork);
|
|
9716
|
-
if (flags & 8192 && (root = finishedWork.stateNode, root._visibility = hoistableRoot ? root._visibility & -2 : root._visibility | 1, hoistableRoot && (current2 === null || wasHidden || offscreenSubtreeIsHidden || offscreenSubtreeWasHidden || recursivelyTraverseDisappearLayoutEffects(finishedWork)), supportsMutation))
|
|
9716
|
+
if (flags & 8192 && (root = finishedWork.stateNode, root._visibility = hoistableRoot ? root._visibility & -2 : root._visibility | 1, hoistableRoot && (current2 === null || wasHidden || offscreenSubtreeIsHidden || offscreenSubtreeWasHidden || recursivelyTraverseDisappearLayoutEffects(finishedWork)), supportsMutation)) {
|
|
9717
9717
|
a:
|
|
9718
9718
|
if (current2 = null, supportsMutation)
|
|
9719
9719
|
for (root = finishedWork;; ) {
|
|
@@ -9753,6 +9753,7 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet
|
|
|
9753
9753
|
root.sibling.return = root.return;
|
|
9754
9754
|
root = root.sibling;
|
|
9755
9755
|
}
|
|
9756
|
+
}
|
|
9756
9757
|
flags & 4 && (flags = finishedWork.updateQueue, flags !== null && (current2 = flags.retryQueue, current2 !== null && (flags.retryQueue = null, attachSuspenseRetryListeners(finishedWork, current2))));
|
|
9757
9758
|
break;
|
|
9758
9759
|
case 19:
|
|
@@ -13315,21 +13316,23 @@ var require_react_reconciler = __commonJS((exports, module) => {
|
|
|
13315
13316
|
}
|
|
13316
13317
|
});
|
|
13317
13318
|
|
|
13318
|
-
// node_modules/
|
|
13319
|
+
// node_modules/ansi-regex/index.js
|
|
13319
13320
|
function ansiRegex({ onlyFirst = false } = {}) {
|
|
13320
13321
|
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
13321
|
-
const
|
|
13322
|
-
|
|
13323
|
-
|
|
13324
|
-
].join("|");
|
|
13322
|
+
const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
|
|
13323
|
+
const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
|
|
13324
|
+
const pattern = `${osc}|${csi}`;
|
|
13325
13325
|
return new RegExp(pattern, onlyFirst ? undefined : "g");
|
|
13326
13326
|
}
|
|
13327
13327
|
|
|
13328
|
-
// node_modules/
|
|
13328
|
+
// node_modules/strip-ansi/index.js
|
|
13329
13329
|
function stripAnsi(string) {
|
|
13330
13330
|
if (typeof string !== "string") {
|
|
13331
13331
|
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
13332
13332
|
}
|
|
13333
|
+
if (!string.includes("\x1B") && !string.includes("")) {
|
|
13334
|
+
return string;
|
|
13335
|
+
}
|
|
13333
13336
|
return string.replace(regex, "");
|
|
13334
13337
|
}
|
|
13335
13338
|
var regex;
|
|
@@ -13431,6 +13434,7 @@ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
|
13431
13434
|
}
|
|
13432
13435
|
var init_get_east_asian_width = __esm(() => {
|
|
13433
13436
|
init_lookup();
|
|
13437
|
+
init_lookup();
|
|
13434
13438
|
});
|
|
13435
13439
|
|
|
13436
13440
|
// node_modules/emoji-regex/index.js
|
|
@@ -13532,30 +13536,6 @@ var init_measure_text = __esm(() => {
|
|
|
13532
13536
|
measure_text_default = measureText;
|
|
13533
13537
|
});
|
|
13534
13538
|
|
|
13535
|
-
// node_modules/ansi-regex/index.js
|
|
13536
|
-
function ansiRegex2({ onlyFirst = false } = {}) {
|
|
13537
|
-
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
13538
|
-
const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
|
|
13539
|
-
const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
|
|
13540
|
-
const pattern = `${osc}|${csi}`;
|
|
13541
|
-
return new RegExp(pattern, onlyFirst ? undefined : "g");
|
|
13542
|
-
}
|
|
13543
|
-
|
|
13544
|
-
// node_modules/strip-ansi/index.js
|
|
13545
|
-
function stripAnsi2(string) {
|
|
13546
|
-
if (typeof string !== "string") {
|
|
13547
|
-
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
13548
|
-
}
|
|
13549
|
-
if (!string.includes("\x1B") && !string.includes("")) {
|
|
13550
|
-
return string;
|
|
13551
|
-
}
|
|
13552
|
-
return string.replace(regex2, "");
|
|
13553
|
-
}
|
|
13554
|
-
var regex2;
|
|
13555
|
-
var init_strip_ansi2 = __esm(() => {
|
|
13556
|
-
regex2 = ansiRegex2();
|
|
13557
|
-
});
|
|
13558
|
-
|
|
13559
13539
|
// node_modules/ansi-styles/index.js
|
|
13560
13540
|
function assembleStyles2() {
|
|
13561
13541
|
const codes = new Map;
|
|
@@ -13744,7 +13724,7 @@ var ESCAPES, END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_CSI = "[", ANSI_OSC
|
|
|
13744
13724
|
const characters = [...word];
|
|
13745
13725
|
let isInsideEscape = false;
|
|
13746
13726
|
let isInsideLinkEscape = false;
|
|
13747
|
-
let visible = stringWidth(
|
|
13727
|
+
let visible = stringWidth(stripAnsi(rows.at(-1)));
|
|
13748
13728
|
for (const [index, character] of characters.entries()) {
|
|
13749
13729
|
const characterLength = stringWidth(character);
|
|
13750
13730
|
if (visible + characterLength <= columns) {
|
|
@@ -13880,7 +13860,7 @@ var ESCAPES, END_CODE = 39, ANSI_ESCAPE_BELL = "\x07", ANSI_CSI = "[", ANSI_OSC
|
|
|
13880
13860
|
};
|
|
13881
13861
|
var init_wrap_ansi = __esm(() => {
|
|
13882
13862
|
init_string_width();
|
|
13883
|
-
|
|
13863
|
+
init_strip_ansi();
|
|
13884
13864
|
init_ansi_styles2();
|
|
13885
13865
|
ESCAPES = new Set([
|
|
13886
13866
|
"\x1B",
|
|
@@ -18075,7 +18055,7 @@ var require_backend = __commonJS((exports, module) => {
|
|
|
18075
18055
|
987: (module2, __unused_webpack_exports, __webpack_require__2) => {
|
|
18076
18056
|
if (true) {
|
|
18077
18057
|
module2.exports = __webpack_require__2(786);
|
|
18078
|
-
}
|
|
18058
|
+
}
|
|
18079
18059
|
},
|
|
18080
18060
|
126: (__unused_webpack_module, exports2, __webpack_require__2) => {
|
|
18081
18061
|
var process4 = __webpack_require__2(169);
|
|
@@ -18525,7 +18505,7 @@ var require_backend = __commonJS((exports, module) => {
|
|
|
18525
18505
|
189: (module2, __unused_webpack_exports, __webpack_require__2) => {
|
|
18526
18506
|
if (true) {
|
|
18527
18507
|
module2.exports = __webpack_require__2(126);
|
|
18528
|
-
}
|
|
18508
|
+
}
|
|
18529
18509
|
},
|
|
18530
18510
|
206: function(module2, exports2, __webpack_require__2) {
|
|
18531
18511
|
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
|
|
@@ -18540,7 +18520,7 @@ var require_backend = __commonJS((exports, module) => {
|
|
|
18540
18520
|
(function(root, factory) {
|
|
18541
18521
|
if (true) {
|
|
18542
18522
|
__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__2(430)], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports2, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module2.exports = __WEBPACK_AMD_DEFINE_RESULT__);
|
|
18543
|
-
}
|
|
18523
|
+
}
|
|
18544
18524
|
})(this, function ErrorStackParser(StackFrame) {
|
|
18545
18525
|
var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/;
|
|
18546
18526
|
var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
|
|
@@ -19236,7 +19216,7 @@ var require_backend = __commonJS((exports, module) => {
|
|
|
19236
19216
|
(function(root, factory) {
|
|
19237
19217
|
if (true) {
|
|
19238
19218
|
__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports2, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module2.exports = __WEBPACK_AMD_DEFINE_RESULT__);
|
|
19239
|
-
}
|
|
19219
|
+
}
|
|
19240
19220
|
})(this, function() {
|
|
19241
19221
|
function _isNumber(n) {
|
|
19242
19222
|
return !isNaN(parseFloat(n)) && isFinite(n);
|
|
@@ -24610,7 +24590,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
24610
24590
|
var suffix = "";
|
|
24611
24591
|
if (true) {
|
|
24612
24592
|
suffix = " (<anonymous>)";
|
|
24613
|
-
}
|
|
24593
|
+
}
|
|
24614
24594
|
return `
|
|
24615
24595
|
` + prefix + name + suffix;
|
|
24616
24596
|
}
|
|
@@ -27339,7 +27319,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
27339
27319
|
hasChanges = true;
|
|
27340
27320
|
updateMostRecentlyInspectedElementIfNecessary(devtoolsInstance.id);
|
|
27341
27321
|
}
|
|
27342
|
-
}
|
|
27322
|
+
}
|
|
27343
27323
|
}
|
|
27344
27324
|
} catch (err) {
|
|
27345
27325
|
_iterator2.e(err);
|
|
@@ -29118,7 +29098,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
29118
29098
|
if (contentFiber === null) {
|
|
29119
29099
|
throw new Error("There should always be an Offscreen Fiber child in a hydrated Suspense boundary.");
|
|
29120
29100
|
}
|
|
29121
|
-
}
|
|
29101
|
+
}
|
|
29122
29102
|
var _isTimedOut = fiber.memoizedState !== null;
|
|
29123
29103
|
if (!_isTimedOut) {
|
|
29124
29104
|
newSuspenseNode.rects = measureInstance(newInstance);
|
|
@@ -29152,7 +29132,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
29152
29132
|
if (_contentFiber === null) {
|
|
29153
29133
|
throw new Error("There should always be an Offscreen Fiber child in a hydrated Suspense boundary.");
|
|
29154
29134
|
}
|
|
29155
|
-
}
|
|
29135
|
+
}
|
|
29156
29136
|
var suspenseState = fiber.memoizedState;
|
|
29157
29137
|
var _isTimedOut3 = suspenseState !== null;
|
|
29158
29138
|
if (!_isTimedOut3) {
|
|
@@ -29252,7 +29232,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
29252
29232
|
trackThrownPromisesFromRetryCache(newSuspenseNode, fiber.stateNode);
|
|
29253
29233
|
mountSuspenseChildrenRecursively(_contentFiber2, traceNearestHostComponentUpdate, stashedSuspenseParent, stashedSuspensePrevious, stashedSuspenseRemaining);
|
|
29254
29234
|
shouldPopSuspenseNode = false;
|
|
29255
|
-
}
|
|
29235
|
+
}
|
|
29256
29236
|
} else {
|
|
29257
29237
|
if (fiber.child !== null) {
|
|
29258
29238
|
mountChildrenRecursively(fiber.child, traceNearestHostComponentUpdate);
|
|
@@ -29838,7 +29818,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
29838
29818
|
shouldPopSuspenseNode = false;
|
|
29839
29819
|
} else if (previousHydrated && !nextHydrated) {
|
|
29840
29820
|
throw new Error("Encountered a dehydrated Suspense boundary that was previously hydrated.");
|
|
29841
|
-
}
|
|
29821
|
+
}
|
|
29842
29822
|
} else {
|
|
29843
29823
|
if (nextFiber.child !== prevFiber.child) {
|
|
29844
29824
|
updateFlags |= updateChildrenRecursively(nextFiber.child, prevFiber.child, traceNearestHostComponentUpdate);
|
|
@@ -29884,8 +29864,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
29884
29864
|
recordResetChildren(fiberInstance);
|
|
29885
29865
|
}
|
|
29886
29866
|
updateFlags &= ~ShouldResetChildren;
|
|
29887
|
-
}
|
|
29888
|
-
}
|
|
29867
|
+
}
|
|
29868
|
+
}
|
|
29889
29869
|
if ((updateFlags & ShouldResetSuspenseChildren) !== NoUpdate) {
|
|
29890
29870
|
if (fiberInstance !== null && fiberInstance.kind === FIBER_INSTANCE) {
|
|
29891
29871
|
var _suspenseNode3 = fiberInstance.suspenseNode;
|
|
@@ -29893,7 +29873,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
29893
29873
|
recordResetSuspenseChildren(_suspenseNode3);
|
|
29894
29874
|
updateFlags &= ~ShouldResetSuspenseChildren;
|
|
29895
29875
|
}
|
|
29896
|
-
}
|
|
29876
|
+
}
|
|
29897
29877
|
}
|
|
29898
29878
|
if ((updateFlags & ShouldResetParentSuspenseChildren) !== NoUpdate) {
|
|
29899
29879
|
if (fiberInstance !== null && fiberInstance.kind === FIBER_INSTANCE) {
|
|
@@ -29902,7 +29882,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
29902
29882
|
updateFlags &= ~ShouldResetParentSuspenseChildren;
|
|
29903
29883
|
updateFlags |= ShouldResetSuspenseChildren;
|
|
29904
29884
|
}
|
|
29905
|
-
}
|
|
29885
|
+
}
|
|
29906
29886
|
}
|
|
29907
29887
|
return updateFlags;
|
|
29908
29888
|
} finally {
|
|
@@ -32966,7 +32946,7 @@ The error thrown in the component is:
|
|
|
32966
32946
|
rendererInterface = renderer_attach(hook, id, renderer, global2, shouldStartProfilingNow, profilingSettings);
|
|
32967
32947
|
} else if (renderer.ComponentTree) {
|
|
32968
32948
|
rendererInterface = legacy_renderer_attach(hook, id, renderer, global2);
|
|
32969
|
-
}
|
|
32949
|
+
}
|
|
32970
32950
|
}
|
|
32971
32951
|
return rendererInterface;
|
|
32972
32952
|
}
|
|
@@ -34421,8 +34401,8 @@ function indentString(string, count = 1, options = {}) {
|
|
|
34421
34401
|
if (count === 0) {
|
|
34422
34402
|
return string;
|
|
34423
34403
|
}
|
|
34424
|
-
const
|
|
34425
|
-
return string.replace(
|
|
34404
|
+
const regex2 = includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
|
|
34405
|
+
return string.replace(regex2, indent.repeat(count));
|
|
34426
34406
|
}
|
|
34427
34407
|
|
|
34428
34408
|
// node_modules/ink/build/get-max-width.js
|
|
@@ -34528,7 +34508,7 @@ var require_cli_boxes = __commonJS((exports, module) => {
|
|
|
34528
34508
|
});
|
|
34529
34509
|
|
|
34530
34510
|
// node_modules/ink/build/colorize.js
|
|
34531
|
-
var rgbRegex,
|
|
34511
|
+
var rgbRegex, ansiRegex2, isNamedColor = (color) => {
|
|
34532
34512
|
return color in source_default;
|
|
34533
34513
|
}, colorize = (str, color, type) => {
|
|
34534
34514
|
if (!color) {
|
|
@@ -34545,7 +34525,7 @@ var rgbRegex, ansiRegex3, isNamedColor = (color) => {
|
|
|
34545
34525
|
return type === "foreground" ? source_default.hex(color)(str) : source_default.bgHex(color)(str);
|
|
34546
34526
|
}
|
|
34547
34527
|
if (color.startsWith("ansi256")) {
|
|
34548
|
-
const matches2 =
|
|
34528
|
+
const matches2 = ansiRegex2.exec(color);
|
|
34549
34529
|
if (!matches2) {
|
|
34550
34530
|
return str;
|
|
34551
34531
|
}
|
|
@@ -34567,7 +34547,7 @@ var rgbRegex, ansiRegex3, isNamedColor = (color) => {
|
|
|
34567
34547
|
var init_colorize = __esm(() => {
|
|
34568
34548
|
init_source();
|
|
34569
34549
|
rgbRegex = /^rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/;
|
|
34570
|
-
|
|
34550
|
+
ansiRegex2 = /^ansi256\(\s?(\d+)\s?\)$/;
|
|
34571
34551
|
colorize_default = colorize;
|
|
34572
34552
|
});
|
|
34573
34553
|
|
|
@@ -34777,94 +34757,15 @@ var init_render_node_to_output = __esm(async () => {
|
|
|
34777
34757
|
render_node_to_output_default = renderNodeToOutput;
|
|
34778
34758
|
});
|
|
34779
34759
|
|
|
34780
|
-
// node_modules/slice-ansi/node_modules/is-fullwidth-code-point/node_modules/get-east-asian-width/lookup-data.js
|
|
34781
|
-
var ambiguousRanges2, fullwidthRanges2, halfwidthRanges2, narrowRanges2, wideRanges2;
|
|
34782
|
-
var init_lookup_data2 = __esm(() => {
|
|
34783
|
-
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];
|
|
34784
|
-
fullwidthRanges2 = [12288, 12288, 65281, 65376, 65504, 65510];
|
|
34785
|
-
halfwidthRanges2 = [8361, 8361, 65377, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65512, 65518];
|
|
34786
|
-
narrowRanges2 = [32, 126, 162, 163, 165, 166, 172, 172, 175, 175, 10214, 10221, 10629, 10630];
|
|
34787
|
-
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];
|
|
34788
|
-
});
|
|
34789
|
-
|
|
34790
|
-
// node_modules/slice-ansi/node_modules/is-fullwidth-code-point/node_modules/get-east-asian-width/utilities.js
|
|
34791
|
-
var isInRange2 = (ranges, codePoint) => {
|
|
34792
|
-
let low = 0;
|
|
34793
|
-
let high = Math.floor(ranges.length / 2) - 1;
|
|
34794
|
-
while (low <= high) {
|
|
34795
|
-
const mid = Math.floor((low + high) / 2);
|
|
34796
|
-
const i = mid * 2;
|
|
34797
|
-
if (codePoint < ranges[i]) {
|
|
34798
|
-
high = mid - 1;
|
|
34799
|
-
} else if (codePoint > ranges[i + 1]) {
|
|
34800
|
-
low = mid + 1;
|
|
34801
|
-
} else {
|
|
34802
|
-
return true;
|
|
34803
|
-
}
|
|
34804
|
-
}
|
|
34805
|
-
return false;
|
|
34806
|
-
};
|
|
34807
|
-
|
|
34808
|
-
// node_modules/slice-ansi/node_modules/is-fullwidth-code-point/node_modules/get-east-asian-width/lookup.js
|
|
34809
|
-
function findWideFastPathRange2(ranges) {
|
|
34810
|
-
let fastPathStart = ranges[0];
|
|
34811
|
-
let fastPathEnd = ranges[1];
|
|
34812
|
-
for (let index = 0;index < ranges.length; index += 2) {
|
|
34813
|
-
const start = ranges[index];
|
|
34814
|
-
const end = ranges[index + 1];
|
|
34815
|
-
if (commonCjkCodePoint2 >= start && commonCjkCodePoint2 <= end) {
|
|
34816
|
-
return [start, end];
|
|
34817
|
-
}
|
|
34818
|
-
if (end - start > fastPathEnd - fastPathStart) {
|
|
34819
|
-
fastPathStart = start;
|
|
34820
|
-
fastPathEnd = end;
|
|
34821
|
-
}
|
|
34822
|
-
}
|
|
34823
|
-
return [fastPathStart, fastPathEnd];
|
|
34824
|
-
}
|
|
34825
|
-
var minimumAmbiguousCodePoint2, maximumAmbiguousCodePoint2, minimumFullWidthCodePoint2, maximumFullWidthCodePoint2, minimumHalfWidthCodePoint2, maximumHalfWidthCodePoint2, minimumNarrowCodePoint2, maximumNarrowCodePoint2, minimumWideCodePoint2, maximumWideCodePoint2, commonCjkCodePoint2 = 19968, wideFastPathStart2, wideFastPathEnd2, isFullWidth2 = (codePoint) => {
|
|
34826
|
-
if (codePoint < minimumFullWidthCodePoint2 || codePoint > maximumFullWidthCodePoint2) {
|
|
34827
|
-
return false;
|
|
34828
|
-
}
|
|
34829
|
-
return isInRange2(fullwidthRanges2, codePoint);
|
|
34830
|
-
}, isWide2 = (codePoint) => {
|
|
34831
|
-
if (codePoint >= wideFastPathStart2 && codePoint <= wideFastPathEnd2) {
|
|
34832
|
-
return true;
|
|
34833
|
-
}
|
|
34834
|
-
if (codePoint < minimumWideCodePoint2 || codePoint > maximumWideCodePoint2) {
|
|
34835
|
-
return false;
|
|
34836
|
-
}
|
|
34837
|
-
return isInRange2(wideRanges2, codePoint);
|
|
34838
|
-
};
|
|
34839
|
-
var init_lookup2 = __esm(() => {
|
|
34840
|
-
init_lookup_data2();
|
|
34841
|
-
minimumAmbiguousCodePoint2 = ambiguousRanges2[0];
|
|
34842
|
-
maximumAmbiguousCodePoint2 = ambiguousRanges2.at(-1);
|
|
34843
|
-
minimumFullWidthCodePoint2 = fullwidthRanges2[0];
|
|
34844
|
-
maximumFullWidthCodePoint2 = fullwidthRanges2.at(-1);
|
|
34845
|
-
minimumHalfWidthCodePoint2 = halfwidthRanges2[0];
|
|
34846
|
-
maximumHalfWidthCodePoint2 = halfwidthRanges2.at(-1);
|
|
34847
|
-
minimumNarrowCodePoint2 = narrowRanges2[0];
|
|
34848
|
-
maximumNarrowCodePoint2 = narrowRanges2.at(-1);
|
|
34849
|
-
minimumWideCodePoint2 = wideRanges2[0];
|
|
34850
|
-
maximumWideCodePoint2 = wideRanges2.at(-1);
|
|
34851
|
-
[wideFastPathStart2, wideFastPathEnd2] = findWideFastPathRange2(wideRanges2);
|
|
34852
|
-
});
|
|
34853
|
-
|
|
34854
|
-
// node_modules/slice-ansi/node_modules/is-fullwidth-code-point/node_modules/get-east-asian-width/index.js
|
|
34855
|
-
var init_get_east_asian_width2 = __esm(() => {
|
|
34856
|
-
init_lookup2();
|
|
34857
|
-
});
|
|
34858
|
-
|
|
34859
34760
|
// node_modules/slice-ansi/node_modules/is-fullwidth-code-point/index.js
|
|
34860
34761
|
function isFullwidthCodePoint2(codePoint) {
|
|
34861
34762
|
if (!Number.isInteger(codePoint)) {
|
|
34862
34763
|
return false;
|
|
34863
34764
|
}
|
|
34864
|
-
return
|
|
34765
|
+
return isFullWidth(codePoint) || isWide(codePoint);
|
|
34865
34766
|
}
|
|
34866
34767
|
var init_is_fullwidth_code_point = __esm(() => {
|
|
34867
|
-
|
|
34768
|
+
init_get_east_asian_width();
|
|
34868
34769
|
});
|
|
34869
34770
|
|
|
34870
34771
|
// node_modules/slice-ansi/index.js
|
|
@@ -34923,15 +34824,15 @@ function tokenize(string, endCharacter = Number.POSITIVE_INFINITY) {
|
|
|
34923
34824
|
continue;
|
|
34924
34825
|
}
|
|
34925
34826
|
}
|
|
34926
|
-
const
|
|
34827
|
+
const isFullWidth2 = isFullwidthCodePoint2(codePoint);
|
|
34927
34828
|
const character = String.fromCodePoint(codePoint);
|
|
34928
34829
|
returnValue.push({
|
|
34929
34830
|
type: "character",
|
|
34930
34831
|
value: character,
|
|
34931
|
-
isFullWidth:
|
|
34832
|
+
isFullWidth: isFullWidth2
|
|
34932
34833
|
});
|
|
34933
34834
|
index += character.length;
|
|
34934
|
-
visibleCount +=
|
|
34835
|
+
visibleCount += isFullWidth2 ? 2 : character.length;
|
|
34935
34836
|
if (visibleCount >= endCharacter) {
|
|
34936
34837
|
break;
|
|
34937
34838
|
}
|
|
@@ -39447,8 +39348,8 @@ function emoji() {
|
|
|
39447
39348
|
}
|
|
39448
39349
|
function timeSource(args) {
|
|
39449
39350
|
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
39450
|
-
const
|
|
39451
|
-
return
|
|
39351
|
+
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+)?)?`;
|
|
39352
|
+
return regex2;
|
|
39452
39353
|
}
|
|
39453
39354
|
function time(args) {
|
|
39454
39355
|
return new RegExp(`^${timeSource(args)}$`);
|
|
@@ -39477,8 +39378,8 @@ var cuid, cuid2, ulid, xid, ksuid, nanoid, duration, extendedDuration, guid, uui
|
|
|
39477
39378
|
const escapedDelim = escapeRegex(delimiter ?? ":");
|
|
39478
39379
|
return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);
|
|
39479
39380
|
}, 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) => {
|
|
39480
|
-
const
|
|
39481
|
-
return new RegExp(`^${
|
|
39381
|
+
const regex2 = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
39382
|
+
return new RegExp(`^${regex2}$`);
|
|
39482
39383
|
}, 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;
|
|
39483
39384
|
var init_regexes = __esm(() => {
|
|
39484
39385
|
init_util();
|
|
@@ -49099,7 +49000,7 @@ function finalize(ctx, schema) {
|
|
|
49099
49000
|
result2.$schema = "http://json-schema.org/draft-07/schema#";
|
|
49100
49001
|
} else if (ctx.target === "draft-04") {
|
|
49101
49002
|
result2.$schema = "http://json-schema.org/draft-04/schema#";
|
|
49102
|
-
} else if (ctx.target === "openapi-3.0") {}
|
|
49003
|
+
} else if (ctx.target === "openapi-3.0") {}
|
|
49103
49004
|
if (ctx.external?.uri) {
|
|
49104
49005
|
const id = ctx.external.registry.get(schema)?.id;
|
|
49105
49006
|
if (!id)
|
|
@@ -49267,9 +49168,9 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
49267
49168
|
json.pattern = regexes[0].source;
|
|
49268
49169
|
else if (regexes.length > 1) {
|
|
49269
49170
|
json.allOf = [
|
|
49270
|
-
...regexes.map((
|
|
49171
|
+
...regexes.map((regex2) => ({
|
|
49271
49172
|
...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
|
|
49272
|
-
pattern:
|
|
49173
|
+
pattern: regex2.source
|
|
49273
49174
|
}))
|
|
49274
49175
|
];
|
|
49275
49176
|
}
|
|
@@ -49364,7 +49265,7 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
49364
49265
|
if (val === undefined) {
|
|
49365
49266
|
if (ctx.unrepresentable === "throw") {
|
|
49366
49267
|
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
49367
|
-
}
|
|
49268
|
+
}
|
|
49368
49269
|
} else if (typeof val === "bigint") {
|
|
49369
49270
|
if (ctx.unrepresentable === "throw") {
|
|
49370
49271
|
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
@@ -50484,10 +50385,10 @@ function hex2(_params) {
|
|
|
50484
50385
|
function hash(alg, params) {
|
|
50485
50386
|
const enc = params?.enc ?? "hex";
|
|
50486
50387
|
const format = `${alg}_${enc}`;
|
|
50487
|
-
const
|
|
50488
|
-
if (!
|
|
50388
|
+
const regex2 = exports_regexes[format];
|
|
50389
|
+
if (!regex2)
|
|
50489
50390
|
throw new Error(`Unrecognized hash format: ${format}`);
|
|
50490
|
-
return _stringFormat(ZodCustomStringFormat, format,
|
|
50391
|
+
return _stringFormat(ZodCustomStringFormat, format, regex2, params);
|
|
50491
50392
|
}
|
|
50492
50393
|
function number2(params) {
|
|
50493
50394
|
return _number(ZodNumber, params);
|
|
@@ -55256,8 +55157,8 @@ function createUnicodePropertyRegex(pattern) {
|
|
|
55256
55157
|
return null;
|
|
55257
55158
|
}
|
|
55258
55159
|
}
|
|
55259
|
-
function matchesUnicodeProperty(character,
|
|
55260
|
-
return
|
|
55160
|
+
function matchesUnicodeProperty(character, regex2) {
|
|
55161
|
+
return regex2?.test(character) ?? false;
|
|
55261
55162
|
}
|
|
55262
55163
|
function isVariationSelector(codePoint) {
|
|
55263
55164
|
return codePoint >= VARIATION_SELECTOR_START && codePoint <= VARIATION_SELECTOR_END || codePoint >= VARIATION_SELECTOR_SUPPLEMENT_START && codePoint <= VARIATION_SELECTOR_SUPPLEMENT_END;
|
|
@@ -55748,8 +55649,8 @@ function getColorAnsiCode(colorName, colorLevel = "ansi16", isBackground = false
|
|
|
55748
55649
|
}
|
|
55749
55650
|
const colored = chalkFn("TEST");
|
|
55750
55651
|
const escapeChar = "\x1B";
|
|
55751
|
-
const
|
|
55752
|
-
const match =
|
|
55652
|
+
const ansiRegex3 = new RegExp(`^(${escapeChar.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\[[^m]+m)`);
|
|
55653
|
+
const match = ansiRegex3.exec(colored);
|
|
55753
55654
|
return match?.[1] ?? "";
|
|
55754
55655
|
}
|
|
55755
55656
|
function getColorDisplayName(colorName) {
|
|
@@ -56138,16 +56039,26 @@ function getTTYForProcess(pid) {
|
|
|
56138
56039
|
}
|
|
56139
56040
|
}
|
|
56140
56041
|
function getWidthForTTY(tty2) {
|
|
56141
|
-
|
|
56142
|
-
|
|
56143
|
-
|
|
56144
|
-
|
|
56145
|
-
|
|
56146
|
-
|
|
56147
|
-
|
|
56148
|
-
|
|
56149
|
-
|
|
56042
|
+
const devicePath = `/dev/${tty2}`;
|
|
56043
|
+
const attempts = [
|
|
56044
|
+
`stty -F ${devicePath} size`,
|
|
56045
|
+
`stty -f ${devicePath} size`,
|
|
56046
|
+
`stty size < ${devicePath}`
|
|
56047
|
+
];
|
|
56048
|
+
for (const cmd of attempts) {
|
|
56049
|
+
try {
|
|
56050
|
+
const width = execSync(`${cmd} 2>/dev/null | awk '{print $2}'`, {
|
|
56051
|
+
encoding: "utf8",
|
|
56052
|
+
stdio: ["pipe", "pipe", "ignore"],
|
|
56053
|
+
shell: "/bin/sh"
|
|
56054
|
+
}).trim();
|
|
56055
|
+
const parsed = parsePositiveInteger(width);
|
|
56056
|
+
if (parsed !== null) {
|
|
56057
|
+
return parsed;
|
|
56058
|
+
}
|
|
56059
|
+
} catch {}
|
|
56150
56060
|
}
|
|
56061
|
+
return null;
|
|
56151
56062
|
}
|
|
56152
56063
|
function getTerminalWidth() {
|
|
56153
56064
|
return probeTerminalWidth();
|
|
@@ -56155,7 +56066,7 @@ function getTerminalWidth() {
|
|
|
56155
56066
|
function canDetectTerminalWidth() {
|
|
56156
56067
|
return probeTerminalWidth() !== null;
|
|
56157
56068
|
}
|
|
56158
|
-
var __dirname = "/
|
|
56069
|
+
var __dirname = "/home/runner/work/ccstatusline/ccstatusline/src/utils", PACKAGE_VERSION = "2.2.17";
|
|
56159
56070
|
var init_terminal = () => {};
|
|
56160
56071
|
|
|
56161
56072
|
// src/utils/renderer.ts
|
|
@@ -59529,6 +59440,9 @@ import * as fs3 from "fs";
|
|
|
59529
59440
|
import * as https from "https";
|
|
59530
59441
|
import * as os4 from "os";
|
|
59531
59442
|
import * as path3 from "path";
|
|
59443
|
+
function getUsageApiBucketUtilization(bucket) {
|
|
59444
|
+
return bucket === null ? 0 : bucket?.utilization ?? undefined;
|
|
59445
|
+
}
|
|
59532
59446
|
function parseJsonWithSchema(rawJson, schema) {
|
|
59533
59447
|
try {
|
|
59534
59448
|
const parsed = schema.safeParse(JSON.parse(rawJson));
|
|
@@ -59569,13 +59483,13 @@ function parseUsageApiResponse(rawJson) {
|
|
|
59569
59483
|
return null;
|
|
59570
59484
|
}
|
|
59571
59485
|
return {
|
|
59572
|
-
sessionUsage: parsed.five_hour
|
|
59486
|
+
sessionUsage: getUsageApiBucketUtilization(parsed.five_hour),
|
|
59573
59487
|
sessionResetAt: parsed.five_hour?.resets_at ?? undefined,
|
|
59574
|
-
weeklyUsage: parsed.seven_day
|
|
59488
|
+
weeklyUsage: getUsageApiBucketUtilization(parsed.seven_day),
|
|
59575
59489
|
weeklyResetAt: parsed.seven_day?.resets_at ?? undefined,
|
|
59576
|
-
weeklySonnetUsage: parsed.seven_day_sonnet
|
|
59490
|
+
weeklySonnetUsage: getUsageApiBucketUtilization(parsed.seven_day_sonnet),
|
|
59577
59491
|
weeklySonnetResetAt: parsed.seven_day_sonnet?.resets_at ?? undefined,
|
|
59578
|
-
weeklyOpusUsage: parsed.seven_day_opus
|
|
59492
|
+
weeklyOpusUsage: getUsageApiBucketUtilization(parsed.seven_day_opus),
|
|
59579
59493
|
weeklyOpusResetAt: parsed.seven_day_opus?.resets_at ?? undefined,
|
|
59580
59494
|
extraUsageEnabled: parsed.extra_usage?.is_enabled ?? undefined,
|
|
59581
59495
|
extraUsageLimit: parsed.extra_usage?.monthly_limit ?? undefined,
|
|
@@ -59900,9 +59814,11 @@ async function fetchUsageData(options = {}) {
|
|
|
59900
59814
|
}
|
|
59901
59815
|
const usageData = parseUsageApiResponse(response.body);
|
|
59902
59816
|
if (!usageData) {
|
|
59817
|
+
writeUsageLock(now2 + LOCK_MAX_AGE, "parse-error");
|
|
59903
59818
|
return getStaleUsageOrError("parse-error", now2, LOCK_MAX_AGE, requiredFields);
|
|
59904
59819
|
}
|
|
59905
59820
|
if (usageData.sessionUsage === undefined && usageData.weeklyUsage === undefined) {
|
|
59821
|
+
writeUsageLock(now2 + LOCK_MAX_AGE, "parse-error");
|
|
59906
59822
|
return getStaleUsageOrError("parse-error", now2, LOCK_MAX_AGE, requiredFields);
|
|
59907
59823
|
}
|
|
59908
59824
|
try {
|
|
@@ -59911,10 +59827,11 @@ async function fetchUsageData(options = {}) {
|
|
|
59911
59827
|
} catch {}
|
|
59912
59828
|
return cacheUsageData(usageData, now2);
|
|
59913
59829
|
} catch {
|
|
59830
|
+
writeUsageLock(now2 + LOCK_MAX_AGE, "parse-error");
|
|
59914
59831
|
return getStaleUsageOrError("parse-error", now2, LOCK_MAX_AGE, requiredFields);
|
|
59915
59832
|
}
|
|
59916
59833
|
}
|
|
59917
|
-
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,
|
|
59834
|
+
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, UsageApiBucketSchema, UsageApiResponseSchema, cachedUsageData = null, usageCacheTime = 0, usageErrorCacheMaxAge, USAGE_API_HOST = "api.anthropic.com", USAGE_API_PATH = "/api/oauth/usage", USAGE_API_TIMEOUT_MS = 5000;
|
|
59918
59835
|
var init_usage_fetch = __esm(async () => {
|
|
59919
59836
|
init_dist5();
|
|
59920
59837
|
init_zod();
|
|
@@ -59925,7 +59842,7 @@ var init_usage_fetch = __esm(async () => {
|
|
|
59925
59842
|
LOCK_FILE = path3.join(CACHE_DIR, "usage.lock");
|
|
59926
59843
|
MACOS_SECURITY_DUMP_MAX_BUFFER = 8 * 1024 * 1024;
|
|
59927
59844
|
UsageCredentialsSchema = exports_external.object({ claudeAiOauth: exports_external.object({ accessToken: exports_external.string().nullable().optional() }).optional() });
|
|
59928
|
-
UsageLockErrorSchema = exports_external.enum(["timeout", "rate-limited"]);
|
|
59845
|
+
UsageLockErrorSchema = exports_external.enum(["timeout", "rate-limited", "parse-error"]);
|
|
59929
59846
|
UsageLockSchema = exports_external.object({
|
|
59930
59847
|
blockedUntil: exports_external.number(),
|
|
59931
59848
|
error: UsageLockErrorSchema.optional()
|
|
@@ -59945,27 +59862,21 @@ var init_usage_fetch = __esm(async () => {
|
|
|
59945
59862
|
extraUsageUtilization: exports_external.number().nullable().optional(),
|
|
59946
59863
|
error: exports_external.string().nullable().optional()
|
|
59947
59864
|
});
|
|
59948
|
-
|
|
59865
|
+
UsageApiBucketSchema = exports_external.looseObject({
|
|
59949
59866
|
utilization: exports_external.number().nullable().optional(),
|
|
59950
59867
|
resets_at: exports_external.string().nullable().optional()
|
|
59951
59868
|
}).nullable().optional();
|
|
59952
|
-
UsageApiResponseSchema = exports_external.
|
|
59953
|
-
five_hour:
|
|
59954
|
-
|
|
59955
|
-
|
|
59956
|
-
|
|
59957
|
-
|
|
59958
|
-
utilization: exports_external.number().nullable().optional(),
|
|
59959
|
-
resets_at: exports_external.string().nullable().optional()
|
|
59960
|
-
}).optional(),
|
|
59961
|
-
seven_day_sonnet: PerModelWeeklyBucketSchema,
|
|
59962
|
-
seven_day_opus: PerModelWeeklyBucketSchema,
|
|
59963
|
-
extra_usage: exports_external.object({
|
|
59869
|
+
UsageApiResponseSchema = exports_external.looseObject({
|
|
59870
|
+
five_hour: UsageApiBucketSchema,
|
|
59871
|
+
seven_day: UsageApiBucketSchema,
|
|
59872
|
+
seven_day_sonnet: UsageApiBucketSchema,
|
|
59873
|
+
seven_day_opus: UsageApiBucketSchema,
|
|
59874
|
+
extra_usage: exports_external.looseObject({
|
|
59964
59875
|
is_enabled: exports_external.boolean().nullable().optional(),
|
|
59965
59876
|
monthly_limit: exports_external.number().nullable().optional(),
|
|
59966
59877
|
used_credits: exports_external.number().nullable().optional(),
|
|
59967
59878
|
utilization: exports_external.number().nullable().optional()
|
|
59968
|
-
}).optional()
|
|
59879
|
+
}).nullable().optional()
|
|
59969
59880
|
});
|
|
59970
59881
|
usageErrorCacheMaxAge = LOCK_MAX_AGE;
|
|
59971
59882
|
});
|
|
@@ -62026,17 +61937,17 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
62026
61937
|
}
|
|
62027
61938
|
const opts = options || {};
|
|
62028
61939
|
const posix = opts.windows;
|
|
62029
|
-
const
|
|
62030
|
-
const state =
|
|
62031
|
-
delete
|
|
61940
|
+
const regex2 = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
|
|
61941
|
+
const state = regex2.state;
|
|
61942
|
+
delete regex2.state;
|
|
62032
61943
|
let isIgnored = () => false;
|
|
62033
61944
|
if (opts.ignore) {
|
|
62034
61945
|
const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
62035
61946
|
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
62036
61947
|
}
|
|
62037
61948
|
const matcher = (input, returnObject = false) => {
|
|
62038
|
-
const { isMatch: isMatch2, match, output } = picomatch.test(input,
|
|
62039
|
-
const result2 = { glob, state, regex:
|
|
61949
|
+
const { isMatch: isMatch2, match, output } = picomatch.test(input, regex2, options, { glob, posix });
|
|
61950
|
+
const result2 = { glob, state, regex: regex2, posix, input, output, match, isMatch: isMatch2 };
|
|
62040
61951
|
if (typeof opts.onResult === "function") {
|
|
62041
61952
|
opts.onResult(result2);
|
|
62042
61953
|
}
|
|
@@ -62061,7 +61972,7 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
62061
61972
|
}
|
|
62062
61973
|
return matcher;
|
|
62063
61974
|
};
|
|
62064
|
-
picomatch.test = (input,
|
|
61975
|
+
picomatch.test = (input, regex2, options, { glob, posix } = {}) => {
|
|
62065
61976
|
if (typeof input !== "string") {
|
|
62066
61977
|
throw new TypeError("Expected input to be a string");
|
|
62067
61978
|
}
|
|
@@ -62078,16 +61989,16 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
62078
61989
|
}
|
|
62079
61990
|
if (match === false || opts.capture === true) {
|
|
62080
61991
|
if (opts.matchBase === true || opts.basename === true) {
|
|
62081
|
-
match = picomatch.matchBase(input,
|
|
61992
|
+
match = picomatch.matchBase(input, regex2, options, posix);
|
|
62082
61993
|
} else {
|
|
62083
|
-
match =
|
|
61994
|
+
match = regex2.exec(output);
|
|
62084
61995
|
}
|
|
62085
61996
|
}
|
|
62086
61997
|
return { isMatch: Boolean(match), match, output };
|
|
62087
61998
|
};
|
|
62088
61999
|
picomatch.matchBase = (input, glob, options) => {
|
|
62089
|
-
const
|
|
62090
|
-
return
|
|
62000
|
+
const regex2 = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
|
62001
|
+
return regex2.test(utils.basename(input));
|
|
62091
62002
|
};
|
|
62092
62003
|
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
62093
62004
|
picomatch.parse = (pattern, options) => {
|
|
@@ -62107,11 +62018,11 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
62107
62018
|
if (state && state.negated === true) {
|
|
62108
62019
|
source = `^(?!${source}).*$`;
|
|
62109
62020
|
}
|
|
62110
|
-
const
|
|
62021
|
+
const regex2 = picomatch.toRegex(source, options);
|
|
62111
62022
|
if (returnState === true) {
|
|
62112
|
-
|
|
62023
|
+
regex2.state = state;
|
|
62113
62024
|
}
|
|
62114
|
-
return
|
|
62025
|
+
return regex2;
|
|
62115
62026
|
};
|
|
62116
62027
|
picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
|
62117
62028
|
if (!input || typeof input !== "string") {
|
|
@@ -64985,10 +64896,11 @@ class SessionUsageWidget {
|
|
|
64985
64896
|
return formatRawOrLabeledValue(item, "Session: ", `${previewPercent.toFixed(1)}%`);
|
|
64986
64897
|
}
|
|
64987
64898
|
const data = context.usageData ?? {};
|
|
64988
|
-
if (data.
|
|
64989
|
-
|
|
64990
|
-
|
|
64899
|
+
if (data.sessionUsage === undefined) {
|
|
64900
|
+
if (data.error)
|
|
64901
|
+
return getUsageErrorMessage(data.error);
|
|
64991
64902
|
return null;
|
|
64903
|
+
}
|
|
64992
64904
|
const percent = Math.max(0, Math.min(100, data.sessionUsage));
|
|
64993
64905
|
const renderedPercent = inverted ? 100 - percent : percent;
|
|
64994
64906
|
const getCursorOptions = () => {
|
|
@@ -65079,10 +64991,11 @@ class WeeklyUsageWidget {
|
|
|
65079
64991
|
return formatRawOrLabeledValue(item, "Weekly: ", `${previewPercent.toFixed(1)}%`);
|
|
65080
64992
|
}
|
|
65081
64993
|
const data = context.usageData ?? {};
|
|
65082
|
-
if (data.
|
|
65083
|
-
|
|
65084
|
-
|
|
64994
|
+
if (data.weeklyUsage === undefined) {
|
|
64995
|
+
if (data.error)
|
|
64996
|
+
return getUsageErrorMessage(data.error);
|
|
65085
64997
|
return null;
|
|
64998
|
+
}
|
|
65086
64999
|
const percent = Math.max(0, Math.min(100, data.weeklyUsage));
|
|
65087
65000
|
const renderedPercent = inverted ? 100 - percent : percent;
|
|
65088
65001
|
const getCursorOptions = () => {
|
|
@@ -65173,10 +65086,11 @@ class WeeklySonnetUsageWidget {
|
|
|
65173
65086
|
return formatRawOrLabeledValue(item, LABEL, `${previewPercent.toFixed(1)}%`);
|
|
65174
65087
|
}
|
|
65175
65088
|
const data = context.usageData ?? {};
|
|
65176
|
-
if (data.
|
|
65177
|
-
|
|
65178
|
-
|
|
65089
|
+
if (data.weeklySonnetUsage === undefined) {
|
|
65090
|
+
if (data.error)
|
|
65091
|
+
return getUsageErrorMessage(data.error);
|
|
65179
65092
|
return null;
|
|
65093
|
+
}
|
|
65180
65094
|
const percent = Math.max(0, Math.min(100, data.weeklySonnetUsage));
|
|
65181
65095
|
const renderedPercent = inverted ? 100 - percent : percent;
|
|
65182
65096
|
const getCursorOptions = () => {
|
|
@@ -65268,10 +65182,11 @@ class WeeklyOpusUsageWidget {
|
|
|
65268
65182
|
return formatRawOrLabeledValue(item, LABEL2, `${previewPercent.toFixed(1)}%`);
|
|
65269
65183
|
}
|
|
65270
65184
|
const data = context.usageData ?? {};
|
|
65271
|
-
if (data.
|
|
65272
|
-
|
|
65273
|
-
|
|
65185
|
+
if (data.weeklyOpusUsage === undefined) {
|
|
65186
|
+
if (data.error)
|
|
65187
|
+
return getUsageErrorMessage(data.error);
|
|
65274
65188
|
return null;
|
|
65189
|
+
}
|
|
65275
65190
|
const percent = Math.max(0, Math.min(100, data.weeklyOpusUsage));
|
|
65276
65191
|
const renderedPercent = inverted ? 100 - percent : percent;
|
|
65277
65192
|
const getCursorOptions = () => {
|
|
@@ -68510,7 +68425,7 @@ gradient.rainbow = rainbow;
|
|
|
68510
68425
|
gradient.pastel = pastel;
|
|
68511
68426
|
|
|
68512
68427
|
// node_modules/ink-gradient/dist/index.js
|
|
68513
|
-
|
|
68428
|
+
init_strip_ansi();
|
|
68514
68429
|
var Gradient = (props) => {
|
|
68515
68430
|
if (props.name && props.colors) {
|
|
68516
68431
|
throw new Error("The `name` and `colors` props are mutually exclusive");
|
|
@@ -68523,7 +68438,7 @@ var Gradient = (props) => {
|
|
|
68523
68438
|
} else {
|
|
68524
68439
|
throw new Error("Either `name` or `colors` prop must be provided");
|
|
68525
68440
|
}
|
|
68526
|
-
const applyGradient2 = (text) => gradient2.multiline(
|
|
68441
|
+
const applyGradient2 = (text) => gradient2.multiline(stripAnsi(text));
|
|
68527
68442
|
const containsBoxDescendant = (nodeChildren) => {
|
|
68528
68443
|
let hasBox = false;
|
|
68529
68444
|
const search = (value) => {
|
|
@@ -75984,32 +75899,99 @@ var USAGE_WIDGET_TYPES = new Set([
|
|
|
75984
75899
|
"reset-timer",
|
|
75985
75900
|
"weekly-reset-timer"
|
|
75986
75901
|
]);
|
|
75987
|
-
var
|
|
75988
|
-
"
|
|
75989
|
-
"
|
|
75990
|
-
|
|
75902
|
+
var USAGE_DATA_FIELDS = [
|
|
75903
|
+
"sessionUsage",
|
|
75904
|
+
"sessionResetAt",
|
|
75905
|
+
"weeklyUsage",
|
|
75906
|
+
"weeklyResetAt",
|
|
75907
|
+
"weeklySonnetUsage",
|
|
75908
|
+
"weeklySonnetResetAt",
|
|
75909
|
+
"weeklyOpusUsage",
|
|
75910
|
+
"weeklyOpusResetAt",
|
|
75911
|
+
"extraUsageEnabled",
|
|
75912
|
+
"extraUsageLimit",
|
|
75913
|
+
"extraUsageUsed",
|
|
75914
|
+
"extraUsageUtilization"
|
|
75915
|
+
];
|
|
75916
|
+
var EMPTY_USAGE_REQUIREMENTS = [];
|
|
75917
|
+
var USAGE_WIDGET_REQUIREMENTS = {
|
|
75918
|
+
"session-usage": [{ field: "sessionUsage" }],
|
|
75919
|
+
"weekly-usage": [{ field: "weeklyUsage" }],
|
|
75920
|
+
"weekly-sonnet-usage": [{ field: "weeklySonnetUsage" }],
|
|
75921
|
+
"weekly-opus-usage": [{ field: "weeklyOpusUsage" }],
|
|
75922
|
+
"block-timer": [{ field: "sessionResetAt" }],
|
|
75923
|
+
"reset-timer": [{ field: "sessionResetAt" }],
|
|
75924
|
+
"weekly-reset-timer": [{ field: "weeklyResetAt" }]
|
|
75925
|
+
};
|
|
75926
|
+
var USAGE_CURSOR_REQUIREMENTS = {
|
|
75927
|
+
"session-usage": { field: "sessionResetAt" },
|
|
75928
|
+
"weekly-usage": { field: "weeklyResetAt" },
|
|
75929
|
+
"weekly-sonnet-usage": { field: "weeklySonnetResetAt", alternatives: ["weeklyResetAt"] },
|
|
75930
|
+
"weekly-opus-usage": { field: "weeklyOpusResetAt", alternatives: ["weeklyResetAt"] }
|
|
75931
|
+
};
|
|
75991
75932
|
function hasUsageDependentWidgets(lines) {
|
|
75992
75933
|
return lines.some((line) => line.some((item) => USAGE_WIDGET_TYPES.has(item.type)));
|
|
75993
75934
|
}
|
|
75994
|
-
function
|
|
75995
|
-
|
|
75996
|
-
|
|
75997
|
-
|
|
75998
|
-
|
|
75935
|
+
function isUsageCursorEnabled2(item) {
|
|
75936
|
+
return item.metadata?.cursor === "true";
|
|
75937
|
+
}
|
|
75938
|
+
function getUsageFieldRequirements(lines) {
|
|
75939
|
+
const requirements = [];
|
|
75999
75940
|
for (const line of lines) {
|
|
76000
75941
|
for (const item of line) {
|
|
76001
|
-
|
|
76002
|
-
|
|
76003
|
-
|
|
76004
|
-
|
|
76005
|
-
requirements.sonnet = true;
|
|
76006
|
-
} else if (item.type === "weekly-opus-usage") {
|
|
76007
|
-
requirements.opus = true;
|
|
75942
|
+
requirements.push(...USAGE_WIDGET_REQUIREMENTS[item.type] ?? EMPTY_USAGE_REQUIREMENTS);
|
|
75943
|
+
const cursorRequirement = USAGE_CURSOR_REQUIREMENTS[item.type];
|
|
75944
|
+
if (cursorRequirement && isUsageCursorEnabled2(item)) {
|
|
75945
|
+
requirements.push(cursorRequirement);
|
|
76008
75946
|
}
|
|
76009
75947
|
}
|
|
76010
75948
|
}
|
|
76011
75949
|
return requirements;
|
|
76012
75950
|
}
|
|
75951
|
+
function hasUsageDataField(data, field) {
|
|
75952
|
+
return data?.[field] !== undefined;
|
|
75953
|
+
}
|
|
75954
|
+
function isUsageRequirementSatisfied(data, requirement) {
|
|
75955
|
+
if (hasUsageDataField(data, requirement.field)) {
|
|
75956
|
+
return true;
|
|
75957
|
+
}
|
|
75958
|
+
return requirement.alternatives?.some((field) => hasUsageDataField(data, field)) ?? false;
|
|
75959
|
+
}
|
|
75960
|
+
function getMissingFetchFields(data, requirements) {
|
|
75961
|
+
const missing = new Set;
|
|
75962
|
+
for (const requirement of requirements) {
|
|
75963
|
+
if (!isUsageRequirementSatisfied(data, requirement)) {
|
|
75964
|
+
missing.add(requirement.field);
|
|
75965
|
+
}
|
|
75966
|
+
}
|
|
75967
|
+
return Array.from(missing);
|
|
75968
|
+
}
|
|
75969
|
+
function hasAnyUsageDataField(data) {
|
|
75970
|
+
return USAGE_DATA_FIELDS.some((field) => data?.[field] !== undefined);
|
|
75971
|
+
}
|
|
75972
|
+
function pickDefinedUsageFields(data) {
|
|
75973
|
+
return {
|
|
75974
|
+
...data?.sessionUsage !== undefined ? { sessionUsage: data.sessionUsage } : {},
|
|
75975
|
+
...data?.sessionResetAt !== undefined ? { sessionResetAt: data.sessionResetAt } : {},
|
|
75976
|
+
...data?.weeklyUsage !== undefined ? { weeklyUsage: data.weeklyUsage } : {},
|
|
75977
|
+
...data?.weeklyResetAt !== undefined ? { weeklyResetAt: data.weeklyResetAt } : {},
|
|
75978
|
+
...data?.weeklySonnetUsage !== undefined ? { weeklySonnetUsage: data.weeklySonnetUsage } : {},
|
|
75979
|
+
...data?.weeklySonnetResetAt !== undefined ? { weeklySonnetResetAt: data.weeklySonnetResetAt } : {},
|
|
75980
|
+
...data?.weeklyOpusUsage !== undefined ? { weeklyOpusUsage: data.weeklyOpusUsage } : {},
|
|
75981
|
+
...data?.weeklyOpusResetAt !== undefined ? { weeklyOpusResetAt: data.weeklyOpusResetAt } : {},
|
|
75982
|
+
...data?.extraUsageEnabled !== undefined ? { extraUsageEnabled: data.extraUsageEnabled } : {},
|
|
75983
|
+
...data?.extraUsageLimit !== undefined ? { extraUsageLimit: data.extraUsageLimit } : {},
|
|
75984
|
+
...data?.extraUsageUsed !== undefined ? { extraUsageUsed: data.extraUsageUsed } : {},
|
|
75985
|
+
...data?.extraUsageUtilization !== undefined ? { extraUsageUtilization: data.extraUsageUtilization } : {}
|
|
75986
|
+
};
|
|
75987
|
+
}
|
|
75988
|
+
function mergeUsageData(rateLimitsData, apiData) {
|
|
75989
|
+
return {
|
|
75990
|
+
...pickDefinedUsageFields(apiData),
|
|
75991
|
+
...pickDefinedUsageFields(rateLimitsData),
|
|
75992
|
+
...apiData.error ? { error: apiData.error } : {}
|
|
75993
|
+
};
|
|
75994
|
+
}
|
|
76013
75995
|
function epochSecondsToIsoString(epochSeconds) {
|
|
76014
75996
|
if (epochSeconds === null || epochSeconds === undefined || !Number.isFinite(epochSeconds)) {
|
|
76015
75997
|
return;
|
|
@@ -76028,10 +76010,7 @@ function extractUsageDataFromRateLimits(rateLimits) {
|
|
|
76028
76010
|
const weeklySonnetResetAt = epochSecondsToIsoString(rateLimits.seven_day_sonnet?.resets_at);
|
|
76029
76011
|
const weeklyOpusUsage = rateLimits.seven_day_opus === null ? 0 : rateLimits.seven_day_opus?.used_percentage ?? undefined;
|
|
76030
76012
|
const weeklyOpusResetAt = epochSecondsToIsoString(rateLimits.seven_day_opus?.resets_at);
|
|
76031
|
-
|
|
76032
|
-
return null;
|
|
76033
|
-
}
|
|
76034
|
-
return {
|
|
76013
|
+
const usageData = {
|
|
76035
76014
|
sessionUsage,
|
|
76036
76015
|
sessionResetAt,
|
|
76037
76016
|
weeklyUsage,
|
|
@@ -76041,39 +76020,20 @@ function extractUsageDataFromRateLimits(rateLimits) {
|
|
|
76041
76020
|
weeklyOpusUsage,
|
|
76042
76021
|
weeklyOpusResetAt
|
|
76043
76022
|
};
|
|
76044
|
-
|
|
76045
|
-
function hasCompleteRateLimitsUsageData(usageData, perModelRequirements) {
|
|
76046
|
-
if (usageData?.sessionUsage === undefined || usageData.sessionResetAt === undefined || usageData.weeklyUsage === undefined || usageData.weeklyResetAt === undefined) {
|
|
76047
|
-
return false;
|
|
76048
|
-
}
|
|
76049
|
-
if (perModelRequirements.sonnet && usageData.weeklySonnetUsage === undefined) {
|
|
76050
|
-
return false;
|
|
76051
|
-
}
|
|
76052
|
-
if (perModelRequirements.opus && usageData.weeklyOpusUsage === undefined) {
|
|
76053
|
-
return false;
|
|
76054
|
-
}
|
|
76055
|
-
return true;
|
|
76056
|
-
}
|
|
76057
|
-
function getRequiredUsageFields(perModelRequirements) {
|
|
76058
|
-
const requiredFields = [];
|
|
76059
|
-
if (perModelRequirements.sonnet) {
|
|
76060
|
-
requiredFields.push("weeklySonnetUsage");
|
|
76061
|
-
}
|
|
76062
|
-
if (perModelRequirements.opus) {
|
|
76063
|
-
requiredFields.push("weeklyOpusUsage");
|
|
76064
|
-
}
|
|
76065
|
-
return requiredFields;
|
|
76023
|
+
return hasAnyUsageDataField(usageData) ? usageData : null;
|
|
76066
76024
|
}
|
|
76067
76025
|
async function prefetchUsageDataIfNeeded(lines, data) {
|
|
76068
76026
|
if (!hasUsageDependentWidgets(lines)) {
|
|
76069
76027
|
return null;
|
|
76070
76028
|
}
|
|
76071
76029
|
const rateLimitsData = extractUsageDataFromRateLimits(data?.rate_limits);
|
|
76072
|
-
const
|
|
76073
|
-
|
|
76030
|
+
const requirements = getUsageFieldRequirements(lines);
|
|
76031
|
+
const missingFields = getMissingFetchFields(rateLimitsData, requirements);
|
|
76032
|
+
if (missingFields.length === 0) {
|
|
76074
76033
|
return rateLimitsData;
|
|
76075
76034
|
}
|
|
76076
|
-
|
|
76035
|
+
const apiData = await fetchUsageData({ requiredFields: missingFields });
|
|
76036
|
+
return mergeUsageData(rateLimitsData, apiData);
|
|
76077
76037
|
}
|
|
76078
76038
|
|
|
76079
76039
|
// src/ccstatusline.ts
|