/**
 * Code-edit extraction + the "watch the agent write code" animation.
 *
 * The base storyboard (./index) compresses a run into scenes but keeps scenes
 * payload-free (title + narration + evidence span ids). To actually SHOW the
 * code an agent wrote, this module pulls the concrete edit (path, diff,
 * before/after, language) out of the raw edit-tool spans and renders a
 * self-contained HTML replay that types each file out, character by character,
 * like an editor recording.
 *
 * Additive on purpose: it reuses the canonical `Span` (trace/schema) and the
 * `Storyboard` IR (./index) without modifying the reducer/compiler — so it
 * composes with the existing pipeline and a Remotion consumer can read the same
 * `CodeEdit[]` to render an MP4.
 */
import type { Span } from '../trace/schema';
import type { Scene, Storyboard } from './index';
/** A concrete code change lifted from a tool span. */
export interface CodeEdit {
    /** Span the edit came from — back-reference into the trace. */
    spanId: string;
    path: string;
    language?: string;
    /** Unified diff, when the tool carried one. */
    diff?: string;
    /** Full file body before / after, when present — enables true keystroke
     *  animation rather than only flashing a diff. */
    before?: string;
    after?: string;
    additions: number;
    deletions: number;
    startedAt: number;
}
/** Extract a CodeEdit from a single span, or undefined if it is not an edit. */
export declare function codeEditFromSpan(span: Span): CodeEdit | undefined;
/** All code edits in a run, in chronological order. */
export declare function extractCodeEdits(spans: readonly Span[]): CodeEdit[];
/** Pair each code-edit (`diff`) scene with its concrete edit, matched via the
 *  scene's evidence span ids. Scenes without a recoverable edit are dropped. */
export declare function codeEditsForStoryboard(storyboard: Storyboard, spans: readonly Span[]): Array<{
    scene: Scene;
    edit: CodeEdit;
}>;
/** The text the animation types for an edit: prefer the full new file body,
 *  then the added lines of a diff, then a minimal placeholder so the scene is
 *  never blank. */
export declare function editAnimationText(edit: CodeEdit): string;
export interface CodeAnimationOptions {
    /** Page title. Default "Agent writing code". */
    title?: string;
    /** Characters typed per animation tick. Higher = faster. Default 4. */
    charsPerTick?: number;
    /** Pause between files, ms. Default 900. */
    pauseBetweenMs?: number;
}
/**
 * Render a self-contained HTML page that animates the agent writing each file,
 * character by character, with a filename tab, line numbers, and a blinking
 * cursor — the shareable "watch it build" clip. No build step, no assets, no
 * deps. The same `CodeEdit[]` feeds a Remotion MP4 renderer in a consumer
 * package; this is the dependency-free baseline.
 */
export declare function renderCodeAnimationHtml(source: readonly Span[] | readonly CodeEdit[], opts?: CodeAnimationOptions): string;
//# sourceMappingURL=code-edit.d.ts.map