import type{LyraEventDetailSnapshot}from'../../../internal/lyra-element.js';import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{Citation,GroundedClaim,GroundingAssessment}from'../../../ai/types.js';import type{ToolTimelineActivateDetail,ToolTimelineEntry,ToolTimelineApprovalDetail,ToolTimelineRenderErrorDetail}from'../tool-timeline/tool-timeline.class.js';import{type AgentStatusPresentation}from'../agent-status-presentation.js'; /** How evaluation content is rendered -- `'markdown'` (the default) through ``, or * `'code'` through ``. */ export type EvalContentFormat='markdown'|'code'; /** One self-contained input/output payload in an evaluation example. */ export interface EvalContent{text:string; /** `'markdown'` is used when unset. */ format?:EvalContentFormat; /** A shiki-recognized language id, consulted only when `format` is `'code'`. */ language?:string;} /** * One example's result within an evaluation batch. `status` reuses the shared `AgentStatus` * contract from `src/ai/types.ts` -- the same run-lifecycle vocabulary an agent step already * uses -- rather than inventing a parallel pass/fail enum; rubric-driven scoring (did the output * actually pass) is a separate concern owned by the sibling result-review component, not this * one's batch-progress/trace-display job. `grounding`/`citations` compose directly into * `` (`assessment`/`citations`) and `toolTrace` directly into * `` (`entries`) with no adapters -- this component owns no grounding-scoring or * tool-call rendering logic of its own. */ export interface EvalExampleResult{id:string; /** Falls back to a localized "Example {index}" (1-based, in array order) when unset. */ label?:string;status:AgentStatusPresentation;input:EvalContent;output:EvalContent; /** This example's grounding/citation-support assessment, when the run computed one. Omitted * entirely means no grounding section renders for this example. */ grounding?:GroundingAssessment; /** Evidence citations backing `grounding`, forwarded verbatim to ``'s own * `citations`. Only consulted while `grounding` is also set. */ citations?:readonly Citation[]; /** This example's own tool-call trace. Omitted or empty means no tool-trace section renders for * this example. */ toolTrace?:readonly ToolTimelineEntry[];} /** `detail` for `lr-example-toggle`. */ export interface EvalExampleToggleDetail{exampleId:string;expanded:boolean;} /** `detail` for `lr-example-citation-select` -- the nested per-example ``'s * own `lr-citation-select` detail (`{ citation }`), correlated with the example it came from so a * host doesn't need to walk the DOM to find out which example's evidence was activated. */ export interface EvalCitationSelectDetail{exampleId:string;citation:Citation;} /** `detail` for `lr-example-tool-approval-decide` -- the nested per-example ``'s * own `lr-tool-approval-decide` detail (`ToolTimelineApprovalDetail`), correlated with the * example it came from. */ export interface EvalToolApprovalDetail extends ToolTimelineApprovalDetail{exampleId:string;}export interface EvalToolActivateDetail extends ToolTimelineActivateDetail{exampleId:string;}export interface EvalToolRenderErrorDetail extends ToolTimelineRenderErrorDetail{exampleId:string;}export interface EvalClaimSelectDetail{exampleId:string;claim:GroundedClaim;}export interface LyraEvalRunEventMap{'lr-example-toggle':CustomEvent;'lr-example-citation-select':CustomEvent>;'lr-example-claim-select':CustomEvent>;'lr-example-tool-approval-decide':CustomEvent;'lr-example-tool-activate':CustomEvent;'lr-example-tool-render-error':CustomEvent;} /** * `` — an evaluation batch's live progress: an overall `` * counting terminal (done/error/cancelled) examples against the batch total, plus one * `` disclosure per example showing its input/output (`` or * ``, per each payload's `format`), a `` when the * example carries a `GroundingAssessment`, and a `` when it carries * `toolTrace` entries. Controlled: `examples` mirrors this package's other data-driven * components' own convention (a plain prop the host replaces wholesale to update, never mutated * in place). * * Nested-component events that need per-example correlation are intercepted and re-emitted under * this component's own name with the originating example's `id` folded into `detail` (matching * ``'s own precedent of extending a shared `*EventDetail` type from * `src/ai/types.ts` rather than inventing a divergent shape) -- a host listening at this * component's boundary never needs to walk the DOM to find out which example a nested selection * or approval decision came from. * * 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-run * @event lr-example-toggle - An example's disclosure was expanded or collapsed. `detail: { exampleId, * expanded }`. * @event lr-example-citation-select - An evidence citation in a nested `` * was activated. `detail: { exampleId, citation }`. * @event lr-example-tool-approval-decide - A pending tool call in a nested `` * was approved or denied. `detail: { exampleId, invocationId, approved, args? }`. Cancelable: * preventing this correlated event vetoes the nested decision and preserves its pending dialog. * @event lr-example-claim-select - A grounded claim was activated. `detail: { exampleId, claim }`. * @event lr-example-tool-activate - A nested tool entry was activated. `detail: { exampleId, * invocationId, sourceKey? }`. * @event lr-example-tool-render-error - A nested tool renderer failed. `detail: { exampleId, * invocationId, sourceKey?, toolName, error }`. * @csspart base - The root wrapper. * @csspart header - The batch-progress header row. * @csspart header-label - The run's label, defaulting to a localized "Evaluation run". * @csspart progress - The batch ``. * @csspart summary - The "N of M examples complete" text. * @csspart counts - Wrapper around the running/failed count badges. * @csspart count - One count badge; carries `data-kind="running"|"error"`. * @csspart examples - Wrapper around the per-example `` rows. * @csspart example - One example's `` row; carries `data-status` (the example's * `status.kind`). * @csspart example-summary - The wrapper around an example's label and status badge, in the * `` `summary` slot. * @csspart example-label - An example's label text. * @csspart example-status - An example's status badge. * @csspart example-status-message - Optional caller-supplied detail for an example status. * @csspart input-section - Wrapper around an example's input heading + rendered content. * @csspart output-section - Wrapper around an example's output heading + rendered content. * @csspart grounding-section - Wrapper around an example's ``, only * rendered when the example carries a `grounding` assessment. * @csspart tool-trace-section - Wrapper around an example's ``, only rendered * when the example carries non-empty `toolTrace` entries. * @csspart section-heading - The heading text inside any of the four sections above. * @csspart input - The rendered ``/`` for an example's input. * @csspart output - The rendered ``/`` for an example's output. * @csspart grounding-summary - The nested `` for an example's grounding * assessment. * @csspart tool-trace - The nested `` for an example's tool calls. * @csspart empty - The empty-state message shown when `examples` is empty. * @csspart live-region - The internal status-announcement live region. * @status stable * @since 9.0.0 */ export declare class LyraEvalRun extends LyraElement{protected static readonly ownedCollectionProperties:readonly string[];static styles:import("lit").CSSResultGroup[];protected static readonly immutableEventDetails:readonly string[]; /** The batch's examples so far. Controlled -- never mutated by this component; pass a new array * to update it (e.g. as each example finishes, or as the whole batch streams in). Empty/blank ids * are omitted and duplicates normalize first-wins before expansion, counts, announcements, * rendering, and events. A valid-id partial streaming row keeps rendering with idle status and * empty Markdown content until its status/input/output payloads arrive. */ examples:readonly EvalExampleResult[]; /** The batch's expected total example count. `null` (the default) derives it from * `examples.length` instead -- the common case once every result has already arrived; set this * explicitly while a batch is still streaming in and the eventual total is already known ahead * of every example actually completing. An explicit value below the current observed count is * raised to `examples.length`, so progress never reports an impossible total. */ total:number|null; /** Header label and accessible-name source. Falls back to a localized "Evaluation run" when * unset. */ label:string;private expandedIds;private liveRegion?; /** `true` until the first completed update -- gates the status-change announcements below so a * freshly-mounted run never announces whatever statuses its very first `examples` happens to * carry (mirrors ``'s identical `isMounting` gate). */ private isMounting; /** Last-seen `status.kind` per example id, diffed against the incoming `examples` on every * update to decide what to announce. */ private previousStatusById;private get normalizedExamples();protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;private statusCounts;private exampleLabel;private statusText;private diffAndAnnounce;private onExampleToggle;private onCitationSelect;private onClaimSelect;private onToolApprovalDecide;private onToolActivate;private onToolRenderError;private stopOwnedEvent;private renderContent;private renderGrounding;private renderToolTrace;private renderExample;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-eval-run':LyraEvalRun;}}