/** * AdaptiveChipsStrip — the suggested-chips tile kind. * * A horizontally scrollable strip of chips. Each chip carries a title * and a typed payload. Clicking a chip mounts its payload widget in a * chromed drawer directly below the strip; clicking again (or the * payload's close button) collapses it. Only one chip is open at a * time per strip. * * Payload rendering goes through the runtime widget registry — the * payload is a `{ widget, props? }` reference (same shape as * `slots.drawer.lid`). Click → strip looks the widget id up in * `runtime.widgets`, mounts it into the drawer body, unmounts on * close. No resolver map, no per-customer JS — the same registry * that mounts tile widgets handles chip payloads. * * Built-in payload widgets (registered by this adaptive): * - `adaptive-chatbot:text-answer` — single paragraph of text * * Customers ship their own widgets through the standard adaptive * registration path (each adaptive's `runtime.widgets` list). LLM- * authored configs reference them by id; the widget owns its props * schema. No new vocabulary per chip — same as every other widget * in the SDK. * * Light DOM. The strip itself is chromeless per the PRD; the payload * drawer below is *always* chromed (PRD §6.7) — the chromed boundary * is what visually links the open chip to its content. * * See PRD §4.5 (the suggested-chips pattern) for the canonical UX. */ import { LitElement, type TemplateResult } from 'lit'; import { z } from 'zod'; /** * Structural type for just the runtime surfaces this strip uses. * Avoids a hard dependency on @syntrologie/runtime-sdk while staying * compatible with the real `SmartCanvasRuntime` shape. * * `events.subscribe` is optional — present when running inside the full * canvas runtime where the chips strip wants to receive LLM-authored * chips via `element.compositional_append`. Absent in standalone test * harnesses; the strip falls back to hand-authored chips only. */ interface ChipsStripRuntime { widgets: { has: (id: string) => boolean; mount: (id: string, container: HTMLElement, props?: Record) => { unmount: () => void; update?: (props?: Record) => void; }; }; events?: { /** Used to ping the store with a replay request when the chip strip * (re)mounts — see `_subscribeCompositional`. */ publish?: (name: string, props?: Record) => void; subscribe?: (handler: (event: { name: string; props?: Record; }) => void) => () => void; }; } declare const ChipPayloadZ: z.ZodObject<{ widget: z.ZodString; props: z.ZodOptional>; }, "strict", z.ZodTypeAny, { widget: string; props?: Record | undefined; }, { widget: string; props?: Record | undefined; }>; /** * Schema for a single suggestion chip (compositional action). * * Mirrors the `faq:question` pattern: discriminated by `kind`, body in * `config`, optional `triggerWhen` for per-chip conditional visibility, * optional `notify` for a toast when the chip first becomes relevant, * plus the standard `AuthoringFieldsZ` (id/title/description/validation — * stripped server-side before serving to the runtime). */ export declare const SuggestionChipSchema: z.ZodEffects; config: z.ZodObject<{ id: z.ZodString; title: z.ZodString; payload: z.ZodObject<{ widget: z.ZodString; props: z.ZodOptional>; }, "strict", z.ZodTypeAny, { widget: string; props?: Record | undefined; }, { widget: string; props?: Record | undefined; }>; }, "strip", z.ZodTypeAny, { id: string; title: string; payload: { widget: string; props?: Record | undefined; }; }, { id: string; title: string; payload: { widget: string; props?: Record | undefined; }; }>; triggerWhen: z.ZodOptional; rules: z.ZodArray; url: z.ZodString; }, "strip", z.ZodTypeAny, { type: "page_url"; url: string; }, { type: "page_url"; url: string; }>, z.ZodObject<{ type: z.ZodLiteral<"route">; routeId: z.ZodString; }, "strip", z.ZodTypeAny, { type: "route"; routeId: string; }, { type: "route"; routeId: string; }>, z.ZodObject<{ type: z.ZodLiteral<"anchor_visible">; anchorId: z.ZodString; state: z.ZodEnum<["visible", "present", "absent"]>; }, "strip", z.ZodTypeAny, { type: "anchor_visible"; anchorId: string; state: "absent" | "visible" | "present"; }, { type: "anchor_visible"; anchorId: string; state: "absent" | "visible" | "present"; }>, z.ZodObject<{ type: z.ZodLiteral<"event_occurred">; eventName: z.ZodString; withinMs: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "event_occurred"; eventName: string; withinMs?: number | undefined; }, { type: "event_occurred"; eventName: string; withinMs?: number | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"state_equals">; key: z.ZodString; value: z.ZodUnknown; }, "strip", z.ZodTypeAny, { type: "state_equals"; key: string; value?: unknown; }, { type: "state_equals"; key: string; value?: unknown; }>, z.ZodObject<{ type: z.ZodLiteral<"viewport">; minWidth: z.ZodOptional; maxWidth: z.ZodOptional; minHeight: z.ZodOptional; maxHeight: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "viewport"; minWidth?: number | undefined; maxWidth?: number | undefined; minHeight?: number | undefined; maxHeight?: number | undefined; }, { type: "viewport"; minWidth?: number | undefined; maxWidth?: number | undefined; minHeight?: number | undefined; maxHeight?: number | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"session_metric">; key: z.ZodEnum<["time_on_page", "page_views", "scroll_depth"]>; operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>; threshold: z.ZodNumber; }, "strip", z.ZodTypeAny, { type: "session_metric"; key: "time_on_page" | "page_views" | "scroll_depth"; operator: "gte" | "lte" | "eq" | "gt" | "lt"; threshold: number; }, { type: "session_metric"; key: "time_on_page" | "page_views" | "scroll_depth"; operator: "gte" | "lte" | "eq" | "gt" | "lt"; threshold: number; }>, z.ZodObject<{ type: z.ZodLiteral<"dismissed">; key: z.ZodString; inverted: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "dismissed"; key: string; inverted?: boolean | undefined; }, { type: "dismissed"; key: string; inverted?: boolean | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"cooldown_active">; key: z.ZodString; inverted: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "cooldown_active"; key: string; inverted?: boolean | undefined; }, { type: "cooldown_active"; key: string; inverted?: boolean | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"frequency_limit">; key: z.ZodString; limit: z.ZodNumber; inverted: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "frequency_limit"; key: string; limit: number; inverted?: boolean | undefined; }, { type: "frequency_limit"; key: string; limit: number; inverted?: boolean | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"event_count">; key: z.ZodString; operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>; count: z.ZodNumber; withinMs: z.ZodOptional; counter: z.ZodOptional, "many">; match: z.ZodOptional>; contains: z.ZodOptional; }, "strip", z.ZodTypeAny, { equals?: string | number | boolean | undefined; contains?: string | undefined; }, { equals?: string | number | boolean | undefined; contains?: string | undefined; }>, { equals?: string | number | boolean | undefined; contains?: string | undefined; }, { equals?: string | number | boolean | undefined; contains?: string | undefined; }>>>; }, "strip", z.ZodTypeAny, { events: ("ui.hover" | "ui.idle" | "ui.hesitate" | "ui.rage_click" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "nav.page_view" | "nav.page_leave")[]; match?: Record | undefined; }, { events: ("ui.hover" | "ui.idle" | "ui.hesitate" | "ui.rage_click" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "nav.page_view" | "nav.page_leave")[]; match?: Record | undefined; }>>; }, "strip", z.ZodTypeAny, { type: "event_count"; key: string; operator: "gte" | "lte" | "eq" | "gt" | "lt"; count: number; withinMs?: number | undefined; counter?: { events: ("ui.hover" | "ui.idle" | "ui.hesitate" | "ui.rage_click" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "nav.page_view" | "nav.page_leave")[]; match?: Record | undefined; } | undefined; }, { type: "event_count"; key: string; operator: "gte" | "lte" | "eq" | "gt" | "lt"; count: number; withinMs?: number | undefined; counter?: { events: ("ui.hover" | "ui.idle" | "ui.hesitate" | "ui.rage_click" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "nav.page_view" | "nav.page_leave")[]; match?: Record | undefined; } | undefined; }>]>, "many">; value: z.ZodUnknown; }, "strip", z.ZodTypeAny, { conditions: ({ type: "page_url"; url: string; } | { type: "route"; routeId: string; } | { type: "anchor_visible"; anchorId: string; state: "absent" | "visible" | "present"; } | { type: "event_occurred"; eventName: string; withinMs?: number | undefined; } | { type: "state_equals"; key: string; value?: unknown; } | { type: "viewport"; minWidth?: number | undefined; maxWidth?: number | undefined; minHeight?: number | undefined; maxHeight?: number | undefined; } | { type: "session_metric"; key: "time_on_page" | "page_views" | "scroll_depth"; operator: "gte" | "lte" | "eq" | "gt" | "lt"; threshold: number; } | { type: "dismissed"; key: string; inverted?: boolean | undefined; } | { type: "cooldown_active"; key: string; inverted?: boolean | undefined; } | { type: "frequency_limit"; key: string; limit: number; inverted?: boolean | undefined; } | { type: "event_count"; key: string; operator: "gte" | "lte" | "eq" | "gt" | "lt"; count: number; withinMs?: number | undefined; counter?: { events: ("ui.hover" | "ui.idle" | "ui.hesitate" | "ui.rage_click" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "nav.page_view" | "nav.page_leave")[]; match?: Record | undefined; } | undefined; })[]; value?: unknown; }, { conditions: ({ type: "page_url"; url: string; } | { type: "route"; routeId: string; } | { type: "anchor_visible"; anchorId: string; state: "absent" | "visible" | "present"; } | { type: "event_occurred"; eventName: string; withinMs?: number | undefined; } | { type: "state_equals"; key: string; value?: unknown; } | { type: "viewport"; minWidth?: number | undefined; maxWidth?: number | undefined; minHeight?: number | undefined; maxHeight?: number | undefined; } | { type: "session_metric"; key: "time_on_page" | "page_views" | "scroll_depth"; operator: "gte" | "lte" | "eq" | "gt" | "lt"; threshold: number; } | { type: "dismissed"; key: string; inverted?: boolean | undefined; } | { type: "cooldown_active"; key: string; inverted?: boolean | undefined; } | { type: "frequency_limit"; key: string; limit: number; inverted?: boolean | undefined; } | { type: "event_count"; key: string; operator: "gte" | "lte" | "eq" | "gt" | "lt"; count: number; withinMs?: number | undefined; counter?: { events: ("ui.hover" | "ui.idle" | "ui.hesitate" | "ui.rage_click" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "nav.page_view" | "nav.page_leave")[]; match?: Record | undefined; } | undefined; })[]; value?: unknown; }>, "many">; default: z.ZodUnknown; }, "strip", z.ZodTypeAny, { type: "rules"; rules: { conditions: ({ type: "page_url"; url: string; } | { type: "route"; routeId: string; } | { type: "anchor_visible"; anchorId: string; state: "absent" | "visible" | "present"; } | { type: "event_occurred"; eventName: string; withinMs?: number | undefined; } | { type: "state_equals"; key: string; value?: unknown; } | { type: "viewport"; minWidth?: number | undefined; maxWidth?: number | undefined; minHeight?: number | undefined; maxHeight?: number | undefined; } | { type: "session_metric"; key: "time_on_page" | "page_views" | "scroll_depth"; operator: "gte" | "lte" | "eq" | "gt" | "lt"; threshold: number; } | { type: "dismissed"; key: string; inverted?: boolean | undefined; } | { type: "cooldown_active"; key: string; inverted?: boolean | undefined; } | { type: "frequency_limit"; key: string; limit: number; inverted?: boolean | undefined; } | { type: "event_count"; key: string; operator: "gte" | "lte" | "eq" | "gt" | "lt"; count: number; withinMs?: number | undefined; counter?: { events: ("ui.hover" | "ui.idle" | "ui.hesitate" | "ui.rage_click" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "nav.page_view" | "nav.page_leave")[]; match?: Record | undefined; } | undefined; })[]; value?: unknown; }[]; default?: unknown; }, { type: "rules"; rules: { conditions: ({ type: "page_url"; url: string; } | { type: "route"; routeId: string; } | { type: "anchor_visible"; anchorId: string; state: "absent" | "visible" | "present"; } | { type: "event_occurred"; eventName: string; withinMs?: number | undefined; } | { type: "state_equals"; key: string; value?: unknown; } | { type: "viewport"; minWidth?: number | undefined; maxWidth?: number | undefined; minHeight?: number | undefined; maxHeight?: number | undefined; } | { type: "session_metric"; key: "time_on_page" | "page_views" | "scroll_depth"; operator: "gte" | "lte" | "eq" | "gt" | "lt"; threshold: number; } | { type: "dismissed"; key: string; inverted?: boolean | undefined; } | { type: "cooldown_active"; key: string; inverted?: boolean | undefined; } | { type: "frequency_limit"; key: string; limit: number; inverted?: boolean | undefined; } | { type: "event_count"; key: string; operator: "gte" | "lte" | "eq" | "gt" | "lt"; count: number; withinMs?: number | undefined; counter?: { events: ("ui.hover" | "ui.idle" | "ui.hesitate" | "ui.rage_click" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "nav.page_view" | "nav.page_leave")[]; match?: Record | undefined; } | undefined; })[]; value?: unknown; }[]; default?: unknown; }>, z.ZodObject<{ type: z.ZodLiteral<"score">; field: z.ZodString; threshold: z.ZodNumber; above: z.ZodUnknown; below: z.ZodUnknown; }, "strip", z.ZodTypeAny, { type: "score"; field: string; threshold: number; above?: unknown; below?: unknown; }, { type: "score"; field: string; threshold: number; above?: unknown; below?: unknown; }>, z.ZodObject<{ type: z.ZodLiteral<"model">; modelId: z.ZodString; inputs: z.ZodArray; outputMapping: z.ZodRecord; default: z.ZodUnknown; }, "strip", z.ZodTypeAny, { type: "model"; modelId: string; inputs: string[]; outputMapping: Record; default?: unknown; }, { type: "model"; modelId: string; inputs: string[]; outputMapping: Record; default?: unknown; }>, z.ZodObject<{ type: z.ZodLiteral<"external">; endpoint: z.ZodString; method: z.ZodOptional>; default: z.ZodUnknown; timeoutMs: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "external"; endpoint: string; method?: "GET" | "POST" | undefined; default?: unknown; timeoutMs?: number | undefined; }, { type: "external"; endpoint: string; method?: "GET" | "POST" | undefined; default?: unknown; timeoutMs?: number | undefined; }>]>>>; notify: z.ZodOptional; body: z.ZodOptional; icon: z.ZodOptional; }, "strip", z.ZodTypeAny, { title?: string | undefined; body?: string | undefined; icon?: string | undefined; }, { title?: string | undefined; body?: string | undefined; icon?: string | undefined; }>>>; id: z.ZodOptional; title: z.ZodOptional; description: z.ZodOptional; validation: z.ZodOptional>; }, "strip", z.ZodTypeAny, { kind: "suggestions:chip"; config: { id: string; title: string; payload: { widget: string; props?: Record | undefined; }; }; id?: string | undefined; title?: string | undefined; validation?: string[] | undefined; triggerWhen?: { type: "rules"; rules: { conditions: ({ type: "page_url"; url: string; } | { type: "route"; routeId: string; } | { type: "anchor_visible"; anchorId: string; state: "absent" | "visible" | "present"; } | { type: "event_occurred"; eventName: string; withinMs?: number | undefined; } | { type: "state_equals"; key: string; value?: unknown; } | { type: "viewport"; minWidth?: number | undefined; maxWidth?: number | undefined; minHeight?: number | undefined; maxHeight?: number | undefined; } | { type: "session_metric"; key: "time_on_page" | "page_views" | "scroll_depth"; operator: "gte" | "lte" | "eq" | "gt" | "lt"; threshold: number; } | { type: "dismissed"; key: string; inverted?: boolean | undefined; } | { type: "cooldown_active"; key: string; inverted?: boolean | undefined; } | { type: "frequency_limit"; key: string; limit: number; inverted?: boolean | undefined; } | { type: "event_count"; key: string; operator: "gte" | "lte" | "eq" | "gt" | "lt"; count: number; withinMs?: number | undefined; counter?: { events: ("ui.hover" | "ui.idle" | "ui.hesitate" | "ui.rage_click" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "nav.page_view" | "nav.page_leave")[]; match?: Record | undefined; } | undefined; })[]; value?: unknown; }[]; default?: unknown; } | { type: "score"; field: string; threshold: number; above?: unknown; below?: unknown; } | { type: "model"; modelId: string; inputs: string[]; outputMapping: Record; default?: unknown; } | { type: "external"; endpoint: string; method?: "GET" | "POST" | undefined; default?: unknown; timeoutMs?: number | undefined; } | null | undefined; notify?: { title?: string | undefined; body?: string | undefined; icon?: string | undefined; } | null | undefined; description?: string | undefined; }, { kind: "suggestions:chip"; config: { id: string; title: string; payload: { widget: string; props?: Record | undefined; }; }; id?: string | undefined; title?: string | undefined; validation?: string[] | undefined; triggerWhen?: { type: "rules"; rules: { conditions: ({ type: "page_url"; url: string; } | { type: "route"; routeId: string; } | { type: "anchor_visible"; anchorId: string; state: "absent" | "visible" | "present"; } | { type: "event_occurred"; eventName: string; withinMs?: number | undefined; } | { type: "state_equals"; key: string; value?: unknown; } | { type: "viewport"; minWidth?: number | undefined; maxWidth?: number | undefined; minHeight?: number | undefined; maxHeight?: number | undefined; } | { type: "session_metric"; key: "time_on_page" | "page_views" | "scroll_depth"; operator: "gte" | "lte" | "eq" | "gt" | "lt"; threshold: number; } | { type: "dismissed"; key: string; inverted?: boolean | undefined; } | { type: "cooldown_active"; key: string; inverted?: boolean | undefined; } | { type: "frequency_limit"; key: string; limit: number; inverted?: boolean | undefined; } | { type: "event_count"; key: string; operator: "gte" | "lte" | "eq" | "gt" | "lt"; count: number; withinMs?: number | undefined; counter?: { events: ("ui.hover" | "ui.idle" | "ui.hesitate" | "ui.rage_click" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "nav.page_view" | "nav.page_leave")[]; match?: Record | undefined; } | undefined; })[]; value?: unknown; }[]; default?: unknown; } | { type: "score"; field: string; threshold: number; above?: unknown; below?: unknown; } | { type: "model"; modelId: string; inputs: string[]; outputMapping: Record; default?: unknown; } | { type: "external"; endpoint: string; method?: "GET" | "POST" | undefined; default?: unknown; timeoutMs?: number | undefined; } | null | undefined; notify?: { title?: string | undefined; body?: string | undefined; icon?: string | undefined; } | null | undefined; description?: string | undefined; }>, { kind: "suggestions:chip"; config: { id: string; title: string; payload: { widget: string; props?: Record | undefined; }; }; id?: string | undefined; title?: string | undefined; validation?: string[] | undefined; triggerWhen?: { type: "rules"; rules: { conditions: ({ type: "page_url"; url: string; } | { type: "route"; routeId: string; } | { type: "anchor_visible"; anchorId: string; state: "absent" | "visible" | "present"; } | { type: "event_occurred"; eventName: string; withinMs?: number | undefined; } | { type: "state_equals"; key: string; value?: unknown; } | { type: "viewport"; minWidth?: number | undefined; maxWidth?: number | undefined; minHeight?: number | undefined; maxHeight?: number | undefined; } | { type: "session_metric"; key: "time_on_page" | "page_views" | "scroll_depth"; operator: "gte" | "lte" | "eq" | "gt" | "lt"; threshold: number; } | { type: "dismissed"; key: string; inverted?: boolean | undefined; } | { type: "cooldown_active"; key: string; inverted?: boolean | undefined; } | { type: "frequency_limit"; key: string; limit: number; inverted?: boolean | undefined; } | { type: "event_count"; key: string; operator: "gte" | "lte" | "eq" | "gt" | "lt"; count: number; withinMs?: number | undefined; counter?: { events: ("ui.hover" | "ui.idle" | "ui.hesitate" | "ui.rage_click" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "nav.page_view" | "nav.page_leave")[]; match?: Record | undefined; } | undefined; })[]; value?: unknown; }[]; default?: unknown; } | { type: "score"; field: string; threshold: number; above?: unknown; below?: unknown; } | { type: "model"; modelId: string; inputs: string[]; outputMapping: Record; default?: unknown; } | { type: "external"; endpoint: string; method?: "GET" | "POST" | undefined; default?: unknown; timeoutMs?: number | undefined; } | null | undefined; notify?: { title?: string | undefined; body?: string | undefined; icon?: string | undefined; } | null | undefined; description?: string | undefined; }, { kind: "suggestions:chip"; config: { id: string; title: string; payload: { widget: string; props?: Record | undefined; }; }; id?: string | undefined; title?: string | undefined; validation?: string[] | undefined; triggerWhen?: { type: "rules"; rules: { conditions: ({ type: "page_url"; url: string; } | { type: "route"; routeId: string; } | { type: "anchor_visible"; anchorId: string; state: "absent" | "visible" | "present"; } | { type: "event_occurred"; eventName: string; withinMs?: number | undefined; } | { type: "state_equals"; key: string; value?: unknown; } | { type: "viewport"; minWidth?: number | undefined; maxWidth?: number | undefined; minHeight?: number | undefined; maxHeight?: number | undefined; } | { type: "session_metric"; key: "time_on_page" | "page_views" | "scroll_depth"; operator: "gte" | "lte" | "eq" | "gt" | "lt"; threshold: number; } | { type: "dismissed"; key: string; inverted?: boolean | undefined; } | { type: "cooldown_active"; key: string; inverted?: boolean | undefined; } | { type: "frequency_limit"; key: string; limit: number; inverted?: boolean | undefined; } | { type: "event_count"; key: string; operator: "gte" | "lte" | "eq" | "gt" | "lt"; count: number; withinMs?: number | undefined; counter?: { events: ("ui.hover" | "ui.idle" | "ui.hesitate" | "ui.rage_click" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "nav.page_view" | "nav.page_leave")[]; match?: Record | undefined; } | undefined; })[]; value?: unknown; }[]; default?: unknown; } | { type: "score"; field: string; threshold: number; above?: unknown; below?: unknown; } | { type: "model"; modelId: string; inputs: string[]; outputMapping: Record; default?: unknown; } | { type: "external"; endpoint: string; method?: "GET" | "POST" | undefined; default?: unknown; timeoutMs?: number | undefined; } | null | undefined; notify?: { title?: string | undefined; body?: string | undefined; icon?: string | undefined; } | null | undefined; description?: string | undefined; }>; /** A widget-reference payload that mounts in the drawer when its chip is opened. */ export type ChipPayload = z.infer; /** Declarative chip data. Inferred from `SuggestionChipSchema`. */ export type SuggestionChip = z.infer; export declare class AdaptiveChipsStrip extends LitElement { static properties: { chips: { attribute: boolean; }; runtimeRef: { attribute: boolean; }; chromeless: { type: BooleanConstructor; reflect: boolean; }; _openId: { state: boolean; }; _canScrollLeft: { state: boolean; }; _canScrollRight: { state: boolean; }; }; chips: SuggestionChip[]; /** * Runtime reference — provides `widgets.has(id)` and * `widgets.mount(id, container, props)` so the strip can render * chip payloads through the same registry that mounts tile widgets. * Null until the host wires it (the AdaptiveChipsStripMountable * passes it in from the runtime). */ runtimeRef: ChipsStripRuntime | null; /** * Strip-level chrome toggle — applies uniformly to all chips + * the payload drawer. Resolved upstream from `tile.chromeless` * (which itself defaults from `slot.theme.chromeless`). Per-chip * inconsistency would break the mini-canvas visual rhythm so * there's no per-chip flag — one strip, one style. */ chromeless: boolean; _openId: string | null; /** * Horizontal-scroll affordance state. The strip is a single row that * overflows horizontally when there are more chips than the panel * width can hold; the left/right chevron buttons are visible only * when the user can actually scroll in that direction. ResizeObserver * + scroll listener keep these in sync. */ _canScrollLeft: boolean; _canScrollRight: boolean; private _stripResizeObserver; /** Unsubscribe handle for the compositional-append/patch/remove event * subscription on `runtime.events`. Null when the strip hasn't yet * resolved its tile id (no parent container yet) or the runtime * doesn't expose an event bus. */ private _compositionalUnsub; /** Tile id this strip occupies. Resolved on first `updated()` pass by * walking the DOM ancestor chain for `data-tile-id`. Cached because * the lookup is stable for the lifetime of the mount. Null while * unresolved (or when not running inside a SyntroTileCard, e.g. * in standalone test fixtures). */ private _tileId; /** Instance ids of chips appended by LLM mounts (vs. authored chip * configs from `props.chips`). Tracked so `removeItem(instance_id)` * can find and prune by id. */ private _llmAppendedIds; /** * Tracks the currently-mounted payload widget so we can swap on chip * change + unmount on close. Same lifecycle pattern as * `SyntroCanvasOverlay._lidMountHandle`. */ private _payloadMount; createRenderRoot(): HTMLElement; disconnectedCallback(): void; updated(changed: Map): void; private _resolveTileId; /** * Subscribe to the runtime's event bus for compositional-item events * targeting this strip's tile id. The subscription survives until * disconnect; when an event arrives with a non-matching tile_id, it's * a no-op (the same subscription handles all strips on the page — * filter is just per-event check). */ private _subscribeCompositional; /** Append (or prepend) a new chip authored by the LLM. */ insertItem(instanceId: string, item: Record, position: 'append' | 'prepend'): void; /** Replace the existing chip's content. v1: full replacement (no * in-place merge); the chip widget already re-renders on chip data * changes. */ patchItem(instanceId: string, item: Record): void; /** Remove a chip by instance id. Closes the payload drawer if the * removed chip was the open one. */ removeItem(instanceId: string): void; /** * Attach a ResizeObserver to the scroll container so we recompute * left/right arrow visibility when chips are added/removed or the * panel width changes. The scroll listener on the strip element * handles user-driven scrolls. */ private _syncStripObserver; /** * Recompute whether the left/right scroll arrows should be visible. * Left arrow ⇐ scrollLeft > 0. Right arrow ⇐ there are more chips * to the right (scrollLeft + clientWidth < scrollWidth). Threshold * of 1px tolerance handles sub-pixel rounding on scaled displays. */ private _updateScrollAffordances; private _onStripScroll; /** * Scroll the strip by ~80% of its visible width, so each arrow click * advances the user past most-but-not-all of the current chips * (a small overlap helps the user keep their place in the row). */ private _scrollBy; private _unmountPayload; /** * Reconcile the payload mount with the current `_openId`: * - drawer closed / no runtime / widget id unknown → tear down * - same chip + same widget id → no-op (or props update) * - different chip → unmount old, mount new */ private _syncPayloadMount; private _onChipClick; private _onChipDismiss; private _onPayloadClose; render(): TemplateResult; } declare global { interface HTMLElementTagNameMap { 'adaptive-chips-strip': AdaptiveChipsStrip; } } export {}; //# sourceMappingURL=AdaptiveChipsStrip.d.ts.map