feat: split apart main.tsx

This commit is contained in:
Brooklyn Nicholson 2026-04-02 20:39:52 -05:00
parent 2818dd8611
commit bbba9ed4f2
16 changed files with 1710 additions and 1653 deletions

View file

@ -0,0 +1,5 @@
import type { Msg, Role } from '../types.js'
export function upsert(prev: Msg[], role: Role, text: string): Msg[] {
return prev.at(-1)?.role === role ? [...prev.slice(0, -1), { role, text }] : [...prev, { role, text }]
}