( name: string, marketplace: string | undefined, managedNames: Set<string> | null = null, )
| 131 | * _PROTO_* fields separately (those require the PII-tagged marker type). |
| 132 | */ |
| 133 | export 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 |
no test coverage detected