(row: typeof workspaceFiles.$inferSelect)
| 18 | const logger = createLogger('MaterializeFile') |
| 19 | |
| 20 | function toFileRecord(row: typeof workspaceFiles.$inferSelect) { |
| 21 | const pathPrefix = getServePathPrefix() |
| 22 | return { |
| 23 | id: row.id, |
| 24 | workspaceId: row.workspaceId || '', |
| 25 | name: row.displayName ?? row.originalName, |
| 26 | key: row.key, |
| 27 | path: `${pathPrefix}${encodeURIComponent(row.key)}?context=mothership`, |
| 28 | size: row.size, |
| 29 | type: row.contentType, |
| 30 | uploadedBy: row.userId, |
| 31 | deletedAt: row.deletedAt, |
| 32 | uploadedAt: row.uploadedAt, |
| 33 | updatedAt: row.updatedAt, |
| 34 | storageContext: 'mothership' as const, |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | async function executeSave(fileName: string, chatId: string): Promise<ToolCallResult> { |
| 39 | const row = await findMothershipUploadRowByChatAndName(chatId, fileName) |
no test coverage detected