MCPcopy
hub / github.com/codeaashu/claude-code / isMarketplacePluginRelevant

Function isMarketplacePluginRelevant

src/services/tips/tipRegistry.ts:69–93  ·  view source on GitHub ↗
(
  pluginName: string,
  context: TipContext | undefined,
  signals: { filePath?: RegExp; cli?: string[] },
)

Source from the content-addressed store, hash-verified

67}
68
69async function isMarketplacePluginRelevant(
70 pluginName: string,
71 context: TipContext | undefined,
72 signals: { filePath?: RegExp; cli?: string[] },
73): Promise<boolean> {
74 if (!(await isOfficialMarketplaceInstalled())) {
75 return false
76 }
77 if (isPluginInstalled(`${pluginName}@${OFFICIAL_MARKETPLACE_NAME}`)) {
78 return false
79 }
80 const { bashTools } = context ?? {}
81 if (signals.cli && bashTools?.size) {
82 if (signals.cli.some(cmd => bashTools.has(cmd))) {
83 return true
84 }
85 }
86 if (signals.filePath && context?.readFileState) {
87 const readFiles = cacheKeys(context.readFileState)
88 if (readFiles.some(fp => signals.filePath!.test(fp))) {
89 return true
90 }
91 }
92 return false
93}
94
95const externalTips: Tip[] = [
96 {

Callers 1

tipRegistry.tsFile · 0.85

Calls 4

isPluginInstalledFunction · 0.85
cacheKeysFunction · 0.85
hasMethod · 0.45

Tested by

no test coverage detected