From dc9c13ffd94d9d7697b16b2237f0813e400f17da Mon Sep 17 00:00:00 2001 From: gilesb Date: Wed, 7 Jan 2026 14:13:56 +0000 Subject: [PATCH] feat: add HTML home page with nav to UI and docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- server.py | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 99 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index 2808921..9169be1 100644 --- a/server.py +++ b/server.py @@ -110,9 +110,9 @@ def cache_file(source: Path) -> str: return content_hash -@app.get("/") -async def root(): - """Server info.""" +@app.get("/api") +async def api_info(): + """Server info (JSON).""" return { "name": "Art DAG L1 Server", "version": "0.1.0", @@ -121,6 +121,102 @@ async def root(): } +HOME_HTML = """ + + + + Art DAG L1 Server + + + +
+ +

Art DAG L1 Server

+

L1 rendering server for the Art DAG system. Manages distributed rendering jobs via Celery workers.

+ +

Dependencies

+
    +
  • artdag (GitHub): Core DAG execution engine
  • +
  • artdag-effects (rose-ash): Effect implementations
  • +
  • Redis: Message broker, result backend, and run persistence
  • +
+ +

API Endpoints

+ + + + + + + + + + +
MethodPathDescription
GET/uiWeb UI for viewing runs
POST/runsStart a rendering run
GET/runsList all runs
GET/runs/{run_id}Get run status
GET/cacheList cached content hashes
GET/cache/{hash}Download cached content
POST/cache/uploadUpload file to cache
GET/assetsList known assets
+ +

Start a Run

+
curl -X POST /runs \\
+  -H "Content-Type: application/json" \\
+  -d '{"recipe": "dog", "inputs": ["33268b6e..."]}'
+ +

Provenance

+

Every render produces a provenance record linking inputs, effects, and infrastructure:

+
{
+  "output": {"content_hash": "..."},
+  "inputs": [...],
+  "effects": [...],
+  "infrastructure": {...}
+}
+
+ + +""" + + +@app.get("/", response_class=HTMLResponse) +async def root(): + """Home page.""" + return HOME_HTML + + @app.post("/runs", response_model=RunStatus) async def create_run(request: RunRequest): """Start a new rendering run."""