use super::super::spend;
use crate::git_tree::Framing;
use crate::login::auth::AuthFailure;
use crate::steps_view::{Doc, Orphan, StepDetail, StepSummary, StepsView, Tail, ToolIo, Wound};
pub(super) fn steps() -> StepsView {
let base = StepSummary {
seq: "001".into(),
framing: Framing::Complete,
attempts: 1,
tokens: spend(),
commit: Some("abc".into()),
started_at: Some("t0".into()),
ended_at: Some("t1".into()),
wound: Wound::None,
};
StepsView {
steps: vec![
base.clone(),
StepSummary {
seq: "002".into(),
framing: Framing::Killed,
wound: Wound::Spoke("no bytes".into()),
commit: None,
started_at: None,
ended_at: None,
..base.clone()
},
StepSummary {
seq: "003".into(),
framing: Framing::Killed,
wound: Wound::Mute,
..base.clone()
},
StepSummary {
seq: "004".into(),
wound: Wound::OutputLimit,
..base.clone()
},
StepSummary {
seq: "005".into(),
framing: Framing::Failed,
wound: Wound::Refused(AuthFailure::Row("anthropic".into())),
..base.clone()
},
StepSummary {
seq: "006".into(),
framing: Framing::Failed,
wound: Wound::Refused(AuthFailure::Unrouted),
..base
},
],
orphan: Orphan::Spoke(Tail::Mail, "driver died".into()),
}
}
pub(super) fn step_detail() -> StepDetail {
StepDetail {
seq: "001".into(),
meta: Doc::Json {
value: serde_json::json!({ "commit": "abc" }),
raw: br#"{"commit":"abc"}"#.to_vec(),
},
request: Doc::Absent,
staging: Doc::Unparsed(b"not json".to_vec()),
response: vec![Doc::Absent],
tools: vec![ToolIo {
tool_id: "toolu_1".into(),
input: Doc::Absent,
output: Doc::Unparsed(b"raw".to_vec()),
is_error: false,
}],
stderr: Some(crate::files_view::Preview::Truncated {
text: "the adapter's last words".into(),
size: 999_999,
}),
driver: None,
}
}