()
| 160 | * `resolve()` — the picker only reads display+timestamp for the list. |
| 161 | */ |
| 162 | export async function* getTimestampedHistory(): AsyncGenerator<TimestampedHistoryEntry> { |
| 163 | const currentProject = getProjectRoot() |
| 164 | const seen = new Set<string>() |
| 165 | |
| 166 | for await (const entry of makeLogEntryReader()) { |
| 167 | if (!entry || typeof entry.project !== 'string') continue |
| 168 | if (entry.project !== currentProject) continue |
| 169 | if (seen.has(entry.display)) continue |
| 170 | seen.add(entry.display) |
| 171 | |
| 172 | yield { |
| 173 | display: entry.display, |
| 174 | timestamp: entry.timestamp, |
| 175 | resolve: () => logEntryToHistoryEntry(entry), |
| 176 | } |
| 177 | |
| 178 | if (seen.size >= MAX_HISTORY_ITEMS) return |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | /** |
| 183 | * Get history entries for the current project, with current session's entries first. |
no test coverage detected