Skip to content

API Reference parrot.outputs.a2ui_renderers._intercept

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

parrot.outputs.a2ui_renderers._intercept

View source

Catalog-aware renderer interception helpers (FEAT-529 Module 0).

Every satellite renderer draws a handful of composite components (Chart, DataTable, Map, ...) NATIVELY, intercepting them before the generic lowering pass runs (see interactive_html.py's _INTERCEPTED, ssr_html.py's _lower_composites). Until now that interception was keyed by bare component NAME alone — safe only because every catalog had a disjoint name set. With a second catalog (viz-core) registering components, interception must resolve the SAME catalog id :func:~parrot.outputs.a2ui.catalog.resolve_catalog would (component's own catalogId, else the surface default) and key on the (catalog_id, name) pair — so a future viz-core Chart and the existing Parrot Chart never intercept for each other's renderer branch.

Function intercepts

Whether comp should be drawn natively instead of lowered.

intercepts(table: frozenset[tuple[str, str]], comp: Component, surface_catalog_id: str | None) -> bool

Parameter Type Default Description
table frozenset[tuple[str, str]] A frozenset of (catalog_id, name) pairs this renderer draws natively — e.g. {(DEFAULT_CATALOG_ID, "Chart"), (VIZ_CORE_CATALOG_ID, "Graph")}.
comp Component The wire component being considered.
surface_catalog_id str | None The owning surface's default catalogId.

Returns: bool — True if comp's resolved (catalog_id, name) is in table. False (never raises) when the catalog id cannot be resolved — an unresolved component is a validation failure caught elsewhere, not this helper's concern.

Function resolve_component_catalog

Resolve the effective catalog id for a wire Component.

Thin wrapper over :func:parrot.outputs.a2ui.catalog.resolve_catalog so renderers never re-implement the component-vs-surface precedence rule.

resolve_component_catalog(comp: Component, surface_catalog_id: str | None) -> str

Parameter Type Default Description
comp Component The wire component.
surface_catalog_id str | None The owning surface's default catalogId.

Returns: str — The resolved catalog id.

Raises:

  • CatalogValidationError — If neither the component nor the surface declares a catalog id.

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