diff options
| author | Aman Kumar <145339995+amankumarsingh77@users.noreply.github.com> | 2026-07-12 22:03:43 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-12 22:03:43 +0530 |
| commit | cf92c10eda651cdad882aa050439c80d2f40b4b1 (patch) | |
| tree | 789e211f90c8548bac7b149ddfecc4312a6ba037 /package.json | |
| parent | f6bab02b6b93c3804ec83b853e333fba417a0988 (diff) | |
fix: make browser daemon setup work on Windows (#7) (#12)
The Unix socket daemon introduced in v0.6.0 made several POSIX-only
assumptions that break setup on Windows:
- protocol.ts hardcoded a Unix socket path (/tmp/pi-browser-daemon.sock).
Node IPC on Windows requires a named pipe (\\.\pipe\<name>); a /tmp
path is not a valid net listen/connect target there.
- spawn.ts spawned the bare tsx binary / `npx` and probed the non-Windows
.bin/tsx shim. On Windows npm binaries are .cmd shims that must run via a
shell, and spawning them directly fails with EINVAL / ENOENT.
- isDaemonRunning() pre-checked the socket with fs.access(), which always
fails for a named pipe and would report a live daemon as dead.
- stale-socket unlink() would throw on a named pipe path.
Changes:
- DAEMON_SOCKET_PATH is now platform-aware: named pipe on win32, Unix
socket elsewhere.
- spawnDaemon() resolves tsx.cmd / npx.cmd on Windows, runs via shell with
per-token quoting (paths with spaces) and windowsVerbatimArguments.
- isDaemonRunning() skips the fs.access pre-check on Windows and probes the
pipe directly.
- stale-socket cleanup is a no-op on Windows (named pipes self-clean).
- setup.ts daemon-failure message uses the actual DAEMON_SOCKET_PATH.
Closes #7
Diffstat (limited to 'package.json')
0 files changed, 0 insertions, 0 deletions
