claude-use 11.54.1 → 11.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -1518,8 +1518,8 @@ function anchor(source) {
1518
1518
  }
1519
1519
  function timeSource(args) {
1520
1520
  const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
1521
- const regex = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : args.seconds ? `${hhmm}:[0-5]\\d(?:\\.\\d+)?` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
1522
- return regex;
1521
+ const regex2 = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : args.seconds ? `${hhmm}:[0-5]\\d(?:\\.\\d+)?` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
1522
+ return regex2;
1523
1523
  }
1524
1524
  function time(args) {
1525
1525
  return new RegExp(`^${timeSource(args)}$`);
@@ -1587,8 +1587,8 @@ var init_regexes = __esm({
1587
1587
  date = /* @__PURE__ */ anchor(dateSource);
1588
1588
  anyString = /^[\s\S]{0,}$/;
1589
1589
  string = (params) => {
1590
- const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
1591
- return new RegExp(`^${regex}$`);
1590
+ const regex2 = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
1591
+ return new RegExp(`^${regex2}$`);
1592
1592
  };
1593
1593
  bigint = /^-?\d+n?$/;
1594
1594
  integer = /^-?\d+$/;
@@ -4781,14 +4781,14 @@ var init_memoizer = __esm({
4781
4781
  (_a4 = inst._zod).deferred ?? (_a4.deferred = []);
4782
4782
  inst._zod.deferred.push(() => {
4783
4783
  const base = inst._zod.parse;
4784
- const wrapped = (payload, ctx) => {
4784
+ const wrapped2 = (payload, ctx) => {
4785
4785
  if (ctx.direction !== "backward" && isBackEdge(ctx, payload.value))
4786
4786
  throw new $ZodCyclicError();
4787
4787
  return base(payload, ctx);
4788
4788
  };
4789
- inst._zod.parse = wrapped;
4789
+ inst._zod.parse = wrapped2;
4790
4790
  if (inst._zod.run === base)
4791
- inst._zod.run = wrapped;
4791
+ inst._zod.run = wrapped2;
4792
4792
  });
4793
4793
  },
4794
4794
  attach(inst) {
@@ -4800,12 +4800,12 @@ var init_memoizer = __esm({
4800
4800
  (_a4 = inst._zod).deferred ?? (_a4.deferred = []);
4801
4801
  inst._zod.deferred.push(() => {
4802
4802
  const base = inst._zod.parse;
4803
- const wrapped = (payload, ctx) => {
4803
+ const wrapped2 = (payload, ctx) => {
4804
4804
  if (isRecursiveInst === void 0) {
4805
4805
  const walked = isRecursive(inst, /* @__PURE__ */ new Set(), false);
4806
4806
  if (walked === NONE) {
4807
4807
  inst._zod.parse = base;
4808
- if (inst._zod.run === wrapped)
4808
+ if (inst._zod.run === wrapped2)
4809
4809
  inst._zod.run = base;
4810
4810
  return base(payload, ctx);
4811
4811
  }
@@ -4859,9 +4859,9 @@ var init_memoizer = __esm({
4859
4859
  entry.issues = result.issues.length ? cloneIssues(result.issues) : NO_ISSUES;
4860
4860
  return result;
4861
4861
  };
4862
- inst._zod.parse = wrapped;
4862
+ inst._zod.parse = wrapped2;
4863
4863
  if (inst._zod.run === base)
4864
- inst._zod.run = wrapped;
4864
+ inst._zod.run = wrapped2;
4865
4865
  });
4866
4866
  }
4867
4867
  };
@@ -12959,7 +12959,7 @@ function withParser(schema, parser) {
12959
12959
  const clone3 = clone(schema);
12960
12960
  const liveRun = schema._zod.run;
12961
12961
  const originalRun = liveRun.__originalRun ?? liveRun;
12962
- const wrapped = (payload, ctx) => {
12962
+ const wrapped2 = (payload, ctx) => {
12963
12963
  if (ctx?.async || ctx?.direction === "backward" || ctx?.skipChecks || ctx?.[FALLBACK_FLAG]) {
12964
12964
  return originalRun(payload, ctx);
12965
12965
  }
@@ -12975,10 +12975,10 @@ function withParser(schema, parser) {
12975
12975
  ctx[FALLBACK_FLAG] = true;
12976
12976
  return originalRun(payload, ctx);
12977
12977
  };
12978
- wrapped.__originalRun = originalRun;
12978
+ wrapped2.__originalRun = originalRun;
12979
12979
  clone3._zod.bag.fallbackRun = originalRun;
12980
12980
  clone3._zod.bag.validator = parser;
12981
- clone3._zod.run = wrapped;
12981
+ clone3._zod.run = wrapped2;
12982
12982
  if (!liveRun.__originalRun)
12983
12983
  installCompiledUserMethods(clone3, schema, parser);
12984
12984
  return clone3;
@@ -16402,9 +16402,9 @@ var init_json_schema_processors = __esm({
16402
16402
  json2.pattern = patternList[0].source;
16403
16403
  else if (patternList.length > 1) {
16404
16404
  json2.allOf = [
16405
- ...patternList.map((regex) => ({
16405
+ ...patternList.map((regex2) => ({
16406
16406
  ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
16407
- pattern: regex.source
16407
+ pattern: regex2.source
16408
16408
  }))
16409
16409
  ];
16410
16410
  }
@@ -17743,10 +17743,10 @@ function currencyCode2(_params) {
17743
17743
  function hash(alg, params) {
17744
17744
  const enc = params?.enc ?? "hex";
17745
17745
  const format = `${alg}_${enc}`;
17746
- const regex = regexes_exports[format];
17747
- if (!regex)
17746
+ const regex2 = regexes_exports[format];
17747
+ if (!regex2)
17748
17748
  throw new Error(`Unrecognized hash format: ${format}`);
17749
- return _stringFormat(ZodCustomStringFormat, format, regex, params);
17749
+ return _stringFormat(ZodCustomStringFormat, format, regex2, params);
17750
17750
  }
17751
17751
  function number2(params) {
17752
17752
  return _number(ZodNumber, params);
@@ -19607,7 +19607,7 @@ function convertBaseSchema(schema, ctx) {
19607
19607
  for (const key of Object.keys(payload.value)) {
19608
19608
  if (propertyKeys.includes(key))
19609
19609
  continue;
19610
- if (patterns.some((regex) => regex.test(key)))
19610
+ if (patterns.some((regex2) => regex2.test(key)))
19611
19611
  continue;
19612
19612
  unrecognized.push(key);
19613
19613
  }
@@ -25036,12 +25036,304 @@ var init_proxyBypass = __esm({
25036
25036
  }
25037
25037
  });
25038
25038
 
25039
+ // node_modules/.pnpm/ansi-regex@6.3.0/node_modules/ansi-regex/index.js
25040
+ function ansiRegex({ onlyFirst = false } = {}) {
25041
+ const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
25042
+ const osc = `(?:\\u001B\\][^\\u0007\\u001B\\u009C]*${ST})`;
25043
+ const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
25044
+ const pattern = `${osc}|${csi}`;
25045
+ return new RegExp(pattern, onlyFirst ? void 0 : "g");
25046
+ }
25047
+ var init_ansi_regex = __esm({
25048
+ "node_modules/.pnpm/ansi-regex@6.3.0/node_modules/ansi-regex/index.js"() {
25049
+ }
25050
+ });
25051
+
25052
+ // node_modules/.pnpm/strip-ansi@7.2.0/node_modules/strip-ansi/index.js
25053
+ function stripAnsi(string4) {
25054
+ if (typeof string4 !== "string") {
25055
+ throw new TypeError(`Expected a \`string\`, got \`${typeof string4}\``);
25056
+ }
25057
+ if (!string4.includes("\x1B") && !string4.includes("\x9B")) {
25058
+ return string4;
25059
+ }
25060
+ return string4.replace(regex, "");
25061
+ }
25062
+ var regex;
25063
+ var init_strip_ansi = __esm({
25064
+ "node_modules/.pnpm/strip-ansi@7.2.0/node_modules/strip-ansi/index.js"() {
25065
+ init_ansi_regex();
25066
+ regex = ansiRegex();
25067
+ }
25068
+ });
25069
+
25070
+ // node_modules/.pnpm/get-east-asian-width@1.6.0/node_modules/get-east-asian-width/lookup-data.js
25071
+ var ambiguousMinimalCodePoint, ambiguousMaximumCodePoint, ambiguousRanges, fullwidthMinimalCodePoint, fullwidthMaximumCodePoint, fullwidthRanges, wideMinimalCodePoint, wideMaximumCodePoint, wideRanges;
25072
+ var init_lookup_data = __esm({
25073
+ "node_modules/.pnpm/get-east-asian-width@1.6.0/node_modules/get-east-asian-width/lookup-data.js"() {
25074
+ ambiguousMinimalCodePoint = 161;
25075
+ ambiguousMaximumCodePoint = 1114109;
25076
+ ambiguousRanges = [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];
25077
+ fullwidthMinimalCodePoint = 12288;
25078
+ fullwidthMaximumCodePoint = 65510;
25079
+ fullwidthRanges = [12288, 12288, 65281, 65376, 65504, 65510];
25080
+ wideMinimalCodePoint = 4352;
25081
+ wideMaximumCodePoint = 262141;
25082
+ wideRanges = [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];
25083
+ }
25084
+ });
25085
+
25086
+ // node_modules/.pnpm/get-east-asian-width@1.6.0/node_modules/get-east-asian-width/utilities.js
25087
+ var isInRange;
25088
+ var init_utilities = __esm({
25089
+ "node_modules/.pnpm/get-east-asian-width@1.6.0/node_modules/get-east-asian-width/utilities.js"() {
25090
+ isInRange = (ranges, codePoint) => {
25091
+ let low = 0;
25092
+ let high = Math.floor(ranges.length / 2) - 1;
25093
+ while (low <= high) {
25094
+ const mid = Math.floor((low + high) / 2);
25095
+ const i10 = mid * 2;
25096
+ if (codePoint < ranges[i10]) {
25097
+ high = mid - 1;
25098
+ } else if (codePoint > ranges[i10 + 1]) {
25099
+ low = mid + 1;
25100
+ } else {
25101
+ return true;
25102
+ }
25103
+ }
25104
+ return false;
25105
+ };
25106
+ }
25107
+ });
25108
+
25109
+ // node_modules/.pnpm/get-east-asian-width@1.6.0/node_modules/get-east-asian-width/lookup.js
25110
+ function findWideFastPathRange(ranges) {
25111
+ let fastPathStart = ranges[0];
25112
+ let fastPathEnd = ranges[1];
25113
+ for (let index = 0; index < ranges.length; index += 2) {
25114
+ const start = ranges[index];
25115
+ const end = ranges[index + 1];
25116
+ if (commonCjkCodePoint >= start && commonCjkCodePoint <= end) {
25117
+ return [start, end];
25118
+ }
25119
+ if (end - start > fastPathEnd - fastPathStart) {
25120
+ fastPathStart = start;
25121
+ fastPathEnd = end;
25122
+ }
25123
+ }
25124
+ return [fastPathStart, fastPathEnd];
25125
+ }
25126
+ var commonCjkCodePoint, wideFastPathStart, wideFastPathEnd, isAmbiguous, isFullWidth, isWide;
25127
+ var init_lookup = __esm({
25128
+ "node_modules/.pnpm/get-east-asian-width@1.6.0/node_modules/get-east-asian-width/lookup.js"() {
25129
+ init_lookup_data();
25130
+ init_utilities();
25131
+ commonCjkCodePoint = 19968;
25132
+ [wideFastPathStart, wideFastPathEnd] = /* @__PURE__ */ findWideFastPathRange(wideRanges);
25133
+ isAmbiguous = (codePoint) => {
25134
+ if (codePoint < ambiguousMinimalCodePoint || codePoint > ambiguousMaximumCodePoint) {
25135
+ return false;
25136
+ }
25137
+ return isInRange(ambiguousRanges, codePoint);
25138
+ };
25139
+ isFullWidth = (codePoint) => {
25140
+ if (codePoint < fullwidthMinimalCodePoint || codePoint > fullwidthMaximumCodePoint) {
25141
+ return false;
25142
+ }
25143
+ return isInRange(fullwidthRanges, codePoint);
25144
+ };
25145
+ isWide = (codePoint) => {
25146
+ if (codePoint >= wideFastPathStart && codePoint <= wideFastPathEnd) {
25147
+ return true;
25148
+ }
25149
+ if (codePoint < wideMinimalCodePoint || codePoint > wideMaximumCodePoint) {
25150
+ return false;
25151
+ }
25152
+ return isInRange(wideRanges, codePoint);
25153
+ };
25154
+ }
25155
+ });
25156
+
25157
+ // node_modules/.pnpm/get-east-asian-width@1.6.0/node_modules/get-east-asian-width/index.js
25158
+ function validate2(codePoint) {
25159
+ if (!Number.isSafeInteger(codePoint)) {
25160
+ throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
25161
+ }
25162
+ }
25163
+ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
25164
+ validate2(codePoint);
25165
+ if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
25166
+ return 2;
25167
+ }
25168
+ return 1;
25169
+ }
25170
+ var init_get_east_asian_width = __esm({
25171
+ "node_modules/.pnpm/get-east-asian-width@1.6.0/node_modules/get-east-asian-width/index.js"() {
25172
+ init_lookup();
25173
+ }
25174
+ });
25175
+
25176
+ // node_modules/.pnpm/string-width@8.3.0/node_modules/string-width/index.js
25177
+ function isDoubleWidthNonRgiEmojiSequence(segment) {
25178
+ if (segment.length > 50) {
25179
+ return false;
25180
+ }
25181
+ if (unqualifiedKeycapRegex.test(segment)) {
25182
+ return true;
25183
+ }
25184
+ if (segment.includes("\u200D")) {
25185
+ const pictographics = segment.match(extendedPictographicRegex);
25186
+ return pictographics !== null && pictographics.length >= 2;
25187
+ }
25188
+ return false;
25189
+ }
25190
+ function baseVisible(segment) {
25191
+ const index = segment.search(visibleCharacterRegex);
25192
+ return index === -1 ? void 0 : segment.slice(index);
25193
+ }
25194
+ function isHangulLeadingJamo(codePoint) {
25195
+ return codePoint >= 4352 && codePoint <= 4447 || codePoint >= 43360 && codePoint <= 43388;
25196
+ }
25197
+ function isHangulVowelJamo(codePoint) {
25198
+ return codePoint >= 4448 && codePoint <= 4519 || codePoint >= 55216 && codePoint <= 55238;
25199
+ }
25200
+ function isHangulTrailingJamo(codePoint) {
25201
+ return codePoint >= 4520 && codePoint <= 4607 || codePoint >= 55243 && codePoint <= 55291;
25202
+ }
25203
+ function isHangulJamo(codePoint) {
25204
+ return isHangulLeadingJamo(codePoint) || isHangulVowelJamo(codePoint) || isHangulTrailingJamo(codePoint);
25205
+ }
25206
+ function hangulClusterWidth(visibleSegment, eastAsianWidthOptions) {
25207
+ const codePoints = [];
25208
+ for (const character of visibleSegment) {
25209
+ if (!visibleCharacterRegex.test(character)) {
25210
+ continue;
25211
+ }
25212
+ codePoints.push(character.codePointAt(0));
25213
+ }
25214
+ if (codePoints.length === 0) {
25215
+ return void 0;
25216
+ }
25217
+ let width = 0;
25218
+ for (let index = 0; index < codePoints.length; index++) {
25219
+ const codePoint = codePoints[index];
25220
+ if (!isHangulJamo(codePoint)) {
25221
+ if (width === 0) {
25222
+ return void 0;
25223
+ }
25224
+ for (let remaining = index; remaining < codePoints.length; remaining++) {
25225
+ width += eastAsianWidth(codePoints[remaining], eastAsianWidthOptions);
25226
+ }
25227
+ return width;
25228
+ }
25229
+ if (isHangulLeadingJamo(codePoint) && isHangulVowelJamo(codePoints[index + 1])) {
25230
+ width += 2;
25231
+ index += isHangulTrailingJamo(codePoints[index + 2]) ? 2 : 1;
25232
+ continue;
25233
+ }
25234
+ width += eastAsianWidth(codePoint, eastAsianWidthOptions);
25235
+ }
25236
+ return width;
25237
+ }
25238
+ function trailingWidth(visibleSegment, eastAsianWidthOptions) {
25239
+ let extra = 0;
25240
+ let first = true;
25241
+ for (const character of visibleSegment) {
25242
+ if (first) {
25243
+ first = false;
25244
+ continue;
25245
+ }
25246
+ if (spacingMarkRegex.test(character) || character >= "\uFF00" && character <= "\uFFEF") {
25247
+ extra += eastAsianWidth(character.codePointAt(0), eastAsianWidthOptions);
25248
+ }
25249
+ }
25250
+ return extra;
25251
+ }
25252
+ function stringWidth(input2, options = {}) {
25253
+ if (typeof input2 !== "string" || input2.length === 0) {
25254
+ return 0;
25255
+ }
25256
+ const {
25257
+ ambiguousIsNarrow = true,
25258
+ countAnsiEscapeCodes = false
25259
+ } = options;
25260
+ let string4 = input2;
25261
+ if (!countAnsiEscapeCodes && (string4.includes("\x1B") || string4.includes("\x9B"))) {
25262
+ string4 = stripAnsi(string4);
25263
+ }
25264
+ if (string4.length === 0) {
25265
+ return 0;
25266
+ }
25267
+ if (/^[\u0020-\u007E]*$/.test(string4)) {
25268
+ return string4.length;
25269
+ }
25270
+ let width = 0;
25271
+ const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
25272
+ for (const { segment } of segmenter.segment(string4)) {
25273
+ const visibleSegment = baseVisible(segment);
25274
+ if (visibleSegment === void 0) {
25275
+ continue;
25276
+ }
25277
+ if (rgiEmojiRegex.test(segment) || isDoubleWidthNonRgiEmojiSequence(segment)) {
25278
+ width += 2;
25279
+ continue;
25280
+ }
25281
+ const hangulWidth = hangulClusterWidth(visibleSegment, eastAsianWidthOptions);
25282
+ if (hangulWidth !== void 0) {
25283
+ width += hangulWidth;
25284
+ continue;
25285
+ }
25286
+ const codePoint = visibleSegment.codePointAt(0);
25287
+ width += eastAsianWidth(codePoint, eastAsianWidthOptions);
25288
+ width += trailingWidth(visibleSegment, eastAsianWidthOptions);
25289
+ }
25290
+ return width;
25291
+ }
25292
+ var segmenter, visibleCharacterRegex, spacingMarkRegex, rgiEmojiRegex, unqualifiedKeycapRegex, extendedPictographicRegex;
25293
+ var init_string_width = __esm({
25294
+ "node_modules/.pnpm/string-width@8.3.0/node_modules/string-width/index.js"() {
25295
+ init_strip_ansi();
25296
+ init_get_east_asian_width();
25297
+ segmenter = new Intl.Segmenter();
25298
+ visibleCharacterRegex = new RegExp("[^\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Nonspacing_Mark}\\p{Enclosing_Mark}\\p{Surrogate}]", "v");
25299
+ spacingMarkRegex = new RegExp("\\p{Spacing_Mark}", "v");
25300
+ rgiEmojiRegex = new RegExp("^\\p{RGI_Emoji}$", "v");
25301
+ unqualifiedKeycapRegex = /^[\d#*]\u20E3$/;
25302
+ extendedPictographicRegex = new RegExp("\\p{Extended_Pictographic}", "gu");
25303
+ }
25304
+ });
25305
+
25306
+ // src/statusline/blank.ts
25307
+ function drawsNothing(text4) {
25308
+ return stringWidth(text4.replace(BLANK_CELLS, "")) === 0;
25309
+ }
25310
+ var BLANK_CELLS;
25311
+ var init_blank = __esm({
25312
+ "src/statusline/blank.ts"() {
25313
+ "use strict";
25314
+ init_string_width();
25315
+ BLANK_CELLS = /[\p{Zs}\u2800\u3164\uFFA0]/gu;
25316
+ }
25317
+ });
25318
+
25319
+ // src/statusline/graphemes.ts
25320
+ function graphemesOf(text4) {
25321
+ return Array.from(SEGMENTER.segment(text4), (part) => part.segment);
25322
+ }
25323
+ var SEGMENTER;
25324
+ var init_graphemes = __esm({
25325
+ "src/statusline/graphemes.ts"() {
25326
+ "use strict";
25327
+ SEGMENTER = new Intl.Segmenter(void 0, { granularity: "grapheme" });
25328
+ }
25329
+ });
25330
+
25039
25331
  // src/config/statusline.ts
25040
25332
  function distinctList(member) {
25041
25333
  return external_exports.array(member).refine((items) => new Set(items).size === items.length, "must not repeat an entry");
25042
25334
  }
25043
25335
  function isSingleVisibleGrapheme(text4) {
25044
- return [...GRAPHEMES.segment(text4)].length === 1 && !/[\p{C}\p{Z}]/u.test(text4);
25336
+ return graphemesOf(text4).length === 1 && stringWidth(text4) === 1 && !/[\p{C}\p{Z}]/u.test(text4) && !drawsNothing(text4);
25045
25337
  }
25046
25338
  function isPlainObject2(value2) {
25047
25339
  return typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
@@ -25063,11 +25355,14 @@ function resolveStatusline(settings2) {
25063
25355
  }
25064
25356
  return resolved;
25065
25357
  }
25066
- var STATUSLINE_HEADER_SEGMENTS, STATUSLINE_ROWS, STATUSLINE_COLOUR_NAMES, DEFAULT_HEADER_SEGMENTS, DEFAULT_ROWS, STATUSLINE_PATH_LEVELS, MAX_PERCENT, MAX_STATUSLINE_PALETTE_INDEX, MAX_STATUSLINE_LABEL_CHARS, MAX_BAR_CELLS, MAX_ACCOUNT_USER_CHARS, MAX_DISPLAY_TEXT_CHARS, LABEL_RE2, OPTIONAL_LABEL_RE, colourValue, GRAPHEMES, barCharacter, labelText, overrideText, wholePercent, SHAPES, StatuslineSchema, ResolvedStatuslineSchema, STATUSLINE_DEFAULTS, STATUSLINE_ENV;
25358
+ var STATUSLINE_HEADER_SEGMENTS, STATUSLINE_ROWS, STATUSLINE_COLOUR_NAMES, DEFAULT_HEADER_SEGMENTS, DEFAULT_ROWS, STATUSLINE_PATH_LEVELS, STATUSLINE_USAGE_VALUES, STATUSLINE_TIME_FORMATS, STATUSLINE_HOUR_CYCLES, MAX_PERCENT, MAX_STATUSLINE_PALETTE_INDEX, MAX_STATUSLINE_LABEL_COLUMNS, MAX_BAR_CELLS, MAX_ACCOUNT_USER_CHARS, MAX_DISPLAY_TEXT_CHARS, LABEL_RE2, OPTIONAL_LABEL_RE, colourValue, barCharacter, labelText, overrideText, wholePercent, thresholdPercent, SHAPES, StatuslineSchema, ResolvedStatuslineSchema, STATUSLINE_DEFAULTS, STATUSLINE_ENV;
25067
25359
  var init_statusline = __esm({
25068
25360
  "src/config/statusline.ts"() {
25069
25361
  "use strict";
25362
+ init_string_width();
25070
25363
  init_zod();
25364
+ init_blank();
25365
+ init_graphemes();
25071
25366
  STATUSLINE_HEADER_SEGMENTS = ["model", "provider", "route", "account", "identity", "headroom", "project", "vcs", "effort", "advisor", "version", "outputStyle"];
25072
25367
  STATUSLINE_ROWS = ["context", "quota", "addedDirs", "gitFiles"];
25073
25368
  STATUSLINE_COLOUR_NAMES = [
@@ -25093,20 +25388,23 @@ var init_statusline = __esm({
25093
25388
  DEFAULT_HEADER_SEGMENTS = ["model", "provider", "route", "account", "identity", "headroom"];
25094
25389
  DEFAULT_ROWS = ["context", "quota"];
25095
25390
  STATUSLINE_PATH_LEVELS = ["1", "2", "3", "full"];
25391
+ STATUSLINE_USAGE_VALUES = ["used", "remaining"];
25392
+ STATUSLINE_TIME_FORMATS = ["relative", "absolute", "both", "elapsed", "elapsedAndAbsolute"];
25393
+ STATUSLINE_HOUR_CYCLES = ["auto", "h11", "h12", "h23", "h24"];
25096
25394
  MAX_PERCENT = 100;
25097
25395
  MAX_STATUSLINE_PALETTE_INDEX = 255;
25098
- MAX_STATUSLINE_LABEL_CHARS = 12;
25396
+ MAX_STATUSLINE_LABEL_COLUMNS = 12;
25099
25397
  MAX_BAR_CELLS = 40;
25100
25398
  MAX_ACCOUNT_USER_CHARS = 254;
25101
25399
  MAX_DISPLAY_TEXT_CHARS = 80;
25102
25400
  LABEL_RE2 = /^[^\p{C}\p{Z}]+(?: [^\p{C}\p{Z}]+)*$/u;
25103
25401
  OPTIONAL_LABEL_RE = /^(?:[^\p{C}\p{Z}]+(?: [^\p{C}\p{Z}]+)*)?$/u;
25104
25402
  colourValue = external_exports.union([external_exports.enum(STATUSLINE_COLOUR_NAMES), external_exports.number().int().min(0).max(MAX_STATUSLINE_PALETTE_INDEX), external_exports.string().regex(/^#[0-9a-fA-F]{6}$/, "must be a colour name, a palette index from 0 to 255 or #rrggbb")]);
25105
- GRAPHEMES = new Intl.Segmenter(void 0, { granularity: "grapheme" });
25106
- barCharacter = external_exports.string().refine(isSingleVisibleGrapheme, "must be a single visible character");
25107
- labelText = external_exports.string().max(MAX_STATUSLINE_LABEL_CHARS).regex(LABEL_RE2, "must be visible text without control characters");
25403
+ barCharacter = external_exports.string().refine(isSingleVisibleGrapheme, "must be a single visible character that takes one terminal column");
25404
+ labelText = external_exports.string().refine((text4) => stringWidth(text4) <= MAX_STATUSLINE_LABEL_COLUMNS, `must take no more than ${String(MAX_STATUSLINE_LABEL_COLUMNS)} terminal columns`).refine((text4) => !drawsNothing(text4), "must show something: a label of only combining marks or blank characters draws nothing").regex(LABEL_RE2, "must be visible text without control characters");
25108
25405
  overrideText = external_exports.string().max(MAX_DISPLAY_TEXT_CHARS).regex(OPTIONAL_LABEL_RE, "must be visible text without control characters");
25109
25406
  wholePercent = external_exports.number().int().min(1).max(MAX_PERCENT);
25407
+ thresholdPercent = external_exports.number().int().min(0).max(MAX_PERCENT);
25110
25408
  SHAPES = {
25111
25409
  layout: {
25112
25410
  header: distinctList(external_exports.enum(STATUSLINE_HEADER_SEGMENTS)).describe("The header segments to draw, in drawing order; a segment left out is hidden, and an empty list hides the header."),
@@ -25143,6 +25441,20 @@ var init_statusline = __esm({
25143
25441
  filled: barCharacter.describe("The character that draws the used part of a bar."),
25144
25442
  empty: barCharacter.describe("The character that draws the unused part of a bar.")
25145
25443
  },
25444
+ usage: {
25445
+ value: external_exports.enum(STATUSLINE_USAGE_VALUES).describe("Whether a quota window's figure is the share of it used or the share left; the bar and the colour always follow the share used."),
25446
+ bar: external_exports.boolean().describe("Whether each quota window is drawn as a bar, or as text alone."),
25447
+ compact: external_exports.boolean().describe("Whether the quota windows are drawn as one short line of text (`5h: 25.0% (1h 30m)`) in place of bars; it takes precedence over usage.bar."),
25448
+ resetLabel: external_exports.boolean().describe("Whether a window's reset time is introduced with `resets in` (`resets` for a wall-clock time), as in `(resets in 1h 30m)`, rather than the bare `(1h 30m)`."),
25449
+ modelScoped: external_exports.boolean().describe("Whether the per-model weekly windows the client reports (rate_limits.model_scoped) are drawn after the account's own windows; they describe the signed-in account, so a session that selected a provider never shows them."),
25450
+ timeFormat: external_exports.enum(STATUSLINE_TIME_FORMATS).describe("How a window's reset is shown: the time left (`1h 30m`), the wall-clock time (`at 14:30`), both, the share of the window already gone (`53% elapsed`), or that share and the wall-clock time. A window whose length is not known shows no share."),
25451
+ threshold: thresholdPercent.describe("The whole percentage of use that at least one quota window must reach for the quota row to be drawn at all; 0 always draws it."),
25452
+ sevenDayThreshold: thresholdPercent.describe("The whole percentage of use at which the weekly window is drawn beside the five-hour one; below it the weekly window is hidden. A weekly window with no five-hour window beside it is always drawn, and 0 always draws it.")
25453
+ },
25454
+ clock: {
25455
+ hourCycle: external_exports.enum(STATUSLINE_HOUR_CYCLES).describe("The hour cycle of a wall-clock time: `auto` follows the system locale, `h23` and `h24` are 24-hour time (`h24` writes midnight as 24:00), and `h12` and `h11` are 12-hour time with am or pm (`h11` writes the hour after midnight as 0)."),
25456
+ seconds: external_exports.boolean().describe("Whether a wall-clock time includes seconds (`14:30:07`).")
25457
+ },
25146
25458
  colours: {
25147
25459
  context: colourValue.describe("The colour of the context bar and its figures below the warning threshold."),
25148
25460
  usage: colourValue.describe("The colour of the quota bars and their figures below the warning threshold."),
@@ -25185,6 +25497,8 @@ var init_statusline = __esm({
25185
25497
  bands: external_exports.strictObject(SHAPES.bands).partial().optional(),
25186
25498
  labels: external_exports.strictObject(SHAPES.labels).partial().optional(),
25187
25499
  bar: external_exports.strictObject(SHAPES.bar).partial().optional(),
25500
+ usage: external_exports.strictObject(SHAPES.usage).partial().optional(),
25501
+ clock: external_exports.strictObject(SHAPES.clock).partial().optional(),
25188
25502
  colours: external_exports.strictObject(SHAPES.colours).partial().optional(),
25189
25503
  project: external_exports.strictObject(SHAPES.project).partial().optional(),
25190
25504
  git: external_exports.strictObject(SHAPES.git).partial().optional(),
@@ -25200,6 +25514,8 @@ var init_statusline = __esm({
25200
25514
  bands: external_exports.strictObject(SHAPES.bands),
25201
25515
  labels: external_exports.strictObject(SHAPES.labels),
25202
25516
  bar: external_exports.strictObject(SHAPES.bar),
25517
+ usage: external_exports.strictObject(SHAPES.usage),
25518
+ clock: external_exports.strictObject(SHAPES.clock),
25203
25519
  colours: external_exports.strictObject(SHAPES.colours),
25204
25520
  project: external_exports.strictObject(SHAPES.project),
25205
25521
  git: external_exports.strictObject(SHAPES.git),
@@ -25215,6 +25531,8 @@ var init_statusline = __esm({
25215
25531
  bands: { warnAt: 70, criticalAt: 90 },
25216
25532
  labels: { fiveHour: "5h", sevenDay: "Wk" },
25217
25533
  bar: { width: 10, filled: "\u2588", empty: "\u2591" },
25534
+ usage: { value: "used", bar: true, compact: false, resetLabel: false, modelScoped: false, timeFormat: "relative", threshold: 0, sevenDayThreshold: 0 },
25535
+ clock: { hourCycle: "auto", seconds: false },
25218
25536
  colours: {
25219
25537
  context: "green",
25220
25538
  usage: "green",
@@ -31658,17 +31976,17 @@ var require_picomatch = __commonJS({
31658
31976
  }
31659
31977
  const opts = options || {};
31660
31978
  const posix = opts.windows;
31661
- const regex = isState ? picomatch4.compileRe(glob, options) : picomatch4.makeRe(glob, options, false, true);
31662
- const state = regex.state;
31663
- delete regex.state;
31979
+ const regex2 = isState ? picomatch4.compileRe(glob, options) : picomatch4.makeRe(glob, options, false, true);
31980
+ const state = regex2.state;
31981
+ delete regex2.state;
31664
31982
  let isIgnored = () => false;
31665
31983
  if (opts.ignore) {
31666
31984
  const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
31667
31985
  isIgnored = picomatch4(opts.ignore, ignoreOpts, returnState);
31668
31986
  }
31669
31987
  const matcher = (input2, returnObject = false) => {
31670
- const { isMatch, match, output: output2 } = picomatch4.test(input2, regex, options, { glob, posix });
31671
- const result = { glob, state, regex, posix, input: input2, output: output2, match, isMatch };
31988
+ const { isMatch, match, output: output2 } = picomatch4.test(input2, regex2, options, { glob, posix });
31989
+ const result = { glob, state, regex: regex2, posix, input: input2, output: output2, match, isMatch };
31672
31990
  if (typeof opts.onResult === "function") {
31673
31991
  opts.onResult(result);
31674
31992
  }
@@ -31693,7 +32011,7 @@ var require_picomatch = __commonJS({
31693
32011
  }
31694
32012
  return matcher;
31695
32013
  };
31696
- picomatch4.test = (input2, regex, options, { glob, posix } = {}) => {
32014
+ picomatch4.test = (input2, regex2, options, { glob, posix } = {}) => {
31697
32015
  if (typeof input2 !== "string") {
31698
32016
  throw new TypeError("Expected input to be a string");
31699
32017
  }
@@ -31710,16 +32028,16 @@ var require_picomatch = __commonJS({
31710
32028
  }
31711
32029
  if (match === false || opts.capture === true) {
31712
32030
  if (opts.matchBase === true || opts.basename === true) {
31713
- match = picomatch4.matchBase(input2, regex, options, posix);
32031
+ match = picomatch4.matchBase(input2, regex2, options, posix);
31714
32032
  } else {
31715
- match = regex.exec(output2);
32033
+ match = regex2.exec(output2);
31716
32034
  }
31717
32035
  }
31718
32036
  return { isMatch: Boolean(match), match, output: output2 };
31719
32037
  };
31720
32038
  picomatch4.matchBase = (input2, glob, options, posix = options && options.windows) => {
31721
- const regex = glob instanceof RegExp ? glob : picomatch4.makeRe(glob, options);
31722
- return regex.test(utils.basename(input2, { windows: posix }));
32039
+ const regex2 = glob instanceof RegExp ? glob : picomatch4.makeRe(glob, options);
32040
+ return regex2.test(utils.basename(input2, { windows: posix }));
31723
32041
  };
31724
32042
  picomatch4.isMatch = (str, patterns, options) => picomatch4(patterns, options)(str);
31725
32043
  picomatch4.parse = (pattern, options) => {
@@ -31738,11 +32056,11 @@ var require_picomatch = __commonJS({
31738
32056
  if (state && state.negated === true) {
31739
32057
  source = `^(?!${source}).*$`;
31740
32058
  }
31741
- const regex = picomatch4.toRegex(source, options);
32059
+ const regex2 = picomatch4.toRegex(source, options);
31742
32060
  if (returnState === true) {
31743
- regex.state = state;
32061
+ regex2.state = state;
31744
32062
  }
31745
- return regex;
32063
+ return regex2;
31746
32064
  };
31747
32065
  picomatch4.makeRe = (input2, options = {}, returnOutput = false, returnState = false) => {
31748
32066
  if (!input2 || typeof input2 !== "string") {
@@ -36315,7 +36633,7 @@ var init_package = __esm({
36315
36633
  "package.json"() {
36316
36634
  package_default = {
36317
36635
  name: "claude-use",
36318
- version: "11.54.1",
36636
+ version: "11.55.0",
36319
36637
  description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
36320
36638
  license: "MIT",
36321
36639
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -36373,6 +36691,7 @@ var init_package = __esm({
36373
36691
  commander: "^15.0.0",
36374
36692
  cosmiconfig: "^10.0.1",
36375
36693
  picomatch: "^4.0.7",
36694
+ "string-width": "8.3.0",
36376
36695
  trilean: "1.7.1",
36377
36696
  undici: "7.29.1",
36378
36697
  zod: "^4.6.1"
@@ -62222,10 +62541,10 @@ var require_connection = __commonJS({
62222
62541
  });
62223
62542
  return controller;
62224
62543
  }
62225
- function closeWebSocketConnection(object3, code, reason, validate2 = false) {
62544
+ function closeWebSocketConnection(object3, code, reason, validate3 = false) {
62226
62545
  code ??= null;
62227
62546
  reason ??= "";
62228
- if (validate2) validateCloseCodeAndReason(code, reason);
62547
+ if (validate3) validateCloseCodeAndReason(code, reason);
62229
62548
  if (isClosed(object3.readyState) || isClosing(object3.readyState)) {
62230
62549
  } else if (!isEstablished(object3.readyState)) {
62231
62550
  failWebsocketConnection(object3);
@@ -104320,8 +104639,8 @@ var require_keyword = __commonJS({
104320
104639
  var _a4;
104321
104640
  const { gen, keyword, schema, parentSchema, $data, it: it2 } = cxt;
104322
104641
  checkAsyncKeyword(it2, def);
104323
- const validate2 = !$data && def.compile ? def.compile.call(it2.self, schema, parentSchema, it2) : def.validate;
104324
- const validateRef = useKeyword(gen, keyword, validate2);
104642
+ const validate3 = !$data && def.compile ? def.compile.call(it2.self, schema, parentSchema, it2) : def.validate;
104643
+ const validateRef = useKeyword(gen, keyword, validate3);
104325
104644
  const valid = gen.let("valid");
104326
104645
  cxt.block$data(valid, validateKeyword);
104327
104646
  cxt.ok((_a4 = def.valid) !== null && _a4 !== void 0 ? _a4 : valid);
@@ -105394,28 +105713,28 @@ var require_compile = __commonJS({
105394
105713
  if (this.opts.code.process)
105395
105714
  sourceCode = this.opts.code.process(sourceCode, sch);
105396
105715
  const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);
105397
- const validate2 = makeValidate(this, this.scope.get());
105398
- this.scope.value(validateName, { ref: validate2 });
105399
- validate2.errors = null;
105400
- validate2.schema = sch.schema;
105401
- validate2.schemaEnv = sch;
105716
+ const validate3 = makeValidate(this, this.scope.get());
105717
+ this.scope.value(validateName, { ref: validate3 });
105718
+ validate3.errors = null;
105719
+ validate3.schema = sch.schema;
105720
+ validate3.schemaEnv = sch;
105402
105721
  if (sch.$async)
105403
- validate2.$async = true;
105722
+ validate3.$async = true;
105404
105723
  if (this.opts.code.source === true) {
105405
- validate2.source = { validateName, validateCode, scopeValues: gen._values };
105724
+ validate3.source = { validateName, validateCode, scopeValues: gen._values };
105406
105725
  }
105407
105726
  if (this.opts.unevaluated) {
105408
105727
  const { props, items } = schemaCxt;
105409
- validate2.evaluated = {
105728
+ validate3.evaluated = {
105410
105729
  props: props instanceof codegen_1.Name ? void 0 : props,
105411
105730
  items: items instanceof codegen_1.Name ? void 0 : items,
105412
105731
  dynamicProps: props instanceof codegen_1.Name,
105413
105732
  dynamicItems: items instanceof codegen_1.Name
105414
105733
  };
105415
- if (validate2.source)
105416
- validate2.source.evaluated = (0, codegen_1.stringify)(validate2.evaluated);
105734
+ if (validate3.source)
105735
+ validate3.source.evaluated = (0, codegen_1.stringify)(validate3.evaluated);
105417
105736
  }
105418
- sch.validate = validate2;
105737
+ sch.validate = validate3;
105419
105738
  return sch;
105420
105739
  } catch (e14) {
105421
105740
  delete sch.validate;
@@ -107097,10 +107416,10 @@ var require_core2 = __commonJS({
107097
107416
  }
107098
107417
  return metaSchema;
107099
107418
  }
107100
- _removeAllSchemas(schemas, regex) {
107419
+ _removeAllSchemas(schemas, regex2) {
107101
107420
  for (const keyRef in schemas) {
107102
107421
  const sch = schemas[keyRef];
107103
- if (!regex || regex.test(keyRef)) {
107422
+ if (!regex2 || regex2.test(keyRef)) {
107104
107423
  if (typeof sch == "string") {
107105
107424
  delete schemas[keyRef];
107106
107425
  } else if (sch && !sch.meta) {
@@ -109338,8 +109657,8 @@ var require_formats = __commonJS({
109338
109657
  "use strict";
109339
109658
  Object.defineProperty(exports2, "__esModule", { value: true });
109340
109659
  exports2.formatNames = exports2.fastFormats = exports2.fullFormats = void 0;
109341
- function fmtDef(validate2, compare) {
109342
- return { validate: validate2, compare };
109660
+ function fmtDef(validate3, compare) {
109661
+ return { validate: validate3, compare };
109343
109662
  }
109344
109663
  exports2.fullFormats = {
109345
109664
  // date: http://tools.ietf.org/html/rfc3339#section-5.6
@@ -109363,7 +109682,7 @@ var require_formats = __commonJS({
109363
109682
  // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
109364
109683
  ipv4: /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,
109365
109684
  ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,
109366
- regex,
109685
+ regex: regex2,
109367
109686
  // uuid: http://tools.ietf.org/html/rfc4122
109368
109687
  uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,
109369
109688
  // JSON-pointer: https://tools.ietf.org/html/rfc6901
@@ -109522,7 +109841,7 @@ var require_formats = __commonJS({
109522
109841
  return true;
109523
109842
  }
109524
109843
  var Z_ANCHOR = /[^\\]\\Z/;
109525
- function regex(str) {
109844
+ function regex2(str) {
109526
109845
  if (Z_ANCHOR.test(str))
109527
109846
  return false;
109528
109847
  try {
@@ -111393,9 +111712,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
111393
111712
  if (typeof fn2 === "function") {
111394
111713
  option.default(defaultValue).argParser(fn2);
111395
111714
  } else if (fn2 instanceof RegExp) {
111396
- const regex = fn2;
111715
+ const regex2 = fn2;
111397
111716
  fn2 = (val, def) => {
111398
- const m10 = regex.exec(val);
111717
+ const m10 = regex2.exec(val);
111399
111718
  return m10 ? m10[0] : def;
111400
111719
  };
111401
111720
  option.default(defaultValue).argParser(fn2);
@@ -113068,7 +113387,7 @@ var getCodePointsLength = /* @__PURE__ */ (() => {
113068
113387
  return input2.length - surrogatePairsNr;
113069
113388
  };
113070
113389
  })();
113071
- var isFullWidth = (x) => {
113390
+ var isFullWidth2 = (x) => {
113072
113391
  return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
113073
113392
  };
113074
113393
  var isWideNotCJKTNotEmoji = (x) => {
@@ -113120,7 +113439,7 @@ var getStringTruncatedWidth = (input2, truncationOptions = {}, widthOptions = {}
113120
113439
  lengthExtra = 0;
113121
113440
  for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
113122
113441
  const codePoint = char.codePointAt(0) || 0;
113123
- if (isFullWidth(codePoint)) {
113442
+ if (isFullWidth2(codePoint)) {
113124
113443
  widthExtra = FULL_WIDTH_WIDTH;
113125
113444
  } else if (isWideNotCJKTNotEmoji(codePoint)) {
113126
113445
  widthExtra = WIDE_WIDTH;
@@ -121311,7 +121630,7 @@ function runDoctor(params) {
121311
121630
  const push = (section, severity, message, subject) => {
121312
121631
  findings.push({ section, severity, message, ...subject === void 0 ? {} : { subject } });
121313
121632
  };
121314
- const validate2 = (schema, input2, section, subject) => {
121633
+ const validate3 = (schema, input2, section, subject) => {
121315
121634
  const validated2 = validateJson(schema, input2);
121316
121635
  if (validated2.ok && validated2.warning !== void 0) {
121317
121636
  push(section, "warn", validated2.warning, subject);
@@ -121357,7 +121676,7 @@ function runDoctor(params) {
121357
121676
  pushLegacyName(push, params);
121358
121677
  const profileSources = /* @__PURE__ */ new Map();
121359
121678
  for (const entry of params.configProfiles) {
121360
- const validated2 = validate2(ConfigProfileSchema, entry, "config-profile", entry.name);
121679
+ const validated2 = validate3(ConfigProfileSchema, entry, "config-profile", entry.name);
121361
121680
  if (!validated2.ok) {
121362
121681
  push("config-profile", "fail", validated2.message, entry.name);
121363
121682
  continue;
@@ -121379,7 +121698,7 @@ function runDoctor(params) {
121379
121698
  const validProfileNames = new Set(profileSources.keys());
121380
121699
  const validIdentityNames = /* @__PURE__ */ new Set();
121381
121700
  for (const entry of params.identities) {
121382
- const validated2 = validate2(IdentitySchema, entry, "identity", entry.name);
121701
+ const validated2 = validate3(IdentitySchema, entry, "identity", entry.name);
121383
121702
  if (!validated2.ok) {
121384
121703
  push("identity", "fail", validated2.message, entry.name);
121385
121704
  continue;
@@ -121469,7 +121788,7 @@ function runDoctor(params) {
121469
121788
  if (params.directoryRules.raw === void 0) {
121470
121789
  push("directory-rules", "pass", "No directory-rules.json configured.");
121471
121790
  } else {
121472
- const validated2 = validate2(DirectoryRulesSchema, params.directoryRules, "directory-rules");
121791
+ const validated2 = validate3(DirectoryRulesSchema, params.directoryRules, "directory-rules");
121473
121792
  if (!validated2.ok) {
121474
121793
  push("directory-rules", "fail", validated2.message);
121475
121794
  } else {
@@ -121494,7 +121813,7 @@ function runDoctor(params) {
121494
121813
  if (params.globalConfig.raw === void 0) {
121495
121814
  push("global-config", "pass", "No config.json configured.");
121496
121815
  } else {
121497
- const validated2 = validate2(GlobalConfigSchema, params.globalConfig, "global-config");
121816
+ const validated2 = validate3(GlobalConfigSchema, params.globalConfig, "global-config");
121498
121817
  if (!validated2.ok) {
121499
121818
  push("global-config", "fail", validated2.message);
121500
121819
  } else {
@@ -121525,7 +121844,7 @@ function runDoctor(params) {
121525
121844
  if (params.categoriesLocal.raw === void 0) {
121526
121845
  push("categories-local", "pass", "No categories.local.json configured.");
121527
121846
  } else {
121528
- const validated2 = validate2(CategoryClassificationOverlaySchema, params.categoriesLocal, "categories-local");
121847
+ const validated2 = validate3(CategoryClassificationOverlaySchema, params.categoriesLocal, "categories-local");
121529
121848
  push(
121530
121849
  "categories-local",
121531
121850
  validated2.ok ? "pass" : "fail",
@@ -129019,8 +129338,8 @@ function getParamRegexp(segment, unnamedStart = 0) {
129019
129338
  _s2 += segment[j10];
129020
129339
  }
129021
129340
  [_s2, _i2] = replaceSegmentWildcards(_s2, _i2);
129022
- const regex = _s2.replace(/:([\w-]+)(?:\(([^)]*)\))?/g, (_, id2, p) => `(?<${toGroupName(id2)}>${p || "[^/]+"})`).replace(/\((?![?<])/g, () => `(?<${toUnnamedGroupKey(_i2++)}>`).replace(/\uFFFE(.)/g, (_, c10) => /[.*+?^${}()|[\]\\]/.test(c10) ? `\\${c10}` : c10);
129023
- return [new RegExp(`^${regex}$`), _i2];
129341
+ const regex2 = _s2.replace(/:([\w-]+)(?:\(([^)]*)\))?/g, (_, id2, p) => `(?<${toGroupName(id2)}>${p || "[^/]+"})`).replace(/\((?![?<])/g, () => `(?<${toUnnamedGroupKey(_i2++)}>`).replace(/\uFFFE(.)/g, (_, c10) => /[.*+?^${}()|[\]\\]/.test(c10) ? `\\${c10}` : c10);
129342
+ return [new RegExp(`^${regex2}$`), _i2];
129024
129343
  }
129025
129344
  function findRoute(ctx, method = "", path68, opts) {
129026
129345
  if (opts?.normalize) path68 = normalizePath(path68);
@@ -130720,13 +131039,8 @@ function rcFanoutOnDoorHub(fanout, hub) {
130720
131039
  }
130721
131040
 
130722
131041
  // src/frontdoor/quotaExpiringEvents.ts
131042
+ init_pick();
130723
131043
  init_schema2();
130724
- var MS_PER_HOUR5 = 36e5;
130725
- var MS_PER_DAY4 = 864e5;
130726
- var FIVE_HOUR_WINDOW_HOURS = 5;
130727
- var SEVEN_DAY_WINDOW_DAYS = 7;
130728
- var FIVE_HOUR_WINDOW_MS2 = FIVE_HOUR_WINDOW_HOURS * MS_PER_HOUR5;
130729
- var SEVEN_DAY_WINDOW_MS2 = SEVEN_DAY_WINDOW_DAYS * MS_PER_DAY4;
130730
131044
  var FINAL_SPAN_DENOMINATOR = 30;
130731
131045
  var QUOTA_EXPIRING_WINDOW_FRACTION = 1 / FINAL_SPAN_DENOMINATOR;
130732
131046
  function createQuotaExpiringPublisher(hub, deps) {
@@ -130746,11 +131060,11 @@ function createQuotaExpiringPublisher(hub, deps) {
130746
131060
  const unified = snapshot.providers[provider]?.rateLimit?.unified;
130747
131061
  const fiveHour = unified?.fiveHour;
130748
131062
  if (fiveHour?.utilization !== void 0 && fiveHour.resetsAt !== void 0) {
130749
- views.push({ provider, view: { window: "fiveHour", spanMs: FIVE_HOUR_WINDOW_MS2, utilization: fiveHour.utilization, resetsAtMs: Date.parse(fiveHour.resetsAt) } });
131063
+ views.push({ provider, view: { window: "fiveHour", spanMs: FIVE_HOUR_WINDOW_MS, utilization: fiveHour.utilization, resetsAtMs: Date.parse(fiveHour.resetsAt) } });
130750
131064
  }
130751
131065
  const sevenDay = unified?.sevenDay;
130752
131066
  if (sevenDay?.utilization !== void 0 && sevenDay.resetsAt !== void 0) {
130753
- views.push({ provider, view: { window: "sevenDay", spanMs: SEVEN_DAY_WINDOW_MS2, utilization: sevenDay.utilization, resetsAtMs: Date.parse(sevenDay.resetsAt) } });
131067
+ views.push({ provider, view: { window: "sevenDay", spanMs: SEVEN_DAY_WINDOW_MS, utilization: sevenDay.utilization, resetsAtMs: Date.parse(sevenDay.resetsAt) } });
130754
131068
  }
130755
131069
  }
130756
131070
  return views;
@@ -131567,10 +131881,10 @@ function quotaHeaders(upstream) {
131567
131881
  var EXHAUSTED_PERCENT = 100;
131568
131882
  var FULL_PERCENT = 100;
131569
131883
  var MINUTES_PER_HOUR3 = 60;
131570
- var FIVE_HOUR_WINDOW_HOURS2 = 5;
131884
+ var FIVE_HOUR_WINDOW_HOURS = 5;
131571
131885
  var HOURS_PER_DAY7 = 24;
131572
131886
  var DAYS_PER_WEEK3 = 7;
131573
- var FIVE_HOUR_MINUTES = FIVE_HOUR_WINDOW_HOURS2 * MINUTES_PER_HOUR3;
131887
+ var FIVE_HOUR_MINUTES = FIVE_HOUR_WINDOW_HOURS * MINUTES_PER_HOUR3;
131574
131888
  var SEVEN_DAY_MINUTES = DAYS_PER_WEEK3 * HOURS_PER_DAY7 * MINUTES_PER_HOUR3;
131575
131889
  function windowReadings(upstream, exhausted, quotaError) {
131576
131890
  let fiveHour;
@@ -137111,7 +137425,7 @@ function enrichStatuslinePayload(params) {
137111
137425
  plan = candidatePlan;
137112
137426
  }
137113
137427
  }
137114
- const providerQuotaWindows = [...scopedState?.quota?.windows ?? []].sort((a10, b) => (a10.periodMs ?? Number.POSITIVE_INFINITY) - (b.periodMs ?? Number.POSITIVE_INFINITY)).map((window) => ({ measures: window.measures, utilization: window.utilization, resetsAt: window.resetsAt }));
137428
+ const providerQuotaWindows = [...scopedState?.quota?.windows ?? []].sort((a10, b) => (a10.periodMs ?? Number.POSITIVE_INFINITY) - (b.periodMs ?? Number.POSITIVE_INFINITY)).map((window) => ({ measures: window.measures, utilization: window.utilization, resetsAt: window.resetsAt, periodMs: window.periodMs }));
137115
137429
  const providerBuckets = Object.fromEntries(
137116
137430
  (scopedState?.quota?.windows ?? []).map((window) => [
137117
137431
  window.measures,
@@ -137221,9 +137535,11 @@ var import_node_os12 = __toESM(require("node:os"), 1);
137221
137535
  var RUN_TIMEOUT_MS = 2e3;
137222
137536
  var RUN_MAX_BUFFER_BYTES = 1048576;
137223
137537
  function realStatuslinePorts(env) {
137538
+ const { locale, timeZone } = Intl.DateTimeFormat().resolvedOptions();
137224
137539
  return {
137225
137540
  env,
137226
137541
  homeDirectory: import_node_os12.default.homedir(),
137542
+ clock: { locale, timeZone },
137227
137543
  readText: (path68) => {
137228
137544
  try {
137229
137545
  return import_node_fs22.default.readFileSync(path68, "utf8");
@@ -137281,11 +137597,33 @@ function realStatuslinePorts(env) {
137281
137597
  init_statusline();
137282
137598
 
137283
137599
  // src/statusline/ansi.ts
137600
+ init_string_width();
137601
+ init_graphemes();
137284
137602
  var ESCAPE_CHAR_CODE = 27;
137285
137603
  var ESCAPE = String.fromCharCode(ESCAPE_CHAR_CODE);
137286
- var ANSI_REGEX = new RegExp(`${ESCAPE}\\[[0-9;]*[a-zA-Z]`, "g");
137604
+ var BELL = "\\u0007";
137605
+ var ESCAPE_SEQUENCE_PATTERN = [`${ESCAPE}\\[[0-?]*[ -/]*[@-~]`, `${ESCAPE}\\][^${BELL}${ESCAPE}]*(?:${BELL}|${ESCAPE}\\\\)?`, `${ESCAPE}[@-Z\\\\-_]`].join("|");
137606
+ var SPLIT_ON_ESCAPES = new RegExp(`(${ESCAPE_SEQUENCE_PATTERN})`);
137287
137607
  function visibleLength(text4) {
137288
- return text4.replace(ANSI_REGEX, "").length;
137608
+ return stringWidth(text4);
137609
+ }
137610
+ function truncateToColumns(text4, columns) {
137611
+ let used = 0;
137612
+ let kept = "";
137613
+ text4.split(SPLIT_ON_ESCAPES).forEach((part, index) => {
137614
+ if (index % 2 === 1) {
137615
+ kept += part;
137616
+ return;
137617
+ }
137618
+ for (const grapheme of graphemesOf(part)) {
137619
+ used += visibleLength(grapheme);
137620
+ if (used > columns) {
137621
+ return;
137622
+ }
137623
+ kept += grapheme;
137624
+ }
137625
+ });
137626
+ return kept;
137289
137627
  }
137290
137628
 
137291
137629
  // src/statusline/barGrid.ts
@@ -137358,13 +137696,8 @@ function layoutBarGrid(groups, maxWidth, separator, baseBarCells) {
137358
137696
  return renderGrid(layoutFor(1), maxWidth, separator, baseBarCells);
137359
137697
  }
137360
137698
 
137361
- // src/statusline/graphemes.ts
137362
- var SEGMENTER = new Intl.Segmenter(void 0, { granularity: "grapheme" });
137363
- function graphemesOf(text4) {
137364
- return Array.from(SEGMENTER.segment(text4), (part) => part.segment);
137365
- }
137366
-
137367
137699
  // src/statusline/elements/header/account.ts
137700
+ init_graphemes();
137368
137701
  function tierSuffixOf(tier) {
137369
137702
  const match = /_(\d+x)$/i.exec(tier ?? "");
137370
137703
  return match === null ? void 0 : match[1];
@@ -137432,15 +137765,29 @@ function accountSegment({ summary, settings: settings2 }) {
137432
137765
 
137433
137766
  // src/statusline/sanitise.ts
137434
137767
  init_statusline();
137435
- var BELL = "\\u0007";
137436
- var ESCAPE_SEQUENCES = new RegExp([`${ESCAPE}\\[[0-?]*[ -/]*[@-~]`, `${ESCAPE}\\][^${BELL}${ESCAPE}]*(?:${BELL}|${ESCAPE}\\\\)`, `${ESCAPE}[@-Z\\\\-_]`].join("|"), "g");
137437
- var CONTROL_AND_BIDI = /[\p{Cc}؜‎‏‪-‮⁦-⁩-]/gu;
137768
+ init_blank();
137769
+ init_graphemes();
137770
+ var ESCAPE_SEQUENCES = new RegExp(ESCAPE_SEQUENCE_PATTERN, "g");
137771
+ var CONTROL_AND_BIDI = /[\p{Cc}\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069\u206a-\u206f]/gu;
137438
137772
  function sanitiseDisplayText(text4) {
137439
137773
  return text4.replace(ESCAPE_SEQUENCES, "").replace(CONTROL_AND_BIDI, "");
137440
137774
  }
137441
137775
  function boundedDisplayText(text4) {
137442
137776
  return graphemesOf(sanitiseDisplayText(text4).trim()).slice(0, MAX_DISPLAY_TEXT_CHARS).join("").trim();
137443
137777
  }
137778
+ var TAG_SEQUENCE2 = "\\u{1F3F4}[\\u{E0020}-\\u{E007E}]+\\u{E007F}";
137779
+ var INVISIBLE_FORMAT = new RegExp(`(${TAG_SEQUENCE2})|(?![\\u200C\\u200D])\\p{Cf}`, "gu");
137780
+ var LINE_SEPARATORS = /[\u2028\u2029]/gu;
137781
+ var HANGUL_JAMO = "\\u1100-\\u115E\\u1161-\\u11FF\\uA960-\\uA97F\\uD7B0-\\uD7FF";
137782
+ var STANDALONE_HANGUL_FILLER = new RegExp(`(?<![${HANGUL_JAMO}])[\\u115F\\u1160](?![${HANGUL_JAMO}])`, "gu");
137783
+ function visibleDisplayText(text4) {
137784
+ const cleaned = sanitiseDisplayText(text4).replace(LINE_SEPARATORS, "").replace(BLANK_CELLS, " ").replace(STANDALONE_HANGUL_FILLER, " ").replace(INVISIBLE_FORMAT, (_match, tagSequence) => tagSequence ?? "");
137785
+ return graphemesOf(cleaned).map((grapheme) => {
137786
+ const body = grapheme.replace(/^ /u, "");
137787
+ const space = body === grapheme ? "" : " ";
137788
+ return drawsNothing(body) ? space : grapheme;
137789
+ }).join("").trim();
137790
+ }
137444
137791
 
137445
137792
  // src/statusline/elements/header/advisor.ts
137446
137793
  var MODEL_ID = /^(?:claude-)?(?:(\d{1,2})(?:-(\d{1,2}))?-)?(opus|sonnet|haiku)(?:-(\d{1,2})(?:-(\d{1,2}))?)?(?:-\d{8})?$/i;
@@ -137588,6 +137935,9 @@ function formatDuration(seconds) {
137588
137935
  if (seconds === void 0 || seconds <= 0) {
137589
137936
  return "available";
137590
137937
  }
137938
+ if (seconds < SECONDS_PER_MINUTE2) {
137939
+ return `${String(seconds)}s`;
137940
+ }
137591
137941
  const days = Math.floor(seconds / SECONDS_PER_DAY);
137592
137942
  const hours = Math.floor(seconds % SECONDS_PER_DAY / (MINUTES_PER_HOUR4 * SECONDS_PER_MINUTE2));
137593
137943
  const minutes = Math.floor(seconds % (MINUTES_PER_HOUR4 * SECONDS_PER_MINUTE2) / SECONDS_PER_MINUTE2);
@@ -138146,56 +138496,11 @@ function gitFilesRow(context) {
138146
138496
  }
138147
138497
 
138148
138498
  // src/statusline/elements/rows/quota.ts
138149
- function quotaRow(context) {
138150
- const { summary, nowMs, settings: settings2, palette } = context;
138151
- const style = barStyleOf(context, "usage");
138152
- const cells = [];
138153
- const drawWindow = (label2, fraction, resetsAt) => {
138154
- const clamped = Math.max(0, Math.min(1, fraction));
138155
- const color = statusColor(clamped, true, style);
138156
- cells.push(barCell(palette.paint("label", `${label2} `), ` ${withColor(color, `${(fraction * FULL_PERCENT3).toFixed(1)}%`)} (${formatDuration(secondsUntil(resetsAt, nowMs))})`, clamped, style));
138157
- };
138158
- if (summary.quotaFamilies.length > 0) {
138159
- for (const window of summary.quotaFamilies) {
138160
- drawWindow(window.measures, window.utilization, window.resetsAt);
138161
- }
138162
- } else {
138163
- if (summary.fiveHourUsed !== void 0) {
138164
- drawWindow(settings2.labels.fiveHour, summary.fiveHourUsed / FULL_PERCENT3, summary.fiveHourResetAt);
138165
- }
138166
- if (summary.sevenDayUsed !== void 0) {
138167
- drawWindow(settings2.labels.sevenDay, summary.sevenDayUsed / FULL_PERCENT3, summary.sevenDayResetAt);
138168
- }
138169
- if (summary.fiveHourUsed === void 0 && summary.sevenDayUsed === void 0) {
138170
- for (const window of summary.providerQuotaWindows) {
138171
- drawWindow(window.measures, window.utilization, window.resetsAt);
138172
- }
138173
- }
138174
- }
138175
- return { kind: "bars", cells };
138176
- }
138177
-
138178
- // src/statusline/elements/registry.ts
138179
- var HEADER_ROLES = {
138180
- model: "model",
138181
- provider: "model",
138182
- route: "label",
138183
- account: "label",
138184
- identity: "label",
138185
- headroom: "label",
138186
- project: "project",
138187
- vcs: "git",
138188
- effort: "model",
138189
- advisor: "label",
138190
- version: "label",
138191
- outputStyle: "label"
138192
- };
138193
- var ELEMENTS = {
138194
- header: { model: modelSegment, provider: providerSegment, route: routeSegment, account: accountSegment, identity: identitySegment, headroom: headroomSegment, project: projectSegment, vcs: vcsSegment, effort: effortSegment, advisor: advisorSegment, version: versionSegment, outputStyle: outputStyleSegment },
138195
- rows: { context: contextRow, quota: quotaRow, addedDirs: addedDirsRow, gitFiles: gitFilesRow }
138196
- };
138499
+ init_statusline();
138500
+ init_pick();
138197
138501
 
138198
138502
  // src/statusline/headerLayout.ts
138503
+ var SEPARATOR2 = " | ";
138199
138504
  function headerUnits(parts, overflow) {
138200
138505
  const units = [];
138201
138506
  parts.forEach((part, index) => {
@@ -138235,7 +138540,7 @@ function justify(texts, maxWidth, separator) {
138235
138540
  });
138236
138541
  return parts.join("");
138237
138542
  }
138238
- function layoutHeader(texts, maxWidth, separator) {
138543
+ function packLines(texts, maxWidth, separator) {
138239
138544
  const separatorLength = visibleLength(separator);
138240
138545
  const lines = [];
138241
138546
  let current = [];
@@ -138255,9 +138560,176 @@ function layoutHeader(texts, maxWidth, separator) {
138255
138560
  if (current.length > 0) {
138256
138561
  lines.push(current);
138257
138562
  }
138258
- return lines.map((line) => justify(line, maxWidth, separator)).join("\n");
138563
+ return lines;
138564
+ }
138565
+ function layoutHeader(texts, maxWidth, separator) {
138566
+ return packLines(texts, maxWidth, separator).map((line) => justify(line, maxWidth, separator)).join("\n");
138567
+ }
138568
+
138569
+ // src/statusline/wallClock.ts
138570
+ var DAY_KEY_LOCALE = "en-CA";
138571
+ var FORMATTERS = /* @__PURE__ */ new Map();
138572
+ function formatterFor(locale, options) {
138573
+ const key = JSON.stringify([locale, options]);
138574
+ let formatter = FORMATTERS.get(key);
138575
+ if (formatter === void 0) {
138576
+ formatter = new Intl.DateTimeFormat(locale, options);
138577
+ FORMATTERS.set(key, formatter);
138578
+ }
138579
+ return formatter;
138580
+ }
138581
+ function formatWallClock(atMs, nowMs, clock, settings2) {
138582
+ const { locale, timeZone } = clock;
138583
+ const time4 = formatterFor(locale, {
138584
+ timeZone,
138585
+ timeStyle: settings2.seconds ? "medium" : "short",
138586
+ ...settings2.hourCycle === "auto" ? {} : { hourCycle: settings2.hourCycle }
138587
+ }).format(atMs);
138588
+ const dayKey = formatterFor(DAY_KEY_LOCALE, { timeZone, year: "numeric", month: "numeric", day: "numeric" });
138589
+ if (dayKey.format(atMs) === dayKey.format(nowMs)) {
138590
+ return time4;
138591
+ }
138592
+ return `${formatterFor(locale, { timeZone, month: "short", day: "numeric" }).format(atMs)} ${time4}`;
138593
+ }
138594
+
138595
+ // src/statusline/resetTime.ts
138596
+ var AVAILABLE = formatDuration(void 0);
138597
+ function elapsedPercent(resetMs, periodMs, nowMs) {
138598
+ if (!Number.isFinite(resetMs) || periodMs === void 0) {
138599
+ return void 0;
138600
+ }
138601
+ const share = (nowMs - (resetMs - periodMs)) / periodMs * FULL_PERCENT3;
138602
+ return Math.max(0, Math.min(FULL_PERCENT3, Math.round(share)));
138603
+ }
138604
+ function formatResetTime(window, nowMs, settings2, clock) {
138605
+ const resetMs = window.resetsAt === void 0 ? Number.NaN : Date.parse(window.resetsAt);
138606
+ const secondsLeft = secondsUntil(window.resetsAt, nowMs);
138607
+ const pending = secondsLeft !== void 0 && secondsLeft > 0;
138608
+ const relative = formatDuration(secondsLeft);
138609
+ const absolute = pending ? `at ${formatWallClock(resetMs, nowMs, clock, settings2.clock)}` : AVAILABLE;
138610
+ const elapsed = elapsedPercent(resetMs, window.periodMs, nowMs);
138611
+ const elapsedText = elapsed === void 0 ? void 0 : `${String(elapsed)}% elapsed`;
138612
+ switch (settings2.usage.timeFormat) {
138613
+ case "relative":
138614
+ return { text: relative, pending };
138615
+ case "absolute":
138616
+ return { text: absolute, pending };
138617
+ case "both":
138618
+ return { text: pending ? `${relative}, ${absolute}` : AVAILABLE, pending };
138619
+ case "elapsed":
138620
+ return { text: elapsedText ?? "", pending };
138621
+ case "elapsedAndAbsolute":
138622
+ return { text: [elapsedText, pending ? absolute : void 0].filter((part) => part !== void 0).join(", "), pending };
138623
+ default:
138624
+ return settings2.usage.timeFormat;
138625
+ }
138626
+ }
138627
+
138628
+ // src/statusline/elements/rows/quota.ts
138629
+ function safeLabel(label2) {
138630
+ return truncateToColumns(visibleDisplayText(label2), MAX_STATUSLINE_LABEL_COLUMNS).trim();
138631
+ }
138632
+ function modelScopedWindows({ payload }) {
138633
+ return (payload.rate_limits?.model_scoped ?? []).flatMap((window) => {
138634
+ const label2 = safeLabel(window.display_name ?? "");
138635
+ if (label2 === "" || window.utilization === void 0 || !Number.isFinite(window.utilization)) {
138636
+ return [];
138637
+ }
138638
+ return [{ label: label2, fraction: window.utilization / FULL_PERCENT3, resetsAt: window.resets_at, periodMs: SEVEN_DAY_WINDOW_MS, weekly: false }];
138639
+ });
138640
+ }
138641
+ function candidateWindows(context) {
138642
+ const { summary, settings: settings2 } = context;
138643
+ if (summary.quotaFamilies.length > 0) {
138644
+ return summary.quotaFamilies.map((window) => ({ label: window.measures, fraction: window.utilization, resetsAt: window.resetsAt, periodMs: void 0, weekly: false }));
138645
+ }
138646
+ const windows = [];
138647
+ if (summary.fiveHourUsed !== void 0) {
138648
+ windows.push({ label: settings2.labels.fiveHour, fraction: summary.fiveHourUsed / FULL_PERCENT3, resetsAt: summary.fiveHourResetAt, periodMs: FIVE_HOUR_WINDOW_MS, weekly: false });
138649
+ }
138650
+ if (summary.sevenDayUsed !== void 0) {
138651
+ windows.push({ label: settings2.labels.sevenDay, fraction: summary.sevenDayUsed / FULL_PERCENT3, resetsAt: summary.sevenDayResetAt, periodMs: SEVEN_DAY_WINDOW_MS, weekly: true });
138652
+ }
138653
+ if (summary.fiveHourUsed === void 0 && summary.sevenDayUsed === void 0) {
138654
+ windows.push(...summary.providerQuotaWindows.map((window) => ({ label: window.measures, fraction: window.utilization, resetsAt: window.resetsAt, periodMs: window.periodMs, weekly: false })));
138655
+ }
138656
+ if (settings2.usage.modelScoped && summary.provider === void 0) {
138657
+ windows.push(...modelScopedWindows(context));
138658
+ }
138659
+ return windows;
138660
+ }
138661
+ function visibleWindows(context) {
138662
+ const { summary, settings: settings2 } = context;
138663
+ const candidates = candidateWindows(context);
138664
+ const mostUsed = Math.max(0, ...candidates.map((window) => window.fraction * FULL_PERCENT3));
138665
+ if (mostUsed < settings2.usage.threshold) {
138666
+ return [];
138667
+ }
138668
+ const hidesWeekly = summary.fiveHourUsed !== void 0 && summary.sevenDayUsed !== void 0 && summary.sevenDayUsed < settings2.usage.sevenDayThreshold;
138669
+ return hidesWeekly ? candidates.filter((window) => !window.weekly) : candidates;
138670
+ }
138671
+ function figuresOf(window, context, style) {
138672
+ const { settings: settings2, nowMs, ports } = context;
138673
+ const clamped = Math.max(0, Math.min(1, window.fraction));
138674
+ const used = window.fraction * FULL_PERCENT3;
138675
+ const shown = settings2.usage.value === "remaining" ? Math.max(0, FULL_PERCENT3 - used) : used;
138676
+ const { text: text4, pending } = formatResetTime(window, nowMs, settings2, ports.clock);
138677
+ return { value: withColor(statusColor(clamped, true, style), `${shown.toFixed(1)}%`), reset: text4, pending };
138678
+ }
138679
+ function resetSuffix(reset, pending, context) {
138680
+ if (reset === "") {
138681
+ return "";
138682
+ }
138683
+ const { usage } = context.settings;
138684
+ const elapsedForm = usage.timeFormat === "elapsed" || usage.timeFormat === "elapsedAndAbsolute";
138685
+ if (!usage.resetLabel || !pending || elapsedForm) {
138686
+ return `(${reset})`;
138687
+ }
138688
+ return `(${usage.timeFormat === "absolute" ? "resets" : "resets in"} ${reset})`;
138689
+ }
138690
+ function wrapped(windows, width) {
138691
+ return packLines(windows, width, SEPARATOR2).map((line) => line.join(SEPARATOR2));
138692
+ }
138693
+ function quotaRow(context) {
138694
+ const { palette, settings: settings2 } = context;
138695
+ const style = barStyleOf(context, "usage");
138696
+ const windows = visibleWindows(context);
138697
+ const parts = windows.map((window) => {
138698
+ const { value: value2, reset, pending } = figuresOf(window, context, style);
138699
+ return { window, value: value2, reset, suffix: resetSuffix(reset, pending, context) };
138700
+ });
138701
+ if (settings2.usage.compact) {
138702
+ const lines = parts.map(({ window, value: value2, reset }) => `${palette.paint("label", `${window.label}:`)} ${value2}${reset === "" ? "" : ` ${palette.paint("label", `(${reset})`)}`}`);
138703
+ return { kind: "text", lines: wrapped(lines, context.width) };
138704
+ }
138705
+ if (!settings2.usage.bar) {
138706
+ const lines = parts.map(({ window, value: value2, suffix }) => `${palette.paint("label", `${window.label} `)}${value2}${suffix === "" ? "" : ` ${suffix}`}`);
138707
+ return { kind: "text", lines: wrapped(lines, context.width) };
138708
+ }
138709
+ const cells = parts.map(({ window, value: value2, suffix }) => barCell(palette.paint("label", `${window.label} `), ` ${value2}${suffix === "" ? "" : ` ${suffix}`}`, Math.max(0, Math.min(1, window.fraction)), style));
138710
+ return { kind: "bars", cells };
138259
138711
  }
138260
138712
 
138713
+ // src/statusline/elements/registry.ts
138714
+ var HEADER_ROLES = {
138715
+ model: "model",
138716
+ provider: "model",
138717
+ route: "label",
138718
+ account: "label",
138719
+ identity: "label",
138720
+ headroom: "label",
138721
+ project: "project",
138722
+ vcs: "git",
138723
+ effort: "model",
138724
+ advisor: "label",
138725
+ version: "label",
138726
+ outputStyle: "label"
138727
+ };
138728
+ var ELEMENTS = {
138729
+ header: { model: modelSegment, provider: providerSegment, route: routeSegment, account: accountSegment, identity: identitySegment, headroom: headroomSegment, project: projectSegment, vcs: vcsSegment, effort: effortSegment, advisor: advisorSegment, version: versionSegment, outputStyle: outputStyleSegment },
138730
+ rows: { context: contextRow, quota: quotaRow, addedDirs: addedDirsRow, gitFiles: gitFilesRow }
138731
+ };
138732
+
138261
138733
  // src/statusline/identityTranscript.ts
138262
138734
  init_zod();
138263
138735
  var TRANSCRIPT_CHUNK_BYTES = 65536;
@@ -138350,7 +138822,6 @@ function readTranscriptIdentity(ports, transcriptPath) {
138350
138822
 
138351
138823
  // src/statusline/render.ts
138352
138824
  var RESERVED_COLUMNS = 4;
138353
- var SEPARATOR2 = " | ";
138354
138825
  function once2(read) {
138355
138826
  let kept;
138356
138827
  return () => {
@@ -138360,12 +138831,14 @@ function once2(read) {
138360
138831
  }
138361
138832
  function renderStatuslineBlock(input2) {
138362
138833
  const { terminalWidth, settings: settings2 = STATUSLINE_DEFAULTS, elements = ELEMENTS } = input2;
138834
+ const width = Math.max(TWENTY, terminalWidth - RESERVED_COLUMNS);
138363
138835
  const context = {
138364
138836
  summary: input2.summary,
138365
138837
  view: input2.view,
138366
138838
  payload: input2.payload,
138367
138839
  nowMs: input2.nowMs,
138368
138840
  terminalWidth,
138841
+ width,
138369
138842
  settings: settings2,
138370
138843
  palette: createPalette(settings2.colours, colourEnabled(input2.ports.env)),
138371
138844
  ports: input2.ports,
@@ -138376,7 +138849,6 @@ function renderStatuslineBlock(input2) {
138376
138849
  return text4 === void 0 ? [] : { name, text: context.palette.paint(HEADER_ROLES[name], text4) };
138377
138850
  });
138378
138851
  const header = headerUnits(parts, settings2.git.branchOverflow);
138379
- const width = Math.max(TWENTY, terminalWidth - RESERVED_COLUMNS);
138380
138852
  const lines = [];
138381
138853
  if (header.length > 0) {
138382
138854
  lines.push(layoutHeader(header, width, SEPARATOR2));
@@ -141043,13 +141515,13 @@ function timeRegex(args) {
141043
141515
  return new RegExp(`^${timeRegexSource(args)}$`);
141044
141516
  }
141045
141517
  function datetimeRegex(args) {
141046
- let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
141518
+ let regex2 = `${dateRegexSource}T${timeRegexSource(args)}`;
141047
141519
  const opts = [];
141048
141520
  opts.push(args.local ? `Z?` : `Z`);
141049
141521
  if (args.offset)
141050
141522
  opts.push(`([+-]\\d{2}:?\\d{2})`);
141051
- regex = `${regex}(${opts.join("|")})`;
141052
- return new RegExp(`^${regex}$`);
141523
+ regex2 = `${regex2}(${opts.join("|")})`;
141524
+ return new RegExp(`^${regex2}$`);
141053
141525
  }
141054
141526
  function isValidIP(ip2, version2) {
141055
141527
  if ((version2 === "v4" || !version2) && ipv4Regex.test(ip2)) {
@@ -141295,8 +141767,8 @@ var ZodString2 = class _ZodString2 extends ZodType2 {
141295
141767
  status.dirty();
141296
141768
  }
141297
141769
  } else if (check2.kind === "datetime") {
141298
- const regex = datetimeRegex(check2);
141299
- if (!regex.test(input2.data)) {
141770
+ const regex2 = datetimeRegex(check2);
141771
+ if (!regex2.test(input2.data)) {
141300
141772
  ctx = this._getOrReturnCtx(input2, ctx);
141301
141773
  addIssueToContext(ctx, {
141302
141774
  code: ZodIssueCode2.invalid_string,
@@ -141306,8 +141778,8 @@ var ZodString2 = class _ZodString2 extends ZodType2 {
141306
141778
  status.dirty();
141307
141779
  }
141308
141780
  } else if (check2.kind === "date") {
141309
- const regex = dateRegex;
141310
- if (!regex.test(input2.data)) {
141781
+ const regex2 = dateRegex;
141782
+ if (!regex2.test(input2.data)) {
141311
141783
  ctx = this._getOrReturnCtx(input2, ctx);
141312
141784
  addIssueToContext(ctx, {
141313
141785
  code: ZodIssueCode2.invalid_string,
@@ -141317,8 +141789,8 @@ var ZodString2 = class _ZodString2 extends ZodType2 {
141317
141789
  status.dirty();
141318
141790
  }
141319
141791
  } else if (check2.kind === "time") {
141320
- const regex = timeRegex(check2);
141321
- if (!regex.test(input2.data)) {
141792
+ const regex2 = timeRegex(check2);
141793
+ if (!regex2.test(input2.data)) {
141322
141794
  ctx = this._getOrReturnCtx(input2, ctx);
141323
141795
  addIssueToContext(ctx, {
141324
141796
  code: ZodIssueCode2.invalid_string,
@@ -141393,8 +141865,8 @@ var ZodString2 = class _ZodString2 extends ZodType2 {
141393
141865
  }
141394
141866
  return { status: status.value, value: input2.data };
141395
141867
  }
141396
- _regex(regex, validation, message) {
141397
- return this.refinement((data) => regex.test(data), {
141868
+ _regex(regex2, validation, message) {
141869
+ return this.refinement((data) => regex2.test(data), {
141398
141870
  validation,
141399
141871
  code: ZodIssueCode2.invalid_string,
141400
141872
  ...errorUtil.errToObj(message)
@@ -141486,10 +141958,10 @@ var ZodString2 = class _ZodString2 extends ZodType2 {
141486
141958
  duration(message) {
141487
141959
  return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
141488
141960
  }
141489
- regex(regex, message) {
141961
+ regex(regex2, message) {
141490
141962
  return this._addCheck({
141491
141963
  kind: "regex",
141492
- regex,
141964
+ regex: regex2,
141493
141965
  ...errorUtil.errToObj(message)
141494
141966
  });
141495
141967
  }
@@ -144863,7 +145335,7 @@ function addFormat(schema, value2, message, refs) {
144863
145335
  setResponseValueAndErrors(schema, "format", value2, message, refs);
144864
145336
  }
144865
145337
  }
144866
- function addPattern2(schema, regex, message, refs) {
145338
+ function addPattern2(schema, regex2, message, refs) {
144867
145339
  if (schema.pattern || schema.allOf?.some((x) => x.pattern)) {
144868
145340
  if (!schema.allOf) {
144869
145341
  schema.allOf = [];
@@ -144884,24 +145356,24 @@ function addPattern2(schema, regex, message, refs) {
144884
145356
  }
144885
145357
  }
144886
145358
  schema.allOf.push({
144887
- pattern: stringifyRegExpWithFlags(regex, refs),
145359
+ pattern: stringifyRegExpWithFlags(regex2, refs),
144888
145360
  ...message && refs.errorMessages && { errorMessage: { pattern: message } }
144889
145361
  });
144890
145362
  } else {
144891
- setResponseValueAndErrors(schema, "pattern", stringifyRegExpWithFlags(regex, refs), message, refs);
145363
+ setResponseValueAndErrors(schema, "pattern", stringifyRegExpWithFlags(regex2, refs), message, refs);
144892
145364
  }
144893
145365
  }
144894
- function stringifyRegExpWithFlags(regex, refs) {
144895
- if (!refs.applyRegexFlags || !regex.flags) {
144896
- return regex.source;
145366
+ function stringifyRegExpWithFlags(regex2, refs) {
145367
+ if (!refs.applyRegexFlags || !regex2.flags) {
145368
+ return regex2.source;
144897
145369
  }
144898
145370
  const flags = {
144899
- i: regex.flags.includes("i"),
144900
- m: regex.flags.includes("m"),
144901
- s: regex.flags.includes("s")
145371
+ i: regex2.flags.includes("i"),
145372
+ m: regex2.flags.includes("m"),
145373
+ s: regex2.flags.includes("s")
144902
145374
  // `.` matches newlines
144903
145375
  };
144904
- const source = flags.i ? regex.source.toLowerCase() : regex.source;
145376
+ const source = flags.i ? regex2.source.toLowerCase() : regex2.source;
144905
145377
  let pattern = "";
144906
145378
  let isEscaped = false;
144907
145379
  let inCharGroup = false;
@@ -144962,7 +145434,7 @@ function stringifyRegExpWithFlags(regex, refs) {
144962
145434
  new RegExp(pattern);
144963
145435
  } catch {
144964
145436
  console.warn(`Could not convert regex pattern at ${refs.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`);
144965
- return regex.source;
145437
+ return regex2.source;
144966
145438
  }
144967
145439
  return pattern;
144968
145440
  }