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

@llblab/pi-telegram-extension-demo

v0.1.2

Published

Demo Pi extension for Pi-Telegram — proves third-party devs can extend the Telegram interface

Readme

pi-telegram-extension-demo

pi-telegram-extension-demo screenshot

Reference implementation of a third-party extension for pi-telegram.

This extension proves that ordinary pi extensions can add interactive buttons to the Telegram bot interface — main menu rows, Settings submenu toggles, and inline views — without owning a second bot poller, forking transport, or touching pi-telegram internals.

Import registerTelegramSection from @llblab/pi-telegram, define a section with render, handleCallback, and optional settings, and the bridge handles polling, callback routing, navigation hierarchy, authorization, and diagnostics.

Install

From npm:

pi install npm:@llblab/pi-telegram-extension-demo

From git:

pi install git:github.com/llblab/pi-telegram-extension-demo

Requires @llblab/pi-telegram ^0.10.0 (which provides the Extension Sections platform).

What it registers

Two UI surfaces through pi-telegram's Extension Sections platform:

  • Main menu🧪 Demo submenu row before ⚙️ Settings. Opens an interactive panel with enqueue-prompt, answer-callback, info popup, a live counter, and a confirmation dialog (💬 Confirm dialog) that sends buttons into chat, deletes itself on answer, and posts a follow-up message.
  • Settings submenu🧪 Demo settings row with a dynamic ON/OFF status indicator (🟢/⚫️). Opens a toggle panel where clicking ON/OFF re-renders the view and updates the indicator in the Settings list.

Every button click produces an unambiguous result: a queued prompt, a native Telegram popup, or a message edit. Navigation hierarchy (Back → parent, Main menu → root) is preserved automatically by the platform.

How it works

import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
import { registerTelegramSection } from "@llblab/pi-telegram/lib/extension-sections.ts";

export default function (pi: ExtensionAPI) {
  const unregister = registerTelegramSection({
    id: "@llblab/pi-telegram-extension-demo",
    label: "🧪 Demo submenu",
    render: async (ctx) => ({
      text: "<b>Demo</b>",
      replyMarkup: {
        inline_keyboard: [
          [{ text: "Click me", callback_data: ctx.callbackData("act") }],
        ],
      },
    }),
    handleCallback: async (ctx) => {
      await ctx.answerCallback(`action: ${ctx.action}`);
      return "handled";
    },
  });
  pi.on("session_shutdown", () => unregister());
}
  1. registerTelegramSection() adds a row to the main menu and registers callback handlers
  2. ctx.callbackData() builds a namespaced callback string — never hand-roll section: tokens
  3. ctx.edit(), ctx.open(), ctx.enqueuePrompt(), ctx.answerCallback() are the only surface area
  4. The bridge owns: polling, Telegram API, menu rendering, callback routing, navigation, stale-token answers
  5. pi.on("shutdown", ...) cleans up on unload

Dependencies

  • @llblab/pi-telegram ^0.10.0 (peer) — provides registerTelegramSection and the shared Telegram shell
  • @earendil-works/pi-coding-agent (peer) — provides ExtensionAPI types

Reference

License

MIT