@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.
Files changed (2) hide show
  1. package/index.ts +12 -15
  2. 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(modelName);
77
- if (model?.reasoning) {
78
- const level = ctx.thinkingLevel || 'off';
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) statsParts.push(theme.fg('error', contextDisplay));
89
- else if (contextPercentValue > 70) statsParts.push(theme.fg('warning', contextDisplay));
90
- else statsParts.push(contextDisplay);
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
- statsParts.push(`${theme.fg('dim', '•')} ${theme.bold(theme.fg('warning', 'xp'))}`);
99
+ topParts.push(theme.bold(theme.fg('warning', 'xp')));
102
100
  }
103
101
 
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)];
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ravshansbox/pi-statusline",
3
- "version": "1.7.0",
3
+ "version": "1.9.0",
4
4
  "description": "Statusline extension for pi",
5
5
  "license": "MIT",
6
6
  "type": "module",