import { AgentName } from '../typings/es_schemas/ui/fields/agent' ; export const OPEN_TELEMETRY_AGENT_NAMES = [ 'otlp' , 'opentelemetry/cpp' , 'opentelemetry/dotnet' , 'opentelemetry/erlang' , 'opentelemetry/go' , 'opentelemetry/java' , 'opentelemetry/nodejs' , 'opentelemetry/php' , 'opentelemetry/python' , 'opentelemetry/ruby' , 'opentelemetry/swift' , 'opentelemetry/webjs' , ] ; export const AGENT_NAMES = [ 'dotnet' , 'go' , 'iOS/swift' , 'java' , 'js-base' , 'nodejs' , 'php' , 'python' , 'ruby' , 'rum-js' , ... OPEN_TELEMETRY_AGENT_NAMES , ] ; export const JAVA_AGENT_NAMES = [ 'java' , 'opentelemetry/java' ] ; export function isJavaAgentName ( agentName ? ) { return JAVA_AGENT_NAMES . includes ( agentName ! as AgentName ) ; } export const RUM_AGENT_NAMES = [ 'js-base' , 'rum-js' , 'opentelemetry/webjs' , ] ; export function isRumAgentName ( agentName ? ) { return RUM_AGENT_NAMES . includes ( agentName ! as AgentName ) ; } export function normalizeAgentName < T extends string | undefined > ( agentName ) { if ( isRumAgentName ( agentName ) ) { return 'rum-js' ; } if ( isJavaAgentName ( agentName ) ) { return 'java' ; } if ( isIosAgentName ( agentName ) ) { return 'ios' ; } return agentName ; } export function isIosAgentName ( agentName ? ) { const lowercased = agentName && agentName . toLowerCase ( ) ; return lowercased === 'ios/swift' || lowercased === 'opentelemetry/swift' ; } export function isJRubyAgent ( agentName ? , runtimeName ? ) { return agentName === 'ruby' && runtimeName ?. toLowerCase ( ) === 'jruby' ; }