(message: Message)
| 150 | ]) |
| 151 | |
| 152 | function extractUserMessageText(message: Message): string { |
| 153 | const content = message.message?.content |
| 154 | if (typeof content === 'string') return content |
| 155 | if (!Array.isArray(content)) return '' |
| 156 | return content |
| 157 | .filter( |
| 158 | ( |
| 159 | block, |
| 160 | ): block is { |
| 161 | type: 'text' |
| 162 | text: string |
| 163 | } => |
| 164 | !!block && |
| 165 | typeof block === 'object' && |
| 166 | block.type === 'text' && |
| 167 | typeof block.text === 'string', |
| 168 | ) |
| 169 | .map(block => block.text) |
| 170 | .join('') |
| 171 | } |
| 172 | |
| 173 | function getEnvelopeTagNames(text: string): string[] | null { |
| 174 | const trimmed = text.trim() |
no outgoing calls
no test coverage detected