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

Function getItem

packages/cli/src/registry/resolver.ts:139–156  ·  view source on GitHub ↗
(itemName: string)

Source from the content-addressed store, hash-verified

137 // the `Promise<RegistryItem>` return type. The body has no `await`, so the
138 // cache is still populated synchronously on first request (dedup intact).
139 const getItem = async (itemName: string): Promise<RegistryItem> => {
140 const existing = itemCache.get(itemName);
141 if (existing) return existing;
142
143 const registryEntry = entryByName.get(itemName);
144 if (!registryEntry) {
145 const available = entries.map((e) => e.name).join(", ");
146 throw new Error(
147 available.length > 0
148 ? `Dependency "${itemName}" not found in registry. Available: ${available}`
149 : `Dependency "${itemName}" not found — registry unreachable or empty.`,
150 );
151 }
152
153 const pending = fetchItemManifest(registryEntry.name, registryEntry.type, options.baseUrl);
154 itemCache.set(itemName, pending);
155 return pending;
156 };
157
158 const visit = async (itemName: string, path: string[]): Promise<void> => {
159 if (visited.has(itemName)) return;

Callers 1

visitFunction · 0.85

Calls 3

fetchItemManifestFunction · 0.85
getMethod · 0.80
setMethod · 0.65

Tested by

no test coverage detected