(raw: ChatSession)
| 9 | } |
| 10 | |
| 11 | function normalizeSession(raw: ChatSession): ChatSession { |
| 12 | return repairSession({ |
| 13 | ...raw, |
| 14 | messages: raw.messages.map((m) => ({ |
| 15 | ...m, |
| 16 | content: typeof m.content === "string" ? m.content : "", |
| 17 | reasoning: typeof m.reasoning === "string" ? m.reasoning : undefined, |
| 18 | })), |
| 19 | }); |
| 20 | } |
| 21 | |
| 22 | export async function listSessions(): Promise<SessionSummary[]> { |
| 23 | try { |
no test coverage detected