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

Function getPluginHookCounts

src/utils/hooks.ts:1461–1478  ·  view source on GitHub ↗

* Build a map of {sanitizedPluginName: hookCount} from matched hooks. * Only logs actual names for official marketplace plugins; others become 'third-party'.

(
  hooks: MatchedHook[],
)

Source from the content-addressed store, hash-verified

1459 * Only logs actual names for official marketplace plugins; others become 'third-party'.
1460 */
1461function getPluginHookCounts(
1462 hooks: MatchedHook[],
1463): Record<string, number> | undefined {
1464 const pluginHooks = hooks.filter(h => h.pluginId)
1465 if (pluginHooks.length === 0) {
1466 return undefined
1467 }
1468 const counts: Record<string, number> = {}
1469 for (const h of pluginHooks) {
1470 const atIndex = h.pluginId!.lastIndexOf('@')
1471 const isOfficial =
1472 atIndex > 0 &&
1473 ALLOWED_OFFICIAL_MARKETPLACE_NAMES.has(h.pluginId!.slice(atIndex + 1))
1474 const key = isOfficial ? h.pluginId! : 'third-party'
1475 counts[key] = (counts[key] || 0) + 1
1476 }
1477 return counts
1478}
1479
1480
1481/**

Callers 2

executeHooksFunction · 0.85
executeHooksOutsideREPLFunction · 0.85

Calls 1

hasMethod · 0.45

Tested by

no test coverage detected