diff --git a/crates/mind-body/src/chat_client.rs b/crates/mind-body/src/chat_client.rs index 9ec290a..597bf4d 100644 --- a/crates/mind-body/src/chat_client.rs +++ b/crates/mind-body/src/chat_client.rs @@ -36,6 +36,8 @@ pub const ACK: &str = "gamecult.persona.chat_ack.v1"; pub const READ: &str = "gamecult.persona.chat_read.v1"; pub const SEND_REQUEST: &str = "gamecult.persona.chat_send_request.v2"; pub const SEND_RECEIPT: &str = "gamecult.persona.chat_send_receipt.v2"; +/// A send that repeats an earlier one: the v2 tuple plus `resend`, answered with the v2 receipt. +pub const SEND_REQUEST_V3: &str = "gamecult.persona.chat_send_request.v3"; /// Her request that the mouth open a DM with a person, and its answer. pub const OPEN_DIRECT_REQUEST: &str = "gamecult.persona.chat_open_direct_request.v1"; pub const OPEN_DIRECT_RECEIPT: &str = "gamecult.persona.chat_open_direct_receipt.v1"; @@ -529,6 +531,19 @@ impl Refusal { } } +impl Refusal { + /// Whether the refusal says the mouth got no answer from the homeserver, so the send may or may not have been made. Every other kind + /// is an answer: the mouth declined before it put anything. The match names every kind, so a new one has to be placed. + pub(crate) fn is_no_answer(self) -> bool { + match self { + // The mouth's PUT timed out or the homeserver answered 5xx or 429: the event may have been persisted. + Self::SendFailed => true, + // `RoomMoved` cannot answer a resend, which skips the basis check. + Self::Brake | Self::PersonaMismatch | Self::UnknownRoom | Self::EmptyText | Self::UnknownPersona | Self::RoomMoved | Self::UnknownKind => false, + } + } +} + impl Serialize for Refusal { fn serialize(&self, serializer: S) -> Result { serializer.serialize_str(self.name()) @@ -576,7 +591,9 @@ pub struct SendBasis { } /// A send. `request_id` is the mouth's transaction id, so a repeat of the same -/// id is the same send. No `basis` is her choice standing: the mouth checks nothing. +/// id is the same send. No `basis` is her choice standing: the mouth checks nothing. `resend` says this repeats an earlier send +/// under the same id: the mouth does not check its basis (the decision was made against the first try's), and the homeserver answers +/// with the first try's event if it was made. It is on the wire only when true, as the sixth field of the v3 request. #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct ChatSendRequest { pub request_id: String, @@ -584,6 +601,8 @@ pub struct ChatSendRequest { pub room_alias: String, pub text: String, pub basis: Option, + #[serde(default, skip_serializing_if = "std::ops::Not::not")] + pub resend: bool, } /// The mouth's answer to a send: the event it made, or why it did not. `newer` names the events that moved the diff --git a/crates/mind-body/src/chat_client/tests.rs b/crates/mind-body/src/chat_client/tests.rs index e152fe8..3c4216b 100644 --- a/crates/mind-body/src/chat_client/tests.rs +++ b/crates/mind-body/src/chat_client/tests.rs @@ -200,7 +200,7 @@ fn a_refusal_is_the_mouths_bytes_and_a_typed_name() { #[test] fn a_send_and_its_receipt_are_the_mouths_bytes() { - let request = |basis: Option| ChatSendRequest { request_id: "req-1".into(), persona: "eureka".into(), room_alias: "#swarm:gamecult.org".into(), text: "hi".into(), basis }; + let request = |basis: Option| ChatSendRequest { request_id: "req-1".into(), persona: "eureka".into(), room_alias: "#swarm:gamecult.org".into(), text: "hi".into(), basis, resend: false }; golden(NIL_BASIS_BYTES, &request(None)); golden(SEEN_AND_SINCE_BYTES, &request(Some(SendBasis { seen_event_id: Some("$seen".into()), since_unix_ms: 1_793_698_425_998 }))); golden(SINCE_ONLY_BYTES, &request(Some(SendBasis { seen_event_id: None, since_unix_ms: 1_793_698_425_998 }))); @@ -668,3 +668,16 @@ fn invisible_cells_that_render_as_nothing_are_stripped_from_the_excerpt() { assert_eq!(excerpt_of("\u{2800}\u{3164}"), None); assert_eq!(excerpt_of("a\u{00A0}b").as_deref(), Some("a\u{00A0}b"), "NBSP stays"); } + +/// The v3 send is the v2 tuple plus `resend` (Bifrost `sendRequestV3Tuple`), and a first try stays the v2 tuple the mouth has always read. +#[test] +fn a_resend_is_the_v2_tuple_plus_one_boolean_and_a_first_send_is_the_v2_tuple() { + let first = ChatSendRequest { request_id: "req-1".into(), persona: "eureka".into(), room_alias: "#swarm:gamecult.org".into(), text: "hi".into(), basis: None, resend: false }; + let again = ChatSendRequest { resend: true, ..first.clone() }; + let fields = |request: &ChatSendRequest| decode::>(&encode(request).unwrap()).unwrap(); + assert_eq!(fields(&first).len(), 5); + let sent = fields(&again); + assert_eq!((sent.len(), &sent[5]), (6, &serde_json::Value::Bool(true))); + assert_eq!(decode::(&encode(&again).unwrap()).unwrap(), again); + assert_eq!(decode::(&encode(&first).unwrap()).unwrap(), first, "a v2 tuple reads as a first send"); +} diff --git a/crates/mind-body/src/chat_rudp.rs b/crates/mind-body/src/chat_rudp.rs index fcfd7c6..6807f08 100644 --- a/crates/mind-body/src/chat_rudp.rs +++ b/crates/mind-body/src/chat_rudp.rs @@ -31,7 +31,7 @@ use sha2::{Digest, Sha256}; use crate::chat_client::{ ACK, Chat, ChatAck, ChatFetchReceipt, ChatFetchRequest, ChatOpenDirectReceipt, ChatOpenDirectRequest, ChatPending, ChatPendingRequest, ChatRead, ChatRefusal, MouthRefused, Refusal, reply_warnings, ChatSendReceipt, ChatSendRequest, PENDING, PENDING_REQUEST, PENDING_REQUEST_V1, PENDING_REQUEST_V4, PENDING_V2, PENDING_V4, OPEN_DIRECT_RECEIPT, OPEN_DIRECT_REQUEST, FETCH_RECEIPT, FETCH_REQUEST, PENDING_V1, READ, REFUSAL, SEND_RECEIPT, - SEND_REQUEST, decode, encode, + SEND_REQUEST, SEND_REQUEST_V3, decode, encode, }; /// The tag every chat document carries; the mouth refuses any other. @@ -202,7 +202,17 @@ impl Chat for RudpChat { } fn send(&self, request: &ChatSendRequest) -> Result { - let receipt: ChatSendReceipt = self.call(SEND_REQUEST, &request.request_id, request, (SEND_RECEIPT, &request.request_id))?; + let receipt: ChatSendReceipt = if request.resend { + // A mouth that does not serve v3 answers `UnknownKind` keyed by the persona: heard here, the resend is known not made. + let answers = [(SEND_RECEIPT, request.request_id.as_str()), (REFUSAL, self.persona.as_str())]; + let (kind, payload) = self.exchange(SEND_REQUEST_V3, &request.request_id, request, Some(&answers))?.ok_or_else(|| anyhow!("no answer payload"))?; + if kind == REFUSAL { + bail!("the mouth refused the resend: {}", decode::(&payload)?.refusal.name()); + } + decode(&payload)? + } else { + self.call(SEND_REQUEST, &request.request_id, request, (SEND_RECEIPT, &request.request_id))? + }; if receipt.request_id != request.request_id { bail!("the mouth answered another send"); } diff --git a/crates/mind-body/src/persona.rs b/crates/mind-body/src/persona.rs index 347892d..fc48c8c 100644 --- a/crates/mind-body/src/persona.rs +++ b/crates/mind-body/src/persona.rs @@ -46,7 +46,7 @@ use crate::address::{Addressee, addresses, is_for, localpart}; use crate::chat_client::{Basis, Chat, ChatDelivery, TailLine}; use crate::control::{ControlSource, Effective, HeldReason, derive}; use crate::heartbeat::{HeartbeatView, Speaker, own_rooms, pending_facts, read_pending, wakes}; -use crate::projection::{DomainSource, HuginnPersonaSource, Model, Mouth, Organs, PersonaStore, Put, ReadSource, Request, Taken, Through, TurnKind, apply_commit, decide, decided, deliver, history, owing, own_addressee as heard_as}; +use crate::projection::{DomainSource, HuginnPersonaSource, Model, Mouth, Organs, Pass, PersonaStore, Put, ReadSource, Request, Taken, Through, TurnKind, apply_commit, decide, decided, deliver, history, owing, own_addressee as heard_as}; /// The admitting agent's name on what her Persona admitted; `self_run::inbox` still reads her briefs by it. pub const AGENT: &str = "mind-persona"; @@ -422,7 +422,7 @@ fn drain(instance: &Slug, start: &Start) -> Outcome { let now = (start.clock)(); let recorded_ms = record["at"].as_str().and_then(|at| DateTime::parse_from_rfc3339(at).ok()).map(|at| at.timestamp_millis()); let age = recorded_ms.map_or(i64::MAX, |at| (now.timestamp_millis() - at) / 1000); - deliver(&mouth, &mut record, age > OWED_WINDOW_S, &mut stalled); + deliver(&mouth, &mut record, if age > OWED_WINDOW_S { Pass::Past } else { Pass::Retry }, &mut stalled); if let Some(unknown) = record["unknown_sends"].as_array() { eprintln!("mind-persona: {} owed send(s) got no answer within the time a repeat is safe, so whether they went out is unknown, and she is told at her next real turn: {unknown:?}", unknown.len()); record["unknown_at"] = json!(now.to_rfc3339()); @@ -508,7 +508,7 @@ fn drain(instance: &Slug, start: &Start) -> Outcome { } } } - deliver(&mouth, &mut turn.record, false, &mut stalled); + deliver(&mouth, &mut turn.record, Pass::First, &mut stalled); if turn.record.get("failed").is_none() && let Err(fault) = start.trace.record(&record_key, &turn.record) { diff --git a/crates/mind-body/src/projection.rs b/crates/mind-body/src/projection.rs index 171b712..57b83f6 100644 --- a/crates/mind-body/src/projection.rs +++ b/crates/mind-body/src/projection.rs @@ -50,7 +50,7 @@ pub use narrate::{Answer, Continued, Failed, KitModel, Model, Reasoning, Spent, pub use read::{LiveReads, ReadFailure, ReadFixture, ReadRequest, ReadSource}; pub use select::TurnKind; pub(crate) use commit::apply as apply_commit; -pub(crate) use turn::{Mouth, Taken, decide, decided, deliver, failed_run, history, owes, owing}; +pub(crate) use turn::{Mouth, Pass, Taken, decide, decided, deliver, failed_run, history, owes, owing}; pub use tuning::{TUNING_FILE, TUNING_ROOT}; use narrate::{cap_prose, cap_words, distinct_2, field_names, heard_overlap, judge_prompt, judged, offers_options, persona_prompt, projector_prompt, word_budget, words}; diff --git a/crates/mind-body/src/projection/simulate.rs b/crates/mind-body/src/projection/simulate.rs index dd4e614..11bb6b2 100644 --- a/crates/mind-body/src/projection/simulate.rs +++ b/crates/mind-body/src/projection/simulate.rs @@ -190,7 +190,7 @@ struct SimRoom<'a> { } impl Actuator for SimRoom<'_> { - fn send(&self, _id: &str, room: &str, text: &str, in_reply_to: Option<&str>, mentions: &[String]) -> Sent { + fn send(&self, _id: &str, room: &str, text: &str, in_reply_to: Option<&str>, mentions: &[String], _resend: bool) -> Sent { let offset = self.sent.replace(self.sent.get() + 1); let mut lines = self.lines.borrow_mut(); let reply_to = match in_reply_to { diff --git a/crates/mind-body/src/projection/turn.rs b/crates/mind-body/src/projection/turn.rs index cff6e01..a95ed6c 100644 --- a/crates/mind-body/src/projection/turn.rs +++ b/crates/mind-body/src/projection/turn.rs @@ -28,6 +28,15 @@ pub(crate) enum Sent { Lost, } +/// Which pass over a record's owed sends this is. `First` is the turn's own, made against what she saw; `Retry` repeats what an earlier start owed, under the +/// recorded id, and says so to the mouth (`resend`); `Past` is a start that finds the record older than the homeserver remembers an id. +#[derive(Clone, Copy, PartialEq, Eq)] +pub(crate) enum Pass { + First, + Retry, + Past, +} + /// The refusal that kept an amendment out of the room, or none when it was made. pub(crate) type Edited = Option<&'static str>; @@ -36,7 +45,7 @@ pub(crate) trait Actuator { /// Say `text` in `room`, replying to the line `in_reply_to` and waking `mentions`, where the actuator carries them. `id` /// names this send, `{key}:s{index}` of the turn's key and the line's place in what she decided, and the record keeps it: /// the mouth's transaction id is this id, so a send repeated from the record is the same transaction. - fn send(&self, id: &str, room: &str, text: &str, in_reply_to: Option<&str>, mentions: &[String]) -> Sent; + fn send(&self, id: &str, room: &str, text: &str, in_reply_to: Option<&str>, mentions: &[String], resend: bool) -> Sent; /// Add `added` to her line `event`. fn edit(&self, event: &str, added: &str) -> Edited; } @@ -54,11 +63,12 @@ pub(crate) struct Mouth<'a> { } impl Actuator for Mouth<'_> { - fn send(&self, id: &str, room: &str, text: &str, _in_reply_to: Option<&str>, _mentions: &[String]) -> Sent { + fn send(&self, id: &str, room: &str, text: &str, _in_reply_to: Option<&str>, _mentions: &[String], resend: bool) -> Sent { let basis = SendBasis { seen_event_id: self.seen.get(room).cloned(), since_unix_ms: self.since_unix_ms }; - let request = ChatSendRequest { request_id: id.to_owned(), persona: self.persona.clone(), room_alias: room.to_owned(), text: text.to_owned(), basis: Some(basis) }; + let request = ChatSendRequest { request_id: id.to_owned(), persona: self.persona.clone(), room_alias: room.to_owned(), text: text.to_owned(), basis: Some(basis), resend }; match self.chat.send(&request) { Ok(receipt) => match (receipt.event_id, receipt.refusal) { + (_, Some(refusal)) if refusal.is_no_answer() => Sent::Lost, (_, Some(refusal)) => Sent::Refused(refusal.name().to_owned()), (Some(event), None) => Sent::Posted(event), (None, None) => Sent::Refused("no_event".to_owned()), @@ -82,7 +92,7 @@ pub(crate) struct Taken { /// One turn: `decide`, then `deliver`. pub(crate) fn take(organs: &Organs, request: &Request, actuator: &dyn Actuator, key: &str, now: DateTime) -> Taken { let mut taken = decide(organs, request, key, now); - deliver(actuator, &mut taken.record, false, &mut BTreeSet::new()); + deliver(actuator, &mut taken.record, Pass::First, &mut BTreeSet::new()); taken } @@ -139,11 +149,11 @@ pub(crate) fn decide(organs: &Organs, request: &Request, key: &str, now: DateTim /// came, still owed. The only receipt is the mouth's answer to a send, an event id; her lines in the room's tail are never one. The /// amendments follow once nothing is owed. A record that owes nothing is the shape the simulator and the mouth share. /// -/// A send is made under its recorded id, so the homeserver answers a repeat with the original event. `window_passed` (the record is older +/// A send is made under its recorded id, so the homeserver answers a repeat with the original event. `Pass::Past` (the record is older /// than the homeserver remembers an id) sends nothing: each owed send is recorded in `unknown_sends`, neither posted nor refused, and /// she is told it may or may not have gone out. `stalled` holds the rooms whose earlier send got no answer in this start: nothing is /// sent into them after it, so her lines never arrive out of order, and a send not sent stays owed. -pub(crate) fn deliver(actuator: &dyn Actuator, record: &mut Value, window_passed: bool, stalled: &mut BTreeSet) { +pub(crate) fn deliver(actuator: &dyn Actuator, record: &mut Value, pass: Pass, stalled: &mut BTreeSet) { let owed: Vec = record["owed"].as_array().cloned().unwrap_or_default(); let mut still = Vec::new(); for send in owed { @@ -153,7 +163,7 @@ pub(crate) fn deliver(actuator: &dyn Actuator, record: &mut Value, window_passed None => json!({ "room": room, "text": text, "refusal": why }), }; let mentions: Vec = send["mentions"].as_array().into_iter().flatten().filter_map(Value::as_str).map(str::to_owned).collect(); - if window_passed { + if pass == Pass::Past { let unknown = json!({ "room": room, "text": text }); match record["unknown_sends"].as_array_mut() { Some(unknowns) => unknowns.push(unknown), @@ -165,7 +175,7 @@ pub(crate) fn deliver(actuator: &dyn Actuator, record: &mut Value, window_passed still.push(send); continue; } - match actuator.send(send["id"].as_str().unwrap_or_default(), room, text, send["in_reply_to"].as_str(), &mentions) { + match actuator.send(send["id"].as_str().unwrap_or_default(), room, text, send["in_reply_to"].as_str(), &mentions, pass == Pass::Retry) { Sent::Posted(event) => record["posted"].as_array_mut().into_iter().for_each(|posted| posted.push(json!({ "event": event, "room": room, "text": text }))), Sent::Refused(why) => record["refused_sends"].as_array_mut().into_iter().for_each(|refused| refused.push(refusal(&why))), Sent::Lost => { diff --git a/crates/mind-body/src/projection/turn/tests.rs b/crates/mind-body/src/projection/turn/tests.rs index a326d44..e466e01 100644 --- a/crates/mind-body/src/projection/turn/tests.rs +++ b/crates/mind-body/src/projection/turn/tests.rs @@ -93,7 +93,7 @@ fn t_l2_each_send_of_a_turn_has_its_own_id_and_its_own_rooms_basis() { let elsewhere = Mouth { seen: BTreeMap::from([("#other:gamecult.org".to_owned(), "$elsewhere".to_owned())]), ..mouth(&chat) }; drop(sent); chat.sent.borrow_mut().clear(); - let _ = elsewhere.send("k:s0", "!dm-meta:gamecult.org", "hi", None, &[]); + let _ = elsewhere.send("k:s0", "!dm-meta:gamecult.org", "hi", None, &[], false); assert_eq!(basis(&chat.sent.borrow()[0]), SendBasis { seen_event_id: None, since_unix_ms: 7 }, "another room's newest event is not this room's basis"); } @@ -241,3 +241,45 @@ fn t_l3_an_unknown_sends_own_record_reports_no_line_missing_its_receipt() { let outcome = outcome_of(&record).expect("an outcome"); assert!(outcome.omitted.is_empty(), "{:?}", outcome.omitted); } + +/// Soul s7 mouth-no-answer-recorded-refused. Every refusal kind the mouth names is placed: `SendFailed` says the homeserver was not heard +/// (the PUT timed out or was answered 5xx), so the event may exist and the send stays owed; each other kind is the mouth declining before it +/// put anything, which settles the send as refused. +#[test] +fn t_l3_a_refusal_is_no_answer_only_when_the_homeserver_was_not_heard() { + let kinds = [ + (Refusal::SendFailed, true), + (Refusal::Brake, false), + (Refusal::PersonaMismatch, false), + (Refusal::UnknownRoom, false), + (Refusal::EmptyText, false), + (Refusal::UnknownPersona, false), + (Refusal::RoomMoved, false), + (Refusal::UnknownKind, false), + ]; + for (refusal, no_answer) in kinds { + let chat = FakeChat::new(Some(refusal)); + let taken = warm_turn(&mouth(&chat)); + let owed = taken.record["owed"].as_array().is_some_and(|owed| !owed.is_empty()); + let refused = taken.record["refused_sends"].as_array().is_some_and(|refused| !refused.is_empty()); + assert_eq!((owed, refused), (no_answer, !no_answer), "{}: {}", refusal.name(), taken.record); + if refused { + assert_eq!(taken.record["refused_sends"][0]["refusal"], refusal.name()); + } + } +} + +/// A send the turn makes is a first try and says so; one repeated from the record under its id is a resend and says that, so the mouth does +/// not hold it to the basis of the first try. The second try of a send whose first got no answer is answered with the event. +#[test] +fn t_l3_a_first_send_carries_no_resend_flag_and_every_repeat_does() { + let first = FakeChat::new(Some(Refusal::SendFailed)); + let mut taken = warm_turn(&mouth(&first)); + assert_eq!(first.sent.borrow().iter().map(|request| request.resend).collect::>(), [false], "a first send"); + let id = first.sent.borrow()[0].request_id.clone(); + let again = FakeChat::new(None); + deliver(&mouth(&again), &mut taken.record, Pass::Retry, &mut BTreeSet::new()); + let repeats = again.sent.borrow(); + assert_eq!(repeats.iter().map(|request| (request.request_id.clone(), request.resend)).collect::>(), [(id, true)], "the repeat is under the recorded id and says so"); + assert!(taken.record.get("owed").is_none() && taken.record["posted"][0]["event"] == "$sent-1", "{}", taken.record); +} diff --git a/crates/mind-body/tests/chat_rudp.rs b/crates/mind-body/tests/chat_rudp.rs index f38dc38..bc04053 100644 --- a/crates/mind-body/tests/chat_rudp.rs +++ b/crates/mind-body/tests/chat_rudp.rs @@ -209,7 +209,7 @@ fn a_request_the_mouth_does_not_answer_ends_in_an_error_not_a_hang() { let mouth = mouth(KEY); let chat = client(&mouth, KEY, "someone-else", Duration::from_millis(600)); assert!(chat.pending(0).is_err(), "the mouth answers only its own Persona"); - let sent = ChatSendRequest { request_id: "r".into(), persona: "someone-else".into(), room_alias: "#a:b".into(), text: "x".into(), basis: None }; + let sent = ChatSendRequest { request_id: "r".into(), persona: "someone-else".into(), room_alias: "#a:b".into(), text: "x".into(), basis: None, resend: false }; assert!(chat.send(&sent).is_err()); } @@ -232,7 +232,7 @@ fn a_client_recovers_from_a_restarted_mouth_on_its_next_call() { fn a_send_that_timed_out_is_not_repeated_by_the_client() { let mouth = mouth(KEY); let chat = client(&mouth, KEY, "someone-else", Duration::from_millis(600)); - let sent = ChatSendRequest { request_id: "r-1".into(), persona: "someone-else".into(), room_alias: "#a:b".into(), text: "x".into(), basis: None }; + let sent = ChatSendRequest { request_id: "r-1".into(), persona: "someone-else".into(), room_alias: "#a:b".into(), text: "x".into(), basis: None, resend: false }; assert!(chat.send(&sent).is_err()); chat.ack(1).unwrap(); let sends: Vec<_> = mouth.seen.lock().unwrap().iter().filter(|(kind, _)| kind == SEND_REQUEST).map(|(_, payload)| chat_client::decode::(payload).unwrap().request_id).collect(); diff --git a/crates/mind-body/tests/public_surface.txt b/crates/mind-body/tests/public_surface.txt index ef7c491..f0b6099 100644 --- a/crates/mind-body/tests/public_surface.txt +++ b/crates/mind-body/tests/public_surface.txt @@ -91,7 +91,7 @@ mind_body::chat_client: struct ChatPendingRequest # [derive (Clone , Debug , Par mind_body::chat_client: struct ChatRead # [derive (Clone , Debug , PartialEq , Eq , Serialize , Deserialize)] pub-fields[persona: String, room: String, event_id: String, at_unix_ms: u64] mind_body::chat_client: struct ChatRefusal # [derive (Clone , Debug , PartialEq , Eq , Serialize , Deserialize)] pub-fields[persona: String, refusal: Refusal] mind_body::chat_client: struct ChatSendReceipt # [derive (Clone , Debug , PartialEq , Eq , Serialize , Deserialize)] pub-fields[request_id: String, event_id: Option < String >, refusal: Option < Refusal >, newer: Vec < String >] -mind_body::chat_client: struct ChatSendRequest # [derive (Clone , Debug , PartialEq , Eq , Serialize , Deserialize)] pub-fields[request_id: String, persona: String, room_alias: String, text: String, basis: Option < SendBasis >] +mind_body::chat_client: struct ChatSendRequest # [derive (Clone , Debug , PartialEq , Eq , Serialize , Deserialize)] pub-fields[request_id: String, persona: String, room_alias: String, text: String, basis: Option < SendBasis > , resend: bool] mind_body::chat_client: struct ContextLine # [derive (Clone , Debug , PartialEq , Eq , Serialize , Deserialize)] pub-fields[sender: String, text: String, at_unix_ms: u64] mind_body::chat_client: struct MouthRefused # [derive (Clone , Copy , Debug , PartialEq , Eq)] pub-fields[0: Refusal] mind_body::chat_client: struct ReplyTo # [derive (Clone , Debug , PartialEq , Eq , Serialize)] pub-fields[event_id: String, sender: String, excerpt: Option < String >, at_cap: bool]