(timestamp: number | null)
| 121 | } |
| 122 | |
| 123 | function formatCacheAge(timestamp: number | null): string { |
| 124 | if (!timestamp) return ''; |
| 125 | const ageMs = Date.now() - timestamp; |
| 126 | const days = Math.floor(ageMs / (1000 * 60 * 60 * 24)); |
| 127 | const hours = Math.floor(ageMs / (1000 * 60 * 60)); |
| 128 | |
| 129 | if (days > 0) { |
| 130 | return `${days} day${days === 1 ? '' : 's'} ago`; |
| 131 | } else if (hours > 0) { |
| 132 | return `${hours} hour${hours === 1 ? '' : 's'} ago`; |
| 133 | } |
| 134 | return 'just now'; |
| 135 | } |
| 136 | |
| 137 | async function selectModel( |
| 138 | provider: string, |
no outgoing calls
no test coverage detected
searching dependent graphs…