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
//! Message domain primitives.
//!
//! Re-exports the SDK `Message`, `MessageRole`, `VariantInfo`, and the
//! NDJSON streaming-event types so callers have one canonical path. Adds
//! conversion impls between the SDK `Message` and the Phase 1 SeaORM
//! entity model.
//!
//! ### Schema drift between SDK and DB
//!
//! The SDK `Message` has both `created_at` and `updated_at`, but the Phase
//! 1 `messages` table only stores `created_at` (messages are immutable
//! tree nodes per ADR-0001 — `updated_at` exists in the SDK for streaming
//! placeholders that get filled in). On read we synthesize
//! `updated_at = created_at`; on write the `ActiveModel` simply doesn't
//! carry the field.
//!
//! ### `file_ids` shape
//!
//! Phase 1 stores `messages.file_ids` as JSONB array of UUID strings (see
//! `out/phase-01-db-contract.md`). The SDK `file_ids: Vec<Uuid>` is mapped
//! to / from that JSON via `serde_json`.
//
// @cpt-cf-chat-engine-domain-message:p2
pub use ;
/// Concatenate the bodies of all `text`-typed parts of a message in `number`
/// order, joined by newlines. Non-text parts contribute nothing. This is the
/// canonical "plain text of a message" used by search matching, export
/// rendering, and any caller that needs a flat string view of the body.