* fix(cli): reject unmet preconditions in upload, har stop, diff snapshot and diff url upload resolves relative paths in the CLI against its own cwd, fails with file_not_found for a missing file (warns for provider browsers) and with not_file_input for other targets. network har stop fails with no_har_recording when no recording is active, e.g. after a browser restart. diff snapshot without --baseline compares against the last snapshot of the page session, or fails with no_baseline. diff url returns the snapshot diff the renderer reads, honours --screenshot, --full, --selector, --compact and --depth. Co-Authored-By: dwin-gharibi <20875684+dwin-gharibi@users.noreply.github.com> Co-Authored-By: Mohammad-Maraqa <154911866+Mohammad-Maraqa@users.noreply.github.com> Co-Authored-By: cavalcanticampos <64264987+cavalcanticampos@users.noreply.github.com> Co-Authored-By: hyunjinee <63354527+hyunjinee@users.noreply.github.com> * docs: describe upload paths, har stop and diff snapshot preconditions * docs: record upload and diff snapshot prose edits in the docs baseline * fix(cli): keep the diff snapshot baseline's options, pass directories to upload, warn for remote browsers A bare diff snapshot captures with the options and frame of the last snapshot; an option that differs fails with baseline_mismatch. diff snapshot accepts -i and -u. upload accepts directories (webkitdirectory), expands ~, and only warns when the browser is on another machine (provider or non-loopback --cdp). diff snapshot --baseline resolves against the CLI cwd and fails with file_not_found when the file is missing. diff url --full without --screenshot is rejected. Messages and docs name the daemon restart as what discards a HAR recording, and MCP tool descriptions are regenerated. * fix(upload): record the attached target for every session connection A session whose settings carry --cdp, auto-connect or a provider attached without recording the target, so upload treated a remote browser as local and rejected paths missing on this host. The target is now derived from the connection after every settings-driven launch. Also: diff snapshot baseline_mismatch names both the requested and the last snapshot values, the MCP diff_snapshot tool accepts urls, the directory upload test waits for the input to be populated, and docs say the implicit baseline is per tab. * fix(cli): keep the diff snapshot baseline per tab and box the launch future The implicit baseline of diff snapshot is kept per tab and dropped when the tab closes, so a snapshot on one tab no longer discards another's. The launch wrapper boxes the inner launch future so it stays out of the caller's future size. * fix(security): keep page text out of upload errors and inside content boundaries not_file_input names the node only through a fixed tag list and input type list. Snapshot diff output, including diff url, goes through the same boundary and truncation path as other page content. * test(cli): compare resolved paths without assuming forward slashes std::path::absolute emits backslashes on Windows, so expected paths are built with Path::join and the HAR test checks the file name. --------- Co-authored-by: dwin-gharibi <20875684+dwin-gharibi@users.noreply.github.com> Co-authored-by: Mohammad-Maraqa <154911866+Mohammad-Maraqa@users.noreply.github.com> Co-authored-by: cavalcanticampos <64264987+cavalcanticampos@users.noreply.github.com> Co-authored-by: hyunjinee <63354527+hyunjinee@users.noreply.github.com>
@agent-browser/sandbox
Helpers for installing and running agent-browser inside sandbox runtimes.
This package does not define model tools. Use it from framework-specific tools, agents, route handlers, or jobs that already decide what the browser should do.
eve
For eve agents, use @agent-browser/eve. It mounts the full browser tool set and exposes the sandbox bootstrap helpers from @agent-browser/eve/sandbox, with this package as an internal dependency.
Vercel Sandbox
Install @vercel/sandbox in the consuming app:
pnpm add @vercel/sandbox
Then use the Vercel provider entry:
import { runAgentBrowserCommand, withAgentBrowserSandbox } from "@agent-browser/sandbox/vercel";
const snapshot = await withAgentBrowserSandbox(async (sandbox) => {
await runAgentBrowserCommand(sandbox, ["open", "https://example.com"]);
const result = await runAgentBrowserCommand(sandbox, ["snapshot", "-i", "-c"], {
json: false,
});
return result.stdout;
});
The Vercel helpers install browser system dependencies by default. Pass installSystemDependencies: false only when the sandbox image already provides Chromium's required libraries.
Set AGENT_BROWSER_SNAPSHOT_ID to boot from a prebuilt Vercel Sandbox snapshot. Without a snapshot, the helper installs system dependencies, agent-browser, and Chrome on first boot.
One MCP server per sandbox
startAgentBrowserMcp keeps one agent-browser mcp running over stdin, so tool calls reuse the same process instead of starting a command each time. It needs @vercel/sandbox 3.7 or later.
import { createAgentBrowserSandbox, startAgentBrowserMcp } from "@agent-browser/sandbox/vercel";
const sandbox = await createAgentBrowserSandbox();
const mcp = await startAgentBrowserMcp(sandbox, { timeout: 60_000 });
await mcp.callTool("agent_browser_open", { url: "https://example.com" });
const snapshot = await mcp.callTool("agent_browser_snapshot", { interactive: true });
await mcp.close();
await sandbox.stop();
timeout applies to each request and has no default. For another runtime, pass a process with stdin and stdout streams to connectAgentBrowserMcp from @agent-browser/sandbox.
MCP tool catalog
@agent-browser/sandbox/mcp-tools.json lists every agent-browser mcp tool with its title, description, input schema, annotations, and startup profiles, generated from the CLI of the same version. Use it to build tools for runtimes that cannot run tools/list, and call them with agent-browser mcp call <tool> '<json>'. Run pnpm mcp-tools:sync after changing MCP tools; a Rust test fails while the file is out of date.
Version pinning
By default, this package installs the agent-browser version that matches its own, such as agent-browser@0.41.0 for @agent-browser/sandbox@0.41.0.
Pass installSpec: "latest" or another npm spec to override that default.