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

Function readSharedCursorModelsCache

cli/src/modules/common/cursorModelsSharedCache.ts:22–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20
21/** Cross-process catalog for New Session while an ACP lock blocks `agent --list-models`. */
22export function readSharedCursorModelsCache(): CursorModelsResponse | null {
23 const path = getSharedCachePath();
24 if (!existsSync(path)) {
25 return null;
26 }
27
28 try {
29 const parsed = JSON.parse(readFileSync(path, 'utf8')) as CursorModelsResponse;
30 return isUsableModelsResponse(parsed) ? parsed : null;
31 } catch {
32 return null;
33 }
34}
35
36export function writeSharedCursorModelsCache(response: CursorModelsResponse): void {
37 if (!isUsableModelsResponse(response)) {

Calls 2

getSharedCachePathFunction · 0.85
isUsableModelsResponseFunction · 0.85

Tested by

no test coverage detected