Overview and architecture
Lynx XML generates a complete .lynxml file containing the code and styles
needed to render a Vanilla Lynx page. @lynx-js/genui/lynx-xml supplies the
generation contract and deterministic processing utilities; the consuming
application supplies the model and runtime.
Where Lynx XML fits
A2UI and OpenUI describe UI as data interpreted by trusted components in a
ReactLynx application. Lynx XML generates standalone executable UI source. Use
it when a task needs a complete page artifact with model-authored state and
interactions, and your host can load .lynxml files.
There is no Catalog or Library to register. The contract comes from the system prompt, the selected transformation features, and the target Lynx runtime.
Responsibilities
Processing pipeline
Keep raw streaming deltas available for generation progress. Run transformation on the complete response before preview or delivery. For Direct mode with all transformation features disabled, normalize the model response directly.
Transformation runs locally without executing generated JavaScript or making another model request. It performs syntax and contract checks required by enabled features. Normalization checks the final artifact contract; execution and rendering remain runtime responsibilities.
Generation modes
Template transforms the static element tree deterministically. State and interactions remain model-authored. Without ScriptReuse, the model also owns lifecycle registration.
The generated contract targets the main thread: page state, UI interactions,
and lifecycle callbacks live in one <script thread="main">. Prompts omit
background execution and cross-thread instructions. This generation policy
does not change existing parser or renderer support for background scripts.
Independent transformation features
All three features are independently opt-in in the package API. Prompt and transformation must use matching values. Template and ScriptReuse artifacts contain an intermediate contract and must be transformed before runtime delivery.
GenUI Create and new Lynx XML Bench groups enable these features by default. Saved product settings and historical compatibility are described in the artifact guide. Design guidance is composed separately by GenUI Server and is not a transformation feature of this package.
Validation boundary
normalizeLynxXmlArtifact is the public entry point for extracting, normalizing,
and checking the final artifact. Callers do not need a separate extraction step.
Its checks do not establish JavaScript, CSS, Element PAPI, or rendering
correctness. Use runtime previews for those checks.
Continue with Artifacts and validation, System prompts, or the Introduction.

