"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.detectLlamaIndexInstrumentation = detectLlamaIndexInstrumentation;
const types_1 = require("./types");
/**
 * Detects which LlamaIndex instrumentation style produced the trace.
 * - otel_tracer: span names include UUID suffix (e.g. AgentWorkflow.run-19a481aa-cb99-429a-b1e9-32e74eef067e); scope "llamaindex.opentelemetry.tracer".
 * - openinference: exact span names (AgentWorkflow.run) and/or openinference attributes.
 */
function detectLlamaIndexInstrumentation(spans) {
    for (const s of spans) {
        const name = s.name ?? '';
        if (types_1.LLAMAINDEX_OTEL_NAME_SUFFIX_RE.test(name)) {
            return 'otel_tracer';
        }
    }
    return 'openinference';
}
//# sourceMappingURL=detector.js.map