MCPcopy
hub / github.com/colbymchenry/codegraph / getDaemonSocketCandidates

Function getDaemonSocketCandidates

src/mcp/daemon-paths.ts:69–77  ·  view source on GitHub ↗
(projectRoot: string)

Source from the content-addressed store, hash-verified

67 * — bind would throw ENAMETOOLONG, so we skip straight to tmpdir.
68 */
69export function getDaemonSocketCandidates(projectRoot: string): string[] {
70 if (process.platform === 'win32') {
71 return [`\\\\.\\pipe\\codegraph-${projectHash(projectRoot)}`];
72 }
73 const inProject = path.join(getCodeGraphDir(projectRoot), 'daemon.sock');
74 const tmp = tmpdirSocketPath(projectRoot);
75 if (inProject.length > POSIX_SOCKET_PATH_LIMIT) return [tmp];
76 return [inProject, tmp];
77}
78
79/**
80 * The PREFERRED (primary) socket path — candidate 0. Use this only where a

Callers 5

startMethod · 0.90
cleanupDaemonArtifactsFunction · 0.90
getDaemonSocketPathFunction · 0.85

Calls 4

getCodeGraphDirFunction · 0.90
projectHashFunction · 0.85
tmpdirSocketPathFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected