/**
 * Copyright: (c) Myia SAS 2026.
 * This file and its contents are licensed under the AGPLv3 License.
 * Please see the LICENSE file at the root of this repository
 */
import { type TestAttachment } from '../../domain/trace-event-recorder/model/statement-trace-schema';
import type { ExecutionRecord, TestStatus } from '../../domain/persistence';
export interface ExecutionSummary {
    executionId: string;
    source?: 'env' | 'generated';
    startedAt?: number;
    endedAt?: number;
    durationMs?: number;
    totals?: ExecutionRecord['totals'];
    git?: ExecutionRecord['git'];
    playwrightVersion?: string;
}
export interface TestSummary {
    /**
     * Compound routing key for `/api/.../tests/:playwrightTestId/:attempt`.
     * Format: `${playwrightTestId}_${attempt}` — the SPA splits on the
     * last underscore. Sanitized — never contains `..`, `/`, or `\`.
     */
    id: string;
    /** Underlying Playwright `testInfo.testId`. */
    playwrightTestId: string;
    /** 1-indexed attempt number. */
    attempt: number;
    /** NDJSON path relative to `<rootDir>/heal-traces/<executionId>/`. */
    ndjsonPath: string;
    title: string;
    titlePath: string[];
    file: string;
    project: string;
    status: TestStatus;
    duration: number;
    startedAt: number;
    /**
     * All Playwright attachments for this test. Sourced from the
     * NDJSON's `test-attachments` record. Empty when the reporter
     * isn't registered. Videos are NOT separately exposed — consumers
     * filter on `contentType.startsWith('video/')` to derive them.
     */
    attachments: TestAttachment[];
}
export interface ViewerIndex {
    schemaVersion: number;
    executionId: string;
    tests: TestSummary[];
}
/**
 * Decode the compound id back into (playwrightTestId, attempt). Splits
 * on the LAST underscore so test ids that themselves contain underscores
 * round-trip correctly. Returns null on invalid shapes.
 */
export declare const parseSummaryId: (id: string) => {
    playwrightTestId: string;
    attempt: number;
} | null;
export declare const discoverTraces: (rootDir: string, executionId: string) => Promise<TestSummary[]>;
export declare const buildIndex: (executionId: string, tests: TestSummary[]) => ViewerIndex;
/**
 * List executions known under `<rootDir>/heal-traces/`. Tries to read
 * `executions.ndjson` first; if absent or partial, falls back to
 * scanning subdirectory names. The index file lists records in the
 * order runs were appended; we surface them newest-first to match
 * the typical viewer use ("show me the latest run").
 */
export declare const discoverExecutions: (rootDir: string) => Promise<ExecutionSummary[]>;
export declare const isSafeIdForRouting: (id: string) => boolean;
