| 8 | import { renderMessagesToPlainText } from '../../utils/exportRenderer.js'; |
| 9 | import { writeFileSync_DEPRECATED } from '../../utils/slowOperations.js'; |
| 10 | function formatTimestamp(date: Date): string { |
| 11 | const year = date.getFullYear(); |
| 12 | const month = String(date.getMonth() + 1).padStart(2, '0'); |
| 13 | const day = String(date.getDate()).padStart(2, '0'); |
| 14 | const hours = String(date.getHours()).padStart(2, '0'); |
| 15 | const minutes = String(date.getMinutes()).padStart(2, '0'); |
| 16 | const seconds = String(date.getSeconds()).padStart(2, '0'); |
| 17 | return `${year}-${month}-${day}-${hours}${minutes}${seconds}`; |
| 18 | } |
| 19 | export function extractFirstPrompt(messages: Message[]): string { |
| 20 | const firstUserMessage = messages.find(msg => msg.type === 'user'); |
| 21 | if (!firstUserMessage || firstUserMessage.type !== 'user') { |