MCPcopy Index your code
hub / github.com/codeaashu/claude-code / readSeedKnownMarketplaces

Function readSeedKnownMarketplaces

src/utils/plugins/marketplaceManager.ts:436–462  ·  view source on GitHub ↗
(
  seedDir: string,
)

Source from the content-addressed store, hash-verified

434}
435
436async function readSeedKnownMarketplaces(
437 seedDir: string,
438): Promise<KnownMarketplacesConfig | null> {
439 const seedJsonPath = join(seedDir, 'known_marketplaces.json')
440 try {
441 const content = await getFsImplementation().readFile(seedJsonPath, {
442 encoding: 'utf-8',
443 })
444 const parsed = KnownMarketplacesFileSchema().safeParse(jsonParse(content))
445 if (!parsed.success) {
446 logForDebugging(
447 `Seed known_marketplaces.json invalid at ${seedDir}: ${parsed.error.message}`,
448 { level: 'warn' },
449 )
450 return null
451 }
452 return parsed.data
453 } catch (e) {
454 if (!isENOENT(e)) {
455 logForDebugging(
456 `Failed to read seed known_marketplaces.json at ${seedDir}: ${e}`,
457 { level: 'warn' },
458 )
459 }
460 return null
461 }
462}
463
464/**
465 * Locate a marketplace in the seed directory by name.

Callers 1

registerSeedMarketplacesFunction · 0.85

Calls 5

getFsImplementationFunction · 0.85
jsonParseFunction · 0.85
logForDebuggingFunction · 0.85
isENOENTFunction · 0.85
readFileMethod · 0.80

Tested by

no test coverage detected