MCPcopy Create free account
hub / github.com/Noumena-Network/code / findPluginByIdentifier

Function findPluginByIdentifier

src/services/plugins/pluginOperations.ts:207–224  ·  view source on GitHub ↗

* Helper function to find a plugin from loaded plugins

(
  plugin: string,
  plugins: LoadedPlugin[],
)

Source from the content-addressed store, hash-verified

205 * Helper function to find a plugin from loaded plugins
206 */
207function findPluginByIdentifier(
208 plugin: string,
209 plugins: LoadedPlugin[],
210): LoadedPlugin | undefined {
211 const { name, marketplace } = parsePluginIdentifier(plugin)
212
213 return plugins.find(p => {
214 // Check exact name match
215 if (p.name === plugin || p.name === name) return true
216
217 // If marketplace specified, check if it matches the source
218 if (marketplace && p.source) {
219 return p.name === name && p.source.includes(`@${marketplace}`)
220 }
221
222 return false
223 })
224}
225
226/**
227 * Resolve a plugin ID from V2 installed plugins data for a plugin that may

Callers 1

uninstallPluginOpFunction · 0.85

Calls 1

parsePluginIdentifierFunction · 0.85

Tested by

no test coverage detected