import type{LyraEventDetailSnapshot}from'../../../internal/lyra-element.js';import{type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{ChatComposerStatus}from'../chat-composer/chat-composer.class.js';import type{AgentRunMetric}from'../../agent-tools/agent-run/agent-run.class.js';export type{AgentRunMetric}from'../../agent-tools/agent-run/agent-run.class.js';import type{ContextInspectorSegment}from'../../agent-tools/context-inspector/context-inspector.class.js';export type{ContextInspectorSegment}from'../../agent-tools/context-inspector/context-inspector.class.js';import type{AgentRun,CancelEventDetail,ChatMessage,Citation,CitationSelectEventDetail,GroundingAssessment,RetrievalChunk,RetryEventDetail}from'../../../ai/types.js';import type{RetrievalResultsSelectDetail}from'../../retrieval/retrieval-results/retrieval-results.class.js';import type{ToolTimelineEntry,ToolTimelineApprovalDetail}from'../../agent-tools/tool-timeline/tool-timeline.class.js';export type{ToolTimelineEntry}from'../../agent-tools/tool-timeline/tool-timeline.class.js';export interface LyraAgentWorkspaceEventMap{'lr-input':CustomEvent<{value:string;}>;'lr-submit':CustomEvent<{value:string;}>;'lr-stop':CustomEvent;'lr-message-retry':CustomEvent<{messageId:string;}>;'lr-follow-change':CustomEvent<{following:boolean;}>;'lr-retrieval-select':CustomEvent>;'lr-citation-select':CustomEvent>;'lr-tool-approval-decide':CustomEvent;'lr-cancel':CustomEvent;'lr-run-retry':CustomEvent;} /** * `` — a responsive, controlled shell for an AI conversation and its * supporting agent state. It renders the transcript and composer in the main pane, and composes * existing run, tool, retrieval, grounding, and context primitives in an optional details pane. * * The component performs no network requests, model calls, retrieval, or persistence. Assign new * data to the public properties as the host application receives updates. The `messages` fallback * renders ordered `message.parts` through `` when supplied, otherwise sanitized * Markdown from the legacy `message.text`; applications can replace the entire region with the * `messages` slot. The `details` slot similarly replaces the built-in details pane while keeping * the responsive shell. Empty and duplicate message ids normalize first-wins before the bounded * window is chosen; at most the latest 500 valid messages are materialized. Applications needing * a larger retained transcript can supply a virtualized `messages` slot. * Composer value, follow state, and retrieval selection are request-only: * child events are forwarded, but the workspace never writes those public * properties. The host applies accepted state back to the component. * * 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. * * **The transcript is the only region that scrolls.** `[part='base']` is a three-row grid — * header, conversation, composer — where only the middle row can shrink, so the composed * `` owns the scrolling and the chrome rows stay put. Header and composer * content are therefore sized by their own content: give the workspace less block-size than they * need and the conversation row collapses to zero first, after which the chrome is clipped with no * scrollbar. That only happens with unusually large slotted chrome — a very tall `header-actions` * toolbar, or a `composer` replacement much taller than the built-in one — and the fix belongs to * whoever supplied it, through the public parts: * `lr-agent-workspace::part(header) { max-block-size: 4rem; overflow: auto; }` (the same applies * to `::part(composer)`). No component-owned custom property duplicates that, because a * `::part()` rule from the consumer's tree already wins over the shadow stylesheet regardless of * specificity and can set the cap and the overflow together. * * @customElement lr-agent-workspace * @slot messages - Replaces the data-driven transcript message list. * @slot details - Replaces the built-in run/tool/retrieval/grounding/context details pane. * @slot composer - Replaces the built-in plain-frame ``; a supplied composer keeps its own frame. * @slot header-actions - Header actions such as model selection, settings, or export controls. * @event lr-input - Forwarded from the built-in composer. `detail: { value }`. * @event lr-submit - Forwarded from the built-in composer. `detail: { value }`. * @event lr-stop - Forwarded from the built-in composer. * @event lr-message-retry - A data-driven message's retry action was activated. `detail: { messageId }`. * @event lr-follow-change - Forwarded from the transcript viewport. `detail: { following }`. * @event lr-retrieval-select - Forwarded from the built-in retrieval results. `detail: { chunkIds, chunks }`. * @event lr-citation-select - Forwarded from the built-in grounding summary. `detail: { citation }`. * @event lr-tool-approval-decide - Forwarded from the built-in tool timeline. * @event lr-cancel - Forwarded from the built-in agent run. * @event lr-run-retry - Forwarded from the built-in agent run. * @csspart base - The root workspace wrapper. * @csspart header - The workspace heading and header-actions slot. * @csspart heading - The visible workspace heading. * @csspart header-actions - The header-actions slot wrapper. * @csspart body - The main conversation/details layout. * @csspart conversation - The main transcript pane. * @csspart viewport - The composed ``. * @csspart messages - Each data-driven transcript message (also exposed as `message`). * @csspart message - Each data-driven transcript message. * @csspart messages-empty - The empty transcript state. * @csspart details - The responsive details pane. * @csspart details-content - The built-in details content wrapper. * @csspart section - A built-in run, tools, retrieval, grounding, or context section. * @csspart section-heading - A built-in details section heading. * @csspart composer - The composer region. * @csspart composer-input - The built-in ``. * @status stable * @since 4.2.0 */ export declare class LyraAgentWorkspace extends LyraElement{protected static readonly immutableEventDetails:readonly string[];protected static readonly ownedCollectionProperties:readonly string[];static styles:import("lit").CSSResultGroup[]; /** Accessible name and visible heading for the workspace. */ label:string; /** Host-level accessible-name override for the internal `role="region"` root. */ accessibleLabel:string|null; /** Conversation messages. The host owns ordering, updates, and persistence. Ids are unique, * nonempty occurrence identities; malformed rows and later duplicates are ignored before the * bounded render window is chosen, with the first occurrence winning. */ messages:readonly ChatMessage[]; /** Current agent run, rendered in the details pane when set. */ run:Readonly |null; /** Additional metrics forwarded to ``, such as token counts or latency. */ metrics:readonly AgentRunMetric[]; /** Tool calls for the current run. Malformed/blank/later duplicate composite identities are * ignored before section gating and forwarding to ``. */ tools:readonly ToolTimelineEntry[]; /** Retrieval chunks for the current answer or query, first-valid/first-wins by nonblank id. */ retrievalChunks:readonly RetrievalChunk[]; /** Controlled retrieval selection, forwarded to ``. */ selectedRetrievalChunkIds:readonly string[]; /** Loading state for the built-in retrieval result list. */ retrievalLoading:boolean; /** Whether more retrieval results can be requested. */ retrievalHasMore:boolean; /** Caller-supplied retrieval error text. */ retrievalErrorText:string; /** Grounding assessment for the current assistant answer. */ groundingAssessment:Readonly |null; /** Citations displayed with the grounding summary, first-valid/first-wins by nonblank id. */ citations:readonly Citation[]; /** Final model-call context segments, first-valid/first-wins by nonblank id. */ contextSegments:readonly ContextInspectorSegment[]; /** Overall context-window token total. */ contextTotal:number; /** Whether the transcript follows the latest message. */ follow:boolean; /** First unread message index, forwarded to the transcript viewport. */ unreadStartIndex:number|null; /** Whether the built-in details pane is available when data is present. */ showDetails:boolean; /** Whether the built-in plain-frame composer is available when no `composer` slot is supplied. */ showComposer:boolean; /** Controlled value of the built-in composer. */ composerValue:string; /** Status of the built-in composer. */ private composerStatusValue;get composerStatus():ChatComposerStatus;set composerStatus(value:ChatComposerStatus); /** Placeholder for the built-in composer. */ composerPlaceholder:string; /** Minimum and maximum rows for the built-in composer. */ composerMinRows:number;composerMaxRows:number;private hasSlotted;private get safeContextTotal();private get effectiveTools();private get effectiveRetrievalChunks();private get effectiveCitations();private get effectiveContextSegments();private get effectiveMessages();private get safeUnreadStartIndex();private get safeComposerMinRows();private get safeComposerMaxRows();private onRetrievalSelect;private onMessageRetry;private stopOwnedEvent;private renderMessage;private renderMessages;private messageWindowOffsetFor; /** Bound to every named slot whose assignment `render()` reads back through `hasSlotted()` -- * `messages` (which decides how `safeUnreadStartIndex` is projected), `details`, and `composer`. * A slot assignment change alone schedules no Lit update, so without this the branch is only * ever evaluated at mount. */ private onNamedSlotChange;private renderDetails;private get hasBuiltInDetails();render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-agent-workspace':LyraAgentWorkspace;}}