/** * Trace Format Converters — Convert between different trace formats * * Supports: AgentProbe, LangSmith, OpenTelemetry, Arize, custom * * @example * ```bash * agentprobe convert trace.json --from agentprobe --to langsmith * agentprobe convert trace.json --from agentprobe --to opentelemetry * ``` */ import type { AgentTrace } from './types'; export type TraceFormat = 'agentprobe' | 'langsmith' | 'opentelemetry' | 'arize' | 'custom'; export interface LangSmithRun { id: string; name: string; run_type: 'chain' | 'llm' | 'tool'; start_time: string; end_time?: string; inputs: Record; outputs?: Record; parent_run_id?: string; extra?: Record; tags?: string[]; error?: string; } export interface LangSmithTrace { runs: LangSmithRun[]; } export interface OTelSpanSimple { traceId: string; spanId: string; parentSpanId?: string; name: string; kind: number; startTimeUnixNano: string; endTimeUnixNano: string; attributes: Array<{ key: string; value: { stringValue?: string; intValue?: string; }; }>; status: { code: number; }; } export interface OTelTrace { resourceSpans: Array<{ resource: { attributes: Array<{ key: string; value: { stringValue: string; }; }>; }; scopeSpans: Array<{ scope: { name: string; }; spans: OTelSpanSimple[]; }>; }>; } export interface ArizeSpan { name: string; span_kind: 'LLM' | 'TOOL' | 'CHAIN' | 'AGENT'; start_time: string; end_time?: string; attributes: Record; events: Array<{ name: string; timestamp: string; attributes: Record; }>; context: { trace_id: string; span_id: string; }; parent_id?: string; status_code: 'OK' | 'ERROR' | 'UNSET'; } export interface ArizeTrace { spans: ArizeSpan[]; } /** * Convert AgentProbe trace → LangSmith format. */ export declare function toLangSmith(trace: AgentTrace): LangSmithTrace; /** * Convert AgentProbe trace → OpenTelemetry format. */ export declare function toOpenTelemetry(trace: AgentTrace): OTelTrace; /** * Convert AgentProbe trace → Arize format. */ export declare function toArize(trace: AgentTrace): ArizeTrace; /** * Convert LangSmith format → AgentProbe trace. */ export declare function fromLangSmith(ls: LangSmithTrace): AgentTrace; /** * Convert OpenTelemetry format → AgentProbe trace. */ export declare function fromOpenTelemetry(otel: OTelTrace): AgentTrace; /** * Convert between any two supported formats. */ export declare function convertTrace(input: any, from: TraceFormat, to: TraceFormat): any; /** * Convert Arize format → AgentProbe trace. */ export declare function fromArize(arize: ArizeTrace): AgentTrace; /** * List supported formats. */ export declare function listFormats(): TraceFormat[]; /** * Detect the format of a trace object. */ export declare function detectFormat(obj: any): TraceFormat | null; //# sourceMappingURL=converters.d.ts.map