use axum::{Router, routing::get};
use oneiros_service::*;
use tower_http::trace::TraceLayer;

use crate::handlers;

pub fn router(state: OneirosService) -> Router {
    Router::new()
        .route("/", get(handlers::dashboard::handler))
        .route("/activity", get(handlers::activity::handler))
        .nest("/agents", handlers::agent::router())
        .nest("/brains", handlers::brain::router())
        .nest("/cognitions", handlers::cognition::router())
        .nest("/connections", handlers::connection::router())
        .nest("/natures", handlers::nature::router())
        .nest("/dream", handlers::dream::router())
        .nest("/sensations", handlers::sensation::router())
        .nest("/events", handlers::event::router())
        .nest("/experiences", handlers::experience::router())
        .nest("/health", handlers::health::router())
        .nest("/introspect", handlers::introspect::router())
        .nest("/lifecycle", handlers::lifecycle::router())
        .nest("/levels", handlers::level::router())
        .nest("/memories", handlers::memory::router())
        .nest("/personas", handlers::persona::router())
        .nest("/pressures", handlers::pressure::router())
        .nest("/reflect", handlers::reflect::router())
        .nest("/search", handlers::search::router())
        .nest("/sense", handlers::sense::router())
        .nest("/storage", handlers::storage::router())
        .nest("/textures", handlers::texture::router())
        .nest("/urges", handlers::urge::router())
        .nest("/mcp", handlers::mcp::router(state.clone()))
        .layer(TraceLayer::new_for_http())
        .with_state(state)
}
