Expand description
Per-user runtime paths for the daemon (control socket, token file) and the filesystem-permission helpers that keep them owner-private.
The runtime directory is resolved via dirs::data_dir —
~/Library/Application Support/omni-dev/ on macOS, ~/.local/share/omni-dev/
on Linux. This deliberately diverges from the ~/.omni-dev config-file
convention used by crate::claude::context: that governs user-editable
configuration, whereas these are runtime artifacts of a long-lived
menu-bar app, for which the platform data directory is the native home.
See ADR-0039.
Constants§
- MAX_
SOCKET_ PATH_ LEN - macOS caps a
sockaddr_unpath at 104 bytes (including the NUL terminator); Linux allows 108. Use the smaller, portable bound.
Functions§
- check_
socket_ path_ len - Fails closed if the socket path is too long for the platform’s
sockaddr_un, with an actionable message instead of an opaque bind error. - ensure_
dir_ 0700 - Creates
dir(and ancestors) if absent and tightens it to owner-only (0700) on Unix. - runtime_
dir - The per-user runtime directory holding the daemon’s socket and token file.
- set_
file_ 0600 - Tightens an existing file to owner read/write only (
0600) on Unix. - socket_
path - Default control-socket path:
<runtime_dir>/daemon.sock. - token_
path - Default bridge token-file path:
<runtime_dir>/bridge.token. Thin clients (request/harvest) fall back to this when no--token-file/env is set. - token_
path_ for_ socket - The bridge token file co-located with a control socket
(
<socket dir>/bridge.token), so a custom--socketkeeps its token beside it. For the default socket this equalstoken_path.