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

Function loadAllItems

packages/cli/src/registry/resolver.ts:47–66  ·  view source on GitHub ↗
(
  entries: RegistryManifestEntry[],
  options: ResolveOptions = {},
)

Source from the content-addressed store, hash-verified

45 * break the picker.
46 */
47export async function loadAllItems(
48 entries: RegistryManifestEntry[],
49 options: ResolveOptions = {},
50): Promise<RegistryItem[]> {
51 const baseUrl = options.baseUrl ?? DEFAULT_REGISTRY_URL;
52 const warn = options.onWarn ?? defaultWarn;
53 const results = await Promise.allSettled(
54 entries.map((e) => fetchItemManifest(e.name, e.type, baseUrl)),
55 );
56 const items: RegistryItem[] = [];
57 results.forEach((r, i) => {
58 if (r.status === "fulfilled") {
59 items.push(r.value);
60 } else {
61 const name = entries[i]?.name ?? "<unknown>";
62 warn(`skipped item "${name}": ${String(r.reason)}`);
63 }
64 });
65 return items;
66}
67
68/**
69 * Resolve a single item by name. Throws if unknown or unreachable.

Callers 6

resolveItemsByTagFunction · 0.85
resolver.test.tsFile · 0.85
runFunction · 0.85
listRemoteTemplatesFunction · 0.85
resolveTemplateListFunction · 0.85
listRegistryCatalogFunction · 0.85

Calls 2

fetchItemManifestFunction · 0.85
warnFunction · 0.50

Tested by

no test coverage detected