(rootDir: string)
| 104 | } |
| 105 | |
| 106 | function scheduleSave(rootDir: string): void { |
| 107 | const existing = saveTimeout.get(rootDir); |
| 108 | if (existing) clearTimeout(existing); |
| 109 | savePending.set(rootDir, true); |
| 110 | saveTimeout.set(rootDir, setTimeout(() => { |
| 111 | if (savePending.get(rootDir)) { |
| 112 | persistGraph(rootDir).catch(() => {}).finally(() => savePending.set(rootDir, false)); |
| 113 | } |
| 114 | }, 500)); |
| 115 | } |
| 116 | |
| 117 | function getEdgesForNode(graph: GraphStore, nodeId: string): MemoryEdge[] { |
| 118 | return Object.values(graph.edges).filter(e => e.source === nodeId || e.target === nodeId); |
no test coverage detected