(content)
| 52 | } |
| 53 | |
| 54 | function flattenUserContent(content) { |
| 55 | if (typeof content === 'string') return content; |
| 56 | if (!Array.isArray(content)) return ''; |
| 57 | return content.map(block => { |
| 58 | if (!block || typeof block !== 'object') return ''; |
| 59 | if (typeof block.text === 'string') return block.text; |
| 60 | if (typeof block.content === 'string') return block.content; |
| 61 | return ''; |
| 62 | }).filter(Boolean).join('\n'); |
| 63 | } |
| 64 | |
| 65 | function extractSlashCommand(content) { |
| 66 | const text = flattenUserContent(content).trim(); |
no outgoing calls
no test coverage detected