()
| 112 | } |
| 113 | |
| 114 | async function formatRuntimeSection(): Promise<string> { |
| 115 | const daemon = queryDaemonStatus() |
| 116 | const sessions = await listLiveSessions() |
| 117 | const lines = [ |
| 118 | `Daemon: ${daemon.status}${daemon.state ? ` pid=${daemon.state.pid} workers=${daemon.state.workerKinds.join(',')}` : ''}`, |
| 119 | `Background sessions: ${sessions.length}`, |
| 120 | ] |
| 121 | for (const session of sessions.slice(0, 8)) { |
| 122 | lines.push( |
| 123 | ` pid=${session.pid} kind=${session.kind} status=${session.status ?? 'unknown'} cwd=${session.cwd}`, |
| 124 | ) |
| 125 | } |
| 126 | if (sessions.length > 8) { |
| 127 | lines.push(` ... ${sessions.length - 8} more session(s)`) |
| 128 | } |
| 129 | return lines.join('\n') |
| 130 | } |
| 131 | |
| 132 | function formatAutoModeSection(): string { |
| 133 | let available = false |
no test coverage detected