Cotton code
48 lines · 1.7 KB · RustRaw
//! The email tools (spec `2026-08-29-cotton-email-design.md`).//!//! Email is an append-only archive with first-class threads: `ingest_emails`//! lands batches idempotently (Message-ID first, content fingerprint as the//! fallback — never sender identity), the THREAD carries project membership,//! and the read verbs resolve participants to the owner's people by exact//! address at read time — which is what makes identifying someone later//! retroactive for free.//!//! The BODY is append-only; the STATE is not (schema v33). Read, starred,//! inbox and bin live on the MESSAGE and are decided ONCE, in//! `cotton_core::rules::email_state` — never a second implementation here.//!//! WHO a sender is (person, service, junk) is the reader's, in `kinds` (v107)://! a blocked sender's mail files into Junk, never into the bin.pub mod classify;pub mod engine_shim;pub mod extract;pub mod ingest;pub mod junk;pub mod kinds;pub mod photos;pub mod read;pub mod record_acts;pub mod record_fields;pub mod senders;pub mod shared;pub mod state;pub mod validate;use crate::mcp::dispatch::HandlerGroup;pub fn handlers() -> HandlerGroup {    &[        ("ingest_emails", ingest::ingest_emails),        ("list_email_threads", read::list_email_threads),        ("read_email_thread", read::read_email_thread),        ("update_email", state::update_email),        ("update_emails", state::update_emails),        ("list_email_senders", senders::list_email_senders),        ("block_sender", senders::block_sender),        ("unblock_sender", senders::unblock_sender),        ("list_blocked_senders", senders::list_blocked_senders),        ("add_sender_to_people", senders::add_sender_to_people),        ("empty_junk", junk::empty_junk),    ]}