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

Function findMissingPlugins

src/utils/plugins/pluginStartupCheck.ts:216–250  ·  view source on GitHub ↗
(
  enabledPlugins: string[],
)

Source from the content-addressed store, hash-verified

214 * @returns Array of missing plugin IDs
215 */
216export async function findMissingPlugins(
217 enabledPlugins: string[],
218): Promise<string[]> {
219 try {
220 const installedPlugins = await getInstalledPlugins()
221
222 // Filter to not-installed synchronously, then look up all in parallel.
223 // Results are collected in original enabledPlugins order.
224 const notInstalled = enabledPlugins.filter(
225 id => !installedPlugins.includes(id),
226 )
227 const lookups = await Promise.all(
228 notInstalled.map(async pluginId => {
229 try {
230 const plugin = await getPluginById(pluginId)
231 return { pluginId, found: plugin !== null && plugin !== undefined }
232 } catch (error) {
233 logForDebugging(
234 `Failed to check plugin ${pluginId} in marketplace: ${error}`,
235 )
236 // Plugin doesn't exist in any marketplace, will be handled as an error
237 return { pluginId, found: false }
238 }
239 }),
240 )
241 const missing = lookups
242 .filter(({ found }) => found)
243 .map(({ pluginId }) => pluginId)
244
245 return missing
246 } catch (error) {
247 logError(error)
248 return []
249 }
250}
251
252/**
253 * Result of plugin installation attempt

Callers

nothing calls this directly

Calls 4

getInstalledPluginsFunction · 0.85
getPluginByIdFunction · 0.85
logForDebuggingFunction · 0.85
logErrorFunction · 0.50

Tested by

no test coverage detected