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

Function buildPlacementIndex

graph-ui/src/agents/agent-placement.ts:108–125  ·  view source on GitHub ↗
(nodes: readonly GraphNode[])

Source from the content-addressed store, hash-verified

106
107/** Den Index einmal bauen. */
108export function buildPlacementIndex(nodes: readonly GraphNode[]): PlacementIndex {
109 const byPath = new Map<string, GraphNode[]>();
110 const named: GraphNode[] = [];
111 for (const node of nodes) {
112 const path = normalizePath(node.file_path ?? '');
113 if (path.length === 0) {
114 continue;
115 }
116 const bucket = byPath.get(path);
117 if (bucket === undefined) {
118 byPath.set(path, [node]);
119 } else {
120 bucket.push(node);
121 }
122 named.push(node);
123 }
124 return { byPath, named };
125}
126
127/** Wie viele Zeilen ein Knoten umspannt. Unbekannt heisst: unendlich weit. */
128function spanOf(node: GraphNode): number {

Callers 4

GalaxyPanelFunction · 0.90
buildAgentsViewFunction · 0.90
ActivityPanelFunction · 0.90

Calls 3

normalizePathFunction · 0.70
getMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected