# `Jido.Chat.ModalResponse`
[🔗](https://github.com/agentjido/jido_chat/blob/v1.0.0/lib/jido/chat/modal_response.ex#L1)

Canonical modal lifecycle response used by submit and close handlers.

# `t`

```elixir
@type t() :: %Jido.Chat.ModalResponse{
  action: :close | :errors | :update | :push,
  errors: map(),
  metadata: map(),
  modal: nil | nil | any()
}
```

# `close`

```elixir
@spec close(keyword() | map()) :: t()
```

Builds a close response.

# `errors`

```elixir
@spec errors(map(), keyword() | map()) :: t()
```

Builds a validation-error response.

# `from_map`

```elixir
@spec from_map(map()) :: t()
```

Builds a modal response from serialized data.

# `new`

```elixir
@spec new(t() | map()) :: t()
```

Creates a canonical modal response.

# `push`

```elixir
@spec push(Jido.Chat.Modal.t() | map(), keyword() | map()) :: t()
```

Builds a push response with a new modal.

# `schema`

Returns the schema for modal responses.

# `to_adapter_payload`

```elixir
@spec to_adapter_payload(t()) :: map()
```

Returns a plain adapter-facing response map.

# `to_map`

```elixir
@spec to_map(t()) :: map()
```

Serializes the response into a plain map with a type marker.

# `update`

```elixir
@spec update(Jido.Chat.Modal.t() | map(), keyword() | map()) :: t()
```

Builds an update response with a replacement modal.

---

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