MCPcopy Create free account
hub / github.com/backnotprop/plannotator / warmFileListCache

Function warmFileListCache

packages/shared/resolve-file.ts:264–276  ·  view source on GitHub ↗
(
	projectRoot: string,
	kind: "code",
)

Source from the content-addressed store, hash-verified

262 * Returns `null` (wrapped in Promise) when the walk fails (perms, etc).
263 */
264export function warmFileListCache(
265 projectRoot: string,
266 kind: "code",
267): Promise<string[] | null> {
268 const key = fileListCacheKey(projectRoot, kind);
269 const entry = fileListCache.get(key);
270 if (entry && Date.now() - entry.startedAt < FILE_LIST_CACHE_TTL_MS) {
271 return entry.promise;
272 }
273 const promise = startCodeWalk(projectRoot);
274 fileListCache.set(key, { promise, startedAt: Date.now() });
275 return promise;
276}
277
278/**
279 * Resolve a code-file path within a project root.

Callers 7

startPlannotatorServerFunction · 0.90
handleDocFunction · 0.90
startAnnotateServerFunction · 0.90
resolveCodeFileFunction · 0.85
startPlanReviewServerFunction · 0.85
startAnnotateServerFunction · 0.85
handleDocRequestFunction · 0.85

Calls 4

fileListCacheKeyFunction · 0.85
startCodeWalkFunction · 0.85
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected