opalacoder 0.2.2__tar.gz → 0.2.3.1__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.
Files changed (162) hide show
  1. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/PKG-INFO +1 -1
  2. opalacoder-0.2.3.1/docs/specs/backlog_register.md +71 -0
  3. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/gui_src/src/App.jsx +45 -1
  4. opalacoder-0.2.3.1/opalacoder/gui/assets/index-DYKstQJF.js +159 -0
  5. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/gui/index.html +1 -1
  6. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/ide_server.py +4 -0
  7. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/pyproject.toml +1 -1
  8. opalacoder-0.2.2/docs/specs/backlog_register.md +0 -39
  9. opalacoder-0.2.2/opalacoder/gui/assets/index-D2mJbeF2.js +0 -159
  10. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/.claude/rules/RULES.md +0 -0
  11. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/.claude/settings.json +0 -0
  12. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/.github/workflows/publish.yml +0 -0
  13. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/.gitignore +0 -0
  14. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AGENTS.md +0 -0
  15. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/100.png +0 -0
  16. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/102.png +0 -0
  17. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/1024.png +0 -0
  18. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/108.png +0 -0
  19. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/114.png +0 -0
  20. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/120.png +0 -0
  21. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/128.png +0 -0
  22. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/144.png +0 -0
  23. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/152.png +0 -0
  24. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/16.png +0 -0
  25. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/167.png +0 -0
  26. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/172.png +0 -0
  27. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/180.png +0 -0
  28. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/196.png +0 -0
  29. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/20.png +0 -0
  30. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/216.png +0 -0
  31. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/234.png +0 -0
  32. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/256.png +0 -0
  33. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/258.png +0 -0
  34. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/29.png +0 -0
  35. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/32.png +0 -0
  36. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/40.png +0 -0
  37. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/48.png +0 -0
  38. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/50.png +0 -0
  39. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/512.png +0 -0
  40. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/55.png +0 -0
  41. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/57.png +0 -0
  42. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/58.png +0 -0
  43. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/60.png +0 -0
  44. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/64.png +0 -0
  45. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/66.png +0 -0
  46. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/72.png +0 -0
  47. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/76.png +0 -0
  48. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/80.png +0 -0
  49. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/87.png +0 -0
  50. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/88.png +0 -0
  51. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/92.png +0 -0
  52. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -0
  53. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/android/mipmap-hdpi/ic_launcher.png +0 -0
  54. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/android/mipmap-mdpi/ic_launcher.png +0 -0
  55. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/android/mipmap-xhdpi/ic_launcher.png +0 -0
  56. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/android/mipmap-xxhdpi/ic_launcher.png +0 -0
  57. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/android/mipmap-xxxhdpi/ic_launcher.png +0 -0
  58. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/appstore.png +0 -0
  59. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/icon.png +0 -0
  60. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/opalaicon.png +0 -0
  61. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/AppIcons/playstore.png +0 -0
  62. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/CLAUDE.md +0 -0
  63. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/GEMINI.md +0 -0
  64. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/README.md +0 -0
  65. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/agents.yaml +0 -0
  66. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/config.yaml +0 -0
  67. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/debug/debug_litellm_callbacks.py +0 -0
  68. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/debug/scratch_tail.py +0 -0
  69. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/debug/test_thought_stream.py +0 -0
  70. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/docs/guide/analysis_results.md +0 -0
  71. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/docs/guide/figs/logotipo.png +0 -0
  72. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/docs/guide/paper_memplan.md +0 -0
  73. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/docs/guide/skills-plugin-system.md +0 -0
  74. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/docs/specs/01-arquitetura.md +0 -0
  75. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/docs/specs/02-memgpt-orquestrador.md +0 -0
  76. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/docs/specs/03-skill-implement-feature.md +0 -0
  77. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/docs/specs/04-memoria.md +0 -0
  78. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/docs/specs/05-vcs-sombra.md +0 -0
  79. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/docs/specs/06-skills-e-plugins.md +0 -0
  80. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/docs/specs/07-configuracao.md +0 -0
  81. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/docs/specs/08-ide.md +0 -0
  82. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/docs/specs/09-ide-projectcreationinterface.md +0 -0
  83. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/docs/specs/README.md +0 -0
  84. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/gui_src/index.html +0 -0
  85. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/gui_src/package-lock.json +0 -0
  86. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/gui_src/package.json +0 -0
  87. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/gui_src/src/index.css +0 -0
  88. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/gui_src/src/main.jsx +0 -0
  89. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/gui_src/vite.config.js +0 -0
  90. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/icon.png +0 -0
  91. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/main.py +0 -0
  92. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/__init__.py +0 -0
  93. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/agent_stdin.py +0 -0
  94. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/agents.py +0 -0
  95. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/api_keys.py +0 -0
  96. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/archival.py +0 -0
  97. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/assetstore/modelconfigs/gpt_oss__latest.metadata +0 -0
  98. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/assetstore/modelconfigs/gpt_oss__latest.zip +0 -0
  99. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/assetstore/skills/skill_html_css_js.metadata +0 -0
  100. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/assetstore/skills/skill_html_css_js.zip +0 -0
  101. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/assetstore/skills/skill_implement_feature.metadata +0 -0
  102. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/assetstore/skills/skill_implement_feature.zip +0 -0
  103. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/assetstore.py +0 -0
  104. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/cli.py +0 -0
  105. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/cli_commands.py +0 -0
  106. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/code_index.py +0 -0
  107. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/config.py +0 -0
  108. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/embeddings.py +0 -0
  109. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/gui/assets/index-CD7_Sjss.css +0 -0
  110. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/gui/assets/vendor-monaco-BkbU5OES.js +0 -0
  111. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/gui/assets/vendor-react-B2vUwPEE.js +0 -0
  112. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/gui/assets/vendor-xterm-3VOAfa_q.js +0 -0
  113. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/i18n.py +0 -0
  114. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/icon.png +0 -0
  115. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/memgpt_runtime.py +0 -0
  116. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/orchestrator.py +0 -0
  117. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/planner.py +0 -0
  118. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/plugins/__init__.py +0 -0
  119. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/plugins/html_css_js_tools.py +0 -0
  120. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/project.py +0 -0
  121. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/session.py +0 -0
  122. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/skills.py +0 -0
  123. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/structured.py +0 -0
  124. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/terminal.py +0 -0
  125. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/terminal_manager.py +0 -0
  126. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/tools.py +0 -0
  127. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/vcs.py +0 -0
  128. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/vector_index.py +0 -0
  129. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/workflow_orchestrator.py +0 -0
  130. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/opalacoder/workflow_tools.py +0 -0
  131. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/pytest.ini +0 -0
  132. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/requirements.txt +0 -0
  133. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/skills/chat-orchestrator/SKILL.md +0 -0
  134. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/skills/command-line/SKILL.md +0 -0
  135. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/skills/command-line/scripts/command_executor.py +0 -0
  136. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/skills/skills_store/html-css-js/SKILL.md +0 -0
  137. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/skills/skills_store/html-css-js/scripts/check_contracts.py +0 -0
  138. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/skills/skills_store/implement-feature/SKILL.md +0 -0
  139. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/skills/skills_store/implement-feature/scripts/run_workflow.py +0 -0
  140. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/skills/view-editor/SKILL.md +0 -0
  141. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/skills/view-editor/scripts/run_view_editor.py +0 -0
  142. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_agent_config.py +0 -0
  143. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_agent_stdin.py +0 -0
  144. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_code_index_integration.py +0 -0
  145. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_command_line_skill.py +0 -0
  146. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_complexity_evaluator.py +0 -0
  147. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_context_guard.py +0 -0
  148. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_file_delete.py +0 -0
  149. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_i18n_coverage.py +0 -0
  150. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_implement_feature_script.py +0 -0
  151. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_memgpt_runtime.py +0 -0
  152. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_model_commands.py +0 -0
  153. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_planner_oracle_live.py +0 -0
  154. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_planner_output.py +0 -0
  155. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_project_store.py +0 -0
  156. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_refinement_loop.py +0 -0
  157. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_search_bugs.py +0 -0
  158. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_skills_directory_loader.py +0 -0
  159. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_unhashable_dict_bug.py +0 -0
  160. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_verification_strategies.py +0 -0
  161. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_view_editor_skill.py +0 -0
  162. {opalacoder-0.2.2 → opalacoder-0.2.3.1}/tests/test_workflow_pipeline.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: opalacoder
3
- Version: 0.2.2
3
+ Version: 0.2.3.1
4
4
  Summary: Autonomous coding agent with interactive planning and modular execution
5
5
  Project-URL: Homepage, https://github.com/gilzamir/OpalaCoder
6
6
  Project-URL: Bug Tracker, https://github.com/gilzamir/OpalaCoder/issues
@@ -0,0 +1,71 @@
1
+ # BUGS TO FIX DETECTED ON LAST PUBLIC RELEASE (READ THE LAST SUBTOPIC)
2
+
3
+ ## FROM CURRENT = 0.1.17 TO NEXT = 0.1.18
4
+
5
+ 1. Terminal dont work, no obvious message in back terminal, but on IDE terminal we get the message "[OpalaCoder] Conexão com o terminal perdida. Reconectando...".
6
+
7
+ 2. A janela de criação de projeto somente deveria permitir confirmar criação de projeto se o diretório especificado for válido.
8
+
9
+ 3. New feature: install optional modules must be on IDE startup.
10
+
11
+ ## FROM CURRENT = 0.1.18 TO NEXT = 0.1.19
12
+
13
+ 1. Projeto não mostra nenhum erro quando o backend de modelos falha, por exemplo, tenta-se rodar um modelo que o ollama não tem instalado.
14
+
15
+ 2. Ao criar um novo arquivo, ficou congelado em carregando.
16
+
17
+ 3. A aba de Problems nunca mostra nada errado, mesmo tendo.
18
+
19
+ 4. Adicionar opção de renomear arquivo/diretório selecionado
20
+
21
+ 5. Adicionar opção de limpar output e problems.
22
+
23
+ 6. Abrir mais de uma aba no editor de arquivo (vários arquivos abertos ao mesmo tempo)
24
+
25
+ 7. Verificar se o agente de comunicação com o backend é um LLMAgentBlock e, se for, como está as configurações de limite de chamada de ferramentas e de reflexão e outras.
26
+
27
+ ## FROM CURRENT = 0.1.19 TO NEXT = 0.1.20
28
+
29
+ 1. Implementar a visualização do pensamento do agente em uma aba thinking do painel inferior Implementar em uma aba separada thinking
30
+ 2. Aumentar tamanho da fonte quando digitar ctrl+ no editor, ou diminuir quando digitar ctrl-.
31
+ 3. Disponibilizar uma skill da ide que permite ao chat visualizar o conteúdo atual do editor e retornar o trecho selecionado.
32
+ 4. Colocar botão de interroper o agente.
33
+ 5. Descobrir porque o agente granite4:latest demora a responder.
34
+ 6. O erro ao criar um projeto em um diretório existente ou proibido deveria ser mostrado como mensagem na janela de criação de projeto e não no terminal (colocar mensagem correta, de acordo com exceção).
35
+ 6.1 Se diretório já existe e der erro de permissão, mostrar erro de permissão, se diretório não existe, criar diretório com nome do projeto.
36
+ 7. Colocar hint de completação de servidor ollama (já trazer preenchido com o valor que geralmente é).
37
+ 8. Criar uma janela de configuração de modelo com parâmetros mais usados que são aceitos no agenticblocks. E criar um comando set-model-param param-name value que permite qualquer parâmetro geralmente permitido pro litellm/ollama. Cuidado para implementar controle de verdade (valores adequados de parâmetro, por example).
38
+
39
+ 9. Permitir que mensagens no chat não podem ser copiadas.
40
+
41
+ ## FROM CURRENT = 0.2.3 TO NEXT = 0.2.4
42
+
43
+ 1. Menu contextual para copiar, cortar e colar no terminal e no chat.
44
+ 2. Adicionar botões de maximizar e de minimizar o editor de texto (e outros paineis?).
45
+ 3. Adicionar o conceito de meta configurações de chat (configurações que somente são válidas naquele momento que se conversa com o agente - durante a vida de uma mensagem). Por enquanto, apenas os parâmetros max_tokens, system_prompt, temperature, top-k, top-p, min-p são permitidos. Exemplos:
46
+ 3.1 User: Implemente uma função que calcula a série de fourier. <param max_tokens=3>.
47
+ 3.2 Agent: ok ok
48
+ 3.3 User: Ora, ora, o que é você? <param system_prompt="seja irônico na resposta">
49
+ 3.4 Agent: resposta irônica
50
+ 3.5 User:...
51
+ 3.6 Agent:...
52
+ ...
53
+
54
+ Neste exemplo, em 3.1, o valor de max_tokens deve ser revertido depois que o agente der a resposta (a vida de uma meta instrução é só o do turno).
55
+ Em 3.3, o system_prompt softre uma injeção, mas que dura somente enquanto o agente responde. Observe que, a partir de 3.3, max_tokens já volta para o seu valor padrão. E partir de 3.5, a injeção de system prompt perde o efeito (resetando-se o system prompt para sua versão original).
56
+
57
+ 4. Prover ferramentas/funções de selecionar e pedir para o agente redefinir o que está selecionado. Ou para o agente detectar um erro em uma função ou trecho de código selecionado. Possíveis formas de se fazer isso:
58
+ 4.1 : o usuário seleciona o texto, e no menu contextual tem opções: refinar e corrigir se algo estiver selecionado. Também há a possibilidade do usuário selecionar algo ou deixar o cursor em alguma parte e executar CTRL+i e então abrir uma caixa em que o usuário pode pedir algo (o agente recebe o que foi selecionado, a linha inicial, a linha final e a posição do cursor. Uma interpretação é feita "se seleção vazia e linha inicial igual a linha final, focar na posição do cursor como o lugar onde posso começar a colocar algo.")
59
+
60
+ 5. Implementar e disponibilizar uma skill specs (em que o agente é instruído para a leitura de das specs).
61
+
62
+ 6. Disponibilizar a ferramenta web_search para o agente.
63
+
64
+ ## FROM CURRENT = 0.2.4 TO NEXT = 0.2.5
65
+
66
+ 1. Implementar suporte a git.
67
+ 2. Focar na integração com ollama (funcionar com tudo o que o ollama oferece e suas peculiaridades).
68
+ 3. Criar spects de programador e de programador react.
69
+
70
+ ## FROM CURRENT = 0.2.5 TO NEXT = 0.2.6
71
+ 1. ...
@@ -442,6 +442,18 @@ export default function App() {
442
442
  }
443
443
  }, [activeProject]);
444
444
 
445
+ // Polling for workspace file changes and git status (every 10 seconds)
446
+ useEffect(() => {
447
+ if (!activeProject) return;
448
+
449
+ const interval = setInterval(() => {
450
+ fetchFiles();
451
+ fetchGitStatus();
452
+ }, 10000);
453
+
454
+ return () => clearInterval(interval);
455
+ }, [activeProject]);
456
+
445
457
  useEffect(() => {
446
458
  if (activeSidebarTab === 'git' && activeProject) {
447
459
  fetchGitStatus();
@@ -1574,7 +1586,39 @@ export default function App() {
1574
1586
  }}
1575
1587
  style={dragOverPath === '__root__' ? { border: '2px dashed #007acc', backgroundColor: 'rgba(0, 122, 204, 0.05)' } : {}}
1576
1588
  >
1577
- <div className="vscode-sidebar-section-title">Workspace Files</div>
1589
+ <div className="vscode-sidebar-section-title" style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
1590
+ <span>Workspace Files</span>
1591
+ {activeProject && (
1592
+ <button
1593
+ onClick={(e) => {
1594
+ e.stopPropagation();
1595
+ fetchFiles();
1596
+ }}
1597
+ title="Atualizar arquivos"
1598
+ style={{
1599
+ background: 'transparent',
1600
+ border: 'none',
1601
+ color: '#808080',
1602
+ cursor: 'pointer',
1603
+ display: 'flex',
1604
+ alignItems: 'center',
1605
+ padding: '2px',
1606
+ borderRadius: '3px',
1607
+ transition: 'color 0.2s, background-color 0.2s',
1608
+ }}
1609
+ onMouseOver={(e) => {
1610
+ e.currentTarget.style.color = '#ffffff';
1611
+ e.currentTarget.style.backgroundColor = 'rgba(255, 255, 255, 0.1)';
1612
+ }}
1613
+ onMouseOut={(e) => {
1614
+ e.currentTarget.style.color = '#808080';
1615
+ e.currentTarget.style.backgroundColor = 'transparent';
1616
+ }}
1617
+ >
1618
+ <RefreshCw size={12} />
1619
+ </button>
1620
+ )}
1621
+ </div>
1578
1622
  {files.length === 0 ? (
1579
1623
  <div style={{ fontSize: '12px', color: '#808080', padding: '0 4px', fontStyle: 'italic' }}>
1580
1624
  Selecione um projeto para explorar.
@@ -0,0 +1,159 @@
1
+ import{r as l,F as As,R as Ls}from"./vendor-monaco-BkbU5OES.js";import{r as Fs}from"./vendor-react-B2vUwPEE.js";import{D as Ws,o as qs}from"./vendor-xterm-3VOAfa_q.js";(function(){const f=document.createElement("link").relList;if(f&&f.supports&&f.supports("modulepreload"))return;for(const p of document.querySelectorAll('link[rel="modulepreload"]'))j(p);new MutationObserver(p=>{for(const y of p)if(y.type==="childList")for(const u of y.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&j(u)}).observe(document,{childList:!0,subtree:!0});function n(p){const y={};return p.integrity&&(y.integrity=p.integrity),p.referrerPolicy&&(y.referrerPolicy=p.referrerPolicy),p.crossOrigin==="use-credentials"?y.credentials="include":p.crossOrigin==="anonymous"?y.credentials="omit":y.credentials="same-origin",y}function j(p){if(p.ep)return;p.ep=!0;const y=n(p);fetch(p.href,y)}})();var os={exports:{}},Te={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Bs=l,Hs=Symbol.for("react.element"),Js=Symbol.for("react.fragment"),Us=Object.prototype.hasOwnProperty,Vs=Bs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Gs={key:!0,ref:!0,__self:!0,__source:!0};function rs(h,f,n){var j,p={},y=null,u=null;n!==void 0&&(y=""+n),f.key!==void 0&&(y=""+f.key),f.ref!==void 0&&(u=f.ref);for(j in f)Us.call(f,j)&&!Gs.hasOwnProperty(j)&&(p[j]=f[j]);if(h&&h.defaultProps)for(j in f=h.defaultProps,f)p[j]===void 0&&(p[j]=f[j]);return{$$typeof:Hs,type:h,key:y,ref:u,props:p,_owner:Vs.current}}Te.Fragment=Js;Te.jsx=rs;Te.jsxs=rs;os.exports=Te;var e=os.exports,Xe={},Zt=Fs;Xe.createRoot=Zt.createRoot,Xe.hydrateRoot=Zt.hydrateRoot;/**
10
+ * @license lucide-react v0.378.0 - ISC
11
+ *
12
+ * This source code is licensed under the ISC license.
13
+ * See the LICENSE file in the root directory of this source tree.
14
+ */const Ks=h=>h.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ns=(...h)=>h.filter((f,n,j)=>!!f&&j.indexOf(f)===n).join(" ");/**
15
+ * @license lucide-react v0.378.0 - ISC
16
+ *
17
+ * This source code is licensed under the ISC license.
18
+ * See the LICENSE file in the root directory of this source tree.
19
+ */var Xs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
20
+ * @license lucide-react v0.378.0 - ISC
21
+ *
22
+ * This source code is licensed under the ISC license.
23
+ * See the LICENSE file in the root directory of this source tree.
24
+ */const Ys=l.forwardRef(({color:h="currentColor",size:f=24,strokeWidth:n=2,absoluteStrokeWidth:j,className:p="",children:y,iconNode:u,...N},T)=>l.createElement("svg",{ref:T,...Xs,width:f,height:f,stroke:h,strokeWidth:j?Number(n)*24/Number(f):n,className:ns("lucide",p),...N},[...u.map(([S,M])=>l.createElement(S,M)),...Array.isArray(y)?y:[y]]));/**
25
+ * @license lucide-react v0.378.0 - ISC
26
+ *
27
+ * This source code is licensed under the ISC license.
28
+ * See the LICENSE file in the root directory of this source tree.
29
+ */const k=(h,f)=>{const n=l.forwardRef(({className:j,...p},y)=>l.createElement(Ys,{ref:y,iconNode:f,className:ns(`lucide-${Ks(h)}`,j),...p}));return n.displayName=`${h}`,n};/**
30
+ * @license lucide-react v0.378.0 - ISC
31
+ *
32
+ * This source code is licensed under the ISC license.
33
+ * See the LICENSE file in the root directory of this source tree.
34
+ */const Zs=k("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
35
+ * @license lucide-react v0.378.0 - ISC
36
+ *
37
+ * This source code is licensed under the ISC license.
38
+ * See the LICENSE file in the root directory of this source tree.
39
+ */const Ce=k("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
40
+ * @license lucide-react v0.378.0 - ISC
41
+ *
42
+ * This source code is licensed under the ISC license.
43
+ * See the LICENSE file in the root directory of this source tree.
44
+ */const Qs=k("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
45
+ * @license lucide-react v0.378.0 - ISC
46
+ *
47
+ * This source code is licensed under the ISC license.
48
+ * See the LICENSE file in the root directory of this source tree.
49
+ */const ea=k("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
50
+ * @license lucide-react v0.378.0 - ISC
51
+ *
52
+ * This source code is licensed under the ISC license.
53
+ * See the LICENSE file in the root directory of this source tree.
54
+ */const ta=k("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
55
+ * @license lucide-react v0.378.0 - ISC
56
+ *
57
+ * This source code is licensed under the ISC license.
58
+ * See the LICENSE file in the root directory of this source tree.
59
+ */const sa=k("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
60
+ * @license lucide-react v0.378.0 - ISC
61
+ *
62
+ * This source code is licensed under the ISC license.
63
+ * See the LICENSE file in the root directory of this source tree.
64
+ */const aa=k("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
65
+ * @license lucide-react v0.378.0 - ISC
66
+ *
67
+ * This source code is licensed under the ISC license.
68
+ * See the LICENSE file in the root directory of this source tree.
69
+ */const oa=k("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
70
+ * @license lucide-react v0.378.0 - ISC
71
+ *
72
+ * This source code is licensed under the ISC license.
73
+ * See the LICENSE file in the root directory of this source tree.
74
+ */const Qt=k("Files",[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]]);/**
75
+ * @license lucide-react v0.378.0 - ISC
76
+ *
77
+ * This source code is licensed under the ISC license.
78
+ * See the LICENSE file in the root directory of this source tree.
79
+ */const Ke=k("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
80
+ * @license lucide-react v0.378.0 - ISC
81
+ *
82
+ * This source code is licensed under the ISC license.
83
+ * See the LICENSE file in the root directory of this source tree.
84
+ */const ra=k("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
85
+ * @license lucide-react v0.378.0 - ISC
86
+ *
87
+ * This source code is licensed under the ISC license.
88
+ * See the LICENSE file in the root directory of this source tree.
89
+ */const ls=k("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
90
+ * @license lucide-react v0.378.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */const na=k("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
95
+ * @license lucide-react v0.378.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */const la=k("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
100
+ * @license lucide-react v0.378.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */const ia=k("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
105
+ * @license lucide-react v0.378.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */const es=k("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
110
+ * @license lucide-react v0.378.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const ca=k("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
115
+ * @license lucide-react v0.378.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */const da=k("Pen",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}]]);/**
120
+ * @license lucide-react v0.378.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const ts=k("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
125
+ * @license lucide-react v0.378.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const ss=k("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
130
+ * @license lucide-react v0.378.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const we=k("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
135
+ * @license lucide-react v0.378.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const as=k("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
140
+ * @license lucide-react v0.378.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const pa=k("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
145
+ * @license lucide-react v0.378.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const F=k("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),_e=(h,f)=>{try{const n=localStorage.getItem(h);return n!==null?n:f}catch{return f}},$=(h,f)=>{try{localStorage.setItem(h,f)}catch{}};function xa(){var Dt,Rt,It,$t,At,Lt,Ft,Wt,qt,Bt,Ht,Jt,Ut,Vt,Gt,Kt,Xt,Yt;const[h,f]=l.useState([]),[n,j]=l.useState(null),[p,y]=l.useState([]),[u,N]=l.useState(null),[T,S]=l.useState(""),[M,P]=l.useState([]),[D,z]=l.useState({}),[E,ae]=l.useState(null),[oe,re]=l.useState(!1),[ne,b]=l.useState([]),[le,J]=l.useState(""),[W,ie]=l.useState(!1),[ze,Ye]=l.useState([]),[q,Ze]=l.useState(!1),[ce,Qe]=l.useState(!0),[U,et]=l.useState("explorer"),[C,cs]=l.useState("output"),[de,V]=l.useState([]),[tt,Ee]=l.useState([]),[Pe,st]=l.useState(!1),[at,pe]=l.useState(""),[B,A]=l.useState(""),[R,H]=l.useState(null),[ds,xe]=l.useState(!1),[L,Oe]=l.useState("preferences"),[G,ps]=l.useState(()=>_e("theme","dark")),[ot,K]=l.useState(()=>Number(_e("editorFontSize",13))),[rt,xs]=l.useState(()=>Number(_e("editorTabSize",4))),[nt,ms]=l.useState(()=>_e("editorWordWrap","on")),[X,lt]=l.useState([]),[Y,it]=l.useState(""),[Me,ct]=l.useState(!1),[Z,hs]=l.useState(null),[De,me]=l.useState(null),[Re,dt]=l.useState(!1),[he,ue]=l.useState(""),[pt,Ie]=l.useState(""),[us,$e]=l.useState(!1),Q=l.useRef(null),ee=l.useRef(null),fe=l.useRef(null),ye=l.useRef(null),[xt,fs]=l.useState(260),[mt,ys]=l.useState(320),[Ae,gs]=l.useState(240),[Le,Fe]=l.useState(null),[ge,We]=l.useState(null),[x,g]=l.useState(null);l.useEffect(()=>{x||st(!1)},[x]);const qe=async()=>{if(n)try{const t=await fetch(`/api/opalacoder/problems?projectPath=${encodeURIComponent(n.project_path)}`);if(t.ok){const s=await t.json();V(s.problems||[])}}catch(t){console.error("Failed to fetch problems",t)}},Be=(t,s)=>{t.preventDefault();const o=t.clientX,a=t.clientY,r=xt,d=mt,c=Ae,m=_=>{if(s==="left"){const w=_.clientX-o,I=Math.max(150,Math.min(600,r+w));fs(I)}else if(s==="right"){const w=_.clientX-o,I=Math.max(200,Math.min(600,d-w));ys(I)}else if(s==="bottom"){const w=_.clientY-a,I=Math.max(100,Math.min(600,c-w));gs(I)}},v=()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",v)};document.addEventListener("mousemove",m),document.addEventListener("mouseup",v)},[He,ve]=l.useState(!1),[je,ht]=l.useState(""),[te,Je]=l.useState(""),[ut,ft]=l.useState(""),[Ue,yt]=l.useState("gemini/gemini-2.5-flash"),[gt,vs]=l.useState("auto"),[vt,jt]=l.useState({}),[bt,kt]=l.useState(""),[Nt,St]=l.useState("http://localhost:11434/v1"),Ct=l.useRef(null),wt=l.useRef(null),be=l.useRef(null),Ve=l.useRef(null),js=(t,s)=>{be.current=t,t.onKeyDown(o=>{const a=o.browserEvent,r=a.ctrlKey||a.metaKey,d=a.key,c=a.code;r&&(d==="+"||d==="="||c==="Equal"||c==="NumpadAdd")?(a.preventDefault(),a.stopPropagation(),K(m=>{const v=Math.min(30,m+1);return $("editorFontSize",v),v})):r&&(d==="-"||c==="Minus"||c==="NumpadSubtract")?(a.preventDefault(),a.stopPropagation(),K(m=>{const v=Math.max(10,m-1);return $("editorFontSize",v),v})):r&&d==="s"&&(a.preventDefault(),a.stopPropagation(),Ve.current&&Ve.current())})};l.useEffect(()=>{He||pe("")},[He]),l.useEffect(()=>{ke()},[]),l.useEffect(()=>{n?(O(),qe(),b([{role:"assistant",content:`Olá! Estou pronto para auxiliar no projeto **${n.project_name||n.name}**.`}])):(y([]),N(null),S(""),P([]),z({}),V([]))},[n]),l.useEffect(()=>{const t=o=>{o.preventDefault()};document.addEventListener("contextmenu",t);const s=()=>{Fe(null)};return document.addEventListener("click",s),()=>{document.removeEventListener("contextmenu",t),document.removeEventListener("click",s)}},[]),l.useEffect(()=>{var t;(t=Ct.current)==null||t.scrollIntoView({behavior:"smooth"})},[ne]),l.useEffect(()=>{var t;(t=wt.current)==null||t.scrollIntoView({behavior:"smooth"})},[ze]),l.useEffect(()=>{const t=s=>{const o=s.ctrlKey||s.metaKey,a=s.key,r=s.code;o&&a==="s"?(s.preventDefault(),Ne()):o&&(a==="+"||a==="="||r==="Equal"||r==="NumpadAdd")?(s.preventDefault(),K(d=>{const c=Math.min(30,d+1);return $("editorFontSize",c),c})):o&&(a==="-"||r==="Minus"||r==="NumpadSubtract")&&(s.preventDefault(),K(d=>{const c=Math.max(10,d-1);return $("editorFontSize",c),c}))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[u,T,n]),l.useEffect(()=>{if(!n){fe.current&&(fe.current.close(),fe.current=null);return}if(!Q.current)return;const t=new Ws({cursorBlink:!0,fontSize:13,fontFamily:'Consolas, "Courier New", monospace',theme:{background:"#1e1e1e",foreground:"#cccccc"}}),s=new qs;t.loadAddon(s),Q.current.innerHTML="",t.open(Q.current);try{s.fit()}catch{}ee.current=t,ye.current=s;const o=n.project_path,a=`/api/terminal/stream?projectPath=${encodeURIComponent(o)}`,r=new EventSource(a);fe.current=r,r.onmessage=c=>{try{const m=c.data,v=atob(m),_=new Uint8Array(v.length);for(let w=0;w<v.length;w++)_[w]=v.charCodeAt(w);t.write(_)}catch(m){console.error("Error decoding terminal stream data",m)}},r.onerror=c=>{console.error("Terminal event source error",c),t.write(`\r
150
+ \x1B[31m[OpalaCoder] Conexão com o terminal perdida. Reconectando...\x1B[0m\r
151
+ `)},t.onData(c=>{fetch("/api/terminal/input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"input",text:c,projectPath:n.project_path})}).catch(m=>console.error("Failed to send terminal input",m))});const d=new ResizeObserver(()=>{if(s)try{s.fit();const{cols:c,rows:m}=t;fetch("/api/terminal/input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"resize",cols:c,rows:m,projectPath:n.project_path})}).catch(v=>console.error("Failed to send terminal resize",v))}catch{}});return d.observe(Q.current),()=>{d.disconnect(),r&&r.close(),t.dispose(),ee.current=null,ye.current=null}},[n]),l.useEffect(()=>{$("theme",G),G==="light"?document.body.classList.add("light-theme"):document.body.classList.remove("light-theme")},[G]),l.useEffect(()=>{C==="terminal"&&ee.current&&ye.current&&n&&setTimeout(()=>{try{ye.current.fit();const{cols:t,rows:s}=ee.current;fetch("/api/terminal/input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"resize",cols:t,rows:s,projectPath:n.project_path})}).catch(o=>console.error("Failed to send terminal resize",o)),ee.current.focus()}catch{}},50)},[C,Ae,n]),l.useEffect(()=>{n?se():lt([])},[n]),l.useEffect(()=>{if(!n)return;const t=setInterval(()=>{O(),se()},1e4);return()=>clearInterval(t)},[n]),l.useEffect(()=>{U==="git"&&n&&se()},[U,n]);const ke=async()=>{try{const t=await fetch("/api/opalacoder/list-projects");if(t.ok){const s=await t.json();f(s.projects||[]),s.projects&&s.projects.length>0&&!n&&Tt(s.projects[0])}}catch(t){i("error",`Falha ao carregar projetos: ${t.message}`)}},se=async()=>{if(n)try{const t=await fetch(`/api/git/status?projectPath=${encodeURIComponent(n.project_path)}`);if(t.ok){const s=await t.json();lt(s.files||[])}}catch(t){console.error("Failed to fetch git status",t)}},bs=async t=>{if(t&&t.preventDefault(),!(!n||!Y.trim()||Me)){ct(!0),i("info",`Criando commit com a mensagem: "${Y}"...`);try{const s=await fetch("/api/git/commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:n.project_path,message:Y})});if(s.ok)i("info","Commit criado com sucesso!"),it(""),se();else{const o=await s.json();i("error",`Falha ao fazer commit: ${o.error||"Erro desconhecido"}`)}}catch(s){i("error",`Erro ao fazer commit: ${s.message}`)}finally{ct(!1)}}},_t=async()=>{if(!Re){dt(!0),ue("Instalando..."),Ie(`Iniciando pip install...
152
+ `);try{const t=await fetch("/api/settings/install-dependencies",{method:"POST"});if(!t.ok)throw new Error("Falha ao iniciar instalação");const s=t.body.getReader(),o=new TextDecoder("utf-8");let a="";for(;;){const{value:r,done:d}=await s.read();if(d)break;a+=o.decode(r,{stream:!0});const c=a.split(`
153
+ `);a=c.pop();for(const m of c)if(m.trim())try{const v=JSON.parse(m.trim());v.output&&Ie(_=>_+v.output),v.status==="success"?ue("Instalado com Sucesso!"):v.status==="error"&&ue("Erro na Instalação")}catch{}}}catch(t){ue("Falha ao conectar"),Ie(s=>s+`
154
+ Erro: ${t.message}
155
+ `)}finally{dt(!1)}}},Tt=t=>{j(t),i("info",`Projeto selecionado: ${t.project_name||t.name}`)},O=async()=>{if(n)try{const t=await fetch(`/api/files?projectPath=${encodeURIComponent(n.project_path)}`);if(t.ok){const s=await t.json();y(s.files||[])}else{const s=await t.json();i("error",`Falha ao listar arquivos: ${s.error}`)}}catch(t){i("error",`Erro na chamada de arquivos: ${t.message}`)}},ks=t=>{n&&(t.preventDefault(),t.stopPropagation(),ae(null),Fe({x:t.clientX,y:t.clientY}))},Ns=(t,s)=>{n&&(t.preventDefault(),t.stopPropagation(),ae(s),Fe({x:t.clientX,y:t.clientY}))},Ss=async t=>{if(!n)return;const s=t?`${t}/`:"",o=window.prompt("Nome do novo arquivo (ex: src/utils.py):",s);if(o)try{const a=await fetch("/api/file/write",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:n.project_path,filePath:o,content:""})});if(a.ok)i("info",`Arquivo criado: ${o}`),await O(),await Ge(o);else{const r=await a.json();i("error",`Falha ao criar arquivo: ${r.error}`),alert(`Erro ao criar arquivo: ${r.error}`)}}catch(a){i("error",`Erro na chamada de criação de arquivo: ${a.message}`)}},Cs=async t=>{if(!n)return;const s=t?`${t}/`:"",o=window.prompt("Nome do novo diretório (ex: src/components):",s);if(o)try{const a=await fetch("/api/file/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:n.project_path,dirPath:o})});if(a.ok)i("info",`Diretório criado: ${o}`),await O();else{const r=await a.json();i("error",`Falha ao criar diretório: ${r.error}`),alert(`Erro ao criar diretório: ${r.error}`)}}catch(a){i("error",`Erro na chamada de criação de diretório: ${a.message}`)}},ws=async t=>{if(!n||!t)return;const s=window.prompt(`Digite o novo caminho/nome para "${t.path}":`,t.path);if(!(!s||s===t.path))try{const o=await fetch("/api/file/rename",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:n.project_path,oldPath:t.path,newPath:s})});if(o.ok){if(i("info",`${t.isDirectory?"Diretório":"Arquivo"} renomeado de ${t.path} para ${s}`),!t.isDirectory)P(a=>a.map(r=>r===t.path?s:r)),z(a=>{const r={...a},d=r[t.path];return delete r[t.path],r[s]=d,r}),u===t.path&&N(s);else{const a=`${t.path}/`;P(r=>r.map(d=>d.startsWith(a)?d.replace(t.path,s):d)),z(r=>{const d={};for(const[c,m]of Object.entries(r))c.startsWith(a)?d[c.replace(t.path,s)]=m:d[c]=m;return d}),u&&u.startsWith(a)&&N(r=>r.replace(t.path,s))}await O()}else{const a=await o.json();i("error",`Falha ao renomear: ${a.error}`),alert(`Erro ao renomear: ${a.error}`)}}catch(o){i("error",`Erro ao renomear: ${o.message}`)}},zt=async(t,s,o)=>{if(!n)return;const a=t.split("/").pop(),r=s?`${s}/${a}`:a;if(t!==r){if(o&&(r===t||r.startsWith(`${t}/`))){i("error","Não é possível mover um diretório para dentro dele mesmo.");return}try{const d=await fetch("/api/file/rename",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:n.project_path,oldPath:t,newPath:r})});if(d.ok){if(i("info",`${o?"Diretório":"Arquivo"} movido de ${t} para ${r}`),!o)P(c=>c.map(m=>m===t?r:m)),z(c=>{const m={...c},v=m[t];return delete m[t],m[r]=v,m}),u===t&&N(r);else{const c=`${t}/`;P(m=>m.map(v=>v.startsWith(c)?v.replace(t,r):v)),z(m=>{const v={};for(const[_,w]of Object.entries(m))_.startsWith(c)?v[_.replace(t,r)]=w:v[_]=w;return v}),u&&u.startsWith(c)&&N(m=>m.replace(t,r))}await O()}else{const c=await d.json();i("error",`Falha ao mover: ${c.error}`)}}catch(d){i("error",`Erro ao mover: ${d.message}`)}}},_s=async t=>{if(!n||!t)return;const s=`Tem certeza que deseja deletar o ${t.isDirectory?"diretório":"arquivo"} "${t.path}"?${t.isDirectory?" Todos os arquivos internos serão removidos!":""}`;if(window.confirm(s))try{const o=await fetch("/api/file/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:n.project_path,filePath:t.path})});if(o.ok){if(i("info",`${t.isDirectory?"Diretório":"Arquivo"} excluído: ${t.path}`),!t.isDirectory)P(a=>a.filter(r=>r!==t.path)),z(a=>{const r={...a};return delete r[t.path],r}),u===t.path&&N(a=>{const r=M.filter(d=>d!==t.path);if(r.length>0){const d=r[r.length-1];return setTimeout(()=>{S(D[d]||"")},0),d}return S(""),null});else{const a=`${t.path}/`;P(r=>r.filter(d=>!d.startsWith(a))),z(r=>{const d={};for(const[c,m]of Object.entries(r))c.startsWith(a)||(d[c]=m);return d}),u&&u.startsWith(a)&&N(r=>{const d=M.filter(c=>!c.startsWith(a));if(d.length>0){const c=d[d.length-1];return setTimeout(()=>{S(D[c]||"")},0),c}return S(""),null})}await O()}else{const a=await o.json();i("error",`Falha ao deletar: ${a.error}`),alert(`Erro ao deletar: ${a.error}`)}}catch(o){i("error",`Erro ao deletar: ${o.message}`)}},Ts=(t,s)=>{s&&(s.stopPropagation(),s.preventDefault()),u===t&&z(o=>({...o,[t]:T})),P(o=>{const a=o.filter(r=>r!==t);if(u===t)if(a.length>0){const r=a[a.length-1];N(r),S(D[r]||"")}else N(null),S("");return a})},Ge=async t=>{if(n){if(u&&z(s=>({...s,[u]:T})),P(s=>s.includes(t)?s:[...s,t]),N(t),D[t]!==void 0){S(D[t]);return}try{const s=await fetch(`/api/file/read?projectPath=${encodeURIComponent(n.project_path)}&filePath=${encodeURIComponent(t)}`);if(s.ok){const o=await s.json();S(o.content),z(a=>({...a,[t]:o.content}))}else i("error",`Erro ao ler arquivo: ${t}`)}catch(s){i("error",`Erro de leitura: ${s.message}`)}}},Ne=async()=>{if(!(!n||!u)){re(!0);try{(await fetch("/api/file/write",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:n.project_path,filePath:u,content:T})})).ok?(i("info",`Arquivo salvo: ${u}`),z(s=>({...s,[u]:T})),se(),qe()):i("error",`Erro ao salvar arquivo: ${u}`)}catch(t){i("error",`Erro de escrita: ${t.message}`)}finally{re(!1)}}};l.useEffect(()=>{Ve.current=Ne},[Ne]);const zs=async t=>{if(t.preventDefault(),!(!je||!te)){pe("");try{const s=await fetch("/api/opalacoder/create-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_name:je,project_path:te,description:ut,model:Ue,mode:gt,api_key:bt,api_base:Nt,model_params:Object.keys(vt).length?vt:void 0})});if(s.ok)i("info",`Projeto '${je}' registrado.`),ve(!1),ht(""),Je(""),ft(""),kt(""),St("http://localhost:11434/v1"),ke();else{const o=await s.json();pe(o.error||"Erro ao criar projeto."),i("error",`Erro ao criar projeto: ${o.error}`)}}catch(s){pe(s.message||"Erro ao criar projeto."),i("error",`Erro ao criar: ${s.message}`)}}},Es=async t=>{if(confirm(`Remover projeto '${t}'?`))try{(await fetch("/api/opalacoder/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_name:t})})).ok&&(i("info",`Projeto removido: ${t}`),n&&n.name===t&&j(null),ke())}catch(s){i("error",`Erro ao excluir: ${s.message}`)}},Ps=async(t,s)=>{t.stopPropagation();let o=s;try{const a=await fetch("/api/opalacoder/list-projects");if(a.ok){const{projects:r}=await a.json(),d=r.find(c=>c.name===s.name);d&&(o=d)}}catch{}A(""),g({name:o.name,project_name:o.project_name||o.name,project_path:o.project_path||"",model:o.model||"",alternative_model:o.alternative_model||"",mode:o.mode||"auto",description:o.description||"",model_params:o.model_params||{},api_key:o.api_key||"",api_base:o.api_base||""})},Os=async t=>{if(t.preventDefault(),!!x)try{const s=await fetch("/api/opalacoder/update-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_name:x.name,display_name:x.project_name,project_path:x.project_path,model:x.model,alternative_model:x.alternative_model,mode:x.mode,description:x.description,model_params:x.model_params,api_key:x.api_key,api_base:x.api_base})});if(s.ok){const o=await s.json();i("info",`Projeto '${o.project_name}' atualizado.`),g(null),await ke(),n&&n.name===o.name&&j(a=>({...a,...o}))}else{const o=await s.json();i("error",`Erro ao atualizar: ${o.error}`)}}catch(s){i("error",`Erro ao atualizar projeto: ${s.message}`)}},Et=async(t,s,o)=>{if(A(""),!t||!s){A("⚠️ Defina o caminho do projeto e o modelo antes de carregar.");return}try{const r=await(await fetch("/api/opalacoder/model-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:t,model:s})})).json();if(!r.found){A(r.message);return}o(r),A("✅ Configuração refinada carregada.")}catch(a){A(`⚠️ Erro ao carregar: ${a.message}`)}},Pt=async(t,s)=>{const o=s||"~";try{const r=await(await fetch("/api/fs/dirs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:o})})).json();H({target:t,current:r.current,dirs:r.dirs||[]})}catch{H({target:t,current:o,dirs:[]})}},Ms=async t=>{try{const o=await(await fetch("/api/fs/dirs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t})})).json();H(a=>({...a,current:o.current,dirs:o.dirs||[]}))}catch{}},Ds=()=>{R&&(R.target==="new"?Je(R.current):g(t=>({...t,project_path:R.current})),H(null))},i=(t,s)=>{Ye(o=>[...o,{type:t,message:s,timestamp:new Date().toLocaleTimeString()}])},Se=t=>{cs(t),q&&Ze(!1)},Rs=async()=>{try{(await fetch("/api/opalacoder/interrupt",{method:"POST"})).ok?i("info","Sinal de interrupção enviado ao agente."):i("error","Falha ao enviar sinal de interrupção.")}catch(t){i("error",`Erro ao interromper: ${t.message}`)}},Is=async t=>{if(t&&t.preventDefault(),!le.trim()||!n||W)return;const s=le;if(J(""),b(a=>[...a,{role:"user",content:s}]),ie(!0),V([]),i("info",`Iniciando: "${s}"`),s.trim().startsWith("/")){try{const r=await(await fetch("/api/opalacoder/slash-command",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:s.trim(),project_name:n.name,project_path:n.project_path})})).json();if(r.status==="confirm")We({id:r.id,prompt:r.prompt,options:r.options||["yes","no"],default:r.default||"yes",isSlashCommand:!0}),i("info",`🔔 Aguardando confirmação: ${r.prompt}`);else if(r.status==="done"){const d=(r.messages||[]).join(`
156
+ `)||"Comando executado.";b(c=>[...c,{role:"assistant",content:d}])}else b(d=>[...d,{role:"assistant",content:`🔴 Erro: ${r.error||"desconhecido"}`}])}catch(a){i("error",`Falha no comando: ${a.message}`),b(r=>[...r,{role:"assistant",content:`🔴 Falha: ${a.message}`}])}finally{ie(!1),O()}return}let o="";if(be.current)try{const a=be.current.getModel(),r=be.current.getSelection();a&&r&&(o=a.getValueInRange(r))}catch{}try{const a=await fetch("/api/opalacoder/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:"run",agent:"chat_orchestrator",prompt:s,project_name:n.name,project_path:n.project_path,model:n.model,current_file:u||"",editor_content:T||"",selected_text:o||""})});if(!a.body){i("error","ReadableStream não suportado pelo backend."),ie(!1);return}const r=a.body.getReader(),d=new TextDecoder;let c="";for(;;){const{done:m,value:v}=await r.read();if(m)break;c+=d.decode(v,{stream:!0});const _=c.split(`
157
+ `);c=_.pop();for(const w of _)if(w.trim())try{const I=JSON.parse(w);Ot(I)}catch{i("stdout",w)}}if(c.trim())try{const m=JSON.parse(c);Ot(m)}catch{i("stdout",c)}}catch(a){i("error",`Falha na execução: ${a.message}`),b(r=>[...r,{role:"assistant",content:`🔴 Falha na execução: ${a.message}`}])}finally{ie(!1),O(),qe()}},Ot=t=>{const{event:s,...o}=t;switch(s){case"server_ready":i("info","Agente pronto.");break;case"agent_started":i("info",`Agente ${o.agent} iniciado.`);break;case"thought":i("thought",o.content),Ee(a=>[...a,{timestamp:new Date().toLocaleTimeString(),type:"THINKING",content:o.content}]);break;case"reflection":i("thought",o.content),Ee(a=>[...a,{timestamp:new Date().toLocaleTimeString(),type:"REFLECTION",content:o.content}]);break;case"cancelled":i("warning",o.message||"Execução cancelada."),b(a=>[...a,{role:"assistant",content:`⚠️ Interrompido: ${o.message||"A execução do agente foi parada."}`}]);break;case"tool_call":i("tool_call",`Chamando: ${o.tool} (${JSON.stringify(o.arguments)})`);break;case"tool_result":i("tool_result",`Sucesso: ${o.tool}`);break;case"agent_response":i("info","Resposta recebida."),b(a=>{const r=a[a.length-1];return r&&r.role==="assistant"&&r.content===o.response?(i("info","Duplicate assistant message ignored."),a):[...a,{role:"assistant",content:o.response}]});break;case"agent_finished":i("info","Processamento concluído.");break;case"input_request":We({id:o.id,prompt:o.prompt,options:o.options||["yes","no"],default:o.default||"yes"}),i("info",`🔔 Aguardando confirmação: ${o.prompt}`);break;case"error":i("error",o.message),b(a=>[...a,{role:"assistant",content:`🔴 Erro do Agente: ${o.message}`}]);break;case"problem":i("error",`[Problema em ${o.tool}]: ${o.message}`),V(a=>[...a,{id:Math.random().toString(),tool:o.tool,message:o.message,severity:o.severity||"error",timestamp:new Date().toLocaleTimeString()}]);break;default:i("info",`Evento: ${s}`)}},Mt=async t=>{if(!ge)return;const{id:s,prompt:o,isSlashCommand:a}=ge;We(null),i("info",`✅ Confirmação: "${o}" → ${t}`);try{if(a){const d=await(await fetch("/api/opalacoder/slash-command/continue",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:s,value:t})})).json();if(d.status==="done"){const c=(d.messages||[]).join(`
158
+ `)||"Comando executado.";b(m=>[...m,{role:"assistant",content:c}])}}else await fetch("/api/opalacoder/input_response",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:s,value:t})})}catch(r){i("error",`Erro ao enviar confirmação: ${r.message}`)}},$s=t=>{if(!t)return"plaintext";const s=t.split(".").pop().toLowerCase();return{py:"python",js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",html:"html",css:"css",json:"json",md:"markdown",yml:"yaml",yaml:"yaml",sh:"shell"}[s]||"plaintext"};return e.jsxs("div",{className:"vscode-app",children:[e.jsxs("div",{className:"vscode-main",children:[e.jsxs("div",{className:"vscode-activitybar",children:[e.jsxs("div",{className:"vscode-activitybar-top",children:[e.jsx("button",{onClick:()=>et("explorer"),className:`vscode-activitybar-btn ${U==="explorer"?"active":""}`,title:"Explorer",children:e.jsx(Qt,{size:22})}),e.jsxs("button",{onClick:()=>et("git"),className:`vscode-activitybar-btn ${U==="git"?"active":""}`,title:"Source Control",style:{position:"relative"},children:[e.jsx(na,{size:22}),X.length>0&&e.jsx("span",{style:{position:"absolute",top:"4px",right:"4px",background:"#007acc",color:"#ffffff",borderRadius:"50%",width:"16px",height:"16px",fontSize:"9px",fontWeight:"bold",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 0 4px rgba(0,0,0,0.5)"},children:X.length})]}),e.jsx("button",{onClick:()=>Qe(!ce),className:`vscode-activitybar-btn ${ce?"active":""}`,title:"Opala Chat",children:e.jsx(es,{size:22})})]}),e.jsx("div",{children:e.jsx("button",{onClick:()=>xe(!0),className:"vscode-activitybar-btn",title:"Settings",children:e.jsx(we,{size:20})})})]}),e.jsx("aside",{className:"vscode-sidebar",style:{width:`${xt}px`},children:U==="explorer"?e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"vscode-sidebar-header",children:[e.jsx("span",{className:"vscode-sidebar-title",children:"EXPLORER: PROJECTS"}),e.jsx("button",{onClick:()=>{ve(!0),A(""),jt({})},style:{background:"transparent",border:"none",cursor:"pointer",color:"#c5c5c5"},title:"Novo Projeto...",children:e.jsx(ts,{size:14})})]}),e.jsxs("div",{className:"vscode-sidebar-section",children:[e.jsx("div",{className:"vscode-sidebar-section-title",children:"Selecione o Projeto"}),e.jsx("div",{className:"overflow-y-auto",style:{maxHeight:"140px"},children:h.map(t=>{const s=n&&n.name===t.name;return e.jsxs("div",{onClick:()=>Tt(t),className:`vscode-project-item ${s?"active":""}`,children:[e.jsxs("div",{className:"truncate flex-1",children:[e.jsx("div",{style:{fontSize:"13px",fontWeight:"500"},className:"truncate",children:t.project_name||t.name}),e.jsx("div",{style:{fontSize:"10px",color:"#808080"},className:"truncate",children:t.project_path})]}),e.jsx("button",{onClick:o=>Ps(o,t),style:{background:"transparent",border:"none",cursor:"pointer",color:"#a0a0a0",padding:"2px 4px"},title:"Configurar projeto",children:e.jsx(we,{size:12})}),e.jsx("button",{onClick:o=>{o.stopPropagation(),Es(t.name)},style:{background:"transparent",border:"none",cursor:"pointer",color:"#a0a0a0",padding:"2px 4px"},title:"Remover projeto",children:e.jsx(as,{size:12})})]},t.name)})})]}),e.jsxs("div",{className:"vscode-sidebar-content",onContextMenu:ks,onDragOver:t=>{t.preventDefault(),Z&&me("__root__")},onDragLeave:t=>{t.preventDefault(),De==="__root__"&&me(null)},onDrop:t=>{t.preventDefault(),me(null),Z&&zt(Z.path,"",Z.isDirectory)},style:De==="__root__"?{border:"2px dashed #007acc",backgroundColor:"rgba(0, 122, 204, 0.05)"}:{},children:[e.jsxs("div",{className:"vscode-sidebar-section-title",style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx("span",{children:"Workspace Files"}),n&&e.jsx("button",{onClick:t=>{t.stopPropagation(),O()},title:"Atualizar arquivos",style:{background:"transparent",border:"none",color:"#808080",cursor:"pointer",display:"flex",alignItems:"center",padding:"2px",borderRadius:"3px",transition:"color 0.2s, background-color 0.2s"},onMouseOver:t=>{t.currentTarget.style.color="#ffffff",t.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.1)"},onMouseOut:t=>{t.currentTarget.style.color="#808080",t.currentTarget.style.backgroundColor="transparent"},children:e.jsx(ss,{size:12})})]}),p.length===0?e.jsx("div",{style:{fontSize:"12px",color:"#808080",padding:"0 4px",fontStyle:"italic"},children:"Selecione um projeto para explorar."}):e.jsx("div",{children:p.map(t=>e.jsx(is,{node:t,selectedFile:u,handleFileSelect:Ge,handleNodeContextMenu:Ns,draggedNode:Z,setDraggedNode:hs,dragOverPath:De,setDragOverPath:me,handleMoveNode:zt},t.path))})]})]}):e.jsxs("div",{className:"vscode-sidebar-content",style:{padding:"12px",display:"flex",flexDirection:"column",height:"100%",gap:"16px"},children:[e.jsx("div",{className:"vscode-sidebar-title",children:"SOURCE CONTROL (GIT)"}),n?X.length===0?e.jsx("div",{style:{fontSize:"12px",color:"#808080",fontStyle:"italic"},children:"Sem alterações locais."}):e.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",style:{gap:"16px"},children:[e.jsxs("form",{onSubmit:bs,className:"flex flex-col",style:{gap:"8px"},children:[e.jsx("input",{type:"text",placeholder:"Mensagem do Commit...",value:Y,onChange:t=>it(t.target.value),required:!0,style:{width:"100%",fontSize:"12px"}}),e.jsx("button",{type:"submit",className:"vscode-button",disabled:Me||!Y.trim(),style:{width:"100%"},children:Me?"Commit...":"Commit"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto",style:{borderTop:"1px solid var(--vscode-border)",paddingTop:"12px"},children:[e.jsxs("div",{className:"vscode-sidebar-section-title",style:{marginBottom:"8px",padding:0},children:["Modificações (",X.length,")"]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:X.map((t,s)=>{let o="#cccccc",a=t.status;return t.status==="M"?(o="#e2b52b",a="M"):t.status==="??"||t.status==="A"?(o="#73c991",a="U"):t.status==="D"&&(o="#f48771",a="D"),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"12px",padding:"4px 6px",borderRadius:"3px",background:"rgba(255,255,255,0.02)"},children:[e.jsx("span",{className:"truncate",title:t.path,style:{color:"#cccccc",flex:1,marginRight:"8px"},children:t.path}),e.jsx("span",{style:{fontWeight:"bold",color:o,fontSize:"11px",minWidth:"12px",textAlign:"center"},children:a})]},s)})})]})]}):e.jsx("div",{style:{fontSize:"12px",color:"#808080",fontStyle:"italic"},children:"Selecione um projeto para ver as alterações Git."})]})}),e.jsx("div",{className:"vscode-resizer-horizontal",onMouseDown:t=>Be(t,"left")}),e.jsxs("main",{className:"vscode-editor-panel",children:[u?e.jsxs("div",{className:"vscode-editor-panel",children:[e.jsxs("div",{className:"vscode-tabs",children:[e.jsx("div",{className:"flex h-full overflow-x-auto",style:{gap:"2px"},children:M.map(t=>{const s=t===u;return e.jsxs("div",{onClick:()=>Ge(t),className:`vscode-tab ${s?"active":""}`,style:{cursor:"pointer",userSelect:"none"},children:[e.jsx("span",{style:{color:s?"#ffffff":"#a0a0a0"},children:t.split("/").pop()}),e.jsx("button",{onClick:o=>Ts(t,o),className:"vscode-tab-close-btn",children:e.jsx(F,{size:12})})]},t)})}),e.jsx("div",{children:e.jsxs("button",{onClick:Ne,disabled:oe,className:"vscode-button",children:[oe?e.jsx(ss,{size:12,className:"animate-spin"}):e.jsx(Ce,{size:12}),e.jsx("span",{children:oe?"Salvando...":"Salvar (Ctrl+S)"})]})})]}),e.jsx("div",{className:"vscode-editor-container",children:e.jsx(As,{height:"100%",path:u,language:$s(u),theme:G==="light"?"light":"vs-dark",value:T,onChange:t=>S(t),onMount:js,options:{minimap:{enabled:!0},fontSize:ot,lineNumbers:"on",tabSize:rt,wordWrap:nt,automaticLayout:!0}})})]}):e.jsx("div",{className:"vscode-editor-container",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:e.jsxs("div",{style:{textAlign:"center"},children:[e.jsx(Qt,{size:64,style:{color:"#3c3c3c",marginBottom:"16px"}}),e.jsx("h3",{style:{fontSize:"14px",fontWeight:"bold",color:"#b0b0b0",marginBottom:"4px"},children:"Nenhum Arquivo Aberto"}),e.jsx("p",{style:{fontSize:"12px",color:"#808080"},children:"Abra um arquivo na barra lateral esquerda."})]})}),!q&&e.jsx("div",{className:"vscode-resizer-vertical",onMouseDown:t=>Be(t,"bottom")}),e.jsxs("div",{className:"vscode-bottom-panel",style:{height:q?"30px":`${Ae}px`},children:[e.jsxs("div",{className:"vscode-bottom-tabs",children:[e.jsxs("div",{className:"vscode-bottom-tab-list",children:[e.jsx("span",{className:`vscode-bottom-tab ${C==="output"?"active":""}`,onClick:()=>Se("output"),children:"OUTPUT (OPALACODER)"}),e.jsxs("span",{className:`vscode-bottom-tab ${C==="problems"?"active":""}`,onClick:()=>Se("problems"),children:["PROBLEMS ",de.length>0&&e.jsx("span",{style:{marginLeft:"4px",background:"#f48771",color:"#1e1e1e",borderRadius:"10px",padding:"0 6px",fontSize:"10px",fontWeight:"bold"},children:de.length})]}),e.jsx("span",{className:`vscode-bottom-tab ${C==="thinking"?"active":""}`,onClick:()=>Se("thinking"),children:"THINKING"}),e.jsx("span",{className:`vscode-bottom-tab ${C==="terminal"?"active":""}`,onClick:()=>Se("terminal"),children:"TERMINAL"})]}),e.jsxs("div",{className:"flex items-center",style:{gap:"8px"},children:[(C==="output"||C==="problems"||C==="thinking")&&e.jsxs("button",{onClick:C==="output"?()=>Ye([]):C==="problems"?()=>V([]):()=>Ee([]),className:"vscode-bottom-panel-clear-btn",title:C==="output"?"Limpar Output":C==="problems"?"Limpar Problemas":"Limpar Pensamentos",children:[e.jsx(pa,{size:12}),e.jsx("span",{children:"Clear"})]}),e.jsx("button",{onClick:()=>Ze(!q),style:{background:"transparent",border:"none",cursor:"pointer",color:"#a0a0a0"},children:q?e.jsx(ia,{size:12}):e.jsx(ca,{size:12})})]})]}),!q&&e.jsxs("div",{style:{height:"calc(100% - 30px)",width:"100%"},children:[C==="output"&&e.jsxs("div",{className:"vscode-logs",style:{height:"100%"},children:[ze.length===0?e.jsx("div",{style:{color:"#808080",fontStyle:"italic"},children:"Nenhum log gerado. Envie uma instrução no chat para iniciar..."}):ze.map((t,s)=>{let o="text-[#cccccc]",a="SYSTEM";return t.type==="error"?(o="text-[#f48771] font-semibold",a="ERROR"):t.type==="info"?(o="text-[#75beff]",a="INFO"):t.type==="thought"?(o="text-[#da70d6] italic",a="THOUGHT"):t.type==="tool_call"?(o="text-[#d7ba7d]",a="TOOL"):t.type==="tool_result"&&(o="text-[#89d4a5]",a="RESULT"),e.jsxs("div",{className:o,style:{display:"flex",alignItems:"flex-start",gap:"6px",marginBottom:"3px"},children:[e.jsxs("span",{style:{color:"#5a5a5a"},children:["[",t.timestamp,"]"]}),e.jsxs("span",{style:{fontWeight:"bold"},children:["[",a,"]"]}),e.jsx("span",{style:{whiteSpace:"pre-wrap",flex:1},children:t.message})]},s)}),e.jsx("div",{ref:wt})]}),C==="problems"&&e.jsx("div",{className:"vscode-problems-list",style:{padding:"8px",overflowY:"auto",height:"100%",color:"#cccccc",fontFamily:"Consolas, monospace",fontSize:"12px"},children:de.length===0?e.jsx("div",{style:{color:"#808080",fontStyle:"italic",padding:"8px"},children:"Nenhum problema detectado."}):de.map(t=>e.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"flex-start",borderBottom:"1px solid #2d2d2d",padding:"6px 0"},children:[e.jsx(ta,{size:14,className:"text-[#f48771]",style:{flexShrink:0,marginTop:"2px"}}),e.jsxs("div",{children:[e.jsxs("div",{style:{fontWeight:"bold",color:"#f48771",marginBottom:"2px"},children:["[",t.timestamp,"] Erro em ",t.tool,":"]}),e.jsx("pre",{style:{whiteSpace:"pre-wrap",margin:0,color:"#e0e0e0",fontSize:"12px",fontFamily:"inherit"},children:t.message})]})]},t.id))}),C==="thinking"&&e.jsx("div",{className:"vscode-logs",style:{height:"100%"},children:tt.length===0?e.jsx("div",{style:{color:"#808080",fontStyle:"italic"},children:"Nenhum pensamento gerado ainda. Execute uma instrução para ver o raciocínio do agente..."}):tt.map((t,s)=>{const o=t.type==="REFLECTION";return e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"6px",marginBottom:"4px"},children:[e.jsxs("span",{style:{color:"#5a5a5a",flexShrink:0},children:["[",t.timestamp,"]"]}),e.jsxs("span",{style:{fontWeight:"bold",flexShrink:0,color:o?"#4ec9b0":"#da70d6"},children:["[",t.type||"THINKING","]"]}),e.jsx("span",{style:{whiteSpace:"pre-wrap",flex:1,fontFamily:"Consolas, monospace",color:o?"#4ec9b0":"#da70d6"},children:t.content})]},s)})}),e.jsx("div",{style:{display:C==="terminal"?"block":"none",height:"100%",background:"#1e1e1e",overflow:"hidden"},children:n?e.jsx("div",{ref:Q,style:{width:"100%",height:"100%",padding:"4px"}}):e.jsx("div",{style:{color:"#808080",fontStyle:"italic",padding:"16px"},children:"Defina um projeto/workspace para habilitar o terminal."})})]})]})]}),ce&&e.jsx("div",{className:"vscode-resizer-horizontal",onMouseDown:t=>Be(t,"right")}),ce&&e.jsxs("aside",{className:"vscode-chat",style:{width:`${mt}px`},children:[e.jsxs("div",{className:"vscode-chat-header",children:[e.jsxs("span",{className:"vscode-sidebar-title",style:{display:"flex",alignItems:"center",gap:"6px"},children:[e.jsx(es,{size:12,style:{color:"#007acc"}}),e.jsx("span",{children:"OPALA CHAT"})]}),e.jsx("button",{onClick:()=>Qe(!1),style:{background:"transparent",border:"none",cursor:"pointer",color:"#a0a0a0"},children:e.jsx(F,{size:14})})]}),e.jsxs("div",{className:"vscode-chat-toolbar",children:[e.jsxs("button",{onClick:()=>J("/skills"),className:"vscode-chat-tool-btn",children:[e.jsx(aa,{size:11}),e.jsx("span",{children:"/skills"})]}),e.jsxs("button",{onClick:()=>J("/help"),className:"vscode-chat-tool-btn",children:[e.jsx(sa,{size:11}),e.jsx("span",{children:"/help"})]}),e.jsxs("button",{onClick:()=>J("/commit"),className:"vscode-chat-tool-btn",children:[e.jsx(Ce,{size:11}),e.jsx("span",{children:"/commit"})]})]}),e.jsxs("div",{className:"vscode-chat-history",children:[ne.map((t,s)=>{const o=t.role==="user";return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[e.jsx("span",{className:"vscode-chat-msg-header",style:{color:o?"#75beff":"#da70d6"},children:o?"VOCÊ":"OPALACODER"}),e.jsx("div",{className:"vscode-chat-msg-content",children:ma(t.content)})]},s)}),W&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[e.jsx("span",{className:"vscode-chat-msg-header",style:{color:"#da70d6"},children:"OPALACODER"}),e.jsx("div",{className:"vscode-chat-msg-content",children:e.jsxs("div",{className:"thinking-indicator",children:[e.jsx("span",{className:"dot"}),e.jsx("span",{className:"dot"}),e.jsx("span",{className:"dot"})]})})]}),e.jsx("div",{ref:Ct})]}),e.jsx("form",{onSubmit:Is,className:"vscode-chat-form",children:e.jsxs("div",{className:"vscode-chat-input-row",children:[e.jsx("input",{type:"text",value:le,onChange:t=>J(t.target.value),disabled:!n||W,placeholder:n?W?"Pensando...":"Pergunte ao OpalaCoder...":"Defina um projeto...",style:{flex:1}}),W?e.jsx("button",{type:"button",onClick:Rs,className:"vscode-button",style:{padding:"6px",backgroundColor:"#f48771",color:"#1e1e1e"},title:"Interromper agente",children:e.jsx(F,{size:14})}):e.jsx("button",{type:"submit",disabled:!n||!le.trim(),className:"vscode-button",style:{padding:"6px"},children:e.jsx(Zs,{size:14})})]})})]})]}),e.jsxs("footer",{className:"vscode-statusbar",children:[e.jsxs("div",{className:"flex items-center",style:{gap:"16px"},children:[e.jsxs("div",{className:"flex items-center",style:{gap:"6px"},children:[e.jsx(la,{size:11}),e.jsx("span",{style:{fontWeight:"bold"},children:n?`Workspace: ${n.project_name||n.name}`:"Sem Workspace"})]}),W&&e.jsxs("span",{className:"flex items-center",style:{gap:"6px"},children:[e.jsx("span",{style:{width:"6px",height:"6px",backgroundColor:"#ffffff",borderRadius:"50%",display:"inline-block"}}),e.jsx("span",{style:{fontWeight:"bold"},children:"OpalaCoder Ativo..."})]})]}),e.jsxs("div",{className:"flex items-center",style:{gap:"12px"},children:[e.jsx("span",{children:"UTF-8"}),e.jsx("span",{children:"LF"}),e.jsx("span",{children:"JSON IPC Bridge"})]})]}),us&&e.jsx("div",{className:"vscode-modal-overlay",children:e.jsxs("div",{className:"vscode-modal",style:{maxWidth:"440px",width:"90%"},children:[e.jsxs("div",{className:"vscode-sidebar-header",style:{padding:"10px 16px"},children:[e.jsx("span",{className:"vscode-sidebar-title",style:{color:"#ffffff"},children:"MÓDULOS OPCIONAIS REQUERIDOS"}),e.jsx("button",{onClick:()=>$e(!1),style:{background:"transparent",border:"none",cursor:"pointer",color:"#a0a0a0"},children:e.jsx(F,{size:14})})]}),e.jsxs("div",{className:"overflow-y-auto flex-1",style:{padding:"16px",color:"#cccccc",display:"flex",flexDirection:"column",gap:"12px"},children:[e.jsxs("p",{style:{fontSize:"13px",lineHeight:"1.5"},children:["Os módulos opcionais para embeddings offline (",e.jsx("code",{children:"sentence-transformers"}),") não foram encontrados no ambiente."]}),e.jsx("p",{style:{fontSize:"12px",color:"#888888",lineHeight:"1.4"},children:"Recomendamos a instalação para habilitar o processamento local de vetores e a indexação de código sem depender de APIs externas."}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"8px",borderTop:"1px solid #3c3c3c",paddingTop:"12px"},children:[e.jsx("button",{onClick:()=>$e(!1),className:"vscode-button",style:{backgroundColor:"#3c3c3c",color:"#ffffff"},children:"Ignorar"}),e.jsx("button",{onClick:()=>{$e(!1),xe(!0),Oe("preferences"),_t()},className:"vscode-button",children:"Instalar Agora"})]})]})]})}),He&&e.jsx("div",{className:"vscode-modal-overlay",children:e.jsxs("div",{className:"vscode-modal",children:[e.jsxs("div",{className:"vscode-sidebar-header",style:{padding:"10px 16px"},children:[e.jsx("span",{className:"vscode-sidebar-title",style:{color:"#ffffff"},children:"REGISTRAR NOVO PROJETO"}),e.jsx("button",{onClick:()=>ve(!1),style:{background:"transparent",border:"none",cursor:"pointer",color:"#a0a0a0"},children:e.jsx(F,{size:14})})]}),e.jsxs("form",{onSubmit:zs,className:"flex flex-col overflow-y-auto flex-1",style:{padding:"16px",gap:"12px"},children:[e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Nome do Projeto *"}),e.jsx("input",{type:"text",value:je,onChange:t=>ht(t.target.value),placeholder:"Ex: Meu Servidor Web",required:!0})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Caminho Absoluto *"}),e.jsxs("div",{style:{display:"flex",gap:"6px"},children:[e.jsx("input",{type:"text",value:te,onChange:t=>Je(t.target.value),placeholder:"Ex: /home/gilzamir/projetos/meu-app",required:!0,style:{flex:1}}),e.jsx("button",{type:"button",className:"vscode-button",style:{padding:"4px 8px",whiteSpace:"nowrap"},onClick:()=>Pt("new",te||"~"),children:e.jsx(Ke,{size:14})})]})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Descrição"}),e.jsx("textarea",{value:ut,onChange:t=>ft(t.target.value),placeholder:"Descritivo do projeto...",rows:2,style:{resize:"none"}})]}),e.jsxs("div",{style:{display:"flex",gap:"12px"},children:[e.jsxs("div",{className:"flex flex-col flex-1",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Chave de API (Opcional)"}),e.jsx("input",{type:"password",value:bt,onChange:t=>kt(t.target.value),placeholder:"Ex: sk-..."})]}),e.jsxs("div",{className:"flex flex-col flex-1",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"URL Base da API (Opcional)"}),e.jsx("input",{type:"text",value:Nt,onChange:t=>St(t.target.value),placeholder:"Ex: http://localhost:11434/v1"})]})]}),e.jsxs("div",{style:{fontSize:"11px",color:"#808080",marginTop:"-6px",lineHeight:"1.4"},children:["Dica: Para usar o Ollama local com ",e.jsx("strong",{children:"ollama/ministral-3:14b"}),", informe a URL Base acima (ex: ",e.jsx("code",{children:"http://localhost:11434/v1"}),") e digite/selecione o modelo correspondente."]}),e.jsxs("div",{style:{display:"flex",gap:"12px"},children:[e.jsxs("div",{className:"flex flex-col flex-1",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Modelo de IA"}),e.jsx("input",{type:"text",list:"default-models",value:Ue,onChange:t=>yt(t.target.value),placeholder:"Selecione ou digite o modelo (ex: ollama/ministral-3:14b)"}),e.jsxs("datalist",{id:"default-models",children:[e.jsx("option",{value:"gemini/gemini-2.5-flash"}),e.jsx("option",{value:"gemini/gemini-2.5-pro"}),e.jsx("option",{value:"openai/gpt-4o"}),e.jsx("option",{value:"ollama/ministral-3:14b"})]})]}),e.jsxs("div",{className:"flex flex-col flex-1",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Modo de Execução"}),e.jsxs("select",{value:gt,onChange:t=>vs(t.target.value),children:[e.jsx("option",{value:"auto",children:"Auto (Completo)"}),e.jsx("option",{value:"plan",children:"Plan (Planejar)"}),e.jsx("option",{value:"edit",children:"Edit (Editar)"})]})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[e.jsx("button",{type:"button",className:"vscode-button",style:{background:"#3c3c3c",fontSize:"12px"},onClick:()=>Et(te,Ue,t=>{t.model_params&&jt(t.model_params),t.model&&yt(t.model)}),children:"Load Refined Config"}),B&&e.jsx("span",{style:{fontSize:"11px",color:B.startsWith("✅")?"#4ec9b0":"#f48771"},children:B})]}),at&&e.jsxs("div",{style:{color:"#f48771",fontSize:"11px",marginTop:"4px",whiteSpace:"pre-wrap"},children:["⚠️ ",at]}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",paddingTop:"12px",borderTop:"1px solid #3c3c3c",marginTop:"4px"},children:[e.jsx("button",{type:"button",onClick:()=>ve(!1),className:"vscode-button",style:{backgroundColor:"#3c3c3c",color:"#ffffff"},children:"Cancelar"}),e.jsx("button",{type:"submit",className:"vscode-button",children:"Registrar"})]})]})]})}),Le&&e.jsxs("div",{className:"vscode-context-menu",style:{top:`${Le.y}px`,left:`${Le.x}px`},children:[e.jsxs("div",{className:"vscode-context-menu-item",onClick:()=>{const t=E?E.isDirectory?E.path:E.path.split("/").slice(0,-1).join("/"):"";Ss(t)},children:[e.jsx(ts,{size:13,style:{color:"#007acc"}}),e.jsx("span",{children:"New File..."})]}),e.jsxs("div",{className:"vscode-context-menu-item",onClick:()=>{const t=E?E.isDirectory?E.path:E.path.split("/").slice(0,-1).join("/"):"";Cs(t)},children:[e.jsx(ra,{size:13,style:{color:"#007acc"}}),e.jsx("span",{children:"New Dir..."})]}),E&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"vscode-context-menu-item",onClick:()=>ws(E),children:[e.jsx(da,{size:13,style:{color:"#e2b52b"}}),e.jsx("span",{children:"Rename..."})]}),e.jsxs("div",{className:"vscode-context-menu-item",onClick:()=>_s(E),children:[e.jsx(as,{size:13,style:{color:"#f48771"}}),e.jsx("span",{children:"Delete"})]})]})]}),x&&e.jsx("div",{className:"vscode-modal-overlay",children:e.jsxs("div",{className:"vscode-modal",style:{maxWidth:"520px",width:"92%"},children:[e.jsxs("div",{className:"vscode-sidebar-header",style:{padding:"10px 16px"},children:[e.jsxs("span",{className:"vscode-sidebar-title",style:{color:"#ffffff",display:"flex",alignItems:"center",gap:"8px"},children:[e.jsx(we,{size:14,style:{color:"#007acc"}}),"CONFIGURAÇÕES DO PROJETO"]}),e.jsx("button",{onClick:()=>g(null),style:{background:"transparent",border:"none",cursor:"pointer",color:"#a0a0a0"},children:e.jsx(F,{size:14})})]}),e.jsxs("form",{onSubmit:Os,className:"flex flex-col overflow-y-auto flex-1",style:{padding:"16px",gap:"14px"},children:[e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"ID Interno (somente leitura)"}),e.jsx("input",{type:"text",value:x.name,readOnly:!0,style:{opacity:.5,cursor:"not-allowed"}})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Nome de Exibição *"}),e.jsx("input",{type:"text",value:x.project_name,onChange:t=>g(s=>({...s,project_name:t.target.value})),required:!0,placeholder:"Nome do projeto"})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Caminho Absoluto"}),e.jsxs("div",{style:{display:"flex",gap:"6px"},children:[e.jsx("input",{type:"text",value:x.project_path,onChange:t=>g(s=>({...s,project_path:t.target.value})),placeholder:"/caminho/absoluto/do/projeto",style:{flex:1}}),e.jsx("button",{type:"button",className:"vscode-button",style:{padding:"4px 8px",whiteSpace:"nowrap"},onClick:()=>Pt("edit",x.project_path||"~"),children:e.jsx(Ke,{size:14})})]})]}),e.jsxs("div",{style:{display:"flex",gap:"12px"},children:[e.jsxs("div",{className:"flex flex-col flex-1",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Modelo Principal"}),e.jsx("input",{type:"text",list:"edit-models",value:x.model,onChange:t=>g(s=>({...s,model:t.target.value})),placeholder:"gemini/gemini-2.5-flash"}),e.jsxs("datalist",{id:"edit-models",children:[e.jsx("option",{value:"gemini/gemini-2.5-flash"}),e.jsx("option",{value:"gemini/gemini-2.5-pro"}),e.jsx("option",{value:"openai/gpt-4o"}),e.jsx("option",{value:"ollama/ministral-3:14b"})]})]}),e.jsxs("div",{className:"flex flex-col flex-1",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Modo"}),e.jsxs("select",{value:x.mode,onChange:t=>g(s=>({...s,mode:t.target.value})),children:[e.jsx("option",{value:"auto",children:"Auto (Completo)"}),e.jsx("option",{value:"plan",children:"Plan (Planejar)"}),e.jsx("option",{value:"edit",children:"Edit (Editar)"})]})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[e.jsx("button",{type:"button",className:"vscode-button",style:{background:"#3c3c3c",fontSize:"12px"},onClick:()=>Et(x.project_path,x.model,t=>{g(s=>({...s,model_params:t.model_params||s.model_params,model:t.model||s.model}))}),children:"Load Refined Config"}),B&&e.jsx("span",{style:{fontSize:"11px",color:B.startsWith("✅")?"#4ec9b0":"#f48771"},children:B})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Modelo Alternativo"}),e.jsx("input",{type:"text",list:"edit-alt-models",value:x.alternative_model,onChange:t=>g(s=>({...s,alternative_model:t.target.value})),placeholder:"(usa o padrão global se vazio)"}),e.jsxs("datalist",{id:"edit-alt-models",children:[e.jsx("option",{value:"gemini/gemini-2.5-flash"}),e.jsx("option",{value:"openai/gpt-4o-mini"}),e.jsx("option",{value:"ollama/gemma3:4b"})]})]}),e.jsxs("div",{style:{display:"flex",gap:"12px"},children:[e.jsxs("div",{className:"flex flex-col flex-1",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Chave de API (Opcional)"}),e.jsx("input",{type:"password",value:x.api_key,onChange:t=>g(s=>({...s,api_key:t.target.value})),placeholder:"Ex: sk-..."})]}),e.jsxs("div",{className:"flex flex-col flex-1",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"URL Base da API (Opcional)"}),e.jsx("input",{type:"text",value:x.api_base,onChange:t=>g(s=>({...s,api_base:t.target.value})),placeholder:"Ex: http://localhost:11434/v1"})]})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Descrição"}),e.jsx("textarea",{value:x.description,onChange:t=>g(s=>({...s,description:t.target.value})),placeholder:"Descrição opcional do projeto...",rows:2,style:{resize:"none"}})]}),e.jsxs("div",{className:"flex flex-col",style:{marginTop:"4px"},children:[e.jsx("button",{type:"button",onClick:()=>st(!Pe),style:{background:"transparent",border:"none",color:"#007acc",cursor:"pointer",display:"flex",alignItems:"center",gap:"4px",padding:"4px 0",fontSize:"12px",fontWeight:"bold",textAlign:"left",width:"fit-content"},children:e.jsxs("span",{children:[Pe?"▼":"▶"," Parâmetros do Modelo (Avançado)"]})}),Pe&&e.jsxs("div",{style:{border:"1px solid #3c3c3c",borderRadius:"4px",padding:"12px",marginTop:"8px",backgroundColor:"#252526",display:"flex",flexDirection:"column",gap:"16px"},children:[e.jsxs("div",{children:[e.jsx("div",{style:{color:"#9cdcfe",fontSize:"11px",fontWeight:"bold",marginBottom:"8px",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Parâmetros LiteLLM (model_kwargs)"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"10px"},children:[e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Temperature"}),e.jsx("input",{type:"number",step:"0.1",min:"0",max:"2",placeholder:"padrão: 0.7",value:((Dt=x.model_params)==null?void 0:Dt.temperature)??"",onChange:t=>{const s=t.target.value===""?void 0:parseFloat(t.target.value);g(o=>{const a={...o.model_params};return s===void 0?delete a.temperature:a.temperature=s,{...o,model_params:a}})}})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Max Tokens"}),e.jsx("input",{type:"number",min:"1",placeholder:"padrão: 4096",value:((Rt=x.model_params)==null?void 0:Rt.max_tokens)??"",onChange:t=>{const s=t.target.value===""?void 0:parseInt(t.target.value,10);g(o=>{const a={...o.model_params};return s===void 0?delete a.max_tokens:a.max_tokens=s,{...o,model_params:a}})}})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Context Window (num_ctx)"}),e.jsx("input",{type:"number",min:"1",placeholder:"padrão: 8192",value:((It=x.model_params)==null?void 0:It.num_ctx)??"",onChange:t=>{const s=t.target.value===""?void 0:parseInt(t.target.value,10);g(o=>{const a={...o.model_params};return s===void 0?delete a.num_ctx:a.num_ctx=s,{...o,model_params:a}})}})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Seed"}),e.jsx("input",{type:"number",min:"0",placeholder:"padrão: nenhum",value:(($t=x.model_params)==null?void 0:$t.seed)??"",onChange:t=>{const s=t.target.value===""?void 0:parseInt(t.target.value,10);g(o=>{const a={...o.model_params};return s===void 0?delete a.seed:a.seed=s,{...o,model_params:a}})}})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Top P"}),e.jsx("input",{type:"number",step:"0.05",min:"0",max:"1",placeholder:"padrão: 1.0",value:((At=x.model_params)==null?void 0:At.top_p)??"",onChange:t=>{const s=t.target.value===""?void 0:parseFloat(t.target.value);g(o=>{const a={...o.model_params};return s===void 0?delete a.top_p:a.top_p=s,{...o,model_params:a}})}})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Frequency Penalty"}),e.jsx("input",{type:"number",step:"0.1",min:"-2",max:"2",placeholder:"padrão: 0.0",value:((Lt=x.model_params)==null?void 0:Lt.frequency_penalty)??"",onChange:t=>{const s=t.target.value===""?void 0:parseFloat(t.target.value);g(o=>{const a={...o.model_params};return s===void 0?delete a.frequency_penalty:a.frequency_penalty=s,{...o,model_params:a}})}})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Presence Penalty"}),e.jsx("input",{type:"number",step:"0.1",min:"-2",max:"2",placeholder:"padrão: 0.0",value:((Ft=x.model_params)==null?void 0:Ft.presence_penalty)??"",onChange:t=>{const s=t.target.value===""?void 0:parseFloat(t.target.value);g(o=>{const a={...o.model_params};return s===void 0?delete a.presence_penalty:a.presence_penalty=s,{...o,model_params:a}})}})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Reasoning Effort"}),e.jsxs("select",{value:((Wt=x.model_params)==null?void 0:Wt.reasoning_effort)??"",onChange:t=>{const s=t.target.value||void 0;g(o=>{const a={...o.model_params};return s===void 0?delete a.reasoning_effort:a.reasoning_effort=s,{...o,model_params:a}})},style:{backgroundColor:"#3c3c3c",color:"#cccccc",border:"1px solid #555",borderRadius:"3px",padding:"4px 6px",fontSize:"12px"},children:[e.jsx("option",{value:"",children:"— padrão —"}),e.jsx("option",{value:"none",children:"none"}),e.jsx("option",{value:"low",children:"low"}),e.jsx("option",{value:"medium",children:"medium"}),e.jsx("option",{value:"high",children:"high"}),e.jsx("option",{value:"xhigh",children:"xhigh"})]})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px",justifyContent:"flex-end"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Thinking (think)"}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer",userSelect:"none"},children:[e.jsx("input",{type:"checkbox",checked:!!((qt=x.model_params)!=null&&qt.think),onChange:t=>g(s=>({...s,model_params:{...s.model_params,think:t.target.checked}}))}),e.jsx("span",{style:{fontSize:"12px",color:"#cccccc"},children:"Habilitado"})]})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px",justifyContent:"flex-end"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Stream"}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer",userSelect:"none"},children:[e.jsx("input",{type:"checkbox",checked:!!((Bt=x.model_params)!=null&&Bt.stream),onChange:t=>g(s=>({...s,model_params:{...s.model_params,stream:t.target.checked}}))}),e.jsx("span",{style:{fontSize:"12px",color:"#cccccc"},children:"Habilitado"})]})]})]})]}),e.jsxs("div",{children:[e.jsx("div",{style:{color:"#9cdcfe",fontSize:"11px",fontWeight:"bold",marginBottom:"8px",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Parâmetros do Agente"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"10px"},children:[e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Max Heartbeats (MemGPT)"}),e.jsx("input",{type:"number",min:"1",placeholder:"padrão: 20 (memgpt)",value:((Ht=x.model_params)==null?void 0:Ht.max_heartbeats)??"",onChange:t=>{const s=t.target.value===""?void 0:parseInt(t.target.value,10);g(o=>{const a={...o.model_params};return s===void 0?delete a.max_heartbeats:a.max_heartbeats=s,{...o,model_params:a}})}})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Max Context Tokens (MemGPT)"}),e.jsx("input",{type:"number",min:"1",placeholder:"padrão: igual a num_ctx",value:((Jt=x.model_params)==null?void 0:Jt.max_context_tokens)??"",onChange:t=>{const s=t.target.value===""?void 0:parseInt(t.target.value,10);g(o=>{const a={...o.model_params};return s===void 0?delete a.max_context_tokens:a.max_context_tokens=s,{...o,model_params:a}})}})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Eviction Threshold"}),e.jsx("input",{type:"number",step:"0.05",min:"0",max:"1",placeholder:"padrão: 1.0",value:((Ut=x.model_params)==null?void 0:Ut.eviction_threshold)??"",onChange:t=>{const s=t.target.value===""?void 0:parseFloat(t.target.value);g(o=>{const a={...o.model_params};return s===void 0?delete a.eviction_threshold:a.eviction_threshold=s,{...o,model_params:a}})}})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Memory Pressure Threshold"}),e.jsx("input",{type:"number",step:"0.05",min:"0",max:"1",placeholder:"padrão: 0.7",value:((Vt=x.model_params)==null?void 0:Vt.memory_pressure_threshold)??"",onChange:t=>{const s=t.target.value===""?void 0:parseFloat(t.target.value);g(o=>{const a={...o.model_params};return s===void 0?delete a.memory_pressure_threshold:a.memory_pressure_threshold=s,{...o,model_params:a}})}})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Max Iterations (Worker)"}),e.jsx("input",{type:"number",min:"1",placeholder:"padrão: sem limite",value:((Gt=x.model_params)==null?void 0:Gt.max_iterations)??"",onChange:t=>{const s=t.target.value===""?void 0:parseInt(t.target.value,10);g(o=>{const a={...o.model_params};return s===void 0?delete a.max_iterations:a.max_iterations=s,{...o,model_params:a}})}})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Max Tool Calls (Worker)"}),e.jsx("input",{type:"number",min:"1",placeholder:"padrão: 10",value:((Kt=x.model_params)==null?void 0:Kt.max_tool_calls)??"",onChange:t=>{const s=t.target.value===""?void 0:parseInt(t.target.value,10);g(o=>{const a={...o.model_params};return s===void 0?delete a.max_tool_calls:a.max_tool_calls=s,{...o,model_params:a}})}})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Response Mode (MemGPT)"}),e.jsxs("select",{value:((Xt=x.model_params)==null?void 0:Xt.response_mode)??"all",onChange:t=>g(s=>({...s,model_params:{...s.model_params,response_mode:t.target.value}})),style:{backgroundColor:"#3c3c3c",color:"#cccccc",border:"1px solid #555",borderRadius:"3px",padding:"4px 6px",fontSize:"12px"},children:[e.jsx("option",{value:"all",children:"all — concatena todas as mensagens"}),e.jsx("option",{value:"last",children:"last — só a última mensagem"})]})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"4px",justifyContent:"flex-end"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Debug"}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer",userSelect:"none"},children:[e.jsx("input",{type:"checkbox",checked:!!((Yt=x.model_params)!=null&&Yt.debug),onChange:t=>g(s=>({...s,model_params:{...s.model_params,debug:t.target.checked}}))}),e.jsx("span",{style:{fontSize:"12px",color:"#cccccc"},children:"Habilitado"})]})]})]})]})]})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",paddingTop:"12px",borderTop:"1px solid #3c3c3c",marginTop:"4px"},children:[e.jsx("button",{type:"button",onClick:()=>g(null),className:"vscode-button",style:{backgroundColor:"#3c3c3c",color:"#ffffff"},children:"Cancelar"}),e.jsxs("button",{type:"submit",className:"vscode-button",children:[e.jsx(Ce,{size:12}),"Salvar Alterações"]})]})]})]})}),R&&e.jsx("div",{style:{position:"fixed",inset:0,zIndex:1100,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.6)",backdropFilter:"blur(3px)"},onClick:()=>H(null),children:e.jsxs("div",{style:{background:"#1e1e1e",border:"1px solid #3c3c3c",borderRadius:"6px",padding:"16px",width:"480px",maxHeight:"60vh",display:"flex",flexDirection:"column",gap:"10px"},onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{style:{color:"#cccccc",fontSize:"13px",fontWeight:"bold",display:"flex",alignItems:"center",gap:"6px"},children:[e.jsx(Ke,{size:15,style:{color:"#e8a838"}}),"Selecionar Diretório"]}),e.jsx("div",{style:{background:"#252526",border:"1px solid #3c3c3c",borderRadius:"3px",padding:"5px 8px",fontSize:"12px",color:"#9cdcfe",fontFamily:"monospace",wordBreak:"break-all"},children:R.current}),e.jsxs("div",{style:{overflowY:"auto",flex:1,border:"1px solid #3c3c3c",borderRadius:"3px",background:"#252526"},children:[R.dirs.length===0&&e.jsx("div",{style:{color:"#808080",fontSize:"12px",padding:"12px",textAlign:"center"},children:"Nenhum subdiretório"}),R.dirs.map(t=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",padding:"5px 8px",cursor:"pointer",fontSize:"12px",color:"#cccccc",borderBottom:"1px solid #2d2d2d"},onMouseEnter:s=>s.currentTarget.style.background="#2a2d2e",onMouseLeave:s=>s.currentTarget.style.background="transparent",onClick:()=>Ms(t.path),children:[e.jsx(ls,{size:13,style:{color:"#e8a838",flexShrink:0}}),e.jsx("span",{style:{fontFamily:"monospace"},children:t.name})]},t.path))]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px"},children:[e.jsx("button",{type:"button",className:"vscode-button",style:{background:"#3c3c3c",fontSize:"12px"},onClick:()=>H(null),children:"Cancelar"}),e.jsxs("button",{type:"button",className:"vscode-button",style:{fontSize:"12px"},onClick:Ds,children:[e.jsx(Ce,{size:12})," Selecionar esta pasta"]})]})]})}),ge&&e.jsx("div",{style:{position:"fixed",inset:0,zIndex:1e3,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.55)",backdropFilter:"blur(4px)",animation:"fadeIn 0.15s ease"},children:e.jsxs("div",{style:{background:"linear-gradient(135deg, #1e1e2e 0%, #252537 100%)",border:"1px solid #3c3c5c",borderRadius:"12px",padding:"28px 32px",maxWidth:"420px",width:"90%",boxShadow:"0 24px 64px rgba(0,0,0,0.6)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"16px"},children:[e.jsx("span",{style:{fontSize:"22px"},children:"🔔"}),e.jsx("span",{style:{fontSize:"12px",fontWeight:700,color:"#a0a0c0",letterSpacing:"0.1em",textTransform:"uppercase"},children:"Confirmação Necessária"})]}),e.jsx("p",{style:{fontSize:"14px",color:"#e0e0f0",lineHeight:1.6,marginBottom:"24px",margin:"0 0 24px 0"},children:ge.prompt}),e.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end"},children:[e.jsx("button",{id:"confirm-no-btn",onClick:()=>Mt("no"),style:{padding:"8px 20px",borderRadius:"8px",border:"1px solid #4c4c6c",background:"transparent",color:"#a0a0c0",cursor:"pointer",fontSize:"13px",fontWeight:600,transition:"all 0.15s"},onMouseEnter:t=>{t.target.style.background="#2c2c3c",t.target.style.color="#e0e0f0"},onMouseLeave:t=>{t.target.style.background="transparent",t.target.style.color="#a0a0c0"},children:"Não"}),e.jsx("button",{id:"confirm-yes-btn",onClick:()=>Mt("yes"),style:{padding:"8px 24px",borderRadius:"8px",border:"none",background:"linear-gradient(135deg, #007acc, #0062a3)",color:"#fff",cursor:"pointer",fontSize:"13px",fontWeight:700,boxShadow:"0 4px 16px rgba(0,122,204,0.35)",transition:"all 0.15s"},onMouseEnter:t=>{t.target.style.background="linear-gradient(135deg, #0090f0, #007acc)"},onMouseLeave:t=>{t.target.style.background="linear-gradient(135deg, #007acc, #0062a3)"},children:"Sim"})]})]})}),ds&&e.jsx("div",{className:"vscode-modal-overlay",children:e.jsxs("div",{className:"vscode-modal",style:{maxWidth:"440px",width:"90%"},children:[e.jsxs("div",{className:"vscode-sidebar-header",style:{padding:"10px 16px"},children:[e.jsxs("span",{className:"vscode-sidebar-title",style:{color:"#ffffff",display:"flex",alignItems:"center",gap:"8px"},children:[e.jsx(we,{size:14,style:{color:"#007acc"}}),"CONFIGURAÇÕES DA IDE"]}),e.jsx("button",{onClick:()=>xe(!1),style:{background:"transparent",border:"none",cursor:"pointer",color:"#a0a0a0"},children:e.jsx(F,{size:14})})]}),e.jsxs("div",{style:{display:"flex",borderBottom:"1px solid var(--vscode-border)",backgroundColor:"var(--vscode-tab-inactive-bg)"},children:[e.jsx("button",{onClick:()=>Oe("preferences"),style:{flex:1,padding:"8px",background:L==="preferences"?"var(--vscode-tab-active-bg)":"transparent",border:"none",borderBottom:L==="preferences"?"2px solid var(--vscode-active-border)":"none",color:L==="preferences"?"#ffffff":"#808080",fontWeight:"bold",fontSize:"11px",textTransform:"uppercase",cursor:"pointer"},children:"Preferências"}),e.jsx("button",{onClick:()=>Oe("about"),style:{flex:1,padding:"8px",background:L==="about"?"var(--vscode-tab-active-bg)":"transparent",border:"none",borderBottom:L==="about"?"2px solid var(--vscode-active-border)":"none",color:L==="about"?"#ffffff":"#808080",fontWeight:"bold",fontSize:"11px",textTransform:"uppercase",cursor:"pointer"},children:"Sobre"})]}),e.jsx("div",{className:"flex flex-col overflow-y-auto flex-1",style:{padding:"16px",gap:"14px"},children:L==="preferences"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col",style:{gap:"6px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Tema de Cor"}),e.jsxs("select",{value:G,onChange:t=>ps(t.target.value),style:{width:"100%"},children:[e.jsx("option",{value:"dark",children:"Escuro (Dark Mode)"}),e.jsx("option",{value:"light",children:"Claro (Light Mode)"})]})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"6px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Tamanho da Fonte do Editor"}),e.jsx("input",{type:"number",min:"10",max:"30",value:ot,onChange:t=>{const s=Number(t.target.value);K(s),$("editorFontSize",s)},style:{width:"100%"}})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"6px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Tamanho do Tab (Espaços)"}),e.jsxs("select",{value:rt,onChange:t=>{const s=Number(t.target.value);xs(s),$("editorTabSize",s)},style:{width:"100%"},children:[e.jsx("option",{value:2,children:"2 Espaços"}),e.jsx("option",{value:4,children:"4 Espaços"}),e.jsx("option",{value:8,children:"8 Espaços"})]})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"6px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Quebra Automática de Linha (Word Wrap)"}),e.jsxs("select",{value:nt,onChange:t=>{ms(t.target.value),$("editorWordWrap",t.target.value)},style:{width:"100%"},children:[e.jsx("option",{value:"on",children:"Ativado (On)"}),e.jsx("option",{value:"off",children:"Desativado (Off)"})]})]}),e.jsxs("div",{className:"flex flex-col",style:{gap:"6px",borderTop:"1px solid var(--vscode-border)",paddingTop:"12px",marginTop:"6px"},children:[e.jsx("label",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Dependências Opcionais"}),e.jsx("span",{style:{fontSize:"11px",color:"#888888",lineHeight:"1.4"},children:"Instale recursos extras (Local Embeddings, PyTorch, CUDA, etc.) que otimizam o processamento off-line."}),e.jsx("button",{type:"button",className:"vscode-button",disabled:Re,onClick:_t,style:{width:"100%",marginTop:"6px"},children:Re?"Instalando...":"Instalar Recursos Opcionais"}),he&&e.jsxs("span",{style:{fontSize:"11px",fontWeight:"bold",color:he.includes("Erro")||he.includes("Falha")?"#f48771":"#73c991",marginTop:"4px"},children:["Status: ",he]}),pt&&e.jsx("textarea",{readOnly:!0,value:pt,style:{width:"100%",height:"80px",marginTop:"8px",fontSize:"10px",fontFamily:"monospace",background:"#151515",color:"#89d4a5",border:"1px solid var(--vscode-border)",padding:"6px",resize:"none"}})]})]}):e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"14px",color:"#cccccc"},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[e.jsx("span",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Versão"}),e.jsx("span",{style:{fontSize:"13px",fontWeight:"bold",color:"#ffffff"},children:"0.1.26 alfa"})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[e.jsx("span",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Autor"}),e.jsx("span",{style:{fontSize:"13px",color:"#ffffff"},children:"dev@opala.com"})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[e.jsx("span",{className:"vscode-sidebar-section-title",style:{padding:0},children:"Licença"}),e.jsx("span",{style:{fontSize:"13px",color:"#ffffff"},children:"MIT"})]})]})}),e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",padding:"12px 16px",gap:"8px",borderTop:"1px solid var(--vscode-border)",backgroundColor:"var(--vscode-sidebar-bg)"},children:e.jsx("button",{onClick:()=>xe(!1),className:"vscode-button",children:"Fechar"})})]})})]})}function is({node:h,selectedFile:f,handleFileSelect:n,handleNodeContextMenu:j,draggedNode:p,setDraggedNode:y,dragOverPath:u,setDragOverPath:N,handleMoveNode:T}){const S=h.isDirectory,[M,P]=l.useState(!1),D=b=>{b.stopPropagation(),y({path:h.path,isDirectory:h.isDirectory}),b.dataTransfer.setData("text/plain",h.path),b.dataTransfer.effectAllowed="move"},z=b=>{b.preventDefault(),b.stopPropagation(),S&&p&&p.path!==h.path&&(N(h.path),b.dataTransfer.dropEffect="move")},E=b=>{b.preventDefault(),b.stopPropagation(),u===h.path&&N(null)},ae=b=>{b.preventDefault(),b.stopPropagation(),N(null),S&&p&&p.path!==h.path&&T(p.path,h.path,p.isDirectory)},re=u===h.path?{backgroundColor:"#2d2d2d",border:"1px dashed #007acc"}:{};if(S)return e.jsxs("div",{className:"select-none",draggable:"true",onDragStart:D,onDragOver:z,onDragLeave:E,onDrop:ae,children:[e.jsxs("div",{onClick:()=>P(!M),className:"vscode-tree-node",style:re,onContextMenu:b=>j(b,h),children:[M?e.jsx(Qs,{size:14}):e.jsx(ea,{size:14}),e.jsx(ls,{size:14,className:"text-white",style:{color:"#e8a838"}}),e.jsx("span",{className:"truncate",children:h.name})]}),M&&e.jsx("div",{style:{paddingLeft:"12px",borderLeft:"1px solid #3c3c3c",marginLeft:"14px"},children:h.children.map(b=>e.jsx(is,{node:b,selectedFile:f,handleFileSelect:n,handleNodeContextMenu:j,draggedNode:p,setDraggedNode:y,dragOverPath:u,setDragOverPath:N,handleMoveNode:T},b.path))})]});const ne=f===h.path;return e.jsxs("div",{onClick:()=>n(h.path),className:`vscode-tree-node ${ne?"active":""}`,draggable:"true",onDragStart:D,onContextMenu:b=>j(b,h),children:[e.jsx(oa,{size:13,style:{color:"#a0a0a0"}}),e.jsx("span",{className:"truncate",children:h.name})]})}function ma(h){return h?h.split(`
159
+ `).map((n,j)=>{const p=n.trim();if(p.startsWith("### ")){const y=p.replace("### ","");return e.jsx("h4",{style:{margin:"14px 0 6px 0",fontWeight:"bold",color:"#ffffff",fontSize:"13px"},children:y},j)}if(p.startsWith("🔹 ")||p.startsWith("⭐ ")){const y=p.substring(0,2),N=p.substring(2).split("—");if(N.length>=2){const T=N[0].replace(/\*\*`|`\*\*/g,"").trim(),S=N.slice(1).join("—").trim();return e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"6px",margin:"4px 0",paddingLeft:"4px"},children:[e.jsx("span",{style:{fontSize:"12px",flexShrink:0},children:y}),e.jsxs("span",{style:{fontSize:"13px",lineHeight:"1.4"},children:[e.jsx("code",{style:{background:"#2d2d2d",padding:"2px 4px",borderRadius:"3px",color:"#f8f8f2",fontFamily:"monospace",fontSize:"11px",marginRight:"6px"},children:T}),e.jsx("span",{style:{color:"#cccccc"},children:S})]})]},j)}}if(p.startsWith("_(")&&p.endsWith(")_")){const y=p.substring(2,p.length-2);return e.jsx("p",{style:{margin:"8px 0",fontStyle:"italic",color:"#8a8a8a",fontSize:"11px"},children:y},j)}return e.jsx("div",{style:{minHeight:"1.2em",color:"#cccccc",fontSize:"13px",margin:"2px 0"},children:n},j)}):null}Xe.createRoot(document.getElementById("root")).render(e.jsx(Ls.StrictMode,{children:e.jsx(xa,{})}));
@@ -9,7 +9,7 @@
9
9
  <link rel="preconnect" href="https://fonts.googleapis.com">
10
10
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
11
11
  <link href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
12
- <script type="module" crossorigin src="/assets/index-D2mJbeF2.js"></script>
12
+ <script type="module" crossorigin src="/assets/index-DYKstQJF.js"></script>
13
13
  <link rel="modulepreload" crossorigin href="/assets/vendor-monaco-BkbU5OES.js">
14
14
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-B2vUwPEE.js">
15
15
  <link rel="modulepreload" crossorigin href="/assets/vendor-xterm-3VOAfa_q.js">
@@ -972,6 +972,10 @@ def start_gui_server(host="127.0.0.1", port=3000):
972
972
  if not os.path.exists(icon_path):
973
973
  icon_path = None
974
974
 
975
+ import sys
976
+ if icon_path and sys.platform == "win32" and not icon_path.lower().endswith(".ico"):
977
+ icon_path = None
978
+
975
979
  # webview.start() blocks the main thread until the window is closed.
976
980
  webview.start(debug=False, icon=icon_path)
977
981
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "opalacoder"
7
- version = "0.2.2"
7
+ version = "0.2.3.1"
8
8
  description = "Autonomous coding agent with interactive planning and modular execution"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -1,39 +0,0 @@
1
- # BUGS TO FIX DETECTED ON LAST PUBLIC RELEASE (READ THE LAST SUBTOPIC)
2
-
3
- ## FROM CURRENT = 0.1.17 TO NEXT = 0.1.18
4
-
5
- 1. Terminal dont work, no obvious message in back terminal, but on IDE terminal we get the message "[OpalaCoder] Conexão com o terminal perdida. Reconectando...".
6
-
7
- 2. A janela de criação de projeto somente deveria permitir confirmar criação de projeto se o diretório especificado for válido.
8
-
9
- 3. New feature: install optional modules must be on IDE startup.
10
-
11
- ## FROM CURRENT = 0.1.18 TO NEXT = 0.1.19
12
-
13
- 1. Projeto não mostra nenhum erro quando o backend de modelos falha, por exemplo, tenta-se rodar um modelo que o ollama não tem instalado.
14
-
15
- 2. Ao criar um novo arquivo, ficou congelado em carregando.
16
-
17
- 3. A aba de Problems nunca mostra nada errado, mesmo tendo.
18
-
19
- 4. Adicionar opção de renomear arquivo/diretório selecionado
20
-
21
- 5. Adicionar opção de limpar output e problems.
22
-
23
- 6. Abrir mais de uma aba no editor de arquivo (vários arquivos abertos ao mesmo tempo)
24
-
25
- 7. Verificar se o agente de comunicação com o backend é um LLMAgentBlock e, se for, como está as configurações de limite de chamada de ferramentas e de reflexão e outras.
26
-
27
- ## FROM CURRENT = 0.1.19 TO NEXT = 0.1.20
28
-
29
- 1. Implementar a visualização do pensamento do agente em uma aba thinking do painel inferior Implementar em uma aba separada thinking
30
- 2. Aumentar tamanho da fonte quando digitar ctrl+ no editor, ou diminuir quando digitar ctrl-.
31
- 3. Disponibilizar uma skill da ide que permite ao chat visualizar o conteúdo atual do editor e retornar o trecho selecionado.
32
- 4. Colocar botão de interroper o agente.
33
- 5. Descobrir porque o agente granite4:latest demora a responder.
34
- 6. O erro ao criar um projeto em um diretório existente ou proibido deveria ser mostrado como mensagem na janela de criação de projeto e não no terminal (colocar mensagem correta, de acordo com exceção).
35
- 6.1 Se diretório já existe e der erro de permissão, mostrar erro de permissão, se diretório não existe, criar diretório com nome do projeto.
36
- 7. Colocar hint de completação de servidor ollama (já trazer preenchido com o valor que geralmente é).
37
- 8. Criar uma janela de configuração de modelo com parâmetros mais usados que são aceitos no agenticblocks. E criar um comando set-model-param param-name value que permite qualquer parâmetro geralmente permitido pro litellm/ollama. Cuidado para implementar controle de verdade (valores adequados de parâmetro, por example).
38
-
39
- 9. Permitir que mensagens no chat não podem ser copiadas.