feat: registry

This commit is contained in:
2026-04-01 12:16:05 +02:00
parent 01a3e0095c
commit 8d3245b7b1
7 changed files with 475 additions and 13 deletions

View File

@@ -1,10 +1,12 @@
"""µFrame compile endpoint — POST /api/compile."""
"""µFrame compile + DSL metadata endpoints."""
from fastapi import APIRouter, HTTPException
from pydantic import BaseModel
import uframe
import uframe.keywords # noqa: F401 — triggers keyword registration
from uframe.errors import UFrameError
from uframe.registry import get_dsl_meta
router = APIRouter()
@@ -36,3 +38,9 @@ async def compile_source(req: CompileRequest):
)
except UFrameError as e:
raise HTTPException(status_code=422, detail=str(e))
@router.get("/dsl-meta")
async def dsl_meta():
"""Return DSL metadata for frontend syntax highlighting and autocomplete."""
return get_dsl_meta()