ccstatusline-usage 2.1.3 โ†’ 2.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.
package/README.md CHANGED
@@ -46,6 +46,19 @@
46
46
 
47
47
  ## ๐Ÿ†• Recent Updates
48
48
 
49
+ ### [v2.1.5](https://github.com/pcvelz/ccstatusline-usage/releases/tag/v2.1.5) - Claude Code Teams compatibility
50
+
51
+ - [pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage): **Teams mode support** โ€” automatically detects Claude Code's native Teams sessions (orchestrator + teammates in tmux split panes) and applies compact rendering for the narrow orchestrator pane. Widgets render at half terminal width to fit CC's two-column status bar layout.
52
+
53
+ ### [v2.1.4](https://github.com/pcvelz/ccstatusline-usage/releases/tag/v2.1.4) - Compact mode widget-boundary wrapping
54
+
55
+ - [pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage): **Widget-boundary wrapping** โ€” compact mode now wraps at widget boundaries instead of mid-widget, using a dedicated compact renderer (`compact-renderer.ts`). Widgets that don't fit on the current line cleanly wrap to the next:
56
+ ```
57
+ S: [โ–‘โ–‘โ–‘โ–‘] 2.0% | W: [โ–ˆโ–ˆโ–‘โ–‘] 43.0% | 4:36 hr
58
+ M: o4.6 โ–Œโ–Œโ–Œ | S: 5647528d | C: [โ–ˆโ–ˆโ–‘โ–‘] 119k/200k
59
+ ```
60
+ - [pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage): **Terminal-agnostic compact detection** โ€” compact mode now triggers on any narrow terminal (< 80 columns), not just tmux
61
+
49
62
  ### [v2.1.3](https://github.com/pcvelz/ccstatusline-usage/releases/tag/v2.1.3) - Mobile/compact mode and thinking effort bars
50
63
 
51
64
  - [pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage): **Mobile/compact mode** โ€” in narrow terminals (< 80 effective columns, e.g. tmux panes), widgets auto-switch to compact rendering: `M: o4.6` instead of `Model: claude-opus-4-6`, session ID truncated to 8 chars, and multiple status lines merge into one
@@ -376,8 +389,8 @@ Once configured, ccstatusline automatically formats your Claude Code status line
376
389
  - **Tokens Cached** - Shows cached tokens used
377
390
  - **Tokens Total** - Shows total tokens used
378
391
  - **Context Length** - Shows current context length in tokens
379
- - **Context Percentage** - Shows percentage of context limit used (dynamic: 1M for Sonnet 4.5 with `[1m]` suffix, 200k otherwise)
380
- - **Context Percentage (usable)** - Shows percentage of usable context (dynamic: 800k for Sonnet 4.5 with `[1m]` suffix, 160k otherwise, accounting for auto-compact at 80%)
392
+ - **Context Percentage** - Shows percentage of context limit used (dynamic: 1M for Sonnet 4.5/Opus 4.6 with `[1m]` suffix, 200k otherwise)
393
+ - **Context Percentage (usable)** - Shows percentage of usable context (dynamic: 800k for Sonnet 4.5/Opus 4.6 with `[1m]` suffix, 160k otherwise, accounting for auto-compact at 80%)
381
394
  - **Terminal Width** - Shows detected terminal width (for debugging)
382
395
  - **Custom Text** - Add your own custom text to the status line
383
396
  - **Custom Command** - Execute shell commands and display their output (refreshes whenever the statusline is updated by Claude Code)
@@ -447,7 +460,7 @@ The Block Timer widget helps you track your progress through Claude Code's 5-hou
447
460
  ### ๐Ÿ”ค Raw Value Mode
448
461
 
449
462
  Some widgets support "raw value" mode which displays just the value without a label:
450
- - Normal: `Model: Claude 3.5 Sonnet` โ†’ Raw: `Claude 3.5 Sonnet`
463
+ - Normal: `Model: Claude Opus 4.6` โ†’ Raw: `Claude Opus 4.6`
451
464
  - Normal: `Session: 2hr 15m` โ†’ Raw: `2hr 15m`
452
465
  - Normal: `Block: 3hr 45m` โ†’ Raw: `3hr 45m`
453
466
  - Normal: `Ctx: 18.6k` โ†’ Raw: `18.6k`
@@ -624,6 +637,11 @@ Contributions are welcome! Please feel free to submit a Pull Request.
624
637
 
625
638
  - GitHub: [@sirmalloc](https://github.com/sirmalloc)
626
639
 
640
+ **Fork maintained by Peter van Velzen**
641
+
642
+ - GitHub: [@pcvelz](https://github.com/pcvelz)
643
+ - Fork: [pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage)
644
+
627
645
  ---
628
646
 
629
647
  ## ๐Ÿ”— Related Projects
@@ -643,11 +661,11 @@ Contributions are welcome! Please feel free to submit a Pull Request.
643
661
 
644
662
  ## Star History
645
663
 
646
- <a href="https://www.star-history.com/#sirmalloc/ccstatusline&Timeline">
664
+ <a href="https://www.star-history.com/#pcvelz/ccstatusline-usage&Timeline">
647
665
  <picture>
648
- <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=sirmalloc/ccstatusline&type=Timeline&theme=dark" />
649
- <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=sirmalloc/ccstatusline&type=Timeline" />
650
- <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=sirmalloc/ccstatusline&type=Timeline" />
666
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=pcvelz/ccstatusline-usage&type=Timeline&theme=dark" />
667
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=pcvelz/ccstatusline-usage&type=Timeline" />
668
+ <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=pcvelz/ccstatusline-usage&type=Timeline" />
651
669
  </picture>
652
670
  </a>
653
671
 
@@ -657,21 +675,21 @@ Contributions are welcome! Please feel free to submit a Pull Request.
657
675
 
658
676
  Give a โญ if this project helped you!
659
677
 
660
- [![GitHub stars](https://img.shields.io/github/stars/sirmalloc/ccstatusline?style=social)](https://github.com/sirmalloc/ccstatusline/stargazers)
661
- [![GitHub forks](https://img.shields.io/github/forks/sirmalloc/ccstatusline?style=social)](https://github.com/sirmalloc/ccstatusline/network/members)
662
- [![GitHub watchers](https://img.shields.io/github/watchers/sirmalloc/ccstatusline?style=social)](https://github.com/sirmalloc/ccstatusline/watchers)
678
+ [![GitHub stars](https://img.shields.io/github/stars/pcvelz/ccstatusline-usage?style=social)](https://github.com/pcvelz/ccstatusline-usage/stargazers)
679
+ [![GitHub forks](https://img.shields.io/github/forks/pcvelz/ccstatusline-usage?style=social)](https://github.com/pcvelz/ccstatusline-usage/network/members)
680
+ [![GitHub watchers](https://img.shields.io/github/watchers/pcvelz/ccstatusline-usage?style=social)](https://github.com/pcvelz/ccstatusline-usage/watchers)
663
681
 
664
- [![npm version](https://img.shields.io/npm/v/ccstatusline.svg)](https://www.npmjs.com/package/ccstatusline)
665
- [![npm downloads](https://img.shields.io/npm/dm/ccstatusline.svg)](https://www.npmjs.com/package/ccstatusline)
666
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/sirmalloc/ccstatusline/blob/main/LICENSE)
682
+ [![npm version](https://img.shields.io/npm/v/ccstatusline-usage.svg)](https://www.npmjs.com/package/ccstatusline-usage)
683
+ [![npm downloads](https://img.shields.io/npm/dm/ccstatusline-usage.svg)](https://www.npmjs.com/package/ccstatusline-usage)
684
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/pcvelz/ccstatusline-usage/blob/main/LICENSE)
667
685
  [![Made with Bun](https://img.shields.io/badge/Made%20with-Bun-000000.svg?logo=bun)](https://bun.sh)
668
686
 
669
- [![Issues](https://img.shields.io/github/issues/sirmalloc/ccstatusline)](https://github.com/sirmalloc/ccstatusline/issues)
670
- [![Pull Requests](https://img.shields.io/github/issues-pr/sirmalloc/ccstatusline)](https://github.com/sirmalloc/ccstatusline/pulls)
671
- [![Contributors](https://img.shields.io/github/contributors/sirmalloc/ccstatusline)](https://github.com/sirmalloc/ccstatusline/graphs/contributors)
687
+ [![Issues](https://img.shields.io/github/issues/pcvelz/ccstatusline-usage)](https://github.com/pcvelz/ccstatusline-usage/issues)
688
+ [![Pull Requests](https://img.shields.io/github/issues-pr/pcvelz/ccstatusline-usage)](https://github.com/pcvelz/ccstatusline-usage/pulls)
689
+ [![Contributors](https://img.shields.io/github/contributors/pcvelz/ccstatusline-usage)](https://github.com/pcvelz/ccstatusline-usage/graphs/contributors)
672
690
 
673
691
  ### ๐Ÿ’ฌ Connect
674
692
 
675
- [Report Bug](https://github.com/sirmalloc/ccstatusline/issues) ยท [Request Feature](https://github.com/sirmalloc/ccstatusline/issues) ยท [Discussions](https://github.com/sirmalloc/ccstatusline/discussions)
693
+ [Report Bug](https://github.com/pcvelz/ccstatusline-usage/issues) ยท [Request Feature](https://github.com/pcvelz/ccstatusline-usage/issues) ยท [Discussions](https://github.com/pcvelz/ccstatusline-usage/discussions)
676
694
 
677
695
  </div>
@@ -51450,7 +51450,7 @@ import { execSync as execSync3 } from "child_process";
51450
51450
  import * as fs5 from "fs";
51451
51451
  import * as path4 from "path";
51452
51452
  var __dirname = "/Users/peter/Documents/Code/ccstatusline-usage/src/utils";
51453
- var PACKAGE_VERSION = "2.1.3";
51453
+ var PACKAGE_VERSION = "2.1.5";
51454
51454
  function getPackageVersion() {
51455
51455
  if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
51456
51456
  return PACKAGE_VERSION;
@@ -52287,6 +52287,18 @@ function getDefaultPowerlineTheme() {
52287
52287
  return "nord-aurora";
52288
52288
  }
52289
52289
 
52290
+ // src/utils/input-guards.ts
52291
+ var CONTROL_CHAR_REGEX = /[\u0000-\u001F\u007F]/u;
52292
+ var shouldInsertInput = (input, key) => {
52293
+ if (!input) {
52294
+ return false;
52295
+ }
52296
+ if (key.ctrl || key.meta || key.tab) {
52297
+ return false;
52298
+ }
52299
+ return !CONTROL_CHAR_REGEX.test(input);
52300
+ };
52301
+
52290
52302
  // src/widgets/Model.ts
52291
52303
  import * as fs6 from "fs";
52292
52304
  import { homedir as homedir4 } from "os";
@@ -52350,6 +52362,9 @@ class ModelWidget {
52350
52362
  getDisplayName() {
52351
52363
  return "Model";
52352
52364
  }
52365
+ getCategory() {
52366
+ return "Core";
52367
+ }
52353
52368
  getEditorDisplay(item) {
52354
52369
  return { displayText: this.getDisplayName() };
52355
52370
  }
@@ -52389,6 +52404,9 @@ class OutputStyleWidget {
52389
52404
  getDisplayName() {
52390
52405
  return "Output Style";
52391
52406
  }
52407
+ getCategory() {
52408
+ return "Core";
52409
+ }
52392
52410
  getEditorDisplay(item) {
52393
52411
  return { displayText: this.getDisplayName() };
52394
52412
  }
@@ -52420,6 +52438,9 @@ class GitBranchWidget {
52420
52438
  getDisplayName() {
52421
52439
  return "Git Branch";
52422
52440
  }
52441
+ getCategory() {
52442
+ return "Git";
52443
+ }
52423
52444
  getEditorDisplay(item) {
52424
52445
  const hideNoGit = item.metadata?.hideNoGit === "true";
52425
52446
  const modifiers = [];
@@ -52490,6 +52511,9 @@ class GitChangesWidget {
52490
52511
  getDisplayName() {
52491
52512
  return "Git Changes";
52492
52513
  }
52514
+ getCategory() {
52515
+ return "Git";
52516
+ }
52493
52517
  getEditorDisplay(item) {
52494
52518
  const hideNoGit = item.metadata?.hideNoGit === "true";
52495
52519
  const modifiers = [];
@@ -52579,6 +52603,9 @@ class GitWorktreeWidget {
52579
52603
  getDisplayName() {
52580
52604
  return "Git Worktree";
52581
52605
  }
52606
+ getCategory() {
52607
+ return "Git";
52608
+ }
52582
52609
  getEditorDisplay(item) {
52583
52610
  const hideNoGit = item.metadata?.hideNoGit === "true";
52584
52611
  const modifiers = [];
@@ -52646,7 +52673,7 @@ function getContextConfig(modelId) {
52646
52673
  };
52647
52674
  if (!modelId)
52648
52675
  return defaultConfig;
52649
- if (modelId.includes("claude-sonnet-4-5") && modelId.toLowerCase().includes("[1m]")) {
52676
+ if (modelId.toLowerCase().includes("[1m]")) {
52650
52677
  return {
52651
52678
  maxTokens: 1e6,
52652
52679
  usableTokens: 800000
@@ -53342,6 +53369,9 @@ class TokensInputWidget {
53342
53369
  getDisplayName() {
53343
53370
  return "Tokens Input";
53344
53371
  }
53372
+ getCategory() {
53373
+ return "Tokens";
53374
+ }
53345
53375
  getEditorDisplay(item) {
53346
53376
  return { displayText: this.getDisplayName() };
53347
53377
  }
@@ -53371,6 +53401,9 @@ class TokensOutputWidget {
53371
53401
  getDisplayName() {
53372
53402
  return "Tokens Output";
53373
53403
  }
53404
+ getCategory() {
53405
+ return "Tokens";
53406
+ }
53374
53407
  getEditorDisplay(item) {
53375
53408
  return { displayText: this.getDisplayName() };
53376
53409
  }
@@ -53400,6 +53433,9 @@ class TokensCachedWidget {
53400
53433
  getDisplayName() {
53401
53434
  return "Tokens Cached";
53402
53435
  }
53436
+ getCategory() {
53437
+ return "Tokens";
53438
+ }
53403
53439
  getEditorDisplay(item) {
53404
53440
  return { displayText: this.getDisplayName() };
53405
53441
  }
@@ -53429,6 +53465,9 @@ class TokensTotalWidget {
53429
53465
  getDisplayName() {
53430
53466
  return "Tokens Total";
53431
53467
  }
53468
+ getCategory() {
53469
+ return "Tokens";
53470
+ }
53432
53471
  getEditorDisplay(item) {
53433
53472
  return { displayText: this.getDisplayName() };
53434
53473
  }
@@ -53458,6 +53497,9 @@ class ContextLengthWidget {
53458
53497
  getDisplayName() {
53459
53498
  return "Context Length";
53460
53499
  }
53500
+ getCategory() {
53501
+ return "Context";
53502
+ }
53461
53503
  getEditorDisplay(item) {
53462
53504
  return { displayText: this.getDisplayName() };
53463
53505
  }
@@ -53487,6 +53529,9 @@ class ContextPercentageWidget {
53487
53529
  getDisplayName() {
53488
53530
  return "Context %";
53489
53531
  }
53532
+ getCategory() {
53533
+ return "Context";
53534
+ }
53490
53535
  getEditorDisplay(item) {
53491
53536
  const isInverse = item.metadata?.inverse === "true";
53492
53537
  const modifiers = [];
@@ -53549,6 +53594,9 @@ class ContextPercentageUsableWidget {
53549
53594
  getDisplayName() {
53550
53595
  return "Context % (usable)";
53551
53596
  }
53597
+ getCategory() {
53598
+ return "Context";
53599
+ }
53552
53600
  getEditorDisplay(item) {
53553
53601
  const isInverse = item.metadata?.inverse === "true";
53554
53602
  const modifiers = [];
@@ -53611,6 +53659,9 @@ class SessionClockWidget {
53611
53659
  getDisplayName() {
53612
53660
  return "Session Clock";
53613
53661
  }
53662
+ getCategory() {
53663
+ return "Session";
53664
+ }
53614
53665
  getEditorDisplay(item) {
53615
53666
  return { displayText: this.getDisplayName() };
53616
53667
  }
@@ -53639,6 +53690,9 @@ class SessionCostWidget {
53639
53690
  getDisplayName() {
53640
53691
  return "Session Cost";
53641
53692
  }
53693
+ getCategory() {
53694
+ return "Session";
53695
+ }
53642
53696
  getEditorDisplay(item) {
53643
53697
  return { displayText: this.getDisplayName() };
53644
53698
  }
@@ -53671,6 +53725,9 @@ class TerminalWidthWidget {
53671
53725
  getDisplayName() {
53672
53726
  return "Terminal Width";
53673
53727
  }
53728
+ getCategory() {
53729
+ return "Environment";
53730
+ }
53674
53731
  getEditorDisplay(item) {
53675
53732
  return { displayText: this.getDisplayName() };
53676
53733
  }
@@ -53702,6 +53759,9 @@ class VersionWidget {
53702
53759
  getDisplayName() {
53703
53760
  return "Version";
53704
53761
  }
53762
+ getCategory() {
53763
+ return "Core";
53764
+ }
53705
53765
  getEditorDisplay(item) {
53706
53766
  return { displayText: this.getDisplayName() };
53707
53767
  }
@@ -53734,6 +53794,9 @@ class CustomTextWidget {
53734
53794
  getDisplayName() {
53735
53795
  return "Custom Text";
53736
53796
  }
53797
+ getCategory() {
53798
+ return "Custom";
53799
+ }
53737
53800
  getEditorDisplay(item) {
53738
53801
  const text = item.customText ?? "Empty";
53739
53802
  return { displayText: `${this.getDisplayName()} (${text})` };
@@ -53836,7 +53899,7 @@ var CustomTextEditor = ({ widget, onComplete, onCancel }) => {
53836
53899
  setText(text.slice(0, deleteFromIndex) + text.slice(deleteToIndex));
53837
53900
  }
53838
53901
  }
53839
- } else if (input && !key.ctrl && !key.meta) {
53902
+ } else if (shouldInsertInput(input, key)) {
53840
53903
  const newText = text.slice(0, cursorPos) + input + text.slice(cursorPos);
53841
53904
  setText(newText);
53842
53905
  setCursorPos(cursorPos + input.length);
@@ -53886,6 +53949,9 @@ class CustomCommandWidget {
53886
53949
  getDisplayName() {
53887
53950
  return "Custom Command";
53888
53951
  }
53952
+ getCategory() {
53953
+ return "Custom";
53954
+ }
53889
53955
  getEditorDisplay(item) {
53890
53956
  const cmd = item.commandPath ?? "No command";
53891
53957
  const truncatedCmd = cmd.length > 20 ? `${cmd.substring(0, 17)}...` : cmd;
@@ -54009,7 +54075,7 @@ var CustomCommandEditor = ({ widget, onComplete, onCancel, action }) => {
54009
54075
  if (commandCursorPos < commandInput.length) {
54010
54076
  setCommandInput(commandInput.slice(0, commandCursorPos) + commandInput.slice(commandCursorPos + 1));
54011
54077
  }
54012
- } else if (input) {
54078
+ } else if (shouldInsertInput(input, key)) {
54013
54079
  setCommandInput(commandInput.slice(0, commandCursorPos) + input + commandInput.slice(commandCursorPos));
54014
54080
  setCommandCursorPos(commandCursorPos + input.length);
54015
54081
  }
@@ -54026,7 +54092,7 @@ var CustomCommandEditor = ({ widget, onComplete, onCancel, action }) => {
54026
54092
  onCancel();
54027
54093
  } else if (key.backspace) {
54028
54094
  setWidthInput(widthInput.slice(0, -1));
54029
- } else if (input && /\d/.test(input)) {
54095
+ } else if (shouldInsertInput(input, key) && /\d/.test(input)) {
54030
54096
  setWidthInput(widthInput + input);
54031
54097
  }
54032
54098
  } else if (mode === "timeout") {
@@ -54042,7 +54108,7 @@ var CustomCommandEditor = ({ widget, onComplete, onCancel, action }) => {
54042
54108
  onCancel();
54043
54109
  } else if (key.backspace) {
54044
54110
  setTimeoutInput(timeoutInput.slice(0, -1));
54045
- } else if (input && /\d/.test(input)) {
54111
+ } else if (shouldInsertInput(input, key) && /\d/.test(input)) {
54046
54112
  setTimeoutInput(timeoutInput + input);
54047
54113
  }
54048
54114
  }
@@ -54136,6 +54202,9 @@ class BlockTimerWidget {
54136
54202
  getDisplayName() {
54137
54203
  return "Block Timer";
54138
54204
  }
54205
+ getCategory() {
54206
+ return "Session";
54207
+ }
54139
54208
  getEditorDisplay(item) {
54140
54209
  const mode = item.metadata?.display ?? "time";
54141
54210
  const modifiers = [];
@@ -54236,8 +54305,8 @@ class BlockTimerWidget {
54236
54305
  }
54237
54306
  // src/widgets/CurrentWorkingDir.tsx
54238
54307
  var import_react31 = __toESM(require_react(), 1);
54239
- var jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
54240
54308
  import * as os5 from "node:os";
54309
+ var jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
54241
54310
 
54242
54311
  class CurrentWorkingDirWidget {
54243
54312
  getDefaultColor() {
@@ -54249,6 +54318,9 @@ class CurrentWorkingDirWidget {
54249
54318
  getDisplayName() {
54250
54319
  return "Current Working Dir";
54251
54320
  }
54321
+ getCategory() {
54322
+ return "Environment";
54323
+ }
54252
54324
  getEditorDisplay(item) {
54253
54325
  const segments = item.metadata?.segments ? parseInt(item.metadata.segments, 10) : undefined;
54254
54326
  const fishStyle = item.metadata?.fishStyle === "true";
@@ -54391,7 +54463,7 @@ var CurrentWorkingDirEditor = ({ widget, onComplete, onCancel, action }) => {
54391
54463
  onCancel();
54392
54464
  } else if (key.backspace) {
54393
54465
  setSegmentsInput(segmentsInput.slice(0, -1));
54394
- } else if (input && /\d/.test(input) && !key.ctrl) {
54466
+ } else if (shouldInsertInput(input, key) && /\d/.test(input)) {
54395
54467
  setSegmentsInput(segmentsInput + input);
54396
54468
  }
54397
54469
  }
@@ -54437,6 +54509,9 @@ class ClaudeSessionIdWidget {
54437
54509
  getDisplayName() {
54438
54510
  return "Claude Session ID";
54439
54511
  }
54512
+ getCategory() {
54513
+ return "Core";
54514
+ }
54440
54515
  getEditorDisplay(item) {
54441
54516
  return { displayText: this.getDisplayName() };
54442
54517
  }
@@ -54701,6 +54776,9 @@ class SessionUsageWidget {
54701
54776
  getDisplayName() {
54702
54777
  return "Session Usage";
54703
54778
  }
54779
+ getCategory() {
54780
+ return "API Usage";
54781
+ }
54704
54782
  getEditorDisplay(item) {
54705
54783
  return { displayText: this.getDisplayName() };
54706
54784
  }
@@ -54732,6 +54810,9 @@ class WeeklyUsageWidget {
54732
54810
  getDisplayName() {
54733
54811
  return "Weekly Usage";
54734
54812
  }
54813
+ getCategory() {
54814
+ return "API Usage";
54815
+ }
54735
54816
  getEditorDisplay(item) {
54736
54817
  return { displayText: this.getDisplayName() };
54737
54818
  }
@@ -54763,6 +54844,9 @@ class ResetTimerWidget {
54763
54844
  getDisplayName() {
54764
54845
  return "Reset Timer";
54765
54846
  }
54847
+ getCategory() {
54848
+ return "API Usage";
54849
+ }
54766
54850
  getEditorDisplay(item) {
54767
54851
  return { displayText: this.getDisplayName() };
54768
54852
  }
@@ -54822,6 +54906,9 @@ class ContextBarWidget {
54822
54906
  getDisplayName() {
54823
54907
  return "Context Bar";
54824
54908
  }
54909
+ getCategory() {
54910
+ return "API Usage";
54911
+ }
54825
54912
  getEditorDisplay(item) {
54826
54913
  return { displayText: this.getDisplayName() };
54827
54914
  }
@@ -54898,6 +54985,98 @@ function getAllWidgetTypes(settings) {
54898
54985
  }
54899
54986
  return allTypes;
54900
54987
  }
54988
+ var LAYOUT_WIDGETS = {
54989
+ separator: {
54990
+ displayName: "Separator",
54991
+ description: "A separator character between status line widgets",
54992
+ category: "Layout"
54993
+ },
54994
+ "flex-separator": {
54995
+ displayName: "Flex Separator",
54996
+ description: "Expands to fill available terminal width",
54997
+ category: "Layout"
54998
+ }
54999
+ };
55000
+ function getLayoutCatalogEntry(type) {
55001
+ const layout = LAYOUT_WIDGETS[type];
55002
+ if (!layout) {
55003
+ return null;
55004
+ }
55005
+ return {
55006
+ type,
55007
+ displayName: layout.displayName,
55008
+ description: layout.description,
55009
+ category: layout.category,
55010
+ searchText: `${layout.displayName} ${layout.description} ${type}`.toLowerCase()
55011
+ };
55012
+ }
55013
+ function getWidgetCatalog(settings) {
55014
+ return getAllWidgetTypes(settings).map((type) => {
55015
+ const layoutEntry = getLayoutCatalogEntry(type);
55016
+ if (layoutEntry) {
55017
+ return layoutEntry;
55018
+ }
55019
+ const widget = getWidget(type);
55020
+ const displayName = widget?.getDisplayName() ?? type;
55021
+ const description = widget?.getDescription() ?? `Unknown widget: ${type}`;
55022
+ const category = widget?.getCategory() ?? "Other";
55023
+ return {
55024
+ type,
55025
+ displayName,
55026
+ description,
55027
+ category,
55028
+ searchText: `${displayName} ${description} ${type}`.toLowerCase()
55029
+ };
55030
+ });
55031
+ }
55032
+ function getWidgetCatalogCategories(catalog) {
55033
+ const categories = new Set;
55034
+ for (const entry of catalog) {
55035
+ categories.add(entry.category);
55036
+ }
55037
+ return Array.from(categories);
55038
+ }
55039
+ function filterWidgetCatalog(catalog, category, query) {
55040
+ const normalizedQuery = query.trim().toLowerCase();
55041
+ const categoryFiltered = category === "All" ? [...catalog] : catalog.filter((entry) => entry.category === category);
55042
+ const withScore = categoryFiltered.map((entry) => {
55043
+ if (!normalizedQuery) {
55044
+ return {
55045
+ entry,
55046
+ score: 99
55047
+ };
55048
+ }
55049
+ const name = entry.displayName.toLowerCase();
55050
+ const description = entry.description.toLowerCase();
55051
+ const type = entry.type.toLowerCase();
55052
+ if (name.startsWith(normalizedQuery)) {
55053
+ return { entry, score: 0 };
55054
+ }
55055
+ if (name.includes(normalizedQuery)) {
55056
+ return { entry, score: 1 };
55057
+ }
55058
+ if (type.includes(normalizedQuery)) {
55059
+ return { entry, score: 2 };
55060
+ }
55061
+ if (description.includes(normalizedQuery)) {
55062
+ return { entry, score: 3 };
55063
+ }
55064
+ if (entry.searchText.includes(normalizedQuery)) {
55065
+ return { entry, score: 4 };
55066
+ }
55067
+ return null;
55068
+ }).filter((item) => item !== null);
55069
+ return withScore.sort((a, b) => {
55070
+ if (a.score !== b.score) {
55071
+ return a.score - b.score;
55072
+ }
55073
+ const byDisplayName = a.entry.displayName.localeCompare(b.entry.displayName);
55074
+ if (byDisplayName !== 0) {
55075
+ return byDisplayName;
55076
+ }
55077
+ return a.entry.type.localeCompare(b.entry.type);
55078
+ }).map((item) => item.entry);
55079
+ }
54901
55080
 
54902
55081
  // src/tui/components/ConfirmDialog.tsx
54903
55082
  var import_react32 = __toESM(require_react(), 1);
@@ -55016,7 +55195,7 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
55016
55195
  }
55017
55196
  } else if (key.backspace || key.delete) {
55018
55197
  setHexInput(hexInput.slice(0, -1));
55019
- } else if (input && hexInput.length < 6) {
55198
+ } else if (shouldInsertInput(input, key) && hexInput.length < 6) {
55020
55199
  const upperInput = input.toUpperCase();
55021
55200
  if (/^[0-9A-F]$/.test(upperInput)) {
55022
55201
  setHexInput(hexInput + upperInput);
@@ -55054,7 +55233,7 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
55054
55233
  }
55055
55234
  } else if (key.backspace || key.delete) {
55056
55235
  setAnsi256Input(ansi256Input.slice(0, -1));
55057
- } else if (input && ansi256Input.length < 3) {
55236
+ } else if (shouldInsertInput(input, key) && ansi256Input.length < 3) {
55058
55237
  if (/^[0-9]$/.test(input)) {
55059
55238
  const newInput = ansi256Input + input;
55060
55239
  const code = parseInt(newInput, 10);
@@ -55528,7 +55707,7 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
55528
55707
  setEditingPadding(false);
55529
55708
  } else if (key.backspace) {
55530
55709
  setPaddingInput(paddingInput.slice(0, -1));
55531
- } else if (key.delete) {} else if (input) {
55710
+ } else if (key.delete) {} else if (shouldInsertInput(input, key)) {
55532
55711
  setPaddingInput(paddingInput + input);
55533
55712
  }
55534
55713
  } else if (editingSeparator) {
@@ -55550,7 +55729,7 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
55550
55729
  setEditingSeparator(false);
55551
55730
  } else if (key.backspace) {
55552
55731
  setSeparatorInput(separatorInput.slice(0, -1));
55553
- } else if (key.delete) {} else if (input) {
55732
+ } else if (key.delete) {} else if (shouldInsertInput(input, key)) {
55554
55733
  setSeparatorInput(separatorInput + input);
55555
55734
  }
55556
55735
  } else if (confirmingSeparator) {
@@ -56017,21 +56196,11 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
56017
56196
  const [selectedIndex, setSelectedIndex] = import_react36.useState(0);
56018
56197
  const [moveMode, setMoveMode] = import_react36.useState(false);
56019
56198
  const [customEditorWidget, setCustomEditorWidget] = import_react36.useState(null);
56199
+ const [widgetPicker, setWidgetPicker] = import_react36.useState(null);
56200
+ const [showClearConfirm, setShowClearConfirm] = import_react36.useState(false);
56020
56201
  const separatorChars = ["|", "-", ",", " "];
56021
- const getAllowedTypes = () => {
56022
- let allowedTypes = getAllWidgetTypes(settings);
56023
- if (settings.defaultSeparator) {
56024
- allowedTypes = allowedTypes.filter((t) => t !== "separator");
56025
- }
56026
- if (settings.powerline.enabled) {
56027
- allowedTypes = allowedTypes.filter((t) => t !== "separator" && t !== "flex-separator");
56028
- }
56029
- return allowedTypes;
56030
- };
56031
- const getDefaultItemType = () => {
56032
- const allowedTypes = getAllowedTypes();
56033
- return allowedTypes.includes("model") ? "model" : allowedTypes[0] ?? "model";
56034
- };
56202
+ const widgetCatalog = getWidgetCatalog(settings);
56203
+ const widgetCategories = ["All", ...getWidgetCatalogCategories(widgetCatalog)];
56035
56204
  const getUniqueBackgroundColor = (insertIndex) => {
56036
56205
  if (!settings.powerline.enabled || settings.powerline.theme === "custom") {
56037
56206
  return;
@@ -56057,10 +56226,187 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
56057
56226
  const handleEditorCancel = () => {
56058
56227
  setCustomEditorWidget(null);
56059
56228
  };
56229
+ const getFilteredCategories = (query) => {
56230
+ return [...widgetCategories];
56231
+ };
56232
+ const normalizePickerState = (state) => {
56233
+ const filteredCategories = getFilteredCategories(state.categoryQuery);
56234
+ const selectedCategory = state.selectedCategory && filteredCategories.includes(state.selectedCategory) ? state.selectedCategory : filteredCategories[0] ?? null;
56235
+ const hasTopLevelSearch = state.level === "category" && state.categoryQuery.trim().length > 0;
56236
+ const effectiveCategory = hasTopLevelSearch ? "All" : selectedCategory ?? "All";
56237
+ const effectiveQuery = hasTopLevelSearch ? state.categoryQuery : state.widgetQuery;
56238
+ const filteredWidgets = filterWidgetCatalog(widgetCatalog, effectiveCategory, effectiveQuery);
56239
+ const hasSelectedType = state.selectedType ? filteredWidgets.some((entry) => entry.type === state.selectedType) : false;
56240
+ return {
56241
+ ...state,
56242
+ selectedCategory,
56243
+ selectedType: hasSelectedType ? state.selectedType : filteredWidgets[0]?.type ?? null
56244
+ };
56245
+ };
56246
+ const openWidgetPicker = (action) => {
56247
+ if (widgetCatalog.length === 0) {
56248
+ return;
56249
+ }
56250
+ const currentType = widgets[selectedIndex]?.type;
56251
+ const selectedType = action === "change" ? currentType ?? null : null;
56252
+ setWidgetPicker(normalizePickerState({
56253
+ action,
56254
+ level: "category",
56255
+ selectedCategory: "All",
56256
+ categoryQuery: "",
56257
+ widgetQuery: "",
56258
+ selectedType
56259
+ }));
56260
+ };
56261
+ const applyWidgetPickerSelection = (selectedType) => {
56262
+ if (!widgetPicker) {
56263
+ return;
56264
+ }
56265
+ if (widgetPicker.action === "change") {
56266
+ const currentWidget2 = widgets[selectedIndex];
56267
+ if (currentWidget2) {
56268
+ const newWidgets = [...widgets];
56269
+ newWidgets[selectedIndex] = { ...currentWidget2, type: selectedType };
56270
+ onUpdate(newWidgets);
56271
+ }
56272
+ } else {
56273
+ const insertIndex = widgetPicker.action === "add" ? widgets.length > 0 ? selectedIndex + 1 : 0 : selectedIndex;
56274
+ const backgroundColor = getUniqueBackgroundColor(insertIndex);
56275
+ const newWidget = {
56276
+ id: generateGuid(),
56277
+ type: selectedType,
56278
+ ...backgroundColor && { backgroundColor }
56279
+ };
56280
+ const newWidgets = [...widgets];
56281
+ newWidgets.splice(insertIndex, 0, newWidget);
56282
+ onUpdate(newWidgets);
56283
+ setSelectedIndex(insertIndex);
56284
+ }
56285
+ setWidgetPicker(null);
56286
+ };
56060
56287
  use_input_default((input, key) => {
56061
56288
  if (customEditorWidget) {
56062
56289
  return;
56063
56290
  }
56291
+ if (showClearConfirm) {
56292
+ return;
56293
+ }
56294
+ if (widgetPicker) {
56295
+ const filteredCategories = getFilteredCategories(widgetPicker.categoryQuery);
56296
+ const selectedCategory = widgetPicker.selectedCategory && filteredCategories.includes(widgetPicker.selectedCategory) ? widgetPicker.selectedCategory : filteredCategories[0] ?? null;
56297
+ const hasTopLevelSearch = widgetPicker.level === "category" && widgetPicker.categoryQuery.trim().length > 0;
56298
+ const topLevelSearchEntries2 = hasTopLevelSearch ? filterWidgetCatalog(widgetCatalog, "All", widgetPicker.categoryQuery) : [];
56299
+ const topLevelSelectedEntry = topLevelSearchEntries2.find((entry) => entry.type === widgetPicker.selectedType) ?? topLevelSearchEntries2[0];
56300
+ const filteredWidgets = filterWidgetCatalog(widgetCatalog, selectedCategory ?? "All", widgetPicker.widgetQuery);
56301
+ const selectedEntry = filteredWidgets.find((entry) => entry.type === widgetPicker.selectedType) ?? filteredWidgets[0];
56302
+ if (widgetPicker.level === "category") {
56303
+ if (key.escape) {
56304
+ if (widgetPicker.categoryQuery.length > 0) {
56305
+ setWidgetPicker((prev) => prev ? normalizePickerState({
56306
+ ...prev,
56307
+ categoryQuery: ""
56308
+ }) : prev);
56309
+ } else {
56310
+ setWidgetPicker(null);
56311
+ }
56312
+ } else if (key.return) {
56313
+ if (hasTopLevelSearch) {
56314
+ if (topLevelSelectedEntry) {
56315
+ applyWidgetPickerSelection(topLevelSelectedEntry.type);
56316
+ }
56317
+ } else if (selectedCategory) {
56318
+ setWidgetPicker((prev) => prev ? normalizePickerState({
56319
+ ...prev,
56320
+ level: "widget",
56321
+ selectedCategory
56322
+ }) : prev);
56323
+ }
56324
+ } else if (key.upArrow || key.downArrow) {
56325
+ if (hasTopLevelSearch) {
56326
+ if (topLevelSearchEntries2.length === 0) {
56327
+ return;
56328
+ }
56329
+ let currentIndex = topLevelSearchEntries2.findIndex((entry) => entry.type === widgetPicker.selectedType);
56330
+ if (currentIndex === -1) {
56331
+ currentIndex = 0;
56332
+ }
56333
+ const nextIndex = key.downArrow ? Math.min(topLevelSearchEntries2.length - 1, currentIndex + 1) : Math.max(0, currentIndex - 1);
56334
+ const nextType = topLevelSearchEntries2[nextIndex]?.type ?? null;
56335
+ setWidgetPicker((prev) => prev ? normalizePickerState({
56336
+ ...prev,
56337
+ selectedType: nextType
56338
+ }) : prev);
56339
+ } else {
56340
+ if (filteredCategories.length === 0) {
56341
+ return;
56342
+ }
56343
+ let currentIndex = filteredCategories.findIndex((category) => category === selectedCategory);
56344
+ if (currentIndex === -1) {
56345
+ currentIndex = 0;
56346
+ }
56347
+ const nextIndex = key.downArrow ? Math.min(filteredCategories.length - 1, currentIndex + 1) : Math.max(0, currentIndex - 1);
56348
+ const nextCategory = filteredCategories[nextIndex] ?? null;
56349
+ setWidgetPicker((prev) => prev ? normalizePickerState({
56350
+ ...prev,
56351
+ selectedCategory: nextCategory
56352
+ }) : prev);
56353
+ }
56354
+ } else if (key.backspace || key.delete) {
56355
+ setWidgetPicker((prev) => prev ? normalizePickerState({
56356
+ ...prev,
56357
+ categoryQuery: prev.categoryQuery.slice(0, -1)
56358
+ }) : prev);
56359
+ } else if (input && !key.ctrl && !key.meta && !key.tab) {
56360
+ setWidgetPicker((prev) => prev ? normalizePickerState({
56361
+ ...prev,
56362
+ categoryQuery: prev.categoryQuery + input
56363
+ }) : prev);
56364
+ }
56365
+ } else {
56366
+ if (key.escape) {
56367
+ if (widgetPicker.widgetQuery.length > 0) {
56368
+ setWidgetPicker((prev) => prev ? normalizePickerState({
56369
+ ...prev,
56370
+ widgetQuery: ""
56371
+ }) : prev);
56372
+ } else {
56373
+ setWidgetPicker((prev) => prev ? normalizePickerState({
56374
+ ...prev,
56375
+ level: "category"
56376
+ }) : prev);
56377
+ }
56378
+ } else if (key.return) {
56379
+ if (selectedEntry) {
56380
+ applyWidgetPickerSelection(selectedEntry.type);
56381
+ }
56382
+ } else if (key.upArrow || key.downArrow) {
56383
+ if (filteredWidgets.length === 0) {
56384
+ return;
56385
+ }
56386
+ let currentIndex = filteredWidgets.findIndex((entry) => entry.type === widgetPicker.selectedType);
56387
+ if (currentIndex === -1) {
56388
+ currentIndex = 0;
56389
+ }
56390
+ const nextIndex = key.downArrow ? Math.min(filteredWidgets.length - 1, currentIndex + 1) : Math.max(0, currentIndex - 1);
56391
+ const nextType = filteredWidgets[nextIndex]?.type ?? null;
56392
+ setWidgetPicker((prev) => prev ? normalizePickerState({
56393
+ ...prev,
56394
+ selectedType: nextType
56395
+ }) : prev);
56396
+ } else if (key.backspace || key.delete) {
56397
+ setWidgetPicker((prev) => prev ? normalizePickerState({
56398
+ ...prev,
56399
+ widgetQuery: prev.widgetQuery.slice(0, -1)
56400
+ }) : prev);
56401
+ } else if (input && !key.ctrl && !key.meta && !key.tab) {
56402
+ setWidgetPicker((prev) => prev ? normalizePickerState({
56403
+ ...prev,
56404
+ widgetQuery: prev.widgetQuery + input
56405
+ }) : prev);
56406
+ }
56407
+ }
56408
+ return;
56409
+ }
56064
56410
  if (moveMode) {
56065
56411
  if (key.upArrow && selectedIndex > 0) {
56066
56412
  const newWidgets = [...widgets];
@@ -56084,69 +56430,20 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
56084
56430
  setMoveMode(false);
56085
56431
  }
56086
56432
  } else {
56087
- if (key.upArrow) {
56433
+ if (key.upArrow && widgets.length > 0) {
56088
56434
  setSelectedIndex(Math.max(0, selectedIndex - 1));
56089
- } else if (key.downArrow) {
56435
+ } else if (key.downArrow && widgets.length > 0) {
56090
56436
  setSelectedIndex(Math.min(widgets.length - 1, selectedIndex + 1));
56091
56437
  } else if (key.leftArrow && widgets.length > 0) {
56092
- const types = getAllowedTypes();
56093
- const currentWidget2 = widgets[selectedIndex];
56094
- if (currentWidget2) {
56095
- const currentType = currentWidget2.type;
56096
- let currentIndex = types.indexOf(currentType);
56097
- if (currentIndex === -1) {
56098
- currentIndex = 0;
56099
- }
56100
- const prevIndex = currentIndex === 0 ? types.length - 1 : currentIndex - 1;
56101
- const newWidgets = [...widgets];
56102
- const prevType = types[prevIndex];
56103
- if (prevType) {
56104
- newWidgets[selectedIndex] = { ...currentWidget2, type: prevType };
56105
- onUpdate(newWidgets);
56106
- }
56107
- }
56438
+ openWidgetPicker("change");
56108
56439
  } else if (key.rightArrow && widgets.length > 0) {
56109
- const types = getAllowedTypes();
56110
- const currentWidget2 = widgets[selectedIndex];
56111
- if (currentWidget2) {
56112
- const currentType = currentWidget2.type;
56113
- let currentIndex = types.indexOf(currentType);
56114
- if (currentIndex === -1) {
56115
- currentIndex = 0;
56116
- }
56117
- const nextIndex = (currentIndex + 1) % types.length;
56118
- const newWidgets = [...widgets];
56119
- const nextType = types[nextIndex];
56120
- if (nextType) {
56121
- newWidgets[selectedIndex] = { ...currentWidget2, type: nextType };
56122
- onUpdate(newWidgets);
56123
- }
56124
- }
56440
+ openWidgetPicker("change");
56125
56441
  } else if (key.return && widgets.length > 0) {
56126
56442
  setMoveMode(true);
56127
56443
  } else if (input === "a") {
56128
- const insertIndex = widgets.length > 0 ? selectedIndex + 1 : 0;
56129
- const backgroundColor = getUniqueBackgroundColor(insertIndex);
56130
- const newWidget = {
56131
- id: generateGuid(),
56132
- type: getDefaultItemType(),
56133
- ...backgroundColor && { backgroundColor }
56134
- };
56135
- const newWidgets = [...widgets];
56136
- newWidgets.splice(insertIndex, 0, newWidget);
56137
- onUpdate(newWidgets);
56138
- setSelectedIndex(insertIndex);
56444
+ openWidgetPicker("add");
56139
56445
  } else if (input === "i") {
56140
- const insertIndex = selectedIndex;
56141
- const backgroundColor = getUniqueBackgroundColor(insertIndex);
56142
- const newWidget = {
56143
- id: generateGuid(),
56144
- type: getDefaultItemType(),
56145
- ...backgroundColor && { backgroundColor }
56146
- };
56147
- const newWidgets = [...widgets];
56148
- newWidgets.splice(insertIndex, 0, newWidget);
56149
- onUpdate(newWidgets);
56446
+ openWidgetPicker("insert");
56150
56447
  } else if (input === "d" && widgets.length > 0) {
56151
56448
  const newWidgets = widgets.filter((_, i) => i !== selectedIndex);
56152
56449
  onUpdate(newWidgets);
@@ -56154,8 +56451,9 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
56154
56451
  setSelectedIndex(selectedIndex - 1);
56155
56452
  }
56156
56453
  } else if (input === "c") {
56157
- onUpdate([]);
56158
- setSelectedIndex(0);
56454
+ if (widgets.length > 0) {
56455
+ setShowClearConfirm(true);
56456
+ }
56159
56457
  } else if (input === " " && widgets.length > 0) {
56160
56458
  const currentWidget2 = widgets[selectedIndex];
56161
56459
  if (currentWidget2 && currentWidget2.type === "separator") {
@@ -56241,6 +56539,12 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
56241
56539
  };
56242
56540
  const hasFlexSeparator = widgets.some((widget) => widget.type === "flex-separator");
56243
56541
  const widthDetectionAvailable = canDetectTerminalWidth();
56542
+ const pickerCategories = widgetPicker ? getFilteredCategories(widgetPicker.categoryQuery) : [];
56543
+ const selectedPickerCategory = widgetPicker ? widgetPicker.selectedCategory && pickerCategories.includes(widgetPicker.selectedCategory) ? widgetPicker.selectedCategory : pickerCategories[0] ?? null : null;
56544
+ const topLevelSearchEntries = widgetPicker && widgetPicker.level === "category" && widgetPicker.categoryQuery.trim().length > 0 ? filterWidgetCatalog(widgetCatalog, "All", widgetPicker.categoryQuery) : [];
56545
+ const selectedTopLevelSearchEntry = widgetPicker ? topLevelSearchEntries.find((entry) => entry.type === widgetPicker.selectedType) ?? topLevelSearchEntries[0] : null;
56546
+ const pickerEntries = widgetPicker ? filterWidgetCatalog(widgetCatalog, selectedPickerCategory ?? "All", widgetPicker.widgetQuery) : [];
56547
+ const selectedPickerEntry = widgetPicker ? pickerEntries.find((entry) => entry.type === widgetPicker.selectedType) ?? pickerEntries[0] : null;
56244
56548
  const currentWidget = widgets[selectedIndex];
56245
56549
  const isSeparator = currentWidget?.type === "separator";
56246
56550
  const isFlexSeparator = currentWidget?.type === "flex-separator";
@@ -56258,11 +56562,14 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
56258
56562
  }
56259
56563
  }
56260
56564
  const canMerge = currentWidget && selectedIndex < widgets.length - 1 && !isSeparator && !isFlexSeparator;
56261
- let helpText = "โ†‘โ†“ select, โ†โ†’ change type";
56565
+ const hasWidgets = widgets.length > 0;
56566
+ let helpText = hasWidgets ? "โ†‘โ†“ select, โ†โ†’ open type picker" : "(a)dd via picker, (i)nsert via picker";
56262
56567
  if (isSeparator) {
56263
56568
  helpText += ", Space edit separator";
56264
56569
  }
56265
- helpText += ", Enter to move, (a)dd, (i)nsert, (d)elete, (c)lear line";
56570
+ if (hasWidgets) {
56571
+ helpText += ", Enter to move, (a)dd via picker, (i)nsert via picker, (d)elete, (c)lear line";
56572
+ }
56266
56573
  if (canToggleRaw) {
56267
56574
  helpText += ", (r)aw value";
56268
56575
  }
@@ -56271,6 +56578,7 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
56271
56578
  }
56272
56579
  helpText += ", ESC back";
56273
56580
  const customKeybindsText = customKeybinds.map((kb) => kb.label).join(", ");
56581
+ const pickerActionLabel = widgetPicker?.action === "add" ? "Add Widget" : widgetPicker?.action === "insert" ? "Insert Widget" : "Change Widget Type";
56274
56582
  if (customEditorWidget?.impl.renderEditor) {
56275
56583
  return customEditorWidget.impl.renderEditor({
56276
56584
  widget: customEditorWidget.widget,
@@ -56279,6 +56587,56 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
56279
56587
  action: customEditorWidget.action
56280
56588
  });
56281
56589
  }
56590
+ if (showClearConfirm) {
56591
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56592
+ flexDirection: "column",
56593
+ children: [
56594
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56595
+ bold: true,
56596
+ color: "yellow",
56597
+ children: "โš  Confirm Clear Line"
56598
+ }, undefined, false, undefined, this),
56599
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56600
+ marginTop: 1,
56601
+ flexDirection: "column",
56602
+ children: [
56603
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56604
+ children: [
56605
+ "This will remove all widgets from Line",
56606
+ " ",
56607
+ lineNumber,
56608
+ "."
56609
+ ]
56610
+ }, undefined, true, undefined, this),
56611
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56612
+ color: "red",
56613
+ children: "This action cannot be undone!"
56614
+ }, undefined, false, undefined, this)
56615
+ ]
56616
+ }, undefined, true, undefined, this),
56617
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56618
+ marginTop: 2,
56619
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56620
+ children: "Continue?"
56621
+ }, undefined, false, undefined, this)
56622
+ }, undefined, false, undefined, this),
56623
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56624
+ marginTop: 1,
56625
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ConfirmDialog, {
56626
+ inline: true,
56627
+ onConfirm: () => {
56628
+ onUpdate([]);
56629
+ setSelectedIndex(0);
56630
+ setShowClearConfirm(false);
56631
+ },
56632
+ onCancel: () => {
56633
+ setShowClearConfirm(false);
56634
+ }
56635
+ }, undefined, false, undefined, this)
56636
+ }, undefined, false, undefined, this)
56637
+ ]
56638
+ }, undefined, true, undefined, this);
56639
+ }
56282
56640
  return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56283
56641
  flexDirection: "column",
56284
56642
  children: [
@@ -56297,6 +56655,10 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
56297
56655
  color: "blue",
56298
56656
  children: "[MOVE MODE]"
56299
56657
  }, undefined, false, undefined, this),
56658
+ widgetPicker && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56659
+ color: "cyan",
56660
+ children: `[${pickerActionLabel.toUpperCase()}]`
56661
+ }, undefined, false, undefined, this),
56300
56662
  (settings.powerline.enabled || Boolean(settings.defaultSeparator)) && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56301
56663
  marginLeft: 2,
56302
56664
  children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
@@ -56317,6 +56679,57 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
56317
56679
  dimColor: true,
56318
56680
  children: "โ†‘โ†“ to move widget, ESC or Enter to exit move mode"
56319
56681
  }, undefined, false, undefined, this)
56682
+ }, undefined, false, undefined, this) : widgetPicker ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56683
+ flexDirection: "column",
56684
+ children: widgetPicker.level === "category" ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
56685
+ children: [
56686
+ widgetPicker.categoryQuery.trim().length > 0 ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56687
+ dimColor: true,
56688
+ children: "โ†‘โ†“ select widget match, Enter apply, ESC clear/cancel"
56689
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56690
+ dimColor: true,
56691
+ children: "โ†‘โ†“ select category, type to search all widgets, Enter continue, ESC cancel"
56692
+ }, undefined, false, undefined, this),
56693
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56694
+ children: [
56695
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56696
+ dimColor: true,
56697
+ children: "Search: "
56698
+ }, undefined, false, undefined, this),
56699
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56700
+ color: "cyan",
56701
+ children: widgetPicker.categoryQuery || "(none)"
56702
+ }, undefined, false, undefined, this)
56703
+ ]
56704
+ }, undefined, true, undefined, this)
56705
+ ]
56706
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
56707
+ children: [
56708
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56709
+ dimColor: true,
56710
+ children: "โ†‘โ†“ select widget, type to search widgets, Enter apply, ESC back"
56711
+ }, undefined, false, undefined, this),
56712
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56713
+ children: [
56714
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56715
+ dimColor: true,
56716
+ children: [
56717
+ "Category:",
56718
+ " ",
56719
+ selectedPickerCategory ?? "(none)",
56720
+ " ",
56721
+ "| Search:",
56722
+ " "
56723
+ ]
56724
+ }, undefined, true, undefined, this),
56725
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56726
+ color: "cyan",
56727
+ children: widgetPicker.widgetQuery || "(none)"
56728
+ }, undefined, false, undefined, this)
56729
+ ]
56730
+ }, undefined, true, undefined, this)
56731
+ ]
56732
+ }, undefined, true, undefined, this)
56320
56733
  }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56321
56734
  flexDirection: "column",
56322
56735
  children: [
@@ -56343,7 +56756,114 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
56343
56756
  }, undefined, false, undefined, this)
56344
56757
  ]
56345
56758
  }, undefined, true, undefined, this),
56346
- /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56759
+ widgetPicker && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56760
+ marginTop: 1,
56761
+ flexDirection: "column",
56762
+ children: widgetPicker.level === "category" ? widgetPicker.categoryQuery.trim().length > 0 ? topLevelSearchEntries.length === 0 ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56763
+ dimColor: true,
56764
+ children: "No widgets match the search."
56765
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
56766
+ children: [
56767
+ topLevelSearchEntries.map((entry, index) => {
56768
+ const isSelected = entry.type === selectedTopLevelSearchEntry?.type;
56769
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56770
+ flexDirection: "row",
56771
+ flexWrap: "nowrap",
56772
+ children: [
56773
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56774
+ width: 3,
56775
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56776
+ color: isSelected ? "green" : undefined,
56777
+ children: isSelected ? "โ–ถ " : " "
56778
+ }, undefined, false, undefined, this)
56779
+ }, undefined, false, undefined, this),
56780
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56781
+ color: isSelected ? "green" : undefined,
56782
+ children: `${index + 1}. ${entry.displayName}`
56783
+ }, undefined, false, undefined, this)
56784
+ ]
56785
+ }, entry.type, true, undefined, this);
56786
+ }),
56787
+ selectedTopLevelSearchEntry && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56788
+ marginTop: 1,
56789
+ paddingLeft: 2,
56790
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56791
+ dimColor: true,
56792
+ children: selectedTopLevelSearchEntry.description
56793
+ }, undefined, false, undefined, this)
56794
+ }, undefined, false, undefined, this)
56795
+ ]
56796
+ }, undefined, true, undefined, this) : pickerCategories.length === 0 ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56797
+ dimColor: true,
56798
+ children: "No categories available."
56799
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
56800
+ children: [
56801
+ pickerCategories.map((category, index) => {
56802
+ const isSelected = category === selectedPickerCategory;
56803
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56804
+ flexDirection: "row",
56805
+ flexWrap: "nowrap",
56806
+ children: [
56807
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56808
+ width: 3,
56809
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56810
+ color: isSelected ? "green" : undefined,
56811
+ children: isSelected ? "โ–ถ " : " "
56812
+ }, undefined, false, undefined, this)
56813
+ }, undefined, false, undefined, this),
56814
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56815
+ color: isSelected ? "green" : undefined,
56816
+ children: `${index + 1}. ${category}`
56817
+ }, undefined, false, undefined, this)
56818
+ ]
56819
+ }, category, true, undefined, this);
56820
+ }),
56821
+ selectedPickerCategory === "All" && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56822
+ marginTop: 1,
56823
+ paddingLeft: 2,
56824
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56825
+ dimColor: true,
56826
+ children: "Search across all widget categories."
56827
+ }, undefined, false, undefined, this)
56828
+ }, undefined, false, undefined, this)
56829
+ ]
56830
+ }, undefined, true, undefined, this) : pickerEntries.length === 0 ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56831
+ dimColor: true,
56832
+ children: "No widgets match the current category/search."
56833
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
56834
+ children: [
56835
+ pickerEntries.map((entry, index) => {
56836
+ const isSelected = entry.type === selectedPickerEntry?.type;
56837
+ return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56838
+ flexDirection: "row",
56839
+ flexWrap: "nowrap",
56840
+ children: [
56841
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56842
+ width: 3,
56843
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56844
+ color: isSelected ? "green" : undefined,
56845
+ children: isSelected ? "โ–ถ " : " "
56846
+ }, undefined, false, undefined, this)
56847
+ }, undefined, false, undefined, this),
56848
+ /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56849
+ color: isSelected ? "green" : undefined,
56850
+ children: `${index + 1}. ${entry.displayName}`
56851
+ }, undefined, false, undefined, this)
56852
+ ]
56853
+ }, entry.type, true, undefined, this);
56854
+ }),
56855
+ selectedPickerEntry && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56856
+ marginTop: 1,
56857
+ paddingLeft: 2,
56858
+ children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
56859
+ dimColor: true,
56860
+ children: selectedPickerEntry.description
56861
+ }, undefined, false, undefined, this)
56862
+ }, undefined, false, undefined, this)
56863
+ ]
56864
+ }, undefined, true, undefined, this)
56865
+ }, undefined, false, undefined, this),
56866
+ !widgetPicker && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
56347
56867
  marginTop: 1,
56348
56868
  flexDirection: "column",
56349
56869
  children: widgets.length === 0 ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
@@ -56910,7 +57430,7 @@ var PowerlineSeparatorEditor = ({
56910
57430
  } else if (key.backspace && cursorPos > 0) {
56911
57431
  setHexInput(hexInput.slice(0, cursorPos - 1) + hexInput.slice(cursorPos));
56912
57432
  setCursorPos(cursorPos - 1);
56913
- } else if (input && /[0-9a-fA-F]/.test(input) && hexInput.length < 4) {
57433
+ } else if (shouldInsertInput(input, key) && /[0-9a-fA-F]/.test(input) && hexInput.length < 4) {
56914
57434
  setHexInput(hexInput.slice(0, cursorPos) + input.toUpperCase() + hexInput.slice(cursorPos));
56915
57435
  setCursorPos(cursorPos + 1);
56916
57436
  }
@@ -58186,7 +58706,7 @@ var TerminalWidthMenu = ({ settings, onUpdate, onBack }) => {
58186
58706
  } else if (key.backspace) {
58187
58707
  setThresholdInput(thresholdInput.slice(0, -1));
58188
58708
  setValidationError(null);
58189
- } else if (key.delete) {} else if (input && /\d/.test(input)) {
58709
+ } else if (key.delete) {} else if (shouldInsertInput(input, key) && /\d/.test(input)) {
58190
58710
  const newValue = thresholdInput + input;
58191
58711
  if (newValue.length <= 2) {
58192
58712
  setThresholdInput(newValue);
@@ -58732,6 +59252,7 @@ var StatusJSONSchema = exports_external.looseObject({
58732
59252
  total_lines_added: exports_external.number().optional(),
58733
59253
  total_lines_removed: exports_external.number().optional()
58734
59254
  }).optional(),
59255
+ agent: exports_external.object({ name: exports_external.string().optional() }).optional(),
58735
59256
  context_window: exports_external.object({
58736
59257
  context_window_size: exports_external.number().nullable().optional(),
58737
59258
  total_input_tokens: exports_external.number().nullable().optional(),
@@ -58750,6 +59271,63 @@ var StatusJSONSchema = exports_external.looseObject({
58750
59271
  }).nullable().optional()
58751
59272
  });
58752
59273
 
59274
+ // src/utils/compact-renderer.ts
59275
+ function renderCompactOutput(preRenderedLines, settings, maxWidth) {
59276
+ const colorLevel = getColorLevelString(settings.colorLevel);
59277
+ const sep = settings.defaultSeparator ?? "|";
59278
+ const separatorText = sep === "|" ? " | " : ` ${sep} `;
59279
+ const separatorWidth = separatorText.length;
59280
+ const coloredWidgets = [];
59281
+ for (const line of preRenderedLines) {
59282
+ for (const pw of line) {
59283
+ if (pw.widget.type === "separator" || pw.widget.type === "flex-separator")
59284
+ continue;
59285
+ if (pw.plainLength === 0)
59286
+ continue;
59287
+ let fgColor = pw.widget.color;
59288
+ if (!fgColor) {
59289
+ const impl = getWidget(pw.widget.type);
59290
+ fgColor = impl ? impl.getDefaultColor() : "white";
59291
+ }
59292
+ let bgColor = pw.widget.backgroundColor;
59293
+ if (settings.overrideForegroundColor && settings.overrideForegroundColor !== "none")
59294
+ fgColor = settings.overrideForegroundColor;
59295
+ if (settings.overrideBackgroundColor && settings.overrideBackgroundColor !== "none")
59296
+ bgColor = settings.overrideBackgroundColor;
59297
+ const bold = settings.globalBold || pw.widget.bold;
59298
+ const colored = applyColors(pw.content, fgColor, bgColor, bold, colorLevel);
59299
+ coloredWidgets.push({ colored, width: pw.plainLength });
59300
+ }
59301
+ }
59302
+ if (coloredWidgets.length === 0)
59303
+ return;
59304
+ const outputLines = [];
59305
+ let currentLine = "";
59306
+ let currentWidth = 0;
59307
+ for (const cw of coloredWidgets) {
59308
+ const needed = currentWidth === 0 ? cw.width : separatorWidth + cw.width;
59309
+ if (currentWidth > 0 && currentWidth + needed > maxWidth) {
59310
+ outputLines.push(currentLine);
59311
+ currentLine = cw.colored;
59312
+ currentWidth = cw.width;
59313
+ } else {
59314
+ if (currentWidth > 0) {
59315
+ currentLine += source_default.gray(separatorText);
59316
+ currentWidth += separatorWidth;
59317
+ }
59318
+ currentLine += cw.colored;
59319
+ currentWidth += cw.width;
59320
+ }
59321
+ }
59322
+ if (currentLine)
59323
+ outputLines.push(currentLine);
59324
+ for (const line of outputLines) {
59325
+ let outputLine = line.replace(/ /g, "ย ");
59326
+ outputLine = "\x1B[0m" + outputLine;
59327
+ console.log(outputLine);
59328
+ }
59329
+ }
59330
+
58753
59331
  // src/utils/jsonl.ts
58754
59332
  import * as fs8 from "fs";
58755
59333
  import path8 from "node:path";
@@ -59781,6 +60359,15 @@ function floorToHour(timestamp) {
59781
60359
  }
59782
60360
 
59783
60361
  // src/ccstatusline.ts
60362
+ var COMPACT_THRESHOLD = 100;
60363
+ var TEAM_LEAD_DEFAULT_WIDTH = 60;
60364
+ function shouldUseCompactMode(width, data) {
60365
+ if (width !== null && width > 0 && width < COMPACT_THRESHOLD)
60366
+ return true;
60367
+ if (data.agent?.name === "team-lead")
60368
+ return true;
60369
+ return false;
60370
+ }
59784
60371
  async function readStdin() {
59785
60372
  if (process.stdin.isTTY) {
59786
60373
  return null;
@@ -59823,9 +60410,10 @@ async function renderMultipleLines(data) {
59823
60410
  if (hasBlockTimer) {
59824
60411
  blockMetrics = getBlockMetrics();
59825
60412
  }
59826
- const rawWidth = getTerminalWidth();
59827
- const deduction = settings.flexMode === "full-minus-40" ? 40 : 6;
59828
- const effectiveWidth = rawWidth ? rawWidth - deduction : null;
60413
+ const terminalWidth = getTerminalWidth();
60414
+ const compact = shouldUseCompactMode(terminalWidth, data);
60415
+ const compactWidth = compact ? terminalWidth !== null && terminalWidth > 0 ? terminalWidth >= 80 ? Math.floor(terminalWidth / 2) - 4 : terminalWidth - 6 : TEAM_LEAD_DEFAULT_WIDTH : null;
60416
+ const effectiveWidth = compactWidth ?? terminalWidth;
59829
60417
  const context = {
59830
60418
  data,
59831
60419
  tokenMetrics,
@@ -59835,37 +60423,27 @@ async function renderMultipleLines(data) {
59835
60423
  isPreview: false
59836
60424
  };
59837
60425
  const preRenderedLines = preRenderAllWidgets(lines, settings, context);
59838
- const preCalculatedMaxWidths = calculateMaxWidthsFromPreRendered(preRenderedLines, settings);
59839
- const mobile = effectiveWidth !== null && effectiveWidth > 0 && effectiveWidth < 80;
59840
- const renderedLines = [];
59841
- let globalSeparatorIndex = 0;
59842
- for (let i = 0;i < lines.length; i++) {
59843
- const lineItems = lines[i];
59844
- if (lineItems && lineItems.length > 0) {
59845
- const lineContext = { ...context, lineIndex: i, globalSeparatorIndex };
59846
- const preRenderedWidgets = preRenderedLines[i] ?? [];
59847
- const line = renderStatusLine(lineItems, settings, lineContext, preRenderedWidgets, preCalculatedMaxWidths);
59848
- const strippedLine = line.replace(/\x1b\[[0-9;]*m/g, "").trim();
59849
- if (strippedLine.length > 0) {
59850
- const nonMergedWidgets = lineItems.filter((_, idx) => idx === lineItems.length - 1 || !lineItems[idx]?.merge);
59851
- if (nonMergedWidgets.length > 1)
59852
- globalSeparatorIndex += nonMergedWidgets.length - 1;
59853
- renderedLines.push(line);
59854
- }
59855
- }
59856
- }
59857
- if (mobile && renderedLines.length > 1) {
59858
- const sep2 = settings.defaultSeparator ?? "|";
59859
- const separator = sep2 === "|" ? " | " : ` ${sep2} `;
59860
- const merged = renderedLines.join(separator);
59861
- let outputLine = merged.replace(/ /g, "ย ");
59862
- outputLine = "\x1B[0m" + outputLine;
59863
- console.log(outputLine);
60426
+ if (compact && compactWidth) {
60427
+ renderCompactOutput(preRenderedLines, settings, compactWidth);
59864
60428
  } else {
59865
- for (const line of renderedLines) {
59866
- let outputLine = line.replace(/ /g, "ย ");
59867
- outputLine = "\x1B[0m" + outputLine;
59868
- console.log(outputLine);
60429
+ const preCalculatedMaxWidths = calculateMaxWidthsFromPreRendered(preRenderedLines, settings);
60430
+ let globalSeparatorIndex = 0;
60431
+ for (let i = 0;i < lines.length; i++) {
60432
+ const lineItems = lines[i];
60433
+ if (lineItems && lineItems.length > 0) {
60434
+ const lineContext = { ...context, lineIndex: i, globalSeparatorIndex };
60435
+ const preRenderedWidgets = preRenderedLines[i] ?? [];
60436
+ const line = renderStatusLine(lineItems, settings, lineContext, preRenderedWidgets, preCalculatedMaxWidths);
60437
+ const strippedLine = line.replace(/\x1b\[[0-9;]*m/g, "").trim();
60438
+ if (strippedLine.length > 0) {
60439
+ const nonMergedWidgets = lineItems.filter((_, idx) => idx === lineItems.length - 1 || !lineItems[idx]?.merge);
60440
+ if (nonMergedWidgets.length > 1)
60441
+ globalSeparatorIndex += nonMergedWidgets.length - 1;
60442
+ let outputLine = line.replace(/ /g, "ย ");
60443
+ outputLine = "\x1B[0m" + outputLine;
60444
+ console.log(outputLine);
60445
+ }
60446
+ }
59869
60447
  }
59870
60448
  }
59871
60449
  if (settings.updatemessage?.message && settings.updatemessage.message.trim() !== "" && settings.updatemessage.remaining && settings.updatemessage.remaining > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccstatusline-usage",
3
- "version": "2.1.3",
3
+ "version": "2.1.5",
4
4
  "description": "A customizable status line formatter for Claude Code CLI",
5
5
  "module": "src/ccstatusline.ts",
6
6
  "type": "module",