use super::*;
use crate::git_tree::{Agent, AgentState};
mod derived;
mod roster;
mod signals;
fn agent(id: &str) -> Agent {
Agent {
branch_name: format!("agents/{id}"),
agent_id: id.to_string(),
tip_oid: format!("tip-{id}"),
tip_short_oid: "tip".into(),
tip_timestamp_unix: 0,
last_action_unix: 0,
messages: 0,
steps: vec![],
preview: None,
stream: crate::git_tree::Stream::default(),
tool_calls: vec![],
state: AgentState::Live,
state_uncertain: false,
truncated: false,
failure: None,
flagged: None,
pending: vec![],
conflicted_oid: None,
budget_oid: None,
abandoned_oid: None,
notify_oid: None,
held: None,
goal_ball: None,
name: None,
goal_name: None,
call_start_unix: None,
}
}
fn acked(kind: SeenKind, oid: &'static str) -> impl Fn(SeenKind, &str, &str, &str) -> bool {
move |k, _w, _a, o| k == kind && o == oid
}
fn nothing(_: SeenKind, _: &str, _: &str, _: &str) -> bool {
false
}
fn tips_acked(ids: &'static [&'static str]) -> impl Fn(SeenKind, &str, &str, &str) -> bool {
move |k, _w, _a, o| k == SeenKind::Stopped && ids.iter().any(|id| o == format!("tip-{id}"))
}