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

Function resolveDaemonRoot

src/mcp/index.ts:119–124  ·  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

117 * fail to share the daemon.
118 */
119function resolveDaemonRoot(explicitPath: string | null): string | null {
120 const candidate = explicitPath ?? process.cwd();
121 const root = findNearestCodeGraphRoot(candidate);
122 if (!root) return null;
123 try { return fs.realpathSync(root); } catch { return root; }
124}
125
126/**
127 * Spawn the shared daemon as a fully detached background process: its own

Callers 2

startMethod · 0.85
startDaemonProcessMethod · 0.85

Calls 1

findNearestCodeGraphRootFunction · 0.90

Tested by

no test coverage detected