npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bytesbrains/pi-telegram-bridge

v1.4.0

Published

Telegram bot bridge for pi agents — send messages, ask questions, and listen for human replies via Telegram.

Readme

pi-telegram-bridge

Telegram bot bridge for pi agents — send messages, ask questions, and listen for human replies via Telegram.

Install

pi install npm:@bytesbrains/pi-telegram-bridge

Configuration

Set the following environment variables:

export TELEGRAM_BOT_TOKEN="123456:ABC-DEF1234ghikl-zyx57W2v1u123ew11"
export TELEGRAM_CHAT_ID="123456789"

| Variable | Required | Description | |----------|----------|-------------| | TELEGRAM_BOT_TOKEN | ✅ | Bot token from @BotFather | | TELEGRAM_CHAT_ID | ✅ | Target chat ID (your personal chat or a group) |

Tools

telegram_listen

Check for new inbound messages from the human.

telegram_listen()

telegram_send

Send a one-way message. Use for status updates and progress reports.

telegram_send(message="Build completed successfully ✅")

telegram_ask

Ask a question with inline keyboard options and wait for a human reply. Blocks until answered or timeout (default 30 min).

telegram_ask(question="Deploy to production?")
telegram_ask(question="Which branch?", options=["main", "staging", "dev"])
telegram_ask(question="Approve this change?", options=["Approve", "Reject", "Need changes"], timeoutMinutes=5)

telegram_override

Ask a human to approve or reject a blocked action (force push, destructive git ops, file deletion, etc.). Designed for supervisor override flows. Returns details.action = "proceed"|"abort"|"explain" so the agent can call supervisor_override() or abort.

telegram_override(
  command="git push gitea feat/add-check --force",
  reason="Force push can overwrite remote history"
)

telegram_override(
  command="rm -rf node_modules",
  reason="Recursive deletion outside project boundary",
  context="User requested a clean reinstall of dependencies",
  options=["Yes, it's fine", "No, cancel", "Use npx instead", "Explain more"],
  timeoutMinutes=10
)

Parameters: | Param | Required | Default | Description | |-------|----------|---------|-------------| | command | ✅ | — | The blocked command or action | | reason | ✅ | — | Why it was blocked by the supervisor | | context | ❌ | — | Additional context (what the user asked for, etc.) | | options | ❌ | ["Yes, proceed", "No, cancel", "Explain more"] | Custom button labels | | timeoutMinutes | ❌ | 30 | How long to wait for a response |

Returns details: | Field | Type | Description | |-------|------|-------------| | choice | string | The exact button label the human clicked | | action | string | "proceed" (first option), "abort" (second option), or "explain" (anything else) | | command | string | The original blocked command | | timedOut | boolean | Whether the request timed out |

Agent workflow:

  1. Agent gets blocked by supervisor
  2. Calls telegram_override(command, reason, context)
  3. Checks details.action:
    • "proceed" → call supervisor_override(reason, command)
    • "abort" → tell user action was cancelled
    • "explain" → call telegram_send(message="...") with more context, then re-ask
  4. If details.timedOut → abort the action

telegram_status

Check if the bridge is configured and running.

telegram_status()

Background Listener

The extension starts a background listener on session start that polls for incoming Telegram messages. Any non-bot text message in the configured chat is forwarded to the agent as a user message. The agent responds with a confirmation.

The listener runs automatically — no manual setup needed.

How It Works

  1. Session start: The bridge restores the last processed update ID from session state and starts polling
  2. Inbound messages: Non-bot text messages in the configured chat are forwarded to the agent
  3. Session end: The listener stops cleanly on session shutdown
  4. Update ID is persisted across sessions to avoid processing duplicate messages

Get a Bot Token

  1. Open Telegram and chat with @BotFather
  2. Send /newbot and follow the prompts
  3. Copy the token and set TELEGRAM_BOT_TOKEN
  4. Send a message to your bot, then visit: https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates
  5. Copy the chat.id from the response and set TELEGRAM_CHAT_ID

Requirements

  • Node.js >= 18
  • A Telegram bot token
  • A chat ID to send/receive messages

License

MIT