@henryqw/pi-footer 5.0.1 → 5.1.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/README.md +56 -79
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `@henryqw/pi-footer`
|
|
2
2
|
|
|
3
|
-
Keep footer identity, model usage, agent-work time, and extension status visible
|
|
3
|
+
Keep footer identity, model usage, agent-work time, and extension status visible in Pi. Use `/open` to open the current working directory. Enable the footer and open commands independently.
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
@@ -10,18 +10,16 @@ Keep footer identity, model usage, agent-work time, and extension status visible
|
|
|
10
10
|
pi install npm:@henryqw/pi-footer
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
This package
|
|
14
|
-
|
|
15
|
-
Version 3 replaces `@henryqw/pi-open-in`. If it is installed, remove it before you upgrade. This prevents duplicate `/open` and `/set-open-in` commands:
|
|
13
|
+
This package replaces `@henryqw/pi-open-in`. Remove that package before you upgrade to prevent duplicate `/open` and `/set-open-in` commands:
|
|
16
14
|
|
|
17
15
|
```bash
|
|
18
16
|
pi remove npm:@henryqw/pi-open-in
|
|
19
17
|
pi install npm:@henryqw/pi-footer
|
|
20
18
|
```
|
|
21
19
|
|
|
22
|
-
For project-local installations,
|
|
20
|
+
For project-local installations, add `--local` to both commands. Remove manually configured paths to the old package, then restart Pi. Keep the existing open command configuration at `config/pi-open-in/config.json`; do not move it.
|
|
23
21
|
|
|
24
|
-
Both entry points load by default. To
|
|
22
|
+
Both entry points load by default. To select only the open commands, use Pi's resource filter in `settings.json`:
|
|
25
23
|
|
|
26
24
|
```json
|
|
27
25
|
{
|
|
@@ -34,7 +32,7 @@ Both entry points load by default. To use `/open` without the custom footer, use
|
|
|
34
32
|
}
|
|
35
33
|
```
|
|
36
34
|
|
|
37
|
-
|
|
35
|
+
Select `extensions/footer.ts` for only the footer, or use `pi config` to toggle either resource. No package activation config is necessary.
|
|
38
36
|
|
|
39
37
|
## Works with
|
|
40
38
|
|
|
@@ -47,77 +45,64 @@ To use only the footer, select `extensions/footer.ts` instead. You can also use
|
|
|
47
45
|
|
|
48
46
|
## Use
|
|
49
47
|
|
|
50
|
-
|
|
48
|
+
Start a Pi TUI session to see the footer. Run `/open` to open the current directory in VS Code, even while the agent is busy.
|
|
51
49
|
|
|
52
50
|
| Surface | Type | Purpose |
|
|
53
51
|
| --- | --- | --- |
|
|
54
|
-
| Footer | ui | Shows footer identity, usage, model, agent-work time, and extension statuses. |
|
|
55
|
-
| `/open` | command | Opens the current
|
|
56
|
-
| `/set-open-in <command>` | command | Sets the command
|
|
57
|
-
|
|
58
|
-
Run `/set-open-in <command>` to choose another command, such as `cursor --reuse-window`. `/open` runs `<command> <current-working-directory>`.
|
|
52
|
+
| Footer | ui | Shows footer identity, usage, model, agent-work time, and extension statuses to the user. |
|
|
53
|
+
| `/open` | command | Opens the current directory for the user with the configured command. |
|
|
54
|
+
| `/set-open-in <command>` | command | Sets the user's open command, such as `cursor --reuse-window`. |
|
|
59
55
|
|
|
60
|
-
|
|
61
|
-
pi-harness · clear-field-f8d2 [+2 ~3 ?1 ↑2] · PR #123 · approved Codex #1 · 50% · 7d 1d 1h 22m
|
|
62
|
-
↑ 12.4k · ↓ 2.1k · ↺ 84.3% · ⚡ 87.4 t/s · $ 0.127 · ◔ 36.8% gpt-5.6-luna • high
|
|
63
|
-
✓ CG · ● 🐴 ponytail: ⚡ FULL ◷ 12m 34s
|
|
64
|
-
```
|
|
56
|
+
`/open` runs `<command> <current-working-directory>`.
|
|
65
57
|
|
|
66
58
|
### Footer lines
|
|
67
59
|
|
|
68
|
-
|
|
60
|
+
| Line | Left | Right |
|
|
61
|
+
| --- | --- | --- |
|
|
62
|
+
| First | Repository, branch, Git state, and `pi-pr` pull-request status. Linked-worktree branches omit the generated `worktree/` prefix. | Non-empty `pi-multi-codex` family status. |
|
|
63
|
+
| Second: usage line | Input and output token totals, latest cache-hit rate, response throughput, estimated cost, and context use. | Active model and thinking level. |
|
|
64
|
+
| Third | CodeGraph first, then other extension statuses sorted by key, including Ponytail and `pi-rewind`. | Cumulative agent-work time. |
|
|
65
|
+
|
|
66
|
+
Token and cost totals include reported tool usage and completed `pi-subagent` background workflows. Response throughput measures output tokens per second from first to last streamed content. It excludes request latency, time to first token, and later provider work, including Claude bridge shutdown. Non-streamed or instantaneous responses show `—`. Other unavailable values show `—` without a percent sign.
|
|
69
67
|
|
|
70
|
-
|
|
68
|
+
Virtual models show the latest successful physical model and thinking level after an arrow: `auto • high → gpt-5.6-luna • medium`.
|
|
71
69
|
|
|
72
|
-
|
|
70
|
+
Thinking colors are dim grey for `off` and the model name, then green `minimal`, yellow-green `low`, lime `medium`, yellow `high`, orange `xhigh`, and red `max`. Active levels use ANSI-256 colors. `ultra` uses a rainbow only when the runtime supports it; unsupported levels do not appear.
|
|
73
71
|
|
|
74
|
-
|
|
72
|
+
CodeGraph shows `✓ CG` with an index, `○ CG` in Git without an index, and no index badge outside Git. Setup shows a dim spinner and elapsed time, such as `⠋ CG · indexing 8s`. Persistent failures retain their theme-colored `!` and error text. Direct `codegraph_explore` calls temporarily show `● CG`; queries inside scripted tools do not.
|
|
75
73
|
|
|
76
|
-
|
|
74
|
+
Other dependency statuses, such as `⠋ deps · installing 12s`, disappear after completion. Middle dots separate statuses. The footer preserves colors, links, glyphs, and interior spacing, trims outer whitespace, replaces line breaks with spaces, and shortens long statuses.
|
|
77
75
|
|
|
78
76
|
### Git state
|
|
79
77
|
|
|
80
|
-
|
|
78
|
+
Badges appear only when action is necessary:
|
|
81
79
|
|
|
82
80
|
| Badge | Meaning |
|
|
83
81
|
| --- | --- |
|
|
84
82
|
| `+2` | Two staged paths |
|
|
85
83
|
| `~3` | Three unstaged tracked paths |
|
|
86
|
-
| `?N` | `N` untracked porcelain status entries |
|
|
84
|
+
| `?N` | `N` untracked porcelain status entries; Git can collapse an untracked directory into one entry. |
|
|
87
85
|
| `!1` | One unresolved path |
|
|
88
|
-
| `↑2` | Two commits ahead of
|
|
89
|
-
| `↓1` | One commit behind
|
|
90
|
-
|
|
91
|
-
`?N` counts porcelain status entries. In `--untracked-files=normal` mode, Git can collapse a whole untracked directory to one entry.
|
|
92
|
-
|
|
93
|
-
Active operations appear first, such as `REBASE 3/7`, `MERGING`, or `CHERRY-PICKING`. Detached HEAD uses the short commit form `@a1b2c3d`.
|
|
94
|
-
|
|
95
|
-
The extension reads local Git data with `git status --porcelain=v2 --branch --untracked-files=normal`. It refreshes after each agent run and branch change. It does not make an LLM call or fetch a remote. Ahead and behind counts use the last fetched upstream state.
|
|
96
|
-
|
|
97
|
-
Unavailable values render as `—` without a misleading percent sign.
|
|
98
|
-
|
|
99
|
-
`off` uses the same dim grey as the model name. Active levels use an ANSI-256 gradient: green `minimal`, yellow-green `low`, lime `medium`, yellow `high`, orange `xhigh`, and red `max`.
|
|
86
|
+
| `↑2` | Two commits ahead of upstream |
|
|
87
|
+
| `↓1` | One commit behind upstream |
|
|
100
88
|
|
|
101
|
-
|
|
89
|
+
Active operations appear first: `REBASE 3/7`, `MERGING`, or `CHERRY-PICKING`. Detached HEAD shows a short commit, such as `@a1b2c3d`.
|
|
102
90
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
Statuses from other extensions, including Ponytail and `pi-rewind`, share the left side of the third line. The footer sorts these statuses by key. It preserves colors, links, glyphs, and interior spacing. It removes leading and trailing whitespace and changes line breaks to spaces. It can shorten long statuses to fit the footer.
|
|
106
|
-
|
|
107
|
-
Only direct `codegraph_explore` tool calls trigger the `● CG` badge. The footer does not show CodeGraph queries from inside scripted tools.
|
|
91
|
+
Local Git data comes from `git status --porcelain=v2 --branch --untracked-files=normal` and refreshes after agent runs and branch changes. No model call or remote fetch occurs. Ahead and behind counts use the last fetched upstream state.
|
|
108
92
|
|
|
109
93
|
## Config
|
|
110
94
|
|
|
111
|
-
Package-owned
|
|
95
|
+
Package-owned paths under `getAgentDir()` (normally `~/.pi/agent`):
|
|
96
|
+
|
|
97
|
+
- `~/.pi/agent/config/pi-footer/config.json`: footer colors.
|
|
98
|
+
- `~/.pi/agent/config/pi-open-in/config.json`: open command, retained from `pi-open-in`.
|
|
112
99
|
|
|
113
100
|
| Name | Description | Values | Default |
|
|
114
101
|
| --- | --- | --- | --- |
|
|
115
|
-
| `colors` |
|
|
116
|
-
| `command` | Command
|
|
102
|
+
| `colors` | Footer-owned colors by role. | Object mapping roles to theme tokens, `#RGB`, `#RRGGBB`, `oklch(...)`, `okhsl(...)`, or ANSI indices `0` to `255`. | Built-in colors. |
|
|
103
|
+
| `command` | Command for `/open`. | Non-empty string. | `"code"` |
|
|
117
104
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
At each session start, the footer warns about unknown keys, unknown roles, and invalid colors. The warning gives the path and the reason. Only the invalid role uses its built-in color. The other roles keep their configured colors. A malformed file uses the built-in colors for all roles.
|
|
105
|
+
Colors load at session start; run `/reload` after edits. Missing files or roles keep built-in colors. Unknown keys, unknown roles, and invalid colors produce warnings with the path and reason. Invalid roles use built-in colors independently; malformed files use all built-in colors. The footer never rewrites the file.
|
|
121
106
|
|
|
122
107
|
### Footer color roles
|
|
123
108
|
|
|
@@ -125,14 +110,16 @@ Every role is optional:
|
|
|
125
110
|
|
|
126
111
|
| Role | Surface |
|
|
127
112
|
| --- | --- |
|
|
128
|
-
| `repository` | Repository name
|
|
129
|
-
| `branch` | Branch
|
|
130
|
-
| `gitStatus` | Git badges
|
|
131
|
-
| `input`, `output`, `cache`, `throughput`, `cost`, `context` | The six usage metrics
|
|
132
|
-
| `model` | Active
|
|
133
|
-
| `runtime` |
|
|
134
|
-
| `codegraphActive` |
|
|
135
|
-
| `separator` | Middle dots, bullets, arrows, and
|
|
113
|
+
| `repository` | Repository name. |
|
|
114
|
+
| `branch` | Branch name, with a hyperlink where supported. |
|
|
115
|
+
| `gitStatus` | Git badges. |
|
|
116
|
+
| `input`, `output`, `cache`, `throughput`, `cost`, `context` | The six usage metrics. |
|
|
117
|
+
| `model` | Active and physical models. |
|
|
118
|
+
| `runtime` | Agent-work time. |
|
|
119
|
+
| `codegraphActive` | Direct-call `● CG` badge. |
|
|
120
|
+
| `separator` | Middle dots, bullets, arrows, and truncation ellipsis. |
|
|
121
|
+
|
|
122
|
+
Theme tokens: `accent`, `dim`, `muted`, `text`, `success`, `warning`, `error`, and `thinkingText`. Colors do not change the thinking gradient or other extensions' status colors.
|
|
136
123
|
|
|
137
124
|
```json
|
|
138
125
|
{
|
|
@@ -154,17 +141,13 @@ Every role is optional:
|
|
|
154
141
|
}
|
|
155
142
|
```
|
|
156
143
|
|
|
157
|
-
Theme tokens are `accent`, `dim`, `muted`, `text`, `success`, `warning`, `error`, and `thinkingText`. Thinking levels keep their built-in gradient. Statuses from other extensions keep the colors from those extensions. The `colors` object controls neither.
|
|
158
|
-
|
|
159
144
|
### Open command
|
|
160
145
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
`/open` reads the config on every run. Only `/set-open-in` writes the file, atomically. Reads do not create or write the config home.
|
|
146
|
+
`/open` reads config on each run. Missing config silently uses `code`. Reads never create or write the config home; only `/set-open-in` writes the file, atomically.
|
|
164
147
|
|
|
165
148
|
## API
|
|
166
149
|
|
|
167
|
-
Consumers
|
|
150
|
+
Consumers must use the owner API, not read config directly. Replace `@henryqw/pi-open-in/open-uri` imports with `@henryqw/pi-footer/open-uri`:
|
|
168
151
|
|
|
169
152
|
```ts
|
|
170
153
|
import { loadOpenInConfig } from "@henryqw/pi-footer/open-uri";
|
|
@@ -173,29 +156,23 @@ const loaded = loadOpenInConfig();
|
|
|
173
156
|
if (loaded.status === "ok") console.log(loaded.value.command, loaded.issues);
|
|
174
157
|
```
|
|
175
158
|
|
|
176
|
-
These exports are for package consumers. The commands in Use are the Pi interfaces.
|
|
177
|
-
|
|
178
159
|
| Surface | Type | Purpose |
|
|
179
160
|
| --- | --- | --- |
|
|
180
|
-
| `default` (`openInExtension(pi)`) | function | Registers
|
|
181
|
-
| `OpenInConfig` | type | Describes the
|
|
182
|
-
| `loadOpenInConfig(agentDir?)` | function | Reads and validates
|
|
183
|
-
| `configuredOpenUri(path)` | function | Returns a safe VS Code URI for
|
|
161
|
+
| `default` (`openInExtension(pi)`) | function | Registers open commands without the footer. |
|
|
162
|
+
| `OpenInConfig` | type | Describes the command. |
|
|
163
|
+
| `loadOpenInConfig(agentDir?)` | function | Reads and validates owner config; accepts an optional agent directory. |
|
|
164
|
+
| `configuredOpenUri(path)` | function | Returns a safe VS Code URI for `code`, or `undefined` for other commands. |
|
|
184
165
|
|
|
185
|
-
`loadOpenInConfig` returns a `@henryqw/pi-config-store` `ConfigLoad
|
|
186
|
-
|
|
187
|
-
`configuredOpenUri(path)` works when the executable is `code`. With `code -n` or `code --new-window`, it adds `windowId=_blank` so the link opens in a new window. It returns `undefined` for other commands. An invalid config uses `code`. The function never shows a notification, because the footer calls it on each render. `@henryqw/pi-config-store` owns the config home and storage.
|
|
166
|
+
`loadOpenInConfig` returns a `@henryqw/pi-config-store` `ConfigLoad`: `status`, `source` (`"missing"` or `"file"`), `issues`, and `value` when `status` is `"ok"`. Invalid `value.command` gives `"code"` and an issue. Neither function shows notifications. `configuredOpenUri(path)` uses `code` for invalid config; `code -n` and `code --new-window` add `windowId=_blank`.
|
|
188
167
|
|
|
189
168
|
## Limits and recovery
|
|
190
169
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
An existing config file must be a JSON object with one non-empty string `command` property. An unknown key, an invalid `command`, or a malformed file shows a warning at session start, or at the next `/open`. The warning also shows when only the footer is active, because the footer link uses this config. Each issue shows one time in each session, even when the footer and `/open` are both active. The footer never shows a warning while it renders.
|
|
170
|
+
Open commands split on whitespace. Quoting and tokens with spaces are unsupported; use a wrapper script for executable paths with spaces.
|
|
194
171
|
|
|
195
|
-
|
|
172
|
+
Open config must be a JSON object with one non-empty string `command`. Unknown keys, invalid commands, or malformed files produce warnings at session start or the next `/open`, including footer-only installations. Each issue shows once per session, never during rendering. Invalid commands and malformed files use `code` without changing the file.
|
|
196
173
|
|
|
197
|
-
|
|
174
|
+
Fix config or run `/set-open-in <command>` to replace it; the command reports new issues before replacement. If the command fails, Pi reports its error output or exit code. Fix the command and retry `/open`.
|
|
198
175
|
|
|
199
|
-
|
|
176
|
+
With `code` and Pi hyperlink support, the accent-colored branch name links to the current path. `code -n` and `code --new-window` open a new window. Other executables or disabled hyperlinks give plain text.
|
|
200
177
|
|
|
201
|
-
Ghostty uses `Cmd+click`, but
|
|
178
|
+
Use primary click in Pi's default fullscreen TUI. Regular TUI (`"tuiMode": "regular"` or `--tui-mode regular`) needs terminal support for OSC 8 links and custom URI schemes. Ghostty uses `Cmd+click`, but might not open custom URI schemes.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@henryqw/pi-footer",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.1",
|
|
4
4
|
"description": "Show repository and usage details in the Pi footer and open the current working directory.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"pack:check": "npm pack --dry-run"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@earendil-works/pi-coding-agent": "^1.
|
|
32
|
-
"@earendil-works/pi-tui": "^1.
|
|
31
|
+
"@earendil-works/pi-coding-agent": "^1.3.0",
|
|
32
|
+
"@earendil-works/pi-tui": "^1.3.0"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@henryqw/pi-config-store": "^4.0.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@earendil-works/pi-coding-agent": "1.
|
|
57
|
-
"@earendil-works/pi-tui": "1.
|
|
56
|
+
"@earendil-works/pi-coding-agent": "1.3.0",
|
|
57
|
+
"@earendil-works/pi-tui": "1.3.0"
|
|
58
58
|
}
|
|
59
59
|
}
|