/** * Builds a complete trace from a WorkflowRun and its Events. * * This module groups raw events by correlation ID and entity type, * converts each group into an OpenTelemetry-style Span, and returns * a fully-formed Trace ready for the trace viewer. */ import type { Event, WorkflowRun } from '@workflow/world'; import type { Span } from '../components/trace-viewer/types'; export declare const isStepEvent: (eventType: string) => boolean; export declare const isTimerEvent: (eventType: string) => eventType is "wait_created" | "wait_completed"; export declare const isHookLifecycleEvent: (eventType: string) => eventType is "hook_created" | "hook_received" | "hook_disposed"; export type GroupedEvents = { eventsByStepId: Map; runLevelEvents: Event[]; timerEvents: Map; hookEvents: Map; }; export declare function groupEventsByCorrelation(events: Event[]): GroupedEvents; export interface TraceWithMeta { traceId: string; rootSpanId: string; spans: Span[]; resources: { name: string; attributes: Record; }[]; /** Duration in ms from trace start to the latest known event. */ knownDurationMs: number; } export declare function buildTrace(run: WorkflowRun, events: Event[], now: Date): TraceWithMeta; //# sourceMappingURL=trace-builder.d.ts.map