bxcore: a turn's speaker, SessionUpdated's turn, the session-state messages
Co-Authored-By: ornith-1.5-35b-a3b <agent@wntrmute.dev>
This commit is contained in:
@@ -2,7 +2,8 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::gateway::{ApprovalOutcome, ApprovalPosted, ApprovalReply, ApprovalRequest};
|
||||
use crate::memory::{
|
||||
MemoryAdmin, MemoryAdminReply, MemoryBlockReply, MemoryCall, Reindexed, SessionUpdated,
|
||||
MemoryAdmin, MemoryAdminReply, MemoryBlockReply, MemoryCall, Reindexed, SessionState,
|
||||
SessionStateReply, SessionUpdated,
|
||||
};
|
||||
use crate::{CallId, DataClass, DecisionRecord, SessionId, Timestamp, Usage};
|
||||
|
||||
@@ -51,6 +52,8 @@ pub enum Message {
|
||||
Reindexed(Reindexed),
|
||||
MemoryAdmin(MemoryAdmin),
|
||||
MemoryAdminReply(MemoryAdminReply),
|
||||
SessionState(SessionState),
|
||||
SessionStateReply(SessionStateReply),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
@@ -126,13 +129,18 @@ pub enum DenyReason {
|
||||
StateUnreadable,
|
||||
}
|
||||
|
||||
// JSON: {"kind":"turn","body":{"session":"…","content":"…","resume":false}}
|
||||
// JSON: {"kind":"turn","body":{"session":"…","content":"…","resume":false,"speaker":"kyle"}}
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct Turn {
|
||||
pub session: SessionId,
|
||||
pub content: String,
|
||||
pub resume: bool,
|
||||
/// Who spoke the turn, when one person did (M5c spec, section 11). Written only when present,
|
||||
/// and a frame without it reads as `None`, the safe side: a turn without a speaker is never
|
||||
/// synced to Honcho.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub speaker: Option<String>,
|
||||
}
|
||||
|
||||
// JSON: {"event":"content","text":"…"} — the tag sits beside the fields, snake_case
|
||||
|
||||
Reference in New Issue
Block a user