/**
 * Convert agent-eval's internal trace shape (`FileSystemTraceStore` → `Run`,
 * `Span`, `TraceEvent`) into the OTLP-flat JSONL the trace analyst
 * (`analyzeTraces` + `OtlpFileTraceStore`) reads.
 *
 * Eval harnesses shard a `FileSystemTraceStore` per cell (persona / variant)
 * under a run directory. The analyst consumes a single OTLP-NDJSON file keyed
 * on `trace_id` + `span_id` with `start_time`/`end_time` in ISO-8601 and
 * resource + `attributes` rolled up per-span. This module walks every shard,
 * projects each `Span` (plus events pinned to it) into the flat OTLP shape,
 * and emits one NDJSON file.
 *
 * Generic OTLP/OpenInference fields are always emitted (`service.name`,
 * `agent.name`, `run.id`/`run.status`, `openinference.span.kind`,
 * `llm.model_name`, …). Domain attributes (`legal.*`, `tax.*`, …) are injected
 * per-run via {@link TraceStoreToOtlpOptions.resourceAttributes} /
 * {@link TraceStoreToOtlpOptions.runAttributes} so consumers don't re-roll the
 * walker.
 */
import type { Run } from './schema';
export interface TracesToOtlpResult {
    /** Total spans emitted across every cell. */
    spanCount: number;
    /** Total run-anchor spans (one per Run) appended for analyst visibility. */
    runCount: number;
    /** Cells whose shards parsed cleanly. */
    cellCount: number;
    /** Cells that errored mid-conversion — surfaced so a partial conversion
     *  isn't silently masked. */
    cellErrorCount: number;
}
/**
 * A trace source the analyst should ingest. Two layouts are supported:
 *
 *   - `celled` (default): the root holds one cell subdirectory per
 *     persona/variant, each a `FileSystemTraceStore` (`runs.ndjson`,
 *     `spans.ndjson`, `events.ndjson`).
 *   - `flat`: the root is itself a single `FileSystemTraceStore` (e.g. a
 *     production-ingestion sidecar that appends one ndjson set directly under
 *     the chosen directory).
 */
export interface TraceStoreSource {
    /** Absolute path to the trace store root. */
    root: string;
    /** Layout — `celled` (default) or `flat`. */
    layout?: 'celled' | 'flat';
    /** OTLP `service.name` for this source. Overrides the options default. */
    serviceName?: string;
}
/** Domain hooks. The walker is generic; consumers inject the namespaced
 *  attributes that ride along on every run + span for analyst discovery. */
export interface TraceStoreToOtlpOptions {
    /** Default OTLP `service.name` when a source doesn't set its own.
     *  Default `agent-eval`. */
    serviceName?: string;
    /** Extra resource attributes per run, e.g.
     *  `(run) => ({ 'legal.persona_id': run.tags?.personaId ?? '' })`. */
    resourceAttributes?: (run: Run) => Record<string, unknown>;
    /** Extra attributes on the per-run anchor span, e.g. domain outcome fields. */
    runAttributes?: (run: Run) => Record<string, unknown>;
}
/**
 * Read every per-cell shard under each source root and write a flat OTLP-JSONL
 * view of the corpus to `outPath`. Each cell directory is a
 * `FileSystemTraceStore` — NDJSON append-only with size-based rotation;
 * `updateRun`/`updateSpan` append `{ id, ...patch, _update: true }` rows
 * rather than rewriting, so readers must merge those patches in (done here).
 *
 * A `string` source is treated as a celled root.
 */
export declare function convertTraceStoresToOtlp(source: string | TraceStoreSource | readonly TraceStoreSource[], outPath: string, opts?: TraceStoreToOtlpOptions): TracesToOtlpResult;
//# sourceMappingURL=store-to-otlp.d.ts.map