# `A2UIAgent.Express.Catalogs`
[🔗](https://github.com/a2ui-elixir/a2ui/blob/v0.1.1/umbrella/apps/a2ui_agent/lib/a2ui_agent/express/catalogs.ex#L1)

The active catalogs of an Express format, compiler or decompiler, with
a schema helper for each, and the lookups they share.

The catalogs must be non-empty, have distinct ids and target one
protocol version; several catalogs need v1.0 or later, where each
component and function call carries its own `catalogId`. With one
catalog, a surface is bound to it and nothing in Express names it.
With several, a surface has no catalog: a name is looked up across the
catalogs, and one that several catalogs define needs a `catalogId`.

# `kind`
*since 0.1.0* 

```elixir
@type kind() :: :component | :function
```

Whether a name is a component or a function.

# `t`
*since 0.1.0* 

```elixir
@type t() :: %A2UIAgent.Express.Catalogs{
  catalogs: [A2UICore.Catalog.t()],
  helpers: [A2UIAgent.Express.SchemaHelper.t()],
  version: String.t()
}
```

# `defines?`
*since 0.1.0* 

```elixir
@spec defines?(A2UIAgent.Express.SchemaHelper.t(), kind(), String.t()) :: boolean()
```

Whether `helper`'s catalog defines a component or function.

# `defining`
*since 0.1.0* 

```elixir
@spec defining(t(), kind(), String.t()) :: [String.t()]
```

The ids of the catalogs that define a component or function, in catalog order.

# `first_helper`
*since 0.1.0* 

```elixir
@spec first_helper(t()) :: A2UIAgent.Express.SchemaHelper.t()
```

The first catalog's helper.

# `helper`
*since 0.1.0* 

```elixir
@spec helper(t(), term()) :: A2UIAgent.Express.SchemaHelper.t() | nil
```

The helper of the catalog with id `catalog_id`, or `nil`.

# `new`
*since 0.1.0* 

```elixir
@spec new([A2UICore.Catalog.t()], String.t() | nil) ::
  {:ok, t()} | {:error, A2UICore.Error.t()}
```

Checks `catalogs` and builds their helpers for `version` (default: the
catalogs' protocol version). A version must be on the catalogs'
release line (`v0.9` and `v0.9.1` are one line).

# `sole_catalog_id`
*since 0.1.0* 

```elixir
@spec sole_catalog_id(t()) :: String.t() | nil
```

The id of the only catalog, or `nil` when there are several.

# `v1?`
*since 0.1.0* 

```elixir
@spec v1?(String.t()) :: boolean()
```

Whether the protocol version is at least v1.0, where components and
calls carry their own `catalogId`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
