token-stats-timer 1.0.10 → 1.0.11

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/step-timer.ts +4 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "token-stats-timer",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "pi extension to display token usage and time spend.",
5
5
  "keywords": [
6
6
  "pi-package",
package/step-timer.ts CHANGED
@@ -92,11 +92,12 @@ export function createStepTimer(pi: ExtensionAPI): void {
92
92
  lastCtx = undefined;
93
93
  });
94
94
 
95
- pi.registerEntryRenderer<FinalTimingData>(FINAL_TYPE, (entry, _opts, _theme) => {
95
+ pi.registerEntryRenderer<FinalTimingData>(FINAL_TYPE, (entry, _opts, theme) => {
96
96
  const d = entry.data;
97
97
  if (!d) return undefined;
98
- const box = new Box(1, 1);
99
- box.addChild(new Text(`总耗时 ${formatDuration(d.totalMs)}`, 0, 0));
98
+ const title = theme.fg("accent", "总耗时");
99
+ const box = new Box(1, 1, (text) => theme.bg("customMessageBg", text));
100
+ box.addChild(new Text(`${title} ${formatDuration(d.totalMs)}`, 0, 0));
100
101
  return box;
101
102
  });
102
103
  }