import{type TemplateResult}from'lit';import{LyraElement,type LyraEventDetailSnapshot}from'../../../internal/lyra-element.js';import type{RubricKey,RubricValue}from'../../forms/rubric-form/rubric-form.class.js';import type{AgentRunActivateDetail}from'../run-events.js';import type{TableColumn}from'../../data/table/table.class.js';import'../../forms/rubric-form/rubric-form.class.js';import'../../data/table/table.class.js';import'../../utility/diff-view/diff-view.class.js'; /** * One model/prompt-version's output for a single evaluation example, plus whatever automated * `scores` it already carries and whatever `review` a human has entered for it so far. `scores` * and `review` are both keyed the same way as the `rubricKeys` passed to this component -- the * same `RubricValue` shape `` itself reads and writes -- so a `TableColumn`'s * `cell()` accessor and the rubric form's own `value` binding can both read a run's fields with * no conversion. */ export interface EvalRunResult{readonly id:string;readonly label:string;readonly model?:string;readonly promptVersion?:string;readonly output:string;readonly scores?:RubricValue;readonly review?:RubricValue;}export interface LyraEvalResultEventMap{'lr-run-activate':CustomEvent>>;'lr-review-input':CustomEvent>;'lr-review-validity-change':CustomEvent;}>>;'lr-review-submit':CustomEvent>;'lr-review-skip':CustomEvent>;} /** * `` — rubric scoring, human review, and comparison across a single evaluation * example's runs (one per model or prompt version), LangSmith/Arize-eval-result style. Duplicate * run ids normalize before fallback selection, lookup, table row keys, review events, and * comparison; the first occurrence wins. * * Composes three existing primitives directly rather than re-deriving any of their behavior: * `` renders the `runs` comparison table (`columns` is a plain pass-through to its * own `TableColumn[]` shape, the same way `rubricKeys` is a pass-through to * ``'s own `keys` -- neither is re-derived here); `` is the * human-review scoring surface for whichever run is currently selected, reading/writing that * run's own `review` value and re-emitting its `lr-input`/`lr-validity-change`/`lr-submit`/ * `lr-skip` events with the run id attached; `` compares the selected run's output * against `baselineRunId`'s output -- `layout="split"` once they resolve to two distinct runs, * `layout="unified"` (an all-equal diff, i.e. a plain read of the one run's output) once they * resolve to the same run or no baseline resolves at all -- so there is no separate un-diffed * "just show the output" code path to keep in sync with the comparison one. * * `selectedRunId`/`baselineRunId` are both fully controlled: this component never mutates either * property itself. Each one falls back to `runs[0]?.id` purely for *rendering* whenever the * property is unset, so the component renders something useful with zero configuration beyond * `runs` -- but moving the selection for real requires the host to set `selectedRunId` in * response to `lr-run-activate`, the same shape ``'s own `itemId` already uses. A * `selectedRunId`/`baselineRunId` that doesn't match any entry in `runs` degrades gracefully: the * comparison grid still renders, and the review/diff sections simply don't (no error, no crash). * * Public collection properties take bounded, clone-owned readonly snapshots. Create a new * collection and reassign it after changes; mutating the assigned array does not update the view. * * @customElement lr-eval-result * @event lr-run-activate - A comparison-grid row was activated. `detail: { runId, run }`. * @event lr-review-input - The selected run's rubric value changed. `detail: { runId, value }`. * @event lr-review-validity-change - The selected run's rubric validity changed. `detail: { runId, valid, errors }`. * @event lr-review-submit - The selected run's rubric form was submitted. `detail: { runId, value }`. * @event lr-review-skip - The selected run's rubric form was skipped (`reviewSkippable` only). `detail: { runId }`. * @csspart base - The outer wrapper. * @csspart empty - The message shown when `runs` has no entries. * @csspart grid - The `` comparison table. * @csspart review - The `` scoring the selected run. * @csspart diff - The wrapper around the diff caption and ``. * @csspart diff-labels - The caption row naming the two compared runs (only rendered while comparing two distinct runs). * @csspart diff-label-old - The baseline run's caption. * @csspart diff-label-new - The selected run's caption. * @csspart diff-view - The `` comparing the baseline and selected runs' output. * @status stable * @since 4.1.0 */ export declare class LyraEvalResult extends LyraElement{protected static readonly ownedCollectionProperties:readonly string[];static styles:import("lit").CSSResultGroup[];protected static readonly immutableEventDetails:readonly string[]; /** The runs (one per model or prompt version) being compared for this evaluation example. Empty * ids are omitted and duplicates normalize first-wins before selection, diff, grid, and review * events. */ runs:readonly EvalRunResult[]; /** Column definitions for the comparison grid -- forwarded to `` after malformed and * empty keys are omitted and duplicate keys normalize first-wins. * Each column now needs a `cell(row)` accessor (``'s `TableColumn` shape), not the old * `` `DataGridColumn`'s optional `value(row)`. */ columns:readonly TableColumn[]; /** Rubric field definitions for the review form. Empty keys are omitted and duplicate keys * normalize first-wins before the review form receives them. */ rubricKeys:readonly RubricKey[]; /** Accessible name for the independently interactive comparison grid. Falls back to the * localized evaluation-runs label when unset. */ label:string;private get normalizedRuns();private get normalizedColumns();private get normalizedRubricKeys(); /** The run currently open for review, and the diff's "new" side. `null` falls back to the first * valid run; an unmatched identity selects no run. */ selectedRunId:string|null; /** The run compared against, and the diff's "old" side. `null` falls back to the first valid run; * an unmatched identity selects no baseline. */ baselineRunId:string|null; /** Shows a Skip control on the review form (forwarded to ``'s own `skippable`). */ reviewSkippable:boolean; /** Disables the review form's controls. The comparison grid stays interactive (selecting a run to inspect is not a mutation). */ disabled:boolean;private get effectiveSelectedRunId();private get selectedRun();private get effectiveBaselineRunId();private get baselineRun();private stopOwnedEvent;private renderReview;private renderDiff;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-eval-result':LyraEvalResult;}}