()
| 24 | } |
| 25 | |
| 26 | private load(): void { |
| 27 | if (!existsSync(this.graphPath)) { |
| 28 | this.index = null; |
| 29 | return; |
| 30 | } |
| 31 | |
| 32 | try { |
| 33 | const raw = readFileSync(this.graphPath, "utf-8"); |
| 34 | const graph: WorkflowGraph = JSON.parse(raw); |
| 35 | graph._workspacePath = this.workspacePath; |
| 36 | this.index = this.buildIndex(graph); |
| 37 | } catch { |
| 38 | this.index = null; |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | private buildIndex(graph: WorkflowGraph): GraphIndex { |
| 43 | const nodeById = new Map<string, WorkflowNode>(); |
no test coverage detected