editor/apps/cli/src/cli-socket-path.ts
konstantin-paulus c3c105aa22 Initial open source release.
This repository contains the initial public version of the project.
The previous development history was intentionally not included.
2026-07-07 09:27:28 +02:00

17 lines
725 B
TypeScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { platform, tmpdir } from "node:os";
import { join } from "node:path";
// One socket / named pipe per host. On macOS tmpdir is per-user; on Linux /tmp
// is global but the socket file's owner-only mode 0600 keeps it isolated.
//
// Kept separate from cli-channels so the renderer can import the channel
// registry and envelope types without pulling in node:os / node:path.
export const SOCKET_PATH =
platform() === "win32"
? "\\\\.\\pipe\\diffusion-studio"
: join(tmpdir(), "diffusion-studio.sock");