* fix(windows): resolve daemon startup failures and Git Bash compatibility
Three root causes behind 27 open Windows issues:
1. Path::canonicalize() returns \\?\ prefixed paths on Windows that
Node.js cannot parse, preventing daemon startup. Strip the prefix
before passing to Node. (fixes#522, #390, #56, #25, #37, #89)
2. Git Bash/MSYS2 translates Unix-style paths and resolves node to
a shell wrapper script. Use node.exe explicitly and set
MSYS_NO_PATHCONV/MSYS2_ARG_CONV_EXCL to prevent argument mangling.
(fixes#148, #108, #171)
3. postinstall fixWindowsShims() hardcoded x64 arch and did not verify
the native binary exists before rewriting shims. Now detects arch
dynamically and validates the binary path. (fixes#262)
Also:
- Error messages now show TCP port on Windows instead of Unix socket path
- Windows CI expanded to test full daemon lifecycle (open, snapshot, close)
* fix(windows): strip \\?\ prefix in auth-cli path (fixes#579)
Same canonicalize() issue as the daemon spawn path, but in
run_auth_cli() which passes the script path to Node.js.
Add automated verification that package.json and cli/Cargo.toml versions
stay in sync. This prevents version drift between the npm package and
Rust CLI binary.
- Add CI job to check version sync on push/PR
- Update pre-commit hook to sync versions automatically
- Update ci:version script to include version sync step
- Add check-version-sync.js script for CI validation
* test: add Windows npm global install CI test (reproduces #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#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#262
* test global install
* remove dead code
* 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