/**
 * Storyboard — compile a raw agent trace into a small set of meaningful scenes,
 * then render them as a shareable, watchable replay.
 *
 *   Span[] → SemanticEvent[] → Storyboard{scenes} → { markdown | html }
 *
 * The trace is the source of truth; the storyboard is the IR; markdown/html
 * (and, in a consumer package, Remotion/MP4) are compiled targets. Everything
 * here is PURE — same spans in, same bytes out (no clock/random) — so a run's
 * replay is deterministic and diffable.
 *
 * Crucially, every scene carries a modality-typed VISUAL extracted from the
 * span — a browser/computer screenshot, a code diff, a terminal command +
 * output, file content, an API request/response, or reasoning prose — so no
 * matter what the agent did, the replay SHOWS it, not just narrates it. The
 * reducer is rules-based; an LLM pass can refine titles/summaries later, but
 * the structure + visuals do not depend on one. Renderers that need a browser
 * (Remotion, React) live in consumers; this module only emits strings.
 */
import type { Span } from '../trace/schema';
/** What the agent meaningfully did — the compressed vocabulary. */
export type SemanticKind = 'understood_task' | 'user_message' | 'agent_reply' | 'reasoned' | 'ran_command' | 'read_file' | 'edited_code' | 'searched' | 'used_browser' | 'used_computer' | 'called_api' | 'called_tool' | 'evaluated' | 'observed_failure' | 'completed';
/** The modality-typed payload a scene shows. This is what makes any agent
 *  action — screen, browser, shell, code, API — actually viewable. */
export type SceneVisual = {
    type: 'screenshot';
    src: string;
    caption?: string;
} | {
    type: 'browser';
    url?: string;
    action?: string;
    screenshot?: string;
} | {
    type: 'diff';
    path: string;
    patch: string;
} | {
    type: 'code';
    path: string;
    content: string;
} | {
    type: 'terminal';
    command: string;
    output?: string;
} | {
    type: 'api';
    method?: string;
    url: string;
    status?: number;
    request?: string;
    response?: string;
} | {
    type: 'prose';
    text: string;
} | {
    type: 'none';
};
export interface SemanticEvent {
    kind: SemanticKind;
    /** One-line headline (the ticket/scene title). */
    title: string;
    /** Short human summary. */
    summary: string;
    /** The modality payload to show for this moment. */
    visual: SceneVisual;
    /** Span ids backing this moment — the evidence trail. */
    evidenceSpanIds: string[];
    /** 1 (noise) … 5 (pivotal: failures, edits). Drives selection + duration. */
    importance: 1 | 2 | 3 | 4 | 5;
    startTs: number;
    endTs: number;
}
export interface ReduceOptions {
    /** Collapse adjacent same-kind moments into one. Default true. */
    collapseAdjacent?: boolean;
}
/**
 * Reduce a span tree into the meaningful moments a viewer cares about. The
 * conversation (user asks, agent replies) is lifted from LLM spans first so the
 * dialogue is first-class; the remaining work spans are classified + have their
 * modality visual extracted. Adjacent same-kind work moments collapse (the
 * compression step), carrying the latest visual; failures and conversation
 * turns never collapse.
 */
export declare function reduceToSemanticEvents(spans: readonly Span[], opts?: ReduceOptions): SemanticEvent[];
export type SceneType = 'title_card' | 'prompt' | 'reply' | 'reasoning' | 'terminal' | 'file' | 'diff' | 'search' | 'browser' | 'computer' | 'api' | 'tool' | 'eval' | 'error' | 'summary';
export interface Scene {
    sceneType: SceneType;
    title: string;
    narration: string;
    /** The modality payload the renderer shows. */
    visual: SceneVisual;
    durationMs: number;
    evidenceSpanIds: string[];
}
export interface Storyboard {
    title: string;
    totalMs: number;
    scenes: Scene[];
}
export interface CompileOptions {
    /** Headline for the title card. Default "Agent run". */
    title?: string;
    /** Max action scenes between the title + summary cards. Default 16. */
    maxScenes?: number;
}
/**
 * Select the moments worth showing and lay them out as scenes. Every failure
 * (importance 5) and edit (4) is always kept; the rest fill the budget by
 * importance, then re-sort chronological. A title card opens, a summary closes.
 */
export declare function compileStoryboard(events: readonly SemanticEvent[], opts?: CompileOptions): Storyboard;
/** Render the storyboard as a Markdown timeline — the human-readable shot list. */
export declare function renderStoryboardMarkdown(storyboard: Storyboard): string;
export interface HtmlRenderOptions {
    /** Document title + on-page heading. Defaults to the storyboard title. */
    title?: string;
}
/**
 * Render the storyboard as a self-contained, auto-playing HTML replay — one
 * shareable file, no build step, no external assets. Each scene animates in
 * for its duration and SHOWS its modality (screenshot / diff / terminal / API
 * / browser / prose); controls let a viewer scrub. This is the "free clip" a
 * run produces; an MP4 is the same storyboard fed to Remotion in a consumer.
 */
export declare function renderStoryboardHtml(storyboard: Storyboard, opts?: HtmlRenderOptions): string;
export * from './code-edit';
//# sourceMappingURL=index.d.ts.map