MCPcopy Index your code
hub / github.com/codeaashu/claude-code / resolvePluginHint

Function resolvePluginHint

src/utils/plugins/hintRecommendation.ts:103–135  ·  view source on GitHub ↗
(
  hint: ClaudeCodeHint,
)

Source from the content-addressed store, hash-verified

101 * the plugin isn't in the marketplace cache — the hint is discarded.
102 */
103export async function resolvePluginHint(
104 hint: ClaudeCodeHint,
105): Promise<PluginHintRecommendation | null> {
106 const pluginId = hint.value
107 const { name, marketplace } = parsePluginIdentifier(pluginId)
108
109 const pluginData = await getPluginById(pluginId)
110
111 logEvent('tengu_plugin_hint_detected', {
112 _PROTO_plugin_name: (name ??
113 '') as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
114 _PROTO_marketplace_name: (marketplace ??
115 '') as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
116 result: (pluginData
117 ? 'passed'
118 : 'not_in_cache') as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
119 })
120
121 if (!pluginData) {
122 logForDebugging(
123 `[hintRecommendation] ${pluginId} not found in marketplace cache`,
124 )
125 return null
126 }
127
128 return {
129 pluginId,
130 pluginName: pluginData.entry.name,
131 marketplaceName: marketplace ?? '',
132 pluginDescription: pluginData.entry.description,
133 sourceCommand: hint.sourceCommand,
134 }
135}
136
137/**
138 * Record that a prompt for this plugin was surfaced. Called regardless of

Callers 1

Calls 4

parsePluginIdentifierFunction · 0.85
getPluginByIdFunction · 0.85
logEventFunction · 0.85
logForDebuggingFunction · 0.85

Tested by

no test coverage detected