Architecture and exports
This page is for developers who already finished the quick start and want to understand which part of the A2UI stack owns each responsibility.
Responsibilities
Package contents
<A2UI>: all-in-one component that owns aMessageProcessor, subscribes to a developer-suppliedMessageStore, and renders the most recent surface.MessageStore: an append-only buffer of raw protocol messages the developer pushes into from any IO transport, such as fetch, SSE, WebSocket, or an in-process mock.defineCatalog,mergeCatalogs,serializeCatalog, anddefineFunction: the catalog API. There is no global component catalog; every consumer composes the component and function entries it wants.catalog/<Name>: built-in component renderers (Text,Image,Row,Column,List,Card,Modal,Button,Divider,Icon,CheckBox,ChoicePicker,DateTimeInput,LineChart,PieChart,RadioGroup,Slider,TextField, andTabs).catalog/<Name>/catalog.json: per-component JSON-Schema manifests for Agent handshakes.basicFunctions: A2UI v0.9 basic-catalog client function entries, ready to spread intocatalogs.
Exports
@lynx-js/genui/a2ui:<A2UI>,createMessageStore,defineCatalog, built-ins, basic functions, and protocol types.@lynx-js/genui/a2ui/catalog: re-exports of the catalog API and built-ins for tree-shake-friendly subpath access.@lynx-js/genui/a2ui/catalog/<Name>: import a single built-in.@lynx-js/genui/a2ui/catalog/<Name>/catalog.json: import the per-component manifest.@lynx-js/genui/a2ui/store:MessageStore,MessageProcessor,Resource, payload normalizers — the pure data layer.@lynx-js/genui/a2ui/react: helpers used by custom catalog components, includingNodeRenderer,useAction,useDataBinding, anduseChecks.@lynx-js/genui/a2ui/functions: basic-catalog function entries and registration helpers.@lynx-js/genui/a2ui/styles/theme.css: optional default CSS tokens for.a2ui-lightand.a2ui-dark.
<A2UI> lifecycle notes
- It owns its own
MessageProcessorper mount. Passing a differentmessageStoreinstance does not reset internal state; use akeyderived from your turn or session id when you want a fresh session. onActionis fire-and-forget. The renderer does not wait for a response. Your Agent pushes follow-up messages back into the sameMessageStore.classNameapplies to the surface root view (surface-${surfaceId}).wrapSurfaceapplies an outer wrapper around the rendered surface.classNameandwrapSurfacecan both support theme switching; choose the layer that matches your styling strategy.

