import type { Envelope, EnvelopeItem } from "@sentry/core"; import { type SentryTransactionEvent } from "../../parser/index.js"; import type { EventContainer } from "../../utils/index.js"; export interface TraceContext { trace_id: string; span_id: string; parent_span_id?: string; } export interface SpanData { span_id: string; parent_span_id?: string; trace_id: string; op?: string; description?: string; start_timestamp?: number; timestamp?: number; duration?: number; status?: string; data?: Record; } export interface TraceEvent { event_id: string; type: string; timestamp?: number; start_timestamp?: number; transaction?: string; trace_context?: TraceContext; spans?: SpanData[]; level?: string; platform?: string; message?: string; exception?: { values?: Array<{ type?: string; value?: string; }>; }; } export interface TraceSummary { trace_id: string; root_transaction?: string; start_timestamp?: number; duration?: number; span_count: number; error_count: number; events: TraceEvent[]; } /** * Extract trace events from envelopes and group by trace ID */ export declare function extractTracesFromEnvelopes(containers: EventContainer[]): Map; /** * Build a hierarchical span tree from trace events */ export interface SpanNode { span_id: string; parent_span_id?: string; op?: string; description?: string; duration?: number; status?: string; is_transaction?: boolean; children: SpanNode[]; level: number; event_id?: string; } export declare function buildSpanTree(trace: TraceSummary): SpanNode[]; /** * Format a transaction payload for CLI output */ export declare function formatTransactionEvent(event: SentryTransactionEvent): string[]; /** * Format a trace/transaction event to markdown string */ export declare function formatTrace(payload: EnvelopeItem[1], _envelopeHeader: Envelope[0]): string[]; /** * Process a single trace event for CLI output */ export declare function processTraceEvent(event: TraceEvent): string[]; /** * Format trace summary for display */ export declare function formatTraceSummary(trace: TraceSummary): string; /** * Render span tree as hierarchical text */ export declare function renderSpanTree(spans: SpanNode[]): string[];