tunacode-cli 0.0.33__tar.gz → 0.0.35__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.

Files changed (194) hide show
  1. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/CLAUDE.md +12 -245
  2. {tunacode_cli-0.0.33/src/tunacode_cli.egg-info → tunacode_cli-0.0.35}/PKG-INFO +20 -1
  3. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/README.md +19 -0
  4. tunacode_cli-0.0.35/TUNACODE.md +27 -0
  5. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/pyproject.toml +1 -1
  6. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/cli/commands.py +75 -25
  7. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/cli/repl.py +17 -5
  8. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/constants.py +1 -1
  9. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/core/agents/main.py +28 -0
  10. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/core/setup/config_setup.py +15 -9
  11. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/tools/run_command.py +18 -8
  12. tunacode_cli-0.0.35/src/tunacode/utils/security.py +208 -0
  13. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/utils/user_configuration.py +20 -3
  14. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35/src/tunacode_cli.egg-info}/PKG-INFO +20 -1
  15. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode_cli.egg-info/SOURCES.txt +10 -0
  16. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/agent/test_agent_creation.py +32 -26
  17. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/agent/test_process_request.py +5 -5
  18. tunacode_cli-0.0.35/tests/characterization/commands/__init__.py +1 -0
  19. tunacode_cli-0.0.35/tests/characterization/commands/test_init_command.py +252 -0
  20. tunacode_cli-0.0.35/tests/characterization/context/__init__.py +1 -0
  21. tunacode_cli-0.0.35/tests/characterization/context/test_context_acceptance.py +94 -0
  22. tunacode_cli-0.0.35/tests/characterization/context/test_context_integration.py +106 -0
  23. tunacode_cli-0.0.35/tests/characterization/context/test_context_loading.py +143 -0
  24. tunacode_cli-0.0.35/tests/characterization/context/test_tunacode_logging.py +80 -0
  25. tunacode_cli-0.0.35/tests/test_config_directory_creation.py +105 -0
  26. tunacode_cli-0.0.35/tests/test_security.py +192 -0
  27. tunacode_cli-0.0.33/TUNACODE.md +0 -0
  28. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/LICENSE +0 -0
  29. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/MANIFEST.in +0 -0
  30. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/setup.cfg +0 -0
  31. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/setup.py +0 -0
  32. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/__init__.py +0 -0
  33. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/cli/__init__.py +0 -0
  34. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/cli/main.py +0 -0
  35. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/cli/textual_app.py +0 -0
  36. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/cli/textual_bridge.py +0 -0
  37. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/configuration/__init__.py +0 -0
  38. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/configuration/defaults.py +0 -0
  39. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/configuration/models.py +0 -0
  40. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/configuration/settings.py +0 -0
  41. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/context.py +0 -0
  42. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/core/__init__.py +0 -0
  43. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/core/agents/__init__.py +0 -0
  44. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/core/background/__init__.py +0 -0
  45. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/core/background/manager.py +0 -0
  46. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/core/code_index.py +0 -0
  47. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/core/llm/__init__.py +0 -0
  48. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/core/setup/__init__.py +0 -0
  49. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/core/setup/agent_setup.py +0 -0
  50. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/core/setup/base.py +0 -0
  51. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/core/setup/coordinator.py +0 -0
  52. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/core/setup/environment_setup.py +0 -0
  53. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/core/setup/git_safety_setup.py +0 -0
  54. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/core/state.py +0 -0
  55. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/core/tool_handler.py +0 -0
  56. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/exceptions.py +0 -0
  57. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/prompts/system.md +0 -0
  58. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/py.typed +0 -0
  59. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/services/__init__.py +0 -0
  60. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/services/mcp.py +0 -0
  61. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/setup.py +0 -0
  62. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/tools/__init__.py +0 -0
  63. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/tools/base.py +0 -0
  64. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/tools/bash.py +0 -0
  65. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/tools/glob.py +0 -0
  66. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/tools/grep.py +0 -0
  67. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/tools/list_dir.py +0 -0
  68. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/tools/read_file.py +0 -0
  69. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/tools/read_file_async_poc.py +0 -0
  70. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/tools/update_file.py +0 -0
  71. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/tools/write_file.py +0 -0
  72. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/types.py +0 -0
  73. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/ui/__init__.py +0 -0
  74. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/ui/completers.py +0 -0
  75. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/ui/console.py +0 -0
  76. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/ui/constants.py +0 -0
  77. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/ui/decorators.py +0 -0
  78. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/ui/input.py +0 -0
  79. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/ui/keybindings.py +0 -0
  80. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/ui/lexers.py +0 -0
  81. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/ui/output.py +0 -0
  82. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/ui/panels.py +0 -0
  83. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/ui/prompt_manager.py +0 -0
  84. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/ui/tool_ui.py +0 -0
  85. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/ui/validators.py +0 -0
  86. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/utils/__init__.py +0 -0
  87. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/utils/bm25.py +0 -0
  88. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/utils/diff_utils.py +0 -0
  89. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/utils/file_utils.py +0 -0
  90. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/utils/import_cache.py +0 -0
  91. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/utils/ripgrep.py +0 -0
  92. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/utils/system.py +0 -0
  93. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/utils/text_utils.py +0 -0
  94. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode/utils/token_counter.py +0 -0
  95. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode_cli.egg-info/dependency_links.txt +0 -0
  96. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode_cli.egg-info/entry_points.txt +0 -0
  97. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode_cli.egg-info/requires.txt +0 -0
  98. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/src/tunacode_cli.egg-info/top_level.txt +0 -0
  99. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/agent/__init__.py +0 -0
  100. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/agent/conftest.py +0 -0
  101. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/agent/test_json_tool_parsing.py +0 -0
  102. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/agent/test_process_node.py +0 -0
  103. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/agent/test_tool_message_patching.py +0 -0
  104. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/background/test_background_edge_cases.py +0 -0
  105. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/background/test_cleanup.py +0 -0
  106. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/background/test_task_cancellation.py +0 -0
  107. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/background/test_task_creation.py +0 -0
  108. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/background/test_task_execution.py +0 -0
  109. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/code_index/test_cache_management.py +0 -0
  110. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/code_index/test_file_scanning.py +0 -0
  111. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/code_index/test_index_building.py +0 -0
  112. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/code_index/test_search_operations.py +0 -0
  113. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/code_index/test_symbol_extraction.py +0 -0
  114. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/conftest.py +0 -0
  115. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/repl/test_command_parsing.py +0 -0
  116. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/repl/test_input_handling.py +0 -0
  117. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/repl/test_keyboard_interrupts.py +0 -0
  118. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/repl/test_multiline_input.py +0 -0
  119. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/repl/test_repl_initialization.py +0 -0
  120. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/repl/test_session_flow.py +0 -0
  121. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/services/test_error_recovery.py +0 -0
  122. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/services/test_llm_routing.py +0 -0
  123. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/services/test_mcp_integration.py +0 -0
  124. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/services/test_service_lifecycle.py +0 -0
  125. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/state/test_agent_tracking.py +0 -0
  126. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/state/test_message_history.py +0 -0
  127. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/state/test_permissions.py +0 -0
  128. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/state/test_session_management.py +0 -0
  129. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/state/test_state_initialization.py +0 -0
  130. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/state/test_user_config.py +0 -0
  131. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/test_characterization_commands.py +0 -0
  132. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/ui/test_async_ui.py +0 -0
  133. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/ui/test_console_output.py +0 -0
  134. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/ui/test_diff_display.py +0 -0
  135. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/ui/test_prompt_rendering.py +0 -0
  136. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/ui/test_tool_confirmations.py +0 -0
  137. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/utils/test_file_operations.py +0 -0
  138. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/utils/test_git_commands.py +0 -0
  139. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/utils/test_token_counting.py +0 -0
  140. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/characterization/utils/test_utils_edge_cases.py +0 -0
  141. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/conftest.py +0 -0
  142. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/crud/test_core_file_operations.py +0 -0
  143. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/fixtures/__init__.py +0 -0
  144. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/fixtures/file_operations.py +0 -0
  145. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/integration/test_error_recovery_flow.py +0 -0
  146. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/integration/test_full_session_flow.py +0 -0
  147. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/integration/test_mcp_tool_flow.py +0 -0
  148. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/integration/test_multi_tool_operations.py +0 -0
  149. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/integration/test_performance_scenarios.py +0 -0
  150. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_actual_parallelism.py +0 -0
  151. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_agent_initialization.py +0 -0
  152. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_background_manager.py +0 -0
  153. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_characterization_agent_main.py +0 -0
  154. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_characterization_bash.py +0 -0
  155. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_characterization_commands_system.py +0 -0
  156. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_characterization_glob.py +0 -0
  157. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_characterization_grep.py +0 -0
  158. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_characterization_grep_performance.py +0 -0
  159. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_characterization_iteration_limits.py +0 -0
  160. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_characterization_list_dir.py +0 -0
  161. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_characterization_read_file.py +0 -0
  162. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_characterization_repl_utils.py +0 -0
  163. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_characterization_run_command.py +0 -0
  164. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_characterization_setup_system.py +0 -0
  165. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_characterization_tool_ui_behavior.py +0 -0
  166. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_characterization_update_file.py +0 -0
  167. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_characterization_utilities.py +0 -0
  168. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_characterization_write_file.py +0 -0
  169. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_cli_command_flow.py +0 -0
  170. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_cli_file_operations_integration.py +0 -0
  171. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_config_setup_async.py +0 -0
  172. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_enhanced_visual_feedback.py +0 -0
  173. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_fallback_responses.py +0 -0
  174. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_fast_glob_search.py +0 -0
  175. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_file_operations_edge_cases.py +0 -0
  176. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_file_operations_stress.py +0 -0
  177. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_file_reference_context_tracking.py +0 -0
  178. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_file_reference_expansion.py +0 -0
  179. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_grep_fast_glob.py +0 -0
  180. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_grep_legacy_compat.py +0 -0
  181. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_grep_timeout.py +0 -0
  182. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_json_tool_parsing.py +0 -0
  183. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_list_dir.py +0 -0
  184. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_parallel_execution_demo.py +0 -0
  185. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_parallel_execution_freeze_fix.py +0 -0
  186. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_parallel_execution_integration.py +0 -0
  187. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_parallel_read_only_tools.py +0 -0
  188. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_parallel_tool_execution.py +0 -0
  189. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_read_only_confirmation.py +0 -0
  190. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_tool_categorization.py +0 -0
  191. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_tool_combinations.py +0 -0
  192. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_tool_handler_ui_messages.py +0 -0
  193. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/tests/test_update_command.py +0 -0
  194. {tunacode_cli-0.0.33 → tunacode_cli-0.0.35}/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 flow for working
14
- Project structure:
15
- agent-tools/
16
- ├── wakeup.sh # Read memory bank
17
- ├── scratchpad.sh # Task logging
18
- ├── check_workflow.sh # Simple verification
19
- ├── bankctl.sh # Memory bank control
20
- └── WORKFLOW_GUIDE.md # Complete workflow documentation
21
-
22
- memory-bank/
23
- ├── project_brief.md
24
- ├── tech_context.md
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tunacode-cli
3
- Version: 0.0.33
3
+ Version: 0.0.35
4
4
  Summary: Your agentic CLI developer.
5
5
  Author-email: larock22 <noreply@github.com>
6
6
  License-Expression: MIT
@@ -40,6 +40,7 @@ Dynamic: license-file
40
40
  <div align="center">
41
41
 
42
42
  [![PyPI version](https://badge.fury.io/py/tunacode-cli.svg)](https://badge.fury.io/py/tunacode-cli)
43
+ [![Downloads](https://pepy.tech/badge/tunacode-cli)](https://pepy.tech/project/tunacode-cli)
43
44
  [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
44
45
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
45
46
 
@@ -78,6 +79,17 @@ tunacode --model "openrouter:openai/gpt-4o" --key "sk-or-your-openrouter-key"
78
79
 
79
80
  Your config is saved to `~/.config/tunacode.json` (edit directly with `nvim ~/.config/tunacode.json`)
80
81
 
82
+ ### Recommended Models
83
+
84
+ Based on extensive testing, these models provide the best performance:
85
+ - `google/gemini-2.5-pro` - Excellent for complex reasoning
86
+ - `openai/gpt-4.1` - Strong general-purpose model
87
+ - `deepseek/deepseek-r1-0528` - Great for code generation
88
+ - `openai/gpt-4.1-mini` - Fast and cost-effective
89
+ - `anthropic/claude-4-sonnet-20250522` - Superior context handling
90
+
91
+ *Note: Formal evaluations coming soon. Any model can work, but these have shown the best results in practice.*
92
+
81
93
  ## Start Coding
82
94
 
83
95
  ```bash
@@ -105,6 +117,13 @@ TunaCode leverages parallel execution for read-only operations, achieving **3x f
105
117
 
106
118
  Multiple file reads, directory listings, and searches execute concurrently using async I/O, making code exploration significantly faster.
107
119
 
120
+ ## Features in Development
121
+
122
+ - **Streaming UI**: Currently working on implementing streaming responses for better user experience
123
+ - **Bug Fixes**: Actively addressing issues - please report any bugs you encounter!
124
+
125
+ *Note: While the tool is fully functional, we're focusing on stability and core features before optimizing for speed.*
126
+
108
127
  ## Safety First
109
128
 
110
129
  ⚠️ **Important**: TunaCode can modify your codebase. Always:
@@ -3,6 +3,7 @@
3
3
  <div align="center">
4
4
 
5
5
  [![PyPI version](https://badge.fury.io/py/tunacode-cli.svg)](https://badge.fury.io/py/tunacode-cli)
6
+ [![Downloads](https://pepy.tech/badge/tunacode-cli)](https://pepy.tech/project/tunacode-cli)
6
7
  [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
7
8
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
9
 
@@ -41,6 +42,17 @@ tunacode --model "openrouter:openai/gpt-4o" --key "sk-or-your-openrouter-key"
41
42
 
42
43
  Your config is saved to `~/.config/tunacode.json` (edit directly with `nvim ~/.config/tunacode.json`)
43
44
 
45
+ ### Recommended Models
46
+
47
+ Based on extensive testing, these models provide the best performance:
48
+ - `google/gemini-2.5-pro` - Excellent for complex reasoning
49
+ - `openai/gpt-4.1` - Strong general-purpose model
50
+ - `deepseek/deepseek-r1-0528` - Great for code generation
51
+ - `openai/gpt-4.1-mini` - Fast and cost-effective
52
+ - `anthropic/claude-4-sonnet-20250522` - Superior context handling
53
+
54
+ *Note: Formal evaluations coming soon. Any model can work, but these have shown the best results in practice.*
55
+
44
56
  ## Start Coding
45
57
 
46
58
  ```bash
@@ -68,6 +80,13 @@ TunaCode leverages parallel execution for read-only operations, achieving **3x f
68
80
 
69
81
  Multiple file reads, directory listings, and searches execute concurrently using async I/O, making code exploration significantly faster.
70
82
 
83
+ ## Features in Development
84
+
85
+ - **Streaming UI**: Currently working on implementing streaming responses for better user experience
86
+ - **Bug Fixes**: Actively addressing issues - please report any bugs you encounter!
87
+
88
+ *Note: While the tool is fully functional, we're focusing on stability and core features before optimizing for speed.*
89
+
71
90
  ## Safety First
72
91
 
73
92
  ⚠️ **Important**: TunaCode can modify your codebase. Always:
@@ -0,0 +1,27 @@
1
+ # TUNACODE.md
2
+
3
+ ## Build Commands
4
+ - Run all tests: `make test`
5
+ - Run single test: `pytest tests/test_file.py::test_name`
6
+ - Run quick tests: `pytest -m "not slow"`
7
+ - Lint code: `make lint`
8
+ - Build package: `make build`
9
+ - Clean artifacts: `make clean`
10
+
11
+ ## Code Style
12
+ - Use type hints for all function signatures
13
+ - Prefer guard clauses over nested conditionals
14
+ - Keep functions focused and under 50 lines
15
+ - Use descriptive variable names
16
+ - Follow PEP 8 conventions
17
+ - Maximum line length: 120 characters
18
+ - Use black for formatting
19
+ - Use isort for imports
20
+ - Use snake_case for variables and functions
21
+ - Use PascalCase for classes
22
+ - Prefer explicit error handling, avoid bare excepts
23
+
24
+ ## Architecture Notes
25
+ - Agent creation loads this file and appends to system prompt
26
+ - Context is loaded synchronously to avoid event loop issues
27
+ - TUNACODE.md is walked up directory tree (closest first)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "tunacode-cli"
7
- version = "0.0.33"
7
+ version = "0.0.35"
8
8
  description = "Your agentic CLI developer."
9
9
  keywords = ["cli", "agent", "development", "automation"]
10
10
  readme = "README.md"
@@ -6,7 +6,7 @@ from enum import Enum
6
6
  from typing import Any, Dict, List, Optional, Type
7
7
 
8
8
  from .. import utils
9
- from ..exceptions import ValidationError
9
+ from ..exceptions import ConfigurationError, ValidationError
10
10
  from ..types import CommandArgs, CommandContext, CommandResult, ProcessRequestCallback
11
11
  from ..ui import console as ui
12
12
 
@@ -181,26 +181,29 @@ class IterationsCommand(SimpleCommand):
181
181
 
182
182
  async def execute(self, args: List[str], context: CommandContext) -> None:
183
183
  state = context.state_manager.session
184
- if args:
185
- try:
186
- new_limit = int(args[0])
187
- if new_limit < 1 or new_limit > 100:
188
- await ui.error("Iterations must be between 1 and 100")
189
- return
190
-
191
- # Update the user config
192
- if "settings" not in state.user_config:
193
- state.user_config["settings"] = {}
194
- state.user_config["settings"]["max_iterations"] = new_limit
195
-
196
- await ui.success(f"Maximum iterations set to {new_limit}")
197
- await ui.muted("Higher values allow more complex reasoning but may be slower")
198
- except ValueError:
199
- await ui.error("Please provide a valid number")
200
- else:
184
+
185
+ # Guard clause - handle "no args" case first and return early
186
+ if not args:
201
187
  current = state.user_config.get("settings", {}).get("max_iterations", 40)
202
188
  await ui.info(f"Current maximum iterations: {current}")
203
189
  await ui.muted("Usage: /iterations <number> (1-100)")
190
+ return
191
+
192
+ # update the logic to not be as nested messely, the above guars needing to get as messy
193
+ try:
194
+ new_limit = int(args[0])
195
+ if new_limit < 1 or new_limit > 100:
196
+ await ui.error("Iterations must be between 1 and 100")
197
+ return
198
+
199
+ # Update the user config
200
+ if "settings" not in state.user_config:
201
+ state.user_config["settings"] = {}
202
+ state.user_config["settings"]["max_iterations"] = new_limit
203
+
204
+ await ui.success(f"Maximum iterations set to {new_limit}")
205
+ except ValueError:
206
+ await ui.error("Please provide a valid number")
204
207
 
205
208
 
206
209
  class ClearCommand(SimpleCommand):
@@ -288,7 +291,9 @@ class ParseToolsCommand(SimpleCommand):
288
291
 
289
292
  try:
290
293
  await extract_and_execute_tool_calls(
291
- part.content, tool_callback_with_state, context.state_manager
294
+ part.content,
295
+ tool_callback_with_state,
296
+ context.state_manager,
292
297
  )
293
298
  await ui.success("JSON tool parsing completed")
294
299
  found_content = True
@@ -524,7 +529,8 @@ class UpdateCommand(SimpleCommand):
524
529
  result = subprocess.run(
525
530
  ["pipx", "list"], capture_output=True, text=True, timeout=10
526
531
  )
527
- if "tunacode" in result.stdout.lower():
532
+ pipx_installed = "tunacode" in result.stdout.lower()
533
+ if pipx_installed:
528
534
  installation_method = "pipx"
529
535
  except (subprocess.TimeoutExpired, subprocess.CalledProcessError):
530
536
  pass
@@ -555,12 +561,22 @@ class UpdateCommand(SimpleCommand):
555
561
  if installation_method == "pipx":
556
562
  await ui.info("Updating via pipx...")
557
563
  result = subprocess.run(
558
- ["pipx", "upgrade", "tunacode"], capture_output=True, text=True, timeout=60
564
+ ["pipx", "upgrade", "tunacode"],
565
+ capture_output=True,
566
+ text=True,
567
+ timeout=60,
559
568
  )
560
569
  else: # pip
561
570
  await ui.info("Updating via pip...")
562
571
  result = subprocess.run(
563
- [sys.executable, "-m", "pip", "install", "--upgrade", "tunacode-cli"],
572
+ [
573
+ sys.executable,
574
+ "-m",
575
+ "pip",
576
+ "install",
577
+ "--upgrade",
578
+ "tunacode-cli",
579
+ ],
564
580
  capture_output=True,
565
581
  text=True,
566
582
  timeout=60,
@@ -628,9 +644,13 @@ class ModelCommand(SimpleCommand):
628
644
 
629
645
  # Check if setting as default
630
646
  if len(args) > 1 and args[1] == "default":
631
- utils.user_configuration.set_default_model(model_name, context.state_manager)
632
- await ui.muted("Updating default model")
633
- return "restart"
647
+ try:
648
+ utils.user_configuration.set_default_model(model_name, context.state_manager)
649
+ await ui.muted("Updating default model")
650
+ return "restart"
651
+ except ConfigurationError as e:
652
+ await ui.error(str(e))
653
+ return None
634
654
 
635
655
  # Show success message with the new model
636
656
  await ui.success(f"Switched to model: {model_name}")
@@ -669,6 +689,35 @@ class CommandFactory:
669
689
  setattr(self.dependencies, key, value)
670
690
 
671
691
 
692
+ class InitCommand(SimpleCommand):
693
+ """Creates or updates TUNACODE.md with project-specific context."""
694
+
695
+ spec = CommandSpec(
696
+ name="/init",
697
+ aliases=[],
698
+ description="Analyze codebase and create/update TUNACODE.md file",
699
+ category=CommandCategory.DEVELOPMENT,
700
+ )
701
+
702
+ async def execute(self, args, context: CommandContext) -> CommandResult:
703
+ """Execute the init command."""
704
+ # Minimal implementation to make test pass
705
+ prompt = """Please analyze this codebase and create a TUNACODE.md file containing:
706
+ 1. Build/lint/test commands - especially for running a single test
707
+ 2. Code style guidelines including imports, formatting, types, naming conventions, error handling, etc.
708
+
709
+ The file you create will be given to agentic coding agents (such as yourself) that operate in this repository.
710
+ Make it about 20 lines long.
711
+ If there's already a TUNACODE.md, improve it.
712
+ If there are Cursor rules (in .cursor/rules/ or .cursorrules) or Copilot rules (in .github/copilot-instructions.md),
713
+ make sure to include them."""
714
+
715
+ # Call the agent to analyze and create/update the file
716
+ await context.process_request(prompt, context.state_manager)
717
+
718
+ return None
719
+
720
+
672
721
  class CommandRegistry:
673
722
  """Registry for managing commands with auto-discovery and categories."""
674
723
 
@@ -726,6 +775,7 @@ class CommandRegistry:
726
775
  BranchCommand,
727
776
  CompactCommand,
728
777
  ModelCommand,
778
+ InitCommand,
729
779
  ]
730
780
 
731
781
  # Register all discovered commands
@@ -22,6 +22,7 @@ from tunacode.core.tool_handler import ToolHandler
22
22
  from tunacode.exceptions import AgentError, UserAbortError, ValidationError
23
23
  from tunacode.ui import console as ui
24
24
  from tunacode.ui.tool_ui import ToolUI
25
+ from tunacode.utils.security import CommandSecurityError, safe_subprocess_run
25
26
 
26
27
  from ..types import CommandContext, CommandResult, StateManager, ToolArgs
27
28
  from .commands import CommandRegistry
@@ -320,13 +321,24 @@ async def repl(state_manager: StateManager):
320
321
  def run_shell():
321
322
  try:
322
323
  if command:
323
- result = subprocess.run(command, shell=True, capture_output=False)
324
- if result.returncode != 0:
325
- # Use print directly since we're in a terminal context
326
- print(f"\nCommand exited with code {result.returncode}")
324
+ # Use secure subprocess execution for shell commands
325
+ # Note: User shell commands are inherently risky but this is by design
326
+ # We validate but allow shell features since it's explicit user intent
327
+ try:
328
+ result = safe_subprocess_run(
329
+ command,
330
+ shell=True,
331
+ validate=True, # Still validate for basic safety
332
+ capture_output=False,
333
+ )
334
+ if result.returncode != 0:
335
+ print(f"\nCommand exited with code {result.returncode}")
336
+ except CommandSecurityError as e:
337
+ print(f"\nSecurity validation failed: {str(e)}")
338
+ print("If you need to run this command, please ensure it's safe.")
327
339
  else:
328
340
  shell = os.environ.get("SHELL", "bash")
329
- subprocess.run(shell)
341
+ subprocess.run(shell) # Interactive shell is safe
330
342
  except Exception as e:
331
343
  print(f"\nShell command failed: {str(e)}")
332
344
 
@@ -7,7 +7,7 @@ Centralizes all magic strings, UI text, error messages, and application constant
7
7
 
8
8
  # Application info
9
9
  APP_NAME = "TunaCode"
10
- APP_VERSION = "0.0.33"
10
+ APP_VERSION = "0.0.35"
11
11
 
12
12
  # File patterns
13
13
  GUIDE_FILE_PATTERN = "{name}.md"
@@ -457,6 +457,26 @@ def get_or_create_agent(model: ModelName, state_manager: StateManager) -> Pydant
457
457
  # Use a default system prompt if neither file exists
458
458
  system_prompt = "You are a helpful AI assistant for software development tasks."
459
459
 
460
+ # Load TUNACODE.md context
461
+ # Use sync version of get_code_style to avoid nested event loop issues
462
+ try:
463
+ from pathlib import Path as PathlibPath
464
+
465
+ tunacode_path = PathlibPath.cwd() / "TUNACODE.md"
466
+ if tunacode_path.exists():
467
+ tunacode_content = tunacode_path.read_text(encoding="utf-8")
468
+ if tunacode_content.strip():
469
+ # Log that we found TUNACODE.md
470
+ print("📄 TUNACODE.md located: Loading context...")
471
+
472
+ system_prompt += "\n\n# Project Context from TUNACODE.md\n" + tunacode_content
473
+ else:
474
+ # Log that TUNACODE.md was not found
475
+ print("📄 TUNACODE.md not found: Using default context")
476
+ except Exception:
477
+ # Ignore errors loading TUNACODE.md
478
+ pass
479
+
460
480
  state_manager.session.agents[model] = Agent(
461
481
  model=model,
462
482
  system_prompt=system_prompt,
@@ -670,6 +690,14 @@ async def process_request(
670
690
  # Create a request-level buffer for batching read-only tools across nodes
671
691
  tool_buffer = ToolBuffer()
672
692
 
693
+ # Show TUNACODE.md preview if it was loaded and thoughts are enabled
694
+ if state_manager.session.show_thoughts and hasattr(state_manager, "tunacode_preview"):
695
+ from tunacode.ui import console as ui
696
+
697
+ await ui.muted(state_manager.tunacode_preview)
698
+ # Clear the preview after displaying it once
699
+ delattr(state_manager, "tunacode_preview")
700
+
673
701
  # Show what we're sending to the API when thoughts are enabled
674
702
  if state_manager.session.show_thoughts:
675
703
  from tunacode.ui import console as ui