# Threadplane — Full Reference See /llms.txt for a compact summary. --- ## API Reference (API Extractor) ### @threadplane/a2ui # A2UI_BASIC_CATALOG_ID Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2UI_BASIC_CATALOG_ID ```typescript import { A2UI_BASIC_CATALOG_ID } from '@threadplane/a2ui'; ``` ## A2UI_BASIC_CATALOG_ID Catalog id of the standard A2UI basic component catalog. ```typescript A2UI_BASIC_CATALOG_ID = "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json" ``` # A2UI_MIME_TYPE Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2UI_MIME_TYPE ```typescript import { A2UI_MIME_TYPE } from '@threadplane/a2ui'; ``` ## A2UI_MIME_TYPE MIME type for A2UI payloads, standardized in the v0.9.1 release. ```typescript A2UI_MIME_TYPE = "application/a2ui+json" ``` # A2UI_WIRE_VERSION Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2UI_WIRE_VERSION ```typescript import { A2UI_WIRE_VERSION } from '@threadplane/a2ui'; ``` ## A2UI_WIRE_VERSION Wire version stamped on every A2UI v0.9-family envelope. ```typescript A2UI_WIRE_VERSION = "v0.9" ``` # A2uiAction Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiAction ```typescript import type { A2uiAction } from '@threadplane/a2ui'; ``` ## A2uiAction Component action that sends an event to the agent or invokes a local function. ```typescript export type A2uiAction = A2uiEventAction | A2uiFunctionAction; ``` # A2uiActionMessage Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiActionMessage ```typescript import type { A2uiActionMessage } from '@threadplane/a2ui'; ``` ## A2uiActionMessage Versioned client-to-agent event with its surface, source component, timestamp, and optional context. ```typescript export interface A2uiActionMessage { action: { name: string; surfaceId: string; sourceComponentId: string; timestamp: string; context?: Record; label?: string; }; metadata?: { a2uiClientDataModel?: A2uiClientDataModel; }; version: string; } ``` ### action ```typescript action: { name: string; surfaceId: string; sourceComponentId: string; timestamp: string; context?: Record; label?: string; }; ``` ### metadata ```typescript metadata?: { a2uiClientDataModel?: A2uiClientDataModel; }; ``` ### version ```typescript version: string; ``` # A2uiAudioPlayer Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiAudioPlayer ```typescript import type { A2uiAudioPlayer } from '@threadplane/a2ui'; ``` ## A2uiAudioPlayer Basic-catalog audio player with a dynamic media URL and optional description. ```typescript export interface A2uiAudioPlayer extends A2uiComponentBase { component: 'AudioPlayer'; description?: DynamicString; url: DynamicString; } ``` ### component ```typescript component: 'AudioPlayer'; ``` ### description ```typescript description?: DynamicString; ``` ### url ```typescript url: DynamicString; ``` # A2uiButton Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiButton ```typescript import type { A2uiButton } from '@threadplane/a2ui'; ``` ## A2uiButton Basic-catalog button that renders a child component and dispatches its configured action. ```typescript export interface A2uiButton extends A2uiComponentBase { action: A2uiAction; child: string; component: 'Button'; variant?: 'default' | 'primary' | 'borderless'; } ``` ### action ```typescript action: A2uiAction; ``` ### child ```typescript child: string; ``` ### component ```typescript component: 'Button'; ``` ### variant ```typescript variant?: 'default' | 'primary' | 'borderless'; ``` # A2uiCard Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiCard ```typescript import type { A2uiCard } from '@threadplane/a2ui'; ``` ## A2uiCard Basic-catalog card that wraps the component identified by its child ID. ```typescript export interface A2uiCard extends A2uiComponentBase { child: string; component: 'Card'; } ``` ### child ```typescript child: string; ``` ### component ```typescript component: 'Card'; ``` # A2uiCatalogComponent Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiCatalogComponent ```typescript import type { A2uiCatalogComponent } from '@threadplane/a2ui'; ``` ## A2uiCatalogComponent Union of the basic-catalog component shapes. ```typescript export type A2uiCatalogComponent = A2uiText | A2uiImage | A2uiIcon | A2uiVideo | A2uiAudioPlayer | A2uiRow | A2uiColumn | A2uiList | A2uiCard | A2uiTabs | A2uiModal | A2uiDivider | A2uiButton | A2uiCheckBox | A2uiTextField | A2uiDateTimeInput | A2uiChoicePicker | A2uiSlider; ``` # A2uiCheck Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiCheck ```typescript import type { A2uiCheck } from '@threadplane/a2ui'; ``` ## A2uiCheck Client-side validation condition paired with the message shown on failure. ```typescript export interface A2uiCheck { condition: DynamicValue; message: string; } ``` ### condition A DynamicBoolean — typically a validator function call (`required`, `regex`, `length`, `numeric`, `email`) or a logic combinator. The rule passes when the condition resolves to `true`. ```typescript condition: DynamicValue; ``` ### message Error message displayed when the check fails. ```typescript message: string; ``` # A2uiCheckable Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiCheckable ```typescript import type { A2uiCheckable } from '@threadplane/a2ui'; ``` ## A2uiCheckable Mixin for input components that support client-side validation checks. ```typescript export interface A2uiCheckable { checks?: A2uiCheck[]; } ``` ### checks ```typescript checks?: A2uiCheck[]; ``` # A2uiCheckBox Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiCheckBox ```typescript import type { A2uiCheckBox } from '@threadplane/a2ui'; ``` ## A2uiCheckBox Basic-catalog checkbox with dynamic label and boolean value plus optional validation checks. ```typescript export interface A2uiCheckBox extends A2uiComponentBase, A2uiCheckable { component: 'CheckBox'; label: DynamicString; value: DynamicBoolean; } ``` ### component ```typescript component: 'CheckBox'; ``` ### label ```typescript label: DynamicString; ``` ### value ```typescript value: DynamicBoolean; ``` # A2uiChildren Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiChildren ```typescript import type { A2uiChildren } from '@threadplane/a2ui'; ``` ## A2uiChildren Static child-id list, or a template stamped per element of a data-model list. ```typescript export type A2uiChildren = string[] | { path: string; componentId: string; }; ``` # A2uiChoicePicker Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiChoicePicker ```typescript import type { A2uiChoicePicker } from '@threadplane/a2ui'; ``` ## A2uiChoicePicker Basic-catalog single- or multiple-choice input whose selected values are a dynamic string list. ```typescript export interface A2uiChoicePicker extends A2uiComponentBase, A2uiCheckable { component: 'ChoicePicker'; displayStyle?: 'checkbox' | 'chips'; filterable?: boolean; label?: DynamicString; options: { label: DynamicString; value: string; }[]; value: DynamicStringList; variant?: 'mutuallyExclusive' | 'multipleSelection'; } ``` ### component ```typescript component: 'ChoicePicker'; ``` ### displayStyle ```typescript displayStyle?: 'checkbox' | 'chips'; ``` ### filterable ```typescript filterable?: boolean; ``` ### label ```typescript label?: DynamicString; ``` ### options ```typescript options: { label: DynamicString; value: string; }[]; ``` ### value ```typescript value: DynamicStringList; ``` ### variant ```typescript variant?: 'mutuallyExclusive' | 'multipleSelection'; ``` # A2uiClientCapabilities Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiClientCapabilities ```typescript import type { A2uiClientCapabilities } from '@threadplane/a2ui'; ``` ## A2uiClientCapabilities Catalog IDs and optional inline catalog definitions advertised by the client. ```typescript export interface A2uiClientCapabilities { inlineCatalogs?: unknown[]; supportedCatalogIds: string[]; } ``` ### inlineCatalogs ```typescript inlineCatalogs?: unknown[]; ``` ### supportedCatalogIds ```typescript supportedCatalogIds: string[]; ``` # A2uiClientDataModel Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiClientDataModel ```typescript import type { A2uiClientDataModel } from '@threadplane/a2ui'; ``` ## A2uiClientDataModel Surface-ID keyed data models attached to outbound messages when surface data-model sharing is enabled. ```typescript export interface A2uiClientDataModel { surfaces: Record>; } ``` ### surfaces ```typescript surfaces: Record>; ``` # A2uiColumn Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiColumn ```typescript import type { A2uiColumn } from '@threadplane/a2ui'; ``` ## A2uiColumn Basic-catalog vertical container for static or templated children. ```typescript export interface A2uiColumn extends A2uiComponentBase { align?: A2uiAlign; children: A2uiChildren; component: 'Column'; justify?: A2uiJustify; } ``` ### align ```typescript align?: A2uiAlign; ``` ### children ```typescript children: A2uiChildren; ``` ### component ```typescript component: 'Column'; ``` ### justify ```typescript justify?: A2uiJustify; ``` # A2uiComponent Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiComponent ```typescript import type { A2uiComponent } from '@threadplane/a2ui'; ``` ## A2uiComponent Any component, including non-basic-catalog types. Renderers treat unknown `component` strings as unrenderable and fall back gracefully. ```typescript export type A2uiComponent = A2uiCatalogComponent | (A2uiComponentBase & Record); ``` # A2uiComponentBase Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiComponentBase ```typescript import type { A2uiComponentBase } from '@threadplane/a2ui'; ``` ## A2uiComponentBase Shared identity, catalog override, layout weight, and accessibility fields for an A2UI component. ```typescript export interface A2uiComponentBase { accessibility?: Record; catalogId?: string; component: string; id: string; weight?: number; } ``` ### accessibility Accessibility attributes (spec `AccessibilityAttributes`). ```typescript accessibility?: Record; ``` ### catalogId Overrides the surface's default catalog for this component. ```typescript catalogId?: string; ``` ### component ```typescript component: string; ``` ### id ```typescript id: string; ``` ### weight Flex-grow-like weight; only valid as a direct child of Row/Column. ```typescript weight?: number; ``` # A2uiCreateSurface Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiCreateSurface ```typescript import type { A2uiCreateSurface } from '@threadplane/a2ui'; ``` ## A2uiCreateSurface Agent-to-client payload that creates a surface with its catalog, theme, and data-model sharing preference. ```typescript export interface A2uiCreateSurface { catalogId: string; sendDataModel?: boolean; surfaceId: string; theme?: A2uiTheme; } ``` ### catalogId ```typescript catalogId: string; ``` ### sendDataModel When true, the client attaches the surface's full data model to every outbound message. ```typescript sendDataModel?: boolean; ``` ### surfaceId ```typescript surfaceId: string; ``` ### theme ```typescript theme?: A2uiTheme; ``` # A2uiDateTimeInput Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiDateTimeInput ```typescript import type { A2uiDateTimeInput } from '@threadplane/a2ui'; ``` ## A2uiDateTimeInput Basic-catalog date/time input with an ISO 8601 value and optional date, time, and range controls. ```typescript export interface A2uiDateTimeInput extends A2uiComponentBase, A2uiCheckable { component: 'DateTimeInput'; enableDate?: boolean; enableTime?: boolean; label?: DynamicString; max?: DynamicString; min?: DynamicString; value: DynamicString; } ``` ### component ```typescript component: 'DateTimeInput'; ``` ### enableDate ```typescript enableDate?: boolean; ``` ### enableTime ```typescript enableTime?: boolean; ``` ### label ```typescript label?: DynamicString; ``` ### max ```typescript max?: DynamicString; ``` ### min ```typescript min?: DynamicString; ``` ### value ISO 8601 value. ```typescript value: DynamicString; ``` # A2uiDeleteSurface Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiDeleteSurface ```typescript import type { A2uiDeleteSurface } from '@threadplane/a2ui'; ``` ## A2uiDeleteSurface Agent-to-client payload identifying the surface to remove. ```typescript export interface A2uiDeleteSurface { surfaceId: string; } ``` ### surfaceId ```typescript surfaceId: string; ``` # A2uiDivider Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiDivider ```typescript import type { A2uiDivider } from '@threadplane/a2ui'; ``` ## A2uiDivider Basic-catalog separator with an optional horizontal or vertical axis. ```typescript export interface A2uiDivider extends A2uiComponentBase { axis?: 'horizontal' | 'vertical'; component: 'Divider'; } ``` ### axis ```typescript axis?: 'horizontal' | 'vertical'; ``` ### component ```typescript component: 'Divider'; ``` # A2uiErrorMessage Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiErrorMessage ```typescript import type { A2uiErrorMessage } from '@threadplane/a2ui'; ``` ## A2uiErrorMessage Versioned A2UI error envelope with a code and optional surface, path, and message details. ```typescript export interface A2uiErrorMessage { error: { code: string; surfaceId?: string; path?: string; message?: string; }; version: string; } ``` ### error ```typescript error: { code: string; surfaceId?: string; path?: string; message?: string; }; ``` ### version ```typescript version: string; ``` # A2uiEventAction Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiEventAction ```typescript import type { A2uiEventAction } from '@threadplane/a2ui'; ``` ## A2uiEventAction Dispatches a named event (with optional context) to the agent. ```typescript export interface A2uiEventAction { event: { name: string; context?: Record; }; } ``` ### event ```typescript event: { name: string; context?: Record; }; ``` # A2uiFunctionAction Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiFunctionAction ```typescript import type { A2uiFunctionAction } from '@threadplane/a2ui'; ``` ## A2uiFunctionAction Executes a client-side function locally (e.g. `openUrl`). ```typescript export interface A2uiFunctionAction { functionCall: A2uiFunctionCall; } ``` ### functionCall ```typescript functionCall: A2uiFunctionCall; ``` # A2uiFunctionCall Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiFunctionCall ```typescript import type { A2uiFunctionCall } from '@threadplane/a2ui'; ``` ## A2uiFunctionCall Client-side function invocation (e.g. `formatString`, `required`). ```typescript export interface A2uiFunctionCall { args?: Record; call: string; returnType?: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'any' | 'void'; } ``` ### args ```typescript args?: Record; ``` ### call ```typescript call: string; ``` ### returnType ```typescript returnType?: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'any' | 'void'; ``` # A2uiFunctionContext Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiFunctionContext ```typescript import type { A2uiFunctionContext } from '@threadplane/a2ui'; ``` ## A2uiFunctionContext Execution context handed to every function implementation. ```typescript export interface A2uiFunctionContext { locale?: string; resolveArg(value: unknown): unknown; } ``` ### locale BCP 47 locale for Intl-based formatting; host default when undefined. ```typescript locale?: string; ``` ### resolveArg · overload 1 Resolve a (possibly dynamic) argument value — bare literal, `{ path }` binding, or nested `{ call }` — against the current data model/scope. ```typescript resolveArg(value: unknown): unknown; ``` # A2uiFunctionImpl Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiFunctionImpl ```typescript import type { A2uiFunctionImpl } from '@threadplane/a2ui'; ``` ## A2uiFunctionImpl Client-side function implementation receiving named arguments and a context for resolving dynamic values. ```typescript export type A2uiFunctionImpl = (args: Record, ctx: A2uiFunctionContext) => unknown; ``` # A2uiFunctionRegistry Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiFunctionRegistry ```typescript import type { A2uiFunctionRegistry } from '@threadplane/a2ui'; ``` ## A2uiFunctionRegistry Read-only lookup of client-side function implementations by their A2UI call names. ```typescript export type A2uiFunctionRegistry = ReadonlyMap; ``` # A2uiIcon Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiIcon ```typescript import type { A2uiIcon } from '@threadplane/a2ui'; ``` ## A2uiIcon Basic-catalog icon component identified by a dynamic name or an SVG path. ```typescript export interface A2uiIcon extends A2uiComponentBase { component: 'Icon'; name: DynamicString | { svgPath: string; }; } ``` ### component ```typescript component: 'Icon'; ``` ### name ```typescript name: DynamicString | { svgPath: string; }; ``` # A2uiImage Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiImage ```typescript import type { A2uiImage } from '@threadplane/a2ui'; ``` ## A2uiImage Basic-catalog image component with a dynamic URL, description, and display options. ```typescript export interface A2uiImage extends A2uiComponentBase { component: 'Image'; description?: DynamicString; fit?: 'contain' | 'cover' | 'fill' | 'none' | 'scaleDown'; url: DynamicString; variant?: 'icon' | 'avatar' | 'smallFeature' | 'mediumFeature' | 'largeFeature' | 'header'; } ``` ### component ```typescript component: 'Image'; ``` ### description ```typescript description?: DynamicString; ``` ### fit ```typescript fit?: 'contain' | 'cover' | 'fill' | 'none' | 'scaleDown'; ``` ### url ```typescript url: DynamicString; ``` ### variant ```typescript variant?: 'icon' | 'avatar' | 'smallFeature' | 'mediumFeature' | 'largeFeature' | 'header'; ``` # A2uiList Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiList ```typescript import type { A2uiList } from '@threadplane/a2ui'; ``` ## A2uiList Basic-catalog list of static or templated children with configurable direction and alignment. ```typescript export interface A2uiList extends A2uiComponentBase { align?: A2uiAlign; children: A2uiChildren; component: 'List'; direction?: 'vertical' | 'horizontal'; } ``` ### align ```typescript align?: A2uiAlign; ``` ### children ```typescript children: A2uiChildren; ``` ### component ```typescript component: 'List'; ``` ### direction ```typescript direction?: 'vertical' | 'horizontal'; ``` # A2uiMessage Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiMessage ```typescript import type { A2uiMessage } from '@threadplane/a2ui'; ``` ## A2uiMessage Versioned agent-to-client envelope containing one surface or data-model operation. ```typescript export type A2uiMessage = A2uiEnvelopeBase & ({ createSurface: A2uiCreateSurface; } | { updateComponents: A2uiUpdateComponents; } | { updateDataModel: A2uiUpdateDataModel; } | { deleteSurface: A2uiDeleteSurface; }); ``` # A2uiMessageParser Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiMessageParser ```typescript import type { A2uiMessageParser } from '@threadplane/a2ui'; ``` ## A2uiMessageParser Stateful JSONL parser that buffers incomplete lines and returns recognized A2UI envelopes from stream chunks. ```typescript export interface A2uiMessageParser { push(chunk: string): A2uiMessage[]; } ``` ### push · overload 1 Push a JSONL stream chunk and return every complete A2UI envelope parsed from it. ```typescript push(chunk: string): A2uiMessage[]; ``` # A2uiModal Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiModal ```typescript import type { A2uiModal } from '@threadplane/a2ui'; ``` ## A2uiModal Basic-catalog modal referencing separate trigger and content component IDs. ```typescript export interface A2uiModal extends A2uiComponentBase { component: 'Modal'; content: string; trigger: string; } ``` ### component ```typescript component: 'Modal'; ``` ### content ```typescript content: string; ``` ### trigger ```typescript trigger: string; ``` # A2uiPathRef Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiPathRef ```typescript import type { A2uiPathRef } from '@threadplane/a2ui'; ``` ## A2uiPathRef JSON-pointer data-model binding. Absolute (`/a/b`) or relative inside templates. ```typescript export interface A2uiPathRef { path: string; } ``` ### path ```typescript path: string; ``` # A2uiRow Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiRow ```typescript import type { A2uiRow } from '@threadplane/a2ui'; ``` ## A2uiRow Basic-catalog horizontal container for static or templated children. ```typescript export interface A2uiRow extends A2uiComponentBase { align?: A2uiAlign; children: A2uiChildren; component: 'Row'; justify?: A2uiJustify; } ``` ### align ```typescript align?: A2uiAlign; ``` ### children ```typescript children: A2uiChildren; ``` ### component ```typescript component: 'Row'; ``` ### justify ```typescript justify?: A2uiJustify; ``` # A2uiScope Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiScope ```typescript import type { A2uiScope } from '@threadplane/a2ui'; ``` ## A2uiScope Repeated-item context whose base path anchors relative data-model bindings. ```typescript export interface A2uiScope { basePath: string; item: unknown; } ``` ### basePath ```typescript basePath: string; ``` ### item ```typescript item: unknown; ``` # A2uiSlider Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiSlider ```typescript import type { A2uiSlider } from '@threadplane/a2ui'; ``` ## A2uiSlider Basic-catalog numeric slider with a dynamic value, fixed bounds, and optional validation checks. ```typescript export interface A2uiSlider extends A2uiComponentBase, A2uiCheckable { component: 'Slider'; label?: DynamicString; max: number; min?: number; value: DynamicNumber; } ``` ### component ```typescript component: 'Slider'; ``` ### label ```typescript label?: DynamicString; ``` ### max ```typescript max: number; ``` ### min ```typescript min?: number; ``` ### value ```typescript value: DynamicNumber; ``` # A2uiSurface Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiSurface ```typescript import type { A2uiSurface } from '@threadplane/a2ui'; ``` ## A2uiSurface Renderer-side surface state combining catalog settings, components indexed by ID, and the current data model. ```typescript export interface A2uiSurface { catalogId: string; components: Map; dataModel: Record; sendDataModel?: boolean; surfaceId: string; theme?: A2uiTheme; } ``` ### catalogId ```typescript catalogId: string; ``` ### components ```typescript components: Map; ``` ### dataModel ```typescript dataModel: Record; ``` ### sendDataModel ```typescript sendDataModel?: boolean; ``` ### surfaceId ```typescript surfaceId: string; ``` ### theme ```typescript theme?: A2uiTheme; ``` # A2uiTabs Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiTabs ```typescript import type { A2uiTabs } from '@threadplane/a2ui'; ``` ## A2uiTabs Basic-catalog tab container pairing dynamic tab titles with child component IDs. ```typescript export interface A2uiTabs extends A2uiComponentBase { component: 'Tabs'; tabs: { title: DynamicString; child: string; }[]; } ``` ### component ```typescript component: 'Tabs'; ``` ### tabs ```typescript tabs: { title: DynamicString; child: string; }[]; ``` # A2uiText Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiText ```typescript import type { A2uiText } from '@threadplane/a2ui'; ``` ## A2uiText Basic-catalog text component with a dynamic string and optional typographic variant. ```typescript export interface A2uiText extends A2uiComponentBase { component: 'Text'; text: DynamicString; variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'caption' | 'body'; } ``` ### component ```typescript component: 'Text'; ``` ### text ```typescript text: DynamicString; ``` ### variant ```typescript variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'caption' | 'body'; ``` # A2uiTextField Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiTextField ```typescript import type { A2uiTextField } from '@threadplane/a2ui'; ``` ## A2uiTextField Basic-catalog text input with a dynamic label and value, input variant, and optional validation. ```typescript export interface A2uiTextField extends A2uiComponentBase, A2uiCheckable { component: 'TextField'; label: DynamicString; validationRegexp?: string; value?: DynamicString; variant?: 'shortText' | 'longText' | 'number' | 'obscured'; } ``` ### component ```typescript component: 'TextField'; ``` ### label ```typescript label: DynamicString; ``` ### validationRegexp ```typescript validationRegexp?: string; ``` ### value ```typescript value?: DynamicString; ``` ### variant ```typescript variant?: 'shortText' | 'longText' | 'number' | 'obscured'; ``` # A2uiTheme Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiTheme ```typescript import type { A2uiTheme } from '@threadplane/a2ui'; ``` ## A2uiTheme Optional surface branding: primary color, icon URL, and agent display name. ```typescript export interface A2uiTheme { agentDisplayName?: string; iconUrl?: string; primaryColor?: string; } ``` ### agentDisplayName ```typescript agentDisplayName?: string; ``` ### iconUrl ```typescript iconUrl?: string; ``` ### primaryColor ```typescript primaryColor?: string; ``` # A2uiUpdateComponents Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiUpdateComponents ```typescript import type { A2uiUpdateComponents } from '@threadplane/a2ui'; ``` ## A2uiUpdateComponents Agent-to-client payload carrying component definitions for the identified surface. ```typescript export interface A2uiUpdateComponents { components: A2uiComponent[]; surfaceId: string; } ``` ### components ```typescript components: A2uiComponent[]; ``` ### surfaceId ```typescript surfaceId: string; ``` # A2uiUpdateDataModel Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiUpdateDataModel ```typescript import type { A2uiUpdateDataModel } from '@threadplane/a2ui'; ``` ## A2uiUpdateDataModel Agent-to-client payload that replaces or deletes a value at a surface data-model path. ```typescript export interface A2uiUpdateDataModel { path?: string; surfaceId: string; value?: unknown; } ``` ### path JSON pointer into the data model. Omitted or `/` targets the whole model. ```typescript path?: string; ``` ### surfaceId ```typescript surfaceId: string; ``` ### value Replacement value at `path`. Omitted value deletes the key at `path`. ```typescript value?: unknown; ``` # A2uiVideo Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/A2uiVideo ```typescript import type { A2uiVideo } from '@threadplane/a2ui'; ``` ## A2uiVideo Basic-catalog video component whose media URL can be a literal or dynamic value. ```typescript export interface A2uiVideo extends A2uiComponentBase { component: 'Video'; url: DynamicString; } ``` ### component ```typescript component: 'Video'; ``` ### url ```typescript url: DynamicString; ``` # createA2uiFunctionRegistry Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/createA2uiFunctionRegistry ```typescript import { createA2uiFunctionRegistry } from '@threadplane/a2ui'; ``` ## createA2uiFunctionRegistry · overload 1 Creates an A2UI client-side function registry containing the standard basic-catalog functions — `formatString`, `formatNumber`, `formatCurrency`, `formatDate`, `pluralize`, `and`, `or`, `not`, plus the check-rule validators `required`, `regex`, `length`, `numeric`, and `email` — optionally extended or overridden with custom implementations. ```typescript export declare function createA2uiFunctionRegistry(overrides?: Record): A2uiFunctionRegistry; ``` ```ts const registry = createA2uiFunctionRegistry(); resolveDynamic({ call: 'formatCurrency', args: { value: 42, currency: 'USD' } }, {}, undefined, registry); ``` # createA2uiMessageParser Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/createA2uiMessageParser ```typescript import { createA2uiMessageParser } from '@threadplane/a2ui'; ``` ## createA2uiMessageParser · overload 1 Creates a stateful parser for newline-delimited A2UI v0.9 message streams. The parser buffers incomplete lines, skips malformed JSON, and returns only recognized A2UI envelopes: `createSurface`, `updateComponents`, `updateDataModel`, and `deleteSurface`. Unknown envelope keys (e.g. future v1.0 messages) are skipped rather than treated as errors. A missing `version` field defaults to `v0.9`. ```typescript export declare function createA2uiMessageParser(): A2uiMessageParser; ``` ```ts const parser = createA2uiMessageParser(); const messages = parser.push( '{"version":"v0.9","createSurface":{"surfaceId":"s1","catalogId":"basic"}}\n', ); ``` # deleteByPointer Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/deleteByPointer ```typescript import { deleteByPointer } from '@threadplane/a2ui'; ``` ## deleteByPointer · overload 1 Returns a new model with the key at `pointer` removed. Empty string and `/` clear the whole model. Missing parent paths leave the input model unchanged. ```typescript export declare function deleteByPointer(model: Record, pointer: string): Record; ``` ```ts const next = deleteByPointer({ user: { name: 'Ada' } }, '/user/name'); ``` # DynamicBoolean Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/DynamicBoolean ```typescript import type { DynamicBoolean } from '@threadplane/a2ui'; ``` ## DynamicBoolean Boolean literal, data-model path reference, or client-side function call. ```typescript export type DynamicBoolean = boolean | A2uiPathRef | A2uiFunctionCall; ``` # DynamicNumber Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/DynamicNumber ```typescript import type { DynamicNumber } from '@threadplane/a2ui'; ``` ## DynamicNumber Numeric literal, data-model path reference, or client-side function call. ```typescript export type DynamicNumber = number | A2uiPathRef | A2uiFunctionCall; ``` # DynamicString Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/DynamicString ```typescript import type { DynamicString } from '@threadplane/a2ui'; ``` ## DynamicString String literal, data-model path reference, or client-side function call. ```typescript export type DynamicString = string | A2uiPathRef | A2uiFunctionCall; ``` # DynamicStringList Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/DynamicStringList ```typescript import type { DynamicStringList } from '@threadplane/a2ui'; ``` ## DynamicStringList String-list literal, data-model path reference, or client-side function call. ```typescript export type DynamicStringList = string[] | A2uiPathRef | A2uiFunctionCall; ``` # DynamicValue Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/DynamicValue ```typescript import type { DynamicValue } from '@threadplane/a2ui'; ``` ## DynamicValue Any dynamic value position where the concrete type is component-defined. ```typescript export type DynamicValue = unknown; ``` # getByPointer Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/getByPointer ```typescript import { getByPointer } from '@threadplane/a2ui'; ``` ## getByPointer · overload 1 Reads a value from a model using the package's simple slash-separated pointer syntax. Empty string and `/` target the root. Segments are not RFC 6901-unescaped; normalize keys before using pointers that would require `~0` or `~1`. ```typescript export declare function getByPointer(model: Record, pointer: string): unknown; ``` ```ts getByPointer({ user: { name: 'Ada' } }, '/user/name'); // 'Ada' ``` # isFunctionCall Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/isFunctionCall ```typescript import { isFunctionCall } from '@threadplane/a2ui'; ``` ## isFunctionCall · overload 1 Returns true when `value` is an A2UI client-side function call. ```typescript export declare function isFunctionCall(value: unknown): value is { call: string; args?: Record; }; ``` # isPathRef Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/isPathRef ```typescript import { isPathRef } from '@threadplane/a2ui'; ``` ## isPathRef · overload 1 Returns true when `value` is an A2UI dynamic path reference. ```typescript export declare function isPathRef(value: unknown): value is { path: string; }; ``` # resolveDynamic Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/resolveDynamic ```typescript import { resolveDynamic } from '@threadplane/a2ui'; ``` ## resolveDynamic · overload 1 Resolves an A2UI v0.9 dynamic value against a client data model. Bare literals (strings, numbers, booleans) pass through unchanged, `{ path }` references read from the model by JSON-pointer path, arrays resolve element-wise, and client-side function calls (`{ call }`) execute through the provided function registry — argument values resolve recursively, so args may themselves be bindings or nested calls. Without a registry (or for unknown function names) calls resolve to `undefined`. Unrecognized plain objects pass through unchanged. ```typescript export declare function resolveDynamic(value: unknown, model: Record, scope?: A2uiScope, registry?: A2uiFunctionRegistry): unknown; ``` ```ts const model = { customer: { name: 'Ada' } }; resolveDynamic({ path: '/customer/name' }, model); // 'Ada' resolveDynamic('Checkout', model); // 'Checkout' resolveDynamic( { call: 'formatString', args: { value: 'Hi ${/customer/name}' } }, model, undefined, createA2uiFunctionRegistry(), ); // 'Hi Ada' ``` # setByPointer Package: `@threadplane/a2ui` · 0.3.7 Reference: /docs/api/a2ui/setByPointer ```typescript import { setByPointer } from '@threadplane/a2ui'; ``` ## setByPointer · overload 1 Returns a new model with `value` written at `pointer`. The input model is not mutated. Missing intermediate objects are created. ```typescript export declare function setByPointer(model: Record, pointer: string, value: unknown): Record; ``` ```ts const next = setByPointer({}, '/user/name', 'Ada'); ``` ### @threadplane/ag-ui # AgentConfig Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/AgentConfig ```typescript import type { AgentConfig } from '@threadplane/ag-ui'; ``` ## AgentConfig Connection options for the AG-UI agent provider, passed to [provideAgent](/docs/api/ag-ui/provideAgent#member-provideAgent-1iabkey). Mirrors the underlying `HttpAgent` config (`@ag-ui/client`) plus an optional telemetry sink. ```typescript export interface AgentConfig { agentId?: string; headers?: Record; interruptTransport?: ToAgentOptions['interruptTransport']; persistence?: ToAgentOptions['persistence']; replay?: ToAgentOptions['replay']; telemetry?: AgentRuntimeTelemetrySink | false; threadId?: string; url: string; } ``` ### agentId Agent identifier, when the endpoint serves more than one agent. ```typescript agentId?: string; ``` ### headers Extra HTTP headers sent with every request (e.g. auth tokens). ```typescript headers?: Record; ``` ### interruptTransport Explicit compatibility wire profile; auto prefers protocol-native outcomes. ```typescript interruptTransport?: ToAgentOptions['interruptTransport']; ``` ### persistence Optional application-owned durable thread storage and reconciliation. ```typescript persistence?: ToAgentOptions['persistence']; ``` ### replay Optional source of the thread's AG-UI events, replayed on hydration so a reopened thread comes back as the live view showed it. Called only when `threadId` is configured — a fresh conversation has nothing to replay. `httpReplay()` covers the common HTTP shape. ```typescript replay?: ToAgentOptions['replay']; ``` ### telemetry Omit to enable automatic development-only collection. Set `false` to disable. An app-owned sink replaces the automatic destination and receives the existing runtime lifecycle callbacks. ```typescript telemetry?: AgentRuntimeTelemetrySink | false; ``` ### threadId Thread to connect to on start; omit to begin a fresh conversation. ```typescript threadId?: string; ``` ### url Endpoint URL of the AG-UI HTTP agent (e.g. `'http://localhost:8000/agent'`). Required. ```typescript url: string; ``` # AgUiAgent Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/AgUiAgent ```typescript import type { AgUiAgent } from '@threadplane/ag-ui'; ``` ## AgUiAgent The neutral Agent contract, widened with the AG-UI adapter's `customEvents` signal (the chat composition feature-detects it to enable live a2ui streaming), the browser client-tools capability, and concrete ACTIVITY-backed `subagents`. Mirrors langgraph's LangGraphAgent extension where the protocol surfaces overlap. ```typescript export interface AgUiAgent> extends Agent { clientTools: ClientToolsCapability; customEvents: Signal; dispose(): void; interruptSession: Signal; rawEvents$: Observable; ready: Promise; reconcileInterrupt(): Promise; subagents: Signal>; submit(input: AgentSubmitInput, opts?: AgUiSubmitOptions): Promise; } ``` ### clientTools ```typescript clientTools: ClientToolsCapability; ``` ### customEvents ```typescript customEvents: Signal; ``` ### dispose · overload 1 Unsubscribe and stop local work. Does not cancel backend checkpoints. ```typescript dispose(): void; ``` ### interruptSession Full interrupt batch and its request ownership phase. ```typescript interruptSession: Signal; ``` ### rawEvents$ Every AG-UI protocol event the adapter reduced into its signals, in arrival order, for hosts that fold the full stream into their own view model. Emits exactly the events the signals saw: events from a superseded run, events after a run was stopped or failed, and events after a terminal outcome are suppressed here too. Each event is emitted after the signals are updated for it. A run's terminal `RUN_ERROR` is always emitted once, after `error()` and `status()` settle. Where `provideAgent()` protects operation errors, the emitted `RUN_ERROR` honours the same protection as `error()`: it carries only the generic message, with the server's message, code and payload dropped. Hot and unbuffered — subscribe before submitting to see a whole run. Completes on `dispose()`. Hydration from a configured `replay` source emits every replayed event, in order, once the whole replay has been folded into the signals; subscribe before awaiting `ready` to see them. Hydration from `persistence` restores a committed snapshot rather than replaying protocol events, so nothing is emitted for it; read the hydrated `messages()` and `state()` instead. ```typescript rawEvents$: Observable; ``` ### ready Resolves after replayed or persisted thread state is hydrated; actions wait for it. ```typescript ready: Promise; ``` ### reconcileInterrupt · overload 1 Recover an uncertain attempt using the configured authoritative reconciler, adopting whatever it reports — including an `acknowledged` answer that only proves the resume was started. The imperative escape hatch; prefer the base contract's `checkStatus` for the control offered to a user when `error().recovery === 'check'`, which settles only on a conclusive answer. ```typescript reconcileInterrupt(): Promise; ``` ### subagents Subagent activities (activityType==='subagent') projected to the neutral Subagent contract, keyed by messageId. Narrows the base Agent's optional `subagents?` to a concrete signal for AG-UI consumers. ```typescript subagents: Signal>; ``` ### submit · overload 1 ```typescript submit(input: AgentSubmitInput, opts?: AgUiSubmitOptions): Promise; ``` # AgUiFakeAgentConfig Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/AgUiFakeAgentConfig ```typescript import type { AgUiFakeAgentConfig } from '@threadplane/ag-ui'; ``` ## AgUiFakeAgentConfig Config accepted by [provideFakeAgent](/docs/api/ag-ui/provideFakeAgent): the shared `FakeAgentConfig` (`tokens`, `reasoningTokens`, `delayMs`) plus the AG-UI-only `script`, which replaces the canned token reply with raw AG-UI events. ```typescript export interface AgUiFakeAgentConfig extends FakeAgentConfig { script?: FakeAgentScript; } ``` ### script Deterministic event branches — see [FakeAgentScript](/docs/api/ag-ui/FakeAgentScript). ```typescript script?: FakeAgentScript; ``` # AgUiInterruptPersistence Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/AgUiInterruptPersistence ```typescript import type { AgUiInterruptPersistence } from '@threadplane/ag-ui'; ``` ## AgUiInterruptPersistence Application-owned interrupt storage using revision-based writes and optional authoritative recovery reconciliation. ```typescript export interface AgUiInterruptPersistence { namespace: string; reconcile?: (record: AgUiThreadRecord) => Promise<{ status: 'unknown'; } | { status: 'pending' | 'acknowledged' | 'completed'; committed: ThreadSnapshot; session: InterruptSessionSnapshot; }>; store: { load(key: string): Promise; compareAndSwap(key: string, expectedRevision: number | null, next: AgUiThreadRecord): Promise; }; } ``` ### namespace ```typescript namespace: string; ``` ### reconcile ```typescript reconcile?: (record: AgUiThreadRecord) => Promise<{ status: 'unknown'; } | { status: 'pending' | 'acknowledged' | 'completed'; committed: ThreadSnapshot; session: InterruptSessionSnapshot; }>; ``` ### store ```typescript store: { load(key: string): Promise; compareAndSwap(key: string, expectedRevision: number | null, next: AgUiThreadRecord): Promise; }; ``` # AgUiReplaySource Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/AgUiReplaySource ```typescript import type { AgUiReplaySource } from '@threadplane/ag-ui'; ``` ## AgUiReplaySource Loads a thread's AG-UI protocol events from the server, in the order a live stream delivered them, so the adapter can rebuild the thread exactly as the live view showed it. Return the events as a Promise of an array or as an Observable that completes. Resolve to an empty array when the server has nothing for the thread; reject (or error) for any other failure. `signal` aborts when the adapter is disposed; honour it to cancel the request. ```typescript export type AgUiReplaySource = (threadId: string, signal: AbortSignal) => Promise | Observable; ``` # AgUiSubmitOptions Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/AgUiSubmitOptions ```typescript import type { AgUiSubmitOptions } from '@threadplane/ag-ui'; ``` ## AgUiSubmitOptions Adapter-specific submit guards in addition to cancellation. ```typescript export interface AgUiSubmitOptions extends AgentSubmitOptions { interruptGeneration?: number; } ``` ### interruptGeneration Generation captured when rendering the interrupt decision; rejects stale controls. ```typescript interruptGeneration?: number; ``` # AgUiThreadRecord Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/AgUiThreadRecord ```typescript import type { AgUiThreadRecord } from '@threadplane/ag-ui'; ``` ## AgUiThreadRecord Versioned persisted thread snapshot and interrupt session, scoped by namespace and thread ID with a compare-and-swap revision. ```typescript export interface AgUiThreadRecord { committed: ThreadSnapshot; namespace: string; resumeInput?: ThreadSnapshot; revision: number; session: InterruptSessionSnapshot; threadId: string; version: 1; } ``` ### committed ```typescript committed: ThreadSnapshot; ``` ### namespace ```typescript namespace: string; ``` ### resumeInput ```typescript resumeInput?: ThreadSnapshot; ``` ### revision ```typescript revision: number; ``` ### session ```typescript session: InterruptSessionSnapshot; ``` ### threadId ```typescript threadId: string; ``` ### version ```typescript version: 1; ``` # bridgeCitationsState Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/bridgeCitationsState ```typescript import { bridgeCitationsState } from '@threadplane/ag-ui'; ``` ## bridgeCitationsState · overload 1 Attach per-message [Citation](/docs/api/chat/Citation)s carried in an AG-UI thread's `state` (`state.citations`, keyed by message id) onto the corresponding assistant [Message](/docs/api/chat/Message)s — for advanced consumers wiring citations from STATE events into the neutral chat contract. ```typescript export declare function bridgeCitationsState(thread: ThreadStateLike, messages: Message[]): Message[]; ``` - **thread**: The thread-state container holding `state.citations`. - **messages**: The messages to enrich. **Returns:** A new array where matching messages gain their `citations`; messages without citations are returned unchanged. ```ts const enriched = bridgeCitationsState(threadState, agent.messages()); ``` # CustomStreamEvent Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/CustomStreamEvent ```typescript import type { CustomStreamEvent } from '@threadplane/ag-ui'; ``` ## CustomStreamEvent A custom event surfaced to consumers via the agent's `customEvents` signal. Mirrors the LangGraph adapter's CustomStreamEvent shape so the chat a2ui partial-args bridge consumes both transports identically. ```typescript export interface CustomStreamEvent { data: unknown; name: string; } ``` ### data Arbitrary payload from the backend (JSON-string values are parsed). ```typescript data: unknown; ``` ### name Event name set by the backend (e.g. 'a2ui-partial', 'state_update'). ```typescript name: string; ``` # FakeAgent Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/FakeAgent ```typescript import { FakeAgent } from '@threadplane/ag-ui'; ``` ## FakeAgent In-process AG-UI agent that emits a canned streaming response. Use for offline demos and tests where a real backend isn't available. Echoes a fixed assistant reply token-by-token with realistic timing. NOT for production use. ```typescript export declare class FakeAgent extends AbstractAgent { constructor(opts?: { tokens?: string[]; reasoningTokens?: string[]; delayMs?: number; script?: FakeAgentScript; }); run(input: RunAgentInput): Observable; } ``` ### Constructor · overload 1 Constructs a new instance of the `FakeAgent` class ```typescript constructor(opts?: { tokens?: string[]; reasoningTokens?: string[]; delayMs?: number; script?: FakeAgentScript; }); ``` ### run · overload 1 ```typescript run(input: RunAgentInput): Observable; ``` # FakeAgentScript Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/FakeAgentScript ```typescript import type { FakeAgentScript } from '@threadplane/ag-ui'; ``` ## FakeAgentScript Deterministic event branches for [FakeAgent](/docs/api/ag-ui/FakeAgent), reachable through the constructor and through `provideFakeAgent({ script })`. Each branch supplies a raw AG-UI event sequence — tool calls, state snapshots, custom events, anything the protocol defines. `when: 'initial'` matches a turn whose history carries no tool result; `{ toolMessageFor: id }` matches the follow-up turn whose history carries a tool result for that tool call id. The first matching branch wins, and its `events` are wrapped in `RUN_STARTED` / `RUN_FINISHED`. When no branch matches, the canned token reply is streamed instead. ```typescript export type FakeAgentScript = readonly { when: 'initial' | { toolMessageFor: string; }; events: readonly BaseEvent[]; }[]; ``` # httpReplay Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/httpReplay ```typescript import { httpReplay } from '@threadplane/ag-ui'; ``` ## httpReplay · overload 1 A replay source for the common HTTP shape: `GET url(threadId)` answering JSON `{ events: BaseEvent[] }`. A `404` resolves to no events, so the adapter falls back to `persistence` (or starts empty). Any other non-2xx status, a body without an `events` array, or an entry without a string `type` rejects; the adapter treats that as a failed replay and falls back the same way. ```typescript export declare function httpReplay(options: HttpReplayOptions): AgUiReplaySource; ``` ```ts provideAgent({ url: '/api/agent', threadId, replay: httpReplay({ url: (id) => `/api/threads/${encodeURIComponent(id)}/events` }), }); ``` # HttpReplayOptions Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/HttpReplayOptions ```typescript import type { HttpReplayOptions } from '@threadplane/ag-ui'; ``` ## HttpReplayOptions Options for [httpReplay](/docs/api/ag-ui/httpReplay). ```typescript export interface HttpReplayOptions { fetch?: typeof fetch; headers?: Record; url: (threadId: string) => string; } ``` ### fetch Fetch implementation. Defaults to the global `fetch`. ```typescript fetch?: typeof fetch; ``` ### headers Extra request headers, e.g. auth tokens. ```typescript headers?: Record; ``` ### url Builds the GET URL for a thread. ```typescript url: (threadId: string) => string; ``` ```ts (id) => `/api/threads/${id}/events` ``` # injectAgent Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/injectAgent ```typescript import { injectAgent } from '@threadplane/ag-ui'; ``` ## injectAgent · overload 1 Injects the AG-UI agent from Angular's dependency injection container. Use this in components or services provided via `provideAgent()` (or `provideFakeAgent()`). Returns an `AgUiAgent` — the runtime-neutral `Agent` contract plus the AG-UI-specific `customEvents` signal — so `customEvents` is reachable directly, without casting. **Typed state via AgentRef.** Pass the same ref that was supplied to `provideAgent(ref, …)` to carry the state type through DI without repeating the generic at every call site. The no-arg form defaults to `AgUiAgent>`. ```typescript export declare function injectAgent(): AgUiAgent; ``` Typed state via AgentRef ```ts const agent = injectAgent(TRIP); // AgUiAgent ``` ## injectAgent · overload 2 ```typescript export declare function injectAgent(ref: AgentRef): AgUiAgent; ``` # InterruptSessionPhase Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/InterruptSessionPhase ```typescript import type { InterruptSessionPhase } from '@threadplane/ag-ui'; ``` ## InterruptSessionPhase Interrupt batch lifecycle, including resume ownership, dispatch, acknowledgment, and recovery states. ```typescript export type InterruptSessionPhase = 'none' | 'collecting' | 'pending' | 'claimed' | 'resuming' | 'acknowledged' | 'uncertain' | 'recovery-required'; ``` # InterruptSessionSnapshot Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/InterruptSessionSnapshot ```typescript import type { InterruptSessionSnapshot } from '@threadplane/ag-ui'; ``` ## InterruptSessionSnapshot Interrupt batch state containing its phase, generation, native or legacy interrupts, and any retained resume attempt. ```typescript export interface InterruptSessionSnapshot { attempt?: ResumeAttempt; generation: number; interrupts: Interrupt[]; legacy?: AgentInterrupt; phase: InterruptSessionPhase; runId?: string; } ``` ### attempt ```typescript attempt?: ResumeAttempt; ``` ### generation ```typescript generation: number; ``` ### interrupts ```typescript interrupts: Interrupt[]; ``` ### legacy ```typescript legacy?: AgentInterrupt; ``` ### phase ```typescript phase: InterruptSessionPhase; ``` ### runId ```typescript runId?: string; ``` # InterruptTransport Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/InterruptTransport ```typescript import type { InterruptTransport } from '@threadplane/ag-ui'; ``` ## InterruptTransport Resume encoding profile; auto prefers native protocol interrupts, then selects Mastra or legacy command encoding. ```typescript export type InterruptTransport = 'auto' | 'protocol' | 'legacy-command' | 'mastra-command'; ``` # provideAgent Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/provideAgent ```typescript import { provideAgent } from '@threadplane/ag-ui'; ``` ## provideAgent · overload 1 Provides an Agent instance wired through HttpAgent and toAgent. Constructs an HttpAgent from config and wraps it in the runtime-neutral Agent contract via toAgent(). Returns a provider array suitable for bootstrapApplication or TestBed.configureTestingModule(). **Static vs factory config.** Pass a plain `AgentConfig` object when the config is known up front. Pass a `() => AgentConfig` factory when the config depends on runtime/DI state — the factory runs inside an Angular injection context, so it may call `inject()` to read services or route params. **Typed state via AgentRef.** Pass a typed ref as the first argument to flow the state shape from `provideAgent` to `injectAgent` without repeating the generic at every call site. **Several agents at one injector level.** Each `provideAgent(ref, …)` call builds its own agent, so two (or more) refs may be provided side by side in a single `providers` array and `injectAgent(refA)` / `injectAgent(refB)` return distinct agents. The ref-less `injectAgent()` resolves a single shared token, which can only point at one of them: when more than one ref is provided at the same level the **last** call wins. Always inject by ref when an injector provides more than one agent. Development builds emit a one-time `console.warn` naming the refs involved when an injector level registers more than one, so the silent last-ref-wins aliasing is visible during development. ```typescript export declare function provideAgent>(ref: AgentRef, configOrFactory: AgentConfig | (() => AgentConfig)): Provider[]; ``` Typed state via AgentRef ```ts interface TripState { day: number; places: string[]; } export const TRIP = createAgentRef('trip'); // app.config.ts: providers: [provideAgent(TRIP, { url: 'http://localhost:8000/agent' })] // component: const agent = injectAgent(TRIP); // AgUiAgent ``` ## provideAgent · overload 2 ```typescript export declare function provideAgent(configOrFactory: AgentConfig | (() => AgentConfig)): Provider[]; ``` # provideFakeAgent Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/provideFakeAgent ```typescript import { provideFakeAgent } from '@threadplane/ag-ui'; ``` ## provideFakeAgent · overload 1 Registers an in-process FakeAgent under AGENT. Use for offline demos and development. Drop-in replacement for `provideAgent({ url })` when no real backend is available. Pass `script` to stream exact AG-UI events instead of the canned token reply — the adapter reduces them into `toolCalls()`, `state()`, `customEvents()`, and `interrupt()` exactly as it would real wire events, and emits each one on `rawEvents$`. ```typescript export declare function provideFakeAgent(config?: AgUiFakeAgentConfig): Provider[]; ``` ```ts TestBed.configureTestingModule({ providers: [provideFakeAgent({ tokens: ['Hello from the fake agent'] })], }); ``` Scripted tool call ```ts TestBed.configureTestingModule({ providers: [provideFakeAgent({ delayMs: 0, script: [{ when: 'initial', events: [ { type: EventType.TOOL_CALL_START, toolCallId: 't1', toolCallName: 'get_weather' }, { type: EventType.TOOL_CALL_ARGS, toolCallId: 't1', delta: '{"city":"SF"}' }, { type: EventType.TOOL_CALL_END, toolCallId: 't1' }, ] as BaseEvent[], }], })], }); ``` # ResumeAttempt Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/ResumeAttempt ```typescript import type { ResumeAttempt } from '@threadplane/ag-ui'; ``` ## ResumeAttempt Retained resume decision and encoded request parameters correlated to an attempt ID, run ID, and interrupt generation. ```typescript export interface ResumeAttempt { generation: number; id: string; input: AgentSubmitInput; parameters: { resume?: ResumeEntry[]; forwardedProps?: Record; }; runId: string; } ``` ### generation ```typescript generation: number; ``` ### id ```typescript id: string; ``` ### input ```typescript input: AgentSubmitInput; ``` ### parameters ```typescript parameters: { resume?: ResumeEntry[]; forwardedProps?: Record; }; ``` ### runId ```typescript runId: string; ``` # ThreadSnapshot Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/ThreadSnapshot ```typescript import type { ThreadSnapshot } from '@threadplane/ag-ui'; ``` ## ThreadSnapshot Serializable protocol state at a confirmed run boundary. ```typescript export interface ThreadSnapshot { messages: Message[]; state: Record; } ``` ### messages ```typescript messages: Message[]; ``` ### state ```typescript state: Record; ``` # toAgent Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/toAgent ```typescript import { toAgent } from '@threadplane/ag-ui'; ``` ## toAgent · overload 1 Wraps an AG-UI AbstractAgent into the runtime-neutral Agent contract. The adapter subscribes to `source.subscribe({ onEvent })` and reduces every event into the produced Agent's signals. submit() optimistically appends the user message to both our signals and the source agent's internal message list, then calls source.runAgent(). stop() calls source.abortRun(). Subscription cleanup: providers dispose the adapter with their injector. Direct callers must call dispose() when they no longer need the adapter. ```typescript export declare function toAgent(source: AbstractAgent, options?: ToAgentOptions): AgUiAgent; ``` ```ts import { HttpAgent } from '@ag-ui/client'; import { toAgent } from '@threadplane/ag-ui'; const agent = toAgent(new HttpAgent({ url: '/api/agent' })); ``` # ToAgentOptions Package: `@threadplane/ag-ui` · 0.3.7 Reference: /docs/api/ag-ui/ToAgentOptions ```typescript import type { ToAgentOptions } from '@threadplane/ag-ui'; ``` ## ToAgentOptions Options for adapting an AG-UI agent, including replay, interrupt persistence and transport, telemetry, and A2UI capabilities. ```typescript export interface ToAgentOptions { a2uiClientCapabilities?: { supportedCatalogIds: string[]; inlineCatalogs?: unknown[]; }; interruptTransport?: InterruptTransport; persistence?: AgUiInterruptPersistence; replay?: AgUiReplaySource; telemetry?: AgentRuntimeTelemetrySink | false; } ``` ### a2uiClientCapabilities A2UI client capabilities (catalog negotiation) to advertise to the agent. When set, they are seeded once into the AG-UI shared state under the `a2ui_client_capabilities` key, so every RunAgentInput.state carries them. Use `@threadplane/chat`'s `a2uiClientCapabilities()` for the renderer's standard value. ```typescript a2uiClientCapabilities?: { supportedCatalogIds: string[]; inlineCatalogs?: unknown[]; }; ``` ### interruptTransport Native outcomes take precedence in auto mode; select a legacy profile explicitly when required. ```typescript interruptTransport?: InterruptTransport; ``` ### persistence Application-owned durable storage. Requires a stable source threadId and scoped namespace. ```typescript persistence?: AgUiInterruptPersistence; ``` ### replay Loads the thread's AG-UI events from the server when the adapter hydrates. The replayed events are folded through the same reducer a live run uses, so messages, tool calls, reasoning, subagent nesting and pending interrupts come back as the live view showed them, and each event is emitted on `rawEvents$`. Replay wins whenever it returns at least one event; an empty result, a failure, or events that cannot be folded fall back to `persistence` (or an empty thread). Failures never reject `ready`. The request is aborted when the adapter is disposed. See `httpReplay()` for the common HTTP shape. ```typescript replay?: AgUiReplaySource; ``` ### telemetry Omit to enable automatic development-only collection. Set `false` to disable. An app-owned sink replaces the automatic destination and receives the existing runtime lifecycle callbacks. ```typescript telemetry?: AgentRuntimeTelemetrySink | false; ``` ### @threadplane/angular # observeAgent Package: `@threadplane/angular` · 0.0.0 **Unpublished development API.** Reference: /docs/api/angular/observeAgent ```typescript import { observeAgent } from '@threadplane/angular'; ``` ## observeAgent · overload 1 Observe an app-owned session in an injection context. Destroying that context releases only this subscription; the app retains session lifetime. ```typescript export declare function observeAgent(session: { getSnapshot(): TSnapshot; subscribe(notify: () => void): () => void; }): Signal; ``` ### @threadplane/angular/chat # TextTranscriptComponent Package: `@threadplane/angular/chat` · 0.0.0 **Unpublished development API.** Reference: /docs/api/angular/chat/TextTranscriptComponent ```typescript import { TextTranscriptComponent } from '@threadplane/angular/chat'; ``` ## TextTranscriptComponent Readonly text rows with IDs unique within this list. Lifetime belongs to the caller. ```typescript export declare class TextTranscriptComponent { readonly label: import("@angular/core").InputSignal; readonly messages: import("@angular/core").InputSignal[]>; } ``` **Angular selector:** `threadplane-text-transcript` - Input `label`: `string` - Input `messages` (required): `readonly Pick[]` ### label ```typescript readonly label: import("@angular/core").InputSignal; ``` ### messages ```typescript readonly messages: import("@angular/core").InputSignal[]>; ``` # ToolObservationComponent Package: `@threadplane/angular/chat` · 0.0.0 **Unpublished development API.** Reference: /docs/api/angular/chat/ToolObservationComponent ```typescript import { ToolObservationComponent } from '@threadplane/angular/chat'; ``` ## ToolObservationComponent Literal observed text. The caller owns tool/result association and formatting. ```typescript export declare class ToolObservationComponent { readonly argumentsText: import("@angular/core").InputSignal; readonly label: import("@angular/core").InputSignal; readonly name: import("@angular/core").InputSignal; readonly resultText: import("@angular/core").InputSignal; } ``` **Angular selector:** `threadplane-tool-observation` - Input `argumentsText` (required): `string` - Input `label`: `string` - Input `name` (required): `string` - Input `resultText`: `string | undefined` ### argumentsText ```typescript readonly argumentsText: import("@angular/core").InputSignal; ``` ### label ```typescript readonly label: import("@angular/core").InputSignal; ``` ### name ```typescript readonly name: import("@angular/core").InputSignal; ``` ### resultText ```typescript readonly resultText: import("@angular/core").InputSignal; ``` ### @threadplane/angular/markdown # MarkdownComponent Package: `@threadplane/angular/markdown` · 0.0.0 **Unpublished development API.** Reference: /docs/api/angular/markdown/MarkdownComponent ```typescript import { MarkdownComponent } from '@threadplane/angular/markdown'; ``` ## MarkdownComponent Renders an owned Markdown snapshot as Angular elements, filtering URLs and displaying raw HTML as text. ```typescript export declare class MarkdownComponent { readonly snapshot: import("@angular/core").InputSignal; } ``` **Angular selector:** `threadplane-markdown` - Input `snapshot` (required): `MarkdownSnapshot` ### snapshot ```typescript readonly snapshot: import("@angular/core").InputSignal; ``` ### @threadplane/chat # A2UI_BASIC_CATALOG_ID Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2UI_BASIC_CATALOG_ID ```typescript import { A2UI_BASIC_CATALOG_ID } from '@threadplane/chat'; ``` ## A2UI_BASIC_CATALOG_ID Catalog id of the standard A2UI basic component catalog. ```typescript A2UI_BASIC_CATALOG_ID = "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json" ``` # A2UI_MIME_TYPE Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2UI_MIME_TYPE ```typescript import { A2UI_MIME_TYPE } from '@threadplane/chat'; ``` ## A2UI_MIME_TYPE MIME type for A2UI payloads, standardized in the v0.9.1 release. ```typescript A2UI_MIME_TYPE = "application/a2ui+json" ``` # A2UI_WIRE_VERSION Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2UI_WIRE_VERSION ```typescript import { A2UI_WIRE_VERSION } from '@threadplane/chat'; ``` ## A2UI_WIRE_VERSION Wire version stamped on every A2UI v0.9-family envelope. ```typescript A2UI_WIRE_VERSION = "v0.9" ``` # A2uiAction Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiAction ```typescript import type { A2uiAction } from '@threadplane/chat'; ``` ## A2uiAction Component action that sends an event to the agent or invokes a local function. ```typescript export type A2uiAction = A2uiEventAction | A2uiFunctionAction; ``` # A2uiActionMessage Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiActionMessage ```typescript import type { A2uiActionMessage } from '@threadplane/chat'; ``` ## A2uiActionMessage Versioned client-to-agent event with its surface, source component, timestamp, and optional context. ```typescript export interface A2uiActionMessage { action: { name: string; surfaceId: string; sourceComponentId: string; timestamp: string; context?: Record; label?: string; }; metadata?: { a2uiClientDataModel?: A2uiClientDataModel; }; version: string; } ``` ### action ```typescript action: { name: string; surfaceId: string; sourceComponentId: string; timestamp: string; context?: Record; label?: string; }; ``` ### metadata ```typescript metadata?: { a2uiClientDataModel?: A2uiClientDataModel; }; ``` ### version ```typescript version: string; ``` # A2uiAudioPlayerComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiAudioPlayerComponent ```typescript import { A2uiAudioPlayerComponent } from '@threadplane/chat'; ``` ## A2uiAudioPlayerComponent Renders an A2UI audio URL with native playback controls and an optional description. ```typescript export declare class A2uiAudioPlayerComponent { readonly bindings: import("@angular/core").InputSignal>; readonly childKeys: import("@angular/core").InputSignal; readonly description: import("@angular/core").InputSignal; readonly emit: import("@angular/core").InputSignal<(event: string) => void>; readonly loading: import("@angular/core").InputSignal; readonly spec: import("@angular/core").InputSignal; readonly url: import("@angular/core").InputSignal; } ``` **Angular selector:** `a2ui-audio-player` - Input `bindings`: `Record` - Input `childKeys`: `string[]` - Input `description`: `string` - Input `emit`: `(event: string) => void` - Input `loading`: `boolean` - Input `spec`: `Spec | undefined` - Input `url`: `string` ### bindings ```typescript readonly bindings: import("@angular/core").InputSignal>; ``` ### childKeys ```typescript readonly childKeys: import("@angular/core").InputSignal; ``` ### description v0.9 prop: short description / title rendered above the player. ```typescript readonly description: import("@angular/core").InputSignal; ``` ### emit ```typescript readonly emit: import("@angular/core").InputSignal<(event: string) => void>; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### spec ```typescript readonly spec: import("@angular/core").InputSignal; ``` ### url ```typescript readonly url: import("@angular/core").InputSignal; ``` # a2uiBasicCatalog Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/a2uiBasicCatalog ```typescript import { a2uiBasicCatalog } from '@threadplane/chat'; ``` ## a2uiBasicCatalog · overload 1 Build the built-in A2UI component catalog — a [ViewRegistry](/docs/api/chat/ViewRegistry) mapping the standard A2UI element types (Card, Button, TextField, Image, AudioPlayer, Video, …) to their Angular renderers. Spread it into `provideViews` (with any of your own views) so an agent's A2UI surface specs render. ```typescript export declare function a2uiBasicCatalog(): ViewRegistry; ``` **Returns:** A [ViewRegistry](/docs/api/chat/ViewRegistry) of the standard A2UI components. ```ts providers: [provideViews({ ...a2uiBasicCatalog(), MyWidget: MyWidgetComponent })] ``` # A2uiButtonComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiButtonComponent ```typescript import { A2uiButtonComponent } from '@threadplane/chat'; ``` ## A2uiButtonComponent Renders A2UI child content as a styled button and forwards clicks to the render event handler. ```typescript export declare class A2uiButtonComponent { readonly bindings: import("@angular/core").InputSignal>; readonly childKeys: import("@angular/core").InputSignal; readonly disabled: import("@angular/core").InputSignal; readonly emit: import("@angular/core").InputSignal<(event: string) => void>; handleClick(): void; readonly loading: import("@angular/core").InputSignal; readonly spec: import("@angular/core").InputSignal; readonly variant: import("@angular/core").InputSignal; } ``` **Angular selector:** `a2ui-button` - Input `bindings`: `Record` - Input `childKeys`: `string[]` - Input `disabled`: `boolean` - Input `emit`: `(event: string) => void` - Input `loading`: `boolean` - Input `spec` (required): `Spec` - Input `variant`: `ButtonVariant` ### bindings ```typescript readonly bindings: import("@angular/core").InputSignal>; ``` ### childKeys v0.9: child Text component is rendered inside the button via childKeys. ```typescript readonly childKeys: import("@angular/core").InputSignal; ``` ### disabled ```typescript readonly disabled: import("@angular/core").InputSignal; ``` ### emit ```typescript readonly emit: import("@angular/core").InputSignal<(event: string) => void>; ``` ### handleClick · overload 1 ```typescript handleClick(): void; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### spec ```typescript readonly spec: import("@angular/core").InputSignal; ``` ### variant v0.9 prop: visual style (default 'default'). ```typescript readonly variant: import("@angular/core").InputSignal; ``` # A2uiCardComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiCardComponent ```typescript import { A2uiCardComponent } from '@threadplane/chat'; ``` ## A2uiCardComponent Renders A2UI child elements inside a padded card. ```typescript export declare class A2uiCardComponent { readonly bindings: import("@angular/core").InputSignal>; readonly childKeys: import("@angular/core").InputSignal; readonly emit: import("@angular/core").InputSignal<(event: string) => void>; readonly loading: import("@angular/core").InputSignal; readonly spec: import("@angular/core").InputSignal; } ``` **Angular selector:** `a2ui-card` - Input `bindings`: `Record` - Input `childKeys`: `string[]` - Input `emit`: `(event: string) => void` - Input `loading`: `boolean` - Input `spec` (required): `Spec` ### bindings ```typescript readonly bindings: import("@angular/core").InputSignal>; ``` ### childKeys v1: a single child key, delivered via childKeys[0] from the render framework. ```typescript readonly childKeys: import("@angular/core").InputSignal; ``` ### emit ```typescript readonly emit: import("@angular/core").InputSignal<(event: string) => void>; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### spec ```typescript readonly spec: import("@angular/core").InputSignal; ``` # A2uiCatalogComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiCatalogComponent ```typescript import type { A2uiCatalogComponent } from '@threadplane/chat'; ``` ## A2uiCatalogComponent Union of the basic-catalog component shapes. ```typescript export type A2uiCatalogComponent = A2uiText | A2uiImage | A2uiIcon | A2uiVideo | A2uiAudioPlayer | A2uiRow | A2uiColumn | A2uiList | A2uiCard | A2uiTabs | A2uiModal | A2uiDivider | A2uiButton | A2uiCheckBox | A2uiTextField | A2uiDateTimeInput | A2uiChoicePicker | A2uiSlider; ``` # A2uiCheck Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiCheck ```typescript import type { A2uiCheck } from '@threadplane/chat'; ``` ## A2uiCheck Client-side validation condition paired with the message shown on failure. ```typescript export interface A2uiCheck { condition: DynamicValue; message: string; } ``` ### condition A DynamicBoolean — typically a validator function call (`required`, `regex`, `length`, `numeric`, `email`) or a logic combinator. The rule passes when the condition resolves to `true`. ```typescript condition: DynamicValue; ``` ### message Error message displayed when the check fails. ```typescript message: string; ``` # A2uiCheckBoxComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiCheckBoxComponent ```typescript import { A2uiCheckBoxComponent } from '@threadplane/chat'; ``` ## A2uiCheckBoxComponent Renders an A2UI checkbox that writes its checked value to the bound render state. ```typescript export declare class A2uiCheckBoxComponent { readonly _bindings: import("@angular/core").InputSignal>; readonly bindings: import("@angular/core").InputSignal>; readonly childKeys: import("@angular/core").InputSignal; readonly errorText: import("@angular/core").InputSignal; readonly label: import("@angular/core").InputSignal; readonly loading: import("@angular/core").InputSignal; onChange(event: Event): void; readonly spec: import("@angular/core").InputSignal; readonly value: import("@angular/core").InputSignal; } ``` **Angular selector:** `a2ui-check-box` - Input `_bindings`: `Record` - Input `bindings`: `Record` - Input `childKeys`: `string[]` - Input `errorText`: `string` - Input `label`: `string` - Input `loading`: `boolean` - Input `spec`: `Spec | undefined` - Input `value`: `boolean` ### _bindings ```typescript readonly _bindings: import("@angular/core").InputSignal>; ``` ### bindings ```typescript readonly bindings: import("@angular/core").InputSignal>; ``` ### childKeys ```typescript readonly childKeys: import("@angular/core").InputSignal; ``` ### errorText Live validation message written by the surface's check gate (bound to /_a2uiChecks/); empty when valid. ```typescript readonly errorText: import("@angular/core").InputSignal; ``` ### label ```typescript readonly label: import("@angular/core").InputSignal; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### onChange · overload 1 ```typescript onChange(event: Event): void; ``` ### spec ```typescript readonly spec: import("@angular/core").InputSignal; ``` ### value v0.9 prop: boolean checked state. ```typescript readonly value: import("@angular/core").InputSignal; ``` # A2uiChildren Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiChildren ```typescript import type { A2uiChildren } from '@threadplane/chat'; ``` ## A2uiChildren Static child-id list, or a template stamped per element of a data-model list. ```typescript export type A2uiChildren = string[] | { path: string; componentId: string; }; ``` # A2uiChoicePickerComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiChoicePickerComponent ```typescript import { A2uiChoicePickerComponent } from '@threadplane/chat'; ``` ## A2uiChoicePickerComponent Renders single or multiple A2UI choices as chips or selection rows, with optional filtering. ```typescript export declare class A2uiChoicePickerComponent { readonly _bindings: import("@angular/core").InputSignal>; readonly bindings: import("@angular/core").InputSignal>; readonly childKeys: import("@angular/core").InputSignal; readonly displayStyle: import("@angular/core").InputSignal<"checkbox" | "chips">; readonly errorText: import("@angular/core").InputSignal; readonly filterable: import("@angular/core").InputSignal; readonly label: import("@angular/core").InputSignal; readonly loading: import("@angular/core").InputSignal; onCheckChange(value: string, event: Event): void; onChipToggle(value: string): void; onFilterInput(event: Event): void; readonly options: import("@angular/core").InputSignal; readonly spec: import("@angular/core").InputSignal; readonly value: import("@angular/core").InputSignal; readonly variant: import("@angular/core").InputSignal<"mutuallyExclusive" | "multipleSelection">; } ``` **Angular selector:** `a2ui-choice-picker` - Input `_bindings`: `Record` - Input `bindings`: `Record` - Input `childKeys`: `string[]` - Input `displayStyle`: `"checkbox" | "chips"` - Input `errorText`: `string` - Input `filterable`: `boolean` - Input `label`: `string` - Input `loading`: `boolean` - Input `options`: `ResolvedOption[]` - Input `spec`: `Spec | undefined` - Input `value`: `string | string[] | undefined` - Input `variant`: `"mutuallyExclusive" | "multipleSelection"` ### _bindings ```typescript readonly _bindings: import("@angular/core").InputSignal>; ``` ### bindings ```typescript readonly bindings: import("@angular/core").InputSignal>; ``` ### childKeys ```typescript readonly childKeys: import("@angular/core").InputSignal; ``` ### displayStyle v0.9 prop: render as 'checkbox' rows (default) or 'chips'. ```typescript readonly displayStyle: import("@angular/core").InputSignal<"checkbox" | "chips">; ``` ### errorText Live validation message written by the surface's check gate (bound to /_a2uiChecks/); empty when valid. ```typescript readonly errorText: import("@angular/core").InputSignal; ``` ### filterable v0.9 prop: when true, show a client-side option filter input. ```typescript readonly filterable: import("@angular/core").InputSignal; ``` ### label ```typescript readonly label: import("@angular/core").InputSignal; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### onCheckChange · overload 1 ```typescript onCheckChange(value: string, event: Event): void; ``` ### onChipToggle · overload 1 ```typescript onChipToggle(value: string): void; ``` ### onFilterInput · overload 1 ```typescript onFilterInput(event: Event): void; ``` ### options Resolved options with plain string labels (surface-to-spec resolves DynamicString). ```typescript readonly options: import("@angular/core").InputSignal; ``` ### spec ```typescript readonly spec: import("@angular/core").InputSignal; ``` ### value v0.9 prop: current selection (string[]). Normalized in `valueArray` because LLMs sometimes seed the data model with a scalar (e.g. `"5"`) instead of an array (`["5"]`); we coerce so .includes() works either way. ```typescript readonly value: import("@angular/core").InputSignal; ``` ### variant v0.9 prop: 'mutuallyExclusive' (single-select, default) or 'multipleSelection'. ```typescript readonly variant: import("@angular/core").InputSignal<"mutuallyExclusive" | "multipleSelection">; ``` # a2uiClientCapabilities Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/a2uiClientCapabilities ```typescript import { a2uiClientCapabilities } from '@threadplane/chat'; ``` ## a2uiClientCapabilities · overload 1 The A2UI client capabilities this renderer supports — the typed `a2uiClientCapabilities` metadata a host attaches to agent requests so the agent knows which component catalogs it may target (catalog negotiation, A2UI v0.9 transport metadata). ```typescript export declare function a2uiClientCapabilities(): A2uiClientCapabilities; ``` ```ts const metadata = { a2uiClientCapabilities: a2uiClientCapabilities() }; ``` # A2uiClientCapabilities Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiClientCapabilities ```typescript import type { A2uiClientCapabilities } from '@threadplane/chat'; ``` ## A2uiClientCapabilities Catalog IDs and optional inline catalog definitions advertised by the client. ```typescript export interface A2uiClientCapabilities { inlineCatalogs?: unknown[]; supportedCatalogIds: string[]; } ``` ### inlineCatalogs ```typescript inlineCatalogs?: unknown[]; ``` ### supportedCatalogIds ```typescript supportedCatalogIds: string[]; ``` # A2uiClientDataModel Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiClientDataModel ```typescript import type { A2uiClientDataModel } from '@threadplane/chat'; ``` ## A2uiClientDataModel Surface-ID keyed data models attached to outbound messages when surface data-model sharing is enabled. ```typescript export interface A2uiClientDataModel { surfaces: Record>; } ``` ### surfaces ```typescript surfaces: Record>; ``` # A2uiColumnComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiColumnComponent ```typescript import { A2uiColumnComponent } from '@threadplane/chat'; ``` ## A2uiColumnComponent Arranges A2UI child elements vertically with configurable alignment, distribution, and spacing. ```typescript export declare class A2uiColumnComponent { readonly align: import("@angular/core").InputSignal; readonly bindings: import("@angular/core").InputSignal>; readonly childKeys: import("@angular/core").InputSignal; readonly emit: import("@angular/core").InputSignal<(event: string) => void>; readonly gap: import("@angular/core").InputSignal; readonly justify: import("@angular/core").InputSignal; readonly loading: import("@angular/core").InputSignal; readonly spec: import("@angular/core").InputSignal; } ``` **Angular selector:** `a2ui-column` - Input `align`: `ColumnAlign` - Input `bindings`: `Record` - Input `childKeys`: `string[]` - Input `emit`: `(event: string) => void` - Input `gap`: `number | "small" | "medium" | "large" | undefined` - Input `justify`: `ColumnJustify` - Input `loading`: `boolean` - Input `spec` (required): `Spec` ### align v0.9 prop: cross-axis alignment (default 'stretch'). ```typescript readonly align: import("@angular/core").InputSignal; ``` ### bindings ```typescript readonly bindings: import("@angular/core").InputSignal>; ``` ### childKeys ```typescript readonly childKeys: import("@angular/core").InputSignal; ``` ### emit ```typescript readonly emit: import("@angular/core").InputSignal<(event: string) => void>; ``` ### gap Not part of the v0.9 catalog — kept for json-render generative-ui specs, which may set a numeric spacing unit (multiples of 4px) or a named size. Unset falls back to the CSS default gap. ```typescript readonly gap: import("@angular/core").InputSignal; ``` ### justify v0.9 prop: main-axis distribution (default 'start'). ```typescript readonly justify: import("@angular/core").InputSignal; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### spec ```typescript readonly spec: import("@angular/core").InputSignal; ``` # A2uiComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiComponent ```typescript import type { A2uiComponent } from '@threadplane/chat'; ``` ## A2uiComponent Any component, including non-basic-catalog types. Renderers treat unknown `component` strings as unrenderable and fall back gracefully. ```typescript export type A2uiComponent = A2uiCatalogComponent | (A2uiComponentBase & Record); ``` # A2uiComponentBase Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiComponentBase ```typescript import type { A2uiComponentBase } from '@threadplane/chat'; ``` ## A2uiComponentBase Shared identity, catalog override, layout weight, and accessibility fields for an A2UI component. ```typescript export interface A2uiComponentBase { accessibility?: Record; catalogId?: string; component: string; id: string; weight?: number; } ``` ### accessibility Accessibility attributes (spec `AccessibilityAttributes`). ```typescript accessibility?: Record; ``` ### catalogId Overrides the surface's default catalog for this component. ```typescript catalogId?: string; ``` ### component ```typescript component: string; ``` ### id ```typescript id: string; ``` ### weight Flex-grow-like weight; only valid as a direct child of Row/Column. ```typescript weight?: number; ``` # A2uiComponentView Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiComponentView ```typescript import type { A2uiComponentView } from '@threadplane/chat'; ``` ## A2uiComponentView Chat-internal projection of an A2UI component, materialized by the surface store. Distinct from the wire-format `A2uiComponent` in `@threadplane/a2ui` — this type adds the per-component readiness fields the progressive renderer consumes. ```typescript export interface A2uiComponentView { readonly bindings: readonly string[]; readonly def: A2uiComponent; readonly id: string; readonly props: Readonly>; readonly ready: boolean; readonly type: string; } ``` ### bindings Data model paths this component references via its `{$.path}` prop expressions. Extracted once on `updateComponents` apply; immutable. ```typescript readonly bindings: readonly string[]; ``` ### def The raw wire-format component, retained so the slot directive can look up the catalog entry by type and resolve nested children on re-renders. ```typescript readonly def: A2uiComponent; ``` ### id The component's id (same as the wire-format `A2uiComponent.id`). ```typescript readonly id: string; ``` ### props Resolved property bag (reserved protocol keys stripped). Meaningful only when `ready === true`. ```typescript readonly props: Readonly>; ``` ### ready Monotonic: `false` until every binding has resolved at least once in the accumulated data model, then `true` forever. Once `true`, subsequent `updateDataModel` envelopes push new prop values but do NOT flip this back to `false`. ```typescript readonly ready: boolean; ``` ### type The component type — e.g. `'Button'`, `'TextField'` — matched against catalog `views` entries. Mirrors the wire `component` string. ```typescript readonly type: string; ``` # A2uiDateTimeInputComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiDateTimeInputComponent ```typescript import { A2uiDateTimeInputComponent } from '@threadplane/chat'; ``` ## A2uiDateTimeInputComponent Renders an A2UI date, time, or local date-time input and writes changes to its bound state. ```typescript export declare class A2uiDateTimeInputComponent { readonly _bindings: import("@angular/core").InputSignal>; readonly bindings: import("@angular/core").InputSignal>; readonly childKeys: import("@angular/core").InputSignal; readonly enableDate: import("@angular/core").InputSignal; readonly enableTime: import("@angular/core").InputSignal; readonly errorText: import("@angular/core").InputSignal; readonly label: import("@angular/core").InputSignal; readonly loading: import("@angular/core").InputSignal; readonly max: import("@angular/core").InputSignal; readonly min: import("@angular/core").InputSignal; onChange(event: Event): void; readonly spec: import("@angular/core").InputSignal; readonly value: import("@angular/core").InputSignal; } ``` **Angular selector:** `a2ui-date-time-input` - Input `_bindings`: `Record` - Input `bindings`: `Record` - Input `childKeys`: `string[]` - Input `enableDate`: `boolean` - Input `enableTime`: `boolean` - Input `errorText`: `string` - Input `label`: `string` - Input `loading`: `boolean` - Input `max`: `string | undefined` - Input `min`: `string | undefined` - Input `spec`: `Spec | undefined` - Input `value`: `string` ### _bindings ```typescript readonly _bindings: import("@angular/core").InputSignal>; ``` ### bindings ```typescript readonly bindings: import("@angular/core").InputSignal>; ``` ### childKeys ```typescript readonly childKeys: import("@angular/core").InputSignal; ``` ### enableDate v0.9 prop: enableDate — include date portion. ```typescript readonly enableDate: import("@angular/core").InputSignal; ``` ### enableTime v0.9 prop: enableTime — include time portion. ```typescript readonly enableTime: import("@angular/core").InputSignal; ``` ### errorText Live validation message written by the surface's check gate (bound to /_a2uiChecks/); empty when valid. ```typescript readonly errorText: import("@angular/core").InputSignal; ``` ### label ```typescript readonly label: import("@angular/core").InputSignal; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### max v0.9 prop: ISO upper bound mapped to the native input's max. ```typescript readonly max: import("@angular/core").InputSignal; ``` ### min v0.9 prop: ISO lower bound mapped to the native input's min. ```typescript readonly min: import("@angular/core").InputSignal; ``` ### onChange · overload 1 ```typescript onChange(event: Event): void; ``` ### spec ```typescript readonly spec: import("@angular/core").InputSignal; ``` ### value v0.9 prop: ISO 8601 value (resolved DynamicString). Still renders when absent. ```typescript readonly value: import("@angular/core").InputSignal; ``` # A2uiDividerComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiDividerComponent ```typescript import { A2uiDividerComponent } from '@threadplane/chat'; ``` ## A2uiDividerComponent Renders a horizontal or vertical A2UI divider. ```typescript export declare class A2uiDividerComponent { readonly axis: import("@angular/core").InputSignal<"vertical" | "horizontal">; readonly bindings: import("@angular/core").InputSignal>; readonly childKeys: import("@angular/core").InputSignal; readonly emit: import("@angular/core").InputSignal<(event: string) => void>; readonly loading: import("@angular/core").InputSignal; readonly spec: import("@angular/core").InputSignal; } ``` **Angular selector:** `a2ui-divider` - Input `axis`: `"vertical" | "horizontal"` - Input `bindings`: `Record` - Input `childKeys`: `string[]` - Input `emit`: `(event: string) => void` - Input `loading`: `boolean` - Input `spec`: `Spec | undefined` ### axis v0.9 prop: divider axis (default 'horizontal'). ```typescript readonly axis: import("@angular/core").InputSignal<"vertical" | "horizontal">; ``` ### bindings ```typescript readonly bindings: import("@angular/core").InputSignal>; ``` ### childKeys ```typescript readonly childKeys: import("@angular/core").InputSignal; ``` ### emit ```typescript readonly emit: import("@angular/core").InputSignal<(event: string) => void>; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### spec ```typescript readonly spec: import("@angular/core").InputSignal; ``` # A2uiErrorMessage Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiErrorMessage ```typescript import type { A2uiErrorMessage } from '@threadplane/chat'; ``` ## A2uiErrorMessage Versioned A2UI error envelope with a code and optional surface, path, and message details. ```typescript export interface A2uiErrorMessage { error: { code: string; surfaceId?: string; path?: string; message?: string; }; version: string; } ``` ### error ```typescript error: { code: string; surfaceId?: string; path?: string; message?: string; }; ``` ### version ```typescript version: string; ``` # A2uiEventAction Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiEventAction ```typescript import type { A2uiEventAction } from '@threadplane/chat'; ``` ## A2uiEventAction Dispatches a named event (with optional context) to the agent. ```typescript export interface A2uiEventAction { event: { name: string; context?: Record; }; } ``` ### event ```typescript event: { name: string; context?: Record; }; ``` # A2uiFunctionAction Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiFunctionAction ```typescript import type { A2uiFunctionAction } from '@threadplane/chat'; ``` ## A2uiFunctionAction Executes a client-side function locally (e.g. `openUrl`). ```typescript export interface A2uiFunctionAction { functionCall: A2uiFunctionCall; } ``` ### functionCall ```typescript functionCall: A2uiFunctionCall; ``` # A2uiFunctionCall Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiFunctionCall ```typescript import type { A2uiFunctionCall } from '@threadplane/chat'; ``` ## A2uiFunctionCall Client-side function invocation (e.g. `formatString`, `required`). ```typescript export interface A2uiFunctionCall { args?: Record; call: string; returnType?: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'any' | 'void'; } ``` ### args ```typescript args?: Record; ``` ### call ```typescript call: string; ``` ### returnType ```typescript returnType?: 'string' | 'number' | 'boolean' | 'array' | 'object' | 'any' | 'void'; ``` # A2uiIconComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiIconComponent ```typescript import { A2uiIconComponent } from '@threadplane/chat'; ``` ## A2uiIconComponent Renders an A2UI icon from a Material Symbols name or an inline SVG path. ```typescript export declare class A2uiIconComponent { readonly bindings: import("@angular/core").InputSignal>; readonly childKeys: import("@angular/core").InputSignal; readonly emit: import("@angular/core").InputSignal<(event: string) => void>; readonly loading: import("@angular/core").InputSignal; readonly name: import("@angular/core").InputSignal; readonly spec: import("@angular/core").InputSignal; } ``` **Angular selector:** `a2ui-icon` - Input `bindings`: `Record` - Input `childKeys`: `string[]` - Input `emit`: `(event: string) => void` - Input `loading`: `boolean` - Input `name`: `string | { svgPath: string; } | undefined` - Input `spec`: `Spec | undefined` ### bindings ```typescript readonly bindings: import("@angular/core").InputSignal>; ``` ### childKeys ```typescript readonly childKeys: import("@angular/core").InputSignal; ``` ### emit ```typescript readonly emit: import("@angular/core").InputSignal<(event: string) => void>; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### name v0.9 prop: a Material Symbols name (string) or an inline `{ svgPath }`. ```typescript readonly name: import("@angular/core").InputSignal; ``` ### spec ```typescript readonly spec: import("@angular/core").InputSignal; ``` # A2uiImageComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiImageComponent ```typescript import { A2uiImageComponent } from '@threadplane/chat'; ``` ## A2uiImageComponent Renders an A2UI image with a description, sizing preset, and object-fit behavior. ```typescript export declare class A2uiImageComponent { readonly bindings: import("@angular/core").InputSignal>; readonly childKeys: import("@angular/core").InputSignal; readonly description: import("@angular/core").InputSignal; readonly emit: import("@angular/core").InputSignal<(event: string) => void>; readonly fit: import("@angular/core").InputSignal; readonly loading: import("@angular/core").InputSignal; readonly spec: import("@angular/core").InputSignal; readonly url: import("@angular/core").InputSignal; readonly variant: import("@angular/core").InputSignal; } ``` **Angular selector:** `a2ui-image` - Input `bindings`: `Record` - Input `childKeys`: `string[]` - Input `description`: `string` - Input `emit`: `(event: string) => void` - Input `fit`: `ImageFit` - Input `loading`: `boolean` - Input `spec`: `Spec | undefined` - Input `url`: `string` - Input `variant`: `ImageVariant` ### bindings ```typescript readonly bindings: import("@angular/core").InputSignal>; ``` ### childKeys ```typescript readonly childKeys: import("@angular/core").InputSignal; ``` ### description v0.9 prop: alt text / accessible description. ```typescript readonly description: import("@angular/core").InputSignal; ``` ### emit ```typescript readonly emit: import("@angular/core").InputSignal<(event: string) => void>; ``` ### fit v0.9 prop: CSS object-fit equivalent ('scaleDown' → 'scale-down'). ```typescript readonly fit: import("@angular/core").InputSignal; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### spec ```typescript readonly spec: import("@angular/core").InputSignal; ``` ### url ```typescript readonly url: import("@angular/core").InputSignal; ``` ### variant v0.9 prop: sizing preset. ```typescript readonly variant: import("@angular/core").InputSignal; ``` # A2uiListComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiListComponent ```typescript import { A2uiListComponent } from '@threadplane/chat'; ``` ## A2uiListComponent Renders A2UI child elements in a horizontal or vertical list with configurable alignment. ```typescript export declare class A2uiListComponent { readonly align: import("@angular/core").InputSignal<"start" | "center" | "end" | "stretch">; readonly bindings: import("@angular/core").InputSignal>; readonly childKeys: import("@angular/core").InputSignal; readonly direction: import("@angular/core").InputSignal<"vertical" | "horizontal">; readonly emit: import("@angular/core").InputSignal<(event: string) => void>; readonly loading: import("@angular/core").InputSignal; readonly spec: import("@angular/core").InputSignal; } ``` **Angular selector:** `a2ui-list` - Input `align`: `"start" | "center" | "end" | "stretch"` - Input `bindings`: `Record` - Input `childKeys`: `string[]` - Input `direction`: `"vertical" | "horizontal"` - Input `emit`: `(event: string) => void` - Input `loading`: `boolean` - Input `spec` (required): `Spec` ### align v0.9 prop: cross-axis alignment (default 'stretch'). ```typescript readonly align: import("@angular/core").InputSignal<"start" | "center" | "end" | "stretch">; ``` ### bindings ```typescript readonly bindings: import("@angular/core").InputSignal>; ``` ### childKeys ```typescript readonly childKeys: import("@angular/core").InputSignal; ``` ### direction ```typescript readonly direction: import("@angular/core").InputSignal<"vertical" | "horizontal">; ``` ### emit ```typescript readonly emit: import("@angular/core").InputSignal<(event: string) => void>; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### spec ```typescript readonly spec: import("@angular/core").InputSignal; ``` # A2uiModalComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiModalComponent ```typescript import { A2uiModalComponent } from '@threadplane/chat'; ``` ## A2uiModalComponent Renders an A2UI trigger that opens its associated child content in a modal overlay. ```typescript export declare class A2uiModalComponent { readonly bindings: import("@angular/core").InputSignal>; readonly childKeys: import("@angular/core").InputSignal; readonly emit: import("@angular/core").InputSignal<(event: string) => void>; readonly loading: import("@angular/core").InputSignal; readonly spec: import("@angular/core").InputSignal; } ``` **Angular selector:** `a2ui-modal` - Input `bindings`: `Record` - Input `childKeys`: `string[]` - Input `emit`: `(event: string) => void` - Input `loading`: `boolean` - Input `spec` (required): `Spec` ### bindings ```typescript readonly bindings: import("@angular/core").InputSignal>; ``` ### childKeys v0.9: childKeys[0] = trigger (inline entry point), childKeys[1] = content (modal body). ```typescript readonly childKeys: import("@angular/core").InputSignal; ``` ### emit ```typescript readonly emit: import("@angular/core").InputSignal<(event: string) => void>; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### spec ```typescript readonly spec: import("@angular/core").InputSignal; ``` # A2uiPathRef Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiPathRef ```typescript import type { A2uiPathRef } from '@threadplane/chat'; ``` ## A2uiPathRef JSON-pointer data-model binding. Absolute (`/a/b`) or relative inside templates. ```typescript export interface A2uiPathRef { path: string; } ``` ### path ```typescript path: string; ``` # A2uiRowComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiRowComponent ```typescript import { A2uiRowComponent } from '@threadplane/chat'; ``` ## A2uiRowComponent Arranges A2UI child elements horizontally with configurable alignment, distribution, and spacing. ```typescript export declare class A2uiRowComponent { readonly align: import("@angular/core").InputSignal; readonly bindings: import("@angular/core").InputSignal>; readonly childKeys: import("@angular/core").InputSignal; readonly emit: import("@angular/core").InputSignal<(event: string) => void>; readonly gap: import("@angular/core").InputSignal; readonly justify: import("@angular/core").InputSignal; readonly loading: import("@angular/core").InputSignal; readonly spec: import("@angular/core").InputSignal; } ``` **Angular selector:** `a2ui-row` - Input `align`: `RowAlign` - Input `bindings`: `Record` - Input `childKeys`: `string[]` - Input `emit`: `(event: string) => void` - Input `gap`: `number | "small" | "medium" | "large" | undefined` - Input `justify`: `RowJustify` - Input `loading`: `boolean` - Input `spec` (required): `Spec` ### align v0.9 prop: cross-axis alignment (default 'stretch'). ```typescript readonly align: import("@angular/core").InputSignal; ``` ### bindings ```typescript readonly bindings: import("@angular/core").InputSignal>; ``` ### childKeys ```typescript readonly childKeys: import("@angular/core").InputSignal; ``` ### emit ```typescript readonly emit: import("@angular/core").InputSignal<(event: string) => void>; ``` ### gap Not part of the v0.9 catalog — kept for json-render generative-ui specs, which may set a numeric spacing unit (multiples of 4px) or a named size. Unset falls back to the CSS default gap. ```typescript readonly gap: import("@angular/core").InputSignal; ``` ### justify v0.9 prop: main-axis distribution (default 'start'). ```typescript readonly justify: import("@angular/core").InputSignal; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### spec ```typescript readonly spec: import("@angular/core").InputSignal; ``` # A2uiSliderComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiSliderComponent ```typescript import { A2uiSliderComponent } from '@threadplane/chat'; ``` ## A2uiSliderComponent Renders an A2UI range input that writes numeric changes to its bound render state. ```typescript export declare class A2uiSliderComponent { readonly _bindings: import("@angular/core").InputSignal>; readonly bindings: import("@angular/core").InputSignal>; readonly childKeys: import("@angular/core").InputSignal; readonly errorText: import("@angular/core").InputSignal; readonly label: import("@angular/core").InputSignal; readonly loading: import("@angular/core").InputSignal; readonly max: import("@angular/core").InputSignal; readonly min: import("@angular/core").InputSignal; onInput(event: Event): void; readonly spec: import("@angular/core").InputSignal; readonly value: import("@angular/core").InputSignal; } ``` **Angular selector:** `a2ui-slider` - Input `_bindings`: `Record` - Input `bindings`: `Record` - Input `childKeys`: `string[]` - Input `errorText`: `string` - Input `label`: `string` - Input `loading`: `boolean` - Input `max`: `number` - Input `min`: `number` - Input `spec`: `Spec | undefined` - Input `value`: `number` ### _bindings ```typescript readonly _bindings: import("@angular/core").InputSignal>; ``` ### bindings ```typescript readonly bindings: import("@angular/core").InputSignal>; ``` ### childKeys ```typescript readonly childKeys: import("@angular/core").InputSignal; ``` ### errorText Live validation message written by the surface's check gate (bound to /_a2uiChecks/); empty when valid. ```typescript readonly errorText: import("@angular/core").InputSignal; ``` ### label ```typescript readonly label: import("@angular/core").InputSignal; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### max v0.9 prop: upper bound. ```typescript readonly max: import("@angular/core").InputSignal; ``` ### min v0.9 prop: lower bound (default 0). ```typescript readonly min: import("@angular/core").InputSignal; ``` ### onInput · overload 1 ```typescript onInput(event: Event): void; ``` ### spec ```typescript readonly spec: import("@angular/core").InputSignal; ``` ### value v0.9 prop: value (resolved DynamicNumber). ```typescript readonly value: import("@angular/core").InputSignal; ``` # A2uiSurface Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiSurface ```typescript import type { A2uiSurface } from '@threadplane/chat'; ``` ## A2uiSurface Renderer-side surface state combining catalog settings, components indexed by ID, and the current data model. ```typescript export interface A2uiSurface { catalogId: string; components: Map; dataModel: Record; sendDataModel?: boolean; surfaceId: string; theme?: A2uiTheme; } ``` ### catalogId ```typescript catalogId: string; ``` ### components ```typescript components: Map; ``` ### dataModel ```typescript dataModel: Record; ``` ### sendDataModel ```typescript sendDataModel?: boolean; ``` ### surfaceId ```typescript surfaceId: string; ``` ### theme ```typescript theme?: A2uiTheme; ``` # A2uiSurfaceComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiSurfaceComponent ```typescript import { A2uiSurfaceComponent } from '@threadplane/chat'; ``` ## A2uiSurfaceComponent Renders an A2UI surface. Supports two input shapes: - `state` (preferred): chat-side `A2uiSurfaceState`, converted to a json-render spec whose `$bindState` props defer each component until its data has arrived. - `surface` (legacy): wire-format `A2uiSurface` fed into ``; kept for backwards compatibility. When both inputs are set, `state` takes priority for rendering AND for action-message construction; `surface` is only consulted when `state` is unset. ```typescript export declare class A2uiSurfaceComponent { constructor(); readonly action: import("@angular/core").OutputEmitterRef; readonly catalog: import("@angular/core").InputSignal>> | Readonly>>>; readonly events: import("@angular/core").OutputEmitterRef; readonly handlers: import("@angular/core").InputSignal) => unknown | Promise>>; readonly internalHandlers: import("@angular/core").Signal<{ 'a2ui:event': (params: Record) => A2uiActionMessage | undefined; 'a2ui:localAction': (params: Record) => unknown; }>; readonly liveStore: import("@threadplane/render").SignalStateStore; onRenderEvent(event: RenderEvent): void; readonly primaryColor: import("@angular/core").Signal; readonly registry: import("@angular/core").Signal; readonly rootIds: import("@angular/core").Signal; readonly spec: import("@angular/core").Signal; readonly state: import("@angular/core").InputSignal; readonly surface: import("@angular/core").InputSignal; readonly surfaceFallback: import("@angular/core").InputSignal | undefined>; readonly validationError: import("@angular/core").OutputEmitterRef; } ``` **Angular selector:** `a2ui-surface` - Input `catalog` (required): `Readonly>> | Readonly>>` - Input `handlers`: `Record) => unknown>` - Input `state`: `A2uiSurfaceState | undefined` - Input `surface`: `A2uiSurface | undefined` - Input `surfaceFallback`: `Type | undefined` - Output `action`: `A2uiActionMessage` - Output `events`: `RenderEvent` - Output `validationError`: `A2uiErrorMessage` ### Constructor · overload 1 Constructs a new instance of the `A2uiSurfaceComponent` class ```typescript constructor(); ``` ### action ```typescript readonly action: import("@angular/core").OutputEmitterRef; ``` ### catalog ```typescript readonly catalog: import("@angular/core").InputSignal>> | Readonly>>>; ``` ### events ```typescript readonly events: import("@angular/core").OutputEmitterRef; ``` ### handlers ```typescript readonly handlers: import("@angular/core").InputSignal) => unknown | Promise>>; ``` ### internalHandlers Merge built-in A2UI handlers with consumer-provided handlers. ```typescript readonly internalHandlers: import("@angular/core").Signal<{ 'a2ui:event': (params: Record) => A2uiActionMessage | undefined; 'a2ui:localAction': (params: Record) => unknown; }>; ``` ### liveStore Surface-owned live state store: `$bindState` props read it and input components write user edits into it, so event-time logic (checks, action context) sees CURRENT values instead of the agent-seeded snapshot. Seeded from spec.state with user edits preserved. Public so hosts (and tests) can read the live values of a rendered surface. ```typescript readonly liveStore: import("@threadplane/render").SignalStateStore; ``` ### onRenderEvent · overload 1 ```typescript onRenderEvent(event: RenderEvent): void; ``` ### primaryColor Agent-set primary color from `createSurface.theme.primaryColor`. Returns null when unset so the host binding doesn't override the consumer's `:root`-level `--a2ui-primary` default. ```typescript readonly primaryColor: import("@angular/core").Signal; ``` ### registry Convert ViewRegistry to AngularRegistry for RenderSpecComponent. ```typescript readonly registry: import("@angular/core").Signal; ``` ### rootIds Roots from the surface state. The v0.9 wire contract reserves the component id `root` as the single tree root; we keep the renderer permissive in case future surfaces emit multiple top-level components. Conservative: returns only the first key from componentViews insertion order. ```typescript readonly rootIds: import("@angular/core").Signal; ``` ### spec Convert the A2UI surface to a json-render Spec for rendering. Prefers `state().surface` (the progressively-built wire surface) over the legacy `surface` input. surfaceToSpec handles children-id-list → spec.children translation + reserved-key filtering + path-ref → $bindState rewriting; the rendered tree then uses render-element's standard input-mapping (`childKeys: el.children`) so catalog components receive the inputs they actually declare. An earlier slot-based progressive renderer mounted root components but never populated their childKeys input, leaving Columns/Rows/etc. with no children; the spec conversion replaced it. ```typescript readonly spec: import("@angular/core").Signal; ``` ### state Chat-side surface state with per-component readiness. When set, this takes priority and the progressive renderer is used. ```typescript readonly state: import("@angular/core").InputSignal; ``` ### surface Wire-format surface (legacy path — kept for backwards compat). ```typescript readonly surface: import("@angular/core").InputSignal; ``` ### surfaceFallback Optional top-level placeholder when the surface has no components yet. Defaults to A2uiDefaultFallbackComponent. ```typescript readonly surfaceFallback: import("@angular/core").InputSignal | undefined>; ``` ### validationError Emitted when a submit is blocked by failing validation checks — the spec client → agent error message (code VALIDATION_FAILED). ```typescript readonly validationError: import("@angular/core").OutputEmitterRef; ``` # A2uiSurfaceState Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiSurfaceState ```typescript import type { A2uiSurfaceState } from '@threadplane/chat'; ``` ## A2uiSurfaceState Chat-side state for a surface — wraps the wire-format `A2uiSurface` with the per-component projection the progressive renderer consumes. Both maps are kept in sync; the wire shape preserves existing `surfaceToSpec` semantics, the view shape carries readiness. ```typescript export interface A2uiSurfaceState { readonly componentViews: ReadonlyMap; readonly surface: A2uiSurface; } ``` ### componentViews ```typescript readonly componentViews: ReadonlyMap; ``` ### surface ```typescript readonly surface: A2uiSurface; ``` # A2uiSurfaceStore Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiSurfaceStore ```typescript import type { A2uiSurfaceStore } from '@threadplane/chat'; ``` ## A2uiSurfaceStore Applies A2UI envelopes and exposes reactive wire surfaces and component readiness projections. ```typescript export interface A2uiSurfaceStore { apply(message: A2uiMessage): void; applyPartialArgs(toolCallId: string, envelopes: readonly A2uiMessage[]): void; isPartialLive(toolCallId: string): boolean; surface(surfaceId: string): Signal; readonly surfaces: Signal>; surfaceState(surfaceId: string): Signal; readonly surfaceStates: Signal>; } ``` ### apply · overload 1 ```typescript apply(message: A2uiMessage): void; ``` ### applyPartialArgs · overload 1 Live-stream entry point. Iterates envelopes and feeds each through `apply()`. Records the tool_call_id so the wrapped-content classifier can short-circuit duplicate dispatch when the final AIMessage arrives. ```typescript applyPartialArgs(toolCallId: string, envelopes: readonly A2uiMessage[]): void; ``` ### isPartialLive · overload 1 True if a tool_call_id has produced live envelopes via applyPartialArgs. ```typescript isPartialLive(toolCallId: string): boolean; ``` ### surface · overload 1 ```typescript surface(surfaceId: string): Signal; ``` ### surfaces Wire-format surfaces, for downstream consumers (e.g. surfaceToSpec). ```typescript readonly surfaces: Signal>; ``` ### surfaceState · overload 1 ```typescript surfaceState(surfaceId: string): Signal; ``` ### surfaceStates Chat-side projections with per-component readiness. ```typescript readonly surfaceStates: Signal>; ``` # A2uiTabsComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiTabsComponent ```typescript import { A2uiTabsComponent } from '@threadplane/chat'; ``` ## A2uiTabsComponent Renders A2UI tab titles and the child content for the locally selected tab. ```typescript export declare class A2uiTabsComponent { constructor(); readonly bindings: import("@angular/core").InputSignal>; readonly childKeys: import("@angular/core").InputSignal; readonly emit: import("@angular/core").InputSignal<(event: string) => void>; readonly loading: import("@angular/core").InputSignal; selectTab(index: number): void; readonly spec: import("@angular/core").InputSignal; readonly tabTitles: import("@angular/core").InputSignal; } ``` **Angular selector:** `a2ui-tabs` - Input `bindings`: `Record` - Input `childKeys`: `string[]` - Input `emit`: `(event: string) => void` - Input `loading`: `boolean` - Input `spec` (required): `Spec` - Input `tabTitles`: `string[]` ### Constructor · overload 1 Constructs a new instance of the `A2uiTabsComponent` class ```typescript constructor(); ``` ### bindings ```typescript readonly bindings: import("@angular/core").InputSignal>; ``` ### childKeys v0.9: each child key corresponds to a tab's child (childKeys[i] ↔ tabTitles[i]). ```typescript readonly childKeys: import("@angular/core").InputSignal; ``` ### emit ```typescript readonly emit: import("@angular/core").InputSignal<(event: string) => void>; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### selectTab · overload 1 ```typescript selectTab(index: number): void; ``` ### spec ```typescript readonly spec: import("@angular/core").InputSignal; ``` ### tabTitles Resolved tab titles from tabs[*].title — produced by surface-to-spec. ```typescript readonly tabTitles: import("@angular/core").InputSignal; ``` # A2uiTextComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiTextComponent ```typescript import { A2uiTextComponent } from '@threadplane/chat'; ``` ## A2uiTextComponent Renders A2UI text using the selected typography variant. ```typescript export declare class A2uiTextComponent { readonly bindings: import("@angular/core").InputSignal>; readonly childKeys: import("@angular/core").InputSignal; readonly emit: import("@angular/core").InputSignal<(event: string) => void>; readonly loading: import("@angular/core").InputSignal; readonly spec: import("@angular/core").InputSignal; readonly text: import("@angular/core").InputSignal; readonly variant: import("@angular/core").InputSignal; } ``` **Angular selector:** `a2ui-text` - Input `bindings`: `Record` - Input `childKeys`: `string[]` - Input `emit`: `(event: string) => void` - Input `loading`: `boolean` - Input `spec`: `Spec | undefined` - Input `text`: `string` - Input `variant`: `TextVariant` ### bindings ```typescript readonly bindings: import("@angular/core").InputSignal>; ``` ### childKeys ```typescript readonly childKeys: import("@angular/core").InputSignal; ``` ### emit ```typescript readonly emit: import("@angular/core").InputSignal<(event: string) => void>; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### spec ```typescript readonly spec: import("@angular/core").InputSignal; ``` ### text ```typescript readonly text: import("@angular/core").InputSignal; ``` ### variant v0.9 prop: typography variant. ```typescript readonly variant: import("@angular/core").InputSignal; ``` # A2uiTextFieldComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiTextFieldComponent ```typescript import { A2uiTextFieldComponent } from '@threadplane/chat'; ``` ## A2uiTextFieldComponent Renders an A2UI text, number, password, or multiline field and writes edits to its bound state. ```typescript export declare class A2uiTextFieldComponent { readonly _bindings: import("@angular/core").InputSignal>; readonly bindings: import("@angular/core").InputSignal>; readonly childKeys: import("@angular/core").InputSignal; readonly errorText: import("@angular/core").InputSignal; readonly label: import("@angular/core").InputSignal; readonly loading: import("@angular/core").InputSignal; onInput(event: Event): void; readonly placeholder: import("@angular/core").InputSignal; readonly spec: import("@angular/core").InputSignal; readonly validationRegexp: import("@angular/core").InputSignal; readonly value: import("@angular/core").InputSignal; readonly variant: import("@angular/core").InputSignal; } ``` **Angular selector:** `a2ui-text-field` - Input `_bindings`: `Record` - Input `bindings`: `Record` - Input `childKeys`: `string[]` - Input `errorText`: `string` - Input `label`: `string` - Input `loading`: `boolean` - Input `placeholder`: `string` - Input `spec`: `Spec | undefined` - Input `validationRegexp`: `string` - Input `value`: `string` - Input `variant`: `TextFieldVariant` ### _bindings ```typescript readonly _bindings: import("@angular/core").InputSignal>; ``` ### bindings ```typescript readonly bindings: import("@angular/core").InputSignal>; ``` ### childKeys ```typescript readonly childKeys: import("@angular/core").InputSignal; ``` ### errorText Live validation message written by the surface's check gate (bound to /_a2uiChecks/); empty when valid. ```typescript readonly errorText: import("@angular/core").InputSignal; ``` ### label ```typescript readonly label: import("@angular/core").InputSignal; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### onInput · overload 1 ```typescript onInput(event: Event): void; ``` ### placeholder ```typescript readonly placeholder: import("@angular/core").InputSignal; ``` ### spec ```typescript readonly spec: import("@angular/core").InputSignal; ``` ### validationRegexp Enforced by the surface's check gate as an implicit regex rule (plus the native pattern attribute). ```typescript readonly validationRegexp: import("@angular/core").InputSignal; ``` ### value v0.9 prop: resolved string value. ```typescript readonly value: import("@angular/core").InputSignal; ``` ### variant v0.9 prop: input variant (default 'shortText'). ```typescript readonly variant: import("@angular/core").InputSignal; ``` # A2uiTheme Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiTheme ```typescript import type { A2uiTheme } from '@threadplane/chat'; ``` ## A2uiTheme Optional surface branding: primary color, icon URL, and agent display name. ```typescript export interface A2uiTheme { agentDisplayName?: string; iconUrl?: string; primaryColor?: string; } ``` ### agentDisplayName ```typescript agentDisplayName?: string; ``` ### iconUrl ```typescript iconUrl?: string; ``` ### primaryColor ```typescript primaryColor?: string; ``` # A2uiVideoComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiVideoComponent ```typescript import { A2uiVideoComponent } from '@threadplane/chat'; ``` ## A2uiVideoComponent Renders an A2UI video URL with native playback controls. ```typescript export declare class A2uiVideoComponent { readonly bindings: import("@angular/core").InputSignal>; readonly childKeys: import("@angular/core").InputSignal; readonly emit: import("@angular/core").InputSignal<(event: string) => void>; readonly loading: import("@angular/core").InputSignal; readonly spec: import("@angular/core").InputSignal; readonly url: import("@angular/core").InputSignal; } ``` **Angular selector:** `a2ui-video` - Input `bindings`: `Record` - Input `childKeys`: `string[]` - Input `emit`: `(event: string) => void` - Input `loading`: `boolean` - Input `spec`: `Spec | undefined` - Input `url`: `string` ### bindings ```typescript readonly bindings: import("@angular/core").InputSignal>; ``` ### childKeys ```typescript readonly childKeys: import("@angular/core").InputSignal; ``` ### emit ```typescript readonly emit: import("@angular/core").InputSignal<(event: string) => void>; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### spec ```typescript readonly spec: import("@angular/core").InputSignal; ``` ### url ```typescript readonly url: import("@angular/core").InputSignal; ``` # A2uiViewEntry Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiViewEntry ```typescript import type { A2uiViewEntry } from '@threadplane/chat'; ``` ## A2uiViewEntry Catalog entry for the A2UI surface renderer. `component` is mounted once all of the component's bindings (data model paths referenced in its prop expressions) have resolved. While any binding is unpopulated, the `fallback` is mounted instead. If `fallback` is omitted, the lib's default fallback (`A2uiDefaultFallbackComponent`) is mounted. This is a chat-side alias for the shared `RenderViewEntry` shape so consumers of `@threadplane/chat` don't have to import from `@threadplane/render`. ```typescript export type A2uiViewEntry = RenderViewEntry; ``` # A2uiViews Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/A2uiViews ```typescript import type { A2uiViews } from '@threadplane/chat'; ``` ## A2uiViews Catalog shape accepted by ``. Each entry is either a bare `Type` (legacy shape — no per-component fallback) or an `A2uiViewEntry`. ```typescript export type A2uiViews = Readonly | A2uiViewEntry>>; ``` # action Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/action ```typescript import { action } from '@threadplane/chat'; ``` ## action · overload 1 Declare an async function tool the model can call; its resolved return value becomes the tool result shipped back to the model. ```typescript export declare function action(description: string, schema: S, handler: (args: StandardSchemaInferOutput, context: FunctionToolHandlerContext) => R | Promise, options?: ClientToolExecutionOptions): FunctionToolDef; ``` - **description**: Natural-language description the model sees. - **schema**: Standard Schema (e.g. a Zod object) for the arguments; the handler's argument type is inferred from it. - **handler**: Runs in the browser when the model calls the tool. The second argument carries an `AbortSignal`; its return type `R` is carried on the resulting [FunctionToolDef](/docs/api/chat/FunctionToolDef). - **options**: Execution policy options, including `idempotent: true` to skip durable pre-execution claims when a guard is configured. **Returns:** A [FunctionToolDef](/docs/api/chat/FunctionToolDef) for inclusion in [tools](/docs/api/chat/tools). ```ts const move = action('Move a stop', z.object({ fromDay: z.number() }), (a) => a.fromDay); const registry = tools({ move_stop: move }); ``` # Agent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/Agent ```typescript import type { Agent } from '@threadplane/chat'; ``` ## Agent Runtime-neutral contract chat primitives consume. Implementations are produced by runtime adapters (e.g. a LangGraph or AG-UI adapter) or by user code for custom backends. `interrupt` and `subagents` are optional: runtimes that do not support these concepts should leave them undefined, and primitives that need them check presence and render a neutral fallback when absent. Invariant: state lives on signals; `events$` carries only things that are not derivable from signals. ```typescript export interface Agent { checkStatus?: () => Promise; clientTools?: ClientToolsCapability; error: Signal; events$: Observable; interrupt?: Signal; isInputBlocked?: Signal; isLoading: Signal; messages: Signal; regenerate: (assistantMessageIndex: number) => Promise; retry: () => Promise; state: Signal; status: Signal; stop: () => Promise; subagents?: Signal>; submit: (input: AgentSubmitInput, opts?: AgentSubmitOptions) => Promise; toolCalls: Signal; usage?: Signal; } ``` ### checkStatus Optional read-only reconciliation of an uncertain run outcome, offered when `error().recovery === 'check'`. Asks the backend what happened. The answer arrives on the signals, not in the return value: a run the backend reports as finished clears `error` and returns `status` to idle, and any messages it committed appear on `messages`. An outcome that stays unknown leaves the existing error in place, so the caller can offer the check again later. Adapters implementing this must not resubmit the operation and must not append a message; a dropped stream is not proof that the server did nothing. They should reject while a request is in flight, and must discard a result that resolves after a newer request has started. ```typescript checkStatus?: () => Promise; ``` ### clientTools Optional: client-declared, client-executed tools (see ClientToolsCapability). ```typescript clientTools?: ClientToolsCapability; ``` ### error ```typescript error: Signal; ``` ### events$ ```typescript events$: Observable; ``` ### interrupt Optional display projection of the pending interrupt. A runtime may expose a separate full batch and lifecycle surface. A cleared display projection does not by itself prove that resumed backend work completed. ```typescript interrupt?: Signal; ``` ### isInputBlocked Optional gate for ordinary composer input while the runtime requires resolution or recovery. Resume actions remain adapter-controlled. ```typescript isInputBlocked?: Signal; ``` ### isLoading ```typescript isLoading: Signal; ``` ### messages ```typescript messages: Signal; ``` ### regenerate Discards the assistant message at the given index AND all messages after it, then re-runs the agent against the trimmed conversation tail. The preceding user message (at index - 1) is preserved and re-submitted as the agent's input. No new user message is added to the history. Throws if the message at `index` is not 'assistant' role, or if the agent is currently loading another response. ```typescript regenerate: (assistantMessageIndex: number) => Promise; ``` ### retry Re-run the captured submission after a failure, including a resume command with no message payload. Does not append another user message or reuse an aborted request signal. Does not restart an in-flight request; no-op when nothing is saved. Adapters may reject unsafe resume retries until the backend outcome has been reconciled; a transport failure alone does not prove non-execution. ```typescript retry: () => Promise; ``` ### state ```typescript state: Signal; ``` ### status ```typescript status: Signal; ``` ### stop ```typescript stop: () => Promise; ``` ### subagents ```typescript subagents?: Signal>; ``` ### submit ```typescript submit: (input: AgentSubmitInput, opts?: AgentSubmitOptions) => Promise; ``` ### toolCalls ```typescript toolCalls: Signal; ``` ### usage Optional token usage for the most recent completed or errored run. Adapters whose runtime reports usage set it at the run boundary; it is `undefined` while a run is in flight and after a run that reported none. ```typescript usage?: Signal; ``` # AGENT_ERROR_MESSAGES Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AGENT_ERROR_MESSAGES ```typescript import { AGENT_ERROR_MESSAGES } from '@threadplane/chat'; ``` ## AGENT_ERROR_MESSAGES Default, human-facing copy per [AgentErrorKind](/docs/api/chat/AgentErrorKind). Used as the message when a classified error has no better text. Override by mapping `error.kind` to your own strings in a custom error component. For `interrupted` errors, prefer `AGENT_RECOVERY_MESSAGES[recovery]` once `recovery` is known — it carries the correct per-case copy. The `interrupted` entry here is only the fallback for errors constructed without a recovery value. ```typescript AGENT_ERROR_MESSAGES: Record ``` # AGENT_RECOVERY_DETAILS Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AGENT_RECOVERY_DETAILS ```typescript import { AGENT_RECOVERY_DETAILS } from '@threadplane/chat'; ``` ## AGENT_RECOVERY_DETAILS The second line of the `interrupted` banner, per [AgentRecovery](/docs/api/chat/AgentRecovery). Each entry is written to be read as a continuation of the matching [AGENT_RECOVERY_MESSAGES](/docs/api/chat/AGENT_RECOVERY_MESSAGES) sentence, never on its own: the `check` entry supplies only the action that follows, and the `none` entry only its cost. Adapters set `AgentError.detail` from here so every transport says the same thing. Keep the pairs in sync when editing either table. ```typescript AGENT_RECOVERY_DETAILS: Record ``` # AGENT_RECOVERY_MESSAGES Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AGENT_RECOVERY_MESSAGES ```typescript import { AGENT_RECOVERY_MESSAGES } from '@threadplane/chat'; ``` ## AGENT_RECOVERY_MESSAGES Human-facing copy per [AgentRecovery](/docs/api/chat/AgentRecovery), used for `interrupted` errors. ```typescript AGENT_RECOVERY_MESSAGES: Record ``` # AgentCheckpoint Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AgentCheckpoint ```typescript import type { AgentCheckpoint } from '@threadplane/chat'; ``` ## AgentCheckpoint Runtime-neutral snapshot of a point in an agent's execution history. Consumed by time-travel / debug UIs. `id` is adapter-opaque — UIs emit it back to the parent app on replay/fork, and the parent app dispatches to the underlying runtime. ```typescript export interface AgentCheckpoint { id?: string; label?: string; values: Record; } ``` ### id Adapter-opaque checkpoint identifier (e.g. LangGraph checkpoint_id). ```typescript id?: string; ``` ### label Human-friendly label for the checkpoint (e.g. next node name). ```typescript label?: string; ``` ### values State snapshot at this checkpoint. ```typescript values: Record; ``` # AgentCustomEvent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AgentCustomEvent ```typescript import type { AgentCustomEvent } from '@threadplane/chat'; ``` ## AgentCustomEvent Escape hatch for runtime-specific or user-defined events that do not (yet) have a well-known structured variant. `name` carries the runtime event name; `data` carries the payload verbatim. ```typescript export interface AgentCustomEvent { readonly data: unknown; readonly name: string; readonly type: 'custom'; } ``` ### data ```typescript readonly data: unknown; ``` ### name ```typescript readonly name: string; ``` ### type ```typescript readonly type: 'custom'; ``` # AgentError Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AgentError ```typescript import { AgentError } from '@threadplane/chat'; ``` ## AgentError Structured, classified failure surfaced on `Agent.error`. Extends `Error`, so existing `.message` / `instanceof Error` reads keep working — but adds a machine-readable [AgentErrorKind](/docs/api/chat/AgentErrorKind), a `retryable` flag, an optional HTTP `status`, and the original `cause`. You rarely construct one yourself; adapters normalize raw failures via [toAgentError](/docs/api/chat/toAgentError). Read it off the agent to render legible, cause-specific UI: ```typescript export declare class AgentError extends Error { constructor(init: { kind: AgentErrorKind; message: string; retryable: boolean; status?: number; cause?: unknown; recovery?: AgentRecovery; detail?: string; }); readonly cause: unknown; readonly detail?: string; readonly kind: AgentErrorKind; readonly recovery?: AgentRecovery; readonly retryable: boolean; readonly status?: number; } ``` ```ts const err = agent.error(); // AgentError | undefined if (err) { console.warn(err.message); // legible, per-kind copy if (err.kind === 'auth') showApiKeyHelp(); if (err.retryable) showRetryButton(); // → agent.retry() } ``` ### Constructor · overload 1 Constructs a new instance of the `AgentError` class ```typescript constructor(init: { kind: AgentErrorKind; message: string; retryable: boolean; status?: number; cause?: unknown; recovery?: AgentRecovery; detail?: string; }); ``` ### cause The original raw error this was classified from, preserved for debugging/telemetry. ```typescript readonly cause: unknown; ``` ### detail A short sentence explaining the uncertainty. Adapters set this whenever `recovery` is `check` or `none`, and leave it undefined otherwise. It is the only thing a caller can show when `recovery` is `check` but the agent exposes no `checkStatus`, so omitting it there leaves the reader with a bare error and no path forward. ```typescript readonly detail?: string; ``` ### kind The classified failure type. See [AgentErrorKind](/docs/api/chat/AgentErrorKind). ```typescript readonly kind: AgentErrorKind; ``` ### recovery The recovery action the adapter can justify. Only set on `interrupted` errors; always `undefined` for every other [AgentErrorKind](/docs/api/chat/AgentErrorKind). ```typescript readonly recovery?: AgentRecovery; ``` ### retryable Whether retrying the same request could plausibly succeed: `connection` | `server` (5xx) → true; `auth` | `aborted` | non-auth `4xx` → false. For `interrupted`, this tracks [AgentRecovery](/docs/api/chat/AgentRecovery): true only when `recovery` is `retry`, because a dispatched request may already have run on the server. ```typescript readonly retryable: boolean; ``` ### status The HTTP status code when the failure came from an HTTP response. ```typescript readonly status?: number; ``` # AgentErrorKind Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AgentErrorKind ```typescript import type { AgentErrorKind } from '@threadplane/chat'; ``` ## AgentErrorKind The failure class of an [AgentError](/docs/api/chat/AgentError), used to drive UI and retry logic: - `connection` — offline / DNS / connection refused / `fetch` failed. Retryable. - `auth` — `401` / `403`; credentials or API key are wrong. Not retryable. - `server` — a `5xx` (retryable) or a non-auth `4xx` like `400`/`404`/`429` (not retryable). - `interrupted` — the stream closed mid-response after a run had started. Retryable only when `recovery` is `retry`; see [AgentRecovery](/docs/api/chat/AgentRecovery). - `aborted` — the user pressed stop; treated as a graceful idle, not surfaced as an error. ```typescript export type AgentErrorKind = 'connection' | 'auth' | 'server' | 'interrupted' | 'aborted'; ``` # AgentEvent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AgentEvent ```typescript import type { AgentEvent } from '@threadplane/chat'; ``` ## AgentEvent Discriminated union of events flowing on `Agent.events$`. Invariant: state lives on signals (`messages`, `status`, `toolCalls`, `state`, `interrupt`, `subagents`, `history`); events on `events$` carry only things that are not derivable from signals. New variants are added purely additively when patterns prove necessary. ```typescript export type AgentEvent = AgentStateUpdateEvent | AgentCustomEvent; ``` # AgentInterrupt Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AgentInterrupt ```typescript import type { AgentInterrupt } from '@threadplane/chat'; ``` ## AgentInterrupt A runtime interrupt payload, its identifier, and whether the agent can resume it. ```typescript export interface AgentInterrupt { id: string; resumable: boolean; value: unknown; } ``` ### id Stable identifier for this interrupt instance. ```typescript id: string; ``` ### resumable True when the runtime supports resuming via `submit({ resume })`. ```typescript resumable: boolean; ``` ### value Opaque payload the app renders. Runtime-specific shape. ```typescript value: unknown; ``` # AgentRecovery Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AgentRecovery ```typescript import type { AgentRecovery } from '@threadplane/chat'; ``` ## AgentRecovery What the adapter can safely offer after an unexpectedly closed stream: - `retry` — the request is known not to have been dispatched. Re-running it cannot duplicate server-side work. - `check` — the outcome is uncertain and the backend supports a read-only status check, so a caller may offer one. - `none` — the outcome is uncertain and nothing can verify it. Explain, and offer no action. ```typescript export type AgentRecovery = 'retry' | 'check' | 'none'; ``` # AgentRef Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AgentRef ```typescript import type { AgentRef } from '@threadplane/chat'; ``` ## AgentRef A typed handle that threads a state shape through Angular DI from `provideAgent(ref, …)` to `injectAgent(ref)` without per-call-site restatement of the generic. ```typescript export interface AgentRef { readonly token: InjectionToken>; } ``` ### token ```typescript readonly token: InjectionToken>; ``` # AgentRuntimeTelemetryEvent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AgentRuntimeTelemetryEvent ```typescript import type { AgentRuntimeTelemetryEvent } from '@threadplane/chat'; ``` ## AgentRuntimeTelemetryEvent Event names for agent runtime creation, requests, and stream lifecycle telemetry. ```typescript export type AgentRuntimeTelemetryEvent = 'tplane:runtime_instance_created' | 'tplane:runtime_request_created' | 'tplane:stream_started' | 'tplane:stream_ended' | 'tplane:stream_errored'; ``` # AgentRuntimeTelemetryPayload Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AgentRuntimeTelemetryPayload ```typescript import type { AgentRuntimeTelemetryPayload } from '@threadplane/chat'; ``` ## AgentRuntimeTelemetryPayload A runtime telemetry event paired with its properties. ```typescript export interface AgentRuntimeTelemetryPayload { event: AgentRuntimeTelemetryEvent; properties: AgentRuntimeTelemetryProperties; } ``` ### event ```typescript event: AgentRuntimeTelemetryEvent; ``` ### properties ```typescript properties: AgentRuntimeTelemetryProperties; ``` # AgentRuntimeTelemetryProperties Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AgentRuntimeTelemetryProperties ```typescript import type { AgentRuntimeTelemetryProperties } from '@threadplane/chat'; ``` ## AgentRuntimeTelemetryProperties Transport and optional request, model, timing, and error details attached to runtime telemetry. ```typescript export interface AgentRuntimeTelemetryProperties { durationMs?: number; errorClass?: string; model?: string; provider?: string; requestType?: string; surface?: string; transport: 'langgraph' | 'ag-ui' | 'custom' | string; } ``` ### durationMs ```typescript durationMs?: number; ``` ### errorClass ```typescript errorClass?: string; ``` ### model ```typescript model?: string; ``` ### provider ```typescript provider?: string; ``` ### requestType ```typescript requestType?: string; ``` ### surface ```typescript surface?: string; ``` ### transport ```typescript transport: 'langgraph' | 'ag-ui' | 'custom' | string; ``` # AgentRuntimeTelemetrySink Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AgentRuntimeTelemetrySink ```typescript import type { AgentRuntimeTelemetrySink } from '@threadplane/chat'; ``` ## AgentRuntimeTelemetrySink Receives runtime telemetry payloads synchronously or asynchronously. ```typescript export type AgentRuntimeTelemetrySink = (payload: AgentRuntimeTelemetryPayload) => void | Promise; ``` # AgentStateUpdateEvent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AgentStateUpdateEvent ```typescript import type { AgentStateUpdateEvent } from '@threadplane/chat'; ``` ## AgentStateUpdateEvent Render-state-store sync event. Adapters emit this when the runtime publishes a state-snapshot intended for the chat library's render store (used by generative UI and a2ui surfaces). ```typescript export interface AgentStateUpdateEvent { readonly data: Record; readonly type: 'state_update'; } ``` ### data ```typescript readonly data: Record; ``` ### type ```typescript readonly type: 'state_update'; ``` # AgentStatus Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AgentStatus ```typescript import type { AgentStatus } from '@threadplane/chat'; ``` ## AgentStatus The agent execution state exposed to chat consumers. ```typescript export type AgentStatus = 'idle' | 'running' | 'error'; ``` # AgentSubmitInput Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AgentSubmitInput ```typescript import type { AgentSubmitInput } from '@threadplane/chat'; ``` ## AgentSubmitInput A user message, interrupt resume payload, or runtime state patch submitted to an agent. ```typescript export interface AgentSubmitInput { message?: string | ContentBlock[]; resume?: unknown; state?: Record; } ``` ### message New user message to append. May be combined with `resume` and/or `state` in the same submit call. ```typescript message?: string | ContentBlock[]; ``` ### resume Resume payload for an active interrupt. ```typescript resume?: unknown; ``` ### state State patch to merge before submitting (runtime-interpreted). ```typescript state?: Record; ``` # AgentSubmitOptions Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AgentSubmitOptions ```typescript import type { AgentSubmitOptions } from '@threadplane/chat'; ``` ## AgentSubmitOptions Options for cancelling an agent submission through an abort signal. ```typescript export interface AgentSubmitOptions { signal?: AbortSignal; } ``` ### signal ```typescript signal?: AbortSignal; ``` # AgentUsage Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AgentUsage ```typescript import type { AgentUsage } from '@threadplane/chat'; ``` ## AgentUsage Usage for the most recent finished or errored run, one entry per provider and model. ```typescript export interface AgentUsage { entries: AgentUsageEntry[]; } ``` ### entries ```typescript entries: AgentUsageEntry[]; ``` # AgentUsageEntry Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AgentUsageEntry ```typescript import type { AgentUsageEntry } from '@threadplane/chat'; ``` ## AgentUsageEntry Token accounting for one run, as the runtime reported it. Every count is optional: absent means the provider did not report it, which is distinct from zero. Reasoning, cached, and cache-write counts are parts of the input/output totals, never additions to them. ```typescript export interface AgentUsageEntry { cachedInputTokens?: number; cacheWriteInputTokens?: number; inputTokens?: number; model?: string; outputTokens?: number; provider?: string; reasoningTokens?: number; totalTokens?: number; } ``` ### cachedInputTokens ```typescript cachedInputTokens?: number; ``` ### cacheWriteInputTokens ```typescript cacheWriteInputTokens?: number; ``` ### inputTokens ```typescript inputTokens?: number; ``` ### model ```typescript model?: string; ``` ### outputTokens ```typescript outputTokens?: number; ``` ### provider ```typescript provider?: string; ``` ### reasoningTokens ```typescript reasoningTokens?: number; ``` ### totalTokens ```typescript totalTokens?: number; ``` # AgentWithHistory Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AgentWithHistory ```typescript import type { AgentWithHistory } from '@threadplane/chat'; ``` ## AgentWithHistory Extension of Agent that exposes checkpoint history for time-travel UIs. Concrete adapters that record per-node checkpoints (e.g. LangGraph) should implement this. Pure request/response runtimes that don't have checkpoints should implement plain Agent. ```typescript export interface AgentWithHistory extends Agent { history: Signal; messageCheckpoints?: Signal>; } ``` ### history ```typescript history: Signal; ``` ### messageCheckpoints Optional reactive map of `messageId → checkpointId`, computed by walking history once: for each checkpoint, find the most recent assistant message present in its `values.messages` and pair them. UIs use this to anchor inline checkpoint markers on each assistant turn. Missing on adapters that don't compute it. ```typescript messageCheckpoints?: Signal>; ``` # AnyFunctionToolDef Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AnyFunctionToolDef ```typescript import type { AnyFunctionToolDef } from '@threadplane/chat'; ``` ## AnyFunctionToolDef Bivariant union member used only for registry storage/iteration. The handler param is `any` (NOT `never`): `any` is simultaneously a supertype any precise `FunctionToolDef` is assignable to under `strictFunctionTypes`, AND callable by internal code that has narrowed by `kind` and parsed runtime args. A `never` param would satisfy the former but break the latter. ```typescript export interface AnyFunctionToolDef { readonly description: string; readonly followUp?: boolean; readonly handler: (args: any, context: FunctionToolHandlerContext) => unknown | Promise; readonly idempotent?: boolean; readonly kind: 'function'; readonly schema: StandardSchemaV1; } ``` ### description ```typescript readonly description: string; ``` ### followUp ```typescript readonly followUp?: boolean; ``` ### handler ```typescript readonly handler: (args: any, context: FunctionToolHandlerContext) => unknown | Promise; ``` ### idempotent ```typescript readonly idempotent?: boolean; ``` ### kind ```typescript readonly kind: 'function'; ``` ### schema ```typescript readonly schema: StandardSchemaV1; ``` # ask Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ask ```typescript import { ask } from '@threadplane/chat'; ``` ## ask · overload 1 Interactive (human-in-the-loop) component tool — the model fills the component's props from the schema's output; the value the component emits back to the framework becomes the tool result sent to the model. The component's signal inputs are checked against the schema output type (strict-but-flexible: every schema key must be a declared input with an assignable type; the component may declare extra inputs the schema doesn't fill). Author the component with `ViewProps` to derive input prop types directly from the schema. ```typescript export declare function ask(description: string, schema: S, component: AcceptComponent, options?: ClientToolContinuationOptions): AskToolDef; ``` - **description**: Natural-language description the model sees. - **schema**: Standard Schema defining the props the model must supply. - **component**: Angular component whose signal inputs must be compatible with the schema output. A type-level error is reported here when they diverge. **Returns:** An [AskToolDef](/docs/api/chat/AskToolDef) for inclusion in [tools](/docs/api/chat/tools). ```ts const schema = z.object({ question: z.string(), options: z.array(z.string()) }); type Inputs = ViewProps; \@Component({ ... }) class ChoiceCardComponent { question = input.required(); options = input.required(); // Emits the chosen option back to the model. } const choice = ask('Ask the user to choose', schema, ChoiceCardComponent); const registry = tools({ pick_option: choice }); ``` # AskToolDef Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/AskToolDef ```typescript import type { AskToolDef } from '@threadplane/chat'; ``` ## AskToolDef Defines a schema-backed Angular tool view that resolves through a rendered user interaction. ```typescript export interface AskToolDef { readonly component: Type; readonly description: string; readonly followUp?: boolean; readonly kind: 'ask'; readonly schema: S; } ``` ### component ```typescript readonly component: Type; ``` ### description ```typescript readonly description: string; ``` ### followUp ```typescript readonly followUp?: boolean; ``` ### kind ```typescript readonly kind: 'ask'; ``` ### schema ```typescript readonly schema: S; ``` # buildA2uiActionMessage Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/buildA2uiActionMessage ```typescript import { buildA2uiActionMessage } from '@threadplane/chat'; ``` ## buildA2uiActionMessage · overload 1 Builds a v0.9 A2uiActionMessage from handler params and the current surface. The action.context is the resolved plain object the renderer produced from the component's `action.event.context`. Sets action.label when the source component is a Button with a Text child whose text is a non-empty bare literal. ```typescript export declare function buildA2uiActionMessage(params: Record, surface: A2uiSurface): A2uiActionMessage; ``` # cacheplaneMarkdownViews Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/cacheplaneMarkdownViews ```typescript import { cacheplaneMarkdownViews } from '@threadplane/chat'; ``` ## cacheplaneMarkdownViews Default view registry consumed by ``. Maps every `MarkdownNode.type` emitted by `@cacheplane/partial-markdown@0.2` to its corresponding Angular component. Override per-node-type via `withViews(cacheplaneMarkdownViews, { … })`. ```typescript cacheplaneMarkdownViews: ViewRegistry ``` # cancelledClientToolResult Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/cancelledClientToolResult ```typescript import { cancelledClientToolResult } from '@threadplane/chat'; ``` ## cancelledClientToolResult · overload 1 Result recorded when the user stops a run while a client tool is running. ```typescript export declare function cancelledClientToolResult(toolCallId: string): ClientToolResult; ``` # CHAT_LIFECYCLE Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/CHAT_LIFECYCLE ```typescript import { CHAT_LIFECYCLE } from '@threadplane/chat'; ``` ## CHAT_LIFECYCLE Injection token for the lifecycle signals provided by a chat component. ```typescript CHAT_LIFECYCLE: InjectionToken ``` # ChatActivityTemplateContext Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatActivityTemplateContext ```typescript import type { ChatActivityTemplateContext } from '@threadplane/chat'; ``` ## ChatActivityTemplateContext Template context for a per-message activity template projected into ``. One context is built for every assistant message. ```typescript export interface ChatActivityTemplateContext { $implicit: Message; agent: Agent; index: number; subagents: Subagent[]; toolCalls: ToolCall[]; } ``` ### $implicit The assistant message the activity belongs to (`let-message`). ```typescript $implicit: Message; ``` ### agent The agent bound to `` (`let-agent="agent"`). ```typescript agent: Agent; ``` ### index Index of the message in `agent.messages()` (`let-i="index"`). ```typescript index: number; ``` ### subagents Subagents spawned by this message's tool calls, anchored by `Subagent.toolCallId` and ordered like the spawning calls (`let-subagents="subagents"`). ```typescript subagents: Subagent[]; ``` ### toolCalls The tool calls this message emitted, in emission order, excluding the generative-UI dispatcher and view-backed tool names that `` never renders as cards (`let-toolCalls="toolCalls"`). ```typescript toolCalls: ToolCall[]; ``` # ChatActivityTemplateDirective Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatActivityTemplateDirective ```typescript import { ChatActivityTemplateDirective } from '@threadplane/chat'; ``` ## ChatActivityTemplateDirective Registers a per-message activity renderer on ``. When present, the template replaces the reasoning pill and the tool-call region (`` + ``) of every assistant message. Markdown, tool views, generative UI and message actions still render. The template renders at message level, so tall activity (nested subagent turns, approval cards) is never clipped by a trace body. Precedence: the activity template owns the whole region, so any `chatToolCallTemplate` projected into `` is not used while an activity template is present. Render `` inside the activity template to keep per-tool templates. Usage: ```html ``` ```typescript export declare class ChatActivityTemplateDirective { static ngTemplateContextGuard(_directive: ChatActivityTemplateDirective, context: unknown): context is ChatActivityTemplateContext; readonly templateRef: TemplateRef; } ``` **Angular selector:** `ng-template[chatActivityTemplate]` ### ngTemplateContextGuard · overload 1 ```typescript static ngTemplateContextGuard(_directive: ChatActivityTemplateDirective, context: unknown): context is ChatActivityTemplateContext; ``` ### templateRef ```typescript readonly templateRef: TemplateRef; ``` # ChatApprovalAction Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatApprovalAction ```typescript import type { ChatApprovalAction } from '@threadplane/chat'; ``` ## ChatApprovalAction Actions emitted by the approval dialog for the host to handle. ```typescript export type ChatApprovalAction = 'approve' | 'edit' | 'cancel'; ``` # ChatApprovalCardComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatApprovalCardComponent ```typescript import { ChatApprovalCardComponent } from '@threadplane/chat'; ``` ## ChatApprovalCardComponent Displays an approval dialog for a matching agent interrupt and emits approve, edit, or cancel actions. ```typescript export declare class ChatApprovalCardComponent { constructor(); readonly action: import("@angular/core").OutputEmitterRef; readonly agent: import("@angular/core").InputSignal>; readonly matchKind: import("@angular/core").InputSignal; readonly showEdit: import("@angular/core").InputSignal; readonly title: import("@angular/core").InputSignal; } ``` **Angular selector:** `chat-approval-card` - Input `agent` (required): `Agent` - Input `matchKind`: `string | undefined` - Input `showEdit`: `boolean` - Input `title`: `string` - Output `action`: `ChatApprovalAction` ### Constructor · overload 1 Constructs a new instance of the `ChatApprovalCardComponent` class ```typescript constructor(); ``` ### action ```typescript readonly action: import("@angular/core").OutputEmitterRef; ``` ### agent ```typescript readonly agent: import("@angular/core").InputSignal>; ``` ### matchKind ```typescript readonly matchKind: import("@angular/core").InputSignal; ``` ### showEdit ```typescript readonly showEdit: import("@angular/core").InputSignal; ``` ### title ```typescript readonly title: import("@angular/core").InputSignal; ``` # ChatCitationCardTemplateDirective Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatCitationCardTemplateDirective ```typescript import { ChatCitationCardTemplateDirective } from '@threadplane/chat'; ``` ## ChatCitationCardTemplateDirective ContentChild template directive for custom citation card rendering. ```html ... ``` ```typescript export declare class ChatCitationCardTemplateDirective { readonly tpl: TemplateRef<{ $implicit: Citation; }>; } ``` **Angular selector:** `ng-template[chatCitationCard]` ### tpl ```typescript readonly tpl: TemplateRef<{ $implicit: Citation; }>; ``` # ChatCitationPreviewComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatCitationPreviewComponent ```typescript import { ChatCitationPreviewComponent } from '@threadplane/chat'; ``` ## ChatCitationPreviewComponent Presentational provenance card for a single Citation. Rendered inside the inline marker's connected-overlay pane (hover/tap preview) — self-contained so its encapsulated styles apply even when portaled to the body-level pane. ```typescript export declare class ChatCitationPreviewComponent { readonly citation: import("@angular/core").InputSignal; } ``` **Angular selector:** `chat-citation-preview` - Input `citation` (required): `Citation` ### citation ```typescript readonly citation: import("@angular/core").InputSignal; ``` # ChatCitationsCardComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatCitationsCardComponent ```typescript import { ChatCitationsCardComponent } from '@threadplane/chat'; ``` ## ChatCitationsCardComponent Sources-panel detail card: index badge, favicon/monogram + domain + type, title, one-line snippet. Renders as an (opens the source) when a url is present, otherwise a non-interactive
. Shares the panel style module. ```typescript export declare class ChatCitationsCardComponent { readonly citation: import("@angular/core").InputSignal; } ``` **Angular selector:** `chat-citations-card` - Input `citation` (required): `Citation` ### citation ```typescript readonly citation: import("@angular/core").InputSignal; ``` # ChatCitationsComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatCitationsComponent ```typescript import { ChatCitationsComponent } from '@threadplane/chat'; ``` ## ChatCitationsComponent Renders an expandable sources panel combining message citations with markdown citation definitions. ```typescript export declare class ChatCitationsComponent { cardTpl: ChatCitationCardTemplateDirective | null; readonly heading: import("@angular/core").InputSignal; readonly message: import("@angular/core").InputSignal; } ``` **Angular selector:** `chat-citations` - Input `heading`: `string` - Input `message` (required): `Message` ### cardTpl ```typescript cardTpl: ChatCitationCardTemplateDirective | null; ``` ### heading ```typescript readonly heading: import("@angular/core").InputSignal; ``` ### message ```typescript readonly message: import("@angular/core").InputSignal; ``` # ChatComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatComponent ```typescript import { ChatComponent } from '@threadplane/chat'; ``` ## ChatComponent Composes an agent conversation with message input, streaming content, tool views, and customizable activity templates. Project `[chatInputFooter]` for composer help in both presentations, and `[chatFooterStatus]` for application-owned status below the transcript composer. ```typescript export declare class ChatComponent { constructor(); readonly activeThreadId: import("@angular/core").InputSignal; readonly activityTemplate: import("@angular/core").Signal; readonly agent: import("@angular/core").InputSignal>; classifyMessage(content: string, message: Pick): ContentClassifier; clearClassifiers(): void; clearDraft(): void; clearThread(): void; readonly clientToolContinuationLimit: import("@angular/core").OutputEmitterRef; readonly clientToolContinuationPolicy: import("@angular/core").InputSignal; readonly clientToolExecutionGuard: import("@angular/core").InputSignal; readonly clientTools: import("@angular/core").InputSignal> | undefined>; readonly excludedToolNames: import("@angular/core").Signal; readonly genuiToolNames: import("@angular/core").InputSignal; readonly handlers: import("@angular/core").InputSignal) => unknown | Promise>>; readonly interruptTemplate: import("@angular/core").Signal; readonly messageContent: typeof messageContent; readonly messageCopy: import("@angular/core").OutputEmitterRef<{ messageIndex: number; content: string; }>; readonly modelOptions: import("@angular/core").InputSignal; readonly modelPickerPlaceholder: import("@angular/core").InputSignal; onA2uiAction(message: A2uiActionMessage): void; onA2uiEvent(event: RenderEvent, messageIndex: number, surfaceId: string): void; onCopy(message: unknown, content: string): void; onRate(message: unknown, value: 'up' | 'down'): void; onRegenerate(messageIndex: number): void; onSpecEvent(event: RenderEvent, messageIndex: number): void; readonly placeholder: import("@angular/core").InputSignal; prevRole(index: number): ChatMessageRole | undefined; readonly rate: import("@angular/core").OutputEmitterRef<{ messageIndex: number; rating: "up" | "down"; }>; readonly regenerate: import("@angular/core").OutputEmitterRef; readonly renderEvent: import("@angular/core").OutputEmitterRef; readonly renderRegistry: import("@angular/core").Signal; readonly resolvedStore: import("@angular/core").Signal; readonly runActivityTemplate: import("@angular/core").Signal; scrollToBottom(): void; readonly selectedModel: import("@angular/core").ModelSignal; readonly showModelPicker: import("@angular/core").InputSignal; readonly showWelcome: import("@angular/core").Signal; readonly store: import("@angular/core").InputSignal; submitMessage(text: string): void; readonly threads: import("@angular/core").InputSignal; readonly threadSelected: import("@angular/core").OutputEmitterRef; readonly toolCallTemplates: import("@angular/core").Signal; readonly views: import("@angular/core").InputSignal>> | undefined>; readonly viewToolNames: import("@angular/core").Signal; readonly welcomeDisabled: import("@angular/core").InputSignal; } ``` **Angular selector:** `chat` - Input `activeThreadId`: `string` - Input `agent` (required): `Agent` - Input `clientToolContinuationPolicy`: `ClientToolContinuationPolicy | undefined` - Input `clientToolExecutionGuard`: `ClientToolExecutionGuard | undefined` - Input `clientTools`: `Readonly> | undefined` - Input `genuiToolNames`: `readonly string[]` - Input `handlers`: `Record) => unknown>` - Input `modelOptions`: `readonly ChatSelectOption[]` - Input `modelPickerPlaceholder`: `string` - Input `placeholder`: `string` - Input `selectedModel`: `string` - Input `showModelPicker`: `boolean` - Input `store`: `StateStore | undefined` - Input `threads`: `Thread[]` - Input `views`: `Readonly>> | undefined` - Input `welcomeDisabled`: `boolean` - Output `clientToolContinuationLimit`: `ClientToolContinuationLimitEvent` - Output `messageCopy`: `{ messageIndex: number; content: string; }` - Output `rate`: `{ messageIndex: number; rating: "up" | "down"; }` - Output `regenerate`: `void` - Output `renderEvent`: `ChatRenderEvent` - Output `selectedModelChange`: `string` - Output `threadSelected`: `string` ### Constructor · overload 1 Constructs a new instance of the `ChatComponent` class ```typescript constructor(); ``` ### activeThreadId ```typescript readonly activeThreadId: import("@angular/core").InputSignal; ``` ### activityTemplate Optional per-message activity renderer projected as ``. When present it replaces the reasoning pill and the tool-call region of every assistant message, and takes precedence over any projected `chatToolCallTemplate`. ```typescript readonly activityTemplate: import("@angular/core").Signal; ``` ### agent ```typescript readonly agent: import("@angular/core").InputSignal>; ``` ### classifyMessage · overload 1 ```typescript classifyMessage(content: string, message: Pick): ContentClassifier; ``` ### clearClassifiers · overload 1 ```typescript clearClassifiers(): void; ``` ### clearDraft · overload 1 Clears the local composer after an application-owned conversation reset. ```typescript clearDraft(): void; ``` ### clearThread · overload 1 Clears local view state (classifiers, surface store, lifecycle counters) for a new thread. Resets messageCount to 0 and inputSubmittedAt to null. componentReady and firstMessageSent are NOT reset (sticky for the chat instance lifetime). ```typescript clearThread(): void; ``` ### clientToolContinuationLimit ```typescript readonly clientToolContinuationLimit: import("@angular/core").OutputEmitterRef; ``` ### clientToolContinuationPolicy ```typescript readonly clientToolContinuationPolicy: import("@angular/core").InputSignal; ``` ### clientToolExecutionGuard ```typescript readonly clientToolExecutionGuard: import("@angular/core").InputSignal; ``` ### clientTools Client-declared tools (`view`/`ask`/`function`) the model may call. When provided, a coordinator ships their catalog to the agent, runs `function` tools in the browser, and renders/resolves `view`/`ask` tools through the same tool-views pipeline as `views`. Additive — leave undefined for the classic server-tools-only experience. ```typescript readonly clientTools: import("@angular/core").InputSignal> | undefined>; ``` ### excludedToolNames Union of GenUI dispatcher tool names and registered view tool names. ```typescript readonly excludedToolNames: import("@angular/core").Signal; ``` ### genuiToolNames Tool names whose calls produce a rendered GenUI surface rather than visible text. Used to (a) filter so internal dispatchers don't render args JSON as cards, and (b) detect "this is a GenUI turn" for the building-UI skeleton. Default covers the canonical A2UI + json-render schema tools. ```typescript readonly genuiToolNames: import("@angular/core").InputSignal; ``` ### handlers ```typescript readonly handlers: import("@angular/core").InputSignal) => unknown | Promise>>; ``` ### interruptTemplate Optional interrupt renderer projected as ``. Rendered at the end of the transcript while `agent.interrupt()` is defined. ```typescript readonly interruptTemplate: import("@angular/core").Signal; ``` ### messageContent ```typescript readonly messageContent: typeof messageContent; ``` ### messageCopy Emitted when the user copies an assistant message. ```typescript readonly messageCopy: import("@angular/core").OutputEmitterRef<{ messageIndex: number; content: string; }>; ``` ### modelOptions High-level model-picker API. When `modelOptions` is non-empty, the chat composition renders a `` inside the input pill (in BOTH welcome and conversation modes), wired to the two-way `selectedModel` model. Consumers who want full control should leave `modelOptions` empty and project a `` themselves. ```typescript readonly modelOptions: import("@angular/core").InputSignal; ``` ### modelPickerPlaceholder ```typescript readonly modelPickerPlaceholder: import("@angular/core").InputSignal; ``` ### onA2uiAction · overload 1 ```typescript onA2uiAction(message: A2uiActionMessage): void; ``` ### onA2uiEvent · overload 1 ```typescript onA2uiEvent(event: RenderEvent, messageIndex: number, surfaceId: string): void; ``` ### onCopy · overload 1 ```typescript onCopy(message: unknown, content: string): void; ``` ### onRate · overload 1 ```typescript onRate(message: unknown, value: 'up' | 'down'): void; ``` ### onRegenerate · overload 1 Regenerate the assistant response at the given message index. ```typescript onRegenerate(messageIndex: number): void; ``` ### onSpecEvent · overload 1 ```typescript onSpecEvent(event: RenderEvent, messageIndex: number): void; ``` ### placeholder Placeholder shared by welcome and transcript composers. ```typescript readonly placeholder: import("@angular/core").InputSignal; ``` ### prevRole · overload 1 ```typescript prevRole(index: number): ChatMessageRole | undefined; ``` ### rate Emitted when the user rates an assistant message. ```typescript readonly rate: import("@angular/core").OutputEmitterRef<{ messageIndex: number; rating: "up" | "down"; }>; ``` ### regenerate Emitted when the user clicks the regenerate button on an assistant message. ```typescript readonly regenerate: import("@angular/core").OutputEmitterRef; ``` ### renderEvent ```typescript readonly renderEvent: import("@angular/core").OutputEmitterRef; ``` ### renderRegistry ```typescript readonly renderRegistry: import("@angular/core").Signal; ``` ### resolvedStore ```typescript readonly resolvedStore: import("@angular/core").Signal; ``` ### runActivityTemplate Optional turn-level run renderer projected as ``. Rendered after the last message while a run is active and has no assistant message yet, in place of the typing indicator. ```typescript readonly runActivityTemplate: import("@angular/core").Signal; ``` ### scrollToBottom · overload 1 Scrolls the transcript to its newest content and re-pins it, exactly as the scroll-to-bottom bubble does. Hosts that apply many messages in one pass (a replay seeking to a recorded time, a restored thread rendered after tool views mount) call this once their layout has settled: the chat's own pin runs when messages change, which can be before the views that follow them have rendered. The write is counted as programmatic so the scroll event it raises does not read as the user unpinning. ```typescript scrollToBottom(): void; ``` ### selectedModel ```typescript readonly selectedModel: import("@angular/core").ModelSignal; ``` ### showModelPicker When `false`, hide the auto-rendered model picker even when `modelOptions` is non-empty. Useful in cramped surfaces (popup, sidebar) where the picker crowds the input. Defaults to `true`. Has no effect when consumers project their own `` via content projection. ```typescript readonly showModelPicker: import("@angular/core").InputSignal; ``` ### showWelcome ```typescript readonly showWelcome: import("@angular/core").Signal; ``` ### store ```typescript readonly store: import("@angular/core").InputSignal; ``` ### submitMessage · overload 1 Programmatic submit. Calls `agent.submit({ message: text })` and updates the CHAT_LIFECYCLE signals. Trimmed-empty text is a no-op. ```typescript submitMessage(text: string): void; ``` ### threads ```typescript readonly threads: import("@angular/core").InputSignal; ``` ### threadSelected ```typescript readonly threadSelected: import("@angular/core").OutputEmitterRef; ``` ### toolCallTemplates Per-tool-name templates projected as ``. Collected here and passed to each message's ``, which cannot query templates re-projected through ``. Unused while an `activityTemplate` is present. ```typescript readonly toolCallTemplates: import("@angular/core").Signal; ``` ### views ```typescript readonly views: import("@angular/core").InputSignal>> | undefined>; ``` ### viewToolNames Tool names that have a registered view (keys of the effective view registry, including client-declared view/ask tools). These render as inline tool-views and are excluded from the default tool-call card so they don't render twice. ```typescript readonly viewToolNames: import("@angular/core").Signal; ``` ### welcomeDisabled ```typescript readonly welcomeDisabled: import("@angular/core").InputSignal; ``` # ChatConfirmDialogComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatConfirmDialogComponent ```typescript import { ChatConfirmDialogComponent } from '@threadplane/chat'; ``` ## ChatConfirmDialogComponent Renders a configurable confirmation dialog and emits confirm or cancel actions. ```typescript export declare class ChatConfirmDialogComponent { constructor(); readonly body: import("@angular/core").InputSignal; readonly cancelLabel: import("@angular/core").InputSignal; readonly cancelled: import("@angular/core").OutputEmitterRef; readonly confirmed: import("@angular/core").OutputEmitterRef; readonly confirmLabel: import("@angular/core").InputSignal; readonly open: import("@angular/core").InputSignal; readonly title: import("@angular/core").InputSignal; readonly tone: import("@angular/core").InputSignal<"normal" | "destructive">; } ``` **Angular selector:** `chat-confirm-dialog` - Input `body`: `string` - Input `cancelLabel`: `string` - Input `confirmLabel`: `string` - Input `open`: `boolean` - Input `title`: `string` - Input `tone`: `"normal" | "destructive"` - Output `cancelled`: `void` - Output `confirmed`: `void` ### Constructor · overload 1 Constructs a new instance of the `ChatConfirmDialogComponent` class ```typescript constructor(); ``` ### body ```typescript readonly body: import("@angular/core").InputSignal; ``` ### cancelLabel ```typescript readonly cancelLabel: import("@angular/core").InputSignal; ``` ### cancelled ```typescript readonly cancelled: import("@angular/core").OutputEmitterRef; ``` ### confirmed ```typescript readonly confirmed: import("@angular/core").OutputEmitterRef; ``` ### confirmLabel ```typescript readonly confirmLabel: import("@angular/core").InputSignal; ``` ### open ```typescript readonly open: import("@angular/core").InputSignal; ``` ### title ```typescript readonly title: import("@angular/core").InputSignal; ``` ### tone ```typescript readonly tone: import("@angular/core").InputSignal<"normal" | "destructive">; ``` # ChatConnectedOverlayDirective Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatConnectedOverlayDirective ```typescript import { ChatConnectedOverlayDirective } from '@threadplane/chat'; ``` ## ChatConnectedOverlayDirective Applied to an ``. When `chatOverlayOpen` is true, the template content is portaled into the shared body-level overlay container and positioned connected to `chatOverlayOrigin`, repositioning live on scroll/resize. Closes on outside mousedown (via the `chatOverlayOutsideClick` output) and Tab; returns focus to the origin when focus was inside the pane. NOTE: the directive does not own the open state — it only emits. To fully close the overlay, consumers MUST handle BOTH `(chatOverlayOutsideClick)` and `(chatOverlayDetach)`. Tab-close (and Escape, when the consumer routes it) surface through `chatOverlayDetach`, so wiring only `chatOverlayOutsideClick` leaves the overlay stuck open on Tab. ```typescript export declare class ChatConnectedOverlayDirective { constructor(); readonly attached: import("@angular/core").OutputEmitterRef; readonly detached: import("@angular/core").OutputEmitterRef; readonly open: import("@angular/core").InputSignal; readonly origin: import("@angular/core").InputSignal; readonly outsideClick: import("@angular/core").OutputEmitterRef; readonly panelClass: import("@angular/core").InputSignal; readonly positions: import("@angular/core").InputSignal; } ``` **Angular selector:** `[chatConnectedOverlay]` - Input `chatOverlayOpen`: `boolean` - Input `chatOverlayOrigin` (required): `ChatOverlayOriginDirective` - Input `chatOverlayPanelClass`: `string | string[]` - Input `chatOverlayPositions`: `ConnectedPosition[]` - Output `chatOverlayAttached`: `HTMLElement` - Output `chatOverlayDetach`: `void` - Output `chatOverlayOutsideClick`: `MouseEvent` ### Constructor · overload 1 Constructs a new instance of the `ChatConnectedOverlayDirective` class ```typescript constructor(); ``` ### attached Emits the pane element once attached (consumers focus content from it). ```typescript readonly attached: import("@angular/core").OutputEmitterRef; ``` ### detached ```typescript readonly detached: import("@angular/core").OutputEmitterRef; ``` ### open ```typescript readonly open: import("@angular/core").InputSignal; ``` ### origin ```typescript readonly origin: import("@angular/core").InputSignal; ``` ### outsideClick ```typescript readonly outsideClick: import("@angular/core").OutputEmitterRef; ``` ### panelClass ```typescript readonly panelClass: import("@angular/core").InputSignal; ``` ### positions ```typescript readonly positions: import("@angular/core").InputSignal; ``` # ChatErrorComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatErrorComponent ```typescript import { ChatErrorComponent } from '@threadplane/chat'; ``` ## ChatErrorComponent Displays the agent error and offers retry or status recovery actions when supported. ```typescript export declare class ChatErrorComponent { readonly agent: import("@angular/core").InputSignal>; } ``` **Angular selector:** `chat-error` - Input `agent` (required): `Agent` ### agent ```typescript readonly agent: import("@angular/core").InputSignal>; ``` # ChatGenerativeUiComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatGenerativeUiComponent ```typescript import { ChatGenerativeUiComponent } from '@threadplane/chat'; ``` ## ChatGenerativeUiComponent Renders a normalized json-render specification with optional registry, state store, and event handlers. ```typescript export declare class ChatGenerativeUiComponent { constructor(); readonly events: import("@angular/core").OutputEmitterRef; readonly handlers: import("@angular/core").InputSignal) => unknown | Promise> | undefined>; readonly loading: import("@angular/core").InputSignal; readonly registry: import("@angular/core").InputSignal; readonly spec: import("@angular/core").InputSignal; readonly store: import("@angular/core").InputSignal; } ``` **Angular selector:** `chat-generative-ui` - Input `handlers`: `Record) => unknown> | undefined` - Input `loading`: `boolean` - Input `registry`: `AngularRegistry | undefined` - Input `spec`: `Spec | null` - Input `store`: `StateStore | undefined` - Output `events`: `RenderEvent` ### Constructor · overload 1 Constructs a new instance of the `ChatGenerativeUiComponent` class ```typescript constructor(); ``` ### events ```typescript readonly events: import("@angular/core").OutputEmitterRef; ``` ### handlers ```typescript readonly handlers: import("@angular/core").InputSignal) => unknown | Promise> | undefined>; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### registry ```typescript readonly registry: import("@angular/core").InputSignal; ``` ### spec ```typescript readonly spec: import("@angular/core").InputSignal; ``` ### store ```typescript readonly store: import("@angular/core").InputSignal; ``` # ChatGenuiSkeletonComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatGenuiSkeletonComponent ```typescript import { ChatGenuiSkeletonComponent } from '@threadplane/chat'; ``` ## ChatGenuiSkeletonComponent Displays an animated loading placeholder while generative UI is being built. ```typescript export declare class ChatGenuiSkeletonComponent { } ``` **Angular selector:** `chat-genui-skeleton` # ChatHistorySearchPaletteComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatHistorySearchPaletteComponent ```typescript import { ChatHistorySearchPaletteComponent } from '@threadplane/chat'; ``` ## ChatHistorySearchPaletteComponent Displays a conversation search dialog with a bound query, supplied results, and keyboard selection. ```typescript export declare class ChatHistorySearchPaletteComponent { constructor(); readonly closed: import("@angular/core").OutputEmitterRef; readonly loading: import("@angular/core").InputSignal; readonly open: import("@angular/core").ModelSignal; readonly placeholder: import("@angular/core").InputSignal; readonly query: import("@angular/core").ModelSignal; readonly results: import("@angular/core").InputSignal; readonly threadSelected: import("@angular/core").OutputEmitterRef; } ``` **Angular selector:** `chat-history-search-palette` - Input `loading`: `boolean` - Input `open`: `boolean` - Input `placeholder`: `string` - Input `query`: `string` - Input `results`: `ThreadMatch[]` - Output `closed`: `void` - Output `openChange`: `boolean` - Output `queryChange`: `string` - Output `threadSelected`: `string` ### Constructor · overload 1 Constructs a new instance of the `ChatHistorySearchPaletteComponent` class ```typescript constructor(); ``` ### closed ```typescript readonly closed: import("@angular/core").OutputEmitterRef; ``` ### loading ```typescript readonly loading: import("@angular/core").InputSignal; ``` ### open ```typescript readonly open: import("@angular/core").ModelSignal; ``` ### placeholder ```typescript readonly placeholder: import("@angular/core").InputSignal; ``` ### query ```typescript readonly query: import("@angular/core").ModelSignal; ``` ### results ```typescript readonly results: import("@angular/core").InputSignal; ``` ### threadSelected ```typescript readonly threadSelected: import("@angular/core").OutputEmitterRef; ``` # ChatInputComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatInputComponent ```typescript import { ChatInputComponent } from '@threadplane/chat'; ``` ## ChatInputComponent Provides an auto-resizing message composer that submits to an agent and can stop its current response. ```typescript export declare class ChatInputComponent { constructor(); readonly agent: import("@angular/core").InputSignal>; readonly canStop: import("@angular/core").Signal; readonly canSubmit: import("@angular/core").Signal; clearDraft(): void; readonly focused: import("@angular/core").WritableSignal; focusTextarea(): void; readonly isLoading: import("@angular/core").Signal; readonly messageText: import("@angular/core").WritableSignal; onKeydown(event: KeyboardEvent): void; onStop(): void; onSubmit(): void; readonly placeholder: import("@angular/core").InputSignal; readonly showStopButton: import("@angular/core").InputSignal; readonly stopped: import("@angular/core").OutputEmitterRef; readonly submitOnEnter: import("@angular/core").InputSignal; readonly submitted: import("@angular/core").OutputEmitterRef; } ``` **Angular selector:** `chat-input` - Input `agent` (required): `Agent` - Input `placeholder`: `string` - Input `showStopButton`: `boolean` - Input `submitOnEnter`: `boolean` - Output `stopped`: `void` - Output `submitted`: `string` ### Constructor · overload 1 Auto-resize the textarea to fit its content as the user types or pastes multi-line text. Caps at min(40vh, 320px); beyond that the textarea scrolls. Without this, multi-line input is hidden behind the rows="1" fixed height (caught by live browser smoke). ```typescript constructor(); ``` ### agent ```typescript readonly agent: import("@angular/core").InputSignal>; ``` ### canStop The stop button only appears when the consumer opted in AND we're loading. ```typescript readonly canStop: import("@angular/core").Signal; ``` ### canSubmit Submit is allowed only when not loading and there's non-whitespace text. ```typescript readonly canSubmit: import("@angular/core").Signal; ``` ### clearDraft · overload 1 Clears the local draft after a successful submit or application-owned reset. ```typescript clearDraft(): void; ``` ### focused ```typescript readonly focused: import("@angular/core").WritableSignal; ``` ### focusTextarea · overload 1 ```typescript focusTextarea(): void; ``` ### isLoading ```typescript readonly isLoading: import("@angular/core").Signal; ``` ### messageText ```typescript readonly messageText: import("@angular/core").WritableSignal; ``` ### onKeydown · overload 1 ```typescript onKeydown(event: KeyboardEvent): void; ``` ### onStop · overload 1 Abort the current streaming response (if the adapter supports it). ```typescript onStop(): void; ``` ### onSubmit · overload 1 ```typescript onSubmit(): void; ``` ### placeholder ```typescript readonly placeholder: import("@angular/core").InputSignal; ``` ### showStopButton When true (default), shows a stop button while the agent is streaming. ```typescript readonly showStopButton: import("@angular/core").InputSignal; ``` ### stopped ```typescript readonly stopped: import("@angular/core").OutputEmitterRef; ``` ### submitOnEnter ```typescript readonly submitOnEnter: import("@angular/core").InputSignal; ``` ### submitted ```typescript readonly submitted: import("@angular/core").OutputEmitterRef; ``` # ChatInterruptComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatInterruptComponent ```typescript import { ChatInterruptComponent } from '@threadplane/chat'; ``` ## ChatInterruptComponent Displays the agent’s current interrupt using a projected template or a default payload preview. ```typescript export declare class ChatInterruptComponent { readonly agent: import("@angular/core").InputSignal>; defaultText(i: AgentInterrupt): string; readonly interrupt: import("@angular/core").Signal; readonly templateRef: import("@angular/core").Signal | undefined>; } ``` **Angular selector:** `chat-interrupt` - Input `agent` (required): `Agent` ### agent ```typescript readonly agent: import("@angular/core").InputSignal>; ``` ### defaultText · overload 1 ```typescript defaultText(i: AgentInterrupt): string; ``` ### interrupt ```typescript readonly interrupt: import("@angular/core").Signal; ``` ### templateRef ```typescript readonly templateRef: import("@angular/core").Signal | undefined>; ``` # ChatInterruptPanelComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatInterruptPanelComponent ```typescript import { ChatInterruptPanelComponent } from '@threadplane/chat'; ``` ## ChatInterruptPanelComponent Displays the agent’s current interrupt reason and emits accept, edit, respond, or ignore actions. ```typescript export declare class ChatInterruptPanelComponent { readonly action: import("@angular/core").OutputEmitterRef; readonly agent: import("@angular/core").InputSignal>; readonly interrupt: import("@angular/core").Signal; readonly interruptReason: import("@angular/core").Signal; } ``` **Angular selector:** `chat-interrupt-panel` - Input `agent` (required): `Agent` - Output `action`: `InterruptAction` ### action ```typescript readonly action: import("@angular/core").OutputEmitterRef; ``` ### agent ```typescript readonly agent: import("@angular/core").InputSignal>; ``` ### interrupt ```typescript readonly interrupt: import("@angular/core").Signal; ``` ### interruptReason ```typescript readonly interruptReason: import("@angular/core").Signal; ``` # ChatInterruptTemplateContext Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatInterruptTemplateContext ```typescript import type { ChatInterruptTemplateContext } from '@threadplane/chat'; ``` ## ChatInterruptTemplateContext Template context for the interrupt template projected into ``. ```typescript export interface ChatInterruptTemplateContext { $implicit: Agent; interrupt: AgentInterrupt; } ``` ### $implicit The agent bound to `` (`let-agent`). ```typescript $implicit: Agent; ``` ### interrupt The pending interrupt, read from `agent.interrupt()` (`let-interrupt="interrupt"`). Runtimes that expose a full interrupt batch do so on their own agent type, reachable through `$implicit`. ```typescript interrupt: AgentInterrupt; ``` # ChatInterruptTemplateDirective Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatInterruptTemplateDirective ```typescript import { ChatInterruptTemplateDirective } from '@threadplane/chat'; ``` ## ChatInterruptTemplateDirective Registers an interrupt renderer on ``. While the agent has a pending interrupt (`agent.interrupt()` is defined), the template renders at the end of the transcript, inside the scroll region and after any run activity, so approval cards and other human-in-the-loop UI sit in the conversation. With no pending interrupt, or no template, nothing renders: `` has no default interrupt UI. Usage: ```html ``` ```typescript export declare class ChatInterruptTemplateDirective { static ngTemplateContextGuard(_directive: ChatInterruptTemplateDirective, context: unknown): context is ChatInterruptTemplateContext; readonly templateRef: TemplateRef; } ``` **Angular selector:** `ng-template[chatInterruptTemplate]` ### ngTemplateContextGuard · overload 1 ```typescript static ngTemplateContextGuard(_directive: ChatInterruptTemplateDirective, context: unknown): context is ChatInterruptTemplateContext; ``` ### templateRef ```typescript readonly templateRef: TemplateRef; ``` # ChatLauncherButtonComponent Package: `@threadplane/chat` · 0.3.7 Reference: /docs/api/chat/ChatLauncherButtonComponent ```typescript import { ChatLauncherButtonComponent } from '@threadplane/chat'; ``` ## ChatLauncherButtonComponent Renders an open-chat button and emits its clicks. ```typescript export declare class ChatLauncherButtonComponent { readonly clicked: import("@angular/core").OutputEmitterRef; } ``` **Angular selector:** `chat-launcher-button` - Output `clicked`: `void` ### clicked Fires when the inner