-
Notifications
You must be signed in to change notification settings - Fork 607
feat: add Kernel as cloud browser provider #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
@rgarcia is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
3 tasks
6629911 to
606a377
Compare
Add Kernel (https://kernel.sh) as a third-party cloud browser provider, following the same pattern as Browserbase and Browser Use integrations. Features: - Launch browser with `-p kernel` flag or `AGENT_BROWSER_PROVIDER=kernel` - Configurable via environment variables: - KERNEL_API_KEY (required) - KERNEL_HEADLESS (default: false) - KERNEL_STEALTH (default: true) - KERNEL_TIMEOUT_SECONDS (default: 300) - KERNEL_PROFILE_NAME (optional, for persistent sessions) - Profile find-or-create: automatically creates profile if it doesn't exist - Profile persistence: cookies/logins saved back to profile on session close - Uses raw fetch() calls for API communication (no SDK dependency) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
606a377 to
8171184
Compare
Collaborator
|
Thanks for adding Kernel as a cloud browser provider! |
34f2aww
added a commit
to 34f2aww/agent-browser
that referenced
this pull request
Jan 27, 2026
* Add Browserbase support for remote browser over CDP (vercel-labs#3) * Add Browserbase support for remote browser over CDP When BROWSERBASE_API_KEY and BROWSERBASE_PROJECT_ID env vars are set, connect to a Browserbase session via CDP instead of launching a local browser. * Update URLs to browserbase repo * Add Browserbase support for remote browser over CDP When BROWSERBASE_API_KEY and BROWSERBASE_PROJECT_ID env vars are set, connect to a Browserbase session via CDP instead of launching a local browser. * Update link to Browserbase Dashboard in README * bump browserbase sdk to latest version * remove sdk as a dep * change name back to vercel labs * added try catch blocks, functions to close session * revert package names * remove extra if statement --------- Co-authored-by: Kylejeong2 <kylejeong21@gmail.com> * feat: add Browser Use cloud browser as available provider (vercel-labs#138) * feat: add Browser Use cloud browser integration * feat: enhance Browser Use integration with provider flag support - Updated README to reflect new usage instructions for enabling Browser Use with the `-p` flag. - Modified CLI to parse and handle the `-p` flag for specifying the provider. - Implemented logic in the main application to launch with the specified cloud provider. - Adjusted BrowserManager to connect to Browser Use based on the provider flag or environment variable. - Updated types and protocol schemas to include provider information. * feat: add validation for mutually exclusive CLI options - Implemented checks to prevent the use of both --cdp and --provider flags simultaneously. - Added validation to ensure --extension cannot be used with the --provider flag. - Enhanced error handling to provide clear feedback in both JSON and console output formats. * feat: support remote CDP WebSocket URLs in --cdp flag (vercel-labs#99) Previously, the --cdp flag only accepted a port number and connected via http://localhost:{port}. This made it impossible to connect to remote browser services like Kernel, Browserless, etc. that provide WebSocket URLs. The --cdp flag now accepts either: - A port number (e.g., 9222) for local connections - A full WebSocket URL (e.g., wss://...) for remote browser services Changes: - Added cdpUrl field to LaunchCommand type - Updated protocol validation to accept URL format with scheme validation - Modified connectViaCDP to detect and handle both formats - Handle numeric strings for JSON serialization edge cases - Updated CLI to send cdpUrl or cdpPort based on input format - Updated README with examples for remote connections Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> * feat: add browser launch --args, --user-agent, --proxy-bypass configuration support. (vercel-labs#35) * feat: add browser launch args, user-agent, and proxy configuration support * fix: User Agent env need added * fix: command pass error --------- Co-authored-by: Chris Tate <chris@ctate.dev> * add missing flag (vercel-labs#203) * add missing flag * clean up tests * fix: add .exe extension for Windows source binary path (vercel-labs#188) The copy-native.js script was looking for 'agent-browser' but on Windows the compiled binary is 'agent-browser.exe', causing the copy to fail. Co-authored-by: jiazhuangai <jiazhuangai@example.com> Co-authored-by: Claude <noreply@anthropic.com> * fix: use ~/.agent-browser for socket files instead of TMPDIR (vercel-labs#180) * fix: use ~/.agent-browser for socket files instead of TMPDIR This fixes issue vercel-labs#163 where different TMPDIR values (common with tmux/screen/VSCode/IntelliJ) caused the CLI and daemon to use different socket paths. Socket directory priority: 1. AGENT_BROWSER_SOCKET_DIR (explicit override) 2. $XDG_RUNTIME_DIR/agent-browser (Linux standard) 3. ~/.agent-browser (fallback, like Docker Desktop) Both CLI (Rust) and daemon (Node.js) now use the same logic. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: session list now looks in correct socket directory - Make get_socket_dir() public in connection.rs - Update session list to use get_socket_dir() instead of temp_dir() - Update pid file pattern from agent-browser-{session}.pid to {session}.pid - Add tmpdir fallback to daemon.ts when homedir is unavailable Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * test: add unit tests for socket directory resolution Add comprehensive tests for get_socket_dir/getSocketDir to verify: - AGENT_BROWSER_SOCKET_DIR takes priority - Empty strings are ignored (fixes Rust/TypeScript consistency) - XDG_RUNTIME_DIR fallback works correctly - Home directory fallback when env vars unset Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> * errors doc more descriptive (vercel-labs#190) * docs: add Claude Code marketplace plugin installation instructions (vercel-labs#181) Document the recommended way to install the agent-browser skill using the /plugin marketplace commands introduced in PR vercel-labs#106. * Add --profile flag for persistent browser profiles (vercel-labs#68) * Add --profile flag for persistent browser profiles Adds support for persistent browser profiles that preserve cookies, localStorage, and login sessions across browser restarts. Changes: - Add --profile <path> CLI flag (flags.rs) - Add AGENT_BROWSER_PROFILE environment variable support - Add profile field to LaunchCommand type (types.ts) - Use launchPersistentContext when profile is specified (browser.ts) - Update help text and README with documentation Usage: agent-browser --profile ~/.myapp-profile open myapp.com This enables AI agents to maintain authenticated sessions across browser restarts without re-authenticating each time. * Expand tilde in profile path to home directory * fix: add missing profile field to test Flags struct --------- Co-authored-by: Chris Tate <chris@ctate.dev> * fix: support WebSocket URLs in connect command (vercel-labs#205) * fix: support WebSocket URLs in connect command * address feedback * feat: add download CLI commands with ref support (vercel-labs#183) * feat: add download and waitfordownload CLI commands Add CLI support for the existing download functionality in the daemon: - `download <selector> <path>`: Click an element to trigger download and save to specified path - `wait --download [path] [--timeout ms]`: Wait for any download to complete, optionally save to path with configurable timeout Includes comprehensive unit tests and help documentation. * fix: download command ref support and output message - Fix handleDownload to use browser.getLocator() for ref selector support - Fix CLI output to show "Downloaded to" instead of "Screenshot saved" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Chris Tate <chris@ctate.dev> * docs: update agent-browser skill documentation (vercel-labs#164) * fix(screenshot): support refs and improve error messages (vercel-labs#141) * fix(screenshot): support refs and improve error messages * fix(cli): support selector argument in screenshot command * Fix CSS class selectors being treated as file paths * fix(test): update screenshot test assertions --------- Co-authored-by: Chris Tate <chris@ctate.dev> * feat(skills): Add hierarchical structure with references and templates (vercel-labs#157) * feat(skills): Add hierarchical structure with references and templates Adds modular documentation and executable templates to the agent-browser skill for better AI agent consumption and progressive disclosure. ## Added ### References (deep-dive documentation) - `references/snapshot-refs.md` - Ref lifecycle, invalidation, troubleshooting - `references/session-management.md` - Parallel sessions, state persistence - `references/authentication.md` - Login flows, OAuth, 2FA patterns - `references/video-recording.md` - Recording for debugging/docs - `references/proxy-support.md` - Proxy configuration, geo-testing ### Templates (ready-to-use workflows) - `templates/form-automation.sh` - Form filling with validation - `templates/authenticated-session.sh` - Login once, reuse state - `templates/capture-workflow.sh` - Content extraction with screenshots ## Modified - `SKILL.md` - Added reference tables linking to new documentation ## Benefits - Progressive disclosure: Load overview first, deep dives on demand - Reduced context: Smaller chunks for better LLM token efficiency - Ready workflows: Copy-paste templates for common patterns * fix(templates): Make authenticated-session.sh runnable out-of-box Addresses review feedback: login actions were commented but verification wasn't, causing script to fail when run as-is. New approach: - DISCOVERY MODE runs first (shows form structure) - LOGIN FLOW section is fully commented as a unit - User runs once to see refs, then customizes ┌─────────────────────────────────────────────────────────────┐ │ LOGIN FORM STRUCTURE │ ├─────────────────────────────────────────────────────────────┤ │ @e1 [input type="email"] │ │ @e2 [input type="password"] │ │ @e3 [button] "Sign In" │ └─────────────────────────────────────────────────────────────┘ * fix(cli): correct output messages for state load and path-based actions (vercel-labs#109) * Add files via upload fix(cli): correct output messages for state load and path-based actions * Add files via upload * Update output.rs * fix crlf --------- Co-authored-by: Chris Tate <chris@ctate.dev> * auto-release (vercel-labs#216) * auto-release * fixes * fix secret name * update provider flag (vercel-labs#217) * auto-release * fixes * fix secret name * update provider flag * v0.7.0 docs (vercel-labs#218) * auto-release * fixes * fix secret name * update provider flag * v0.7.0 changelog * chore: add changeset for v0.7.0 release (vercel-labs#219) * chore: version packages (vercel-labs#220) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: download artifacts to temp directory to avoid naming conflict (vercel-labs#221) The download-artifact action creates directories named after each artifact. When downloading to bin/, this caused conflicts because the artifact directory names matched the binary names (e.g., bin/agent-browser-darwin-arm64/agent-browser-darwin-arm64). Fix by downloading to artifacts/ first, then using find to move the binaries to bin/. * fix docs (vercel-labs#223) * fix: download artifacts to temp directory to avoid naming conflict The download-artifact action creates directories named after each artifact. When downloading to bin/, this caused conflicts because the artifact directory names matched the binary names (e.g., bin/agent-browser-darwin-arm64/agent-browser-darwin-arm64). Fix by downloading to artifacts/ first, then using find to move the binaries to bin/. * fix docs * fix bin (vercel-labs#224) * chore: release v0.7.1 (vercel-labs#225) Fix native binary distribution in npm package. Binaries are now built before publishing to npm, ensuring all platforms work on installation. * chore: version packages (vercel-labs#226) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * chore: add changeset for binary distribution fix (vercel-labs#227) * chore: version packages (vercel-labs#228) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: ensure binary is executable after npm install (vercel-labs#229) * chore: version packages (vercel-labs#231) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: handle existing GitHub releases in workflow (vercel-labs#232) * chore: version packages (vercel-labs#233) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: allow null selector in screenshot command schema (vercel-labs#236) The screenshot command was failing with 'Validation error: selector: Expected string, received null' when only a path was provided (e.g., 'agent-browser screenshot ~/Desktop/test.png'). The Rust CLI serializes None values as null in JSON, but the Zod schema only allowed undefined (via .optional()), not null. Changed selector field to use .nullish() which accepts both null and undefined. Fixes issue where screenshot command without selector fails validation. * chore: add patch changeset for release (vercel-labs#242) * chore: version packages (vercel-labs#243) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * feat: add support for ignoring HTTPS certificate errors (vercel-labs#93) * feat: add support for ignoring HTTPS certificate errors * fix: update warning message for already running daemon to include ignore HTTPS errors option * docs: add documentation for --ignore-https-errors option in README and SKILL.md * feat: initialize ignore_https_errors flag in command context * fix: change launch_cmd to mutable for cdp value handling * Add CLI flags for cookie URL, domain, path, httpOnly, secure, and expires (vercel-labs#266) * Add CLI flags for cookie URL, domain, path, httpOnly, secure, and expires Extends the `cookies set` command to support setting cookies with additional parameters before loading a page, solving authentication workflows where cookies need to be set for different domains. **Key changes:** - Added CLI flags: `--url`, `--domain`, `--path`, `--httpOnly`, `--secure`, `--sameSite`, `--expires` - Added comprehensive test coverage for all new flags and combinations - Updated help documentation with usage examples - No daemon changes needed - it already supported these parameters **Example usage:** ```bash agent-browser cookies set session_id "abc123" --url https://app.example.com --httpOnly --secure ``` This allows setting cookies for a URL before opening the page, eliminating the need for workarounds in cross-domain authentication scenarios. Fixes vercel-labs#261 * Update lock * Fix compilation error * Fix: CLI: state load / profile persistence not usable in v0.7.6 (vercel-labs#268) * Fix: CLI: state load / profile persistence not usable in v0.7.6 This PR addresses issue vercel-labs#259 * Fix issues identified in code review * generic placeholder for cloud browser provider (vercel-labs#260) * docs: use generic placeholder for cloud browser provider * docs: clarify available cloud browser providers * Fix: set device does not apply deviceScaleFactor - HiDPI screenshots not possible (vercel-labs#270) Fixes vercel-labs#255 * Fix: check command hangs indefinitely (vercel-labs#272) Fixes vercel-labs#257 * feat: add Kernel as cloud browser provider (vercel-labs#200) Add Kernel (https://kernel.sh) as a third-party cloud browser provider, following the same pattern as Browserbase and Browser Use integrations. Features: - Launch browser with `-p kernel` flag or `AGENT_BROWSER_PROVIDER=kernel` - Configurable via environment variables: - KERNEL_API_KEY (required) - KERNEL_HEADLESS (default: false) - KERNEL_STEALTH (default: true) - KERNEL_TIMEOUT_SECONDS (default: 300) - KERNEL_PROFILE_NAME (optional, for persistent sessions) - Profile find-or-create: automatically creates profile if it doesn't exist - Profile persistence: cookies/logins saved back to profile on session close - Uses raw fetch() calls for API communication (no SDK dependency) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> * Security: Reject cross-origin connections to daemon and stream server (vercel-labs#274) * Fix tab list command not recognizing new pages opened via clicks (vercel-labs#275) ## Summary Fixed an issue where the `tab list` command couldn't recognize new pages that were opened externally (e.g., via `target="_blank"` links or popup windows). The problem occurred because context-level page tracking wasn't properly set up for all browser launch methods, causing new pages created outside of explicit `newTab()` calls to go untracked. ## Changes - Added `setupContextTracking(context)` calls to `launch()`, `launchIncognito()`, and other context creation methods to ensure all contexts listen for new page events - Added duplicate page checks (`!this.pages.includes(page)`) in `setupContextTracking()`, `newTab()`, and `launchIncognito()` to prevent the same page from being tracked multiple times - Fixed `activePageIndex` calculation in `launch()` to properly set the active page index - Enhanced comments to clarify that `setupContextTracking()` handles externally created pages (popups, new tabs from links) ## Implementation Details The fix ensures that when a user clicks an element that opens a new tab/window, the browser context's 'page' event listener will automatically detect and track the new page. The duplicate prevention logic handles cases where both the context listener and manual page creation might try to add the same page. Fixes vercel-labs#273 * chore(cli): sync Cargo.toml version to 0.7.6 (vercel-labs#276) * chore(cli): save screenshots to tmp dir when no path provided (vercel-labs#247) * fix(cli): save screenshots to tmp dir when no path provided Instead of outputting base64 to stdout (which is not useful for most CLI use cases), screenshots without a path now save to ~/.agent-browser/tmp/screenshots/ with a generated filename and return the path. This makes the behavior more ergonomic for AI agents and CLI users alike. * cleanup * cleanup * just revert the cargo.lock version for now * refactor: extract getAppDir() from getSocketDir() * docs: improve screenshot help text consistency * chore: add minor changeset for release (vercel-labs#280) * chore: version packages (vercel-labs#281) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * v0.8.0 changelog (vercel-labs#282) * header (vercel-labs#283) * fix: CLI binary not executable when postinstall is skipped (pnpm, bun) (vercel-labs#285) * fix binary * check binary in CI * chore: add patch changeset for release (vercel-labs#286) * chore: version packages (vercel-labs#288) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * ci: add retry logic to flaky Windows integration test (vercel-labs#287) * durable windows ci * more * ci: add test for Windows CMD wrapper (vercel-labs#289) * ci: add test for Windows CMD wrapper This test will fail until the CMD wrapper is fixed to call the native binary. * fix: Windows CMD wrapper calls native binary instead of missing index.js * chore: add patch changeset for release (vercel-labs#291) * chore: version packages (vercel-labs#292) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * test: add Windows npm global install CI test (reproduces vercel-labs#262) (vercel-labs#293) * test: add Windows npm global install CI test (reproduces vercel-labs#262) This test packs the package and installs it globally with npm, then runs agent-browser --version. This reproduces the issue where npm-generated shims on Windows try to invoke /bin/sh which doesn't exist. The bin/agent-browser.js wrapper is added but not yet wired up, so this commit should fail CI to confirm the issue. * fix: Windows npm global install and npx support The shell script wrapper (bin/agent-browser) with #!/bin/sh shebang causes npm to generate Windows shims that try to invoke /bin/sh, which doesn't exist on Windows. This fix uses a hybrid approach: 1. Node.js wrapper (bin/agent-browser.js) as bin entry - Makes npx work on all platforms - ~100ms overhead (acceptable since npx has its own overhead) 2. postinstall patches bin entries for global installs - Windows: Overwrites .cmd/.ps1 shims to invoke .exe directly - Mac/Linux: Replaces symlink to point to native binary - Zero overhead for `npm i -g agent-browser` users on all platforms Also fixes PowerShell glob expansion in CI test. Fixes vercel-labs#262 * fix: Windows npm global install and npx support The shell script wrapper (bin/agent-browser) with #!/bin/sh shebang causes npm to generate Windows shims that try to invoke /bin/sh, which doesn't exist on Windows. This fix uses a hybrid approach: 1. Node.js wrapper (bin/agent-browser.js) as bin entry - Makes npx work on all platforms - ~100ms overhead (acceptable since npx has its own overhead) 2. postinstall patches bin entries for global installs - Windows: Overwrites .cmd/.ps1 shims to invoke .exe directly - Mac/Linux: Replaces symlink to point to native binary - Zero overhead for `npm i -g agent-browser` users on all platforms Also adds cross-platform CI tests for npm global install to catch regressions on all platforms (Ubuntu, macOS, Windows). Fixes vercel-labs#262 * test global install * remove dead code * chore: add patch changeset for release (vercel-labs#294) * chore: version packages (vercel-labs#295) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * resolve rebase conflicts in src/daemon.ts --------- Co-authored-by: Paul Klein <paulleoklein@gmail.com> Co-authored-by: Kylejeong2 <kylejeong21@gmail.com> Co-authored-by: Aitor <44302869+reformedot@users.noreply.github.com> Co-authored-by: Rafael <raf@kernel.sh> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Oanakiaja <281723571@qq.com> Co-authored-by: Chris Tate <chris@ctate.dev> Co-authored-by: mypengpengli <306100898@qq.com> Co-authored-by: jiazhuangai <jiazhuangai@example.com> Co-authored-by: mmhiyoko <mmhiyoko@gmail.com> Co-authored-by: Shpeedle <ben.siewert86@gmail.com> Co-authored-by: Tom Dale <tom.dale@vercel.com> Co-authored-by: Lindsey Simon <elsigh@gmail.com> Co-authored-by: Namish pruthi <namishpruthi800@gmail.com> Co-authored-by: Márk Magyar <magyarheaven@gmail.com> Co-authored-by: Danila Poyarkov <dev@dannote.net> Co-authored-by: Yonatan <yonatan2gross@gmail.com> Co-authored-by: TimWhite <36320909+timwhitez@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Zach Warunek <58487828+zwarunek@users.noreply.github.com> Co-authored-by: Zhiwei Li <65117011+Levix@users.noreply.github.com> Co-authored-by: shawn pana <129362299+ShawnPana@users.noreply.github.com> Co-authored-by: n33pm <12273891+n33pm@users.noreply.github.com> Co-authored-by: Li Yang <76434265+hewliyang@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: 34f2aww <34f2aww@users.noreply.github.com>
|
@rgarcia Is self-hosting supported? (via https://github.com/kernel/kernel-images ?) We can only get data from internal network. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
KERNEL_API_KEY,KERNEL_HEADLESS,KERNEL_STEALTH,KERNEL_TIMEOUT_SECONDS,KERNEL_PROFILE_NAMETest plan
Tested locally with integration test script: https://gist.github.com/rgarcia/68f2d24c800cc9e82e620f724dd1f2dd
🤖 Generated with Claude Code