@owloops/claude-powerline 1.25.1 → 1.26.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 +120 -4
- package/dist/browser.d.ts +88 -9
- package/dist/browser.js +3 -3
- package/dist/index.mjs +13 -12
- package/package.json +1 -1
- package/src/browser.ts +5 -0
- package/src/config/defaults.ts +3 -0
- package/src/config/loader.ts +9 -0
- package/src/powerline.ts +148 -5
- package/src/segments/cacheTimer.ts +72 -0
- package/src/segments/index.ts +5 -0
- package/src/segments/renderer.ts +177 -58
- package/src/themes/dark.ts +9 -0
- package/src/themes/gruvbox.ts +9 -0
- package/src/themes/index.ts +27 -0
- package/src/themes/light.ts +9 -0
- package/src/themes/nord.ts +9 -0
- package/src/themes/rose-pine.ts +9 -0
- package/src/themes/tokyo-night.ts +9 -0
- package/src/tui/layouts.ts +56 -20
- package/src/tui/primitives.ts +12 -3
- package/src/tui/sections.ts +555 -124
- package/src/tui/types.ts +8 -0
- package/src/utils/budget.ts +69 -0
- package/src/utils/claude.ts +29 -0
- package/src/utils/constants.ts +6 -0
- package/src/utils/formatters.ts +8 -0
- package/src/utils/icon-visibility.ts +31 -0
package/README.md
CHANGED
|
@@ -48,16 +48,30 @@ Add to your Claude Code `settings.json`:
|
|
|
48
48
|
|
|
49
49
|
Start a Claude session and the statusline appears at the bottom. Using `npx` automatically downloads and runs the latest version without manual updates.
|
|
50
50
|
|
|
51
|
-
##
|
|
51
|
+
## Powerline Studio
|
|
52
|
+
|
|
53
|
+
<a href="https://powerline.owloops.com/">
|
|
54
|
+
<img src="images/powerline-studio.gif" alt="Powerline Studio visual configurator" width="700">
|
|
55
|
+
</a>
|
|
56
|
+
|
|
57
|
+
[**powerline.owloops.com**](https://powerline.owloops.com/) is a visual configurator for claude-powerline. Click segments in the preview to toggle options, switch styles and themes live, reorder, then copy or download the JSON into `~/.claude/claude-powerline.json`. Paste an existing config to edit it.
|
|
58
|
+
|
|
59
|
+
<details>
|
|
60
|
+
<summary><strong>Styles</strong></summary>
|
|
52
61
|
|
|
53
62
|
<img src="images/claude-powerline-styles.png" alt="Claude Powerline Styles" width="700">
|
|
54
63
|
|
|
55
|
-
|
|
64
|
+
</details>
|
|
65
|
+
|
|
66
|
+
<details>
|
|
67
|
+
<summary><strong>Themes</strong></summary>
|
|
56
68
|
|
|
57
69
|
<img src="images/claude-powerline-themes.png" alt="Claude Powerline Themes" width="700">
|
|
58
70
|
|
|
59
71
|
6 built-in themes (dark, light, nord, tokyo-night, rose-pine, gruvbox) or [create your own](#configuration).
|
|
60
72
|
|
|
73
|
+
</details>
|
|
74
|
+
|
|
61
75
|
<details>
|
|
62
76
|
<summary><h2>Configuration</h2></summary>
|
|
63
77
|
|
|
@@ -126,6 +140,8 @@ export CLAUDE_POWERLINE_DEBUG=1 # Enable debug logging
|
|
|
126
140
|
- `fish`: Fish-shell style abbreviation (e.g., `~/p/claude-powerline`)
|
|
127
141
|
- `basename`: Show only folder name (e.g., `claude-powerline`)
|
|
128
142
|
|
|
143
|
+
In `--worktree` sessions, the directory segment automatically shows the original repo path instead of the worktree folder (no config required).
|
|
144
|
+
|
|
129
145
|
</details>
|
|
130
146
|
|
|
131
147
|
<details>
|
|
@@ -374,6 +390,76 @@ Only visible when Claude Code provides native `rate_limits.seven_day` data (Clau
|
|
|
374
390
|
|
|
375
391
|
</details>
|
|
376
392
|
|
|
393
|
+
<details>
|
|
394
|
+
<summary><strong>Agent</strong> - Shows active subagent name when Claude Code is invoked with <code>--agent</code> (hidden otherwise)</summary>
|
|
395
|
+
|
|
396
|
+
```json
|
|
397
|
+
"agent": {
|
|
398
|
+
"enabled": true,
|
|
399
|
+
"showLabel": false
|
|
400
|
+
}
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
**Display:** `◇ researcher` (or `◇ agent: researcher` with `showLabel: true`)
|
|
404
|
+
|
|
405
|
+
**Symbols:** `◇` Agent (unicode) • `&` Agent (text)
|
|
406
|
+
|
|
407
|
+
</details>
|
|
408
|
+
|
|
409
|
+
<details>
|
|
410
|
+
<summary><strong>Thinking</strong> - Shows extended-thinking on/off state and/or reasoning effort level when provided by Claude Code</summary>
|
|
411
|
+
|
|
412
|
+
```json
|
|
413
|
+
"thinking": {
|
|
414
|
+
"enabled": true,
|
|
415
|
+
"showEnabled": true,
|
|
416
|
+
"showEffort": true
|
|
417
|
+
}
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
Set `showEnabled: false` to hide the `On`/`Off` state, or `showEffort: false` to hide the effort level. If both are true the two parts are joined with `·`; if only one is shown, no separator is rendered.
|
|
421
|
+
|
|
422
|
+
**Display:** `✦ On · xhigh` (both shown) • `✦ On` (enabled only) • `✦ xhigh` (effort only)
|
|
423
|
+
|
|
424
|
+
**Symbols:** `✦` Thinking (unicode) • `T` Thinking (text)
|
|
425
|
+
|
|
426
|
+
</details>
|
|
427
|
+
|
|
428
|
+
<details>
|
|
429
|
+
<summary><strong>Cache Timer</strong> - Shows time since last turn, tracking Claude's 5-minute prompt cache TTL</summary>
|
|
430
|
+
|
|
431
|
+
Opt-in (`enabled: false` by default).
|
|
432
|
+
|
|
433
|
+
```json
|
|
434
|
+
"cacheTimer": {
|
|
435
|
+
"enabled": true
|
|
436
|
+
}
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
**Display:** `◴ 3:42` (m:ss under 5m) • `◴ 17m` (5–59m) • `◴ 1h+` (1 hour or more)
|
|
440
|
+
|
|
441
|
+
**Color tiers:** healthy green (0–3m) → yellow warn (3–5m) → red critical (5m+). Hidden when `transcript_path` is unavailable.
|
|
442
|
+
|
|
443
|
+
**Anchor:** elapsed time is measured from the last user message in the transcript (matches Anthropic's cache TTL anchor), falling back to the transcript file mtime if JSONL parsing fails.
|
|
444
|
+
|
|
445
|
+
**TUI:** also available in grid templates via `{cacheTimer}`, `{cacheTimer.icon}`, and `{cacheTimer.value}`.
|
|
446
|
+
|
|
447
|
+
**Symbols:** `◴` Cache timer (unicode) • `C!` Cache timer (text)
|
|
448
|
+
|
|
449
|
+
> **Note:** `cacheTimer` only updates when Claude Code re-runs the statusline. Set `refreshInterval` in your Claude Code `~/.claude/settings.json` `statusLine` block so the elapsed time ticks while you're idle — otherwise the timer freezes between events:
|
|
450
|
+
> ```json
|
|
451
|
+
> {
|
|
452
|
+
> "statusLine": {
|
|
453
|
+
> "type": "command",
|
|
454
|
+
> "command": "npx -y @owloops/claude-powerline@latest",
|
|
455
|
+
> "refreshInterval": 10
|
|
456
|
+
> }
|
|
457
|
+
> }
|
|
458
|
+
> ```
|
|
459
|
+
> `refreshInterval` is in seconds (min 1). `10` keeps the displayed value within ~10s of reality.
|
|
460
|
+
|
|
461
|
+
</details>
|
|
462
|
+
|
|
377
463
|
<details>
|
|
378
464
|
<summary><strong>Tmux</strong> - Shows tmux session name and window info when in tmux</summary>
|
|
379
465
|
|
|
@@ -447,9 +533,25 @@ Hidden when the variable is unset or empty.
|
|
|
447
533
|
- `amount`: Budget limit (required for percentage display)
|
|
448
534
|
- `type`: Budget type - `cost` (USD) | `tokens` (for token-based limits)
|
|
449
535
|
- `warningThreshold`: Warning threshold percentage (default: 80)
|
|
536
|
+
- `showPercentage`: Show the `N%` suffix (default: `true`)
|
|
537
|
+
- `showValue`: Show the base cost/token value (default: `true`)
|
|
450
538
|
|
|
451
539
|
**Indicators:** `25%` Normal • `+75%` Moderate (50-79%) • `!85%` Warning (80%+)
|
|
452
540
|
|
|
541
|
+
**Display toggles.** For `session` and `today`, you can hide the percentage suffix, the base value, or both:
|
|
542
|
+
|
|
543
|
+
```json
|
|
544
|
+
"budget": {
|
|
545
|
+
"today": { "amount": 50, "showPercentage": false }
|
|
546
|
+
}
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
- `showPercentage: false` hides the `N%` suffix while keeping the budget configured (e.g. for warning thresholds).
|
|
550
|
+
- `showValue: false` renders only the percentage (e.g. `◱ 15%`).
|
|
551
|
+
- Both `false` hides the segment entirely.
|
|
552
|
+
|
|
553
|
+
A visible effect requires `amount > 0` AND a computable percentage (e.g. when `type: "tokens"`, tokens must be present). Without a budget or a computable percentage, these flags are no-ops and the segment falls back to rendering the base value. `block` accepts the same fields for config symmetry but does not render a budget suffix today, so they have no visible effect there.
|
|
554
|
+
|
|
453
555
|
> [!TIP]
|
|
454
556
|
> Claude's rate limits consider multiple factors beyond tokens (message count, length, attachments, model). See [Anthropic's usage documentation](https://support.anthropic.com/en/articles/11014257-about-claude-s-max-plan-usage) for details.
|
|
455
557
|
|
|
@@ -534,6 +636,18 @@ Segments flow naturally and wrap to new lines when they exceed the terminal widt
|
|
|
534
636
|
|
|
535
637
|
Set to `0` for compact, `1` (default) for standard spacing.
|
|
536
638
|
|
|
639
|
+
**Show Icons** - hide the leading emblem on each segment for a text-only look:
|
|
640
|
+
|
|
641
|
+
```json
|
|
642
|
+
{
|
|
643
|
+
"display": {
|
|
644
|
+
"showIcons": false
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
Default `true`. Per-segment override via `showIcon` on any segment (e.g. `"git": { "enabled": true, "showIcon": true }`) takes precedence. Status glyphs (git `● ✓ ⚠`, ahead/behind arrows), powerline separators, and metrics sub-icons are unaffected.
|
|
650
|
+
|
|
537
651
|
> [!NOTE]
|
|
538
652
|
> Claude Code system messages may truncate long status lines. Use `autoWrap` or manual multi-line layouts to prevent segment cutoff.
|
|
539
653
|
|
|
@@ -560,7 +674,7 @@ Create custom themes and configure color compatibility:
|
|
|
560
674
|
}
|
|
561
675
|
```
|
|
562
676
|
|
|
563
|
-
**Color Options:** `bg` (hex, `transparent`, `none`) • `fg` (hex)
|
|
677
|
+
**Color Options:** `bg` (hex, `transparent`, `none`) • `fg` (hex) • `bold` (boolean, optional, defaults to `false`)
|
|
564
678
|
|
|
565
679
|
**TUI Grid Colors:** In TUI grid mode, custom colors also support bare segment names and dot-notation parts as keys. A bare segment key (e.g. `"context"`) sets the default color for the segment and all its parts. A part key (e.g. `"context.bar"`) overrides a specific part:
|
|
566
680
|
|
|
@@ -722,7 +836,7 @@ Use bare segment names to render the full pre-formatted segment:
|
|
|
722
836
|
```
|
|
723
837
|
context block session today weekly
|
|
724
838
|
git dir version tmux metrics
|
|
725
|
-
activity env
|
|
839
|
+
activity env agent
|
|
726
840
|
```
|
|
727
841
|
|
|
728
842
|
#### Dot-Notation Subsegments
|
|
@@ -743,6 +857,8 @@ Use `segment.part` to place individual pieces of a segment into separate cells w
|
|
|
743
857
|
| `tmux` | `label`, `value` |
|
|
744
858
|
| `dir` | `value` |
|
|
745
859
|
| `env` | `prefix`, `value` |
|
|
860
|
+
| `agent` | `icon`, `name` |
|
|
861
|
+
| `thinking` | `icon`, `enabled`, `effort` |
|
|
746
862
|
|
|
747
863
|
Example, block segment with a progress bar, mirroring the context layout:
|
|
748
864
|
|
package/dist/browser.d.ts
CHANGED
|
@@ -47,6 +47,22 @@ interface ClaudeHookData {
|
|
|
47
47
|
resets_at: number;
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
+
worktree?: {
|
|
51
|
+
name: string;
|
|
52
|
+
path: string;
|
|
53
|
+
branch?: string;
|
|
54
|
+
original_cwd: string;
|
|
55
|
+
original_branch?: string;
|
|
56
|
+
};
|
|
57
|
+
agent?: {
|
|
58
|
+
name: string;
|
|
59
|
+
};
|
|
60
|
+
effort?: {
|
|
61
|
+
level?: string;
|
|
62
|
+
};
|
|
63
|
+
thinking?: {
|
|
64
|
+
enabled?: boolean;
|
|
65
|
+
};
|
|
50
66
|
}
|
|
51
67
|
//#endregion
|
|
52
68
|
//#region src/themes/dark.d.ts
|
|
@@ -83,6 +99,7 @@ declare const gruvboxAnsiTheme: ColorTheme;
|
|
|
83
99
|
interface SegmentColor {
|
|
84
100
|
bg: string;
|
|
85
101
|
fg: string;
|
|
102
|
+
bold?: boolean;
|
|
86
103
|
}
|
|
87
104
|
interface ColorTheme {
|
|
88
105
|
directory: SegmentColor;
|
|
@@ -99,37 +116,63 @@ interface ColorTheme {
|
|
|
99
116
|
version: SegmentColor;
|
|
100
117
|
env: SegmentColor;
|
|
101
118
|
weekly: SegmentColor;
|
|
119
|
+
agent: SegmentColor;
|
|
120
|
+
thinking: SegmentColor;
|
|
121
|
+
cacheTimer: SegmentColor;
|
|
102
122
|
}
|
|
103
123
|
interface PowerlineColors {
|
|
104
124
|
reset: string;
|
|
105
125
|
modeBg: string;
|
|
106
126
|
modeFg: string;
|
|
127
|
+
modeBold: boolean;
|
|
107
128
|
gitBg: string;
|
|
108
129
|
gitFg: string;
|
|
130
|
+
gitBold: boolean;
|
|
109
131
|
modelBg: string;
|
|
110
132
|
modelFg: string;
|
|
133
|
+
modelBold: boolean;
|
|
111
134
|
sessionBg: string;
|
|
112
135
|
sessionFg: string;
|
|
136
|
+
sessionBold: boolean;
|
|
113
137
|
blockBg: string;
|
|
114
138
|
blockFg: string;
|
|
139
|
+
blockBold: boolean;
|
|
115
140
|
todayBg: string;
|
|
116
141
|
todayFg: string;
|
|
142
|
+
todayBold: boolean;
|
|
117
143
|
tmuxBg: string;
|
|
118
144
|
tmuxFg: string;
|
|
145
|
+
tmuxBold: boolean;
|
|
119
146
|
contextBg: string;
|
|
120
147
|
contextFg: string;
|
|
148
|
+
contextBold: boolean;
|
|
121
149
|
contextWarningBg: string;
|
|
122
150
|
contextWarningFg: string;
|
|
151
|
+
contextWarningBold: boolean;
|
|
123
152
|
contextCriticalBg: string;
|
|
124
153
|
contextCriticalFg: string;
|
|
154
|
+
contextCriticalBold: boolean;
|
|
125
155
|
metricsBg: string;
|
|
126
156
|
metricsFg: string;
|
|
157
|
+
metricsBold: boolean;
|
|
127
158
|
versionBg: string;
|
|
128
159
|
versionFg: string;
|
|
160
|
+
versionBold: boolean;
|
|
129
161
|
envBg: string;
|
|
130
162
|
envFg: string;
|
|
163
|
+
envBold: boolean;
|
|
131
164
|
weeklyBg: string;
|
|
132
165
|
weeklyFg: string;
|
|
166
|
+
weeklyBold: boolean;
|
|
167
|
+
agentBg: string;
|
|
168
|
+
agentFg: string;
|
|
169
|
+
agentBold: boolean;
|
|
170
|
+
thinkingBg: string;
|
|
171
|
+
thinkingFg: string;
|
|
172
|
+
thinkingBold: boolean;
|
|
173
|
+
cacheTimerBg: string;
|
|
174
|
+
cacheTimerFg: string;
|
|
175
|
+
cacheTimerBold: boolean;
|
|
133
176
|
partFg: Record<string, string>;
|
|
134
177
|
}
|
|
135
178
|
declare const BUILT_IN_THEMES: Record<string, ColorTheme>;
|
|
@@ -207,6 +250,11 @@ interface GitInfo {
|
|
|
207
250
|
isWorktree?: boolean;
|
|
208
251
|
}
|
|
209
252
|
//#endregion
|
|
253
|
+
//#region src/segments/cacheTimer.d.ts
|
|
254
|
+
interface CacheTimerInfo {
|
|
255
|
+
elapsedSeconds: number;
|
|
256
|
+
}
|
|
257
|
+
//#endregion
|
|
210
258
|
//#region src/utils/constants.d.ts
|
|
211
259
|
declare const RESET_CODE = "\u001B[0m";
|
|
212
260
|
declare const SYMBOLS: {
|
|
@@ -245,6 +293,9 @@ declare const SYMBOLS: {
|
|
|
245
293
|
readonly weekly_cost: "◑";
|
|
246
294
|
readonly dir: "📁";
|
|
247
295
|
readonly activity: "⚡";
|
|
296
|
+
readonly agent: "◇";
|
|
297
|
+
readonly thinking: "✦";
|
|
298
|
+
readonly cache_timer: "◴";
|
|
248
299
|
};
|
|
249
300
|
declare const BOX_CHARS: {
|
|
250
301
|
readonly topLeft: "╭";
|
|
@@ -303,6 +354,9 @@ declare const TEXT_SYMBOLS: {
|
|
|
303
354
|
readonly weekly_cost: "W";
|
|
304
355
|
readonly dir: "D";
|
|
305
356
|
readonly activity: "A";
|
|
357
|
+
readonly agent: "&";
|
|
358
|
+
readonly thinking: "T";
|
|
359
|
+
readonly cache_timer: "C!";
|
|
306
360
|
};
|
|
307
361
|
//#endregion
|
|
308
362
|
//#region src/tui/types.d.ts
|
|
@@ -324,12 +378,13 @@ interface TuiData {
|
|
|
324
378
|
contextInfo: ContextInfo | null;
|
|
325
379
|
metricsInfo: MetricsInfo | null;
|
|
326
380
|
gitInfo: GitInfo | null;
|
|
381
|
+
cacheTimerInfo: CacheTimerInfo | null;
|
|
327
382
|
tmuxSessionId: string | null;
|
|
328
383
|
colors: PowerlineColors;
|
|
329
384
|
}
|
|
330
385
|
type SymbolSet = typeof SYMBOLS | typeof TEXT_SYMBOLS;
|
|
331
386
|
type LayoutMode = "wide" | "medium" | "narrow";
|
|
332
|
-
declare const SEGMENT_NAME_LIST: readonly ["context", "block", "session", "today", "weekly", "git", "dir", "model", "version", "tmux", "metrics", "activity", "env"];
|
|
387
|
+
declare const SEGMENT_NAME_LIST: readonly ["context", "block", "session", "today", "weekly", "git", "dir", "model", "version", "tmux", "metrics", "activity", "env", "agent", "thinking", "cacheTimer"];
|
|
333
388
|
type SegmentName = (typeof SEGMENT_NAME_LIST)[number];
|
|
334
389
|
declare const VALID_SEGMENT_NAMES: ReadonlySet<string>;
|
|
335
390
|
declare const SEGMENT_PARTS: Record<SegmentName, readonly string[]>;
|
|
@@ -394,6 +449,7 @@ interface RenderCtx {
|
|
|
394
449
|
//#region src/segments/renderer.d.ts
|
|
395
450
|
interface SegmentConfig {
|
|
396
451
|
enabled: boolean;
|
|
452
|
+
showIcon?: boolean;
|
|
397
453
|
}
|
|
398
454
|
interface DirectorySegmentConfig extends SegmentConfig {
|
|
399
455
|
showBasename?: boolean;
|
|
@@ -449,7 +505,15 @@ interface EnvSegmentConfig extends SegmentConfig {
|
|
|
449
505
|
interface WeeklySegmentConfig extends SegmentConfig {
|
|
450
506
|
displayStyle?: BarDisplayStyle;
|
|
451
507
|
}
|
|
452
|
-
|
|
508
|
+
interface AgentSegmentConfig extends SegmentConfig {
|
|
509
|
+
showLabel?: boolean;
|
|
510
|
+
}
|
|
511
|
+
interface ThinkingSegmentConfig extends SegmentConfig {
|
|
512
|
+
showEnabled?: boolean;
|
|
513
|
+
showEffort?: boolean;
|
|
514
|
+
}
|
|
515
|
+
interface CacheTimerSegmentConfig extends SegmentConfig {}
|
|
516
|
+
type AnySegmentConfig = SegmentConfig | DirectorySegmentConfig | GitSegmentConfig | UsageSegmentConfig | TmuxSegmentConfig | ContextSegmentConfig | MetricsSegmentConfig | BlockSegmentConfig | TodaySegmentConfig | VersionSegmentConfig | SessionIdSegmentConfig | EnvSegmentConfig | WeeklySegmentConfig | AgentSegmentConfig | ThinkingSegmentConfig | CacheTimerSegmentConfig;
|
|
453
517
|
interface PowerlineSymbols {
|
|
454
518
|
right: string;
|
|
455
519
|
left: string;
|
|
@@ -483,20 +547,25 @@ interface PowerlineSymbols {
|
|
|
483
547
|
env: string;
|
|
484
548
|
session_id: string;
|
|
485
549
|
weekly_cost: string;
|
|
550
|
+
agent: string;
|
|
551
|
+
thinking: string;
|
|
552
|
+
cache_timer: string;
|
|
486
553
|
}
|
|
487
554
|
interface SegmentData {
|
|
488
555
|
text: string;
|
|
489
556
|
bgColor: string;
|
|
490
557
|
fgColor: string;
|
|
558
|
+
bold?: boolean;
|
|
491
559
|
}
|
|
492
560
|
declare class SegmentRenderer {
|
|
493
561
|
private readonly config;
|
|
494
562
|
private readonly symbols;
|
|
495
563
|
constructor(config: PowerlineConfig, symbols: PowerlineSymbols);
|
|
564
|
+
private leadingIcon;
|
|
496
565
|
renderDirectory(hookData: ClaudeHookData, colors: PowerlineColors, config?: DirectorySegmentConfig): SegmentData;
|
|
497
566
|
renderGit(gitInfo: GitInfo, colors: PowerlineColors, config?: GitSegmentConfig): SegmentData | null;
|
|
498
|
-
renderModel(hookData: ClaudeHookData, colors: PowerlineColors): SegmentData;
|
|
499
|
-
renderSession(usageInfo: UsageInfo, colors: PowerlineColors, config?: UsageSegmentConfig): SegmentData;
|
|
567
|
+
renderModel(hookData: ClaudeHookData, colors: PowerlineColors, config?: SegmentConfig): SegmentData;
|
|
568
|
+
renderSession(usageInfo: UsageInfo, colors: PowerlineColors, config?: UsageSegmentConfig): SegmentData | null;
|
|
500
569
|
renderSessionId(sessionId: string, colors: PowerlineColors, config?: SessionIdSegmentConfig): SegmentData;
|
|
501
570
|
renderTmux(sessionId: string | null, colors: PowerlineColors): SegmentData | null;
|
|
502
571
|
renderContext(contextInfo: ContextInfo | null, colors: PowerlineColors, config?: ContextSegmentConfig): SegmentData | null;
|
|
@@ -506,12 +575,15 @@ declare class SegmentRenderer {
|
|
|
506
575
|
renderMetrics(metricsInfo: MetricsInfo | null, colors: PowerlineColors, config?: MetricsSegmentConfig): SegmentData | null;
|
|
507
576
|
renderBlock(blockInfo: BlockInfo, colors: PowerlineColors, config?: BlockSegmentConfig): SegmentData;
|
|
508
577
|
renderWeekly(hookData: ClaudeHookData, colors: PowerlineColors, config?: WeeklySegmentConfig): SegmentData | null;
|
|
509
|
-
renderToday(todayInfo: TodayInfo, colors: PowerlineColors,
|
|
578
|
+
renderToday(todayInfo: TodayInfo, colors: PowerlineColors, configOrType?: TodaySegmentConfig | string): SegmentData | null;
|
|
510
579
|
private getDisplayDirectoryName;
|
|
511
580
|
private formatUsageDisplay;
|
|
512
581
|
private formatUsageWithBudget;
|
|
513
|
-
renderVersion(hookData: ClaudeHookData, colors: PowerlineColors,
|
|
582
|
+
renderVersion(hookData: ClaudeHookData, colors: PowerlineColors, config?: VersionSegmentConfig): SegmentData | null;
|
|
514
583
|
renderEnv(colors: PowerlineColors, config: EnvSegmentConfig): SegmentData | null;
|
|
584
|
+
renderAgent(hookData: ClaudeHookData, colors: PowerlineColors, config?: AgentSegmentConfig): SegmentData | null;
|
|
585
|
+
renderThinking(hookData: ClaudeHookData, colors: PowerlineColors, config?: ThinkingSegmentConfig): SegmentData | null;
|
|
586
|
+
renderCacheTimer(info: CacheTimerInfo, colors: PowerlineColors, config?: CacheTimerSegmentConfig): SegmentData;
|
|
515
587
|
}
|
|
516
588
|
//#endregion
|
|
517
589
|
//#region src/config/loader.d.ts
|
|
@@ -530,6 +602,9 @@ interface LineConfig {
|
|
|
530
602
|
sessionId?: SessionIdSegmentConfig;
|
|
531
603
|
env?: EnvSegmentConfig;
|
|
532
604
|
weekly?: WeeklySegmentConfig;
|
|
605
|
+
agent?: AgentSegmentConfig;
|
|
606
|
+
thinking?: ThinkingSegmentConfig;
|
|
607
|
+
cacheTimer?: CacheTimerSegmentConfig;
|
|
533
608
|
};
|
|
534
609
|
}
|
|
535
610
|
interface DisplayConfig {
|
|
@@ -539,12 +614,15 @@ interface DisplayConfig {
|
|
|
539
614
|
colorCompatibility?: "auto" | "ansi" | "ansi256" | "truecolor";
|
|
540
615
|
autoWrap?: boolean;
|
|
541
616
|
padding?: number;
|
|
617
|
+
showIcons?: boolean;
|
|
542
618
|
tui?: TuiGridConfig;
|
|
543
619
|
}
|
|
544
620
|
interface BudgetItemConfig {
|
|
545
621
|
amount?: number;
|
|
546
622
|
warningThreshold?: number;
|
|
547
623
|
type?: "cost" | "tokens";
|
|
624
|
+
showPercentage?: boolean;
|
|
625
|
+
showValue?: boolean;
|
|
548
626
|
}
|
|
549
627
|
interface BudgetConfig {
|
|
550
628
|
session?: BudgetItemConfig;
|
|
@@ -600,6 +678,7 @@ declare function collapseHome(dirPath: string, homeDir?: string): string;
|
|
|
600
678
|
declare function formatTimeRemaining(totalMinutes: number): string;
|
|
601
679
|
declare function formatLongTimeRemaining(totalMinutes: number): string;
|
|
602
680
|
declare function minutesUntilReset(epochSeconds: number): number;
|
|
681
|
+
declare function formatCacheTimerElapsed(seconds: number): string;
|
|
603
682
|
//#endregion
|
|
604
683
|
//#region src/utils/budget.d.ts
|
|
605
684
|
interface BudgetStatus {
|
|
@@ -610,7 +689,7 @@ interface BudgetStatus {
|
|
|
610
689
|
declare function getBudgetStatus(cost: number, budget: number | undefined, warningThreshold?: number): BudgetStatus;
|
|
611
690
|
//#endregion
|
|
612
691
|
//#region src/tui/primitives.d.ts
|
|
613
|
-
declare function colorize(text: string, fgColor: string, reset: string): string;
|
|
692
|
+
declare function colorize(text: string, fgColor: string, reset: string, bold?: boolean): string;
|
|
614
693
|
declare function padRight(text: string, width: number): string;
|
|
615
694
|
declare function padLeft(text: string, width: number): string;
|
|
616
695
|
declare function padCenter(text: string, width: number): string;
|
|
@@ -630,7 +709,7 @@ declare function buildWeeklyBar(data: TuiData, barWidth: number, sym: SymbolSet,
|
|
|
630
709
|
declare function buildContextLine(data: TuiData, contentWidth: number, sym: SymbolSet, reset: string, colors: PowerlineColors): string | null;
|
|
631
710
|
declare function collectMetricSegments(data: TuiData, sym: SymbolSet, config: PowerlineConfig, reset: string, colors: PowerlineColors): string[];
|
|
632
711
|
declare function collectActivityParts(data: TuiData, sym: SymbolSet): string[];
|
|
633
|
-
declare function collectWorkspaceParts(data: TuiData, sym: SymbolSet, reset: string, colors: PowerlineColors): string[];
|
|
712
|
+
declare function collectWorkspaceParts(data: TuiData, sym: SymbolSet, reset: string, colors: PowerlineColors, config: PowerlineConfig): string[];
|
|
634
713
|
declare function collectFooterParts(data: TuiData, sym: SymbolSet, config: PowerlineConfig, reset: string, colors: PowerlineColors): string[];
|
|
635
714
|
interface ResolvedTemplate {
|
|
636
715
|
items: string[];
|
|
@@ -673,4 +752,4 @@ declare function renderGrid(gridConfig: TuiGridConfig, resolvedData: Record<stri
|
|
|
673
752
|
//#region src/config/defaults.d.ts
|
|
674
753
|
declare const DEFAULT_CONFIG: PowerlineConfig;
|
|
675
754
|
//#endregion
|
|
676
|
-
export { type AlignValue, type AnySegmentConfig, BOX_CHARS, BOX_CHARS_TEXT, BOX_PRESETS, BUILT_IN_THEMES, type BarDisplayStyle, type BlockInfo, type BlockSegmentConfig, type BoxChars, type BudgetConfig, type BudgetItemConfig, type ClaudeHookData, type ColorTheme, type ContextInfo, type ContextSegmentConfig, DEFAULT_CONFIG, DIVIDER, type DirectorySegmentConfig, type DisplayConfig, EMPTY_CELL, ESC, type EnvSegmentConfig, type GitInfo, type GitSegmentConfig, type GridCell, type GridResult, type JustifyValue, LATE_RESOLVE_SEGMENTS, type LayoutMode, type LineConfig, type MetricsInfo, type MetricsSegmentConfig, type PowerlineColors, type PowerlineConfig, type PowerlineSymbols, RESET_CODE, type RenderCtx, SEGMENT_PARTS, SYMBOLS, type SegmentColor, type SegmentConfig, type SegmentData, type SegmentName, SegmentRenderer, type SegmentTemplate, type SessionIdSegmentConfig, type SessionInfo, type SymbolSet, TEXT_SYMBOLS, type TodayInfo, type TodaySegmentConfig, type TokenBreakdown, type TuiData, type TuiFooterConfig, type TuiGridBreakpoint, type TuiGridConfig, type TuiPanelOptions, type TuiTitleConfig, type UsageInfo, type UsageSegmentConfig, VALID_SEGMENT_NAMES, type VersionSegmentConfig, type WeeklySegmentConfig, abbreviateFishStyle, bottomBorder, buildBlockBar, buildContextBar, buildContextLine, buildTitleBar, buildWeeklyBar, calculateColumnWidths, collapseHome, collectActivityParts, collectFooterParts, collectMetricSegments, collectWorkspaceParts, colorize, composeTemplate, contentRow, cullMatrix, darkAnsi256Theme, darkAnsiTheme, darkTheme, divider, extractBgToFg, formatBurnRate, formatCost, formatDuration, formatLongTimeRemaining, formatModelName, formatResponseTime, formatTimeRemaining, formatTimeSince, formatTokenBreakdown, formatTokenCount, formatTokens, getBudgetStatus, getTheme, gruvboxAnsi256Theme, gruvboxAnsiTheme, gruvboxTheme, hexColorDistance, hexTo256Ansi, hexToAnsi, hexToBasicAnsi, isValidSegmentRef, lightAnsi256Theme, lightAnsiTheme, lightTheme, minutesUntilReset, nordAnsi256Theme, nordAnsiTheme, nordTheme, padCenter, padLeft, padRight, parseAreas, renderGrid, renderMediumBottom, renderMediumMetrics, renderNarrowBottom, renderNarrowMetrics, renderTuiPanel, renderWideBottom, renderWideMetrics, resolveSegments, resolveTitleToken, rosePineAnsi256Theme, rosePineAnsiTheme, rosePineTheme, selectBreakpoint, solveFitContentLayout, spreadEven, spreadTwo, stripAnsi, tokyoNightAnsi256Theme, tokyoNightAnsiTheme, tokyoNightTheme, truncateAnsi, visibleLength };
|
|
755
|
+
export { type AgentSegmentConfig, type AlignValue, type AnySegmentConfig, BOX_CHARS, BOX_CHARS_TEXT, BOX_PRESETS, BUILT_IN_THEMES, type BarDisplayStyle, type BlockInfo, type BlockSegmentConfig, type BoxChars, type BudgetConfig, type BudgetItemConfig, type CacheTimerInfo, type CacheTimerSegmentConfig, type ClaudeHookData, type ColorTheme, type ContextInfo, type ContextSegmentConfig, DEFAULT_CONFIG, DIVIDER, type DirectorySegmentConfig, type DisplayConfig, EMPTY_CELL, ESC, type EnvSegmentConfig, type GitInfo, type GitSegmentConfig, type GridCell, type GridResult, type JustifyValue, LATE_RESOLVE_SEGMENTS, type LayoutMode, type LineConfig, type MetricsInfo, type MetricsSegmentConfig, type PowerlineColors, type PowerlineConfig, type PowerlineSymbols, RESET_CODE, type RenderCtx, SEGMENT_PARTS, SYMBOLS, type SegmentColor, type SegmentConfig, type SegmentData, type SegmentName, SegmentRenderer, type SegmentTemplate, type SessionIdSegmentConfig, type SessionInfo, type SymbolSet, TEXT_SYMBOLS, type ThinkingSegmentConfig, type TodayInfo, type TodaySegmentConfig, type TokenBreakdown, type TuiData, type TuiFooterConfig, type TuiGridBreakpoint, type TuiGridConfig, type TuiPanelOptions, type TuiTitleConfig, type UsageInfo, type UsageSegmentConfig, VALID_SEGMENT_NAMES, type VersionSegmentConfig, type WeeklySegmentConfig, abbreviateFishStyle, bottomBorder, buildBlockBar, buildContextBar, buildContextLine, buildTitleBar, buildWeeklyBar, calculateColumnWidths, collapseHome, collectActivityParts, collectFooterParts, collectMetricSegments, collectWorkspaceParts, colorize, composeTemplate, contentRow, cullMatrix, darkAnsi256Theme, darkAnsiTheme, darkTheme, divider, extractBgToFg, formatBurnRate, formatCacheTimerElapsed, formatCost, formatDuration, formatLongTimeRemaining, formatModelName, formatResponseTime, formatTimeRemaining, formatTimeSince, formatTokenBreakdown, formatTokenCount, formatTokens, getBudgetStatus, getTheme, gruvboxAnsi256Theme, gruvboxAnsiTheme, gruvboxTheme, hexColorDistance, hexTo256Ansi, hexToAnsi, hexToBasicAnsi, isValidSegmentRef, lightAnsi256Theme, lightAnsiTheme, lightTheme, minutesUntilReset, nordAnsi256Theme, nordAnsiTheme, nordTheme, padCenter, padLeft, padRight, parseAreas, renderGrid, renderMediumBottom, renderMediumMetrics, renderNarrowBottom, renderNarrowMetrics, renderTuiPanel, renderWideBottom, renderWideMetrics, resolveSegments, resolveTitleToken, rosePineAnsi256Theme, rosePineAnsiTheme, rosePineTheme, selectBreakpoint, solveFitContentLayout, spreadEven, spreadTwo, stripAnsi, tokyoNightAnsi256Theme, tokyoNightAnsiTheme, tokyoNightTheme, truncateAnsi, visibleLength };
|