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

@sokko/flue

v0.3.1

Published

This package wires a Flue agent to Sokko. It selects the Sokko-managed model, and it mounts Sokko policy around Flue's native Slack and Telegram webhook channels. It uses `@flue/slack` and `@flue/telegram` for request verification and routing. The agent s

Readme

@sokko/flue

This package wires a Flue agent to Sokko. It selects the Sokko-managed model, and it mounts Sokko policy around Flue's native Slack and Telegram webhook channels. It uses @flue/slack and @flue/telegram for request verification and routing. The agent sends replies itself through a bound reply tool, so the package adds no background runner.

Model

Register the Sokko-managed provider once at module scope. Read the model inside the agent.

import { setSokkoProvider } from '@sokko/flue';

setSokkoProvider();
'use agent';
import { useSokkoModel } from '@sokko/flue';

export function Assistant() {
	useSokkoModel();
	return '…your system prompt…';
}

setSokkoProvider() reads the Sokko model environment and registers one Flue provider: OpenAI, Anthropic, OpenRouter, or the ChatGPT subscription. useSokkoModel() selects the model id. Sokko sets that id from the Model tab as FLUE_MODEL. Pass useSokkoModel({ modelId }) to pin a model in code. Pass useSokkoModel({ fallbackModelId }) to set a default. The precedence is modelId, then FLUE_MODEL, then fallbackModelId. The provider and the credential always come from Sokko, so a pinned id must be one that provider can serve.

Channels

import { mountSokkoChannels } from '@sokko/flue';

mountSokkoChannels(app, { agent: Assistant });

The mount adds these routes when their credential pairs are present:

  • POST /channels/slack/events
  • POST /channels/telegram/webhook

The package does not add a Slack interactions or slash-command route. Sokko does not expose or advertise those surfaces for Flue agents.

Environment

Slack requires SLACK_BOT_TOKEN and SLACK_SIGNING_SECRET. Telegram requires TELEGRAM_BOT_TOKEN and TELEGRAM_WEBHOOK_SECRET_TOKEN. A partial credential pair throws when the application mounts the channels.

The package also reads Sokko's provider policy variables:

  • SLACK_ALLOWED_USERS
  • SLACK_REQUIRE_MENTION
  • TELEGRAM_ALLOWED_USERS
  • TELEGRAM_GROUP_ALLOWED_CHATS
  • TELEGRAM_GROUP_ALLOWED_USERS
  • TELEGRAM_REQUIRE_MENTION

Inbound dispatch

The verified callback applies policy and dispatches one Flue message, then returns 200. The dispatch carries the provider redelivery id as its idempotencyKey (a Slack event_id or a Telegram update_id), so Flue delivers and answers each event at most once. The dispatch also carries an initialData seed that names the reply destination.

Reply delivery

The agent replies by calling a bound reply tool. Add one line inside the agent function.

'use agent';
import { useSokkoModel, useSokkoChannelReply } from '@sokko/flue';

export function Assistant() {
	useSokkoModel();
	useSokkoChannelReply();
	return 'Reply in the bound channel conversation when appropriate.';
}

useSokkoChannelReply() reads the dispatch seed with useInitialData() and binds the matching reply tool with useTool. The tool posts to the same Slack thread or Telegram conversation and reads SLACK_BOT_TOKEN or TELEGRAM_BOT_TOKEN from the pod environment. The hook is a no-op when the instance has no channel seed.

Bind a reply tool directly with sokkoSlackReply({ channelId, threadTs }) or sokkoTelegramReply({ chatId, messageThreadId }) when the agent reads the destination itself.