@owloops/claude-powerline 1.25.2 → 1.27.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 +124 -3
- package/dist/browser.d.ts +96 -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 +10 -2
- package/src/config/loader.ts +9 -0
- package/src/powerline.ts +148 -5
- package/src/segments/cacheTimer.ts +108 -0
- package/src/segments/index.ts +5 -0
- package/src/segments/renderer.ts +213 -60
- 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 +15 -0
- package/src/utils/icon-visibility.ts +31 -0
package/README.md
CHANGED
|
@@ -140,6 +140,8 @@ export CLAUDE_POWERLINE_DEBUG=1 # Enable debug logging
|
|
|
140
140
|
- `fish`: Fish-shell style abbreviation (e.g., `~/p/claude-powerline`)
|
|
141
141
|
- `basename`: Show only folder name (e.g., `claude-powerline`)
|
|
142
142
|
|
|
143
|
+
In `--worktree` sessions, the directory segment automatically shows the original repo path instead of the worktree folder (no config required).
|
|
144
|
+
|
|
143
145
|
</details>
|
|
144
146
|
|
|
145
147
|
<details>
|
|
@@ -205,6 +207,7 @@ export CLAUDE_POWERLINE_DEBUG=1 # Enable debug logging
|
|
|
205
207
|
|
|
206
208
|
- `type`: Display format - `cost` | `tokens` | `both` | `breakdown`
|
|
207
209
|
- `costSource`: Cost calculation method - `calculated` (ccusage-style) | `official` (hook data)
|
|
210
|
+
- `showUnits`: Show the trailing `tokens` unit when `type` is `tokens` or `both` (default: `true`). Set to `false` to render `§ 4.4M` instead of `§ 4.4M tokens`. Only applies to the powerline/capsule/minimal styles; the `tui` style already renders tokens without a suffix
|
|
208
211
|
|
|
209
212
|
**Symbols:** `§` Session (unicode) • `S` Session (text)
|
|
210
213
|
|
|
@@ -216,13 +219,14 @@ export CLAUDE_POWERLINE_DEBUG=1 # Enable debug logging
|
|
|
216
219
|
```json
|
|
217
220
|
"today": {
|
|
218
221
|
"enabled": true,
|
|
219
|
-
"type": "
|
|
222
|
+
"type": "both"
|
|
220
223
|
}
|
|
221
224
|
```
|
|
222
225
|
|
|
223
226
|
**Options:**
|
|
224
227
|
|
|
225
228
|
- `type`: Display format - `cost` | `tokens` | `both` | `breakdown`
|
|
229
|
+
- `showUnits`: Show the trailing `tokens` unit when `type` is `tokens` or `both` (default: `true`). Set to `false` to render `☉ $12.34 (4.4M)` instead of `☉ $12.34 (4.4M tokens)`. Only applies to the powerline/capsule/minimal styles; the `tui` style already renders tokens without a suffix
|
|
226
230
|
|
|
227
231
|
**Symbols:** `☉` Today (unicode) • `D` Today (text)
|
|
228
232
|
|
|
@@ -388,6 +392,93 @@ Only visible when Claude Code provides native `rate_limits.seven_day` data (Clau
|
|
|
388
392
|
|
|
389
393
|
</details>
|
|
390
394
|
|
|
395
|
+
<details>
|
|
396
|
+
<summary><strong>Agent</strong> - Shows active subagent name when Claude Code is invoked with <code>--agent</code> (hidden otherwise)</summary>
|
|
397
|
+
|
|
398
|
+
```json
|
|
399
|
+
"agent": {
|
|
400
|
+
"enabled": true,
|
|
401
|
+
"showLabel": false
|
|
402
|
+
}
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
**Display:** `◇ researcher` (or `◇ agent: researcher` with `showLabel: true`)
|
|
406
|
+
|
|
407
|
+
**Symbols:** `◇` Agent (unicode) • `&` Agent (text)
|
|
408
|
+
|
|
409
|
+
</details>
|
|
410
|
+
|
|
411
|
+
<details>
|
|
412
|
+
<summary><strong>Thinking</strong> - Shows extended-thinking on/off state and/or reasoning effort level when provided by Claude Code</summary>
|
|
413
|
+
|
|
414
|
+
```json
|
|
415
|
+
"thinking": {
|
|
416
|
+
"enabled": true,
|
|
417
|
+
"showEnabled": true,
|
|
418
|
+
"showEffort": true
|
|
419
|
+
}
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
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.
|
|
423
|
+
|
|
424
|
+
**Display:** `✦ On · xhigh` (both shown) • `✦ On` (enabled only) • `✦ xhigh` (effort only)
|
|
425
|
+
|
|
426
|
+
**Symbols:** `✦` Thinking (unicode) • `T` Thinking (text)
|
|
427
|
+
|
|
428
|
+
</details>
|
|
429
|
+
|
|
430
|
+
<details>
|
|
431
|
+
<summary><strong>Cache Timer</strong> - Shows time since last turn, tracking Claude's 5-minute prompt cache TTL</summary>
|
|
432
|
+
|
|
433
|
+
Opt-in (`enabled: false` by default).
|
|
434
|
+
|
|
435
|
+
```json
|
|
436
|
+
"cacheTimer": {
|
|
437
|
+
"enabled": true
|
|
438
|
+
}
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
**Display:** `◴ 3:42` (m:ss under 5m) • `◴ 17m` (5–59m) • `◴ 1h+` (1 hour or more)
|
|
442
|
+
|
|
443
|
+
**Color tiers:** healthy green (0–3m) → yellow warn (3–5m) → red critical (5m+). Hidden when `transcript_path` is unavailable.
|
|
444
|
+
|
|
445
|
+
**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.
|
|
446
|
+
|
|
447
|
+
**Display modes:** `displayMode: "elapsed"` (default) shows time-since-last-turn as above. `displayMode: "remaining"` flips it to a countdown of the cache TTL — useful when you care about *how long until cold* rather than *how stale* (matches the Codex CLI status line):
|
|
448
|
+
|
|
449
|
+
```json
|
|
450
|
+
"cacheTimer": {
|
|
451
|
+
"enabled": true,
|
|
452
|
+
"displayMode": "remaining"
|
|
453
|
+
}
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
In remaining mode the display reads `◴ 59:51` while warm and `◴ cold` once expired; color tiers invert (warn under 5m left, critical under 1m left or cold).
|
|
457
|
+
|
|
458
|
+
**TTL detection:** the segment auto-detects which cache window Claude Code is using by reading the last assistant message's `usage.cache_creation` block. `ephemeral_1h_input_tokens > 0` ⇒ 1h TTL; `ephemeral_5m_input_tokens > 0` ⇒ 5-minute TTL. Falls back to 3600 if no usage data is available yet (e.g. the very first turn). Set `ttlSeconds` explicitly to override:
|
|
459
|
+
|
|
460
|
+
```json
|
|
461
|
+
"cacheTimer": { "enabled": true, "displayMode": "remaining", "ttlSeconds": 300 }
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
**TUI:** also available in grid templates via `{cacheTimer}`, `{cacheTimer.icon}`, and `{cacheTimer.value}`.
|
|
465
|
+
|
|
466
|
+
**Symbols:** `◴` Cache timer (unicode) • `C!` Cache timer (text)
|
|
467
|
+
|
|
468
|
+
> **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:
|
|
469
|
+
> ```json
|
|
470
|
+
> {
|
|
471
|
+
> "statusLine": {
|
|
472
|
+
> "type": "command",
|
|
473
|
+
> "command": "npx -y @owloops/claude-powerline@latest",
|
|
474
|
+
> "refreshInterval": 10
|
|
475
|
+
> }
|
|
476
|
+
> }
|
|
477
|
+
> ```
|
|
478
|
+
> `refreshInterval` is in seconds (min 1). `10` keeps the displayed value within ~10s of reality.
|
|
479
|
+
|
|
480
|
+
</details>
|
|
481
|
+
|
|
391
482
|
<details>
|
|
392
483
|
<summary><strong>Tmux</strong> - Shows tmux session name and window info when in tmux</summary>
|
|
393
484
|
|
|
@@ -461,9 +552,25 @@ Hidden when the variable is unset or empty.
|
|
|
461
552
|
- `amount`: Budget limit (required for percentage display)
|
|
462
553
|
- `type`: Budget type - `cost` (USD) | `tokens` (for token-based limits)
|
|
463
554
|
- `warningThreshold`: Warning threshold percentage (default: 80)
|
|
555
|
+
- `showPercentage`: Show the `N%` suffix (default: `true`)
|
|
556
|
+
- `showValue`: Show the base cost/token value (default: `true`)
|
|
464
557
|
|
|
465
558
|
**Indicators:** `25%` Normal • `+75%` Moderate (50-79%) • `!85%` Warning (80%+)
|
|
466
559
|
|
|
560
|
+
**Display toggles.** For `session` and `today`, you can hide the percentage suffix, the base value, or both:
|
|
561
|
+
|
|
562
|
+
```json
|
|
563
|
+
"budget": {
|
|
564
|
+
"today": { "amount": 50, "showPercentage": false }
|
|
565
|
+
}
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
- `showPercentage: false` hides the `N%` suffix while keeping the budget configured (e.g. for warning thresholds).
|
|
569
|
+
- `showValue: false` renders only the percentage (e.g. `◱ 15%`).
|
|
570
|
+
- Both `false` hides the segment entirely.
|
|
571
|
+
|
|
572
|
+
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.
|
|
573
|
+
|
|
467
574
|
> [!TIP]
|
|
468
575
|
> 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.
|
|
469
576
|
|
|
@@ -548,6 +655,18 @@ Segments flow naturally and wrap to new lines when they exceed the terminal widt
|
|
|
548
655
|
|
|
549
656
|
Set to `0` for compact, `1` (default) for standard spacing.
|
|
550
657
|
|
|
658
|
+
**Show Icons** - hide the leading emblem on each segment for a text-only look:
|
|
659
|
+
|
|
660
|
+
```json
|
|
661
|
+
{
|
|
662
|
+
"display": {
|
|
663
|
+
"showIcons": false
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
```
|
|
667
|
+
|
|
668
|
+
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.
|
|
669
|
+
|
|
551
670
|
> [!NOTE]
|
|
552
671
|
> Claude Code system messages may truncate long status lines. Use `autoWrap` or manual multi-line layouts to prevent segment cutoff.
|
|
553
672
|
|
|
@@ -574,7 +693,7 @@ Create custom themes and configure color compatibility:
|
|
|
574
693
|
}
|
|
575
694
|
```
|
|
576
695
|
|
|
577
|
-
**Color Options:** `bg` (hex, `transparent`, `none`) • `fg` (hex)
|
|
696
|
+
**Color Options:** `bg` (hex, `transparent`, `none`) • `fg` (hex) • `bold` (boolean, optional, defaults to `false`)
|
|
578
697
|
|
|
579
698
|
**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:
|
|
580
699
|
|
|
@@ -736,7 +855,7 @@ Use bare segment names to render the full pre-formatted segment:
|
|
|
736
855
|
```
|
|
737
856
|
context block session today weekly
|
|
738
857
|
git dir version tmux metrics
|
|
739
|
-
activity env
|
|
858
|
+
activity env agent
|
|
740
859
|
```
|
|
741
860
|
|
|
742
861
|
#### Dot-Notation Subsegments
|
|
@@ -757,6 +876,8 @@ Use `segment.part` to place individual pieces of a segment into separate cells w
|
|
|
757
876
|
| `tmux` | `label`, `value` |
|
|
758
877
|
| `dir` | `value` |
|
|
759
878
|
| `env` | `prefix`, `value` |
|
|
879
|
+
| `agent` | `icon`, `name` |
|
|
880
|
+
| `thinking` | `icon`, `enabled`, `effort` |
|
|
760
881
|
|
|
761
882
|
Example, block segment with a progress bar, mirroring the context layout:
|
|
762
883
|
|
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,12 @@ 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
|
+
detectedTtlSeconds?: number;
|
|
257
|
+
}
|
|
258
|
+
//#endregion
|
|
210
259
|
//#region src/utils/constants.d.ts
|
|
211
260
|
declare const RESET_CODE = "\u001B[0m";
|
|
212
261
|
declare const SYMBOLS: {
|
|
@@ -245,6 +294,9 @@ declare const SYMBOLS: {
|
|
|
245
294
|
readonly weekly_cost: "◑";
|
|
246
295
|
readonly dir: "📁";
|
|
247
296
|
readonly activity: "⚡";
|
|
297
|
+
readonly agent: "◇";
|
|
298
|
+
readonly thinking: "✦";
|
|
299
|
+
readonly cache_timer: "◴";
|
|
248
300
|
};
|
|
249
301
|
declare const BOX_CHARS: {
|
|
250
302
|
readonly topLeft: "╭";
|
|
@@ -303,6 +355,9 @@ declare const TEXT_SYMBOLS: {
|
|
|
303
355
|
readonly weekly_cost: "W";
|
|
304
356
|
readonly dir: "D";
|
|
305
357
|
readonly activity: "A";
|
|
358
|
+
readonly agent: "&";
|
|
359
|
+
readonly thinking: "T";
|
|
360
|
+
readonly cache_timer: "C!";
|
|
306
361
|
};
|
|
307
362
|
//#endregion
|
|
308
363
|
//#region src/tui/types.d.ts
|
|
@@ -324,12 +379,13 @@ interface TuiData {
|
|
|
324
379
|
contextInfo: ContextInfo | null;
|
|
325
380
|
metricsInfo: MetricsInfo | null;
|
|
326
381
|
gitInfo: GitInfo | null;
|
|
382
|
+
cacheTimerInfo: CacheTimerInfo | null;
|
|
327
383
|
tmuxSessionId: string | null;
|
|
328
384
|
colors: PowerlineColors;
|
|
329
385
|
}
|
|
330
386
|
type SymbolSet = typeof SYMBOLS | typeof TEXT_SYMBOLS;
|
|
331
387
|
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"];
|
|
388
|
+
declare const SEGMENT_NAME_LIST: readonly ["context", "block", "session", "today", "weekly", "git", "dir", "model", "version", "tmux", "metrics", "activity", "env", "agent", "thinking", "cacheTimer"];
|
|
333
389
|
type SegmentName = (typeof SEGMENT_NAME_LIST)[number];
|
|
334
390
|
declare const VALID_SEGMENT_NAMES: ReadonlySet<string>;
|
|
335
391
|
declare const SEGMENT_PARTS: Record<SegmentName, readonly string[]>;
|
|
@@ -394,6 +450,7 @@ interface RenderCtx {
|
|
|
394
450
|
//#region src/segments/renderer.d.ts
|
|
395
451
|
interface SegmentConfig {
|
|
396
452
|
enabled: boolean;
|
|
453
|
+
showIcon?: boolean;
|
|
397
454
|
}
|
|
398
455
|
interface DirectorySegmentConfig extends SegmentConfig {
|
|
399
456
|
showBasename?: boolean;
|
|
@@ -413,6 +470,8 @@ interface GitSegmentConfig extends SegmentConfig {
|
|
|
413
470
|
interface UsageSegmentConfig extends SegmentConfig {
|
|
414
471
|
type: "cost" | "tokens" | "both" | "breakdown";
|
|
415
472
|
costSource?: "calculated" | "official";
|
|
473
|
+
/** Show the trailing "tokens" unit on token counts. Only affects `type: "tokens"` and `type: "both"` (default: true). Inert in the `tui` display style, which never renders the suffix. */
|
|
474
|
+
showUnits?: boolean;
|
|
416
475
|
}
|
|
417
476
|
interface TmuxSegmentConfig extends SegmentConfig {}
|
|
418
477
|
type BarDisplayStyle = "text" | "ball" | "bar" | "blocks" | "blocks-line" | "capped" | "dots" | "filled" | "geometric" | "line" | "squares";
|
|
@@ -437,6 +496,8 @@ interface BlockSegmentConfig extends SegmentConfig {
|
|
|
437
496
|
}
|
|
438
497
|
interface TodaySegmentConfig extends SegmentConfig {
|
|
439
498
|
type: "cost" | "tokens" | "both" | "breakdown";
|
|
499
|
+
/** Show the trailing "tokens" unit on token counts. Only affects `type: "tokens"` and `type: "both"` (default: true). Inert in the `tui` display style, which never renders the suffix. */
|
|
500
|
+
showUnits?: boolean;
|
|
440
501
|
}
|
|
441
502
|
interface VersionSegmentConfig extends SegmentConfig {}
|
|
442
503
|
interface SessionIdSegmentConfig extends SegmentConfig {
|
|
@@ -449,7 +510,18 @@ interface EnvSegmentConfig extends SegmentConfig {
|
|
|
449
510
|
interface WeeklySegmentConfig extends SegmentConfig {
|
|
450
511
|
displayStyle?: BarDisplayStyle;
|
|
451
512
|
}
|
|
452
|
-
|
|
513
|
+
interface AgentSegmentConfig extends SegmentConfig {
|
|
514
|
+
showLabel?: boolean;
|
|
515
|
+
}
|
|
516
|
+
interface ThinkingSegmentConfig extends SegmentConfig {
|
|
517
|
+
showEnabled?: boolean;
|
|
518
|
+
showEffort?: boolean;
|
|
519
|
+
}
|
|
520
|
+
interface CacheTimerSegmentConfig extends SegmentConfig {
|
|
521
|
+
displayMode?: "elapsed" | "remaining";
|
|
522
|
+
ttlSeconds?: number;
|
|
523
|
+
}
|
|
524
|
+
type AnySegmentConfig = SegmentConfig | DirectorySegmentConfig | GitSegmentConfig | UsageSegmentConfig | TmuxSegmentConfig | ContextSegmentConfig | MetricsSegmentConfig | BlockSegmentConfig | TodaySegmentConfig | VersionSegmentConfig | SessionIdSegmentConfig | EnvSegmentConfig | WeeklySegmentConfig | AgentSegmentConfig | ThinkingSegmentConfig | CacheTimerSegmentConfig;
|
|
453
525
|
interface PowerlineSymbols {
|
|
454
526
|
right: string;
|
|
455
527
|
left: string;
|
|
@@ -483,20 +555,25 @@ interface PowerlineSymbols {
|
|
|
483
555
|
env: string;
|
|
484
556
|
session_id: string;
|
|
485
557
|
weekly_cost: string;
|
|
558
|
+
agent: string;
|
|
559
|
+
thinking: string;
|
|
560
|
+
cache_timer: string;
|
|
486
561
|
}
|
|
487
562
|
interface SegmentData {
|
|
488
563
|
text: string;
|
|
489
564
|
bgColor: string;
|
|
490
565
|
fgColor: string;
|
|
566
|
+
bold?: boolean;
|
|
491
567
|
}
|
|
492
568
|
declare class SegmentRenderer {
|
|
493
569
|
private readonly config;
|
|
494
570
|
private readonly symbols;
|
|
495
571
|
constructor(config: PowerlineConfig, symbols: PowerlineSymbols);
|
|
572
|
+
private leadingIcon;
|
|
496
573
|
renderDirectory(hookData: ClaudeHookData, colors: PowerlineColors, config?: DirectorySegmentConfig): SegmentData;
|
|
497
574
|
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;
|
|
575
|
+
renderModel(hookData: ClaudeHookData, colors: PowerlineColors, config?: SegmentConfig): SegmentData;
|
|
576
|
+
renderSession(usageInfo: UsageInfo, colors: PowerlineColors, config?: UsageSegmentConfig): SegmentData | null;
|
|
500
577
|
renderSessionId(sessionId: string, colors: PowerlineColors, config?: SessionIdSegmentConfig): SegmentData;
|
|
501
578
|
renderTmux(sessionId: string | null, colors: PowerlineColors): SegmentData | null;
|
|
502
579
|
renderContext(contextInfo: ContextInfo | null, colors: PowerlineColors, config?: ContextSegmentConfig): SegmentData | null;
|
|
@@ -506,12 +583,15 @@ declare class SegmentRenderer {
|
|
|
506
583
|
renderMetrics(metricsInfo: MetricsInfo | null, colors: PowerlineColors, config?: MetricsSegmentConfig): SegmentData | null;
|
|
507
584
|
renderBlock(blockInfo: BlockInfo, colors: PowerlineColors, config?: BlockSegmentConfig): SegmentData;
|
|
508
585
|
renderWeekly(hookData: ClaudeHookData, colors: PowerlineColors, config?: WeeklySegmentConfig): SegmentData | null;
|
|
509
|
-
renderToday(todayInfo: TodayInfo, colors: PowerlineColors,
|
|
586
|
+
renderToday(todayInfo: TodayInfo, colors: PowerlineColors, configOrType?: TodaySegmentConfig | string): SegmentData | null;
|
|
510
587
|
private getDisplayDirectoryName;
|
|
511
588
|
private formatUsageDisplay;
|
|
512
589
|
private formatUsageWithBudget;
|
|
513
|
-
renderVersion(hookData: ClaudeHookData, colors: PowerlineColors,
|
|
590
|
+
renderVersion(hookData: ClaudeHookData, colors: PowerlineColors, config?: VersionSegmentConfig): SegmentData | null;
|
|
514
591
|
renderEnv(colors: PowerlineColors, config: EnvSegmentConfig): SegmentData | null;
|
|
592
|
+
renderAgent(hookData: ClaudeHookData, colors: PowerlineColors, config?: AgentSegmentConfig): SegmentData | null;
|
|
593
|
+
renderThinking(hookData: ClaudeHookData, colors: PowerlineColors, config?: ThinkingSegmentConfig): SegmentData | null;
|
|
594
|
+
renderCacheTimer(info: CacheTimerInfo, colors: PowerlineColors, config?: CacheTimerSegmentConfig): SegmentData;
|
|
515
595
|
}
|
|
516
596
|
//#endregion
|
|
517
597
|
//#region src/config/loader.d.ts
|
|
@@ -530,6 +610,9 @@ interface LineConfig {
|
|
|
530
610
|
sessionId?: SessionIdSegmentConfig;
|
|
531
611
|
env?: EnvSegmentConfig;
|
|
532
612
|
weekly?: WeeklySegmentConfig;
|
|
613
|
+
agent?: AgentSegmentConfig;
|
|
614
|
+
thinking?: ThinkingSegmentConfig;
|
|
615
|
+
cacheTimer?: CacheTimerSegmentConfig;
|
|
533
616
|
};
|
|
534
617
|
}
|
|
535
618
|
interface DisplayConfig {
|
|
@@ -539,12 +622,15 @@ interface DisplayConfig {
|
|
|
539
622
|
colorCompatibility?: "auto" | "ansi" | "ansi256" | "truecolor";
|
|
540
623
|
autoWrap?: boolean;
|
|
541
624
|
padding?: number;
|
|
625
|
+
showIcons?: boolean;
|
|
542
626
|
tui?: TuiGridConfig;
|
|
543
627
|
}
|
|
544
628
|
interface BudgetItemConfig {
|
|
545
629
|
amount?: number;
|
|
546
630
|
warningThreshold?: number;
|
|
547
631
|
type?: "cost" | "tokens";
|
|
632
|
+
showPercentage?: boolean;
|
|
633
|
+
showValue?: boolean;
|
|
548
634
|
}
|
|
549
635
|
interface BudgetConfig {
|
|
550
636
|
session?: BudgetItemConfig;
|
|
@@ -600,6 +686,7 @@ declare function collapseHome(dirPath: string, homeDir?: string): string;
|
|
|
600
686
|
declare function formatTimeRemaining(totalMinutes: number): string;
|
|
601
687
|
declare function formatLongTimeRemaining(totalMinutes: number): string;
|
|
602
688
|
declare function minutesUntilReset(epochSeconds: number): number;
|
|
689
|
+
declare function formatCacheTimerElapsed(seconds: number): string;
|
|
603
690
|
//#endregion
|
|
604
691
|
//#region src/utils/budget.d.ts
|
|
605
692
|
interface BudgetStatus {
|
|
@@ -610,7 +697,7 @@ interface BudgetStatus {
|
|
|
610
697
|
declare function getBudgetStatus(cost: number, budget: number | undefined, warningThreshold?: number): BudgetStatus;
|
|
611
698
|
//#endregion
|
|
612
699
|
//#region src/tui/primitives.d.ts
|
|
613
|
-
declare function colorize(text: string, fgColor: string, reset: string): string;
|
|
700
|
+
declare function colorize(text: string, fgColor: string, reset: string, bold?: boolean): string;
|
|
614
701
|
declare function padRight(text: string, width: number): string;
|
|
615
702
|
declare function padLeft(text: string, width: number): string;
|
|
616
703
|
declare function padCenter(text: string, width: number): string;
|
|
@@ -630,7 +717,7 @@ declare function buildWeeklyBar(data: TuiData, barWidth: number, sym: SymbolSet,
|
|
|
630
717
|
declare function buildContextLine(data: TuiData, contentWidth: number, sym: SymbolSet, reset: string, colors: PowerlineColors): string | null;
|
|
631
718
|
declare function collectMetricSegments(data: TuiData, sym: SymbolSet, config: PowerlineConfig, reset: string, colors: PowerlineColors): string[];
|
|
632
719
|
declare function collectActivityParts(data: TuiData, sym: SymbolSet): string[];
|
|
633
|
-
declare function collectWorkspaceParts(data: TuiData, sym: SymbolSet, reset: string, colors: PowerlineColors): string[];
|
|
720
|
+
declare function collectWorkspaceParts(data: TuiData, sym: SymbolSet, reset: string, colors: PowerlineColors, config: PowerlineConfig): string[];
|
|
634
721
|
declare function collectFooterParts(data: TuiData, sym: SymbolSet, config: PowerlineConfig, reset: string, colors: PowerlineColors): string[];
|
|
635
722
|
interface ResolvedTemplate {
|
|
636
723
|
items: string[];
|
|
@@ -673,4 +760,4 @@ declare function renderGrid(gridConfig: TuiGridConfig, resolvedData: Record<stri
|
|
|
673
760
|
//#region src/config/defaults.d.ts
|
|
674
761
|
declare const DEFAULT_CONFIG: PowerlineConfig;
|
|
675
762
|
//#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 };
|
|
763
|
+
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 };
|