pi-minimal-footer 0.1.1 → 0.1.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 +15 -1
- package/README.md +12 -7
- package/extensions/index.ts +15 -8
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,12 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.2] - 2026-09-01
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Updated the Node.js engine declaration to match current Pi releases (`>=22.19.0`)
|
|
15
|
+
- README polish: remove internal API jargon, fix `e.g.,` comma, tighten config section
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- Keep merged footer settings non-optional so the extension passes strict TypeScript checks
|
|
20
|
+
- Footer no longer overflows on narrow terminal windows — truncate the path (then the right side) to fit the terminal width using pi-tui's `truncateToWidth`, instead of emitting a line wider than the terminal (which crashed pi)
|
|
21
|
+
|
|
10
22
|
## [0.1.1] - 2026-06-15
|
|
11
23
|
|
|
12
24
|
### Added
|
|
13
25
|
|
|
14
26
|
- Preview screenshot (`preview.png`) and `pi.image` gallery metadata for pi.dev/packages
|
|
15
27
|
- README badges: npm version, downloads, and license
|
|
28
|
+
- Screenshot preview rendered directly in README
|
|
16
29
|
|
|
17
30
|
### Changed
|
|
18
31
|
|
|
@@ -52,7 +65,8 @@ First npm-ready release.
|
|
|
52
65
|
|
|
53
66
|
- Project scaffold — `extensions/index.ts` with basic footer structure, `package.json` with pi extension manifest, `README.md`, `LICENSE` (MIT)
|
|
54
67
|
|
|
55
|
-
[Unreleased]: https://github.com/Ryu-CZ/pi-minimal-footer/compare/v0.1.
|
|
68
|
+
[Unreleased]: https://github.com/Ryu-CZ/pi-minimal-footer/compare/v0.1.2...HEAD
|
|
69
|
+
[0.1.2]: https://github.com/Ryu-CZ/pi-minimal-footer/compare/v0.1.1...v0.1.2
|
|
56
70
|
[0.1.1]: https://github.com/Ryu-CZ/pi-minimal-footer/compare/v0.1.0...v0.1.1
|
|
57
71
|
[0.1.0]: https://github.com/Ryu-CZ/pi-minimal-footer/compare/v0.0.0...v0.1.0
|
|
58
72
|
[0.0.0]: https://github.com/Ryu-CZ/pi-minimal-footer/releases/tag/v0.0.0
|
package/README.md
CHANGED
|
@@ -10,16 +10,23 @@
|
|
|
10
10
|
<a href="LICENSE">
|
|
11
11
|
<img src="https://img.shields.io/npm/l/pi-minimal-footer" alt="license">
|
|
12
12
|
</a>
|
|
13
|
+
<a href="https://pi.dev/packages/pi-minimal-footer">
|
|
14
|
+
<img src="https://img.shields.io/badge/pi-package-1a1a2e" alt="pi package">
|
|
15
|
+
</a>
|
|
13
16
|
</p>
|
|
14
17
|
|
|
15
|
-
A clean, compact one-line footer for [
|
|
18
|
+
A clean, compact one-line footer for [Pi](https://github.com/earendil-works/pi).
|
|
16
19
|
|
|
17
20
|
```
|
|
18
21
|
~/path/to/dir (skill1 | skill2) main sonnet 12/128k
|
|
19
22
|
```
|
|
20
23
|
|
|
24
|
+

|
|
25
|
+
|
|
21
26
|
## Install
|
|
22
27
|
|
|
28
|
+
Available on the [Pi package gallery](https://pi.dev/packages/pi-minimal-footer).
|
|
29
|
+
|
|
23
30
|
```bash
|
|
24
31
|
# From npm (recommended)
|
|
25
32
|
pi install npm:pi-minimal-footer
|
|
@@ -37,10 +44,10 @@ ln -s "$PWD/extensions" ~/.pi/agent/extensions/minimal-footer
|
|
|
37
44
|
## Features
|
|
38
45
|
|
|
39
46
|
- **Working directory** — relative path from home (`~/...`)
|
|
40
|
-
- **Active skills** —
|
|
47
|
+
- **Active skills** — extensions reporting their current status
|
|
41
48
|
- **Git branch** — current branch name
|
|
42
49
|
- **Model** — active model ID
|
|
43
|
-
- **Context usage** — tokens used / context window (e.g
|
|
50
|
+
- **Context usage** — tokens used / context window (e.g., `12/128k`)
|
|
44
51
|
|
|
45
52
|
## Commands
|
|
46
53
|
|
|
@@ -50,11 +57,11 @@ ln -s "$PWD/extensions" ~/.pi/agent/extensions/minimal-footer
|
|
|
50
57
|
| `/minfooter on` | Enable |
|
|
51
58
|
| `/minfooter off` | Disable |
|
|
52
59
|
|
|
53
|
-
> The `/minfooter` command only
|
|
60
|
+
> The `/minfooter` command only toggles the `enabled` flag. To show or hide individual segments, edit `~/.pi/agent/settings.json` directly.
|
|
54
61
|
|
|
55
62
|
## Configuration
|
|
56
63
|
|
|
57
|
-
Settings
|
|
64
|
+
Settings live in `~/.pi/agent/settings.json` under the `minFooter` key:
|
|
58
65
|
|
|
59
66
|
```json
|
|
60
67
|
{
|
|
@@ -68,5 +75,3 @@ Settings are persisted in `~/.pi/agent/settings.json` under the `minFooter` key:
|
|
|
68
75
|
}
|
|
69
76
|
}
|
|
70
77
|
```
|
|
71
|
-
|
|
72
|
-
Edit the file directly to show or hide individual segments. The `/minfooter` command is a shortcut that toggles only the `enabled` flag.
|
package/extensions/index.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import type { ExtensionAPI, ExtensionContext, ReadonlyFooterDataProvider } from "@earendil-works/pi-coding-agent";
|
|
14
|
-
import { visibleWidth } from "@earendil-works/pi-tui";
|
|
14
|
+
import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
|
|
15
15
|
import { readFileSync, writeFileSync, existsSync, mkdirSync } from "node:fs";
|
|
16
16
|
import { join, dirname } from "node:path";
|
|
17
17
|
import { homedir } from "node:os";
|
|
@@ -29,7 +29,9 @@ interface Settings {
|
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
type FooterSettings = NonNullable<Settings["minFooter"]>;
|
|
33
|
+
|
|
34
|
+
const DEFAULT_SETTINGS: FooterSettings = {
|
|
33
35
|
enabled: true,
|
|
34
36
|
showGitBranch: true,
|
|
35
37
|
showSkills: true,
|
|
@@ -67,7 +69,7 @@ function readEnabled(): boolean {
|
|
|
67
69
|
return s.minFooter?.enabled !== false; // default to true
|
|
68
70
|
}
|
|
69
71
|
|
|
70
|
-
function readConfig():
|
|
72
|
+
function readConfig(): FooterSettings {
|
|
71
73
|
const s = readSettings();
|
|
72
74
|
return { ...DEFAULT_SETTINGS, ...s.minFooter };
|
|
73
75
|
}
|
|
@@ -176,12 +178,17 @@ export default function (pi: ExtensionAPI) {
|
|
|
176
178
|
render(width: number): string[] {
|
|
177
179
|
const left = buildLeft();
|
|
178
180
|
const right = buildRight(footerData, (s) => theme.bold(s));
|
|
179
|
-
const leftW = visibleWidth(left);
|
|
180
181
|
const rightW = visibleWidth(right);
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
|
|
183
|
+
// If the right side (model + context) alone doesn't fit, drop the path and truncate it.
|
|
184
|
+
if (rightW >= width) {
|
|
185
|
+
return [theme.fg("dim", truncateToWidth(right, width, ""))];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Otherwise keep the right side intact and fit the path into the remaining
|
|
189
|
+
// space (padded to exactly fill it, keeping the right side right-aligned).
|
|
190
|
+
const leftPart = truncateToWidth(left, width - rightW - 1, "...", true);
|
|
191
|
+
return [theme.fg("dim", `${leftPart} ${right}`)];
|
|
185
192
|
},
|
|
186
193
|
invalidate(): void {},
|
|
187
194
|
dispose: unsub,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-minimal-footer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "A minimal footer extension for pi — clean status line with path, skills, model, and context usage.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"media/"
|
|
25
25
|
],
|
|
26
26
|
"engines": {
|
|
27
|
-
"node": ">=
|
|
27
|
+
"node": ">=22.19.0"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
|
30
30
|
"type": "git",
|