tunacode-cli 0.0.30__tar.gz → 0.0.32__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 (196) hide show
  1. tunacode_cli-0.0.32/CLAUDE.md +484 -0
  2. {tunacode_cli-0.0.30/src/tunacode_cli.egg-info → tunacode_cli-0.0.32}/PKG-INFO +16 -7
  3. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/README.md +14 -6
  4. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/pyproject.toml +2 -1
  5. tunacode_cli-0.0.32/src/api/auth.py +13 -0
  6. tunacode_cli-0.0.32/src/api/users.py +8 -0
  7. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/cli/commands.py +113 -232
  8. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/cli/repl.py +40 -84
  9. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/constants.py +10 -1
  10. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/core/agents/__init__.py +0 -4
  11. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/core/agents/main.py +345 -43
  12. tunacode_cli-0.0.32/src/tunacode/core/code_index.py +479 -0
  13. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/core/setup/git_safety_setup.py +7 -9
  14. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/core/tool_handler.py +18 -0
  15. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/exceptions.py +13 -0
  16. tunacode_cli-0.0.32/src/tunacode/prompts/system.md +344 -0
  17. tunacode_cli-0.0.32/src/tunacode/tools/glob.py +288 -0
  18. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/tools/grep.py +168 -195
  19. tunacode_cli-0.0.32/src/tunacode/tools/list_dir.py +190 -0
  20. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/tools/read_file.py +9 -3
  21. tunacode_cli-0.0.32/src/tunacode/tools/read_file_async_poc.py +188 -0
  22. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32/src/tunacode_cli.egg-info}/PKG-INFO +16 -7
  23. tunacode_cli-0.0.32/src/tunacode_cli.egg-info/SOURCES.txt +179 -0
  24. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode_cli.egg-info/requires.txt +1 -0
  25. tunacode_cli-0.0.32/src/tunacode_cli.egg-info/top_level.txt +3 -0
  26. tunacode_cli-0.0.32/tests/characterization/agent/__init__.py +1 -0
  27. tunacode_cli-0.0.32/tests/characterization/agent/conftest.py +41 -0
  28. tunacode_cli-0.0.32/tests/characterization/agent/test_agent_creation.py +151 -0
  29. tunacode_cli-0.0.32/tests/characterization/agent/test_json_tool_parsing.py +232 -0
  30. tunacode_cli-0.0.32/tests/characterization/agent/test_process_node.py +296 -0
  31. tunacode_cli-0.0.32/tests/characterization/agent/test_process_request.py +348 -0
  32. tunacode_cli-0.0.32/tests/characterization/agent/test_tool_message_patching.py +193 -0
  33. tunacode_cli-0.0.32/tests/characterization/background/test_background_edge_cases.py +64 -0
  34. tunacode_cli-0.0.32/tests/characterization/background/test_cleanup.py +51 -0
  35. tunacode_cli-0.0.32/tests/characterization/background/test_task_cancellation.py +45 -0
  36. tunacode_cli-0.0.32/tests/characterization/background/test_task_creation.py +50 -0
  37. tunacode_cli-0.0.32/tests/characterization/background/test_task_execution.py +49 -0
  38. tunacode_cli-0.0.32/tests/characterization/code_index/test_cache_management.py +43 -0
  39. tunacode_cli-0.0.32/tests/characterization/code_index/test_file_scanning.py +54 -0
  40. tunacode_cli-0.0.32/tests/characterization/code_index/test_index_building.py +46 -0
  41. tunacode_cli-0.0.32/tests/characterization/code_index/test_search_operations.py +55 -0
  42. tunacode_cli-0.0.32/tests/characterization/code_index/test_symbol_extraction.py +62 -0
  43. tunacode_cli-0.0.32/tests/characterization/conftest.py +240 -0
  44. tunacode_cli-0.0.32/tests/characterization/repl/test_command_parsing.py +53 -0
  45. tunacode_cli-0.0.32/tests/characterization/repl/test_input_handling.py +50 -0
  46. tunacode_cli-0.0.32/tests/characterization/repl/test_keyboard_interrupts.py +49 -0
  47. tunacode_cli-0.0.32/tests/characterization/repl/test_multiline_input.py +45 -0
  48. tunacode_cli-0.0.32/tests/characterization/repl/test_repl_initialization.py +44 -0
  49. tunacode_cli-0.0.32/tests/characterization/repl/test_session_flow.py +91 -0
  50. tunacode_cli-0.0.32/tests/characterization/services/test_error_recovery.py +22 -0
  51. tunacode_cli-0.0.32/tests/characterization/services/test_llm_routing.py +22 -0
  52. tunacode_cli-0.0.32/tests/characterization/services/test_mcp_integration.py +22 -0
  53. tunacode_cli-0.0.32/tests/characterization/services/test_service_lifecycle.py +22 -0
  54. tunacode_cli-0.0.32/tests/characterization/state/test_agent_tracking.py +31 -0
  55. tunacode_cli-0.0.32/tests/characterization/state/test_message_history.py +44 -0
  56. tunacode_cli-0.0.32/tests/characterization/state/test_permissions.py +23 -0
  57. tunacode_cli-0.0.32/tests/characterization/state/test_session_management.py +37 -0
  58. tunacode_cli-0.0.32/tests/characterization/state/test_state_initialization.py +62 -0
  59. tunacode_cli-0.0.32/tests/characterization/state/test_user_config.py +31 -0
  60. tunacode_cli-0.0.32/tests/characterization/test_characterization_commands.py +325 -0
  61. tunacode_cli-0.0.32/tests/characterization/ui/test_async_ui.py +25 -0
  62. tunacode_cli-0.0.32/tests/characterization/ui/test_console_output.py +29 -0
  63. tunacode_cli-0.0.32/tests/characterization/ui/test_diff_display.py +24 -0
  64. tunacode_cli-0.0.32/tests/characterization/ui/test_prompt_rendering.py +37 -0
  65. tunacode_cli-0.0.32/tests/characterization/ui/test_tool_confirmations.py +27 -0
  66. tunacode_cli-0.0.32/tests/characterization/utils/test_file_operations.py +31 -0
  67. tunacode_cli-0.0.32/tests/characterization/utils/test_git_commands.py +137 -0
  68. tunacode_cli-0.0.32/tests/characterization/utils/test_token_counting.py +29 -0
  69. tunacode_cli-0.0.32/tests/characterization/utils/test_utils_edge_cases.py +40 -0
  70. tunacode_cli-0.0.32/tests/conftest.py +221 -0
  71. tunacode_cli-0.0.32/tests/crud/test_core_file_operations.py +436 -0
  72. tunacode_cli-0.0.32/tests/fixtures/__init__.py +1 -0
  73. tunacode_cli-0.0.32/tests/fixtures/file_operations.py +313 -0
  74. tunacode_cli-0.0.32/tests/integration/test_error_recovery_flow.py +41 -0
  75. tunacode_cli-0.0.32/tests/integration/test_full_session_flow.py +68 -0
  76. tunacode_cli-0.0.32/tests/integration/test_mcp_tool_flow.py +54 -0
  77. tunacode_cli-0.0.32/tests/integration/test_multi_tool_operations.py +62 -0
  78. tunacode_cli-0.0.32/tests/integration/test_performance_scenarios.py +58 -0
  79. tunacode_cli-0.0.32/tests/test_actual_parallelism.py +253 -0
  80. tunacode_cli-0.0.32/tests/test_characterization_agent_main.py +52 -0
  81. tunacode_cli-0.0.32/tests/test_characterization_bash.py +227 -0
  82. tunacode_cli-0.0.32/tests/test_characterization_commands_system.py +72 -0
  83. tunacode_cli-0.0.32/tests/test_characterization_glob.py +391 -0
  84. tunacode_cli-0.0.32/tests/test_characterization_grep.py +314 -0
  85. tunacode_cli-0.0.32/tests/test_characterization_list_dir.py +283 -0
  86. tunacode_cli-0.0.32/tests/test_characterization_read_file.py +198 -0
  87. tunacode_cli-0.0.32/tests/test_characterization_repl_utils.py +36 -0
  88. tunacode_cli-0.0.32/tests/test_characterization_run_command.py +237 -0
  89. tunacode_cli-0.0.32/tests/test_characterization_setup_system.py +69 -0
  90. tunacode_cli-0.0.32/tests/test_characterization_update_file.py +268 -0
  91. tunacode_cli-0.0.32/tests/test_characterization_utilities.py +58 -0
  92. tunacode_cli-0.0.32/tests/test_characterization_write_file.py +220 -0
  93. tunacode_cli-0.0.32/tests/test_cli_command_flow.py +329 -0
  94. tunacode_cli-0.0.32/tests/test_cli_file_operations_integration.py +285 -0
  95. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/tests/test_config_setup_async.py +26 -2
  96. tunacode_cli-0.0.32/tests/test_enhanced_visual_feedback.py +90 -0
  97. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/tests/test_fallback_responses.py +0 -16
  98. tunacode_cli-0.0.32/tests/test_fast_glob_search.py +117 -0
  99. tunacode_cli-0.0.32/tests/test_file_operations_edge_cases.py +385 -0
  100. tunacode_cli-0.0.32/tests/test_file_operations_stress.py +329 -0
  101. tunacode_cli-0.0.32/tests/test_grep_fast_glob.py +385 -0
  102. tunacode_cli-0.0.32/tests/test_grep_legacy_compat.py +62 -0
  103. tunacode_cli-0.0.32/tests/test_grep_timeout.py +178 -0
  104. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/tests/test_json_tool_parsing.py +9 -5
  105. tunacode_cli-0.0.32/tests/test_list_dir.py +187 -0
  106. tunacode_cli-0.0.32/tests/test_parallel_execution_demo.py +149 -0
  107. tunacode_cli-0.0.32/tests/test_parallel_execution_freeze_fix.py +152 -0
  108. tunacode_cli-0.0.32/tests/test_parallel_execution_integration.py +194 -0
  109. tunacode_cli-0.0.32/tests/test_parallel_read_only_tools.py +222 -0
  110. tunacode_cli-0.0.32/tests/test_parallel_tool_execution.py +149 -0
  111. tunacode_cli-0.0.32/tests/test_read_only_confirmation.py +67 -0
  112. tunacode_cli-0.0.32/tests/test_tool_categorization.py +111 -0
  113. tunacode_cli-0.0.32/tests/test_tool_combinations.py +553 -0
  114. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/tests/test_update_command.py +6 -6
  115. tunacode_cli-0.0.32/tests/test_visual_parallel_feedback.py +160 -0
  116. tunacode_cli-0.0.30/CLAUDE.md +0 -120
  117. tunacode_cli-0.0.30/src/tunacode/core/agents/orchestrator.py +0 -213
  118. tunacode_cli-0.0.30/src/tunacode/core/agents/planner_schema.py +0 -9
  119. tunacode_cli-0.0.30/src/tunacode/core/agents/readonly.py +0 -65
  120. tunacode_cli-0.0.30/src/tunacode/core/llm/planner.py +0 -62
  121. tunacode_cli-0.0.30/src/tunacode/prompts/system.md +0 -135
  122. tunacode_cli-0.0.30/src/tunacode_cli.egg-info/SOURCES.txt +0 -98
  123. tunacode_cli-0.0.30/src/tunacode_cli.egg-info/top_level.txt +0 -1
  124. tunacode_cli-0.0.30/tests/test_architect_integration.py +0 -120
  125. tunacode_cli-0.0.30/tests/test_architect_simple.py +0 -125
  126. tunacode_cli-0.0.30/tests/test_fast_glob_search.py +0 -191
  127. tunacode_cli-0.0.30/tests/test_orchestrator_file_references.py +0 -146
  128. tunacode_cli-0.0.30/tests/test_orchestrator_import.py +0 -22
  129. tunacode_cli-0.0.30/tests/test_orchestrator_planning_visibility.py +0 -56
  130. tunacode_cli-0.0.30/tests/test_react_thoughts.py +0 -149
  131. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/LICENSE +0 -0
  132. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/MANIFEST.in +0 -0
  133. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/TUNACODE.md +0 -0
  134. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/setup.cfg +0 -0
  135. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/setup.py +0 -0
  136. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/__init__.py +0 -0
  137. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/cli/__init__.py +0 -0
  138. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/cli/main.py +0 -0
  139. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/cli/textual_app.py +0 -0
  140. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/cli/textual_bridge.py +0 -0
  141. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/configuration/__init__.py +0 -0
  142. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/configuration/defaults.py +0 -0
  143. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/configuration/models.py +0 -0
  144. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/configuration/settings.py +0 -0
  145. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/context.py +0 -0
  146. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/core/__init__.py +0 -0
  147. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/core/background/__init__.py +0 -0
  148. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/core/background/manager.py +0 -0
  149. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/core/llm/__init__.py +0 -0
  150. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/core/setup/__init__.py +0 -0
  151. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/core/setup/agent_setup.py +0 -0
  152. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/core/setup/base.py +0 -0
  153. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/core/setup/config_setup.py +0 -0
  154. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/core/setup/coordinator.py +0 -0
  155. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/core/setup/environment_setup.py +0 -0
  156. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/core/state.py +0 -0
  157. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/py.typed +0 -0
  158. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/services/__init__.py +0 -0
  159. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/services/mcp.py +0 -0
  160. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/setup.py +0 -0
  161. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/tools/__init__.py +0 -0
  162. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/tools/base.py +0 -0
  163. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/tools/bash.py +0 -0
  164. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/tools/run_command.py +0 -0
  165. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/tools/update_file.py +0 -0
  166. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/tools/write_file.py +0 -0
  167. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/types.py +0 -0
  168. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/ui/__init__.py +0 -0
  169. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/ui/completers.py +0 -0
  170. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/ui/console.py +0 -0
  171. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/ui/constants.py +0 -0
  172. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/ui/decorators.py +0 -0
  173. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/ui/input.py +0 -0
  174. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/ui/keybindings.py +0 -0
  175. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/ui/lexers.py +0 -0
  176. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/ui/output.py +0 -0
  177. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/ui/panels.py +0 -0
  178. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/ui/prompt_manager.py +0 -0
  179. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/ui/tool_ui.py +0 -0
  180. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/ui/validators.py +0 -0
  181. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/utils/__init__.py +0 -0
  182. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/utils/bm25.py +0 -0
  183. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/utils/diff_utils.py +0 -0
  184. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/utils/file_utils.py +0 -0
  185. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/utils/import_cache.py +0 -0
  186. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/utils/ripgrep.py +0 -0
  187. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/utils/system.py +0 -0
  188. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/utils/text_utils.py +0 -0
  189. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/utils/token_counter.py +0 -0
  190. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode/utils/user_configuration.py +0 -0
  191. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode_cli.egg-info/dependency_links.txt +0 -0
  192. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/src/tunacode_cli.egg-info/entry_points.txt +0 -0
  193. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/tests/test_agent_initialization.py +0 -0
  194. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/tests/test_background_manager.py +0 -0
  195. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/tests/test_file_reference_context_tracking.py +0 -0
  196. {tunacode_cli-0.0.30 → tunacode_cli-0.0.32}/tests/test_file_reference_expansion.py +0 -0
@@ -0,0 +1,484 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Commands
6
+
7
+ ### Development Commands
8
+
9
+ ```bash
10
+ # Install development environment (recommended approach)
11
+ ./scripts/setup_dev_env.sh # Creates fresh venv, installs deps, verifies setup
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>
258
+
259
+ For new feature YOU MUST folow this flow
260
+
261
+ - **Start outside-in:** write a failing acceptance test that expresses the user story before any implementation.
262
+ - **Go green fast:** add the bare-minimum code to pass that test, nothing more.
263
+ - **Drive design with micro tests:** for every behavior (validation, calc, expiry, limits) add a failing unit test, then implement until green.
264
+ - **Refactor on green:** once all tests pass, split messy code into clear components (service, repo, calculator, tracker) while keeping the suite green.
265
+ - **Edge-case first mindset:** write tests for expiry, usage caps, and discount > total _before_ handling them; implementation follows the tests.
266
+ - **Rinse & repeat:** keep iterations small, commit only green code, and let the tests guard future changes.
267
+
268
+
269
+ # Manual installation
270
+ pip install -e ".[dev]" # Install in editable mode with dev dependencies
271
+ pip install pytest-asyncio # Additional test dependency
272
+
273
+ # Run linting (black, isort, flake8)
274
+ make lint
275
+
276
+ # Run tests
277
+ make test # Run all tests via Makefile
278
+ pytest tests/ # Run all tests directly
279
+ pytest tests/test_import.py # Run single test file
280
+ pytest -k "test_name" # Run specific test by name
281
+ pytest -m "not slow" # Skip slow tests
282
+
283
+ # Run tests with coverage
284
+ make coverage
285
+
286
+ # Build distribution packages
287
+ make build
288
+
289
+ # Clean build artifacts
290
+ make clean
291
+
292
+ # Run the application
293
+ make run # Or: python -m tunacode
294
+ ```
295
+
296
+ ### Version Management
297
+
298
+ When updating versions, modify both:
299
+
300
+ - `pyproject.toml`: version field
301
+ - `src/tunacode/constants.py`: VERSION constant
302
+
303
+ ## Architecture
304
+
305
+ TunaCode is a CLI tool that provides an AI-powered coding assistant using pydantic-ai. Key architectural decisions:
306
+
307
+ ### Agent System
308
+
309
+ - Uses `pydantic-ai` for LLM agent implementation
310
+ - Central agent in `src/tunacode/core/agents/main.py` with retryable tools
311
+ - Supports multiple LLM providers (Anthropic, OpenAI, Google, OpenRouter) through unified interface
312
+ - Model format: `provider:model-name` (e.g., `openai:gpt-4`, `anthropic:claude-3-opus`)
313
+ - Background task management via `core/background/manager.py`
314
+
315
+ ### Tool System
316
+
317
+ Seven internal tools with confirmation UI:
318
+
319
+ 1. `read_file` - Read file contents with line numbers
320
+ 2. `write_file` - Create new files (fails if exists)
321
+ 3. `update_file` - Update existing files with target/patch pattern
322
+ 4. `run_command` - Execute shell commands
323
+ 5. `bash` - Execute bash commands with enhanced capabilities
324
+ 6. `grep` - Fast file content searching using regex patterns (3-second first match deadline)
325
+ 7. `list_dir` - Efficient directory listing without shell commands
326
+
327
+ Tools extend `BaseTool` or `FileBasedTool` base classes. External tools supported via MCP (Model Context Protocol) through `services/mcp.py`.
328
+
329
+ ### State Management
330
+
331
+ - `StateManager` (core/state.py) maintains all session state
332
+ - Includes user config, agent instances, message history, costs, permissions
333
+ - Single source of truth passed throughout the application
334
+ - Code indexing system in `core/code_index.py` for codebase understanding
335
+
336
+ ### Command System
337
+
338
+ - Command registry pattern in `cli/commands.py`
339
+ - Commands implement `BaseCommand` with `matches()` and `execute()` methods
340
+ - Registered via `@CommandRegistry.register` decorator
341
+ - Shell command execution with `!` prefix (e.g., `!ls`)
342
+ - Available commands: `/help`, `/model`, `/clear`, `/compact`, `/branch`, `/yolo`, `/update`, `/exit`, `/thoughts`
343
+
344
+ ### Parallel Tool Execution
345
+
346
+ - Read-only tools (read_file, grep, list_dir) execute in parallel for 3x performance improvement
347
+ - Write/execute tools remain sequential for safety
348
+ - Enhanced visual feedback when `/thoughts on` is enabled:
349
+ - Clear batch headers: "🚀 PARALLEL BATCH #X: Executing Y read-only tools concurrently"
350
+ - Detailed tool listing with arguments for each batch
351
+ - Sequential warnings for write/execute tools: "⚠️ SEQUENTIAL: tool_name (write/execute tool)"
352
+ - Completion confirmations: "✅ Parallel batch completed successfully"
353
+ - Controlled by `TUNACODE_MAX_PARALLEL` environment variable (defaults to CPU count)
354
+ - Automatic batching of consecutive read-only tools
355
+ - Read-only tools skip confirmation prompts automatically
356
+
357
+ ### Setup Coordinator
358
+
359
+ Modular setup with validation steps:
360
+
361
+ 1. Environment detection (API keys)
362
+ 2. Model validation
363
+ 3. Configuration setup (`~/.config/tunacode.json`)
364
+ 4. Git safety checks
365
+ Each step implements `BaseSetupStep` interface.
366
+
367
+ ### UI Components
368
+
369
+ - REPL uses `prompt_toolkit` for multiline input with syntax highlighting
370
+ - Output formatting via `rich` library
371
+ - Tool confirmations show diffs for file operations
372
+ - Spinner during agent processing
373
+ - Optional Textual UI bridge (`cli/textual_app.py`, `cli/textual_bridge.py`)
374
+
375
+ ## Testing
376
+
377
+ ### Test Organization
378
+
379
+ - Unit tests for individual components
380
+ - Integration tests for system interactions
381
+ - Characterization tests for capturing existing behavior
382
+ - Async tests using `@pytest.mark.asyncio`
383
+
384
+ ### Test Markers
385
+
386
+ - `@pytest.mark.slow` - Long-running tests
387
+ - `@pytest.mark.integration` - Integration tests
388
+ - `@pytest.mark.asyncio` - Async test functions
389
+
390
+ ### Running Tests
391
+
392
+ ```bash
393
+ # Skip slow tests during development
394
+ pytest -m "not slow"
395
+
396
+ # Run only characterization tests
397
+ pytest tests/test_characterization_*.py
398
+
399
+ # Run with verbose output
400
+ pytest -v
401
+
402
+ # Run with coverage report
403
+ pytest --cov=tunacode --cov-report=html
404
+ ```
405
+
406
+ ## Configuration
407
+
408
+ ### User Configuration
409
+
410
+ Location: `~/.config/tunacode.json`
411
+
412
+ ```json
413
+ {
414
+ "default_model": "provider:model-name",
415
+ "env": {
416
+ "ANTHROPIC_API_KEY": "...",
417
+ "OPENAI_API_KEY": "..."
418
+ }
419
+ }
420
+ ```
421
+
422
+ ### Project Guide
423
+
424
+ Location: `TUNACODE.md` in project root
425
+
426
+ - Project-specific context for the AI assistant
427
+ - Loaded automatically when present
428
+ - Can include codebase conventions, architecture notes
429
+
430
+ ### Linting Configuration
431
+
432
+ `.flake8` settings:
433
+
434
+ - Max line length: 120
435
+ - Ignores: E203, W503, E704 (Black compatibility)
436
+ - Excludes: venv, build, dist directories
437
+
438
+ ## Key Design Patterns
439
+
440
+ ### Error Handling
441
+
442
+ - Custom exceptions in `exceptions.py`
443
+ - `ModelRetry` from pydantic-ai for retryable errors
444
+ - Graceful degradation for missing features
445
+
446
+ ### Permissions
447
+
448
+ - File operation permissions tracked per session
449
+ - "Yolo mode" to skip confirmations: `/yolo`
450
+ - Permissions stored in StateManager
451
+
452
+ ### Async Architecture
453
+
454
+ - All agent operations are async
455
+ - Tool executions use async/await
456
+ - REPL handles async with prompt_toolkit integration
457
+
458
+ ### Performance Optimizations
459
+
460
+ - Grep tool uses fast-glob prefiltering with MAX_GLOB limit
461
+ - 3-second deadline for first match in searches
462
+ - Background task management for non-blocking operations
463
+
464
+ ### Safety Features
465
+
466
+ - No automatic git commits
467
+ - File operations require explicit confirmation (unless in yolo mode)
468
+ - Encourages git branches for experiments: `/branch <name>`
469
+ - Git safety checks during setup
470
+
471
+ Follow this code styling
472
+
473
+ | # | Rule | One-line purpose |
474
+ | --- | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
475
+ | 1 | **Guard Clause** | Flatten nested conditionals by returning early, so pre-conditions are explicit |
476
+ | 2 | **Delete Dead Code** | If it’s never executed, delete it – that’s what VCS is for |
477
+ | 3 | **Normalize Symmetries** | Make identical things look identical and different things look different for faster pattern-spotting |
478
+ | 4 | **New Interface, Old Implementation** | Write the interface you wish existed; delegate to the old one for now |
479
+ | 5 | **Reading Order** | Re-order elements so a reader meets ideas in the order they need them |
480
+ | 6 | **Cohesion Order** | Cluster coupled functions/files so related edits sit together |
481
+ | 7 | **Move Declaration & Initialization Together** | Keep a variable’s birth and first value adjacent for comprehension & dependency safety |
482
+ | 8 | **Explaining Variable** | Extract a sub-expression into a well-named variable to record intent |
483
+ | 9 | **Explaining Constant** | Replace magic literals with symbolic constants that broadcast meaning |
484
+ | 10 | **Explicit Parameters** | Split a routine so all inputs are passed openly, banishing hidden state or maps |
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tunacode-cli
3
- Version: 0.0.30
3
+ Version: 0.0.32
4
4
  Summary: Your agentic CLI developer.
5
5
  Author-email: larock22 <noreply@github.com>
6
6
  License-Expression: MIT
@@ -31,6 +31,7 @@ Requires-Dist: flake8; extra == "dev"
31
31
  Requires-Dist: isort; extra == "dev"
32
32
  Requires-Dist: pytest; extra == "dev"
33
33
  Requires-Dist: pytest-cov; extra == "dev"
34
+ Requires-Dist: pytest-asyncio; extra == "dev"
34
35
  Requires-Dist: textual-dev; extra == "dev"
35
36
  Dynamic: license-file
36
37
 
@@ -44,7 +45,7 @@ Dynamic: license-file
44
45
 
45
46
  **AI-powered CLI coding assistant**
46
47
 
47
- ![Demo](demo.gif)
48
+ ![Demo](docs/assets/demo.gif)
48
49
 
49
50
  </div>
50
51
 
@@ -75,7 +76,7 @@ tunacode --model "anthropic:claude-3.5-sonnet" --key "sk-ant-your-anthropic-key"
75
76
  tunacode --model "openrouter:openai/gpt-4o" --key "sk-or-your-openrouter-key"
76
77
  ```
77
78
 
78
- Your config is saved to `~/.config/tunacode.json`
79
+ Your config is saved to `~/.config/tunacode.json` (edit directly with `nvim ~/.config/tunacode.json`)
79
80
 
80
81
  ## Start Coding
81
82
 
@@ -96,6 +97,14 @@ tunacode
96
97
  | `!<command>` | Run shell command |
97
98
  | `exit` | Exit TunaCode |
98
99
 
100
+ ## Performance
101
+
102
+ TunaCode leverages parallel execution for read-only operations, achieving **3x faster** file operations:
103
+
104
+ ![Parallel Execution Performance](docs/assets/parrelel_work_3x.png)
105
+
106
+ Multiple file reads, directory listings, and searches execute concurrently using async I/O, making code exploration significantly faster.
107
+
99
108
  ## Safety First
100
109
 
101
110
  ⚠️ **Important**: TunaCode can modify your codebase. Always:
@@ -105,10 +114,10 @@ tunacode
105
114
 
106
115
  ## Documentation
107
116
 
108
- - [**Features**](documentation/FEATURES.md) - All features, tools, and commands
109
- - [**Advanced Configuration**](documentation/ADVANCED-CONFIG.md) - Provider setup, MCP, customization
110
- - [**Architecture**](documentation/ARCHITECTURE.md) - Source code organization and design
111
- - [**Development**](documentation/DEVELOPMENT.md) - Contributing and development setup
117
+ - [**Features**](docs/FEATURES.md) - All features, tools, and commands
118
+ - [**Advanced Configuration**](docs/ADVANCED-CONFIG.md) - Provider setup, MCP, customization
119
+ - [**Architecture**](docs/ARCHITECTURE.md) - Source code organization and design
120
+ - [**Development**](docs/DEVELOPMENT.md) - Contributing and development setup
112
121
 
113
122
  ## Links
114
123
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  **AI-powered CLI coding assistant**
10
10
 
11
- ![Demo](demo.gif)
11
+ ![Demo](docs/assets/demo.gif)
12
12
 
13
13
  </div>
14
14
 
@@ -39,7 +39,7 @@ tunacode --model "anthropic:claude-3.5-sonnet" --key "sk-ant-your-anthropic-key"
39
39
  tunacode --model "openrouter:openai/gpt-4o" --key "sk-or-your-openrouter-key"
40
40
  ```
41
41
 
42
- Your config is saved to `~/.config/tunacode.json`
42
+ Your config is saved to `~/.config/tunacode.json` (edit directly with `nvim ~/.config/tunacode.json`)
43
43
 
44
44
  ## Start Coding
45
45
 
@@ -60,6 +60,14 @@ tunacode
60
60
  | `!<command>` | Run shell command |
61
61
  | `exit` | Exit TunaCode |
62
62
 
63
+ ## Performance
64
+
65
+ TunaCode leverages parallel execution for read-only operations, achieving **3x faster** file operations:
66
+
67
+ ![Parallel Execution Performance](docs/assets/parrelel_work_3x.png)
68
+
69
+ Multiple file reads, directory listings, and searches execute concurrently using async I/O, making code exploration significantly faster.
70
+
63
71
  ## Safety First
64
72
 
65
73
  ⚠️ **Important**: TunaCode can modify your codebase. Always:
@@ -69,10 +77,10 @@ tunacode
69
77
 
70
78
  ## Documentation
71
79
 
72
- - [**Features**](documentation/FEATURES.md) - All features, tools, and commands
73
- - [**Advanced Configuration**](documentation/ADVANCED-CONFIG.md) - Provider setup, MCP, customization
74
- - [**Architecture**](documentation/ARCHITECTURE.md) - Source code organization and design
75
- - [**Development**](documentation/DEVELOPMENT.md) - Contributing and development setup
80
+ - [**Features**](docs/FEATURES.md) - All features, tools, and commands
81
+ - [**Advanced Configuration**](docs/ADVANCED-CONFIG.md) - Provider setup, MCP, customization
82
+ - [**Architecture**](docs/ARCHITECTURE.md) - Source code organization and design
83
+ - [**Development**](docs/DEVELOPMENT.md) - Contributing and development setup
76
84
 
77
85
  ## Links
78
86
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "tunacode-cli"
7
- version = "0.0.30"
7
+ version = "0.0.32"
8
8
  description = "Your agentic CLI developer."
9
9
  keywords = ["cli", "agent", "development", "automation"]
10
10
  readme = "README.md"
@@ -43,6 +43,7 @@ dev = [
43
43
  "isort",
44
44
  "pytest",
45
45
  "pytest-cov",
46
+ "pytest-asyncio",
46
47
  "textual-dev",
47
48
  ]
48
49
 
@@ -0,0 +1,13 @@
1
+ import jwt
2
+
3
+
4
+ def authenticate(username, password):
5
+ # TODO: Add password hashing
6
+ if username == "admin" and password == "admin":
7
+ return generate_token(username)
8
+ return None
9
+
10
+
11
+ def generate_token(username):
12
+ # TODO: Add expiration
13
+ return jwt.encode({"user": username}, "secret")
@@ -0,0 +1,8 @@
1
+ from .auth import authenticate
2
+
3
+
4
+ class UserManager:
5
+ def login(self, username, password):
6
+ token = authenticate(username, password)
7
+ # TODO: Store session
8
+ return token