(config: ReturnType<Config["loadConfigOrDefault"]>)
| 6484 | } |
| 6485 | |
| 6486 | private buildAgentTaskIndex(config: ReturnType<Config["loadConfigOrDefault"]>): AgentTaskIndex { |
| 6487 | const byId = new Map<string, AgentTaskWorkspaceEntry>(); |
| 6488 | const childrenByParent = new Map<string, string[]>(); |
| 6489 | const parentById = new Map<string, string>(); |
| 6490 | |
| 6491 | for (const task of this.listAgentTaskWorkspaces(config)) { |
| 6492 | const taskId = task.id!; |
| 6493 | byId.set(taskId, task); |
| 6494 | |
| 6495 | const parent = task.parentWorkspaceId; |
| 6496 | if (!parent) continue; |
| 6497 | |
| 6498 | parentById.set(taskId, parent); |
| 6499 | const list = childrenByParent.get(parent) ?? []; |
| 6500 | list.push(taskId); |
| 6501 | childrenByParent.set(parent, list); |
| 6502 | } |
| 6503 | |
| 6504 | return { byId, childrenByParent, parentById }; |
| 6505 | } |
| 6506 | |
| 6507 | private hasArchivedAncestor( |
| 6508 | index: AgentTaskIndex, |
no test coverage detected