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

Function parseClientHelloLine

src/mcp/daemon.ts:758–767  ·  view source on GitHub ↗
(
  line: string,
)

Source from the content-addressed store, hash-verified

756 * which case the caller treats the bytes as ordinary JSON-RPC.
757 */
758export function parseClientHelloLine(
759 line: string,
760): { pid: number; hostPid: number | null } | null {
761 let parsed: unknown;
762 try { parsed = JSON.parse(line); } catch { return null; }
763 if (!parsed || typeof parsed !== 'object') return null;
764 const o = parsed as Record<string, unknown>;
765 if (o.codegraph_client !== 1 || typeof o.pid !== 'number') return null;
766 return { pid: o.pid, hostPid: typeof o.hostPid === 'number' ? o.hostPid : null };
767}
768
769/**
770 * A client's peer is dead when its proxy process is gone, or when its known

Callers 2

onDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected