@johpaz/hive-agents 0.0.38 → 0.0.40
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.
- package/README.md +31 -71
- package/dist/hive.js +4318 -2898
- package/dist/tool-worker.js +2691 -1969
- package/dist/ui/assets/AgentCreateForm-b7xHyfNc.js +1 -0
- package/dist/ui/assets/AgentDetailPage-VHy3M7mI.js +1 -0
- package/dist/ui/assets/AgentNewPage-BnWImQMx.js +1 -0
- package/dist/ui/{dist/assets/AgentsPage-DGNLDXjR.js → assets/AgentsPage-WFy5abqx.js} +5 -5
- package/dist/ui/assets/ApiClientPage-BV7zLIL7.js +3 -0
- package/dist/ui/assets/{CanvasPage-CnMO1FN8.js → CanvasPage-B9zuIrTm.js} +7 -7
- package/dist/ui/assets/ChannelsPage-DiN3NvIM.js +8 -0
- package/dist/ui/{dist/assets/DashboardPage-VyXXp3U1.js → assets/DashboardPage-CHjARjVK.js} +2 -2
- package/dist/ui/assets/{LoginPage-DPj2s2Qq.js → LoginPage-Dwd_XxoU.js} +1 -1
- package/dist/ui/assets/LogsPage-DW8Nnqe6.js +1 -0
- package/dist/ui/assets/MeetingPage-D3bkiKYt.js +1 -0
- package/dist/ui/assets/{NotFound-BMeQSGcG.js → NotFound-BIUDlIXU.js} +1 -1
- package/dist/ui/assets/ProvidersPage-UqsDAxPQ.js +1 -0
- package/dist/ui/{dist/assets/RecoverPage-B-hDZUM2.js → assets/RecoverPage-8hTjr_JU.js} +1 -1
- package/dist/ui/assets/SettingsPage-DNa0jOkA.js +9 -0
- package/dist/ui/assets/SetupPage-Bdm2irQG.js +1 -0
- package/dist/ui/assets/WebChatPage-DElJg6P2.js +16 -0
- package/dist/ui/assets/accordion-CnLzKNHK.js +1 -0
- package/dist/ui/{dist/assets/alert-Bq6awLlW.js → assets/alert-DylmSCDJ.js} +1 -1
- package/dist/ui/{dist/assets/alert-dialog-DQvltYmf.js → assets/alert-dialog-DNNWN_SI.js} +1 -1
- package/dist/ui/assets/{badge-DXUDdTed.js → badge-ChENFgkC.js} +1 -1
- package/dist/ui/assets/bell-8BqRYmzf.js +1 -0
- package/dist/ui/assets/chevron-down-DIosfU_U.js +1 -0
- package/dist/ui/assets/chevron-up-CI-W21Fy.js +1 -0
- package/dist/ui/assets/circle-x-DjLkFDO8.js +1 -0
- package/dist/ui/assets/copy-Bu5d7C-0.js +1 -0
- package/dist/ui/{dist/assets/dialog-bI9jImCS.js → assets/dialog-BJ-npIv8.js} +1 -1
- package/dist/ui/{dist/assets/dropdown-menu-BK-CO3Od.js → assets/dropdown-menu-DDiaHg5y.js} +1 -1
- package/dist/ui/assets/{es-Cg8zdT52.js → es-ecSKCyB6.js} +1 -1
- package/dist/ui/assets/index-CawKP29y.js +116 -0
- package/dist/ui/assets/index-DIcsEkyd.css +2 -0
- package/dist/ui/{dist/assets/label-CrH0Jj3v.js → assets/label-Bi6udtSd.js} +1 -1
- package/dist/ui/assets/progress-D5c-Eilm.js +1 -0
- package/dist/ui/assets/scroll-area-CihOx0cb.js +1 -0
- package/dist/ui/assets/search-DzDptO9s.js +1 -0
- package/dist/ui/assets/select-BQCOjM2j.js +1 -0
- package/dist/ui/assets/send-BPk9XbIq.js +1 -0
- package/dist/ui/assets/shield-CxhcUT39.js +1 -0
- package/dist/ui/assets/{slider-CsiUDxc3.js → slider-bcUiUfx0.js} +1 -1
- package/dist/ui/assets/switch-BR30E4ej.js +1 -0
- package/dist/ui/assets/table-B3aGEaVp.js +1 -0
- package/dist/ui/assets/tabs-LQidMKRS.js +1 -0
- package/dist/ui/assets/textarea-B6Z1Zc6W.js +1 -0
- package/dist/ui/assets/useProviders-Dlizq_8q.js +1 -0
- package/dist/ui/{dist/assets/vendor-radix-cw1bQaVC.js → assets/vendor-radix-D6rA7xKY.js} +4 -4
- package/dist/ui/assets/{vendor-react-D4s9E-zj.js → vendor-react-BU5iQU4f.js} +1 -1
- package/dist/ui/dist/assets/AgentCreateForm-b7xHyfNc.js +1 -0
- package/dist/ui/dist/assets/AgentDetailPage-VHy3M7mI.js +1 -0
- package/dist/ui/dist/assets/AgentNewPage-BnWImQMx.js +1 -0
- package/dist/ui/{assets/AgentsPage-DGNLDXjR.js → dist/assets/AgentsPage-WFy5abqx.js} +5 -5
- package/dist/ui/dist/assets/ApiClientPage-BV7zLIL7.js +3 -0
- package/dist/ui/dist/assets/{CanvasPage-CnMO1FN8.js → CanvasPage-B9zuIrTm.js} +7 -7
- package/dist/ui/dist/assets/ChannelsPage-DiN3NvIM.js +8 -0
- package/dist/ui/{assets/DashboardPage-VyXXp3U1.js → dist/assets/DashboardPage-CHjARjVK.js} +2 -2
- package/dist/ui/dist/assets/{LoginPage-DPj2s2Qq.js → LoginPage-Dwd_XxoU.js} +1 -1
- package/dist/ui/dist/assets/LogsPage-DW8Nnqe6.js +1 -0
- package/dist/ui/dist/assets/MeetingPage-D3bkiKYt.js +1 -0
- package/dist/ui/dist/assets/{NotFound-BMeQSGcG.js → NotFound-BIUDlIXU.js} +1 -1
- package/dist/ui/dist/assets/ProvidersPage-UqsDAxPQ.js +1 -0
- package/dist/ui/{assets/RecoverPage-B-hDZUM2.js → dist/assets/RecoverPage-8hTjr_JU.js} +1 -1
- package/dist/ui/dist/assets/SettingsPage-DNa0jOkA.js +9 -0
- package/dist/ui/dist/assets/SetupPage-Bdm2irQG.js +1 -0
- package/dist/ui/dist/assets/WebChatPage-DElJg6P2.js +16 -0
- package/dist/ui/dist/assets/accordion-CnLzKNHK.js +1 -0
- package/dist/ui/{assets/alert-Bq6awLlW.js → dist/assets/alert-DylmSCDJ.js} +1 -1
- package/dist/ui/{assets/alert-dialog-DQvltYmf.js → dist/assets/alert-dialog-DNNWN_SI.js} +1 -1
- package/dist/ui/dist/assets/{badge-DXUDdTed.js → badge-ChENFgkC.js} +1 -1
- package/dist/ui/dist/assets/bell-8BqRYmzf.js +1 -0
- package/dist/ui/dist/assets/chevron-down-DIosfU_U.js +1 -0
- package/dist/ui/dist/assets/chevron-up-CI-W21Fy.js +1 -0
- package/dist/ui/dist/assets/circle-x-DjLkFDO8.js +1 -0
- package/dist/ui/dist/assets/copy-Bu5d7C-0.js +1 -0
- package/dist/ui/{assets/dialog-bI9jImCS.js → dist/assets/dialog-BJ-npIv8.js} +1 -1
- package/dist/ui/{assets/dropdown-menu-BK-CO3Od.js → dist/assets/dropdown-menu-DDiaHg5y.js} +1 -1
- package/dist/ui/dist/assets/{es-Cg8zdT52.js → es-ecSKCyB6.js} +1 -1
- package/dist/ui/dist/assets/index-CawKP29y.js +116 -0
- package/dist/ui/dist/assets/index-DIcsEkyd.css +2 -0
- package/dist/ui/{assets/label-CrH0Jj3v.js → dist/assets/label-Bi6udtSd.js} +1 -1
- package/dist/ui/dist/assets/progress-D5c-Eilm.js +1 -0
- package/dist/ui/dist/assets/scroll-area-CihOx0cb.js +1 -0
- package/dist/ui/dist/assets/search-DzDptO9s.js +1 -0
- package/dist/ui/dist/assets/select-BQCOjM2j.js +1 -0
- package/dist/ui/dist/assets/send-BPk9XbIq.js +1 -0
- package/dist/ui/dist/assets/shield-CxhcUT39.js +1 -0
- package/dist/ui/dist/assets/{slider-CsiUDxc3.js → slider-bcUiUfx0.js} +1 -1
- package/dist/ui/dist/assets/switch-BR30E4ej.js +1 -0
- package/dist/ui/dist/assets/table-B3aGEaVp.js +1 -0
- package/dist/ui/dist/assets/tabs-LQidMKRS.js +1 -0
- package/dist/ui/dist/assets/textarea-B6Z1Zc6W.js +1 -0
- package/dist/ui/dist/assets/useProviders-Dlizq_8q.js +1 -0
- package/dist/ui/{assets/vendor-radix-cw1bQaVC.js → dist/assets/vendor-radix-D6rA7xKY.js} +4 -4
- package/dist/ui/dist/assets/{vendor-react-D4s9E-zj.js → vendor-react-BU5iQU4f.js} +1 -1
- package/dist/ui/dist/index.html +6 -6
- package/dist/ui/index.html +6 -6
- package/package.json +1 -1
- package/packages/cli/src/adapters/binary.ts +8 -4
- package/packages/cli/src/adapters/bun-global.ts +5 -1
- package/packages/cli/src/adapters/config.ts +4 -3
- package/packages/cli/src/adapters/docker.ts +2 -1
- package/packages/cli/src/commands/gateway.ts +123 -9
- package/packages/cli/src/commands/logs.ts +2 -1
- package/packages/cli/src/commands/onboard.ts +27 -1
- package/packages/cli/src/commands/sessions.ts +2 -1
- package/packages/cli/src/commands/skills.ts +2 -1
- package/packages/core/src/agent/agent-loop.ts +104 -2
- package/packages/core/src/agent/context-compiler.ts +6 -0
- package/packages/core/src/agent/llm-client.ts +6 -0
- package/packages/core/src/agent/llm-providers/anthropic.ts +23 -8
- package/packages/core/src/agent/llm-providers/hiveagents.ts +248 -0
- package/packages/core/src/agent/llm-providers/interface.ts +7 -1
- package/packages/core/src/agent/llm-providers/minimax.ts +13 -0
- package/packages/core/src/agent/llm-providers/openai-compat-base.ts +49 -25
- package/packages/core/src/agent/llm-providers/opencode-go.ts +9 -0
- package/packages/core/src/agent/providers/index.ts +3 -2
- package/packages/core/src/agent/stuck-loop.ts +90 -14
- package/packages/core/src/channels/base.ts +7 -1
- package/packages/core/src/channels/whatsapp.ts +13 -1
- package/packages/core/src/config/loader.ts +8 -8
- package/packages/core/src/gateway/helpers/path.ts +2 -1
- package/packages/core/src/gateway/initializer.ts +4 -4
- package/packages/core/src/gateway/llm-local/downloader.ts +130 -11
- package/packages/core/src/gateway/llm-local/index.ts +2 -0
- package/packages/core/src/gateway/llm-local/models.ts +4 -3
- package/packages/core/src/gateway/router.ts +7 -5
- package/packages/core/src/gateway/routes/http-client.ts +16 -0
- package/packages/core/src/gateway/routes/llm-local.ts +51 -5
- package/packages/core/src/gateway/routes/providers.ts +99 -2
- package/packages/core/src/gateway/server.ts +131 -57
- package/packages/core/src/gateway/slash-commands.ts +7 -1
- package/packages/core/src/gateway/tts/src/install.ts +17 -9
- package/packages/core/src/storage/crypto.ts +152 -20
- package/packages/core/src/storage/migrate.ts +51 -18
- package/packages/core/src/storage/onboarding.ts +28 -0
- package/packages/core/src/storage/seed.ts +52 -2
- package/packages/core/src/tool-runtime/index.ts +22 -1
- package/packages/core/src/tools/api/api-request.ts +174 -0
- package/packages/core/src/tools/api/index.ts +16 -0
- package/packages/core/src/tools/index.ts +12 -0
- package/packages/core/src/tools/web/browser-click.ts +2 -2
- package/packages/core/src/tools/web/browser-extract.ts +22 -6
- package/packages/core/src/tools/web/browser-navigate.ts +34 -18
- package/packages/core/src/tools/web/browser-screenshot.ts +40 -8
- package/packages/core/src/tools/web/browser-script.ts +2 -2
- package/packages/core/src/tools/web/browser-service.ts +295 -341
- package/packages/core/src/tools/web/browser-type.ts +5 -10
- package/packages/core/src/tools/web/browser-wait.ts +2 -2
- package/packages/core/src/tools/web/index.ts +1 -1
- package/packages/core/src/utils/logger.ts +2 -1
- package/packages/mcp/src/manager.ts +2 -1
- package/packages/skills/src/bundled/api/api_client/SKILL.md +132 -0
- package/packages/skills/src/bundled-data.generated.ts +1191 -1134
- package/packages/skills/src/loader.ts +2 -1
- package/dist/ui/assets/AgentCreateForm-0oFbN3gj.js +0 -1
- package/dist/ui/assets/AgentDetailPage-BJ4L2fNJ.js +0 -1
- package/dist/ui/assets/AgentNewPage-B3n0LUck.js +0 -1
- package/dist/ui/assets/ChannelsPage-fbF8K4MR.js +0 -8
- package/dist/ui/assets/LogsPage-B2lY9maY.js +0 -1
- package/dist/ui/assets/MeetingPage-2ky_hKiG.js +0 -1
- package/dist/ui/assets/ProvidersPage-CEyUM2tD.js +0 -1
- package/dist/ui/assets/SettingsPage-eO0i3g8p.js +0 -9
- package/dist/ui/assets/SetupPage-ByYqTELb.js +0 -1
- package/dist/ui/assets/WebChatPage-BuGT2AL0.js +0 -16
- package/dist/ui/assets/accordion-C5d5Rm5z.js +0 -1
- package/dist/ui/assets/chevron-up-BYhk0K2J.js +0 -1
- package/dist/ui/assets/globe-DeCQTCDJ.js +0 -1
- package/dist/ui/assets/index-B2fCYtTS.css +0 -2
- package/dist/ui/assets/index-CQ7fn00w.js +0 -116
- package/dist/ui/assets/progress-BherYzY6.js +0 -1
- package/dist/ui/assets/scroll-area-DkeyX32e.js +0 -1
- package/dist/ui/assets/send-B0H5SEIE.js +0 -1
- package/dist/ui/assets/switch-BDwN8RYV.js +0 -1
- package/dist/ui/assets/table-CSc8ubon.js +0 -1
- package/dist/ui/assets/textarea-CXgXWKrT.js +0 -1
- package/dist/ui/assets/useProviders-CnlC_qCS.js +0 -1
- package/dist/ui/dist/assets/AgentCreateForm-0oFbN3gj.js +0 -1
- package/dist/ui/dist/assets/AgentDetailPage-BJ4L2fNJ.js +0 -1
- package/dist/ui/dist/assets/AgentNewPage-B3n0LUck.js +0 -1
- package/dist/ui/dist/assets/ChannelsPage-fbF8K4MR.js +0 -8
- package/dist/ui/dist/assets/LogsPage-B2lY9maY.js +0 -1
- package/dist/ui/dist/assets/MeetingPage-2ky_hKiG.js +0 -1
- package/dist/ui/dist/assets/ProvidersPage-CEyUM2tD.js +0 -1
- package/dist/ui/dist/assets/SettingsPage-eO0i3g8p.js +0 -9
- package/dist/ui/dist/assets/SetupPage-ByYqTELb.js +0 -1
- package/dist/ui/dist/assets/WebChatPage-BuGT2AL0.js +0 -16
- package/dist/ui/dist/assets/accordion-C5d5Rm5z.js +0 -1
- package/dist/ui/dist/assets/chevron-up-BYhk0K2J.js +0 -1
- package/dist/ui/dist/assets/globe-DeCQTCDJ.js +0 -1
- package/dist/ui/dist/assets/index-B2fCYtTS.css +0 -2
- package/dist/ui/dist/assets/index-CQ7fn00w.js +0 -116
- package/dist/ui/dist/assets/progress-BherYzY6.js +0 -1
- package/dist/ui/dist/assets/scroll-area-DkeyX32e.js +0 -1
- package/dist/ui/dist/assets/send-B0H5SEIE.js +0 -1
- package/dist/ui/dist/assets/switch-BDwN8RYV.js +0 -1
- package/dist/ui/dist/assets/table-CSc8ubon.js +0 -1
- package/dist/ui/dist/assets/textarea-CXgXWKrT.js +0 -1
- package/dist/ui/dist/assets/useProviders-CnlC_qCS.js +0 -1
- /package/dist/ui/assets/{card-CNf6BS2e.js → card-DFKnZ6ky.js} +0 -0
- /package/dist/ui/assets/{circle-alert-CyHDwUj8.js → circle-alert-KuAm2FWh.js} +0 -0
- /package/dist/ui/assets/{circle-check-Bb54Ebmu.js → circle-check-6Ard1-2z.js} +0 -0
- /package/dist/ui/assets/{cpu-Cdgc_B1K.js → cpu-KDy6-FAI.js} +0 -0
- /package/dist/ui/assets/{download-C3ifGMjJ.js → download-Cjbk4Rek.js} +0 -0
- /package/dist/ui/assets/{external-link-BvxYeTP1.js → external-link-6sTlRDUR.js} +0 -0
- /package/dist/ui/assets/{eye-DqNTU_GD.js → eye-Df8o0tkC.js} +0 -0
- /package/dist/ui/assets/{file-text-BT_9S9SM.js → file-text-lnxnjBp0.js} +0 -0
- /package/dist/ui/assets/{folder-open-BhH8y9ac.js → folder-open-DJBLDFjv.js} +0 -0
- /package/dist/ui/assets/{format-GVHeOyWI.js → format-BwdV8bB5.js} +0 -0
- /package/dist/ui/assets/{gateway-url-COCbW0IR.js → gateway-url-DwzPmoc8.js} +0 -0
- /package/dist/ui/assets/{gauge-D_TMa4i9.js → gauge-B8Tj43rC.js} +0 -0
- /package/dist/ui/assets/{hexagon-DsGOUl-H.js → hexagon-6L79pgVK.js} +0 -0
- /package/dist/ui/assets/{history-BSG-Ypqf.js → history-CAF_R34_.js} +0 -0
- /package/dist/ui/assets/{info-NwLoa2Mj.js → info-WjromB4Y.js} +0 -0
- /package/dist/ui/assets/{key-3EP0dhkT.js → key-DyKOoQh5.js} +0 -0
- /package/dist/ui/assets/{loader-circle-CZNax6kS.js → loader-circle-BmBOgYze.js} +0 -0
- /package/dist/ui/assets/{lock-Ei1_J-Nq.js → lock-BS6OLXPv.js} +0 -0
- /package/dist/ui/assets/{pause-BUqah9Bi.js → pause-VqeUmp2Z.js} +0 -0
- /package/dist/ui/assets/{play-NcZ4swwL.js → play-zJpWuhrr.js} +0 -0
- /package/dist/ui/assets/{plus-CX1xyhp5.js → plus-BZQX26Dr.js} +0 -0
- /package/dist/ui/assets/{refresh-cw-DaYdjQFk.js → refresh-cw-CCzDCAuz.js} +0 -0
- /package/dist/ui/assets/{save-CUdYyHNy.js → save-hUmZhceG.js} +0 -0
- /package/dist/ui/assets/{settings-Ds4SqD8s.js → settings-BGfrZ_zM.js} +0 -0
- /package/dist/ui/assets/{sparkles-yUEb-7oH.js → sparkles-BhwlS1pc.js} +0 -0
- /package/dist/ui/assets/{square-BD81nFtN.js → square-DMNWw4Hi.js} +0 -0
- /package/dist/ui/assets/{terminal-DN38Q456.js → terminal--7G943As.js} +0 -0
- /package/dist/ui/assets/{trash-2-CNjMkoq6.js → trash-2-xD2o4SgX.js} +0 -0
- /package/dist/ui/assets/{triangle-alert-C9Y8Ub4X.js → triangle-alert-pVIJGjga.js} +0 -0
- /package/dist/ui/assets/{vendor-router-C9pIYwbJ.js → vendor-router-gqiZ7xhx.js} +0 -0
- /package/dist/ui/assets/{volume-2-CeSXNDv4.js → volume-2-BekVQl6P.js} +0 -0
- /package/dist/ui/assets/{zap-hlXjpSeA.js → zap-B4RaNNO5.js} +0 -0
- /package/dist/ui/dist/assets/{card-CNf6BS2e.js → card-DFKnZ6ky.js} +0 -0
- /package/dist/ui/dist/assets/{circle-alert-CyHDwUj8.js → circle-alert-KuAm2FWh.js} +0 -0
- /package/dist/ui/dist/assets/{circle-check-Bb54Ebmu.js → circle-check-6Ard1-2z.js} +0 -0
- /package/dist/ui/dist/assets/{cpu-Cdgc_B1K.js → cpu-KDy6-FAI.js} +0 -0
- /package/dist/ui/dist/assets/{download-C3ifGMjJ.js → download-Cjbk4Rek.js} +0 -0
- /package/dist/ui/dist/assets/{external-link-BvxYeTP1.js → external-link-6sTlRDUR.js} +0 -0
- /package/dist/ui/dist/assets/{eye-DqNTU_GD.js → eye-Df8o0tkC.js} +0 -0
- /package/dist/ui/dist/assets/{file-text-BT_9S9SM.js → file-text-lnxnjBp0.js} +0 -0
- /package/dist/ui/dist/assets/{folder-open-BhH8y9ac.js → folder-open-DJBLDFjv.js} +0 -0
- /package/dist/ui/dist/assets/{format-GVHeOyWI.js → format-BwdV8bB5.js} +0 -0
- /package/dist/ui/dist/assets/{gateway-url-COCbW0IR.js → gateway-url-DwzPmoc8.js} +0 -0
- /package/dist/ui/dist/assets/{gauge-D_TMa4i9.js → gauge-B8Tj43rC.js} +0 -0
- /package/dist/ui/dist/assets/{hexagon-DsGOUl-H.js → hexagon-6L79pgVK.js} +0 -0
- /package/dist/ui/dist/assets/{history-BSG-Ypqf.js → history-CAF_R34_.js} +0 -0
- /package/dist/ui/dist/assets/{info-NwLoa2Mj.js → info-WjromB4Y.js} +0 -0
- /package/dist/ui/dist/assets/{key-3EP0dhkT.js → key-DyKOoQh5.js} +0 -0
- /package/dist/ui/dist/assets/{loader-circle-CZNax6kS.js → loader-circle-BmBOgYze.js} +0 -0
- /package/dist/ui/dist/assets/{lock-Ei1_J-Nq.js → lock-BS6OLXPv.js} +0 -0
- /package/dist/ui/dist/assets/{pause-BUqah9Bi.js → pause-VqeUmp2Z.js} +0 -0
- /package/dist/ui/dist/assets/{play-NcZ4swwL.js → play-zJpWuhrr.js} +0 -0
- /package/dist/ui/dist/assets/{plus-CX1xyhp5.js → plus-BZQX26Dr.js} +0 -0
- /package/dist/ui/dist/assets/{refresh-cw-DaYdjQFk.js → refresh-cw-CCzDCAuz.js} +0 -0
- /package/dist/ui/dist/assets/{save-CUdYyHNy.js → save-hUmZhceG.js} +0 -0
- /package/dist/ui/dist/assets/{settings-Ds4SqD8s.js → settings-BGfrZ_zM.js} +0 -0
- /package/dist/ui/dist/assets/{sparkles-yUEb-7oH.js → sparkles-BhwlS1pc.js} +0 -0
- /package/dist/ui/dist/assets/{square-BD81nFtN.js → square-DMNWw4Hi.js} +0 -0
- /package/dist/ui/dist/assets/{terminal-DN38Q456.js → terminal--7G943As.js} +0 -0
- /package/dist/ui/dist/assets/{trash-2-CNjMkoq6.js → trash-2-xD2o4SgX.js} +0 -0
- /package/dist/ui/dist/assets/{triangle-alert-C9Y8Ub4X.js → triangle-alert-pVIJGjga.js} +0 -0
- /package/dist/ui/dist/assets/{vendor-router-C9pIYwbJ.js → vendor-router-gqiZ7xhx.js} +0 -0
- /package/dist/ui/dist/assets/{volume-2-CeSXNDv4.js → volume-2-BekVQl6P.js} +0 -0
- /package/dist/ui/dist/assets/{zap-hlXjpSeA.js → zap-B4RaNNO5.js} +0 -0
|
@@ -41,7 +41,7 @@ import { handleSetupStatus, handleVerifyProvider, handleCompleteSetup, handleSet
|
|
|
41
41
|
import { handleAuthStatus, handleLogin, handleSetupCredentials, handleChangePassword, handleRecover, handleDisableAuth, handleRecoveryKey } from "./routes/auth";
|
|
42
42
|
import { resolveUserId } from "../storage/onboarding";
|
|
43
43
|
import { handleGetAgents, handleCreateAgent, handleUpdateAgent, handleDeleteAgent } from "./routes/agents";
|
|
44
|
-
import { handleGetProviders, handleCreateProvider, handleToggleProvider, handleUpdateProvider, handleSyncProviderModels } from "./routes/providers";
|
|
44
|
+
import { handleGetProviders, handleCreateProvider, handleToggleProvider, handleUpdateProvider, handleSyncProviderModels, handleLoadHiveAgentsModel, handleGetHiveAgentsModelStatus } from "./routes/providers";
|
|
45
45
|
import { handleGetUsers, handleCreateUser, handleUpdateUserSettings, handleGetUserChannels, handleLinkUserChannel } from "./routes/users";
|
|
46
46
|
import { handleGetSkills, handleActivateSkill, handleUpdateSkill, handleDeleteSkill, handleCreateSkill } from "./routes/skills";
|
|
47
47
|
import { handleGetEthics, handleActivateEthics, handleDeleteEthics } from "./routes/ethics";
|
|
@@ -73,12 +73,13 @@ import { handleGetModels, handleCreateModel, handleToggleModel, handleGetModelsC
|
|
|
73
73
|
import { handleGetVoiceProviders, handleGetConfiguredVoiceProviders, handleSaveVoiceProviderKey, handleTestVoice, handleGetChannelVoice, handleUpdateChannelVoice, handleGetVoiceProviderVoices } from "./routes/voice";
|
|
74
74
|
import { handleGetVisionProviders, handleGetChannelVision, handleUpdateChannelVision, handleOcrImage } from "./routes/multimodal";
|
|
75
75
|
import { handleGetLocalTTSStatus, handleGetLocalTTSLogs, handleInstallLocalTTS, handleStartLocalTTS, handleStopLocalTTS, handleSpeakLocalTTS, handleGetAvailableModels, handleGetInstalledVoices, handleDownloadModel, handleGetDownloadLogs, initializeLocalTTS } from "./routes/tts-local";
|
|
76
|
-
import { handleGetLocalLLMStatus, handleGetLocalLLMLogs, handleInstallLocalLLM, handleStartLocalLLM, handleStopLocalLLM, handleDownloadLLMModel, initializeLocalLLM } from "./routes/llm-local";
|
|
76
|
+
import { handleGetLocalLLMStatus, handleGetLocalLLMLogs, handleInstallLocalLLM, handleStartLocalLLM, handleStopLocalLLM, handleDownloadLLMModel, handleGetDownloadProgress, initializeLocalLLM } from "./routes/llm-local";
|
|
77
77
|
import { handleCreateMeeting, handleListMeetings, handleGetMeeting, handleAddMeetingSegment, handleStopMeeting } from "./routes/meeting";
|
|
78
78
|
import { handleGetActivityStats, handleGetSystemStats, handleGetUsageStats, handleSystemReload, handleApiReload, handleGetVersion, handleTriggerUpdate } from "./routes/system";
|
|
79
79
|
import { handleGetChatHistory, handleGetCanvas, handleGetNotes, handleUpdateNote } from "./routes/chat";
|
|
80
80
|
import { handleChat as handlePostChat } from "./routes/chat";
|
|
81
81
|
import { handleGetConfig } from "./routes/config";
|
|
82
|
+
import { handleHttpRequest } from "./routes/http-client";
|
|
82
83
|
import { handleGetWorkspace, handleUpdateWorkspace, handleValidateWorkspace, handleCreateWorkspace, handleOpenWorkspace } from "./routes/workspace";
|
|
83
84
|
import { getNarration, expandPath, addCorsHeaders, CORS_ORIGINS } from "./helpers";
|
|
84
85
|
import { redactConfig } from "./helpers";
|
|
@@ -256,6 +257,82 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
256
257
|
return undefined;
|
|
257
258
|
}
|
|
258
259
|
|
|
260
|
+
type WebChatProcessKind = "analysis" | "tool" | "observation" | "writing";
|
|
261
|
+
type WebChatProcessStatus = "thinking" | "done" | "error";
|
|
262
|
+
|
|
263
|
+
function createWebChatProcessReporter(ws: { send: (payload: string) => void }, sessionId: string, messageId: string) {
|
|
264
|
+
const sent = new Set<string>();
|
|
265
|
+
|
|
266
|
+
const send = (event: {
|
|
267
|
+
kind?: WebChatProcessKind;
|
|
268
|
+
label?: string;
|
|
269
|
+
detail?: string;
|
|
270
|
+
status?: WebChatProcessStatus;
|
|
271
|
+
summary?: string;
|
|
272
|
+
}) => {
|
|
273
|
+
ws.send(JSON.stringify({
|
|
274
|
+
type: "process",
|
|
275
|
+
sessionId,
|
|
276
|
+
id: messageId,
|
|
277
|
+
messageId,
|
|
278
|
+
processKind: event.kind,
|
|
279
|
+
processStatus: event.status,
|
|
280
|
+
label: event.label,
|
|
281
|
+
detail: event.detail,
|
|
282
|
+
summary: event.summary,
|
|
283
|
+
timestamp: new Date().toISOString(),
|
|
284
|
+
} as OutboundMessage));
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
const sendOnce = (key: string, event: Parameters<typeof send>[0]) => {
|
|
288
|
+
if (sent.has(key)) return;
|
|
289
|
+
sent.add(key);
|
|
290
|
+
send(event);
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
return {
|
|
294
|
+
start(label = "Revisando tu solicitud") {
|
|
295
|
+
sendOnce("start", { kind: "analysis", label, status: "thinking" });
|
|
296
|
+
},
|
|
297
|
+
writing() {
|
|
298
|
+
sendOnce("writing", { kind: "writing", label: "Preparando la respuesta", status: "thinking" });
|
|
299
|
+
},
|
|
300
|
+
step(step: { type: string; message?: string; toolName?: string }) {
|
|
301
|
+
if (step.type === "tool_call" && step.toolName) {
|
|
302
|
+
sendOnce(`tool:${step.toolName}`, {
|
|
303
|
+
kind: "tool",
|
|
304
|
+
label: getNarration(step.toolName),
|
|
305
|
+
status: "thinking",
|
|
306
|
+
});
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
if (step.type === "tool_result") {
|
|
311
|
+
sendOnce(`tool_result:${sent.size}`, {
|
|
312
|
+
kind: "observation",
|
|
313
|
+
label: "Revisando la informacion obtenida",
|
|
314
|
+
status: "thinking",
|
|
315
|
+
});
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if (step.type === "text") {
|
|
320
|
+
sendOnce("analysis:text", {
|
|
321
|
+
kind: "analysis",
|
|
322
|
+
label: "Organizando la informacion",
|
|
323
|
+
status: "thinking",
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
done(summary = "Proceso completado") {
|
|
328
|
+
send({ status: "done", summary });
|
|
329
|
+
},
|
|
330
|
+
error(summary = "No se pudo completar el proceso") {
|
|
331
|
+
send({ status: "error", summary });
|
|
332
|
+
},
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
|
|
259
336
|
// Set up hot reload watchers
|
|
260
337
|
const watchers: Array<() => void> = [];
|
|
261
338
|
|
|
@@ -961,6 +1038,11 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
961
1038
|
}
|
|
962
1039
|
}
|
|
963
1040
|
|
|
1041
|
+
// ── HTTP Client API ────────────────────────────────────────────────
|
|
1042
|
+
if ((url.pathname === "/api/http-request" || url.pathname === "/api/http-request/") && req.method === "POST") {
|
|
1043
|
+
return await handleHttpRequest(req, addCorsHeaders)
|
|
1044
|
+
}
|
|
1045
|
+
|
|
964
1046
|
// ── Tasks API ─────────────────────────────────────────────────────
|
|
965
1047
|
if ((url.pathname === "/api/tasks" || url.pathname === "/api/tasks/") && req.method === "GET") {
|
|
966
1048
|
return await handleGetTasks(req, addCorsHeaders)
|
|
@@ -1156,6 +1238,14 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
1156
1238
|
return await handleUpdateProvider(req, addCorsHeaders)
|
|
1157
1239
|
}
|
|
1158
1240
|
|
|
1241
|
+
// ── HiveAgents model loading ───────────────────────────────────────
|
|
1242
|
+
if (url.pathname === "/api/providers/hiveagents/load-model" && req.method === "POST") {
|
|
1243
|
+
return await handleLoadHiveAgentsModel(req, addCorsHeaders)
|
|
1244
|
+
}
|
|
1245
|
+
if (url.pathname === "/api/providers/hiveagents/model-status" && req.method === "GET") {
|
|
1246
|
+
return await handleGetHiveAgentsModelStatus(req, addCorsHeaders)
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1159
1249
|
// ── Models API ───────────────────────────────────────────────────
|
|
1160
1250
|
// GET /api/models?provider_id=xxx - Get models filtered by provider
|
|
1161
1251
|
if (url.pathname === "/api/models" && req.method === "GET") {
|
|
@@ -1626,6 +1716,9 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
1626
1716
|
if (url.pathname === "/api/llm-local/download-model" && req.method === "POST") {
|
|
1627
1717
|
return await handleDownloadLLMModel(req, addCorsHeaders)
|
|
1628
1718
|
}
|
|
1719
|
+
if (url.pathname === "/api/llm-local/download-progress" && req.method === "GET") {
|
|
1720
|
+
return await handleGetDownloadProgress(req, addCorsHeaders)
|
|
1721
|
+
}
|
|
1629
1722
|
|
|
1630
1723
|
// ── Meeting Transcription API ────────────────────────────────────────
|
|
1631
1724
|
if (url.pathname === "/api/meetings" && req.method === "POST") {
|
|
@@ -2150,6 +2243,7 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2150
2243
|
} as OutboundMessage));
|
|
2151
2244
|
|
|
2152
2245
|
laneQueue.enqueue(msg.sessionId, async (_task, signal) => {
|
|
2246
|
+
let processReporter: ReturnType<typeof createWebChatProcessReporter> | null = null;
|
|
2153
2247
|
if (signal.aborted) {
|
|
2154
2248
|
ws.send(JSON.stringify({ type: "typing", isTyping: false, sessionId: msg.sessionId } as OutboundMessage));
|
|
2155
2249
|
ws.send(JSON.stringify({ type: "error", sessionId: msg.sessionId, error: "Task cancelled" } as OutboundMessage));
|
|
@@ -2164,11 +2258,14 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2164
2258
|
const unifiedSessionId = conversationThreadId;
|
|
2165
2259
|
const routingSessionId = msg.sessionId;
|
|
2166
2260
|
const messages = [{ role: "user" as const, content: messageContent }];
|
|
2261
|
+
const messageId = crypto.randomUUID();
|
|
2262
|
+
processReporter = createWebChatProcessReporter(ws, routingSessionId, messageId);
|
|
2263
|
+
processReporter.start("Revisando la transcripcion");
|
|
2167
2264
|
log.info(`Generating response for session ${unifiedSessionId}...`);
|
|
2168
2265
|
|
|
2169
2266
|
// Streaming: send tokens as they arrive
|
|
2170
2267
|
let streamedContent = "";
|
|
2171
|
-
let
|
|
2268
|
+
let reportedWriting = false;
|
|
2172
2269
|
|
|
2173
2270
|
const response = await runner.generate({
|
|
2174
2271
|
provider: dbProvider as any,
|
|
@@ -2180,6 +2277,10 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2180
2277
|
userId,
|
|
2181
2278
|
onToken: async (token: string) => {
|
|
2182
2279
|
if (signal.aborted) return;
|
|
2280
|
+
if (!reportedWriting && token.trim()) {
|
|
2281
|
+
reportedWriting = true;
|
|
2282
|
+
processReporter?.writing();
|
|
2283
|
+
}
|
|
2183
2284
|
streamedContent += token;
|
|
2184
2285
|
// Send chunk to client
|
|
2185
2286
|
ws.send(JSON.stringify({
|
|
@@ -2193,30 +2294,7 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2193
2294
|
},
|
|
2194
2295
|
onStep: async (step) => {
|
|
2195
2296
|
if (signal.aborted) return;
|
|
2196
|
-
|
|
2197
|
-
// "text" = el agente narra lo que esta pensando/haciendo
|
|
2198
|
-
if (step.type === "text" && step.message) {
|
|
2199
|
-
const trimmedMessage = (typeof step.message === "string" ? step.message : "").trim();
|
|
2200
|
-
if (trimmedMessage) {
|
|
2201
|
-
ws.send(JSON.stringify({
|
|
2202
|
-
type: "progress",
|
|
2203
|
-
sessionId: routingSessionId,
|
|
2204
|
-
content: trimmedMessage,
|
|
2205
|
-
} as OutboundMessage));
|
|
2206
|
-
}
|
|
2207
|
-
return;
|
|
2208
|
-
}
|
|
2209
|
-
|
|
2210
|
-
// "tool_call" = el agente va a ejecutar una herramienta → narrar al usuario
|
|
2211
|
-
if (step.type === "tool_call" && step.toolName) {
|
|
2212
|
-
const narration = getNarration(step.toolName);
|
|
2213
|
-
ws.send(JSON.stringify({
|
|
2214
|
-
type: "progress",
|
|
2215
|
-
sessionId: routingSessionId,
|
|
2216
|
-
content: narration,
|
|
2217
|
-
} as OutboundMessage));
|
|
2218
|
-
return;
|
|
2219
|
-
}
|
|
2297
|
+
processReporter?.step(step);
|
|
2220
2298
|
|
|
2221
2299
|
// "tool_result" = resultado de herramienta → solo si pide enviarse al usuario
|
|
2222
2300
|
if (step.type === "tool_result" && step.message) {
|
|
@@ -2258,6 +2336,7 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2258
2336
|
if (!voiceCfg.ttsProvider) {
|
|
2259
2337
|
ws.send(JSON.stringify({
|
|
2260
2338
|
type: "message",
|
|
2339
|
+
id: messageId,
|
|
2261
2340
|
sessionId: routingSessionId,
|
|
2262
2341
|
content: `${content}\n\n🔊 Para recibir respuestas en audio, configura el proveedor TTS en Configuración > Canales > WebChat (ej: elevenlabs)`,
|
|
2263
2342
|
isStep: false,
|
|
@@ -2273,6 +2352,7 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2273
2352
|
log.info(`Audio generated: ${base64Audio.length} bytes, mimeType: ${audioOutput.mimeType}`);
|
|
2274
2353
|
ws.send(JSON.stringify({
|
|
2275
2354
|
type: "message",
|
|
2355
|
+
id: messageId,
|
|
2276
2356
|
sessionId: routingSessionId,
|
|
2277
2357
|
content,
|
|
2278
2358
|
audio: base64Audio,
|
|
@@ -2281,11 +2361,11 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2281
2361
|
} as OutboundMessage));
|
|
2282
2362
|
} catch (ttsError) {
|
|
2283
2363
|
log.error(`TTS failed: ${(ttsError as Error).message}), sending text instead`);
|
|
2284
|
-
ws.send(JSON.stringify({ type: "message", sessionId: routingSessionId, content, isStep: false } as OutboundMessage));
|
|
2364
|
+
ws.send(JSON.stringify({ type: "message", id: messageId, sessionId: routingSessionId, content, isStep: false } as OutboundMessage));
|
|
2285
2365
|
}
|
|
2286
2366
|
}
|
|
2287
2367
|
} else {
|
|
2288
|
-
ws.send(JSON.stringify({ type: "message", sessionId: routingSessionId, content, isStep: false } as OutboundMessage));
|
|
2368
|
+
ws.send(JSON.stringify({ type: "message", id: messageId, sessionId: routingSessionId, content, isStep: false } as OutboundMessage));
|
|
2289
2369
|
}
|
|
2290
2370
|
} else if (alreadyStreamed && shouldSpeak && voiceCfg.ttsProvider) {
|
|
2291
2371
|
try {
|
|
@@ -2295,6 +2375,7 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2295
2375
|
log.info(`Audio generated after streaming: ${base64Audio.length} bytes`);
|
|
2296
2376
|
ws.send(JSON.stringify({
|
|
2297
2377
|
type: "message",
|
|
2378
|
+
id: messageId,
|
|
2298
2379
|
sessionId: routingSessionId,
|
|
2299
2380
|
content,
|
|
2300
2381
|
audio: base64Audio,
|
|
@@ -2305,7 +2386,9 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2305
2386
|
log.error(`TTS after streaming failed: ${(ttsError as Error).message}), skipping audio`);
|
|
2306
2387
|
}
|
|
2307
2388
|
}
|
|
2389
|
+
processReporter.done("Listo");
|
|
2308
2390
|
} catch (error) {
|
|
2391
|
+
processReporter?.error("No se pudo completar la respuesta");
|
|
2309
2392
|
ws.send(JSON.stringify({ type: "typing", isTyping: false, sessionId: msg.sessionId } as OutboundMessage));
|
|
2310
2393
|
ws.send(JSON.stringify({
|
|
2311
2394
|
type: "error",
|
|
@@ -2342,6 +2425,7 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2342
2425
|
} as OutboundMessage));
|
|
2343
2426
|
|
|
2344
2427
|
laneQueue.enqueue(msg.sessionId, async (_task, signal) => {
|
|
2428
|
+
let processReporter: ReturnType<typeof createWebChatProcessReporter> | null = null;
|
|
2345
2429
|
if (signal.aborted) {
|
|
2346
2430
|
ws.send(JSON.stringify({ type: "typing", isTyping: false, sessionId: msg.sessionId } as OutboundMessage));
|
|
2347
2431
|
ws.send(JSON.stringify({ type: "error", sessionId: msg.sessionId, error: "Task cancelled" } as OutboundMessage));
|
|
@@ -2355,6 +2439,9 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2355
2439
|
});
|
|
2356
2440
|
const unifiedSessionId = conversationThreadId;
|
|
2357
2441
|
const routingSessionId = msg.sessionId;
|
|
2442
|
+
const messageId = crypto.randomUUID();
|
|
2443
|
+
processReporter = createWebChatProcessReporter(ws, routingSessionId, messageId);
|
|
2444
|
+
processReporter.start(msg.image || msg.document ? "Revisando tu solicitud y adjuntos" : "Revisando tu solicitud");
|
|
2358
2445
|
|
|
2359
2446
|
// Multimodal: process image/document if present
|
|
2360
2447
|
let finalMessageContent = msg.content;
|
|
@@ -2363,6 +2450,7 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2363
2450
|
|
|
2364
2451
|
if (msg.image || msg.document) {
|
|
2365
2452
|
log.info(`🖼️ Multimodal content detected from WebChat session ${unifiedSessionId}`);
|
|
2453
|
+
processReporter.step({ type: "tool_result" });
|
|
2366
2454
|
|
|
2367
2455
|
if (msg.image) {
|
|
2368
2456
|
try {
|
|
@@ -2425,7 +2513,7 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2425
2513
|
|
|
2426
2514
|
// Streaming: send tokens as they arrive
|
|
2427
2515
|
let streamedContent = "";
|
|
2428
|
-
let
|
|
2516
|
+
let reportedWriting = false;
|
|
2429
2517
|
|
|
2430
2518
|
const response = await runner.generate({
|
|
2431
2519
|
provider: dbProvider as any,
|
|
@@ -2438,6 +2526,10 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2438
2526
|
signal,
|
|
2439
2527
|
onToken: async (token: string) => {
|
|
2440
2528
|
if (signal.aborted) return;
|
|
2529
|
+
if (!reportedWriting && token.trim()) {
|
|
2530
|
+
reportedWriting = true;
|
|
2531
|
+
processReporter?.writing();
|
|
2532
|
+
}
|
|
2441
2533
|
streamedContent += token;
|
|
2442
2534
|
// Send chunk to client
|
|
2443
2535
|
ws.send(JSON.stringify({
|
|
@@ -2451,30 +2543,7 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2451
2543
|
},
|
|
2452
2544
|
onStep: async (step) => {
|
|
2453
2545
|
if (signal.aborted) return;
|
|
2454
|
-
|
|
2455
|
-
// "text" = el agente narra lo que esta pensando/haciendo
|
|
2456
|
-
if (step.type === "text" && step.message) {
|
|
2457
|
-
const trimmedMessage = (typeof step.message === "string" ? step.message : "").trim();
|
|
2458
|
-
if (trimmedMessage) {
|
|
2459
|
-
ws.send(JSON.stringify({
|
|
2460
|
-
type: "progress",
|
|
2461
|
-
sessionId: routingSessionId,
|
|
2462
|
-
content: trimmedMessage,
|
|
2463
|
-
} as OutboundMessage));
|
|
2464
|
-
}
|
|
2465
|
-
return;
|
|
2466
|
-
}
|
|
2467
|
-
|
|
2468
|
-
// "tool_call" = el agente va a ejecutar una herramienta → narrar al usuario
|
|
2469
|
-
if (step.type === "tool_call" && step.toolName) {
|
|
2470
|
-
const narration = getNarration(step.toolName);
|
|
2471
|
-
ws.send(JSON.stringify({
|
|
2472
|
-
type: "progress",
|
|
2473
|
-
sessionId: routingSessionId,
|
|
2474
|
-
content: narration,
|
|
2475
|
-
} as OutboundMessage));
|
|
2476
|
-
return;
|
|
2477
|
-
}
|
|
2546
|
+
processReporter?.step(step);
|
|
2478
2547
|
|
|
2479
2548
|
// "tool_result" = resultado de herramienta → solo si pide enviarse al usuario
|
|
2480
2549
|
if (step.type === "tool_result" && step.message) {
|
|
@@ -2516,6 +2585,7 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2516
2585
|
if (!voiceConfig.ttsProvider) {
|
|
2517
2586
|
ws.send(JSON.stringify({
|
|
2518
2587
|
type: "message",
|
|
2588
|
+
id: messageId,
|
|
2519
2589
|
sessionId: routingSessionId,
|
|
2520
2590
|
content: `${content}\n\n🔊 Para recibir respuestas en audio, configura el proveedor TTS en Configuración > Canales > WebChat (ej: elevenlabs)`,
|
|
2521
2591
|
isStep: false
|
|
@@ -2530,6 +2600,7 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2530
2600
|
const base64Audio = (audioOutput.data as Buffer).toString("base64");
|
|
2531
2601
|
ws.send(JSON.stringify({
|
|
2532
2602
|
type: "message",
|
|
2603
|
+
id: messageId,
|
|
2533
2604
|
sessionId: routingSessionId,
|
|
2534
2605
|
content,
|
|
2535
2606
|
audio: base64Audio,
|
|
@@ -2538,11 +2609,11 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2538
2609
|
} as OutboundMessage));
|
|
2539
2610
|
} catch (ttsError) {
|
|
2540
2611
|
log.error(`TTS failed: ${(ttsError as Error).message}), sending text instead`);
|
|
2541
|
-
ws.send(JSON.stringify({ type: "message", sessionId: routingSessionId, content, isStep: false } as OutboundMessage));
|
|
2612
|
+
ws.send(JSON.stringify({ type: "message", id: messageId, sessionId: routingSessionId, content, isStep: false } as OutboundMessage));
|
|
2542
2613
|
}
|
|
2543
2614
|
}
|
|
2544
2615
|
} else {
|
|
2545
|
-
ws.send(JSON.stringify({ type: "message", sessionId: routingSessionId, content, isStep: false } as OutboundMessage));
|
|
2616
|
+
ws.send(JSON.stringify({ type: "message", id: messageId, sessionId: routingSessionId, content, isStep: false } as OutboundMessage));
|
|
2546
2617
|
}
|
|
2547
2618
|
} else if (alreadyStreamed && shouldSpeak && voiceConfig.ttsProvider) {
|
|
2548
2619
|
try {
|
|
@@ -2552,6 +2623,7 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2552
2623
|
log.info(`Audio generated after streaming: ${base64Audio.length} bytes`);
|
|
2553
2624
|
ws.send(JSON.stringify({
|
|
2554
2625
|
type: "message",
|
|
2626
|
+
id: messageId,
|
|
2555
2627
|
sessionId: routingSessionId,
|
|
2556
2628
|
content,
|
|
2557
2629
|
audio: base64Audio,
|
|
@@ -2562,7 +2634,9 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2562
2634
|
log.error(`TTS after streaming failed: ${(ttsError as Error).message}), skipping audio`);
|
|
2563
2635
|
}
|
|
2564
2636
|
}
|
|
2637
|
+
processReporter.done("Listo");
|
|
2565
2638
|
} catch (error) {
|
|
2639
|
+
processReporter?.error("No se pudo completar la respuesta");
|
|
2566
2640
|
// Detener typing aunque falle — nunca dejar el spinner infinito
|
|
2567
2641
|
ws.send(JSON.stringify({ type: "typing", isTyping: false, sessionId: msg.sessionId } as OutboundMessage));
|
|
2568
2642
|
ws.send(JSON.stringify({
|
|
@@ -2729,7 +2803,7 @@ export async function startGateway(config: Config): Promise<void> {
|
|
|
2729
2803
|
process.exit(0);
|
|
2730
2804
|
});
|
|
2731
2805
|
|
|
2732
|
-
process.on("SIGHUP", async () => {
|
|
2806
|
+
if (process.platform !== "win32") process.on("SIGHUP", async () => {
|
|
2733
2807
|
log.info("Received SIGHUP, reloading configuration...");
|
|
2734
2808
|
try {
|
|
2735
2809
|
const newConfig = await loadConfig();
|
|
@@ -27,15 +27,21 @@ export interface InboundMessage {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export interface OutboundMessage {
|
|
30
|
-
type: "message" | "stream" | "status" | "error" | "pong" | "command_result" | "joined" | "typing" | "audio" | "welcome" | "progress";
|
|
30
|
+
type: "message" | "stream" | "status" | "error" | "pong" | "command_result" | "joined" | "typing" | "audio" | "welcome" | "progress" | "process";
|
|
31
31
|
sessionId: string;
|
|
32
32
|
id?: string; // Message ID for streaming
|
|
33
|
+
messageId?: string;
|
|
33
34
|
content?: string;
|
|
34
35
|
chunk?: string;
|
|
35
36
|
isChunk?: boolean; // True if this is a streaming chunk
|
|
36
37
|
isLast?: boolean;
|
|
37
38
|
isTyping?: boolean;
|
|
38
39
|
isStep?: boolean;
|
|
40
|
+
processKind?: "analysis" | "tool" | "observation" | "writing";
|
|
41
|
+
processStatus?: "thinking" | "done" | "error";
|
|
42
|
+
label?: string;
|
|
43
|
+
detail?: string;
|
|
44
|
+
summary?: string;
|
|
39
45
|
stepType?: "plan" | "tool_call" | "tool_result" | "text";
|
|
40
46
|
status?: {
|
|
41
47
|
state: string;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Los datos se guardan en $HIVE_HOME/tts/ (por defecto ~/.hive/tts/).
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { existsSync, mkdirSync, readdirSync, renameSync } from "fs"
|
|
7
|
+
import { existsSync, mkdirSync, readdirSync, renameSync, unlinkSync, rmSync } from "fs"
|
|
8
8
|
import { join } from "path"
|
|
9
9
|
import { homedir } from "os"
|
|
10
10
|
import {
|
|
@@ -37,16 +37,24 @@ async function extractTarGz(archivePath: string, destDir: string): Promise<void>
|
|
|
37
37
|
stderr: "inherit",
|
|
38
38
|
}).exited
|
|
39
39
|
if (code !== 0) throw new Error(`tar falló con código ${code}`)
|
|
40
|
-
|
|
40
|
+
unlinkSync(archivePath)
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
async function extractZip(archivePath: string, destDir: string): Promise<void> {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
let code: number
|
|
45
|
+
if (process.platform === "win32") {
|
|
46
|
+
code = await Bun.spawn(
|
|
47
|
+
["powershell", "-Command", `Expand-Archive -Path "${archivePath}" -DestinationPath "${destDir}" -Force`],
|
|
48
|
+
{ stdout: "inherit", stderr: "inherit" }
|
|
49
|
+
).exited
|
|
50
|
+
} else {
|
|
51
|
+
code = await Bun.spawn(["unzip", "-q", archivePath, "-d", destDir], {
|
|
52
|
+
stdout: "inherit",
|
|
53
|
+
stderr: "inherit",
|
|
54
|
+
}).exited
|
|
55
|
+
}
|
|
56
|
+
if (code !== 0) throw new Error(`Extracción ZIP falló con código ${code}`)
|
|
57
|
+
unlinkSync(archivePath)
|
|
50
58
|
}
|
|
51
59
|
|
|
52
60
|
/**
|
|
@@ -86,7 +94,7 @@ export async function runInstall(ttsRoot: string): Promise<void> {
|
|
|
86
94
|
for (const entry of readdirSync(tempDir)) {
|
|
87
95
|
renameSync(join(tempDir, entry), join(BIN_DIR, entry))
|
|
88
96
|
}
|
|
89
|
-
|
|
97
|
+
rmSync(tempDir, { recursive: true, force: true })
|
|
90
98
|
}
|
|
91
99
|
|
|
92
100
|
if (!existsSync(binaryPath)) {
|