/** * Tile element handler — translates `slot`-placed mount/patch/unmount * mutations into pub/sub events that the runtime SDK subscribes to. * * The runtime SDK's `SmartCanvasElementLit` already routes config-driven * tiles to inline slots via `tile.slot === slotName`. LLM-authored tiles * use the same path: we publish a TileConfig-shaped envelope and the * runtime merges it into its tile array, then existing routing renders * it inside the slot's `` alongside any config tiles. * * Why pub/sub instead of `core:mountWidget` via ActionEngine? * * - `Surfaces.mount` is exclusive per slot — a second LLM tile to the * same slot would displace the first. * - `Surfaces` only knows built-in slot names; inline slots resolve * anchors via SyntroInlineSlot, not via Surfaces. * - Tiles need the SyntroTileCard chrome (chromeless handling, theme * overrides, dismiss control) that `core:mountWidget` skips. * * Container widgets stay dumb: the runtime owns one tile array per slot * and renders it the same way regardless of provenance. Subscribers * filter on `slot === this.name`. * * Event names + payload types live in `@syntrologie/sdk-contracts` so * both packages share the contract. Renaming a field there is a TS * error here and in the runtime subscriber — no silent drift. */ import type { ElementHandlerContext, ElementTypeHandler, ValidateResult } from './ElementTypeHandler'; import type { MountedElement } from './types'; export { TILE_MOUNTED_EVENT, TILE_PATCHED_EVENT, TILE_UNMOUNTED_EVENT, } from '@syntrologie/sdk-contracts'; /** * Optional template→widget resolver. ``uiTemplates`` declares both * the LLM-facing ``id`` (e.g. ``"product-card"``) and the runtime * widget the chrome should render (e.g. ``"adaptive-product:card"``). * Without this resolver, the handler falls back to ``template_id`` as * the widget id — which only works when the admin chose ids matching * the widget registry, and silently mounts to "Widget not available" * when they don't. */ export type TileTemplateWidgetResolver = (templateId: string) => string | undefined; export declare class TileHandler implements ElementTypeHandler { private readonly resolveWidget?; readonly typeName: "tile"; readonly lifecycle: "stateful"; constructor(resolveWidget?: TileTemplateWidgetResolver | undefined); private _widgetFor; validate(instance: MountedElement, _ctx: ElementHandlerContext): ValidateResult; mount(instance: MountedElement, ctx: ElementHandlerContext): Promise; patch(instance: MountedElement, ctx: ElementHandlerContext): Promise; unmount(instance: MountedElement, ctx: ElementHandlerContext): Promise; } //# sourceMappingURL=TileHandler.d.ts.map