/** * Eval report exporter extension contract. * * A single `EvalReportExporterRegistry` implementation lives in the contract * registry under {@link EvalReportExporterRegistryName}. Vendor extensions * resolve that registry during setup() and register one exporter each. * * @module extensions/eval/eval-report-exporter */ import type { EvalReport } from "../../eval/types.js"; /** Contract name used for `resolve()` / `provide()`. */ export declare const EvalReportExporterRegistryName: "EvalReportExporterRegistry"; /** Value that can be returned synchronously or as a promise. */ type EvalReportExportMaybePromise = T | Promise; /** Sentinel used when record payload fields are removed for external export. */ export declare const EvalReportRedactedValue: "[redacted]"; /** Redaction policy applied before reports leave the process. */ export interface EvalReportExportRedaction { /** Include dataset input payloads. Defaults to false. */ includeInputs?: boolean; /** Include target output payloads. Defaults to false. */ includeOutputs?: boolean; /** Include reference answer payloads. Defaults to false. */ includeReferences?: boolean; /** Include trace events and tool-call metadata. Defaults to false. */ includeTraces?: boolean; /** Include retrieved RAG context passages. Defaults to false. */ includeRetrievedContext?: boolean; /** Include answer citation payloads. Defaults to false. */ includeCitations?: boolean; /** Include metric/check explanations. Defaults to false. */ includeMetricExplanations?: boolean; /** * Include metric/check evidence payloads. Defaults to false. Metric labels restate the same * configured parameters, so they follow this setting on both record and summary metrics. */ includeMetricEvidence?: boolean; /** Include dataset source paths. Defaults to false. */ includeDatasetPath?: boolean; /** Record and export context metadata keys that can be exported. Defaults to none. */ metadataAllowlist?: string[]; } /** Trace correlation fields that connect eval exports to runtime spans. */ export interface EvalReportExportTraceContext { traceId?: string; spanId?: string; parentSpanId?: string; } /** Context passed to eval report exporters. */ export interface EvalReportExportContext { projectId?: string; projectReference?: string; evalId?: string; sourcePath?: string; reportPath?: string; environment?: string; branch?: string; commitSha?: string; runUrl?: string; tags?: string[]; metadata?: Record; trace?: EvalReportExportTraceContext; redaction?: EvalReportExportRedaction; } /** Optional receipt returned by a vendor exporter. */ export interface EvalReportExportReceipt { externalRunId?: string; url?: string; metadata?: Record; } /** Vendor or backend implementation that receives sanitized eval reports. */ export interface EvalReportExporter { /** Stable exporter id, for example `braintrust`, `langfuse`, or `langsmith`. */ readonly id: string; export(report: EvalReport, context: EvalReportExportContext): EvalReportExportMaybePromise; } /** Successful exporter result. */ export interface EvalReportExportSuccess { exporterId: string; ok: true; receipt?: EvalReportExportReceipt; } /** Failed exporter result. Failures are captured so later exporters still run. */ export interface EvalReportExportFailure { exporterId: string; ok: false; error: string; } /** Result for one exporter invocation. */ export type EvalReportExportResult = EvalReportExportSuccess | EvalReportExportFailure; /** Registry contract. Single impl created at bootstrap. */ export interface EvalReportExporterRegistry { register(exporter: EvalReportExporter): void; unregister(id: string): void; get(id: string): EvalReportExporter | undefined; require(id: string): EvalReportExporter; list(): EvalReportExporter[]; has(id: string): boolean; export(report: EvalReport, context?: EvalReportExportContext): Promise; } /** Create an eval report copy with external-export redaction applied. */ export declare function redactEvalReportForExport(report: EvalReport, redaction?: EvalReportExportRedaction): EvalReport; /** Create an eval report exporter registry. */ export declare function createEvalReportExporterRegistry(): EvalReportExporterRegistry; export {}; //# sourceMappingURL=eval-report-exporter.d.ts.map