use std::collections::HashSet;
use std::path::Path;
use super::{AutoExpand, Reading, Transcript};
mod flow;
mod folds;
mod legible;
mod parity;
mod render;
mod rows;
mod spine;
mod tail;
mod turns;
mod vm;
pub(super) const AGENT: &str = "20260427T120000Z-aaaa";
pub(super) fn reading(raw: bool, auto: AutoExpand) -> Reading {
Reading {
speaker: rows::SPEAKER.to_owned(),
raw,
auto,
}
}
pub(super) fn plain(
ui: &mut egui::Ui,
t: &Transcript,
raw: bool,
auto: AutoExpand,
folds: &mut HashSet<String>,
) {
let _ = super::render(
ui,
t,
&reading(raw, auto),
folds,
&crate::rail::Rail::default(),
&mut None,
);
}
pub(super) fn write_msg(ws: &Path, name: &str, bytes: &[u8]) {
let dir = ws.join("agents").join(AGENT).join("messages");
std::fs::create_dir_all(&dir).unwrap();
std::fs::write(dir.join(name), bytes).unwrap();
}
pub(super) fn write_response(ws: &Path, seq: u32, bytes: &[u8]) {
let dir = ws.join("steps").join(AGENT).join(format!("{seq:03}"));
std::fs::create_dir_all(&dir).unwrap();
std::fs::write(dir.join("response.json"), bytes).unwrap();
}