use crate::reply::Reply;
use super::{acts, chat, policy, reads, records, step, tasks, walls, work};
pub(super) fn answer(reply: &Reply) -> String {
match reply {
Reply::Workspaces(roster) => walls::workspaces(roster),
Reply::Conversations(rows) => walls::conversations(rows),
Reply::Attention(rows) => walls::attention(rows),
Reply::Transcript(transcript) => chat::transcript(transcript),
Reply::Follow(stream) => walls::follow(stream),
Reply::Agent(agent) => chat::agent(agent),
Reply::Steps(steps) => records::steps(steps),
Reply::Step(one) => step::step(one),
Reply::Files(files) => records::files(files),
Reply::Inbox(rows) => records::inbox(rows),
Reply::Rail(rail) => records::rail(rail),
Reply::Governing(governing) => records::governing(governing),
Reply::Roles(rows) => policy::roles(rows),
Reply::Config(config) => policy::config(config),
Reply::Lineages(rows) => policy::lineages(rows),
Reply::Clients(rows) => policy::clients(rows),
Reply::Balls(rows) => tasks::balls(rows),
Reply::Board(board) => tasks::board(board),
Reply::WorkspaceBalls(rows) => tasks::workspace_balls(rows),
Reply::Marks { branch } => format!("tasks tracked on {branch}"),
Reply::Science(rows) => tasks::science(rows),
Reply::Work(rows) => work::work(rows),
Reply::Ops(rows) => reads::ops(rows),
Reply::Found(found) => reads::found(found),
Reply::Help(rows) => reads::help(rows),
Reply::Outcome(outcome) => acts::outcome(outcome),
Reply::Prepared(prepared) => acts::prepared(prepared),
Reply::Fanned(candidates) => acts::fanned(candidates),
Reply::Enrolled(enrolled) => acts::enrolled(enrolled),
Reply::Login(signin) => acts::login(signin),
Reply::Providers(rows) => acts::providers(rows),
Reply::Models(rows) => acts::models(rows),
Reply::Answered {
tool,
tool_use,
verdict,
advanced,
} => acts::answered(tool, tool_use, verdict, *advanced),
Reply::Delivered {
base,
target,
source,
commit,
} => acts::delivered(base, target, source.as_deref(), commit.as_deref()),
Reply::Started { conversation } => format!("started {conversation}"),
Reply::Nudged => "nudged — the advance is running".to_owned(),
Reply::Flagged => "flagged — it is on the queue now".to_owned(),
Reply::Acked => "the trail's watermark is where you are".to_owned(),
Reply::TrailCleared => "the trail is truncated".to_owned(),
Reply::Retired { discarded } => acts::retired(*discarded),
Reply::Floored { standing } => acts::floored(*standing),
Reply::Armed(standing) => acts::armed(*standing),
}
}
#[cfg(test)]
mod tests;