| 33 | } |
| 34 | |
| 35 | function itemToRow(conversationId: string, item: ConversationItem) { |
| 36 | return { |
| 37 | conversationId, |
| 38 | role: roleOf(item), |
| 39 | // Prisma's `IPrismaUIMessageParts` narrows to `unknown[]`, but our |
| 40 | // JSON column stores a single `ConversationItem` object. The |
| 41 | // runtime is fine — Prisma accepts any JSON-serializable value — |
| 42 | // so we cast past the generator. |
| 43 | // biome-ignore lint/suspicious/noExplicitAny: see comment above |
| 44 | parts: item as any, |
| 45 | }; |
| 46 | } |
| 47 | |
| 48 | export const prismaConversationStore: ConversationStore = { |
| 49 | async load({ conversationId }) { |