A pi extension that adds a web_fetch tool for fetching web pages as clean markdown. Pages are rendered by obscura, a CDP-compatible headless browser engine written in Rust, driven over the Chrome DevTools Protocol via Playwright.
- Connects to the obscura CDP server on
ws://127.0.0.1:9222 - Opens the target URL and waits for the page's
loadevent (JS-heavy SPAs work fine) - Extracts the page content and converts it to clean markdown using Defuddle, which ships site-specific extractors for many popular sites
You need on your system:
- podman 5.0 or newer, for the obscura server
- Node.js 22.18 or newer and pnpm 11.3.0 (development only)
The server runs as a rootless podman container managed by a user systemd quadlet unit. Deploy it from the mine checkout:
install -d -m 0700 "$HOME/.config/containers/systemd"
ln -sT "$PWD/obscura.container" "$HOME/.config/containers/systemd/obscura.container"
systemctl --user daemon-reload
systemctl --user start obscura.serviceThe unit starts with your session, restarts on failure, and pulls the image on
every start. Obscura runs with stealth mode enabled and persistent
cookie/localStorage storage in the obscura-data volume. Verify it is up:
curl -s http://127.0.0.1:9222/json/versionThe endpoint can be overridden with the MINE_CDP_ENDPOINT environment variable.
systemctl --user stop obscura.service
rm -- "$HOME/.config/containers/systemd/obscura.container"
systemctl --user daemon-reload
podman volume rm obscura-data
podman image rm docker.io/h4ckf0r0day/obscura:latestpi install git:github.com/resolveworks/mineFor project-local install:
pi install git:github.com/resolveworks/mine -lOnce installed, the web_fetch tool is available to pi:
> Fetch the content of https://example.com
Requires Node.js 22.18 or newer and pnpm 11.3.0.
pnpm install --frozen-lockfile
pnpm typecheck
pnpm format:checkUse pnpm format to apply formatting.