diff --git a/agent-office/app/main.py b/agent-office/app/main.py index cd4abd6..75d34b7 100644 --- a/agent-office/app/main.py +++ b/agent-office/app/main.py @@ -227,3 +227,30 @@ def youtube_research_status(): if not job: return {"status": "never_run"} return job + + +# --- Lotto Signal Endpoints --- + +@app.get("/api/agent-office/lotto/signals") +async def list_lotto_signals(days: int = 7): + """시그널 이력 (모든 fire_level).""" + from .db import get_signals_history + return {"items": get_signals_history(days=days)} + + +@app.get("/api/agent-office/lotto/baselines") +async def list_lotto_baselines(): + """현재 baseline μ/σ + window 상태.""" + from .db import get_all_baselines + return {"items": get_all_baselines()} + + +@app.post("/api/agent-office/lotto/signal-check") +async def trigger_signal_check(source: str = "light"): + """수동 트리거 (디버그·테스트용). source ∈ {light, sim, deep}.""" + if source not in ("light", "sim", "deep"): + raise HTTPException(status_code=400, detail="source must be light/sim/deep") + agent = AGENT_REGISTRY.get("lotto") + if not agent: + raise HTTPException(status_code=503, detail="lotto agent not registered") + return await agent.run_signal_check(source=source)