@ravshansbox/pi-statusline 1.7.0 → 1.9.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/index.ts +12 -15
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -73,22 +73,18 @@ export default function (pi: ExtensionAPI) {
|
|
|
73
73
|
const topParts = [basename(ctx.sessionManager.getCwd())];
|
|
74
74
|
const branch = footerData.getGitBranch();
|
|
75
75
|
if (branch) topParts.push(branch);
|
|
76
|
-
topParts.push(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
topParts.push(level === 'off' ? 'thinking off' : level);
|
|
80
|
-
}
|
|
81
|
-
const top = topParts.join(' • ');
|
|
82
|
-
|
|
83
|
-
const statsParts: string[] = [];
|
|
76
|
+
topParts.push(
|
|
77
|
+
model?.reasoning ? `${modelName}:${ctx.thinkingLevel || 'off'}` : modelName,
|
|
78
|
+
);
|
|
84
79
|
const contextDisplay =
|
|
85
80
|
contextPercent === '?'
|
|
86
81
|
? `?/${formatTokens(contextWindow)}`
|
|
87
82
|
: `${contextPercent}%/${formatTokens(contextWindow)}`;
|
|
88
|
-
if (contextPercentValue > 90)
|
|
89
|
-
else if (contextPercentValue > 70)
|
|
90
|
-
else
|
|
83
|
+
if (contextPercentValue > 90) topParts.push(theme.fg('error', contextDisplay));
|
|
84
|
+
else if (contextPercentValue > 70) topParts.push(theme.fg('warning', contextDisplay));
|
|
85
|
+
else topParts.push(contextDisplay);
|
|
91
86
|
|
|
87
|
+
const statsParts: string[] = [];
|
|
92
88
|
if (totals.input) statsParts.push(`↑${formatTokens(totals.input)}`);
|
|
93
89
|
if (totals.output) statsParts.push(`↓${formatTokens(totals.output)}`);
|
|
94
90
|
if (totals.cacheRead) statsParts.push(`R${formatTokens(totals.cacheRead)}`);
|
|
@@ -97,13 +93,14 @@ export default function (pi: ExtensionAPI) {
|
|
|
97
93
|
statsParts.push(`CH${latestCacheHitRate.toFixed(0)}%`);
|
|
98
94
|
}
|
|
99
95
|
|
|
96
|
+
if (statsParts.length > 0) topParts.push(statsParts.join(' '));
|
|
97
|
+
|
|
100
98
|
if (process.env['PI_EXPERIMENTAL'] === '1') {
|
|
101
|
-
|
|
99
|
+
topParts.push(theme.bold(theme.fg('warning', 'xp')));
|
|
102
100
|
}
|
|
103
101
|
|
|
104
|
-
const
|
|
105
|
-
const
|
|
106
|
-
const lines = [topLine, theme.fg('dim', statsLine)];
|
|
102
|
+
const line = truncateToWidth(topParts.join(' • '), width, '...');
|
|
103
|
+
const lines = [theme.fg('dim', line)];
|
|
107
104
|
|
|
108
105
|
const statuses = footerData.getExtensionStatuses();
|
|
109
106
|
if (statuses.size > 0) {
|