agent: route terminal scroll+backfill+SSE through hive-fr0nt::TERMINAL_JS

This commit is contained in:
müde 2026-05-17 11:53:50 +02:00
parent 0b9e7cbcf6
commit f27108aecf
5 changed files with 308 additions and 215 deletions

View file

@ -93,6 +93,7 @@ pub async fn serve(
.route("/", get(serve_index))
.route("/static/agent.css", get(serve_css))
.route("/static/app.js", get(serve_app_js))
.route("/static/hive-fr0nt.js", get(serve_shared_js))
.route("/api/state", get(api_state))
.route("/events/stream", get(events_stream))
.route("/events/history", get(events_history))
@ -181,6 +182,13 @@ async fn serve_app_js() -> impl IntoResponse {
)
}
async fn serve_shared_js() -> impl IntoResponse {
(
[("content-type", "application/javascript")],
hive_fr0nt::TERMINAL_JS,
)
}
#[derive(Serialize)]
struct StateSnapshot {
label: String,