(body: RunRequest)
| 104 | "running": _live_run["running"], |
| 105 | "target": _live_run["target"], |
| 106 | "log": _live_run["log"][-50:], # last 50 lines |
| 107 | "error": _live_run["error"], |
| 108 | } |
| 109 | |
| 110 | @app.post("/api/run") |
| 111 | async def api_trigger_run(body: RunRequest): |
| 112 | global _live_run |
| 113 | target = (body.target or "").strip() |
| 114 | mode = body.mode |
| 115 | profile = body.profile |
| 116 | |
| 117 | if not target: |
| 118 | raise HTTPException(status_code=400, detail="target is required") |
| 119 | if _live_run["running"]: |
| 120 | raise HTTPException(status_code=409, detail="A run is already in progress") |
| 121 | |
| 122 | _live_run = {"running": True, "target": target, "log": [], "error": ""} |
nothing calls this directly
no test coverage detected