pi-hud 0.1.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/README.md ADDED
@@ -0,0 +1,114 @@
1
+ ![pi-hud](assets/pi-hud.jpeg)
2
+
3
+ Persistent right-side HUD for [Pi](https://pi.dev).
4
+
5
+ It shows the current session, model/context usage, subagent activity, project path, and git branch without stealing focus from the editor.
6
+
7
+ ## Features
8
+
9
+ - Starts visible by default when the extension is installed.
10
+ - `/hud` toggle command.
11
+ - `/hud-settings` configuration command.
12
+ - Default hide/show keyboard shortcut: `f2`.
13
+ - Default minimize/expand keyboard shortcut: `ctrl+h`.
14
+ - Non-blocking TUI overlay: keep typing while the hud is visible.
15
+ - Live subagent status:
16
+ - running/done/error counts;
17
+ - active task label;
18
+ - elapsed time;
19
+ - token/context count when available.
20
+ - Session context usage and cost.
21
+ - Project path and current git branch.
22
+ - MCP server names when `pi-mcp-adapter` is installed.
23
+
24
+ ## Install
25
+
26
+ ```bash
27
+ pi install npm:pi-hud
28
+ ```
29
+
30
+ For project-local install:
31
+
32
+ ```bash
33
+ pi install -l npm:pi-hud
34
+ ```
35
+
36
+ ## Try locally
37
+
38
+ From this repository:
39
+
40
+ ```bash
41
+ pi -e .
42
+ ```
43
+
44
+ From the Pi monorepo checkout during development:
45
+
46
+ ```bash
47
+ ./pi-test.sh --no-env -e /path/to/pi-hud
48
+ ```
49
+
50
+ The HUD opens automatically on session start. Inside Pi, run:
51
+
52
+ ```text
53
+ /hud
54
+ ```
55
+
56
+ Run `/hud` again, or press `f2`, to hide or show it. Press `ctrl+h` to minimize or expand it.
57
+
58
+ ## Commands
59
+
60
+ | Command | Description |
61
+ | --- | --- |
62
+ | `/hud` | Toggle the hud. |
63
+ | `/hud-settings` | Configure position, shortcuts, auto-compact, and sizing. |
64
+
65
+ ## Settings
66
+
67
+ `pi-hud` reads a `hud` object from Pi settings. Global settings live in `~/.pi/agent/settings.json`; project settings in `.pi/settings.json` override them.
68
+
69
+ Defaults:
70
+
71
+ ```json
72
+ {
73
+ "hud": {
74
+ "position": "top-right",
75
+ "shortcut": "f2",
76
+ "minimizeShortcut": "ctrl+h",
77
+ "autoCompactWhileStreaming": true,
78
+ "expandedWidth": 42,
79
+ "compactWidth": 26,
80
+ "minTerminalWidth": 90,
81
+ "margin": { "top": 1, "right": 1, "bottom": 1 }
82
+ }
83
+ }
84
+ ```
85
+
86
+ Supported `position` values are `center`, `top-left`, `top-right`, `bottom-left`, `bottom-right`, `top-center`, `bottom-center`, `left-center`, and `right-center`.
87
+
88
+ Examples:
89
+
90
+ ```text
91
+ /hud-settings position bottom-right
92
+ /hud-settings shortcut ctrl+shift+h
93
+ /hud-settings minimizeShortcut ctrl+h
94
+ /hud-settings autoCompactWhileStreaming off
95
+ ```
96
+
97
+ Shortcut changes require `/reload` because shortcuts are registered when the extension loads. Do not bind HUD shortcuts to `enter`, `return`, `alt+m`, `ctrl+m`, `ctrl+shift+m`, `ctrl+j`, or `ctrl+shift+j`; those conflict with Pi or terminal input keys.
98
+
99
+ ## Notes
100
+
101
+ - MCP servers are shown only when Pi has `pi-mcp-adapter` installed; config files alone do not enable the section.
102
+ - Subagent status is based on Pi extension events and `pi-subagents` tool/result shapes when available.
103
+ - The HUD auto-compacts for the full assistant turn and expands when the turn ends, instead of changing state on each reasoning update.
104
+ - The overlay is hidden on narrow terminals under the configured `minTerminalWidth`.
105
+
106
+ ## Inspiration
107
+
108
+ `pi-hud` is inspired by [sub-agent-statusline](https://github.com/Joaquinvesapa/sub-agent-statusline).
109
+
110
+ ---
111
+
112
+ ## License
113
+
114
+ MIT
Binary file
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "pi-hud",
3
+ "version": "0.1.0",
4
+ "description": "A persistent hud for Pi with context, project, and subagent status.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/ludevdot/pi-hud.git"
10
+ },
11
+ "keywords": [
12
+ "pi-package",
13
+ "pi",
14
+ "hud",
15
+ "tui",
16
+ "coding-agent"
17
+ ],
18
+ "files": [
19
+ "extensions",
20
+ "assets",
21
+ "README.md",
22
+ "LICENSE"
23
+ ],
24
+ "pi": {
25
+ "extensions": [
26
+ "./extensions"
27
+ ],
28
+ "image": "https://cdn.jsdelivr.net/npm/pi-hud/assets/pi-hud.jpeg"
29
+ },
30
+ "peerDependencies": {
31
+ "@earendil-works/pi-ai": "*",
32
+ "@earendil-works/pi-coding-agent": "*",
33
+ "@earendil-works/pi-tui": "*"
34
+ },
35
+ "devDependencies": {
36
+ "@earendil-works/pi-ai": "0.74.1",
37
+ "@earendil-works/pi-coding-agent": "0.74.1",
38
+ "@earendil-works/pi-tui": "0.74.1",
39
+ "vitest": "3.2.4",
40
+ "tsx": "4.20.3",
41
+ "typescript": "5.9.2"
42
+ },
43
+ "engines": {
44
+ "node": ">=20.0.0"
45
+ },
46
+ "scripts": {
47
+ "test": "vitest --run",
48
+ "pack:dry": "pnpm pack --dry-run"
49
+ }
50
+ }