Skip to main content

wabot_feature_chat_controller/
lib.rs

1//! # wabot-feature-chat-controller
2//!
3//! Rust port of `wabot-ts/src/feature/chat-controller`. Provides:
4//!
5//! * `ChatChannel` trait + `ChannelMessage` / `ReceivedMessage` types.
6//! * `Chat` entity, `ChatRepository`, `ChatResolver` (in-memory; Phase 4
7//!   will graduate these into a dedicated `wabot-feature-chat-bot`
8//!   crate alongside the Postgres implementation).
9//! * The runtime helpers macro emissions call into.
10//!
11//! The `#[chat_controller]` macro lives in `wabot-macros`. Per-channel
12//! markers (`#[cmd]`, future `#[telegram(...)]` / `#[socket(...)]`) are
13//! also there.
14
15pub mod channel;
16pub mod chat;
17pub mod handler;
18pub mod runtime;
19pub mod types;
20
21pub use channel::{
22    ChannelError, ChannelMessage, ChatChannel, InjectInstance, MessageCallback, ReplyFn,
23    ReplyResult,
24};
25pub use chat::{
26    chat_from_connection, Chat, ChatData, ChatRepository, ChatResolver, InMemoryChatRepository,
27};
28pub use handler::{Dispatch, DispatchArgs, DispatchError, ReceivedMessage, ReplyHandle};
29pub use runtime::{
30    build_message_callback, into_received, populate_child_container, run_chat_controllers,
31};
32pub use types::{ChatConnection, ChatMessage, ChatMessageFile, ChatType};
33
34/// Re-export for macro emissions and addon authors.
35pub use async_trait;