(
pluginName: string,
context: TipContext | undefined,
signals: { filePath?: RegExp; cli?: string[] },
)
| 67 | } |
| 68 | |
| 69 | async 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 | |
| 95 | const externalTips: Tip[] = [ |
| 96 | { |
no test coverage detected