* Gathers candidate session files across all project directories.
(doStat: boolean)
| 404 | * Gathers candidate session files across all project directories. |
| 405 | */ |
| 406 | async function gatherAllCandidates(doStat: boolean): Promise<Candidate[]> { |
| 407 | const projectsDir = getProjectsDir() |
| 408 | |
| 409 | let dirents: Dirent[] |
| 410 | try { |
| 411 | dirents = await readdir(projectsDir, { withFileTypes: true }) |
| 412 | } catch { |
| 413 | return [] |
| 414 | } |
| 415 | |
| 416 | const perProject = await Promise.all( |
| 417 | dirents |
| 418 | .filter(d => d.isDirectory()) |
| 419 | .map(d => listCandidates(join(projectsDir, d.name), doStat)), |
| 420 | ) |
| 421 | |
| 422 | return perProject.flat() |
| 423 | } |
| 424 | |
| 425 | /** |
| 426 | * Lists sessions with metadata extracted from stat + head/tail reads. |
no test coverage detected