Sends a ping and resolves the daemon's pong response (or null on failure).
The CLI's path: sends raw argv and answers with the exit code the daemon reported.
True iff the user opted in to auto-spawn (QUNITX_DAEMON=1), the invocation
is daemon-eligible, and no daemon is running yet — meaning cli should spawn
one before dispatching the run.
True iff a live daemon socket exists and the invocation can use it. The cli's primary dispatch check.
Sends shutdown and waits until the daemon has actually fully exited — not just
until the socket closes. The daemon's dispatch handler acks 'done' before its
async cleanup (server.close / browser.close / process.exit) runs, so a naive
"stop returned" signal leaves the daemon's socket / named-pipe handle still
held. A fast follow-up daemon start would then race the dying daemon and hit
EADDRINUSE — observed reliably on Windows where named-pipe handle release lags
process exit by tens of milliseconds.
Opens a connection to the daemon for the given cwd. Resolves the connected socket
on success; resolves null on any failure (no socket file, ECONNREFUSED, timeout).
Every way a daemon-routed run can fail to produce an exit code.
The daemon accepted the run and then dropped the connection without a terminal message.
The daemon accepted the connection and then said nothing for RUN_SILENCE_TIMEOUT_MS.
& ((
No daemon was listening — the ordinary case on a cold machine, not an error worth showing.
How long the client waits on total silence before declaring the daemon wedged.
Usage
import * as mod from "lib/commands/daemon/client.ts";