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

Function buildPluginTelemetryFields

src/utils/telemetry/pluginTelemetry.ts:133–164  ·  view source on GitHub ↗
(
  name: string,
  marketplace: string | undefined,
  managedNames: Set<string> | null = null,
)

Source from the content-addressed store, hash-verified

131 * _PROTO_* fields separately (those require the PII-tagged marker type).
132 */
133export function buildPluginTelemetryFields(
134 name: string,
135 marketplace: string | undefined,
136 managedNames: Set<string> | null = null,
137): {
138 plugin_id_hash: AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS
139 plugin_scope: AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS
140 plugin_name_redacted: AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS
141 marketplace_name_redacted: AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS
142 is_official_plugin: boolean
143} {
144 const scope = getTelemetryPluginScope(name, marketplace, managedNames)
145 // Both official marketplaces and builtin plugins are Anthropic-controlled
146 // — safe to expose real names in the redacted columns.
147 const isAnthropicControlled =
148 scope === 'official' || scope === 'default-bundle'
149 return {
150 plugin_id_hash: hashPluginId(
151 name,
152 marketplace,
153 ) as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
154 plugin_scope:
155 scope as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
156 plugin_name_redacted: (isAnthropicControlled
157 ? name
158 : 'third-party') as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
159 marketplace_name_redacted: (isAnthropicControlled && marketplace
160 ? marketplace
161 : 'third-party') as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
162 is_official_plugin: isAnthropicControlled,
163 }
164}
165
166/**
167 * Per-invocation callers (SkillTool, processSlashCommand) pass

Callers 10

logPluginLoadErrorsFunction · 0.85
handlePluginCommandErrorFunction · 0.85
installPluginFunction · 0.85
uninstallPluginFunction · 0.85
enablePluginFunction · 0.85
disablePluginFunction · 0.85
updatePluginCliFunction · 0.85

Calls 2

getTelemetryPluginScopeFunction · 0.85
hashPluginIdFunction · 0.85

Tested by

no test coverage detected