pi-browser

extension

Playwright-backed pi extension that registers the pi-browser tool

by · v0.1.0 · published 2mo ago

$ pi install npm:pi-browser
downloads/mo
107
stars
last push
open issues

Signals

license: MITtestspi manifest: missinginstall size: —deps: 0peer deps: 0

Download trend

348 downloads · last 12 weeks (weekly)

README

pi-browser

A publishable pi package that registers a Playwright-backed browser tool named pi-browser.

It loads a single URL in headless Chromium and returns concise rendered output:

  • title
  • finalUrl
  • status when available
  • rendered text
  • optional truncated html

Install

pi install npm:pi-browser
npx playwright install chromium

Then restart pi or run:

/reload

Linux may need:

npx playwright install --with-deps chromium

Local development

npm install
npx playwright install chromium
pi

This repo keeps:

  • extensions/pi-browser.ts — publishable package entry
  • .pi/extensions/pi-browser.ts — local auto-discovery shim for pi in this repo

Tool inputs

  • url — required
  • waitUntilload, domcontentloaded, networkidle, commit
  • timeoutMs
  • waitForSelector
  • waitForSelectorStateattached, detached, visible, hidden
  • extraWaitMs
  • modetext (default), html, both

Example

{
  "url": "https://example.com",
  "waitUntil": "load",
  "timeoutMs": 30000,
  "mode": "text"
}

Publish

npm run typecheck
npm pack --dry-run
npm login
npm publish

For a scoped package, use:

npm publish --access public