(content)
| 58 | return String(task.id || '').replace(/^#/, '').trim(); |
| 59 | } |
| 60 | |
| 61 | function parseWorkQueue(content) { |
| 62 | const lines = String(content || '').split(/\r?\n/); |
| 63 | const start = lines.findIndex((line) => /^##\s+Work Queue\s*$/i.test(line.trim())); |
| 64 | if (start === -1) return []; |
| 65 | |
| 66 | const tableLines = []; |
| 67 | for (let i = start + 1; i < lines.length; i++) { |
| 68 | const line = lines[i]; |
| 69 | if (/^##\s+/.test(line.trim())) break; |
| 70 | if (line.trim().startsWith('|')) tableLines.push(line); |
| 71 | } |
| 72 | |
| 73 | const headerLine = tableLines.find((line) => !isSeparatorRow(line)); |
| 74 | if (!headerLine) return []; |
| 75 | |
| 76 | const headers = splitCells(headerLine).map(normalizeHeader); |
| 77 | return tableLines |
| 78 | .slice(tableLines.indexOf(headerLine) + 1) |
| 79 | .filter((line) => !isSeparatorRow(line)) |
| 80 | .map((line) => { |
| 81 | const cells = splitCells(line); |
| 82 | const row = {}; |
| 83 | headers.forEach((header, index) => { |
| 84 | row[header] = cells[index] || ''; |
| 85 | }); |
| 86 | |
| 87 | return { |
| 88 | id: taskId({ id: row.id }), |
| 89 | campaign: row.campaign || '', |
| 90 | scope: parseList(row.scope), |
| 91 | deps: parseDeps(row.deps), |
| 92 | status: normalizeStatus(row.status), |
| 93 | wave: parseWave(row.wave), |
| 94 | agent: row.agent || '', |
| 95 | branch: row.branch || '', |
| 96 | evidence: row.evidence || '', |
| 97 | }; |
| 98 | }) |
| 99 | .filter((task) => task.id); |
| 100 | } |
| 101 | |
| 102 | function formatList(items) { |
no test coverage detected