(run: RunInfo)
| 272 | } |
| 273 | |
| 274 | function broadcastStatus(run: RunInfo) { |
| 275 | const payload = { |
| 276 | id: run.id, |
| 277 | state: run.state, |
| 278 | startedAt: run.startedAt ?? null, |
| 279 | endedAt: run.endedAt ?? null, |
| 280 | exitCode: run.exitCode ?? null, |
| 281 | planPath: run.planPath, |
| 282 | cmd: run.cmd, |
| 283 | dashboardUrl: dashboardProxyPath(run), |
| 284 | } |
| 285 | for (const sub of run.subscribers) { |
| 286 | try { |
| 287 | sseWrite(sub, 'status', payload) |
| 288 | } catch { |
| 289 | // ignore |
| 290 | } |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | async function proxyHttp( |
| 295 | req: IncomingMessage, |
no test coverage detected