Skip to content

API Reference parrot.outputs.a2ui_renderers.ssr_html

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.outputs.a2ui_renderers.ssr_html

View source

SSR-HTML renderer (Module 5/7, satellite).

Turns a validated CreateSurface envelope into a single self-contained, baked HTML document. It is the backbone of static delivery (G5): the PDF renderer rasterizes its output and email attaches it directly.

Security invariants (spec G1):

  • Subclasses the core :class:AbstractA2UIRenderer — never the legacy BaseRenderer (which holds the arbitrary-code sink FEAT-273 exists to kill).
  • Every data value is HTML-escaped — envelope data is data, never markup/JS.
  • Output is self-contained — all CSS inline, no external CDN/script/style/font refs.

v1.0 dispatch (FEAT-470 TASK-2543): :meth:SSRHTMLRenderer.render first LOWERS every non-primitive/Parrot composite component in the envelope via its own registered lower() + :func:~parrot.outputs.a2ui.catalog.base.to_components (flattening each composite's nested BasicNode tree into the envelope's own flat wire component list, in place of the composite — this is the ONLY correct order: a composite like DataTable lowers to a row ChildTemplate, and template/binding expansion is exclusively :func:~parrot.outputs.a2ui.baking.bake_envelope's job, which must run AFTER lowering, never before — see test_datatable_row_materialization.py for the pinned lowering -> bake contract). It THEN bakes the fully-lowered, flat envelope (resolving every binding and expanding every template), reconstructs a nested :class:BasicNode tree rooted at "root" from the baked flat dicts (pure id-reference resolution — every node is already a Basic Catalog primitive at this point), and dispatches each of the 18 official primitives to a dedicated _render_<Name> method. A component this renderer does not know how to render natively degrades to a visible Text placeholder (never a silent failure or an exception) via :func:parrot.outputs.a2ui.renderers.degrade.degrade; every degradation is recorded in RenderedArtifact.metadata["degraded"].

Alias AbstractA2UIRenderer

Re-exported from parrot.outputs.a2ui.renderers.AbstractA2UIRenderer.

Alias BASIC_CATALOG_ID

Re-exported from parrot.outputs.a2ui.catalog.basic.BASIC_CATALOG_ID.

Alias BasicNode

Re-exported from parrot.outputs.a2ui.catalog.base.BasicNode.

Alias Component

Re-exported from parrot.outputs.a2ui.models.Component.

Alias ComponentMetadata

Re-exported from parrot.outputs.a2ui.models.ComponentMetadata.

Alias CreateSurface

Re-exported from parrot.outputs.a2ui.models.CreateSurface.

Alias DEFAULT_CATALOG_ID

Re-exported from parrot.outputs.a2ui.catalog.base.DEFAULT_CATALOG_ID.

Alias DeepLink

Re-exported from parrot.outputs.a2ui.artifacts.DeepLink.

Alias DesignSystem

Re-exported from parrot.outputs.formats.assets.design_system.DesignSystem.

Alias GraphComponent

Re-exported from parrot.outputs.a2ui.catalog.viz_core.graph.GraphComponent.

Alias GraphTooLargeError

Re-exported from parrot.outputs.a2ui.graph.GraphTooLargeError.

Alias MAX_STATIC_NODES

Re-exported from parrot.outputs.a2ui.graph.MAX_STATIC_NODES.

Alias RenderedArtifact

Re-exported from parrot.outputs.a2ui.artifacts.RenderedArtifact.

Alias RendererCapabilities

Re-exported from parrot.outputs.a2ui.renderers.RendererCapabilities.

Class SSRHTMLRenderer

Static, self-contained HTML renderer for A2UI v1.0 envelopes.

Parameter Type Default Description
theme str 'light' Default theme name resolved by :class:~parrot.outputs.formats.assets.design_system.DesignSystem.
layout str 'analytics' Default layout name.

Attributes:

Attribute Type Description
PAGINATES bool

Method SSRHTMLRenderer.render

Render an envelope to a baked, self-contained HTML RenderedArtifact.

render(envelope: CreateSurface, *, bake: bool = True, deep_links: list[DeepLink] | None = None) -> RenderedArtifact

Parameter Type Default Description
envelope CreateSurface The validated createSurface envelope.
bake bool True Always effectively True for this static renderer (bindings are resolved regardless); kept for ABC compatibility.
deep_links list[DeepLink] | None None Deep links to render as anchors for degraded actions.

Returns: RenderedArtifact — A RenderedArtifact with mime_type="text/html"; any component this renderer degraded is recorded in metadata["degraded"].

Alias TabSpec

Re-exported from parrot.outputs.a2ui.catalog.base.TabSpec.

Alias VIZ_CORE_CATALOG_ID

Re-exported from parrot.outputs.a2ui.catalog.viz_core.VIZ_CORE_CATALOG_ID.

Alias bake_envelope

Re-exported from parrot.outputs.a2ui.baking.bake_envelope.

Alias degradation_record

Re-exported from parrot.outputs.a2ui.renderers.degrade.degradation_record.

Alias degrade

Re-exported from parrot.outputs.a2ui.renderers.degrade.degrade.

Alias document_shell

Re-exported from parrot.outputs.a2ui_renderers._shell.document_shell.

Alias format_cell

Re-exported from parrot.outputs.a2ui_renderers._table_format.format_cell.

Alias get_component

Re-exported from parrot.outputs.a2ui.catalog.get_component.

Alias intercepts

Re-exported from parrot.outputs.a2ui_renderers._intercept.intercepts.

Alias is_kpi_row

Re-exported from parrot.outputs.a2ui_renderers._semantics.is_kpi_row.

Alias is_numeric_column

Re-exported from parrot.outputs.a2ui_renderers._table_format.is_numeric_column.

Alias kpi_comparison_html

Re-exported from parrot.outputs.a2ui_renderers._semantics.kpi_comparison_html.

Alias kpi_unit_html

Re-exported from parrot.outputs.a2ui_renderers._semantics.kpi_unit_html.

Alias kpi_value_display

Re-exported from parrot.outputs.a2ui_renderers._semantics.kpi_value_display.

Attribute logger

Alias node_extensions

Re-exported from parrot.outputs.a2ui_renderers._semantics.node_extensions.

Alias parrot

Re-exported from parrot.

Alias parse_html_document_placeholder_title

Re-exported from parrot.outputs.a2ui.catalog.parrot.htmldocument.parse_html_document_placeholder_title.

Alias register_a2ui_renderer

Re-exported from parrot.outputs.a2ui.renderers.register_a2ui_renderer.

Alias render_graph_svg

Re-exported from parrot.outputs.a2ui_renderers._graph_svg.render_graph_svg.

Alias semantic_card_class

Re-exported from parrot.outputs.a2ui_renderers._semantics.semantic_card_class.

Alias semantic_text_class

Re-exported from parrot.outputs.a2ui_renderers._semantics.semantic_text_class.

Alias to_components

Re-exported from parrot.outputs.a2ui.catalog.base.to_components.

Alias trend_attr_html

Re-exported from parrot.outputs.a2ui_renderers._semantics.trend_attr_html.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally