(hint: ClaudeCodeHint)
| 63 | * later in resolvePluginHint (hook side). |
| 64 | */ |
| 65 | export function maybeRecordPluginHint(hint: ClaudeCodeHint): void { |
| 66 | if (!getFeatureValue_CACHED_MAY_BE_STALE('tengu_lapis_finch', false)) return |
| 67 | if (hasShownHintThisSession()) return |
| 68 | |
| 69 | const state = getGlobalConfig().claudeCodeHints |
| 70 | if (state?.disabled) return |
| 71 | |
| 72 | const shown = state?.plugin ?? [] |
| 73 | if (shown.length >= MAX_SHOWN_PLUGINS) return |
| 74 | |
| 75 | const pluginId = hint.value |
| 76 | const { name, marketplace } = parsePluginIdentifier(pluginId) |
| 77 | if (!name || !marketplace) return |
| 78 | if (!isOfficialMarketplaceName(marketplace)) return |
| 79 | if (shown.includes(pluginId)) return |
| 80 | if (isPluginInstalled(pluginId)) return |
| 81 | if (isPluginBlockedByPolicy(pluginId)) return |
| 82 | |
| 83 | // Bound repeat lookups on the same slug — a CLI that emits on every |
| 84 | // invocation shouldn't trigger N resolve cycles for the same plugin. |
| 85 | if (triedThisSession.has(pluginId)) return |
| 86 | triedThisSession.add(pluginId) |
| 87 | |
| 88 | setPendingHint(hint) |
| 89 | } |
| 90 | |
| 91 | const triedThisSession = new Set<string>() |
| 92 |
no test coverage detected