(board, item)
| 272 | } |
| 273 | |
| 274 | function buildItemWorkStatus(board, item) { |
| 275 | const statuses = []; |
| 276 | const assignees = normalizeStringArray(item?.assignees); |
| 277 | if (assignees.length > 0) { |
| 278 | statuses.push({ label: `Assigned: ${assignees.join(", ")}` }); |
| 279 | } |
| 280 | const decision = board.decisions?.[item.id]; |
| 281 | const triageAgent = normalizeText(decision?.decision === "assign_agent" ? decision?.agent : ""); |
| 282 | if (assignees.length === 0 && triageAgent) { |
| 283 | statuses.push({ label: `Assigned in triage: ${triageAgent}` }); |
| 284 | } |
| 285 | const work = board.workStatus?.[item.id]; |
| 286 | if (work?.sessionState === "active") { |
| 287 | const sessionName = normalizeText(work.sessionName); |
| 288 | statuses.push({ label: sessionName ? `Session active: ${sessionName}` : "Session active" }); |
| 289 | } else if (work?.sessionState === "starting") { |
| 290 | statuses.push({ label: "Session starting" }); |
| 291 | } else if (work?.sessionState === "requested") { |
| 292 | const sessionName = normalizeText(work.sessionName); |
| 293 | statuses.push({ label: sessionName ? `Session requested: ${sessionName}` : "Session requested" }); |
| 294 | } |
| 295 | return statuses; |
| 296 | } |
| 297 | |
| 298 | function buildBoardState(board) { |
| 299 | const allLabels = [...new Set(board.items.flatMap((item) => (Array.isArray(item.labels) ? item.labels : [])))].sort((a, b) => |
no test coverage detected