Skip to main content

Project architecture

pbvm uses a pnpm workspace monorepo structure, containing the CLI core package and a documentation site.

100%
100%

Key modules

ModulePathResponsibility
browser.lock.tssrc/browser/Locked wrapper around @puppeteer/browsers install / uninstall / getInstalledBrowsers, preventing concurrent cache directory access
base.browser.tssrc/browser/WebSocket connection abstraction (DevConnection), process spawning, endpoint capture — shared by Chromium and Firefox
chromium.browser.tssrc/browser/CDP protocol implementation; collects runtime info via Browser.getVersion / Target.attachToTarget / Runtime.evaluate; supports headless=new fallback to headless
firefox.browser.tssrc/browser/WebDriver BiDi protocol implementation; collects runtime info via session.new / script.evaluate; RemoteValue deserialization
buildEnvScript.tssrc/browser/Fingerprint collection script injected into browser pages; collects userAgent, webgl, screen, timezone, etc.
manifest.tssrc/utils/browserlist.json read/write + Store list query; supports lookup by alias or browser@buildId
lock.tssrc/utils/Process-level file lock; acquireLock for exclusive write lock, waitForLock for waiting on read lock release
paths.tssrc/utils/Directory management based on env-paths; provides five standard paths: cache / data / config / log / temp

Core dependency chain

100%
100%

Summary

LayerResponsibilityKey files
EntryCommander CLI startup, command registrationsrc/index.ts
CommandArg parsing, interactive completion, confirmationsrc/commands/*.ts
Prompt@inquirer/prompts interactive Q&Asrc/prompts/*.ts
ScriptCore business logicsrc/bin/*.script.ts
BrowserCDP/BiDi WebSocket communication, process management, lockingsrc/browser/*.ts
Utilitymanifest management, file lock, paths, loggingsrc/utils/*.ts
TypeZod runtime validation + TypeScript typessrc/types/index.ts
APIPublic export: launchBrowser()src/api.ts
DocsDocusaurus 3 + Tailwind 4 + React 19documentation/