@johpaz/hive-agents 0.0.38 → 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 (214) hide show
  1. package/README.md +18 -18
  2. package/dist/hive.js +3428 -2603
  3. package/dist/tool-worker.js +2085 -1820
  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-DGNLDXjR.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-CnMO1FN8.js → CanvasPage-Cvs5ctza.js} +7 -7
  10. package/dist/ui/assets/ChannelsPage-C5m_L7P9.js +8 -0
  11. package/dist/ui/{dist/assets/DashboardPage-VyXXp3U1.js → assets/DashboardPage-CztbRQdm.js} +2 -2
  12. package/dist/ui/assets/{LoginPage-DPj2s2Qq.js → LoginPage-OMsrx5oj.js} +1 -1
  13. package/dist/ui/assets/LogsPage-CcYYwjgF.js +1 -0
  14. package/dist/ui/{dist/assets/MeetingPage-2ky_hKiG.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-B-hDZUM2.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/{dist/assets/WebChatPage-BuGT2AL0.js → assets/WebChatPage-c-7S9jnT.js} +2 -2
  21. package/dist/ui/assets/accordion-DAbcVQCn.js +1 -0
  22. package/dist/ui/{dist/assets/alert-Bq6awLlW.js → assets/alert-D_2Y3qjL.js} +1 -1
  23. package/dist/ui/{dist/assets/alert-dialog-DQvltYmf.js → assets/alert-dialog-CpMxaNcu.js} +1 -1
  24. package/dist/ui/assets/{badge-DXUDdTed.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-bI9jImCS.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-Cg8zdT52.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-CrH0Jj3v.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/assets/{slider-CsiUDxc3.js → 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-DGNLDXjR.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-CnMO1FN8.js → CanvasPage-Cvs5ctza.js} +7 -7
  54. package/dist/ui/dist/assets/ChannelsPage-C5m_L7P9.js +8 -0
  55. package/dist/ui/{assets/DashboardPage-VyXXp3U1.js → dist/assets/DashboardPage-CztbRQdm.js} +2 -2
  56. package/dist/ui/dist/assets/{LoginPage-DPj2s2Qq.js → LoginPage-OMsrx5oj.js} +1 -1
  57. package/dist/ui/dist/assets/LogsPage-CcYYwjgF.js +1 -0
  58. package/dist/ui/{assets/MeetingPage-2ky_hKiG.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-B-hDZUM2.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/{assets/WebChatPage-BuGT2AL0.js → dist/assets/WebChatPage-c-7S9jnT.js} +2 -2
  65. package/dist/ui/dist/assets/accordion-DAbcVQCn.js +1 -0
  66. package/dist/ui/{assets/alert-Bq6awLlW.js → dist/assets/alert-D_2Y3qjL.js} +1 -1
  67. package/dist/ui/{assets/alert-dialog-DQvltYmf.js → dist/assets/alert-dialog-CpMxaNcu.js} +1 -1
  68. package/dist/ui/dist/assets/{badge-DXUDdTed.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-bI9jImCS.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-Cg8zdT52.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-CrH0Jj3v.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/dist/assets/{slider-CsiUDxc3.js → 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/llm-client.ts +4 -0
  105. package/packages/core/src/agent/llm-providers/anthropic.ts +23 -8
  106. package/packages/core/src/agent/llm-providers/interface.ts +5 -1
  107. package/packages/core/src/agent/llm-providers/minimax.ts +13 -0
  108. package/packages/core/src/agent/llm-providers/opencode-go.ts +9 -0
  109. package/packages/core/src/channels/whatsapp.ts +13 -1
  110. package/packages/core/src/config/loader.ts +7 -7
  111. package/packages/core/src/gateway/helpers/path.ts +2 -1
  112. package/packages/core/src/gateway/initializer.ts +4 -4
  113. package/packages/core/src/gateway/llm-local/downloader.ts +130 -11
  114. package/packages/core/src/gateway/llm-local/index.ts +2 -0
  115. package/packages/core/src/gateway/llm-local/models.ts +4 -3
  116. package/packages/core/src/gateway/router.ts +7 -5
  117. package/packages/core/src/gateway/routes/http-client.ts +16 -0
  118. package/packages/core/src/gateway/routes/llm-local.ts +51 -5
  119. package/packages/core/src/gateway/routes/providers.ts +43 -2
  120. package/packages/core/src/gateway/server.ts +11 -2
  121. package/packages/core/src/gateway/tts/src/install.ts +17 -9
  122. package/packages/core/src/storage/crypto.ts +152 -20
  123. package/packages/core/src/storage/migrate.ts +51 -18
  124. package/packages/core/src/storage/seed.ts +38 -2
  125. package/packages/core/src/tool-runtime/index.ts +22 -1
  126. package/packages/core/src/tools/api/api-request.ts +174 -0
  127. package/packages/core/src/tools/api/index.ts +16 -0
  128. package/packages/core/src/tools/index.ts +12 -0
  129. package/packages/core/src/tools/web/browser-click.ts +2 -2
  130. package/packages/core/src/tools/web/browser-extract.ts +22 -6
  131. package/packages/core/src/tools/web/browser-navigate.ts +34 -18
  132. package/packages/core/src/tools/web/browser-screenshot.ts +40 -8
  133. package/packages/core/src/tools/web/browser-script.ts +2 -2
  134. package/packages/core/src/tools/web/browser-service.ts +295 -341
  135. package/packages/core/src/tools/web/browser-type.ts +5 -10
  136. package/packages/core/src/tools/web/browser-wait.ts +2 -2
  137. package/packages/core/src/tools/web/index.ts +1 -1
  138. package/packages/core/src/utils/logger.ts +2 -1
  139. package/packages/mcp/src/manager.ts +2 -1
  140. package/packages/skills/src/bundled/api/api_client/SKILL.md +132 -0
  141. package/packages/skills/src/bundled-data.generated.ts +1274 -1217
  142. package/packages/skills/src/loader.ts +2 -1
  143. package/dist/ui/assets/AgentCreateForm-0oFbN3gj.js +0 -1
  144. package/dist/ui/assets/AgentDetailPage-BJ4L2fNJ.js +0 -1
  145. package/dist/ui/assets/AgentNewPage-B3n0LUck.js +0 -1
  146. package/dist/ui/assets/ChannelsPage-fbF8K4MR.js +0 -8
  147. package/dist/ui/assets/LogsPage-B2lY9maY.js +0 -1
  148. package/dist/ui/assets/ProvidersPage-CEyUM2tD.js +0 -1
  149. package/dist/ui/assets/SettingsPage-eO0i3g8p.js +0 -9
  150. package/dist/ui/assets/SetupPage-ByYqTELb.js +0 -1
  151. package/dist/ui/assets/accordion-C5d5Rm5z.js +0 -1
  152. package/dist/ui/assets/globe-DeCQTCDJ.js +0 -1
  153. package/dist/ui/assets/index-B2fCYtTS.css +0 -2
  154. package/dist/ui/assets/index-CQ7fn00w.js +0 -116
  155. package/dist/ui/assets/progress-BherYzY6.js +0 -1
  156. package/dist/ui/assets/scroll-area-DkeyX32e.js +0 -1
  157. package/dist/ui/assets/send-B0H5SEIE.js +0 -1
  158. package/dist/ui/assets/switch-BDwN8RYV.js +0 -1
  159. package/dist/ui/assets/table-CSc8ubon.js +0 -1
  160. package/dist/ui/assets/textarea-CXgXWKrT.js +0 -1
  161. package/dist/ui/assets/useProviders-CnlC_qCS.js +0 -1
  162. package/dist/ui/dist/assets/AgentCreateForm-0oFbN3gj.js +0 -1
  163. package/dist/ui/dist/assets/AgentDetailPage-BJ4L2fNJ.js +0 -1
  164. package/dist/ui/dist/assets/AgentNewPage-B3n0LUck.js +0 -1
  165. package/dist/ui/dist/assets/ChannelsPage-fbF8K4MR.js +0 -8
  166. package/dist/ui/dist/assets/LogsPage-B2lY9maY.js +0 -1
  167. package/dist/ui/dist/assets/ProvidersPage-CEyUM2tD.js +0 -1
  168. package/dist/ui/dist/assets/SettingsPage-eO0i3g8p.js +0 -9
  169. package/dist/ui/dist/assets/SetupPage-ByYqTELb.js +0 -1
  170. package/dist/ui/dist/assets/accordion-C5d5Rm5z.js +0 -1
  171. package/dist/ui/dist/assets/globe-DeCQTCDJ.js +0 -1
  172. package/dist/ui/dist/assets/index-B2fCYtTS.css +0 -2
  173. package/dist/ui/dist/assets/index-CQ7fn00w.js +0 -116
  174. package/dist/ui/dist/assets/progress-BherYzY6.js +0 -1
  175. package/dist/ui/dist/assets/scroll-area-DkeyX32e.js +0 -1
  176. package/dist/ui/dist/assets/send-B0H5SEIE.js +0 -1
  177. package/dist/ui/dist/assets/switch-BDwN8RYV.js +0 -1
  178. package/dist/ui/dist/assets/table-CSc8ubon.js +0 -1
  179. package/dist/ui/dist/assets/textarea-CXgXWKrT.js +0 -1
  180. package/dist/ui/dist/assets/useProviders-CnlC_qCS.js +0 -1
  181. /package/dist/ui/assets/{card-CNf6BS2e.js → card-CXAm46at.js} +0 -0
  182. /package/dist/ui/assets/{cpu-Cdgc_B1K.js → cpu-DSpPVLAz.js} +0 -0
  183. /package/dist/ui/assets/{download-C3ifGMjJ.js → download-D9ZyUZZR.js} +0 -0
  184. /package/dist/ui/assets/{external-link-BvxYeTP1.js → external-link-CHPbUorN.js} +0 -0
  185. /package/dist/ui/assets/{eye-DqNTU_GD.js → eye-epHJZ_nQ.js} +0 -0
  186. /package/dist/ui/assets/{file-text-BT_9S9SM.js → file-text-BEjEmgby.js} +0 -0
  187. /package/dist/ui/assets/{folder-open-BhH8y9ac.js → folder-open-iQMHVEqS.js} +0 -0
  188. /package/dist/ui/assets/{format-GVHeOyWI.js → format-oFACFaca.js} +0 -0
  189. /package/dist/ui/assets/{gateway-url-COCbW0IR.js → gateway-url-iG-C6Agn.js} +0 -0
  190. /package/dist/ui/assets/{gauge-D_TMa4i9.js → gauge-D0_GMEcq.js} +0 -0
  191. /package/dist/ui/assets/{settings-Ds4SqD8s.js → settings-CcMGI1iU.js} +0 -0
  192. /package/dist/ui/assets/{sparkles-yUEb-7oH.js → sparkles-D6fx8JC5.js} +0 -0
  193. /package/dist/ui/assets/{trash-2-CNjMkoq6.js → trash-2-BHRa5ft9.js} +0 -0
  194. /package/dist/ui/assets/{triangle-alert-C9Y8Ub4X.js → triangle-alert-D4nwAVbc.js} +0 -0
  195. /package/dist/ui/assets/{vendor-router-C9pIYwbJ.js → vendor-router-pCP7sjma.js} +0 -0
  196. /package/dist/ui/assets/{volume-2-CeSXNDv4.js → volume-2-B6tkRy2u.js} +0 -0
  197. /package/dist/ui/assets/{zap-hlXjpSeA.js → zap-QO7iWMRg.js} +0 -0
  198. /package/dist/ui/dist/assets/{card-CNf6BS2e.js → card-CXAm46at.js} +0 -0
  199. /package/dist/ui/dist/assets/{cpu-Cdgc_B1K.js → cpu-DSpPVLAz.js} +0 -0
  200. /package/dist/ui/dist/assets/{download-C3ifGMjJ.js → download-D9ZyUZZR.js} +0 -0
  201. /package/dist/ui/dist/assets/{external-link-BvxYeTP1.js → external-link-CHPbUorN.js} +0 -0
  202. /package/dist/ui/dist/assets/{eye-DqNTU_GD.js → eye-epHJZ_nQ.js} +0 -0
  203. /package/dist/ui/dist/assets/{file-text-BT_9S9SM.js → file-text-BEjEmgby.js} +0 -0
  204. /package/dist/ui/dist/assets/{folder-open-BhH8y9ac.js → folder-open-iQMHVEqS.js} +0 -0
  205. /package/dist/ui/dist/assets/{format-GVHeOyWI.js → format-oFACFaca.js} +0 -0
  206. /package/dist/ui/dist/assets/{gateway-url-COCbW0IR.js → gateway-url-iG-C6Agn.js} +0 -0
  207. /package/dist/ui/dist/assets/{gauge-D_TMa4i9.js → gauge-D0_GMEcq.js} +0 -0
  208. /package/dist/ui/dist/assets/{settings-Ds4SqD8s.js → settings-CcMGI1iU.js} +0 -0
  209. /package/dist/ui/dist/assets/{sparkles-yUEb-7oH.js → sparkles-D6fx8JC5.js} +0 -0
  210. /package/dist/ui/dist/assets/{trash-2-CNjMkoq6.js → trash-2-BHRa5ft9.js} +0 -0
  211. /package/dist/ui/dist/assets/{triangle-alert-C9Y8Ub4X.js → triangle-alert-D4nwAVbc.js} +0 -0
  212. /package/dist/ui/dist/assets/{vendor-router-C9pIYwbJ.js → vendor-router-pCP7sjma.js} +0 -0
  213. /package/dist/ui/dist/assets/{volume-2-CeSXNDv4.js → volume-2-B6tkRy2u.js} +0 -0
  214. /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-CQ7fn00w.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-CQ7fn00w.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.38",
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.38
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.38";
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" },
@@ -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
+ }
@@ -11,6 +11,7 @@ import type { ChannelConfig, IncomingMessage, OutboundMessage } from "./base.ts"
11
11
  import { BaseChannel } from "./base.ts";
12
12
  import { existsSync, mkdirSync, rmSync } from "node:fs";
13
13
  import * as path from "node:path";
14
+ import { homedir } from "node:os";
14
15
  import { logger } from "../utils/logger.ts";
15
16
  import { getDb } from "../storage/sqlite.ts";
16
17
  // @ts-ignore — no type definitions for qrcode-terminal
@@ -69,7 +70,7 @@ export class WhatsAppChannel extends BaseChannel {
69
70
  }
70
71
 
71
72
  private getAuthPath(agentId: string, accountId: string): string {
72
- const baseDir = process.env.HOME ?? "";
73
+ const baseDir = homedir();
73
74
  const authDir = path.join(baseDir, ".hive", "agents", agentId, "whatsapp", accountId);
74
75
 
75
76
  if (!existsSync(authDir)) {
@@ -117,11 +118,22 @@ export class WhatsAppChannel extends BaseChannel {
117
118
  this.connectionState.waVersion = version.join(".");
118
119
  this.log.info(`Using WhatsApp Web v${version.join(".")}`);
119
120
 
121
+ const baileysLogger = {
122
+ level: "silent",
123
+ child: () => baileysLogger,
124
+ trace: () => {},
125
+ debug: () => {},
126
+ info: (msg: unknown) => { if (typeof msg === "object" && msg !== null) this.log.debug((msg as any).msg ?? JSON.stringify(msg)); },
127
+ warn: (msg: unknown) => { if (typeof msg === "object" && msg !== null) this.log.warn((msg as any).msg ?? JSON.stringify(msg)); },
128
+ error: (msg: unknown) => { if (typeof msg === "object" && msg !== null) this.log.error((msg as any).msg ?? JSON.stringify(msg)); },
129
+ };
130
+
120
131
  this.socket = makeWASocket({
121
132
  version,
122
133
  auth: state,
123
134
  printQRInTerminal: false,
124
135
  syncFullHistory: false,
136
+ logger: baileysLogger as any,
125
137
  getMessage: async () => ({ conversation: "" }),
126
138
  });
127
139
 
@@ -1,7 +1,7 @@
1
1
  import * as z from "zod";
2
2
  import { mkdirSync, existsSync, readFileSync } from "node:fs";
3
3
  import * as path from "node:path";
4
- import { availableParallelism } from "node:os";
4
+ import { availableParallelism, homedir } from "node:os";
5
5
 
6
6
  const LogLevelSchema = z.enum(["debug", "info", "warn", "error"]);
7
7
  const DMPolicySchema = z.enum(["open", "pairing", "allowlist"]);
@@ -33,7 +33,7 @@ export function getHiveDir(): string {
33
33
  // Priority 1: HIVE_HOME explicitly set
34
34
  if (process.env.HIVE_HOME) {
35
35
  const hiveDir = process.env.HIVE_HOME.startsWith("~")
36
- ? path.join(process.env.HOME || "", process.env.HIVE_HOME.slice(1))
36
+ ? path.join(homedir(), process.env.HIVE_HOME.slice(1))
37
37
  : process.env.HIVE_HOME;
38
38
  loadEnv(hiveDir);
39
39
  return hiveDir;
@@ -49,7 +49,7 @@ export function getHiveDir(): string {
49
49
  }
50
50
 
51
51
  // Priority 3: Default ~/.hive
52
- const defaultDir = path.join(process.env.HOME || "", ".hive");
52
+ const defaultDir = path.join(homedir(), ".hive");
53
53
  loadEnv(defaultDir);
54
54
  return defaultDir;
55
55
  }
@@ -60,7 +60,7 @@ const expandPath = (p: string): string => {
60
60
  return p.replace("~/.hive", hiveDir);
61
61
  }
62
62
  if (p.startsWith("~")) {
63
- return path.join(process.env.HOME || "", p.slice(1));
63
+ return path.join(homedir(), p.slice(1));
64
64
  }
65
65
  return p;
66
66
  };
@@ -117,9 +117,9 @@ const WebConfigSchema = z.object({
117
117
 
118
118
  const BrowserConfigSchema = z.object({
119
119
  enabled: z.boolean().optional(),
120
- cdpUrl: z.string().optional(),
121
120
  headless: z.boolean().optional(),
122
121
  timeoutMs: z.number().optional(),
122
+ sessionName: z.string().optional(),
123
123
  });
124
124
 
125
125
  const CanvasConfigSchema = z.object({
@@ -437,7 +437,7 @@ function buildDefaultConfig(): Config {
437
437
  allowlist: [],
438
438
  denylist: ["rm -rf /", "sudo", "chmod 777", "> /dev/", "mkfs"],
439
439
  timeoutSeconds: 30,
440
- workDir: path.join(process.env.HOME || "", "exec"), // Points to home for exec by default
440
+ workDir: path.join(homedir(), "exec"), // Points to home for exec by default
441
441
  },
442
442
  web: {
443
443
  allowlist: [],
@@ -446,9 +446,9 @@ function buildDefaultConfig(): Config {
446
446
  },
447
447
  browser: {
448
448
  enabled: true,
449
- cdpUrl: "ws://127.0.0.1:9222",
450
449
  headless: true,
451
450
  timeoutMs: 30000,
451
+ sessionName: "hive",
452
452
  },
453
453
  canvas: {
454
454
  enabled: true,
@@ -1,4 +1,5 @@
1
1
  import * as path from "node:path";
2
+ import { homedir } from "node:os";
2
3
 
3
4
  /**
4
5
  * Expands a path that starts with ~ to the user's home directory.
@@ -7,7 +8,7 @@ import * as path from "node:path";
7
8
  */
8
9
  export function expandPath(p: string): string {
9
10
  if (p.startsWith("~")) {
10
- return path.join(process.env.HOME ?? "", p.slice(1));
11
+ return path.join(homedir(), p.slice(1));
11
12
  }
12
13
  return p;
13
14
  }