@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.
- package/README.md +5 -43
- package/dist/browser.d.ts +676 -0
- package/dist/browser.js +3 -0
- package/dist/index.mjs +12 -12
- package/package.json +9 -1
- package/plugin/templates/config-full.json +1 -1
- package/plugin/templates/config-tui-compact.json +3 -3
- package/plugin/templates/config-tui-full.json +4 -4
- package/plugin/templates/config-tui-standard.json +4 -4
- package/src/browser.ts +203 -0
- package/src/config/defaults.ts +79 -0
- package/src/config/loader.ts +462 -0
- package/src/index.ts +90 -0
- package/src/powerline.ts +904 -0
- package/src/segments/block.ts +31 -0
- package/src/segments/context.ts +221 -0
- package/src/segments/git.ts +492 -0
- package/src/segments/index.ts +25 -0
- package/src/segments/metrics.ts +175 -0
- package/src/segments/pricing.ts +454 -0
- package/src/segments/renderer.ts +796 -0
- package/src/segments/session.ts +207 -0
- package/src/segments/tmux.ts +35 -0
- package/src/segments/today.ts +191 -0
- package/src/themes/dark.ts +52 -0
- package/src/themes/gruvbox.ts +52 -0
- package/src/themes/index.ts +131 -0
- package/src/themes/light.ts +52 -0
- package/src/themes/nord.ts +52 -0
- package/src/themes/rose-pine.ts +52 -0
- package/src/themes/tokyo-night.ts +52 -0
- package/src/tui/grid.ts +712 -0
- package/src/tui/index.ts +4 -0
- package/src/tui/layouts.ts +285 -0
- package/src/tui/primitives.ts +175 -0
- package/src/tui/renderer.ts +206 -0
- package/src/tui/sections.ts +1080 -0
- package/src/tui/types.ts +181 -0
- package/src/utils/budget.ts +47 -0
- package/src/utils/cache.ts +247 -0
- package/src/utils/claude.ts +489 -0
- package/src/utils/color-support.ts +118 -0
- package/src/utils/colors.ts +120 -0
- package/src/utils/constants.ts +176 -0
- package/src/utils/formatters.ts +160 -0
- package/src/utils/logger.ts +5 -0
- package/src/utils/terminal-width.ts +117 -0
- 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
|
-
- `
|
|
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
|
-
|
|
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
|
|
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
|
|
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`
|
|
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
|
|