@agent-infra/browser
A tiny Browser Control library based on puppeteer, built for Agent Tars.
Features
- 🔍 Browser Detection - Auto-detects installed browsers across platforms
- 🔄 Remote Browser Support - Connect to remote browser instances
- 🛡️ Type Safety - Written in TypeScript with full type definitions
Architecture
graph TD
A[Browser Interface] --> B[Local Browser]
A --> C[Remote Browser]
B --> D[Browser Finder]
B --> E[Browser Adapter]
C --> E
E --> F[Puppeteer Adapter]
F --> G[Browser Control]
Installation
npm install @agent-infra/browser
yarn add @agent-infra/browser
pnpm add @agent-infra/browser
Quick Start
import { LocalBrowser } from '@agent-infra/browser';
async function main() {
const browser = new LocalBrowser();
try {
await browser.launch({ headless: false });
const page = await browser.createPage();
await page.goto('https://example.com');
await page.screenshot({ path: 'example.png' });
} finally {
await browser.close();
}
}
Credits
Thanks to:
- EGOIST for creating a great AI chatbot product ChatWise from which we draw a lot of inspiration for browser detection functionality.
- The puppeteer project which helps us operate the browser better.