( slave: PipeIpcSlaveState, entry: SessionEntry, )
| 76 | } |
| 77 | |
| 78 | export function applyPipeEntryToSlaveState( |
| 79 | slave: PipeIpcSlaveState, |
| 80 | entry: SessionEntry, |
| 81 | ): PipeIpcSlaveState { |
| 82 | return { |
| 83 | ...slave, |
| 84 | status: statusForPipeEntry(slave.status, entry.type), |
| 85 | lastActivityAt: entry.timestamp, |
| 86 | lastSummary: summarizePipeEntry(entry), |
| 87 | lastEventType: entry.type as PipeIpcSlaveState['lastEventType'], |
| 88 | unreadCount: (slave.unreadCount ?? 0) + 1, |
| 89 | history: [...slave.history, entry], |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * Module-level registry of connected slave PipeClients. |
no test coverage detected