tunacode-cli 0.0.34__tar.gz → 0.0.36__tar.gz
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-0.0.34 → tunacode_cli-0.0.36}/CLAUDE.md +12 -245
- {tunacode_cli-0.0.34/src/tunacode_cli.egg-info → tunacode_cli-0.0.36}/PKG-INFO +1 -1
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/pyproject.toml +2 -1
- tunacode_cli-0.0.36/src/tunacode/cli/commands/__init__.py +62 -0
- tunacode_cli-0.0.36/src/tunacode/cli/commands/base.py +99 -0
- tunacode_cli-0.0.36/src/tunacode/cli/commands/implementations/__init__.py +37 -0
- tunacode_cli-0.0.36/src/tunacode/cli/commands/implementations/conversation.py +115 -0
- tunacode_cli-0.0.36/src/tunacode/cli/commands/implementations/debug.py +189 -0
- tunacode_cli-0.0.36/src/tunacode/cli/commands/implementations/development.py +77 -0
- tunacode_cli-0.0.36/src/tunacode/cli/commands/implementations/model.py +61 -0
- tunacode_cli-0.0.36/src/tunacode/cli/commands/implementations/system.py +177 -0
- tunacode_cli-0.0.36/src/tunacode/cli/commands/registry.py +229 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/cli/repl.py +17 -5
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/configuration/settings.py +9 -2
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/constants.py +1 -1
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/core/agents/main.py +12 -2
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/core/state.py +9 -2
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/setup.py +7 -2
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/tools/read_file.py +8 -2
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/tools/read_file_async_poc.py +18 -10
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/tools/run_command.py +29 -12
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/ui/console.py +27 -4
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/ui/output.py +7 -2
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/ui/panels.py +24 -5
- tunacode_cli-0.0.36/src/tunacode/utils/security.py +208 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/utils/text_utils.py +6 -2
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36/src/tunacode_cli.egg-info}/PKG-INFO +1 -1
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode_cli.egg-info/SOURCES.txt +11 -1
- tunacode_cli-0.0.36/tests/test_security.py +192 -0
- tunacode_cli-0.0.34/src/tunacode/cli/commands.py +0 -877
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/LICENSE +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/MANIFEST.in +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/README.md +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/TUNACODE.md +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/setup.cfg +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/setup.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/__init__.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/cli/__init__.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/cli/main.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/cli/textual_app.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/cli/textual_bridge.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/configuration/__init__.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/configuration/defaults.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/configuration/models.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/context.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/core/__init__.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/core/agents/__init__.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/core/background/__init__.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/core/background/manager.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/core/code_index.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/core/llm/__init__.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/core/setup/__init__.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/core/setup/agent_setup.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/core/setup/base.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/core/setup/config_setup.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/core/setup/coordinator.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/core/setup/environment_setup.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/core/setup/git_safety_setup.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/core/tool_handler.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/exceptions.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/prompts/system.md +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/py.typed +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/services/__init__.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/services/mcp.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/tools/__init__.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/tools/base.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/tools/bash.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/tools/glob.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/tools/grep.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/tools/list_dir.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/tools/update_file.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/tools/write_file.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/types.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/ui/__init__.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/ui/completers.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/ui/constants.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/ui/decorators.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/ui/input.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/ui/keybindings.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/ui/lexers.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/ui/prompt_manager.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/ui/tool_ui.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/ui/validators.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/utils/__init__.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/utils/bm25.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/utils/diff_utils.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/utils/file_utils.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/utils/import_cache.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/utils/ripgrep.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/utils/system.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/utils/token_counter.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode/utils/user_configuration.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode_cli.egg-info/dependency_links.txt +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode_cli.egg-info/entry_points.txt +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode_cli.egg-info/requires.txt +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/src/tunacode_cli.egg-info/top_level.txt +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/agent/__init__.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/agent/conftest.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/agent/test_agent_creation.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/agent/test_json_tool_parsing.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/agent/test_process_node.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/agent/test_process_request.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/agent/test_tool_message_patching.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/background/test_background_edge_cases.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/background/test_cleanup.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/background/test_task_cancellation.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/background/test_task_creation.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/background/test_task_execution.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/code_index/test_cache_management.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/code_index/test_file_scanning.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/code_index/test_index_building.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/code_index/test_search_operations.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/code_index/test_symbol_extraction.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/commands/__init__.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/commands/test_init_command.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/conftest.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/context/__init__.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/context/test_context_acceptance.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/context/test_context_integration.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/context/test_context_loading.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/context/test_tunacode_logging.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/repl/test_command_parsing.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/repl/test_input_handling.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/repl/test_keyboard_interrupts.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/repl/test_multiline_input.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/repl/test_repl_initialization.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/repl/test_session_flow.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/services/test_error_recovery.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/services/test_llm_routing.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/services/test_mcp_integration.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/services/test_service_lifecycle.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/state/test_agent_tracking.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/state/test_message_history.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/state/test_permissions.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/state/test_session_management.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/state/test_state_initialization.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/state/test_user_config.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/test_characterization_commands.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/ui/test_async_ui.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/ui/test_console_output.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/ui/test_diff_display.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/ui/test_prompt_rendering.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/ui/test_tool_confirmations.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/utils/test_file_operations.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/utils/test_git_commands.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/utils/test_token_counting.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/characterization/utils/test_utils_edge_cases.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/conftest.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/crud/test_core_file_operations.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/fixtures/__init__.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/fixtures/file_operations.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/integration/test_error_recovery_flow.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/integration/test_full_session_flow.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/integration/test_mcp_tool_flow.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/integration/test_multi_tool_operations.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/integration/test_performance_scenarios.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_actual_parallelism.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_agent_initialization.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_background_manager.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_characterization_agent_main.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_characterization_bash.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_characterization_commands_system.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_characterization_glob.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_characterization_grep.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_characterization_grep_performance.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_characterization_iteration_limits.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_characterization_list_dir.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_characterization_read_file.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_characterization_repl_utils.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_characterization_run_command.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_characterization_setup_system.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_characterization_tool_ui_behavior.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_characterization_update_file.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_characterization_utilities.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_characterization_write_file.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_cli_command_flow.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_cli_file_operations_integration.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_config_directory_creation.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_config_setup_async.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_enhanced_visual_feedback.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_fallback_responses.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_fast_glob_search.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_file_operations_edge_cases.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_file_operations_stress.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_file_reference_context_tracking.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_file_reference_expansion.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_grep_fast_glob.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_grep_legacy_compat.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_grep_timeout.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_json_tool_parsing.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_list_dir.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_parallel_execution_demo.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_parallel_execution_freeze_fix.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_parallel_execution_integration.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_parallel_read_only_tools.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_parallel_tool_execution.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_read_only_confirmation.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_tool_categorization.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_tool_combinations.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_tool_handler_ui_messages.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_update_command.py +0 -0
- {tunacode_cli-0.0.34 → tunacode_cli-0.0.36}/tests/test_visual_parallel_feedback.py +0 -0
|
@@ -10,251 +10,18 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|
|
10
10
|
# Install development environment (recommended approach)
|
|
11
11
|
./scripts/setup_dev_env.sh # Creates fresh venv, installs deps, verifies setup
|
|
12
12
|
|
|
13
|
-
# You must always follow the
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
├── product_context.md
|
|
26
|
-
├── current_state_summary.md
|
|
27
|
-
└── progress_overview.md
|
|
28
|
-
|
|
29
|
-
🚀 Quick start:
|
|
30
|
-
1. Edit memory-bank/*.md files with your project details
|
|
31
|
-
2. ./wakeup.sh # Read current context
|
|
32
|
-
3. ./scratchpad.sh start 'Task' # Begin new task
|
|
33
|
-
4. ./scratchpad.sh step 'Action' # Log progress
|
|
34
|
-
5. ./scratchpad.sh close 'Done' # Complete task
|
|
35
|
-
|
|
36
|
-
📖 Full guide: cat agent-tools/WORKFLOW_GUIDE.md
|
|
37
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
38
|
-
<system_prompt>
|
|
39
|
-
|
|
40
|
-
###Instruction###
|
|
41
|
-
|
|
42
|
-
You are an expert software engineering assistant equipped with specialized bash tools for memory management and task tracking. Your primary goal is to maintain persistent context across sessions while following a structured workflow.
|
|
43
|
-
|
|
44
|
-
You MUST use these tools proactively and frequently. You will be penalized for failing to use appropriate tools when they would improve task outcomes.
|
|
45
|
-
|
|
46
|
-
<role>Expert Software Engineering Assistant with Memory Management Tools</role>
|
|
47
|
-
|
|
48
|
-
<available_tools>
|
|
49
|
-
1. wakeup.sh - Read memory bank to regain project context
|
|
50
|
-
2. scratchpad.sh - Task logging and progress tracking
|
|
51
|
-
3. check_workflow.sh - Simple verification check
|
|
52
|
-
4. bankctl.sh - Memory bank initialization and management
|
|
53
|
-
</available_tools>
|
|
54
|
-
|
|
55
|
-
<critical_requirements>
|
|
56
|
-
- Think step by step when approaching any task
|
|
57
|
-
- Always run wakeup.sh at the start of a new session to regain context
|
|
58
|
-
- Use scratchpad.sh for EVERY task to maintain detailed work logs
|
|
59
|
-
- Update memory-bank/current_state_summary.md after completing tasks
|
|
60
|
-
- Occasionally run check_workflow.sh to verify nothing was missed
|
|
61
|
-
- Ensure that your approach is unbiased and does not rely on stereotypes
|
|
62
|
-
</critical_requirements>
|
|
63
|
-
|
|
64
|
-
###Example###
|
|
65
|
-
|
|
66
|
-
<example_workflow>
|
|
67
|
-
User: "Help me implement a new user registration feature"
|
|
68
|
-
|
|
69
|
-
CORRECT APPROACH:
|
|
70
|
-
1. ./wakeup.sh (read memory bank to understand project context)
|
|
71
|
-
2. ./scratchpad.sh start "Implement user registration feature"
|
|
72
|
-
3. ./scratchpad.sh plan "1. Create user model 2. Design API endpoint 3. Add validation 4. Write tests"
|
|
73
|
-
4. ./scratchpad.sh step "Created User model in models.py with email, username, password_hash"
|
|
74
|
-
5. ./scratchpad.sh step "Implemented POST /register endpoint with input validation"
|
|
75
|
-
6. ./scratchpad.sh step "Added password hashing using bcrypt"
|
|
76
|
-
7. ./scratchpad.sh step "Wrote unit tests for registration flow"
|
|
77
|
-
8. ./scratchpad.sh close "User registration feature complete"
|
|
78
|
-
9. Update memory-bank/current_state_summary.md with session outcome
|
|
79
|
-
10. ./check_workflow.sh (verify workflow was followed)
|
|
80
|
-
|
|
81
|
-
INCORRECT APPROACH:
|
|
82
|
-
- Starting work without reading memory bank
|
|
83
|
-
- Making changes without tracking steps in scratchpad
|
|
84
|
-
- Not updating current_state_summary.md after task completion
|
|
85
|
-
- Never checking if workflow was properly followed
|
|
86
|
-
</example_workflow>
|
|
87
|
-
|
|
88
|
-
###Guidelines###
|
|
89
|
-
|
|
90
|
-
<wakeup_usage>
|
|
91
|
-
WHEN TO USE:
|
|
92
|
-
- At the start of EVERY new session
|
|
93
|
-
- When returning to a project after any break
|
|
94
|
-
- To understand project context and current state
|
|
95
|
-
|
|
96
|
-
OUTPUT:
|
|
97
|
-
- Reads all memory bank files in priority order
|
|
98
|
-
- Shows current_state_summary.md first (most important)
|
|
99
|
-
- Displays project brief, technical context, product context, and progress
|
|
100
|
-
|
|
101
|
-
You MUST:
|
|
102
|
-
- Always run wakeup.sh before starting any work
|
|
103
|
-
- Pay special attention to current_state_summary.md
|
|
104
|
-
- Use the context to inform your approach
|
|
105
|
-
</wakeup_usage>
|
|
106
|
-
|
|
107
|
-
<scratchpad_usage>
|
|
108
|
-
WHEN TO USE:
|
|
109
|
-
- For EVERY task, regardless of complexity
|
|
110
|
-
- Even for single-step tasks (maintains history)
|
|
111
|
-
- When exploring, debugging, or implementing features
|
|
112
|
-
|
|
113
|
-
COMMANDS:
|
|
114
|
-
- start "task_name": Begin new task tracking
|
|
115
|
-
- plan "plan_details": Document your approach
|
|
116
|
-
- step "action_taken": Log each action/decision
|
|
117
|
-
- close "completion_message": Archive the task
|
|
118
|
-
|
|
119
|
-
You MUST:
|
|
120
|
-
- Start scratchpad for every task
|
|
121
|
-
- Log detailed steps as you work
|
|
122
|
-
- Close and archive when complete
|
|
123
|
-
- Note: close command auto-sanitizes filenames
|
|
124
|
-
</scratchpad_usage>
|
|
125
|
-
|
|
126
|
-
<check_workflow_usage>
|
|
127
|
-
WHEN TO USE:
|
|
128
|
-
- After completing a few tasks
|
|
129
|
-
- When you want to verify workflow compliance
|
|
130
|
-
- Periodically to ensure nothing was missed
|
|
131
|
-
|
|
132
|
-
OUTPUT:
|
|
133
|
-
- Shows when memory bank was last updated
|
|
134
|
-
- Lists recent archived scratchpads
|
|
135
|
-
- Displays current state summary
|
|
136
|
-
|
|
137
|
-
You SHOULD:
|
|
138
|
-
- Run this occasionally (not after every single task)
|
|
139
|
-
- Use it as a sanity check for workflow adherence
|
|
140
|
-
- Pay attention if updates are getting stale
|
|
141
|
-
</check_workflow_usage>
|
|
142
|
-
|
|
143
|
-
<bankctl_usage>
|
|
144
|
-
WHEN TO USE:
|
|
145
|
-
- First time setup of a project
|
|
146
|
-
- When memory bank structure needs initialization
|
|
147
|
-
- For memory bank maintenance tasks
|
|
148
|
-
|
|
149
|
-
COMMANDS:
|
|
150
|
-
- init: Initialize memory bank structure
|
|
151
|
-
- Other commands vary by implementation
|
|
152
|
-
|
|
153
|
-
You MUST:
|
|
154
|
-
- Use bankctl.sh init for new projects
|
|
155
|
-
- Ensure memory bank exists before using other tools
|
|
156
|
-
</bankctl_usage>
|
|
157
|
-
|
|
158
|
-
<memory_bank_structure>
|
|
159
|
-
CORE FILES:
|
|
160
|
-
1. project_brief.md - What & why of the project
|
|
161
|
-
2. tech_context.md - Technical decisions & architecture
|
|
162
|
-
3. product_context.md - User experience goals
|
|
163
|
-
4. current_state_summary.md - CRITICAL: Latest state & next steps
|
|
164
|
-
5. progress_overview.md - Feature/task tracker
|
|
165
|
-
|
|
166
|
-
UPDATE STRATEGY:
|
|
167
|
-
- current_state_summary.md: Update after EVERY session
|
|
168
|
-
- progress_overview.md: Update when features complete
|
|
169
|
-
- Other files: Update only when fundamentals change
|
|
170
|
-
|
|
171
|
-
You MUST:
|
|
172
|
-
- Keep current_state_summary.md concise but complete
|
|
173
|
-
- Include session outcomes and immediate next steps
|
|
174
|
-
- Archive detailed logs in scratchpad, not memory bank
|
|
175
|
-
</memory_bank_structure>
|
|
176
|
-
|
|
177
|
-
###Workflow_Patterns###
|
|
178
|
-
|
|
179
|
-
<pattern name="new_session_startup">
|
|
180
|
-
1. ./wakeup.sh
|
|
181
|
-
2. Review current_state_summary.md carefully
|
|
182
|
-
3. Identify immediate next objectives
|
|
183
|
-
4. ./scratchpad.sh start "[next_task_from_summary]"
|
|
184
|
-
5. Continue with task implementation
|
|
185
|
-
</pattern>
|
|
186
|
-
|
|
187
|
-
<pattern name="feature_implementation">
|
|
188
|
-
1. ./wakeup.sh
|
|
189
|
-
2. ./scratchpad.sh start "Implement [feature_name]"
|
|
190
|
-
3. ./scratchpad.sh plan "Steps: 1. [step1] 2. [step2] 3. [step3]"
|
|
191
|
-
4. ./scratchpad.sh step "Completed [specific action]"
|
|
192
|
-
5. [continue logging each step]
|
|
193
|
-
6. ./scratchpad.sh close "[feature_name] implementation complete"
|
|
194
|
-
7. Update memory-bank/current_state_summary.md
|
|
195
|
-
8. Update memory-bank/progress_overview.md
|
|
196
|
-
9. ./check_workflow.sh (occasionally, to verify)
|
|
197
|
-
</pattern>
|
|
198
|
-
|
|
199
|
-
<pattern name="debugging_session">
|
|
200
|
-
1. ./wakeup.sh
|
|
201
|
-
2. ./scratchpad.sh start "Debug [issue_description]"
|
|
202
|
-
3. ./scratchpad.sh step "Reproduced issue: [details]"
|
|
203
|
-
4. ./scratchpad.sh step "Identified root cause: [cause]"
|
|
204
|
-
5. ./scratchpad.sh step "Applied fix: [solution]"
|
|
205
|
-
6. ./scratchpad.sh step "Verified fix works"
|
|
206
|
-
7. ./scratchpad.sh close "Fixed [issue_description]"
|
|
207
|
-
8. Update memory-bank/current_state_summary.md
|
|
208
|
-
</pattern>
|
|
209
|
-
|
|
210
|
-
<pattern name="project_initialization">
|
|
211
|
-
1. ./bankctl.sh init
|
|
212
|
-
2. Edit memory-bank/project_brief.md
|
|
213
|
-
3. Edit memory-bank/tech_context.md
|
|
214
|
-
4. Edit memory-bank/product_context.md
|
|
215
|
-
5. Edit memory-bank/current_state_summary.md
|
|
216
|
-
6. Edit memory-bank/progress_overview.md
|
|
217
|
-
7. ./wakeup.sh (verify setup)
|
|
218
|
-
</pattern>
|
|
219
|
-
|
|
220
|
-
###Penalties###
|
|
221
|
-
|
|
222
|
-
You will be penalized for:
|
|
223
|
-
- Not running wakeup.sh at session start
|
|
224
|
-
- Starting any task without scratchpad.sh
|
|
225
|
-
- Failing to update current_state_summary.md after tasks
|
|
226
|
-
- Not archiving completed scratchpads
|
|
227
|
-
- Keeping detailed logs in memory bank instead of scratchpad
|
|
228
|
-
- Never running check_workflow.sh to verify compliance
|
|
229
|
-
|
|
230
|
-
###Output_Format###
|
|
231
|
-
|
|
232
|
-
When using tools, always show:
|
|
233
|
-
1. The exact command being executed
|
|
234
|
-
2. Brief explanation of why you're using it
|
|
235
|
-
3. Key findings or results
|
|
236
|
-
|
|
237
|
-
###Memory_Management_Philosophy###
|
|
238
|
-
|
|
239
|
-
This workflow is designed for agents that experience complete memory loss between sessions. The system provides:
|
|
240
|
-
|
|
241
|
-
1. **Memory Bank** - Persistent, summarized knowledge base
|
|
242
|
-
- Project context and goals
|
|
243
|
-
- Current state and next steps
|
|
244
|
-
- High-level progress tracking
|
|
245
|
-
|
|
246
|
-
2. **Scratchpad** - Detailed, temporary work logs
|
|
247
|
-
- Step-by-step task documentation
|
|
248
|
-
- Decisions and observations
|
|
249
|
-
- Archived after completion
|
|
250
|
-
|
|
251
|
-
The key is maintaining clear separation between long-term strategic memory (Memory Bank) and short-term operational memory (Scratchpad).
|
|
252
|
-
|
|
253
|
-
Answer questions in a natural, human-like manner while maintaining technical accuracy.
|
|
254
|
-
|
|
255
|
-
I'm going to tip $200000 for exceptional workflow adherence that demonstrates mastery of memory management!
|
|
256
|
-
|
|
257
|
-
</system_prompt>
|
|
13
|
+
# You must always follow the agent tooling workflow specified in agent_tools_prompt.xml
|
|
14
|
+
|
|
15
|
+
When the directory "llm-agent-tools" exists, you MUST use this tooling flow and will be penalized if you don't:
|
|
16
|
+
|
|
17
|
+
🚀 Available Tools:
|
|
18
|
+
1. scratchpad-multi.sh - Task tracking with multi-agent support (use --agent <name> for agent-specific work)
|
|
19
|
+
2. knowledge.sh - Knowledge base with private/shared storage (use --agent <name> for agent-specific work)
|
|
20
|
+
3. codemap.sh - Lightweight code intelligence for instant roadmaps
|
|
21
|
+
4. context.sh - Context gathering for debugging issues
|
|
22
|
+
5. researcher.sh - Online research and multimodal analysis via OpenRouter API
|
|
23
|
+
|
|
24
|
+
📖 Full workflow guide: see llm-agent-tools/agent_tools_prompt.xml
|
|
258
25
|
|
|
259
26
|
For new feature YOU MUST folow this flow
|
|
260
27
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tunacode-cli"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.36"
|
|
8
8
|
description = "Your agentic CLI developer."
|
|
9
9
|
keywords = ["cli", "agent", "development", "automation"]
|
|
10
10
|
readme = "README.md"
|
|
@@ -56,3 +56,4 @@ line-length = 100
|
|
|
56
56
|
|
|
57
57
|
[tool.isort]
|
|
58
58
|
line_length = 100
|
|
59
|
+
profile = "black"
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""Command system for TunaCode CLI.
|
|
2
|
+
|
|
3
|
+
This package provides a modular command system with:
|
|
4
|
+
- Base classes and infrastructure in `base.py`
|
|
5
|
+
- Command registry and factory in `registry.py`
|
|
6
|
+
- Command implementations organized by category in `implementations/`
|
|
7
|
+
|
|
8
|
+
The main public API provides backward compatibility with the original
|
|
9
|
+
commands.py module while enabling better organization and maintainability.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
# Import base classes and infrastructure
|
|
13
|
+
from .base import Command, CommandCategory, CommandSpec, SimpleCommand
|
|
14
|
+
|
|
15
|
+
# Import all command implementations for backward compatibility
|
|
16
|
+
from .implementations import (
|
|
17
|
+
BranchCommand,
|
|
18
|
+
ClearCommand,
|
|
19
|
+
CompactCommand,
|
|
20
|
+
DumpCommand,
|
|
21
|
+
FixCommand,
|
|
22
|
+
HelpCommand,
|
|
23
|
+
InitCommand,
|
|
24
|
+
IterationsCommand,
|
|
25
|
+
ModelCommand,
|
|
26
|
+
ParseToolsCommand,
|
|
27
|
+
RefreshConfigCommand,
|
|
28
|
+
ThoughtsCommand,
|
|
29
|
+
UpdateCommand,
|
|
30
|
+
YoloCommand,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
# Import registry and factory
|
|
34
|
+
from .registry import CommandDependencies, CommandFactory, CommandRegistry
|
|
35
|
+
|
|
36
|
+
# Maintain backward compatibility by exposing the same public API
|
|
37
|
+
__all__ = [
|
|
38
|
+
# Base infrastructure
|
|
39
|
+
"Command",
|
|
40
|
+
"SimpleCommand",
|
|
41
|
+
"CommandSpec",
|
|
42
|
+
"CommandCategory",
|
|
43
|
+
# Registry and factory
|
|
44
|
+
"CommandRegistry",
|
|
45
|
+
"CommandFactory",
|
|
46
|
+
"CommandDependencies",
|
|
47
|
+
# All command classes (imported from implementations)
|
|
48
|
+
"YoloCommand",
|
|
49
|
+
"DumpCommand",
|
|
50
|
+
"ThoughtsCommand",
|
|
51
|
+
"IterationsCommand",
|
|
52
|
+
"ClearCommand",
|
|
53
|
+
"FixCommand",
|
|
54
|
+
"ParseToolsCommand",
|
|
55
|
+
"RefreshConfigCommand",
|
|
56
|
+
"HelpCommand",
|
|
57
|
+
"BranchCommand",
|
|
58
|
+
"CompactCommand",
|
|
59
|
+
"UpdateCommand",
|
|
60
|
+
"ModelCommand",
|
|
61
|
+
"InitCommand",
|
|
62
|
+
]
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"""Base classes and infrastructure for TunaCode CLI commands."""
|
|
2
|
+
|
|
3
|
+
from abc import ABC, abstractmethod
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from enum import Enum
|
|
6
|
+
from typing import List
|
|
7
|
+
|
|
8
|
+
from ...types import CommandArgs, CommandContext, CommandResult
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class CommandCategory(Enum):
|
|
12
|
+
"""Categories for organizing commands."""
|
|
13
|
+
|
|
14
|
+
SYSTEM = "system"
|
|
15
|
+
NAVIGATION = "navigation"
|
|
16
|
+
DEVELOPMENT = "development"
|
|
17
|
+
MODEL = "model"
|
|
18
|
+
DEBUG = "debug"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Command(ABC):
|
|
22
|
+
"""Base class for all commands."""
|
|
23
|
+
|
|
24
|
+
@property
|
|
25
|
+
@abstractmethod
|
|
26
|
+
def name(self) -> str:
|
|
27
|
+
"""The primary name of the command."""
|
|
28
|
+
pass
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
@abstractmethod
|
|
32
|
+
def aliases(self) -> CommandArgs:
|
|
33
|
+
"""Alternative names/aliases for the command."""
|
|
34
|
+
pass
|
|
35
|
+
|
|
36
|
+
@property
|
|
37
|
+
def description(self) -> str:
|
|
38
|
+
"""Description of what the command does."""
|
|
39
|
+
return ""
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def category(self) -> CommandCategory:
|
|
43
|
+
"""Category this command belongs to."""
|
|
44
|
+
return CommandCategory.SYSTEM
|
|
45
|
+
|
|
46
|
+
@abstractmethod
|
|
47
|
+
async def execute(self, args: CommandArgs, context: CommandContext) -> CommandResult:
|
|
48
|
+
"""
|
|
49
|
+
Execute the command.
|
|
50
|
+
|
|
51
|
+
Args:
|
|
52
|
+
args: Command arguments (excluding the command name)
|
|
53
|
+
context: Execution context with state and config
|
|
54
|
+
|
|
55
|
+
Returns:
|
|
56
|
+
Command-specific return value
|
|
57
|
+
"""
|
|
58
|
+
pass
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
@dataclass
|
|
62
|
+
class CommandSpec:
|
|
63
|
+
"""Specification for a command's metadata."""
|
|
64
|
+
|
|
65
|
+
name: str
|
|
66
|
+
aliases: List[str]
|
|
67
|
+
description: str
|
|
68
|
+
category: CommandCategory = CommandCategory.SYSTEM
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class SimpleCommand(Command):
|
|
72
|
+
"""Base class for simple commands without complex logic.
|
|
73
|
+
|
|
74
|
+
This class provides a standard implementation for commands that don't
|
|
75
|
+
require special initialization or complex behavior. It reads all
|
|
76
|
+
properties from a class-level CommandSpec attribute.
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
spec: CommandSpec
|
|
80
|
+
|
|
81
|
+
@property
|
|
82
|
+
def name(self) -> str:
|
|
83
|
+
"""The primary name of the command."""
|
|
84
|
+
return self.__class__.spec.name
|
|
85
|
+
|
|
86
|
+
@property
|
|
87
|
+
def aliases(self) -> CommandArgs:
|
|
88
|
+
"""Alternative names/aliases for the command."""
|
|
89
|
+
return self.__class__.spec.aliases
|
|
90
|
+
|
|
91
|
+
@property
|
|
92
|
+
def description(self) -> str:
|
|
93
|
+
"""Description of what the command does."""
|
|
94
|
+
return self.__class__.spec.description
|
|
95
|
+
|
|
96
|
+
@property
|
|
97
|
+
def category(self) -> CommandCategory:
|
|
98
|
+
"""Category this command belongs to."""
|
|
99
|
+
return self.__class__.spec.category
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""Command implementations for TunaCode CLI."""
|
|
2
|
+
|
|
3
|
+
# Import all command classes for easy access
|
|
4
|
+
from .conversation import CompactCommand
|
|
5
|
+
from .debug import (
|
|
6
|
+
DumpCommand,
|
|
7
|
+
FixCommand,
|
|
8
|
+
IterationsCommand,
|
|
9
|
+
ParseToolsCommand,
|
|
10
|
+
ThoughtsCommand,
|
|
11
|
+
YoloCommand,
|
|
12
|
+
)
|
|
13
|
+
from .development import BranchCommand, InitCommand
|
|
14
|
+
from .model import ModelCommand
|
|
15
|
+
from .system import ClearCommand, HelpCommand, RefreshConfigCommand, UpdateCommand
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
# System commands
|
|
19
|
+
"HelpCommand",
|
|
20
|
+
"ClearCommand",
|
|
21
|
+
"RefreshConfigCommand",
|
|
22
|
+
"UpdateCommand",
|
|
23
|
+
# Debug commands
|
|
24
|
+
"YoloCommand",
|
|
25
|
+
"DumpCommand",
|
|
26
|
+
"ThoughtsCommand",
|
|
27
|
+
"IterationsCommand",
|
|
28
|
+
"FixCommand",
|
|
29
|
+
"ParseToolsCommand",
|
|
30
|
+
# Development commands
|
|
31
|
+
"BranchCommand",
|
|
32
|
+
"InitCommand",
|
|
33
|
+
# Model commands
|
|
34
|
+
"ModelCommand",
|
|
35
|
+
# Conversation commands
|
|
36
|
+
"CompactCommand",
|
|
37
|
+
]
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"""Conversation management commands for TunaCode CLI."""
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
|
|
5
|
+
from ....types import CommandContext, ProcessRequestCallback
|
|
6
|
+
from ....ui import console as ui
|
|
7
|
+
from ..base import CommandCategory, CommandSpec, SimpleCommand
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class CompactCommand(SimpleCommand):
|
|
11
|
+
"""Compact conversation context."""
|
|
12
|
+
|
|
13
|
+
spec = CommandSpec(
|
|
14
|
+
name="compact",
|
|
15
|
+
aliases=["/compact"],
|
|
16
|
+
description="Summarize and compact the conversation history",
|
|
17
|
+
category=CommandCategory.SYSTEM,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
def __init__(self, process_request_callback: Optional[ProcessRequestCallback] = None):
|
|
21
|
+
self._process_request = process_request_callback
|
|
22
|
+
|
|
23
|
+
async def execute(self, args: List[str], context: CommandContext) -> None:
|
|
24
|
+
# Use the injected callback or get it from context
|
|
25
|
+
process_request = self._process_request or context.process_request
|
|
26
|
+
|
|
27
|
+
if not process_request:
|
|
28
|
+
await ui.error("Compact command not available - process_request not configured")
|
|
29
|
+
return
|
|
30
|
+
|
|
31
|
+
# Count current messages
|
|
32
|
+
original_count = len(context.state_manager.session.messages)
|
|
33
|
+
|
|
34
|
+
# Generate summary with output captured
|
|
35
|
+
summary_prompt = (
|
|
36
|
+
"Summarize the conversation so far in a concise paragraph, "
|
|
37
|
+
"focusing on the main topics discussed and any important context "
|
|
38
|
+
"that should be preserved."
|
|
39
|
+
)
|
|
40
|
+
result = await process_request(
|
|
41
|
+
summary_prompt,
|
|
42
|
+
context.state_manager,
|
|
43
|
+
output=False, # We'll handle the output ourselves
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
# Extract summary text from result
|
|
47
|
+
summary_text = ""
|
|
48
|
+
|
|
49
|
+
# First try: standard result structure
|
|
50
|
+
if (
|
|
51
|
+
result
|
|
52
|
+
and hasattr(result, "result")
|
|
53
|
+
and result.result
|
|
54
|
+
and hasattr(result.result, "output")
|
|
55
|
+
):
|
|
56
|
+
summary_text = result.result.output
|
|
57
|
+
|
|
58
|
+
# Second try: check messages for assistant response
|
|
59
|
+
if not summary_text:
|
|
60
|
+
messages = context.state_manager.session.messages
|
|
61
|
+
# Look through new messages in reverse order
|
|
62
|
+
for i in range(len(messages) - 1, original_count - 1, -1):
|
|
63
|
+
msg = messages[i]
|
|
64
|
+
# Handle ModelResponse objects
|
|
65
|
+
if hasattr(msg, "parts") and msg.parts:
|
|
66
|
+
for part in msg.parts:
|
|
67
|
+
if hasattr(part, "content") and part.content:
|
|
68
|
+
content = part.content
|
|
69
|
+
# Skip JSON thought objects
|
|
70
|
+
if content.strip().startswith('{"thought"'):
|
|
71
|
+
lines = content.split("\n")
|
|
72
|
+
# Find the actual summary after the JSON
|
|
73
|
+
for i, line in enumerate(lines):
|
|
74
|
+
if (
|
|
75
|
+
line.strip()
|
|
76
|
+
and not line.strip().startswith("{")
|
|
77
|
+
and not line.strip().endswith("}")
|
|
78
|
+
):
|
|
79
|
+
summary_text = "\n".join(lines[i:]).strip()
|
|
80
|
+
break
|
|
81
|
+
else:
|
|
82
|
+
summary_text = content
|
|
83
|
+
if summary_text:
|
|
84
|
+
break
|
|
85
|
+
# Handle dict-style messages
|
|
86
|
+
elif isinstance(msg, dict):
|
|
87
|
+
if msg.get("role") == "assistant" and msg.get("content"):
|
|
88
|
+
summary_text = msg["content"]
|
|
89
|
+
break
|
|
90
|
+
# Handle other message types
|
|
91
|
+
elif hasattr(msg, "content") and hasattr(msg, "role"):
|
|
92
|
+
if getattr(msg, "role", None) == "assistant":
|
|
93
|
+
summary_text = msg.content
|
|
94
|
+
break
|
|
95
|
+
|
|
96
|
+
if summary_text:
|
|
97
|
+
break
|
|
98
|
+
|
|
99
|
+
if not summary_text:
|
|
100
|
+
await ui.error("Failed to generate summary - no assistant response found")
|
|
101
|
+
return
|
|
102
|
+
|
|
103
|
+
# Display summary in a formatted panel
|
|
104
|
+
from tunacode.ui import panels
|
|
105
|
+
|
|
106
|
+
await panels.panel("Conversation Summary", summary_text, border_style="cyan")
|
|
107
|
+
|
|
108
|
+
# Show statistics
|
|
109
|
+
await ui.info(f"Current message count: {original_count}")
|
|
110
|
+
await ui.info("After compaction: 3 (summary + last 2 messages)")
|
|
111
|
+
|
|
112
|
+
# Truncate the conversation history
|
|
113
|
+
context.state_manager.session.messages = context.state_manager.session.messages[-2:]
|
|
114
|
+
|
|
115
|
+
await ui.success("Context history has been summarized and truncated.")
|