Skip to content

API Reference parrot_formdesigner.extractors.a2ui

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

parrot_formdesigner.extractors.a2ui

View source

A2UI createSurface → FormSchema extractor (FEAT-650, spec §3 M5).

Strict mode (root parrot_variant == "form") reads the FEAT-544 parrot_* extensions; heuristic mode (TASK-4202) maps any Basic-catalog surface. Every loss is reported in :class:ExtractedForm. parrot.outputs.a2ui is an OPTIONAL extra — imported lazily in :func:_a2ui_ns only.

Class A2UIExtractor

Convert an A2UI v1.0 createSurface into a FormSchema (strict or heuristic).

Parameter Type Default Description
default_section_id str 'fields'
max_components int A2UI_MAX_COMPONENTS
max_depth int A2UI_MAX_DEPTH

Method A2UIExtractor.extract

Parse, validate (S6), walk, build.

extract(surface: Any, *, form_id: str | None = None, title: str | None = None, tenant: str | None = None) -> ExtractedForm

Parameter Type Default Description
surface Any A createSurface envelope (dict, JSON str/bytes or CreateSurface).
form_id str | None None Override for the resulting form_id.
title str | None None Override for the resulting form title.
tenant str | None None Tenant stamped on the form (never read from the surface).

Returns: ExtractedForm — The extracted form with warnings and dropped components.

Raises:

  • ValueError — Non-surface, invalid or oversized payload.

Attribute A2UI_MAX_COMPONENTS

Attribute A2UI_MAX_DEPTH

Attribute CHECK_FUNCTION_TO_CONSTRAINT

Type: dict[str, str]

Class DroppedComponent

A surface component that could not be represented in the FormSchema.

Fields:

Field Type Default Description
component_id str
component str
reason str

Class ExtractedForm

Result of an extraction: the form plus everything that was lost.

Fields:

Field Type Default Description
form FormSchema
mode ExtractionMode
warnings list[str]
dropped list[DroppedComponent]

Class ExtractionMode

How a surface was interpreted.

Alias FieldConstraints

Re-exported from parrot_formdesigner.core.constraints.FieldConstraints.

Alias FieldOption

Re-exported from parrot_formdesigner.core.options.FieldOption.

Alias FieldType

Re-exported from parrot_formdesigner.core.types.FieldType.

Alias FormField

Re-exported from parrot_formdesigner.core.schema.FormField.

Alias FormSchema

Re-exported from parrot_formdesigner.core.schema.FormSchema.

Alias FormSection

Re-exported from parrot_formdesigner.core.schema.FormSection.

Alias FormSubsection

Re-exported from parrot_formdesigner.core.schema.FormSubsection.

Attribute HEURISTIC_PRIMITIVE_MAP

Type: dict[str, FieldType]

Attribute logger

Alias resolve_rule_references

Re-exported from parrot_formdesigner.core.resolution.resolve_rule_references.

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