import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{LyraFrame,LyraVariant}from'../../../internal/variants.js';import type{LyraTranscriptMode}from'../../../internal/shared-unions.js';export interface ActivityEntry{id:string;text:string; /** Literal icon hint (e.g. an emoji), like ``'s `icon`. A small variant dot * renders in its place when omitted. */ icon?:string; /** Invalid strings are treated as unset. */ timestamp?:Date|string; /** Token-mapped, the library's shared `variant` vocabulary. */ variant?:LyraVariant; /** Opaque caller payload (e.g. the source record this entry summarizes). Never read or * rendered by `` itself -- carried through the owned `entries` snapshot and * handed back to `renderText` by reference, never deep-cloned, so a consumer can look up * richer per-entry context without re-scanning its own source array by id on every render. */ data?:unknown;} /** Whether the feed is streaming a run live or replaying a finished one -- the library's shared * transcript-mode vocabulary, identical to ``'s `ThinkingPanelMode`. */ export type ActivityFeedMode=LyraTranscriptMode;export interface ActivityFeedToggleDetail{expanded:boolean;}export interface ActivityFeedFollowChangeDetail{following:boolean;}export interface LyraActivityFeedEventMap{'lr-toggle':CustomEvent;'lr-follow-change':CustomEvent;} /** * `` — an append-only streaming log of granular agent actions ("Searching the * web…", "Read src/index.ts"), collapsing to a localized "Completed N steps" summary once the run * is over. Entries never change state once added (a step whose status mutates in place belongs to * `` instead). Implements the shared follow (stick-to-bottom) contract: `follow` * is a component-managed, host-assignable property, released on user scroll-up and re-engaged at * the bottom. `lr-follow-change` reports user-driven transitions only; direct host assignments are * controlled input and never echo an event. At/above * `virtualizeAt` entries, the body renders through an internal `` * instead of a plain keyed list — same list semantics either way, keyed by `id`. Empty/blank ids * are omitted and duplicates normalize before counts, follow calculations, and rendering; the * first occurrence wins. * * Each entry's `text` renders as plain text by default; a host needing richer per-entry content * (rendered markdown, a trailing tool-call chip list, etc.) sets `renderText` to replace the * default text inside the stable `entry-text` styling wrapper, identically whether or not the feed * is currently virtualized. An entry's optional `data` is an opaque caller payload -- never read * or rendered by this component -- carried through by reference (never deep-cloned) and handed * back to `renderText`, so a host needing the original source record behind a rendered line does * not have to re-derive it by re-scanning its own source array on every render. * * `compact` tightens the header and entry-row padding for dense transcript rows. `frame="plain"` * removes the outside card chrome when a containing message or panel already supplies it; the * header/body divider remains, so the disclosure keeps its internal structure -- the same two-knob * convention `` and `` already establish. The card's own paint * is retunable without a `::part(base)` override through `--lr-activity-feed-background`, * `--lr-activity-feed-border-color` and `--lr-activity-feed-radius`; each is an inline `var()` * fallback at its point of use, so an unset feed renders exactly as before and any of the three can * be set on the feed or on an ancestor transcript. * * Focus is repaired, not merely dropped, when the currently focused control disappears from under * it: collapsing (`expanded` becoming `false`) moves focus already inside the body to * `[part="header"]` before the body is hidden, and an `entries` update that removes the specific * row holding focus does the same once that update (and, while virtualized, the internal * ``'s own follow-up render) has settled. Neither case fires when focus is * elsewhere -- appending a live entry never steals focus from an unrelated, still-present control. * * 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-activity-feed * @event lr-toggle - The header was activated, expanding or collapsing the body. `detail: { * expanded }`. * @event lr-follow-change - A user scroll released or re-engaged `follow`. `detail: { * following }`. Direct property/attribute assignments never echo an event. * @csspart base - The outer container. * @csspart header - The clickable header (`