getAgentBrowserPath resolves the agent-browser bin script, but the resolved path is handed straight to Bun.spawn / execFileSync in execCommand (src/runner.ts). On Windows that does not work for two reasons:
- Only the extensionless shim is probed. The resolver checks
<node_modules>/.bin/agent-browser. On Windows, npm/bun generate agent-browser.cmd (and .ps1) alongside it; the extensionless file is a shell script that Windows will not execute.
- The JavaScript-bin fallback has no interpreter. When the shim is missing, the resolver falls back to the package's own
bin script (agent-browser@0.9.3 ships a JS file). Windows does not honour the shebang line, so spawning that path directly fails.
Suggested fix
Teach the resolver to return a command descriptor rather than a bare path — something like { command, prependArgs } — so the launch site can:
- prefer
agent-browser.cmd on win32 when it exists, and
- invoke a JS bin script through
process.execPath (node <script>) instead of relying on shebang handling.
Keep the current direct-execution path unchanged on non-Windows platforms.
Notes
getAgentBrowserPathresolves the agent-browser bin script, but the resolved path is handed straight toBun.spawn/execFileSyncinexecCommand(src/runner.ts). On Windows that does not work for two reasons:<node_modules>/.bin/agent-browser. On Windows, npm/bun generateagent-browser.cmd(and.ps1) alongside it; the extensionless file is a shell script that Windows will not execute.binscript (agent-browser@0.9.3ships a JS file). Windows does not honour the shebang line, so spawning that path directly fails.Suggested fix
Teach the resolver to return a command descriptor rather than a bare path — something like
{ command, prependArgs }— so the launch site can:agent-browser.cmdonwin32when it exists, andprocess.execPath(node <script>) instead of relying on shebang handling.Keep the current direct-execution path unchanged on non-Windows platforms.
Notes
mainin fix: resolve agent-browser via module resolution (fixes #15) #19 (fix/agent-browser-resolution), not in feat: CLI surface adapter #16 — it only surfaced in that PR's diff becausemainwas merged into the branch. Deferred out of feat: CLI surface adapter #16 as out of scope.windows-latestCI leg) should come with the fix.