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

@xsaf/agent

v0.1.0-alpha.0

Published

Extra Small Agent Framework built on xsAI, Hono, and MCP v2

Downloads

129

Readme

XSAF

Extra Small Agent Framework: a fluent TypeScript agent runtime built on xsAI, Hono, and the MCP TypeScript SDK.

Backbone

Every agent owns a Hono application created through @modelcontextprotocol/hono:

  • POST /invoke runs the normal XSAF request path.
  • GET /health provides a basic readiness response.
  • .serve() mounts the agent's tools on /mcp using the MCP v2 per-request handler.
  • bot.app supports Hono composition and in-memory app.request() testing.
  • bot.fetch(request) can be passed to a runtime HTTP server.

The Hono MCP middleware keeps its localhost DNS-rebinding and Origin protections enabled by default.

Mock agent quick start

The included example is entirely local. Its model, channel, and HTTP requests are deterministic mocks, so it consumes no AI tokens and opens no listening socket.

bun run example:mock
import { agent } from "@xsaf/agent";
import mockChannel from "@xsaf/agent/channel/mock";
import mockModel from "@xsaf/agent/model/mock";

const ai = mockModel({ response: "Hello from the mock model" });
const channel = mockChannel();
const bot = agent({
  model: ai,
  persona: "You are a test agent.",
  stream: false,
})
  .channel(channel)
  .serve({ path: "/mcp" });

await bot.start();
await channel.receive({ sessionId: "demo", text: "hello" });

const response = await bot.app.request("http://localhost/invoke", {
  method: "POST",
  headers: { host: "localhost", "content-type": "application/json" },
  body: JSON.stringify({ sessionId: "http-demo", prompt: "hello hono" }),
});
console.log(await response.json());
await bot.stop();

Development

bun install
bun run typecheck
bun run lint
bun run fmt:check
bun test
bun run build

XSAF vendors the type-only Standard Schema V1 and Standard JSON Schema V1 contracts from standardschema.dev. Model-visible tool schemas must implement both validation and JSON Schema conversion.

Executable tools always require an explicit sandbox. Use an AgentOS-compatible driver for isolation or deliberately opt out with @xsaf/agent/sandbox/local via local({ unsafe: true }).