forked from earendil-works/pi
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathworking-message-test.ts
More file actions
25 lines (22 loc) · 904 Bytes
/
Copy pathworking-message-test.ts
File metadata and controls
25 lines (22 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
* 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);
});
}