MCPcopy
hub / github.com/cursor/community-plugins / findSimilarPlugins

Function findSimilarPlugins

apps/cursor/src/lib/plugins/scan.ts:242–262  ·  view source on GitHub ↗

* Top-N active plugins with a name trigram-similar to this one.

(
  pluginId: string,
)

Source from the content-addressed store, hash-verified

240 * Top-N active plugins with a name trigram-similar to this one.
241 */
242async function findSimilarPlugins(
243 pluginId: string,
244): Promise<SimilarPluginRow[]> {
245 const supabase = await createClient();
246 const { data, error } = await supabase.rpc("find_similar_plugins", {
247 p_plugin_id: pluginId,
248 p_threshold: SIMILAR_THRESHOLD,
249 p_limit: SIMILAR_LIMIT,
250 });
251
252 if (error) {
253 logError(
254 pluginId,
255 "find_similar_plugins failed (continuing without)",
256 error,
257 );
258 return [];
259 }
260
261 return (data ?? []) as SimilarPluginRow[];
262}
263
264/**
265 * Exported so the drain route can reuse it for the "exceeded MAX_ATTEMPTS"

Callers 1

runPluginScanFunction · 0.85

Calls 2

createClientFunction · 0.90
logErrorFunction · 0.70

Tested by

no test coverage detected