tunacode-cli 0.0.55__py3-none-any.whl → 0.0.57__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of tunacode-cli might be problematic. Click here for more details.

Files changed (47) hide show
  1. tunacode/cli/commands/implementations/plan.py +50 -0
  2. tunacode/cli/commands/registry.py +3 -0
  3. tunacode/cli/repl.py +327 -186
  4. tunacode/cli/repl_components/command_parser.py +37 -4
  5. tunacode/cli/repl_components/error_recovery.py +79 -1
  6. tunacode/cli/repl_components/output_display.py +21 -1
  7. tunacode/cli/repl_components/tool_executor.py +12 -0
  8. tunacode/configuration/defaults.py +8 -0
  9. tunacode/constants.py +10 -2
  10. tunacode/core/agents/agent_components/agent_config.py +212 -22
  11. tunacode/core/agents/agent_components/node_processor.py +46 -40
  12. tunacode/core/code_index.py +83 -29
  13. tunacode/core/state.py +44 -0
  14. tunacode/core/token_usage/usage_tracker.py +2 -2
  15. tunacode/core/tool_handler.py +20 -0
  16. tunacode/prompts/system.md +117 -490
  17. tunacode/services/mcp.py +29 -7
  18. tunacode/tools/base.py +110 -0
  19. tunacode/tools/bash.py +96 -1
  20. tunacode/tools/exit_plan_mode.py +273 -0
  21. tunacode/tools/glob.py +366 -33
  22. tunacode/tools/grep.py +226 -77
  23. tunacode/tools/grep_components/result_formatter.py +98 -4
  24. tunacode/tools/list_dir.py +132 -2
  25. tunacode/tools/present_plan.py +288 -0
  26. tunacode/tools/read_file.py +91 -0
  27. tunacode/tools/run_command.py +99 -0
  28. tunacode/tools/schema_assembler.py +167 -0
  29. tunacode/tools/todo.py +108 -1
  30. tunacode/tools/update_file.py +94 -0
  31. tunacode/tools/write_file.py +86 -0
  32. tunacode/types.py +58 -0
  33. tunacode/ui/input.py +14 -2
  34. tunacode/ui/keybindings.py +25 -4
  35. tunacode/ui/panels.py +53 -8
  36. tunacode/ui/prompt_manager.py +25 -2
  37. tunacode/ui/tool_ui.py +3 -2
  38. tunacode/utils/json_utils.py +206 -0
  39. tunacode/utils/message_utils.py +14 -4
  40. tunacode/utils/ripgrep.py +332 -9
  41. {tunacode_cli-0.0.55.dist-info → tunacode_cli-0.0.57.dist-info}/METADATA +8 -3
  42. {tunacode_cli-0.0.55.dist-info → tunacode_cli-0.0.57.dist-info}/RECORD +46 -42
  43. tunacode/tools/read_file_async_poc.py +0 -196
  44. {tunacode_cli-0.0.55.dist-info → tunacode_cli-0.0.57.dist-info}/WHEEL +0 -0
  45. {tunacode_cli-0.0.55.dist-info → tunacode_cli-0.0.57.dist-info}/entry_points.txt +0 -0
  46. {tunacode_cli-0.0.55.dist-info → tunacode_cli-0.0.57.dist-info}/licenses/LICENSE +0 -0
  47. {tunacode_cli-0.0.55.dist-info → tunacode_cli-0.0.57.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,50 @@
1
+ """Plan mode commands for TunaCode."""
2
+
3
+ from typing import List
4
+
5
+ from ....types import CommandContext
6
+ from ....ui import console as ui
7
+ from ..base import CommandCategory, CommandSpec, SimpleCommand
8
+
9
+
10
+ class PlanCommand(SimpleCommand):
11
+ """Enter plan mode for read-only research and planning."""
12
+
13
+ spec = CommandSpec(
14
+ name="plan",
15
+ aliases=["/plan"],
16
+ description="Enter Plan Mode - read-only research phase",
17
+ category=CommandCategory.DEVELOPMENT,
18
+ )
19
+
20
+ async def execute(self, args: List[str], context: CommandContext) -> None:
21
+ """Enter plan mode."""
22
+ context.state_manager.enter_plan_mode()
23
+
24
+ await ui.info("🔍 Entering Plan Mode")
25
+ await ui.info("• Only read-only operations available")
26
+ await ui.info("• Use tools to research and analyze the codebase")
27
+ await ui.info("• Use 'exit_plan_mode' tool to present your plan")
28
+ await ui.info("• Read-only tools: read_file, grep, list_dir, glob")
29
+ await ui.success("✅ Plan Mode active - indicator will appear above next input")
30
+
31
+
32
+ class ExitPlanCommand(SimpleCommand):
33
+ """Exit plan mode manually."""
34
+
35
+ spec = CommandSpec(
36
+ name="exit-plan",
37
+ aliases=["/exit-plan"],
38
+ description="Exit Plan Mode and return to normal mode",
39
+ category=CommandCategory.DEVELOPMENT,
40
+ )
41
+
42
+ async def execute(self, args: List[str], context: CommandContext) -> None:
43
+ """Exit plan mode manually."""
44
+ if not context.state_manager.is_plan_mode():
45
+ await ui.warning("Not currently in Plan Mode")
46
+ return
47
+
48
+ context.state_manager.exit_plan_mode()
49
+ await ui.success("🚪 Exiting Plan Mode - returning to normal mode")
50
+ await ui.info("✅ All tools are now available - '⏸ PLAN MODE ON' status removed")
@@ -23,6 +23,7 @@ from .implementations.debug import (
23
23
  )
24
24
  from .implementations.development import BranchCommand, InitCommand
25
25
  from .implementations.model import ModelCommand
26
+ from .implementations.plan import ExitPlanCommand, PlanCommand
26
27
  from .implementations.system import (
27
28
  ClearCommand,
28
29
  HelpCommand,
@@ -129,6 +130,8 @@ class CommandRegistry:
129
130
  InitCommand,
130
131
  TemplateCommand,
131
132
  TodoCommand,
133
+ PlanCommand, # Add plan command
134
+ ExitPlanCommand, # Add exit plan command
132
135
  ]
133
136
 
134
137
  # Register all discovered commands