@wierdbytes/pi-facelift 0.6.3 → 0.6.5
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 +11 -0
- package/index.ts +15 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.5
|
|
4
|
+
|
|
5
|
+
- **Fix:** pi crashing with "extension ctx is stale" when the session was replaced or reloaded while the working timer was ticking.
|
|
6
|
+
|
|
7
|
+
## 0.6.4
|
|
8
|
+
|
|
9
|
+
- **Fix:** declare `shiki` as a runtime dependency instead of a dev-only one.
|
|
10
|
+
`index.ts` imports `bundledThemes` from `shiki` at runtime, so installs
|
|
11
|
+
without dev dependencies crashed with `Cannot find module 'shiki'` and
|
|
12
|
+
the extension failed to load.
|
|
13
|
+
|
|
3
14
|
## 0.6.3
|
|
4
15
|
|
|
5
16
|
- **New:** `tps` (output tokens/sec) next to the working timer — live `~`-prefixed estimate from streamed deltas and exact final from `usage.output`.
|
package/index.ts
CHANGED
|
@@ -1180,11 +1180,24 @@ export default function piFaceliftExtension(pi: PiFaceliftApi, deps?: PiFacelift
|
|
|
1180
1180
|
};
|
|
1181
1181
|
|
|
1182
1182
|
const renderWorkingMessage = (ctx: SessionContextLike): void => {
|
|
1183
|
-
|
|
1184
|
-
|
|
1183
|
+
// The ticker captures `ctx`; after session replacement / reload any
|
|
1184
|
+
// access to it throws (stale ctx). Inside a timer that would be an
|
|
1185
|
+
// uncaughtException and kill pi, so swallow and stop ticking.
|
|
1186
|
+
try {
|
|
1187
|
+
if (ctx.hasUI) {
|
|
1188
|
+
ctx.ui.setWorkingMessage(workingMessageText(workingTracker.elapsedMs(), workingTracker.liveTps()));
|
|
1189
|
+
}
|
|
1190
|
+
} catch {
|
|
1191
|
+
stopWorkingTick();
|
|
1185
1192
|
}
|
|
1186
1193
|
};
|
|
1187
1194
|
|
|
1195
|
+
// Session replaced / reloaded / exiting mid-stream: message_end and
|
|
1196
|
+
// agent_settled may never arrive, so kill the ticker here.
|
|
1197
|
+
pi.on("session_shutdown", () => {
|
|
1198
|
+
stopWorkingTick();
|
|
1199
|
+
});
|
|
1200
|
+
|
|
1188
1201
|
// `before_agent_start` fires right after the user submits the prompt,
|
|
1189
1202
|
// so it anchors the wall-clock `total` (retries + tools + overhead).
|
|
1190
1203
|
pi.on("before_agent_start", () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wierdbytes/pi-facelift",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "Cosmetic facelift for built-in pi tool output — open-right rounded frames, syntax-highlighted reads, status-aware bash summaries, find/grep.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@shikijs/cli": "^4.0.2",
|
|
56
|
-
"@wierdbytes/pi-common": "^0.4.0"
|
|
56
|
+
"@wierdbytes/pi-common": "^0.4.0",
|
|
57
|
+
"shiki": "^4.0.2"
|
|
57
58
|
},
|
|
58
59
|
"peerDependencies": {
|
|
59
60
|
"@earendil-works/pi-ai": ">=0.74.0",
|
|
@@ -64,7 +65,6 @@
|
|
|
64
65
|
"@earendil-works/pi-ai": "^0.74.0",
|
|
65
66
|
"@earendil-works/pi-coding-agent": "^0.74.0",
|
|
66
67
|
"@earendil-works/pi-tui": "^0.74.0",
|
|
67
|
-
"shiki": "^4.0.2",
|
|
68
68
|
"vitest": "^4.0.18"
|
|
69
69
|
}
|
|
70
70
|
}
|