* Resolve the project root the daemon machinery should key on. Returns * `null` when no `.codegraph/` is reachable from the candidate path — in * that case the caller must run in direct mode, since the daemon lockfile * and socket both live under `.codegraph/`. * * The result is canonicalized w
(explicitPath: string | null)
| 158 | * fail to share the daemon. |
| 159 | */ |
| 160 | function resolveDaemonRoot(explicitPath: string | null): string | null { |
| 161 | const candidate = explicitPath ?? process.cwd(); |
| 162 | const root = findNearestCodeGraphRoot(candidate); |
| 163 | if (!root) return null; |
| 164 | try { return fs.realpathSync(root); } catch { return root; } |
| 165 | } |
| 166 | |
| 167 | /** |
| 168 | * Spawn the shared daemon as a fully detached background process: its own |
no test coverage detected