(
chatId: string,
message: PersistedMessage,
seq: number,
options?: { chatModel?: string | null; streamId?: string | null }
)
| 21 | } |
| 22 | |
| 23 | function toRow( |
| 24 | chatId: string, |
| 25 | message: PersistedMessage, |
| 26 | seq: number, |
| 27 | options?: { chatModel?: string | null; streamId?: string | null } |
| 28 | ): typeof copilotMessages.$inferInsert { |
| 29 | const ts = new Date(message.timestamp) |
| 30 | return { |
| 31 | chatId, |
| 32 | messageId: message.id, |
| 33 | role: message.role, |
| 34 | content: stripToolResultOutput(message), |
| 35 | seq, |
| 36 | model: options?.chatModel ?? null, |
| 37 | streamId: options?.streamId ?? null, |
| 38 | createdAt: ts, |
| 39 | updatedAt: ts, |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Append messages to the `copilot_messages` table — the sole store for chat |
no test coverage detected