| 4658 | } |
| 4659 | |
| 4660 | export function shouldShowUserMessage( |
| 4661 | message: NormalizedMessage, |
| 4662 | isTranscriptMode: boolean, |
| 4663 | ): boolean { |
| 4664 | if (message.type !== 'user') return true |
| 4665 | if (message.isMeta) { |
| 4666 | // Channel messages stay isMeta (for snip-tag/turn-boundary/brief-mode |
| 4667 | // semantics) but render in the default transcript — the keyboard user |
| 4668 | // should see what arrived. The <channel> tag in UserTextMessage handles |
| 4669 | // the actual rendering. |
| 4670 | if ( |
| 4671 | (feature('KAIROS') || feature('KAIROS_CHANNELS')) && |
| 4672 | message.origin?.kind === 'channel' |
| 4673 | ) |
| 4674 | return true |
| 4675 | return false |
| 4676 | } |
| 4677 | if (message.isVisibleInTranscriptOnly && !isTranscriptMode) return false |
| 4678 | return true |
| 4679 | } |
| 4680 | |
| 4681 | export function isThinkingMessage(message: Message): boolean { |
| 4682 | if (message.type !== 'assistant') return false |