@agents-js/a2ui-renderer
v0.4.0
Published
Maps A2UI component trees onto the acp-* Lit primitives shipped by agents-js.
Maintainers
Readme
@agents-js/a2ui-renderer
Maps A2UI component trees onto the acp-* Lit primitives shipped by agents-js.
Installation
bun add @agents-js/a2ui-rendererAPI
Classes
A2uiRendererError— Error thrown by the A2UI renderer when it cannot map an A2UI component onto a concrete host primitive (unknown catalog id, unknown component name, or property-binding failure).
Functions
bindAuthSelectorbindChatAppbindCodeBlockbindConnectDialogbindDebugPanelbindElicitationFormbindMessagebindModelSelectorbindPermissionModalbindPermissionModeSelectorbindPromptInputbindStatusBarbindStreamingTextbindTranscriptbindWriteGateModalrenderA2uiComponent— Render a single A2UI component node into a LitTemplateResult. ThrowsA2uiRendererErrorwhen the catalog id is unknown or when the component name is not present in the ACP catalog.renderSurface— Render a full A2UI surface (or every surface in a group) into a single LitTemplateResult.
Interfaces
A2uiComponentNode— Minimum shape this renderer needs from an A2UI component entry.BindingContext— Context passed to every binding function.ComponentLike— Minimal shape of a/web_coreComponentModelthat the surface view reads. Both real models and plain-object fakes satisfy this shape.RenderOptions— Options accepted by the renderer.RenderSurfaceOptions— Options for {renderSurface}.SurfaceGroupLike— Minimal shape of aSurfaceGroupModelas the renderer needs it.SurfaceLike— Minimal shape of a surface as the renderer needs it.
Types
A2uiAction— An A2UIAction— either an action name string or a{ action: string }object.A2uiEventHandler— Handler fired whenever an ACP primitive emits an event that should be forwarded.BindingResult— Type-shape returned by the binding functions.DynamicValue— An A2UIDynamicString/DynamicBoolean— a literal or a{ path }binding.
Constants
ACP_BINDINGS— Map from A2UI ACP component name (perComponentApi.name) to binding function. Populated once at module load — matches the frozen 15-component ACP catalog.DEFAULT_SURFACE_ID— Surface id used by {renderA2uiComponent} when callers omit an explicitsurfaceId. Hosts that render a single surface can rely on this value when wiring up their action-event handlers.
Dependencies
@agents-js/a2ui-types@agents-js/ui-components
Peer Dependencies
lit
License
MIT
