( id: string, memorySummary: string, memoryMessageCount: number, )
| 92 | } |
| 93 | |
| 94 | export async function updateThreadMemory( |
| 95 | id: string, |
| 96 | memorySummary: string, |
| 97 | memoryMessageCount: number, |
| 98 | ): Promise<void> { |
| 99 | const database = await getDB(); |
| 100 | const deviceId = await getDeviceId(); |
| 101 | const syncVersion = await nextSyncVersion(database, "threads"); |
| 102 | const updatedAt = await nextUpdatedAt(database, "threads", id); |
| 103 | await database.execute( |
| 104 | "UPDATE threads SET memory_summary = ?, memory_updated_at = ?, memory_message_count = ?, updated_at = ?, sync_version = ?, last_modified_by = ? WHERE id = ?", |
| 105 | [memorySummary, Date.now(), memoryMessageCount, updatedAt, syncVersion, deviceId, id], |
| 106 | ); |
| 107 | } |
| 108 | |
| 109 | export async function updateThreadTitle(id: string, title: string): Promise<void> { |
| 110 | const database = await getDB(); |
no test coverage detected