/**
 * RAG / Vector DB trace types
 * Standard response shape for all vector DB parsers (ChromaDb, AstraDb, Milvus, Postgres, Pinecone, Qdrant).
 */
import type { Span } from '../types';
/** Request status for a single RAG/vector DB call */
export type RAGCallStatus = 'passed' | 'failed' | 'error';
/**
 * Standard RAG call result — same shape across all vector DB parsers.
 * Metrics aligned with OpenTelemetry DB semantic conventions where applicable.
 */
export interface RAGCall {
    /** Span id of the vector DB operation */
    spanId: string;
    /** Trace id */
    traceId: string;
    /** top_k parameter when present (e.g. similarity_search with limit) */
    topK?: number;
    /** Duration in milliseconds: db.client.operation.duration (seconds → ms), else span.duration (ns → ms) */
    duration: number;
    /** DB system name (db.system or db.system.name) */
    systemName: string;
    /** Operation type (db.operation.name or derived from span name) */
    operationName: string;
    /** Whether the request passed, failed, or errored */
    status: RAGCallStatus;
    /** Number of rows/documents returned (db.response.returned_rows or estimated from db.query.summary) */
    returnedRows?: number;
    /** Collection/table/index name (db.collection.name) */
    collectionName?: string;
    /** Span start timestamp (ISO or numeric) */
    timestamp?: string;
    /** Optional raw span for debugging */
    _rawSpan?: Span;
}
/**
 * Parser interface for a specific vector DB.
 * Each vector DB has its own parser that detects and parses its spans into RAGCall[].
 */
export interface VectorDbRagParser {
    /** Parser identifier (e.g. 'chromadb', 'pinecone') */
    name: string;
    /** Whether this parser can handle the given spans (e.g. by db.system, span name, service name) */
    canParse(spans: Span[]): boolean;
    /** Extract RAG/vector DB calls from spans; returns standard RAGCall[]. */
    parse(spans: Span[]): RAGCall[];
}
/**
 * Display-ready RAG card for trace parser UI.
 * All values are formatted in the backend; frontend renders as-is.
 */
export interface TraceRagDetailsCard {
    spanId: string;
    traceId: string;
    spanDuration: string;
    operationDuration: string;
    operationName: string;
    systemName: string;
    serviceName: string;
    status: string;
    timestamp?: string;
    topK?: string;
    returnedRows?: string;
    collectionName?: string;
}
//# sourceMappingURL=types.d.ts.map