Thread handle with posting, lifecycle, state, and discovery helpers.
Summary
Functions
Fetches all available messages by following pagination cursors when supported.
Alias for messages_stream/2 to mirror full-history stream naming.
Returns a channel reference tied to this thread's room.
Returns the logical channel id for this thread.
Edits a previously-sent message via adapter edit_message/4 when supported.
Builds a thread from serialized map data.
Renders a user mention string for this thread's adapter.
Fetches a page of normalized messages for the thread when supported.
Returns a lazy stream over thread messages using cursor pagination.
Creates a thread handle.
Opens a modal in the thread when supported by the adapter.
Posts string/postable/stream content and returns a sent-message handle.
Posts an ephemeral message to a user with optional DM fallback policy.
Fetches a recent message list with default limit 20.
Refreshes thread metadata when adapter supports fetch_thread callback.
Returns the Zoi schema for Thread.
Uploads a file to the thread when supported by the adapter.
Sets thread state in chat struct using :replace, :merge, or key/value modes.
Starts a typing indicator in the thread when supported.
Gets thread state map or a single key from chat struct state.
Subscribes this thread in a pure Jido.Chat state struct.
Returns true when the thread is subscribed in a pure Jido.Chat state struct.
Serializes thread into a plain map with type marker.
Unsubscribes this thread in a pure Jido.Chat state struct.
Types
Functions
@spec all_messages(t(), keyword() | map() | Jido.Chat.FetchOptions.t()) :: {:ok, [Jido.Chat.Message.t()]} | {:error, term()}
Fetches all available messages by following pagination cursors when supported.
@spec all_messages_stream(t(), keyword() | map() | Jido.Chat.FetchOptions.t()) :: Enumerable.t()
Alias for messages_stream/2 to mirror full-history stream naming.
@spec channel(Jido.Chat.t(), t()) :: Jido.Chat.ChannelRef.t()
Returns a channel reference tied to this thread's room.
Returns the logical channel id for this thread.
Edits a previously-sent message via adapter edit_message/4 when supported.
Builds a thread from serialized map data.
Renders a user mention string for this thread's adapter.
@spec messages(t(), keyword() | map() | Jido.Chat.FetchOptions.t()) :: {:ok, Jido.Chat.MessagePage.t()} | {:error, term()}
Fetches a page of normalized messages for the thread when supported.
@spec messages_stream(t(), keyword() | map() | Jido.Chat.FetchOptions.t()) :: Enumerable.t()
Returns a lazy stream over thread messages using cursor pagination.
Creates a thread handle.
@spec open_modal(t(), Jido.Chat.Modal.t() | map(), keyword()) :: {:ok, Jido.Chat.ModalResult.t()} | {:error, term()}
Opens a modal in the thread when supported by the adapter.
@spec post( t(), String.t() | Jido.Chat.Postable.t() | map() | Enumerable.t(), keyword() ) :: {:ok, Jido.Chat.SentMessage.t()} | {:error, term()}
Posts string/postable/stream content and returns a sent-message handle.
@spec post_ephemeral( t(), String.t() | integer() | Jido.Chat.Author.t() | map(), String.t() | Jido.Chat.Postable.t() | map(), keyword() ) :: {:ok, Jido.Chat.EphemeralMessage.t()} | {:error, term()}
Posts an ephemeral message to a user with optional DM fallback policy.
@spec recent_messages( t(), keyword() ) :: {:ok, [Jido.Chat.Message.t()]} | {:error, term()}
Fetches a recent message list with default limit 20.
Refreshes thread metadata when adapter supports fetch_thread callback.
Returns the Zoi schema for Thread.
@spec send_file(t(), Jido.Chat.FileUpload.input(), keyword()) :: {:ok, Jido.Chat.SentMessage.t()} | {:error, term()}
Uploads a file to the thread when supported by the adapter.
@spec set_state(Jido.Chat.t(), t(), atom() | term(), map() | term()) :: Jido.Chat.t()
Sets thread state in chat struct using :replace, :merge, or key/value modes.
Starts a typing indicator in the thread when supported.
@spec state(Jido.Chat.t(), t(), term() | nil) :: map() | term()
Gets thread state map or a single key from chat struct state.
@spec subscribe(Jido.Chat.t(), t()) :: Jido.Chat.t()
Subscribes this thread in a pure Jido.Chat state struct.
@spec subscribed?(Jido.Chat.t(), t()) :: boolean()
Returns true when the thread is subscribed in a pure Jido.Chat state struct.
Serializes thread into a plain map with type marker.
@spec unsubscribe(Jido.Chat.t(), t()) :: Jido.Chat.t()
Unsubscribes this thread in a pure Jido.Chat state struct.