tunacode-cli 0.1.4__tar.gz → 0.1.28__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 (576) hide show
  1. tunacode_cli-0.1.28/.claude/JOURNAL.md +278 -0
  2. tunacode_cli-0.1.28/.claude/debug_history/list-dir-tool-execution-error.md +55 -0
  3. tunacode_cli-0.1.28/.claude/qa/no-cargo-cult-fixes.md +52 -0
  4. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/.github/pull_request_template.md +1 -1
  5. tunacode_cli-0.1.28/.github/workflows/lint.yml +20 -0
  6. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/.github/workflows/publish-release.yml +2 -2
  7. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/.gitignore +4 -1
  8. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/.pre-commit-config.yaml +9 -16
  9. tunacode_cli-0.1.28/AGENTS.md +302 -0
  10. tunacode_cli-0.1.28/CHANGELOG.md +199 -0
  11. tunacode_cli-0.1.28/CLAUDE.md +333 -0
  12. tunacode_cli-0.1.28/CLAUDE_LOCAL.md +72 -0
  13. tunacode_cli-0.1.28/CONTRIBUTING.md +156 -0
  14. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/PKG-INFO +59 -17
  15. tunacode_cli-0.1.28/README.md +122 -0
  16. tunacode_cli-0.1.28/docs/codebase-map/MAP.md +466 -0
  17. tunacode_cli-0.1.28/docs/codebase-map/architecture/architecture.md +810 -0
  18. tunacode_cli-0.1.28/docs/codebase-map/modules/00-overview.md +57 -0
  19. tunacode_cli-0.1.28/docs/codebase-map/modules/INDEX.md +118 -0
  20. tunacode_cli-0.1.28/docs/codebase-map/modules/configuration.md +99 -0
  21. tunacode_cli-0.1.28/docs/codebase-map/modules/constants.md +163 -0
  22. tunacode_cli-0.1.28/docs/codebase-map/modules/core-agents.md +217 -0
  23. tunacode_cli-0.1.28/docs/codebase-map/modules/core-compaction.md +163 -0
  24. tunacode_cli-0.1.28/docs/codebase-map/modules/core-limits.md +171 -0
  25. tunacode_cli-0.1.28/docs/codebase-map/modules/core-prompting.md +120 -0
  26. tunacode_cli-0.1.28/docs/codebase-map/modules/core-state.md +57 -0
  27. tunacode_cli-0.1.28/docs/codebase-map/modules/exceptions.md +187 -0
  28. tunacode_cli-0.1.28/docs/codebase-map/modules/indexing.md +95 -0
  29. tunacode_cli-0.1.28/docs/codebase-map/modules/lsp.md +112 -0
  30. tunacode_cli-0.1.28/docs/codebase-map/modules/prompts.md +151 -0
  31. tunacode_cli-0.1.28/docs/codebase-map/modules/templates.md +113 -0
  32. tunacode_cli-0.1.28/docs/codebase-map/modules/tools-overview.md +219 -0
  33. tunacode_cli-0.1.28/docs/codebase-map/modules/types.md +95 -0
  34. tunacode_cli-0.1.28/docs/codebase-map/modules/ui-overview.md +166 -0
  35. tunacode_cli-0.1.28/docs/codebase-map/modules/utils.md +153 -0
  36. tunacode_cli-0.1.28/docs/codebase-map/state/state.md +324 -0
  37. tunacode_cli-0.1.28/docs/codebase-map/structure/00-root-overview.md +82 -0
  38. tunacode_cli-0.1.28/docs/codebase-map/structure/01-ui-directory.md +129 -0
  39. tunacode_cli-0.1.28/docs/codebase-map/structure/02-core-directory.md +136 -0
  40. tunacode_cli-0.1.28/docs/codebase-map/structure/03-tools-directory.md +169 -0
  41. tunacode_cli-0.1.28/docs/codebase-map/structure/04-configuration-directory.md +171 -0
  42. tunacode_cli-0.1.28/docs/codebase-map/structure/05-cli-directory.md +123 -0
  43. tunacode_cli-0.1.28/docs/codebase-map/structure/06-supporting-modules.md +216 -0
  44. tunacode_cli-0.1.28/docs/codebase-map/structure/ANALYSIS_SUMMARY.md +266 -0
  45. tunacode_cli-0.1.28/docs/codebase-map/structure/README.md +233 -0
  46. tunacode_cli-0.1.28/docs/codebase-map/structure/tree-structure.txt +264 -0
  47. tunacode_cli-0.1.28/docs/configuration/README.md +90 -0
  48. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/docs/configuration/tunacode.json.example +7 -0
  49. tunacode_cli-0.1.28/docs/configuration/tunacode.local.json.example +34 -0
  50. tunacode_cli-0.1.28/docs/media/agent-response.png +0 -0
  51. tunacode_cli-0.1.28/docs/media/plan-approval.png +0 -0
  52. tunacode_cli-0.1.28/docs/media/read-file-tool.png +0 -0
  53. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/docs/tools/architecture.md +1 -1
  54. tunacode_cli-0.1.28/docs/ui/agent_response_panel.md +92 -0
  55. tunacode_cli-0.1.28/docs/ui/design_philosophy.md +26 -0
  56. tunacode_cli-0.1.28/docs/ui/nextstep_panels.md +108 -0
  57. tunacode_cli-0.1.28/docs/ui/tool_renderers.md +249 -0
  58. tunacode_cli-0.1.28/memory-bank/execute/2026-01-07_23-25-00_glob-grep-modelretry.md +121 -0
  59. tunacode_cli-0.1.28/memory-bank/execute/2026-01-08_22-30-00_agent-response-panel.md +55 -0
  60. tunacode_cli-0.1.28/memory-bank/execute/2026-01-09_19-05-00_register-present-plan-tool-222.md +95 -0
  61. tunacode_cli-0.1.28/memory-bank/plan/2026-01-07_16-30-00_renderer-unification.md +156 -0
  62. tunacode_cli-0.1.28/memory-bank/plan/2026-01-07_23-12-56_glob-grep-modelretry.md +165 -0
  63. tunacode_cli-0.1.28/memory-bank/plan/2026-01-08_agent-response-panel.md +211 -0
  64. tunacode_cli-0.1.28/memory-bank/plan/2026-01-09_19-00-00_register-present-plan-tool-222.md +139 -0
  65. tunacode_cli-0.1.28/memory-bank/plan/subplan-renderer-ui.md +139 -0
  66. tunacode_cli-0.1.28/memory-bank/research/2026-01-07_23-10-22_glob-grep-error-strings.md +207 -0
  67. tunacode_cli-0.1.28/memory-bank/research/2026-01-07_panel-architecture-map.md +229 -0
  68. tunacode_cli-0.1.28/memory-bank/research/2026-01-07_pydantic-v2-analysis.md +142 -0
  69. tunacode_cli-0.1.28/memory-bank/research/2026-01-08_14-14-39_local-mode-docs.md +147 -0
  70. tunacode_cli-0.1.28/memory-bank/research/2026-01-08_14-20-00_messages-and-pruning-local-vs-api.md +229 -0
  71. tunacode_cli-0.1.28/memory-bank/research/2026-01-08_23-46-19_plan-permission-keeps-asking.md +150 -0
  72. tunacode_cli-0.1.28/memory-bank/research/2026-01-08_agent-reply-rendering-analysis.md +178 -0
  73. tunacode_cli-0.1.28/memory-bank/research/2026-01-08_raw-code-rendering-gaps.md +255 -0
  74. tunacode_cli-0.1.28/memory-bank/research/2026-01-08_ui-model-selector-logic.md +257 -0
  75. tunacode_cli-0.1.28/memory-bank/research/2026-01-09_11-33-26_grep-read-performance.md +203 -0
  76. tunacode_cli-0.1.28/memory-bank/research/2026-01-09_18-41-11_register-present-plan-tool-222.md +131 -0
  77. tunacode_cli-0.1.28/memory-bank/research/2026-01-09_simple-prompt-evals.md +153 -0
  78. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/pyproject.toml +20 -117
  79. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/pytest.ini +3 -0
  80. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/scripts/check-file-length.sh +29 -2
  81. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/scripts/run-dead-imports.sh +1 -0
  82. tunacode_cli-0.1.28/scripts/update_models_registry.sh +4 -0
  83. tunacode_cli-0.1.28/src/tunacode/cli/textual_repl.tcss +283 -0
  84. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/configuration/defaults.py +8 -2
  85. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/configuration/models.py +66 -3
  86. tunacode_cli-0.1.28/src/tunacode/configuration/models_registry.json +1 -0
  87. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/configuration/pricing.py +32 -12
  88. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/constants.py +75 -112
  89. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/core/agents/agent_components/agent_config.py +192 -88
  90. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/core/agents/agent_components/message_handler.py +2 -2
  91. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/core/agents/agent_components/node_processor.py +184 -84
  92. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/core/agents/agent_components/state_transition.py +1 -5
  93. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/core/agents/agent_components/streaming.py +6 -29
  94. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/core/agents/agent_components/tool_executor.py +7 -29
  95. tunacode_cli-0.1.28/src/tunacode/core/agents/agent_components/truncation_checker.py +37 -0
  96. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/core/agents/delegation_tools.py +10 -10
  97. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/core/agents/main.py +3 -22
  98. tunacode_cli-0.1.28/src/tunacode/core/agents/research_agent.py +233 -0
  99. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/core/compaction.py +24 -31
  100. tunacode_cli-0.1.28/src/tunacode/core/limits.py +96 -0
  101. tunacode_cli-0.1.28/src/tunacode/core/prompting/__init__.py +29 -0
  102. tunacode_cli-0.1.28/src/tunacode/core/prompting/loader.py +66 -0
  103. tunacode_cli-0.1.28/src/tunacode/core/prompting/local_prompt.md +72 -0
  104. tunacode_cli-0.1.28/src/tunacode/core/prompting/prompting_engine.py +98 -0
  105. tunacode_cli-0.1.28/src/tunacode/core/prompting/sections.py +50 -0
  106. tunacode_cli-0.1.28/src/tunacode/core/prompting/templates.py +86 -0
  107. tunacode_cli-0.1.28/src/tunacode/core/state.py +413 -0
  108. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/exceptions.py +115 -43
  109. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/indexing/code_index.py +46 -247
  110. tunacode_cli-0.1.28/src/tunacode/indexing/constants.py +86 -0
  111. tunacode_cli-0.1.28/src/tunacode/lsp/__init__.py +110 -0
  112. tunacode_cli-0.1.28/src/tunacode/lsp/client.py +351 -0
  113. tunacode_cli-0.1.28/src/tunacode/lsp/diagnostics.py +19 -0
  114. tunacode_cli-0.1.28/src/tunacode/lsp/servers.py +101 -0
  115. tunacode_cli-0.1.4/src/tunacode/prompts/system.xml → tunacode_cli-0.1.28/src/tunacode/prompts/default_prompt.md +551 -560
  116. tunacode_cli-0.1.28/src/tunacode/prompts/research/sections/agent_role.xml +5 -0
  117. tunacode_cli-0.1.28/src/tunacode/prompts/research/sections/constraints.xml +14 -0
  118. tunacode_cli-0.1.28/src/tunacode/prompts/research/sections/output_format.xml +57 -0
  119. tunacode_cli-0.1.28/src/tunacode/prompts/research/sections/tool_use.xml +23 -0
  120. tunacode_cli-0.1.28/src/tunacode/prompts/sections/advanced_patterns.xml +255 -0
  121. tunacode_cli-0.1.28/src/tunacode/prompts/sections/agent_role.xml +8 -0
  122. tunacode_cli-0.1.28/src/tunacode/prompts/sections/completion.xml +10 -0
  123. tunacode_cli-0.1.28/src/tunacode/prompts/sections/critical_rules.xml +37 -0
  124. tunacode_cli-0.1.28/src/tunacode/prompts/sections/examples.xml +220 -0
  125. tunacode_cli-0.1.28/src/tunacode/prompts/sections/output_style.xml +94 -0
  126. tunacode_cli-0.1.28/src/tunacode/prompts/sections/parallel_exec.xml +105 -0
  127. tunacode_cli-0.1.28/src/tunacode/prompts/sections/search_pattern.xml +100 -0
  128. tunacode_cli-0.1.28/src/tunacode/prompts/sections/system_info.xml +6 -0
  129. tunacode_cli-0.1.28/src/tunacode/prompts/sections/tool_use.xml +86 -0
  130. tunacode_cli-0.1.28/src/tunacode/prompts/sections/user_instructions.xml +3 -0
  131. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/authorization/context.py +4 -3
  132. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/authorization/factory.py +2 -0
  133. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/authorization/handler.py +9 -2
  134. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/authorization/notifier.py +14 -10
  135. tunacode_cli-0.1.28/src/tunacode/tools/authorization/policy.py +40 -0
  136. tunacode_cli-0.1.28/src/tunacode/tools/authorization/requests.py +119 -0
  137. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/authorization/rules.py +24 -2
  138. tunacode_cli-0.1.28/src/tunacode/tools/authorization/types.py +18 -0
  139. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/bash.py +10 -17
  140. tunacode_cli-0.1.28/src/tunacode/tools/decorators.py +218 -0
  141. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/glob.py +6 -20
  142. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/grep.py +96 -102
  143. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/grep_components/file_filter.py +3 -14
  144. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/grep_components/pattern_matcher.py +12 -6
  145. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/grep_components/result_formatter.py +0 -1
  146. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/list_dir.py +58 -82
  147. tunacode_cli-0.1.28/src/tunacode/tools/present_plan.py +102 -0
  148. tunacode_cli-0.1.28/src/tunacode/tools/prompts/present_plan_prompt.xml +42 -0
  149. tunacode_cli-0.1.28/src/tunacode/tools/prompts/todoclear_prompt.xml +12 -0
  150. tunacode_cli-0.1.28/src/tunacode/tools/prompts/todoread_prompt.xml +16 -0
  151. tunacode_cli-0.1.28/src/tunacode/tools/prompts/todowrite_prompt.xml +28 -0
  152. tunacode_cli-0.1.28/src/tunacode/tools/prompts/web_fetch_prompt.xml +11 -0
  153. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/react.py +3 -3
  154. tunacode_cli-0.1.28/src/tunacode/tools/read_file.py +96 -0
  155. tunacode_cli-0.1.28/src/tunacode/tools/todo.py +222 -0
  156. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/update_file.py +21 -10
  157. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/utils/ripgrep.py +48 -47
  158. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/utils/text_match.py +31 -17
  159. tunacode_cli-0.1.28/src/tunacode/tools/web_fetch.py +245 -0
  160. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/write_file.py +1 -1
  161. tunacode_cli-0.1.28/src/tunacode/tools/xml_helper.py +34 -0
  162. tunacode_cli-0.1.28/src/tunacode/types/__init__.py +164 -0
  163. tunacode_cli-0.1.28/src/tunacode/types/base.py +94 -0
  164. tunacode_cli-0.1.28/src/tunacode/types/callbacks.py +53 -0
  165. tunacode_cli-0.1.28/src/tunacode/types/dataclasses.py +121 -0
  166. tunacode_cli-0.1.28/src/tunacode/types/pydantic_ai.py +31 -0
  167. tunacode_cli-0.1.28/src/tunacode/types/state.py +136 -0
  168. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/ui/__init__.py +2 -1
  169. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/ui/app.py +205 -111
  170. tunacode_cli-0.1.28/src/tunacode/ui/commands/__init__.py +483 -0
  171. tunacode_cli-0.1.28/src/tunacode/ui/components/__init__.py +1 -0
  172. tunacode_cli-0.1.28/src/tunacode/ui/headless/__init__.py +5 -0
  173. tunacode_cli-0.1.28/src/tunacode/ui/headless/output.py +72 -0
  174. tunacode_cli-0.1.28/src/tunacode/ui/main.py +252 -0
  175. tunacode_cli-0.1.28/src/tunacode/ui/plan_approval.py +144 -0
  176. tunacode_cli-0.1.28/src/tunacode/ui/renderers/agent_response.py +208 -0
  177. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/ui/renderers/errors.py +7 -6
  178. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/ui/renderers/panels.py +95 -10
  179. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/ui/renderers/search.py +1 -1
  180. tunacode_cli-0.1.28/src/tunacode/ui/renderers/tools/__init__.py +73 -0
  181. tunacode_cli-0.1.28/src/tunacode/ui/renderers/tools/base.py +441 -0
  182. tunacode_cli-0.1.28/src/tunacode/ui/renderers/tools/bash.py +242 -0
  183. tunacode_cli-0.1.28/src/tunacode/ui/renderers/tools/diagnostics.py +186 -0
  184. tunacode_cli-0.1.28/src/tunacode/ui/renderers/tools/glob.py +241 -0
  185. tunacode_cli-0.1.28/src/tunacode/ui/renderers/tools/grep.py +228 -0
  186. tunacode_cli-0.1.28/src/tunacode/ui/renderers/tools/list_dir.py +217 -0
  187. tunacode_cli-0.1.28/src/tunacode/ui/renderers/tools/read_file.py +211 -0
  188. tunacode_cli-0.1.28/src/tunacode/ui/renderers/tools/research.py +284 -0
  189. tunacode_cli-0.1.28/src/tunacode/ui/renderers/tools/syntax_utils.py +225 -0
  190. tunacode_cli-0.1.28/src/tunacode/ui/renderers/tools/update_file.py +268 -0
  191. tunacode_cli-0.1.28/src/tunacode/ui/renderers/tools/web_fetch.py +176 -0
  192. tunacode_cli-0.1.28/src/tunacode/ui/renderers/tools/write_file.py +143 -0
  193. tunacode_cli-0.1.28/src/tunacode/ui/repl_support.py +234 -0
  194. tunacode_cli-0.1.28/src/tunacode/ui/screens/__init__.py +16 -0
  195. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/ui/screens/model_picker.py +76 -20
  196. tunacode_cli-0.1.28/src/tunacode/ui/screens/session_picker.py +181 -0
  197. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/ui/screens/setup.py +2 -1
  198. tunacode_cli-0.1.28/src/tunacode/ui/screens/update_confirm.py +69 -0
  199. tunacode_cli-0.1.28/src/tunacode/ui/shell_runner.py +129 -0
  200. tunacode_cli-0.1.28/src/tunacode/ui/styles/layout.tcss +98 -0
  201. tunacode_cli-0.1.28/src/tunacode/ui/styles/modals.tcss +38 -0
  202. tunacode_cli-0.1.28/src/tunacode/ui/styles/panels.tcss +81 -0
  203. tunacode_cli-0.1.28/src/tunacode/ui/styles/theme-nextstep.tcss +314 -0
  204. tunacode_cli-0.1.28/src/tunacode/ui/styles/widgets.tcss +33 -0
  205. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/ui/widgets/__init__.py +2 -0
  206. tunacode_cli-0.1.28/src/tunacode/ui/widgets/command_autocomplete.py +62 -0
  207. tunacode_cli-0.1.28/src/tunacode/ui/widgets/editor.py +402 -0
  208. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/ui/widgets/messages.py +2 -1
  209. tunacode_cli-0.1.28/src/tunacode/ui/widgets/resource_bar.py +179 -0
  210. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/ui/widgets/status_bar.py +25 -1
  211. tunacode_cli-0.1.28/src/tunacode/utils/__init__.py +0 -0
  212. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/utils/config/__init__.py +0 -2
  213. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/utils/config/user_configuration.py +5 -11
  214. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/utils/messaging/__init__.py +1 -2
  215. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/utils/messaging/message_utils.py +5 -0
  216. tunacode_cli-0.1.28/src/tunacode/utils/messaging/token_counter.py +20 -0
  217. tunacode_cli-0.1.28/src/tunacode/utils/parsing/__init__.py +13 -0
  218. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/utils/parsing/command_parser.py +4 -8
  219. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/utils/parsing/json_utils.py +36 -54
  220. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/utils/parsing/retry.py +9 -20
  221. tunacode_cli-0.1.28/src/tunacode/utils/parsing/tool_parser.py +268 -0
  222. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/utils/security/__init__.py +0 -4
  223. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/utils/security/command.py +0 -44
  224. tunacode_cli-0.1.28/src/tunacode/utils/system/gitignore.py +80 -0
  225. tunacode_cli-0.1.28/src/tunacode/utils/system/ignore_patterns.py +130 -0
  226. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/utils/system/paths.py +60 -2
  227. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/utils/ui/file_filter.py +2 -21
  228. tunacode_cli-0.1.28/tests/test_base_renderer.py +79 -0
  229. tunacode_cli-0.1.28/tests/test_base_tool_renderer.py +182 -0
  230. tunacode_cli-0.1.28/tests/test_cli_default_command.py +29 -0
  231. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/tests/test_compaction.py +59 -50
  232. tunacode_cli-0.1.28/tests/test_confirmation_preview.py +46 -0
  233. tunacode_cli-0.1.28/tests/test_diagnostics_renderer.py +175 -0
  234. tunacode_cli-0.1.28/tests/test_exceptions.py +94 -0
  235. tunacode_cli-0.1.28/tests/test_glob_grep_path_validation.py +70 -0
  236. tunacode_cli-0.1.28/tests/test_headless_cli.py +37 -0
  237. tunacode_cli-0.1.28/tests/test_limits.py +245 -0
  238. tunacode_cli-0.1.28/tests/test_present_plan.py +118 -0
  239. tunacode_cli-0.1.28/tests/test_prompting_engine.py +90 -0
  240. tunacode_cli-0.1.28/tests/test_repl_support.py +26 -0
  241. tunacode_cli-0.1.28/tests/test_shell_command_escape.py +97 -0
  242. tunacode_cli-0.1.28/tests/test_text_match.py +132 -0
  243. tunacode_cli-0.1.28/tests/test_todo_tools.py +48 -0
  244. tunacode_cli-0.1.28/tests/test_token_counter.py +79 -0
  245. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/tests/test_tool_decorators.py +26 -16
  246. tunacode_cli-0.1.28/tests/test_tool_parser.py +306 -0
  247. tunacode_cli-0.1.28/tests/test_tool_performance.py +281 -0
  248. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/tests/test_tool_retry.py +37 -8
  249. tunacode_cli-0.1.28/tests/test_update_file_renderer.py +24 -0
  250. tunacode_cli-0.1.28/tests/test_web_fetch.py +141 -0
  251. tunacode_cli-0.1.28/uv.lock +3537 -0
  252. tunacode_cli-0.1.4/.claude/README.md +0 -28
  253. tunacode_cli-0.1.4/.claude/cheatsheets/agents.core.json +0 -12
  254. tunacode_cli-0.1.4/.claude/debug_history/2025-09-21-rag-search-hyphen-gotcha.md +0 -8
  255. tunacode_cli-0.1.4/.claude/debug_history/2025-11-05_tool_handler_refactoring.md +0 -236
  256. tunacode_cli-0.1.4/.claude/debug_history/agent.state.json +0 -13
  257. tunacode_cli-0.1.4/.claude/debug_history/agent.tool_execution.json +0 -13
  258. tunacode_cli-0.1.4/.claude/debug_history/agent_components.streaming.json +0 -13
  259. tunacode_cli-0.1.4/.claude/debug_history/agents.delegation.json +0 -13
  260. tunacode_cli-0.1.4/.claude/debug_history/cli.textual_repl.json +0 -13
  261. tunacode_cli-0.1.4/.claude/debug_history/cli.tool_confirmation.json +0 -13
  262. tunacode_cli-0.1.4/.claude/debug_history/core.agents.main.json +0 -13
  263. tunacode_cli-0.1.4/.claude/debug_history/core.agents.prompts.json +0 -13
  264. tunacode_cli-0.1.4/.claude/debug_history/debug_sessions.json +0 -142
  265. tunacode_cli-0.1.4/.claude/debug_history/error-handling.json +0 -13
  266. tunacode_cli-0.1.4/.claude/debug_history/streaming.json +0 -13
  267. tunacode_cli-0.1.4/.claude/debug_history/ui.panels.json +0 -13
  268. tunacode_cli-0.1.4/.claude/debug_history/ui.research_agent.json +0 -13
  269. tunacode_cli-0.1.4/.claude/debug_history/ui.research_feedback.json +0 -13
  270. tunacode_cli-0.1.4/.claude/delta_summaries/2025-01-05-baseline.yml +0 -27
  271. tunacode_cli-0.1.4/.claude/delta_summaries/2025-09-21-models_registry-pydantic-conversion.md +0 -26
  272. tunacode_cli-0.1.4/.claude/delta_summaries/2025-09-21-models_registry-validation-tests.md +0 -18
  273. tunacode_cli-0.1.4/.claude/delta_summaries/2025-09-21-test-update-model-command-characterization.md +0 -17
  274. tunacode_cli-0.1.4/.claude/delta_summaries/2025-10-01-startup-banner-panel.md +0 -14
  275. tunacode_cli-0.1.4/.claude/delta_summaries/2025-10-03-tool_handler-behavior-optimization.md +0 -70
  276. tunacode_cli-0.1.4/.claude/delta_summaries/2025-11-05_tool_handler_api_changes.md +0 -372
  277. tunacode_cli-0.1.4/.claude/delta_summaries/api_change_logs.json +0 -145
  278. tunacode_cli-0.1.4/.claude/delta_summaries/behavior_changes.json +0 -405
  279. tunacode_cli-0.1.4/.claude/delta_summaries/fix-text-alignment-layout-task3.md +0 -48
  280. tunacode_cli-0.1.4/.claude/delta_summaries/prompt_system_xml_migration.json +0 -23
  281. tunacode_cli-0.1.4/.claude/delta_summaries/reasoning_logs.json +0 -352
  282. tunacode_cli-0.1.4/.claude/delta_summaries/task4_ui_formatting_fix.md +0 -75
  283. tunacode_cli-0.1.4/.claude/delta_summaries/v0.0.53_to_v0.0.54.diff +0 -13
  284. tunacode_cli-0.1.4/.claude/development/always-on-display-implementation.md +0 -11
  285. tunacode_cli-0.1.4/.claude/development/cli-json-recovery-incident.md +0 -181
  286. tunacode_cli-0.1.4/.claude/development/directory-caching-optimization.md +0 -195
  287. tunacode_cli-0.1.4/.claude/development/esc-investigation/ESC_KEY_INVESTIGATION.md +0 -84
  288. tunacode_cli-0.1.4/.claude/development/esc-investigation/ESC_KEY_STREAMING_ANALYSIS.md +0 -308
  289. tunacode_cli-0.1.4/.claude/development/hatch-commands.md +0 -120
  290. tunacode_cli-0.1.4/.claude/development/model-updates-2025.md +0 -18
  291. tunacode_cli-0.1.4/.claude/development/onboarding-improvements.md +0 -20
  292. tunacode_cli-0.1.4/.claude/development/openai_tool_calling_evaluation.md +0 -85
  293. tunacode_cli-0.1.4/.claude/development/phase5-prompt-injection-system.md +0 -119
  294. tunacode_cli-0.1.4/.claude/development/slash-commands.md +0 -34
  295. tunacode_cli-0.1.4/.claude/development/uv-hatch-setup.md +0 -102
  296. tunacode_cli-0.1.4/.claude/development/uv-installer-updates.md +0 -67
  297. tunacode_cli-0.1.4/.claude/development/version-management.md +0 -73
  298. tunacode_cli-0.1.4/.claude/docs_model_friendly/component_purpose.md +0 -273
  299. tunacode_cli-0.1.4/.claude/docs_model_friendly/component_relationships.md +0 -341
  300. tunacode_cli-0.1.4/.claude/docs_model_friendly/option3_feedback_flow.md +0 -207
  301. tunacode_cli-0.1.4/.claude/docs_model_friendly/rag_modules_overview.md +0 -21
  302. tunacode_cli-0.1.4/.claude/kv/github-actions-release-fix.json +0 -1
  303. tunacode_cli-0.1.4/.claude/manifest.json +0 -354
  304. tunacode_cli-0.1.4/.claude/memory_anchors/anchors.json +0 -60
  305. tunacode_cli-0.1.4/.claude/metadata/components.yml +0 -84
  306. tunacode_cli-0.1.4/.claude/metadata/file_classifications.json +0 -195
  307. tunacode_cli-0.1.4/.claude/metadata/hotspots.txt +0 -20
  308. tunacode_cli-0.1.4/.claude/patterns/agent.state.json +0 -11
  309. tunacode_cli-0.1.4/.claude/patterns/agents.delegation.json +0 -11
  310. tunacode_cli-0.1.4/.claude/patterns/agents.main_beta.json +0 -11
  311. tunacode_cli-0.1.4/.claude/patterns/agents.parallel_execution.json +0 -15
  312. tunacode_cli-0.1.4/.claude/patterns/canonical_patterns/backward_compatibility_refactor.md +0 -18
  313. tunacode_cli-0.1.4/.claude/patterns/cli.textual_tui.json +0 -31
  314. tunacode_cli-0.1.4/.claude/patterns/core.agents.agent_config.json +0 -11
  315. tunacode_cli-0.1.4/.claude/patterns/core.agents.main.json +0 -11
  316. tunacode_cli-0.1.4/.claude/patterns/error-handling.json +0 -15
  317. tunacode_cli-0.1.4/.claude/patterns/json_retry_implementation.md +0 -111
  318. tunacode_cli-0.1.4/.claude/patterns/templates.json +0 -11
  319. tunacode_cli-0.1.4/.claude/patterns/testing.json +0 -11
  320. tunacode_cli-0.1.4/.claude/patterns/tool-status-widget-pattern.md +0 -27
  321. tunacode_cli-0.1.4/.claude/patterns/tool_handler_refactoring_pattern.md +0 -245
  322. tunacode_cli-0.1.4/.claude/patterns/tools.bash.json +0 -11
  323. tunacode_cli-0.1.4/.claude/patterns/ui.concurrent_updates.json +0 -11
  324. tunacode_cli-0.1.4/.claude/patterns/ui.research_agent.json +0 -11
  325. tunacode_cli-0.1.4/.claude/patterns/ui.research_agent_panel.json +0 -11
  326. tunacode_cli-0.1.4/.claude/qa/agents.core.json +0 -11
  327. tunacode_cli-0.1.4/.claude/qa/context_logs/latest_session.txt +0 -1
  328. tunacode_cli-0.1.4/.claude/qa/context_logs/main-agent-integration-20250917-123100/commits.txt +0 -6
  329. tunacode_cli-0.1.4/.claude/qa/context_logs/main-agent-integration-20250917-123100/diffstat.txt +0 -1
  330. tunacode_cli-0.1.4/.claude/qa/context_logs/main-agent-integration-20250917-123100/files.json +0 -7
  331. tunacode_cli-0.1.4/.claude/qa/context_logs/main-agent-integration-20250917-123100/hunks.txt +0 -4
  332. tunacode_cli-0.1.4/.claude/qa/context_logs/main-agent-integration-20250917-141518/commits.txt +0 -1
  333. tunacode_cli-0.1.4/.claude/qa/context_logs/main-agent-integration-20250917-141518/diffstat.txt +0 -1
  334. tunacode_cli-0.1.4/.claude/qa/context_logs/main-agent-integration-20250917-141518/files.json +0 -22
  335. tunacode_cli-0.1.4/.claude/qa/context_logs/main-agent-integration-20250917-141518/hunks.txt +0 -29
  336. tunacode_cli-0.1.4/.claude/qa/context_logs/react-tool-session-20250120-000002/summary.md +0 -6
  337. tunacode_cli-0.1.4/.claude/qa/context_logs/smart-git-20250917-122934/commits.txt +0 -5
  338. tunacode_cli-0.1.4/.claude/qa/context_logs/smart-git-20250917-122934/diffstat.txt +0 -9
  339. tunacode_cli-0.1.4/.claude/qa/context_logs/smart-git-20250917-122934/files.json +0 -10
  340. tunacode_cli-0.1.4/.claude/qa/context_logs/tool-rejection-feedback-20251010-000001/summary.md +0 -7
  341. tunacode_cli-0.1.4/.claude/qa/core.agents.main.json +0 -11
  342. tunacode_cli-0.1.4/.claude/qa/fix-agent-errors.yml +0 -6
  343. tunacode_cli-0.1.4/.claude/qa/fix-publish-script.yml +0 -6
  344. tunacode_cli-0.1.4/.claude/qa/fix-runtime-warnings.yml +0 -6
  345. tunacode_cli-0.1.4/.claude/qa/reasoning_docs/main-agent-integration-20250917-123100.md +0 -27
  346. tunacode_cli-0.1.4/.claude/qa/reasoning_docs/main-agent-integration-20250917-141518.md +0 -31
  347. tunacode_cli-0.1.4/.claude/qa/reasoning_docs/simplified-agent-handoff-20250929.md +0 -21
  348. tunacode_cli-0.1.4/.claude/qa/reasoning_docs/smart-git-20250917-122934.md +0 -37
  349. tunacode_cli-0.1.4/.claude/qa/reasoning_docs/tool-rejection-feedback-20251010-000001.md +0 -16
  350. tunacode_cli-0.1.4/.claude/qa/tools.bash.json +0 -11
  351. tunacode_cli-0.1.4/.claude/rag_knowledge.db +0 -0
  352. tunacode_cli-0.1.4/.claude/semantic_index/function_call_graphs.json +0 -326
  353. tunacode_cli-0.1.4/.claude/semantic_index/intent_mappings.json +0 -266
  354. tunacode_cli-0.1.4/.claude/semantic_index/prompt_system_changes.json +0 -21
  355. tunacode_cli-0.1.4/.claude/semantic_index/type_relationships.json +0 -582
  356. tunacode_cli-0.1.4/.github/scripts/check_file_size.py +0 -53
  357. tunacode_cli-0.1.4/.github/workflows/lint.yml +0 -25
  358. tunacode_cli-0.1.4/AGENTS.md +0 -75
  359. tunacode_cli-0.1.4/CLAUDE.md +0 -75
  360. tunacode_cli-0.1.4/README.md +0 -81
  361. tunacode_cli-0.1.4/docs/configuration/README.md +0 -20
  362. tunacode_cli-0.1.4/memory-bank/communication/2025-11-29_gemini_textual-migration-discussion.md +0 -300
  363. tunacode_cli-0.1.4/memory-bank/execute/2025-09-12_15-20-00_model_selection_config_persistence_fix.md +0 -146
  364. tunacode_cli-0.1.4/memory-bank/execute/2025-09-29_12-15-00_git_safety_branch_removal_log.md +0 -112
  365. tunacode_cli-0.1.4/memory-bank/execute/2025-10-02_14-45-00_release_process_automation.md +0 -25
  366. tunacode_cli-0.1.4/memory-bank/execute/2025-11-18_17-15-00_multi-agent-delegation-implementation.md +0 -424
  367. tunacode_cli-0.1.4/memory-bank/execute/2025-11-19_error_handling_hardening.md +0 -194
  368. tunacode_cli-0.1.4/memory-bank/execute/2025-11-19_error_handling_hardening_REPORT.md +0 -236
  369. tunacode_cli-0.1.4/memory-bank/execute/2025-11-20_23-50-00_global-request-timeout.md +0 -185
  370. tunacode_cli-0.1.4/memory-bank/execute/2025-11-29_01-00-00_tool-activity-display.md +0 -121
  371. tunacode_cli-0.1.4/memory-bank/execute/2025-11-29_17-55-00_textual-tui-architecture-refactor.md +0 -178
  372. tunacode_cli-0.1.4/memory-bank/execute/2025-11-30_15-00-00_nextstep-tui-rebuild.md +0 -107
  373. tunacode_cli-0.1.4/memory-bank/execute/2025-11-30_20-15-00_textual_tui_tool_error_search_display.md +0 -244
  374. tunacode_cli-0.1.4/memory-bank/execute/2025-12-01_14-45-23_dead-code-removal.md +0 -120
  375. tunacode_cli-0.1.4/memory-bank/plan/2025-09-11_13-30-00_agent_loop_architecture_enhancement.md +0 -504
  376. tunacode_cli-0.1.4/memory-bank/plan/2025-09-11_14-00-00_enum_state_machine_implementation.md +0 -451
  377. tunacode_cli-0.1.4/memory-bank/plan/2025-09-11_14-15-00_automated_cli_tool_testing_framework.md +0 -461
  378. tunacode_cli-0.1.4/memory-bank/plan/2025-09-12_12-20-00_global_graceful_error_handling_implementation.md +0 -399
  379. tunacode_cli-0.1.4/memory-bank/plan/2025-09-12_15-08-14_model_selection_config_persistence_fix.md +0 -208
  380. tunacode_cli-0.1.4/memory-bank/plan/2025-09-17_15-30-00_main-agent-refactor_plan.md +0 -325
  381. tunacode_cli-0.1.4/memory-bank/plan/2025-09-19_11-30-00_tunacode_md_to_agents_md_migration.md +0 -440
  382. tunacode_cli-0.1.4/memory-bank/plan/2025-09-24_cli_prompt_toolkit_fuzzy_plan.md +0 -88
  383. tunacode_cli-0.1.4/memory-bank/plan/2025-09-29_11-15-30_simplified_agent_implementation.md +0 -81
  384. tunacode_cli-0.1.4/memory-bank/plan/2025-09-29_11-45-00_git_safety_branch_removal_plan.md +0 -334
  385. tunacode_cli-0.1.4/memory-bank/plan/2025-10-02_14-30-45_release_process_automation.md +0 -114
  386. tunacode_cli-0.1.4/memory-bank/plan/2025-11-12_15-50-42_critical_thread_safety_resource_fixes.md +0 -433
  387. tunacode_cli-0.1.4/memory-bank/plan/2025-11-18_17-09-12_multi-agent-delegation-implementation.md +0 -474
  388. tunacode_cli-0.1.4/memory-bank/plan/2025-11-19_10-00-00_main_agent_error_handling_hardening.md +0 -321
  389. tunacode_cli-0.1.4/memory-bank/plan/2025-11-20_global-request-timeout-plan.md +0 -243
  390. tunacode_cli-0.1.4/memory-bank/plan/2025-11-20_rate-limit-signaling-plan.md +0 -172
  391. tunacode_cli-0.1.4/memory-bank/plan/2025-11-20_recovery-notification-plan.md +0 -201
  392. tunacode_cli-0.1.4/memory-bank/plan/2025-11-29_00-45-00_tool-activity-display.md +0 -132
  393. tunacode_cli-0.1.4/memory-bank/plan/2025-11-29_17-15-00_textual-tui-modernization.md +0 -289
  394. tunacode_cli-0.1.4/memory-bank/plan/2025-11-29_17-20-38_textual-tui-architecture-refactor.md +0 -215
  395. tunacode_cli-0.1.4/memory-bank/plan/2025-11-29_textual-repl-migration-plan.md +0 -208
  396. tunacode_cli-0.1.4/memory-bank/plan/2025-11-30_14-30-00_nextstep-tui-component-rebuild.md +0 -231
  397. tunacode_cli-0.1.4/memory-bank/plan/2025-11-30_20-00-00_textual_tui_tool_error_search_display.md +0 -327
  398. tunacode_cli-0.1.4/memory-bank/plan/2025-12-01_16-15-00_json-utils-auth-decoupling.md +0 -161
  399. tunacode_cli-0.1.4/memory-bank/plan/2025-12-01_dead-code-removal.md +0 -165
  400. tunacode_cli-0.1.4/memory-bank/plan/2025-12-04_13-30-00_permission_modal_keybindings.md +0 -149
  401. tunacode_cli-0.1.4/memory-bank/plan/2025-12-04_16-51-48_simple_setup_command.md +0 -191
  402. tunacode_cli-0.1.4/memory-bank/plan/2025-12-04_17-30-00_ui-theme-unification.md +0 -243
  403. tunacode_cli-0.1.4/memory-bank/plan/2025-12-06_15-30-00_startup_index_build.md +0 -303
  404. tunacode_cli-0.1.4/memory-bank/plan/plan-1.md +0 -389
  405. tunacode_cli-0.1.4/memory-bank/qa/coderabbit/cr-qa-2025-11-29.md +0 -57
  406. tunacode_cli-0.1.4/memory-bank/research/2025-01-19_react-shim-analysis.md +0 -101
  407. tunacode_cli-0.1.4/memory-bank/research/2025-09-07_21-13-37_agent_loop_architecture.md +0 -176
  408. tunacode_cli-0.1.4/memory-bank/research/2025-09-11_13-14-06_agent_loop_enhancement_analysis.md +0 -222
  409. tunacode_cli-0.1.4/memory-bank/research/2025-09-12_12-15-48_global_graceful_error_handling_analysis.md +0 -126
  410. tunacode_cli-0.1.4/memory-bank/research/2025-09-12_14-54-43_model_configuration_crash_analysis.md +0 -130
  411. tunacode_cli-0.1.4/memory-bank/research/2025-09-12_15-06-58_model_selection_config_update_issue.md +0 -63
  412. tunacode_cli-0.1.4/memory-bank/research/2025-09-12_ai-agent-tools-architecture.md +0 -222
  413. tunacode_cli-0.1.4/memory-bank/research/2025-09-15_12-19-00_configuration_system_and_dashboard.md +0 -184
  414. tunacode_cli-0.1.4/memory-bank/research/2025-09-15_13-54-11_first-chunk_character_loss_investigation.md +0 -109
  415. tunacode_cli-0.1.4/memory-bank/research/2025-09-16_11-12-45_setup_py_usage_and_location_analysis.md +0 -145
  416. tunacode_cli-0.1.4/memory-bank/research/2025-09-19_11-25-00_tunacode_md_to_agents_md_migration.md +0 -207
  417. tunacode_cli-0.1.4/memory-bank/research/2025-09-21_models-registry-pydantic-conversion.md +0 -217
  418. tunacode_cli-0.1.4/memory-bank/research/2025-09-24_fuzzy_logic_implementation_analysis.md +0 -96
  419. tunacode_cli-0.1.4/memory-bank/research/2025-09-26_10-56-29_main_agent_architecture.md +0 -727
  420. tunacode_cli-0.1.4/memory-bank/research/2025-09-29_11-08-14_state_and_task_logic.md +0 -140
  421. tunacode_cli-0.1.4/memory-bank/research/2025-09-29_11-41-39_git_safety_branch_removal_analysis.md +0 -127
  422. tunacode_cli-0.1.4/memory-bank/research/2025-10-01_11-15-38_model_validation_error.md +0 -42
  423. tunacode_cli-0.1.4/memory-bank/research/2025-10-02_12-19-05_startup_performance_analysis.md +0 -183
  424. tunacode_cli-0.1.4/memory-bank/research/2025-10-02_14-26-18_release_process_analysis.md +0 -151
  425. tunacode_cli-0.1.4/memory-bank/research/2025-10-03_11-17-55_repl-test-analysis.md +0 -101
  426. tunacode_cli-0.1.4/memory-bank/research/2025-10-10_11-44-51_userabort_error_analysis.md +0 -76
  427. tunacode_cli-0.1.4/memory-bank/research/2025-11-05_17-35-17_tool_handler_mapping.md +0 -200
  428. tunacode_cli-0.1.4/memory-bank/research/2025-11-05_refactored_tool_handler_design.md +0 -580
  429. tunacode_cli-0.1.4/memory-bank/research/2025-11-11_12-12-42_option3_feedback_flow.md +0 -526
  430. tunacode_cli-0.1.4/memory-bank/research/2025-11-11_12-23-58_plan_mode_architecture.md +0 -956
  431. tunacode_cli-0.1.4/memory-bank/research/2025-11-12_15-48-04_ai_agent_system_mapping.md +0 -222
  432. tunacode_cli-0.1.4/memory-bank/research/2025-11-12_permission_system_map.md +0 -838
  433. tunacode_cli-0.1.4/memory-bank/research/2025-11-16_main-agent-architecture-map.md +0 -863
  434. tunacode_cli-0.1.4/memory-bank/research/2025-11-16_venv_setup_complexity_analysis.md +0 -325
  435. tunacode_cli-0.1.4/memory-bank/research/2025-11-17_15-00-59_todo-tool-architecture-map.md +0 -806
  436. tunacode_cli-0.1.4/memory-bank/research/2025-11-17_15-06-17_retry-rate-limit-configuration.md +0 -348
  437. tunacode_cli-0.1.4/memory-bank/research/2025-11-17_16-49-12_parallel-tool-calling-single-batch-issue.md +0 -251
  438. tunacode_cli-0.1.4/memory-bank/research/2025-11-17_18-24-31_input-display-truncation.md +0 -243
  439. tunacode_cli-0.1.4/memory-bank/research/2025-11-17_23-35-02_tool-output-formatting-inconsistency.md +0 -367
  440. tunacode_cli-0.1.4/memory-bank/research/2025-11-18_13-08-42_streaming-retry-state-corruption.md +0 -532
  441. tunacode_cli-0.1.4/memory-bank/research/2025-11-18_14-00-45_http-retry-vs-streaming-state-corruption.md +0 -468
  442. tunacode_cli-0.1.4/memory-bank/research/2025-11-18_17-01-30_multi-agent-delegation-pydantic-ai.md +0 -809
  443. tunacode_cli-0.1.4/memory-bank/research/2025-11-18_agent-feedback-visibility-issue.md +0 -420
  444. tunacode_cli-0.1.4/memory-bank/research/2025-11-18_main-py-refactoring-logic-map.md +0 -204
  445. tunacode_cli-0.1.4/memory-bank/research/2025-11-19_09-45-17_main_agent_error_handling_analysis.md +0 -174
  446. tunacode_cli-0.1.4/memory-bank/research/2025-11-19_11-30-00_node_processor_refactoring_analysis.md +0 -185
  447. tunacode_cli-0.1.4/memory-bank/research/2025-11-20_17-33-18_output_visibility_issues.md +0 -121
  448. tunacode_cli-0.1.4/memory-bank/research/2025-11-20_23-45-24_global-request-timeout-architecture.md +0 -553
  449. tunacode_cli-0.1.4/memory-bank/research/2025-11-20_error_signaling_gaps_analysis.md +0 -112
  450. tunacode_cli-0.1.4/memory-bank/research/2025-11-29_14-53-40_rich-to-textual-migration.md +0 -190
  451. tunacode_cli-0.1.4/memory-bank/research/2025-11-29_textual-repl-tui-modernization.md +0 -283
  452. tunacode_cli-0.1.4/memory-bank/research/2025-11-29_textual-tui-architecture-and-style-guide.md +0 -586
  453. tunacode_cli-0.1.4/memory-bank/research/2025-11-29_textual-tui-architecture-diagrams.md +0 -359
  454. tunacode_cli-0.1.4/memory-bank/research/2025-11-29_tool-activity-display-blueprint.md +0 -335
  455. tunacode_cli-0.1.4/memory-bank/research/2025-11-30_13-45-00_tui-architecture-map.md +0 -417
  456. tunacode_cli-0.1.4/memory-bank/research/2025-11-30_17-15-00_rich-prompt_toolkit-to-textual-deletion-map.md +0 -335
  457. tunacode_cli-0.1.4/memory-bank/research/2025-11-30_19-48-30_tool_error_search_display_textual_tui.md +0 -159
  458. tunacode_cli-0.1.4/memory-bank/research/2025-11-30_21-52-16_remove_tool_status_bar.md +0 -248
  459. tunacode_cli-0.1.4/memory-bank/research/2025-11-30_22-06-48_cli_directory_architecture_mapping.md +0 -186
  460. tunacode_cli-0.1.4/memory-bank/research/2025-12-01_15-35-51_json-utils-authorization-coupling.md +0 -170
  461. tunacode_cli-0.1.4/memory-bank/research/2025-12-01_services-directory-mapping.md +0 -260
  462. tunacode_cli-0.1.4/memory-bank/research/2025-12-01_utils-directory-mapping.md +0 -233
  463. tunacode_cli-0.1.4/memory-bank/research/2025-12-02_09-45-00_tutorial-deletion-mapping.md +0 -224
  464. tunacode_cli-0.1.4/memory-bank/research/2025-12-02_14-30-00_tools-directory-mapping.md +0 -216
  465. tunacode_cli-0.1.4/memory-bank/research/2025-12-02_15-13-03_tooling_rewrite_bash_command_analysis.md +0 -131
  466. tunacode_cli-0.1.4/memory-bank/research/2025-12-02_16-15-00_tools-decorator-refactor-mapping.md +0 -243
  467. tunacode_cli-0.1.4/memory-bank/research/2025-12-02_18-15-00_core-empty-directories.md +0 -63
  468. tunacode_cli-0.1.4/memory-bank/research/2025-12-02_18-25-55_core-module-architecture.md +0 -300
  469. tunacode_cli-0.1.4/memory-bank/research/2025-12-02_18-45-00_core-reorganization-map.md +0 -259
  470. tunacode_cli-0.1.4/memory-bank/research/2025-12-04_12-24-58_permission_prompt_regression.md +0 -183
  471. tunacode_cli-0.1.4/memory-bank/research/2025-12-04_14-07-20_tui_message_differentiation.md +0 -101
  472. tunacode_cli-0.1.4/memory-bank/research/2025-12-04_14-27-17_status_bar_file_tracking.md +0 -142
  473. tunacode_cli-0.1.4/memory-bank/research/2025-12-04_14-50-38_at_file_picker_autocomplete.md +0 -266
  474. tunacode_cli-0.1.4/memory-bank/research/2025-12-04_15-21-47_editor_autocomplete_migration.md +0 -160
  475. tunacode_cli-0.1.4/memory-bank/research/2025-12-04_16-15-00_inline_confirmation_ui.md +0 -217
  476. tunacode_cli-0.1.4/memory-bank/research/2025-12-04_16-46-37_simple_setup_command.md +0 -314
  477. tunacode_cli-0.1.4/memory-bank/research/2025-12-04_23-23-08_error-flash-silent-stop.md +0 -171
  478. tunacode_cli-0.1.4/memory-bank/research/2025-12-04_23-38-36_pricing-mechanism-consolidation.md +0 -265
  479. tunacode_cli-0.1.4/memory-bank/research/2025-12-04_bash-mode-ui-indicator.md +0 -166
  480. tunacode_cli-0.1.4/memory-bank/research/2025-12-04_permission_modal_keybindings.md +0 -185
  481. tunacode_cli-0.1.4/memory-bank/research/2025-12-04_theme-switching-config-persistence.md +0 -203
  482. tunacode_cli-0.1.4/memory-bank/research/2025-12-04_token-counting-verification.md +0 -269
  483. tunacode_cli-0.1.4/memory-bank/research/2025-12-04_token-management-context-compaction.md +0 -258
  484. tunacode_cli-0.1.4/memory-bank/research/2025-12-04_tools_test_suite_design.md +0 -93
  485. tunacode_cli-0.1.4/memory-bank/research/2025-12-04_ui-theme-unification.md +0 -207
  486. tunacode_cli-0.1.4/memory-bank/research/2025-12-05_14-41-57_at_search_depth_limitation.md +0 -137
  487. tunacode_cli-0.1.4/memory-bank/research/2025-12-05_hatch-to-uv-migration.md +0 -173
  488. tunacode_cli-0.1.4/memory-bank/research/2025-12-05_sparse_directories_cleanup_map.md +0 -143
  489. tunacode_cli-0.1.4/memory-bank/research/2025-12-06_18-25-48_ruff-lint-cleanup-map.md +0 -192
  490. tunacode_cli-0.1.4/memory-bank/research/2025-12-06_code_index_analysis.md +0 -256
  491. tunacode_cli-0.1.4/memory-bank/research/2025-12-06_error_handling_and_retry_mechanisms.md +0 -505
  492. tunacode_cli-0.1.4/memory-bank/research/2025-12-06_uniform_truncation_research.md +0 -245
  493. tunacode_cli-0.1.4/reports/SMALL_WINS_AUDIT.md +0 -211
  494. tunacode_cli-0.1.4/scripts/setup_dev_env.sh +0 -115
  495. tunacode_cli-0.1.4/src/__init__.py +0 -12
  496. tunacode_cli-0.1.4/src/tunacode/__init__.py +0 -4
  497. tunacode_cli-0.1.4/src/tunacode/configuration/key_descriptions.py +0 -267
  498. tunacode_cli-0.1.4/src/tunacode/configuration/models_registry.json +0 -1
  499. tunacode_cli-0.1.4/src/tunacode/core/agents/agent_components/truncation_checker.py +0 -78
  500. tunacode_cli-0.1.4/src/tunacode/core/agents/research_agent.py +0 -117
  501. tunacode_cli-0.1.4/src/tunacode/core/logging/__init__.py +0 -23
  502. tunacode_cli-0.1.4/src/tunacode/core/logging/config.py +0 -70
  503. tunacode_cli-0.1.4/src/tunacode/core/logging/formatters.py +0 -48
  504. tunacode_cli-0.1.4/src/tunacode/core/logging/logger.py +0 -8
  505. tunacode_cli-0.1.4/src/tunacode/core/state.py +0 -202
  506. tunacode_cli-0.1.4/src/tunacode/prompts/research/system.xml +0 -104
  507. tunacode_cli-0.1.4/src/tunacode/tools/authorization/policy.py +0 -19
  508. tunacode_cli-0.1.4/src/tunacode/tools/authorization/requests.py +0 -11
  509. tunacode_cli-0.1.4/src/tunacode/tools/decorators.py +0 -100
  510. tunacode_cli-0.1.4/src/tunacode/tools/read_file.py +0 -68
  511. tunacode_cli-0.1.4/src/tunacode/tools/xml_helper.py +0 -83
  512. tunacode_cli-0.1.4/src/tunacode/types.py +0 -203
  513. tunacode_cli-0.1.4/src/tunacode/ui/app.tcss +0 -605
  514. tunacode_cli-0.1.4/src/tunacode/ui/commands/__init__.py +0 -249
  515. tunacode_cli-0.1.4/src/tunacode/ui/components/__init__.py +0 -7
  516. tunacode_cli-0.1.4/src/tunacode/ui/components/error_display.py +0 -101
  517. tunacode_cli-0.1.4/src/tunacode/ui/components/search_results.py +0 -82
  518. tunacode_cli-0.1.4/src/tunacode/ui/components/tool_panel.py +0 -98
  519. tunacode_cli-0.1.4/src/tunacode/ui/main.py +0 -99
  520. tunacode_cli-0.1.4/src/tunacode/ui/screens/__init__.py +0 -12
  521. tunacode_cli-0.1.4/src/tunacode/ui/widgets/editor.py +0 -69
  522. tunacode_cli-0.1.4/src/tunacode/ui/widgets/resource_bar.py +0 -93
  523. tunacode_cli-0.1.4/src/tunacode/utils/messaging/token_counter.py +0 -83
  524. tunacode_cli-0.1.4/src/tunacode/utils/parsing/__init__.py +0 -3
  525. tunacode_cli-0.1.4/src/tunacode/utils/system/gitignore.py +0 -156
  526. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/LICENSE +0 -0
  527. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/MANIFEST.in +0 -0
  528. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/assets/tunacode_example.png +0 -0
  529. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/docs/images/theme.png +0 -0
  530. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/docs/images/tui-model-setup.png +0 -0
  531. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/docs/images/tui.png +0 -0
  532. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/scripts/download_ripgrep.py +0 -0
  533. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/scripts/install_linux.sh +0 -0
  534. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/scripts/playwright_cache.py +0 -0
  535. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/scripts/startup_timer.py +0 -0
  536. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/scripts/ui_import_timer.py +0 -0
  537. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/scripts/uninstall.sh +0 -0
  538. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/scripts/utils/vulture_whitelist.py +0 -0
  539. {tunacode_cli-0.1.4/src/tunacode/utils → tunacode_cli-0.1.28/src/tunacode}/__init__.py +0 -0
  540. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/configuration/__init__.py +0 -0
  541. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/configuration/settings.py +0 -0
  542. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/core/__init__.py +0 -0
  543. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/core/agents/__init__.py +0 -0
  544. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/core/agents/agent_components/__init__.py +0 -0
  545. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/core/agents/agent_components/agent_helpers.py +0 -0
  546. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/core/agents/agent_components/response_state.py +0 -0
  547. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/core/agents/agent_components/result_wrapper.py +0 -0
  548. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/core/agents/agent_components/task_completion.py +0 -0
  549. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/core/agents/agent_components/tool_buffer.py +0 -0
  550. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/core/agents/prompts.py +0 -0
  551. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/indexing/__init__.py +0 -0
  552. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/py.typed +0 -0
  553. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/templates/__init__.py +0 -0
  554. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/templates/loader.py +0 -0
  555. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/__init__.py +0 -0
  556. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/authorization/__init__.py +0 -0
  557. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/grep_components/__init__.py +0 -0
  558. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/grep_components/search_result.py +0 -0
  559. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/prompts/bash_prompt.xml +0 -0
  560. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/prompts/glob_prompt.xml +0 -0
  561. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/prompts/grep_prompt.xml +0 -0
  562. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/prompts/list_dir_prompt.xml +0 -0
  563. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/prompts/read_file_prompt.xml +0 -0
  564. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/prompts/update_file_prompt.xml +0 -0
  565. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/prompts/write_file_prompt.xml +0 -0
  566. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/tools/utils/__init__.py +0 -0
  567. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/ui/renderers/__init__.py +0 -0
  568. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/ui/screens/theme_picker.py +0 -0
  569. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/ui/styles.py +0 -0
  570. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/ui/widgets/file_autocomplete.py +0 -0
  571. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/utils/system/__init__.py +0 -0
  572. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/utils/ui/__init__.py +0 -0
  573. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/src/tunacode/utils/ui/helpers.py +0 -0
  574. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/tests/__init__.py +0 -0
  575. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/tests/conftest.py +0 -0
  576. {tunacode_cli-0.1.4 → tunacode_cli-0.1.28}/tests/test_tool_conformance.py +0 -0
@@ -0,0 +1,278 @@
1
+ # Claude Journal
2
+
3
+ ## 2026-01-07: Renderer Unification
4
+
5
+ Unifying the 8 tool renderers in `src/tunacode/ui/renderers/tools/` to eliminate duplication via a shared base class and registry pattern.
6
+
7
+ ### Completed:
8
+ - Created `base.py` with `BaseToolRenderer[T]` ABC and `ToolRendererProtocol`
9
+ - Extracted shared helpers: `truncate_line`, `truncate_content`, `pad_lines`
10
+ - Added registry pattern: `@tool_renderer`, `get_renderer`, `list_renderers`
11
+ - Migrated `list_dir.py` to use `BaseToolRenderer` (199 -> 149 lines)
12
+ - Created documentation at `docs/ui/tool_renderers.md`
13
+
14
+ ### Architecture Decisions:
15
+ - Module-level singleton renderer instances (not created per-call)
16
+ - Render functions remain the public API (backward compatible)
17
+ - `@tool_renderer` decorator for self-registration
18
+ - Helpers are standalone functions, not methods
19
+
20
+ ---
21
+
22
+ ## 2026-01-07: Local Mode Context Optimization
23
+
24
+ ### Problem:
25
+ - System prompt + tool schemas used ~3.5k tokens before any conversation
26
+ - Each file read could use 2000 lines (~20k tokens)
27
+ - With 10k context, only ~6.5k left for conversation
28
+ - LLM APIs are stateless - system prompt sent every turn
29
+
30
+ ### Solution:
31
+
32
+ **1. Minimal System Prompt**
33
+ - `LOCAL_TEMPLATE` in `templates.py` - only 3 sections: AGENT_ROLE, TOOL_USE, USER_INSTRUCTIONS
34
+ - `local_mode: true` setting triggers minimal template
35
+
36
+ **2. Minimal Tool Schemas**
37
+ - Reduced from 11 tools to 6 (bash, read_file, update_file, write_file, glob, list_dir)
38
+ - 1-word descriptions ("Shell", "Read", "Edit", etc.) - saves ~1k tokens
39
+
40
+ **3. Aggressive Pruning**
41
+ - LOCAL_PRUNE_PROTECT_TOKENS: 2,000 (vs 40,000)
42
+ - LOCAL_PRUNE_MINIMUM_THRESHOLD: 500 (vs 20,000)
43
+
44
+ **4. Tool Output Limits**
45
+ - LOCAL_DEFAULT_READ_LIMIT: 200 lines (vs 2,000)
46
+ - LOCAL_MAX_LINE_LENGTH: 500 chars (vs 2,000)
47
+ - LOCAL_MAX_COMMAND_OUTPUT: 1,500 chars (vs 5,000)
48
+
49
+ **5. Response Limit**
50
+ - local_max_tokens: 1000 - caps model output per turn
51
+
52
+ ### Token Budget (Local Mode):
53
+ | Component | Tokens |
54
+ |-----------|--------|
55
+ | System prompt | ~1,100 |
56
+ | Guide file | ~500 |
57
+ | 6 tools (minimal) | ~575 |
58
+ | **Total base** | **~2,200** |
59
+
60
+ With 10k context: ~7.8k available for conversation.
61
+
62
+ ### Key Insight:
63
+ LLM APIs are stateless. Every request sends: system prompt + tool schemas + full conversation history. Model has no memory - re-reads everything each turn.
64
+
65
+ ### Key Files:
66
+ - `src/tunacode/core/limits.py` - Centralized limit configuration
67
+ - `src/tunacode/core/prompting/templates.py` - LOCAL_TEMPLATE
68
+ - `src/tunacode/core/prompting/local_prompt.md` - Condensed prompt
69
+ - `src/tunacode/core/compaction.py` - Dynamic prune thresholds
70
+ - `src/tunacode/constants.py` - Local mode limit constants
71
+
72
+ ---
73
+
74
+ ## 2026-01-06: Local Model Support
75
+
76
+ ### Task: Add local model support to tunacode
77
+
78
+ ### Completed:
79
+ - Created condensed system prompt at `src/tunacode/prompts/local_model_prompt.txt` (~500 bytes vs 34KB full prompt)
80
+ - Added `local_model: true/false` setting in config defaults
81
+ - Modified `load_system_prompt()` to use condensed prompt when `local_model=true`
82
+ - Added cache invalidation for `local_model` setting in `_compute_agent_version()`
83
+ - Skip AGENTS.md loading for local models to save tokens
84
+ - Created `fallback_executor.py` for models that output tool calls in text (e.g., `<tool_call>` tags)
85
+ - Updated `node_processor.py` to detect and execute fallback tool calls
86
+ - Passed `agent_ctx` through the call chain for result injection
87
+ - Tested with multiple local models via LM Studio/vLLM
88
+
89
+ ### Notes:
90
+ - Qwen2.5-Coder-14B supports native OpenAI tool calling format
91
+ - Smaller models (0.6B-1.7B) output `<tool_call>` tags in content - fallback parser handles this
92
+ - llama.cpp uses KV cache efficiently (LCP similarity) so repeated prompt not re-computed
93
+
94
+ ---
95
+
96
+ ## 2026-01-08: Config Restoration & Local Mode Docs
97
+
98
+ ### Task: Restore pre-local-mode config and document local mode setup
99
+
100
+ ### Completed:
101
+
102
+ **1. Config Backup Discovery**
103
+ Found three config variants in `~/.config/`:
104
+ - `tunacode.json` - was set to local mode (grok-code-fast-1, 10k context)
105
+ - `tunacode.json.bak` - MiniMax-M2.1, 200k context, no local mode
106
+ - `@tunacode.json` - Gemini 3 Pro via OpenRouter
107
+
108
+ **2. Restored Config**
109
+ - Restored `~/.config/tunacode.json` from `.bak` (MiniMax config)
110
+ - Settings: `minimax:MiniMax-M2.1`, 200k context, `guide_file: AGENTS.md`
111
+
112
+ **3. Created Local Mode Example**
113
+ - Created `docs/configuration/tunacode.local.json.example`
114
+ - Documents all local mode settings:
115
+ - `local_mode: true`
116
+ - `local_max_tokens: 1000`
117
+ - `context_window_size: 10000`
118
+ - `OPENAI_BASE_URL: http://127.0.0.1:8080/v1`
119
+ - `guide_file: CLAUDE_LOCAL.md`
120
+
121
+ ### Key Files:
122
+ - `~/.config/tunacode.json` - user config (restored to MiniMax)
123
+ - `docs/configuration/tunacode.json.example` - standard example
124
+ - `docs/configuration/tunacode.local.json.example` - NEW: local mode example
125
+
126
+ ### Notes:
127
+ - Local mode uses condensed prompts and minimal tool schemas for small context windows
128
+ - The `.bak` file preserved the pre-experimentation state - good backup hygiene!
129
+ - User was testing local models, now back to cloud (MiniMax)
130
+
131
+ ---
132
+
133
+ ## 2026-01-08: Syntax Highlighting for Tool Renderers (Branch: ui-model-work)
134
+
135
+ ### The Mission:
136
+ Make tool outputs pretty! All those ugly plain text viewports were a crime against NeXTSTEP aesthetics. Time to add syntax highlighting everywhere.
137
+
138
+ ### Completed (Commit 9db8e92):
139
+
140
+ **1. Created `syntax_utils.py` - The Shared Foundation**
141
+ - `EXTENSION_LEXERS` - 60+ file extension → lexer mappings
142
+ - `get_lexer(filepath)` - Get pygments lexer from file path
143
+ - `syntax_or_text(content, filepath)` - Render highlighted or plain
144
+ - `detect_code_lexer(content)` - Heuristic code detection (shebangs, JSON, Python/JS patterns)
145
+ - `SYNTAX_THEME = "monokai"` - Consistent theme everywhere
146
+
147
+ **2. Created `write_file.py` - New Renderer!**
148
+ - Was missing entirely - now shows syntax-highlighted preview of written content
149
+ - Green "NEW" badge in header, file stats
150
+
151
+ **3. Updated 8 Existing Renderers:**
152
+
153
+ | Renderer | What Changed |
154
+ |----------|-------------|
155
+ | `read_file` | Syntax highlighting by file extension, built-in line numbers from Syntax component |
156
+ | `grep` | Cyan file paths, yellow `reverse` highlighted matches, styled line numbers with `│` |
157
+ | `glob` | Files colored by type: Python=bright_blue, JS=yellow, JSON=green, etc. Dir path dim, filename bold |
158
+ | `list_dir` | Tree chars dim, directories bold cyan, files colored by lexer type |
159
+ | `bash` | Smart detection: `git diff`→diff lexer, JSON commands→json lexer, labeled stdout/stderr |
160
+ | `web_fetch` | URL-based detection (raw.githubusercontent.com, .json, /api/), content heuristics |
161
+ | `research` | New "Code" section with syntax-highlighted examples from `code_examples` field |
162
+ | `update_file` | Already had Syntax("diff") - unchanged, the OG |
163
+
164
+ **4. Updated `__init__.py`:**
165
+ - Added `write_file` renderer to exports
166
+ - Added syntax utility functions to `__all__`
167
+ - Better docstring explaining the 4-zone pattern
168
+
169
+ ### Key Design Decisions:
170
+ - `syntax_or_text()` returns `RenderableType` - graceful fallback to `Text()` for unknown extensions
171
+ - File-type coloring consistent across `glob`, `list_dir`, `grep` (same color = same type)
172
+ - Bash output detection is conservative - only highlights when confident
173
+ - Research viewport prioritizes findings over code (code is supplementary)
174
+
175
+ ### Files Modified:
176
+ ```
177
+ src/tunacode/ui/renderers/tools/
178
+ ├── __init__.py (exports + docstring)
179
+ ├── syntax_utils.py (NEW - shared utilities)
180
+ ├── write_file.py (NEW - renderer)
181
+ ├── read_file.py (syntax highlighting)
182
+ ├── grep.py (styled matches)
183
+ ├── glob.py (colored paths)
184
+ ├── list_dir.py (styled tree)
185
+ ├── bash.py (smart detection)
186
+ ├── web_fetch.py (URL/content detection)
187
+ └── research.py (code examples)
188
+ ```
189
+
190
+ ### What's Left on This Branch:
191
+ - Other UI model work (the branch name suggests more to do)
192
+ - Unstaged: `.claude/JOURNAL.md`, `CLAUDE.md`, research docs, config example
193
+
194
+ ### Commands:
195
+ ```bash
196
+ uv run ruff check src/tunacode/ui/renderers/tools/ # All checks pass
197
+ uv run python -c "from tunacode.ui.renderers.tools import list_renderers; print(list_renderers())"
198
+ # ['bash', 'glob', 'grep', 'list_dir', 'read_file', 'research_codebase', 'update_file', 'web_fetch', 'write_file']
199
+ ```
200
+
201
+ ### Fun Fact:
202
+ We went from 0 syntax-highlighted viewports to 8 in one session. The `update_file` renderer was the lonely pioneer - now it has friends!
203
+
204
+ ---
205
+
206
+ ## 2026-01-08: The Great Panel Width Debugging Adventure (Branch: master)
207
+
208
+ ### The Problem:
209
+ Tool panels were narrower than agent panels. User showed screenshot - `read_file` panel was ~50 chars wide while `agent` panel was full width. Classic NeXTSTEP violation!
210
+
211
+ ### The Red Herring (What We Thought):
212
+ Initially believed the issue was `width=TOOL_PANEL_WIDTH` (50 chars) on `Panel()` calls. Spent time:
213
+ - Removing `width=TOOL_PANEL_WIDTH` from 7 Panel() calls in `panels.py`
214
+ - Removing it from `search.py`, `update_file.py`, `app.py`
215
+ - Cleaning up unused imports
216
+
217
+ But panels were STILL narrow after restart. User called me out: "stop being lazy, dig deeper"
218
+
219
+ ### The Actual Root Cause (The AHA Moment):
220
+
221
+ **Textual's `RichLog.write()` has its OWN `expand` parameter that defaults to `False`!**
222
+
223
+ From `.venv/lib/python3.13/site-packages/textual/widgets/_rich_log.py`:
224
+ ```python
225
+ def write(
226
+ self,
227
+ content: RenderableType | object,
228
+ width: int | None = None,
229
+ expand: bool = False, # <-- THIS IS THE VILLAIN
230
+ shrink: bool = True,
231
+ ...
232
+ )
233
+ ```
234
+
235
+ When `expand=False` (default), RichLog measures the content's minimum width and renders at that width, **completely ignoring** the Panel's own `expand=True` property!
236
+
237
+ The Panel's expand tells Rich "expand to console width", but RichLog overrides the console width to be just the measured content width. Two different expand flags, two different systems!
238
+
239
+ ### The Real Fix:
240
+ Pass `expand=True` to `rich_log.write()`:
241
+
242
+ ```python
243
+ # Before
244
+ self.rich_log.write(panel)
245
+
246
+ # After
247
+ self.rich_log.write(panel, expand=True)
248
+ ```
249
+
250
+ ### Files Modified:
251
+ | File | Change |
252
+ |------|--------|
253
+ | `src/tunacode/ui/app.py` | 3 panel writes → `expand=True` (lines 325, 377, 558) |
254
+ | `src/tunacode/ui/plan_approval.py` | 1 panel write → `expand=True` (line 132) |
255
+ | `src/tunacode/ui/renderers/panels.py` | Removed `width=TOOL_PANEL_WIDTH` (harmless cleanup) |
256
+ | `src/tunacode/ui/renderers/search.py` | Removed unused import |
257
+ | `src/tunacode/ui/renderers/tools/update_file.py` | Removed unused import |
258
+
259
+ ### The Lesson:
260
+ When Rich Panel has `expand=True` but isn't expanding in Textual:
261
+ 1. The Panel's expand is **not** the issue
262
+ 2. Check how the panel is being **written** to the widget
263
+ 3. RichLog.write() has its own expand parameter!
264
+
265
+ ### Status:
266
+ - Changes made, ruff passes
267
+ - NOT COMMITTED YET - user needs to test
268
+ - Previous width removal changes are technically unnecessary but harmless
269
+
270
+ ### Commands:
271
+ ```bash
272
+ git diff --stat # See all changes
273
+ uv run ruff check src/tunacode/ui/ # Verify
274
+ # Restart tunacode and make NEW request to test
275
+ ```
276
+
277
+ ### Philosophical Note:
278
+ This bug was a perfect example of "the abstraction leaked". Panel.expand and RichLog.write(expand=) look like they should be the same thing, but they operate at different levels. Panel tells Rich what to do. RichLog tells Rich what size canvas to give it. The canvas size wins.
@@ -0,0 +1,55 @@
1
+ ---
2
+ title: list_dir halts agent on bad paths
3
+ link: list-dir-tool-execution-error
4
+ type: delta
5
+ path: src/tunacode/tools/list_dir.py
6
+ depth: 0
7
+ seams: [M] module
8
+ ontological_relations:
9
+ - relates_to: [[tools]]
10
+ - affects: [[tool-executor]]
11
+ - fixes: [[agent-halt-on-tool-error]]
12
+ tags:
13
+ - tools
14
+ - error-handling
15
+ - list_dir
16
+ - ModelRetry
17
+ created_at: 2026-01-07T22:54:00-08:00
18
+ updated_at: 2026-01-07T23:15:00-08:00
19
+ uuid: a1b2c3d4-e5f6-7890-abcd-ef1234567890
20
+ ---
21
+
22
+ ## Summary
23
+
24
+ `list_dir` raised `FileNotFoundError` on non-existent directories, which `@base_tool` wrapped as `ToolExecutionError`. Since `ToolExecutionError` is in `NON_RETRYABLE_ERRORS`, the agent halted instead of letting the LLM self-correct with a valid path.
25
+
26
+ ## Context
27
+
28
+ Surfaced when agent called `list_dir("/home/tuna/tunacode/apps")` - a directory that doesn't exist. Agent crashed with `ToolExecutionError` instead of retrying.
29
+
30
+ ## Root Cause
31
+
32
+ Error propagation chain:
33
+ 1. `list_dir` raises `FileNotFoundError`
34
+ 2. `@base_tool` decorator wraps it as `ToolExecutionError`
35
+ 3. `tool_executor.py` has `ToolExecutionError` in `NON_RETRYABLE_ERRORS`
36
+ 4. Non-retryable errors propagate immediately, halting the agent
37
+
38
+ First attempted fix: switch to `@file_tool` decorator. Failed because `@file_tool` expects required `filepath` positional arg, but `list_dir` has optional `directory="."`.
39
+
40
+ ## Changes
41
+
42
+ - Import `ModelRetry` from `pydantic_ai.exceptions`
43
+ - Replace `raise FileNotFoundError(...)` with `raise ModelRetry(...)`
44
+ - Replace `raise NotADirectoryError(...)` with `raise ModelRetry(...)`
45
+ - Keep `@base_tool` decorator (not `@file_tool`)
46
+
47
+ ## Behavioral Impact
48
+
49
+ - Agent no longer halts on bad directory paths
50
+ - LLM receives retry signal with error message, can self-correct
51
+ - No change to valid path behavior
52
+
53
+ ## Related Cards
54
+
55
+ - [[glob-grep-error-strings]] - similar smell: return error strings instead of raising
@@ -0,0 +1,52 @@
1
+ ---
2
+ title: No Cargo Cult Fixes - Question Every Change
3
+ link: no-cargo-cult-fixes
4
+ type: qa
5
+ path: qa/
6
+ depth: 1
7
+ seams: [M]
8
+ ontological_relations:
9
+ - relates_to: [[code-review]]
10
+ - affects: [[all-modules]]
11
+ - fixes: [[scope-creep]]
12
+ tags:
13
+ - discipline
14
+ - shims
15
+ - code-review
16
+ created_at: 2026-01-09T22:15:00Z
17
+ updated_at: 2026-01-09T22:15:00Z
18
+ uuid: 4fa0c1e7-d7d0-415a-91e4-d69b28210ff0
19
+ ---
20
+
21
+ ## Problem
22
+
23
+ When extracting changes from a messy PR, I blindly copied a fix to `retry.py` without questioning whether it was needed.
24
+
25
+ The signature preservation fix was for pydantic-ai tool schema generation. `retry_on_json_error` is a JSON parsing utility - it never gets passed to pydantic-ai's `Tool()`. The fix there was a shim.
26
+
27
+ ## Root Cause
28
+
29
+ Cargo culting. "The original PR had it, so I included it."
30
+
31
+ ## Lesson
32
+
33
+ Before applying any fix, ask: **"Does this code path actually hit the problem?"**
34
+
35
+ For the signature preservation bug specifically:
36
+ - pydantic-ai uses `inspect.signature()` to generate JSON schemas for tools
37
+ - Only wrappers that produce functions passed to `Tool()` need the fix
38
+ - `retry_on_json_error` wraps JSON parsers, not pydantic-ai tools
39
+
40
+ ## Rule
41
+
42
+ If you encounter a shim, fix it. Don't care who made it. Don't propagate it.
43
+
44
+ ## Files That Actually Needed The Fix
45
+
46
+ 1. `research_agent.py` - `ProgressTracker.wrap_tool()` wraps tools for pydantic-ai
47
+ 2. `decorators.py` - `base_tool()` and `file_tool()` wrap tools for pydantic-ai
48
+ 3. `present_plan.py` - `create_present_plan_tool()` creates a pydantic-ai tool
49
+
50
+ ## Files That Did NOT Need The Fix
51
+
52
+ - `retry.py` - wraps JSON parsers, not pydantic-ai tools
@@ -13,7 +13,7 @@
13
13
 
14
14
  ## Testing
15
15
  <!-- Describe the tests you ran to verify your changes -->
16
- - [ ] All existing tests pass (`hatch run test`)
16
+ - [ ] All existing tests pass (`uv run pytest`)
17
17
  - [ ] New tests have been added to cover the changes
18
18
  - [ ] Tests have been run locally
19
19
  - [ ] Golden/character tests established for new features
@@ -0,0 +1,20 @@
1
+ name: Lint
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main, master]
7
+
8
+ jobs:
9
+ pre-commit:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-python@v5
14
+ with:
15
+ python-version: "3.11"
16
+ - uses: astral-sh/setup-uv@v4
17
+ - name: Install dependencies
18
+ run: uv sync --extra dev --frozen
19
+ - name: Run pre-commit
20
+ run: uv run pre-commit run --all-files
@@ -22,7 +22,7 @@ jobs:
22
22
  - name: Install build tooling
23
23
  run: |
24
24
  python -m pip install --upgrade pip
25
- pip install hatch twine uv ruff pytest pytest-cov pytest-asyncio
25
+ pip install build twine ruff pytest pytest-cov pytest-asyncio
26
26
 
27
27
  - name: Install project dependencies
28
28
  run: pip install -e '.[dev]'
@@ -63,7 +63,7 @@ jobs:
63
63
  fi
64
64
 
65
65
  - name: Build
66
- run: hatch build
66
+ run: python -m build
67
67
 
68
68
  # Preferred: API token secret
69
69
  - name: Publish to PyPI (API token)
@@ -32,7 +32,6 @@ venv/
32
32
  ENV/
33
33
  .env
34
34
  .deploy_venv/
35
- uv.lock
36
35
 
37
36
  # IDE files
38
37
  .idea/
@@ -80,3 +79,7 @@ node_modules/
80
79
  # Task files
81
80
  vendor/
82
81
  .beads/
82
+ .osgrep
83
+ .osgrep*
84
+ .pre-commit-cache/
85
+ TODO.md
@@ -4,7 +4,7 @@ default_language_version:
4
4
  python: python3
5
5
 
6
6
  # Global exclusions to prevent hooks from scanning unnecessary directories
7
- exclude: ^(venv/|build/|dist/|\.git/|__pycache__/|.*\.egg-info/|\.pytest_cache/|\.mypy_cache/|\.ruff_cache/|htmlcov/|\.coverage|reports/|llm-agent-tools/)
7
+ exclude: ^(venv/|build/|dist/|\.git/|__pycache__/|.*\.egg-info/|\.pytest_cache/|\.mypy_cache/|\.ruff_cache/|\.uv-cache/|\.uv_cache/|htmlcov/|\.coverage|reports/|llm-agent-tools/)
8
8
 
9
9
  repos:
10
10
  # Pre-commit framework hooks
@@ -13,6 +13,9 @@ repos:
13
13
  hooks:
14
14
  - id: trailing-whitespace
15
15
  - id: end-of-file-fixer
16
+ # models_registry.json is auto-generated config; lsp/__init__.py is empty stub
17
+ # trailing newline changes create diff noise
18
+ exclude: (models_registry\.json|lsp/__init__\.py)$
16
19
  - id: check-yaml
17
20
  args: ['--allow-multiple-documents']
18
21
  - id: check-added-large-files
@@ -39,11 +42,12 @@ repos:
39
42
 
40
43
  # Ruff - Fast Python linter and formatter
41
44
  - repo: https://github.com/astral-sh/ruff-pre-commit
42
- rev: v0.8.6
45
+ rev: v0.14.9
43
46
  hooks:
44
47
  - id: ruff
45
48
  args: ['--fix', '--show-fixes']
46
- # - id: ruff-format # Disabled - hatch-lint already handles formatting
49
+ - id: ruff-format # Re-enabled - ruff handles linting, ruff-format handles formatting
50
+ exclude: (models_registry\.json|lsp/__init__\.py)$
47
51
 
48
52
  # Type checking with mypy
49
53
  - repo: https://github.com/pre-commit/mirrors-mypy
@@ -59,20 +63,9 @@ repos:
59
63
 
60
64
 
61
65
  # Local hooks for project-specific checks
62
- # Strategy: Use 'hatch run' for commands defined in pyproject.toml scripts
63
- # Use 'uv run' for standalone tools not managed by hatch environments
64
66
  - repo: local
65
67
  hooks:
66
- # Hatch-managed commands (use hatch run for consistency)
67
- - id: hatch-lint
68
- name: Run hatch lint check
69
- entry: hatch run lint
70
- language: system
71
- pass_filenames: false
72
- always_run: true
73
- stages: [pre-commit]
74
-
75
- # UV-managed standalone tools (not in hatch environments)
68
+ # UV-managed tools
76
69
  - id: dead-imports
77
70
  name: Check for unused imports in changed files
78
71
  entry: scripts/run-dead-imports.sh
@@ -144,5 +137,5 @@ ci:
144
137
  autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
145
138
  autoupdate_schedule: weekly
146
139
  # Skip hooks that require project-specific environment setup
147
- skip: [hatch-lint, dead-imports, vulture-changed]
140
+ skip: [vulture-changed]
148
141
  submodules: false