pi-powerline 0.4.2 → 0.5.1
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/breadcrumb.ts +1 -1
- package/editor.ts +2 -2
- package/footer.ts +3 -3
- package/header.ts +14 -3
- package/index.ts +2 -2
- package/package.json +4 -4
- package/widget.ts +2 -2
package/breadcrumb.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* widget.ts and editor.ts to render the model→folder breadcrumb.
|
|
6
6
|
*/
|
|
7
7
|
import { basename } from 'node:path';
|
|
8
|
-
import type { ExtensionContext, Theme } from '@
|
|
8
|
+
import type { ExtensionContext, Theme } from '@earendil-works/pi-coding-agent';
|
|
9
9
|
|
|
10
10
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
11
11
|
// nerd font detection
|
package/editor.ts
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* Switches to bash-mode coloring when the prompt starts with !.
|
|
6
6
|
* Editor is always enabled; breadcrumb mode controls whether widget info is embedded.
|
|
7
7
|
*/
|
|
8
|
-
import { type EditorTheme, truncateToWidth, visibleWidth } from '@
|
|
8
|
+
import { type EditorTheme, truncateToWidth, visibleWidth } from '@earendil-works/pi-tui';
|
|
9
9
|
import {
|
|
10
10
|
CustomEditor,
|
|
11
11
|
type ExtensionAPI,
|
|
12
12
|
type ExtensionContext,
|
|
13
13
|
type Theme,
|
|
14
14
|
type ThemeColor,
|
|
15
|
-
} from '@
|
|
15
|
+
} from '@earendil-works/pi-coding-agent';
|
|
16
16
|
import { getBreadcrumbData, renderBreadcrumbInfo } from './breadcrumb.ts';
|
|
17
17
|
import { readPowerlineSettings } from './settings.ts';
|
|
18
18
|
|
package/footer.ts
CHANGED
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
|
|
14
14
|
import { readFileSync, existsSync } from 'node:fs';
|
|
15
15
|
import { join } from 'node:path';
|
|
16
|
-
import type { AssistantMessage } from '@
|
|
17
|
-
import type { ExtensionAPI, ExtensionContext } from '@
|
|
18
|
-
import { truncateToWidth, visibleWidth } from '@
|
|
16
|
+
import type { AssistantMessage } from '@earendil-works/pi-ai';
|
|
17
|
+
import type { ExtensionAPI, ExtensionContext } from '@earendil-works/pi-coding-agent';
|
|
18
|
+
import { truncateToWidth, visibleWidth } from '@earendil-works/pi-tui';
|
|
19
19
|
import { readPowerlineSettings } from './settings.ts';
|
|
20
20
|
|
|
21
21
|
// ═══════════════════════════════════════════════════════════════════════════
|
package/header.ts
CHANGED
|
@@ -14,9 +14,9 @@ import type {
|
|
|
14
14
|
SessionStartEvent,
|
|
15
15
|
SlashCommandInfo,
|
|
16
16
|
Theme,
|
|
17
|
-
} from '@
|
|
18
|
-
import { VERSION } from '@
|
|
19
|
-
import { truncateToWidth, wrapTextWithAnsi } from '@
|
|
17
|
+
} from '@earendil-works/pi-coding-agent';
|
|
18
|
+
import { VERSION } from '@earendil-works/pi-coding-agent';
|
|
19
|
+
import { truncateToWidth, wrapTextWithAnsi } from '@earendil-works/pi-tui';
|
|
20
20
|
import { readPowerlineSettings } from './settings.ts';
|
|
21
21
|
|
|
22
22
|
/** Left-to-right ANSI gradient coloring. Spaces are left uncolored. */
|
|
@@ -144,6 +144,8 @@ interface HeaderInfo {
|
|
|
144
144
|
promptsCount: number;
|
|
145
145
|
extensionsCount: number;
|
|
146
146
|
commandsCount: number;
|
|
147
|
+
tools: string[];
|
|
148
|
+
toolsCount: number;
|
|
147
149
|
}
|
|
148
150
|
|
|
149
151
|
function renderBullet(theme: Theme, value: string, width: number): string[] {
|
|
@@ -195,6 +197,7 @@ function renderLogo(
|
|
|
195
197
|
`prompts: ${info.promptsCount}`,
|
|
196
198
|
`extensions: ${info.extensionsCount}`,
|
|
197
199
|
`commands: ${info.commandsCount}`,
|
|
200
|
+
`tools: ${info.toolsCount}`,
|
|
198
201
|
].join(' | ');
|
|
199
202
|
|
|
200
203
|
return [
|
|
@@ -204,6 +207,8 @@ function renderLogo(
|
|
|
204
207
|
'',
|
|
205
208
|
...renderInfoSection(theme, 'Context', info.contextItems, width),
|
|
206
209
|
'',
|
|
210
|
+
...renderInfoSection(theme, 'Tools', info.tools, width),
|
|
211
|
+
'',
|
|
207
212
|
...renderInfoSection(theme, 'Skills', info.skills, width),
|
|
208
213
|
'',
|
|
209
214
|
...renderInfoSection(
|
|
@@ -360,6 +365,10 @@ function collectHeaderInfo(
|
|
|
360
365
|
const allThemes = typeof ctx.ui.getAllThemes === 'function' ? ctx.ui.getAllThemes() : [];
|
|
361
366
|
const themeName = theme.name ?? ctx.ui.theme?.name ?? 'current';
|
|
362
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
|
+
: [];
|
|
363
372
|
|
|
364
373
|
return {
|
|
365
374
|
themeName,
|
|
@@ -375,6 +384,8 @@ function collectHeaderInfo(
|
|
|
375
384
|
promptsCount: countUniqueSources(commands, 'prompt'),
|
|
376
385
|
extensionsCount: extensions.length,
|
|
377
386
|
commandsCount: commands.length,
|
|
387
|
+
tools: activeTools,
|
|
388
|
+
toolsCount: activeTools.length,
|
|
378
389
|
};
|
|
379
390
|
}
|
|
380
391
|
|
package/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ExtensionAPI } from '@
|
|
2
|
-
import type { AutocompleteItem } from '@
|
|
1
|
+
import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';
|
|
2
|
+
import type { AutocompleteItem } from '@earendil-works/pi-tui';
|
|
3
3
|
import { registerEditor } from './editor.ts';
|
|
4
4
|
import { registerFooter } from './footer.ts';
|
|
5
5
|
import { registerHeader } from './header.ts';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-powerline",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Powerline-style UI extensions for pi coding agent (custom editor, breadcrumb, footer, header)",
|
|
5
5
|
"homepage": "https://github.com/jwu/pi-powerline#readme",
|
|
6
6
|
"repository": {
|
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
"image": "https://raw.githubusercontent.com/jwu/pi-powerline/refs/heads/main/assets/pi-powerline.png"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
|
-
"@
|
|
81
|
-
"@
|
|
82
|
-
"@
|
|
80
|
+
"@earendil-works/pi-ai": "*",
|
|
81
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
82
|
+
"@earendil-works/pi-tui": "*"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@commitlint/cli": "^20.5.3",
|
package/widget.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Shows: model → current folder.
|
|
6
6
|
* Only active when breadcrumb mode is "top" in .pi/settings.json.
|
|
7
7
|
*/
|
|
8
|
-
import type { ExtensionAPI, ExtensionContext, Theme } from '@
|
|
9
|
-
import { truncateToWidth, visibleWidth } from '@
|
|
8
|
+
import type { ExtensionAPI, ExtensionContext, Theme } from '@earendil-works/pi-coding-agent';
|
|
9
|
+
import { truncateToWidth, visibleWidth } from '@earendil-works/pi-tui';
|
|
10
10
|
import { getBreadcrumbData, renderBreadcrumbInfo } from './breadcrumb.ts';
|
|
11
11
|
import { readPowerlineSettings } from './settings.ts';
|
|
12
12
|
|