withA2ui

fun AguiComponents.withA2ui(host: A2uiHost, registry: ComponentRegistry, onMessage: (RendererToAgentMessage) -> Unit = {}, pending: A2uiPendingRenderer = BasicPending, placeholder: A2uiPlaceholder = NoPlaceholder, toolNames: Set<String> = setOf(AguiA2ui.RENDER_TOOL_NAME)): AguiComponents

This slot table with the activity and toolCall slots drawing A2UI through host.

An activity slot that finds its carrier in host draws its surfaces, or its pending state; one that does not -- an activity of some other type -- falls through to the slot it replaced, so a table that already drew activities keeps drawing the ones this module does not read.

A tool-call slot is the same with two carriers to look up, the arguments and the result. When both hold surfaces -- a render call whose result also carries a2ui_operations for a second surface, which nothing upstream does but nothing forbids -- both draw, result first. A render call whose surface an activity owns is A2uiSlot.Shadowed and draws nothing -- not the tool call either, because "render_a2ui (awaiting result)" under a surface that is on screen would be a status line for the thing above it. Any other tool call whose result an activity shadows keeps its ordinary rendering: its result is still a result, and the surface is elsewhere.

remember the table this returns, as AguiComponents says: the slots capture host.

Parameters

registry

what draws each component type. Must cover the catalogs the host's renderer holds, or the uncovered types draw as the registry's placeholder.

onMessage

where a surface's actions go. Nothing is sent anywhere by this module; ActionMessage.toForwardedProps and toUserText in agui-a2ui are the two shapes upstream reads them in.

pending

what to draw for a payload that is not yet, or not at all, a surface.

placeholder

what a2ui-compose draws for a component type the registry lacks.

toolNames

the tools whose calls draw nothing when shadowed. The host's own set.