@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/src/segments/renderer.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { ClaudeHookData } from "../utils/claude";
|
|
2
|
+
import { getEffortLevel, getThinkingEnabled } from "../utils/claude";
|
|
2
3
|
import type { PowerlineColors } from "../themes";
|
|
3
4
|
import type { PowerlineConfig } from "../config/loader";
|
|
4
5
|
import type { BlockInfo } from "./block";
|
|
6
|
+
import type { CacheTimerInfo } from "./cacheTimer";
|
|
5
7
|
import type {
|
|
6
8
|
UsageInfo,
|
|
7
9
|
TokenBreakdown,
|
|
@@ -20,13 +22,17 @@ import {
|
|
|
20
22
|
formatTimeSince,
|
|
21
23
|
formatDuration,
|
|
22
24
|
formatLongTimeRemaining,
|
|
25
|
+
formatCacheTimerElapsed,
|
|
23
26
|
collapseHome,
|
|
24
27
|
minutesUntilReset,
|
|
25
28
|
} from "../utils/formatters";
|
|
26
|
-
import {
|
|
29
|
+
import { resolveBudgetDisplay } from "../utils/budget";
|
|
30
|
+
import type { BudgetItemConfig } from "../config/loader";
|
|
31
|
+
import { shouldShowIcon } from "../utils/icon-visibility";
|
|
27
32
|
|
|
28
33
|
export interface SegmentConfig {
|
|
29
34
|
enabled: boolean;
|
|
35
|
+
showIcon?: boolean;
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
export interface DirectorySegmentConfig extends SegmentConfig {
|
|
@@ -107,6 +113,17 @@ export interface WeeklySegmentConfig extends SegmentConfig {
|
|
|
107
113
|
displayStyle?: BarDisplayStyle;
|
|
108
114
|
}
|
|
109
115
|
|
|
116
|
+
export interface AgentSegmentConfig extends SegmentConfig {
|
|
117
|
+
showLabel?: boolean;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface ThinkingSegmentConfig extends SegmentConfig {
|
|
121
|
+
showEnabled?: boolean;
|
|
122
|
+
showEffort?: boolean;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface CacheTimerSegmentConfig extends SegmentConfig {}
|
|
126
|
+
|
|
110
127
|
export type AnySegmentConfig =
|
|
111
128
|
| SegmentConfig
|
|
112
129
|
| DirectorySegmentConfig
|
|
@@ -120,7 +137,10 @@ export type AnySegmentConfig =
|
|
|
120
137
|
| VersionSegmentConfig
|
|
121
138
|
| SessionIdSegmentConfig
|
|
122
139
|
| EnvSegmentConfig
|
|
123
|
-
| WeeklySegmentConfig
|
|
140
|
+
| WeeklySegmentConfig
|
|
141
|
+
| AgentSegmentConfig
|
|
142
|
+
| ThinkingSegmentConfig
|
|
143
|
+
| CacheTimerSegmentConfig;
|
|
124
144
|
|
|
125
145
|
export interface PowerlineSymbols {
|
|
126
146
|
right: string;
|
|
@@ -155,12 +175,16 @@ export interface PowerlineSymbols {
|
|
|
155
175
|
env: string;
|
|
156
176
|
session_id: string;
|
|
157
177
|
weekly_cost: string;
|
|
178
|
+
agent: string;
|
|
179
|
+
thinking: string;
|
|
180
|
+
cache_timer: string;
|
|
158
181
|
}
|
|
159
182
|
|
|
160
183
|
export interface SegmentData {
|
|
161
184
|
text: string;
|
|
162
185
|
bgColor: string;
|
|
163
186
|
fgColor: string;
|
|
187
|
+
bold?: boolean;
|
|
164
188
|
}
|
|
165
189
|
|
|
166
190
|
interface BarStyleDef {
|
|
@@ -188,13 +212,24 @@ export class SegmentRenderer {
|
|
|
188
212
|
private readonly symbols: PowerlineSymbols,
|
|
189
213
|
) {}
|
|
190
214
|
|
|
215
|
+
private leadingIcon(symbol: string, segConfig?: SegmentConfig): string {
|
|
216
|
+
const show = shouldShowIcon(
|
|
217
|
+
this.config.display?.showIcons,
|
|
218
|
+
segConfig?.showIcon,
|
|
219
|
+
);
|
|
220
|
+
return show ? `${symbol} ` : "";
|
|
221
|
+
}
|
|
222
|
+
|
|
191
223
|
renderDirectory(
|
|
192
224
|
hookData: ClaudeHookData,
|
|
193
225
|
colors: PowerlineColors,
|
|
194
226
|
config?: DirectorySegmentConfig,
|
|
195
227
|
): SegmentData {
|
|
196
|
-
const
|
|
197
|
-
const
|
|
228
|
+
const worktreeOriginalCwd = hookData.worktree?.original_cwd || undefined;
|
|
229
|
+
const currentDir =
|
|
230
|
+
worktreeOriginalCwd ??
|
|
231
|
+
(hookData.workspace?.current_dir || hookData.cwd || "/");
|
|
232
|
+
const projectDir = worktreeOriginalCwd ?? hookData.workspace?.project_dir;
|
|
198
233
|
|
|
199
234
|
const style = config?.style ?? (config?.showBasename ? "basename" : "full");
|
|
200
235
|
|
|
@@ -245,7 +280,15 @@ export class SegmentRenderer {
|
|
|
245
280
|
parts.push(`[${gitInfo.operation}]`);
|
|
246
281
|
}
|
|
247
282
|
|
|
248
|
-
|
|
283
|
+
const showBranchIcon = shouldShowIcon(
|
|
284
|
+
this.config.display?.showIcons,
|
|
285
|
+
config?.showIcon,
|
|
286
|
+
);
|
|
287
|
+
parts.push(
|
|
288
|
+
showBranchIcon
|
|
289
|
+
? `${this.symbols.branch} ${gitInfo.branch}`
|
|
290
|
+
: gitInfo.branch,
|
|
291
|
+
);
|
|
249
292
|
|
|
250
293
|
if (config?.showTag && gitInfo.tag) {
|
|
251
294
|
parts.push(`${this.symbols.git_tag} ${gitInfo.tag}`);
|
|
@@ -314,12 +357,16 @@ export class SegmentRenderer {
|
|
|
314
357
|
};
|
|
315
358
|
}
|
|
316
359
|
|
|
317
|
-
renderModel(
|
|
360
|
+
renderModel(
|
|
361
|
+
hookData: ClaudeHookData,
|
|
362
|
+
colors: PowerlineColors,
|
|
363
|
+
config?: SegmentConfig,
|
|
364
|
+
): SegmentData {
|
|
318
365
|
const rawName = hookData.model?.display_name || "Claude";
|
|
319
366
|
const modelName = formatModelName(rawName);
|
|
320
367
|
|
|
321
368
|
return {
|
|
322
|
-
text: `${this.symbols.model}
|
|
369
|
+
text: `${this.leadingIcon(this.symbols.model, config)}${modelName}`,
|
|
323
370
|
bgColor: colors.modelBg,
|
|
324
371
|
fgColor: colors.modelFg,
|
|
325
372
|
};
|
|
@@ -329,7 +376,7 @@ export class SegmentRenderer {
|
|
|
329
376
|
usageInfo: UsageInfo,
|
|
330
377
|
colors: PowerlineColors,
|
|
331
378
|
config?: UsageSegmentConfig,
|
|
332
|
-
): SegmentData {
|
|
379
|
+
): SegmentData | null {
|
|
333
380
|
const type = config?.type || "cost";
|
|
334
381
|
const costSource = config?.costSource;
|
|
335
382
|
const sessionBudget = this.config.budget?.session;
|
|
@@ -345,12 +392,12 @@ export class SegmentRenderer {
|
|
|
345
392
|
usageInfo.session.tokens,
|
|
346
393
|
usageInfo.session.tokenBreakdown,
|
|
347
394
|
type,
|
|
348
|
-
sessionBudget
|
|
349
|
-
sessionBudget?.warningThreshold || 80,
|
|
350
|
-
sessionBudget?.type,
|
|
395
|
+
sessionBudget,
|
|
351
396
|
);
|
|
352
397
|
|
|
353
|
-
|
|
398
|
+
if (formattedUsage === null) return null;
|
|
399
|
+
|
|
400
|
+
const text = `${this.leadingIcon(this.symbols.session_cost, config)}${formattedUsage}`;
|
|
354
401
|
|
|
355
402
|
return {
|
|
356
403
|
text,
|
|
@@ -366,7 +413,7 @@ export class SegmentRenderer {
|
|
|
366
413
|
): SegmentData {
|
|
367
414
|
const showLabel = config?.showIdLabel !== false;
|
|
368
415
|
const text = showLabel
|
|
369
|
-
? `${this.symbols.session_id}
|
|
416
|
+
? `${this.leadingIcon(this.symbols.session_id, config)}${sessionId}`
|
|
370
417
|
: sessionId;
|
|
371
418
|
|
|
372
419
|
return {
|
|
@@ -418,7 +465,7 @@ export class SegmentRenderer {
|
|
|
418
465
|
};
|
|
419
466
|
}
|
|
420
467
|
return {
|
|
421
|
-
text: `${this.symbols.context_time}
|
|
468
|
+
text: `${this.leadingIcon(this.symbols.context_time, config)}0 (${emptyPct})`,
|
|
422
469
|
bgColor: colors.contextBg,
|
|
423
470
|
fgColor: colors.contextFg,
|
|
424
471
|
};
|
|
@@ -426,13 +473,16 @@ export class SegmentRenderer {
|
|
|
426
473
|
|
|
427
474
|
let bgColor = colors.contextBg;
|
|
428
475
|
let fgColor = colors.contextFg;
|
|
476
|
+
let bold = colors.contextBold;
|
|
429
477
|
|
|
430
478
|
if (contextInfo.contextLeftPercentage <= 20) {
|
|
431
479
|
bgColor = colors.contextCriticalBg;
|
|
432
480
|
fgColor = colors.contextCriticalFg;
|
|
481
|
+
bold = colors.contextCriticalBold;
|
|
433
482
|
} else if (contextInfo.contextLeftPercentage <= 40) {
|
|
434
483
|
bgColor = colors.contextWarningBg;
|
|
435
484
|
fgColor = colors.contextWarningFg;
|
|
485
|
+
bold = colors.contextWarningBold;
|
|
436
486
|
}
|
|
437
487
|
|
|
438
488
|
const pct =
|
|
@@ -456,14 +506,15 @@ export class SegmentRenderer {
|
|
|
456
506
|
? `${bar} ${pct}%`
|
|
457
507
|
: `${bar} ${contextInfo.totalTokens.toLocaleString()} (${pct}%)`;
|
|
458
508
|
|
|
459
|
-
return { text, bgColor, fgColor };
|
|
509
|
+
return { text, bgColor, fgColor, bold };
|
|
460
510
|
}
|
|
461
511
|
|
|
512
|
+
const iconPrefix = this.leadingIcon(this.symbols.context_time, config);
|
|
462
513
|
const text = config?.showPercentageOnly
|
|
463
|
-
? `${
|
|
464
|
-
: `${
|
|
514
|
+
? `${iconPrefix}${pct}%`
|
|
515
|
+
: `${iconPrefix}${contextInfo.totalTokens.toLocaleString()} (${pct}%)`;
|
|
465
516
|
|
|
466
|
-
return { text, bgColor, fgColor };
|
|
517
|
+
return { text, bgColor, fgColor, bold };
|
|
467
518
|
}
|
|
468
519
|
|
|
469
520
|
private buildBar(
|
|
@@ -619,18 +670,22 @@ export class SegmentRenderer {
|
|
|
619
670
|
|
|
620
671
|
let bgColor = colors.blockBg;
|
|
621
672
|
let fgColor = colors.blockFg;
|
|
673
|
+
let bold = colors.blockBold;
|
|
622
674
|
if (pct >= warningThreshold) {
|
|
623
675
|
bgColor = colors.contextCriticalBg;
|
|
624
676
|
fgColor = colors.contextCriticalFg;
|
|
677
|
+
bold = colors.contextCriticalBold;
|
|
625
678
|
} else if (pct >= 50) {
|
|
626
679
|
bgColor = colors.contextWarningBg;
|
|
627
680
|
fgColor = colors.contextWarningFg;
|
|
681
|
+
bold = colors.contextWarningBold;
|
|
628
682
|
}
|
|
629
683
|
|
|
630
684
|
return {
|
|
631
|
-
text: `${this.symbols.block_cost}
|
|
685
|
+
text: `${this.leadingIcon(this.symbols.block_cost, config)}${this.formatPercentageWithBar(pct, config?.displayStyle, timeStr)}`,
|
|
632
686
|
bgColor,
|
|
633
687
|
fgColor,
|
|
688
|
+
bold,
|
|
634
689
|
};
|
|
635
690
|
}
|
|
636
691
|
|
|
@@ -649,36 +704,47 @@ export class SegmentRenderer {
|
|
|
649
704
|
|
|
650
705
|
let bgColor = colors.weeklyBg;
|
|
651
706
|
let fgColor = colors.weeklyFg;
|
|
707
|
+
let bold = colors.weeklyBold;
|
|
652
708
|
if (pct >= 80) {
|
|
653
709
|
bgColor = colors.contextCriticalBg;
|
|
654
710
|
fgColor = colors.contextCriticalFg;
|
|
711
|
+
bold = colors.contextCriticalBold;
|
|
655
712
|
} else if (pct >= 50) {
|
|
656
713
|
bgColor = colors.contextWarningBg;
|
|
657
714
|
fgColor = colors.contextWarningFg;
|
|
715
|
+
bold = colors.contextWarningBold;
|
|
658
716
|
}
|
|
659
717
|
|
|
660
718
|
return {
|
|
661
|
-
text: `${this.symbols.weekly_cost}
|
|
719
|
+
text: `${this.leadingIcon(this.symbols.weekly_cost, config)}${this.formatPercentageWithBar(pct, config?.displayStyle, timeStr)}`,
|
|
662
720
|
bgColor,
|
|
663
721
|
fgColor,
|
|
722
|
+
bold,
|
|
664
723
|
};
|
|
665
724
|
}
|
|
666
725
|
|
|
667
726
|
renderToday(
|
|
668
727
|
todayInfo: TodayInfo,
|
|
669
728
|
colors: PowerlineColors,
|
|
670
|
-
|
|
671
|
-
): SegmentData {
|
|
729
|
+
configOrType?: TodaySegmentConfig | string,
|
|
730
|
+
): SegmentData | null {
|
|
731
|
+
const config: TodaySegmentConfig | undefined =
|
|
732
|
+
typeof configOrType === "string"
|
|
733
|
+
? ({ enabled: true, type: configOrType } as TodaySegmentConfig)
|
|
734
|
+
: configOrType;
|
|
735
|
+
const type = config?.type ?? "cost";
|
|
672
736
|
const todayBudget = this.config.budget?.today;
|
|
673
|
-
const
|
|
737
|
+
const formattedUsage = this.formatUsageWithBudget(
|
|
674
738
|
todayInfo.cost,
|
|
675
739
|
todayInfo.tokens,
|
|
676
740
|
todayInfo.tokenBreakdown,
|
|
677
741
|
type,
|
|
678
|
-
todayBudget
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
)
|
|
742
|
+
todayBudget,
|
|
743
|
+
);
|
|
744
|
+
|
|
745
|
+
if (formattedUsage === null) return null;
|
|
746
|
+
|
|
747
|
+
const text = `${this.leadingIcon(this.symbols.today_cost, config)}${formattedUsage}`;
|
|
682
748
|
|
|
683
749
|
return {
|
|
684
750
|
text,
|
|
@@ -730,52 +796,34 @@ export class SegmentRenderer {
|
|
|
730
796
|
tokens: number | null,
|
|
731
797
|
tokenBreakdown: TokenBreakdown | null,
|
|
732
798
|
type: string,
|
|
733
|
-
budget
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
799
|
+
budget?: BudgetItemConfig,
|
|
800
|
+
): string | null {
|
|
801
|
+
const state = resolveBudgetDisplay(cost, tokens, budget);
|
|
802
|
+
if (state.suppressAll) return null;
|
|
803
|
+
if (!state.showBase) return state.percentText;
|
|
804
|
+
|
|
737
805
|
const baseDisplay = this.formatUsageDisplay(
|
|
738
806
|
cost,
|
|
739
807
|
tokens,
|
|
740
808
|
tokenBreakdown,
|
|
741
809
|
type,
|
|
742
810
|
);
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
if (budgetType === "tokens" && tokens !== null) {
|
|
748
|
-
budgetValue = tokens;
|
|
749
|
-
} else if (budgetType === "cost" && cost !== null) {
|
|
750
|
-
budgetValue = cost;
|
|
751
|
-
} else if (!budgetType && cost !== null) {
|
|
752
|
-
budgetValue = cost;
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
if (budgetValue !== null) {
|
|
756
|
-
const budgetStatus = getBudgetStatus(
|
|
757
|
-
budgetValue,
|
|
758
|
-
budget,
|
|
759
|
-
warningThreshold,
|
|
760
|
-
);
|
|
761
|
-
return baseDisplay + budgetStatus.displayText;
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
return baseDisplay;
|
|
811
|
+
return state.percentText
|
|
812
|
+
? `${baseDisplay} ${state.percentText}`
|
|
813
|
+
: baseDisplay;
|
|
766
814
|
}
|
|
767
815
|
|
|
768
816
|
renderVersion(
|
|
769
817
|
hookData: ClaudeHookData,
|
|
770
818
|
colors: PowerlineColors,
|
|
771
|
-
|
|
819
|
+
config?: VersionSegmentConfig,
|
|
772
820
|
): SegmentData | null {
|
|
773
821
|
if (!hookData.version) {
|
|
774
822
|
return null;
|
|
775
823
|
}
|
|
776
824
|
|
|
777
825
|
return {
|
|
778
|
-
text: `${this.symbols.version}
|
|
826
|
+
text: `${this.leadingIcon(this.symbols.version, config)}v${hookData.version}`,
|
|
779
827
|
bgColor: colors.versionBg,
|
|
780
828
|
fgColor: colors.versionFg,
|
|
781
829
|
};
|
|
@@ -788,9 +836,80 @@ export class SegmentRenderer {
|
|
|
788
836
|
const value = globalThis.process?.env?.[config.variable];
|
|
789
837
|
if (!value) return null;
|
|
790
838
|
const prefix = config.prefix ?? config.variable;
|
|
839
|
+
const iconPrefix = this.leadingIcon(this.symbols.env, config);
|
|
791
840
|
const text = prefix
|
|
792
|
-
? `${
|
|
793
|
-
: `${
|
|
841
|
+
? `${iconPrefix}${prefix}: ${value}`
|
|
842
|
+
: `${iconPrefix}${value}`;
|
|
794
843
|
return { text, bgColor: colors.envBg, fgColor: colors.envFg };
|
|
795
844
|
}
|
|
845
|
+
|
|
846
|
+
renderAgent(
|
|
847
|
+
hookData: ClaudeHookData,
|
|
848
|
+
colors: PowerlineColors,
|
|
849
|
+
config?: AgentSegmentConfig,
|
|
850
|
+
): SegmentData | null {
|
|
851
|
+
const rawName = hookData.agent?.name;
|
|
852
|
+
if (typeof rawName !== "string") return null;
|
|
853
|
+
const name = rawName.trim();
|
|
854
|
+
if (!name) return null;
|
|
855
|
+
|
|
856
|
+
const iconPrefix = this.leadingIcon(this.symbols.agent, config);
|
|
857
|
+
const body = config?.showLabel ? `agent: ${name}` : name;
|
|
858
|
+
|
|
859
|
+
return {
|
|
860
|
+
text: `${iconPrefix}${body}`,
|
|
861
|
+
bgColor: colors.agentBg,
|
|
862
|
+
fgColor: colors.agentFg,
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
renderThinking(
|
|
867
|
+
hookData: ClaudeHookData,
|
|
868
|
+
colors: PowerlineColors,
|
|
869
|
+
config?: ThinkingSegmentConfig,
|
|
870
|
+
): SegmentData | null {
|
|
871
|
+
const showEnabled = config?.showEnabled ?? true;
|
|
872
|
+
const showEffort = config?.showEffort ?? true;
|
|
873
|
+
if (!showEnabled && !showEffort) return null;
|
|
874
|
+
|
|
875
|
+
const enabled = showEnabled ? getThinkingEnabled(hookData) : null;
|
|
876
|
+
const level = showEffort ? getEffortLevel(hookData) : null;
|
|
877
|
+
|
|
878
|
+
const parts: string[] = [];
|
|
879
|
+
if (enabled !== null) parts.push(enabled ? "On" : "Off");
|
|
880
|
+
if (level) parts.push(level);
|
|
881
|
+
if (parts.length === 0) return null;
|
|
882
|
+
|
|
883
|
+
const iconPrefix = this.leadingIcon(this.symbols.thinking, config);
|
|
884
|
+
return {
|
|
885
|
+
text: `${iconPrefix}${parts.join(" · ")}`,
|
|
886
|
+
bgColor: colors.thinkingBg,
|
|
887
|
+
fgColor: colors.thinkingFg,
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
renderCacheTimer(
|
|
892
|
+
info: CacheTimerInfo,
|
|
893
|
+
colors: PowerlineColors,
|
|
894
|
+
config?: CacheTimerSegmentConfig,
|
|
895
|
+
): SegmentData {
|
|
896
|
+
const e = info.elapsedSeconds;
|
|
897
|
+
const iconPrefix = this.leadingIcon(this.symbols.cache_timer, config);
|
|
898
|
+
const text = `${iconPrefix}${formatCacheTimerElapsed(e)}`;
|
|
899
|
+
|
|
900
|
+
let bgColor = colors.cacheTimerBg;
|
|
901
|
+
let fgColor = colors.cacheTimerFg;
|
|
902
|
+
let bold = colors.cacheTimerBold;
|
|
903
|
+
if (e >= 300) {
|
|
904
|
+
bgColor = colors.contextCriticalBg;
|
|
905
|
+
fgColor = colors.contextCriticalFg;
|
|
906
|
+
bold = colors.contextCriticalBold;
|
|
907
|
+
} else if (e >= 180) {
|
|
908
|
+
bgColor = colors.contextWarningBg;
|
|
909
|
+
fgColor = colors.contextWarningFg;
|
|
910
|
+
bold = colors.contextWarningBold;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
return { text, bgColor, fgColor, bold };
|
|
914
|
+
}
|
|
796
915
|
}
|
package/src/themes/dark.ts
CHANGED
|
@@ -15,6 +15,9 @@ export const darkTheme: ColorTheme = {
|
|
|
15
15
|
version: { bg: "#3a3a4a", fg: "#b8b8d0" },
|
|
16
16
|
env: { bg: "#2d2d3d", fg: "#d0a0d0" },
|
|
17
17
|
weekly: { bg: "#2a2a3a", fg: "#a0c4e8" },
|
|
18
|
+
agent: { bg: "#2a2a4a", fg: "#b0a8e0" },
|
|
19
|
+
thinking: { bg: "#2a2a3a", fg: "#c792ea" },
|
|
20
|
+
cacheTimer: { bg: "#1f3a1f", fg: "#90ee90" },
|
|
18
21
|
};
|
|
19
22
|
|
|
20
23
|
export const darkAnsi256Theme: ColorTheme = {
|
|
@@ -32,6 +35,9 @@ export const darkAnsi256Theme: ColorTheme = {
|
|
|
32
35
|
version: { bg: "#444444", fg: "#d7afff" },
|
|
33
36
|
env: { bg: "#3a3a3a", fg: "#d787d7" },
|
|
34
37
|
weekly: { bg: "#303030", fg: "#87afd7" },
|
|
38
|
+
agent: { bg: "#3a3a5f", fg: "#afafd7" },
|
|
39
|
+
thinking: { bg: "#2a2a3a", fg: "#d787ff" },
|
|
40
|
+
cacheTimer: { bg: "#1c2e1c", fg: "#87ff87" },
|
|
35
41
|
};
|
|
36
42
|
|
|
37
43
|
export const darkAnsiTheme: ColorTheme = {
|
|
@@ -49,4 +55,7 @@ export const darkAnsiTheme: ColorTheme = {
|
|
|
49
55
|
version: { bg: "#585858", fg: "#af87ff" },
|
|
50
56
|
env: { bg: "#444444", fg: "#ff87ff" },
|
|
51
57
|
weekly: { bg: "#3a3a3a", fg: "#5fafff" },
|
|
58
|
+
agent: { bg: "#444444", fg: "#af87ff" },
|
|
59
|
+
thinking: { bg: "#444444", fg: "#ff87ff" },
|
|
60
|
+
cacheTimer: { bg: "#2f4f2f", fg: "#00ff00" },
|
|
52
61
|
};
|
package/src/themes/gruvbox.ts
CHANGED
|
@@ -15,6 +15,9 @@ export const gruvboxTheme: ColorTheme = {
|
|
|
15
15
|
version: { bg: "#504945", fg: "#8ec07c" },
|
|
16
16
|
env: { bg: "#3c3836", fg: "#d3869b" },
|
|
17
17
|
weekly: { bg: "#3c3836", fg: "#8ec07c" },
|
|
18
|
+
agent: { bg: "#504945", fg: "#d3869b" },
|
|
19
|
+
thinking: { bg: "#3c3046", fg: "#d3869b" },
|
|
20
|
+
cacheTimer: { bg: "#3c3836", fg: "#b8bb26" },
|
|
18
21
|
};
|
|
19
22
|
|
|
20
23
|
export const gruvboxAnsi256Theme: ColorTheme = {
|
|
@@ -32,6 +35,9 @@ export const gruvboxAnsi256Theme: ColorTheme = {
|
|
|
32
35
|
version: { bg: "#585858", fg: "#87af87" },
|
|
33
36
|
env: { bg: "#444444", fg: "#d787af" },
|
|
34
37
|
weekly: { bg: "#444444", fg: "#87af87" },
|
|
38
|
+
agent: { bg: "#6c6c6c", fg: "#d787af" },
|
|
39
|
+
thinking: { bg: "#444444", fg: "#d787af" },
|
|
40
|
+
cacheTimer: { bg: "#444444", fg: "#afaf00" },
|
|
35
41
|
};
|
|
36
42
|
|
|
37
43
|
export const gruvboxAnsiTheme: ColorTheme = {
|
|
@@ -49,4 +55,7 @@ export const gruvboxAnsiTheme: ColorTheme = {
|
|
|
49
55
|
version: { bg: "#808080", fg: "#00d787" },
|
|
50
56
|
env: { bg: "#585858", fg: "#ff87af" },
|
|
51
57
|
weekly: { bg: "#585858", fg: "#00d787" },
|
|
58
|
+
agent: { bg: "#808080", fg: "#ff87af" },
|
|
59
|
+
thinking: { bg: "#808080", fg: "#ff87af" },
|
|
60
|
+
cacheTimer: { bg: "#585858", fg: "#ffff00" },
|
|
52
61
|
};
|
package/src/themes/index.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { gruvboxTheme, gruvboxAnsi256Theme, gruvboxAnsiTheme } from "./gruvbox";
|
|
|
16
16
|
export interface SegmentColor {
|
|
17
17
|
bg: string;
|
|
18
18
|
fg: string;
|
|
19
|
+
bold?: boolean;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export interface ColorTheme {
|
|
@@ -33,38 +34,64 @@ export interface ColorTheme {
|
|
|
33
34
|
version: SegmentColor;
|
|
34
35
|
env: SegmentColor;
|
|
35
36
|
weekly: SegmentColor;
|
|
37
|
+
agent: SegmentColor;
|
|
38
|
+
thinking: SegmentColor;
|
|
39
|
+
cacheTimer: SegmentColor;
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
export interface PowerlineColors {
|
|
39
43
|
reset: string;
|
|
40
44
|
modeBg: string;
|
|
41
45
|
modeFg: string;
|
|
46
|
+
modeBold: boolean;
|
|
42
47
|
gitBg: string;
|
|
43
48
|
gitFg: string;
|
|
49
|
+
gitBold: boolean;
|
|
44
50
|
modelBg: string;
|
|
45
51
|
modelFg: string;
|
|
52
|
+
modelBold: boolean;
|
|
46
53
|
sessionBg: string;
|
|
47
54
|
sessionFg: string;
|
|
55
|
+
sessionBold: boolean;
|
|
48
56
|
blockBg: string;
|
|
49
57
|
blockFg: string;
|
|
58
|
+
blockBold: boolean;
|
|
50
59
|
todayBg: string;
|
|
51
60
|
todayFg: string;
|
|
61
|
+
todayBold: boolean;
|
|
52
62
|
tmuxBg: string;
|
|
53
63
|
tmuxFg: string;
|
|
64
|
+
tmuxBold: boolean;
|
|
54
65
|
contextBg: string;
|
|
55
66
|
contextFg: string;
|
|
67
|
+
contextBold: boolean;
|
|
56
68
|
contextWarningBg: string;
|
|
57
69
|
contextWarningFg: string;
|
|
70
|
+
contextWarningBold: boolean;
|
|
58
71
|
contextCriticalBg: string;
|
|
59
72
|
contextCriticalFg: string;
|
|
73
|
+
contextCriticalBold: boolean;
|
|
60
74
|
metricsBg: string;
|
|
61
75
|
metricsFg: string;
|
|
76
|
+
metricsBold: boolean;
|
|
62
77
|
versionBg: string;
|
|
63
78
|
versionFg: string;
|
|
79
|
+
versionBold: boolean;
|
|
64
80
|
envBg: string;
|
|
65
81
|
envFg: string;
|
|
82
|
+
envBold: boolean;
|
|
66
83
|
weeklyBg: string;
|
|
67
84
|
weeklyFg: string;
|
|
85
|
+
weeklyBold: boolean;
|
|
86
|
+
agentBg: string;
|
|
87
|
+
agentFg: string;
|
|
88
|
+
agentBold: boolean;
|
|
89
|
+
thinkingBg: string;
|
|
90
|
+
thinkingFg: string;
|
|
91
|
+
thinkingBold: boolean;
|
|
92
|
+
cacheTimerBg: string;
|
|
93
|
+
cacheTimerFg: string;
|
|
94
|
+
cacheTimerBold: boolean;
|
|
68
95
|
partFg: Record<string, string>;
|
|
69
96
|
}
|
|
70
97
|
|
package/src/themes/light.ts
CHANGED
|
@@ -15,6 +15,9 @@ export const lightTheme: ColorTheme = {
|
|
|
15
15
|
version: { bg: "#8b7dd8", fg: "#ffffff" },
|
|
16
16
|
env: { bg: "#d45dbf", fg: "#ffffff" },
|
|
17
17
|
weekly: { bg: "#4f46e5", fg: "#ffffff" },
|
|
18
|
+
agent: { bg: "#7c3aed", fg: "#ffffff" },
|
|
19
|
+
thinking: { bg: "#7c3aed", fg: "#ffffff" },
|
|
20
|
+
cacheTimer: { bg: "#059669", fg: "#ffffff" },
|
|
18
21
|
};
|
|
19
22
|
|
|
20
23
|
export const lightAnsi256Theme: ColorTheme = {
|
|
@@ -32,6 +35,9 @@ export const lightAnsi256Theme: ColorTheme = {
|
|
|
32
35
|
version: { bg: "#af87ff", fg: "#ffffff" },
|
|
33
36
|
env: { bg: "#d787af", fg: "#ffffff" },
|
|
34
37
|
weekly: { bg: "#5f5fff", fg: "#ffffff" },
|
|
38
|
+
agent: { bg: "#8787d7", fg: "#ffffff" },
|
|
39
|
+
thinking: { bg: "#8700d7", fg: "#ffffff" },
|
|
40
|
+
cacheTimer: { bg: "#00875f", fg: "#ffffff" },
|
|
35
41
|
};
|
|
36
42
|
|
|
37
43
|
export const lightAnsiTheme: ColorTheme = {
|
|
@@ -49,4 +55,7 @@ export const lightAnsiTheme: ColorTheme = {
|
|
|
49
55
|
version: { bg: "#af87ff", fg: "#ffffff" },
|
|
50
56
|
env: { bg: "#d787af", fg: "#ffffff" },
|
|
51
57
|
weekly: { bg: "#5f5fff", fg: "#ffffff" },
|
|
58
|
+
agent: { bg: "#5f5fff", fg: "#ffffff" },
|
|
59
|
+
thinking: { bg: "#8700d7", fg: "#ffffff" },
|
|
60
|
+
cacheTimer: { bg: "#00875f", fg: "#ffffff" },
|
|
52
61
|
};
|
package/src/themes/nord.ts
CHANGED
|
@@ -15,6 +15,9 @@ export const nordTheme: ColorTheme = {
|
|
|
15
15
|
version: { bg: "#434c5e", fg: "#88c0d0" },
|
|
16
16
|
env: { bg: "#3b4252", fg: "#b48ead" },
|
|
17
17
|
weekly: { bg: "#3b4252", fg: "#88c0d0" },
|
|
18
|
+
agent: { bg: "#4c566a", fg: "#b48ead" },
|
|
19
|
+
thinking: { bg: "#3b4252", fg: "#b48ead" },
|
|
20
|
+
cacheTimer: { bg: "#3b4252", fg: "#a3be8c" },
|
|
18
21
|
};
|
|
19
22
|
|
|
20
23
|
export const nordAnsi256Theme: ColorTheme = {
|
|
@@ -32,6 +35,9 @@ export const nordAnsi256Theme: ColorTheme = {
|
|
|
32
35
|
version: { bg: "#5f87af", fg: "#5fafaf" },
|
|
33
36
|
env: { bg: "#4e4e4e", fg: "#d787af" },
|
|
34
37
|
weekly: { bg: "#4e4e4e", fg: "#5fafaf" },
|
|
38
|
+
agent: { bg: "#6c6c6c", fg: "#d787af" },
|
|
39
|
+
thinking: { bg: "#4e4e4e", fg: "#d787af" },
|
|
40
|
+
cacheTimer: { bg: "#4e4e4e", fg: "#87af87" },
|
|
35
41
|
};
|
|
36
42
|
|
|
37
43
|
export const nordAnsiTheme: ColorTheme = {
|
|
@@ -49,4 +55,7 @@ export const nordAnsiTheme: ColorTheme = {
|
|
|
49
55
|
version: { bg: "#0087af", fg: "#00d7d7" },
|
|
50
56
|
env: { bg: "#585858", fg: "#ff87af" },
|
|
51
57
|
weekly: { bg: "#585858", fg: "#00d7d7" },
|
|
58
|
+
agent: { bg: "#808080", fg: "#ff87af" },
|
|
59
|
+
thinking: { bg: "#585858", fg: "#ff87d7" },
|
|
60
|
+
cacheTimer: { bg: "#585858", fg: "#87d787" },
|
|
52
61
|
};
|
package/src/themes/rose-pine.ts
CHANGED
|
@@ -15,6 +15,9 @@ export const rosePineTheme: ColorTheme = {
|
|
|
15
15
|
version: { bg: "#2a273f", fg: "#c4a7e7" },
|
|
16
16
|
env: { bg: "#21202e", fg: "#eb6f92" },
|
|
17
17
|
weekly: { bg: "#21202e", fg: "#c4a7e7" },
|
|
18
|
+
agent: { bg: "#2a273f", fg: "#c4a7e7" },
|
|
19
|
+
thinking: { bg: "#26223a", fg: "#c4a7e7" },
|
|
20
|
+
cacheTimer: { bg: "#1f2d2e", fg: "#9ccfd8" },
|
|
18
21
|
};
|
|
19
22
|
|
|
20
23
|
export const rosePineAnsi256Theme: ColorTheme = {
|
|
@@ -32,6 +35,9 @@ export const rosePineAnsi256Theme: ColorTheme = {
|
|
|
32
35
|
version: { bg: "#4e4e4e", fg: "#d787d7" },
|
|
33
36
|
env: { bg: "#303030", fg: "#ff5f87" },
|
|
34
37
|
weekly: { bg: "#303030", fg: "#d787d7" },
|
|
38
|
+
agent: { bg: "#4e4e4e", fg: "#d787d7" },
|
|
39
|
+
thinking: { bg: "#303030", fg: "#d787d7" },
|
|
40
|
+
cacheTimer: { bg: "#303030", fg: "#87d7d7" },
|
|
35
41
|
};
|
|
36
42
|
|
|
37
43
|
export const rosePineAnsiTheme: ColorTheme = {
|
|
@@ -49,4 +55,7 @@ export const rosePineAnsiTheme: ColorTheme = {
|
|
|
49
55
|
version: { bg: "#666666", fg: "#ff87ff" },
|
|
50
56
|
env: { bg: "#444444", fg: "#ff5f87" },
|
|
51
57
|
weekly: { bg: "#444444", fg: "#ff87ff" },
|
|
58
|
+
agent: { bg: "#666666", fg: "#ff87ff" },
|
|
59
|
+
thinking: { bg: "#444444", fg: "#ff87ff" },
|
|
60
|
+
cacheTimer: { bg: "#444444", fg: "#00d7d7" },
|
|
52
61
|
};
|
|
@@ -15,6 +15,9 @@ export const tokyoNightTheme: ColorTheme = {
|
|
|
15
15
|
version: { bg: "#292e42", fg: "#bb9af7" },
|
|
16
16
|
env: { bg: "#24283b", fg: "#fca7ea" },
|
|
17
17
|
weekly: { bg: "#24283b", fg: "#7dcfff" },
|
|
18
|
+
agent: { bg: "#2d2b55", fg: "#bb9af7" },
|
|
19
|
+
thinking: { bg: "#2f2a3d", fg: "#bb9af7" },
|
|
20
|
+
cacheTimer: { bg: "#1f2e2a", fg: "#9ece6a" },
|
|
18
21
|
};
|
|
19
22
|
|
|
20
23
|
export const tokyoNightAnsi256Theme: ColorTheme = {
|
|
@@ -32,6 +35,9 @@ export const tokyoNightAnsi256Theme: ColorTheme = {
|
|
|
32
35
|
version: { bg: "#444460", fg: "#d787ff" },
|
|
33
36
|
env: { bg: "#303050", fg: "#ff87ff" },
|
|
34
37
|
weekly: { bg: "#303050", fg: "#5fd7ff" },
|
|
38
|
+
agent: { bg: "#5f5f87", fg: "#af87ff" },
|
|
39
|
+
thinking: { bg: "#444460", fg: "#d787ff" },
|
|
40
|
+
cacheTimer: { bg: "#1c3a30", fg: "#87d787" },
|
|
35
41
|
};
|
|
36
42
|
|
|
37
43
|
export const tokyoNightAnsiTheme: ColorTheme = {
|
|
@@ -49,4 +55,7 @@ export const tokyoNightAnsiTheme: ColorTheme = {
|
|
|
49
55
|
version: { bg: "#585870", fg: "#d787ff" },
|
|
50
56
|
env: { bg: "#444470", fg: "#ff87ff" },
|
|
51
57
|
weekly: { bg: "#444470", fg: "#00d7ff" },
|
|
58
|
+
agent: { bg: "#5f5faf", fg: "#d787ff" },
|
|
59
|
+
thinking: { bg: "#585870", fg: "#d787ff" },
|
|
60
|
+
cacheTimer: { bg: "#305050", fg: "#00d787" },
|
|
52
61
|
};
|