@johpaz/hive-agents 0.0.37 → 0.0.39

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 (223) hide show
  1. package/README.md +18 -18
  2. package/dist/hive.js +3529 -2702
  3. package/dist/tool-worker.js +2110 -1856
  4. package/dist/ui/assets/AgentCreateForm-BTCzFbca.js +1 -0
  5. package/dist/ui/assets/AgentDetailPage-o27TRSVw.js +1 -0
  6. package/dist/ui/assets/AgentNewPage-400cCpYt.js +1 -0
  7. package/dist/ui/{dist/assets/AgentsPage-YvSgWRiw.js → assets/AgentsPage-C-GSRk-N.js} +5 -5
  8. package/dist/ui/assets/ApiClientPage-BOTpz6oP.js +3 -0
  9. package/dist/ui/assets/{CanvasPage-DtMwGvxf.js → CanvasPage-Cvs5ctza.js} +7 -7
  10. package/dist/ui/assets/ChannelsPage-C5m_L7P9.js +8 -0
  11. package/dist/ui/{dist/assets/DashboardPage-ghl1ZguH.js → assets/DashboardPage-CztbRQdm.js} +2 -2
  12. package/dist/ui/assets/{LoginPage-CAmSI9Vy.js → LoginPage-OMsrx5oj.js} +1 -1
  13. package/dist/ui/assets/LogsPage-CcYYwjgF.js +1 -0
  14. package/dist/ui/{dist/assets/MeetingPage-WjjGOqqU.js → assets/MeetingPage-CrKVAfe6.js} +1 -1
  15. package/dist/ui/assets/{NotFound-BMeQSGcG.js → NotFound-GbAJDgoD.js} +1 -1
  16. package/dist/ui/assets/ProvidersPage-uqPcZUSV.js +1 -0
  17. package/dist/ui/{dist/assets/RecoverPage-DpW3l-yv.js → assets/RecoverPage-CwB2ByCU.js} +1 -1
  18. package/dist/ui/assets/SettingsPage-DKLlye0z.js +9 -0
  19. package/dist/ui/assets/SetupPage-DOVh1ldK.js +1 -0
  20. package/dist/ui/assets/WebChatPage-c-7S9jnT.js +16 -0
  21. package/dist/ui/assets/accordion-DAbcVQCn.js +1 -0
  22. package/dist/ui/{dist/assets/alert-C-NE-P3s.js → assets/alert-D_2Y3qjL.js} +1 -1
  23. package/dist/ui/{dist/assets/alert-dialog-C5mzbHdP.js → assets/alert-dialog-CpMxaNcu.js} +1 -1
  24. package/dist/ui/assets/{badge-ChpACfWO.js → badge-CxTPR6_t.js} +1 -1
  25. package/dist/ui/assets/bell-8BqRYmzf.js +1 -0
  26. package/dist/ui/assets/circle-x-Bv6WrUJo.js +1 -0
  27. package/dist/ui/assets/copy-dU94ZGsi.js +1 -0
  28. package/dist/ui/{dist/assets/dialog-QnZ0ad8O.js → assets/dialog-DfS3idb3.js} +1 -1
  29. package/dist/ui/{dist/assets/dropdown-menu-BK-CO3Od.js → assets/dropdown-menu-BdCbAW1z.js} +1 -1
  30. package/dist/ui/assets/{es-NQNoaWDx.js → es-Cz5h9_84.js} +1 -1
  31. package/dist/ui/assets/index-CmGm_r89.js +116 -0
  32. package/dist/ui/assets/index-T7HgphSn.css +2 -0
  33. package/dist/ui/{dist/assets/label-D2H1IR_J.js → assets/label-byJkqOYq.js} +1 -1
  34. package/dist/ui/assets/progress-Dtz-Mzys.js +1 -0
  35. package/dist/ui/assets/scroll-area-BXtLsE9E.js +1 -0
  36. package/dist/ui/assets/search-BGmPJ-6L.js +1 -0
  37. package/dist/ui/assets/select-Cl16QYa_.js +1 -0
  38. package/dist/ui/assets/send-BuQcUO-R.js +1 -0
  39. package/dist/ui/assets/shield-C-05qB-2.js +1 -0
  40. package/dist/ui/{dist/assets/slider-CsiUDxc3.js → assets/slider-D2I0qven.js} +1 -1
  41. package/dist/ui/assets/switch-h2SfQX4B.js +1 -0
  42. package/dist/ui/assets/table-CVkIRJKK.js +1 -0
  43. package/dist/ui/assets/tabs-C619jxbO.js +1 -0
  44. package/dist/ui/assets/textarea-wvA-FDjO.js +1 -0
  45. package/dist/ui/assets/useProviders-eEri6BAc.js +1 -0
  46. package/dist/ui/{dist/assets/vendor-radix-cw1bQaVC.js → assets/vendor-radix-D6rA7xKY.js} +4 -4
  47. package/dist/ui/assets/{vendor-react-D4s9E-zj.js → vendor-react-BU5iQU4f.js} +1 -1
  48. package/dist/ui/dist/assets/AgentCreateForm-BTCzFbca.js +1 -0
  49. package/dist/ui/dist/assets/AgentDetailPage-o27TRSVw.js +1 -0
  50. package/dist/ui/dist/assets/AgentNewPage-400cCpYt.js +1 -0
  51. package/dist/ui/{assets/AgentsPage-YvSgWRiw.js → dist/assets/AgentsPage-C-GSRk-N.js} +5 -5
  52. package/dist/ui/dist/assets/ApiClientPage-BOTpz6oP.js +3 -0
  53. package/dist/ui/dist/assets/{CanvasPage-DtMwGvxf.js → CanvasPage-Cvs5ctza.js} +7 -7
  54. package/dist/ui/dist/assets/ChannelsPage-C5m_L7P9.js +8 -0
  55. package/dist/ui/{assets/DashboardPage-ghl1ZguH.js → dist/assets/DashboardPage-CztbRQdm.js} +2 -2
  56. package/dist/ui/dist/assets/{LoginPage-CAmSI9Vy.js → LoginPage-OMsrx5oj.js} +1 -1
  57. package/dist/ui/dist/assets/LogsPage-CcYYwjgF.js +1 -0
  58. package/dist/ui/{assets/MeetingPage-WjjGOqqU.js → dist/assets/MeetingPage-CrKVAfe6.js} +1 -1
  59. package/dist/ui/dist/assets/{NotFound-BMeQSGcG.js → NotFound-GbAJDgoD.js} +1 -1
  60. package/dist/ui/dist/assets/ProvidersPage-uqPcZUSV.js +1 -0
  61. package/dist/ui/{assets/RecoverPage-DpW3l-yv.js → dist/assets/RecoverPage-CwB2ByCU.js} +1 -1
  62. package/dist/ui/dist/assets/SettingsPage-DKLlye0z.js +9 -0
  63. package/dist/ui/dist/assets/SetupPage-DOVh1ldK.js +1 -0
  64. package/dist/ui/dist/assets/WebChatPage-c-7S9jnT.js +16 -0
  65. package/dist/ui/dist/assets/accordion-DAbcVQCn.js +1 -0
  66. package/dist/ui/{assets/alert-C-NE-P3s.js → dist/assets/alert-D_2Y3qjL.js} +1 -1
  67. package/dist/ui/{assets/alert-dialog-C5mzbHdP.js → dist/assets/alert-dialog-CpMxaNcu.js} +1 -1
  68. package/dist/ui/dist/assets/{badge-ChpACfWO.js → badge-CxTPR6_t.js} +1 -1
  69. package/dist/ui/dist/assets/bell-8BqRYmzf.js +1 -0
  70. package/dist/ui/dist/assets/circle-x-Bv6WrUJo.js +1 -0
  71. package/dist/ui/dist/assets/copy-dU94ZGsi.js +1 -0
  72. package/dist/ui/{assets/dialog-QnZ0ad8O.js → dist/assets/dialog-DfS3idb3.js} +1 -1
  73. package/dist/ui/{assets/dropdown-menu-BK-CO3Od.js → dist/assets/dropdown-menu-BdCbAW1z.js} +1 -1
  74. package/dist/ui/dist/assets/{es-NQNoaWDx.js → es-Cz5h9_84.js} +1 -1
  75. package/dist/ui/dist/assets/index-CmGm_r89.js +116 -0
  76. package/dist/ui/dist/assets/index-T7HgphSn.css +2 -0
  77. package/dist/ui/{assets/label-D2H1IR_J.js → dist/assets/label-byJkqOYq.js} +1 -1
  78. package/dist/ui/dist/assets/progress-Dtz-Mzys.js +1 -0
  79. package/dist/ui/dist/assets/scroll-area-BXtLsE9E.js +1 -0
  80. package/dist/ui/dist/assets/search-BGmPJ-6L.js +1 -0
  81. package/dist/ui/dist/assets/select-Cl16QYa_.js +1 -0
  82. package/dist/ui/dist/assets/send-BuQcUO-R.js +1 -0
  83. package/dist/ui/dist/assets/shield-C-05qB-2.js +1 -0
  84. package/dist/ui/{assets/slider-CsiUDxc3.js → dist/assets/slider-D2I0qven.js} +1 -1
  85. package/dist/ui/dist/assets/switch-h2SfQX4B.js +1 -0
  86. package/dist/ui/dist/assets/table-CVkIRJKK.js +1 -0
  87. package/dist/ui/dist/assets/tabs-C619jxbO.js +1 -0
  88. package/dist/ui/dist/assets/textarea-wvA-FDjO.js +1 -0
  89. package/dist/ui/dist/assets/useProviders-eEri6BAc.js +1 -0
  90. package/dist/ui/{assets/vendor-radix-cw1bQaVC.js → dist/assets/vendor-radix-D6rA7xKY.js} +4 -4
  91. package/dist/ui/dist/assets/{vendor-react-D4s9E-zj.js → vendor-react-BU5iQU4f.js} +1 -1
  92. package/dist/ui/dist/index.html +6 -6
  93. package/dist/ui/index.html +6 -6
  94. package/package.json +1 -1
  95. package/packages/cli/src/adapters/binary.ts +8 -4
  96. package/packages/cli/src/adapters/bun-global.ts +5 -1
  97. package/packages/cli/src/adapters/config.ts +4 -3
  98. package/packages/cli/src/adapters/docker.ts +2 -1
  99. package/packages/cli/src/commands/gateway.ts +123 -9
  100. package/packages/cli/src/commands/logs.ts +2 -1
  101. package/packages/cli/src/commands/onboard.ts +1 -1
  102. package/packages/cli/src/commands/sessions.ts +2 -1
  103. package/packages/cli/src/commands/skills.ts +2 -1
  104. package/packages/core/src/agent/agent-loop.ts +4 -14
  105. package/packages/core/src/agent/context-compiler.ts +1 -1
  106. package/packages/core/src/agent/conversation-store.ts +4 -5
  107. package/packages/core/src/agent/llm-client.ts +4 -0
  108. package/packages/core/src/agent/llm-providers/anthropic.ts +23 -8
  109. package/packages/core/src/agent/llm-providers/interface.ts +5 -1
  110. package/packages/core/src/agent/llm-providers/minimax.ts +13 -0
  111. package/packages/core/src/agent/llm-providers/opencode-go.ts +9 -0
  112. package/packages/core/src/agent/providers/index.ts +3 -4
  113. package/packages/core/src/agent/tool-selector.ts +3 -4
  114. package/packages/core/src/channels/whatsapp.ts +13 -1
  115. package/packages/core/src/config/loader.ts +7 -7
  116. package/packages/core/src/gateway/helpers/path.ts +2 -1
  117. package/packages/core/src/gateway/initializer.ts +4 -4
  118. package/packages/core/src/gateway/llm-local/downloader.ts +130 -11
  119. package/packages/core/src/gateway/llm-local/index.ts +2 -0
  120. package/packages/core/src/gateway/llm-local/models.ts +4 -3
  121. package/packages/core/src/gateway/resolver.ts +5 -1
  122. package/packages/core/src/gateway/router.ts +7 -5
  123. package/packages/core/src/gateway/routes/chat.ts +16 -16
  124. package/packages/core/src/gateway/routes/http-client.ts +16 -0
  125. package/packages/core/src/gateway/routes/llm-local.ts +51 -5
  126. package/packages/core/src/gateway/routes/providers.ts +43 -2
  127. package/packages/core/src/gateway/server.ts +55 -47
  128. package/packages/core/src/gateway/tts/src/install.ts +17 -9
  129. package/packages/core/src/storage/crypto.ts +152 -20
  130. package/packages/core/src/storage/migrate.ts +51 -18
  131. package/packages/core/src/storage/seed.ts +77 -35
  132. package/packages/core/src/tool-runtime/index.ts +42 -1
  133. package/packages/core/src/tools/api/api-request.ts +174 -0
  134. package/packages/core/src/tools/api/index.ts +16 -0
  135. package/packages/core/src/tools/index.ts +12 -0
  136. package/packages/core/src/tools/web/browser-click.ts +2 -2
  137. package/packages/core/src/tools/web/browser-extract.ts +22 -6
  138. package/packages/core/src/tools/web/browser-navigate.ts +34 -18
  139. package/packages/core/src/tools/web/browser-screenshot.ts +40 -8
  140. package/packages/core/src/tools/web/browser-script.ts +2 -2
  141. package/packages/core/src/tools/web/browser-service.ts +295 -341
  142. package/packages/core/src/tools/web/browser-type.ts +5 -10
  143. package/packages/core/src/tools/web/browser-wait.ts +2 -2
  144. package/packages/core/src/tools/web/index.ts +1 -1
  145. package/packages/core/src/utils/logger.ts +2 -1
  146. package/packages/mcp/src/manager.ts +2 -1
  147. package/packages/skills/src/bundled/api/api_client/SKILL.md +132 -0
  148. package/packages/skills/src/bundled-data.generated.ts +1274 -1217
  149. package/packages/skills/src/loader.ts +2 -1
  150. package/dist/ui/assets/AgentCreateForm-tJZv9FZC.js +0 -1
  151. package/dist/ui/assets/AgentDetailPage-Du-mRcAX.js +0 -1
  152. package/dist/ui/assets/AgentNewPage-DIFYd_Ys.js +0 -1
  153. package/dist/ui/assets/ChannelsPage-BdBXWHjj.js +0 -8
  154. package/dist/ui/assets/LogsPage-DAPBHkwK.js +0 -1
  155. package/dist/ui/assets/ProvidersPage-Ct6HsAi1.js +0 -1
  156. package/dist/ui/assets/SettingsPage-DBJ7_E6C.js +0 -9
  157. package/dist/ui/assets/SetupPage-DKmLVUaj.js +0 -1
  158. package/dist/ui/assets/WebChatPage-CVRcKept.js +0 -16
  159. package/dist/ui/assets/accordion-C5d5Rm5z.js +0 -1
  160. package/dist/ui/assets/globe-DeCQTCDJ.js +0 -1
  161. package/dist/ui/assets/index-B2fCYtTS.css +0 -2
  162. package/dist/ui/assets/index-DMCjjdqf.js +0 -116
  163. package/dist/ui/assets/progress-BherYzY6.js +0 -1
  164. package/dist/ui/assets/scroll-area-DkeyX32e.js +0 -1
  165. package/dist/ui/assets/send-B0H5SEIE.js +0 -1
  166. package/dist/ui/assets/switch-BDwN8RYV.js +0 -1
  167. package/dist/ui/assets/table-CSc8ubon.js +0 -1
  168. package/dist/ui/assets/textarea-CXgXWKrT.js +0 -1
  169. package/dist/ui/assets/useProviders-C6_QHsEi.js +0 -1
  170. package/dist/ui/dist/assets/AgentCreateForm-tJZv9FZC.js +0 -1
  171. package/dist/ui/dist/assets/AgentDetailPage-Du-mRcAX.js +0 -1
  172. package/dist/ui/dist/assets/AgentNewPage-DIFYd_Ys.js +0 -1
  173. package/dist/ui/dist/assets/ChannelsPage-BdBXWHjj.js +0 -8
  174. package/dist/ui/dist/assets/LogsPage-DAPBHkwK.js +0 -1
  175. package/dist/ui/dist/assets/ProvidersPage-Ct6HsAi1.js +0 -1
  176. package/dist/ui/dist/assets/SettingsPage-DBJ7_E6C.js +0 -9
  177. package/dist/ui/dist/assets/SetupPage-DKmLVUaj.js +0 -1
  178. package/dist/ui/dist/assets/WebChatPage-CVRcKept.js +0 -16
  179. package/dist/ui/dist/assets/accordion-C5d5Rm5z.js +0 -1
  180. package/dist/ui/dist/assets/globe-DeCQTCDJ.js +0 -1
  181. package/dist/ui/dist/assets/index-B2fCYtTS.css +0 -2
  182. package/dist/ui/dist/assets/index-DMCjjdqf.js +0 -116
  183. package/dist/ui/dist/assets/progress-BherYzY6.js +0 -1
  184. package/dist/ui/dist/assets/scroll-area-DkeyX32e.js +0 -1
  185. package/dist/ui/dist/assets/send-B0H5SEIE.js +0 -1
  186. package/dist/ui/dist/assets/switch-BDwN8RYV.js +0 -1
  187. package/dist/ui/dist/assets/table-CSc8ubon.js +0 -1
  188. package/dist/ui/dist/assets/textarea-CXgXWKrT.js +0 -1
  189. package/dist/ui/dist/assets/useProviders-C6_QHsEi.js +0 -1
  190. /package/dist/ui/assets/{card-CNf6BS2e.js → card-CXAm46at.js} +0 -0
  191. /package/dist/ui/assets/{cpu-Cdgc_B1K.js → cpu-DSpPVLAz.js} +0 -0
  192. /package/dist/ui/assets/{download-C3ifGMjJ.js → download-D9ZyUZZR.js} +0 -0
  193. /package/dist/ui/assets/{external-link-BvxYeTP1.js → external-link-CHPbUorN.js} +0 -0
  194. /package/dist/ui/assets/{eye-DqNTU_GD.js → eye-epHJZ_nQ.js} +0 -0
  195. /package/dist/ui/assets/{file-text-BT_9S9SM.js → file-text-BEjEmgby.js} +0 -0
  196. /package/dist/ui/assets/{folder-open-BhH8y9ac.js → folder-open-iQMHVEqS.js} +0 -0
  197. /package/dist/ui/assets/{format-GVHeOyWI.js → format-oFACFaca.js} +0 -0
  198. /package/dist/ui/assets/{gateway-url-COCbW0IR.js → gateway-url-iG-C6Agn.js} +0 -0
  199. /package/dist/ui/assets/{gauge-D_TMa4i9.js → gauge-D0_GMEcq.js} +0 -0
  200. /package/dist/ui/assets/{settings-Ds4SqD8s.js → settings-CcMGI1iU.js} +0 -0
  201. /package/dist/ui/assets/{sparkles-yUEb-7oH.js → sparkles-D6fx8JC5.js} +0 -0
  202. /package/dist/ui/assets/{trash-2-CNjMkoq6.js → trash-2-BHRa5ft9.js} +0 -0
  203. /package/dist/ui/assets/{triangle-alert-C9Y8Ub4X.js → triangle-alert-D4nwAVbc.js} +0 -0
  204. /package/dist/ui/assets/{vendor-router-C9pIYwbJ.js → vendor-router-pCP7sjma.js} +0 -0
  205. /package/dist/ui/assets/{volume-2-CeSXNDv4.js → volume-2-B6tkRy2u.js} +0 -0
  206. /package/dist/ui/assets/{zap-hlXjpSeA.js → zap-QO7iWMRg.js} +0 -0
  207. /package/dist/ui/dist/assets/{card-CNf6BS2e.js → card-CXAm46at.js} +0 -0
  208. /package/dist/ui/dist/assets/{cpu-Cdgc_B1K.js → cpu-DSpPVLAz.js} +0 -0
  209. /package/dist/ui/dist/assets/{download-C3ifGMjJ.js → download-D9ZyUZZR.js} +0 -0
  210. /package/dist/ui/dist/assets/{external-link-BvxYeTP1.js → external-link-CHPbUorN.js} +0 -0
  211. /package/dist/ui/dist/assets/{eye-DqNTU_GD.js → eye-epHJZ_nQ.js} +0 -0
  212. /package/dist/ui/dist/assets/{file-text-BT_9S9SM.js → file-text-BEjEmgby.js} +0 -0
  213. /package/dist/ui/dist/assets/{folder-open-BhH8y9ac.js → folder-open-iQMHVEqS.js} +0 -0
  214. /package/dist/ui/dist/assets/{format-GVHeOyWI.js → format-oFACFaca.js} +0 -0
  215. /package/dist/ui/dist/assets/{gateway-url-COCbW0IR.js → gateway-url-iG-C6Agn.js} +0 -0
  216. /package/dist/ui/dist/assets/{gauge-D_TMa4i9.js → gauge-D0_GMEcq.js} +0 -0
  217. /package/dist/ui/dist/assets/{settings-Ds4SqD8s.js → settings-CcMGI1iU.js} +0 -0
  218. /package/dist/ui/dist/assets/{sparkles-yUEb-7oH.js → sparkles-D6fx8JC5.js} +0 -0
  219. /package/dist/ui/dist/assets/{trash-2-CNjMkoq6.js → trash-2-BHRa5ft9.js} +0 -0
  220. /package/dist/ui/dist/assets/{triangle-alert-C9Y8Ub4X.js → triangle-alert-D4nwAVbc.js} +0 -0
  221. /package/dist/ui/dist/assets/{vendor-router-C9pIYwbJ.js → vendor-router-pCP7sjma.js} +0 -0
  222. /package/dist/ui/dist/assets/{volume-2-CeSXNDv4.js → volume-2-B6tkRy2u.js} +0 -0
  223. /package/dist/ui/dist/assets/{zap-hlXjpSeA.js → zap-QO7iWMRg.js} +0 -0
@@ -21,16 +21,16 @@
21
21
  <meta name="twitter:title" content="Hive">
22
22
  <meta property="og:description" content="Hive Agents">
23
23
  <meta name="twitter:description" content="Hive Agents">
24
- <script type="module" crossorigin src="/assets/index-DMCjjdqf.js"></script>
24
+ <script type="module" crossorigin src="/assets/index-CmGm_r89.js"></script>
25
25
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-S-ySWqyJ.js">
26
26
  <link rel="modulepreload" crossorigin href="/assets/vendor-charts-Bu2lyBKP.js">
27
- <link rel="modulepreload" crossorigin href="/assets/vendor-router-C9pIYwbJ.js">
27
+ <link rel="modulepreload" crossorigin href="/assets/vendor-router-pCP7sjma.js">
28
28
  <link rel="modulepreload" crossorigin href="/assets/vendor-query-DsWPbQdG.js">
29
- <link rel="modulepreload" crossorigin href="/assets/vendor-radix-cw1bQaVC.js">
29
+ <link rel="modulepreload" crossorigin href="/assets/vendor-radix-D6rA7xKY.js">
30
30
  <link rel="modulepreload" crossorigin href="/assets/utils-3pnRFmFe.js">
31
- <link rel="modulepreload" crossorigin href="/assets/vendor-react-D4s9E-zj.js">
32
- <link rel="modulepreload" crossorigin href="/assets/gateway-url-COCbW0IR.js">
33
- <link rel="stylesheet" crossorigin href="/assets/index-B2fCYtTS.css">
31
+ <link rel="modulepreload" crossorigin href="/assets/vendor-react-BU5iQU4f.js">
32
+ <link rel="modulepreload" crossorigin href="/assets/gateway-url-iG-C6Agn.js">
33
+ <link rel="stylesheet" crossorigin href="/assets/index-T7HgphSn.css">
34
34
  </head>
35
35
 
36
36
  <body>
@@ -21,16 +21,16 @@
21
21
  <meta name="twitter:title" content="Hive">
22
22
  <meta property="og:description" content="Hive Agents">
23
23
  <meta name="twitter:description" content="Hive Agents">
24
- <script type="module" crossorigin src="/assets/index-DMCjjdqf.js"></script>
24
+ <script type="module" crossorigin src="/assets/index-CmGm_r89.js"></script>
25
25
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-S-ySWqyJ.js">
26
26
  <link rel="modulepreload" crossorigin href="/assets/vendor-charts-Bu2lyBKP.js">
27
- <link rel="modulepreload" crossorigin href="/assets/vendor-router-C9pIYwbJ.js">
27
+ <link rel="modulepreload" crossorigin href="/assets/vendor-router-pCP7sjma.js">
28
28
  <link rel="modulepreload" crossorigin href="/assets/vendor-query-DsWPbQdG.js">
29
- <link rel="modulepreload" crossorigin href="/assets/vendor-radix-cw1bQaVC.js">
29
+ <link rel="modulepreload" crossorigin href="/assets/vendor-radix-D6rA7xKY.js">
30
30
  <link rel="modulepreload" crossorigin href="/assets/utils-3pnRFmFe.js">
31
- <link rel="modulepreload" crossorigin href="/assets/vendor-react-D4s9E-zj.js">
32
- <link rel="modulepreload" crossorigin href="/assets/gateway-url-COCbW0IR.js">
33
- <link rel="stylesheet" crossorigin href="/assets/index-B2fCYtTS.css">
31
+ <link rel="modulepreload" crossorigin href="/assets/vendor-react-BU5iQU4f.js">
32
+ <link rel="modulepreload" crossorigin href="/assets/gateway-url-iG-C6Agn.js">
33
+ <link rel="stylesheet" crossorigin href="/assets/index-T7HgphSn.css">
34
34
  </head>
35
35
 
36
36
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johpaz/hive-agents",
3
- "version": "0.0.37",
3
+ "version": "0.0.39",
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": {
@@ -8,6 +8,7 @@
8
8
 
9
9
  import { spawn, execSync } from "node:child_process";
10
10
  import * as path from "node:path";
11
+ import { homedir } from "node:os";
11
12
  import { existsSync, readFileSync, unlinkSync, chmodSync } from "node:fs";
12
13
  import type {
13
14
  InstallationAdapter,
@@ -93,8 +94,8 @@ export class BinaryAdapter implements InstallationAdapter {
93
94
  path.join(process.cwd(), "dist", "hive.exe"),
94
95
  "/usr/local/bin/hive",
95
96
  "/usr/bin/hive",
96
- path.join(process.env.HOME || "", ".local", "bin", "hive"),
97
- path.join(process.env.HOME || "", ".bun", "bin", "hive"),
97
+ path.join(homedir(), ".local", "bin", "hive"),
98
+ path.join(homedir(), ".bun", "bin", "hive"),
98
99
  ];
99
100
 
100
101
  for (const binaryPath of commonPaths) {
@@ -279,8 +280,11 @@ export class BinaryAdapter implements InstallationAdapter {
279
280
  } else {
280
281
  // Try to kill by process name
281
282
  try {
282
- const pattern = process.platform === "win32" ? "hive.exe" : "hive";
283
- execSync(`pkill -f "${pattern}"`, { stdio: "ignore" });
283
+ if (process.platform === "win32") {
284
+ execSync("taskkill /IM hive.exe /F", { stdio: "ignore" });
285
+ } else {
286
+ execSync('pkill -f "hive"', { stdio: "ignore" });
287
+ }
284
288
  console.log("✅ Hive Gateway detenido");
285
289
  } catch {
286
290
  console.log("⚠️ Hive Gateway no está corriendo");
@@ -202,7 +202,11 @@ export class BunGlobalAdapter implements InstallationAdapter {
202
202
  } else {
203
203
  // Try to kill by process name
204
204
  try {
205
- execSync("pkill -f 'bun.*hive.*start'", { stdio: "ignore" });
205
+ if (process.platform === "win32") {
206
+ execSync("taskkill /IM bun.exe /F", { stdio: "ignore" });
207
+ } else {
208
+ execSync("pkill -f 'bun.*hive.*start'", { stdio: "ignore" });
209
+ }
206
210
  console.log("✅ Hive Gateway detenido");
207
211
  } catch {
208
212
  console.log("⚠️ Hive Gateway no está corriendo");
@@ -7,6 +7,7 @@
7
7
 
8
8
  import { z } from "zod";
9
9
  import * as path from "node:path";
10
+ import { homedir } from "node:os";
10
11
  import { existsSync, readFileSync } from "node:fs";
11
12
  import type { GatewayConfig, InstallationConfig, InstallationPaths } from "./types";
12
13
  import { DEFAULT_GATEWAY_CONFIG, PORTS, gatewayConfigSchema, installationConfigSchema } from "./types";
@@ -26,11 +27,11 @@ export function getHiveDir(customDir?: string): string {
26
27
 
27
28
  // Development mode
28
29
  if (process.env.HIVE_DEV === "true") {
29
- return path.join(process.env.HOME || "", ".hive-dev");
30
+ return path.join(homedir(), ".hive-dev");
30
31
  }
31
32
 
32
33
  // Default production location
33
- return path.join(process.env.HOME || "", ".hive");
34
+ return path.join(homedir(), ".hive");
34
35
  }
35
36
 
36
37
  /**
@@ -230,7 +231,7 @@ export function expandPath(input: string): string {
230
231
 
231
232
  // Expand ~ to home directory
232
233
  if (input.startsWith("~/")) {
233
- return path.join(process.env.HOME || "", input.slice(2));
234
+ return path.join(homedir(), input.slice(2));
234
235
  }
235
236
 
236
237
  // Expand environment variables ${VAR} or $VAR
@@ -7,6 +7,7 @@
7
7
 
8
8
  import { spawn, execSync } from "node:child_process";
9
9
  import * as path from "node:path";
10
+ import { homedir } from "node:os";
10
11
  import { existsSync } from "node:fs";
11
12
  import type {
12
13
  InstallationAdapter,
@@ -55,7 +56,7 @@ export class DockerAdapter implements InstallationAdapter {
55
56
  const standardPaths = [
56
57
  "/opt/hive/docker-compose.yml",
57
58
  "/usr/local/share/hive/docker-compose.yml",
58
- path.join(process.env.HOME || "", ".hive", "docker-compose.yml"),
59
+ path.join(homedir(), ".hive", "docker-compose.yml"),
59
60
  ];
60
61
 
61
62
  for (const composePath of standardPaths) {
@@ -113,7 +113,11 @@ function cleanup() {
113
113
  for (const child of children) {
114
114
  if (child.pid) {
115
115
  try {
116
- process.kill(-child.pid, "SIGTERM");
116
+ if (process.platform !== "win32") {
117
+ process.kill(-child.pid, "SIGTERM");
118
+ } else {
119
+ child.kill("SIGTERM");
120
+ }
117
121
  } catch {
118
122
  child.kill("SIGTERM");
119
123
  }
@@ -212,10 +216,52 @@ async function isSetupMode(): Promise<boolean> {
212
216
  return !existsSync(dbPath);
213
217
  }
214
218
 
219
+ /**
220
+ * Kill any process listening on a given TCP port (cross-platform)
221
+ */
222
+ async function killPortProcess(port: number): Promise<void> {
223
+ try {
224
+ if (process.platform === "win32") {
225
+ const result = Bun.spawnSync(["netstat", "-ano"], { stderr: "pipe" });
226
+ for (const line of result.stdout.toString().split("\n")) {
227
+ if (line.includes(`:${port} `) && line.includes("LISTENING")) {
228
+ const pid = line.trim().split(/\s+/).pop();
229
+ if (pid && !isNaN(parseInt(pid, 10))) {
230
+ Bun.spawnSync(["taskkill", "/PID", pid, "/F"], { stderr: "pipe" });
231
+ }
232
+ }
233
+ }
234
+ } else {
235
+ const result = Bun.spawnSync(["fuser", "-k", `${port}/tcp`], { stderr: "pipe" });
236
+ if (result.exitCode !== 0) {
237
+ const lsof = Bun.spawnSync(["lsof", "-ti", `tcp:${port}`], { stderr: "pipe" });
238
+ const pids = lsof.stdout.toString().trim().split("\n").filter(Boolean);
239
+ for (const pid of pids) {
240
+ try { process.kill(parseInt(pid, 10), "SIGTERM"); } catch { }
241
+ }
242
+ }
243
+ }
244
+ await Bun.sleep(500);
245
+ } catch { }
246
+ }
247
+
215
248
  /**
216
249
  * Check if gateway is running using the adapter
217
250
  */
218
251
  async function isRunning(): Promise<boolean> {
252
+ // HTTP health check first — if the port responds, something is running
253
+ // regardless of PID file or adapter state
254
+ try {
255
+ const coreConfig = await loadConfig().catch(() => null);
256
+ const port = coreConfig?.gateway?.port ?? 18790;
257
+ const res = await fetch(`http://127.0.0.1:${port}/health`, {
258
+ signal: AbortSignal.timeout(600),
259
+ });
260
+ if (res.ok) return true;
261
+ } catch {
262
+ // Nothing listening on the port — continue to other checks
263
+ }
264
+
219
265
  try {
220
266
  // Try adapter first
221
267
  const adapter = await getAdapter();
@@ -319,7 +365,7 @@ export async function start(flags: string[]): Promise<void> {
319
365
  ║ ██║ ██║██║ ╚████╔╝ ███████╗ ║
320
366
  ║ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚══════╝ ║
321
367
  ║ ║
322
- ║ Personal Swarm AI Gateway — v0.0.37
368
+ ║ Personal Swarm AI Gateway — v0.0.39
323
369
  ╚════════════════════════════════════════════╝
324
370
 
325
371
  📦 Installation: ${adapter.name}
@@ -405,7 +451,40 @@ async function handleDevMode(
405
451
  }
406
452
  }
407
453
 
454
+ // Verify port is free before spawning children
455
+ {
456
+ const portBusy = await (async () => {
457
+ try {
458
+ const r = await fetch(`http://127.0.0.1:${gatewayConfig.port}/health`, { signal: AbortSignal.timeout(500) });
459
+ return r.ok;
460
+ } catch { return false; }
461
+ })();
462
+ if (portBusy) {
463
+ // Try to free it (works for local processes; silently fails for Docker/root processes)
464
+ await killPortProcess(gatewayConfig.port);
465
+ await Bun.sleep(800);
466
+ const stillBusy = await (async () => {
467
+ try {
468
+ const r = await fetch(`http://127.0.0.1:${gatewayConfig.port}/health`, { signal: AbortSignal.timeout(500) });
469
+ return r.ok;
470
+ } catch { return false; }
471
+ })();
472
+ if (stillBusy) {
473
+ const manualCmd = process.platform === "win32"
474
+ ? `netstat -ano | findstr :${gatewayConfig.port} → taskkill /PID <pid> /F`
475
+ : `sudo fuser -k ${gatewayConfig.port}/tcp`;
476
+ console.error(`\n❌ El puerto ${gatewayConfig.port} está ocupado por otro proceso (Docker u otro servicio).`);
477
+ console.error(` Detén el servicio antes de iniciar el modo dev:`);
478
+ console.error(` • Docker: docker stop $(docker ps -q --filter publish=${gatewayConfig.port})`);
479
+ console.error(` • Hive: hive stop`);
480
+ console.error(` • Manual: ${manualCmd}\n`);
481
+ return;
482
+ }
483
+ }
484
+ }
485
+
408
486
  // Spawn Gateway child process
487
+ let gwExitedEarly = false;
409
488
  const spawnGateway = (): ReturnType<typeof spawn> => {
410
489
  const gw = spawn(process.execPath, [process.argv[1] || "", "start", "--skip-check", "--dev-internal"], {
411
490
  detached: true,
@@ -437,6 +516,8 @@ async function handleDevMode(
437
516
  const newGw = spawnGateway();
438
517
  const idx = children.indexOf(gw);
439
518
  if (idx !== -1) children.splice(idx, 1, newGw);
519
+ } else if (code !== null) {
520
+ gwExitedEarly = true;
440
521
  }
441
522
  });
442
523
 
@@ -458,6 +539,19 @@ async function handleDevMode(
458
539
  waitForHttpPort(18790, "/health", 30000),
459
540
  ]);
460
541
 
542
+ // Give the child a moment to potentially fail before we declare success
543
+ await Bun.sleep(600);
544
+
545
+ if (gwExitedEarly) {
546
+ const portCheckCmd = process.platform === "win32"
547
+ ? `netstat -ano | findstr :${gatewayConfig.port}`
548
+ : `sudo fuser ${gatewayConfig.port}/tcp`;
549
+ console.error(`\n❌ El proceso Gateway terminó inesperadamente.`);
550
+ console.error(` El puerto ${gatewayConfig.port} puede estar ocupado por otro servicio.`);
551
+ console.error(` Revisa con: ${portCheckCmd}\n`);
552
+ return;
553
+ }
554
+
461
555
  if (!viteReady && hasVite) {
462
556
  console.error("⚠️ Vite no respondió a tiempo");
463
557
  }
@@ -466,15 +560,30 @@ async function handleDevMode(
466
560
  return;
467
561
  }
468
562
 
469
- // Additional wait: ensure Gateway is fully initialized and serving UI
470
- // In dev mode, Gateway needs a moment to set up HMR proxy
471
- await Bun.sleep(500);
472
-
473
563
  console.log("✅ Servicios listos\n");
474
564
 
475
- // Open browser - en desarrollo, Gateway sirve la UI igual que en producción
476
- const setupMode = await isSetupMode();
477
- const browserPort = gatewayConfig.port; // 18790, igual que producción
565
+ // Open browser - en desarrollo, Gateway sirve la UI igual que en producción.
566
+ // Poll /api/setup/status (same as production mode) so the decision is based on
567
+ // the gateway's own check (users count == 0), not just whether the DB file exists.
568
+ const browserPort = gatewayConfig.port;
569
+ let setupMode = await isSetupMode(); // fallback default
570
+ {
571
+ const deadline = Date.now() + 10_000;
572
+ while (Date.now() < deadline) {
573
+ try {
574
+ const res = await fetch(`http://127.0.0.1:${browserPort}/api/setup/status`, {
575
+ signal: AbortSignal.timeout(1000),
576
+ });
577
+ if (res.ok) {
578
+ const body = await res.json() as { setupMode?: boolean };
579
+ setupMode = body.setupMode === true;
580
+ break;
581
+ }
582
+ // 503 = gateway still initializing ("starting" phase) — retry
583
+ } catch { }
584
+ await Bun.sleep(300);
585
+ }
586
+ }
478
587
  const url = setupMode ? `http://localhost:${browserPort}/setup` : `http://localhost:${browserPort}`;
479
588
 
480
589
  console.log(`
@@ -707,6 +816,11 @@ export async function reload(): Promise<void> {
707
816
  return;
708
817
  }
709
818
 
819
+ if (process.platform === "win32") {
820
+ console.log("⚠️ Recarga en caliente no disponible en Windows. Reinicia el gateway para aplicar cambios.");
821
+ return;
822
+ }
823
+
710
824
  const pidFile = await getPidFile();
711
825
  const pid = parseInt(readFileSync(pidFile, "utf-8").trim(), 10);
712
826
 
@@ -1,8 +1,9 @@
1
1
  import * as fs from "fs";
2
2
  import * as path from "path";
3
+ import { homedir } from "os";
3
4
  import { spawn } from "child_process";
4
5
 
5
- const LOG_DIR = path.join(process.env.HOME || "", ".hive", "logs");
6
+ const LOG_DIR = path.join(homedir(), ".hive", "logs");
6
7
  const LOG_FILE = path.join(LOG_DIR, "gateway.log");
7
8
 
8
9
  export async function logs(flags: string[]): Promise<void> {
@@ -50,7 +50,7 @@ function reloadEnvToProcess(hiveDir: string): void {
50
50
  }
51
51
  }
52
52
 
53
- const VERSION = "0.0.37";
53
+ const VERSION = "0.0.39";
54
54
 
55
55
  const DEFAULT_MODELS: Record<string, string> = {
56
56
  anthropic: "claude-sonnet-4-6",
@@ -1,7 +1,8 @@
1
1
  import * as fs from "fs";
2
2
  import * as path from "path";
3
+ import { homedir } from "os";
3
4
 
4
- const HIVE_DIR = path.join(process.env.HOME || "", ".hive");
5
+ const HIVE_DIR = path.join(homedir(), ".hive");
5
6
  const SESSIONS_DIR = path.join(HIVE_DIR, "sessions");
6
7
 
7
8
  export async function sessions(subcommand: string | undefined, args: string[]): Promise<void> {
@@ -1,8 +1,9 @@
1
1
  import * as p from "@clack/prompts";
2
2
  import * as fs from "fs";
3
3
  import * as path from "path";
4
+ import { homedir } from "os";
4
5
 
5
- const SKILLS_DIR = path.join(process.env.HOME || "", ".hive", "skills");
6
+ const SKILLS_DIR = path.join(homedir(), ".hive", "skills");
6
7
  const BUNDLED_SKILLS: Array<{ slug: string; name: string; description: string }> = [
7
8
  { slug: "web-search", name: "Web Search", description: "Search the web using multiple search engines" },
8
9
  { slug: "code-exec", name: "Code Execution", description: "Execute code snippets safely" },
@@ -194,13 +194,9 @@ export async function* runAgent(
194
194
  tool_calls: response.tool_calls,
195
195
  reasoning_content: response.reasoning_content,
196
196
  })
197
- if (!opts.isolated) {
198
- addMessage(opts.threadId, "assistant", response.content || "", {
199
- channel: opts.channel,
200
- tool_calls: response.tool_calls,
201
- reasoning_content: response.reasoning_content,
202
- })
203
- }
197
+ // Note: assistant messages with tool_calls are NOT persisted to DB.
198
+ // Only the final text response to the user is saved.
199
+ // Tool-call round-tripping happens in-memory via the 'messages' array above.
204
200
 
205
201
  for (const tc of response.tool_calls) {
206
202
  const toolName = tc.function.name
@@ -284,18 +280,12 @@ export async function* runAgent(
284
280
  await opts.onStep({ type: "tool_result", message: toolResultLLM })
285
281
  }
286
282
 
287
- // Add tool result to messages for next model call AND persist (TOON encoded)
283
+ // Add tool result to messages for next model call (in-memory only, NOT persisted to DB)
288
284
  messages.push({
289
285
  role: "tool",
290
286
  content: toolResultLLM,
291
287
  tool_call_id: tc.id,
292
288
  })
293
- if (!opts.isolated) {
294
- addMessage(opts.threadId, "tool", toolResultLLM, {
295
- channel: opts.channel,
296
- tool_call_id: tc.id,
297
- })
298
- }
299
289
 
300
290
  // Dynamic tool injection: when search_knowledge finds tools (native or MCP), add them to ctx.tools
301
291
  if (toolName === "search_knowledge") {
@@ -40,7 +40,7 @@ import { getUserDate, getUserTime } from "../utils/date"
40
40
  const log = logger.child("context-compiler")
41
41
 
42
42
  // Configuration constants
43
- const KEEP_LAST_N_MESSAGES = 15 // Always keep last N messages (Strategy: SELECT) — increased because tool calls/results are now persisted
43
+ const KEEP_LAST_N_MESSAGES = 30 // Always keep last N messages (Strategy: SELECT) — only user+assistant text, no tool results
44
44
  const DEFAULT_CONTEXT_WINDOW = 250000 // Default context window when model is unknown
45
45
  const COMPACT_RATIO = 0.80 // Compact when estimated input exceeds 70% of context window
46
46
  const MAX_SYSTEM_PROMPT_CHARS_CAP = 128000 // Hard cap for pathological prompts; normal budget is model-aware
@@ -97,7 +97,7 @@ export function getRecentMessages(threadId: string, n: number): StoredMessage[]
97
97
  const db = getDb()
98
98
  const rows = db.query(`
99
99
  SELECT * FROM conversations
100
- WHERE thread_id = ?
100
+ WHERE thread_id = ? AND role != 'tool'
101
101
  ORDER BY id DESC
102
102
  LIMIT ?
103
103
  `).all(threadId, n) as StoredMessage[]
@@ -170,10 +170,9 @@ export function toAPIMessages(rows: StoredMessage[]): LLMMessage[] {
170
170
  try { content = JSON.parse(r.content_multimodal) } catch { /* ignore */ }
171
171
  }
172
172
  const msg: LLMMessage = { role: r.role, content }
173
- if (r.tool_calls_json) {
174
- try { msg.tool_calls = JSON.parse(r.tool_calls_json) } catch { /* ignore */ }
175
- }
176
- if (r.tool_call_id) msg.tool_call_id = r.tool_call_id
173
+ // Note: tool_calls and tool_call_id are NOT reconstructed from DB.
174
+ // Tool results are kept in-memory during iteration but not persisted,
175
+ // so historical messages only contain text conversation.
177
176
  if (r.reasoning_content) msg.reasoning_content = r.reasoning_content
178
177
  return msg
179
178
  })
@@ -24,6 +24,8 @@ import { KimiProvider } from "./llm-providers/kimi"
24
24
  import { LocalLlamaProvider } from "./llm-providers/local-llama"
25
25
  import { NvidiaProvider } from "./llm-providers/nvidia"
26
26
  import { QwenProvider } from "./llm-providers/qwen"
27
+ import { MiniMaxProvider } from "./llm-providers/minimax"
28
+ import { OpenCodeGoProvider } from "./llm-providers/opencode-go"
27
29
  import type { LLMProvider } from "./llm-providers/interface"
28
30
 
29
31
  const log = logger.child("llm-client")
@@ -109,6 +111,8 @@ function getProvider(provider: string): LLMProvider {
109
111
  case "local-llama": return new LocalLlamaProvider()
110
112
  case "nvidia": return new NvidiaProvider()
111
113
  case "qwen": return new QwenProvider()
114
+ case "minimax": return new MiniMaxProvider()
115
+ case "opencode-go": return new OpenCodeGoProvider()
112
116
  default:
113
117
  log.warn(`[llm-client] Unknown provider "${provider}" — falling back to OpenAI-compatible endpoint`)
114
118
  return new OpenAIProvider()
@@ -1,4 +1,5 @@
1
1
  import { logger } from "../../utils/logger"
2
+ import { normalizeToolName } from "./interface"
2
3
  import type { LLMCallOptions, LLMProvider, LLMResponse, LLMToolCall } from "./interface"
3
4
  import type { ContentPart, LLMMessage } from "../llm-client"
4
5
 
@@ -55,6 +56,10 @@ export class AnthropicProvider implements LLMProvider {
55
56
  const Anthropic = await import("@anthropic-ai/sdk")
56
57
  const client = new Anthropic.default({ apiKey: options.apiKey })
57
58
 
59
+ // Anthropic requires tool names to match ^[a-zA-Z0-9_-]{1,128}$
60
+ // Native Hive tools use dots (e.g. cron.create) which violate this.
61
+ const toolNameMap = new Map<string, string>() // wireName -> originalName
62
+
58
63
  const systemText = options.messages
59
64
  .filter((m) => m.role === "system")
60
65
  .map((m) => m.content)
@@ -82,7 +87,9 @@ export class AnthropicProvider implements LLMProvider {
82
87
  for (const tc of msg.tool_calls) {
83
88
  let input: Record<string, unknown>
84
89
  try { input = JSON.parse(tc.function.arguments || "{}") } catch { input = {} }
85
- content.push({ type: "tool_use", id: tc.id, name: tc.function.name, input })
90
+ const wireName = normalizeToolName(tc.function.name, "_")
91
+ if (wireName !== tc.function.name) toolNameMap.set(wireName, tc.function.name)
92
+ content.push({ type: "tool_use", id: tc.id, name: wireName, input })
86
93
  }
87
94
  anthropicMessages.push({ role: "assistant", content })
88
95
  continue
@@ -91,11 +98,16 @@ export class AnthropicProvider implements LLMProvider {
91
98
  anthropicMessages.push({ role: msg.role, content: Array.isArray(msg.content) ? this._convertUserContent(msg) : msg.content })
92
99
  }
93
100
 
94
- const tools: any[] = (options.tools ?? []).map((t) => ({
95
- name: t.function.name,
96
- description: t.function.description,
97
- input_schema: t.function.parameters,
98
- }))
101
+ const tools: any[] = (options.tools ?? []).map((t) => {
102
+ const originalName = t.function.name
103
+ const wireName = normalizeToolName(originalName, "_")
104
+ if (wireName !== originalName) toolNameMap.set(wireName, originalName)
105
+ return {
106
+ name: wireName,
107
+ description: t.function.description,
108
+ input_schema: t.function.parameters,
109
+ }
110
+ })
99
111
 
100
112
  const body: any = {
101
113
  model: options.model,
@@ -132,7 +144,9 @@ export class AnthropicProvider implements LLMProvider {
132
144
  for await (const event of stream) {
133
145
  if (event.type === "content_block_start") {
134
146
  if (event.content_block.type === "tool_use") {
135
- toolMeta[event.index] = { id: event.content_block.id, name: event.content_block.name }
147
+ const wireName = event.content_block.name
148
+ const originalName = toolNameMap.get(wireName) ?? wireName
149
+ toolMeta[event.index] = { id: event.content_block.id, name: originalName }
136
150
  partialInputs[event.index] = ""
137
151
  }
138
152
  } else if (event.type === "content_block_delta") {
@@ -187,10 +201,11 @@ export class AnthropicProvider implements LLMProvider {
187
201
  if (block.type === "tool_use") {
188
202
  let args: string
189
203
  try { args = JSON.stringify(block.input) } catch { args = "{}" }
204
+ const originalName = toolNameMap.get(block.name) ?? block.name
190
205
  tool_calls.push({
191
206
  id: block.id,
192
207
  type: "function",
193
- function: { name: block.name, arguments: args },
208
+ function: { name: originalName, arguments: args },
194
209
  })
195
210
  }
196
211
  }
@@ -27,7 +27,9 @@ export const OPENAI_COMPAT_BASE_URLS: Record<string, string> = {
27
27
  kimi: "https://api.moonshot.ai/v1",
28
28
  "local-llama": "http://localhost:8081/v1",
29
29
  nvidia: "https://integrate.api.nvidia.com/v1",
30
- qwen: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
30
+ qwen: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
31
+ minimax: "https://api.minimaxi.com/v1",
32
+ "opencode-go": "https://opencode.ai/zen/go/v1",
31
33
  }
32
34
 
33
35
  // ─── Provider profiles ────────────────────────────────────────────────────────
@@ -66,6 +68,8 @@ export const PROVIDER_PROFILES: Record<string, ProviderProfile> = {
66
68
  nvidia: { ...DEFAULT_PROFILE, normalizeToolNames: true },
67
69
  qwen: { ...DEFAULT_PROFILE, normalizeToolNames: true, retryWithoutToolsOnCodes: [400, 422] },
68
70
  "local-llama": { ...DEFAULT_PROFILE },
71
+ minimax: { ...DEFAULT_PROFILE, normalizeToolNames: true, retryWithoutToolsOnCodes: [400, 422] },
72
+ "opencode-go": { ...DEFAULT_PROFILE, normalizeToolNames: true, retryWithoutToolsOnCodes: [400, 422] },
69
73
  }
70
74
 
71
75
  export function getProviderProfile(provider: string): ProviderProfile {
@@ -0,0 +1,13 @@
1
+ import { OpenAICompatBase } from "./openai-compat-base"
2
+
3
+ export class MiniMaxProvider extends OpenAICompatBase {
4
+ static readonly secretKey = "MINIMAX_API_KEY"
5
+
6
+ constructor() {
7
+ super("minimax")
8
+ }
9
+
10
+ protected needsReasoningRoundtrip(): boolean {
11
+ return true
12
+ }
13
+ }
@@ -0,0 +1,9 @@
1
+ import { OpenAICompatBase } from "./openai-compat-base"
2
+
3
+ export class OpenCodeGoProvider extends OpenAICompatBase {
4
+ static readonly secretKey = "OPENCODE_GO_API_KEY"
5
+
6
+ constructor() {
7
+ super("opencode-go")
8
+ }
9
+ }
@@ -7,7 +7,6 @@
7
7
 
8
8
  import type { Config } from "../../config/loader.ts"
9
9
  import { logger } from "../../utils/logger.ts"
10
- import { getDb } from "../../storage/sqlite.ts"
11
10
  import { getAgentLoop } from "../agent-loop"
12
11
  import { resolveUserId, resolveAgentId } from "../../storage/onboarding"
13
12
  import type { ContentPart } from "../../multimodal/types"
@@ -34,6 +33,7 @@ export interface ModelOptions {
34
33
  onStep?: (step: StepEvent) => Promise<void>
35
34
  threadId?: string
36
35
  userId?: string
36
+ agentId?: string
37
37
  channel?: string
38
38
  rawUserMessage?: string
39
39
  signal?: AbortSignal
@@ -62,9 +62,8 @@ export class AgentRunner {
62
62
  }
63
63
 
64
64
  async generate(options: ModelOptions): Promise<ModelResponse> {
65
- const db = getDb()
66
- // Resolve agentId from database (coordinator or first enabled)
67
- const agentId = resolveAgentId(null) || "main"
65
+ // Resolve agentId from explicit option or database (coordinator/first enabled)
66
+ const agentId = options.agentId || resolveAgentId(null) || "main"
68
67
 
69
68
  // Resolve userId from database
70
69
  const userId = options.userId || resolveUserId({})