feat: registry
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user