fold omp runtime config and remaining pi extensions into source
This commit is contained in:
parent
6c3a47f350
commit
bacafdf715
4 changed files with 446 additions and 6 deletions
37
dot_pi/agent/extensions/private_notify.ts
Normal file
37
dot_pi/agent/extensions/private_notify.ts
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/**
|
||||
* Pi Notify Extension (with audible bell)
|
||||
*
|
||||
* Fires a terminal bell + native desktop notification when Pi finishes.
|
||||
* - Bell (\x07): tmux flags the window in the status bar + audible ding
|
||||
* - OSC 777: Ghostty, iTerm2, WezTerm desktop notification popup
|
||||
* - OSC 99: Kitty desktop notification popup
|
||||
*
|
||||
* Based on the official example from earendil-works/pi, with bell added.
|
||||
*/
|
||||
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
||||
|
||||
function notifyOSC777(title: string, body: string): void {
|
||||
process.stdout.write(`\x1b]777;notify;${title};${body}\x07`);
|
||||
}
|
||||
|
||||
function notifyOSC99(title: string, body: string): void {
|
||||
process.stdout.write(`\x1b]99;i=1:d=0;${title}\x1b\\`);
|
||||
process.stdout.write(`\x1b]99;i=1:p=body;${body}\x1b\\`);
|
||||
}
|
||||
|
||||
function notify(title: string, body: string): void {
|
||||
// Audible bell — tmux catches this, flags the window, terminal dings
|
||||
process.stdout.write("\x07");
|
||||
// Desktop notification popup (OSC 777 for Ghostty, OSC 99 for Kitty)
|
||||
if (process.env.KITTY_WINDOW_ID) {
|
||||
notifyOSC99(title, body);
|
||||
} else {
|
||||
notifyOSC777(title, body);
|
||||
}
|
||||
}
|
||||
|
||||
export default function (pi: ExtensionAPI) {
|
||||
pi.on("agent_end", async () => {
|
||||
notify("Pi", "Task complete — ready for input");
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue