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

ag-ui-hono

v0.1.0

Published

AG-UI protocol HTTP endpoint adapter for Hono — aligned with Python add_langgraph_fastapi_endpoint

Readme

ag-ui-hono

AG-UI protocol HTTP endpoint adapter for Hono — TypeScript equivalent of the Python add_langgraph_fastapi_endpoint.

Features

  • One-liner endpoint: Wire any AG-UI agent handler into a Hono SSE endpoint
  • Lifecycle hooks: transformInput, onComplete, onError, onAbort
  • Health check: Built-in GET /health endpoint
  • EventEncoder: Proper SSE encoding via @ag-ui/encoder
  • Error handling: Automatic RUN_ERROR event on handler exceptions

Quick Start

import { createAgentEndpoint } from "ag-ui-hono";
import { LangGraphAgent } from "ag-ui-langgraph";

const agent = new LangGraphAgent({ name: "agent", graph });

// Create the endpoint
const agentApp = createAgentEndpoint(
  (input, signal) => agent.clone().run(input),
  {
    transformInput: (input) => ({
      ...input,
      messages: hydrateHistory(input.threadId, input.messages),
    }),
    onComplete: (threadId, msgs, events) => {
      persistHistory(threadId, msgs, events);
    },
    logger: myLogger,
  },
);

// Mount on your Hono app
app.route("/api/agent", agentApp);

Public API

createAgentEndpoint(handler, options?)

| Parameter | Type | Description | |---|---|---| | handler | (input: RunAgentInput, signal: AbortSignal) => AsyncGenerator<BaseEvent> | Your agent handler | | options.transformInput | (input) => input | Pre-process input (e.g. hydrate history) | | options.onComplete | (threadId, messages, events) => void | Called after successful stream | | options.onError | (threadId, error, events) => void | Called on handler exception | | options.onAbort | (threadId, events) => void | Called when client disconnects | | options.logger | { info, warn, error } | Optional structured logger |

Returns a Hono app with:

  • POST / — Agent endpoint (accepts RunAgentInput JSON, streams SSE)
  • GET /health — Health check ({ status: "ok" })

The npm package intentionally exposes only the root entrypoint:

import { createAgentEndpoint } from "ag-ui-hono";

Internal source files are not subpath exports. Treat imports such as ag-ui-hono/endpoint as unsupported.

Source Layout

The package is intentionally small:

src/
  endpoint.ts  Hono endpoint factory, streaming, hooks, and error handling
  index.ts     root public exports
tests/
  endpoint.test.ts  endpoint behavior
  package/          npm publishing metadata and public export contract

Keep new implementation code in focused modules only when the endpoint grows past a single responsibility.

Testing

pnpm --filter ag-ui-hono run test
pnpm --filter ag-ui-hono run test:coverage
pnpm --filter ag-ui-hono run typecheck

The test suite covers app creation, health checks, invalid input, SSE event encoding, input transformation, lifecycle hooks, handler failures, package exports, and npm publishing metadata. test:coverage enforces global coverage thresholds before publishing.

Publishing

The npm package is emitted from dist:

pnpm --filter ag-ui-hono run typecheck
pnpm --filter ag-ui-hono run test:coverage
pnpm --filter ag-ui-hono run build
pnpm --filter ag-ui-hono run publish:check-name
pnpm --filter ag-ui-hono run publish:dry

The build script removes dist before compiling so deleted modules cannot leak into the tarball. publish:dry runs npm pack --dry-run; the real publish step is intentionally left to the package owner.