()
| 20 | } |
| 21 | |
| 22 | export async function listSessions(): Promise<SessionSummary[]> { |
| 23 | try { |
| 24 | const res = await fetch("/api/sessions"); |
| 25 | if (!res.ok) { |
| 26 | return []; |
| 27 | } |
| 28 | return (await res.json()) as SessionSummary[]; |
| 29 | } catch { |
| 30 | return []; |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | export async function loadSessionById(id: string): Promise<ChatSession | null> { |
| 35 | try { |