rebrand: agent-browser-stealth → chrome-use, de-fork, reset to v1.0.0
Release binaries / Build macOS ARM64 (push) Has been cancelled
Release binaries / Build macOS x64 (push) Has been cancelled
Release binaries / Build Linux ARM64 (push) Has been cancelled
Release binaries / Build Linux musl ARM64 (push) Has been cancelled
Release binaries / Build Linux musl x64 (push) Has been cancelled
Release binaries / Build Linux x64 (push) Has been cancelled
Release binaries / Build Windows x64 (push) Has been cancelled
Release binaries / Attach binaries to GitHub Release (push) Has been cancelled
Release binaries / Build macOS ARM64 (push) Has been cancelled
Release binaries / Build macOS x64 (push) Has been cancelled
Release binaries / Build Linux ARM64 (push) Has been cancelled
Release binaries / Build Linux musl ARM64 (push) Has been cancelled
Release binaries / Build Linux musl x64 (push) Has been cancelled
Release binaries / Build Linux x64 (push) Has been cancelled
Release binaries / Build Windows x64 (push) Has been cancelled
Release binaries / Attach binaries to GitHub Release (push) Has been cancelled
Standalone product rename across the whole repo (issue: project identity): - Binary/package/repo/skill/docs: agent-browser[-stealth] → chrome-use (single binary name `chrome-use`; old aliases agent-browser/abs dropped). - Version: 0.27.0-fork.51 → 1.0.0 (drop the upstream-fork counter). - Native-messaging host: com.agent_browser.connect → com.leeguoo.chrome_use (CLI + ab-connect extension in lockstep — this is a breaking handshake change, extension bumped 0.4.2 → 0.5.0, needs a Web Store republish). - Config dir: ~/.agent-browser → ~/.chrome-use. - README/zh: reframed from "stealth fork of agent-browser" to a standalone product with a small `originally based on vercel-labs/agent-browser` credit. - Kept AGENT_BROWSER_* env vars working (63 vars across the codebase; renaming them would break every existing script/skill for no user-facing gain). Build green, 802 unit tests pass, fmt + clippy clean. Upstream attribution to vercel-labs/agent-browser preserved.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
---
|
||||
name: vercel-sandbox
|
||||
description: Run agent-browser + Chrome inside Vercel Sandbox microVMs for browser automation from any Vercel-deployed app. Use when the user needs browser automation in a Vercel app (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.), wants to run headless Chrome without binary size limits, needs persistent browser sessions across commands, or wants ephemeral isolated browser environments. Triggers include "Vercel Sandbox browser", "microVM Chrome", "agent-browser in sandbox", "browser automation on Vercel", or any task requiring Chrome in a Vercel Sandbox.
|
||||
description: Run chrome-use + Chrome inside Vercel Sandbox microVMs for browser automation from any Vercel-deployed app. Use when the user needs browser automation in a Vercel app (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.), wants to run headless Chrome without binary size limits, needs persistent browser sessions across commands, or wants ephemeral isolated browser environments. Triggers include "Vercel Sandbox browser", "microVM Chrome", "chrome-use in sandbox", "browser automation on Vercel", or any task requiring Chrome in a Vercel Sandbox.
|
||||
---
|
||||
|
||||
# Browser Automation with Vercel Sandbox
|
||||
|
||||
Run agent-browser + headless Chrome inside ephemeral Vercel Sandbox microVMs. A Linux VM spins up on demand, executes browser commands, and shuts down. Works with any Vercel-deployed framework (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.).
|
||||
Run chrome-use + headless Chrome inside ephemeral Vercel Sandbox microVMs. A Linux VM spins up on demand, executes browser commands, and shuts down. Works with any Vercel-deployed framework (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.).
|
||||
|
||||
## Dependencies
|
||||
|
||||
@@ -13,7 +13,7 @@ Run agent-browser + headless Chrome inside ephemeral Vercel Sandbox microVMs. A
|
||||
pnpm add @vercel/sandbox
|
||||
```
|
||||
|
||||
The sandbox VM needs system dependencies for Chromium plus agent-browser itself. Use sandbox snapshots (below) to pre-install everything for sub-second startup.
|
||||
The sandbox VM needs system dependencies for Chromium plus chrome-use itself. Use sandbox snapshots (below) to pre-install everything for sub-second startup.
|
||||
|
||||
## Core Pattern
|
||||
|
||||
@@ -63,8 +63,8 @@ async function withBrowser<T>(
|
||||
"-c",
|
||||
`sudo dnf clean all 2>&1 && sudo dnf install -y --skip-broken ${CHROMIUM_SYSTEM_DEPS.join(" ")} 2>&1 && sudo ldconfig 2>&1`,
|
||||
]);
|
||||
await sandbox.runCommand("npm", ["install", "-g", "agent-browser"]);
|
||||
await sandbox.runCommand("npx", ["agent-browser", "install"]);
|
||||
await sandbox.runCommand("npm", ["install", "-g", "chrome-use"]);
|
||||
await sandbox.runCommand("npx", ["chrome-use", "install"]);
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -82,21 +82,21 @@ The `screenshot --json` command saves to a file and returns the path. Read the f
|
||||
```ts
|
||||
export async function screenshotUrl(url: string) {
|
||||
return withBrowser(async (sandbox) => {
|
||||
await sandbox.runCommand("agent-browser", ["open", url]);
|
||||
await sandbox.runCommand("chrome-use", ["open", url]);
|
||||
|
||||
const titleResult = await sandbox.runCommand("agent-browser", [
|
||||
const titleResult = await sandbox.runCommand("chrome-use", [
|
||||
"get", "title", "--json",
|
||||
]);
|
||||
const title = JSON.parse(await titleResult.stdout())?.data?.title || url;
|
||||
|
||||
const ssResult = await sandbox.runCommand("agent-browser", [
|
||||
const ssResult = await sandbox.runCommand("chrome-use", [
|
||||
"screenshot", "--json",
|
||||
]);
|
||||
const ssPath = JSON.parse(await ssResult.stdout())?.data?.path;
|
||||
const b64Result = await sandbox.runCommand("base64", ["-w", "0", ssPath]);
|
||||
const screenshot = (await b64Result.stdout()).trim();
|
||||
|
||||
await sandbox.runCommand("agent-browser", ["close"]);
|
||||
await sandbox.runCommand("chrome-use", ["close"]);
|
||||
|
||||
return { title, screenshot };
|
||||
});
|
||||
@@ -108,19 +108,19 @@ export async function screenshotUrl(url: string) {
|
||||
```ts
|
||||
export async function snapshotUrl(url: string) {
|
||||
return withBrowser(async (sandbox) => {
|
||||
await sandbox.runCommand("agent-browser", ["open", url]);
|
||||
await sandbox.runCommand("chrome-use", ["open", url]);
|
||||
|
||||
const titleResult = await sandbox.runCommand("agent-browser", [
|
||||
const titleResult = await sandbox.runCommand("chrome-use", [
|
||||
"get", "title", "--json",
|
||||
]);
|
||||
const title = JSON.parse(await titleResult.stdout())?.data?.title || url;
|
||||
|
||||
const snapResult = await sandbox.runCommand("agent-browser", [
|
||||
const snapResult = await sandbox.runCommand("chrome-use", [
|
||||
"snapshot", "-i", "-c",
|
||||
]);
|
||||
const snapshot = await snapResult.stdout();
|
||||
|
||||
await sandbox.runCommand("agent-browser", ["close"]);
|
||||
await sandbox.runCommand("chrome-use", ["close"]);
|
||||
|
||||
return { title, snapshot };
|
||||
});
|
||||
@@ -134,29 +134,29 @@ The sandbox persists between commands, so you can run full automation sequences:
|
||||
```ts
|
||||
export async function fillAndSubmitForm(url: string, data: Record<string, string>) {
|
||||
return withBrowser(async (sandbox) => {
|
||||
await sandbox.runCommand("agent-browser", ["open", url]);
|
||||
await sandbox.runCommand("chrome-use", ["open", url]);
|
||||
|
||||
const snapResult = await sandbox.runCommand("agent-browser", [
|
||||
const snapResult = await sandbox.runCommand("chrome-use", [
|
||||
"snapshot", "-i",
|
||||
]);
|
||||
const snapshot = await snapResult.stdout();
|
||||
// Parse snapshot to find element refs...
|
||||
|
||||
for (const [ref, value] of Object.entries(data)) {
|
||||
await sandbox.runCommand("agent-browser", ["fill", ref, value]);
|
||||
await sandbox.runCommand("chrome-use", ["fill", ref, value]);
|
||||
}
|
||||
|
||||
await sandbox.runCommand("agent-browser", ["click", "@e5"]);
|
||||
await sandbox.runCommand("agent-browser", ["wait", "--load", "networkidle"]);
|
||||
await sandbox.runCommand("chrome-use", ["click", "@e5"]);
|
||||
await sandbox.runCommand("chrome-use", ["wait", "--load", "networkidle"]);
|
||||
|
||||
const ssResult = await sandbox.runCommand("agent-browser", [
|
||||
const ssResult = await sandbox.runCommand("chrome-use", [
|
||||
"screenshot", "--json",
|
||||
]);
|
||||
const ssPath = JSON.parse(await ssResult.stdout())?.data?.path;
|
||||
const b64Result = await sandbox.runCommand("base64", ["-w", "0", ssPath]);
|
||||
const screenshot = (await b64Result.stdout()).trim();
|
||||
|
||||
await sandbox.runCommand("agent-browser", ["close"]);
|
||||
await sandbox.runCommand("chrome-use", ["close"]);
|
||||
|
||||
return { screenshot };
|
||||
});
|
||||
@@ -165,15 +165,15 @@ export async function fillAndSubmitForm(url: string, data: Record<string, string
|
||||
|
||||
## Sandbox Snapshots (Fast Startup)
|
||||
|
||||
A **sandbox snapshot** is a saved VM image of a Vercel Sandbox with system dependencies + agent-browser + Chromium already installed. Think of it like a Docker image -- instead of installing dependencies from scratch every time, the sandbox boots from the pre-built image.
|
||||
A **sandbox snapshot** is a saved VM image of a Vercel Sandbox with system dependencies + chrome-use + Chromium already installed. Think of it like a Docker image -- instead of installing dependencies from scratch every time, the sandbox boots from the pre-built image.
|
||||
|
||||
This is unrelated to agent-browser's *accessibility snapshot* feature (`agent-browser snapshot`), which dumps a page's accessibility tree. A sandbox snapshot is a Vercel infrastructure concept for fast VM startup.
|
||||
This is unrelated to chrome-use's *accessibility snapshot* feature (`chrome-use snapshot`), which dumps a page's accessibility tree. A sandbox snapshot is a Vercel infrastructure concept for fast VM startup.
|
||||
|
||||
Without a sandbox snapshot, each run installs system deps + agent-browser + Chromium (~30s). With one, startup is sub-second.
|
||||
Without a sandbox snapshot, each run installs system deps + chrome-use + Chromium (~30s). With one, startup is sub-second.
|
||||
|
||||
### Creating a sandbox snapshot
|
||||
|
||||
The snapshot must include system dependencies (via `dnf`), agent-browser, and Chromium:
|
||||
The snapshot must include system dependencies (via `dnf`), chrome-use, and Chromium:
|
||||
|
||||
```ts
|
||||
import { Sandbox } from "@vercel/sandbox";
|
||||
@@ -196,8 +196,8 @@ async function createSnapshot(): Promise<string> {
|
||||
"-c",
|
||||
`sudo dnf clean all 2>&1 && sudo dnf install -y --skip-broken ${CHROMIUM_SYSTEM_DEPS.join(" ")} 2>&1 && sudo ldconfig 2>&1`,
|
||||
]);
|
||||
await sandbox.runCommand("npm", ["install", "-g", "agent-browser"]);
|
||||
await sandbox.runCommand("npx", ["agent-browser", "install"]);
|
||||
await sandbox.runCommand("npm", ["install", "-g", "chrome-use"]);
|
||||
await sandbox.runCommand("npx", ["chrome-use", "install"]);
|
||||
|
||||
const snapshot = await sandbox.snapshot();
|
||||
return snapshot.snapshotId;
|
||||
@@ -238,9 +238,9 @@ Combine with Vercel Cron Jobs for recurring browser tasks:
|
||||
// app/api/cron/route.ts (or equivalent in your framework)
|
||||
export async function GET() {
|
||||
const result = await withBrowser(async (sandbox) => {
|
||||
await sandbox.runCommand("agent-browser", ["open", "https://example.com/pricing"]);
|
||||
const snap = await sandbox.runCommand("agent-browser", ["snapshot", "-i", "-c"]);
|
||||
await sandbox.runCommand("agent-browser", ["close"]);
|
||||
await sandbox.runCommand("chrome-use", ["open", "https://example.com/pricing"]);
|
||||
const snap = await sandbox.runCommand("chrome-use", ["snapshot", "-i", "-c"]);
|
||||
await sandbox.runCommand("chrome-use", ["close"]);
|
||||
return await snap.stdout();
|
||||
});
|
||||
|
||||
@@ -277,4 +277,4 @@ The pattern works identically across frameworks. The only difference is where yo
|
||||
|
||||
## Example
|
||||
|
||||
See `examples/environments/` in the agent-browser repo for a working app with the Vercel Sandbox pattern, including a sandbox snapshot creation script, streaming progress UI, and rate limiting.
|
||||
See `examples/environments/` in the chrome-use repo for a working app with the Vercel Sandbox pattern, including a sandbox snapshot creation script, streaming progress UI, and rate limiting.
|
||||
|
||||
Reference in New Issue
Block a user