export interface StorageTestCase {
    id: string;
    name: string;
    description?: string;
    version: number;
    initialPrompt: string;
    tools?: unknown[];
    messages?: unknown[];
    context?: unknown[];
    forwardedProps?: Record<string, unknown>;
    expectedPPL?: string;
    expectedOutcomes?: string[];
    expectedTrajectory?: unknown[];
    labels?: string[];
    category?: string;
    subcategory?: string;
    difficulty?: 'Easy' | 'Medium' | 'Hard';
    tags?: string[];
    author?: string;
    createdAt: string;
    updatedAt: string;
    lastRunAt?: string;
    /** Source provenance for SDK / code-imported test cases. Used by the
     *  CollapsibleTestCaseDefinition UI to distinguish SDK tests (path is
     *  the source of truth) from JSON tests (the row itself is the source
     *  of truth). Already round-trips through OpenSearch — the storage
     *  layer was just dropping it on read. */
    sourceFile?: string;
    sourceHash?: string;
}
export interface StorageBenchmarkRunConfig {
    id: string;
    name: string;
    description?: string;
    agentKey: string;
    agentId?: string;
    modelId: string;
    headers?: Record<string, string>;
    iterationCount?: number;
    createdAt: string;
    results?: Record<string, {
        reportId: string;
        status: string;
        error?: string;
    }>;
    status?: string;
    error?: string;
    stats?: {
        passed: number;
        failed: number;
        pending: number;
        total: number;
        errored?: number;
    };
}
export interface StorageBenchmark {
    id: string;
    name: string;
    description?: string;
    author?: string;
    createdAt: string;
    llmJudgePrompt?: string;
    testCaseIds: string[];
    runs: StorageBenchmarkRunConfig[];
}
/** @deprecated Use StorageBenchmarkRunConfig instead */
export type StorageExperimentRunConfig = StorageBenchmarkRunConfig;
/** @deprecated Use StorageBenchmark instead */
export type StorageExperiment = StorageBenchmark;
export interface StorageRunAnnotation {
    id: string;
    text: string;
    tags?: string[];
    author?: string;
    createdAt: string;
    updatedAt: string;
}
export interface StorageRun {
    id: string;
    name?: string;
    description?: string;
    experimentId: string;
    experimentRunId: string;
    testCaseId: string;
    testCaseVersionId: string;
    agentId: string;
    modelId: string;
    iteration: number;
    author?: string;
    createdAt: string;
    status: 'running' | 'completed' | 'failed';
    passFailStatus?: 'passed' | 'failed';
    traceId?: string;
    tags?: string[];
    actualOutcomes?: unknown[];
    llmJudgeReasoning?: string;
    metrics?: {
        accuracy?: number;
        faithfulness?: number;
        latency_score?: number;
        trajectory_alignment_score?: number;
    };
    annotations?: StorageRunAnnotation[];
    trajectory?: unknown[];
    rawEvents?: unknown[];
    logs?: unknown[];
    improvementStrategies?: {
        category: string;
        issue: string;
        recommendation: string;
        priority: 'high' | 'medium' | 'low';
    }[];
    connectorProtocol?: string;
}
export interface StorageAnalyticsRecord {
    analyticsId: string;
    runId: string;
    experimentId: string;
    experimentRunId: string;
    testCaseId: string;
    testCaseVersionId?: string;
    traceId?: string;
    experimentName?: string;
    testCaseName?: string;
    testCaseCategory?: string;
    testCaseDifficulty?: string;
    agentId: string;
    modelId: string;
    iteration: number;
    tags?: string[];
    passFailStatus?: string;
    status?: string;
    createdAt: string;
    author?: string;
    [key: string]: unknown;
}
export declare const storageAdmin: {
    /**
     * Check storage health/connectivity
     */
    health(): Promise<{
        status: string;
        cluster?: unknown;
        error?: string;
    }>;
    /**
     * Initialize all indexes with mappings
     */
    initIndexes(): Promise<{
        success: boolean;
        results: Record<string, {
            status: string;
            error?: string;
        }>;
    }>;
    /**
     * Get storage statistics
     */
    stats(): Promise<{
        stats: Record<string, {
            count: number;
            error?: string;
        }>;
    }>;
};
export declare const testCaseStorage: {
    /**
     * Get all test cases (latest versions only)
     * @param options.fields - 'summary' for lightweight list-view payload
     * @param options.size - page size for pagination
     * @param options.after - cursor token for next page
     * @param options.includeSample - whether to include sample/demo data
     */
    getAll(options?: {
        fields?: "summary";
        size?: number;
        after?: string;
        includeSample?: boolean;
    }): Promise<{
        testCases: StorageTestCase[];
        total: number;
        after?: string | null;
        hasMore?: boolean;
    }>;
    /**
     * Get test cases by specific IDs (latest versions only)
     * Used for efficient filtered fetching (e.g., only test cases in a benchmark)
     */
    getByIds(ids: string[]): Promise<StorageTestCase[]>;
    /**
     * Get test case by ID (latest version)
     */
    getById(id: string): Promise<StorageTestCase | null>;
    /**
     * Get all versions of a test case
     */
    getVersions(id: string): Promise<StorageTestCase[]>;
    /**
     * Get specific version of a test case
     */
    getVersion(id: string, version: number): Promise<StorageTestCase | null>;
    /**
     * Create new test case (starts at version 1)
     */
    create(testCase: Omit<StorageTestCase, "id" | "version" | "createdAt" | "updatedAt">): Promise<StorageTestCase>;
    /**
     * Update test case (creates new version)
     */
    update(id: string, testCase: Partial<StorageTestCase>): Promise<StorageTestCase>;
    /**
     * Delete test case (all versions)
     */
    delete(id: string): Promise<{
        deleted: number;
    }>;
    /**
     * Bulk create test cases
     */
    bulkCreate(testCases: Partial<StorageTestCase>[]): Promise<{
        created: number;
        errors: boolean;
    }>;
};
export declare const benchmarkStorage: {
    /**
     * Get all benchmarks
     * @param options.includeSample - whether to include sample/demo data
     */
    getAll(options?: {
        includeSample?: boolean;
    }): Promise<StorageBenchmark[]>;
    /**
     * Get benchmark by ID
     * @param options.fields - 'polling' for lightweight payload (excludes versions, testCaseSnapshots, headers)
     * @param options.runsSize - max number of runs to return
     * @param options.runsOffset - offset into runs array for pagination
     */
    getById(id: string, options?: {
        fields?: "polling";
        runsSize?: number;
        runsOffset?: number;
    }): Promise<StorageBenchmark | null>;
    /**
     * Create benchmark
     */
    create(benchmark: Omit<StorageBenchmark, "id" | "createdAt">): Promise<StorageBenchmark>;
    /**
     * Update benchmark (for run management)
     */
    update(id: string, benchmark: Partial<StorageBenchmark>): Promise<StorageBenchmark>;
    /**
     * Delete benchmark
     */
    delete(id: string): Promise<{
        deleted: boolean;
    }>;
    /**
     * Bulk create benchmarks
     */
    bulkCreate(benchmarks: Partial<StorageBenchmark>[]): Promise<{
        created: number;
        errors: boolean;
    }>;
    /**
     * Update benchmark metadata only (name, description)
     */
    updateMetadata(id: string, updates: {
        name?: string;
        description?: string;
    }): Promise<StorageBenchmark>;
    /**
     * Get all versions of a benchmark
     */
    getVersions(id: string): Promise<{
        versions: any[];
        total: number;
    }>;
    /**
     * Get specific version of a benchmark
     */
    getVersion(id: string, version: number): Promise<any>;
};
/** @deprecated Use benchmarkStorage instead */
export declare const experimentStorage: {
    /**
     * Get all benchmarks
     * @param options.includeSample - whether to include sample/demo data
     */
    getAll(options?: {
        includeSample?: boolean;
    }): Promise<StorageBenchmark[]>;
    /**
     * Get benchmark by ID
     * @param options.fields - 'polling' for lightweight payload (excludes versions, testCaseSnapshots, headers)
     * @param options.runsSize - max number of runs to return
     * @param options.runsOffset - offset into runs array for pagination
     */
    getById(id: string, options?: {
        fields?: "polling";
        runsSize?: number;
        runsOffset?: number;
    }): Promise<StorageBenchmark | null>;
    /**
     * Create benchmark
     */
    create(benchmark: Omit<StorageBenchmark, "id" | "createdAt">): Promise<StorageBenchmark>;
    /**
     * Update benchmark (for run management)
     */
    update(id: string, benchmark: Partial<StorageBenchmark>): Promise<StorageBenchmark>;
    /**
     * Delete benchmark
     */
    delete(id: string): Promise<{
        deleted: boolean;
    }>;
    /**
     * Bulk create benchmarks
     */
    bulkCreate(benchmarks: Partial<StorageBenchmark>[]): Promise<{
        created: number;
        errors: boolean;
    }>;
    /**
     * Update benchmark metadata only (name, description)
     */
    updateMetadata(id: string, updates: {
        name?: string;
        description?: string;
    }): Promise<StorageBenchmark>;
    /**
     * Get all versions of a benchmark
     */
    getVersions(id: string): Promise<{
        versions: any[];
        total: number;
    }>;
    /**
     * Get specific version of a benchmark
     */
    getVersion(id: string, version: number): Promise<any>;
};
export declare const runStorage: {
    /**
     * Get all runs with pagination
     */
    getAll(options?: {
        size?: number;
        from?: number;
        _source?: string[];
    }): Promise<{
        runs: StorageRun[];
        total: number;
        size: number;
        from: number;
    }>;
    /**
     * Get run by ID
     */
    getById(id: string): Promise<StorageRun | null>;
    /**
     * Create run
     */
    create(run: Omit<StorageRun, "id" | "createdAt" | "annotations">, options?: {
        analytics?: boolean;
    }): Promise<StorageRun>;
    /**
     * Delete run
     */
    delete(id: string): Promise<{
        deleted: boolean;
    }>;
    /**
     * Partial update of a run
     * Used for updating trace-mode runs after traces become available
     */
    partialUpdate(id: string, updates: Partial<StorageRun>): Promise<StorageRun>;
    /**
     * Get run counts grouped by test case ID (single aggregation query)
     */
    getCountsByTestCase(): Promise<Record<string, number>>;
    /**
     * Get runs by test case ID
     */
    getByTestCase(testCaseId: string, size?: number, from?: number): Promise<{
        runs: StorageRun[];
        total: number;
    }>;
    /**
     * Get runs by benchmark ID
     */
    getByBenchmark(benchmarkId: string, size?: number): Promise<StorageRun[]>;
    /**
     * Get runs by benchmark run config ID
     */
    getByBenchmarkRun(benchmarkId: string, runId: string, size?: number): Promise<StorageRun[]>;
    /**
     * Get all iterations for a test case in a benchmark
     */
    getIterations(benchmarkId: string, testCaseId: string, benchmarkRunId?: string): Promise<{
        runs: StorageRun[];
        total: number;
        maxIteration: number;
    }>;
    /** @deprecated Use getByBenchmark instead */
    getByExperiment(experimentId: string, size?: number): Promise<StorageRun[]>;
    /** @deprecated Use getByBenchmarkRun instead */
    getByExperimentRun(experimentId: string, runId: string, size?: number): Promise<StorageRun[]>;
    /**
     * Search runs with filters
     */
    search(filters: {
        experimentId?: string;
        testCaseId?: string;
        experimentRunId?: string;
        agentId?: string;
        modelId?: string;
        status?: string;
        passFailStatus?: string;
        tags?: string[];
        dateRange?: {
            start: string;
            end: string;
        };
        size?: number;
        from?: number;
    }): Promise<{
        runs: StorageRun[];
        total: number;
    }>;
    /**
     * Add annotation to run
     */
    addAnnotation(runId: string, annotation: Omit<StorageRunAnnotation, "id" | "createdAt" | "updatedAt">): Promise<StorageRunAnnotation>;
    /**
     * Update annotation
     */
    updateAnnotation(runId: string, annotationId: string, updates: Partial<StorageRunAnnotation>): Promise<StorageRunAnnotation>;
    /**
     * Delete annotation
     */
    deleteAnnotation(runId: string, annotationId: string): Promise<{
        deleted: boolean;
    }>;
    /**
     * Bulk create runs
     */
    bulkCreate(runs: Partial<StorageRun>[]): Promise<{
        created: number;
        errors: boolean;
    }>;
};
export declare const analyticsStorage: {
    /**
     * Query analytics records
     */
    query(filters: {
        experimentId?: string;
        testCaseId?: string;
        agentId?: string;
        modelId?: string;
        passFailStatus?: string;
        size?: number;
        from?: number;
    }): Promise<{
        records: StorageAnalyticsRecord[];
        total: number;
    }>;
    /**
     * Get aggregated metrics
     */
    aggregations(experimentId?: string, groupBy?: string): Promise<{
        aggregations: Array<{
            key: string;
            metrics: {
                avgAccuracy?: number;
                avgFaithfulness?: number;
                avgLatency?: number;
                avgTrajectory?: number;
            };
            passCount: number;
            failCount: number;
            totalRuns: number;
        }>;
        groupBy: string;
    }>;
    /**
     * Complex search with custom filters and aggregations
     */
    search(options: {
        filters?: Record<string, unknown>;
        aggs?: Record<string, unknown>;
        size?: number;
        from?: number;
    }): Promise<{
        records: StorageAnalyticsRecord[];
        total: number;
        aggregations: Record<string, unknown>;
    }>;
    /**
     * Backfill analytics from existing runs
     */
    backfill(): Promise<{
        backfilled: number;
        errors: number;
        total: number;
    }>;
};
export declare const opensearchStorage: {
    admin: {
        /**
         * Check storage health/connectivity
         */
        health(): Promise<{
            status: string;
            cluster?: unknown;
            error?: string;
        }>;
        /**
         * Initialize all indexes with mappings
         */
        initIndexes(): Promise<{
            success: boolean;
            results: Record<string, {
                status: string;
                error?: string;
            }>;
        }>;
        /**
         * Get storage statistics
         */
        stats(): Promise<{
            stats: Record<string, {
                count: number;
                error?: string;
            }>;
        }>;
    };
    testCases: {
        /**
         * Get all test cases (latest versions only)
         * @param options.fields - 'summary' for lightweight list-view payload
         * @param options.size - page size for pagination
         * @param options.after - cursor token for next page
         * @param options.includeSample - whether to include sample/demo data
         */
        getAll(options?: {
            fields?: "summary";
            size?: number;
            after?: string;
            includeSample?: boolean;
        }): Promise<{
            testCases: StorageTestCase[];
            total: number;
            after?: string | null;
            hasMore?: boolean;
        }>;
        /**
         * Get test cases by specific IDs (latest versions only)
         * Used for efficient filtered fetching (e.g., only test cases in a benchmark)
         */
        getByIds(ids: string[]): Promise<StorageTestCase[]>;
        /**
         * Get test case by ID (latest version)
         */
        getById(id: string): Promise<StorageTestCase | null>;
        /**
         * Get all versions of a test case
         */
        getVersions(id: string): Promise<StorageTestCase[]>;
        /**
         * Get specific version of a test case
         */
        getVersion(id: string, version: number): Promise<StorageTestCase | null>;
        /**
         * Create new test case (starts at version 1)
         */
        create(testCase: Omit<StorageTestCase, "id" | "version" | "createdAt" | "updatedAt">): Promise<StorageTestCase>;
        /**
         * Update test case (creates new version)
         */
        update(id: string, testCase: Partial<StorageTestCase>): Promise<StorageTestCase>;
        /**
         * Delete test case (all versions)
         */
        delete(id: string): Promise<{
            deleted: number;
        }>;
        /**
         * Bulk create test cases
         */
        bulkCreate(testCases: Partial<StorageTestCase>[]): Promise<{
            created: number;
            errors: boolean;
        }>;
    };
    benchmarks: {
        /**
         * Get all benchmarks
         * @param options.includeSample - whether to include sample/demo data
         */
        getAll(options?: {
            includeSample?: boolean;
        }): Promise<StorageBenchmark[]>;
        /**
         * Get benchmark by ID
         * @param options.fields - 'polling' for lightweight payload (excludes versions, testCaseSnapshots, headers)
         * @param options.runsSize - max number of runs to return
         * @param options.runsOffset - offset into runs array for pagination
         */
        getById(id: string, options?: {
            fields?: "polling";
            runsSize?: number;
            runsOffset?: number;
        }): Promise<StorageBenchmark | null>;
        /**
         * Create benchmark
         */
        create(benchmark: Omit<StorageBenchmark, "id" | "createdAt">): Promise<StorageBenchmark>;
        /**
         * Update benchmark (for run management)
         */
        update(id: string, benchmark: Partial<StorageBenchmark>): Promise<StorageBenchmark>;
        /**
         * Delete benchmark
         */
        delete(id: string): Promise<{
            deleted: boolean;
        }>;
        /**
         * Bulk create benchmarks
         */
        bulkCreate(benchmarks: Partial<StorageBenchmark>[]): Promise<{
            created: number;
            errors: boolean;
        }>;
        /**
         * Update benchmark metadata only (name, description)
         */
        updateMetadata(id: string, updates: {
            name?: string;
            description?: string;
        }): Promise<StorageBenchmark>;
        /**
         * Get all versions of a benchmark
         */
        getVersions(id: string): Promise<{
            versions: any[];
            total: number;
        }>;
        /**
         * Get specific version of a benchmark
         */
        getVersion(id: string, version: number): Promise<any>;
    };
    runs: {
        /**
         * Get all runs with pagination
         */
        getAll(options?: {
            size?: number;
            from?: number;
            _source?: string[];
        }): Promise<{
            runs: StorageRun[];
            total: number;
            size: number;
            from: number;
        }>;
        /**
         * Get run by ID
         */
        getById(id: string): Promise<StorageRun | null>;
        /**
         * Create run
         */
        create(run: Omit<StorageRun, "id" | "createdAt" | "annotations">, options?: {
            analytics?: boolean;
        }): Promise<StorageRun>;
        /**
         * Delete run
         */
        delete(id: string): Promise<{
            deleted: boolean;
        }>;
        /**
         * Partial update of a run
         * Used for updating trace-mode runs after traces become available
         */
        partialUpdate(id: string, updates: Partial<StorageRun>): Promise<StorageRun>;
        /**
         * Get run counts grouped by test case ID (single aggregation query)
         */
        getCountsByTestCase(): Promise<Record<string, number>>;
        /**
         * Get runs by test case ID
         */
        getByTestCase(testCaseId: string, size?: number, from?: number): Promise<{
            runs: StorageRun[];
            total: number;
        }>;
        /**
         * Get runs by benchmark ID
         */
        getByBenchmark(benchmarkId: string, size?: number): Promise<StorageRun[]>;
        /**
         * Get runs by benchmark run config ID
         */
        getByBenchmarkRun(benchmarkId: string, runId: string, size?: number): Promise<StorageRun[]>;
        /**
         * Get all iterations for a test case in a benchmark
         */
        getIterations(benchmarkId: string, testCaseId: string, benchmarkRunId?: string): Promise<{
            runs: StorageRun[];
            total: number;
            maxIteration: number;
        }>;
        /** @deprecated Use getByBenchmark instead */
        getByExperiment(experimentId: string, size?: number): Promise<StorageRun[]>;
        /** @deprecated Use getByBenchmarkRun instead */
        getByExperimentRun(experimentId: string, runId: string, size?: number): Promise<StorageRun[]>;
        /**
         * Search runs with filters
         */
        search(filters: {
            experimentId?: string;
            testCaseId?: string;
            experimentRunId?: string;
            agentId?: string;
            modelId?: string;
            status?: string;
            passFailStatus?: string;
            tags?: string[];
            dateRange?: {
                start: string;
                end: string;
            };
            size?: number;
            from?: number;
        }): Promise<{
            runs: StorageRun[];
            total: number;
        }>;
        /**
         * Add annotation to run
         */
        addAnnotation(runId: string, annotation: Omit<StorageRunAnnotation, "id" | "createdAt" | "updatedAt">): Promise<StorageRunAnnotation>;
        /**
         * Update annotation
         */
        updateAnnotation(runId: string, annotationId: string, updates: Partial<StorageRunAnnotation>): Promise<StorageRunAnnotation>;
        /**
         * Delete annotation
         */
        deleteAnnotation(runId: string, annotationId: string): Promise<{
            deleted: boolean;
        }>;
        /**
         * Bulk create runs
         */
        bulkCreate(runs: Partial<StorageRun>[]): Promise<{
            created: number;
            errors: boolean;
        }>;
    };
    analytics: {
        /**
         * Query analytics records
         */
        query(filters: {
            experimentId?: string;
            testCaseId?: string;
            agentId?: string;
            modelId?: string;
            passFailStatus?: string;
            size?: number;
            from?: number;
        }): Promise<{
            records: StorageAnalyticsRecord[];
            total: number;
        }>;
        /**
         * Get aggregated metrics
         */
        aggregations(experimentId?: string, groupBy?: string): Promise<{
            aggregations: Array<{
                key: string;
                metrics: {
                    avgAccuracy?: number;
                    avgFaithfulness?: number;
                    avgLatency?: number;
                    avgTrajectory?: number;
                };
                passCount: number;
                failCount: number;
                totalRuns: number;
            }>;
            groupBy: string;
        }>;
        /**
         * Complex search with custom filters and aggregations
         */
        search(options: {
            filters?: Record<string, unknown>;
            aggs?: Record<string, unknown>;
            size?: number;
            from?: number;
        }): Promise<{
            records: StorageAnalyticsRecord[];
            total: number;
            aggregations: Record<string, unknown>;
        }>;
        /**
         * Backfill analytics from existing runs
         */
        backfill(): Promise<{
            backfilled: number;
            errors: number;
            total: number;
        }>;
    };
    /** @deprecated Use benchmarks instead */
    experiments: {
        /**
         * Get all benchmarks
         * @param options.includeSample - whether to include sample/demo data
         */
        getAll(options?: {
            includeSample?: boolean;
        }): Promise<StorageBenchmark[]>;
        /**
         * Get benchmark by ID
         * @param options.fields - 'polling' for lightweight payload (excludes versions, testCaseSnapshots, headers)
         * @param options.runsSize - max number of runs to return
         * @param options.runsOffset - offset into runs array for pagination
         */
        getById(id: string, options?: {
            fields?: "polling";
            runsSize?: number;
            runsOffset?: number;
        }): Promise<StorageBenchmark | null>;
        /**
         * Create benchmark
         */
        create(benchmark: Omit<StorageBenchmark, "id" | "createdAt">): Promise<StorageBenchmark>;
        /**
         * Update benchmark (for run management)
         */
        update(id: string, benchmark: Partial<StorageBenchmark>): Promise<StorageBenchmark>;
        /**
         * Delete benchmark
         */
        delete(id: string): Promise<{
            deleted: boolean;
        }>;
        /**
         * Bulk create benchmarks
         */
        bulkCreate(benchmarks: Partial<StorageBenchmark>[]): Promise<{
            created: number;
            errors: boolean;
        }>;
        /**
         * Update benchmark metadata only (name, description)
         */
        updateMetadata(id: string, updates: {
            name?: string;
            description?: string;
        }): Promise<StorageBenchmark>;
        /**
         * Get all versions of a benchmark
         */
        getVersions(id: string): Promise<{
            versions: any[];
            total: number;
        }>;
        /**
         * Get specific version of a benchmark
         */
        getVersion(id: string, version: number): Promise<any>;
    };
};
export default opensearchStorage;
//# sourceMappingURL=opensearchClient.d.ts.map