@ravshansbox/pi-statusline 1.6.0 → 1.8.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.
Files changed (2) hide show
  1. package/index.ts +11 -12
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -78,7 +78,13 @@ export default function (pi: ExtensionAPI) {
78
78
  const level = ctx.thinkingLevel || 'off';
79
79
  topParts.push(level === 'off' ? 'thinking off' : level);
80
80
  }
81
- const top = topParts.join(' • ');
81
+ const contextDisplay =
82
+ contextPercent === '?'
83
+ ? `?/${formatTokens(contextWindow)}`
84
+ : `${contextPercent}%/${formatTokens(contextWindow)}`;
85
+ if (contextPercentValue > 90) topParts.push(theme.fg('error', contextDisplay));
86
+ else if (contextPercentValue > 70) topParts.push(theme.fg('warning', contextDisplay));
87
+ else topParts.push(contextDisplay);
82
88
 
83
89
  const statsParts: string[] = [];
84
90
  if (totals.input) statsParts.push(`↑${formatTokens(totals.input)}`);
@@ -89,21 +95,14 @@ export default function (pi: ExtensionAPI) {
89
95
  statsParts.push(`CH${latestCacheHitRate.toFixed(0)}%`);
90
96
  }
91
97
 
92
- const contextDisplay =
93
- contextPercent === '?'
94
- ? `?/${formatTokens(contextWindow)}`
95
- : `${contextPercent}%/${formatTokens(contextWindow)}`;
96
- if (contextPercentValue > 90) statsParts.push(theme.fg('error', contextDisplay));
97
- else if (contextPercentValue > 70) statsParts.push(theme.fg('warning', contextDisplay));
98
- else statsParts.push(contextDisplay);
98
+ if (statsParts.length > 0) topParts.push(statsParts.join(' '));
99
99
 
100
100
  if (process.env['PI_EXPERIMENTAL'] === '1') {
101
- statsParts.push(`${theme.fg('dim', '•')} ${theme.bold(theme.fg('warning', 'xp'))}`);
101
+ topParts.push(theme.bold(theme.fg('warning', 'xp')));
102
102
  }
103
103
 
104
- const statsLine = truncateToWidth(statsParts.join(' '), width, '...');
105
- const topLine = truncateToWidth(theme.fg('dim', top), width, theme.fg('dim', '...'));
106
- const lines = [topLine, theme.fg('dim', statsLine)];
104
+ const line = truncateToWidth(topParts.join(' • '), width, '...');
105
+ const lines = [theme.fg('dim', line)];
107
106
 
108
107
  const statuses = footerData.getExtensionStatuses();
109
108
  if (statuses.size > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ravshansbox/pi-statusline",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "Statusline extension for pi",
5
5
  "license": "MIT",
6
6
  "type": "module",