import type { TraceStepKind, TraceStepStatus } from "../components/TraceStep/TraceStep";
export interface TraceStepRecord {
    id: string;
    kind?: TraceStepKind;
    status?: TraceStepStatus;
    title: React.ReactNode;
    tool?: string;
    duration?: string;
    tokens?: number;
    /** Body content — usually filled in on completion. */
    children?: React.ReactNode;
    /** Initial open-state for the head when first rendered. */
    defaultOpen?: boolean;
    /** Free-form bag for consumer metadata that doesn't need to drive
     *  rendering (e.g. server-side request ids, trace correlation ids). */
    meta?: Record<string, unknown>;
}
export type StartInput = Omit<TraceStepRecord, "id" | "status"> & {
    /** Optional explicit id. Auto-generated when omitted. */
    id?: string;
    /** Initial status. Defaults to "running". */
    status?: TraceStepStatus;
};
export interface UseTraceTimelineOptions {
    /** Controlled `steps` — when set, hook becomes a pass-through driver. */
    steps?: TraceStepRecord[];
    /** Uncontrolled seed. */
    defaultSteps?: TraceStepRecord[];
    onChange?: (steps: TraceStepRecord[]) => void;
}
export interface UseTraceTimelineReturn {
    /** Current ordered list of steps. */
    steps: TraceStepRecord[];
    /** Append a step. Returns its id (auto-generated when not provided). */
    start: (input: StartInput) => string;
    /** Patch a step by id with the supplied fields. */
    update: (id: string, patch: Partial<Omit<TraceStepRecord, "id">>) => void;
    /** Set `status: "success"` and merge any final fields (duration/tokens/children). */
    complete: (id: string, patch?: Partial<Omit<TraceStepRecord, "id" | "status">>) => void;
    /** Set `status: "failed"` and merge any final fields. */
    fail: (id: string, patch?: Partial<Omit<TraceStepRecord, "id" | "status">>) => void;
    /** Remove a step by id. */
    remove: (id: string) => void;
    /** Replace the entire list. */
    set: (next: TraceStepRecord[]) => void;
    /** Clear all steps. */
    clear: () => void;
    /** Latest step (most recently appended), if any. */
    current: TraceStepRecord | undefined;
    /** True when there's at least one step with `status === "running"`. */
    isRunning: boolean;
}
export declare function useTraceTimeline({ steps: controlled, defaultSteps, onChange, }?: UseTraceTimelineOptions): UseTraceTimelineReturn;
//# sourceMappingURL=useTraceTimeline.d.ts.map