MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / resolveDaemonRoot

Function resolveDaemonRoot

src/mcp/index.ts:160–165  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

158 * fail to share the daemon.
159 */
160function 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

Callers 3

startMethod · 0.85
startDirectMethod · 0.85
startDaemonProcessMethod · 0.85

Calls 1

findNearestCodeGraphRootFunction · 0.90

Tested by

no test coverage detected