This is the dev preview website. Check out the document at lynxjs.org

Home > @lynx-js/genui

genui package

Classes

Functions

Function

Description

buildA2UISystemPrompt(opts)

createA2UICatalog(options)

createA2UICatalogFromManifests(options)

createFallbackMessagesFromPlainText(text)

Build a single-Text fallback message stream from a plain string. Used by transports / Session.ingest callers that receive free-form text from the agent instead of structured protocol messages.

createMessageStore(options)

createOpenUiLibrary(options)

createResource(id)

createTextCardMessages(text)

Build a Card-wrapped Text fallback message stream from a plain string. Used when the agent emits text payloads with kind: 'text'.

defineComponent(config)

executeFunctionCall(processor, fn, surfaceId, dataContextPath, options)

Resolve arguments, look the function up in the registry, and invoke it. When no impl is registered, log once and return undefined so callers (checks, dynamic-property bindings) can degrade gracefully.

extractCatalogComponents(options)

extractCatalogComponentsFromTypeDocJson(project, options)

extractCatalogComponentsFromTypeDocProject(project, options)

extractCatalogFunctions(options)

extractCatalogFunctionsFromTypeDocJson(project, options)

extractCatalogFunctionsFromTypeDocProject(project, options)

findCatalogSourceFiles(inputPath)

isDataBinding(value)

isFunctionCall(value)

normalizePayloadToMessages(payload)

Normalize an arbitrary payload (string, array, object) into a flat list of ServerToClientMessage records. Pass-through for already-structured messages; falls back to wrapping plain text in a Text/Card surface.

OpenUiRenderer(props)

prepareMessagesForProcessing(rawMessages, messageId, activeSurfaceIds)

Tag messages with the given messageId and report whether any of them carries a non-empty updateComponents. Also dedupes createSurface messages against the set of currently-active surfaces.

readA2UICatalogFromDirectory(options)

registerBasicFunctions()

Manual escape hatch for consumers who build their own renderer and don't go through defineCatalog. Registers every adapted basic-catalog impl into the shared functionRegistry. Calling more than once is harmless — later registrations override earlier ones, which is the intended override path.

renderCatalogReference(catalog)

resolveDynamicValue(processor, value, surfaceId, dataContextPath, options)

resolveFunctionArguments(processor, args, surfaceId, dataContextPath, options)

useAction(props)

useChecks(options)

Evaluate an input component's checks array reactively. Returns the current outcome plus the first failure message (handy for inline error rendering). When an enclosing <FormContext.Provider> exists, the input is also registered with it so Buttons in the same form can react to isValid.

useDataBinding(dynamicValue, surface, dataContextPath, fallbackValue)

useResolvedProps(properties, surface, dataContextPath, processor, functions)

writeCatalogArtifacts(options)

Bootstrap TypeDoc once and emit both component and function catalog files. Preferred entry point for the CLI — running the conversion twice doubles cold-start latency on large catalogs.

writeCatalogComponents(components, options)

writeCatalogFunctionDefinitions(options)

writeCatalogFunctions(functions, options)

writeComponentCatalogs(options)

Interfaces

Interface

Description

A2UIComponentProp

A2UIComponentSpec

A2UIEvent

A2UIExample

A2UIFunctionSpec

A2UIPromptCatalog

A2UIPromptJsonSchema

A2UIProps

ActionProps

BuildSystemPromptOptions

CatalogArtifacts

CatalogFunction

A function discovered in source via @a2uiFunction, with its origin path.

CheckLike

A v0.9 CheckRule is { condition, message } where condition is a boolean, a DataBinding, or a FunctionCall. We accept the loose unknown shape so component props don't have to import the v0_9 types just to pass them through.

ComponentRenderProps

CreateOpenUiLibraryOptions

ExtractCatalogFromTypeDocOptions

ExtractCatalogOptions

ExtractedA2UICatalog

ExtractedCatalogComponent

ExtractedJsonSchema

FunctionCallContext

Runtime context passed to client-side function implementations. It mirrors the small DataContext subset used by upstream A2UI basic functions while staying tied to this renderer's MessageProcessor + SignalStore.

FunctionDefinition

FunctionEntry

GenericComponentProps

MessageStore

A pure append-only buffer of raw protocol messages produced by the developer's IO module. The store knows nothing about the v0.9 protocol — it does not parse, process, or interpret messages. It only:

  1. Stores them in arrival order. 2. Notifies subscribers when new ones land. 3. Hands the current snapshot back via getSnapshot() (referentially stable between mutations — required by useSyncExternalStore).

Protocol-aware processing — surfaces, signals, resources, action dispatch — is the responsibility of <A2UI> (the renderer component). Developers who don't want to learn the protocol should use <A2UI>; developers who do can run their own MessageProcessor against the snapshot directly.

MessageStoreOptions

RawResource

ReadA2UICatalogDirectoryOptions

ResolveFunctionOptions

ResourceInfo

Surface

TypeDocComment

TypeDocCommentDisplayPart

TypeDocCommentTag

TypeDocProject

TypeDocReflection

TypeDocSignature

TypeDocSource

TypeDocType

UserActionPayload

WriteComponentCatalogOptions

Variables

Variable

Description

A2UI_PROTOCOL_VERSION

A2UI_SYSTEM_PROMPT

A2UI

BASIC_CATALOG_EXAMPLES

BASIC_CATALOG_ID

BASIC_CATALOG

basicFunctions

The A2UI 0.9 basic-catalog function implementations packaged as CatalogFunctionEntrys, ready to spread into <A2UI catalogs={[...]}>. The impls themselves come from @a2ui/web_core so we stay aligned with the upstream spec for free.

functionRegistry

NodeRenderer

Type Aliases

Type Alias

Description

A2UIClientEventMessage

ComponentInstance

ComponentRenderer

DefinedComponent

FunctionImpl

Function implementations live on the client; the agent only references functions by name. The registry is the bridge from the wire-level FunctionCall.call string to the actual code that runs locally.

Library

LibraryDefinition

Resource

ResourceStatus

ServerToClientMessage

SurfaceId