MCPcopy
hub / github.com/OpenCoworkAI/open-codesign / findRecent

Function findRecent

apps/desktop/src/main/reported-fingerprints.ts:138–150  ·  view source on GitHub ↗
(
  filePath: string,
  fingerprint: string,
  windowMs: number = DEFAULT_WINDOW_MS,
  now: () => number = Date.now,
)

Source from the content-addressed store, hash-verified

136}
137
138export function findRecent(
139 filePath: string,
140 fingerprint: string,
141 windowMs: number = DEFAULT_WINDOW_MS,
142 now: () => number = Date.now,
143): ReportedFingerprint | undefined {
144 const file = readReported(filePath);
145 const cutoff = now() - windowMs;
146 const match = file.entries
147 .filter((e) => e.fingerprint === fingerprint && e.ts >= cutoff)
148 .sort((a, b) => b.ts - a.ts)[0];
149 return match;
150}

Callers 2

registerDiagnosticsIpcFunction · 0.90

Calls 1

readReportedFunction · 0.85

Tested by

no test coverage detected