heldar-kernel 0.1.2

Heldar kernel — media/DVR control plane, perception ingest + sampler, zone engine, auth, and the worker SDK contract. The open, domain-agnostic platform that domain apps build on.
Documentation
use axum::extract::{Path, State};
use axum::routing::get;
use axum::{Json, Router};

use crate::error::AppResult;
use crate::services::mediamtx::{self, LiveUrls};
use crate::state::AppState;

pub fn router() -> Router<AppState> {
    Router::new().route(
        "/api/v1/cameras/{id}/liveview",
        get(liveview).post(liveview),
    )
}

/// Ensure a MediaMTX path exists for the camera and return live playback URLs.
async fn liveview(State(st): State<AppState>, Path(id): Path<String>) -> AppResult<Json<LiveUrls>> {
    Ok(Json(mediamtx::ensure_live(&st, &id).await?))
}