zerochat 7.3.0__py3-none-any.whl

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 (130) hide show
  1. zerochat-7.3.0.dist-info/METADATA +70 -0
  2. zerochat-7.3.0.dist-info/RECORD +130 -0
  3. zerochat-7.3.0.dist-info/WHEEL +5 -0
  4. zerochat-7.3.0.dist-info/entry_points.txt +2 -0
  5. zerochat-7.3.0.dist-info/licenses/LICENSE +34 -0
  6. zerochat-7.3.0.dist-info/top_level.txt +2 -0
  7. zerochat.py +2004 -0
  8. zerochat_runtime/__init__.py +1 -0
  9. zerochat_runtime/assets/css/base.css +199 -0
  10. zerochat_runtime/assets/css/components/composer.css +1258 -0
  11. zerochat_runtime/assets/css/components/debug.css +777 -0
  12. zerochat_runtime/assets/css/components/header.css +97 -0
  13. zerochat_runtime/assets/css/components/icons.css +39 -0
  14. zerochat_runtime/assets/css/components/markdown.css +685 -0
  15. zerochat_runtime/assets/css/components/messages.css +473 -0
  16. zerochat_runtime/assets/css/components/modals.css +1319 -0
  17. zerochat_runtime/assets/css/components/sidebar.css +622 -0
  18. zerochat_runtime/assets/css/components/tools.css +1223 -0
  19. zerochat_runtime/assets/css/layout.css +171 -0
  20. zerochat_runtime/assets/css/print.css +120 -0
  21. zerochat_runtime/assets/css/styles.css +18 -0
  22. zerochat_runtime/assets/css/theme-overrides.css +555 -0
  23. zerochat_runtime/assets/css/tokens.css +165 -0
  24. zerochat_runtime/assets/help/architecture.html +247 -0
  25. zerochat_runtime/assets/help/composer.html +134 -0
  26. zerochat_runtime/assets/help/conversations.html +105 -0
  27. zerochat_runtime/assets/help/debug.html +108 -0
  28. zerochat_runtime/assets/help/en/architecture.html +247 -0
  29. zerochat_runtime/assets/help/en/composer.html +134 -0
  30. zerochat_runtime/assets/help/en/conversations.html +104 -0
  31. zerochat_runtime/assets/help/en/debug.html +105 -0
  32. zerochat_runtime/assets/help/en/gemini-free.html +39 -0
  33. zerochat_runtime/assets/help/en/index.html +191 -0
  34. zerochat_runtime/assets/help/en/learning.html +71 -0
  35. zerochat_runtime/assets/help/en/mcp.html +143 -0
  36. zerochat_runtime/assets/help/en/openrouter-free.html +39 -0
  37. zerochat_runtime/assets/help/en/profiles.html +173 -0
  38. zerochat_runtime/assets/help/en/rag.html +130 -0
  39. zerochat_runtime/assets/help/en/reasoning-telemetry.html +108 -0
  40. zerochat_runtime/assets/help/en/tools-agent.html +133 -0
  41. zerochat_runtime/assets/help/en/webllm.html +355 -0
  42. zerochat_runtime/assets/help/gemini-free.html +39 -0
  43. zerochat_runtime/assets/help/help.css +604 -0
  44. zerochat_runtime/assets/help/help.js +51 -0
  45. zerochat_runtime/assets/help/index.html +194 -0
  46. zerochat_runtime/assets/help/learning.html +71 -0
  47. zerochat_runtime/assets/help/mcp.html +143 -0
  48. zerochat_runtime/assets/help/openrouter-free.html +39 -0
  49. zerochat_runtime/assets/help/profiles.html +174 -0
  50. zerochat_runtime/assets/help/rag.html +130 -0
  51. zerochat_runtime/assets/help/reasoning-telemetry.html +111 -0
  52. zerochat_runtime/assets/help/tools-agent.html +133 -0
  53. zerochat_runtime/assets/help/webllm.html +359 -0
  54. zerochat_runtime/assets/js/agent-core.js +1553 -0
  55. zerochat_runtime/assets/js/api.js +844 -0
  56. zerochat_runtime/assets/js/app.js +2558 -0
  57. zerochat_runtime/assets/js/attachments.js +220 -0
  58. zerochat_runtime/assets/js/charts.js +338 -0
  59. zerochat_runtime/assets/js/chat-engine.js +566 -0
  60. zerochat_runtime/assets/js/config-store.js +207 -0
  61. zerochat_runtime/assets/js/context-manager.js +584 -0
  62. zerochat_runtime/assets/js/conversation-service.js +484 -0
  63. zerochat_runtime/assets/js/cookies.js +688 -0
  64. zerochat_runtime/assets/js/data-reset-service.js +136 -0
  65. zerochat_runtime/assets/js/debug.js +508 -0
  66. zerochat_runtime/assets/js/defaults.js +16 -0
  67. zerochat_runtime/assets/js/export.js +179 -0
  68. zerochat_runtime/assets/js/file-parser.js +2088 -0
  69. zerochat_runtime/assets/js/generation-controller.js +417 -0
  70. zerochat_runtime/assets/js/i18n.js +1483 -0
  71. zerochat_runtime/assets/js/icons.js +156 -0
  72. zerochat_runtime/assets/js/ingestionEngine.js +436 -0
  73. zerochat_runtime/assets/js/markdown.js +588 -0
  74. zerochat_runtime/assets/js/mcp.js +1271 -0
  75. zerochat_runtime/assets/js/message-turns.js +62 -0
  76. zerochat_runtime/assets/js/profile-backup.js +118 -0
  77. zerochat_runtime/assets/js/profile-export-bundle.js +481 -0
  78. zerochat_runtime/assets/js/profile-repository.js +213 -0
  79. zerochat_runtime/assets/js/providers-webllm.js +486 -0
  80. zerochat_runtime/assets/js/providers.js +1560 -0
  81. zerochat_runtime/assets/js/rag-index.js +295 -0
  82. zerochat_runtime/assets/js/rag-service.js +530 -0
  83. zerochat_runtime/assets/js/rag-ui.js +997 -0
  84. zerochat_runtime/assets/js/ragStorage.js +676 -0
  85. zerochat_runtime/assets/js/sandbox.js +449 -0
  86. zerochat_runtime/assets/js/state.js +704 -0
  87. zerochat_runtime/assets/js/storage-db.js +144 -0
  88. zerochat_runtime/assets/js/tool-cards.js +330 -0
  89. zerochat_runtime/assets/js/tool-security.js +653 -0
  90. zerochat_runtime/assets/js/tools/README.md +50 -0
  91. zerochat_runtime/assets/js/tools/builtin/agent-checkpoint.tool.js +212 -0
  92. zerochat_runtime/assets/js/tools/builtin/download-pdf.tool.js +111 -0
  93. zerochat_runtime/assets/js/tools/builtin/execute-javascript.tool.js +219 -0
  94. zerochat_runtime/assets/js/tools/builtin/fetch-web-page.tool.js +112 -0
  95. zerochat_runtime/assets/js/tools/builtin/list-documents.tool.js +117 -0
  96. zerochat_runtime/assets/js/tools/builtin/read-knowledge-chunk.tool.js +129 -0
  97. zerochat_runtime/assets/js/tools/builtin/read-knowledge-image.tool.js +95 -0
  98. zerochat_runtime/assets/js/tools/builtin/render-chart.tool.js +90 -0
  99. zerochat_runtime/assets/js/tools/builtin/search-knowledge-base.tool.js +124 -0
  100. zerochat_runtime/assets/js/tools/builtin/search-web.tool.js +125 -0
  101. zerochat_runtime/assets/js/tools/tool-manifest.js +53 -0
  102. zerochat_runtime/assets/js/tools/tool-runtime.js +77 -0
  103. zerochat_runtime/assets/js/ui-composer.js +319 -0
  104. zerochat_runtime/assets/js/ui-conversation.js +655 -0
  105. zerochat_runtime/assets/js/ui-dialogs.js +132 -0
  106. zerochat_runtime/assets/js/ui-generation-status.js +119 -0
  107. zerochat_runtime/assets/js/ui-inspector.js +804 -0
  108. zerochat_runtime/assets/js/ui-mcp.js +604 -0
  109. zerochat_runtime/assets/js/ui-profiles.js +824 -0
  110. zerochat_runtime/assets/js/ui-reasoning.js +146 -0
  111. zerochat_runtime/assets/js/ui-settings.js +825 -0
  112. zerochat_runtime/assets/js/ui-shell.js +215 -0
  113. zerochat_runtime/assets/js/ui-sidebar.js +429 -0
  114. zerochat_runtime/assets/js/ui-telemetry.js +404 -0
  115. zerochat_runtime/assets/js/ui-transfer.js +262 -0
  116. zerochat_runtime/assets/js/utils.js +216 -0
  117. zerochat_runtime/assets/js/vendor/orama.browser.js +11 -0
  118. zerochat_runtime/assets/js/web-browser.js +569 -0
  119. zerochat_runtime/assets/js/web-search.js +519 -0
  120. zerochat_runtime/assets/manifest.webmanifest +20 -0
  121. zerochat_runtime/assets/services/dummy_mcp/dummy_mcp_server.py +47 -0
  122. zerochat_runtime/assets/services/dummy_mcp/service.json +22 -0
  123. zerochat_runtime/assets/services/lsp/installer.json +9 -0
  124. zerochat_runtime/assets/services/lsp/service.json +22 -0
  125. zerochat_runtime/assets/services/memory/installer.json +9 -0
  126. zerochat_runtime/assets/services/memory/service.json +24 -0
  127. zerochat_runtime/assets/services/playwright/installer.json +10 -0
  128. zerochat_runtime/assets/services/playwright/service.json +39 -0
  129. zerochat_runtime/assets/sw.js +164 -0
  130. zerochat_runtime/assets/zerochat.html +671 -0
@@ -0,0 +1,671 @@
1
+ <!DOCTYPE html>
2
+ <!--
3
+ ZeroChat — Cliente Web Universal de Chat, Agente IA Autónomo y RAG Local
4
+ Desarrollo experimental 100% asistido por IA (programación sin tocar una sola línea de código manual)
5
+ fruto de la colaboración entre Codex y Antigravity, incorporando la librería Orama como vendor local.
6
+ -->
7
+ <html lang="es" data-theme="dark">
8
+ <head>
9
+ <meta charset="UTF-8">
10
+ <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: https://esm.run https://cdn.jsdelivr.net; worker-src 'self' blob: https://esm.run https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https: rag-image:; connect-src http: https: ws: wss: data: blob:; font-src 'self' data:; object-src 'none'; base-uri 'self';">
11
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, viewport-fit=cover, interactive-widget=resizes-content">
12
+ <meta name="theme-color" content="#0d1117">
13
+ <meta name="description" content="ZeroChat - Cliente web universal, agente IA autónomo y RAG local en un solo archivo con cero instalación">
14
+ <title>ZeroChat v7.3.0</title>
15
+ <link rel="manifest" href="manifest.webmanifest">
16
+ <!-- Carga concurrente paralela de hojas de estilo (elimina la cascada bloqueante de @import en móvil) -->
17
+ <link rel="stylesheet" href="css/tokens.css">
18
+ <link rel="stylesheet" href="css/base.css">
19
+ <link rel="stylesheet" href="css/layout.css">
20
+ <link rel="stylesheet" href="css/components/icons.css">
21
+ <link rel="stylesheet" href="css/components/header.css">
22
+ <link rel="stylesheet" href="css/components/sidebar.css">
23
+ <link rel="stylesheet" href="css/components/messages.css">
24
+ <link rel="stylesheet" href="css/components/markdown.css">
25
+ <link rel="stylesheet" href="css/components/composer.css">
26
+ <link rel="stylesheet" href="css/components/modals.css">
27
+ <link rel="stylesheet" href="css/components/tools.css">
28
+ <link rel="stylesheet" href="css/components/debug.css">
29
+ <link rel="stylesheet" href="css/theme-overrides.css">
30
+ <link rel="stylesheet" href="css/print.css" media="print">
31
+ </head>
32
+ <body>
33
+ <!-- Catálogo de Símbolos SVG Monocromáticos (ZeroChat Icons Sprite) -->
34
+ <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
35
+ <defs>
36
+ <symbol id="icon-square-pen" viewBox="0 0 24 24"><path d="M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z"></path></symbol>
37
+ <symbol id="icon-external-link" viewBox="0 0 24 24"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></symbol>
38
+ <symbol id="icon-settings" viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></symbol>
39
+ <symbol id="icon-close" viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></symbol>
40
+ <symbol id="icon-search" viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></symbol>
41
+ <symbol id="icon-upload" viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="17 8 12 3 7 8"></polyline><line x1="12" y1="3" x2="12" y2="15"></line></symbol>
42
+ <symbol id="icon-trash" viewBox="0 0 24 24"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path></symbol>
43
+ <symbol id="icon-panel-left" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="9" y1="3" x2="9" y2="21"></line></symbol>
44
+ <symbol id="icon-menu" viewBox="0 0 24 24"><line x1="4" y1="6" x2="20" y2="6"></line><line x1="4" y1="12" x2="20" y2="12"></line><line x1="4" y1="18" x2="20" y2="18"></line></symbol>
45
+ <symbol id="icon-user-plus" viewBox="0 0 24 24"><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><line x1="19" y1="8" x2="19" y2="14"></line><line x1="16" y1="11" x2="22" y2="11"></line></symbol>
46
+ <symbol id="icon-zap" viewBox="0 0 24 24"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"></polygon></symbol>
47
+ <symbol id="icon-layers" viewBox="0 0 24 24"><polygon points="12 2 2 7 12 12 22 7 12 2"></polygon><polyline points="2 17 12 22 22 17"></polyline><polyline points="2 12 12 17 22 12"></polyline></symbol>
48
+ <symbol id="icon-panel-right" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="15" y1="3" x2="15" y2="21"></line></symbol>
49
+ <symbol id="icon-terminal" viewBox="0 0 24 24"><polyline points="4 17 10 11 4 5"></polyline><line x1="12" y1="19" x2="20" y2="19"></line></symbol>
50
+ <symbol id="icon-paperclip" viewBox="0 0 24 24"><path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"></path></symbol>
51
+ <symbol id="icon-brain" viewBox="0 0 24 24"><path d="M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 4.44-2.04zm5 0a2.5 2.5 0 0 0-2.5 2.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-4.44-2.04z"></path></symbol>
52
+ <symbol id="icon-help-circle" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></symbol>
53
+ <symbol id="icon-stop" viewBox="0 0 24 24"><rect x="6" y="6" width="12" height="12" rx="2"></rect></symbol>
54
+ <symbol id="icon-send" viewBox="0 0 24 24"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></symbol>
55
+ <symbol id="icon-copy" viewBox="0 0 24 24"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></symbol>
56
+ <symbol id="icon-arrow-left" viewBox="0 0 24 24"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></symbol>
57
+ <symbol id="icon-chevron-right" viewBox="0 0 24 24"><polyline points="9 18 15 12 9 6"></polyline></symbol>
58
+ <symbol id="icon-shield" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path></symbol>
59
+ <symbol id="icon-sliders" viewBox="0 0 24 24"><line x1="4" y1="21" x2="4" y2="14"></line><line x1="4" y1="10" x2="4" y2="3"></line><line x1="12" y1="21" x2="12" y2="12"></line><line x1="12" y1="8" x2="12" y2="3"></line><line x1="20" y1="21" x2="20" y2="16"></line><line x1="20" y1="12" x2="20" y2="3"></line><line x1="1" y1="14" x2="7" y2="14"></line><line x1="9" y1="8" x2="15" y2="8"></line><line x1="17" y1="16" x2="23" y2="16"></line></symbol>
60
+ <symbol id="icon-refresh" viewBox="0 0 24 24"><polyline points="23 4 23 10 17 10"></polyline><polyline points="1 20 1 14 7 14"></polyline><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path></symbol>
61
+ <symbol id="icon-arrow-down" viewBox="0 0 24 24"><line x1="12" y1="5" x2="12" y2="19"></line><polyline points="19 12 12 19 5 12"></polyline></symbol>
62
+ <symbol id="icon-chevron-up" viewBox="0 0 24 24"><polyline points="18 15 12 9 6 15"></polyline></symbol>
63
+ <symbol id="icon-globe" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></symbol>
64
+ <symbol id="icon-bot" viewBox="0 0 24 24"><rect width="18" height="12" x="3" y="10" rx="2"></rect><circle cx="12" cy="4" r="2"></circle><line x1="12" y1="6" x2="12" y2="10"></line><circle cx="8" cy="15" r="1"></circle><circle cx="16" cy="15" r="1"></circle></symbol>
65
+ <symbol id="icon-server" viewBox="0 0 24 24"><rect x="2" y="2" width="20" height="8" rx="2" ry="2"></rect><rect x="2" y="14" width="20" height="8" rx="2" ry="2"></rect><line x1="6" y1="6" x2="6.01" y2="6"></line><line x1="6" y1="18" x2="6.01" y2="18"></line></symbol>
66
+ <symbol id="icon-palette" viewBox="0 0 24 24"><circle cx="13.5" cy="6.5" r=".5"></circle><circle cx="17.5" cy="10.5" r=".5"></circle><circle cx="8.5" cy="7.5" r=".5"></circle><circle cx="6.5" cy="12.5" r=".5"></circle><path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z"></path></symbol>
67
+ <symbol id="icon-plug" viewBox="0 0 24 24"><path d="M12 22v-5"></path><path d="M9 8V2"></path><path d="M15 8V2"></path><path d="M18 8v5a6 6 0 0 1-12 0V8z"></path></symbol>
68
+ <symbol id="icon-sun" viewBox="0 0 24 24"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></symbol>
69
+ <symbol id="icon-moon" viewBox="0 0 24 24"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></symbol>
70
+ <symbol id="icon-eye" viewBox="0 0 24 24"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></symbol>
71
+ <symbol id="icon-plus" viewBox="0 0 24 24"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></symbol>
72
+ <symbol id="icon-save" viewBox="0 0 24 24"><path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"></path><polyline points="17 21 17 13 7 13 7 21"></polyline><polyline points="7 3 7 8 15 8"></polyline></symbol>
73
+ <symbol id="icon-download" viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></symbol>
74
+ <symbol id="icon-file-text" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></symbol>
75
+ <symbol id="icon-code" viewBox="0 0 24 24"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></symbol>
76
+ <symbol id="icon-printer" viewBox="0 0 24 24"><polyline points="6 9 6 2 18 2 18 9"></polyline><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"></path><rect x="6" y="14" width="12" height="8"></rect></symbol>
77
+ <symbol id="icon-shuffle" viewBox="0 0 24 24"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" y1="3" x2="14" y2="10"></line><line x1="3" y1="21" x2="10" y2="14"></line></symbol>
78
+ <symbol id="icon-edit" viewBox="0 0 24 24"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></symbol>
79
+ <symbol id="icon-database" viewBox="0 0 24 24"><ellipse cx="12" cy="5" rx="9" ry="3"></ellipse><path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"></path><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"></path></symbol>
80
+ </defs>
81
+ </svg>
82
+
83
+ <!-- Backdrop oscuro para drawer mobile -->
84
+ <div id="sidebar-backdrop" class="sidebar-backdrop" aria-hidden="true"></div>
85
+
86
+ <!-- Barra Lateral Izquierda: Chats y Configuración -->
87
+ <aside id="chat-sidebar" class="chat-sidebar" aria-label="Chats y Configuración" data-i18n-aria="sidebar_title">
88
+ <div id="sidebar-view-chat" class="sidebar-view sidebar-view-chat">
89
+ <div class="sidebar-header">
90
+ <div class="sidebar-header-top">
91
+ <div class="sidebar-header-actions">
92
+ <button type="button" id="btn-close-sidebar" class="btn-sidebar-icon btn-sidebar-close" data-i18n-title="btn_close_sidebar_title" title="Cerrar barra lateral" aria-label="Cerrar">
93
+ <svg class="ui-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-close"></use></svg>
94
+ </button>
95
+ <button type="button" id="btn-open-settings" class="btn-sidebar-icon" data-i18n-title="btn_settings_title" title="Abrir configuración de API y Modelo" aria-label="Configuración">
96
+ <svg class="ui-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-settings"></use></svg>
97
+ </button>
98
+ <a id="btn-sidebar-new-tab" class="btn-sidebar-icon" href="" target="_blank" rel="noopener" data-i18n-title="btn_open_new_tab_title" data-i18n-aria="btn_open_new_tab_title" title="Abrir ZeroChat en una nueva pestaña" aria-label="Abrir ZeroChat en una nueva pestaña">
99
+ <svg class="ui-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-external-link"></use></svg>
100
+ </a>
101
+ </div>
102
+ </div>
103
+ </div>
104
+
105
+ <div class="sidebar-search-box">
106
+ <svg class="ui-icon sidebar-search-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-search"></use></svg>
107
+ <input type="text" id="sidebar-search-input" class="sidebar-search-input" data-i18n-placeholder="sidebar_search_placeholder" placeholder="Buscar en historial...">
108
+ </div>
109
+
110
+ <div id="sidebar-chats-list" class="sidebar-chats-list">
111
+ <!-- Lista de chats generada dinámicamente -->
112
+ </div>
113
+
114
+ <div class="sidebar-footer">
115
+ <button type="button" id="btn-import-chat-file" class="btn-sidebar-footer" data-i18n-title="btn_import_chat_title" data-i18n-aria="btn_import_chat" title="Importar conversación desde archivo JSON" aria-label="Importar">
116
+ <svg class="ui-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-upload"></use></svg>
117
+ </button>
118
+ <input type="file" id="import-json-input" accept=".json" style="display: none;">
119
+ <button type="button" id="btn-delete-all-chats" class="btn-sidebar-footer btn-sidebar-danger" data-i18n-title="btn_delete_all_chats_title" data-i18n-aria="btn_delete_all_chats" title="Eliminar todas las conversaciones guardadas" aria-label="Borrar todos">
120
+ <svg class="ui-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-trash"></use></svg>
121
+ </button>
122
+ </div>
123
+ </div>
124
+
125
+ <div id="sidebar-view-settings" class="sidebar-view sidebar-view-settings" hidden>
126
+ <div class="sidebar-header sidebar-settings-header">
127
+ <div class="sidebar-header-top">
128
+ <div class="sidebar-header-actions sidebar-settings-header-actions">
129
+ <button type="button" id="btn-sidebar-back-to-chats" class="btn-sidebar-back" data-i18n-title="btn_back_to_chats" data-i18n-aria="btn_back_to_chats" title="Volver al historial" aria-label="Volver al historial">
130
+ <svg class="ui-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-arrow-left"></use></svg>
131
+ <span data-i18n="sidebar_settings_title">Configuración</span>
132
+ </button>
133
+ <button type="button" id="btn-close-sidebar-settings" class="btn-sidebar-icon btn-sidebar-close" data-i18n-title="btn_close_sidebar_title" title="Cerrar barra lateral" aria-label="Cerrar">
134
+ <svg class="ui-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-close"></use></svg>
135
+ </button>
136
+ </div>
137
+ </div>
138
+ </div>
139
+
140
+ <nav id="sidebar-settings-nav" class="sidebar-settings-nav" aria-label="Secciones de Configuración">
141
+ <!-- Elección 1: Idioma -->
142
+ <div class="sidebar-settings-choice" id="sidebar-choice-language">
143
+ <span class="settings-item-icon">
144
+ <svg class="ui-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-globe"></use></svg>
145
+ </span>
146
+ <span class="settings-item-label" data-i18n="field_language_short">Idioma</span>
147
+ <div class="sidebar-choice-toggle-group" id="lang-switcher-group">
148
+ <button type="button" class="btn-lang-toggle active" id="btn-lang-es" data-lang="es" title="Español" aria-label="Español">ES</button>
149
+ <button type="button" class="btn-lang-toggle" id="btn-lang-en" data-lang="en" title="English" aria-label="English">EN</button>
150
+ </div>
151
+ </div>
152
+
153
+ <!-- Elección 2: Modo Claro / Oscuro -->
154
+ <div class="sidebar-settings-choice" id="sidebar-choice-theme">
155
+ <span class="settings-item-icon">
156
+ <svg class="ui-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-palette"></use></svg>
157
+ </span>
158
+ <span class="settings-item-label" data-i18n="field_theme_short">Tema</span>
159
+ <div class="sidebar-choice-toggle-group" id="theme-switcher-group">
160
+ <button type="button" class="btn-theme-toggle" id="btn-theme-light" data-theme="light" data-i18n-title="theme_light" title="Modo Claro" aria-label="Modo Claro">
161
+ <svg class="ui-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-sun"></use></svg>
162
+ </button>
163
+ <button type="button" class="btn-theme-toggle active" id="btn-theme-dark" data-theme="dark" data-i18n-title="theme_dark" title="Modo Oscuro" aria-label="Modo Oscuro">
164
+ <svg class="ui-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-moon"></use></svg>
165
+ </button>
166
+ </div>
167
+ </div>
168
+
169
+ <!-- Secciones de panel -->
170
+ <button type="button" class="sidebar-settings-item" data-section="tab-model">
171
+ <span class="settings-item-icon">
172
+ <svg class="ui-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-settings"></use></svg>
173
+ </span>
174
+ <span class="settings-item-label" data-i18n="tab_model">Modelo</span>
175
+ <span class="settings-item-chevron">
176
+ <svg class="ui-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-chevron-right"></use></svg>
177
+ </span>
178
+ </button>
179
+ <button type="button" class="sidebar-settings-item" data-section="tab-agent">
180
+ <span class="settings-item-icon">
181
+ <svg class="ui-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-bot"></use></svg>
182
+ </span>
183
+ <span class="settings-item-label" data-i18n="tab_agent">Agente</span>
184
+ <span class="settings-item-chevron">
185
+ <svg class="ui-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-chevron-right"></use></svg>
186
+ </span>
187
+ </button>
188
+ <button type="button" class="sidebar-settings-item" data-section="rag-manage">
189
+ <span class="settings-item-icon">
190
+ <svg class="ui-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-layers"></use></svg>
191
+ </span>
192
+ <span class="settings-item-label" data-i18n="rag_menu_label">RAG</span>
193
+ <span class="settings-item-chevron">
194
+ <svg class="ui-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-chevron-right"></use></svg>
195
+ </span>
196
+ </button>
197
+ <button type="button" class="sidebar-settings-item" data-section="tab-mcp">
198
+ <span class="settings-item-icon">
199
+ <svg class="ui-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-server"></use></svg>
200
+ </span>
201
+ <span class="settings-item-label" data-i18n="tab_mcp">MCP</span>
202
+ <span class="settings-item-chevron">
203
+ <svg class="ui-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-chevron-right"></use></svg>
204
+ </span>
205
+ </button>
206
+ <button type="button" class="sidebar-settings-item" data-section="tab-permissions">
207
+ <span class="settings-item-icon">
208
+ <svg class="ui-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-shield"></use></svg>
209
+ </span>
210
+ <span class="settings-item-label" data-i18n="tab_permissions">Permisos</span>
211
+ <span class="settings-item-chevron">
212
+ <svg class="ui-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-chevron-right"></use></svg>
213
+ </span>
214
+ </button>
215
+ <button type="button" class="sidebar-settings-item" data-section="tab-inspector">
216
+ <span class="settings-item-icon">
217
+ <svg class="ui-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-search"></use></svg>
218
+ </span>
219
+ <span class="settings-item-label" data-i18n="tab_inspector">Inspector</span>
220
+ <span class="settings-item-chevron">
221
+ <svg class="ui-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-chevron-right"></use></svg>
222
+ </span>
223
+ </button>
224
+ <a id="sidebar-settings-help" class="sidebar-settings-item" href="help/index.html" target="_blank" rel="noopener noreferrer" data-i18n-href="sidebar_help_href">
225
+ <span class="settings-item-icon">
226
+ <svg class="ui-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-help-circle"></use></svg>
227
+ </span>
228
+ <span class="settings-item-label" data-i18n="sidebar_help">Ayuda</span>
229
+ <span class="settings-item-chevron">
230
+ <svg class="ui-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-external-link"></use></svg>
231
+ </span>
232
+ </a>
233
+ </nav>
234
+
235
+ <div class="sidebar-footer sidebar-settings-footer">
236
+ <button type="button" id="btn-clear-all-data" class="btn-sidebar-settings-clear" data-i18n-title="btn_clear_all_data_title" title="Borrar todas las cookies, sesiones y configuraciones locales">
237
+ <svg class="ui-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-trash"></use></svg>
238
+ <span data-i18n="btn_clear_all_data">Borrar todo</span>
239
+ </button>
240
+ </div>
241
+ </div>
242
+ </aside>
243
+
244
+
245
+
246
+ <!-- Contenedor Principal del Chat (Usa todo el alto de la página: 100vh) -->
247
+ <main class="chat-container">
248
+ <!-- Barra Superior / Header estilo ChatGPT & Gemini -->
249
+ <header class="app-header">
250
+ <div class="header-left">
251
+ <button type="button" id="btn-toggle-sidebar" class="btn-header-icon" data-i18n-title="btn_sidebar_title" title="Chats y Configuración" aria-label="Chats y Configuración" style="display: none;">
252
+ <svg class="ui-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-menu"></use></svg>
253
+ </button>
254
+ <button type="button" id="btn-sidebar-new-chat" class="btn-header-icon" data-i18n-title="btn_new_chat_sidebar_title" data-i18n-aria="btn_new_chat_sidebar_title" title="Crear nueva conversación" aria-label="Crear nueva conversación">
255
+ <svg class="ui-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-square-pen"></use></svg>
256
+ <span class="sr-only" data-i18n="chat_untitled">Nueva conversación</span>
257
+ </button>
258
+ </div>
259
+
260
+ <div class="header-center">
261
+ <!-- Selector de Perfil Activo (movido desde el compositor) -->
262
+ <div id="active-profile-menu" class="header-profile-menu">
263
+ <button type="button" id="active-profile-trigger" class="header-profile-trigger" aria-haspopup="menu" aria-expanded="false" aria-controls="active-profile-list" data-i18n-title="profile_badge_title" title="Perfil de conexión activo">
264
+ <span class="profile-icon"><svg class="ui-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-zap"></use></svg></span>
265
+ <span id="active-profile-name" class="header-profile-name">Espejo</span>
266
+ <span class="profile-chevron"><svg class="ui-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-chevron-up"></use></svg></span>
267
+ </button>
268
+ <div id="active-profile-popover" class="header-profile-popover" hidden>
269
+ <div class="header-profile-popover-header">
270
+ <span id="profile-menu-title" class="header-profile-popover-title" data-i18n="profile_menu_title">Perfiles de conexión</span>
271
+ <div class="header-profile-header-actions">
272
+ <button type="button" id="btn-menu-new-profile" class="btn-profile-header-icon" data-i18n-title="btn_new_profile_title" title="Crear un perfil nuevo" aria-label="Crear un perfil nuevo">
273
+ <svg class="ui-icon" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-plus"></use></svg>
274
+ </button>
275
+ <button type="button" id="btn-menu-export-profiles" class="btn-profile-header-icon" data-i18n-title="btn_export_profiles_title" title="Exportar todos los perfiles a un archivo cifrado" aria-label="Exportar todos los perfiles">
276
+ <svg class="ui-icon" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-download"></use></svg>
277
+ </button>
278
+ <button type="button" id="btn-menu-close-profiles" class="btn-profile-header-icon" data-i18n-title="btn_close_profiles_menu" title="Cerrar selector" aria-label="Cerrar selector">
279
+ <svg class="ui-icon" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-close"></use></svg>
280
+ </button>
281
+ </div>
282
+ </div>
283
+ <div id="active-profile-list" class="header-profile-list" role="menu" aria-labelledby="profile-menu-title"></div>
284
+ </div>
285
+ </div>
286
+ </div>
287
+
288
+ <div class="header-right">
289
+ <button type="button" id="btn-toggle-debug" class="btn-header-icon btn-debug-toggle" data-i18n-title="btn_logs_title" title="Abrir panel lateral de logs y depuración" aria-label="Abrir panel lateral de logs" aria-controls="debug-panel" aria-expanded="false">
290
+ <svg class="ui-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-search"></use></svg>
291
+ </button>
292
+ </div>
293
+ </header>
294
+ <div id="messages-list" class="messages-list">
295
+ <!-- Estado de Bienvenida inicial -->
296
+ <div id="welcome-banner" class="welcome-banner">
297
+ <div class="welcome-icon">
298
+ <svg class="ui-icon" width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-terminal"></use></svg>
299
+ </div>
300
+ <h2 data-i18n="welcome_heading">ZeroChat</h2>
301
+ <p class="welcome-desc" data-i18n="welcome_desc">
302
+ Entorno conversacional y agente autónomo local.
303
+ </p>
304
+ <div class="welcome-status-badge">
305
+ <span class="status-dot"></span>
306
+ <span data-i18n="welcome_status">Chat vacío · A la espera de un comando</span>
307
+ </div>
308
+ <a id="welcome-help-link" class="welcome-status-badge welcome-help-link" href="help/index.html" target="_blank" rel="noopener noreferrer" data-i18n-title="welcome_help_title" data-i18n-href="welcome_help_href" title="Abrir centro de ayuda y documentación online">
309
+ <svg class="ui-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-help-circle"></use></svg>
310
+ <span data-i18n="welcome_help_link">Ayuda y Documentación</span>
311
+ <svg class="ui-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-external-link"></use></svg>
312
+ </a>
313
+ </div>
314
+ </div>
315
+
316
+
317
+ <!-- Barra de entrada inferior -->
318
+ <div class="chat-input-wrapper">
319
+ <!-- Previsualización de archivos adjuntos -->
320
+ <div id="attachments-container" class="attachments-container" style="display: none;"></div>
321
+
322
+
323
+
324
+ <form id="chat-form" class="chat-input-container">
325
+ <!-- Input oculto para selección de archivos -->
326
+ <input type="file" id="file-input" multiple accept=".pdf,.txt,.md,.json,.js,.ts,.py,.html,.css,.csv,.tsv,.xml,.yaml,.yml,.c,.cpp,.h,.java,.sql,.sh,.rs,.go,.php,image/*" style="display: none;">
327
+
328
+ <!-- Zona Superior: Textarea de ancho completo -->
329
+ <div class="composer-top-row">
330
+ <textarea
331
+ id="user-input"
332
+ class="chat-textarea"
333
+ rows="1"
334
+ data-i18n-placeholder="input_placeholder"
335
+ placeholder="Escribe un mensaje..."
336
+ required
337
+ ></textarea>
338
+ <div id="generation-status" class="generation-status" aria-live="polite" hidden>
339
+ <svg class="ui-icon generation-status-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-spinner"></use></svg>
340
+ <span class="generation-status-text"></span>
341
+ <progress class="generation-status-progress" max="100" value="0" hidden></progress>
342
+ </div>
343
+ </div>
344
+
345
+ <!-- Zona Inferior: Controles de estado y acciones -->
346
+ <div class="composer-bottom-row">
347
+ <div class="composer-controls-left">
348
+ <!-- Botón para adjuntar archivos -->
349
+ <button type="button" id="btn-attach-file" class="btn-attach btn-composer-icon-btn" data-i18n-title="btn_attach_title" data-i18n-aria="btn_attach_title" title="Adjuntar archivos (PDF, código, texto, imágenes)" aria-label="Adjuntar archivos">
350
+ <svg class="ui-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-paperclip"></use></svg>
351
+ </button>
352
+
353
+ <!-- Control de Nivel de Razonamiento (Thinking) -->
354
+ <div class="reasoning-control-wrapper">
355
+ <button type="button" id="btn-reasoning" class="btn-composer-chip btn-reasoning" aria-haspopup="dialog" aria-expanded="false" aria-labelledby="reasoning-button-name reasoning-label" data-i18n-title="reasoning_btn_title" title="Nivel de razonamiento (Desactivado por defecto)">
356
+ <svg class="ui-icon reasoning-gauge" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M4 15a8 8 0 0 1 16 0"></path><path d="M6.5 15h11"></path><g id="reasoning-gauge-needle"><path d="M12 15 12 7"></path><circle cx="12" cy="15" r="1.2" fill="currentColor" stroke="none"></circle></g></svg>
357
+ <span id="reasoning-button-name" class="composer-visually-hidden" data-i18n="reasoning_menu_title">Nivel de Razonamiento</span>
358
+ <span id="reasoning-label" class="reasoning-label">None</span>
359
+ </button>
360
+
361
+ <!-- Panel de intensidad de razonamiento -->
362
+ <div id="reasoning-menu" class="reasoning-menu" role="dialog" aria-modal="false" aria-labelledby="reasoning-menu-title" style="display: none;">
363
+ <div class="reasoning-menu-header">
364
+ <span id="reasoning-menu-title" class="reasoning-menu-title-wrapper"><svg class="ui-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-brain"></use></svg><span data-i18n="reasoning_menu_title">Nivel de Razonamiento</span></span>
365
+ <button type="button" id="btn-close-reasoning" class="btn-reasoning-close" data-i18n-aria="modal_close_aria" aria-label="Cerrar"><svg class="ui-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-close"></use></svg></button>
366
+ </div>
367
+ <div class="reasoning-intensity-control">
368
+ <div class="reasoning-intensity-heading"><span data-i18n="reasoning_intensity_title">Intensidad</span><output id="reasoning-intensity-value" for="reasoning-intensity" aria-live="polite">Ninguno</output></div>
369
+ <input id="reasoning-intensity" class="reasoning-intensity-slider" type="range" min="0" max="4" step="1" value="0" data-i18n-aria="reasoning_intensity_aria" aria-label="Intensidad de razonamiento">
370
+ <div class="reasoning-intensity-scale" aria-hidden="true"><span data-i18n="reasoning_intensity_none">Ninguno</span><span data-i18n="reasoning_intensity_max">Máximo</span></div>
371
+ </div>
372
+ <div class="reasoning-menu-footer">
373
+ <div class="reasoning-agent-toggle-wrapper">
374
+ <div class="reasoning-agent-toggle-info">
375
+ <div class="reasoning-agent-toggle-title">
376
+ <svg class="ui-icon" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 6H5a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h13l4-3.5L18 6Z"></path><line x1="12" y1="13" x2="12" y2="21"></line></svg>
377
+ <span data-i18n="reasoning_checkpoint_agent_title">Punto de control agéntico</span>
378
+ </div>
379
+ <div class="reasoning-agent-toggle-desc" data-i18n="reasoning_checkpoint_agent_desc">Consolida hallazgos en modelos abiertos o RAG</div>
380
+ </div>
381
+ <label class="switch switch-sm" data-i18n-title="reasoning_checkpoint_agent_tooltip" title="Activar/Desactivar herramienta agent_checkpoint">
382
+ <input type="checkbox" id="chk-reasoning-agent-checkpoint">
383
+ <span class="slider"></span>
384
+ </label>
385
+ </div>
386
+ </div>
387
+ </div>
388
+ </div>
389
+
390
+ <!-- Botón de gestión de conocimiento RAG (movido desde el header) -->
391
+ <button type="button" id="btn-open-rag" class="btn-composer-chip btn-rag-mini" data-i18n-title="btn_rag_title" data-i18n-aria="btn_rag_title" title="Gestionar conocimiento local (RAG)" aria-label="Gestionar conocimiento local (RAG)">
392
+ <svg class="ui-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" aria-hidden="true"><use href="#icon-layers"></use></svg>
393
+ </button>
394
+ </div>
395
+
396
+ <div class="composer-actions-right input-actions">
397
+ <div id="unified-context-hub" class="context-hub-wrapper">
398
+ <button type="button" id="connection-tokens-badge" class="composer-telemetry-btn" style="display: none;" aria-expanded="false" aria-haspopup="dialog" data-i18n-title="context_hub_btn_title" title="Métricas de Contexto y Tokens de la conversación">
399
+ <span id="connection-tokens-text" class="composer-tokens-text">0 / 128k</span>
400
+ <span id="context-hub-cache-pill" class="composer-tokens-cache" style="display: none;" title="Tokens en caché"><svg class="ui-icon" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-zap"></use></svg><span id="context-hub-cache-val">0</span></span>
401
+ </button>
402
+
403
+ <!-- Popover Flotante de Métricas Detalladas -->
404
+ <div id="context-hub-popover" class="context-hub-popover" style="display: none;" role="dialog" aria-modal="false" aria-label="Métricas de Contexto y Tokens">
405
+ <div class="context-popover-header">
406
+ <div class="context-popover-title">
407
+ <svg class="ui-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-help-circle"></use></svg>
408
+ <span data-i18n="context_hub_title">Métricas de Contexto y Tokens</span>
409
+ </div>
410
+ <button type="button" id="btn-close-context-popover" class="btn-close-popover" aria-label="Cerrar">
411
+ <svg class="ui-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-close"></use></svg>
412
+ </button>
413
+ </div>
414
+
415
+ <!-- Sección 1: Capacidad de Contexto Global -->
416
+ <div class="context-popover-section">
417
+ <div class="context-section-title" data-i18n="context_section_global">Ventana de Contexto Global</div>
418
+ <div class="context-progress-bar-container">
419
+ <div id="context-progress-bar" class="context-progress-bar" style="width: 0%;"></div>
420
+ </div>
421
+ <div class="context-metrics-grid">
422
+ <div class="context-metric-item">
423
+ <span class="context-metric-label" data-i18n="context_metric_used">Usado</span>
424
+ <span id="context-metric-used-val" class="context-metric-val">0 tok</span>
425
+ </div>
426
+ <div class="context-metric-item">
427
+ <span class="context-metric-label" data-i18n="context_metric_limit">Capacidad</span>
428
+ <span id="context-metric-limit-val" class="context-metric-val">128,000</span>
429
+ </div>
430
+ <div class="context-metric-item">
431
+ <span class="context-metric-label" data-i18n="context_metric_free">Disponible</span>
432
+ <span id="context-metric-free-val" class="context-metric-val">128,000</span>
433
+ </div>
434
+ <div class="context-metric-item">
435
+ <span class="context-metric-label" data-i18n="context_metric_status">Estado</span>
436
+ <span id="context-metric-status-val" class="context-metric-val status-ok">Óptimo</span>
437
+ </div>
438
+ </div>
439
+ <div class="context-limit-control">
440
+ <span id="context-limit-source" class="context-limit-source"></span>
441
+ <label for="context-limit-override-input" data-i18n="context_limit_override_label">Capacidad asumida</label>
442
+ <div class="context-limit-control-row">
443
+ <input id="context-limit-override-input" type="text" inputmode="decimal" data-i18n-aria="context_limit_override_label" aria-label="Capacidad de contexto asumida">
444
+ <button type="button" id="btn-save-context-limit-override" class="btn-secondary" data-i18n="context_limit_override_save">Usar</button>
445
+ </div>
446
+ </div>
447
+ </div>
448
+
449
+ <!-- Sección 2: Caché de Contexto -->
450
+ <div class="context-popover-section" id="context-cache-section">
451
+ <div class="context-section-title" data-i18n="context_section_cache">Caché de Contexto (Prompt/KV)</div>
452
+ <div class="context-metrics-grid">
453
+ <div class="context-metric-item">
454
+ <span class="context-metric-label" data-i18n="context_metric_cached_read">Leídos (Ahorro)</span>
455
+ <span id="context-metric-cached-read-val" class="context-metric-val accent">0 tok</span>
456
+ </div>
457
+ <div class="context-metric-item">
458
+ <span class="context-metric-label" data-i18n="context_metric_cached_write">Escritos en caché</span>
459
+ <span id="context-metric-cached-write-val" class="context-metric-val">0 tok</span>
460
+ </div>
461
+ </div>
462
+ </div>
463
+
464
+ <!-- Sección 3: Último Turno Generado -->
465
+ <div class="context-popover-section" id="context-last-turn-section">
466
+ <div class="context-section-title" data-i18n="context_section_turn">Último Turno Generado</div>
467
+ <div class="context-metrics-grid">
468
+ <div class="context-metric-item">
469
+ <span class="context-metric-label" data-i18n="context_metric_turn_prompt">Entrada (Prompt)</span>
470
+ <span id="context-metric-turn-prompt-val" class="context-metric-val">0 tok</span>
471
+ </div>
472
+ <div class="context-metric-item">
473
+ <span class="context-metric-label" data-i18n="context_metric_turn_completion">Salida (Respuesta)</span>
474
+ <span id="context-metric-turn-completion-val" class="context-metric-val">0 tok</span>
475
+ </div>
476
+ <div class="context-metric-item">
477
+ <span class="context-metric-label" data-i18n="context_metric_turn_speed">Velocidad</span>
478
+ <span id="context-metric-turn-speed-val" class="context-metric-val">-</span>
479
+ </div>
480
+ <div class="context-metric-item">
481
+ <span class="context-metric-label" data-i18n="context_metric_turn_latency">Latencia (TTFT)</span>
482
+ <span id="context-metric-turn-latency-val" class="context-metric-val">-</span>
483
+ </div>
484
+ </div>
485
+ </div>
486
+ </div>
487
+ </div>
488
+
489
+ <button type="button" id="btn-stop-stream" class="btn-stop-stream" style="display: none;" data-i18n-title="btn_stop_title" data-i18n-aria="btn_stop_title" title="Detener respuesta" aria-label="Detener respuesta">
490
+ <svg class="ui-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-stop"></use></svg>
491
+ </button>
492
+
493
+ <button type="submit" id="btn-send" class="btn-send" data-i18n-title="btn_send_title" data-i18n-aria="btn_send_title" title="Enviar mensaje" aria-label="Enviar mensaje">
494
+ <svg class="ui-icon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-send"></use></svg>
495
+ </button>
496
+ </div>
497
+ </div>
498
+ </form>
499
+ </div>
500
+ </main>
501
+
502
+ <!-- Panel Lateral Derecho: Log & Debug / Razonamiento -->
503
+ <aside id="debug-panel" class="debug-panel" style="display: none;" aria-labelledby="debug-panel-title" aria-hidden="true">
504
+ <div class="debug-panel-header">
505
+ <div class="debug-title">
506
+ <span class="debug-badge-icon">
507
+ <svg class="ui-icon" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-terminal"></use></svg>
508
+ </span>
509
+ <span id="debug-panel-title" class="debug-badge-text" data-i18n="debug_panel_title">Logs y Debug</span>
510
+ <span id="debug-status-indicator" class="debug-status-indicator idle" aria-live="polite">Inactivo</span>
511
+ </div>
512
+ <div class="debug-actions">
513
+ <button type="button" id="btn-copy-debug" class="btn-debug-action" data-i18n-title="btn_copy_debug_title" title="Copiar logs al portapapeles">
514
+ <svg class="ui-icon" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-copy"></use></svg>
515
+ </button>
516
+ <button type="button" id="btn-clear-debug" class="btn-debug-action" data-i18n-title="btn_clear_debug_title" title="Limpiar logs">
517
+ <svg class="ui-icon" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-trash"></use></svg>
518
+ </button>
519
+ <button type="button" id="btn-toggle-autoscroll" class="btn-debug-action active" data-i18n-title="btn_autoscroll_title" title="Auto-scroll activado">
520
+ <svg class="ui-icon" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-arrow-down"></use></svg>
521
+ </button>
522
+ <button type="button" id="btn-close-debug" class="btn-debug-action btn-close-panel" data-i18n-title="btn_close_debug_title" title="Cerrar panel de logs">
523
+ <svg class="ui-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-close"></use></svg>
524
+ </button>
525
+ </div>
526
+ </div>
527
+
528
+ <!-- Barra superior de controles de depuración (Debug messages y Log completo Raw) -->
529
+ <div class="debug-controls-bar">
530
+ <div class="debug-control-group">
531
+ <div class="debug-toggle-wrapper">
532
+ <label class="switch switch-sm" data-i18n-title="debug_messages_toggle_title" title="Activar/Desactivar depuración interactiva de mensajes salientes">
533
+ <input type="checkbox" id="chk-enable-debug-messages">
534
+ <span class="slider"></span>
535
+ </label>
536
+ <span class="debug-toggle-label" data-i18n="debug_messages_toggle">Debug messages</span>
537
+ </div>
538
+ <span id="debug-messages-status-badge" class="debug-status-pill off">OFF</span>
539
+ </div>
540
+ </div>
541
+
542
+ <!-- Pestañas de filtrado de logs -->
543
+ <div class="debug-tabs" role="group" data-i18n-aria="debug_tabs_label" aria-label="Filtros de logs">
544
+ <button type="button" class="debug-tab active" data-debug-tab="all" data-i18n="debug_tab_all" aria-pressed="true">Todo</button>
545
+ <button type="button" class="debug-tab" data-debug-tab="thinking" data-i18n="debug_tab_thinking" aria-pressed="false">Razonamiento</button>
546
+ <button type="button" class="debug-tab" data-debug-tab="tool" data-i18n="debug_tab_tool" aria-pressed="false">Herramientas</button>
547
+ <button type="button" class="debug-tab" data-debug-tab="network" data-i18n="debug_tab_network" aria-pressed="false">Red</button>
548
+ <button type="button" class="debug-tab" data-debug-tab="raw" data-i18n="debug_tab_raw" aria-pressed="false">Raw</button>
549
+ </div>
550
+
551
+ <!-- Contenedor del Log Monospace -->
552
+ <div id="debug-log-content" class="debug-log-content" tabindex="0">
553
+ <div class="debug-entry debug-entry-system" data-type="system">
554
+ <span class="debug-time">[--:--:--]</span>
555
+ <span class="debug-tag system">[SISTEMA]</span>
556
+ <span class="debug-msg" data-i18n="debug_sys_init">Inspector de razonamiento y logs iniciado.</span>
557
+ </div>
558
+ </div>
559
+ </aside>
560
+
561
+ <!-- Modales de la aplicación (renderizados dinámicamente desde sus módulos UI) -->
562
+ <dialog id="settings-dialog" class="settings-modal" closedby="any"></dialog>
563
+ <dialog id="profiles-dialog" class="settings-modal profiles-modal" closedby="any"></dialog>
564
+ <dialog id="export-modal" class="settings-modal"></dialog>
565
+ <dialog id="debug-interceptor-dialog" class="debug-interceptor-modal"></dialog>
566
+ <dialog id="rag-modal" class="settings-modal rag-modal"></dialog>
567
+ <dialog id="rag-manage-modal" class="settings-modal rag-modal"></dialog>
568
+
569
+ <dialog id="execution-info-dialog" class="settings-modal execution-info-dialog" aria-labelledby="execution-info-title">
570
+ <div class="modal-header">
571
+ <div class="modal-title">
572
+ <svg class="ui-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-help-circle"></use></svg>
573
+ <h3 id="execution-info-title" data-i18n="execution_info_title">Modo de ejecución y almacenamiento</h3>
574
+ </div>
575
+ <button type="button" id="btn-close-execution-info" class="btn-close" data-i18n-aria="modal_close_aria" aria-label="Cerrar modal">
576
+ <svg class="ui-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor"><use href="#icon-close"></use></svg>
577
+ </button>
578
+ </div>
579
+ <div class="modal-body execution-info-body">
580
+ <p data-i18n="execution_info_portable_tool">Herramienta portátil: guarda zerochat.html en una ubicación que controles —Escritorio, Descargas, correo o WhatsApp— y ábrelo desde ahí cuando lo necesites. La interfaz arranca sin conexión a Internet.</p>
581
+ <p id="execution-storage-scope"></p>
582
+ <p data-i18n="execution_info_requirements">La conversación seguirá necesitando el proveedor que hayas configurado: un modelo local puede funcionar sin red; una API remota y las funciones web, no.</p>
583
+ </div>
584
+ <div class="modal-footer">
585
+ <button type="button" id="btn-close-execution-info-footer" class="btn-primary" data-i18n="btn_close">Cerrar</button>
586
+ </div>
587
+ </dialog>
588
+
589
+ <dialog id="notice-dialog" class="settings-modal notice-dialog" aria-labelledby="notice-title" aria-describedby="notice-message">
590
+ <div class="modal-header"><h3 id="notice-title"></h3></div>
591
+ <div class="modal-body">
592
+ <div id="notice-message"></div>
593
+ <input id="notice-input" class="form-input" type="text" maxlength="10000" aria-labelledby="notice-message" autocomplete="off" hidden>
594
+ <div id="notice-checkbox-container" class="notice-checkbox-wrapper" hidden>
595
+ <label class="notice-checkbox-label">
596
+ <input type="checkbox" id="notice-checkbox">
597
+ <span id="notice-checkbox-text"></span>
598
+ </label>
599
+ </div>
600
+ </div>
601
+ <div class="modal-footer"><button type="button" id="notice-cancel" class="btn-secondary" data-i18n="notice_cancel" hidden></button><button type="button" id="notice-accept" class="btn-primary" data-i18n="notice_accept"></button></div>
602
+ </dialog>
603
+
604
+ <!-- Scripts de la aplicación con carga diferida (compatibles con file:// y http://) -->
605
+ <script defer src="js/vendor/orama.browser.js"></script>
606
+ <script defer src="js/utils.js"></script>
607
+ <script defer src="js/storage-db.js"></script>
608
+ <script defer src="js/message-turns.js"></script>
609
+ <script defer src="js/defaults.js"></script>
610
+ <script defer src="js/state.js"></script>
611
+ <script defer src="js/cookies.js"></script>
612
+ <script defer src="js/ragStorage.js"></script>
613
+ <script defer src="js/rag-index.js"></script>
614
+ <script defer src="js/ingestionEngine.js"></script>
615
+ <script defer src="js/rag-service.js"></script>
616
+ <script defer src="js/rag-ui.js"></script>
617
+ <script defer src="js/i18n.js"></script>
618
+ <script defer src="js/icons.js"></script>
619
+ <script defer src="js/ui-dialogs.js"></script>
620
+ <script defer src="js/ui-generation-status.js"></script>
621
+ <script defer src="js/sandbox.js"></script>
622
+ <script defer src="js/charts.js"></script>
623
+ <script defer src="js/web-browser.js"></script>
624
+ <script defer src="js/web-search.js"></script>
625
+ <script defer src="js/markdown.js"></script>
626
+ <script defer src="js/providers.js"></script>
627
+ <script defer src="js/providers-webllm.js"></script>
628
+ <script defer src="js/api.js"></script>
629
+ <script defer src="js/file-parser.js"></script>
630
+ <script defer src="js/tools/tool-runtime.js"></script>
631
+ <script defer src="js/tools/tool-manifest.js"></script>
632
+ <script defer src="js/tools/builtin/execute-javascript.tool.js"></script>
633
+ <script defer src="js/tools/builtin/search-web.tool.js"></script>
634
+ <script defer src="js/tools/builtin/fetch-web-page.tool.js"></script>
635
+ <script defer src="js/tools/builtin/download-pdf.tool.js"></script>
636
+ <script defer src="js/tools/builtin/render-chart.tool.js"></script>
637
+ <script defer src="js/tools/builtin/list-documents.tool.js"></script>
638
+ <script defer src="js/tools/builtin/search-knowledge-base.tool.js"></script>
639
+ <script defer src="js/tools/builtin/read-knowledge-chunk.tool.js"></script>
640
+ <script defer src="js/tools/builtin/read-knowledge-image.tool.js"></script>
641
+ <script defer src="js/tools/builtin/agent-checkpoint.tool.js"></script>
642
+ <script defer src="js/tool-security.js"></script>
643
+ <script defer src="js/agent-core.js"></script>
644
+ <script defer src="js/mcp.js"></script>
645
+ <script defer src="js/debug.js"></script>
646
+ <script defer src="js/tool-cards.js"></script>
647
+ <script defer src="js/attachments.js"></script>
648
+ <script defer src="js/export.js"></script>
649
+ <script defer src="js/profile-backup.js"></script>
650
+ <script defer src="js/profile-export-bundle.js"></script>
651
+ <script defer src="js/profile-repository.js"></script>
652
+ <script defer src="js/config-store.js"></script>
653
+ <script defer src="js/context-manager.js"></script>
654
+ <script defer src="js/chat-engine.js"></script>
655
+ <script defer src="js/ui-reasoning.js"></script>
656
+ <script defer src="js/ui-inspector.js"></script>
657
+ <script defer src="js/ui-sidebar.js"></script>
658
+ <script defer src="js/ui-settings.js"></script>
659
+ <script defer src="js/ui-telemetry.js"></script>
660
+ <script defer src="js/ui-mcp.js"></script>
661
+ <script defer src="js/ui-shell.js"></script>
662
+ <script defer src="js/data-reset-service.js"></script>
663
+ <script defer src="js/ui-transfer.js"></script>
664
+ <script defer src="js/ui-profiles.js"></script>
665
+ <script defer src="js/ui-composer.js"></script>
666
+ <script defer src="js/conversation-service.js"></script>
667
+ <script defer src="js/ui-conversation.js"></script>
668
+ <script defer src="js/generation-controller.js"></script>
669
+ <script defer src="js/app.js"></script>
670
+ </body>
671
+ </html>