mix_schema
Render AI protocol payloads into Mix-powered Flutter UI through a validated schema pipeline.
Early Development — mix_schema is in active development and does not have a public API yet. The architecture and concepts described here reflect the design direction.
mix_schema bridges AI protocol payloads and Mix-powered Flutter UI through a deterministic, validated rendering pipeline.
Why this exists
AI-generated UI is powerful but unstable when raw payloads are rendered directly. mix_schema adds structure, trust boundaries, and design-system consistency.
Core benefits
- Consistent output through a canonical AST.
- Protocol change isolation through adapter boundaries.
- Safer execution through trust and action gating.
- Design fidelity through Mix tokens, variants, and modifiers.
- Better debugging through deterministic diagnostics.
Architecture
Mix already has a complete resolution pipeline that every developer uses: Styler → Spec → Widget. mix_schema feeds agent payloads into that same pipeline through an adapter layer. From the Styler onward, the path is identical.
flowchart TD
subgraph inputs [" "]
direction LR
Dev["Developer Code"]
Agent["Agent Payload"]
end
Agent --> Adapter["Wire Adapter"]
Adapter --> AST["Canonical AST"]
AST --> Gate["Validate &\nTrust Gate"]
subgraph mix ["Mix Pipeline"]
direction LR
Styler["Styler"] --> Spec["Spec"] --> Widget["Widget"]
end
Dev --> mix
Gate --> mix
mix --> UI["Branded UI"]The agent describes what to render. Mix decides how it looks. The user sees the same quality from both paths.
Runtime flow
sequenceDiagram
participant Agent
participant mix_schema
participant Mix
participant App
Agent->>mix_schema: UI payload
mix_schema->>mix_schema: Adapt → Validate → Trust gate
alt Permitted
mix_schema->>Mix: Resolve tokens & styles
Mix->>App: Widget tree
App-->>Agent: UI events
else Blocked
mix_schema-->>Agent: Diagnostics
endTrust model
mix_schema treats validation and action policies as first-class runtime contracts, not optional checks.
Risk policy example:
- Low-risk actions: execute directly.
- Medium-risk actions: propose before execute.
- High-risk actions: blocked or explicit approval required.