()
| 46 | } |
| 47 | |
| 48 | export function createSession(): ChatSession { |
| 49 | const now = new Date().toISOString(); |
| 50 | return { |
| 51 | id: `sess_${Date.now().toString(36)}`, |
| 52 | createdAt: now, |
| 53 | updatedAt: now, |
| 54 | messages: [], |
| 55 | }; |
| 56 | } |
| 57 | |
| 58 | export function loadLocalSession(): ChatSession | null { |
| 59 | try { |