"""
URL configuration for Mnemosyne project.
"""

from django.contrib import admin
from django.urls import include, path

from . import views

urlpatterns = [
    # Health checks — no auth, must return 200 (not redirect) — use trailing slash
    path("live/", views.live, name="live"),
    path("ready/", views.ready, name="ready"),
    # Landing / Dashboard
    path("", views.landing, name="landing"),
    path("dashboard/", views.dashboard, name="dashboard"),
    # Allauth (SSO + local login/logout/password reset)
    path("accounts/", include("allauth.urls")),
    # Admin
    path("admin/", admin.site.urls),
    # Prometheus metrics
    path("", include("django_prometheus.urls")),
    # Themis (auth, keys, profile, notifications)
    path("", include("themis.urls")),
    path("api/v1/", include("themis.api.urls")),
    path("api/v1/llm/", include("llm_manager.api.urls")),
    # Library (Neo4j content graph)
    path("library/", include("library.urls")),
    # LLM Manager
    path("llm/", include("llm_manager.urls")),
    # MCP server — two surfaces:
    #   /profile/tokens/…       — per-user self-service token dashboard (HTML, session auth)
    #   /mcp_server/api/…       — Daedalus-facing team control plane (DRF, UserToken auth)
    # The MCP bearer-auth surface itself (tool calls) is mounted by
    # mnemosyne.asgi at /mcp/ and is not routed here.
    path("", include("mcp_server.urls")),
    path("mcp_server/api/", include("mcp_server.api.urls")),
]
