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

@reactive-agents/gateway

v0.11.1

Published

> Version: **0.10.3** — persistent autonomous agent harness for [Reactive Agents](https://docs.reactiveagents.dev/).

Readme

@reactive-agents/gateway

Version: 0.10.3 — persistent autonomous agent harness for Reactive Agents.

Keeps an agent running long-term with adaptive heartbeats, cron scheduling, webhook ingestion, a composable policy engine, chat mode (per-sender SQLite session history), and unified event routing. The gateway turns a one-shot agent into an always-on operator.

Installation

bun add @reactive-agents/gateway

Or install the umbrella:

bun add reactive-agents

Builder usage

import { ReactiveAgents } from "@reactive-agents/runtime";

const agent = await ReactiveAgents.create()
  .withName("ops-agent")
  .withProvider("anthropic")
  .withModel("claude-sonnet-4-20250514")
  .withMemory("1")
  .withGateway({
    heartbeat: { intervalMs: 1_800_000, policy: "adaptive" },
    crons: [
      { schedule: "0 9 * * MON", instruction: "Review open PRs and summarize status" },
      { schedule: "0 */6 * * *", instruction: "Check system health metrics" },
    ],
    webhooks: [
      { path: "/github", adapter: "github", secret: process.env.WEBHOOK_SECRET },
    ],
    accessControl: {
      mode: "chat",                 // 'chat' (default) or 'task'
      accessPolicy: "allowlist",
      allowedSenders: ["U_TYLER"],
    },
    policies: {
      dailyTokenBudget: 50_000,
      maxActionsPerHour: 30,
    },
  })
  .build();

await agent.start();

Direct service usage

import {
  GatewayService,
  GatewayServiceLive,
  PolicyEngine,
  SchedulerService,
  WebhookService,
  createGitHubAdapter,
  createGenericAdapter,
  createAdaptiveHeartbeatPolicy,
  createCostBudgetPolicy,
  createRateLimitPolicy,
  createEventMergingPolicy,
  createAccessControlPolicy,
  routeEvent,
  routeEventWithBus,
} from "@reactive-agents/gateway";

Key features

  • Adaptive heartbeatsalways, adaptive, or conservative policies skip idle beats to save tokens; tracked via consecutiveHeartbeatSkips in GatewayState.
  • Cron scheduling — standard cron expressions with timezone support and per-job priority; parsed via parseCron / shouldFireAt.
  • Webhook ingestion — HTTP endpoint with pluggable adapters (createGitHubAdapter for HMAC
    • signature verification, createGenericAdapter for any JSON payload).
  • Policy engine — composable SchedulingPolicy[] evaluated per event; built-ins below.
  • Event routing — unified GatewayEvent envelope routes heartbeats, crons, webhooks, and channel messages through the same routeEvent pipeline.
  • EventBus integration — every gateway event publishes to the core EventBus for observability.
  • State tracking — tokens used today, actions per hour, consecutive skips, pending events; all updated without LLM calls.

Chat mode

Set accessControl.mode: "chat" (default) to keep per-(platform, senderId) SQLite sessions across process restarts:

  • 40-turn / 8 KiB sliding window
  • Episodic memory injection from prior sessions
  • Daily compaction of older turns into a summary
  • TTL-based pruning (accessControl.sessionTtlDays, default 30 days)

Switch to mode: "task" for stateless, one-shot dispatch (each inbound message starts a fresh run with no memory of prior turns).

Built-in policies

| Factory | Purpose | |---|---| | createAdaptiveHeartbeatPolicy | Skip heartbeats when the agent is idle | | createCostBudgetPolicy | Enforce a daily token budget | | createRateLimitPolicy | Cap actions per hour | | createEventMergingPolicy | Merge duplicate events within a sliding window | | createAccessControlPolicy | Allowlist / blocklist sender filtering, escalate-or-skip on unknown |

Policies compose: pass an array to evaluatePolicies(event, [p1, p2, p3]) or to .withGateway({ policies }).

Channels integration

For inbound messaging from Discord, Telegram Bot API, Signal bots, etc., pair this package with .withChannels({ adapters, triggers? }) from @reactive-agents/runtime. Channel adapters live in @reactive-agents/channels. Adapters start when agent.start() runs.

GatewayStatus snapshot

const status: GatewayStatus | null = await agent.getGatewayStatus();
// { isRunning, lastExecutionAt, tokensUsedToday, actionsThisHour, pendingEvents, ... }

Documentation

License

MIT