|
121 | 121 | [bold cyan]│[/bold cyan] [bold white]Agentes Especializados[/bold white] [bold cyan]│[/bold cyan] |
122 | 122 | [bold cyan]╰─────────────────────────────────────────────────────────────╯[/bold cyan] |
123 | 123 |
|
124 | | -[bold yellow]Planejamento[/bold yellow] |
| 124 | +[bold yellow]Planejamento (v6.1)[/bold yellow] |
125 | 125 | [cyan]/plan[/cyan] [white]<objetivo>[/white] [dim]......[/dim] GOAP planning, decompõe tarefas |
| 126 | + [cyan]/plan multi[/cyan] [white]<obj>[/white] [dim]....[/dim] Gera 3 planos alternativos (risk/reward) |
| 127 | + [cyan]/plan clarify[/cyan] [white]<obj>[/white] [dim]..[/dim] Faz perguntas antes de planejar |
| 128 | + [cyan]/plan explore[/cyan] [white]<obj>[/white] [dim]..[/dim] Análise read-only (sem modificar) |
126 | 129 | [cyan]/architect[/cyan] [white]<spec>[/white] [dim]....[/dim] Análise de arquitetura |
127 | 130 |
|
128 | 131 | [bold yellow]Código[/bold yellow] |
@@ -1268,8 +1271,30 @@ async def _handle_command( |
1268 | 1271 | view.add_success("Conversation context cleared.") |
1269 | 1272 |
|
1270 | 1273 | # Agent commands - map to agents |
| 1274 | + # ===================================================================== |
| 1275 | + # PLANNER v6.1 COMMANDS (multi, clarify, explore) |
| 1276 | + # ===================================================================== |
1271 | 1277 | elif command == "/plan": |
1272 | | - await self._invoke_agent("planner", args or "Create a plan", view) |
| 1278 | + # Check for v6.1 sub-commands |
| 1279 | + if args: |
| 1280 | + args_lower = args.lower().strip() |
| 1281 | + if args_lower.startswith("multi ") or args_lower == "multi": |
| 1282 | + # Multi-Plan Generation |
| 1283 | + task = args[6:].strip() if args_lower.startswith("multi ") else "" |
| 1284 | + await self._invoke_planner_v61("multi", task or "Generate multiple plans", view) |
| 1285 | + elif args_lower.startswith("clarify ") or args_lower == "clarify": |
| 1286 | + # Clarification Mode |
| 1287 | + task = args[8:].strip() if args_lower.startswith("clarify ") else "" |
| 1288 | + await self._invoke_planner_v61("clarify", task or "Clarify requirements", view) |
| 1289 | + elif args_lower.startswith("explore ") or args_lower == "explore": |
| 1290 | + # Exploration Mode (read-only) |
| 1291 | + task = args[8:].strip() if args_lower.startswith("explore ") else "" |
| 1292 | + await self._invoke_planner_v61("explore", task or "Explore codebase", view) |
| 1293 | + else: |
| 1294 | + # Regular planning |
| 1295 | + await self._invoke_agent("planner", args, view) |
| 1296 | + else: |
| 1297 | + await self._invoke_agent("planner", "Create a plan", view) |
1273 | 1298 |
|
1274 | 1299 | elif command == "/execute": |
1275 | 1300 | await self._invoke_agent("executor", args or "Execute task", view) |
@@ -2681,6 +2706,59 @@ async def _invoke_agent( |
2681 | 2706 | status.mode = "READY" |
2682 | 2707 | view.end_thinking() |
2683 | 2708 |
|
| 2709 | + async def _invoke_planner_v61( |
| 2710 | + self, |
| 2711 | + mode: str, |
| 2712 | + task: str, |
| 2713 | + view: ResponseView |
| 2714 | + ) -> None: |
| 2715 | + """ |
| 2716 | + Invoke Planner v6.1 with specific mode. |
| 2717 | +
|
| 2718 | + Modes: |
| 2719 | + - multi: Generate 3 alternative plans with risk/reward |
| 2720 | + - clarify: Ask clarifying questions before planning |
| 2721 | + - explore: Read-only analysis mode |
| 2722 | + """ |
| 2723 | + self.is_processing = True |
| 2724 | + view.start_thinking() |
| 2725 | + |
| 2726 | + status = self.query_one(StatusBar) |
| 2727 | + mode_labels = { |
| 2728 | + "multi": "MULTI-PLAN", |
| 2729 | + "clarify": "CLARIFY", |
| 2730 | + "explore": "EXPLORE" |
| 2731 | + } |
| 2732 | + status.mode = f"🎯 PLANNER:{mode_labels.get(mode, mode.upper())}" |
| 2733 | + |
| 2734 | + try: |
| 2735 | + if mode == "multi": |
| 2736 | + async for chunk in self.bridge.invoke_planner_multi(task): |
| 2737 | + view.append_chunk(chunk) |
| 2738 | + await asyncio.sleep(0) |
| 2739 | + elif mode == "clarify": |
| 2740 | + async for chunk in self.bridge.invoke_planner_clarify(task): |
| 2741 | + view.append_chunk(chunk) |
| 2742 | + await asyncio.sleep(0) |
| 2743 | + elif mode == "explore": |
| 2744 | + async for chunk in self.bridge.invoke_planner_explore(task): |
| 2745 | + view.append_chunk(chunk) |
| 2746 | + await asyncio.sleep(0) |
| 2747 | + else: |
| 2748 | + view.add_error(f"Unknown planner mode: {mode}") |
| 2749 | + return |
| 2750 | + |
| 2751 | + view.add_success(f"✓ Planner v6.1 ({mode}) complete") |
| 2752 | + status.governance_status = self.bridge.governance.get_status_emoji() |
| 2753 | + |
| 2754 | + except Exception as e: |
| 2755 | + view.add_error(f"Planner v6.1 error: {e}") |
| 2756 | + status.errors += 1 |
| 2757 | + finally: |
| 2758 | + self.is_processing = False |
| 2759 | + status.mode = "READY" |
| 2760 | + view.end_thinking() |
| 2761 | + |
2684 | 2762 | async def _execute_bash( |
2685 | 2763 | self, |
2686 | 2764 | command: str, |
|
0 commit comments