1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//! # Bob Chat
//!
//! Platform-agnostic chat abstractions for the
//! [Bob Agent Framework](https://github.com/longcipher/bob).
//!
//! ## Overview
//!
//! `bob-chat` provides the structured chat layer that sits between chat
//! platform APIs (Slack, Discord, Telegram, CLI, etc.) and the agent loop.
//! It ships a trait-based adapter model, a central event-driven orchestrator
//! ([`ChatBot`]), and rich message primitives.
//!
//! ## Features
//!
//! - **[`ChatAdapter`] trait** — implement once per platform; covers posting, editing, deleting,
//! reactions, ephemeral messages, DMs, modals, file uploads, and event streaming.
//! - **[`ChatBot`] orchestrator** — register adapters and typed handlers, then call
//! [`ChatBot::run`] to poll all adapters concurrently and dispatch events.
//! - **[`ChatEvent`]** — seven event variants (Message, Mention, Reaction, Action, SlashCommand,
//! ModalSubmit, ModalClose).
//! - **[`ThreadHandle`]** — scoped handle passed to handlers for replying, subscribing to threads,
//! and managing ephemeral messages with DM fallback.
//! - **Rich messages** — [`CardElement`] (buttons, sections, images, fields) with a plain-text
//! fallback renderer.
//! - **Modals** — [`ModalElement`] with text inputs, selects, and radio selects.
//! - **Emoji** — [`WellKnownEmoji`] (35 variants) with platform-specific format maps and a
//! custom-emoji escape hatch.
//! - **Streaming** — [`TextStream`] and [`fallback_stream`] for progressive message delivery via
//! post-then-edit.
//! - **Attachments** — [`Attachment`], [`FileUpload`] for file handling.
//! - **Error types** — [`ChatError`] with adapter, transport, rate-limit, auth, not-found,
//! not-supported, and closed variants.
//!
//! ## Module Map
//!
//! | Module | Purpose |
//! |--------|---------|
//! | [`adapter`] | `ChatAdapter` trait definition |
//! | [`bot`] | `ChatBot` orchestrator and handler registration |
//! | [`card`] | Card/rich-message element types |
//! | [`emoji`] | Emoji types and well-known mappings |
//! | [`error`] | `ChatError` enum |
//! | [`event`] | `ChatEvent` variants and event structs |
//! | [`file`](mod@file) | Attachment and file upload types |
//! | [`message`] | Message types (postable, incoming, sent, ephemeral) |
//! | [`modal`] | Modal form dialog types |
//! | [`stream`] | Streaming text types |
//! | [`thread`] | `ThreadHandle` for in-handler interaction |
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use bob_chat::{ChatBot, ChatBotConfig};
//!
//! # async fn example() -> Result<(), bob_chat::ChatError> {
//! let mut bot = ChatBot::new(ChatBotConfig::default());
//!
//! // Register a mention handler.
//! bot.on_mention(|thread, message| async move {
//! let _ = thread.post("Hello! You said: ".to_owned() + &message.text).await;
//! });
//!
//! // Add platform adapters and run.
//! // bot.add_adapter(my_slack_adapter);
//! // bot.run().await?;
//! # Ok(())
//! # }
//! ```
pub
pub use ChatAdapter;
/// Re-export channel types from `bob_core` for convenience.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ChatError;
pub use ;
pub use ;
pub use ;
pub use ;
pub use AppState;
pub use ;
pub use ThreadHandle;