@hheei/pi-status 0.2.0 → 0.3.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 +1 -0
- package/dist/footer.d.ts +1 -1
- package/dist/footer.js +24 -8
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -21,6 +21,7 @@ The package mounts an ext-core response status tracker and replaces Pi's default
|
|
|
21
21
|
- Routing indicator when a virtual model resolves to a distinct physical model (`virtual -> physical`).
|
|
22
22
|
- Context window visualization gauge with percentage and token counts (e.g. `[████░░░░░░] 42% (84k/200k)`), colored dynamically as limits approach.
|
|
23
23
|
- Session token usage and cumulative cost tracking.
|
|
24
|
+
- Right-aligned running child agent ids followed by the TODO status, separated by ` ‧ ` (e.g. `🤖 #21 #22 #23 ‧ #1 Task`); the separator is dropped when only one side is present, and an unrelated extension status is shown only when both are absent.
|
|
24
25
|
- **Lifecycle Cleanliness**: Gracefully unmounts and restores original UI footers on session disposal or reload.
|
|
25
26
|
|
|
26
27
|
## Installation
|
package/dist/footer.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export declare function layoutTwoColumnRow(left: string, right: string | undefin
|
|
|
49
49
|
/**
|
|
50
50
|
* Custom 2-line compact footer:
|
|
51
51
|
* Line 1: path (git) title
|
|
52
|
-
* Line 2: provider/model(level) · N%/100K
|
|
52
|
+
* Line 2: provider/model(level) · N%/100K agent ids ‧ todo status
|
|
53
53
|
*/
|
|
54
54
|
export declare class CompactFooterComponent implements Component {
|
|
55
55
|
#private;
|
package/dist/footer.js
CHANGED
|
@@ -2,6 +2,10 @@ import { homedir } from "node:os";
|
|
|
2
2
|
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
3
3
|
import { visibleWidth } from "@earendil-works/pi-tui";
|
|
4
4
|
import { fitRow, formatCompactNumber } from "@hheei/pi-ext-core";
|
|
5
|
+
/** Pi native status keys owned by other extensions. */
|
|
6
|
+
const AUTO_TITLE_STATUS_KEY = "auto-title";
|
|
7
|
+
const AGENT_STATUS_KEY = "pi-subagents";
|
|
8
|
+
const TODO_STATUS_KEY = "pi-ext-tools:todo";
|
|
5
9
|
/** Formats cwd replacing HOME with ~ */
|
|
6
10
|
export function formatCwdForFooter(cwd, home) {
|
|
7
11
|
if (!home)
|
|
@@ -132,7 +136,7 @@ export function layoutTwoColumnRow(left, right, width, minGap = 2) {
|
|
|
132
136
|
/**
|
|
133
137
|
* Custom 2-line compact footer:
|
|
134
138
|
* Line 1: path (git) title
|
|
135
|
-
* Line 2: provider/model(level) · N%/100K
|
|
139
|
+
* Line 2: provider/model(level) · N%/100K agent ids ‧ todo status
|
|
136
140
|
*/
|
|
137
141
|
export class CompactFooterComponent {
|
|
138
142
|
#extension;
|
|
@@ -156,7 +160,7 @@ export class CompactFooterComponent {
|
|
|
156
160
|
const branch = this.#footerData.getGitBranch();
|
|
157
161
|
const line1Left = formatFooterPath(cwd, branch, this.#theme, homedir());
|
|
158
162
|
const extensionStatuses = this.#footerData.getExtensionStatuses();
|
|
159
|
-
const autoTitleStatus = extensionStatuses.get(
|
|
163
|
+
const autoTitleStatus = extensionStatuses.get(AUTO_TITLE_STATUS_KEY);
|
|
160
164
|
const sessionName = this.#extension.sessionManager.getSessionName();
|
|
161
165
|
const line1Right = autoTitleStatus !== undefined && autoTitleStatus.trim() !== ""
|
|
162
166
|
? autoTitleStatus
|
|
@@ -169,17 +173,29 @@ export class CompactFooterComponent {
|
|
|
169
173
|
const modelPart = formatFooterModel(this.#extension.model, this.#extension.thinkingLevel, this.#theme, routed);
|
|
170
174
|
const contextPart = formatFooterContext(this.#extension.getContextUsage(), this.#extension.model?.contextWindow, this.#theme);
|
|
171
175
|
const line2Left = `${modelPart} ${this.#theme.fg("dim", "·")} ${contextPart}`;
|
|
172
|
-
// Line 2 right:
|
|
173
|
-
|
|
174
|
-
|
|
176
|
+
// Line 2 right: running child agents then TODO, joined by a dim separator. A missing
|
|
177
|
+
// segment drops the separator with it. Any other extension status is only a fallback,
|
|
178
|
+
// so auto-title (line 1) and these two keys never leak in twice.
|
|
179
|
+
const agentStatus = extensionStatuses.get(AGENT_STATUS_KEY);
|
|
180
|
+
const todoStatus = extensionStatuses.get(TODO_STATUS_KEY);
|
|
181
|
+
const statusParts = [];
|
|
182
|
+
if (agentStatus !== undefined && agentStatus.trim() !== "")
|
|
183
|
+
statusParts.push(agentStatus);
|
|
184
|
+
if (todoStatus !== undefined && todoStatus.trim() !== "")
|
|
185
|
+
statusParts.push(todoStatus);
|
|
186
|
+
let line2Right = statusParts.length > 0 ? statusParts.join(this.#theme.fg("dim", " ‧ ")) : undefined;
|
|
187
|
+
if (line2Right === undefined) {
|
|
175
188
|
for (const [key, value] of extensionStatuses) {
|
|
176
|
-
if (key !==
|
|
177
|
-
|
|
189
|
+
if (key !== AUTO_TITLE_STATUS_KEY &&
|
|
190
|
+
key !== AGENT_STATUS_KEY &&
|
|
191
|
+
key !== TODO_STATUS_KEY &&
|
|
192
|
+
value.trim() !== "") {
|
|
193
|
+
line2Right = value;
|
|
178
194
|
break;
|
|
179
195
|
}
|
|
180
196
|
}
|
|
181
197
|
}
|
|
182
|
-
const line2 = layoutTwoColumnRow(line2Left,
|
|
198
|
+
const line2 = layoutTwoColumnRow(line2Left, line2Right, width);
|
|
183
199
|
return [line1, line2];
|
|
184
200
|
}
|
|
185
201
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hheei/pi-status",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Response telemetry for Pi sessions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@hheei/pi-ext-core": "^0.
|
|
38
|
+
"@hheei/pi-ext-core": "^0.5.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@earendil-works/pi-coding-agent": ">=1.
|
|
42
|
-
"@earendil-works/pi-tui": ">=1.
|
|
41
|
+
"@earendil-works/pi-coding-agent": ">=1.3.0",
|
|
42
|
+
"@earendil-works/pi-tui": ">=1.3.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@earendil-works/pi-coding-agent": "1.
|
|
46
|
-
"@earendil-works/pi-tui": "1.
|
|
45
|
+
"@earendil-works/pi-coding-agent": "1.3.0",
|
|
46
|
+
"@earendil-works/pi-tui": "1.3.0"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "node -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.build.json"
|