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.
- tunacode/cli/commands/implementations/plan.py +50 -0
- tunacode/cli/commands/registry.py +3 -0
- tunacode/cli/repl.py +327 -186
- tunacode/cli/repl_components/command_parser.py +37 -4
- tunacode/cli/repl_components/error_recovery.py +79 -1
- tunacode/cli/repl_components/output_display.py +21 -1
- tunacode/cli/repl_components/tool_executor.py +12 -0
- tunacode/configuration/defaults.py +8 -0
- tunacode/constants.py +10 -2
- tunacode/core/agents/agent_components/agent_config.py +212 -22
- tunacode/core/agents/agent_components/node_processor.py +46 -40
- tunacode/core/code_index.py +83 -29
- tunacode/core/state.py +44 -0
- tunacode/core/token_usage/usage_tracker.py +2 -2
- tunacode/core/tool_handler.py +20 -0
- tunacode/prompts/system.md +117 -490
- tunacode/services/mcp.py +29 -7
- tunacode/tools/base.py +110 -0
- tunacode/tools/bash.py +96 -1
- tunacode/tools/exit_plan_mode.py +273 -0
- tunacode/tools/glob.py +366 -33
- tunacode/tools/grep.py +226 -77
- tunacode/tools/grep_components/result_formatter.py +98 -4
- tunacode/tools/list_dir.py +132 -2
- tunacode/tools/present_plan.py +288 -0
- tunacode/tools/read_file.py +91 -0
- tunacode/tools/run_command.py +99 -0
- tunacode/tools/schema_assembler.py +167 -0
- tunacode/tools/todo.py +108 -1
- tunacode/tools/update_file.py +94 -0
- tunacode/tools/write_file.py +86 -0
- tunacode/types.py +58 -0
- tunacode/ui/input.py +14 -2
- tunacode/ui/keybindings.py +25 -4
- tunacode/ui/panels.py +53 -8
- tunacode/ui/prompt_manager.py +25 -2
- tunacode/ui/tool_ui.py +3 -2
- tunacode/utils/json_utils.py +206 -0
- tunacode/utils/message_utils.py +14 -4
- tunacode/utils/ripgrep.py +332 -9
- {tunacode_cli-0.0.55.dist-info → tunacode_cli-0.0.57.dist-info}/METADATA +8 -3
- {tunacode_cli-0.0.55.dist-info → tunacode_cli-0.0.57.dist-info}/RECORD +46 -42
- tunacode/tools/read_file_async_poc.py +0 -196
- {tunacode_cli-0.0.55.dist-info → tunacode_cli-0.0.57.dist-info}/WHEEL +0 -0
- {tunacode_cli-0.0.55.dist-info → tunacode_cli-0.0.57.dist-info}/entry_points.txt +0 -0
- {tunacode_cli-0.0.55.dist-info → tunacode_cli-0.0.57.dist-info}/licenses/LICENSE +0 -0
- {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
|