@brain0pia/pi-notify

Pi package that sends Telegram notifications after each completed agent response.

Package details

extension

Install @brain0pia/pi-notify from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@brain0pia/pi-notify
Package
@brain0pia/pi-notify
Version
0.2.0
Published
Mar 14, 2026
Downloads
38/mo · 6/wk
Author
brain0pia
License
unknown
Types
extension
Size
55 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@brain0pia/pi-notify

Pi package that sends a Telegram notification after each completed Pi agent response.

Install

pi install npm:@brain0pia/pi-notify

For local development you can also load the package directly:

pi -e /absolute/path/to/pi-notify

Configure

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_ID

Useful variants:

  • /pi-notify-url — show the current template
  • /pi-notify-url off — clear the template

Behavior

After every agent_end event the extension:

  1. Finds the latest assistant text from the completed run.
  2. Shows a 30-second overlay countdown.
  3. Sends immediately on Enter.
  4. Cancels on any other key.
  5. 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