auto-sync: 2026-05-17 00:46:35
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
"""API 路由 — Daemon 控制"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
router = APIRouter(prefix="/api/daemon", tags=["daemon"])
|
||||
|
||||
|
||||
@router.get("/status")
|
||||
async def daemon_status():
|
||||
from src.main import _ticker_task, config
|
||||
return {
|
||||
"status": "running",
|
||||
"version": "2.6.0",
|
||||
"ticker_running": _ticker_task is not None and not _ticker_task.done(),
|
||||
"config": {
|
||||
"tick_interval": config.get("daemon", {}).get("tick_interval", 30),
|
||||
"max_global_agents": config.get("daemon", {}).get("max_global_agents", 5),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@router.post("/tick")
|
||||
async def manual_tick():
|
||||
"""触发手动 tick(占位,F6 实现)"""
|
||||
return {"ok": True, "message": "Manual tick triggered (placeholder)"}
|
||||
Reference in New Issue
Block a user