Files
dev/third_party/pi/packages/coding-agent/examples/extensions/working-message-test.ts
alexion 4def357d09 chore(vendor): import pi 0.85.1
Imported as a linear vendor commit so forge rebases do not replay the upstream root tree.

git-subtree-dir: third_party/pi

git-subtree-split: d981de1229ef899957bbe968bc8dcda02a21f477
2026-09-14 10:48:47 -04:00

26 lines
904 B
TypeScript

/**
* Working Message Persistence Test
*
* Sets a custom working message and indicator on session start so you can
* verify they survive across loader recreations (e.g. between agent turns).
*
* Usage:
* pi --extension examples/extensions/working-message-test.ts
*
* Then send a few messages in interactive mode. The working message should
* stay "Working... (custom)" with a brown dot indicator every time the
* loader appears, not revert to the default gray "Working...".
*/
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
const CUSTOM_MESSAGE = "\x1b[38;2;155;86;63mWorking... (custom)\x1b[39m";
const CUSTOM_INDICATOR = { frames: ["\x1b[38;2;155;86;63m●\x1b[39m"] };
export default function (pi: ExtensionAPI) {
pi.on("session_start", async (_event, ctx) => {
ctx.ui.setWorkingMessage(CUSTOM_MESSAGE);
ctx.ui.setWorkingIndicator(CUSTOM_INDICATOR);
});
}