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

agentsite

v0.2.1

Published

React primitives for authoring agent-first websites

Readme

Agentsite

React primitives for agent-first websites: dual surface (human interstitial + rich agent structure), declarative sitemaps, actions, gates, and JSON twins.

npm version CI License: MIT

Features

  • Dual surface: humans see an interstitial; agents get full structure in the DOM and optional JSON twin
  • Declarative Sitemap / Route, Action, and Gate primitives
  • JSON twins with baked-in agent protocol (agentTurn, menuMarkdown)
  • Takeover surfaces: AgentPreamble, VisualGate, ReverseCaptcha, Skill
  • Framework-agnostic React — works with Vite, Next.js, or any React 18+ app

Install

npm install agentsite
import {
  AgentSite,
  AgentPage,
  HumanGate,
  Sitemap,
  Route,
  Action,
  Gate,
  JsonTwin,
} from "agentsite";
import "agentsite/styles.css";

Quick start

import {
  AgentSite,
  AgentPage,
  HumanGate,
  Sitemap,
  Route,
  JsonTwin,
} from "agentsite";
import "agentsite/styles.css";

export function App() {
  return (
    <AgentSite name="Demo" baseUrl="https://example.com">
      <HumanGate />
      <AgentPage path="/" title="Home">
        <Sitemap>
          <Route path="/" title="Home" description="Start here" />
          <Route path="/about" title="About" />
        </Sitemap>
        <JsonTwin data={{ hello: "world" }} path="/" />
      </AgentPage>
    </AgentSite>
  );
}

See a runnable Vite app in examples/basic.

Agent protocol (no browser)

Agentsite sites are meant to be fetched, not browsed:

  1. Agent reads /llms.txt or /AGENTS.md (you serve these)
  2. If a skill is listed, fetch that SKILL.md, read with the human, then follow it
  3. Follow entry URLs with ?format=json
  4. Relay twin data / actions / gates / skills in chat
  5. Execute chosen actions over HTTP

| Component | Role | |-----------|------| | AgentPreamble | “If you were sent ahead…” + skill href | | VisualGate | Locked chrome + blurred body for humans; plain for agents | | ReverseCaptcha | “I'm not a human” | | Skill | Registers a fetchable playbook |

Every JSON twin includes agentProtocol. Do not open a browser for the human.

Dual surface

  • Agents always receive full structure in the DOM (and optional JSON twin).
  • Humans see HumanGate copy unless contentVisible is true (e.g. for admin/dev).

Primitives

| Component | Role | |-----------|------| | AgentSite | Root provider | | AgentPage | Page shell | | HumanGate | Human interstitial | | Sitemap / Route | Navigable index | | JsonTwin | Embed machine payload (#agentsite-json-twin) | | Action | Declared GET/POST affordance | | Gate | Process gate around actions |

JSON twin helper (no React)

Server-safe payload builder:

import { buildJsonTwinPayload } from "agentsite/payload";

const twin = buildJsonTwinPayload({
  site: "Demo",
  path: "/",
  data: { hello: "world" },
  routes: [{ path: "/", title: "Home" }],
});

Next.js App Router

next is an optional peer dependency. Subpath exports:

import { NextAgentSite } from "agentsite/next";
import {
  wantsJsonTwin,
  createLlmsTxtHandler,
  createAgentsMdHandler,
  createSkillMdHandler,
  buildJsonTwinPayload,
} from "agentsite/next/server";
// middleware.ts
import { NextResponse, type NextRequest } from "next/server";
import { wantsJsonTwin } from "agentsite/next/server";

export function middleware(request: NextRequest) {
  if (!wantsJsonTwin(request)) return NextResponse.next();
  const url = request.nextUrl.clone();
  url.searchParams.set("path", url.pathname);
  url.pathname = "/api/twin";
  return NextResponse.rewrite(url);
}
// app/layout.tsx
import { NextAgentSite } from "agentsite/next";
import "agentsite/styles.css";

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        <NextAgentSite name="Demo" baseUrl="https://example.com" routes={[]}>
          {children}
        </NextAgentSite>
      </body>
    </html>
  );
}

Scripts

npm test          # Vitest
npm run typecheck
npm run build

Contributing

  1. Fork and clone
  2. npm install
  3. npm test && npm run typecheck && npm run build
  4. Open a pull request

License

MIT © zeddotes