MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / fetchRegistryManifest

Function fetchRegistryManifest

packages/cli/src/registry/remote.ts:85–102  ·  view source on GitHub ↗
(
  baseUrl: string = DEFAULT_REGISTRY_URL,
  options?: { skipCache?: boolean },
)

Source from the content-addressed store, hash-verified

83 * Returns undefined if the registry is unreachable (offline / 404).
84 */
85export async function fetchRegistryManifest(
86 baseUrl: string = DEFAULT_REGISTRY_URL,
87 options?: { skipCache?: boolean },
88): Promise<RegistryManifest | undefined> {
89 const cacheFile = cachePath(baseUrl, "registry");
90 if (!options?.skipCache) {
91 const cached = readCache<RegistryManifest>(cacheFile);
92 if (cached) return cached;
93 }
94
95 try {
96 const manifest = await fetchJson<RegistryManifest>(`${baseUrl}/registry.json`);
97 writeCache(cacheFile, manifest);
98 return manifest;
99 } catch {
100 return undefined;
101 }
102}
103
104/**
105 * Fetch a single item's `registry-item.json` manifest. Cached for 24h.

Callers 1

listRegistryItemsFunction · 0.85

Calls 3

cachePathFunction · 0.85
readCacheFunction · 0.85
writeCacheFunction · 0.85

Tested by

no test coverage detected