Files
sproutclaw/.pi/agent/extensions-disabled/redraws/index.ts
shumengya ad62015fe3
Some checks failed
CI / build-check-test (push) Has been cancelled
chore: commit pending workspace updates
2026-06-14 20:36:01 +08:00

25 lines
609 B
TypeScript

/**
* Redraws Extension
*
* Exposes /tui to show TUI redraw stats.
*/
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
import { Text } from "@earendil-works/pi-tui";
export default function (pi: ExtensionAPI) {
pi.registerCommand("tui", {
description: "Show TUI stats",
handler: async (_args, ctx) => {
if (!ctx.hasUI) return;
let redraws = 0;
await ctx.ui.custom<void>((tui, _theme, _keybindings, done) => {
redraws = tui.fullRedraws;
done(undefined);
return new Text("", 0, 0);
});
ctx.ui.notify(`TUI full redraws: ${redraws}`, "info");
},
});
}