pi-powerline 0.6.1 → 0.6.2

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/CHANGELOG.md ADDED
@@ -0,0 +1,167 @@
1
+ ## [0.6.2](https://github.com/jwu/pi-powerline/compare/v0.6.1...v0.6.2) (2026-05-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * simplify nerd font detection ([52dacaf](https://github.com/jwu/pi-powerline/commit/52dacaf693161456a8acfcc0da5a6abc98330ffc))
7
+
8
+ ## [0.6.1](https://github.com/jwu/pi-powerline/compare/v0.6.0...v0.6.1) (2026-05-15)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **header:** dedupe extension entries ([2b2db6e](https://github.com/jwu/pi-powerline/commit/2b2db6e4ed2973a50d145205a3884726591a2663))
14
+
15
+ # [0.6.0](https://github.com/jwu/pi-powerline/compare/v0.5.1...v0.6.0) (2026-05-15)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **header:** add missing return in resolvePackageDir npm branch, add tests ([823d4eb](https://github.com/jwu/pi-powerline/commit/823d4ebec8d502c5dd3e07cb9a1c954d62b086bc))
21
+ * **header:** check .pi/npm/node_modules for project-scoped npm packages ([ad2d8d6](https://github.com/jwu/pi-powerline/commit/ad2d8d6a5694ff5371813fcf9e9eaa69e12e3bdc))
22
+ * **header:** resolve npm root via pi-coding-agent instead of pi-subagents ([0ba1051](https://github.com/jwu/pi-powerline/commit/0ba1051a231ad98c4a964658ec0c2a45307cc4c9))
23
+ * **header:** use NVM_DIR/env probe instead of createRequire for npm root ([3081f77](https://github.com/jwu/pi-powerline/commit/3081f77dd49117d831433857c7fd91f89fa1e8c1))
24
+
25
+
26
+ ### Features
27
+
28
+ * **header:** add packages and extensions sections, refactor to config-based discovery ([769465d](https://github.com/jwu/pi-powerline/commit/769465d0798548ff7e6098631739c9f5178fc938))
29
+ * **header:** annotate packages with [project]/[global] scope tag ([d451e96](https://github.com/jwu/pi-powerline/commit/d451e96222b1a88f497b07b19fbc386344879417))
30
+
31
+ ## [0.5.1](https://github.com/jwu/pi-powerline/compare/v0.5.0...v0.5.1) (2026-05-12)
32
+
33
+ ### Code Refactoring
34
+
35
+ * migrate peer deps from @mariozechner to @earendil-works scope ([3d7de22](https://github.com/jwu/pi-powerline/commit/3d7de22))
36
+
37
+ # [0.5.0](https://github.com/jwu/pi-powerline/compare/v0.4.2...v0.5.0) (2026-05-12)
38
+
39
+
40
+ ### Features
41
+
42
+ * show active tools in header info ([bcbc9a3](https://github.com/jwu/pi-powerline/commit/bcbc9a3d41b12ff86c252860cd941e4370d20108))
43
+
44
+ ## [0.4.2](https://github.com/jwu/pi-powerline/compare/v0.4.1...v0.4.2) (2026-05-08)
45
+
46
+
47
+ ### Bug Fixes
48
+
49
+ * improve header session status ([58d644d](https://github.com/jwu/pi-powerline/commit/58d644d6dafe0c83e0b83eb6c451705c51a5e2d3))
50
+
51
+ ## [0.4.1](https://github.com/jwu/pi-powerline/compare/v0.4.0...v0.4.1) (2026-05-08)
52
+
53
+
54
+ ### Bug Fixes
55
+
56
+ * enable header info by default ([bc229be](https://github.com/jwu/pi-powerline/commit/bc229befa2f552c89249bc5c110b5dde13c306c3))
57
+
58
+ # [0.4.0](https://github.com/jwu/pi-powerline/compare/v0.3.1...v0.4.0) (2026-05-08)
59
+
60
+
61
+ ### Bug Fixes
62
+
63
+ * respect quiet startup for header info ([fb243f5](https://github.com/jwu/pi-powerline/commit/fb243f5502f3a866ba971a243f7236f02a9cd96a))
64
+
65
+
66
+ ### Features
67
+
68
+ * add optional header info ([40a2a29](https://github.com/jwu/pi-powerline/commit/40a2a29d758459962656f098da254939f537b87f))
69
+ * center header status ([963e6ef](https://github.com/jwu/pi-powerline/commit/963e6ef0b0fc30fe896d6356734fcd23d1ae4ff5))
70
+
71
+ ## [0.3.1](https://github.com/jwu/pi-powerline/compare/v0.3.0...v0.3.1) (2026-05-06)
72
+
73
+
74
+ ### Bug Fixes
75
+
76
+ * guard prepare script to skip simple-git-hooks outside git repos ([c26bcad](https://github.com/jwu/pi-powerline/commit/c26bcad428ea0a855e9725abb0d269a5f975d09f))
77
+
78
+ # [0.3.0](https://github.com/jwu/pi-powerline/compare/v0.2.3...v0.3.0) (2026-05-06)
79
+
80
+
81
+ ### Bug Fixes
82
+
83
+ * remove npm provenance (requires CI, not supported with --no-ci) ([d9e9005](https://github.com/jwu/pi-powerline/commit/d9e90055df72e9d3b991ba48ecd2acbbd3af998b))
84
+
85
+
86
+ ### Features
87
+
88
+ * switch from git-cliff to semantic-release, add commitlint, strengthen TUI tests ([4cec86e](https://github.com/jwu/pi-powerline/commit/4cec86e61666436ef1cbc0a1cab3426408a0ce70))
89
+
90
+ ## [0.2.3] - 2026-05-06
91
+
92
+ ### 🐛 Bug Fixes
93
+
94
+ - Husky command not found when installed as dependency
95
+
96
+ ### 📚 Documentation
97
+
98
+ - Credit pi-powerline-footer by nicobailon
99
+
100
+ ### ⚙️ Miscellaneous Tasks
101
+
102
+ - Update changelog
103
+ ## [0.2.2] - 2026-05-05
104
+
105
+ ### 🐛 Bug Fixes
106
+
107
+ - Use GitHub raw URL for screenshot in README
108
+
109
+ ### ⚙️ Miscellaneous Tasks
110
+
111
+ - Add homepage and repository fields to package.json
112
+ ## [0.2.1] - 2026-05-05
113
+
114
+ ### ⚙️ Miscellaneous Tasks
115
+
116
+ - Add git-cliff changelog
117
+ - Bump version to 0.2.1
118
+ ## [0.2.0] - 2026-05-05
119
+
120
+ ### 🚀 Features
121
+
122
+ - Add powerline master switch, simplify README, use local assets
123
+
124
+ ### ⚙️ Miscellaneous Tasks
125
+
126
+ - Bump version to 0.2.0
127
+ ## [0.1.0] - 2026-05-03
128
+
129
+ ### 🚀 Features
130
+
131
+ - Powerline UI extensions with auto-format and pre-commit hooks
132
+ - Add /powerline toggle command for editor, footer, header
133
+ - Add powerline status widget above editor
134
+ - /powerline commands take effect immediately via events bus
135
+
136
+ ### 🐛 Bug Fixes
137
+
138
+ - EditorTheme type mismatch, add diagnostics checks
139
+
140
+ ### 💼 Other
141
+
142
+ - Use pi.getThinkingLevel() and pi.on(thinking_level_select) for think level
143
+ - Mirror built-in footer layout with full stats, context usage, thinking level
144
+ - Drop redundant pwd line (already shown by widget)
145
+ - Show only think level on right side, styled like widget
146
+ - Add Nerd Font think icon to right side
147
+ - Real-time token stats via message_update live usage fusion
148
+ - Show (auto) marker when auto-compact is enabled
149
+ - Move context usage to front of stats line, preserve per-segment coloring
150
+ - Restore original dim-wrapping, keep context-first ordering only
151
+ - Remove think level display (now in footer), show only model → folder
152
+ - Truncate with ellipsis instead of wrapping to next line
153
+ - Drop think: prefix from level label in stats line
154
+ - Embed widget info (model + folder) in top border line
155
+
156
+ ### 🚜 Refactor
157
+
158
+ - Unified settings model with breadcrumb/footer/header config keys
159
+ - Extract shared breadcrumb helpers into breadcrumb.ts
160
+
161
+ ### 📚 Documentation
162
+
163
+ - Update README to reflect current features, settings, and commands
164
+
165
+ ### ⚙️ Miscellaneous Tasks
166
+
167
+ - Prepare package.json for pi package publishing
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 jwu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -40,6 +40,24 @@ Settings are read from both global and project files. Project settings override
40
40
  | `header` | `true` / `false` | `true` | Enable custom gradient-logo header |
41
41
  | `header-info` | `true` / `false` | `true` | Show header diagnostic info on startup/reload |
42
42
 
43
+ ### Nerd Font icons
44
+
45
+ pi-powerline uses Nerd Font icons when it can infer that the terminal supports them.
46
+
47
+ Detection order:
48
+
49
+ 1. `PI_NERD_FONTS=1` forces icons on
50
+ 2. `PI_NERD_FONTS=0` forces icons off
51
+ 3. `GHOSTTY_RESOURCES_DIR` enables icons for Ghostty
52
+ 4. `TERM_PROGRAM` or `TERM` containing `iterm`, `wezterm`, `kitty`, `ghostty`, or `alacritty` enables icons
53
+ 5. Otherwise icons are disabled and plain text fallbacks are used
54
+
55
+ For SSH or terminals that cannot be detected reliably, set it explicitly:
56
+
57
+ ```bash
58
+ export PI_NERD_FONTS=1
59
+ ```
60
+
43
61
  ### Header info
44
62
 
45
63
  `header-info` adds diagnostic sections under the header:
Binary file
@@ -1,23 +1,12 @@
1
1
  /**
2
2
  * Shared breadcrumb display helpers
3
3
  *
4
- * Export nerd font detection, icons, and helper functions used by
5
- * widget.ts and editor.ts to render the model→folder breadcrumb.
4
+ * Exports icons and helper functions used by widget.ts and editor.ts
5
+ * to render the model→folder breadcrumb.
6
6
  */
7
7
  import { basename } from 'node:path';
8
8
  import type { ExtensionContext, Theme } from '@earendil-works/pi-coding-agent';
9
-
10
- // ═══════════════════════════════════════════════════════════════════════════
11
- // nerd font detection
12
- // ═══════════════════════════════════════════════════════════════════════════
13
-
14
- export function hasNerdFonts(): boolean {
15
- if (process.env.POWERLINE_NERD_FONTS === '1') return true;
16
- if (process.env.POWERLINE_NERD_FONTS === '0') return false;
17
- if (process.env.GHOSTTY_RESOURCES_DIR) return true;
18
- const term = (process.env.TERM_PROGRAM || '').toLowerCase();
19
- return ['iterm', 'wezterm', 'kitty', 'ghostty', 'alacritty'].some((t) => term.includes(t));
20
- }
9
+ import { hasNerdFonts, hexFg, withIcon } from './utils.ts';
21
10
 
22
11
  const NERD = hasNerdFonts();
23
12
 
@@ -25,23 +14,6 @@ export const ICON_MODEL = NERD ? '\uF4BC' : '';
25
14
  export const ICON_FOLDER = NERD ? '\uF115' : '';
26
15
  export const SEP = NERD ? '\uf054' : '/';
27
16
 
28
- // ═══════════════════════════════════════════════════════════════════════════
29
- // helpers
30
- // ═══════════════════════════════════════════════════════════════════════════
31
-
32
- export function withIcon(icon: string, text: string): string {
33
- return icon ? `${icon} ${text}` : text;
34
- }
35
-
36
- /** hex → ANSI true color (model/folder use hex, not pi theme tokens) */
37
- export function hexFg(hex: string, text: string): string {
38
- const h = hex.replace('#', '');
39
- const r = parseInt(h.slice(0, 2), 16);
40
- const g = parseInt(h.slice(2, 4), 16);
41
- const b = parseInt(h.slice(4, 6), 16);
42
- return `\x1b[38;2;${r};${g};${b}m${text}`;
43
- }
44
-
45
17
  // ═══════════════════════════════════════════════════════════════════════════
46
18
  // breadcrumb data
47
19
  // ═══════════════════════════════════════════════════════════════════════════
@@ -16,7 +16,7 @@ import { join } from 'node:path';
16
16
  import type { AssistantMessage } from '@earendil-works/pi-ai';
17
17
  import type { ExtensionAPI, ExtensionContext } from '@earendil-works/pi-coding-agent';
18
18
  import { truncateToWidth, visibleWidth } from '@earendil-works/pi-tui';
19
- import { hasNerdFonts, hexFg, withIcon } from './breadcrumb.ts';
19
+ import { hasNerdFonts, hexFg, withIcon } from './utils.ts';
20
20
  import { readPowerlineSettings } from './settings.ts';
21
21
 
22
22
  // ═══════════════════════════════════════════════════════════════════════════
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Shared utility functions
3
+ *
4
+ * Rendering and font-detection helpers used by breadcrumb, footer, and other extensions.
5
+ */
6
+
7
+ // ═══════════════════════════════════════════════════════════════════════════
8
+ // nerd font detection (cached)
9
+ // ═══════════════════════════════════════════════════════════════════════════
10
+
11
+ let _nerdCache: boolean | null = null;
12
+
13
+ export function hasNerdFonts(): boolean {
14
+ if (_nerdCache !== null) return _nerdCache;
15
+
16
+ if (process.env.PI_NERD_FONTS === '1') return (_nerdCache = true);
17
+ if (process.env.PI_NERD_FONTS === '0') return (_nerdCache = false);
18
+ if (process.env.GHOSTTY_RESOURCES_DIR) return (_nerdCache = true);
19
+
20
+ const terminal = `${process.env.TERM_PROGRAM || ''} ${process.env.TERM || ''}`.toLowerCase();
21
+ if (['iterm', 'wezterm', 'kitty', 'ghostty', 'alacritty'].some((t) => terminal.includes(t))) {
22
+ return (_nerdCache = true);
23
+ }
24
+
25
+ return (_nerdCache = false);
26
+ }
27
+
28
+ // ═══════════════════════════════════════════════════════════════════════════
29
+ // rendering helpers
30
+ // ═══════════════════════════════════════════════════════════════════════════
31
+
32
+ /** Prepend icon with trailing space, or return plain text if icon is empty */
33
+ export function withIcon(icon: string, text: string): string {
34
+ return icon ? `${icon} ${text}` : text;
35
+ }
36
+
37
+ /** hex → ANSI true color escape (no reset appended) */
38
+ export function hexFg(hex: string, text: string): string {
39
+ const h = hex.replace('#', '');
40
+ const r = parseInt(h.slice(0, 2), 16);
41
+ const g = parseInt(h.slice(2, 4), 16);
42
+ const b = parseInt(h.slice(4, 6), 16);
43
+ return `\x1b[38;2;${r};${g};${b}m${text}`;
44
+ }
package/package.json CHANGED
@@ -1,21 +1,23 @@
1
1
  {
2
2
  "name": "pi-powerline",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
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": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/jwu/pi-powerline.git"
9
9
  },
10
+ "bugs": {
11
+ "url": "https://github.com/jwu/pi-powerline/issues"
12
+ },
10
13
  "type": "module",
11
14
  "files": [
12
- "index.ts",
13
- "editor.ts",
14
- "breadcrumb.ts",
15
- "widget.ts",
16
- "footer.ts",
17
- "header.ts",
18
- "settings.ts"
15
+ "extensions/",
16
+ "README.md",
17
+ "package.json",
18
+ "CHANGELOG.md",
19
+ "LICENSE",
20
+ "assets/"
19
21
  ],
20
22
  "keywords": [
21
23
  "pi-package",
@@ -24,11 +26,12 @@
24
26
  "powerline",
25
27
  "extension"
26
28
  ],
27
- "author": "",
29
+ "author": "jwu",
28
30
  "license": "MIT",
29
31
  "scripts": {
30
32
  "test": "bun test",
31
33
  "typecheck": "bun tsc --noEmit --ignoreDeprecations 6.0",
34
+ "lint": "bun run format:check && bun run typecheck",
32
35
  "format": "prettier --write '**/*.ts'",
33
36
  "format:check": "prettier --check '**/*.ts'",
34
37
  "prepare": "[ -d .git ] && simple-git-hooks || true",
@@ -70,9 +73,12 @@
70
73
  "pre-commit": "bun prettier --check '**/*.ts' && bun test",
71
74
  "commit-msg": "bun commitlint --edit \"$1\""
72
75
  },
76
+ "engines": {
77
+ "node": ">=20"
78
+ },
73
79
  "pi": {
74
80
  "extensions": [
75
- "./index.ts"
81
+ "./extensions"
76
82
  ],
77
83
  "image": "https://raw.githubusercontent.com/jwu/pi-powerline/refs/heads/main/assets/pi-powerline.png"
78
84
  },
File without changes
File without changes
File without changes
File without changes
File without changes