( filename: string, chatId: string )
| 145 | * matches when the model passes a visually equivalent path. |
| 146 | */ |
| 147 | export async function readChatUpload( |
| 148 | filename: string, |
| 149 | chatId: string |
| 150 | ): Promise<FileReadResult | null> { |
| 151 | try { |
| 152 | const row = await findMothershipUploadRowByChatAndName(chatId, filename) |
| 153 | if (!row) return null |
| 154 | return readFileRecord(toWorkspaceFileRecord(row)) |
| 155 | } catch (err) { |
| 156 | logger.warn('Failed to read chat upload', { |
| 157 | filename, |
| 158 | chatId, |
| 159 | error: toError(err).message, |
| 160 | }) |
| 161 | return null |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * Grep the content of a single chat upload (`uploads/<name>`), mirroring |
no test coverage detected