greentic-flow-builder 0.3.1

Greentic Flow Builder — orchestrator that powers Adaptive Card design via the adaptive-card-mcp toolkit
Documentation
//! Static asset handlers: serve embedded HTML/JS/CSS.

use crate::ui::assets;
use axum::http::header;
use axum::response::IntoResponse;

const HTML_CT: &str = "text/html; charset=utf-8";
const JS_CT: &str = "application/javascript; charset=utf-8";
const CSS_CT: &str = "text/css; charset=utf-8";

pub async fn serve_index() -> impl IntoResponse {
    ([(header::CONTENT_TYPE, HTML_CT)], assets::INDEX_HTML)
}

pub async fn serve_app_js() -> impl IntoResponse {
    ([(header::CONTENT_TYPE, JS_CT)], assets::APP_JS)
}

pub async fn serve_api_js() -> impl IntoResponse {
    ([(header::CONTENT_TYPE, JS_CT)], assets::API_JS)
}

pub async fn serve_graph_js() -> impl IntoResponse {
    ([(header::CONTENT_TYPE, JS_CT)], assets::GRAPH_JS)
}

pub async fn serve_demo_js() -> impl IntoResponse {
    ([(header::CONTENT_TYPE, JS_CT)], assets::DEMO_JS)
}

pub async fn serve_sessions_js() -> impl IntoResponse {
    ([(header::CONTENT_TYPE, JS_CT)], assets::SESSIONS_JS)
}

pub async fn serve_css() -> impl IntoResponse {
    ([(header::CONTENT_TYPE, CSS_CT)], assets::STYLE_CSS)
}

pub async fn serve_providers() -> impl IntoResponse {
    (
        [(header::CONTENT_TYPE, "application/json; charset=utf-8")],
        assets::PROVIDERS_JSON,
    )
}