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

zam-adapter-telegram

v0.1.0

Published

Reference adapter: governs a Telegram bot's per-message context via the ZAM context plane, deriving requestSignals from update metadata (chat type, reply).

Readme

zam-adapter-telegram

The third reference adapter for the ZAM context plane (docs/40). It governs a Telegram bot's per-message context, and it is the adapter that exercises the core's requestSignals caller tier — because a message's group-ness or is-a-reply lives in metadata, not in the text the deterministic router sees.

Same docs/37 §5 contract as the OpenClaw (docs/38) and MCP (docs/39) adapters — a third surface, no core change.

Honest scope: no live Telegram transport (no token, no polling/webhook). The adapter operates on a provided bot context inventory + a Telegram Update object (Bot API shape) supplied as data, with a synthetic example-bot.json. Single-family by design: a group message is governed as group_chat_behavior even if its text is about code (the metadata signal wins).

How it works

  1. Build the bot's BotComponent[] (body + light governance) → a schema-valid registry.
  2. Derive signals from the update metadata (deriveSignals):
    • chat.type ∈ {group, supergroup}group_chat_behavior (via requestSignals, which takes precedence over the text router),
    • a reply (reply_to_message) → history_sensitive,
    • otherwise → null, so the deterministic text router classifies the message.
  3. Plan (plan()) and assemble the prompt from the selected components only.

governUpdate does all three.

Usage

import { governUpdate } from 'zam-adapter-telegram';

const { promptFamily, signals, prompt, stats } = governUpdate({
  components,                                   // the bot's context inventory
  update: { message: { message_id: 1, chat: { id: 1, type: 'group' }, text: 'hi all' } },
});
// promptFamily === 'group_chat_behavior' (from metadata); prompt includes the group-etiquette scaffold

CLI

zam-telegram --bot ./example-bot.json --text "fix the build error" --chat-type private
zam-telegram --bot ./example-bot.json --text "hi everyone" --chat-type group   # group-etiquette surfaced

Build & test

npm install   # installs context-plane from npm
npm run build
npm test