@owloops/claude-powerline 1.24.3 → 1.25.0

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.
Files changed (48) hide show
  1. package/README.md +5 -43
  2. package/dist/browser.d.ts +676 -0
  3. package/dist/browser.js +3 -0
  4. package/dist/index.mjs +12 -12
  5. package/package.json +9 -1
  6. package/plugin/templates/config-full.json +1 -1
  7. package/plugin/templates/config-tui-compact.json +3 -3
  8. package/plugin/templates/config-tui-full.json +4 -4
  9. package/plugin/templates/config-tui-standard.json +4 -4
  10. package/src/browser.ts +203 -0
  11. package/src/config/defaults.ts +79 -0
  12. package/src/config/loader.ts +462 -0
  13. package/src/index.ts +90 -0
  14. package/src/powerline.ts +904 -0
  15. package/src/segments/block.ts +31 -0
  16. package/src/segments/context.ts +221 -0
  17. package/src/segments/git.ts +492 -0
  18. package/src/segments/index.ts +25 -0
  19. package/src/segments/metrics.ts +175 -0
  20. package/src/segments/pricing.ts +454 -0
  21. package/src/segments/renderer.ts +796 -0
  22. package/src/segments/session.ts +207 -0
  23. package/src/segments/tmux.ts +35 -0
  24. package/src/segments/today.ts +191 -0
  25. package/src/themes/dark.ts +52 -0
  26. package/src/themes/gruvbox.ts +52 -0
  27. package/src/themes/index.ts +131 -0
  28. package/src/themes/light.ts +52 -0
  29. package/src/themes/nord.ts +52 -0
  30. package/src/themes/rose-pine.ts +52 -0
  31. package/src/themes/tokyo-night.ts +52 -0
  32. package/src/tui/grid.ts +712 -0
  33. package/src/tui/index.ts +4 -0
  34. package/src/tui/layouts.ts +285 -0
  35. package/src/tui/primitives.ts +175 -0
  36. package/src/tui/renderer.ts +206 -0
  37. package/src/tui/sections.ts +1080 -0
  38. package/src/tui/types.ts +181 -0
  39. package/src/utils/budget.ts +47 -0
  40. package/src/utils/cache.ts +247 -0
  41. package/src/utils/claude.ts +489 -0
  42. package/src/utils/color-support.ts +118 -0
  43. package/src/utils/colors.ts +120 -0
  44. package/src/utils/constants.ts +176 -0
  45. package/src/utils/formatters.ts +160 -0
  46. package/src/utils/logger.ts +5 -0
  47. package/src/utils/terminal-width.ts +117 -0
  48. package/src/utils/terminal.ts +11 -0
package/README.md CHANGED
@@ -278,21 +278,17 @@ Configure context window limits for different model types. Defaults to 200K toke
278
278
  ```json
279
279
  "block": {
280
280
  "enabled": true,
281
- "type": "weighted",
282
- "burnType": "cost",
283
281
  "displayStyle": "text"
284
282
  }
285
283
  ```
286
284
 
287
285
  **Options:**
288
286
 
289
- - `type`: Display format - `cost` | `tokens` | `both` | `time` | `weighted`
290
- - `burnType`: Burn rate display - `cost` | `tokens` | `both` | `none`
291
- - `displayStyle`: Visual style for utilization display (see table below). Only applies when native rate limit data is available.
287
+ - `displayStyle`: Visual style for utilization display (see table below)
292
288
 
293
- **Native Rate Limits:** When Claude Code provides `rate_limits` in its hook data (Claude.ai Pro/Max subscribers), the block segment displays the official 5-hour utilization percentage and reset countdown instead of transcript-based estimates. This is more accurate, accounts for cross-machine usage, and requires no disk I/O. When native data is unavailable (API users, older Claude Code versions), the segment falls back to transcript-based cost/token tracking.
289
+ Requires Claude Code's native `rate_limits` hook data (Claude.ai Pro/Max subscribers). Displays the official 5-hour utilization percentage and reset countdown. Hidden when native data is unavailable.
294
290
 
295
- **Display Styles** (native mode only):
291
+ **Display Styles:**
296
292
 
297
293
  | Style | Example |
298
294
  |-------|---------|
@@ -308,8 +304,6 @@ Configure context window limits for different model types. Defaults to 200K toke
308
304
  | `squares` | `◱ ◼◼◻◻◻◻◻◻◻◻ 23% (4h 12m)` |
309
305
  | `ball` | `◱ ──●─────── 23% (4h 12m)` |
310
306
 
311
- **Weighted Tokens:** In transcript mode, Opus tokens count 5x toward rate limits compared to Sonnet/Haiku tokens
312
-
313
307
  **Symbols:** `◱` Block (unicode) • `B` Block (text)
314
308
 
315
309
  </details>
@@ -728,7 +722,7 @@ Use bare segment names to render the full pre-formatted segment:
728
722
  ```
729
723
  context block session today weekly
730
724
  git dir version tmux metrics
731
- activity burn env
725
+ activity env
732
726
  ```
733
727
 
734
728
  #### Dot-Notation Subsegments
@@ -745,7 +739,6 @@ Use `segment.part` to place individual pieces of a segment into separate cells w
745
739
  | `weekly` | `icon`, `bar`, `pct`, `time` |
746
740
  | `metrics` | `response`, `responseIcon`, `responseVal`, `lastResponse`, `lastResponseIcon`, `lastResponseVal`, `added`, `addedIcon`, `addedVal`, `removed`, `removedIcon`, `removedVal` |
747
741
  | `activity` | `duration`, `durationIcon`, `durationVal`, `messages`, `messagesIcon`, `messagesVal` |
748
- | `burn` | `icon`, `rate` |
749
742
  | `version` | `icon`, `value` |
750
743
  | `tmux` | `label`, `value` |
751
744
  | `dir` | `value` |
@@ -761,7 +754,7 @@ Example, block segment with a progress bar, mirroring the context layout:
761
754
  ```
762
755
 
763
756
  > [!NOTE]
764
- > `context.bar`, `block.bar`, and `weekly.bar` are width-aware. Their progress bars render at exactly the resolved column width. Block bar uses `nativeUtilization` when available, or `cost / budget` for transcript mode. Weekly bar uses the 7-day `used_percentage`.
757
+ > `context.bar`, `block.bar`, and `weekly.bar` are width-aware. Their progress bars render at exactly the resolved column width. Block bar uses `nativeUtilization` from the 5-hour rate limit data. Weekly bar uses the 7-day `used_percentage`.
765
758
 
766
759
  #### Custom Box Characters
767
760
 
@@ -847,37 +840,6 @@ Empty segments are automatically removed. Cells resolve to `.`, empty rows are d
847
840
 
848
841
  </details>
849
842
 
850
- <details>
851
- <summary><strong>Performance</strong></summary>
852
-
853
- Execution times for different configurations:
854
-
855
- - **~80ms** default config (`directory`, `git`, `model`, `session`, `today`, `context`)
856
- - **~240ms** full-featured (all segments enabled)
857
-
858
- | Segment | Timing | Notes |
859
- | ----------- | ------ | ------------------------------------------ |
860
- | `directory` | ~40ms | No external commands |
861
- | `model` | ~40ms | Uses hook data |
862
- | `session` | ~40ms | Minimal transcript parsing |
863
- | `context` | ~40ms | Hook data calculation |
864
- | `metrics` | ~40ms | Transcript analysis |
865
- | `git` | ~60ms | No caching for fresh data |
866
- | `tmux` | ~50ms | Environment check + command |
867
- | `block` | ~180ms | 5-hour window transcript load |
868
- | `today` | ~250ms | Full daily transcript load (cached: ~50ms) |
869
- | `version` | ~40ms | Uses hook data |
870
-
871
- **Benchmark:** `npm run benchmark:timing`
872
-
873
- **Optimization Tips:**
874
-
875
- - **Global install:** `npm install -g` to avoid npx overhead
876
- - **Disable unused segments** for faster execution
877
- - **Cache cleanup:** Remove `~/.claude/powerline/` if needed
878
-
879
- </details>
880
-
881
843
  <details>
882
844
  <summary><strong>Custom Segments (Shell Composition)</strong></summary>
883
845