import type { SessionMeta } from './types.js';
import type { SessionTrajectory, TrajectoryStep } from './trajectory.js';
/** Where two sessions' tool sequences first stop lining up. */
export interface TrajectoryDivergence {
    /** Ordinal of the last step both sessions still agree on (0 if none). */
    afterOrdinalA: number;
    afterOrdinalB: number;
    /** ms into each session's own timeline where the divergence begins. */
    startMsA: number;
    startMsB: number;
    /** One-line description of what differs — the next tool step on each side. */
    detail: string;
}
/** Aggregate numbers for one side of a compare — the summary table row. */
export interface TrajectorySummary {
    session: SessionMeta;
    toolCount: number;
    errorCount: number;
    spanMs: number;
    outputTokens: number;
}
/** The result of diffing two trajectories. */
export interface TrajectoryComparison {
    a: SessionTrajectory;
    b: SessionTrajectory;
    /** Undefined only when the tool sequences are identical (or one/both are empty and equal). */
    divergence?: TrajectoryDivergence;
    /** Tool steps present in `b` with no counterpart in `a`, in `b`'s order. */
    added: TrajectoryStep[];
    /** Tool steps present in `a` with no counterpart in `b`, in `a`'s order. */
    removed: TrajectoryStep[];
    summaryA: TrajectorySummary;
    summaryB: TrajectorySummary;
    /** Tool steps dropped from the diff computation by the `maxDiffSteps` cap, per side. */
    truncatedA: number;
    truncatedB: number;
}
export interface DiffTrajectoriesOptions {
    /** Cap on tool steps considered per side (the LCS table is O(n*m)). Default 1000. */
    maxDiffSteps?: number;
}
/**
 * Diff two trajectories: align their tool-step sequences, find the first
 * divergence, and collect the steps each session ran that the other never
 * did. Never mutates either input.
 */
export declare function diffTrajectories(a: SessionTrajectory, b: SessionTrajectory, options?: DiffTrajectoriesOptions): TrajectoryComparison;
