Skip to main content

Module paths

Module paths 

Source
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_un path 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 --socket keeps its token beside it. For the default socket this equals token_path.