MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / readNode

Function readNode

graph-ui/src/galaxy/graph-scope.ts:79–89  ·  view source on GitHub ↗
(row: Record<string, string>, prefix: string, layout: Map<number, GraphNode>)

Source from the content-addressed store, hash-verified

77
78const languageColors: Record<string, string> = { ts: '#6ea6be', tsx: '#6ea6be', js: '#c3b775', jsx: '#c3b775', c: '#92a8b4', h: '#92a8b4', cpp: '#b28da6', py: '#8daf88', go: '#77b2b4', rs: '#bd947c', java: '#bd9281', cs: '#a392bb', rb: '#b78288', swift: '#bf9b85', kt: '#af97ba' };
79function readNode(row: Record<string, string>, prefix: string, layout: Map<number, GraphNode>): GraphNode {
80 const identity = id(row[`${prefix}id`]), known = layout.get(identity);
81 const name = row[`${prefix}name`] || String(identity), label = row[`${prefix}label`] || known?.label || '', qualifiedName = row[`${prefix}qn`] || undefined;
82 // A Branch node answers with the file "{}": no file (round 4, N1).
83 const path = nodeFilePath({ name, label, qualified_name: qualifiedName, file_path: row[`${prefix}file`] || undefined });
84 return { ...known, id: identity, name, label,
85 qualified_name: qualifiedName, file_path: path,
86 start_line: number(row[`${prefix}start_line`]), end_line: number(row[`${prefix}end_line`]),
87 x: known?.x ?? 0, y: known?.y ?? 0, z: known?.z ?? 0,
88 size: known?.size ?? 2.8, color: known?.color ?? languageColors[path?.split('.').pop() ?? ''] ?? '#97a6ad' };
89}
90const anyNames = (alias: string, names: readonly string[]) => `(${names.map(value => `${alias}.qualified_name = "${escapeLiteral(value)}"`).join(' OR ')})`;
91
92/** Deterministic concentric hop rings. Names within a folder stay adjacent;

Callers 1

loadGraphScopeFunction · 0.70

Calls 4

nodeFilePathFunction · 0.90
idFunction · 0.85
numberFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected