(m: Message)
| 101 | * implausible (an interrupt implies a prior prompt already flowed through). |
| 102 | */ |
| 103 | export function extractTitleText(m: Message): string | undefined { |
| 104 | if (m.type !== 'user' || m.isMeta || m.toolUseResult || m.isCompactSummary) |
| 105 | return undefined |
| 106 | if (m.origin && m.origin.kind !== 'human') return undefined |
| 107 | const content = m.message.content |
| 108 | let raw: string | undefined |
| 109 | if (typeof content === 'string') { |
| 110 | raw = content |
| 111 | } else { |
| 112 | for (const block of content) { |
| 113 | if (block.type === 'text') { |
| 114 | raw = block.text |
| 115 | break |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | if (!raw) return undefined |
| 120 | const clean = stripDisplayTagsAllowEmpty(raw) |
| 121 | return clean || undefined |
| 122 | } |
| 123 | |
| 124 | // ─── Ingress routing ───────────────────────────────────────────────────────── |
| 125 |
no test coverage detected