feat(events): add generic Event Bus and /events/wait endpoint for agent wakeups

This commit is contained in:
Riz Ashraf committed 2026-09-26 02:05:18 +01:00
1 parent b8d58b2e64
commit efcab4a7b4
5 files changed
+69

No files matched your search

+13
View File
@@ -45,5 +45,18 @@ pub async fn nvim_telemetry_handler(
let _ = tx.try_send(msg_str.clone());
}
if payload.event == "BufWritePost" {
if let Some(ref file_path) = payload.file {
let normalized_file = file_path.replace("\\", "/");
let topic = format!("nvim:save:{}", normalized_file);
let event = crate::state::GenericEvent {
topic,
session_id: Some(payload.session_id.clone()),
payload: serde_json::json!(&payload),
};
let _ = state.handler.state.event_bus_tx.send(event);
}
}
axum::Json(serde_json::json!({"status": "ok"}))
}