ccstatusline 2.0.23 → 2.0.24

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.
@@ -51405,7 +51405,7 @@ import { execSync as execSync3 } from "child_process";
51405
51405
  import * as fs5 from "fs";
51406
51406
  import * as path4 from "path";
51407
51407
  var __dirname = "/Users/sirmalloc/Projects/Personal/ccstatusline/src/utils";
51408
- var PACKAGE_VERSION = "2.0.23";
51408
+ var PACKAGE_VERSION = "2.0.24";
51409
51409
  function getPackageVersion() {
51410
51410
  if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
51411
51411
  return PACKAGE_VERSION;
@@ -52251,8 +52251,11 @@ class ModelWidget {
52251
52251
  render(item, context, settings) {
52252
52252
  if (context.isPreview) {
52253
52253
  return item.rawValue ? "Claude" : "Model: Claude";
52254
- } else if (context.data?.model?.display_name) {
52255
- return item.rawValue ? context.data.model.display_name : `Model: ${context.data.model.display_name}`;
52254
+ }
52255
+ const model = context.data?.model;
52256
+ const modelDisplayName = typeof model === "string" ? model : model?.display_name ?? model?.id;
52257
+ if (modelDisplayName) {
52258
+ return item.rawValue ? modelDisplayName : `Model: ${modelDisplayName}`;
52256
52259
  }
52257
52260
  return null;
52258
52261
  }
@@ -52545,7 +52548,8 @@ function calculateContextPercentage(context) {
52545
52548
  if (!context.tokenMetrics) {
52546
52549
  return 0;
52547
52550
  }
52548
- const modelId = context.data?.model?.id;
52551
+ const model = context.data?.model;
52552
+ const modelId = typeof model === "string" ? model : model?.id;
52549
52553
  const contextConfig = getContextConfig(modelId);
52550
52554
  return Math.min(100, context.tokenMetrics.contextLength / contextConfig.maxTokens * 100);
52551
52555
  }
@@ -53401,7 +53405,8 @@ class ContextPercentageWidget {
53401
53405
  const previewValue = isInverse ? "90.7%" : "9.3%";
53402
53406
  return item.rawValue ? previewValue : `Ctx: ${previewValue}`;
53403
53407
  } else if (context.tokenMetrics) {
53404
- const modelId = context.data?.model?.id;
53408
+ const model = context.data?.model;
53409
+ const modelId = typeof model === "string" ? model : model?.id;
53405
53410
  const contextConfig = getContextConfig(modelId);
53406
53411
  const usedPercentage = Math.min(100, context.tokenMetrics.contextLength / contextConfig.maxTokens * 100);
53407
53412
  const displayPercentage = isInverse ? 100 - usedPercentage : usedPercentage;
@@ -53462,7 +53467,8 @@ class ContextPercentageUsableWidget {
53462
53467
  const previewValue = isInverse ? "88.4%" : "11.6%";
53463
53468
  return item.rawValue ? previewValue : `Ctx(u): ${previewValue}`;
53464
53469
  } else if (context.tokenMetrics) {
53465
- const modelId = context.data?.model?.id;
53470
+ const model = context.data?.model;
53471
+ const modelId = typeof model === "string" ? model : model?.id;
53466
53472
  const contextConfig = getContextConfig(modelId);
53467
53473
  const usedPercentage = Math.min(100, context.tokenMetrics.contextLength / contextConfig.usableTokens * 100);
53468
53474
  const displayPercentage = isInverse ? 100 - usedPercentage : usedPercentage;
@@ -58145,10 +58151,13 @@ var StatusJSONSchema = exports_external.looseObject({
58145
58151
  session_id: exports_external.string().optional(),
58146
58152
  transcript_path: exports_external.string().optional(),
58147
58153
  cwd: exports_external.string().optional(),
58148
- model: exports_external.object({
58149
- id: exports_external.string().optional(),
58150
- display_name: exports_external.string().optional()
58151
- }).optional(),
58154
+ model: exports_external.union([
58155
+ exports_external.string(),
58156
+ exports_external.object({
58157
+ id: exports_external.string().optional(),
58158
+ display_name: exports_external.string().optional()
58159
+ })
58160
+ ]).optional(),
58152
58161
  workspace: exports_external.object({
58153
58162
  current_dir: exports_external.string().optional(),
58154
58163
  project_dir: exports_external.string().optional()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccstatusline",
3
- "version": "2.0.23",
3
+ "version": "2.0.24",
4
4
  "description": "A customizable status line formatter for Claude Code CLI",
5
5
  "module": "src/ccstatusline.ts",
6
6
  "type": "module",