use super::super::super::super::Reply;
use crate::boundary::reply::ConfigAnswer;
mod chrome;
mod config;
mod convs;
mod trail;
use super::board::board;
use crate::board::Board;
use crate::config_edit::branch::{ConfigBranch, Lineage};
use crate::git_tree::AgentState;
use crate::projects::join::{JoinRow, JoinState};
use crate::search::{Address, Field, Found, Hit};
use convs::conv_rows;
pub(super) fn queue() -> Vec<crate::boundary::answer::queue::QueueRow> {
use crate::attention::AttentionKind;
use crate::boundary::answer::queue::QueueRow;
vec![
QueueRow {
workspace: "ws".into(),
agent: "c-1".into(),
display: "Cobalt".into(),
state: AgentState::Stopped,
uncertain: false,
signals: vec![
AttentionKind::Held,
AttentionKind::Mail,
AttentionKind::Flagged,
],
preview: "p".into(),
age_secs: 5,
pending: 2,
held: Some(crate::control::hold::Held {
tool_use_id: "toolu_1".into(),
tool: "Bash".into(),
reason: "writes".into(),
}),
failure: Some("Unauthorized".into()),
flag: Some(crate::monitor::Flag {
at: "2026-01-01T00:00:00Z".into(),
reason: "please look at this one".into(),
}),
},
QueueRow {
workspace: "ws".into(),
agent: "c-2".into(),
display: "Dun".into(),
state: AgentState::Live,
uncertain: true,
signals: vec![],
preview: String::new(),
age_secs: 0,
pending: 0,
held: None,
failure: None,
flag: None,
},
]
}
fn found() -> Found {
Found {
needle: "gate".into(),
hits: vec![
Hit {
at: Address::Ball {
project: "p".into(),
id: "bl-1".into(),
},
field: Field::Name,
offset: 0,
excerpt: "bl-1".into(),
},
Hit {
at: Address::Workspace { name: "ws".into() },
field: Field::Summary,
offset: 3,
excerpt: "ws".into(),
},
Hit {
at: Address::Conversation {
workspace: "ws".into(),
agent: "c-1".into(),
},
field: Field::Text,
offset: 12,
excerpt: "the gate".into(),
},
],
unreadable: vec!["p: balls unlistable".into()],
}
}
pub(super) fn listings() -> Vec<Reply> {
let mut out = chrome::chrome();
out.extend([
Reply::Conversations(conv_rows()),
Reply::Balls(vec![
JoinRow {
project: "p".into(),
ball_id: "bl-1".into(),
state: JoinState::Delivered,
workspace: Some("ws".into()),
claimant: Some("alba".into()),
title: Some("t".into()),
},
JoinRow {
project: "p".into(),
ball_id: "bl-2".into(),
state: JoinState::ReadyStartable,
workspace: None,
claimant: None,
title: None,
},
]),
Reply::Board(board()),
Reply::Board(Board::default()),
Reply::Attention(queue()),
Reply::Ops(trail::ops()),
Reply::Help(crate::boundary::help::rows(None)),
Reply::Search(found()),
Reply::Search(Found::default()),
Reply::Config(ConfigAnswer::Lineages(vec![Lineage {
branch: ConfigBranch {
name: "main".into(),
tip_oid: "abcdef1234".into(),
tip_short_oid: "abcdef1".into(),
tip_timestamp_unix: 1_700_000_000,
},
files: vec!["workflow.yaml".into()],
}])),
Reply::Config(ConfigAnswer::Models(vec!["opus".into(), "sonnet".into()])),
]);
out.extend(config::answers());
out.extend(routing());
out
}
fn routing() -> Vec<Reply> {
vec![
Reply::Invocations(Vec::new()),
Reply::Invocations(vec![crate::registry::mailbox::Invocation {
id: "inv-1".into(),
tool: "Bash".into(),
input: serde_json::json!({"command": "ls -l", "timeout": 30}),
cwd: None,
}]),
Reply::Invocations(vec![crate::registry::mailbox::Invocation {
id: "inv-2".into(),
tool: "bash".into(),
input: serde_json::json!({"command": "printf made > out.txt"}),
cwd: Some("/w/home/agents/c-1".into()),
}]),
Reply::Clients(vec![
crate::registry::roster::ClientRow {
client: "laptop".into(),
present: true,
last_seen: Some(1_700_000_000),
tools: vec![
crate::registry::tools::Tool {
name: "Bash".into(),
description: "run a command".into(),
input_schema: serde_json::json!({
"type": "object",
"properties": {"command": {"type": "string", "minLength": 1}},
"required": ["command"],
}),
subject_cwd: false,
},
crate::registry::tools::Tool {
name: "bash".into(),
description: "run a command in the conversation's cwd".into(),
input_schema: serde_json::json!({"type": "object"}),
subject_cwd: true,
},
],
},
crate::registry::roster::ClientRow {
client: "phone".into(),
present: false,
tools: Vec::new(),
last_seen: None,
},
]),
Reply::Doctor(vec![
crate::doctor::Row {
check: "listener".into(),
ok: true,
fact: "listening on 127.0.0.1:7737".into(),
remedy: None,
},
crate::doctor::Row {
check: "address".into(),
ok: false,
fact: "127.0.0.1:0 is a request, not an endpoint".into(),
remedy: Some("`WIRE_HOST=<host> WIRE_PORT=<port> yog wire-certs` states it".into()),
},
]),
]
}