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

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:
leeguooooo
2026-06-12 12:56:21 +09:00
parent b4c1707a01
commit 61060486f4
89 changed files with 1897 additions and 1926 deletions
+12 -12
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env node
/**
* Postinstall script for agent-browser
* Postinstall script for chrome-use
*
* Downloads the platform-specific native binary if not present.
* On global installs, patches npm's bin entry to use the native binary directly:
@@ -35,7 +35,7 @@ function isMusl() {
const osKey = platform() === 'linux' && isMusl() ? 'linux-musl' : platform();
const platformKey = `${osKey}-${arch()}`;
const ext = platform() === 'win32' ? '.exe' : '';
const binaryName = `agent-browser-${platformKey}${ext}`;
const binaryName = `chrome-use-${platformKey}${ext}`;
const binaryPath = join(binDir, binaryName);
// Package info
@@ -82,7 +82,7 @@ async function downloadFile(url, dest) {
/**
* Detect which package manager ran this postinstall and write a marker file
* next to the binary so `agent-browser upgrade` can use the correct one
* next to the binary so `chrome-use upgrade` can use the correct one
* without fragile path heuristics or slow subprocess probing.
*
* npm_config_user_agent is set by npm/pnpm/yarn/bun during lifecycle scripts,
@@ -193,7 +193,7 @@ function showInstallReminder() {
if (systemChrome) {
console.log('');
console.log(` ✓ System Chrome found: ${systemChrome}`);
console.log(' agent-browser will use it automatically.');
console.log(' chrome-use will use it automatically.');
console.log('');
return;
}
@@ -202,12 +202,12 @@ function showInstallReminder() {
console.log(' ⚠ No Chrome installation detected.');
console.log(' If you plan to use a local browser, run:');
console.log('');
console.log(' agent-browser install');
console.log(' chrome-use install');
if (platform() === 'linux') {
console.log('');
console.log(' On Linux, include system dependencies with:');
console.log('');
console.log(' agent-browser install --with-deps');
console.log(' chrome-use install --with-deps');
}
console.log('');
console.log(' You can skip this if you use --cdp, --provider, --engine, or --executable-path.');
@@ -240,7 +240,7 @@ async function fixUnixSymlink() {
return; // npm not available
}
const symlinkPath = join(npmBinDir, 'agent-browser');
const symlinkPath = join(npmBinDir, 'chrome-use');
// Check if symlink exists (indicates global install)
try {
@@ -277,19 +277,19 @@ async function fixWindowsShims() {
return;
}
const cmdShim = join(npmBinDir, 'agent-browser.cmd');
const ps1Shim = join(npmBinDir, 'agent-browser.ps1');
const cmdShim = join(npmBinDir, 'chrome-use.cmd');
const ps1Shim = join(npmBinDir, 'chrome-use.ps1');
// Shims may not exist yet during postinstall (npm creates them after
// lifecycle scripts). If missing, fall back: the JS wrapper at
// bin/agent-browser.js handles Windows correctly via child_process.spawn.
// bin/chrome-use.js handles Windows correctly via child_process.spawn.
if (!existsSync(cmdShim)) {
return;
}
// Point the shims at the binary's ABSOLUTE path. The previous code rebuilt a
// relative `node_modules\agent-browser\bin\...` path, but this fork's package
// is `agent-browser-stealth`, so that path never existed → the rewrite was
// relative `node_modules\chrome-use\bin\...` path, but this fork's package
// is `chrome-use`, so that path never existed → the rewrite was
// skipped and the shim stayed the (slower) JS wrapper. `binaryPath` is the
// real absolute path to the native binary inside this package.
if (!existsSync(binaryPath)) {