@brain0pia/pi-notify
v0.2.0
Published
Pi package that sends Telegram notifications after each completed agent response.
Downloads
144
Maintainers
Readme
@brain0pia/pi-notify
Pi package that sends a Telegram notification after each completed Pi agent response.
Install
pi install npm:@brain0pia/pi-notifyFor local development you can also load the package directly:
pi -e /absolute/path/to/pi-notifyConfigure
Create ~/.pi/notify.json:
{
"botToken": "123456:ABCDEF...",
"chatId": "123456789"
}Optional: add a session URL template. If present, SESSION_ID is replaced with the current Pi session id and the resolved link is included in each Telegram notification.
{
"botToken": "123456:ABCDEF...",
"chatId": "123456789",
"sessionUrlTemplate": "https://session-viewer.example/#SESSION_ID"
}You can also manage that field from Pi with the slash command:
/pi-notify-url https://session-viewer.example/#SESSION_IDUseful variants:
/pi-notify-url— show the current template/pi-notify-url off— clear the template
Behavior
After every agent_end event the extension:
- Finds the latest assistant text from the completed run.
- Shows a 30-second overlay countdown.
- Sends immediately on
Enter. - Cancels on any other key.
- Sends automatically when the countdown reaches zero.
The Telegram payload includes metadata (project, cwd, timestamp, model) plus the full assistant output. If sessionUrlTemplate is configured, the notification also includes an Open session link built from the current session id. Short outputs are sent as a MarkdownV2 message with a plain-text fallback on parse errors. Long outputs are sent as a short header message plus a .md attachment containing the full response.
Development
npm install
npm test
npm run check