update
This commit is contained in:
@@ -164,7 +164,7 @@ async def create_blocks(req: BlocksCreateRequest):
|
||||
raise HTTPException(400, "Link must start with http:// or https://.")
|
||||
qp.parent.mkdir(parents=True, exist_ok=True)
|
||||
atomic_write_json(qp, {"type": type, "location": location, "spec": req.instructions.strip()})
|
||||
asyncio.create_task(generate_blocks(topic, req.instructions.strip(), req.provider, ab_phase=req.ab_phase, ab_step=req.ab_step, to_step=req.to_step))
|
||||
asyncio.create_task(generate_blocks(topic, req.instructions.strip(), req.provider, ab_phase=req.ab_phase, ab_step=req.ab_step, to_step=req.to_step, research=req.research))
|
||||
return {"ok": True}
|
||||
|
||||
|
||||
@@ -231,6 +231,28 @@ async def get_blocks_uebersicht(topic: str):
|
||||
return await load_overview(topic)
|
||||
|
||||
|
||||
@router.get("/blocks/kanban")
|
||||
async def get_kanban_board(topic: str):
|
||||
"""Live card counts per kanban column (empty dict when the streaming inventory is not in use)."""
|
||||
import database as db
|
||||
return await db.kanban_stage_counts(topic)
|
||||
|
||||
|
||||
@router.get("/blocks/agents")
|
||||
async def get_active_agents(topic: str):
|
||||
"""Currently running agents for this topic + their runtime (seconds). Label = key minus prefix."""
|
||||
from agents import active_agents
|
||||
prefix = f"blocks-{topic}-"
|
||||
return [{"label": a["key"][len(prefix):], "runtime": a["runtime"]} for a in active_agents(prefix)]
|
||||
|
||||
|
||||
@router.post("/blocks/research")
|
||||
async def add_research(topic: str):
|
||||
"""Attach one more research agent to the running kanban flow (live breadth boost)."""
|
||||
from kanban import add_research_agent
|
||||
return {"started": add_research_agent(topic)}
|
||||
|
||||
|
||||
@router.get("/blocks/question-pattern")
|
||||
async def get_question_pattern(topic: str, block: str):
|
||||
"""Unlocked question patterns of a block (up to the current level; empty = live)."""
|
||||
|
||||
Reference in New Issue
Block a user