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

@boe-ventures/agent-replay

v0.2.1

Published

Local session recording for AI coding agents — captures DOM mutations, console logs, network requests, and errors from your dev server into structured JSONL files that agents can read directly

Downloads

492

Readme

@boe-ventures/agent-replay

npm version License: MIT TypeScript GitHub stars

Local session recording for AI-assisted development. Gives coding agents the same observability into a running web app that a human developer gets — console errors, network requests, DOM state, React component tree — but structured, programmatic, and cheap.

Why

AI coding agents today debug web apps by taking screenshots and feeding them to a vision model. That's expensive, slow, and lossy — you can't see network errors, console logs, or timing from a screenshot.

Session recording captures everything that happens inside the app. The agent gets structured data instead of pixels. The human developer gets a video-like replay for review.

How it works

Agent writes code → Dev server reloads
                         ↓
            AgentReplayProvider captures:
            • DOM mutations (rrweb)
            • Console logs/errors
            • Network requests/responses
            • React component tree + state
            • User interactions (clicks, inputs, navigation)
                         ↓
            Events written to .agent-replay/
                         ↓
    ┌────────────────────┴────────────────────┐
    │                                         │
Agent reads structured events            Human views replay
(file, CLI, or MCP tool)                (npx agent-replay view)

Quick start

npm install @boe-ventures/agent-replay

React (Next.js, Vite, Remix)

// app/layout.tsx
import { AgentReplayProvider } from "@boe-ventures/agent-replay/react";

export default function Layout({ children }) {
  return (
    <html>
      <body>
        <AgentReplayProvider>
          {children}
        </AgentReplayProvider>
      </body>
    </html>
  );
}

The provider auto-disables in production. Only records in development.

Sidecar server (framework-agnostic)

# Run alongside your dev server
npx agent-replay dev

# Or with a specific port
npx agent-replay dev --port 3700

The sidecar receives events from the browser and writes them to .agent-replay/.

Next.js optimized

// next.config.ts
import { withAgentReplay } from "@boe-ventures/agent-replay/next";

export default withAgentReplay(nextConfig);

Auto-injects the provider and API route. Zero config.

Agent consumption

Flat files (works with any agent)

.agent-replay/
  sessions/
    2026-04-25T1430Z/
      events.jsonl       # Full rrweb event stream
      console.jsonl      # Console logs/errors only
      network.jsonl      # Network requests/responses only
      errors.jsonl       # Errors only (highest signal)
      react-tree.json    # React component tree snapshot
      summary.md         # LLM-friendly text summary
  latest -> sessions/2026-04-25T1430Z/

Tell the agent: "Check .agent-replay/latest/errors.jsonl for recent errors" or "Read .agent-replay/latest/summary.md for a session overview."

Separate files so the agent can choose what to look at without exhausting context.

CLI

# Get a text summary of the last session
npx agent-replay summary

# Get just errors
npx agent-replay errors

# Get network failures
npx agent-replay network --failures

# Watch for new events (streaming)
npx agent-replay watch

MCP tool (future)

{
  "tool": "agent_replay_session",
  "description": "Get the latest session recording events",
  "parameters": {
    "type": { "enum": ["summary", "errors", "network", "console", "all"] }
  }
}

What gets captured

| Signal | Source | File | Agent value | |--------|--------|------|-------------| | DOM mutations | rrweb | events.jsonl | Full page reconstruction | | Console logs | rrweb console plugin | console.jsonl | Errors, warnings, debug output | | Network requests | rrweb network plugin | network.jsonl | API failures, slow responses | | Errors | window.onerror + unhandledrejection | errors.jsonl | Highest signal — read this first | | User interactions | rrweb | events.jsonl | Clicks, inputs, navigation | | React tree | React DevTools hook | react-tree.json | Component state, props, context | | Route changes | Next.js router / History API | console.jsonl | Navigation flow |

Video replay

Recordings can be converted to video for human review:

# Generate video from a session
npx agent-replay video .agent-replay/latest

# Or decompose into frames (for vision model analysis via vidgrid)
npx agent-replay frames .agent-replay/latest --fps 1

Chrome Extension (zero-config)

The Chrome extension records any localhost page automatically — no npm install, no provider component, no code changes.

Install from source

cd extension
pnpm install
pnpm build

Then load in Chrome:

  1. Open chrome://extensions
  2. Enable "Developer mode"
  3. Click "Load unpacked"
  4. Select extension/.output/chrome-mv3/

What it does

  • Auto-injects rrweb + console/network recording on localhost:* and 127.0.0.1:*
  • Streams events to the sidecar server (npx agent-replay dev) every 2 seconds
  • Shows recording status, event count, and sidecar connection in the popup
  • Badge shows "REC" on tabs being recorded

Works with the npm package

If <AgentReplayProvider> is already active on the page (sets window.__AGENT_REPLAY_ACTIVE__), the extension defers — no double recording. Both write to the same .agent-replay/ directory via the sidecar.

Development

cd extension
pnpm dev  # starts WXT dev mode with hot reload

Design principles

  • Local-first. No cloud, no accounts, no telemetry. Files on disk.
  • Dev-only. Auto-disabled in production. Zero runtime cost when off.
  • Agent-first, human-friendly. Structured data for agents, visual replay for humans.
  • Separate files per signal. Agent picks what it needs. No context exhaustion.
  • Framework-agnostic core. Next.js adapter for convenience. Works with Vite, Remix, CRA.
  • Composable with agent-browser. Agent-browser gives the outside view (accessibility tree, element refs). Agent-replay gives the inside view (errors, network, state). Together they're complete.

Interplay with agent-browser / Puppeteer

agent-browser ←→ Browser ←→ agent-replay
   (outside)                   (inside)

agent-browser: "Click button @e3"
               "Snapshot accessibility tree"
               "Get page title"

agent-replay:  "Console error at checkout.tsx:47"
               "POST /api/checkout returned 500"
               "React state: cart.items = []"

Agent-browser drives the browser. Agent-replay observes what happens inside. The agent uses both.

License

MIT — Boe Ventures