Skip to content

src/dazzle_ui/runtime/page_routes.py

Generated: 2026-03-30T04:38:49.115369+00:00

Commit: 615f1354a103

Language: python

Scope: dazzle_ui

Purpose

Page routes for server-rendered Dazzle pages.

Creates FastAPI routes that render full HTML pages using Jinja2 templates. Each workspace+surface combination gets a GET route that: 1. Calls the template compiler to get a PageContext 2. Fetches data from the backend service 3. Renders the Jinja2 templ...

Key Exports

  • _PageDeps
  • create_page_routes

Dependencies

Imports

  • asyncio
  • json
  • logging
  • os
  • urllib.request
  • collections.abc.Callable
  • dataclasses.dataclass
  • dataclasses.field
  • functools.partial
  • typing.Any
  • dazzle.core.ir
  • dazzle.core.access.AccessOperationKind
  • dazzle.core.access.AccessRuntimeContext
  • dazzle.core.manifest.resolve_api_url
  • fastapi.APIRouter
  • fastapi.HTTPException
  • fastapi.Request
  • fastapi.responses.HTMLResponse
  • fastapi.responses.JSONResponse
  • fastapi.responses.RedirectResponse

Event Interactions

None detected.

Invariants and Assumptions

  • Validates: Unsupported URL scheme: {parsed.scheme!r}
  • create_url suppression) must not leak between requests (#587).

Tests

  • tests/integration/test_runtime_e2e.py
  • tests/integration/test_runtime_pipeline.py
  • tests/unit/test_runtime_test_routes.py
  • tests/unit/test_runtime_services.py
  • tests/unit/test_runtime_mcp_tools.py

Notes

This page was automatically generated by tools/gen_reference_docs.py.