( state: AppState | StatusLineActiveLabelState, )
| 9 | > |
| 10 | |
| 11 | export function getStatusLineActiveLabel( |
| 12 | state: AppState | StatusLineActiveLabelState, |
| 13 | ): string { |
| 14 | const viewedTeammate = getViewedTeammateTask(state) |
| 15 | if (viewedTeammate) { |
| 16 | return `@${viewedTeammate.identity.agentName}` |
| 17 | } |
| 18 | |
| 19 | if (state.viewingAgentTaskId) { |
| 20 | const task = state.tasks[state.viewingAgentTaskId] |
| 21 | if (task?.type === 'local_agent') { |
| 22 | for (const [name, agentId] of state.agentNameRegistry) { |
| 23 | if (agentId === task.id) { |
| 24 | return `@${name}` |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | return `@${task.agentType}` |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | return DEFAULT_ACTIVE_LABEL |
| 33 | } |
no test coverage detected