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.
Structs§
Enums§
- File
Lock Error - Why
try_lock_file_exclusivefailed.
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. - create_
new_ file_ 0600 - Creates
pathexclusively, owner read/write only (0600) from birth on Unix. - ensure_
dir_ 0700 - Creates
dir(and ancestors) if absent and tightens it to owner-only (0700) on Unix. - ensure_
handle_ 0600 - Tightens an open file to owner read/write only (
0600) on Unix if its current mode is any looser. - ensure_
parent_ dir_ 0700 - Creates
path’s parent directory at0700if it doesn’t already exist. - is_
already_ exists_ error - Whether
err’s cause chain includes anio::Errorof kindAlreadyExists. - log_
path_ for_ socket - The daemon log file co-located with a control socket
(
<socket dir>/daemon.log). - 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. - try_
lock_ file_ exclusive - Acquires an advisory exclusive lock on
path(non-blocking). - worktrees_
polling_ path - Default per-repo PR-poll preferences path:
<runtime_dir>/worktrees-polling.json. - worktrees_
pr_ cache_ path - Default resolved-PR-badge cache path:
<runtime_dir>/worktrees-pr-cache.json. - write_
file_ 0600 - Writes
contentstopath, owner read/write only (0600) from birth on Unix.