( errors: PluginError[], managedNames: Set<string> | null, )
| 265 | * enum — use it directly as error_category. |
| 266 | */ |
| 267 | export function logPluginLoadErrors( |
| 268 | errors: PluginError[], |
| 269 | managedNames: Set<string> | null, |
| 270 | ): void { |
| 271 | for (const err of errors) { |
| 272 | const { name, marketplace } = parsePluginIdentifier(err.source) |
| 273 | // Not all PluginError variants carry a plugin name (some have pluginId, |
| 274 | // some are marketplace-level). Use the 'plugin' property if present, |
| 275 | // fall back to the name parsed from err.source. |
| 276 | const pluginName = 'plugin' in err && err.plugin ? err.plugin : name |
| 277 | logEvent('tengu_plugin_load_failed', { |
| 278 | error_category: |
| 279 | err.type as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 280 | _PROTO_plugin_name: |
| 281 | pluginName as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED, |
| 282 | ...(marketplace && { |
| 283 | _PROTO_marketplace_name: |
| 284 | marketplace as AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED, |
| 285 | }), |
| 286 | ...buildPluginTelemetryFields(pluginName, marketplace, managedNames), |
| 287 | }) |
| 288 | } |
| 289 | } |
| 290 |
no test coverage detected