diff --git a/src/bsk/ipc-client.js b/src/bsk/ipc-client.js index 92f92c7..78c1877 100644 --- a/src/bsk/ipc-client.js +++ b/src/bsk/ipc-client.js @@ -39,9 +39,6 @@ export class BskIpcClient { async resolveSocket({ isAborted = () => false } = {}) { if (this.#sockPath) return this.#sockPath; - if (process.platform === "win32") { - throw new BskRpcError("unsupported", "Windows named-pipe discovery is not implemented; pass { sockPath: '\\\\\\\\.\\\\pipe\\\\...' } explicitly"); - } const found = readDaemonInfo(this.#home); if (found) return found.sock_path; if (!this.#autoStart) { diff --git a/test/fixtures/fake-bsk-daemon.mjs b/test/fixtures/fake-bsk-daemon.mjs index 4394fe9..68e5eb9 100644 --- a/test/fixtures/fake-bsk-daemon.mjs +++ b/test/fixtures/fake-bsk-daemon.mjs @@ -11,7 +11,10 @@ import path from "node:path"; export async function startFakeBskDaemon({ handlers = {}, delayMs = 0 } = {}) { const home = mkdtempSync(path.join(tmpdir(), "fake-bsk-home-")); mkdirSync(path.join(home, "run")); - const sockPath = path.join(home, "run", "daemon.sock"); + // The real daemon publishes a named pipe on Windows, where a socket file under tmpdir cannot be listened on. + const sockPath = process.platform === "win32" + ? "\\\\.\\pipe\\" + path.basename(home) + : path.join(home, "run", "daemon.sock"); const requests = []; const sockets = new Set();