import type { NormalizedEvent } from '../../agent-adapter/normalize/event-types.js'; export interface SourceJournalHeader extends Record { schema_version: string; root_run_id: string; thread_id: string | null; agent_slot: string; resolved_cwd: string; model_execution_identity_hash: string; role_tool_surface_hash: string; bundle_manifest_hash: string; } export interface SourceJournalEvent extends Record { root_run_id: string; thread_id: string | null; agent_slot: string; seq: number; ts: string; requested_model: string; reported_model: string | null; event: NormalizedEvent; } export interface SourceFragment { header: SourceJournalHeader; events: SourceJournalEvent[]; terminal: Record; } export interface ThreadLink { callId: string; threadId: string; } export interface AtifFinalMetrics { total_prompt_tokens: number; total_completion_tokens: number; total_cached_tokens: number; total_cost_usd: number; total_steps: number; extra: { prompt_tokens_definition: string; cached_tokens_definition: string; }; } export interface AtifTrajectory { schema_version: 'ATIF-v1.7'; session_id?: string; trajectory_id: string; agent: Record; steps: Array>; notes?: string; final_metrics?: AtifFinalMetrics; extra: Record; subagent_trajectories?: AtifTrajectory[]; } /** Children are supplied in parent thread_run call order; timestamps never order trajectories. */ export declare function buildAtifTree(parent: SourceFragment, children: SourceFragment[], threadLinks: ThreadLink[], linkSource: 'tool_result' | 'explicit', finalMetrics: AtifFinalMetrics): AtifTrajectory;