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

@conclave-ai/telegram-bot-runner

v0.5.11

Published

Conclave AI Telegram bot-runner — long-polls Telegram callback_query events and dispatches repository_dispatch actions back to the target repo's GH Actions workflows.

Downloads

2,051

Readme

@conclave-ai/telegram-bot-runner

Long-polls Telegram callback_query updates (the 🔧 Rework / ✅ Approve / ❌ Reject buttons that @conclave-ai/integration-telegram renders) and dispatches repository_dispatch events back to the target repo's GH Actions workflows.

Closes the final gap documented in next_session_kickoff.md: the notifier already emits action buttons, but until now clicking them did nothing.

How it fits together

Telegram user clicks 🔧 Rework
   → callback_query (update_id N, data="ep:<id>:reworked")
   → runBotOnce() reads it via getUpdates
   → gh api repos/<repo>/dispatches -f event_type=conclave-rework
        -f client_payload='{"episodic":"<id>", ...}'
   → GH Actions `rework.yml` workflow fires
   → workflow checks out the PR branch, runs `conclave rework --episodic <id>`
   → worker agent generates patch → commit + push → review re-runs automatically

Merge / reject map the same way — the bot-runner only dispatches, it never touches PR state directly. That keeps the token blast radius small: it needs actions: write on the target repo, nothing more.

Running as a GH Actions cron

# .github/workflows/telegram-bot.yml
name: conclave-telegram-bot
on:
  schedule:
    - cron: '*/1 * * * *'
  workflow_dispatch:

jobs:
  poll:
    runs-on: ubuntu-latest
    permissions: { contents: read, actions: write }
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: '20' }
      - uses: actions/cache@v4
        with:
          path: .telegram-bot-offset.json
          key: telegram-bot-offset
      - run: npx -p @conclave-ai/telegram-bot-runner conclave-telegram-bot --repo ${{ github.repository }}
        env:
          TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
          GH_TOKEN: ${{ secrets.ORCHESTRATOR_PAT }}

The offset file is cached across runs so consecutive polls don't double-process the same callback. --poll-timeout 25 means each tick blocks for up to 25 seconds on the Telegram side — the job typically finishes in under 30 seconds even when nothing is queued.

API (for embedding)

import { runBotOnce } from "@conclave-ai/telegram-bot-runner";

const result = await runBotOnce({
  botToken: process.env.TELEGRAM_BOT_TOKEN!,
  repo: "acme/service",
  offset: savedOffset,         // persisted between runs
  pollTimeoutSec: 25,
  allowOutcomes: ["reworked"], // e.g. disable auto-merge from Telegram
});

// result.parsed:     every callback we saw
// result.dispatched: the ones we actually fired repository_dispatch for
// result.errors:     per-update errors (non-fatal)
// result.nextOffset: persist this and pass as `offset` next call

Trust model

  • The bot runs on GH Actions with ORCHESTRATOR_PAT. Anyone who can click the Telegram button can trigger a dispatch. Telegram does not authenticate users beyond "they're in the chat." That means the chat ACL is the authorisation surface — keep the chat private, invite only people who are allowed to rework/merge/reject PRs.
  • The dispatcher never shells out gh pr merge itself — the target repo's workflow does, behind its own branch protection rules. So even a spoofed callback can't merge a PR that doesn't otherwise meet the repo's requirements.
  • The bot's answerCallbackQuery shows the user what happened (✓ conclave-rework dispatched or ⚠ dispatch failed) so they know the button did something.

Zero runtime dependencies

Uses only globalThis.fetch (Node 18+) and the gh CLI. No Telegram SDK, no Octokit.