ccstatusline-zh 2.2.8 → 2.2.9

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.
@@ -53882,7 +53882,7 @@ function getTerminalWidth() {
53882
53882
  function canDetectTerminalWidth() {
53883
53883
  return probeTerminalWidth() !== null;
53884
53884
  }
53885
- var __dirname = "/Users/bytedance/Documents/code/bytedance/ccstatusline-zh/src/utils", PACKAGE_VERSION = "2.2.8";
53885
+ var __dirname = "/Users/bytedance/Documents/code/bytedance/ccstatusline-zh/src/utils", PACKAGE_VERSION = "2.2.9";
53886
53886
  var init_terminal = () => {};
53887
53887
 
53888
53888
  // src/utils/renderer.ts
@@ -54708,21 +54708,22 @@ class ContextPercentageWidget {
54708
54708
  }
54709
54709
  render(item, context, settings) {
54710
54710
  const isInverse = isContextInverse(item);
54711
+ const label = isInverse ? "剩余: " : "已用: ";
54711
54712
  const contextWindowMetrics = getContextWindowMetrics(context.data);
54712
54713
  if (context.isPreview) {
54713
54714
  const previewValue = isInverse ? "90.7%" : "9.3%";
54714
- return formatRawOrLabeledValue(item, "上下文: ", previewValue);
54715
+ return formatRawOrLabeledValue(item, label, previewValue);
54715
54716
  }
54716
54717
  if (contextWindowMetrics.usedPercentage !== null) {
54717
54718
  const displayPercentage = isInverse ? 100 - contextWindowMetrics.usedPercentage : contextWindowMetrics.usedPercentage;
54718
- return formatRawOrLabeledValue(item, "上下文: ", `${displayPercentage.toFixed(1)}%`);
54719
+ return formatRawOrLabeledValue(item, label, `${displayPercentage.toFixed(1)}%`);
54719
54720
  }
54720
54721
  if (context.tokenMetrics) {
54721
54722
  const modelIdentifier = getModelContextIdentifier(context.data?.model);
54722
54723
  const contextConfig = getContextConfig(modelIdentifier, contextWindowMetrics.windowSize);
54723
54724
  const usedPercentage = Math.min(100, context.tokenMetrics.contextLength / contextConfig.maxTokens * 100);
54724
54725
  const displayPercentage = isInverse ? 100 - usedPercentage : usedPercentage;
54725
- return formatRawOrLabeledValue(item, "上下文: ", `${displayPercentage.toFixed(1)}%`);
54726
+ return formatRawOrLabeledValue(item, label, `${displayPercentage.toFixed(1)}%`);
54726
54727
  }
54727
54728
  return null;
54728
54729
  }
@@ -54748,10 +54749,10 @@ class ContextPercentageUsableWidget {
54748
54749
  return "green";
54749
54750
  }
54750
54751
  getDescription() {
54751
- return "显示可用上下文窗口已用或剩余百分比(自动压缩前最大值的 80%)";
54752
+ return "显示有效上下文窗口已用或剩余百分比(自动压缩前最大值的 80%)";
54752
54753
  }
54753
54754
  getDisplayName() {
54754
- return "上下文 %(可用)";
54755
+ return "上下文 %(有效)";
54755
54756
  }
54756
54757
  getCategory() {
54757
54758
  return "上下文";
@@ -54767,22 +54768,23 @@ class ContextPercentageUsableWidget {
54767
54768
  }
54768
54769
  render(item, context, settings) {
54769
54770
  const isInverse = isContextInverse(item);
54771
+ const label = isInverse ? "剩余: " : "已用: ";
54770
54772
  const modelIdentifier = getModelContextIdentifier(context.data?.model);
54771
54773
  const contextWindowMetrics = getContextWindowMetrics(context.data);
54772
54774
  const contextConfig = getContextConfig(modelIdentifier, contextWindowMetrics.windowSize);
54773
54775
  if (context.isPreview) {
54774
54776
  const previewValue = isInverse ? "88.4%" : "11.6%";
54775
- return formatRawOrLabeledValue(item, "可用: ", previewValue);
54777
+ return formatRawOrLabeledValue(item, label, previewValue);
54776
54778
  }
54777
54779
  if (contextWindowMetrics.contextLengthTokens !== null) {
54778
54780
  const usedPercentage = Math.min(100, contextWindowMetrics.contextLengthTokens / contextConfig.usableTokens * 100);
54779
54781
  const displayPercentage = isInverse ? 100 - usedPercentage : usedPercentage;
54780
- return formatRawOrLabeledValue(item, "可用: ", `${displayPercentage.toFixed(1)}%`);
54782
+ return formatRawOrLabeledValue(item, label, `${displayPercentage.toFixed(1)}%`);
54781
54783
  }
54782
54784
  if (context.tokenMetrics) {
54783
54785
  const usedPercentage = Math.min(100, context.tokenMetrics.contextLength / contextConfig.usableTokens * 100);
54784
54786
  const displayPercentage = isInverse ? 100 - usedPercentage : usedPercentage;
54785
- return formatRawOrLabeledValue(item, "可用: ", `${displayPercentage.toFixed(1)}%`);
54787
+ return formatRawOrLabeledValue(item, label, `${displayPercentage.toFixed(1)}%`);
54786
54788
  }
54787
54789
  return null;
54788
54790
  }
@@ -65796,8 +65798,11 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
65796
65798
  if (canMerge) {
65797
65799
  helpText += ", (m)合并";
65798
65800
  }
65799
- helpText += ", ESC 返回";
65800
65801
  const customKeybindsText = customKeybinds.map((kb) => kb.label).join(", ");
65802
+ if (customKeybindsText) {
65803
+ helpText += `, ${customKeybindsText}`;
65804
+ }
65805
+ helpText += ", ESC 返回";
65801
65806
  const pickerActionLabel = widgetPicker?.action === "add" ? "添加组件" : widgetPicker?.action === "insert" ? "插入组件" : "更改组件类型";
65802
65807
  if (customEditorWidget?.impl.renderEditor) {
65803
65808
  return customEditorWidget.impl.renderEditor({
@@ -65952,17 +65957,11 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
65952
65957
  }, undefined, true, undefined, this)
65953
65958
  }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
65954
65959
  flexDirection: "column",
65955
- children: [
65956
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
65957
- dimColor: true,
65958
- children: helpText
65959
- }, undefined, false, undefined, this),
65960
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
65961
- dimColor: true,
65962
- children: customKeybindsText || " "
65963
- }, undefined, false, undefined, this)
65964
- ]
65965
- }, undefined, true, undefined, this),
65960
+ children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
65961
+ dimColor: true,
65962
+ children: helpText
65963
+ }, undefined, false, undefined, this)
65964
+ }, undefined, false, undefined, this),
65966
65965
  hasFlexSeparator && !widthDetectionAvailable && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
65967
65966
  marginTop: 1,
65968
65967
  children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccstatusline-zh",
3
- "version": "2.2.8",
3
+ "version": "2.2.9",
4
4
  "description": "ccstatusline 的中文汉化版 - Claude Code CLI 可定制状态栏格式化工具",
5
5
  "module": "src/ccstatusline.ts",
6
6
  "type": "module",