pi-powerline 0.4.1 → 0.5.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/header.ts +17 -1
- package/package.json +1 -1
package/header.ts
CHANGED
|
@@ -121,6 +121,10 @@ function formatReasonStatus(theme: Theme, reason: SessionStartEvent['reason']):
|
|
|
121
121
|
return theme.fg('success', 'Reloaded');
|
|
122
122
|
case 'new':
|
|
123
123
|
return theme.fg('success', 'New Session Started');
|
|
124
|
+
case 'resume':
|
|
125
|
+
return theme.fg('success', 'Session Resumed');
|
|
126
|
+
case 'fork':
|
|
127
|
+
return theme.fg('success', 'Session Forked');
|
|
124
128
|
default:
|
|
125
129
|
return theme.fg('dim', reason);
|
|
126
130
|
}
|
|
@@ -140,6 +144,8 @@ interface HeaderInfo {
|
|
|
140
144
|
promptsCount: number;
|
|
141
145
|
extensionsCount: number;
|
|
142
146
|
commandsCount: number;
|
|
147
|
+
tools: string[];
|
|
148
|
+
toolsCount: number;
|
|
143
149
|
}
|
|
144
150
|
|
|
145
151
|
function renderBullet(theme: Theme, value: string, width: number): string[] {
|
|
@@ -182,7 +188,7 @@ function renderLogo(
|
|
|
182
188
|
...centerWrappedLines(formatReasonStatus(theme, reason), width),
|
|
183
189
|
];
|
|
184
190
|
|
|
185
|
-
if (!info) return result;
|
|
191
|
+
if (!info) return [...result, ''];
|
|
186
192
|
|
|
187
193
|
const counts = [
|
|
188
194
|
`context: ${info.contextCount}`,
|
|
@@ -191,6 +197,7 @@ function renderLogo(
|
|
|
191
197
|
`prompts: ${info.promptsCount}`,
|
|
192
198
|
`extensions: ${info.extensionsCount}`,
|
|
193
199
|
`commands: ${info.commandsCount}`,
|
|
200
|
+
`tools: ${info.toolsCount}`,
|
|
194
201
|
].join(' | ');
|
|
195
202
|
|
|
196
203
|
return [
|
|
@@ -200,6 +207,8 @@ function renderLogo(
|
|
|
200
207
|
'',
|
|
201
208
|
...renderInfoSection(theme, 'Context', info.contextItems, width),
|
|
202
209
|
'',
|
|
210
|
+
...renderInfoSection(theme, 'Tools', info.tools, width),
|
|
211
|
+
'',
|
|
203
212
|
...renderInfoSection(theme, 'Skills', info.skills, width),
|
|
204
213
|
'',
|
|
205
214
|
...renderInfoSection(
|
|
@@ -210,6 +219,7 @@ function renderLogo(
|
|
|
210
219
|
),
|
|
211
220
|
'',
|
|
212
221
|
...renderInfoSection(theme, 'Extensions', info.extensions, width),
|
|
222
|
+
'',
|
|
213
223
|
];
|
|
214
224
|
}
|
|
215
225
|
|
|
@@ -355,6 +365,10 @@ function collectHeaderInfo(
|
|
|
355
365
|
const allThemes = typeof ctx.ui.getAllThemes === 'function' ? ctx.ui.getAllThemes() : [];
|
|
356
366
|
const themeName = theme.name ?? ctx.ui.theme?.name ?? 'current';
|
|
357
367
|
const extensions = getExtensionItems(ctx.cwd, commands);
|
|
368
|
+
const activeTools =
|
|
369
|
+
typeof pi.getActiveTools === 'function'
|
|
370
|
+
? pi.getActiveTools().sort((a, b) => a.localeCompare(b))
|
|
371
|
+
: [];
|
|
358
372
|
|
|
359
373
|
return {
|
|
360
374
|
themeName,
|
|
@@ -370,6 +384,8 @@ function collectHeaderInfo(
|
|
|
370
384
|
promptsCount: countUniqueSources(commands, 'prompt'),
|
|
371
385
|
extensionsCount: extensions.length,
|
|
372
386
|
commandsCount: commands.length,
|
|
387
|
+
tools: activeTools,
|
|
388
|
+
toolsCount: activeTools.length,
|
|
373
389
|
};
|
|
374
390
|
}
|
|
375
391
|
|
package/package.json
CHANGED