ccstatusline-zh 2.2.33 → 2.2.34

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.
@@ -20698,7 +20698,7 @@ var VARIATION_SELECTOR_SUPPLEMENT_START = 917760;
20698
20698
  var VARIATION_SELECTOR_SUPPLEMENT_END = 917999;
20699
20699
  var REGIONAL_INDICATOR_START = 127462;
20700
20700
  var REGIONAL_INDICATOR_END = 127487;
20701
- var SGR_REGEX = /\x1b\[[0-9;]*m/g;
20701
+ var SGR_REGEX = /(?:\x1b\[|\x9b)[0-9;]*m/g;
20702
20702
  var FIRST_CLUSTER_EXTENDER = 768;
20703
20703
  var CLUSTER_WIDTH_CACHE_LIMIT = 4096;
20704
20704
  var clusterWidthCache = new Map;
@@ -20977,7 +20977,8 @@ function stripSgrCodes(text) {
20977
20977
  return text.replace(SGR_REGEX, "");
20978
20978
  }
20979
20979
  function sgrClearsBackground(sequence) {
20980
- const params = sequence.slice(2, -1).split(";").map((param) => Number.parseInt(param || "0", 10));
20980
+ const introducerLength = sequence.startsWith(C1_CSI2) ? 1 : 2;
20981
+ const params = sequence.slice(introducerLength, -1).split(";").map((param) => Number.parseInt(param || "0", 10));
20981
20982
  let clearsBackground = false;
20982
20983
  for (let i = 0;i < params.length; i++) {
20983
20984
  const param = params[i];
@@ -20995,29 +20996,6 @@ function sgrClearsBackground(sequence) {
20995
20996
  function restoreBackgroundAfterResets(text, backgroundCode) {
20996
20997
  return text.replace(SGR_REGEX, (sequence) => sgrClearsBackground(sequence) ? sequence + backgroundCode : sequence);
20997
20998
  }
20998
- function stripOscCodes(text) {
20999
- let result = "";
21000
- let index = 0;
21001
- while (index < text.length) {
21002
- const escape = parseEscapeSequence(text, index);
21003
- if (escape) {
21004
- const isOsc = escape.sequence.startsWith(`${ESC2}]`) || escape.sequence.startsWith(C1_OSC2);
21005
- if (!isOsc) {
21006
- result += escape.sequence;
21007
- }
21008
- index = escape.nextIndex;
21009
- continue;
21010
- }
21011
- const codePoint = text.codePointAt(index);
21012
- if (codePoint === undefined) {
21013
- break;
21014
- }
21015
- const character = String.fromCodePoint(codePoint);
21016
- result += character;
21017
- index += character.length;
21018
- }
21019
- return result;
21020
- }
21021
20999
  function isEscapeIntroducer(character) {
21022
21000
  return character === ESC2 || character === C1_CSI2 || character === C1_OSC2;
21023
21001
  }
@@ -21887,6 +21865,7 @@ var LOCK_FILE = path.join(CACHE_DIR, "claude-status.lock");
21887
21865
  var CACHE_MAX_AGE = 300;
21888
21866
  var FAILURE_BACKOFF = 30;
21889
21867
  var STATUS_HOST = "status.claude.com";
21868
+ var CLAUDE_STATUS_PAGE_URL = `https://${STATUS_HOST}`;
21890
21869
  var STATUS_PATH = "/api/v2/status.json";
21891
21870
  var INCIDENTS_PATH = "/api/v2/incidents.json";
21892
21871
  var STATUS_TIMEOUT_MS = 5000;
@@ -22886,7 +22865,7 @@ function writeCachedWidth(sessionId, width, deps = defaultDeps2) {
22886
22865
 
22887
22866
  // src/utils/terminal.ts
22888
22867
  var __dirname = "/home/runner/work/ccstatusline-zh/ccstatusline-zh/src/utils";
22889
- var PACKAGE_VERSION = "2.2.33";
22868
+ var PACKAGE_VERSION = "2.2.34";
22890
22869
  function getPackageVersion() {
22891
22870
  if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
22892
22871
  return PACKAGE_VERSION;
@@ -24175,12 +24154,20 @@ function buildBranchWebUrl(remote, encodedBranch) {
24175
24154
  var ESC3 = "\x1B";
24176
24155
  var BEL3 = "\x07";
24177
24156
  var C1_ST = "œ";
24178
- var SGR = /\x1b\[[0-9;:]*m/y;
24179
- var OSC8 = /\x1b\]8;[A-Za-z0-9=:_.-]*;[^\x00-\x20\x7f-\x9f]*(?:\x1b\\|\x07)/y;
24157
+ var SGR = /(?:\x1b\[|\x9b)[0-9;:]*m/y;
24158
+ var OSC8 = /(?:\x1b\]|\x9d)8;[A-Za-z0-9=:_.-]*;[^\x00-\x20\x7f-\x9f]*(?:\x1b\\|\x9c|\x07)/y;
24180
24159
  var SAFE_URL = /^[^\x00-\x20\x7f-\x9f]*$/;
24181
24160
  var CONTROL = /[\x00-\x08\x0b-\x1f\x7f-\x9f]/;
24182
24161
  var CONTROL_GLOBAL = /[\x00-\x08\x0b-\x1f\x7f-\x9f]/g;
24183
24162
  var STRING_INTRODUCERS = new Set(["]", "P", "X", "^", "_"]);
24163
+ var C1_INTRODUCERS = new Map([
24164
+ ["", "P"],
24165
+ ["˜", "X"],
24166
+ ["›", "["],
24167
+ ["", "]"],
24168
+ ["ž", "^"],
24169
+ ["Ÿ", "_"]
24170
+ ]);
24184
24171
  function matchAt(pattern, text, index) {
24185
24172
  pattern.lastIndex = index;
24186
24173
  return pattern.exec(text)?.[0] ?? null;
@@ -24191,13 +24178,23 @@ function isCsiParameterOrIntermediate(code) {
24191
24178
  function isIntermediate(code) {
24192
24179
  return code >= 32 && code <= 47;
24193
24180
  }
24181
+ function startsSequence(char) {
24182
+ return char === ESC3 || char !== undefined && C1_INTRODUCERS.has(char);
24183
+ }
24184
+ function toSevenBit(sequence) {
24185
+ const introducer = C1_INTRODUCERS.get(sequence.charAt(0));
24186
+ const sevenBit = introducer ? ESC3 + introducer + sequence.slice(1) : sequence;
24187
+ return sevenBit.endsWith(C1_ST) ? `${sevenBit.slice(0, -1)}${ESC3}\\` : sevenBit;
24188
+ }
24194
24189
  function skipEscapeSequence(text, index) {
24195
- const introducer = text[index + 1];
24190
+ const c1Introducer = C1_INTRODUCERS.get(text.charAt(index));
24191
+ const introducer = c1Introducer ?? text[index + 1];
24196
24192
  if (introducer === undefined) {
24197
24193
  return index + 1;
24198
24194
  }
24195
+ const bodyStart = c1Introducer ? index + 1 : index + 2;
24199
24196
  if (introducer === "[") {
24200
- let end = index + 2;
24197
+ let end = bodyStart;
24201
24198
  while (end < text.length && isCsiParameterOrIntermediate(text.charCodeAt(end))) {
24202
24199
  end++;
24203
24200
  }
@@ -24205,7 +24202,7 @@ function skipEscapeSequence(text, index) {
24205
24202
  return final >= 64 && final <= 126 ? end + 1 : end;
24206
24203
  }
24207
24204
  if (STRING_INTRODUCERS.has(introducer)) {
24208
- for (let end = index + 2;end < text.length; end++) {
24205
+ for (let end = bodyStart;end < text.length; end++) {
24209
24206
  const char = text[end];
24210
24207
  if (char === BEL3 || char === C1_ST) {
24211
24208
  return end + 1;
@@ -24233,11 +24230,10 @@ function sanitizeTerminalText(text) {
24233
24230
  let result = "";
24234
24231
  let index = 0;
24235
24232
  while (index < text.length) {
24236
- const char = text[index];
24237
- if (char === ESC3) {
24233
+ if (startsSequence(text[index])) {
24238
24234
  const kept = matchAt(SGR, text, index) ?? matchAt(OSC8, text, index);
24239
24235
  if (kept) {
24240
- result += kept;
24236
+ result += toSevenBit(kept);
24241
24237
  index += kept.length;
24242
24238
  } else {
24243
24239
  index = skipEscapeSequence(text, index);
@@ -24245,7 +24241,7 @@ function sanitizeTerminalText(text) {
24245
24241
  continue;
24246
24242
  }
24247
24243
  let end = index;
24248
- while (end < text.length && text[end] !== ESC3) {
24244
+ while (end < text.length && !startsSequence(text[end])) {
24249
24245
  end++;
24250
24246
  }
24251
24247
  result += text.slice(index, end).replace(CONTROL_GLOBAL, "");
@@ -24273,11 +24269,15 @@ function stripControlChars(value) {
24273
24269
  }
24274
24270
  return result;
24275
24271
  }
24272
+ var SAFE_TERMINAL_SEQUENCE = /(?:\x1b\[[0-9;:]*m|\x9b[0-9;:]*m|(?:\x1b\]|\x9d)8;)/;
24273
+ function sanitizeLinkText(value) {
24274
+ return SAFE_TERMINAL_SEQUENCE.test(value) ? sanitizeTerminalText(value) : stripControlChars(value);
24275
+ }
24276
24276
  function renderOsc8Link(url, text) {
24277
24277
  if (!isSafeHyperlinkUrl(url)) {
24278
24278
  return stripControlChars(text);
24279
24279
  }
24280
- return `\x1B]8;;${url}\x1B\\${stripControlChars(text)}\x1B]8;;\x1B\\`;
24280
+ return `\x1B]8;;${url}\x1B\\${sanitizeLinkText(text)}\x1B]8;;\x1B\\`;
24281
24281
  }
24282
24282
  function encodeGitRefForUrlPath(ref) {
24283
24283
  return ref.split("/").map((segment) => encodeURIComponent(segment)).join("/");
@@ -27143,7 +27143,7 @@ var styles_default = styles4;
27143
27143
  // node_modules/ink/build/reconciler.js
27144
27144
  if (process4.env["DEV"] === "true") {
27145
27145
  try {
27146
- await import("./devtools-3w5md92d.js");
27146
+ await import("./devtools-nceaxkjz.js");
27147
27147
  } catch (error) {
27148
27148
  if (error.code === "ERR_MODULE_NOT_FOUND") {
27149
27149
  console.warn(`
@@ -29705,7 +29705,7 @@ var import_react24 = __toESM(require_react(), 1);
29705
29705
  // node_modules/ink/build/hooks/use-is-screen-reader-enabled.js
29706
29706
  var import_react25 = __toESM(require_react(), 1);
29707
29707
  // src/widgets/shared/max-width.tsx
29708
- var import_react26 = __toESM(require_react(), 1);
29708
+ var import_react27 = __toESM(require_react(), 1);
29709
29709
 
29710
29710
  // src/utils/input-guards.ts
29711
29711
  var CONTROL_CHAR_REGEX = /[\u0000-\u001F\u007F]/u;
@@ -29722,8 +29722,45 @@ var shouldInsertInput = (input, key) => {
29722
29722
  return !CONTROL_CHAR_REGEX.test(input);
29723
29723
  };
29724
29724
 
29725
- // src/widgets/shared/max-width.tsx
29725
+ // src/widgets/shared/cursor-blink.ts
29726
+ var import_react26 = __toESM(require_react(), 1);
29727
+ function useCursorBlink() {
29728
+ const [visible, setVisible] = import_react26.useState(true);
29729
+ const timer = import_react26.useRef(undefined);
29730
+ const restart = import_react26.useCallback(() => {
29731
+ clearInterval(timer.current);
29732
+ timer.current = setInterval(() => {
29733
+ setVisible((previous) => !previous);
29734
+ }, 500);
29735
+ }, []);
29736
+ import_react26.useEffect(() => {
29737
+ restart();
29738
+ return () => {
29739
+ clearInterval(timer.current);
29740
+ };
29741
+ }, [restart]);
29742
+ use_input_default(() => {
29743
+ setVisible(true);
29744
+ restart();
29745
+ });
29746
+ return visible;
29747
+ }
29748
+
29749
+ // src/widgets/shared/BlinkingCursor.tsx
29726
29750
  var jsx_runtime = __toESM(require_jsx_runtime(), 1);
29751
+ function BlinkingCursor({ children, inverse = false, dimColor }) {
29752
+ const visible = useCursorBlink();
29753
+ return /* @__PURE__ */ jsx_runtime.jsx(Text, {
29754
+ inverse: inverse && visible,
29755
+ backgroundColor: !inverse && visible ? "gray" : undefined,
29756
+ color: !inverse && visible ? "black" : undefined,
29757
+ dimColor,
29758
+ children
29759
+ });
29760
+ }
29761
+
29762
+ // src/widgets/shared/max-width.tsx
29763
+ var jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
29727
29764
  var MAX_WIDTH_ACTION = "edit-max-width";
29728
29765
  var MAX_WIDTH_KEYBIND = {
29729
29766
  key: "w",
@@ -29740,12 +29777,12 @@ function applyMaxWidth(text, maxWidth) {
29740
29777
  return maxWidth && maxWidth > 0 ? truncateStyledText(text, maxWidth, { ellipsis: true }) : text;
29741
29778
  }
29742
29779
  function renderMaxWidthEditor(props) {
29743
- return /* @__PURE__ */ jsx_runtime.jsx(MaxWidthEditor, {
29780
+ return /* @__PURE__ */ jsx_runtime2.jsx(MaxWidthEditor, {
29744
29781
  ...props
29745
29782
  });
29746
29783
  }
29747
29784
  var MaxWidthEditor = ({ widget, onComplete, onCancel }) => {
29748
- const [widthInput, setWidthInput] = import_react26.useState(widget.maxWidth?.toString() ?? "");
29785
+ const [widthInput, setWidthInput] = import_react27.useState(widget.maxWidth?.toString() ?? "");
29749
29786
  use_input_default((input, key) => {
29750
29787
  if (key.return) {
29751
29788
  const width = Number.parseInt(widthInput, 10);
@@ -29763,25 +29800,23 @@ var MaxWidthEditor = ({ widget, onComplete, onCancel }) => {
29763
29800
  setWidthInput(widthInput + input);
29764
29801
  }
29765
29802
  });
29766
- return /* @__PURE__ */ jsx_runtime.jsxs(Box_default, {
29803
+ return /* @__PURE__ */ jsx_runtime2.jsxs(Box_default, {
29767
29804
  flexDirection: "column",
29768
29805
  children: [
29769
- /* @__PURE__ */ jsx_runtime.jsxs(Box_default, {
29806
+ /* @__PURE__ */ jsx_runtime2.jsxs(Box_default, {
29770
29807
  children: [
29771
- /* @__PURE__ */ jsx_runtime.jsx(Text, {
29808
+ /* @__PURE__ */ jsx_runtime2.jsx(Text, {
29772
29809
  children: "输入最大宽度(留空表示不限):"
29773
29810
  }),
29774
- /* @__PURE__ */ jsx_runtime.jsx(Text, {
29811
+ /* @__PURE__ */ jsx_runtime2.jsx(Text, {
29775
29812
  children: widthInput
29776
29813
  }),
29777
- /* @__PURE__ */ jsx_runtime.jsx(Text, {
29778
- backgroundColor: "gray",
29779
- color: "black",
29814
+ /* @__PURE__ */ jsx_runtime2.jsx(BlinkingCursor, {
29780
29815
  children: " "
29781
29816
  })
29782
29817
  ]
29783
29818
  }),
29784
- /* @__PURE__ */ jsx_runtime.jsx(Text, {
29819
+ /* @__PURE__ */ jsx_runtime2.jsx(Text, {
29785
29820
  dimColor: true,
29786
29821
  children: "按 Enter 保存,ESC 取消"
29787
29822
  })
@@ -29790,10 +29825,10 @@ var MaxWidthEditor = ({ widget, onComplete, onCancel }) => {
29790
29825
  };
29791
29826
 
29792
29827
  // src/widgets/shared/symbol-override.tsx
29793
- var import_react28 = __toESM(require_react(), 1);
29828
+ var import_react29 = __toESM(require_react(), 1);
29794
29829
 
29795
29830
  // src/widgets/shared/text-cursor.ts
29796
- var import_react27 = __toESM(require_react(), 1);
29831
+ var import_react28 = __toESM(require_react(), 1);
29797
29832
  var segmenter2 = "Segmenter" in Intl ? new Intl.Segmenter(undefined, { granularity: "grapheme" }) : null;
29798
29833
  function getGraphemes(str) {
29799
29834
  if (segmenter2) {
@@ -29837,21 +29872,22 @@ function applyTextCursorInput(state, input, key) {
29837
29872
  }
29838
29873
  return null;
29839
29874
  }
29840
- function renderTextWithCursor({ text, cursor }) {
29875
+ function renderTextWithCursor({ text, cursor }, visible = true) {
29841
29876
  let offset = 0;
29842
29877
  const rendered = getGraphemes(text).map((grapheme) => {
29843
29878
  const underCursor = offset === cursor;
29844
29879
  offset += grapheme.length;
29845
- return underCursor ? `\x1B[7m${grapheme}\x1B[27m` : grapheme;
29880
+ return underCursor && visible ? `\x1B[7m${grapheme}\x1B[27m` : grapheme;
29846
29881
  }).join("");
29847
- return cursor === text.length ? `${rendered}\x1B[7m \x1B[27m` : rendered;
29882
+ return cursor === text.length ? `${rendered}${visible ? "\x1B[7m \x1B[27m" : " "}` : rendered;
29848
29883
  }
29849
29884
  function useTextCursor(initialText) {
29850
- const [state, setState] = import_react27.useState({ text: initialText, cursor: initialText.length });
29851
- const latestState = import_react27.useRef(state);
29885
+ const [state, setState] = import_react28.useState({ text: initialText, cursor: initialText.length });
29886
+ const latestState = import_react28.useRef(state);
29887
+ const cursorVisible = useCursorBlink();
29852
29888
  return {
29853
29889
  text: state.text,
29854
- display: renderTextWithCursor(state),
29890
+ display: renderTextWithCursor(state, cursorVisible),
29855
29891
  getText: () => latestState.current.text,
29856
29892
  handleInput: (input, key) => {
29857
29893
  const nextState = applyTextCursorInput(latestState.current, input, key);
@@ -29866,7 +29902,7 @@ function useTextCursor(initialText) {
29866
29902
  }
29867
29903
 
29868
29904
  // src/widgets/shared/symbol-override.tsx
29869
- var jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
29905
+ var jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
29870
29906
  var SYMBOL_OVERRIDE_ACTION = "edit-symbol-override";
29871
29907
  var SYMBOL_KEYBIND = {
29872
29908
  key: "g",
@@ -29912,14 +29948,14 @@ function renderSymbolOverrideEditor(props, defaultSymbol) {
29912
29948
  return renderSymbolSlotsEditor(props, [{ id: "character", label: "字符", defaultSymbol }]);
29913
29949
  }
29914
29950
  function renderSymbolSlotsEditor(props, slots) {
29915
- return /* @__PURE__ */ jsx_runtime2.jsx(SymbolSlotsEditor, {
29951
+ return /* @__PURE__ */ jsx_runtime3.jsx(SymbolSlotsEditor, {
29916
29952
  ...props,
29917
29953
  slots
29918
29954
  });
29919
29955
  }
29920
29956
  var SymbolSlotsEditor = ({ widget, slots, onComplete, onCancel }) => {
29921
- const [values, setValues] = import_react28.useState(() => slots.map((slot) => getSlotSymbol(widget, slot)));
29922
- const [selectedIndex, setSelectedIndex] = import_react28.useState(0);
29957
+ const [values, setValues] = import_react29.useState(() => slots.map((slot) => getSlotSymbol(widget, slot)));
29958
+ const [selectedIndex, setSelectedIndex] = import_react29.useState(0);
29923
29959
  const labelWidth = Math.max(...slots.map((slot) => getVisibleWidth(slot.label)), 0);
29924
29960
  use_input_default((input, key) => {
29925
29961
  if (key.return) {
@@ -29939,48 +29975,49 @@ var SymbolSlotsEditor = ({ widget, slots, onComplete, onCancel }) => {
29939
29975
  setValues(values.map((value, index) => index === selectedIndex ? grapheme : value));
29940
29976
  }
29941
29977
  });
29942
- return /* @__PURE__ */ jsx_runtime2.jsxs(Box_default, {
29978
+ return /* @__PURE__ */ jsx_runtime3.jsxs(Box_default, {
29943
29979
  flexDirection: "column",
29944
29980
  children: [
29945
- /* @__PURE__ */ jsx_runtime2.jsx(Text, {
29981
+ /* @__PURE__ */ jsx_runtime3.jsx(Text, {
29946
29982
  bold: true,
29947
29983
  children: "字符"
29948
29984
  }),
29949
- /* @__PURE__ */ jsx_runtime2.jsx(Text, {
29985
+ /* @__PURE__ */ jsx_runtime3.jsx(Text, {
29950
29986
  dimColor: true,
29951
29987
  children: slots.length > 1 ? "↑↓ 选行,输入字符,Tab 恢复默认,Backspace 清空,Enter 保存,ESC 取消" : "输入任意字符或 emoji,Tab 恢复默认,Backspace 清空,Enter 保存,ESC 取消"
29952
29988
  }),
29953
- /* @__PURE__ */ jsx_runtime2.jsx(Box_default, {
29989
+ /* @__PURE__ */ jsx_runtime3.jsx(Box_default, {
29954
29990
  marginTop: 1,
29955
29991
  flexDirection: "column",
29956
29992
  children: slots.map((slot, index) => {
29957
29993
  const isSelected = index === selectedIndex;
29958
29994
  const value = values[index] ?? "";
29959
29995
  const labelPadding = " ".repeat(Math.max(labelWidth - getVisibleWidth(slot.label), 0));
29960
- return /* @__PURE__ */ jsx_runtime2.jsxs(Box_default, {
29996
+ return /* @__PURE__ */ jsx_runtime3.jsxs(Box_default, {
29961
29997
  flexDirection: "row",
29962
29998
  flexWrap: "nowrap",
29963
29999
  children: [
29964
- /* @__PURE__ */ jsx_runtime2.jsx(Box_default, {
30000
+ /* @__PURE__ */ jsx_runtime3.jsx(Box_default, {
29965
30001
  width: 4,
29966
- children: /* @__PURE__ */ jsx_runtime2.jsx(Text, {
30002
+ children: /* @__PURE__ */ jsx_runtime3.jsx(Text, {
29967
30003
  color: isSelected ? "green" : undefined,
29968
30004
  children: isSelected ? "▶ " : " "
29969
30005
  })
29970
30006
  }),
29971
- /* @__PURE__ */ jsx_runtime2.jsx(Text, {
30007
+ /* @__PURE__ */ jsx_runtime3.jsx(Text, {
29972
30008
  color: isSelected ? "green" : undefined,
29973
30009
  children: `${labelPadding}${slot.label}: `
29974
30010
  }),
29975
- value ? /* @__PURE__ */ jsx_runtime2.jsx(Text, {
30011
+ isSelected ? /* @__PURE__ */ jsx_runtime3.jsx(BlinkingCursor, {
29976
30012
  inverse: true,
29977
- children: value
29978
- }) : /* @__PURE__ */ jsx_runtime2.jsx(Text, {
30013
+ dimColor: !value,
30014
+ children: value || "(无)"
30015
+ }) : /* @__PURE__ */ jsx_runtime3.jsx(Text, {
29979
30016
  inverse: true,
29980
- dimColor: true,
29981
- children: "(无)"
30017
+ dimColor: !value,
30018
+ children: value || "(无)"
29982
30019
  }),
29983
- /* @__PURE__ */ jsx_runtime2.jsx(Text, {
30020
+ /* @__PURE__ */ jsx_runtime3.jsx(Text, {
29984
30021
  dimColor: true,
29985
30022
  children: `(默认: ${slot.defaultSymbol})`
29986
30023
  })
@@ -34253,7 +34290,7 @@ class VersionWidget {
34253
34290
  }
34254
34291
  }
34255
34292
  // src/widgets/CustomText.tsx
34256
- var jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
34293
+ var jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
34257
34294
 
34258
34295
  class CustomTextWidget {
34259
34296
  getDefaultColor() {
@@ -34286,7 +34323,7 @@ class CustomTextWidget {
34286
34323
  return [MERGE_TARGET_HIDDEN_HIDEABLE_STATE];
34287
34324
  }
34288
34325
  renderEditor(props) {
34289
- return /* @__PURE__ */ jsx_runtime3.jsx(CustomTextEditor, {
34326
+ return /* @__PURE__ */ jsx_runtime4.jsx(CustomTextEditor, {
34290
34327
  ...props
34291
34328
  });
34292
34329
  }
@@ -34308,13 +34345,13 @@ var CustomTextEditor = ({ widget, onComplete, onCancel }) => {
34308
34345
  handleInput(input, key);
34309
34346
  }
34310
34347
  });
34311
- return /* @__PURE__ */ jsx_runtime3.jsxs(Box_default, {
34348
+ return /* @__PURE__ */ jsx_runtime4.jsxs(Box_default, {
34312
34349
  flexDirection: "column",
34313
34350
  children: [
34314
- /* @__PURE__ */ jsx_runtime3.jsx(Text, {
34351
+ /* @__PURE__ */ jsx_runtime4.jsx(Text, {
34315
34352
  children: `输入自定义文本:${display}`
34316
34353
  }),
34317
- /* @__PURE__ */ jsx_runtime3.jsx(Text, {
34354
+ /* @__PURE__ */ jsx_runtime4.jsx(Text, {
34318
34355
  dimColor: true,
34319
34356
  children: "←→ 移动光标,Ctrl+←→ 跳到开头/末尾,Enter 保存,ESC 取消"
34320
34357
  })
@@ -34322,8 +34359,8 @@ var CustomTextEditor = ({ widget, onComplete, onCancel }) => {
34322
34359
  });
34323
34360
  };
34324
34361
  // src/widgets/CustomSymbol.tsx
34325
- var import_react29 = __toESM(require_react(), 1);
34326
- var jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
34362
+ var import_react30 = __toESM(require_react(), 1);
34363
+ var jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
34327
34364
 
34328
34365
  class CustomSymbolWidget {
34329
34366
  getDefaultColor() {
@@ -34356,7 +34393,7 @@ class CustomSymbolWidget {
34356
34393
  return [MERGE_TARGET_HIDDEN_HIDEABLE_STATE];
34357
34394
  }
34358
34395
  renderEditor(props) {
34359
- return /* @__PURE__ */ jsx_runtime4.jsx(CustomSymbolEditor, {
34396
+ return /* @__PURE__ */ jsx_runtime5.jsx(CustomSymbolEditor, {
34360
34397
  ...props
34361
34398
  });
34362
34399
  }
@@ -34368,7 +34405,7 @@ class CustomSymbolWidget {
34368
34405
  }
34369
34406
  }
34370
34407
  var CustomSymbolEditor = ({ widget, onComplete, onCancel }) => {
34371
- const [symbol, setSymbol] = import_react29.useState(widget.customSymbol ?? "");
34408
+ const [symbol, setSymbol] = import_react30.useState(widget.customSymbol ?? "");
34372
34409
  use_input_default((input, key) => {
34373
34410
  if (key.return) {
34374
34411
  onComplete({ ...widget, customSymbol: symbol });
@@ -34381,24 +34418,24 @@ var CustomSymbolEditor = ({ widget, onComplete, onCancel }) => {
34381
34418
  setSymbol(firstGrapheme);
34382
34419
  }
34383
34420
  });
34384
- return /* @__PURE__ */ jsx_runtime4.jsxs(Box_default, {
34421
+ return /* @__PURE__ */ jsx_runtime5.jsxs(Box_default, {
34385
34422
  flexDirection: "column",
34386
34423
  children: [
34387
- /* @__PURE__ */ jsx_runtime4.jsxs(Text, {
34424
+ /* @__PURE__ */ jsx_runtime5.jsxs(Text, {
34388
34425
  children: [
34389
34426
  "输入自定义符号:",
34390
34427
  " ",
34391
- symbol ? /* @__PURE__ */ jsx_runtime4.jsx(Text, {
34428
+ symbol ? /* @__PURE__ */ jsx_runtime5.jsx(BlinkingCursor, {
34392
34429
  inverse: true,
34393
34430
  children: symbol
34394
- }) : /* @__PURE__ */ jsx_runtime4.jsx(Text, {
34431
+ }) : /* @__PURE__ */ jsx_runtime5.jsx(BlinkingCursor, {
34395
34432
  inverse: true,
34396
34433
  dimColor: true,
34397
34434
  children: "(空)"
34398
34435
  })
34399
34436
  ]
34400
34437
  }),
34401
- /* @__PURE__ */ jsx_runtime4.jsx(Text, {
34438
+ /* @__PURE__ */ jsx_runtime5.jsx(Text, {
34402
34439
  dimColor: true,
34403
34440
  children: "输入任意字符或 Emoji,Backspace 清空,Enter 保存,ESC 取消"
34404
34441
  })
@@ -34406,7 +34443,7 @@ var CustomSymbolEditor = ({ widget, onComplete, onCancel }) => {
34406
34443
  });
34407
34444
  };
34408
34445
  // src/widgets/CustomCommand.tsx
34409
- var import_react30 = __toESM(require_react(), 1);
34446
+ var import_react31 = __toESM(require_react(), 1);
34410
34447
 
34411
34448
  // src/utils/custom-command.ts
34412
34449
  import { spawnSync } from "node:child_process";
@@ -34684,7 +34721,7 @@ function runCustomCommand(request) {
34684
34721
  }
34685
34722
 
34686
34723
  // src/widgets/CustomCommand.tsx
34687
- var jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
34724
+ var jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
34688
34725
 
34689
34726
  class CustomCommandWidget {
34690
34727
  getDefaultColor() {
@@ -34763,7 +34800,7 @@ class CustomCommandWidget {
34763
34800
  ];
34764
34801
  }
34765
34802
  renderEditor(props) {
34766
- return /* @__PURE__ */ jsx_runtime5.jsx(CustomCommandEditor, {
34803
+ return /* @__PURE__ */ jsx_runtime6.jsx(CustomCommandEditor, {
34767
34804
  ...props
34768
34805
  });
34769
34806
  }
@@ -34791,10 +34828,10 @@ var CustomCommandEditor = ({ widget, onComplete, onCancel, action }) => {
34791
34828
  }
34792
34829
  };
34793
34830
  const mode = getMode();
34794
- const [commandInput, setCommandInput] = import_react30.useState(widget.commandPath ?? "");
34795
- const [commandCursorPos, setCommandCursorPos] = import_react30.useState(commandInput.length);
34796
- const [widthInput, setWidthInput] = import_react30.useState(widget.maxWidth?.toString() ?? "");
34797
- const [timeoutInput, setTimeoutInput] = import_react30.useState(widget.timeout?.toString() ?? "1000");
34831
+ const [commandInput, setCommandInput] = import_react31.useState(widget.commandPath ?? "");
34832
+ const [commandCursorPos, setCommandCursorPos] = import_react31.useState(commandInput.length);
34833
+ const [widthInput, setWidthInput] = import_react31.useState(widget.maxWidth?.toString() ?? "");
34834
+ const [timeoutInput, setTimeoutInput] = import_react31.useState(widget.timeout?.toString() ?? "1000");
34798
34835
  use_input_default((input, key) => {
34799
34836
  if (mode === "command") {
34800
34837
  if (key.return) {
@@ -34853,80 +34890,74 @@ var CustomCommandEditor = ({ widget, onComplete, onCancel, action }) => {
34853
34890
  }
34854
34891
  });
34855
34892
  if (mode === "command") {
34856
- return /* @__PURE__ */ jsx_runtime5.jsxs(Box_default, {
34893
+ return /* @__PURE__ */ jsx_runtime6.jsxs(Box_default, {
34857
34894
  flexDirection: "column",
34858
34895
  children: [
34859
- /* @__PURE__ */ jsx_runtime5.jsxs(Text, {
34896
+ /* @__PURE__ */ jsx_runtime6.jsxs(Text, {
34860
34897
  children: [
34861
34898
  "输入命令路径:",
34862
34899
  " ",
34863
34900
  commandInput.slice(0, commandCursorPos),
34864
- /* @__PURE__ */ jsx_runtime5.jsx(Text, {
34865
- backgroundColor: "gray",
34866
- color: "black",
34901
+ /* @__PURE__ */ jsx_runtime6.jsx(BlinkingCursor, {
34867
34902
  children: commandInput[commandCursorPos] ?? " "
34868
34903
  }),
34869
34904
  commandInput.slice(commandCursorPos + 1)
34870
34905
  ]
34871
34906
  }),
34872
- /* @__PURE__ */ jsx_runtime5.jsx(Text, {
34907
+ /* @__PURE__ */ jsx_runtime6.jsx(Text, {
34873
34908
  dimColor: true,
34874
34909
  children: "←→ 移动光标,Enter 保存,ESC 取消"
34875
34910
  })
34876
34911
  ]
34877
34912
  });
34878
34913
  } else if (mode === "width") {
34879
- return /* @__PURE__ */ jsx_runtime5.jsxs(Box_default, {
34914
+ return /* @__PURE__ */ jsx_runtime6.jsxs(Box_default, {
34880
34915
  flexDirection: "column",
34881
34916
  children: [
34882
- /* @__PURE__ */ jsx_runtime5.jsxs(Box_default, {
34917
+ /* @__PURE__ */ jsx_runtime6.jsxs(Box_default, {
34883
34918
  children: [
34884
- /* @__PURE__ */ jsx_runtime5.jsx(Text, {
34919
+ /* @__PURE__ */ jsx_runtime6.jsx(Text, {
34885
34920
  children: "输入最大宽度(留空表示不限制): "
34886
34921
  }),
34887
- /* @__PURE__ */ jsx_runtime5.jsx(Text, {
34922
+ /* @__PURE__ */ jsx_runtime6.jsx(Text, {
34888
34923
  children: widthInput
34889
34924
  }),
34890
- /* @__PURE__ */ jsx_runtime5.jsx(Text, {
34891
- backgroundColor: "gray",
34892
- color: "black",
34925
+ /* @__PURE__ */ jsx_runtime6.jsx(BlinkingCursor, {
34893
34926
  children: " "
34894
34927
  })
34895
34928
  ]
34896
34929
  }),
34897
- /* @__PURE__ */ jsx_runtime5.jsx(Text, {
34930
+ /* @__PURE__ */ jsx_runtime6.jsx(Text, {
34898
34931
  dimColor: true,
34899
34932
  children: "按 Enter 保存,ESC 取消"
34900
34933
  })
34901
34934
  ]
34902
34935
  });
34903
34936
  } else if (mode === "timeout") {
34904
- return /* @__PURE__ */ jsx_runtime5.jsxs(Box_default, {
34937
+ return /* @__PURE__ */ jsx_runtime6.jsxs(Box_default, {
34905
34938
  flexDirection: "column",
34906
34939
  children: [
34907
- /* @__PURE__ */ jsx_runtime5.jsxs(Box_default, {
34940
+ /* @__PURE__ */ jsx_runtime6.jsxs(Box_default, {
34908
34941
  children: [
34909
- /* @__PURE__ */ jsx_runtime5.jsx(Text, {
34942
+ /* @__PURE__ */ jsx_runtime6.jsx(Text, {
34910
34943
  children: "输入超时时长(毫秒,默认 1000): "
34911
34944
  }),
34912
- /* @__PURE__ */ jsx_runtime5.jsx(Text, {
34945
+ /* @__PURE__ */ jsx_runtime6.jsx(Text, {
34913
34946
  children: timeoutInput
34914
34947
  }),
34915
- /* @__PURE__ */ jsx_runtime5.jsx(Text, {
34916
- backgroundColor: "gray",
34917
- color: "black",
34948
+ /* @__PURE__ */ jsx_runtime6.jsx(BlinkingCursor, {
34918
34949
  children: " "
34919
34950
  })
34920
34951
  ]
34921
34952
  }),
34922
- /* @__PURE__ */ jsx_runtime5.jsx(Text, {
34953
+ /* @__PURE__ */ jsx_runtime6.jsx(Text, {
34923
34954
  dimColor: true,
34924
34955
  children: "按 Enter 保存,ESC 取消"
34925
34956
  })
34926
34957
  ]
34927
34958
  });
34928
34959
  }
34929
- return /* @__PURE__ */ jsx_runtime5.jsx(Text, {
34960
+ return /* @__PURE__ */ jsx_runtime6.jsx(Text, {
34930
34961
  children: "未知编辑模式"
34931
34962
  });
34932
34963
  };
@@ -35247,7 +35278,7 @@ async function installStatusLine({
35247
35278
  }
35248
35279
  const savedSettings = await loadSavedSettingsForHookSync();
35249
35280
  if (savedSettings) {
35250
- const { syncWidgetHooks } = await import("./hooks-q322knq1.js");
35281
+ const { syncWidgetHooks } = await import("./hooks-0wev7tf6.js");
35251
35282
  await syncWidgetHooks(savedSettings);
35252
35283
  }
35253
35284
  }
@@ -35265,7 +35296,7 @@ async function uninstallStatusLine() {
35265
35296
  }
35266
35297
  await saveInstallationMetadata(undefined);
35267
35298
  try {
35268
- const { removeManagedHooks } = await import("./hooks-q322knq1.js");
35299
+ const { removeManagedHooks } = await import("./hooks-0wev7tf6.js");
35269
35300
  await removeManagedHooks();
35270
35301
  } catch {}
35271
35302
  }
@@ -38217,9 +38248,9 @@ class BlockTimerWidget {
38217
38248
  }
38218
38249
  }
38219
38250
  // src/widgets/CurrentWorkingDir.tsx
38220
- var import_react31 = __toESM(require_react(), 1);
38251
+ var import_react32 = __toESM(require_react(), 1);
38221
38252
  import * as os12 from "node:os";
38222
- var jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
38253
+ var jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
38223
38254
  var LABEL13 = "cwd: ";
38224
38255
 
38225
38256
  class CurrentWorkingDirWidget {
@@ -38344,7 +38375,7 @@ class CurrentWorkingDirWidget {
38344
38375
  if (props.action === SYMBOL_OVERRIDE_ACTION) {
38345
38376
  return renderSymbolOverrideEditor(props, "");
38346
38377
  }
38347
- return /* @__PURE__ */ jsx_runtime6.jsx(CurrentWorkingDirEditor, {
38378
+ return /* @__PURE__ */ jsx_runtime7.jsx(CurrentWorkingDirEditor, {
38348
38379
  ...props
38349
38380
  });
38350
38381
  }
@@ -38404,7 +38435,7 @@ class CurrentWorkingDirWidget {
38404
38435
  }
38405
38436
  }
38406
38437
  var CurrentWorkingDirEditor = ({ widget, onComplete, onCancel, action }) => {
38407
- const [segmentsInput, setSegmentsInput] = import_react31.useState(widget.metadata?.segments ?? "");
38438
+ const [segmentsInput, setSegmentsInput] = import_react32.useState(widget.metadata?.segments ?? "");
38408
38439
  use_input_default((input, key) => {
38409
38440
  if (action === "edit-segments") {
38410
38441
  if (key.return) {
@@ -38434,32 +38465,30 @@ var CurrentWorkingDirEditor = ({ widget, onComplete, onCancel, action }) => {
38434
38465
  }
38435
38466
  });
38436
38467
  if (action === "edit-segments") {
38437
- return /* @__PURE__ */ jsx_runtime6.jsxs(Box_default, {
38468
+ return /* @__PURE__ */ jsx_runtime7.jsxs(Box_default, {
38438
38469
  flexDirection: "column",
38439
38470
  children: [
38440
- /* @__PURE__ */ jsx_runtime6.jsxs(Box_default, {
38471
+ /* @__PURE__ */ jsx_runtime7.jsxs(Box_default, {
38441
38472
  children: [
38442
- /* @__PURE__ */ jsx_runtime6.jsx(Text, {
38473
+ /* @__PURE__ */ jsx_runtime7.jsx(Text, {
38443
38474
  children: "输入显示的路径段数(留空显示完整路径): "
38444
38475
  }),
38445
- /* @__PURE__ */ jsx_runtime6.jsx(Text, {
38476
+ /* @__PURE__ */ jsx_runtime7.jsx(Text, {
38446
38477
  children: segmentsInput
38447
38478
  }),
38448
- /* @__PURE__ */ jsx_runtime6.jsx(Text, {
38449
- backgroundColor: "gray",
38450
- color: "black",
38479
+ /* @__PURE__ */ jsx_runtime7.jsx(BlinkingCursor, {
38451
38480
  children: " "
38452
38481
  })
38453
38482
  ]
38454
38483
  }),
38455
- /* @__PURE__ */ jsx_runtime6.jsx(Text, {
38484
+ /* @__PURE__ */ jsx_runtime7.jsx(Text, {
38456
38485
  dimColor: true,
38457
38486
  children: "按 Enter 保存,ESC 取消"
38458
38487
  })
38459
38488
  ]
38460
38489
  });
38461
38490
  }
38462
- return /* @__PURE__ */ jsx_runtime6.jsx(Text, {
38491
+ return /* @__PURE__ */ jsx_runtime7.jsx(Text, {
38463
38492
  children: "未知编辑模式"
38464
38493
  });
38465
38494
  };
@@ -38506,6 +38535,8 @@ class ClaudeSessionIdWidget {
38506
38535
  // src/widgets/ClaudeStatus.ts
38507
38536
  var LABEL15 = "Claude: ";
38508
38537
  var HISTORY_BAR_CHAR = "▮";
38538
+ var LINK_KEY2 = "linkToStatusPage";
38539
+ var TOGGLE_LINK_ACTION4 = "toggle-link";
38509
38540
  var INDICATOR_TEXT = {
38510
38541
  none: "ok",
38511
38542
  minor: "minor",
@@ -38554,12 +38585,20 @@ class ClaudeStatusWidget {
38554
38585
  return LABEL15;
38555
38586
  }
38556
38587
  getEditorDisplay(item) {
38588
+ const modifiers = [];
38589
+ if (isClaudeStatusHistoryEnabled(item))
38590
+ modifiers.push("故障历史");
38591
+ if (isMetadataFlagEnabled(item, LINK_KEY2))
38592
+ modifiers.push("状态链接");
38557
38593
  return {
38558
38594
  displayText: this.getDisplayName(),
38559
- modifierText: isClaudeStatusHistoryEnabled(item) ? "(故障历史)" : undefined
38595
+ modifierText: modifiers.length > 0 ? `(${modifiers.join(", ")})` : undefined
38560
38596
  };
38561
38597
  }
38562
38598
  handleEditorAction(action, item) {
38599
+ if (action === TOGGLE_LINK_ACTION4) {
38600
+ return toggleMetadataFlag(item, LINK_KEY2);
38601
+ }
38563
38602
  if (action === "toggle-history") {
38564
38603
  return {
38565
38604
  ...item,
@@ -38572,6 +38611,10 @@ class ClaudeStatusWidget {
38572
38611
  return null;
38573
38612
  }
38574
38613
  render(item, context, settings) {
38614
+ const text = this.renderStatus(item, context, settings);
38615
+ return isMetadataFlagEnabled(item, LINK_KEY2) ? renderOsc8Link(CLAUDE_STATUS_PAGE_URL, text) : text;
38616
+ }
38617
+ renderStatus(item, context, settings) {
38575
38618
  const showHistory = isClaudeStatusHistoryEnabled(item);
38576
38619
  const colorLevel = getColorLevelString(settings.colorLevel);
38577
38620
  const colorize = (text, key) => {
@@ -38609,7 +38652,8 @@ class ClaudeStatusWidget {
38609
38652
  }
38610
38653
  getCustomKeybinds() {
38611
38654
  return [
38612
- { key: "h", label: "(h)故障历史", action: "toggle-history" }
38655
+ { key: "h", label: "(h)故障历史", action: "toggle-history" },
38656
+ { key: "l", label: "(l)链接状态页", action: TOGGLE_LINK_ACTION4 }
38613
38657
  ];
38614
38658
  }
38615
38659
  preservesRenderedColors(item) {
@@ -39037,7 +39081,7 @@ class ClaudeAccountEmailWidget {
39037
39081
  }
39038
39082
  }
39039
39083
  // src/widgets/shared/speed-widget.tsx
39040
- var import_react32 = __toESM(require_react(), 1);
39084
+ var import_react33 = __toESM(require_react(), 1);
39041
39085
 
39042
39086
  // src/utils/speed-metrics.ts
39043
39087
  function calculateOutputSpeed(metrics) {
@@ -39114,7 +39158,7 @@ function withWidgetSpeedWindowSeconds(item, seconds) {
39114
39158
  }
39115
39159
 
39116
39160
  // src/widgets/shared/speed-widget.tsx
39117
- var jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
39161
+ var jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
39118
39162
  var WINDOW_EDITOR_ACTION = "edit-window";
39119
39163
  var NO_DATA_HIDEABLE_STATE4 = { key: "no-data", label: "无速度数据时(—)" };
39120
39164
  var SPEED_WIDGET_CONFIG = {
@@ -39201,12 +39245,12 @@ function getSpeedWidgetCustomKeybinds() {
39201
39245
  }];
39202
39246
  }
39203
39247
  function renderSpeedWidgetEditor(props) {
39204
- return /* @__PURE__ */ jsx_runtime7.jsx(SpeedWindowEditor, {
39248
+ return /* @__PURE__ */ jsx_runtime8.jsx(SpeedWindowEditor, {
39205
39249
  ...props
39206
39250
  });
39207
39251
  }
39208
39252
  var SpeedWindowEditor = ({ widget, onComplete, onCancel, action }) => {
39209
- const [windowInput, setWindowInput] = import_react32.useState(getWidgetSpeedWindowSeconds(widget).toString());
39253
+ const [windowInput, setWindowInput] = import_react33.useState(getWidgetSpeedWindowSeconds(widget).toString());
39210
39254
  use_input_default((input, key) => {
39211
39255
  if (action !== WINDOW_EDITOR_ACTION) {
39212
39256
  return;
@@ -39230,16 +39274,16 @@ var SpeedWindowEditor = ({ widget, onComplete, onCancel, action }) => {
39230
39274
  }
39231
39275
  });
39232
39276
  if (action !== WINDOW_EDITOR_ACTION) {
39233
- return /* @__PURE__ */ jsx_runtime7.jsx(Text, {
39277
+ return /* @__PURE__ */ jsx_runtime8.jsx(Text, {
39234
39278
  children: "未知编辑模式"
39235
39279
  });
39236
39280
  }
39237
- return /* @__PURE__ */ jsx_runtime7.jsxs(Box_default, {
39281
+ return /* @__PURE__ */ jsx_runtime8.jsxs(Box_default, {
39238
39282
  flexDirection: "column",
39239
39283
  children: [
39240
- /* @__PURE__ */ jsx_runtime7.jsxs(Box_default, {
39284
+ /* @__PURE__ */ jsx_runtime8.jsxs(Box_default, {
39241
39285
  children: [
39242
- /* @__PURE__ */ jsx_runtime7.jsxs(Text, {
39286
+ /* @__PURE__ */ jsx_runtime8.jsxs(Text, {
39243
39287
  children: [
39244
39288
  "输入时间窗口(秒,",
39245
39289
  MIN_SPEED_WINDOW_SECONDS,
@@ -39249,17 +39293,15 @@ var SpeedWindowEditor = ({ widget, onComplete, onCancel, action }) => {
39249
39293
  " "
39250
39294
  ]
39251
39295
  }),
39252
- /* @__PURE__ */ jsx_runtime7.jsx(Text, {
39296
+ /* @__PURE__ */ jsx_runtime8.jsx(Text, {
39253
39297
  children: windowInput
39254
39298
  }),
39255
- /* @__PURE__ */ jsx_runtime7.jsx(Text, {
39256
- backgroundColor: "gray",
39257
- color: "black",
39299
+ /* @__PURE__ */ jsx_runtime8.jsx(BlinkingCursor, {
39258
39300
  children: " "
39259
39301
  })
39260
39302
  ]
39261
39303
  }),
39262
- /* @__PURE__ */ jsx_runtime7.jsx(Text, {
39304
+ /* @__PURE__ */ jsx_runtime8.jsx(Text, {
39263
39305
  dimColor: true,
39264
39306
  children: "0 表示禁用窗口模式并使用全会话平均值。按 Enter 保存,ESC 取消。"
39265
39307
  })
@@ -39527,9 +39569,9 @@ class SessionNameWidget {
39527
39569
  // src/widgets/shared/usage-percent-widget.ts
39528
39570
  var USAGE_PERCENT_WIDGET_CONFIG = {
39529
39571
  session: {
39530
- label: "会话: ",
39531
- displayName: "会话用量",
39532
- description: "显示每日/会话 API 用量百分比",
39572
+ label: "时段: ",
39573
+ displayName: "时段用量",
39574
+ description: "显示当前 5 小时时段的 API 用量百分比",
39533
39575
  previewPercent: 20,
39534
39576
  usageField: "sessionUsage"
39535
39577
  },
@@ -39560,6 +39602,14 @@ var USAGE_PERCENT_WIDGET_CONFIG = {
39560
39602
  description: "显示每周 Fable API 用量百分比",
39561
39603
  previewPercent: 4,
39562
39604
  usageField: "fableUsage"
39605
+ },
39606
+ "spend-limit": {
39607
+ label: "消费限额: ",
39608
+ displayName: "消费限额用量",
39609
+ description: "显示 Claude 应用网关消费限额的已用百分比",
39610
+ previewPercent: 40,
39611
+ usageField: "spendLimitUsage",
39612
+ ignoreApiError: true
39563
39613
  }
39564
39614
  };
39565
39615
  function resolveUsageWindow(kind, data, context) {
@@ -39575,6 +39625,9 @@ function resolveUsageWindow(kind, data, context) {
39575
39625
  if (kind === "weekly-opus") {
39576
39626
  return resolveWeeklyOpusUsageWindow(data);
39577
39627
  }
39628
+ if (kind === "spend-limit") {
39629
+ return null;
39630
+ }
39578
39631
  return resolveFableUsageWindow(data);
39579
39632
  }
39580
39633
  function renderUsageDisplay(item, label, percent, format, getCursorOptions) {
@@ -39631,7 +39684,7 @@ function renderUsagePercentWidgetValue(kind, item, context, settings) {
39631
39684
  const data = context.usageData ?? {};
39632
39685
  const usagePercent = data[config.usageField];
39633
39686
  if (usagePercent === undefined) {
39634
- if (data.error) {
39687
+ if (data.error && !config.ignoreApiError) {
39635
39688
  return isHidden(item, USAGE_NO_DATA_HIDEABLE_STATE.key) ? null : getUsageErrorMessage(data.error);
39636
39689
  }
39637
39690
  return null;
@@ -40261,12 +40314,93 @@ class FableWeeklyUsageWidget {
40261
40314
  return true;
40262
40315
  }
40263
40316
  }
40317
+ // src/widgets/SpendLimitUsage.ts
40318
+ class SpendLimitUsageWidget {
40319
+ getDefaultColor() {
40320
+ return "brightMagenta";
40321
+ }
40322
+ getDescription() {
40323
+ return getUsagePercentWidgetDescription("spend-limit");
40324
+ }
40325
+ getDisplayName() {
40326
+ return getUsagePercentWidgetDisplayName("spend-limit");
40327
+ }
40328
+ getCategory() {
40329
+ return "用量";
40330
+ }
40331
+ getLabelPrefix() {
40332
+ return getUsagePercentWidgetLabel("spend-limit");
40333
+ }
40334
+ getEditorDisplay(item) {
40335
+ return getUsagePercentWidgetEditorDisplay("spend-limit", item);
40336
+ }
40337
+ handleEditorAction(action, item) {
40338
+ return handleUsagePercentWidgetEditorAction(action, item);
40339
+ }
40340
+ render(item, context, settings) {
40341
+ return renderUsagePercentWidgetValue("spend-limit", item, context, settings);
40342
+ }
40343
+ getCustomKeybinds(item) {
40344
+ return getUsagePercentCustomKeybinds(item, false);
40345
+ }
40346
+ supportsRawValue() {
40347
+ return true;
40348
+ }
40349
+ supportsColors(item) {
40350
+ return true;
40351
+ }
40352
+ supportsNumberFormat() {
40353
+ return true;
40354
+ }
40355
+ }
40356
+ // src/widgets/SpendLimitAmount.ts
40357
+ var LABEL21 = "消费: ";
40358
+
40359
+ class SpendLimitAmountWidget {
40360
+ getDefaultColor() {
40361
+ return "brightMagenta";
40362
+ }
40363
+ getDescription() {
40364
+ return "显示 Claude 应用网关消费限额中的已消费金额和限额(美元)";
40365
+ }
40366
+ getDisplayName() {
40367
+ return "消费限额金额";
40368
+ }
40369
+ getCategory() {
40370
+ return "用量";
40371
+ }
40372
+ getLabelPrefix() {
40373
+ return LABEL21;
40374
+ }
40375
+ getEditorDisplay(item) {
40376
+ return { displayText: this.getDisplayName() };
40377
+ }
40378
+ render(item, context, settings) {
40379
+ const format = resolveNumberFormat("cost", item, settings);
40380
+ const data = context.isPreview ? { spendLimitUsedUsd: 314.12, spendLimitLimitUsd: 500 } : context.usageData;
40381
+ if (data?.spendLimitUsedUsd === undefined || data.spendLimitLimitUsd === undefined) {
40382
+ return null;
40383
+ }
40384
+ const used = formatUsageCurrency(data.spendLimitUsedUsd, "USD", format);
40385
+ const limit = formatUsageCurrency(data.spendLimitLimitUsd, "USD", format);
40386
+ return formatRawOrLabeledValue(item, LABEL21, `${used} / ${limit}`);
40387
+ }
40388
+ supportsRawValue() {
40389
+ return true;
40390
+ }
40391
+ supportsColors(item) {
40392
+ return true;
40393
+ }
40394
+ supportsNumberFormat() {
40395
+ return true;
40396
+ }
40397
+ }
40264
40398
  // src/widgets/shared/locale-editor.tsx
40265
- var import_react34 = __toESM(require_react(), 1);
40399
+ var import_react35 = __toESM(require_react(), 1);
40266
40400
 
40267
40401
  // src/widgets/shared/searchable-option-editor.tsx
40268
- var import_react33 = __toESM(require_react(), 1);
40269
- var jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
40402
+ var import_react34 = __toESM(require_react(), 1);
40403
+ var jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
40270
40404
  var MAX_VISIBLE_OPTIONS = 10;
40271
40405
  function getInitialSelectedIndex(options, selectedValue) {
40272
40406
  const selectedIndex = options.findIndex((option) => option.value === selectedValue);
@@ -40298,8 +40432,8 @@ function SearchableOptionEditor({
40298
40432
  onSelect,
40299
40433
  onCancel
40300
40434
  }) {
40301
- const [query, setQuery] = import_react33.useState("");
40302
- const [selectedIndex, setSelectedIndex] = import_react33.useState(() => getInitialSelectedIndex(options, initialValue));
40435
+ const [query, setQuery] = import_react34.useState("");
40436
+ const [selectedIndex, setSelectedIndex] = import_react34.useState(() => getInitialSelectedIndex(options, initialValue));
40303
40437
  const filteredOptions = filterOptions(options, query);
40304
40438
  const clampedSelectedIndex = filteredOptions.length === 0 ? 0 : Math.min(selectedIndex, filteredOptions.length - 1);
40305
40439
  const selectedOption = filteredOptions[clampedSelectedIndex];
@@ -40339,16 +40473,16 @@ function SearchableOptionEditor({
40339
40473
  setSelectedIndex(0);
40340
40474
  }
40341
40475
  });
40342
- return /* @__PURE__ */ jsx_runtime8.jsxs(Box_default, {
40476
+ return /* @__PURE__ */ jsx_runtime9.jsxs(Box_default, {
40343
40477
  flexDirection: "column",
40344
40478
  children: [
40345
- /* @__PURE__ */ jsx_runtime8.jsxs(Box_default, {
40479
+ /* @__PURE__ */ jsx_runtime9.jsxs(Box_default, {
40346
40480
  children: [
40347
- /* @__PURE__ */ jsx_runtime8.jsx(Text, {
40481
+ /* @__PURE__ */ jsx_runtime9.jsx(Text, {
40348
40482
  bold: true,
40349
40483
  children: title
40350
40484
  }),
40351
- /* @__PURE__ */ jsx_runtime8.jsxs(Text, {
40485
+ /* @__PURE__ */ jsx_runtime9.jsxs(Text, {
40352
40486
  dimColor: true,
40353
40487
  children: [
40354
40488
  " ",
@@ -40359,49 +40493,49 @@ function SearchableOptionEditor({
40359
40493
  })
40360
40494
  ]
40361
40495
  }),
40362
- /* @__PURE__ */ jsx_runtime8.jsxs(Box_default, {
40496
+ /* @__PURE__ */ jsx_runtime9.jsxs(Box_default, {
40363
40497
  children: [
40364
- /* @__PURE__ */ jsx_runtime8.jsx(Text, {
40498
+ /* @__PURE__ */ jsx_runtime9.jsx(Text, {
40365
40499
  dimColor: true,
40366
40500
  children: "搜索: "
40367
40501
  }),
40368
- /* @__PURE__ */ jsx_runtime8.jsx(Text, {
40502
+ /* @__PURE__ */ jsx_runtime9.jsx(Text, {
40369
40503
  color: "cyan",
40370
40504
  children: query || "(无)"
40371
40505
  })
40372
40506
  ]
40373
40507
  }),
40374
- /* @__PURE__ */ jsx_runtime8.jsx(Text, {
40508
+ /* @__PURE__ */ jsx_runtime9.jsx(Text, {
40375
40509
  dimColor: true,
40376
40510
  children: "输入以搜索,↑↓ 选择,Enter 保存,ESC 取消"
40377
40511
  }),
40378
- /* @__PURE__ */ jsx_runtime8.jsx(Box_default, {
40512
+ /* @__PURE__ */ jsx_runtime9.jsx(Box_default, {
40379
40513
  marginTop: 1,
40380
40514
  flexDirection: "column",
40381
- children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx_runtime8.jsx(Text, {
40515
+ children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx_runtime9.jsx(Text, {
40382
40516
  dimColor: true,
40383
40517
  children: emptyMessage
40384
40518
  }) : visibleOptions.map((option, visibleIndex) => {
40385
40519
  const actualIndex = visibleRange.start + visibleIndex;
40386
40520
  const isSelected = actualIndex === clampedSelectedIndex;
40387
40521
  const segments = getMatchSegments(option.displayName, query);
40388
- return /* @__PURE__ */ jsx_runtime8.jsxs(Box_default, {
40522
+ return /* @__PURE__ */ jsx_runtime9.jsxs(Box_default, {
40389
40523
  flexDirection: "row",
40390
40524
  flexWrap: "nowrap",
40391
40525
  children: [
40392
- /* @__PURE__ */ jsx_runtime8.jsx(Box_default, {
40526
+ /* @__PURE__ */ jsx_runtime9.jsx(Box_default, {
40393
40527
  width: 3,
40394
- children: /* @__PURE__ */ jsx_runtime8.jsx(Text, {
40528
+ children: /* @__PURE__ */ jsx_runtime9.jsx(Text, {
40395
40529
  color: isSelected ? "green" : undefined,
40396
40530
  children: isSelected ? "> " : " "
40397
40531
  })
40398
40532
  }),
40399
- segments.map((segment, index) => /* @__PURE__ */ jsx_runtime8.jsx(Text, {
40533
+ segments.map((segment, index) => /* @__PURE__ */ jsx_runtime9.jsx(Text, {
40400
40534
  color: getSegmentColor(isSelected, segment.matched),
40401
40535
  bold: isSelected ? true : segment.matched,
40402
40536
  children: segment.text
40403
40537
  }, index)),
40404
- /* @__PURE__ */ jsx_runtime8.jsxs(Text, {
40538
+ /* @__PURE__ */ jsx_runtime9.jsxs(Text, {
40405
40539
  dimColor: true,
40406
40540
  children: [
40407
40541
  " ",
@@ -40414,9 +40548,9 @@ function SearchableOptionEditor({
40414
40548
  }, option.value);
40415
40549
  })
40416
40550
  }),
40417
- filteredOptions.length > MAX_VISIBLE_OPTIONS && /* @__PURE__ */ jsx_runtime8.jsx(Box_default, {
40551
+ filteredOptions.length > MAX_VISIBLE_OPTIONS && /* @__PURE__ */ jsx_runtime9.jsx(Box_default, {
40418
40552
  marginTop: 1,
40419
- children: /* @__PURE__ */ jsx_runtime8.jsxs(Text, {
40553
+ children: /* @__PURE__ */ jsx_runtime9.jsxs(Text, {
40420
40554
  dimColor: true,
40421
40555
  children: [
40422
40556
  "显示",
@@ -40436,22 +40570,22 @@ function SearchableOptionEditor({
40436
40570
  }
40437
40571
 
40438
40572
  // src/widgets/shared/locale-editor.tsx
40439
- var jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
40573
+ var jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
40440
40574
  var LOCALE_EDITOR_ACTION = "edit-locale";
40441
40575
  function renderUsageLocaleEditor(props) {
40442
- return /* @__PURE__ */ jsx_runtime9.jsx(UsageLocaleEditor, {
40576
+ return /* @__PURE__ */ jsx_runtime10.jsx(UsageLocaleEditor, {
40443
40577
  ...props
40444
40578
  });
40445
40579
  }
40446
40580
  var UsageLocaleEditor = ({ widget, onComplete, onCancel, action }) => {
40447
40581
  const currentLocale = getUsageLocale(widget);
40448
- const options = import_react34.useMemo(() => getLocaleOptions(currentLocale), [currentLocale]);
40582
+ const options = import_react35.useMemo(() => getLocaleOptions(currentLocale), [currentLocale]);
40449
40583
  if (action !== LOCALE_EDITOR_ACTION) {
40450
- return /* @__PURE__ */ jsx_runtime9.jsx(Text, {
40584
+ return /* @__PURE__ */ jsx_runtime10.jsx(Text, {
40451
40585
  children: "未知编辑模式"
40452
40586
  });
40453
40587
  }
40454
- return /* @__PURE__ */ jsx_runtime9.jsx(SearchableOptionEditor, {
40588
+ return /* @__PURE__ */ jsx_runtime10.jsx(SearchableOptionEditor, {
40455
40589
  title: "地区设置",
40456
40590
  currentLabel: currentLocale ?? DEFAULT_RESET_LOCALE,
40457
40591
  initialValue: currentLocale ? canonicalizeLocale(currentLocale) : DEFAULT_RESET_LOCALE,
@@ -40467,7 +40601,7 @@ var UsageLocaleEditor = ({ widget, onComplete, onCancel, action }) => {
40467
40601
  };
40468
40602
 
40469
40603
  // src/widgets/shared/timezone-editor.tsx
40470
- var import_react35 = __toESM(require_react(), 1);
40604
+ var import_react36 = __toESM(require_react(), 1);
40471
40605
 
40472
40606
  // src/utils/timezones.ts
40473
40607
  var UTC_TIMEZONE = {
@@ -40564,22 +40698,22 @@ function getTimezoneMatchSegments(text, query) {
40564
40698
  }
40565
40699
 
40566
40700
  // src/widgets/shared/timezone-editor.tsx
40567
- var jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
40701
+ var jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
40568
40702
  var TIMEZONE_EDITOR_ACTION = "edit-timezone";
40569
40703
  function renderUsageTimezoneEditor(props) {
40570
- return /* @__PURE__ */ jsx_runtime10.jsx(UsageTimezoneEditor, {
40704
+ return /* @__PURE__ */ jsx_runtime11.jsx(UsageTimezoneEditor, {
40571
40705
  ...props
40572
40706
  });
40573
40707
  }
40574
40708
  var UsageTimezoneEditor = ({ widget, onComplete, onCancel, action }) => {
40575
40709
  const currentTimezone = getUsageTimezone(widget);
40576
- const options = import_react35.useMemo(() => getTimezoneOptions(currentTimezone), [currentTimezone]);
40710
+ const options = import_react36.useMemo(() => getTimezoneOptions(currentTimezone), [currentTimezone]);
40577
40711
  if (action !== TIMEZONE_EDITOR_ACTION) {
40578
- return /* @__PURE__ */ jsx_runtime10.jsx(Text, {
40712
+ return /* @__PURE__ */ jsx_runtime11.jsx(Text, {
40579
40713
  children: "未知编辑模式"
40580
40714
  });
40581
40715
  }
40582
- return /* @__PURE__ */ jsx_runtime10.jsx(SearchableOptionEditor, {
40716
+ return /* @__PURE__ */ jsx_runtime11.jsx(SearchableOptionEditor, {
40583
40717
  title: "时区",
40584
40718
  currentLabel: currentTimezone ?? "UTC",
40585
40719
  initialValue: currentTimezone ?? "UTC",
@@ -40595,7 +40729,7 @@ var UsageTimezoneEditor = ({ widget, onComplete, onCancel, action }) => {
40595
40729
  };
40596
40730
 
40597
40731
  // src/widgets/BlockResetTimer.ts
40598
- var LABEL21 = "重置: ";
40732
+ var LABEL22 = "重置: ";
40599
40733
  var BAR_LABEL2 = "重置 ";
40600
40734
  var BLOCK_RESET_PREVIEW_AT = "2026-03-12T08:30:00.000Z";
40601
40735
  var USAGE_TIMER_LOADING_MESSAGE = "[Loading]";
@@ -40615,7 +40749,7 @@ class BlockResetTimerWidget {
40615
40749
  }
40616
40750
  getLabelPrefix(item) {
40617
40751
  const displayMode = getUsageDisplayMode(item);
40618
- return isUsageProgressMode(displayMode) || isUsageSliderMode(displayMode) ? BAR_LABEL2 : LABEL21;
40752
+ return isUsageProgressMode(displayMode) || isUsageSliderMode(displayMode) ? BAR_LABEL2 : LABEL22;
40619
40753
  }
40620
40754
  getEditorDisplay(item) {
40621
40755
  return {
@@ -40730,7 +40864,7 @@ class BlockResetTimerWidget {
40730
40864
  }
40731
40865
  }
40732
40866
  // src/widgets/WeeklyResetTimer.ts
40733
- var LABEL22 = "周重置: ";
40867
+ var LABEL23 = "周重置: ";
40734
40868
  var BAR_LABEL3 = "周重置 ";
40735
40869
  var WEEKLY_PREVIEW_DURATION_MS = 36.5 * 60 * 60 * 1000;
40736
40870
  var WEEKLY_RESET_PREVIEW_AT = "2026-03-15T08:30:00.000Z";
@@ -40800,7 +40934,7 @@ class WeeklyResetTimerWidget {
40800
40934
  }
40801
40935
  getLabelPrefix(item) {
40802
40936
  const displayMode = getUsageDisplayMode(item);
40803
- return isUsageProgressMode(displayMode) || isUsageSliderMode(displayMode) ? BAR_LABEL3 : LABEL22;
40937
+ return isUsageProgressMode(displayMode) || isUsageSliderMode(displayMode) ? BAR_LABEL3 : LABEL23;
40804
40938
  }
40805
40939
  getEditorDisplay(item) {
40806
40940
  return {
@@ -40931,7 +41065,7 @@ class WeeklyResetTimerWidget {
40931
41065
  }
40932
41066
  }
40933
41067
  // src/widgets/ContextBar.ts
40934
- var LABEL23 = "上下文: ";
41068
+ var LABEL24 = "上下文: ";
40935
41069
  function getDisplayMode(item) {
40936
41070
  const mode = item.metadata?.display;
40937
41071
  if (mode === "progress" || mode === "slider" || mode === "slider-only") {
@@ -40957,7 +41091,7 @@ class ContextBarWidget {
40957
41091
  return "上下文";
40958
41092
  }
40959
41093
  getLabelPrefix() {
40960
- return LABEL23;
41094
+ return LABEL24;
40961
41095
  }
40962
41096
  getEditorDisplay(item) {
40963
41097
  const mode = getDisplayMode(item);
@@ -41048,8 +41182,8 @@ class ContextBarWidget {
41048
41182
  }
41049
41183
  }
41050
41184
  // src/widgets/Link.tsx
41051
- var import_react36 = __toESM(require_react(), 1);
41052
- var jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
41185
+ var import_react37 = __toESM(require_react(), 1);
41186
+ var jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
41053
41187
  function isValidLinkUrl(url) {
41054
41188
  try {
41055
41189
  const parsed = new URL(url);
@@ -41138,7 +41272,7 @@ class LinkWidget {
41138
41272
  ];
41139
41273
  }
41140
41274
  renderEditor(props) {
41141
- return /* @__PURE__ */ jsx_runtime11.jsx(LinkEditor, {
41275
+ return /* @__PURE__ */ jsx_runtime12.jsx(LinkEditor, {
41142
41276
  ...props
41143
41277
  });
41144
41278
  }
@@ -41158,10 +41292,10 @@ function getEditorMode(action) {
41158
41292
  var LinkEditor = ({ widget, onComplete, onCancel, action }) => {
41159
41293
  const initial = toEditorMetadata(widget);
41160
41294
  const mode = getEditorMode(action);
41161
- const [urlInput, setUrlInput] = import_react36.useState(initial.url);
41162
- const [urlCursorPos, setUrlCursorPos] = import_react36.useState(initial.url.length);
41163
- const [textInput, setTextInput] = import_react36.useState(initial.text);
41164
- const [textCursorPos, setTextCursorPos] = import_react36.useState(initial.text.length);
41295
+ const [urlInput, setUrlInput] = import_react37.useState(initial.url);
41296
+ const [urlCursorPos, setUrlCursorPos] = import_react37.useState(initial.url.length);
41297
+ const [textInput, setTextInput] = import_react37.useState(initial.text);
41298
+ const [textCursorPos, setTextCursorPos] = import_react37.useState(initial.text.length);
41165
41299
  const isUrlMode = mode === "url";
41166
41300
  const activeValue = isUrlMode ? urlInput : textInput;
41167
41301
  const activeCursor = isUrlMode ? urlCursorPos : textCursorPos;
@@ -41200,29 +41334,27 @@ var LinkEditor = ({ widget, onComplete, onCancel, action }) => {
41200
41334
  });
41201
41335
  const showInvalidUrlWarning = isUrlMode && urlInput.trim().length > 0 && !isValidLinkUrl(urlInput.trim());
41202
41336
  const prompt = isUrlMode ? "输入 URL(http/https/file):" : "输入链接文本(留空使用 URL):";
41203
- return /* @__PURE__ */ jsx_runtime11.jsxs(Box_default, {
41337
+ return /* @__PURE__ */ jsx_runtime12.jsxs(Box_default, {
41204
41338
  flexDirection: "column",
41205
41339
  children: [
41206
- /* @__PURE__ */ jsx_runtime11.jsxs(Text, {
41340
+ /* @__PURE__ */ jsx_runtime12.jsxs(Text, {
41207
41341
  children: [
41208
41342
  prompt,
41209
41343
  activeValue.slice(0, activeCursor),
41210
- /* @__PURE__ */ jsx_runtime11.jsx(Text, {
41211
- backgroundColor: "gray",
41212
- color: "black",
41344
+ /* @__PURE__ */ jsx_runtime12.jsx(BlinkingCursor, {
41213
41345
  children: activeValue[activeCursor] ?? " "
41214
41346
  }),
41215
41347
  activeValue.slice(activeCursor + 1)
41216
41348
  ]
41217
41349
  }),
41218
- isUrlMode ? /* @__PURE__ */ jsx_runtime11.jsxs(Text, {
41350
+ isUrlMode ? /* @__PURE__ */ jsx_runtime12.jsxs(Text, {
41219
41351
  dimColor: true,
41220
41352
  children: [
41221
41353
  "当前文本:",
41222
41354
  " ",
41223
41355
  textInput.trim() || "(使用 URL)"
41224
41356
  ]
41225
- }) : /* @__PURE__ */ jsx_runtime11.jsxs(Text, {
41357
+ }) : /* @__PURE__ */ jsx_runtime12.jsxs(Text, {
41226
41358
  dimColor: true,
41227
41359
  children: [
41228
41360
  "当前 URL:",
@@ -41230,11 +41362,11 @@ var LinkEditor = ({ widget, onComplete, onCancel, action }) => {
41230
41362
  urlInput.trim() || "(无)"
41231
41363
  ]
41232
41364
  }),
41233
- showInvalidUrlWarning && /* @__PURE__ */ jsx_runtime11.jsx(Text, {
41365
+ showInvalidUrlWarning && /* @__PURE__ */ jsx_runtime12.jsx(Text, {
41234
41366
  color: "yellow",
41235
41367
  children: "URL 必须以 http://、https:// 或 file:// 开头"
41236
41368
  }),
41237
- /* @__PURE__ */ jsx_runtime11.jsx(Text, {
41369
+ /* @__PURE__ */ jsx_runtime12.jsx(Text, {
41238
41370
  dimColor: true,
41239
41371
  children: "←→ 移动光标,Enter 保存,ESC 取消"
41240
41372
  })
@@ -41242,8 +41374,8 @@ var LinkEditor = ({ widget, onComplete, onCancel, action }) => {
41242
41374
  });
41243
41375
  };
41244
41376
  // src/widgets/Skills.tsx
41245
- var import_react37 = __toESM(require_react(), 1);
41246
- var jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
41377
+ var import_react38 = __toESM(require_react(), 1);
41378
+ var jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
41247
41379
  var MODES = ["current", "count", "list"];
41248
41380
  var MODE_LABELS = { current: "最近使用", count: "总计数", list: "唯一列表" };
41249
41381
  var LIST_LIMIT_KEY = "listLimit";
@@ -41329,7 +41461,7 @@ class SkillsWidget {
41329
41461
  return null;
41330
41462
  }
41331
41463
  renderEditor(props) {
41332
- return /* @__PURE__ */ jsx_runtime12.jsx(SkillsEditor, {
41464
+ return /* @__PURE__ */ jsx_runtime13.jsx(SkillsEditor, {
41333
41465
  ...props
41334
41466
  });
41335
41467
  }
@@ -41381,7 +41513,7 @@ class SkillsWidget {
41381
41513
  }
41382
41514
  }
41383
41515
  var SkillsEditor = ({ widget, onComplete, onCancel, action }) => {
41384
- const [limitInput, setLimitInput] = import_react37.useState(() => parseListLimit(widget).toString());
41516
+ const [limitInput, setLimitInput] = import_react38.useState(() => parseListLimit(widget).toString());
41385
41517
  use_input_default((input, key) => {
41386
41518
  if (action !== EDIT_LIST_LIMIT_ACTION) {
41387
41519
  return;
@@ -41399,37 +41531,35 @@ var SkillsEditor = ({ widget, onComplete, onCancel, action }) => {
41399
41531
  }
41400
41532
  });
41401
41533
  if (action === EDIT_LIST_LIMIT_ACTION) {
41402
- return /* @__PURE__ */ jsx_runtime12.jsxs(Box_default, {
41534
+ return /* @__PURE__ */ jsx_runtime13.jsxs(Box_default, {
41403
41535
  flexDirection: "column",
41404
41536
  children: [
41405
- /* @__PURE__ */ jsx_runtime12.jsxs(Box_default, {
41537
+ /* @__PURE__ */ jsx_runtime13.jsxs(Box_default, {
41406
41538
  children: [
41407
- /* @__PURE__ */ jsx_runtime12.jsx(Text, {
41539
+ /* @__PURE__ */ jsx_runtime13.jsx(Text, {
41408
41540
  children: "输入最多显示的技能数量(0 表示不限制): "
41409
41541
  }),
41410
- /* @__PURE__ */ jsx_runtime12.jsx(Text, {
41542
+ /* @__PURE__ */ jsx_runtime13.jsx(Text, {
41411
41543
  children: limitInput
41412
41544
  }),
41413
- /* @__PURE__ */ jsx_runtime12.jsx(Text, {
41414
- backgroundColor: "gray",
41415
- color: "black",
41545
+ /* @__PURE__ */ jsx_runtime13.jsx(BlinkingCursor, {
41416
41546
  children: " "
41417
41547
  })
41418
41548
  ]
41419
41549
  }),
41420
- /* @__PURE__ */ jsx_runtime12.jsx(Text, {
41550
+ /* @__PURE__ */ jsx_runtime13.jsx(Text, {
41421
41551
  dimColor: true,
41422
41552
  children: "按 Enter 保存,ESC 取消"
41423
41553
  })
41424
41554
  ]
41425
41555
  });
41426
41556
  }
41427
- return /* @__PURE__ */ jsx_runtime12.jsx(Text, {
41557
+ return /* @__PURE__ */ jsx_runtime13.jsx(Text, {
41428
41558
  children: "未知编辑模式"
41429
41559
  });
41430
41560
  };
41431
41561
  // src/widgets/ThinkingEffort.ts
41432
- var LABEL24 = "思考: ";
41562
+ var LABEL25 = "思考: ";
41433
41563
  function resolveThinkingEffortFromStatusJson(context) {
41434
41564
  const effort = context.data?.effort;
41435
41565
  if (!effort || !("level" in effort)) {
@@ -41475,7 +41605,7 @@ class ThinkingEffortWidget {
41475
41605
  return "核心";
41476
41606
  }
41477
41607
  getLabelPrefix() {
41478
- return LABEL24;
41608
+ return LABEL25;
41479
41609
  }
41480
41610
  getEditorDisplay(item) {
41481
41611
  return { displayText: this.getDisplayName() };
@@ -42073,7 +42203,7 @@ class RemoteControlStatusWidget {
42073
42203
  }
42074
42204
  // src/widgets/CacheTimer.ts
42075
42205
  import * as fs16 from "node:fs";
42076
- var LABEL25 = "缓存: ";
42206
+ var LABEL26 = "缓存: ";
42077
42207
  var TTL_METADATA_KEY = "ttlSeconds";
42078
42208
  var DEFAULT_TTL_SECONDS = 300;
42079
42209
  var TTL_OPTIONS = [300, 3600];
@@ -42260,7 +42390,7 @@ class CacheTimerWidget {
42260
42390
  return "会话";
42261
42391
  }
42262
42392
  getLabelPrefix() {
42263
- return LABEL25;
42393
+ return LABEL26;
42264
42394
  }
42265
42395
  getEditorDisplay(item) {
42266
42396
  const modifiers = [];
@@ -42398,6 +42528,8 @@ var WIDGET_MANIFEST = [
42398
42528
  { type: "weekly-sonnet-usage", create: () => new WeeklySonnetUsageWidget },
42399
42529
  { type: "weekly-opus-usage", create: () => new WeeklyOpusUsageWidget },
42400
42530
  { type: "fable-weekly-usage", create: () => new FableWeeklyUsageWidget },
42531
+ { type: "spend-limit-usage", create: () => new SpendLimitUsageWidget },
42532
+ { type: "spend-limit-amount", create: () => new SpendLimitAmountWidget },
42401
42533
  { type: "reset-timer", create: () => new BlockResetTimerWidget },
42402
42534
  { type: "weekly-reset-timer", create: () => new WeeklyResetTimerWidget },
42403
42535
  { type: "context-bar", create: () => new ContextBarWidget },
@@ -42669,7 +42801,7 @@ async function saveSettings(settings) {
42669
42801
  };
42670
42802
  await writeSettingsJson(settingsWithVersion, paths);
42671
42803
  try {
42672
- const { syncWidgetHooks } = await import("./hooks-q322knq1.js");
42804
+ const { syncWidgetHooks } = await import("./hooks-0wev7tf6.js");
42673
42805
  await syncWidgetHooks(settings);
42674
42806
  } catch {}
42675
42807
  }
@@ -42749,4 +42881,4 @@ async function saveInstallationMetadata(metadata) {
42749
42881
  await writeSettingsJson(settingsWithVersion, paths);
42750
42882
  }
42751
42883
 
42752
- export { source_default, string, number, object, looseObject, union, preprocess, stripAnsi, GRADIENT_PRESET_NAMES, stripOscCodes, getVisibleText, getVisibleWidth, truncateStyledText, COLOR_MAP, updateColorMap, getChalkColor, applyColors, getColorDisplayName, getAvailableColorsForUI, getAvailableBackgroundColorsForUI, getBackgroundColorsForPowerline, getPowerlineThemes, getPowerlineTheme, getDefaultPowerlineTheme, prefetchClaudeStatusIfNeeded, ZERO_COMPACTION_STATS, getColorLevelString, NUMBER_KINDS, DefaultPaddingSideSchema, generateGuid, getPackageVersion, getTerminalWidth, canDetectTerminalWidth, getMatchSegments, EDIT_LABEL_ACTION, getLabel, clearLabel, setLabel, getLabelKeybind, getLabelModifierText, EDIT_HIDE_STATES_ACTION, MERGE_TARGET_HIDDEN_HIDEABLE_STATE, getEnabledHideStates, setEnabledHideStates, getHideKeybind, getHideModifierText, resolveExecutable, sanitizeTerminalText, require_react, Box_default, Text, render_default, Transform, use_input_default, use_app_default, getPlainInput, shouldInsertInput, require_jsx_runtime, useTextCursor, GIT_REVIEW_REFRESH_FLAG, refreshGitReviewCacheFromCli, CYCLE_NUMBER_STYLE_ACTION, NUMBER_STYLE_LABELS, getNumberFormatKeybind, getNumberFormatModifierText, getNextNumberStyle, cycleNumberStyle, buildConfigWarningBadge, countPowerlineStartCapSlots, preRenderAllWidgets, calculateMaxWidthsFromPreRendered, renderStatusLineWithInfo, renderStatusLine, CCSTATUSLINE_COMMANDS, PINNED_INSTALL_COMMANDS, isKnownCommand, getClaudeSettingsPath, loadClaudeSettings, saveClaudeSettings, isInstalled, getPackageCommandAvailability, isClaudeCodeVersionAtLeast, buildStatusLineCommand, classifyInstallation, installStatusLine, uninstallStatusLine, getExistingStatusLine, getRefreshInterval, setRefreshInterval, setUsageField, WEEKLY_MODEL_USAGE_BUCKETS, fetchUsageData, getTranscriptAnalysis, getWidgetSpeedWindowSeconds, isWidgetSpeedWindowEnabled, getWidget, getWidgetCatalog, getWidgetCatalogCategories, filterWidgetCatalog, getConfigLoadError, initConfigPath, getConfigPath, isCustomConfigPath, loadSettings, saveSettings, exportConfig, validateImportFile, applyImport, saveInstallationMetadata };
42884
+ export { source_default, string, number, object, looseObject, union, preprocess, stripAnsi, GRADIENT_PRESET_NAMES, getVisibleText, getVisibleWidth, truncateStyledText, COLOR_MAP, updateColorMap, getChalkColor, applyColors, getColorDisplayName, getAvailableColorsForUI, getAvailableBackgroundColorsForUI, getBackgroundColorsForPowerline, getPowerlineThemes, getPowerlineTheme, getDefaultPowerlineTheme, prefetchClaudeStatusIfNeeded, ZERO_COMPACTION_STATS, getColorLevelString, NUMBER_KINDS, DefaultPaddingSideSchema, generateGuid, getPackageVersion, getTerminalWidth, canDetectTerminalWidth, getMatchSegments, EDIT_LABEL_ACTION, getLabel, clearLabel, setLabel, getLabelKeybind, getLabelModifierText, EDIT_HIDE_STATES_ACTION, MERGE_TARGET_HIDDEN_HIDEABLE_STATE, getEnabledHideStates, setEnabledHideStates, getHideKeybind, getHideModifierText, resolveExecutable, sanitizeTerminalText, require_react, Box_default, Text, render_default, Transform, use_input_default, use_app_default, getPlainInput, shouldInsertInput, require_jsx_runtime, BlinkingCursor, useTextCursor, GIT_REVIEW_REFRESH_FLAG, refreshGitReviewCacheFromCli, CYCLE_NUMBER_STYLE_ACTION, NUMBER_STYLE_LABELS, getNumberFormatKeybind, getNumberFormatModifierText, getNextNumberStyle, cycleNumberStyle, buildConfigWarningBadge, countPowerlineStartCapSlots, preRenderAllWidgets, calculateMaxWidthsFromPreRendered, renderStatusLineWithInfo, renderStatusLine, CCSTATUSLINE_COMMANDS, PINNED_INSTALL_COMMANDS, isKnownCommand, getClaudeSettingsPath, loadClaudeSettings, saveClaudeSettings, isInstalled, getPackageCommandAvailability, isClaudeCodeVersionAtLeast, buildStatusLineCommand, classifyInstallation, installStatusLine, uninstallStatusLine, getExistingStatusLine, getRefreshInterval, setRefreshInterval, setUsageField, WEEKLY_MODEL_USAGE_BUCKETS, fetchUsageData, getTranscriptAnalysis, getWidgetSpeedWindowSeconds, isWidgetSpeedWindowEnabled, getWidget, getWidgetCatalog, getWidgetCatalogCategories, filterWidgetCatalog, getConfigLoadError, initConfigPath, getConfigPath, isCustomConfigPath, loadSettings, saveSettings, exportConfig, validateImportFile, applyImport, saveInstallationMetadata };