🚀 Auto-deploy: BotVPS atualizado em 02/05/2026 15:37:40
This commit is contained in:
@@ -63,7 +63,7 @@ Retorne JSON: {"success": true|false, "output": "resultado"}
|
||||
# ============================================================
|
||||
|
||||
def _format_tools_for_prompt() -> str:
|
||||
return "\n".join([f"- {name}: {info['desc']} [{info['danger']}]" for name, info in TOOLS_V2.items()])
|
||||
return "\n".join([f"- {name}: {info.get('description', '')}" for name, info in TOOLS_V2.items()])
|
||||
|
||||
async def detect_git_repo_path_async(task: str) -> str:
|
||||
"""Detecta automaticamente o caminho do repositório Git (async)."""
|
||||
@@ -165,8 +165,18 @@ async def execute_step_async(step: Dict) -> Dict:
|
||||
# MAIN ORCHESTRATION
|
||||
# ============================================================
|
||||
|
||||
async def orchestrate_async(task: str, user_confirmed: bool = False) -> Dict:
|
||||
plan = await plan_task_async(task)
|
||||
async def orchestrate_async(task: str, user_confirmed: bool = False, plan: Dict = None) -> Dict:
|
||||
# Se já temos um plano confirmado, executa direto sem replanejar
|
||||
if user_confirmed and plan:
|
||||
results = []
|
||||
for step in plan.get("steps", []):
|
||||
res = await execute_step_async(step)
|
||||
results.append(res)
|
||||
if not res["success"] and step.get("danger") == "dangerous":
|
||||
break
|
||||
return {"status": "completed", "plan": plan, "results": results}
|
||||
|
||||
plan = plan or await plan_task_async(task)
|
||||
|
||||
# Verifica perigo
|
||||
dangerous = [s for s in plan.get("steps", []) if s.get("danger") in ["medium", "dangerous"]]
|
||||
|
||||
Reference in New Issue
Block a user