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

xurface

v0.2.2

Published

Xurface SDK: give your AI agents a record and a conscience. Declare, then guard.

Readme

xurface (TypeScript / JavaScript)

Give your AI agents a record and a conscience, in one call.

Xurface Horizon is the discernment checkpoint an agent routes through before it takes a critical action on a person's behalf. This SDK records every critical action on Horizon's signed audit ledger and, when the risk exceeds what the person tolerates, holds it for their approve / edit / deny in the Xurface Discern app - and the agent waits for the verdict.

Modern ESM, zero runtime dependencies (uses the global fetch). Node >= 18.

Install

npm install xurface

Use

import { Xurface } from "xurface";

const xf = new Xurface({ clientId, clientSecret });          // Solution creds

await xf.declareAgent("apply-bot", {                         // Horizon scores each ability
  display_name: "Apply Bot",
  abilities: [
    { key: "offers.scan", kind: "skill", description: "Scan the inbox for job offers" },
    { key: "pay.invoice", kind: "capability", description: "Pay an invoice",
      developer_risk: { financial: "HIGH" } },
  ],
});

const user = await xf.resolveUser("email", "[email protected]");

const verdict = await xf.guard({
  user, agent: "apply-bot", capability: "pay.invoice",
  details: { amount: 2400 }, wait: 120000,                   // block up to 2 min for a decision
});

if (verdict.allowed) await reallyPay(verdict.details);       // details may be human-edited
else console.log("not allowed:", verdict.state, verdict.reasons);
  • within appetite -> allowed immediately, and logged;
  • above appetite / SEVERE / developer always -> held, pushed to Discern; guard blocks until the person decides (or wait elapses);
  • the person can edit the arguments before approving - they come back in verdict.details.

Framework adapters

Each adapter wraps a framework's tool abstraction so a held/denied action comes back as an ordinary tool result the model can read. Import per framework:

import { createOpenAIGuard }    from "xurface/openai";
import { createAnthropicGuard } from "xurface/anthropic";
import { createGeminiGuard }    from "xurface/gemini";

Coding agents (Claude Code / Cursor / Zed / Windsurf) use the MCP server at xurface/mcp-server (a stdio Model Context Protocol server exposing xurface_guard). Python adds LangGraph and CrewAI in the sdk-python package.

Add your framework in ~40 lines: see the repo's CONTRIBUTING.md. Copy adapters/gemini.mjs and make it pass the adapter contract test.

Test

npm test           # runs the adapter contract test (offline, no Horizon needed)

The contract test (test/adapter-contract.test.mjs) is the bar every adapter - including a contributed one - must pass: an allowed capability runs the tool, a held/denied one does not, and the adapter guards with the declared capability and the model's args. Full end-to-end tests against a live Horizon core live in the platform.

Part of Xurface. A product of 500xLaunch.