auto-sync: 2026-05-17 13:05:55
This commit is contained in:
@@ -39,7 +39,7 @@ async def list_tasks(project_id: str,
|
||||
|
||||
@router.get("/tasks/{task_id}")
|
||||
async def get_task(project_id: str, task_id: str,
|
||||
expand: Optional[str] = None):
|
||||
expand: Optional[str] = None):
|
||||
bb = _bb(project_id)
|
||||
task = bb.get_task(task_id)
|
||||
if not task:
|
||||
@@ -120,13 +120,11 @@ async def add_comment(project_id: str, task_id: str, body: Dict[str, Any]):
|
||||
@router.get("/tasks/{task_id}/outputs")
|
||||
async def get_outputs(project_id: str, task_id: str):
|
||||
bb = _bb(project_id)
|
||||
return {"decisions": [dict(d.__dict__) for d in bb.get_decisions(task_id)]}
|
||||
return {"outputs": [dict(o.__dict__) for o in bb.get_outputs(task_id)]}
|
||||
|
||||
|
||||
# --- Per-task Decisions (POST) ---
|
||||
|
||||
@router.post("/tasks/{task_id}/decisions")
|
||||
async def add_decision(project_id: str, task_id: str, body: Dict[str, Any]):
|
||||
@router.post("/tasks/{task_id}/outputs")
|
||||
async def write_output(project_id: str, task_id: str, body: Dict[str, Any]):
|
||||
bb = _bb(project_id)
|
||||
oid = bb.write_output(task_id, body["agent"], body["type"],
|
||||
body["title"], content_path=body.get("path"),
|
||||
@@ -137,6 +135,12 @@ async def add_decision(project_id: str, task_id: str, body: Dict[str, Any]):
|
||||
|
||||
# --- Decisions ---
|
||||
|
||||
@router.get("/tasks/{task_id}/decisions")
|
||||
async def get_decisions(project_id: str, task_id: str):
|
||||
bb = _bb(project_id)
|
||||
return {"decisions": [dict(d.__dict__) for d in bb.get_decisions(task_id)]}
|
||||
|
||||
|
||||
@router.post("/tasks/{task_id}/decisions")
|
||||
async def add_decision(project_id: str, task_id: str, body: Dict[str, Any]):
|
||||
bb = _bb(project_id)
|
||||
@@ -177,11 +181,11 @@ async def add_review(project_id: str, task_id: str, body: Dict[str, Any]):
|
||||
return {"ok": True, "review_id": review.id}
|
||||
|
||||
|
||||
# --- Events ---
|
||||
# --- Per-task Events & Experiences ---
|
||||
|
||||
@router.get("/tasks/{task_id}/events")
|
||||
async def get_task_events(project_id: str, task_id: str,
|
||||
limit: int = Query(50, le=200)):
|
||||
limit: int = Query(50, le=200)):
|
||||
q = _q(project_id)
|
||||
return {"events": q.task_events(task_id, limit)}
|
||||
|
||||
@@ -192,6 +196,8 @@ async def get_task_experiences(project_id: str, task_id: str):
|
||||
return {"experiences": q.task_experiences(task_id)}
|
||||
|
||||
|
||||
# --- Global Events ---
|
||||
|
||||
@router.get("/events")
|
||||
async def get_events(project_id: str, limit: int = Query(50, le=200)):
|
||||
q = _q(project_id)
|
||||
|
||||
Reference in New Issue
Block a user