@johpaz/hive-agents 1.0.3 → 1.0.5

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 (228) hide show
  1. package/README.md +4 -4
  2. package/dist/hive.js +49133 -48182
  3. package/dist/tool-worker.js +2 -1
  4. package/dist/ui/assets/A2UIPage-DTW79pyL.js +8 -0
  5. package/dist/ui/assets/AgentCreateForm-Bcp3HN8D.js +1 -0
  6. package/dist/ui/assets/AgentDetailPage-10XptMde.js +1 -0
  7. package/dist/ui/assets/AgentNewPage-CUt49rVS.js +1 -0
  8. package/dist/ui/assets/AgentsPage-1_e1a9xa.js +10 -0
  9. package/dist/ui/assets/ApiClientPage-DHfIlSAg.js +3 -0
  10. package/dist/ui/assets/ChannelsPage-BnCQAGZL.js +8 -0
  11. package/dist/ui/assets/DashboardPage-BsCCKHgg.js +6 -0
  12. package/dist/ui/assets/LoginPage-BaX6cAPa.js +1 -0
  13. package/dist/ui/assets/{LogsPage-DyJOGQNy.js → LogsPage-DiFBQt7o.js} +1 -1
  14. package/dist/ui/assets/MeetingPage-Bpv5zVXf.js +1 -0
  15. package/dist/ui/assets/ModelSelector-DfExlPzx.js +1 -0
  16. package/dist/ui/assets/{NotFound-Bpr12V51.js → NotFound-C8HBdF73.js} +1 -1
  17. package/dist/ui/assets/Office3DPage-ChsGMapf.js +319 -0
  18. package/dist/ui/assets/ProvidersPage-B39pfWHf.js +1 -0
  19. package/dist/ui/assets/RecoverPage-C_Id9WM-.js +1 -0
  20. package/dist/ui/assets/SettingsPage-BgFqasyg.js +9 -0
  21. package/dist/ui/assets/SetupPage-YeJFfgbt.js +1 -0
  22. package/dist/ui/assets/Vignette-Cyi27LQH.js +4302 -0
  23. package/dist/ui/assets/VoicePage-Cp63Abj4.js +307 -0
  24. package/dist/ui/assets/VoicePage-uLWdtoD4.css +1 -0
  25. package/dist/ui/assets/WebChatPage-DxFLWgtM.js +29 -0
  26. package/dist/ui/assets/activity-C_GS5wrG.js +1 -0
  27. package/dist/ui/assets/agentCapabilities-DOeepCty.js +1 -0
  28. package/dist/ui/assets/{alert-CQlRq6sv.js → alert-Cj4DpKv6.js} +1 -1
  29. package/dist/ui/assets/arrow-left-WyDPYZXU.js +1 -0
  30. package/dist/ui/assets/arrow-right-BuNjN-bk.js +1 -0
  31. package/dist/ui/assets/arrow-up-right-DWzTsCXj.js +1 -0
  32. package/dist/ui/assets/{badge-DKGZbVZJ.js → badge-DKpeVCpY.js} +1 -1
  33. package/dist/ui/assets/bia-4LFKOyxR.webp +0 -0
  34. package/dist/ui/assets/bia-BFcUpOu3.glb +0 -0
  35. package/dist/ui/assets/calendar-B6x9cw-q.js +1 -0
  36. package/dist/ui/assets/{card-D3Nw3kh3.js → card-Cag15G4h.js} +1 -1
  37. package/dist/ui/assets/check-C8pw-7Fx.js +1 -0
  38. package/dist/ui/assets/chevron-down-8GjmTjLR.js +1 -0
  39. package/dist/ui/assets/chevron-left-GK4EQOyZ.js +1 -0
  40. package/dist/ui/assets/chevron-right-BupZqrxu.js +1 -0
  41. package/dist/ui/assets/chevron-up-DZrzJIW8.js +1 -0
  42. package/dist/ui/assets/circle-alert-CtDbK2nl.js +1 -0
  43. package/dist/ui/assets/circle-check-BKNT2_q6.js +1 -0
  44. package/dist/ui/assets/circle-x-DfBjbztU.js +1 -0
  45. package/dist/ui/assets/copy-wR7o7Ly8.js +1 -0
  46. package/dist/ui/assets/core-Dz04EE_8.js +1 -0
  47. package/dist/ui/assets/createLucideIcon-BRaPSYgN.js +1 -0
  48. package/dist/ui/assets/{dialog-Dn9hGPYl.js → dialog-7E3EoEt3.js} +1 -1
  49. package/dist/ui/assets/dist-js-Bg0g3vPS.js +1 -0
  50. package/dist/ui/assets/dist-js-DwLn9F4C.js +1 -0
  51. package/dist/ui/assets/download-D0aDV8Y_.js +1 -0
  52. package/dist/ui/assets/earth-BJRGJbVn.js +1 -0
  53. package/dist/ui/assets/ellipsis-vertical-BOW_iEOO.js +1 -0
  54. package/dist/ui/assets/external-link-5cujQzfV.js +1 -0
  55. package/dist/ui/assets/eye-sRPY5qOa.js +1 -0
  56. package/dist/ui/assets/file-text-DNSyNLUh.js +1 -0
  57. package/dist/ui/assets/gauge-C__zxC3_.js +1 -0
  58. package/dist/ui/assets/history-BHQWfE-7.js +1 -0
  59. package/dist/ui/assets/index-Bi8qEmrK.js +116 -0
  60. package/dist/ui/assets/index-D2UhaSb0.css +2 -0
  61. package/dist/ui/assets/info-CG1VohyH.js +1 -0
  62. package/dist/ui/assets/key-BC28VCjO.js +1 -0
  63. package/dist/ui/assets/{label-k0jYxoWW.js → label-C6atPuIh.js} +1 -1
  64. package/dist/ui/assets/lock-open-Bhp0UJlL.js +1 -0
  65. package/dist/ui/assets/mail-Biwn8WrV.js +1 -0
  66. package/dist/ui/assets/mic-Rq4BxU1R.js +1 -0
  67. package/dist/ui/assets/pause-C2l5G2Py.js +1 -0
  68. package/dist/ui/assets/pencil-CUbpCfeG.js +1 -0
  69. package/dist/ui/assets/play-CMAscR3a.js +1 -0
  70. package/dist/ui/assets/plus-DzvRxH4U.js +1 -0
  71. package/dist/ui/assets/radio-DfGzov4y.js +1 -0
  72. package/dist/ui/assets/refresh-cw-DZXu5FrG.js +1 -0
  73. package/dist/ui/assets/rotate-ccw-Dx92orJM.js +1 -0
  74. package/dist/ui/assets/scroll-area-CSoG2z53.js +1 -0
  75. package/dist/ui/assets/search-DB4w9YHW.js +1 -0
  76. package/dist/ui/assets/{select-ot0a6art.js → select-DlCT21_r.js} +1 -1
  77. package/dist/ui/assets/send-xi8HzUdc.js +1 -0
  78. package/dist/ui/assets/settings-pV0cF8Kf.js +1 -0
  79. package/dist/ui/assets/shield-nLNsomh_.js +1 -0
  80. package/dist/ui/assets/slider-Bb_PHFJT.js +1 -0
  81. package/dist/ui/assets/sparkles-CerRDYxk.js +1 -0
  82. package/dist/ui/assets/square-CcWzRWyG.js +1 -0
  83. package/dist/ui/assets/{switch-DXcELPsM.js → switch-CUsGuBNi.js} +1 -1
  84. package/dist/ui/assets/tabs-Ckfc7DGG.js +1 -0
  85. package/dist/ui/assets/terminal-C2SUZUAD.js +1 -0
  86. package/dist/ui/assets/{textarea-rp6vsOZl.js → textarea-BH6pI9Ax.js} +1 -1
  87. package/dist/ui/assets/trash-2-BZsMCfso.js +1 -0
  88. package/dist/ui/assets/useAudioDevices-Dpr_hn6i.js +41 -0
  89. package/dist/ui/assets/useHiveAgentsModelLoad-CHmtvNp4.js +1 -0
  90. package/dist/ui/assets/useProviders-C7FA6z4M.js +1 -0
  91. package/dist/ui/assets/vendor-radix-DUug7irY.js +63 -0
  92. package/dist/ui/assets/{vendor-react-CPJEWbIG.js → vendor-react-DYyYpuMy.js} +1 -1
  93. package/dist/ui/assets/volume-2-CBMYsuF3.js +1 -0
  94. package/dist/ui/assets/volume-x-vNFf2e4-.js +1 -0
  95. package/dist/ui/assets/wifi-DNv53AfN.js +1 -0
  96. package/dist/ui/assets/zap-Yed86Sh8.js +1 -0
  97. package/dist/ui/index.html +8 -7
  98. package/package.json +1 -1
  99. package/packages/cli/src/commands/doctor.ts +99 -44
  100. package/packages/cli/src/commands/onboard.ts +4 -2
  101. package/packages/core/src/agent/agent-catalog.ts +23 -23
  102. package/packages/core/src/agent/agent-loop.ts +48 -0
  103. package/packages/core/src/agent/context-compiler.ts +1 -1
  104. package/packages/core/src/agent/conversation-store.ts +14 -1
  105. package/packages/core/src/agent/llm-client.ts +41 -6
  106. package/packages/core/src/agent/llm-providers/nvidia.ts +39 -0
  107. package/packages/core/src/agent/llm-providers/openai-compat-base.ts +38 -2
  108. package/packages/core/src/agent/mcp-result-normalizer.ts +42 -0
  109. package/packages/core/src/agent/prompt-builder.ts +1 -1
  110. package/packages/core/src/agent/realtime-providers/gemini-live.ts +230 -0
  111. package/packages/core/src/agent/realtime-providers/index.ts +29 -0
  112. package/packages/core/src/agent/realtime-providers/interface.ts +108 -0
  113. package/packages/core/src/agent/skill-selector.ts +1 -1
  114. package/packages/core/src/agent/tool-selector.ts +2 -0
  115. package/packages/core/src/artifacts/store.ts +65 -0
  116. package/packages/core/src/canvas/canvas-manager.ts +128 -26
  117. package/packages/core/src/config/loader.ts +6 -4
  118. package/packages/core/src/events/tool-narration.ts +4 -0
  119. package/packages/core/src/gateway/delegation-groups.ts +4 -4
  120. package/packages/core/src/gateway/initializer.ts +17 -10
  121. package/packages/core/src/gateway/realtime/bridge-tools.ts +392 -0
  122. package/packages/core/src/gateway/realtime/index.ts +249 -0
  123. package/packages/core/src/gateway/realtime/prompt.ts +137 -0
  124. package/packages/core/src/gateway/realtime/protocol.ts +60 -0
  125. package/packages/core/src/gateway/realtime/voice-session.ts +441 -0
  126. package/packages/core/src/gateway/routes/providers.ts +1 -1
  127. package/packages/core/src/gateway/routes/setup.ts +3 -3
  128. package/packages/core/src/gateway/routes/system.ts +9 -4
  129. package/packages/core/src/gateway/server.ts +86 -1
  130. package/packages/core/src/gateway/slash-commands.ts +3 -1
  131. package/packages/core/src/gateway/webchat-turn.ts +34 -1
  132. package/packages/core/src/storage/collections.ts +10 -1
  133. package/packages/core/src/storage/onboarding.ts +39 -39
  134. package/packages/core/src/storage/seed.ts +21 -2
  135. package/packages/core/src/tool-runtime/embedded-worker.generated.ts +20 -0
  136. package/packages/core/src/tool-runtime/index.ts +56 -14
  137. package/packages/core/src/tools/index.ts +4 -2
  138. package/packages/core/src/tools/web/artifact-read.ts +162 -0
  139. package/packages/core/src/tools/web/browser-backend.ts +141 -44
  140. package/packages/core/src/tools/web/browser-click.ts +2 -2
  141. package/packages/core/src/tools/web/browser-extract.ts +2 -2
  142. package/packages/core/src/tools/web/browser-navigate.ts +2 -2
  143. package/packages/core/src/tools/web/browser-screenshot.ts +12 -5
  144. package/packages/core/src/tools/web/browser-script.ts +2 -2
  145. package/packages/core/src/tools/web/browser-service.ts +63 -384
  146. package/packages/core/src/tools/web/browser-session.ts +125 -0
  147. package/packages/core/src/tools/web/browser-type.ts +2 -2
  148. package/packages/core/src/tools/web/browser-wait.ts +2 -2
  149. package/packages/core/src/tools/web/computer-use.ts +553 -0
  150. package/packages/core/src/tools/web/index.ts +8 -1
  151. package/packages/core/src/tools/web/webview-backend.ts +439 -21
  152. package/packages/skills/src/bundled-data.generated.ts +752 -752
  153. package/dist/ui/assets/A2UIPage-DExwevBV.js +0 -8
  154. package/dist/ui/assets/AgentCreateForm-7PPShsUn.js +0 -1
  155. package/dist/ui/assets/AgentDetailPage-CiV4tz4P.js +0 -1
  156. package/dist/ui/assets/AgentNewPage-D3TtVwQf.js +0 -1
  157. package/dist/ui/assets/AgentsPage-C2DThet7.js +0 -10
  158. package/dist/ui/assets/ApiClientPage-Cowdq-0f.js +0 -3
  159. package/dist/ui/assets/ChannelsPage-D4IgglwJ.js +0 -8
  160. package/dist/ui/assets/DashboardPage-DAgVB7Iy.js +0 -6
  161. package/dist/ui/assets/LoginPage-CpU61b3u.js +0 -1
  162. package/dist/ui/assets/MeetingPage-DLmqHmm2.js +0 -1
  163. package/dist/ui/assets/ModelSelector-D4OaICwN.js +0 -1
  164. package/dist/ui/assets/Office3DPage-BvO66B0h.js +0 -4614
  165. package/dist/ui/assets/ProvidersPage-Bhb6Qr87.js +0 -1
  166. package/dist/ui/assets/RecoverPage-DaZrCpdB.js +0 -1
  167. package/dist/ui/assets/SettingsPage-BRD2F7up.js +0 -9
  168. package/dist/ui/assets/SetupPage-DKppgTja.js +0 -1
  169. package/dist/ui/assets/WebChatPage-CPtETNL5.js +0 -29
  170. package/dist/ui/assets/activity-BSosMryb.js +0 -1
  171. package/dist/ui/assets/agentCapabilities-VqxLmrF6.js +0 -1
  172. package/dist/ui/assets/arrow-left-C9Y6p4Jt.js +0 -1
  173. package/dist/ui/assets/arrow-right-BYfOLnTB.js +0 -1
  174. package/dist/ui/assets/arrow-up-right-D2trA3Ob.js +0 -1
  175. package/dist/ui/assets/calendar-rdd4nvY1.js +0 -1
  176. package/dist/ui/assets/check-DUq9uoNQ.js +0 -1
  177. package/dist/ui/assets/chevron-down-rPF4Pr1n.js +0 -1
  178. package/dist/ui/assets/chevron-left-Crzzf2sY.js +0 -1
  179. package/dist/ui/assets/chevron-right-DtMIvG9A.js +0 -1
  180. package/dist/ui/assets/chevron-up-CG0_KGBy.js +0 -1
  181. package/dist/ui/assets/circle-alert-CYt6gsDA.js +0 -1
  182. package/dist/ui/assets/circle-check-Zl32-jCa.js +0 -1
  183. package/dist/ui/assets/circle-x-BJXzKGmx.js +0 -1
  184. package/dist/ui/assets/copy-BmtJXmDe.js +0 -1
  185. package/dist/ui/assets/download-D3mYhuuL.js +0 -1
  186. package/dist/ui/assets/earth-BZzdDXFC.js +0 -1
  187. package/dist/ui/assets/ellipsis-vertical-BF705XvB.js +0 -1
  188. package/dist/ui/assets/external-link-gdpMTHUV.js +0 -1
  189. package/dist/ui/assets/eye-lSG04hI7.js +0 -1
  190. package/dist/ui/assets/file-text-CjQxcJvN.js +0 -1
  191. package/dist/ui/assets/gauge-DBryKhDK.js +0 -1
  192. package/dist/ui/assets/history-BC6ir9qU.js +0 -1
  193. package/dist/ui/assets/index-DyxoAvTq.js +0 -116
  194. package/dist/ui/assets/index-wML8DaUo.css +0 -2
  195. package/dist/ui/assets/info-BGBaIyKc.js +0 -1
  196. package/dist/ui/assets/key-D_CNJTY2.js +0 -1
  197. package/dist/ui/assets/loader-circle-RXdrfPsH.js +0 -1
  198. package/dist/ui/assets/lock-open-UB61lorP.js +0 -1
  199. package/dist/ui/assets/mail-C5bJ_dBt.js +0 -1
  200. package/dist/ui/assets/pause-BSTJvxDu.js +0 -1
  201. package/dist/ui/assets/pencil-C2B1Q7y2.js +0 -1
  202. package/dist/ui/assets/play-tcMbj-0p.js +0 -1
  203. package/dist/ui/assets/plus-BSZvyMND.js +0 -1
  204. package/dist/ui/assets/progress-DrI2UDu-.js +0 -1
  205. package/dist/ui/assets/radio-D9CrjAar.js +0 -1
  206. package/dist/ui/assets/refresh-cw-D7EB_fVv.js +0 -1
  207. package/dist/ui/assets/scroll-area-CfHn94Vb.js +0 -1
  208. package/dist/ui/assets/search-5S6LY69I.js +0 -1
  209. package/dist/ui/assets/send-Dax1tJ5b.js +0 -1
  210. package/dist/ui/assets/settings-97CL32lC.js +0 -1
  211. package/dist/ui/assets/shield-DwbCEZbF.js +0 -1
  212. package/dist/ui/assets/slider-CmE_z1Ii.js +0 -1
  213. package/dist/ui/assets/sparkles-CWMAzkpD.js +0 -1
  214. package/dist/ui/assets/square-B4dgTXI3.js +0 -1
  215. package/dist/ui/assets/tabs-CxiybXcw.js +0 -1
  216. package/dist/ui/assets/terminal-DoLedTPM.js +0 -1
  217. package/dist/ui/assets/trash-2-DxnVYOz8.js +0 -1
  218. package/dist/ui/assets/triangle-alert-Cka-BeIE.js +0 -1
  219. package/dist/ui/assets/useHiveAgentsModelLoad-BjnIsQKR.js +0 -1
  220. package/dist/ui/assets/useProviders-CueMz_mL.js +0 -1
  221. package/dist/ui/assets/vendor-radix-D0s_k6Gp.js +0 -63
  222. package/dist/ui/assets/volume-x-DLsli9cf.js +0 -1
  223. package/dist/ui/assets/wifi-BQRJGfLZ.js +0 -1
  224. package/dist/ui/assets/zap-DSR3CEce.js +0 -1
  225. /package/dist/ui/assets/{gateway-url-BlnabM5e.js → gateway-url-BzQV75Ig.js} +0 -0
  226. /package/dist/ui/assets/{useOfficeModel-Cy7cAyEn.js → useOfficeModel-Cc5VkReZ.js} +0 -0
  227. /package/dist/ui/assets/{utils-Dyb7SC2_.js → utils-lc8H6VGT.js} +0 -0
  228. /package/dist/ui/assets/{vendor-router-zpB-76nT.js → vendor-router-DCsSv_I7.js} +0 -0
@@ -1 +1 @@
1
- import{t as e}from"./rolldown-runtime-S-ySWqyJ.js";import{At as t}from"./vendor-radix-D0s_k6Gp.js";var n=e((e=>{var n=t();e.createRoot=n.createRoot,e.hydrateRoot=n.hydrateRoot}));export{n as t};
1
+ import{t as e}from"./rolldown-runtime-S-ySWqyJ.js";import{At as t}from"./vendor-radix-DUug7irY.js";var n=e((e=>{var n=t();e.createRoot=n.createRoot,e.hydrateRoot=n.hydrateRoot}));export{n as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-BRaPSYgN.js";var t=e(`Volume2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-BRaPSYgN.js";var t=e(`VolumeX`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`line`,{x1:`22`,x2:`16`,y1:`9`,y2:`15`,key:`1ewh16`}],[`line`,{x1:`16`,x2:`22`,y1:`9`,y2:`15`,key:`5ykzw1`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-BRaPSYgN.js";var t=e(`WifiOff`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),n=e(`Wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]);export{t as n,n as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-BRaPSYgN.js";var t=e(`Zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);export{t};
@@ -23,17 +23,18 @@
23
23
  <meta name="twitter:title" content="Hive">
24
24
  <meta property="og:description" content="Hive Agents">
25
25
  <meta name="twitter:description" content="Hive Agents">
26
- <script type="module" crossorigin src="/assets/index-DyxoAvTq.js"></script>
26
+ <script type="module" crossorigin src="/assets/index-Bi8qEmrK.js"></script>
27
27
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-S-ySWqyJ.js">
28
28
  <link rel="modulepreload" crossorigin href="/assets/vendor-charts-K3xcRl0X.js">
29
- <link rel="modulepreload" crossorigin href="/assets/vendor-router-zpB-76nT.js">
29
+ <link rel="modulepreload" crossorigin href="/assets/vendor-router-DCsSv_I7.js">
30
30
  <link rel="modulepreload" crossorigin href="/assets/vendor-query-Dj8xYhQD.js">
31
- <link rel="modulepreload" crossorigin href="/assets/vendor-radix-D0s_k6Gp.js">
31
+ <link rel="modulepreload" crossorigin href="/assets/vendor-radix-DUug7irY.js">
32
32
  <link rel="modulepreload" crossorigin href="/assets/dist-CD_qfA30.js">
33
- <link rel="modulepreload" crossorigin href="/assets/vendor-react-CPJEWbIG.js">
34
- <link rel="modulepreload" crossorigin href="/assets/utils-Dyb7SC2_.js">
35
- <link rel="modulepreload" crossorigin href="/assets/gateway-url-BlnabM5e.js">
36
- <link rel="stylesheet" crossorigin href="/assets/index-wML8DaUo.css">
33
+ <link rel="modulepreload" crossorigin href="/assets/createLucideIcon-BRaPSYgN.js">
34
+ <link rel="modulepreload" crossorigin href="/assets/vendor-react-DYyYpuMy.js">
35
+ <link rel="modulepreload" crossorigin href="/assets/utils-lc8H6VGT.js">
36
+ <link rel="modulepreload" crossorigin href="/assets/gateway-url-BzQV75Ig.js">
37
+ <link rel="stylesheet" crossorigin href="/assets/index-D2UhaSb0.css">
37
38
  </head>
38
39
 
39
40
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johpaz/hive-agents",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Tu colmena de agentes IA. Local-first. Multi-canal. Open source. Construido desde Colombia para el mundo.",
5
5
  "private": false,
6
6
  "bin": {
@@ -1,4 +1,3 @@
1
- import * as p from "@clack/prompts";
2
1
  import * as fs from "fs";
3
2
  import * as path from "path";
4
3
  import { execSync } from "child_process";
@@ -169,7 +168,7 @@ export async function doctor(): Promise<void> {
169
168
  name: "Componentes",
170
169
  status: "error",
171
170
  message: `faltan: ${faltantes.join(", ")}`,
172
- hint: "La base está incompleta. Restaurá una copia o reiniciá para re-sembrar.",
171
+ hint: "La base está incompleta. Restaura una copia o reinicia para volver a sembrar.",
173
172
  });
174
173
  } else {
175
174
  const bytes = dirSize(getDbFile());
@@ -181,22 +180,49 @@ export async function doctor(): Promise<void> {
181
180
  });
182
181
  }
183
182
 
184
- // Lectura real: que los archivos existan no prueba que se puedan leer.
183
+ // Datos reales: que los archivos existan y se puedan leer no prueba que
184
+ // haya algo adentro. Una base vacía abre perfecto y deja a Hive sin
185
+ // agentes, sin modelos y sin tools — que es la falla que el usuario ve
186
+ // como "no responde", no como "la BD está mal".
185
187
  try {
186
- const { ensureHiveDb } = await import("@johpaz/hive-agents-core/storage/bootstrap");
188
+ // Sólo lectura: se abre la base tal como está. Sembrarla acá haría que
189
+ // el diagnóstico se aprobara a sí mismo, además de reescribir datos.
187
190
  const { col } = await import("@johpaz/hive-agents-core/storage/hive");
188
- await ensureHiveDb();
189
191
 
190
- let filas = 0;
191
- for (const nombre of ["agents", "models", "providers", "tools", "skills"]) {
192
- filas += await (await col(nombre)).count();
192
+ const esenciales = ["agents", "models", "providers", "tools", "skills"];
193
+ const conteos: Record<string, number> = {};
194
+ for (const nombre of esenciales) {
195
+ conteos[nombre] = await (await col(nombre)).count();
196
+ }
197
+
198
+ const total = Object.values(conteos).reduce((a, b) => a + b, 0);
199
+ const vacias = esenciales.filter((nombre) => conteos[nombre] === 0);
200
+ const detalle = esenciales.map((nombre) => `${conteos[nombre]} ${nombre}`).join(", ");
201
+
202
+ if (total === 0) {
203
+ checks.push({
204
+ category: "Integridad",
205
+ name: "Datos",
206
+ status: "error",
207
+ message: "la base está vacía",
208
+ hint: "Arranca el gateway con 'hive start': siembra los datos por defecto al iniciar.",
209
+ });
210
+ } else if (vacias.length > 0) {
211
+ checks.push({
212
+ category: "Integridad",
213
+ name: "Datos",
214
+ status: "warn",
215
+ message: `${detalle} — sin registros en: ${vacias.join(", ")}`,
216
+ hint: "Ejecuta 'hive migrate' para volver a sembrar lo que falta.",
217
+ });
218
+ } else {
219
+ checks.push({
220
+ category: "Integridad",
221
+ name: "Datos",
222
+ status: "ok",
223
+ message: detalle,
224
+ });
193
225
  }
194
- checks.push({
195
- category: "Integridad",
196
- name: "Lectura",
197
- status: "ok",
198
- message: `${filas} filas leídas de 5 colecciones`,
199
- });
200
226
  } catch (e) {
201
227
  const mensaje = (e as Error).message;
202
228
  // "Cannot acquire lock" significa que otro proceso la tiene abierta —el
@@ -205,12 +231,12 @@ export async function doctor(): Promise<void> {
205
231
  const enUso = /already open|acquire lock|locked/i.test(mensaje);
206
232
  checks.push({
207
233
  category: "Integridad",
208
- name: "Lectura",
234
+ name: "Datos",
209
235
  status: enUso ? "warn" : "error",
210
236
  message: enUso ? "en uso por otro proceso — no se pudo verificar" : `la base no se pudo leer: ${mensaje}`,
211
237
  hint: enUso
212
- ? "Detené el gateway (hive stop) y volvé a correr el diagnóstico."
213
- : "Puede haber quedado corrupta. Si tenés una copia de <HIVE_HOME>/data, restaurala.",
238
+ ? "Detén el gateway (hive stop) y vuelve a correr el diagnóstico."
239
+ : "Puede haber quedado corrupta. Si tienes una copia de <HIVE_HOME>/data, restáurala.",
214
240
  });
215
241
  }
216
242
 
@@ -251,9 +277,7 @@ export async function doctor(): Promise<void> {
251
277
  // Workspace — leer desde agents.workspace en la BD
252
278
  let workspacePath: string | null = null;
253
279
  try {
254
- const { ensureHiveDb } = await import("@johpaz/hive-agents-core/storage/bootstrap");
255
280
  const { col } = await import("@johpaz/hive-agents-core/storage/hive");
256
- await ensureHiveDb();
257
281
  const agentsCol = await col<{ role: string; workspace: string | null }>("agents");
258
282
  const coordinator = (await agentsCol.findBy("role", "coordinator"))[0];
259
283
  const ws = coordinator?.doc.workspace;
@@ -270,9 +294,7 @@ export async function doctor(): Promise<void> {
270
294
 
271
295
  // Seed Data — verificar que los datos del seed estén actualizados
272
296
  try {
273
- const { ensureHiveDb } = await import("@johpaz/hive-agents-core/storage/bootstrap");
274
297
  const { col } = await import("@johpaz/hive-agents-core/storage/hive");
275
- await ensureHiveDb();
276
298
  const { SEED_DATA } = await import("@johpaz/hive-agents-core/storage/seed");
277
299
 
278
300
  // Tools: comparar count en BD vs seed
@@ -368,9 +390,7 @@ export async function doctor(): Promise<void> {
368
390
  // para que una persona decida. Nada la resuelve automáticamente, así que
369
391
  // se acumulan hasta que alguien las revisa — doctor las saca a la luz.
370
392
  try {
371
- const { ensureHiveDb } = await import("@johpaz/hive-agents-core/storage/bootstrap");
372
393
  const { col } = await import("@johpaz/hive-agents-core/storage/hive");
373
- await ensureHiveDb();
374
394
 
375
395
  const proposalsCol = await col<{ status: string; type: string; agent_id: string }>("agentProposals");
376
396
  const pending = (await proposalsCol.scan({})).filter(
@@ -406,25 +426,51 @@ export async function doctor(): Promise<void> {
406
426
  });
407
427
  }
408
428
 
409
- // Navegador — qué backend va a usar el agente y si el elegido es viable acá.
429
+ // Navegador — las browser tools necesitan un Chromium instalado.
410
430
  try {
411
- const { resolveBackendKind, isWebViewSupported, findChrome } = await import(
412
- "@johpaz/hive-agents-core/tools/web/browser-backend"
413
- );
431
+ const { resolveBackendKind, isWebViewSupported, resolveWebViewEngine, findChrome, browserInstallHint } =
432
+ await import("@johpaz/hive-agents-core/tools/web/browser-backend");
414
433
  const config = loadConfig();
415
- const kind = resolveBackendKind(config.tools?.browser?.backend);
434
+ // Con una config vieja (`backend: "agent-browser"`) esto deja el aviso en el log.
435
+ resolveBackendKind(config.tools?.browser?.backend);
416
436
 
417
- if (kind === "webview" && !isWebViewSupported()) {
437
+ if (!isWebViewSupported()) {
418
438
  checks.push({
419
439
  category: "Navegador",
420
- name: "Backend",
440
+ name: "Motor",
421
441
  status: "error",
422
- message: "webview elegido pero no hay motor disponible",
423
- hint: "WebKit sólo existe en macOS. Instalá Chrome, definí BUN_CHROME_PATH, o usá el backend agent-browser.",
442
+ message: "no se encontró ningún navegador",
443
+ hint: browserInstallHint(),
444
+ });
445
+ } else if (resolveWebViewEngine() === "webkit") {
446
+ // Sin CDP: el snapshot cae al recorrido del DOM, no hay sesión persistente
447
+ // y computer_use_task vuelve a los eventos sintéticos.
448
+ checks.push({
449
+ category: "Navegador",
450
+ name: "Motor",
451
+ status: "warn",
452
+ message: "WebKit (sin CDP: sin sesión persistente ni clics reales)",
453
+ hint: "Instala Chrome o Chromium para tener el motor completo.",
424
454
  });
425
455
  } else {
426
- const detalle = kind === "webview" ? `motor ${findChrome() ? "chrome" : "webkit"}, in-process` : "Chrome via CLI";
427
- checks.push({ category: "Navegador", name: "Backend", status: "ok", message: `${kind} (${detalle})` });
456
+ checks.push({
457
+ category: "Navegador",
458
+ name: "Motor",
459
+ status: "ok",
460
+ message: `Bun.WebView · chrome (${findChrome()})`,
461
+ });
462
+ }
463
+
464
+ // agent-browser se retiró: lo que dejó ocupando disco no lo borra el doctor.
465
+ const cacheViejo = path.join(getHiveDirConst(), "agent-browser");
466
+ if (fs.existsSync(cacheViejo)) {
467
+ checks.push({
468
+ category: "Navegador",
469
+ name: "Caché de agent-browser",
470
+ status: "warn",
471
+ message: "quedó el caché del backend retirado",
472
+ hint: `Ya no se usa; puedes borrar ${cacheViejo} (y ~/.cache/puppeteer si sólo lo usaba él).`,
473
+ });
428
474
  }
429
475
  } catch (e) {
430
476
  checks.push({
@@ -460,20 +506,29 @@ export async function doctor(): Promise<void> {
460
506
  const warns = checks.filter((c) => c.status === "warn");
461
507
 
462
508
  if (errors.length > 0) {
509
+ // Acá se ofrecía ejecutar el onboarding. Ese comando ya no existe —la
510
+ // configuración inicial se hace desde la UI al arrancar el gateway—, así
511
+ // que preguntarlo dejaba el diagnóstico colgado esperando una respuesta
512
+ // que no llevaba a ninguna parte, y encima rompía cualquier uso en CI.
463
513
  console.log(`❌ ${errors.length} error(es) encontrado(s)`);
464
-
465
- const fix = await p.confirm({
466
- message: "¿Deseas ejecutar el onboarding para reparar?",
467
- initialValue: false,
468
- });
469
-
470
- if (fix) {
471
- const { onboard } = await import("./onboard");
472
- await onboard();
473
- }
514
+ console.log(" Revisa las pistas 💡 de arriba. La configuración inicial se completa");
515
+ console.log(" arrancando el gateway con 'hive start' y abriendo la UI.");
474
516
  } else if (warns.length > 0) {
475
517
  console.log(`⚠️ ${warns.length} advertencia(s)`);
476
518
  } else {
477
519
  console.log("✅ Todo en orden");
478
520
  }
521
+
522
+ // El diagnóstico terminó, pero el proceso no: quedan la base abierta y la
523
+ // conexión keep-alive del health check del gateway. Sin esto, `hive doctor`
524
+ // imprime todo y se cuelga para siempre — invisible a ojo, letal en un script.
525
+ try {
526
+ const { closeHiveDb } = await import("@johpaz/hive-agents-core/storage/hivedb");
527
+ closeHiveDb();
528
+ } catch {
529
+ /* la base ni se abrió */
530
+ }
531
+
532
+ // Y sale con el veredicto: 1 si encontró errores, para que sirva en CI.
533
+ process.exit(errors.length > 0 ? 1 : 0);
479
534
  }
@@ -97,7 +97,7 @@ const DEFAULT_MODELS: Record<string, string> = {
97
97
  nvidia: "nvidia/nvidia/nemotron-3-super-120b-a12b",
98
98
  "z-ai": "glm-5.2",
99
99
  minimax: "MiniMax-M3",
100
- hiveagents: "Qwen-AgentWorld-35B-A3B-UD-Q4_K_M.gguf",
100
+ hiveagents: "Qwen3.6-35B-A3B-UD-Q4_K_M.gguf",
101
101
  };
102
102
 
103
103
  const PROVIDER_BASE_URLS: Record<string, string> = {
@@ -208,7 +208,9 @@ const AVAILABLE_MODELS: Record<string, Array<{ value: string; label: string; hin
208
208
  { value: "MiniMax-M2.7", label: "MiniMax M2.7", hint: "200K contexto" },
209
209
  ],
210
210
  hiveagents: [
211
- { value: "Qwen-AgentWorld-35B-A3B-UD-Q4_K_M.gguf", label: "Qwen-AgentWorld 35B MoE (Recomendado)", hint: "MoE 22.1GB — optimizado para agentes, tool use y MCP" },
211
+ { value: "Qwen3.6-35B-A3B-UD-Q4_K_M.gguf", label: "Qwen3.6 35B MoE (Recomendado)", hint: "MoE 22.7GB — el más rápido: 62.7 t/s, carga en 8s" },
212
+ { value: "Qwen3.8-27B-UD-Q4_K_XL.gguf", label: "Qwen3.8 27B Dense + MTP", hint: "Denso 17.9GB — 25.3 t/s, carga en 8s" },
213
+ { value: "DeepSeek-V4-Flash-UD-IQ2_XXS-00001-of-00003.gguf", label: "DeepSeek V4 Flash 90 GB", hint: "MoE 90.9GB, sólo texto — 12.8 t/s y ~91s de carga" },
212
214
  ],
213
215
  };
214
216
 
@@ -37,7 +37,7 @@ ${s.workflow.map((step, index) => `${index + 1}. ${step}`).join("\n")}
37
37
 
38
38
  # QUÉ NO HACES
39
39
  ${s.prohibitions.map((rule) => `- ${rule}`).join("\n")}
40
- - No hablás con el usuario, no pedís confirmaciones directas y no delegás a otros agentes.
40
+ - No hablas con el usuario, no pedís confirmaciones directas y no delegas a otros agentes.
41
41
  - No ampliás el alcance ni usás tools fuera del loadout autorizado.
42
42
  - No declarás éxito sin evidencia comprobable para cada criterio.
43
43
 
@@ -72,10 +72,10 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
72
72
  role: "Tu dominio es investigación web, contraste de fuentes y síntesis basada en evidencia.",
73
73
  receives: "Una pregunta acotada, contexto relevante, restricciones de actualidad y criterios de aceptación.",
74
74
  workflow: [
75
- "Convertí la pregunta en consultas concretas y buscá fuentes primarias o autorizadas.",
76
- "Leé las fuentes relevantes y separá hechos, inferencias y datos no confirmados.",
75
+ "Convertí la pregunta en consultas concretas y busca fuentes primarias o autorizadas.",
76
+ "Lee las fuentes relevantes y separa hechos, inferencias y datos no confirmados.",
77
77
  "Contrastá afirmaciones sensibles o discutidas con más de una fuente.",
78
- "Entregá una síntesis concisa con referencias y fechas cuando sean relevantes.",
78
+ "Entrega una síntesis concisa con referencias y fechas cuando sean relevantes.",
79
79
  ],
80
80
  prohibitions: [...COMMON_PROHIBITIONS, "No automatizás formularios ni realizás acciones en sitios."],
81
81
  quality: "Cada afirmación material debe poder rastrearse a una fuente accesible; los desacuerdos se presentan explícitamente.",
@@ -92,10 +92,10 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
92
92
  role: "Tu dominio es navegación y automatización web renderizada.",
93
93
  receives: "Una acción web autorizada, URL inicial, datos permitidos, estado final esperado y límites de seguridad.",
94
94
  workflow: [
95
- "Abrí el sitio y verificá que corresponda al objetivo.",
96
- "Inspeccioná el estado antes de interactuar y usá selectores estables.",
97
- "Ejecutá solamente los clicks, escritura y esperas necesarios.",
98
- "Verificá el estado final mediante extracción y captura de pantalla.",
95
+ "Abre el sitio y verifica que corresponda al objetivo.",
96
+ "Inspeccioná el estado antes de interactuar y usa selectores estables.",
97
+ "Ejecuta solamente los clicks, escritura y esperas necesarios.",
98
+ "Verifica el estado final mediante extracción y captura de pantalla.",
99
99
  ],
100
100
  prohibitions: [...COMMON_PROHIBITIONS, "No confirmás compras, envíos, borrados o publicaciones si el principal no autorizó explícitamente ese efecto."],
101
101
  quality: "La entrega incluye URL final, estado observado y evidencia visual o estructurada posterior a la acción.",
@@ -112,10 +112,10 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
112
112
  role: "Tu dominio es operaciones seguras sobre archivos y carpetas del workspace.",
113
113
  receives: "Paths relativos o autorizados, contenido solicitado, operación exacta y estado final esperado.",
114
114
  workflow: [
115
- "Resolvé todos los paths contra el workspace y comprobá su estado inicial.",
115
+ "Resuelve todos los paths contra el workspace y comprueba su estado inicial.",
116
116
  "Aplicá la mínima operación necesaria sin tocar paths ajenos.",
117
117
  "Volvé a leer o listar el resultado para comprobarlo.",
118
- "Reportá paths exactos, cambios y evidencia de readback.",
118
+ "Reporta paths exactos, cambios y evidencia de readback.",
119
119
  ],
120
120
  prohibitions: [...COMMON_PROHIBITIONS, "No ejecutás comandos shell ni modificás repositorios fuera de la operación de archivos pedida."],
121
121
  quality: "Todos los paths permanecen dentro del workspace y su contenido o ausencia final se comprueba después de la operación.",
@@ -134,10 +134,10 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
134
134
  workflow: [
135
135
  "Inspeccioná el repositorio, convenciones y estado antes de editar.",
136
136
  "Determiná la causa o el diseño mínimo y modificá solo archivos pertinentes.",
137
- "Ejecutá checks, tests o builds proporcionales al riesgo.",
138
- "Entregá archivos cambiados, evidencia de validación y riesgos restantes.",
137
+ "Ejecuta checks, tests o builds proporcionales al riesgo.",
138
+ "Entrega archivos cambiados, evidencia de validación y riesgos restantes.",
139
139
  ],
140
- prohibitions: [...COMMON_PROHIBITIONS, "No sobrescribís cambios ajenos, no publicás y no delegás a subagentes CLI."],
140
+ prohibitions: [...COMMON_PROHIBITIONS, "No sobrescribís cambios ajenos, no publicás y no delegas a subagentes CLI."],
141
141
  quality: "El cambio satisface el comportamiento pedido, preserva compatibilidad y pasa las validaciones relevantes.",
142
142
  routingExamples: ["implementar una función", "arreglar un bug", "ejecutar tests de un proyecto"],
143
143
  tools: ["fs_*", "cli_exec"],
@@ -153,10 +153,10 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
153
153
  role: "Tu dominio es lectura y generación de archivos Office estructurados.",
154
154
  receives: "Archivo de entrada o especificación del documento, formato final, contenido y path autorizado.",
155
155
  workflow: [
156
- "Inspeccioná entradas y confirmá el formato solicitado.",
156
+ "Inspeccioná entradas y confirma el formato solicitado.",
157
157
  "Generá o extraé contenido preservando estructura y datos.",
158
- "Comprobá que el archivo existe, no está vacío y puede reabrirse.",
159
- "Entregá el path final, resumen de contenido y prueba de reapertura.",
158
+ "Comprueba que el archivo existe, no está vacío y puede reabrirse.",
159
+ "Entrega el path final, resumen de contenido y prueba de reapertura.",
160
160
  ],
161
161
  prohibitions: [...COMMON_PROHIBITIONS, "No editás formatos binarios con tools genéricas de filesystem."],
162
162
  quality: "El artefacto debe abrir sin error con la tool lectora correspondiente y contener la estructura solicitada.",
@@ -174,9 +174,9 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
174
174
  receives: "Sesión, surfaceId, flujo solicitado, datos, acciones permitidas y criterios visuales.",
175
175
  workflow: [
176
176
  "Diseñá una jerarquía pequeña con IDs únicos y un root explícito.",
177
- "Creá la superficie antes de enviar componentes.",
177
+ "Crea la superficie antes de enviar componentes.",
178
178
  "Enviá componentes válidos y después el data model enlazado.",
179
- "Comprobá acknowledgements, IDs y paths; liberá la superficie al cancelar.",
179
+ "Comprueba acknowledgements, IDs y paths; liberá la superficie al cancelar.",
180
180
  ],
181
181
  prohibitions: [...COMMON_PROHIBITIONS, "No interpretás acciones del usuario ni conversás; los eventos vuelven al principal."],
182
182
  quality: "La superficie usa el catálogo v0.9, no tiene referencias rotas y sus bindings apuntan a paths válidos.",
@@ -194,9 +194,9 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
194
194
  receives: "Una automatización que Hive debe ejecutar después, su horario o recurrencia, timezone, canal y comportamiento esperado.",
195
195
  workflow: [
196
196
  "Normalizá fecha, recurrencia y timezone sin cambiar la intención.",
197
- "Creá o modificá únicamente el job solicitado.",
197
+ "Crea o modificá únicamente el job solicitado.",
198
198
  "Consultá el job persistido y su próxima ejecución.",
199
- "Entregá ID, estado, timezone y next_run_at.",
199
+ "Entrega ID, estado, timezone y next_run_at.",
200
200
  ],
201
201
  prohibitions: [
202
202
  ...COMMON_PROHIBITIONS,
@@ -223,9 +223,9 @@ const CATALOG_PERSONAS: CatalogPersona[] = [
223
223
  receives: "Endpoint autorizado, método, headers permitidos, payload, status esperado y esquema relevante.",
224
224
  workflow: [
225
225
  "Validá método, host, payload y alcance antes del request.",
226
- "Ejecutá una sola operación idempotente o explícitamente autorizada.",
227
- "Comprobá status, headers y forma de la respuesta.",
228
- "Entregá evidencia saneada sin secretos.",
226
+ "Ejecuta una sola operación idempotente o explícitamente autorizada.",
227
+ "Comprueba status, headers y forma de la respuesta.",
228
+ "Entrega evidencia saneada sin secretos.",
229
229
  ],
230
230
  prohibitions: [...COMMON_PROHIBITIONS, "No repetís mutaciones automáticamente ni cambiás método, host o payload para forzar éxito."],
231
231
  quality: "El status y contrato observados coinciden con los criterios y la evidencia no contiene credenciales.",
@@ -95,6 +95,50 @@ export async function synthesizeFinalResponse(
95
95
  )
96
96
  }
97
97
 
98
+ type LoadoutContext = {
99
+ tools: Array<{ type: string; function?: { name?: string } }>
100
+ allTools: Array<{ name: string }>
101
+ }
102
+
103
+ /**
104
+ * Adds artifact_read to the loadout the moment a tool result hands the model an
105
+ * `artifact_ref` it will need to open.
106
+ *
107
+ * mcp-result-normalizer.ts moves oversized MCP text results out of the context
108
+ * window and leaves a reference behind. Discovery (search_knowledge) can find
109
+ * the reader, but that costs an iteration and assumes the model thinks to look:
110
+ * in the incident this comes from, it reached for artifact_inspect instead, got
111
+ * metadata, and burned the rest of its budget on `find` and `env` before the
112
+ * turn died on an empty synthesis. Image refs are excluded — those are carried
113
+ * to the UI, not read back by the model.
114
+ *
115
+ * Returns true when the loadout changed.
116
+ */
117
+ export function injectArtifactReadIfNeeded(toolResult: unknown, ctx: LoadoutContext): boolean {
118
+ if (!Array.isArray(toolResult)) return false
119
+
120
+ const needsReader = toolResult.some((block) =>
121
+ !!block && typeof block === "object" &&
122
+ (block as { type?: unknown }).type === "artifact_ref" &&
123
+ !String((block as { mime_type?: unknown }).mime_type ?? "").startsWith("image/")
124
+ )
125
+ if (!needsReader) return false
126
+ if (ctx.tools.some((t) => t.function?.name === "artifact_read")) return false
127
+
128
+ const reader = ctx.allTools.find((t) => t.name === "artifact_read")
129
+ if (!reader) return false
130
+
131
+ ctx.tools.push({
132
+ type: "function",
133
+ function: {
134
+ name: reader.name,
135
+ description: (reader as any).description ?? "",
136
+ parameters: (reader as any).parameters ?? { type: "object", properties: {} },
137
+ },
138
+ } as LoadoutContext["tools"][number])
139
+ return true
140
+ }
141
+
98
142
  /** Bounds a single async operation to its own timeout window, independent of any caller. */
99
143
  export async function withTimeout<T>(op: () => Promise<T>, timeoutMs: number): Promise<T> {
100
144
  let timer: ReturnType<typeof setTimeout>
@@ -672,6 +716,10 @@ export async function* runAgent(
672
716
  }
673
717
  }
674
718
 
719
+ if (injectArtifactReadIfNeeded(toolResultJS, ctx)) {
720
+ log.info("[agent-loop] Tool result carries an artifact_ref — injected artifact_read into loadout")
721
+ }
722
+
675
723
  // Encode TOON only for LLM consumption (with cost calculation)
676
724
  const toolResultLLM = formatToolResult(toolResultJS, cleanModel)
677
725
 
@@ -596,7 +596,7 @@ export async function compileContext(opts: {
596
596
  .filter((line): line is string => !!line)
597
597
 
598
598
  if (causalLines.length > 0) {
599
- systemPrompt += `\n\n# CAUSAL CONTEXT (decisiones y tool calls de este turno, previos a la compactación — priorizá la conversación actual; usalo solo para no repetir algo que ya funcionó o ya falló)\n${causalLines.join("\n")}\n`
599
+ systemPrompt += `\n\n# CAUSAL CONTEXT (decisiones y tool calls de este turno, previos a la compactación — prioriza la conversación actual; úsalo solo para no repetir algo que ya funcionó o ya falló)\n${causalLines.join("\n")}\n`
600
600
  log.info(`[context-compiler] [STEP-9d] ✅ Injected ${causalLines.length} causal context item(s)`)
601
601
  }
602
602
  } catch (err) {
@@ -45,13 +45,26 @@ export interface StoredMessage {
45
45
  // stays clean and the wording can evolve without a migration.
46
46
 
47
47
  export const INTERNAL_SOURCES: ReadonlySet<string> =
48
- new Set(["task_complete", "delegation_summary", "legacy_internal"])
48
+ new Set(["task_complete", "delegation_summary", "legacy_internal", "realtime_chat"])
49
49
 
50
50
  export function isInternalSource(source: string | null | undefined): boolean {
51
51
  return !!source && INTERNAL_SOURCES.has(source)
52
52
  }
53
53
 
54
54
  export function formatInternalEvent(source: string, content: string): string {
55
+ // La charla hablada sí salió del usuario, pero la sesión de voz ya la
56
+ // respondió: es contexto, no trabajo por hacer. Sin esta distinción el
57
+ // coordinador leía cada frase suelta de una llamada como un pedido nuevo y
58
+ // delegaba una tarea por cada una.
59
+ if (source === "realtime_chat") {
60
+ return `<hive:voice_context>\n` +
61
+ `Fragmento de una conversación hablada que la voz de Hive YA respondió en el momento. ` +
62
+ `Es contexto de lo que vinieron hablando, NO un pedido pendiente: no ejecutes ni delegues nada por esto. ` +
63
+ `El trabajo real llega siempre como un mensaje aparte y explícito.\n\n` +
64
+ `${content}\n` +
65
+ `</hive:voice_context>`
66
+ }
67
+
55
68
  return `<hive:internal_event source="${source}">\n` +
56
69
  `Evento interno del sistema — NO es un mensaje del usuario. No lo cites literalmente, no expongas IDs internos (task_id, worker_id) ni JSON crudo. Respondé al usuario de forma natural y breve.\n\n` +
57
70
  `${content}\n` +
@@ -182,20 +182,55 @@ export async function callLLM(options: LLMCallOptions): Promise<LLMResponse> {
182
182
  const cleanModel = options.model.replace(new RegExp(`^${options.provider}\\/`), "")
183
183
  const status = extractErrorStatus(err)
184
184
  const modelUnavailable = status === 404 || status === 410
185
- const msg = modelUnavailable
186
- ? `El modelo "${cleanModel}" ya no existe en ${options.provider} (HTTP ${status}). `
187
- + `El proveedor lo retiró de su catálogo; reintentar no sirve. `
188
- + `Elegí otro modelo en Ajustes → Proveedores.`
189
- : (err as Error).message
185
+ const msg = describeProviderFailure(err, status, options.provider, cleanModel)
190
186
  log.error(`[llm-client] Error calling ${options.provider}/${cleanModel}: ${msg}`, err)
191
187
  return {
192
- content: `[LLM Error] ${msg}`,
188
+ content: `${LLM_ERROR_PREFIX} ${msg}`,
193
189
  stop_reason: "error",
194
190
  error: { message: msg, status, modelUnavailable },
195
191
  }
196
192
  }
197
193
  }
198
194
 
195
+ /**
196
+ * Marks content that is a provider failure rather than something the agent
197
+ * said. webchat-turn.ts keys the failed-turn UI off this prefix, and
198
+ * agent-loop.ts keeps such content out of the conversation history.
199
+ */
200
+ export const LLM_ERROR_PREFIX = "[LLM Error]"
201
+
202
+ /**
203
+ * Turns a provider failure into something the user can act on.
204
+ *
205
+ * The raw SDK text is written for whoever is reading a stack trace: "429 status
206
+ * code (no body)" showed up verbatim in the chat and says nothing about what
207
+ * happened (the account hit its rate limit) or what to do about it. Statuses
208
+ * without a specific mapping keep the original message — a wrong explanation is
209
+ * worse than a technical one.
210
+ */
211
+ export function describeProviderFailure(
212
+ err: unknown,
213
+ status: number | undefined,
214
+ provider: string,
215
+ cleanModel: string,
216
+ ): string {
217
+ if (status === 404 || status === 410) {
218
+ return `El modelo "${cleanModel}" ya no existe en ${provider} (HTTP ${status}). `
219
+ + `El proveedor lo retiró de su catálogo; reintentar no sirve. `
220
+ + `Elige otro modelo en Ajustes → Proveedores.`
221
+ }
222
+ if (status === 429) {
223
+ return `${provider} está limitando las peticiones (HTTP 429) y los reintentos tampoco pasaron. `
224
+ + `Es el límite de uso de tu cuenta, no un problema del modelo: esperá unos minutos, `
225
+ + `revisa tu cuota con el proveedor, o cambiá de modelo en Ajustes → Proveedores.`
226
+ }
227
+ if (status === 401 || status === 403) {
228
+ return `${provider} rechazó la API key (HTTP ${status}). `
229
+ + `Revisa que siga siendo válida y tenga acceso a "${cleanModel}" en Ajustes → Proveedores.`
230
+ }
231
+ return (err as Error).message
232
+ }
233
+
199
234
  /** Provider SDKs disagree on where the HTTP status lands; check every shape we've seen. */
200
235
  function extractErrorStatus(err: unknown): number | undefined {
201
236
  const e = err as { status?: number; statusCode?: number; response?: { status?: number } }
@@ -1,5 +1,44 @@
1
1
  import { OpenAICompatBase } from "./openai-compat-base"
2
+ import type { LLMCallOptions } from "../llm-client"
3
+
4
+ /**
5
+ * NIM mantiene el razonamiento APAGADO por defecto en su endpoint compatible
6
+ * con OpenAI, y el interruptor no es el `reasoning_effort` de OpenAI sino
7
+ * `chat_template_kwargs`, con una clave distinta por familia de modelo.
8
+ *
9
+ * Verificado en vivo contra integrate.api.nvidia.com (2026-08-15):
10
+ * `z-ai/glm-5.2` no emite un solo `reasoning_content` sin esto — el delta trae
11
+ * únicamente `role` y `content` — y sí lo emite con `enable_thinking`. Por eso
12
+ * la app no mostraba razonamiento con los modelos de NVIDIA: no llegaba.
13
+ *
14
+ * Las familias que no están acá se dejan en paz a propósito. Nemotron 3 ya
15
+ * emite `reasoning_content` sin ningún kwarg (también verificado), y mandarle
16
+ * una clave que su plantilla no acepta es justamente lo que rompe la llamada.
17
+ */
18
+ const THINKING_KWARGS: Array<{ pattern: RegExp; kwargs: Record<string, unknown> }> = [
19
+ // Verificado con z-ai/glm-5.2.
20
+ { pattern: /glm/i, kwargs: { enable_thinking: true, clear_thinking: false } },
21
+ // Verificado con minimaxai/minimax-m3.
22
+ { pattern: /minimax/i, kwargs: { thinking_mode: "enabled" } },
23
+ // Documentado por NVIDIA, sin verificar: moonshotai/kimi-k2.6 responde 404
24
+ // en la cuenta con la que se probó. Si la plantilla lo rechaza, el reintento
25
+ // de openai-compat-base repite la llamada sin kwargs.
26
+ { pattern: /kimi|deepseek/i, kwargs: { thinking: true } },
27
+ { pattern: /qwen|qwq/i, kwargs: { enable_thinking: true } },
28
+ ]
2
29
 
3
30
  export class NvidiaProvider extends OpenAICompatBase {
4
31
  constructor() { super("nvidia") }
32
+
33
+ protected modifyRequestBody(body: any, options: LLMCallOptions): any {
34
+ if (!options.thinking?.enabled) return body
35
+
36
+ const match = THINKING_KWARGS.find(({ pattern }) => pattern.test(options.model))
37
+ if (!match) return body
38
+
39
+ return {
40
+ ...body,
41
+ chat_template_kwargs: { ...(body.chat_template_kwargs ?? {}), ...match.kwargs },
42
+ }
43
+ }
5
44
  }