import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';export interface McpAppPermissions{readonly camera?:boolean;readonly microphone?:boolean;readonly geolocation?:boolean;readonly clipboardRead?:boolean;readonly clipboardWrite?:boolean;}export interface McpAppCsp{readonly connectDomains?:readonly string[];readonly resourceDomains?:readonly string[];readonly frameDomains?:readonly string[];}interface McpAppResourceBase{readonly uri:string;readonly title?:string;readonly csp?:McpAppCsp;readonly permissions?:McpAppPermissions;readonly metadata?:Readonly>;} /** An executable app resource with exactly one document source. */ export type McpAppResource=McpAppResourceBase&({ /** Executable app document. It is assigned only to a uniquely-origin sandboxed iframe. */ readonly html:string;readonly src?:never;}|{ /** HTTP(S) or relative app URL served as a separate resource. */ readonly src:string;readonly html?:never;});export interface McpAppToolCallDetail{requestId?:string;name:string;args:unknown; /** Opaque, monotonically increasing id of the frame generation that raised this request. Every * valid `resource` replacement, adoption, or reconnect starts a fresh generation, so a host * that hands this value back to `postToolResult()` has its asynchronous reply dropped instead * of delivered into whatever unrelated app is mounted by the time it resolves. */ frameGeneration:number;}export type McpAppToolResultOptions={frameGeneration:number;result:unknown;error?:never;}|{frameGeneration:number;error:string;result?:never;};export interface LyraMcpAppEventMap{'lr-mcp-ready':CustomEvent<{uri:string;}>;'lr-mcp-tool-call':CustomEvent;'lr-mcp-send-message':CustomEvent<{message:unknown;}>;'lr-mcp-open-link':CustomEvent<{href:string;}>;'lr-mcp-log':CustomEvent<{level:string;value:unknown;}>;'lr-mcp-resize':CustomEvent<{height:number;}>;} /** * `` — hosts an MCP App-style executable UI resource in a uniquely-origin sandbox. * Inline resources receive a trusted leading CSP meta before any caller-controlled HTML token, so * comments or script strings cannot redirect policy insertion away from the parsed document head. * Remote resources accept only relative and HTTP(S) document URLs and never send a referrer. * The frame can request tools, messages, links, logs, and resizing only through typed events; * the component never performs those external actions itself. * Resource records and nested CSP/metadata collections are bounded clone-owned readonly * snapshots. Create and reassign a new resource record after changes. * * @customElement lr-mcp-app * @event lr-mcp-ready - The frame loaded. `detail: { uri }`. * @event lr-mcp-tool-call - The frame requested a tool. * `detail: { requestId?, name, args, frameGeneration }`. `frameGeneration` is an opaque id for * the frame that raised the request; hand it back in `postToolResult()`'s options so an * asynchronous reply arriving after the frame changes is dropped rather than delivered into the * unrelated app now mounted. * @event lr-mcp-send-message - The frame requested a conversation message. * @event lr-mcp-open-link - The frame requested navigation; the host decides whether to honor it. * @event lr-mcp-log - The frame sent a diagnostic value. * @event lr-mcp-resize - The frame requested a clamped height. * @csspart base - The sandbox frame wrapper. * @csspart frame - The sandboxed iframe. * @csspart loading - The pre-load status. * @csspart error - The invalid-resource error. * @status stable * @since 7.0.0 */ export declare class LyraMcpApp extends LyraElement{protected static readonly ownedCollectionProperties:readonly string[];static styles:import("lit").CSSResultGroup[]; /** Clone-owned resource snapshot. Reassign a new record after changing its CSP collections. */ resource:McpAppResource|null;height:number;maxHeight:number; /** Purpose-specific iframe title used ahead of the resource title and localized fallback. */ label:string; /** Programmatic iframe title when no authored host `aria-label` attribute is present. An empty * value cannot leave the executable frame unnamed. */ accessibleLabel:string|null;private loaded;private frameHeight;private frameGeneration;private frame?;private loadingAnnouncementSink?;private errorAnnouncementSink?;private suppressNextResourceAnnouncement;private messageWindow?;private resourceAvailable;private invalidateFrame;private syncAnnouncementSinks;connectedCallback():void;disconnectedCallback():void;adoptedCallback():void;private bindMessageWindow;private unbindMessageWindow;protected willUpdate(changed:PropertyValues):void;protected updated(_changed:PropertyValues):void;private expectedOrigin;private onLoad;private onMessage;private post;postHostContext(context:unknown):void; /** Resolves a prior `lr-mcp-tool-call`. The required frame generation binds the asynchronous * reply to the frame that requested it; stale, uncorrelated, and ambiguous replies fail closed. */ postToolResult(requestId:string,options:McpAppToolResultOptions):void;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-mcp-app':LyraMcpApp;}}export{};