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

@yceachan/pi-wsl-browser

v0.1.0

Published

Session-scoped WSL Windows Edge/Chrome browser leases for pi

Readme

@yceachan/pi-wsl-browser

A Pi extension for session-scoped browser leases from WSL to Microsoft Edge (with Chrome fallback). It owns the browser targets it creates while leaving the user's existing tabs and main browser process alone.

Install

pi install npm:@yceachan/pi-wsl-browser
pi install npm:@yceachan/pi-shelld

Load both extensions and reload Pi. pi-shelld supplies the session-scoped service used for the private controller/daemon and its TUI log monitor.

Workflow

  1. Call the wsl_browser tool with {"action":"acquire"} (the default is headless).

  2. Run browser-harness Python through the package wrapper:

    pi-wsl-browser run <<'PY'
    goto_url("https://example.com")
    print(page_info())
    PY
  3. Call {"action":"retain"} before waiting for a user, login, MFA, or CAPTCHA. Otherwise Pi's agent_settled event releases the lease automatically.

  4. Call {"action":"release"} when finished. Session shutdown always releases remaining targets and removes temporary profiles.

Modes are headless, headed-tmp-profile, and main-profile. Temporary modes use a unique profile under discovered Windows %TEMP%/LocalAppData\Temp storage and a dynamic DevTools port; they never use WSL /tmp or /home UNC paths. A configured tempProfileRoot must be a Windows-backed drive path. main-profile infers profile.last_used from Edge's Local State and never kills the user's browser process.

The wrapper resolves the descriptor for the current PI_SESSION_ID/PI_SESSION_FILE; it does not accept a daemon, lease, browser name, or CDP endpoint from the agent. Each session gets private BH_RUNTIME_DIR and BH_TMP_DIR directories under its package state; those paths are shared by the controller and wrapper and removed at shutdown.

Configuration

Defaults are bundled in config.json. The optional user override is:

$PI_CODING_AGENT_DIR/pi-wsl-browser/config.json

Example:

{
  "browser": "auto",
  "executable": "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
  "userDataDir": "C:\\Users\\<user>\\AppData\\Local\\Microsoft\\Edge\\User Data",
  "profileDirectory": "Default",
  "tempProfileRoot": "C:\\Users\\<user>\\AppData\\Local\\Temp\\pi-wsl-browser"
}

auto selects Edge first and falls back to Chrome only when the Edge executable is absent. An Edge startup, CDP, or authorization failure is returned as an Edge error; it is never silently retried with Chrome. Paths are discovered through Windows/WSL and the package does not embed a username. Runtime selection is fixed to the bundled uv project and frozen lockfile.

Migration and development

pi-wsl-browser doctor reports legacy Skill, launcher, and global uv installations. It never removes user files or credentials; review and migrate those paths manually.

The Python runtime is a pinned, package-private fork under runtime/browser-harness/ with its own uv.lock. The controller and wrapper run it with the bundled uv run --project ... --frozen command; the first run may create uv's cache environment, but it never changes the lock or downloads a newer upstream release. Caller-selected Python, runtime roots/projects, and PYTHONPATH are ignored. uv is required in production (a runner probe is injectable only in TypeScript tests). See UPSTREAM.md for the baseline and merge checklist.

bun run typecheck
bun run test
npm pack --dry-run

GUI, user-profile, and authorization E2E checks are intentionally manual and are not part of the default test suite.