copilot-statusline 0.1.3 → 0.1.5

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.
@@ -52940,7 +52940,7 @@ import { execSync as execSync3 } from "child_process";
52940
52940
  import * as fs5 from "fs";
52941
52941
  import * as path4 from "path";
52942
52942
  var __dirname = "/Users/ts/workspace/active/statusline/copilot_statusline/src/utils";
52943
- var PACKAGE_VERSION = "0.1.3";
52943
+ var PACKAGE_VERSION = "0.1.5";
52944
52944
  function getPackageVersion() {
52945
52945
  if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
52946
52946
  return PACKAGE_VERSION;
@@ -54467,10 +54467,14 @@ class ContextPercentageUsableWidget {
54467
54467
  }
54468
54468
  }
54469
54469
  // src/utils/progress-bar.ts
54470
- function makeUsageProgressBar(percent, width = 15) {
54470
+ function makeUsageProgressBar(percent, width = 15, powerlineMode = false) {
54471
54471
  const filled = Math.round(percent / 100 * width);
54472
54472
  const empty = width - filled;
54473
- return "[" + "█".repeat(filled) + "░".repeat(empty) + "]";
54473
+ const bar = "█".repeat(filled) + "░".repeat(empty);
54474
+ if (powerlineMode) {
54475
+ return `\x1B[38;5;231m[${bar}]`;
54476
+ }
54477
+ return "[" + bar + "]";
54474
54478
  }
54475
54479
 
54476
54480
  // src/widgets/ContextBar.ts
@@ -54480,7 +54484,7 @@ function getDisplayMode(item) {
54480
54484
 
54481
54485
  class ContextBarWidget {
54482
54486
  getDefaultColor() {
54483
- return "blue";
54487
+ return "yellow";
54484
54488
  }
54485
54489
  getDescription() {
54486
54490
  return "Shows context usage as a progress bar";
@@ -54519,8 +54523,9 @@ class ContextBarWidget {
54519
54523
  render(item, context, settings) {
54520
54524
  const displayMode = getDisplayMode(item);
54521
54525
  const barWidth = displayMode === "progress" ? 32 : 16;
54526
+ const powerlineMode = settings.powerline?.enabled === true;
54522
54527
  if (context.isPreview) {
54523
- const previewDisplay = `${makeUsageProgressBar(25, barWidth)} 50k/200k (25%)`;
54528
+ const previewDisplay = `${makeUsageProgressBar(25, barWidth, powerlineMode)} 50k/200k (25%)`;
54524
54529
  return item.rawValue ? previewDisplay : `Context: ${previewDisplay}`;
54525
54530
  }
54526
54531
  const contextWindowMetrics = getContextWindowMetrics(context.data);
@@ -54536,7 +54541,7 @@ class ContextBarWidget {
54536
54541
  const clampedPercent = Math.max(0, Math.min(100, percent));
54537
54542
  const usedK = Math.round(used / 1000);
54538
54543
  const totalK = Math.round(total / 1000);
54539
- const display = `${makeUsageProgressBar(clampedPercent, barWidth)} ${usedK}k/${totalK}k (${Math.round(clampedPercent)}%)`;
54544
+ const display = `${makeUsageProgressBar(clampedPercent, barWidth, powerlineMode)} ${usedK}k/${totalK}k (${Math.round(clampedPercent)}%)`;
54540
54545
  return item.rawValue ? display : `Context: ${display}`;
54541
54546
  }
54542
54547
  getCustomKeybinds() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "copilot-statusline",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "A customizable status line formatter for GitHub Copilot CLI — based on ccstatusline",
5
5
  "module": "src/copilot-statusline.ts",
6
6
  "type": "module",