sealed interface A2uiCatalog


A Jetpack Compose implementation of an A2UI component catalog, which defines which A2uiComponents and A2uiFunctions are available to the agent for a particular A2UI surface.

To instantiate a new catalog, use the A2uiCatalog factory function.

Summary

Public properties

A2uiComponentCollection

The collection of A2uiComponent implementations registered in this catalog.

A2uiFunctionCollection

The collection of A2uiFunction implementations registered in this catalog.

String

The unique identifier for this catalog.

open Boolean

Indicates whether this catalog's full JSON Schema should be serialized inline as part of the capabilities advertisement sent to the agent.

A2uiSchema?

The optional JSON schema defining the dynamic theme overrides supported by this catalog.

Extension functions

A2uiReadinessEvaluator

Creates an A2uiReadinessEvaluator that resolves readiness states using the components registered in this catalog.

Map<StringAny?>

Serializes this catalog to its JSON Schema Map representation.

String

Serializes this catalog to its JSON Schema string representation.

Public properties

components

Added in 1.0.0-alpha01
val componentsA2uiComponentCollection

The collection of A2uiComponent implementations registered in this catalog.

functions

Added in 1.0.0-alpha01
val functionsA2uiFunctionCollection

The collection of A2uiFunction implementations registered in this catalog.

id

Added in 1.0.0-alpha01
val idString

The unique identifier for this catalog.

This ID is announced to the agent during the capability negotiation phase. It is recommended to use a URI format including a version number (e.g., "https://example.com/a2ui/catalog/v1") to ensure global uniqueness and facilitate protocol versioning.

isInline

Added in 1.0.0-alpha01
open val isInlineBoolean

Indicates whether this catalog's full JSON Schema should be serialized inline as part of the capabilities advertisement sent to the agent.

themeSchema

Added in 1.0.0-alpha01
val themeSchemaA2uiSchema?

The optional JSON schema defining the dynamic theme overrides supported by this catalog.

If provided, the agent can send theme properties conforming to this schema (e.g., "primaryColor") within the createSurface message to customize the catalog's visual appearance.

Extension functions

A2uiCatalog.asReadinessEvaluator

fun A2uiCatalog.asReadinessEvaluator(): A2uiReadinessEvaluator

Creates an A2uiReadinessEvaluator that resolves readiness states using the components registered in this catalog.

This evaluator delegates to each specific A2uiComponent.isReady implementation to determine if a component is ready to transition from a loading state to a success state (e.g., has loaded all its required dynamic data).

Returns
A2uiReadinessEvaluator

An A2uiReadinessEvaluator backed by this catalog.

A2uiCatalog.toJsonSchemaMap

fun A2uiCatalog.toJsonSchemaMap(): Map<StringAny?>

Serializes this catalog to its JSON Schema Map representation.

Returns
Map<StringAny?>

the serialized catalog JSON Schema Map

Throws
IllegalArgumentException

If this catalog does not support serialization.

A2uiCatalog.toJsonSchemaString

fun A2uiCatalog.toJsonSchemaString(): String

Serializes this catalog to its JSON Schema string representation.

Returns
String

the serialized catalog JSON Schema string

Throws
IllegalArgumentException

If this catalog does not support serialization.