@wierdbytes/pi-facelift 0.6.1 → 0.6.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 +4 -0
- package/package.json +1 -1
- package/working-time.test.ts +7 -6
- package/working-time.ts +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.2
|
|
4
|
+
|
|
5
|
+
- **Fix:** live `Working...` timer now uses the same duration format as the history line (`1m5s` instead of `65s`).
|
|
6
|
+
|
|
3
7
|
## 0.6.1
|
|
4
8
|
|
|
5
9
|
- **New:** live `Working... Ns` timer on the streaming spinner and a muted `⏱ worked … (total: …)` line persisted to chat history per run — `worked` is model time only (tools excluded), `total` is wall-clock incl. retries/tool calls/overhead; toggle via `showWorkingTime` in `/facelift`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wierdbytes/pi-facelift",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
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": [
|
package/working-time.test.ts
CHANGED
|
@@ -142,10 +142,11 @@ describe("formatClock", () => {
|
|
|
142
142
|
});
|
|
143
143
|
|
|
144
144
|
describe("workingMessageText / workingTimeLine", () => {
|
|
145
|
-
it("formats the live message
|
|
146
|
-
expect(workingMessageText(0)).toBe("Working... 0s");
|
|
147
|
-
expect(workingMessageText(1999)).toBe("Working...
|
|
148
|
-
expect(workingMessageText(65_000)).toBe("Working...
|
|
145
|
+
it("formats the live message using formatClock rules", () => {
|
|
146
|
+
expect(workingMessageText(0)).toBe("Working... 0.0s");
|
|
147
|
+
expect(workingMessageText(1999)).toBe("Working... 2.0s");
|
|
148
|
+
expect(workingMessageText(65_000)).toBe("Working... 1m5s");
|
|
149
|
+
expect(workingMessageText(720_000)).toBe("Working... 12m0s");
|
|
149
150
|
});
|
|
150
151
|
|
|
151
152
|
it("renders a muted history line with worked + total", () => {
|
|
@@ -266,8 +267,8 @@ describe("working-time wiring", () => {
|
|
|
266
267
|
fire("before_provider_request", {});
|
|
267
268
|
vi.advanceTimersByTime(2000);
|
|
268
269
|
const calls = ctx.ui.setWorkingMessage.mock.calls.map((c) => c[0]);
|
|
269
|
-
expect(calls[0]).toBe("Working... 0s");
|
|
270
|
-
expect(calls).toContain("Working...
|
|
270
|
+
expect(calls[0]).toBe("Working... 0.0s");
|
|
271
|
+
expect(calls).toContain("Working... 2.0s");
|
|
271
272
|
fire("message_end", asst);
|
|
272
273
|
fire("agent_settled", {});
|
|
273
274
|
vi.useRealTimers();
|
package/working-time.ts
CHANGED
|
@@ -121,14 +121,15 @@ export class WorkingTimeTracker {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
|
-
* Build the live working message, e.g. `Working...
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
124
|
+
* Build the live working message, e.g. `Working... 1m5s`. Uses the same
|
|
125
|
+
* `formatClock` rules as the durable history line so the live and final
|
|
126
|
+
* displays stay consistent. The animated spinner frames are drawn by pi
|
|
127
|
+
* separately (via `setWorkingIndicator`), so this only supplies the
|
|
128
|
+
* trailing text — preserving whatever spinner the user/other extensions
|
|
129
|
+
* have configured.
|
|
128
130
|
*/
|
|
129
131
|
export function workingMessageText(elapsedMs: number): string {
|
|
130
|
-
|
|
131
|
-
return `Working... ${sec}s`;
|
|
132
|
+
return `Working... ${formatClock(elapsedMs)}`;
|
|
132
133
|
}
|
|
133
134
|
|
|
134
135
|
/**
|