MCPcopy Create free account
hub / github.com/tiann/hapi / applyInMemoryCache

Function applyInMemoryCache

cli/src/modules/common/cursorModels.ts:229–237  ·  view source on GitHub ↗
(response: ListCursorModelsResponse)

Source from the content-addressed store, hash-verified

227}
228
229async function applyInMemoryCache(response: ListCursorModelsResponse): Promise<ListCursorModelsResponse> {
230 const enriched = await enrichCursorModelsWithCliSkus(response);
231 if ((enriched.availableModels?.length ?? 0) > 0) {
232 cache.expiresAt = Date.now() + CACHE_TTL_MS;
233 cache.response = enriched;
234 writeSharedCursorModelsCache(enriched);
235 }
236 return enriched;
237}
238
239/** ACP session snapshot (Zed-style); falls back to seeded / on-disk cache from the last live session. */
240async function listCursorModelsWhileAcpActive(): Promise<ListCursorModelsResponse> {

Callers 3

listCursorModelsFunction · 0.85
seedCursorModelsCacheFunction · 0.85

Calls 2

Tested by

no test coverage detected