MCPcopy Create free account
hub / github.com/Noumena-Network/code / readZipCacheKnownMarketplaces

Function readZipCacheKnownMarketplaces

src/utils/plugins/zipCacheAdapters.ts:38–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36 * validation (data comes from a shared mounted volume — other containers may write).
37 */
38export async function readZipCacheKnownMarketplaces(): Promise<KnownMarketplacesFile> {
39 try {
40 const content = await readFile(getZipCacheKnownMarketplacesPath(), 'utf-8')
41 const parsed = KnownMarketplacesFileSchema().safeParse(jsonParse(content))
42 if (!parsed.success) {
43 logForDebugging(
44 `Invalid known_marketplaces.json in zip cache: ${parsed.error.message}`,
45 { level: 'error' },
46 )
47 return {}
48 }
49 return parsed.data
50 } catch {
51 return {}
52 }
53}
54
55/**
56 * Write known_marketplaces.json to the zip cache atomically.

Callers 1

Calls 4

readFileFunction · 0.85
jsonParseFunction · 0.85
logForDebuggingFunction · 0.50

Tested by

no test coverage detected