MCPcopy
hub / github.com/codeaashu/claude-code / getTimestampedHistory

Function getTimestampedHistory

src/history.ts:162–180  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

160 * `resolve()` — the picker only reads display+timestamp for the list.
161 */
162export 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.

Callers 1

HistorySearchDialogFunction · 0.85

Calls 5

getProjectRootFunction · 0.85
makeLogEntryReaderFunction · 0.85
logEntryToHistoryEntryFunction · 0.85
hasMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected