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

@zenspc/pi-browser

v0.5.0

Published

Drive a dedicated Chrome with full automation, gated by per-domain approval

Readme

@zenspc/pi-browser

A Pi extension that lets the agent drive a dedicated Chrome with full automation, gated by per-domain approval.

The first tool call launches a headed system Chrome against a User Data Dir the extension owns, default ~/.pi-chrome. It never uses the user's daily Chrome data. The Debug Port is ephemeral and read from that dir. It never attaches to some other Chrome just because that Chrome has a debug port open. All agent activity happens in one owned tab, the Automation Tab. Your other tabs are never touched. The window stays up when Pi exits.

Setup

  1. Install the extension:

    pi install npm:@zenspc/pi-browser
  2. Call any browser tool. Chrome launches on first use. If that Chrome is already running, a later Pi session attaches to it and reuses the Automation Tab.

Override the User Data Dir with PI_BROWSER_USER_DATA_DIR (absolute after ~ expansion). Override the Chrome binary with PI_BROWSER_CHROME_BIN. If that is unset, the extension searches Chrome, then Chromium, then Edge. See ADR-0011.

Tools

| Tool | What it does | |---|---| | browser_navigate | Navigate the Automation Tab to a URL and report the page title | | browser_snapshot | Render the tab as a compact accessibility tree with an Element Ref like [ref=e12] on every interactive element | | browser_click | Click the element for a Ref taken from the last snapshot | | browser_type | Enter text into the field for a Ref | | browser_screenshot | Capture a full-viewport PNG and return it as an image to the model | | browser_evaluate | Run a JavaScript expression in the page context and return the serialized result |

Refs go stale when the page changes. After navigation or a click that alters the layout, take a new browser_snapshot before acting again. Acting on a stale or unknown Ref returns an error that says so.

Every tool targets the Automation Tab and every tool passes through the Domain Approval gate below.

Commands

/browser on|off|status|help switches Tool Availability. Bare /browser is status. enable and disable alias on and off.

| Command | Description | |---|---| | /browser | Show Tool Availability | | /browser status | Show Tool Availability | | /browser on | Offer Browser Tools | | /browser off | Hide Browser Tools | | /browser help | Usage |

Off hides Browser Tools from the model only. Chrome, the Attachment, and Domain Approval stay as they are. On restores Browser Tools. A missing sticky file means on. The file is $PI_CODING_AGENT_DIR/extensions/pi-browser.json, by default ~/.pi/agent/extensions/pi-browser.json.

/browser does not load or unload the package. Use pi config to unload it.

See ADR-0013.

Domain Approval

The agent cannot touch a site until you approve it. On first access to a domain, Pi prompts you with three choices:

  • Approve once holds for the rest of the Pi session.
  • Approve permanently writes the domain to the Allowlist and never prompts again.
  • Deny fails the call and navigates nothing. The denial is not remembered, so the next call prompts again.

Approval covers the whole registrable domain: approving example.com also approves app.example.com.

The Allowlist lives at $PI_CODING_AGENT_DIR/extensions/pi-browser-allowlist.json, by default ~/.pi/agent/extensions/pi-browser-allowlist.json. Delete a line there to revoke a permanent grant.

When no UI is available to prompt (headless runs), unapproved domains fail closed with instructions instead of silently passing.

Security notes

  • The agent acts as you. On an approved domain, a tool call can do anything you could do in that tab while logged in.
  • browser_evaluate runs arbitrary JavaScript in the page. It can read everything the page can read, including cookies and storage for approved domains.
  • Snapshots and screenshots capture page content, which can include personal data or tokens. Treat their output as sensitive and redact before sharing, per SECURITY.md.
  • Permanent approvals outlive the session by design. Review the Allowlist file occasionally and prune domains you no longer automate.

Report vulnerabilities privately following SECURITY.md. Do not open a public issue.

Development

pnpm install
pnpm check
pnpm test

The test suite launches Chrome against a throwaway User Data Dir. Set PI_BROWSER_CHROME_BIN to override the Chrome binary.