refactor(#2581): carve per-agent mcp.sock protocol into hive-agent-sock crate

This commit is contained in:
damocles 2026-07-19 14:22:37 +02:00 committed by mara
commit d0beec8a40
26 changed files with 603 additions and 542 deletions

View file

@ -35,14 +35,14 @@ async fn fetch_reminder_stats(
) -> Option<hive_sh4re::ReminderStats> {
match super::broker_request(
socket,
&hive_sh4re::Request::ReminderRollup {
&hive_agent_sock::Request::ReminderRollup {
since_secs: window_secs,
agent: None,
},
)
.await
{
Ok(hive_sh4re::Response::ReminderRollup(stats)) => Some(stats),
Ok(hive_agent_sock::Response::ReminderRollup(stats)) => Some(stats),
_ => None,
}
}
@ -57,14 +57,14 @@ async fn fetch_reminder_stats(
pub(super) async fn api_loose_ends(State(state): State<AppState>) -> Response {
match super::broker_request(
&state.socket,
&hive_sh4re::Request::GetLooseEnds { agent: None },
&hive_agent_sock::Request::GetLooseEnds { agent: None },
)
.await
{
Ok(hive_sh4re::Response::LooseEnds { loose_ends }) => {
Ok(hive_agent_sock::Response::LooseEnds { loose_ends }) => {
axum::Json(serde_json::json!({ "loose_ends": loose_ends })).into_response()
}
Ok(hive_sh4re::Response::Err { message }) => error_response(
Ok(hive_agent_sock::Response::Err { message }) => error_response(
StatusCode::INTERNAL_SERVER_ERROR,
&format!("get_loose_ends: {message}"),
),