(email: string)
| 53 | } |
| 54 | |
| 55 | function nameFromEmail(email: string): string { |
| 56 | const local = email.split("@")[0] || email; |
| 57 | const parts = local.split(/[._-]+/).filter(Boolean); |
| 58 | if (parts.length === 0) return email; |
| 59 | return parts |
| 60 | .map((p) => p.charAt(0).toUpperCase() + p.slice(1)) |
| 61 | .join(" "); |
| 62 | } |
| 63 | |
| 64 | function deriveState(messages: MessageSummary[], nowMs: number): ThreadState { |
| 65 | // pending wins over everything else — operator action needed. |