MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / getCache

Function getCache

packages/node-runtime/src/cache/session-cache.ts:49–54  ·  view source on GitHub ↗
(sessionId: string, key: string, cacheDir: string)

Source from the content-addressed store, hash-verified

47}
48
49export function getCache<T>(sessionId: string, key: string, cacheDir: string): T | null {
50 const cachePath = getCachePath(sessionId, cacheDir)
51 const file = readCacheFile(cachePath)
52 if (!file || !file[key]) return null
53 return file[key].data as T
54}
55
56export function setCache<T>(sessionId: string, key: string, data: T, cacheDir: string): void {
57 const cachePath = getCachePath(sessionId, cacheDir)

Calls 2

getCachePathFunction · 0.85
readCacheFileFunction · 0.85

Tested by

no test coverage detected