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

@inbrowser/agent

v0.2.0

Published

Agent runtime + CLI. Library exports AgentSession, AgentStrategy, ToolRegistry, LlmClient, MetricsCollector, SandboxObserver. Ships an `agent` binary with NDJSON output, --json stdin, --dry-run, schema introspection, and inverse-mode MCP serve. Domain-agn

Downloads

530

Readme

@inbrowser/agent

Agent runtime + agent-friendly CLI in one package. Three consumer surfaces:

  • Libraryimport { createAgentSession, createToolRegistry, ... }. Pure TypeScript, no React, no DOM, no fetch. The playground UI consumes the same primitives.
  • CLI — the agent binary. NDJSON output by default, --json stdin, --dry-run, schema introspection, automatic session logs.
  • MCP serveragent serve exposes agent tools over stdio so external LLM hosts (Claude Desktop, others) can drive them as MCP tools.

The library is browser-safe; the CLI and MCP server are Node-only.

Install

bun add @inbrowser/agent
# or
npm install @inbrowser/agent

The agent binary lands in ./node_modules/.bin/.

A 30-second example

Library

import {
  createAgentSession,
  createReactLoopStrategy,
  createToolRegistry,
  createDispatch,
  createMetricsCollector,
} from '@inbrowser/agent';

const session = createAgentSession({
  strategy: createReactLoopStrategy(),
  llm: yourLlmClient,
  tools: createDispatch(createToolRegistry()),
  toolContext: () => ({ workspace, runtime, sandbox, lint, signal: new AbortController().signal }),
  metrics: createMetricsCollector(),
  history: [],
  id: 'sess-1',
  systemPromptBuilder: (workspace, runtime) => '…',
});

for await (const event of session.submit('hello')) {
  // SessionEvent stream — apply to your store / UI / log
}

CLI

# Headless single session — text in TTY, NDJSON when piped.
agent run "build a chess rule set"

# JSON payload via stdin.
echo '{"prompt": "reset rules"}' | agent run --json -

# 10 isolated sessions in parallel.
agent fleet --size 10

MCP server

# Expose agent tools over stdio for an external host.
agent serve --project my-project

CLI commands

| Command | Purpose | |---------|---------| | run | Headless single session — text in a TTY, NDJSON when piped | | fleet | Run N isolated sessions in parallel | | serve | Expose agent tools over MCP stdio | | events | Inspect a session's event log | | undo | Roll back the last mutating operation via the event log | | describe | Print tool schemas / session metadata | | schema | Emit machine-readable schema introspection | | migrate | Migrate session logs / event-log format | | version, help | Version string and usage |

Subpath exports

| Entry | Surface | |-------|---------| | @inbrowser/agent | Browser-safe library — createAgentSession, createToolRegistry, strategies, metrics, storage adapters, event utilities | | @inbrowser/agent/cli | Node-only CLI internals — main, command handlers, arg parsing, the CLI_SPEC | | @inbrowser/agent/node | Node-only event-log writer — openEventLog, buildRollbackEvent, id generation |

Where to go next

Documentation is organised under docs/ following the Diataxis framework:

| If you want to | Read | |---|---| | Follow a complete lesson | Tutorials | | Accomplish a specific task | How-to guides | | Look up a function, event, or CLI flag | Reference | | Understand the design choices | Explanation |

Starting points by role

Position in the stack

@inbrowser/agent is the agent runtime — independent of domain packages. Hosts compose it with their own AgentDefinitions; the bare CLI ships zero built-ins.

See Inference vs inverse architectures for the two distinct consumer modes.

Licence

Same as the parent workspace.