@johpaz/hive-agents 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/hive.js +49133 -48182
- package/dist/tool-worker.js +2 -1
- package/dist/ui/assets/A2UIPage-DTW79pyL.js +8 -0
- package/dist/ui/assets/AgentCreateForm-Bcp3HN8D.js +1 -0
- package/dist/ui/assets/AgentDetailPage-10XptMde.js +1 -0
- package/dist/ui/assets/AgentNewPage-CUt49rVS.js +1 -0
- package/dist/ui/assets/AgentsPage-1_e1a9xa.js +10 -0
- package/dist/ui/assets/ApiClientPage-DHfIlSAg.js +3 -0
- package/dist/ui/assets/ChannelsPage-BnCQAGZL.js +8 -0
- package/dist/ui/assets/DashboardPage-BsCCKHgg.js +6 -0
- package/dist/ui/assets/LoginPage-BaX6cAPa.js +1 -0
- package/dist/ui/assets/{LogsPage-DyJOGQNy.js → LogsPage-DiFBQt7o.js} +1 -1
- package/dist/ui/assets/MeetingPage-Bpv5zVXf.js +1 -0
- package/dist/ui/assets/ModelSelector-DfExlPzx.js +1 -0
- package/dist/ui/assets/{NotFound-Bpr12V51.js → NotFound-C8HBdF73.js} +1 -1
- package/dist/ui/assets/Office3DPage-ChsGMapf.js +319 -0
- package/dist/ui/assets/ProvidersPage-B39pfWHf.js +1 -0
- package/dist/ui/assets/RecoverPage-C_Id9WM-.js +1 -0
- package/dist/ui/assets/SettingsPage-BgFqasyg.js +9 -0
- package/dist/ui/assets/SetupPage-YeJFfgbt.js +1 -0
- package/dist/ui/assets/Vignette-Cyi27LQH.js +4302 -0
- package/dist/ui/assets/VoicePage-Cp63Abj4.js +307 -0
- package/dist/ui/assets/VoicePage-uLWdtoD4.css +1 -0
- package/dist/ui/assets/WebChatPage-DxFLWgtM.js +29 -0
- package/dist/ui/assets/activity-C_GS5wrG.js +1 -0
- package/dist/ui/assets/agentCapabilities-DOeepCty.js +1 -0
- package/dist/ui/assets/{alert-CQlRq6sv.js → alert-Cj4DpKv6.js} +1 -1
- package/dist/ui/assets/arrow-left-WyDPYZXU.js +1 -0
- package/dist/ui/assets/arrow-right-BuNjN-bk.js +1 -0
- package/dist/ui/assets/arrow-up-right-DWzTsCXj.js +1 -0
- package/dist/ui/assets/{badge-DKGZbVZJ.js → badge-DKpeVCpY.js} +1 -1
- package/dist/ui/assets/bia-4LFKOyxR.webp +0 -0
- package/dist/ui/assets/bia-BFcUpOu3.glb +0 -0
- package/dist/ui/assets/calendar-B6x9cw-q.js +1 -0
- package/dist/ui/assets/{card-D3Nw3kh3.js → card-Cag15G4h.js} +1 -1
- package/dist/ui/assets/check-C8pw-7Fx.js +1 -0
- package/dist/ui/assets/chevron-down-8GjmTjLR.js +1 -0
- package/dist/ui/assets/chevron-left-GK4EQOyZ.js +1 -0
- package/dist/ui/assets/chevron-right-BupZqrxu.js +1 -0
- package/dist/ui/assets/chevron-up-DZrzJIW8.js +1 -0
- package/dist/ui/assets/circle-alert-CtDbK2nl.js +1 -0
- package/dist/ui/assets/circle-check-BKNT2_q6.js +1 -0
- package/dist/ui/assets/circle-x-DfBjbztU.js +1 -0
- package/dist/ui/assets/copy-wR7o7Ly8.js +1 -0
- package/dist/ui/assets/core-Dz04EE_8.js +1 -0
- package/dist/ui/assets/createLucideIcon-BRaPSYgN.js +1 -0
- package/dist/ui/assets/{dialog-Dn9hGPYl.js → dialog-7E3EoEt3.js} +1 -1
- package/dist/ui/assets/dist-js-Bg0g3vPS.js +1 -0
- package/dist/ui/assets/dist-js-DwLn9F4C.js +1 -0
- package/dist/ui/assets/download-D0aDV8Y_.js +1 -0
- package/dist/ui/assets/earth-BJRGJbVn.js +1 -0
- package/dist/ui/assets/ellipsis-vertical-BOW_iEOO.js +1 -0
- package/dist/ui/assets/external-link-5cujQzfV.js +1 -0
- package/dist/ui/assets/eye-sRPY5qOa.js +1 -0
- package/dist/ui/assets/file-text-DNSyNLUh.js +1 -0
- package/dist/ui/assets/gauge-C__zxC3_.js +1 -0
- package/dist/ui/assets/history-BHQWfE-7.js +1 -0
- package/dist/ui/assets/index-Bi8qEmrK.js +116 -0
- package/dist/ui/assets/index-D2UhaSb0.css +2 -0
- package/dist/ui/assets/info-CG1VohyH.js +1 -0
- package/dist/ui/assets/key-BC28VCjO.js +1 -0
- package/dist/ui/assets/{label-k0jYxoWW.js → label-C6atPuIh.js} +1 -1
- package/dist/ui/assets/lock-open-Bhp0UJlL.js +1 -0
- package/dist/ui/assets/mail-Biwn8WrV.js +1 -0
- package/dist/ui/assets/mic-Rq4BxU1R.js +1 -0
- package/dist/ui/assets/pause-C2l5G2Py.js +1 -0
- package/dist/ui/assets/pencil-CUbpCfeG.js +1 -0
- package/dist/ui/assets/play-CMAscR3a.js +1 -0
- package/dist/ui/assets/plus-DzvRxH4U.js +1 -0
- package/dist/ui/assets/radio-DfGzov4y.js +1 -0
- package/dist/ui/assets/refresh-cw-DZXu5FrG.js +1 -0
- package/dist/ui/assets/rotate-ccw-Dx92orJM.js +1 -0
- package/dist/ui/assets/scroll-area-CSoG2z53.js +1 -0
- package/dist/ui/assets/search-DB4w9YHW.js +1 -0
- package/dist/ui/assets/{select-ot0a6art.js → select-DlCT21_r.js} +1 -1
- package/dist/ui/assets/send-xi8HzUdc.js +1 -0
- package/dist/ui/assets/settings-pV0cF8Kf.js +1 -0
- package/dist/ui/assets/shield-nLNsomh_.js +1 -0
- package/dist/ui/assets/slider-Bb_PHFJT.js +1 -0
- package/dist/ui/assets/sparkles-CerRDYxk.js +1 -0
- package/dist/ui/assets/square-CcWzRWyG.js +1 -0
- package/dist/ui/assets/{switch-DXcELPsM.js → switch-CUsGuBNi.js} +1 -1
- package/dist/ui/assets/tabs-Ckfc7DGG.js +1 -0
- package/dist/ui/assets/terminal-C2SUZUAD.js +1 -0
- package/dist/ui/assets/{textarea-rp6vsOZl.js → textarea-BH6pI9Ax.js} +1 -1
- package/dist/ui/assets/trash-2-BZsMCfso.js +1 -0
- package/dist/ui/assets/useAudioDevices-Dpr_hn6i.js +41 -0
- package/dist/ui/assets/useHiveAgentsModelLoad-CHmtvNp4.js +1 -0
- package/dist/ui/assets/useProviders-C7FA6z4M.js +1 -0
- package/dist/ui/assets/vendor-radix-DUug7irY.js +63 -0
- package/dist/ui/assets/{vendor-react-CPJEWbIG.js → vendor-react-DYyYpuMy.js} +1 -1
- package/dist/ui/assets/volume-2-CBMYsuF3.js +1 -0
- package/dist/ui/assets/volume-x-vNFf2e4-.js +1 -0
- package/dist/ui/assets/wifi-DNv53AfN.js +1 -0
- package/dist/ui/assets/zap-Yed86Sh8.js +1 -0
- package/dist/ui/index.html +8 -7
- package/package.json +1 -1
- package/packages/cli/src/commands/doctor.ts +99 -44
- package/packages/cli/src/commands/onboard.ts +4 -2
- package/packages/core/src/agent/agent-catalog.ts +23 -23
- package/packages/core/src/agent/agent-loop.ts +48 -0
- package/packages/core/src/agent/context-compiler.ts +1 -1
- package/packages/core/src/agent/conversation-store.ts +14 -1
- package/packages/core/src/agent/llm-client.ts +41 -6
- package/packages/core/src/agent/llm-providers/nvidia.ts +39 -0
- package/packages/core/src/agent/llm-providers/openai-compat-base.ts +38 -2
- package/packages/core/src/agent/mcp-result-normalizer.ts +42 -0
- package/packages/core/src/agent/prompt-builder.ts +1 -1
- package/packages/core/src/agent/realtime-providers/gemini-live.ts +230 -0
- package/packages/core/src/agent/realtime-providers/index.ts +29 -0
- package/packages/core/src/agent/realtime-providers/interface.ts +108 -0
- package/packages/core/src/agent/skill-selector.ts +1 -1
- package/packages/core/src/agent/tool-selector.ts +2 -0
- package/packages/core/src/artifacts/store.ts +65 -0
- package/packages/core/src/canvas/canvas-manager.ts +128 -26
- package/packages/core/src/config/loader.ts +6 -4
- package/packages/core/src/events/tool-narration.ts +4 -0
- package/packages/core/src/gateway/delegation-groups.ts +4 -4
- package/packages/core/src/gateway/initializer.ts +17 -10
- package/packages/core/src/gateway/realtime/bridge-tools.ts +392 -0
- package/packages/core/src/gateway/realtime/index.ts +249 -0
- package/packages/core/src/gateway/realtime/prompt.ts +137 -0
- package/packages/core/src/gateway/realtime/protocol.ts +60 -0
- package/packages/core/src/gateway/realtime/voice-session.ts +441 -0
- package/packages/core/src/gateway/routes/providers.ts +1 -1
- package/packages/core/src/gateway/routes/setup.ts +3 -3
- package/packages/core/src/gateway/routes/system.ts +9 -4
- package/packages/core/src/gateway/server.ts +86 -1
- package/packages/core/src/gateway/slash-commands.ts +3 -1
- package/packages/core/src/gateway/webchat-turn.ts +34 -1
- package/packages/core/src/storage/collections.ts +10 -1
- package/packages/core/src/storage/onboarding.ts +39 -39
- package/packages/core/src/storage/seed.ts +21 -2
- package/packages/core/src/tool-runtime/embedded-worker.generated.ts +20 -0
- package/packages/core/src/tool-runtime/index.ts +56 -14
- package/packages/core/src/tools/index.ts +4 -2
- package/packages/core/src/tools/web/artifact-read.ts +162 -0
- package/packages/core/src/tools/web/browser-backend.ts +141 -44
- package/packages/core/src/tools/web/browser-click.ts +2 -2
- package/packages/core/src/tools/web/browser-extract.ts +2 -2
- package/packages/core/src/tools/web/browser-navigate.ts +2 -2
- package/packages/core/src/tools/web/browser-screenshot.ts +12 -5
- package/packages/core/src/tools/web/browser-script.ts +2 -2
- package/packages/core/src/tools/web/browser-service.ts +63 -384
- package/packages/core/src/tools/web/browser-session.ts +125 -0
- package/packages/core/src/tools/web/browser-type.ts +2 -2
- package/packages/core/src/tools/web/browser-wait.ts +2 -2
- package/packages/core/src/tools/web/computer-use.ts +553 -0
- package/packages/core/src/tools/web/index.ts +8 -1
- package/packages/core/src/tools/web/webview-backend.ts +439 -21
- package/packages/skills/src/bundled-data.generated.ts +752 -752
- package/dist/ui/assets/A2UIPage-DExwevBV.js +0 -8
- package/dist/ui/assets/AgentCreateForm-7PPShsUn.js +0 -1
- package/dist/ui/assets/AgentDetailPage-CiV4tz4P.js +0 -1
- package/dist/ui/assets/AgentNewPage-D3TtVwQf.js +0 -1
- package/dist/ui/assets/AgentsPage-C2DThet7.js +0 -10
- package/dist/ui/assets/ApiClientPage-Cowdq-0f.js +0 -3
- package/dist/ui/assets/ChannelsPage-D4IgglwJ.js +0 -8
- package/dist/ui/assets/DashboardPage-DAgVB7Iy.js +0 -6
- package/dist/ui/assets/LoginPage-CpU61b3u.js +0 -1
- package/dist/ui/assets/MeetingPage-DLmqHmm2.js +0 -1
- package/dist/ui/assets/ModelSelector-D4OaICwN.js +0 -1
- package/dist/ui/assets/Office3DPage-BvO66B0h.js +0 -4614
- package/dist/ui/assets/ProvidersPage-Bhb6Qr87.js +0 -1
- package/dist/ui/assets/RecoverPage-DaZrCpdB.js +0 -1
- package/dist/ui/assets/SettingsPage-BRD2F7up.js +0 -9
- package/dist/ui/assets/SetupPage-DKppgTja.js +0 -1
- package/dist/ui/assets/WebChatPage-CPtETNL5.js +0 -29
- package/dist/ui/assets/activity-BSosMryb.js +0 -1
- package/dist/ui/assets/agentCapabilities-VqxLmrF6.js +0 -1
- package/dist/ui/assets/arrow-left-C9Y6p4Jt.js +0 -1
- package/dist/ui/assets/arrow-right-BYfOLnTB.js +0 -1
- package/dist/ui/assets/arrow-up-right-D2trA3Ob.js +0 -1
- package/dist/ui/assets/calendar-rdd4nvY1.js +0 -1
- package/dist/ui/assets/check-DUq9uoNQ.js +0 -1
- package/dist/ui/assets/chevron-down-rPF4Pr1n.js +0 -1
- package/dist/ui/assets/chevron-left-Crzzf2sY.js +0 -1
- package/dist/ui/assets/chevron-right-DtMIvG9A.js +0 -1
- package/dist/ui/assets/chevron-up-CG0_KGBy.js +0 -1
- package/dist/ui/assets/circle-alert-CYt6gsDA.js +0 -1
- package/dist/ui/assets/circle-check-Zl32-jCa.js +0 -1
- package/dist/ui/assets/circle-x-BJXzKGmx.js +0 -1
- package/dist/ui/assets/copy-BmtJXmDe.js +0 -1
- package/dist/ui/assets/download-D3mYhuuL.js +0 -1
- package/dist/ui/assets/earth-BZzdDXFC.js +0 -1
- package/dist/ui/assets/ellipsis-vertical-BF705XvB.js +0 -1
- package/dist/ui/assets/external-link-gdpMTHUV.js +0 -1
- package/dist/ui/assets/eye-lSG04hI7.js +0 -1
- package/dist/ui/assets/file-text-CjQxcJvN.js +0 -1
- package/dist/ui/assets/gauge-DBryKhDK.js +0 -1
- package/dist/ui/assets/history-BC6ir9qU.js +0 -1
- package/dist/ui/assets/index-DyxoAvTq.js +0 -116
- package/dist/ui/assets/index-wML8DaUo.css +0 -2
- package/dist/ui/assets/info-BGBaIyKc.js +0 -1
- package/dist/ui/assets/key-D_CNJTY2.js +0 -1
- package/dist/ui/assets/loader-circle-RXdrfPsH.js +0 -1
- package/dist/ui/assets/lock-open-UB61lorP.js +0 -1
- package/dist/ui/assets/mail-C5bJ_dBt.js +0 -1
- package/dist/ui/assets/pause-BSTJvxDu.js +0 -1
- package/dist/ui/assets/pencil-C2B1Q7y2.js +0 -1
- package/dist/ui/assets/play-tcMbj-0p.js +0 -1
- package/dist/ui/assets/plus-BSZvyMND.js +0 -1
- package/dist/ui/assets/progress-DrI2UDu-.js +0 -1
- package/dist/ui/assets/radio-D9CrjAar.js +0 -1
- package/dist/ui/assets/refresh-cw-D7EB_fVv.js +0 -1
- package/dist/ui/assets/scroll-area-CfHn94Vb.js +0 -1
- package/dist/ui/assets/search-5S6LY69I.js +0 -1
- package/dist/ui/assets/send-Dax1tJ5b.js +0 -1
- package/dist/ui/assets/settings-97CL32lC.js +0 -1
- package/dist/ui/assets/shield-DwbCEZbF.js +0 -1
- package/dist/ui/assets/slider-CmE_z1Ii.js +0 -1
- package/dist/ui/assets/sparkles-CWMAzkpD.js +0 -1
- package/dist/ui/assets/square-B4dgTXI3.js +0 -1
- package/dist/ui/assets/tabs-CxiybXcw.js +0 -1
- package/dist/ui/assets/terminal-DoLedTPM.js +0 -1
- package/dist/ui/assets/trash-2-DxnVYOz8.js +0 -1
- package/dist/ui/assets/triangle-alert-Cka-BeIE.js +0 -1
- package/dist/ui/assets/useHiveAgentsModelLoad-BjnIsQKR.js +0 -1
- package/dist/ui/assets/useProviders-CueMz_mL.js +0 -1
- package/dist/ui/assets/vendor-radix-D0s_k6Gp.js +0 -63
- package/dist/ui/assets/volume-x-DLsli9cf.js +0 -1
- package/dist/ui/assets/wifi-BQRJGfLZ.js +0 -1
- package/dist/ui/assets/zap-DSR3CEce.js +0 -1
- /package/dist/ui/assets/{gateway-url-BlnabM5e.js → gateway-url-BzQV75Ig.js} +0 -0
- /package/dist/ui/assets/{useOfficeModel-Cy7cAyEn.js → useOfficeModel-Cc5VkReZ.js} +0 -0
- /package/dist/ui/assets/{utils-Dyb7SC2_.js → utils-lc8H6VGT.js} +0 -0
- /package/dist/ui/assets/{vendor-router-zpB-76nT.js → vendor-router-DCsSv_I7.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{o as n}from"./vendor-query-Dj8xYhQD.js";import{t as r}from"./activity-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{o as n}from"./vendor-query-Dj8xYhQD.js";import{t as r}from"./activity-C_GS5wrG.js";import{t as i}from"./pause-C2l5G2Py.js";import{t as a}from"./play-CMAscR3a.js";import{t as o}from"./refresh-cw-DZXu5FrG.js";import{t as s}from"./search-DB4w9YHW.js";import{t as c}from"./trash-2-BZsMCfso.js";import{t as l}from"./utils-lc8H6VGT.js";import{G as u,H as d,W as f}from"./index-Bi8qEmrK.js";import{t as p}from"./badge-DKpeVCpY.js";import{t as m}from"./scroll-area-CSoG2z53.js";import{n as h,t as g}from"./card-Cag15G4h.js";var _=e(t(),1),v=n();function y(){let[e,t]=(0,_.useState)([]),[n,y]=(0,_.useState)(!1),[b,x]=(0,_.useState)(``),[S,C]=(0,_.useState)([`info`,`warn`,`error`]),[w,T]=(0,_.useState)(!1),[E,D]=(0,_.useState)(!0),O=(0,_.useRef)(null),{url:k,status:A,subscribe:j,send:M}=d();(0,_.useEffect)(()=>{if(A!==`connected`)return;M({type:`logs_subscribe`});let e=j(`log`,e=>{w||e.logEntry&&t(t=>[...t,e.logEntry].slice(-2e3))});return()=>{M({type:`logs_unsubscribe`}),e()}},[A,j,M,w]),(0,_.useEffect)(()=>{if(E&&O.current){let e=O.current.querySelector(`[data-radix-scroll-area-viewport]`);e&&(e.scrollTop=e.scrollHeight)}},[e,E]);let N=e=>{C(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},P=(0,_.useMemo)(()=>e.filter(e=>{let t=S.includes(e.level),n=e.message.toLowerCase().includes(b.toLowerCase())||e.meta&&JSON.stringify(e.meta).toLowerCase().includes(b.toLowerCase());return t&&n}),[e,S,b]),F=e=>{switch(e){case`error`:return`bg-red-500/10 text-red-500 border-red-500/20`;case`warn`:return`bg-yellow-500/10 text-yellow-500 border-yellow-500/20`;case`debug`:return`bg-slate-500/10 text-slate-500 border-slate-500/20`;default:return`bg-blue-500/10 text-blue-500 border-blue-500/20`}};return(0,v.jsxs)(`div`,{className:`flex flex-col h-[calc(100vh-8rem)] space-y-4 mt-10`,children:[(0,v.jsxs)(`div`,{className:`flex flex-col md:flex-row md:items-center justify-between gap-4`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`h2`,{className:`text-2xl font-bold tracking-tight`,children:`Logs del Sistema`}),(0,v.jsx)(`p`,{className:`text-muted-foreground`,children:`Monitoreo en tiempo real de la actividad del enjambre.`})]}),(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsxs)(u,{variant:`outline`,size:`sm`,onClick:()=>T(!w),className:w?`text-yellow-500 border-yellow-500/50 hover:bg-yellow-500/10`:``,children:[w?(0,v.jsx)(a,{className:`h-4 w-4 mr-2`}):(0,v.jsx)(i,{className:`h-4 w-4 mr-2`}),w?`Renaudar`:`Pausar`]}),(0,v.jsxs)(u,{variant:`outline`,size:`sm`,onClick:()=>t([]),children:[(0,v.jsx)(c,{className:`h-4 w-4 mr-2`}),`Limpiar`]}),(0,v.jsxs)(u,{variant:`outline`,size:`sm`,onClick:()=>{},disabled:!0,className:`opacity-50`,children:[(0,v.jsx)(o,{className:`h-4 w-4 mr-2`}),`Sincronizado via WS`]})]})]}),(0,v.jsx)(g,{className:`bg-muted/30`,children:(0,v.jsxs)(h,{className:`p-3 flex flex-wrap items-center gap-4`,children:[(0,v.jsxs)(`div`,{className:`relative flex-1 min-w-[200px]`,children:[(0,v.jsx)(s,{className:`absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground`}),(0,v.jsx)(f,{placeholder:`Buscar en logs...`,className:`pl-9 h-9 bg-background`,value:b,onChange:e=>x(e.target.value)})]}),(0,v.jsx)(`div`,{className:`flex items-center gap-1.5 p-1 bg-background rounded-md border text-xs`,children:[`debug`,`info`,`warn`,`error`].map(e=>(0,v.jsx)(`button`,{onClick:()=>N(e),className:l(`px-2 py-1 rounded capitalize transition-colors`,S.includes(e)?F(e).split(` `)[1]+` `+F(e).split(` `)[0]:`text-muted-foreground hover:bg-muted`),children:e},e))}),(0,v.jsxs)(`label`,{className:`flex items-center gap-2 text-xs cursor-pointer select-none`,children:[(0,v.jsx)(`input`,{type:`checkbox`,className:`sr-only`,checked:E,onChange:()=>D(!E)}),(0,v.jsx)(`div`,{className:l(`w-8 h-4 rounded-full relative transition-colors`,E?`bg-primary`:`bg-muted border shadow-inner`),children:(0,v.jsx)(`div`,{className:l(`absolute top-0.5 w-3 h-3 rounded-full bg-white transition-all shadow-sm`,E?`left-[17px]`:`left-0.5`)})}),`Auto-scroll`]}),(0,v.jsxs)(`div`,{className:`ml-auto flex items-center gap-2 text-[10px] text-muted-foreground`,children:[(0,v.jsx)(`div`,{className:l(`w-2 h-2 rounded-full`,A===`connected`?`bg-green-500 animate-pulse`:`bg-red-500`)}),A===`connected`?`STREAMING`:`OFFLINE`,(0,v.jsx)(`span`,{className:`mx-1 opacity-30`,children:`|`}),P.length,` de `,e.length,` entradas`]})]})}),(0,v.jsx)(g,{className:`flex-1 overflow-hidden border-2`,children:(0,v.jsx)(h,{className:`p-0 h-full bg-black/95`,children:(0,v.jsx)(m,{className:`h-full w-full`,ref:O,children:(0,v.jsxs)(`div`,{className:`p-4 font-mono text-[11px] leading-relaxed`,children:[P.length===0?(0,v.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20 text-muted-foreground opacity-50`,children:[(0,v.jsx)(r,{className:`h-10 w-10 mb-4 stroke-[1]`}),(0,v.jsx)(`p`,{children:n?`Analizando registros...`:`No se encontraron logs con los filtros activos.`})]}):(0,v.jsx)(`div`,{className:`space-y-0.5`,children:P.map(e=>(0,v.jsxs)(`div`,{className:`group flex items-start gap-3 py-0.5 hover:bg-white/5 rounded px-1 transition-colors`,children:[(0,v.jsx)(`span`,{className:`text-slate-600 shrink-0 select-none hidden md:inline`,children:e.timestamp.includes(`T`)?e.timestamp.split(`T`)[1].split(`.`)[0]:e.timestamp}),(0,v.jsx)(p,{variant:`outline`,className:l(`px-1 py-0 h-4 text-[9px] uppercase font-bold shrink-0 border`,F(e.level)),children:e.level}),(0,v.jsxs)(`div`,{className:`flex-1 break-all text-slate-300`,children:[(0,v.jsxs)(`span`,{className:`text-slate-500 mr-2`,children:[`[`,e.source,`]`]}),e.message,e.meta&&(0,v.jsx)(`span`,{className:`text-slate-500 ml-2 italic opacity-60`,children:JSON.stringify(e.meta)})]})]},`${e.timestamp}-${e.source}-${e.message.slice(0,30)}`))}),(0,v.jsx)(`div`,{className:`h-4`}),` `]})})})})]})}export{y as LogsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{o as n}from"./vendor-query-Dj8xYhQD.js";import{t as r}from"./createLucideIcon-BRaPSYgN.js";import{t as i}from"./chevron-down-8GjmTjLR.js";import{t as a}from"./chevron-up-DZrzJIW8.js";import{t as o}from"./file-text-DNSyNLUh.js";import{t as s}from"./history-BHQWfE-7.js";import{t as ee}from"./mic-Rq4BxU1R.js";import{t as te}from"./radio-DfGzov4y.js";import{t as c}from"./square-CcWzRWyG.js";import{n as l,r as u,t as d}from"./gateway-url-BzQV75Ig.js";import{G as f,W as ne,st as p}from"./index-Bi8qEmrK.js";import{t as m}from"./badge-DKpeVCpY.js";var h=r(`MicOff`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M18.89 13.23A7.12 7.12 0 0 0 19 12v-2`,key:`80xlxr`}],[`path`,{d:`M5 10v2a7 7 0 0 0 12 5`,key:`p2k8kg`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`,key:`1gzdoj`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`,key:`r2i35w`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}]]),g=r(`MonitorSpeaker`,[[`path`,{d:`M5.5 20H8`,key:`1k40s5`}],[`path`,{d:`M17 9h.01`,key:`1j24nn`}],[`rect`,{width:`10`,height:`16`,x:`12`,y:`4`,rx:`2`,key:`ixliua`}],[`path`,{d:`M8 6H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h4`,key:`1mp6e1`}],[`circle`,{cx:`17`,cy:`15`,r:`1`,key:`tqvash`}]]),_=e(t(),1),v=u((e,t)=>({sessions:[],activeSessionId:null,segments:[],isRecording:!1,isConnecting:!1,error:null,wsConnection:null,startSession:async(n,r=`whisper-large-v3-turbo`)=>{e({error:null,isConnecting:!0});try{let i=await(await fetch(`${d()}/api/meetings`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:n,stt_model:r})})).json();return!i.ok||!i.session?(e({error:i.error??`Error al crear sesión`,isConnecting:!1}),null):(e({activeSessionId:i.session.id,segments:[],sessions:[i.session,...t().sessions],isConnecting:!1}),i.session.id)}catch(t){return e({error:t.message,isConnecting:!1}),null}},stopSession:async()=>{let{activeSessionId:n,wsConnection:r}=t();if(n){if(r&&r.readyState===WebSocket.OPEN)r.send(JSON.stringify({type:`meeting_stop`}));else try{await fetch(`${d()}/api/meetings/${n}/stop`,{method:`POST`})}catch{}r?.close(),e({isRecording:!1,wsConnection:null})}},fetchSessions:async()=>{try{let t=await(await fetch(`${d()}/api/meetings`)).json();t.ok&&t.sessions&&e({sessions:t.sessions})}catch{}},fetchSession:async t=>{try{let n=await(await fetch(`${d()}/api/meetings/${t}`)).json();n.ok&&n.session&&e({activeSessionId:t,segments:n.segments??[]})}catch{}},addSegmentLocal:t=>e(e=>({segments:[...e.segments,t]})),setWsConnection:t=>e({wsConnection:t}),setRecording:t=>e({isRecording:t}),setConnecting:t=>e({isConnecting:t}),setError:t=>e({error:t}),clearActiveSession:()=>e({activeSessionId:null,segments:[],isRecording:!1,wsConnection:null}),generateReport:async t=>{e({error:null});try{let n=await(await fetch(`${d()}/api/meetings/${t}/report`,{method:`POST`})).json();return!n.ok||!n.report_path?(e({error:n.error??`Error al generar el reporte`}),null):(e(e=>({sessions:e.sessions.map(e=>e.id===t?{...e,status:`report_ready`,report_path:n.report_path}:e)})),n.report_path)}catch(t){return e({error:t.message}),null}}}));function y(e){return`${l()}/meeting-stream?meetingSessionId=${encodeURIComponent(e)}`}var b=n();function re(e){let t=Math.floor(Date.now()/1e3-e);return`${Math.floor(t/60).toString().padStart(2,`0`)}:${(t%60).toString().padStart(2,`0`)}`}async function ie(){if(!navigator.mediaDevices?.getDisplayMedia)return!1;try{let e=await navigator.mediaDevices.getDisplayMedia({video:!0,audio:!0,systemAudio:`include`}),t=e.getAudioTracks().length>0;return e.getTracks().forEach(e=>e.stop()),t}catch{return!1}}function ae({segment:e}){return(0,b.jsxs)(`div`,{className:`flex gap-3 py-2 px-3 rounded-lg hover:bg-white/[0.03] transition-colors`,children:[e.speaker&&(0,b.jsxs)(`span`,{className:`shrink-0 text-xs font-semibold text-amber-400 mt-0.5 leading-5`,children:[`[`,e.speaker,`]`]}),(0,b.jsx)(`span`,{className:`text-sm text-zinc-300 leading-relaxed`,children:e.text})]})}function oe(){return(0,b.jsxs)(`span`,{className:`relative flex h-3 w-3`,children:[(0,b.jsx)(`span`,{className:`animate-ping absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-75`}),(0,b.jsx)(`span`,{className:`relative inline-flex rounded-full h-3 w-3 bg-red-500`})]})}function x(){let{sessions:e,activeSessionId:t,segments:n,isRecording:r,isConnecting:l,error:u,wsConnection:x,startSession:S,stopSession:C,fetchSessions:se,addSegmentLocal:w,setWsConnection:T,setRecording:E,setError:D,clearActiveSession:O,generateReport:k}=v(),[A,j]=(0,_.useState)(``),[M,N]=(0,_.useState)(`00:00`),[P,F]=(0,_.useState)(!0),[I,L]=(0,_.useState)(!1),[R,z]=(0,_.useState)(`microphone`),[B,V]=(0,_.useState)(null),H=(0,_.useRef)(null),U=(0,_.useRef)([]),W=(0,_.useRef)(null),G=(0,_.useRef)(null),K=(0,_.useRef)(null),ce=(0,_.useRef)(null),q=(0,_.useRef)(null),J=(0,_.useRef)(!1),Y=(0,_.useRef)(null),X=(0,_.useRef)(null),Z=e.find(e=>e.id===t);(0,_.useEffect)(()=>{if(!r||!Z)return;let e=setInterval(()=>N(re(Z.started_at)),1e3);return()=>clearInterval(e)},[r,Z]),(0,_.useEffect)(()=>{q.current?.scrollIntoView({behavior:`smooth`})},[n]),(0,_.useEffect)(()=>{se()},[]),(0,_.useEffect)(()=>{ie().then(e=>{V(e)})},[]),(0,_.useEffect)(()=>()=>{J.current=!1,X.current&&clearTimeout(X.current);let e=H.current;e?.state===`recording`&&e.stop(),W.current?.getTracks().forEach(e=>e.stop()),G.current?.getTracks().forEach(e=>e.stop()),K.current?.close(),Y.current?.close()},[]);let Q=(0,_.useCallback)(async()=>{if(!A.trim()){D(`Ingresa el título de la reunión`);return}if(D(null),!navigator.mediaDevices?.getUserMedia){D(`Tu navegador no puede acceder al micrófono. Asegúrate de usar HTTPS o localhost.`);return}let e=`audio/webm`,t,n=`microphone`;try{let e=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});W.current=e;let r;if(B)try{r=await navigator.mediaDevices.getDisplayMedia({video:!0,audio:!0,systemAudio:`include`}),G.current=r,n=r.getAudioTracks().length>0?`system`:`microphone`}catch{n=`microphone`}if(n===`system`&&r){let n=new AudioContext;K.current=n;let i=n.createMediaStreamDestination();ce.current=i,n.createMediaStreamSource(e).connect(i),n.createMediaStreamSource(r).connect(i),t=new MediaStream([...i.stream.getAudioTracks()]),z(`dual`)}else t=e,z(`microphone`)}catch(e){let t=e.name;D(t===`NotAllowedError`||t===`PermissionDeniedError`?`Permiso de micrófono denegado. Ve a la configuración del navegador (🔒 en la barra de URL) y permite el micrófono.`:t===`NotFoundError`?`No se encontró ningún micrófono en este dispositivo.`:`No se pudo acceder al micrófono: ${e.message}`);return}W.current=t;let r=await S(A.trim());if(!r){t.getTracks().forEach(e=>e.stop()),G.current?.getTracks().forEach(e=>e.stop());return}let i=new WebSocket(y(r));Y.current=i,T(i);let a=()=>{if(!J.current||i.readyState!==WebSocket.OPEN)return;U.current=[];let n=new MediaRecorder(t,{mimeType:e});H.current=n,n.ondataavailable=e=>{e.data.size>0&&U.current.push(e.data)},n.onstop=()=>{if(U.current.length===0){J.current&&i.readyState===WebSocket.OPEN&&a();return}let t=new Blob(U.current,{type:e}),n=new FileReader;n.readAsDataURL(t),n.onloadend=()=>{let t=n.result.split(`,`)[1];i.readyState===WebSocket.OPEN&&i.send(JSON.stringify({type:`audio_chunk`,audio:t,mime_type:e})),J.current&&i.readyState===WebSocket.OPEN&&a()}},n.start(),X.current=setTimeout(()=>{n.state===`recording`&&n.stop()},5e3)};i.onopen=()=>{J.current=!0,E(!0),a()},i.onmessage=e=>{try{let t=JSON.parse(e.data);t.type===`transcript_segment`&&w({seq:t.seq,speaker:t.speaker||null,text:t.text}),t.type===`meeting_stopped`&&(J.current=!1,E(!1)),t.type===`error`&&D(t.error)}catch{}},i.onerror=()=>D(`Error en la conexión WebSocket`),i.onclose=()=>{Y.current===i&&(Y.current=null),J.current=!1,E(!1),W.current?.getTracks().forEach(e=>e.stop()),G.current?.getTracks().forEach(e=>e.stop()),K.current?.close()}},[A,S,T,E,D,w,B]),le=(0,_.useCallback)(async()=>{J.current=!1,X.current&&=(clearTimeout(X.current),null),H.current?.stop(),W.current?.getTracks().forEach(e=>e.stop()),G.current?.getTracks().forEach(e=>e.stop()),K.current?.close(),await C(),Y.current=null,N(`00:00`)},[C]),ue=(0,_.useCallback)(async()=>{t&&(L(!0),await k(t),L(!1))},[t,k]),$=Z?.status===`report_ready`,de=!r&&t,fe=!r&&!Z?.status.startsWith(`stop`)&&!t;return(0,b.jsxs)(`div`,{className:`flex h-full flex-col bg-[#111319] text-white`,children:[(0,b.jsx)(`div`,{className:`shrink-0 px-5 py-4 border-b border-white/[0.06] bg-[#191b22]/80 backdrop-blur-sm`,children:(0,b.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,b.jsx)(`div`,{className:`flex items-center justify-center w-9 h-9 rounded-xl bg-amber-500/10 border border-amber-500/20`,children:(0,b.jsx)(te,{className:`h-4 w-4 text-amber-400`})}),(0,b.jsxs)(`div`,{children:[(0,b.jsx)(`h1`,{className:`text-sm font-semibold text-white leading-tight`,children:`Transcripción de Reuniones`}),(0,b.jsx)(`p`,{className:`text-[11px] text-zinc-500 leading-tight`,children:`Captura · Transcribe · Informa en tiempo real`})]})]}),r&&(0,b.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 rounded-full bg-red-500/10 border border-red-500/20`,children:[(0,b.jsx)(oe,{}),(0,b.jsx)(`span`,{className:`text-xs font-semibold text-red-400 tabular-nums`,children:M})]})]})}),(0,b.jsxs)(`div`,{className:`flex flex-col lg:flex-row flex-1 overflow-hidden min-h-0`,children:[(0,b.jsxs)(`div`,{className:`flex flex-col flex-1 min-h-0 overflow-hidden`,children:[(0,b.jsxs)(`div`,{className:`shrink-0 px-5 py-4 border-b border-white/[0.06] space-y-3`,children:[fe?(0,b.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-2`,children:[(0,b.jsx)(ne,{placeholder:`Nombre de la reunión...`,value:A,onChange:e=>j(e.target.value),onKeyDown:e=>e.key===`Enter`&&Q(),className:`flex-1 bg-white/[0.04] border-white/[0.08] text-white placeholder:text-zinc-600 focus-visible:ring-amber-500/40 focus-visible:border-amber-500/40 rounded-xl h-10`,disabled:l}),(0,b.jsxs)(f,{onClick:Q,disabled:l||!A.trim(),className:`shrink-0 bg-amber-500 hover:bg-amber-400 active:bg-amber-600 text-black font-semibold rounded-xl h-10 px-5 shadow-lg shadow-amber-900/30 transition-all`,children:[(0,b.jsx)(ee,{className:`h-4 w-4 mr-1.5`}),l?`Iniciando...`:`Iniciar`]})]}):(0,b.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0`,children:[(0,b.jsx)(m,{variant:`outline`,className:r?`border-red-500/40 text-red-400 bg-red-500/10 rounded-full px-2.5`:`border-zinc-600/40 text-zinc-400 bg-white/[0.04] rounded-full px-2.5`,children:r?`● REC`:`Detenida`}),R!==`microphone`&&r&&(0,b.jsx)(m,{variant:`outline`,className:`border-blue-500/40 text-blue-400 bg-blue-500/10 rounded-full px-2.5`,children:R===`dual`?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g,{className:`h-3 w-3 mr-1`}),`Mic+Altavozz`]}):R===`system`?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g,{className:`h-3 w-3 mr-1`}),`Altavozz`]}):null}),(0,b.jsx)(`span`,{className:`text-sm font-medium text-zinc-200 truncate max-w-[180px]`,children:Z?.title}),r&&(0,b.jsxs)(`span`,{className:`hidden sm:flex items-center gap-1 text-xs text-zinc-500`,children:[(0,b.jsx)(p,{className:`h-3 w-3`}),M]})]}),(0,b.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[r&&(0,b.jsxs)(f,{variant:`outline`,size:`sm`,onClick:le,className:`border-red-500/30 text-red-400 hover:bg-red-500/10 hover:border-red-500/50 rounded-xl h-8`,children:[(0,b.jsx)(c,{className:`h-3 w-3 mr-1.5 fill-current`}),`Detener`]}),de&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(f,{size:`sm`,onClick:ue,disabled:I||$,className:`bg-amber-500 hover:bg-amber-400 text-black font-semibold rounded-xl h-8 px-3 shadow-md shadow-amber-900/30 disabled:opacity-60`,children:[(0,b.jsx)(o,{className:`h-3.5 w-3.5 mr-1.5`}),I?`Generando...`:$?`Reporte generado ✓`:`Generar Reporte`]}),(0,b.jsx)(f,{variant:`ghost`,size:`sm`,onClick:O,className:`text-zinc-500 hover:text-zinc-300 hover:bg-white/[0.05] rounded-xl h-8`,children:`Nueva reunión`})]})]})]}),u&&(0,b.jsxs)(`div`,{className:`flex items-start gap-2.5 px-3.5 py-2.5 rounded-xl bg-red-500/[0.08] border border-red-500/20 text-xs text-red-400`,children:[(0,b.jsx)(`span`,{className:`shrink-0 mt-px`,children:`⚠`}),(0,b.jsx)(`span`,{children:u})]}),$&&t&&(0,b.jsxs)(`div`,{className:`flex items-center gap-2.5 px-3.5 py-2.5 rounded-xl bg-emerald-500/[0.08] border border-emerald-500/20 text-xs text-emerald-400`,children:[(0,b.jsx)(`span`,{children:`✓`}),(0,b.jsx)(`span`,{children:`Reporte generado.`}),(0,b.jsx)(`a`,{href:`${d()}/api/meetings/${t}/report/download`,target:`_blank`,rel:`noreferrer`,className:`underline hover:text-emerald-300 font-medium`,children:`Descargar .docx`})]})]}),(0,b.jsx)(`div`,{className:`flex-1 overflow-y-auto px-4 py-4 min-h-0`,children:n.length===0?(0,b.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-4 text-zinc-600`,children:[(0,b.jsx)(`div`,{className:`flex items-center justify-center w-16 h-16 rounded-2xl bg-white/[0.03] border border-white/[0.06]`,children:(0,b.jsx)(h,{className:`h-7 w-7`})}),(0,b.jsx)(`p`,{className:`text-sm text-center max-w-[220px] leading-relaxed`,children:r?`Escuchando… las transcripciones aparecerán aquí`:`Inicia una sesión para ver la transcripción en tiempo real`})]}):(0,b.jsxs)(`div`,{className:`space-y-0.5`,children:[n.map(e=>(0,b.jsx)(ae,{segment:e},e.seq)),(0,b.jsx)(`div`,{ref:q})]})}),n.length>0&&(0,b.jsxs)(`div`,{className:`shrink-0 border-t border-white/[0.06] px-5 py-2 flex items-center justify-between`,children:[(0,b.jsxs)(`span`,{className:`text-[11px] text-zinc-600`,children:[n.length,` segmento`,n.length===1?``:`s`,` transcritos`]}),r&&(0,b.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[11px] text-zinc-500`,children:[(0,b.jsx)(p,{className:`h-3 w-3`}),M]})]})]}),(0,b.jsxs)(`div`,{className:`shrink-0 flex flex-col lg:w-64 xl:w-72 border-t lg:border-t-0 lg:border-l border-white/[0.06] bg-[#191b22]/40 max-h-60 lg:max-h-none`,children:[(0,b.jsxs)(`button`,{onClick:()=>F(!P),className:`flex items-center justify-between px-4 py-3 text-[11px] font-semibold text-zinc-500 uppercase tracking-wider hover:text-zinc-300 border-b border-white/[0.06] transition-colors`,children:[(0,b.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(s,{className:`h-3.5 w-3.5`}),`Historial (`,e.length,`)`]}),P?(0,b.jsx)(a,{className:`h-3 w-3`}):(0,b.jsx)(i,{className:`h-3 w-3`})]}),P&&(0,b.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:e.length===0?(0,b.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-8 gap-2 text-zinc-600`,children:[(0,b.jsx)(s,{className:`h-6 w-6 opacity-40`}),(0,b.jsx)(`p`,{className:`text-xs`,children:`Sin reuniones aún`})]}):(0,b.jsx)(`div`,{className:`py-1`,children:e.map(e=>(0,b.jsxs)(`button`,{onClick:()=>v.getState().fetchSession(e.id),className:`w-full text-left px-4 py-3 hover:bg-white/[0.04] transition-colors border-b border-white/[0.04] ${e.id===t?`bg-amber-500/[0.06]`:``}`,children:[(0,b.jsx)(`p`,{className:`text-xs font-medium text-zinc-200 truncate leading-snug`,children:e.title}),(0,b.jsxs)(`div`,{className:`flex items-center gap-1.5 mt-1`,children:[(0,b.jsx)(m,{variant:`outline`,className:`text-[10px] px-1.5 py-0 rounded-full border-0 ${e.status===`active`?`bg-emerald-500/15 text-emerald-400`:e.status===`report_ready`?`bg-blue-500/15 text-blue-400`:`bg-white/[0.05] text-zinc-500`}`,children:e.status===`active`?`activa`:e.status===`report_ready`?`con reporte`:`detenida`}),e.segment_count!==void 0&&e.segment_count>0&&(0,b.jsxs)(`span`,{className:`text-[10px] text-zinc-600`,children:[e.segment_count,` seg`]})]})]},e.id))})})]})]})]})}function S(){return(0,b.jsx)(`div`,{className:`h-full overflow-hidden`,children:(0,b.jsx)(x,{})})}export{S as MeetingPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{o as n}from"./vendor-query-Dj8xYhQD.js";import{t as r}from"./createLucideIcon-BRaPSYgN.js";import"./useProviders-C7FA6z4M.js";import{C as i,K as a,j as o}from"./index-Bi8qEmrK.js";import{t as s}from"./badge-DKpeVCpY.js";import{t as c}from"./label-C6atPuIh.js";import{i as l,n as u,o as d,s as f,t as p}from"./select-DlCT21_r.js";import{n as m,t as h}from"./card-Cag15G4h.js";import{t as g}from"./useHiveAgentsModelLoad-CHmtvNp4.js";var _=r(`FolderOpen`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),v=r(`Save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),y=e(t(),1),b=n();function x({selectedProviderId:e,selectedModelId:t,onProviderChange:n,onModelChange:r,disabled:_=!1,typeFilter:v}){let{providers:x,models:S}=i(),{load:C,cancel:w}=g(),[T,E]=(0,y.useState)(!1),D=e=>{if(e.id===`ollama`||e.id===`hiveagents`)return!0;let t=e.base_url||e.baseUrl||``;return t.includes(`localhost`)||t.includes(`127.0.0.1`)?!0:!!e.has_api_key},O=e=>{if(e.id===`ollama`)return!0;let t=e.base_url||e.baseUrl||``;return t.includes(`localhost`)||t.includes(`127.0.0.1`)},k=x.filter(e=>e.enabled&&e.active&&D(e)&&(e.category??`llm`)===`llm`),A=x.find(t=>t.id===e),j=!!A&&!k.some(e=>e.id===A.id),M=(0,y.useMemo)(()=>e?S.filter(t=>{let n=(t.provider_id||t.providerId)===e,r=!v||t.model_type===v;return n&&r}):[],[e,S,v]),N=(0,y.useMemo)(()=>M.filter(e=>e.enabled||e.active),[M]),P=M.find(e=>e.id===t),F=!!P&&!N.some(e=>e.id===P.id);(0,y.useEffect)(()=>{t&&M.length>0&&!M.find(e=>e.id===t)&&r(``)},[M,t,r]);let I=e=>{if(!e)return[];try{return JSON.parse(e)}catch{return[]}};return(0,y.useEffect)(()=>()=>w(),[e,t,w]),(0,b.jsxs)(`div`,{className:`space-y-4`,children:[(0,b.jsxs)(`div`,{className:`space-y-2`,children:[(0,b.jsx)(c,{htmlFor:`provider`,children:`Proveedor de IA`}),(0,b.jsxs)(p,{value:e||``,onValueChange:n,disabled:_||T||k.length===0,children:[(0,b.jsx)(d,{id:`provider`,className:`w-full`,children:(0,b.jsx)(f,{placeholder:`Selecciona un proveedor`,children:e&&A?(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`span`,{children:A.name}),j&&(0,b.jsx)(`span`,{className:`text-[10px] text-amber-400/80`,children:`(inactivo)`}),O(A)?(0,b.jsx)(`span`,{className:`text-[9px] font-bold px-1.5 py-0.5 rounded-full bg-amber-500/20 text-amber-400`,children:`LOCAL`}):(0,b.jsx)(`span`,{className:`text-[9px] font-bold px-1.5 py-0.5 rounded-full bg-emerald-500/20 text-emerald-400`,children:`API`})]}):`Selecciona un proveedor`})}),(0,b.jsx)(u,{children:k.length===0?(0,b.jsx)(l,{value:`none`,disabled:!0,children:`No hay proveedores configurados`}):k.map(e=>(0,b.jsx)(l,{value:e.id,children:(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`span`,{children:e.name}),O(e)?(0,b.jsx)(`span`,{className:`text-[9px] font-bold px-1.5 py-0.5 rounded-full bg-amber-500/20 text-amber-400`,children:`LOCAL`}):(0,b.jsx)(`span`,{className:`text-[9px] font-bold px-1.5 py-0.5 rounded-full bg-emerald-500/20 text-emerald-400`,children:`API`})]})},e.id))})]}),j&&A&&(0,b.jsxs)(`p`,{className:`text-[10px] text-amber-400/80`,children:[`El proveedor "`,A.name,`" está inactivo. Selecciona uno activo para cambiar.`]}),k.length===0&&(0,b.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Configura un proveedor en`,` `,(0,b.jsx)(`a`,{href:`/providers`,className:`text-primary underline`,children:`Settings > Providers`})]})]}),e&&(0,b.jsxs)(`div`,{className:`space-y-2`,children:[(0,b.jsx)(c,{htmlFor:`model`,children:`Modelo`}),(0,b.jsxs)(p,{value:t||``,onValueChange:async t=>{if(e===`hiveagents`&&t){let e=N.find(e=>e.id===t)?.contextWindow;if(!e){a.error(`No se pudo determinar el context_window del modelo`,{description:`Revisa la configuración del modelo en la base de datos.`});return}o.show(`Cargando modelo en HiveAgents…`),E(!0);let n=await C(t,e);if(E(!1),o.hide(),!n){a.error(`No se pudo confirmar la carga del modelo`,{description:`Intenta seleccionar el modelo nuevamente o verifica la conexión.`});return}a.success(`Modelo listo`,{description:`El modelo de HiveAgents ya está cargado y listo para usar.`})}r(t)},disabled:_||T||N.length===0,children:[(0,b.jsx)(d,{id:`model`,className:`w-full`,children:(0,b.jsx)(f,{placeholder:`Selecciona un modelo`,children:t&&P?(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`span`,{children:P.name}),F&&(0,b.jsx)(`span`,{className:`text-[10px] text-amber-400/80`,children:`(inactivo)`})]}):`Selecciona un modelo`})}),(0,b.jsx)(u,{children:N.length===0?(0,b.jsx)(l,{value:`none`,disabled:!0,children:`No hay modelos disponibles`}):N.map(e=>(0,b.jsx)(l,{value:e.id,children:(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`span`,{children:e.name}),e.contextWindow&&(0,b.jsxs)(s,{variant:`secondary`,className:`text-[10px]`,children:[(e.contextWindow/1e3).toFixed(0),`K ctx`]})]})},e.id))})]}),F&&P&&(0,b.jsxs)(`p`,{className:`text-[10px] text-amber-400/80`,children:[`El modelo "`,P.name,`" está inactivo. Selecciona uno activo para cambiar.`]}),t&&M.find(e=>e.id===t)&&(0,b.jsx)(h,{className:`mt-2`,children:(0,b.jsxs)(m,{className:`p-3 space-y-2`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,b.jsx)(`span`,{className:`text-sm font-medium`,children:M.find(e=>e.id===t)?.name}),(0,b.jsx)(s,{variant:`outline`,children:x.find(t=>t.id===e)?.name})]}),(()=>{let e=I(M.find(e=>e.id===t)?.capabilities);return e.length>0?(0,b.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.slice(0,5).map(e=>(0,b.jsx)(s,{variant:`secondary`,className:`text-[10px]`,children:e},e))}):null})()]})})]})]})}export{v as n,_ as r,x as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{o as n}from"./vendor-query-Dj8xYhQD.js";import{s as r}from"./vendor-router-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{o as n}from"./vendor-query-Dj8xYhQD.js";import{s as r}from"./vendor-router-DCsSv_I7.js";var i=e(t(),1),a=n(),o=()=>{let e=r();return(0,i.useEffect)(()=>{console.error(`404 Error: User attempted to access non-existent route:`,e.pathname)},[e.pathname]),(0,a.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-muted`,children:(0,a.jsxs)(`div`,{className:`text-center`,children:[(0,a.jsx)(`h1`,{className:`mb-4 text-4xl font-bold`,children:`404`}),(0,a.jsx)(`p`,{className:`mb-4 text-xl text-muted-foreground`,children:`Oops! Page not found`}),(0,a.jsx)(`a`,{href:`/`,className:`text-primary underline hover:text-primary/90`,children:`Return to Home`})]})})};export{o as default};
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{t as n}from"./vendor-react-DYyYpuMy.js";import{o as r}from"./vendor-query-Dj8xYhQD.js";import{t as i}from"./createLucideIcon-BRaPSYgN.js";import{t as a}from"./activity-C_GS5wrG.js";import{t as o}from"./arrow-right-BuNjN-bk.js";import{t as s}from"./chevron-left-GK4EQOyZ.js";import{t as c}from"./chevron-right-BupZqrxu.js";import{t as l}from"./circle-check-BKNT2_q6.js";import{t as u}from"./gauge-C__zxC3_.js";import{t as d}from"./radio-DfGzov4y.js";import{t as f}from"./send-xi8HzUdc.js";import{t as p}from"./volume-2-CBMYsuF3.js";import{t as m}from"./volume-x-vNFf2e4-.js";import{n as h,t as g}from"./wifi-DNv53AfN.js";import{r as _}from"./gateway-url-BzQV75Ig.js";import{N as v,Q as y,_ as b,at as x,q as S}from"./index-Bi8qEmrK.js";import{t as C}from"./useOfficeModel-Cc5VkReZ.js";import{Ct as w,G as T,K as E,St as D,T as O,c as ee,d as k,i as te,it as ne,l as re,lt as A,m as ie,mt as j,n as ae,nt as M,p as N,rt as P,s as oe,t as F,u as I,v as L,x as R,y as z}from"./Vignette-Cyi27LQH.js";var se=i(`Crown`,[[`path`,{d:`M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z`,key:`1vdc57`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),B=i(`SearchCheck`,[[`path`,{d:`m8 11 2 2 4-4`,key:`1sed1v`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),V=e(t(),1);function ce(){let{agents:e,fetchAgents:t}=b(),n=v(e=>e.graphNodes),r=v(e=>e.graphEdges),i=v(e=>e.workEvents),a=v(e=>e.isConnected);(0,V.useEffect)(()=>{t()},[t]);let{coordinator:o,desks:s,interactions:c}=C(e,n,r);return{coordinator:o,desks:s,interactions:c,workEvents:i,isConnected:a}}function le(){return typeof window>`u`?!1:window.localStorage.getItem(`office3d-sound`)===`on`}var H=_(e=>({selectedAgentId:null,quality:`high`,motion:`calm`,introDone:!1,soundEnabled:le(),activeCue:null,select:t=>e({selectedAgentId:t}),setQuality:t=>e({quality:t}),setMotion:t=>e({motion:t}),setIntroDone:()=>e({introDone:!0}),setSoundEnabled:t=>{typeof window<`u`&&window.localStorage.setItem(`office3d-sound`,t?`on`:`off`),e({soundEnabled:t})},setActiveCue:t=>e({activeCue:t})})),ue=e(n()),U=new w,de=new w,fe=new w,pe=new D;function me(e,t,n){let r=U.setFromMatrixPosition(e.matrixWorld);r.project(t);let i=n.width/2,a=n.height/2;return[r.x*i+i,-(r.y*a)+a]}function he(e,t){let n=U.setFromMatrixPosition(e.matrixWorld),r=de.setFromMatrixPosition(t.matrixWorld),i=n.sub(r),a=t.getWorldDirection(fe);return i.angleTo(a)>Math.PI/2}function ge(e,t,n,r){let i=U.setFromMatrixPosition(e.matrixWorld),a=i.clone();a.project(t),pe.set(a.x,a.y),n.setFromCamera(pe,t);let o=n.intersectObjects(r,!0);if(o.length){let e=o[0].distance;return i.distanceTo(n.ray.origin)<e}return!0}function _e(e,t){if(t instanceof P)return t.zoom;if(t instanceof ne){let n=U.setFromMatrixPosition(e.matrixWorld),r=de.setFromMatrixPosition(t.matrixWorld),i=t.fov*Math.PI/180,a=n.distanceTo(r);return 1/(2*Math.tan(i/2)*a)}else return 1}function ve(e,t,n){if(t instanceof ne||t instanceof P){let r=U.setFromMatrixPosition(e.matrixWorld),i=de.setFromMatrixPosition(t.matrixWorld),a=r.distanceTo(i),o=(n[1]-n[0])/(t.far-t.near),s=n[1]-o*t.far;return Math.round(o*a+s)}}var ye=e=>Math.abs(e)<1e-10?0:e;function be(e,t,n=``){let r=`matrix3d(`;for(let n=0;n!==16;n++)r+=ye(t[n]*e.elements[n])+(n===15?`)`:`,`);return n+r}var xe=(e=>t=>be(t,e))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),Se=(e=>(t,n)=>be(t,e(n),`translate(-50%,-50%)`))(e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1]);function Ce(e){return e&&typeof e==`object`&&`current`in e}var W=V.forwardRef(({children:e,eps:t=.001,style:n,className:r,prepend:i,center:a,fullscreen:o,portal:s,distanceFactor:c,sprite:l=!1,transform:u=!1,occlude:d,onOcclude:f,castShadow:p,receiveShadow:m,material:h,geometry:g,zIndexRange:_=[16777271,0],calculatePosition:v=me,as:y=`div`,wrapperClass:b,pointerEvents:x=`auto`,...S},C)=>{let{gl:T,camera:E,scene:D,size:O,raycaster:te,events:ne,viewport:re}=N(),[A]=V.useState(()=>document.createElement(y)),ie=V.useRef(),j=V.useRef(null),ae=V.useRef(0),M=V.useRef([0,0]),P=V.useRef(null),oe=V.useRef(null),F=s?.current||ne.connected||T.domElement.parentNode,I=V.useRef(null),L=V.useRef(!1),R=V.useMemo(()=>d&&d!==`blending`||Array.isArray(d)&&d.length&&Ce(d[0]),[d]);V.useLayoutEffect(()=>{let e=T.domElement;d&&d===`blending`?(e.style.zIndex=`${Math.floor(_[0]/2)}`,e.style.position=`absolute`,e.style.pointerEvents=`none`):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[d]),V.useLayoutEffect(()=>{if(j.current){let e=ie.current=ue.createRoot(A);if(D.updateMatrixWorld(),u)A.style.cssText=`position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;`;else{let e=v(j.current,E,O);A.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return F&&(i?F.prepend(A):F.appendChild(A)),()=>{F&&F.removeChild(A),e.unmount()}}},[F,u]),V.useLayoutEffect(()=>{b&&(A.className=b)},[b]);let z=V.useMemo(()=>u?{position:`absolute`,top:0,left:0,width:O.width,height:O.height,transformStyle:`preserve-3d`,pointerEvents:`none`}:{position:`absolute`,transform:a?`translate3d(-50%,-50%,0)`:`none`,...o&&{top:-O.height/2,left:-O.width/2,width:O.width,height:O.height},...n},[n,a,o,O,u]),se=V.useMemo(()=>({position:`absolute`,pointerEvents:x}),[x]);V.useLayoutEffect(()=>{if(L.current=!1,u){var t;(t=ie.current)==null||t.render(V.createElement(`div`,{ref:P,style:z},V.createElement(`div`,{ref:oe,style:se},V.createElement(`div`,{ref:C,className:r,style:n,children:e}))))}else{var i;(i=ie.current)==null||i.render(V.createElement(`div`,{ref:C,style:z,className:r,children:e}))}});let B=V.useRef(!0);k(e=>{if(j.current){E.updateMatrixWorld(),j.current.updateWorldMatrix(!0,!1);let e=u?M.current:v(j.current,E,O);if(u||Math.abs(ae.current-E.zoom)>t||Math.abs(M.current[0]-e[0])>t||Math.abs(M.current[1]-e[1])>t){let t=he(j.current,E),n=!1;R&&(Array.isArray(d)?n=d.map(e=>e.current):d!==`blending`&&(n=[D]));let r=B.current;n?B.current=ge(j.current,E,te,n)&&!t:B.current=!t,r!==B.current&&(f?f(!B.current):A.style.display=B.current?`block`:`none`);let i=Math.floor(_[0]/2),a=d?R?[_[0],i]:[i-1,0]:_;if(A.style.zIndex=`${ve(j.current,E,a)}`,u){let[e,t]=[O.width/2,O.height/2],n=E.projectionMatrix.elements[5]*t,{isOrthographicCamera:r,top:i,left:a,bottom:o,right:s}=E,u=xe(E.matrixWorldInverse),d=r?`scale(${n})translate(${ye(-(s+a)/2)}px,${ye((i+o)/2)}px)`:`translateZ(${n}px)`,f=j.current.matrixWorld;l&&(f=E.matrixWorldInverse.clone().transpose().copyPosition(f).scale(j.current.scale),f.elements[3]=f.elements[7]=f.elements[11]=0,f.elements[15]=1),A.style.width=O.width+`px`,A.style.height=O.height+`px`,A.style.perspective=r?``:`${n}px`,P.current&&oe.current&&(P.current.style.transform=`${d}${u}translate(${e}px,${t}px)`,oe.current.style.transform=Se(f,1/((c||10)/400)))}else{let t=c===void 0?1:_e(j.current,E)*c;A.style.transform=`translate3d(${e[0]}px,${e[1]}px,0) scale(${t})`}M.current=e,ae.current=E.zoom}}if(!R&&I.current&&!L.current)if(u){if(P.current){let e=P.current.children[0];if(e!=null&&e.clientWidth&&e!=null&&e.clientHeight){let{isOrthographicCamera:t}=E;if(t||g)S.scale&&(Array.isArray(S.scale)?S.scale instanceof w?I.current.scale.copy(S.scale.clone().divideScalar(1)):I.current.scale.set(1/S.scale[0],1/S.scale[1],1/S.scale[2]):I.current.scale.setScalar(1/S.scale));else{let t=(c||10)/400,n=e.clientWidth*t,r=e.clientHeight*t;I.current.scale.set(n,r,1)}L.current=!0}}}else{let t=A.children[0];if(t!=null&&t.clientWidth&&t!=null&&t.clientHeight){let e=1/re.factor,n=t.clientWidth*e,r=t.clientHeight*e;I.current.scale.set(n,r,1),L.current=!0}I.current.lookAt(e.camera.position)}});let ce=V.useMemo(()=>({vertexShader:u?void 0:`
|
|
2
|
+
/*
|
|
3
|
+
This shader is from the THREE's SpriteMaterial.
|
|
4
|
+
We need to turn the backing plane into a Sprite
|
|
5
|
+
(make it always face the camera) if "transfrom"
|
|
6
|
+
is false.
|
|
7
|
+
*/
|
|
8
|
+
#include <common>
|
|
9
|
+
|
|
10
|
+
void main() {
|
|
11
|
+
vec2 center = vec2(0., 1.);
|
|
12
|
+
float rotation = 0.0;
|
|
13
|
+
|
|
14
|
+
// This is somewhat arbitrary, but it seems to work well
|
|
15
|
+
// Need to figure out how to derive this dynamically if it even matters
|
|
16
|
+
float size = 0.03;
|
|
17
|
+
|
|
18
|
+
vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
|
|
19
|
+
vec2 scale;
|
|
20
|
+
scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
|
|
21
|
+
scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );
|
|
22
|
+
|
|
23
|
+
bool isPerspective = isPerspectiveMatrix( projectionMatrix );
|
|
24
|
+
if ( isPerspective ) scale *= - mvPosition.z;
|
|
25
|
+
|
|
26
|
+
vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size;
|
|
27
|
+
vec2 rotatedPosition;
|
|
28
|
+
rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
|
|
29
|
+
rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
|
|
30
|
+
mvPosition.xy += rotatedPosition;
|
|
31
|
+
|
|
32
|
+
gl_Position = projectionMatrix * mvPosition;
|
|
33
|
+
}
|
|
34
|
+
`,fragmentShader:`
|
|
35
|
+
void main() {
|
|
36
|
+
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
|
|
37
|
+
}
|
|
38
|
+
`}),[u]);return V.createElement(`group`,ee({},S,{ref:j}),d&&!R&&V.createElement(`mesh`,{castShadow:p,receiveShadow:m,ref:I},g||V.createElement(`planeGeometry`,null),h||V.createElement(`shaderMaterial`,{side:2,vertexShader:ce.vertexShader,fragmentShader:ce.fragmentShader})))}),we=Object.defineProperty,Te=(e,t,n)=>t in e?we(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,G=(e,t,n)=>(Te(e,typeof t==`symbol`?t:t+``,n),n);function Ee(e,t,n,r,i){let a;if(e=e.subarray||e.slice?e:e.buffer,n=n.subarray||n.slice?n:n.buffer,e=t?e.subarray?e.subarray(t,i&&t+i):e.slice(t,i&&t+i):e,n.set)n.set(e,r);else for(a=0;a<e.length;a++)n[a+r]=e[a];return n}function De(e){return e instanceof Float32Array?e:e instanceof z?e.getAttribute(`position`).array:e.map(e=>{let t=Array.isArray(e);return e instanceof w?[e.x,e.y,e.z]:e instanceof D?[e.x,e.y,0]:t&&e.length===3?[e[0],e[1],e[2]]:t&&e.length===2?[e[0],e[1],0]:e}).flat()}var Oe=class extends z{constructor(){super(),G(this,`type`,`MeshLine`),G(this,`isMeshLine`,!0),G(this,`positions`,[]),G(this,`previous`,[]),G(this,`next`,[]),G(this,`side`,[]),G(this,`width`,[]),G(this,`indices_array`,[]),G(this,`uvs`,[]),G(this,`counters`,[]),G(this,`widthCallback`,null),G(this,`_attributes`),G(this,`_points`,[]),G(this,`points`),G(this,`matrixWorld`,new E),Object.defineProperties(this,{points:{enumerable:!0,get(){return this._points},set(e){this.setPoints(e,this.widthCallback)}}})}setMatrixWorld(e){this.matrixWorld=e}setPoints(e,t){if(e=De(e),this._points=e,this.widthCallback=t??null,this.positions=[],this.counters=[],e.length&&e[0]instanceof w)for(let t=0;t<e.length;t++){let n=e[t],r=t/(e.length-1);this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(r),this.counters.push(r)}else for(let t=0;t<e.length;t+=3){let n=t/(e.length-1);this.positions.push(e[t],e[t+1],e[t+2]),this.positions.push(e[t],e[t+1],e[t+2]),this.counters.push(n),this.counters.push(n)}this.process()}compareV3(e,t){let n=e*6,r=t*6;return this.positions[n]===this.positions[r]&&this.positions[n+1]===this.positions[r+1]&&this.positions[n+2]===this.positions[r+2]}copyV3(e){let t=e*6;return[this.positions[t],this.positions[t+1],this.positions[t+2]]}process(){let e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];let t,n;n=this.compareV3(0,e-1)?this.copyV3(e-2):this.copyV3(0),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);for(let r=0;r<e;r++){if(this.side.push(1),this.side.push(-1),t=this.widthCallback?this.widthCallback(r/(e-1)):1,this.width.push(t),this.width.push(t),this.uvs.push(r/(e-1),0),this.uvs.push(r/(e-1),1),r<e-1){n=this.copyV3(r),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);let e=r*2;this.indices_array.push(e,e+1,e+2),this.indices_array.push(e+2,e+1,e+3)}r>0&&(n=this.copyV3(r),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]))}n=this.compareV3(e-1,0)?this.copyV3(1):this.copyV3(e-1),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]),!this._attributes||this._attributes.position.count!==this.counters.length?this._attributes={position:new L(new Float32Array(this.positions),3),previous:new L(new Float32Array(this.previous),3),next:new L(new Float32Array(this.next),3),side:new L(new Float32Array(this.side),1),width:new L(new Float32Array(this.width),1),uv:new L(new Float32Array(this.uvs),2),index:new L(new Uint16Array(this.indices_array),1),counters:new L(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute(`position`,this._attributes.position),this.setAttribute(`previous`,this._attributes.previous),this.setAttribute(`next`,this._attributes.next),this.setAttribute(`side`,this._attributes.side),this.setAttribute(`width`,this._attributes.width),this.setAttribute(`uv`,this._attributes.uv),this.setAttribute(`counters`,this._attributes.counters),this.setAttribute(`position`,this._attributes.position),this.setAttribute(`previous`,this._attributes.previous),this.setAttribute(`next`,this._attributes.next),this.setAttribute(`side`,this._attributes.side),this.setAttribute(`width`,this._attributes.width),this.setAttribute(`uv`,this._attributes.uv),this.setAttribute(`counters`,this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()}advance({x:e,y:t,z:n}){let r=this._attributes.position.array,i=this._attributes.previous.array,a=this._attributes.next.array,o=r.length;Ee(r,0,i,0,o),Ee(r,6,r,0,o-6),r[o-6]=e,r[o-5]=t,r[o-4]=n,r[o-3]=e,r[o-2]=t,r[o-1]=n,Ee(r,6,a,0,o-6),a[o-6]=e,a[o-5]=t,a[o-4]=n,a[o-3]=e,a[o-2]=t,a[o-1]=n,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0}},ke=`
|
|
39
|
+
#include <common>
|
|
40
|
+
#include <logdepthbuf_pars_vertex>
|
|
41
|
+
#include <fog_pars_vertex>
|
|
42
|
+
#include <clipping_planes_pars_vertex>
|
|
43
|
+
|
|
44
|
+
attribute vec3 previous;
|
|
45
|
+
attribute vec3 next;
|
|
46
|
+
attribute float side;
|
|
47
|
+
attribute float width;
|
|
48
|
+
attribute float counters;
|
|
49
|
+
|
|
50
|
+
uniform vec2 resolution;
|
|
51
|
+
uniform float lineWidth;
|
|
52
|
+
uniform vec3 color;
|
|
53
|
+
uniform float opacity;
|
|
54
|
+
uniform float sizeAttenuation;
|
|
55
|
+
|
|
56
|
+
varying vec2 vUV;
|
|
57
|
+
varying vec4 vColor;
|
|
58
|
+
varying float vCounters;
|
|
59
|
+
|
|
60
|
+
vec2 fix(vec4 i, float aspect) {
|
|
61
|
+
vec2 res = i.xy / i.w;
|
|
62
|
+
res.x *= aspect;
|
|
63
|
+
return res;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
void main() {
|
|
67
|
+
float aspect = resolution.x / resolution.y;
|
|
68
|
+
vColor = vec4(color, opacity);
|
|
69
|
+
vUV = uv;
|
|
70
|
+
vCounters = counters;
|
|
71
|
+
|
|
72
|
+
mat4 m = projectionMatrix * modelViewMatrix;
|
|
73
|
+
vec4 finalPosition = m * vec4(position, 1.0) * aspect;
|
|
74
|
+
vec4 prevPos = m * vec4(previous, 1.0);
|
|
75
|
+
vec4 nextPos = m * vec4(next, 1.0);
|
|
76
|
+
|
|
77
|
+
vec2 currentP = fix(finalPosition, aspect);
|
|
78
|
+
vec2 prevP = fix(prevPos, aspect);
|
|
79
|
+
vec2 nextP = fix(nextPos, aspect);
|
|
80
|
+
|
|
81
|
+
float w = lineWidth * width;
|
|
82
|
+
|
|
83
|
+
vec2 dir;
|
|
84
|
+
if (nextP == currentP) dir = normalize(currentP - prevP);
|
|
85
|
+
else if (prevP == currentP) dir = normalize(nextP - currentP);
|
|
86
|
+
else {
|
|
87
|
+
vec2 dir1 = normalize(currentP - prevP);
|
|
88
|
+
vec2 dir2 = normalize(nextP - currentP);
|
|
89
|
+
dir = normalize(dir1 + dir2);
|
|
90
|
+
|
|
91
|
+
vec2 perp = vec2(-dir1.y, dir1.x);
|
|
92
|
+
vec2 miter = vec2(-dir.y, dir.x);
|
|
93
|
+
//w = clamp(w / dot(miter, perp), 0., 4. * lineWidth * width);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
//vec2 normal = (cross(vec3(dir, 0.), vec3(0., 0., 1.))).xy;
|
|
97
|
+
vec4 normal = vec4(-dir.y, dir.x, 0., 1.);
|
|
98
|
+
normal.xy *= .5 * w;
|
|
99
|
+
//normal *= projectionMatrix;
|
|
100
|
+
if (sizeAttenuation == 0.) {
|
|
101
|
+
normal.xy *= finalPosition.w;
|
|
102
|
+
normal.xy /= (vec4(resolution, 0., 1.) * projectionMatrix).xy * aspect;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
finalPosition.xy += normal.xy * side;
|
|
106
|
+
gl_Position = finalPosition;
|
|
107
|
+
#include <logdepthbuf_vertex>
|
|
108
|
+
#include <fog_vertex>
|
|
109
|
+
vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);
|
|
110
|
+
#include <clipping_planes_vertex>
|
|
111
|
+
#include <fog_vertex>
|
|
112
|
+
}
|
|
113
|
+
`,Ae=`
|
|
114
|
+
#include <fog_pars_fragment>
|
|
115
|
+
#include <logdepthbuf_pars_fragment>
|
|
116
|
+
#include <clipping_planes_pars_fragment>
|
|
117
|
+
|
|
118
|
+
uniform sampler2D map;
|
|
119
|
+
uniform sampler2D alphaMap;
|
|
120
|
+
uniform float useGradient;
|
|
121
|
+
uniform float useMap;
|
|
122
|
+
uniform float useAlphaMap;
|
|
123
|
+
uniform float useDash;
|
|
124
|
+
uniform float dashArray;
|
|
125
|
+
uniform float dashOffset;
|
|
126
|
+
uniform float dashRatio;
|
|
127
|
+
uniform float visibility;
|
|
128
|
+
uniform float alphaTest;
|
|
129
|
+
uniform vec2 repeat;
|
|
130
|
+
uniform vec3 gradient[2];
|
|
131
|
+
|
|
132
|
+
varying vec2 vUV;
|
|
133
|
+
varying vec4 vColor;
|
|
134
|
+
varying float vCounters;
|
|
135
|
+
|
|
136
|
+
void main() {
|
|
137
|
+
#include <logdepthbuf_fragment>
|
|
138
|
+
vec4 diffuseColor = vColor;
|
|
139
|
+
if (useGradient == 1.) diffuseColor = vec4(mix(gradient[0], gradient[1], vCounters), 1.0);
|
|
140
|
+
if (useMap == 1.) diffuseColor *= texture2D(map, vUV * repeat);
|
|
141
|
+
if (useAlphaMap == 1.) diffuseColor.a *= texture2D(alphaMap, vUV * repeat).a;
|
|
142
|
+
if (diffuseColor.a < alphaTest) discard;
|
|
143
|
+
if (useDash == 1.) diffuseColor.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));
|
|
144
|
+
diffuseColor.a *= step(vCounters, visibility);
|
|
145
|
+
#include <clipping_planes_fragment>
|
|
146
|
+
gl_FragColor = diffuseColor;
|
|
147
|
+
#include <fog_fragment>
|
|
148
|
+
#include <tonemapping_fragment>
|
|
149
|
+
#include <${parseInt(`185`.replace(/\D+/g,``))>=154?`colorspace_fragment`:`encodings_fragment`}>
|
|
150
|
+
}
|
|
151
|
+
`,je=class extends j{constructor(e){super({uniforms:{...ie.fog,lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new R(16777215)},gradient:{value:[new R(16711680),new R(65280)]},opacity:{value:1},resolution:{value:new D(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},useGradient:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new D(1,1)}},vertexShader:ke,fragmentShader:Ae}),G(this,`lineWidth`),G(this,`map`),G(this,`useMap`),G(this,`alphaMap`),G(this,`useAlphaMap`),G(this,`color`),G(this,`gradient`),G(this,`resolution`),G(this,`sizeAttenuation`),G(this,`dashArray`),G(this,`dashOffset`),G(this,`dashRatio`),G(this,`useDash`),G(this,`useGradient`),G(this,`visibility`),G(this,`repeat`),this.type=`MeshLineMaterial`,Object.defineProperties(this,{lineWidth:{enumerable:!0,get(){return this.uniforms.lineWidth.value},set(e){this.uniforms.lineWidth.value=e}},map:{enumerable:!0,get(){return this.uniforms.map.value},set(e){this.uniforms.map.value=e}},useMap:{enumerable:!0,get(){return this.uniforms.useMap.value},set(e){this.uniforms.useMap.value=e}},alphaMap:{enumerable:!0,get(){return this.uniforms.alphaMap.value},set(e){this.uniforms.alphaMap.value=e}},useAlphaMap:{enumerable:!0,get(){return this.uniforms.useAlphaMap.value},set(e){this.uniforms.useAlphaMap.value=e}},color:{enumerable:!0,get(){return this.uniforms.color.value},set(e){this.uniforms.color.value=e}},gradient:{enumerable:!0,get(){return this.uniforms.gradient.value},set(e){this.uniforms.gradient.value=e}},opacity:{enumerable:!0,get(){return this.uniforms.opacity.value},set(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get(){return this.uniforms.resolution.value},set(e){this.uniforms.resolution.value.copy(e)}},sizeAttenuation:{enumerable:!0,get(){return this.uniforms.sizeAttenuation.value},set(e){this.uniforms.sizeAttenuation.value=e}},dashArray:{enumerable:!0,get(){return this.uniforms.dashArray.value},set(e){this.uniforms.dashArray.value=e,this.useDash=e===0?0:1}},dashOffset:{enumerable:!0,get(){return this.uniforms.dashOffset.value},set(e){this.uniforms.dashOffset.value=e}},dashRatio:{enumerable:!0,get(){return this.uniforms.dashRatio.value},set(e){this.uniforms.dashRatio.value=e}},useDash:{enumerable:!0,get(){return this.uniforms.useDash.value},set(e){this.uniforms.useDash.value=e}},useGradient:{enumerable:!0,get(){return this.uniforms.useGradient.value},set(e){this.uniforms.useGradient.value=e}},visibility:{enumerable:!0,get(){return this.uniforms.visibility.value},set(e){this.uniforms.visibility.value=e}},alphaTest:{enumerable:!0,get(){return this.uniforms.alphaTest.value},set(e){this.uniforms.alphaTest.value=e}},repeat:{enumerable:!0,get(){return this.uniforms.repeat.value},set(e){this.uniforms.repeat.value.copy(e)}}}),this.setValues(e)}copy(e){return super.copy(e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.gradient=e.gradient,this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray=e.dashArray,this.dashOffset=e.dashOffset,this.dashRatio=e.dashRatio,this.useDash=e.useDash,this.useGradient=e.useGradient,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this}},Me={width:.2,length:1,decay:1,local:!1,stride:0,interval:1},Ne=(e,t=1)=>(e.set(e.subarray(t)),e.fill(-1/0,-t),e);function Pe(e,t){let{length:n,local:r,decay:i,interval:a,stride:o}={...Me,...t},s=V.useRef(),[c]=V.useState(()=>new w);V.useLayoutEffect(()=>{e&&(s.current=Float32Array.from({length:n*10*3},(t,n)=>e.position.getComponent(n%3)))},[n,e]);let l=V.useRef(new w),u=V.useRef(0);return k(()=>{if(e&&s.current){if(u.current===0){let t;r?t=e.position:(e.getWorldPosition(c),t=c);let n=1*i;for(let e=0;e<n;e++)t.distanceTo(l.current)<o||(Ne(s.current,3),s.current.set(t.toArray(),s.current.length-3));l.current.copy(t)}u.current++,u.current%=a}}),s}var Fe=V.forwardRef((e,t)=>{let{children:n}=e,{width:r,length:i,decay:a,local:o,stride:s,interval:c}={...Me,...e},{color:l=`hotpink`,attenuation:u,target:d}=e,f=N(e=>e.size),p=N(e=>e.scene),m=V.useRef(null),[h,g]=V.useState(null),_=Pe(h,{length:i,decay:a,local:o,stride:s,interval:c});V.useEffect(()=>{let e=d?.current||m.current.children.find(e=>e instanceof M);e&&g(e)},[_,d]);let v=V.useMemo(()=>new Oe,[]),y=V.useMemo(()=>{let e=new je({lineWidth:.1*r,color:l,sizeAttenuation:1,resolution:new D(f.width,f.height)}),t;if(n)if(Array.isArray(n))t=n.find(e=>{let t=e;return typeof t.type==`string`&&t.type===`meshLineMaterial`});else{let e=n;typeof e.type==`string`&&e.type===`meshLineMaterial`&&(t=e)}return typeof t?.props==`object`&&e.setValues(t.props),e},[r,l,f,n]);return V.useEffect(()=>{y.uniforms.resolution.value.set(f.width,f.height)},[f]),k(()=>{_.current&&v.setPoints(_.current,u)}),V.createElement(`group`,null,I(V.createElement(`mesh`,{ref:t,geometry:v,material:y}),p),V.createElement(`group`,{ref:m},n))}),Ie=(0,V.createContext)(null);function Le({iterations:e=10,ms:t=250,threshold:n=.75,step:r=.1,factor:i=.5,flipflops:a=1/0,bounds:o=e=>e>100?[60,100]:[40,60],onIncline:s,onDecline:c,onChange:l,onFallback:u,children:d}){let[f,p]=(0,V.useState)(()=>({fps:0,index:0,factor:i,flipped:0,refreshrate:0,fallback:!1,frames:[],averages:[],subscriptions:new Map,subscribe:e=>{let t=Symbol();return f.subscriptions.set(t,e.current),()=>void f.subscriptions.delete(t)}})),m=0;return k(()=>{let{frames:i,averages:d}=f;if(!f.fallback&&d.length<e){i.push(performance.now());let p=i[i.length-1]-i[0];if(p>=t){if(f.fps=Math.round(i.length/p*1e3*1)/1,f.refreshrate=Math.max(f.refreshrate,f.fps),d[f.index++%e]=f.fps,d.length===e){let[t,i]=o(f.refreshrate),p=d.filter(e=>e>=i),h=d.filter(e=>e<t);p.length>e*n&&(f.factor=Math.min(1,f.factor+r),f.flipped++,s&&s(f),f.subscriptions.forEach(e=>e.onIncline&&e.onIncline(f))),h.length>e*n&&(f.factor=Math.max(0,f.factor-r),f.flipped++,c&&c(f),f.subscriptions.forEach(e=>e.onDecline&&e.onDecline(f))),m!==f.factor&&(m=f.factor,l&&l(f),f.subscriptions.forEach(e=>e.onChange&&e.onChange(f))),f.flipped>a&&!f.fallback&&(f.fallback=!0,u&&u(f),f.subscriptions.forEach(e=>e.onFallback&&e.onFallback(f))),f.averages=[]}f.frames=[]}}}),V.createElement(Ie.Provider,{value:f},d)}function Re(e,t){let n=t.clone(),r=0;e&&(r=e.distanceTo(t),n.add(e).multiplyScalar(.5));let i=Math.max(22,14+r*1.05);return{target:n,position:new w(n.x,n.y+i,n.z+.8)}}var K=r(),ze=new w(0,46,62),Be=new w(0,15.5,24.5),Ve=1.35,q=new w(0,2.2,0),J=new w(0,15.5,24.5),He=new w(0,3.1,0),Ue=.025;function We(e){return 1-(1-e)**3}function Ge({coordinatorId:e,selectedAgentId:t,swarmRef:n,motion:r}){let i=(0,V.useRef)(null),a=N(e=>e.camera),o=typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,s=H(e=>e.introDone),c=H(e=>e.setIntroDone),l=H(e=>e.activeCue),u=(0,V.useRef)(null),d=(0,V.useRef)(!1),[f]=(0,V.useState)(()=>q.clone()),[p]=(0,V.useState)(()=>J.clone()),m=(0,V.useRef)(null),h=(0,V.useRef)({position:J.clone(),target:q.clone()}),g=(0,V.useRef)(!1);return(0,V.useEffect)(()=>{if(r!==`calm`||o){m.current=null;return}l?m.current={sourceId:l.actorId,targetId:l.targetId||e||l.actorId,phase:`focus`}:m.current?.phase===`focus`&&(m.current.phase=`return`)},[l,e,r,o]),(0,V.useEffect)(()=>{t?g.current=!0:g.current&&(g.current=!1,m.current={sourceId:null,targetId:``,phase:`return`})},[t]),k((l,_)=>{if(o&&!s){a.position.copy(J),a.lookAt(q),c();return}if(!s){u.current===null&&(u.current=l.clock.elapsedTime,a.position.copy(ze));let e=Math.min(1,(l.clock.elapsedTime-u.current)/Ve);a.position.lerpVectors(ze,Be,We(e)),a.lookAt(q),e>=1&&(h.current.position.copy(J),h.current.target.copy(q),c());return}let v=i.current;if(v){if(!d.current){a.position.copy(J),v.target.copy(q),h.current.position.copy(J),h.current.target.copy(q),v.update(),d.current=!0;return}let i=m.current;if(i&&r===`calm`&&!o){if(i.phase===`focus`){let t=i.sourceId===e?He:i.sourceId?n.current.get(i.sourceId)?.pos:null,r=i.targetId===e?He:n.current.get(i.targetId)?.pos;if(r){let e=Re(t??null,r);f.copy(e.target),p.copy(e.position)}}else{let r=t===e?He:t?n.current.get(t)?.pos:null;g.current&&r?(f.copy(r),p.set(r.x,r.y+7,r.z+11)):(f.copy(h.current.target),p.copy(h.current.position))}let r=1-.035**_,o=1-.06**_;v.target.lerp(f,r),a.position.lerp(p,o),i.phase===`return`&&v.target.distanceToSquared(f)<Ue&&a.position.distanceToSquared(p)<Ue&&(m.current=null)}else if(g.current&&t&&r===`calm`&&!o){let r=t===e?He:n.current.get(t)?.pos;r&&(f.copy(r),p.set(r.x,r.y+7,r.z+11),v.target.lerp(f,1-.035**_),a.position.lerp(p,1-.06**_))}v.update()}}),(0,K.jsx)(oe,{ref:i,makeDefault:!0,enabled:s,enableDamping:!0,dampingFactor:.06,enablePan:!0,minDistance:9,maxDistance:60,maxPolarAngle:1.42,autoRotate:!1,onStart:()=>{m.current=null,g.current=!1},onEnd:()=>{let e=i.current;e&&(h.current.position.copy(a.position),h.current.target.copy(e.target))}})}var Ke=`
|
|
152
|
+
varying vec3 vWorldPos;
|
|
153
|
+
void main() {
|
|
154
|
+
vec4 world = modelMatrix * vec4(position, 1.0);
|
|
155
|
+
vWorldPos = world.xyz;
|
|
156
|
+
gl_Position = projectionMatrix * viewMatrix * world;
|
|
157
|
+
}
|
|
158
|
+
`,qe=`
|
|
159
|
+
varying vec3 vWorldPos;
|
|
160
|
+
uniform vec3 uColor;
|
|
161
|
+
|
|
162
|
+
// Distancia a aristas de un tiling hexagonal (pointy-top).
|
|
163
|
+
float hexEdge(vec2 p) {
|
|
164
|
+
p.x *= 0.57735 * 2.0;
|
|
165
|
+
p.y += mod(floor(p.x), 2.0) * 0.5;
|
|
166
|
+
p = abs(fract(p) - 0.5);
|
|
167
|
+
return abs(max(p.x * 1.5 + p.y, p.y * 2.0) - 1.0);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
void main() {
|
|
171
|
+
vec2 uv = vWorldPos.xz;
|
|
172
|
+
float dist = length(uv);
|
|
173
|
+
|
|
174
|
+
// Una referencia espacial estable, sin barridos ni pulsos.
|
|
175
|
+
float g1 = hexEdge(uv * 0.55);
|
|
176
|
+
float g2 = hexEdge(uv * 2.2);
|
|
177
|
+
float lines = smoothstep(0.065, 0.0, g1) * 0.42 + smoothstep(0.035, 0.0, g2) * 0.035;
|
|
178
|
+
|
|
179
|
+
// Fade radial hacia el vacío
|
|
180
|
+
float fade = smoothstep(46.0, 14.0, dist);
|
|
181
|
+
float centerGlow = exp(-dist * 0.11) * 0.12;
|
|
182
|
+
|
|
183
|
+
vec3 col = uColor * (lines + centerGlow);
|
|
184
|
+
float alpha = clamp((lines * 0.22 + centerGlow) * fade, 0.0, 0.22);
|
|
185
|
+
gl_FragColor = vec4(col, alpha);
|
|
186
|
+
}
|
|
187
|
+
`;function Je(){let e=(0,V.useMemo)(()=>({uColor:{value:new R(`#4f8ff7`)}}),[]);return(0,K.jsxs)(`mesh`,{rotation:[-Math.PI/2,0,0],position:[0,.01,0],children:[(0,K.jsx)(`circleGeometry`,{args:[48,72]}),(0,K.jsx)(`shaderMaterial`,{vertexShader:Ke,fragmentShader:qe,uniforms:e,transparent:!0,depthWrite:!1,blending:2})]})}var Ye=[0,0,0],Xe=4.2,Ze=4.4,Y=[{radius:7.5,yBase:2.8,inclination:.55},{radius:10.5,yBase:3.8,inclination:.9},{radius:13.5,yBase:4.8,inclination:1.25}],Qe=Math.PI*(3-Math.sqrt(5));function $e(e,t){let n=Y[e%Y.length],r=Math.floor(e/Y.length),i=Math.max(1,Math.ceil(t/Y.length));return{radius:n.radius,yBase:n.yBase,inclination:n.inclination,phase:r*Math.PI*2/i+e%Y.length*Qe*.37,angularSpeed:.05+e*7%5*.016}}function et(e,t,n,r,i){return[Math.cos(r)*t,n+Math.sin(r)*e.inclination,Math.sin(r)*t]}function tt(e,t){return e===`disabled`||e===`archived`?0:e===`tool_call`?.65:e===`thinking`?t?.42:.2:e===`stuck`?.08:0}function nt(e,t,n){return e===`disabled`||e===`archived`?20:t?Xe:n}function rt(e,t,n){return e===`disabled`||e===`archived`?1.4:t?Ze:n}var X=`#f59e0b`;function it({coordinator:e,active:t,swarmRef:n}){let r=(0,V.useRef)(null),i=(0,V.useRef)(null),a=(0,V.useRef)(null),o=(0,V.useRef)(null),s=(0,V.useRef)(null),c=(0,V.useRef)(null),l=H(t=>!!e&&t.selectedAgentId===e.id),u=H(e=>e.select),d=H(e=>e.motion),f=H(e=>e.activeCue),p=e?.status===`thinking`||e?.status===`tool_call`;return k((l,u)=>{let m=l.clock.elapsedTime,h=!!e&&(f?.actorId===e.id||f?.targetId===e.id),g=f?.actorId===e?.id?f.targetId:f?.actorId,_=g?n.current.get(g)?.pos:null;if(r.current){let e=d===`calm`&&(t||p)?Math.sin(m*2.1)*.04:0;r.current.position.y=1.05+e;let n=d===`calm`?Math.sin(m*.38)*.08:0,i=h&&_?Math.atan2(_.x,_.z):n;r.current.rotation.y=T.damp(r.current.rotation.y,i,4.5,u);let a=h&&d===`calm`?1.08:1,o=T.damp(r.current.scale.x,a,5,u);r.current.scale.setScalar(o)}let v=d===`calm`?Math.sin(m*(h?7:t||p?4.2:1.4))*(h?.34:t||p?.24:.08):0;i.current&&(i.current.rotation.z=.28+v),a.current&&(a.current.rotation.z=-.28-v),o.current&&(o.current.intensity+=((t||p?12:6)-o.current.intensity)*.04),s.current&&(s.current.rotation.y+=u*(h?1.2:.22)),c.current&&(c.current.rotation.z=h&&d===`calm`?Math.sin(m*7)*.08:0)}),(0,K.jsxs)(`group`,{position:Ye,children:[(0,K.jsxs)(`mesh`,{position:[0,.3,0],children:[(0,K.jsx)(`cylinderGeometry`,{args:[2.5,2.8,.45,6]}),(0,K.jsx)(`meshStandardMaterial`,{color:`#0b0f1a`,metalness:.7,roughness:.35,emissive:X,emissiveIntensity:l?.5:.18})]}),(0,K.jsxs)(`mesh`,{position:[0,.54,0],rotation:[-Math.PI/2,0,0],children:[(0,K.jsx)(`ringGeometry`,{args:[1.85,2.22,6]}),(0,K.jsx)(`meshBasicMaterial`,{color:X,transparent:!0,opacity:l?.9:.48,blending:2})]}),(0,K.jsxs)(`group`,{ref:r,onClick:t=>{t.stopPropagation(),e&&u(l?null:e.id)},onPointerOver:e=>{e.stopPropagation(),document.body.style.cursor=`pointer`},onPointerOut:()=>{document.body.style.cursor=`auto`},children:[(0,K.jsxs)(`mesh`,{position:[0,1.2,0],scale:[.74,1.28,.68],children:[(0,K.jsx)(`sphereGeometry`,{args:[.72,24,20]}),(0,K.jsx)(`meshStandardMaterial`,{color:`#e6a519`,emissive:X,emissiveIntensity:l?.8:.42,metalness:.34,roughness:.36})]}),[.58,1.02,1.46].map((e,t)=>(0,K.jsxs)(`mesh`,{position:[0,e,0],rotation:[Math.PI/2,0,0],children:[(0,K.jsx)(`torusGeometry`,{args:[.5-t*.035,.075,8,28]}),(0,K.jsx)(`meshStandardMaterial`,{color:`#251807`,metalness:.52,roughness:.48})]},e)),(0,K.jsxs)(`mesh`,{position:[0,-.02,0],rotation:[0,0,Math.PI],children:[(0,K.jsx)(`coneGeometry`,{args:[.14,.52,8]}),(0,K.jsx)(`meshStandardMaterial`,{color:`#ffcf6a`,emissive:X,emissiveIntensity:.5})]}),(0,K.jsxs)(`mesh`,{position:[0,2.25,0],scale:[1,.9,.82],children:[(0,K.jsx)(`sphereGeometry`,{args:[.7,22,18]}),(0,K.jsx)(`meshStandardMaterial`,{color:`#593c12`,emissive:X,emissiveIntensity:l?.55:.24,metalness:.48,roughness:.42})]}),(0,K.jsxs)(`mesh`,{position:[0,3.15,0],children:[(0,K.jsx)(`sphereGeometry`,{args:[.54,22,18]}),(0,K.jsx)(`meshStandardMaterial`,{color:`#d69113`,emissive:X,emissiveIntensity:l?.95:.48,metalness:.38,roughness:.34})]}),[-1,1].map(e=>(0,K.jsxs)(`mesh`,{position:[e*.34,3.2,.4],scale:[1,1.18,.42],children:[(0,K.jsx)(`sphereGeometry`,{args:[.15,12,10]}),(0,K.jsx)(`meshBasicMaterial`,{color:`#fff1a8`})]},e)),(0,K.jsx)(`group`,{ref:c,position:[0,3.55,0],children:[-1,1].map(e=>(0,K.jsxs)(`group`,{rotation:[0,0,e*-.36],children:[(0,K.jsxs)(`mesh`,{position:[e*.22,.28,0],children:[(0,K.jsx)(`capsuleGeometry`,{args:[.035,.42,4,8]}),(0,K.jsx)(`meshBasicMaterial`,{color:`#ffd465`})]}),(0,K.jsxs)(`mesh`,{position:[e*.32,.53,0],children:[(0,K.jsx)(`sphereGeometry`,{args:[.07,8,8]}),(0,K.jsx)(`meshBasicMaterial`,{color:`#fff0a6`})]})]},e))}),(0,K.jsxs)(`group`,{ref:i,position:[.48,2.45,0],children:[(0,K.jsxs)(`mesh`,{position:[.62,.18,0],rotation:[.08,.15,-.18],scale:[1.65,.12,.72],children:[(0,K.jsx)(`sphereGeometry`,{args:[.48,16,12]}),(0,K.jsx)(`meshStandardMaterial`,{color:`#e8f8ff`,emissive:`#8cdcff`,emissiveIntensity:.58,transparent:!0,opacity:.48,side:2,depthWrite:!1})]}),(0,K.jsxs)(`mesh`,{position:[.46,-.34,.05],rotation:[.08,.1,.2],scale:[1.25,.1,.58],children:[(0,K.jsx)(`sphereGeometry`,{args:[.4,14,10]}),(0,K.jsx)(`meshStandardMaterial`,{color:`#dff7ff`,emissive:`#77c8ff`,emissiveIntensity:.42,transparent:!0,opacity:.38,side:2,depthWrite:!1})]})]}),(0,K.jsxs)(`group`,{ref:a,position:[-.48,2.45,0],children:[(0,K.jsxs)(`mesh`,{position:[-.62,.18,0],rotation:[.08,-.15,.18],scale:[1.65,.12,.72],children:[(0,K.jsx)(`sphereGeometry`,{args:[.48,16,12]}),(0,K.jsx)(`meshStandardMaterial`,{color:`#e8f8ff`,emissive:`#8cdcff`,emissiveIntensity:.58,transparent:!0,opacity:.48,side:2,depthWrite:!1})]}),(0,K.jsxs)(`mesh`,{position:[-.46,-.34,.05],rotation:[.08,-.1,-.2],scale:[1.25,.1,.58],children:[(0,K.jsx)(`sphereGeometry`,{args:[.4,14,10]}),(0,K.jsx)(`meshStandardMaterial`,{color:`#dff7ff`,emissive:`#77c8ff`,emissiveIntensity:.42,transparent:!0,opacity:.38,side:2,depthWrite:!1})]})]}),(0,K.jsxs)(`group`,{ref:s,position:[0,4.08,0],children:[(0,K.jsxs)(`mesh`,{rotation:[Math.PI/2,0,0],children:[(0,K.jsx)(`torusGeometry`,{args:[.48,.055,6,6]}),(0,K.jsx)(`meshBasicMaterial`,{color:`#ffe38a`,blending:2})]}),[-.4,0,.4].map((e,t)=>(0,K.jsxs)(`mesh`,{position:[e,t===1?.25:.14,0],children:[(0,K.jsx)(`coneGeometry`,{args:[.11,t===1?.48:.34,5]}),(0,K.jsx)(`meshStandardMaterial`,{color:`#ffd465`,emissive:X,emissiveIntensity:.9,metalness:.6,roughness:.2})]},e))]})]}),(0,K.jsx)(`pointLight`,{ref:o,position:[0,3,0],color:X,intensity:6,distance:18,decay:1.8})]})}var at=`
|
|
188
|
+
varying vec2 vUv;
|
|
189
|
+
void main() {
|
|
190
|
+
vUv = uv;
|
|
191
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
192
|
+
}
|
|
193
|
+
`,ot=`
|
|
194
|
+
varying vec2 vUv;
|
|
195
|
+
uniform vec3 uColor;
|
|
196
|
+
uniform float uTime;
|
|
197
|
+
uniform float uSpeed;
|
|
198
|
+
uniform float uIntensity;
|
|
199
|
+
|
|
200
|
+
void main() {
|
|
201
|
+
// uv.y recorre la longitud del cilindro (delegante → worker)
|
|
202
|
+
float flow = fract(vUv.y * 3.0 - uTime * uSpeed);
|
|
203
|
+
float packet = smoothstep(0.0, 0.12, flow) * smoothstep(0.42, 0.12, flow);
|
|
204
|
+
float flow2 = fract(vUv.y * 7.0 - uTime * uSpeed * 1.7);
|
|
205
|
+
float packet2 = smoothstep(0.0, 0.06, flow2) * smoothstep(0.2, 0.06, flow2);
|
|
206
|
+
|
|
207
|
+
float core = 0.3 + packet * 1.6 + packet2 * 0.9;
|
|
208
|
+
float ends = smoothstep(0.0, 0.05, vUv.y) * smoothstep(1.0, 0.95, vUv.y);
|
|
209
|
+
float glow = core * uIntensity;
|
|
210
|
+
gl_FragColor = vec4(uColor * glow, clamp(glow * 0.6 * ends, 0.0, 1.0));
|
|
211
|
+
}
|
|
212
|
+
`,st=new w(0,4.4,0),ct=new w,lt=new w,ut=new w,dt=new w,ft=new w(0,1,0),pt=new A;function mt({desks:e,interactions:t,swarmRef:n,coordinatorId:r}){return(0,K.jsx)(`group`,{children:t.map(t=>(0,K.jsx)(ht,{interaction:t,targetDesk:e.find(e=>e.agent.id===t.targetId)??null,swarmRef:n,coordinatorId:r},t.id))})}function ht({interaction:e,targetDesk:t,swarmRef:n,coordinatorId:r}){let i=(0,V.useRef)(null),a=(0,V.useRef)(null),o=(0,V.useMemo)(()=>({uTime:{value:0},uColor:{value:new R(t?.color??`#f59e0b`)},uSpeed:{value:.52},uIntensity:{value:.82}}),[t?.color]);return k(t=>{o.uTime.value=t.clock.elapsedTime;let s=n.current.get(e.targetId);if(!s||!i.current)return;if(e.sourceId===r)ct.copy(st);else{let t=n.current.get(e.sourceId);if(!t){i.current.visible=!1;return}ct.copy(t.pos)}lt.copy(s.pos),ut.subVectors(lt,ct);let c=ut.length();i.current.visible=c>.5,!(c<=.5)&&(dt.addVectors(ct,lt).multiplyScalar(.5),i.current.position.copy(dt),a.current?.position.copy(dt),pt.setFromUnitVectors(ft,ut.normalize()),i.current.quaternion.copy(pt),i.current.scale.set(.055,c,.055))}),(0,K.jsxs)(`group`,{children:[(0,K.jsxs)(`mesh`,{ref:i,visible:!1,children:[(0,K.jsx)(`cylinderGeometry`,{args:[1,1,1,6,1,!0]}),(0,K.jsx)(`shaderMaterial`,{vertexShader:at,fragmentShader:ot,uniforms:o,transparent:!0,depthWrite:!1,side:2,blending:2})]}),(0,K.jsx)(`group`,{ref:a,children:(0,K.jsx)(W,{position:[0,.55,0],center:!0,distanceFactor:24,className:`pointer-events-none select-none`,children:(0,K.jsxs)(`div`,{className:`office3d-beam-label`,style:{"--chip-color":t?.color??`#f59e0b`},children:[(0,K.jsx)(`strong`,{children:e.kind===`reviews`?`REVISIÓN EN CURSO`:`TRABAJO DELEGADO`}),e.taskName&&(0,K.jsx)(`span`,{children:e.taskName})]})})})]})}var gt=`
|
|
213
|
+
attribute float aSeed;
|
|
214
|
+
uniform float uTime;
|
|
215
|
+
uniform float uPixelRatio;
|
|
216
|
+
varying float vSeed;
|
|
217
|
+
varying float vFade;
|
|
218
|
+
|
|
219
|
+
void main() {
|
|
220
|
+
vSeed = aSeed;
|
|
221
|
+
vec3 pos = position;
|
|
222
|
+
float t = uTime * (0.08 + aSeed * 0.12);
|
|
223
|
+
// Deriva orgánica
|
|
224
|
+
pos.x += sin(uTime * 0.25 + aSeed * 40.0) * 1.6;
|
|
225
|
+
pos.z += cos(uTime * 0.2 + aSeed * 31.0) * 1.6;
|
|
226
|
+
// Ascenso envolvente (polen que sube y reaparece abajo)
|
|
227
|
+
pos.y = mod(position.y + t * 6.0, 22.0);
|
|
228
|
+
vFade = smoothstep(0.0, 3.0, pos.y) * smoothstep(22.0, 16.0, pos.y);
|
|
229
|
+
|
|
230
|
+
vec4 mv = modelViewMatrix * vec4(pos, 1.0);
|
|
231
|
+
gl_PointSize = (1.4 + aSeed * 2.4) * uPixelRatio * (28.0 / -mv.z);
|
|
232
|
+
gl_Position = projectionMatrix * mv;
|
|
233
|
+
}
|
|
234
|
+
`,_t=`
|
|
235
|
+
uniform vec3 uColor;
|
|
236
|
+
uniform float uOpacity;
|
|
237
|
+
varying float vSeed;
|
|
238
|
+
varying float vFade;
|
|
239
|
+
|
|
240
|
+
void main() {
|
|
241
|
+
vec2 c = gl_PointCoord - 0.5;
|
|
242
|
+
float d = length(c);
|
|
243
|
+
float disc = smoothstep(0.5, 0.05, d);
|
|
244
|
+
gl_FragColor = vec4(uColor * (0.6 + vSeed * 0.8), disc * uOpacity * vFade);
|
|
245
|
+
}
|
|
246
|
+
`,vt=`
|
|
247
|
+
attribute vec3 aVel;
|
|
248
|
+
attribute float aSeed;
|
|
249
|
+
uniform float uTime;
|
|
250
|
+
uniform float uStart;
|
|
251
|
+
uniform float uPixelRatio;
|
|
252
|
+
varying float vLife;
|
|
253
|
+
|
|
254
|
+
void main() {
|
|
255
|
+
float t = clamp((uTime - uStart) / 1.4, 0.0, 1.0);
|
|
256
|
+
vLife = 1.0 - t;
|
|
257
|
+
vec3 pos = aVel * (t * 3.2 - t * t * 1.1); // desaceleración
|
|
258
|
+
pos.y += t * 1.2; // ligera ascensión
|
|
259
|
+
vec4 mv = modelViewMatrix * vec4(pos, 1.0);
|
|
260
|
+
gl_PointSize = (2.2 + aSeed * 2.0) * vLife * uPixelRatio * (30.0 / -mv.z);
|
|
261
|
+
gl_Position = projectionMatrix * mv;
|
|
262
|
+
}
|
|
263
|
+
`,yt=`
|
|
264
|
+
uniform vec3 uColor;
|
|
265
|
+
varying float vLife;
|
|
266
|
+
void main() {
|
|
267
|
+
vec2 c = gl_PointCoord - 0.5;
|
|
268
|
+
float disc = smoothstep(0.5, 0.05, length(c));
|
|
269
|
+
gl_FragColor = vec4(uColor * (0.8 + vLife), disc * vLife);
|
|
270
|
+
}
|
|
271
|
+
`,bt=780,xt=42,St=22;function Ct(){let e=(0,V.useRef)(null),t=N(e=>e.viewport.dpr),n=(0,V.useMemo)(()=>{let e=new z,t=new Float32Array(bt*3),n=new Float32Array(bt);for(let e=0;e<bt;e++){let r=Math.sqrt(Math.random())*xt,i=Math.random()*Math.PI*2;t[e*3]=Math.cos(i)*r,t[e*3+1]=Math.random()*St,t[e*3+2]=Math.sin(i)*r,n[e]=Math.random()}return e.setAttribute(`position`,new O(t,3)),e.setAttribute(`aSeed`,new O(n,1)),e},[]),r=(0,V.useMemo)(()=>({uTime:{value:0},uColor:{value:new R(`#6aa9ff`)},uOpacity:{value:.16},uPixelRatio:{value:t}}),[]);return k(e=>{r.uTime.value=e.clock.elapsedTime,r.uPixelRatio.value=e.viewport.dpr}),(0,K.jsx)(`points`,{geometry:n,frustumCulled:!1,children:(0,K.jsx)(`shaderMaterial`,{ref:e,vertexShader:gt,fragmentShader:_t,uniforms:r,transparent:!0,depthWrite:!1,blending:2})})}var wt=64,Tt=1700,Et=0;function Dt({desks:e,swarmRef:t}){let[n,r]=(0,V.useState)([]),i=(0,V.useRef)(new Map);return(0,V.useEffect)(()=>{let n=i.current;for(let i of e){if(n.get(i.agent.id)===`tool_call`&&i.state!==`tool_call`){let e=t.current.get(i.agent.id);if(e){let t=++Et;r(n=>[...n,{id:t,position:e.pos.toArray(),color:i.color}]),setTimeout(()=>{r(e=>e.filter(e=>e.id!==t))},Tt)}}n.set(i.agent.id,i.state)}},[e,t]),(0,K.jsx)(`group`,{children:n.map(e=>(0,K.jsx)(Ot,{burst:e},e.id))})}function Ot({burst:e}){let t=(0,V.useMemo)(()=>{let e=new z,t=new Float32Array(wt*3),n=new Float32Array(wt*3),r=new Float32Array(wt);for(let e=0;e<wt;e++){let t=Math.random()*Math.PI*2,i=Math.acos(2*Math.random()-1),a=.6+Math.random()*1.4;n[e*3]=Math.sin(i)*Math.cos(t)*a,n[e*3+1]=Math.cos(i)*a*.9,n[e*3+2]=Math.sin(i)*Math.sin(t)*a,r[e]=Math.random()}return e.setAttribute(`position`,new O(t,3)),e.setAttribute(`aVel`,new O(n,3)),e.setAttribute(`aSeed`,new O(r,1)),e},[]),n=(0,V.useMemo)(()=>({uTime:{value:0},uStart:{value:-1},uColor:{value:new R(e.color)},uPixelRatio:{value:1}}),[e.color]);return k(e=>{n.uTime.value=e.clock.elapsedTime,n.uStart.value<0&&(n.uStart.value=e.clock.elapsedTime),n.uPixelRatio.value=e.viewport.dpr}),(0,K.jsx)(`points`,{geometry:t,position:e.position,frustumCulled:!1,children:(0,K.jsx)(`shaderMaterial`,{vertexShader:vt,fragmentShader:yt,uniforms:n,transparent:!0,depthWrite:!1,blending:2})})}function kt({quality:e}){return(0,K.jsxs)(te,{multisampling:0,children:[(0,K.jsx)(ae,{mipmapBlur:!0,intensity:e===`high`?.52:.32,luminanceThreshold:.38,luminanceSmoothing:.22}),(0,K.jsx)(F,{offset:.34,darkness:.38})]})}var Z=new w;function At({desks:e,swarmRef:t,motion:n}){let r=(0,V.useMemo)(()=>new Map(e.map((t,n)=>[t.agent.id,$e(n,e.length)])),[e]),i=(0,V.useRef)(e);return(0,V.useEffect)(()=>{i.current=e},[e]),k((e,a)=>{let o=e.clock.elapsedTime,s=t.current;for(let e of i.current){let t=e.agent.id,i=r.get(t);if(!i)continue;let c=s.get(t);if(!c){let[e,n,r]=et(i,i.radius,i.yBase,i.phase,o);c={pos:new w(e,n,r),prevPos:new w(e,n,r),angle:i.phase,radius:i.radius,y:i.yBase,speedMul:1},s.set(t,c)}let l=!!e.currentTask,u=nt(e.state,l,i.radius),d=rt(e.state,l,i.yBase),f=n===`off`?0:tt(e.state,l),p=1-.12**a;c.radius+=(u-c.radius)*p,c.y+=(d-c.y)*p,c.speedMul+=(f-c.speedMul)*p,c.angle+=i.angularSpeed*c.speedMul*a,c.prevPos.copy(c.pos);let[m,h,g]=et(i,c.radius,c.y,c.angle,o);Z.set(m,h,g),n===`calm`&&e.state===`stuck`&&(Z.x+=Math.sin(o*31+i.phase*7)*.22,Z.y+=Math.cos(o*41+i.phase*3)*.15,Z.z+=Math.sin(o*37+i.phase*5)*.22),c.pos.copy(Z)}for(let e of s.keys())r.has(e)||s.delete(e)},-1),null}var jt={task_delegate:`Delegando tarea`,task_status:`Consultando estado`,web_search:`Buscando en la web`,web_fetch:`Leyendo página web`,browser_navigate:`Navegando`,browser_click:`Haciendo clic`,browser_type:`Escribiendo en la página`,browser_screenshot:`Tomando captura`,computer_use_task:`Operando el navegador`,browser_extract:`Extrayendo datos`,fs_read:`Leyendo archivo`,fs_write:`Escribiendo archivo`,fs_exists:`Verificando archivo`,exec:`Ejecutando comando`,search_knowledge:`Buscando herramientas`,a2ui_create_surface:`Creando interfaz`,a2ui_update_components:`Actualizando interfaz`,a2ui_update_data_model:`Actualizando datos`,memory_write:`Guardando en memoria`,memory_read:`Leyendo memoria`,memory_search:`Buscando en memoria`,save_note:`Guardando nota`,"cron.create":`Programando tarea`,notify:`Enviando aviso`,report_progress:`Reportando avance`};function Mt(e){if(!e)return null;if(jt[e])return jt[e];let t=e.split(`__`)[0];if(t&&t!==e)return`Usando ${t}`;let n=e.replace(/[_.]+/g,` `).trim();return n.charAt(0).toUpperCase()+n.slice(1)}var Nt=`
|
|
272
|
+
varying vec3 vNormal;
|
|
273
|
+
varying vec3 vWorldPos;
|
|
274
|
+
varying vec3 vViewDir;
|
|
275
|
+
uniform float uTime;
|
|
276
|
+
uniform float uGlitch;
|
|
277
|
+
|
|
278
|
+
float hash(float n) { return fract(sin(n) * 43758.5453123); }
|
|
279
|
+
|
|
280
|
+
void main() {
|
|
281
|
+
vec3 pos = position;
|
|
282
|
+
if (uGlitch > 0.01) {
|
|
283
|
+
float row = floor(position.y * 14.0 + uTime * 18.0);
|
|
284
|
+
float slice = step(0.94, hash(row));
|
|
285
|
+
pos.x += slice * uGlitch * (hash(uTime * 43.0) - 0.5) * 0.45;
|
|
286
|
+
pos.z += slice * uGlitch * (hash(uTime * 71.0) - 0.5) * 0.2;
|
|
287
|
+
}
|
|
288
|
+
vec4 world = modelMatrix * vec4(pos, 1.0);
|
|
289
|
+
vWorldPos = world.xyz;
|
|
290
|
+
vNormal = normalize(normalMatrix * normal);
|
|
291
|
+
vViewDir = cameraPosition - world.xyz;
|
|
292
|
+
gl_Position = projectionMatrix * viewMatrix * world;
|
|
293
|
+
}
|
|
294
|
+
`,Pt=`
|
|
295
|
+
varying vec3 vNormal;
|
|
296
|
+
varying vec3 vWorldPos;
|
|
297
|
+
varying vec3 vViewDir;
|
|
298
|
+
uniform vec3 uColor;
|
|
299
|
+
uniform float uTime;
|
|
300
|
+
uniform float uIntensity;
|
|
301
|
+
uniform float uGlitch;
|
|
302
|
+
uniform float uOpacity;
|
|
303
|
+
|
|
304
|
+
void main() {
|
|
305
|
+
vec3 n = normalize(vNormal);
|
|
306
|
+
vec3 v = normalize(vViewDir);
|
|
307
|
+
float fresnel = pow(1.0 - abs(dot(n, v)), 2.2);
|
|
308
|
+
float scan = 0.82 + 0.18 * sin(vWorldPos.y * 90.0 - uTime * 6.0);
|
|
309
|
+
float flicker = 0.93 + 0.07 * sin(uTime * 37.0 + vWorldPos.x * 10.0);
|
|
310
|
+
vec3 col = uColor;
|
|
311
|
+
if (uGlitch > 0.01) {
|
|
312
|
+
col = mix(col, vec3(1.0, 0.28, 0.2), uGlitch * 0.65);
|
|
313
|
+
flicker *= 0.75 + 0.25 * step(0.5, fract(uTime * 24.0));
|
|
314
|
+
}
|
|
315
|
+
float alpha = (0.16 + fresnel * 0.95) * scan * flicker * uOpacity;
|
|
316
|
+
vec3 glow = col * (uIntensity * (0.45 + fresnel * 1.7));
|
|
317
|
+
gl_FragColor = vec4(glow, alpha);
|
|
318
|
+
}
|
|
319
|
+
`;function Ft(e){let t=e?.toLowerCase()??``;return/knowledge|memory|rag|embed|document|vector/.test(t)?`knowledge`:/browser|web|search|fetch|http|url/.test(t)?`browser`:/file|code|exec|shell|terminal|git|patch|write|read/.test(t)?`code`:/message|mail|slack|discord|telegram|whatsapp|notify/.test(t)?`communication`:`generic`}function Q({color:e}){return(0,K.jsx)(`meshBasicMaterial`,{color:e,transparent:!0,opacity:.72,wireframe:!0,blending:2,depthWrite:!1})}function It({toolName:e,color:t}){let n=(0,V.useRef)(null),r=Ft(e);return k((e,t)=>{n.current&&(n.current.rotation.y+=t*.85,n.current.position.y=1.05+Math.sin(e.clock.elapsedTime*2.4)*.08)}),(0,K.jsxs)(`group`,{ref:n,scale:.7,children:[r===`browser`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`mesh`,{children:[(0,K.jsx)(`sphereGeometry`,{args:[.42,10,8]}),(0,K.jsx)(Q,{color:t})]}),(0,K.jsxs)(`mesh`,{rotation:[Math.PI/2,0,0],children:[(0,K.jsx)(`torusGeometry`,{args:[.53,.035,6,24]}),(0,K.jsx)(Q,{color:t})]})]}),r===`code`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`mesh`,{children:[(0,K.jsx)(`boxGeometry`,{args:[.75,.55,.12]}),(0,K.jsx)(Q,{color:t})]}),(0,K.jsxs)(`mesh`,{position:[-.16,0,.1],rotation:[0,0,-.55],children:[(0,K.jsx)(`boxGeometry`,{args:[.06,.32,.05]}),(0,K.jsx)(Q,{color:t})]}),(0,K.jsxs)(`mesh`,{position:[.16,0,.1],rotation:[0,0,.55],children:[(0,K.jsx)(`boxGeometry`,{args:[.06,.32,.05]}),(0,K.jsx)(Q,{color:t})]})]}),r===`knowledge`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`mesh`,{children:[(0,K.jsx)(`octahedronGeometry`,{args:[.46,0]}),(0,K.jsx)(Q,{color:t})]}),(0,K.jsxs)(`mesh`,{rotation:[Math.PI/2,0,0],children:[(0,K.jsx)(`torusGeometry`,{args:[.58,.025,6,6]}),(0,K.jsx)(Q,{color:t})]})]}),r===`communication`&&(0,K.jsx)(K.Fragment,{children:[.25,.42,.59].map(e=>(0,K.jsxs)(`mesh`,{rotation:[0,Math.PI/2,0],children:[(0,K.jsx)(`torusGeometry`,{args:[e,.025,5,20,Math.PI]}),(0,K.jsx)(Q,{color:t})]},e))}),r===`generic`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`mesh`,{children:[(0,K.jsx)(`icosahedronGeometry`,{args:[.4,0]}),(0,K.jsx)(Q,{color:t})]}),(0,K.jsxs)(`mesh`,{rotation:[Math.PI/2,0,0],children:[(0,K.jsx)(`torusGeometry`,{args:[.56,.025,5,24]}),(0,K.jsx)(Q,{color:t})]})]}),(0,K.jsx)(`pointLight`,{color:t,intensity:2.2,distance:4,decay:2})]})}var Lt=new w,Rt=new E,zt=new A,Bt=new w(0,1,0),Vt=new w(0,0,0),Ht={archived:{flap:0,intensity:.08,opacity:.12},idle:{flap:0,intensity:.45,opacity:.72},thinking:{flap:5,intensity:.85,opacity:.9},tool_call:{flap:8,intensity:1.05,opacity:1},stuck:{flap:2,intensity:.9,opacity:.95},disabled:{flap:0,intensity:.12,opacity:.06}};function Ut({desk:e,swarmRef:t}){let{agent:n,state:r,color:i}=e,a=H(e=>e.selectedAgentId===n.id),o=H(e=>e.select),s=H(e=>e.motion),c=H(e=>e.activeCue),l=(0,V.useRef)(null),u=(0,V.useRef)(null),d=(0,V.useRef)(null),f=(0,V.useRef)(null),p=(0,V.useRef)(null),m=(0,V.useRef)(null),h=(0,V.useMemo)(()=>new j({vertexShader:Nt,fragmentShader:Pt,uniforms:{uTime:{value:0},uColor:{value:new R(i)},uIntensity:{value:.65},uGlitch:{value:0},uOpacity:{value:.8}},transparent:!0,depthWrite:!1,side:2,blending:2}),[i]),g=(0,V.useMemo)(()=>new j({vertexShader:Nt,fragmentShader:Pt,uniforms:{uTime:{value:0},uColor:{value:new R(i).lerp(new R(`#ffffff`),.55)},uIntensity:{value:.9},uGlitch:{value:0},uOpacity:{value:.4}},transparent:!0,depthWrite:!1,side:2,blending:2}),[i]),_=(0,V.useMemo)(()=>new R(i),[i]);k((e,i)=>{let o=e.clock.elapsedTime,_=Ht[r],v=c?.actorId===n.id||c?.targetId===n.id,y=c&&!v&&!a?.28:1;h.uniforms.uTime.value=o,g.uniforms.uTime.value=o;let b=1-.002**i;h.uniforms.uIntensity.value+=(_.intensity-h.uniforms.uIntensity.value)*b,h.uniforms.uOpacity.value+=(_.opacity*y-h.uniforms.uOpacity.value)*b,g.uniforms.uOpacity.value+=(.4*y-g.uniforms.uOpacity.value)*b,h.uniforms.uGlitch.value+=(+(r===`stuck`)-h.uniforms.uGlitch.value)*b;let x=t.current.get(n.id);x&&l.current&&(l.current.position.copy(x.pos),u.current&&(Lt.subVectors(x.pos,x.prevPos),Lt.lengthSq()>1e-8&&(Rt.lookAt(Lt,Vt,Bt),zt.setFromRotationMatrix(Rt),u.current.quaternion.slerp(zt,1-.01**i))));let S=s===`calm`&&_.flap>0?Math.sin(o*_.flap)*.45+.2:.15;if(f.current&&(f.current.rotation.z=S),p.current&&(p.current.rotation.z=-S),m.current){let e=r===`disabled`||r===`archived`?0:r===`tool_call`?7:2.6;m.current.intensity+=(e-m.current.intensity)*b}if(d.current){let e=c?.phase===`delegated`&&c.targetId===n.id,t=c?.actorId===n.id&&(c.phase===`completed`||c.phase===`failed`),r=s===`calm`&&e?Math.sin(o*8.5)*.22:s===`calm`&&t?-.16:0;d.current.rotation.x=T.damp(d.current.rotation.x,r,7,i);let a=v&&s===`calm`?1.12:1,l=T.damp(d.current.scale.x,a,6,i);d.current.scale.setScalar(l)}});let v=e=>{e.stopPropagation(),o(a?null:n.id)},y=r===`tool_call`?Mt(e.currentTool):null;return(0,K.jsxs)(`group`,{ref:l,children:[(0,K.jsx)(`group`,{onClick:v,onPointerOver:e=>{e.stopPropagation(),document.body.style.cursor=`pointer`},onPointerOut:()=>{document.body.style.cursor=`auto`},children:(0,K.jsx)(Fe,{width:r===`idle`||r===`disabled`||r===`archived`?0:.65,length:2.2,color:_,attenuation:e=>e*e,children:(0,K.jsx)(`group`,{ref:u,scale:a?.85:.62,children:(0,K.jsxs)(`group`,{ref:d,children:[(0,K.jsx)(`mesh`,{material:h,scale:[.85,.75,1.35],children:(0,K.jsx)(`sphereGeometry`,{args:[.32,14,14]})}),(0,K.jsxs)(`mesh`,{position:[0,0,.1],children:[(0,K.jsx)(`torusGeometry`,{args:[.24,.045,8,20]}),(0,K.jsx)(`meshStandardMaterial`,{color:`#241804`,metalness:.4,roughness:.6})]}),(0,K.jsxs)(`mesh`,{position:[0,0,-.14],children:[(0,K.jsx)(`torusGeometry`,{args:[.22,.04,8,20]}),(0,K.jsx)(`meshStandardMaterial`,{color:`#241804`,metalness:.4,roughness:.6})]}),(0,K.jsx)(`mesh`,{material:h,position:[0,.03,.5],children:(0,K.jsx)(`sphereGeometry`,{args:[.18,12,12]})}),(0,K.jsx)(`mesh`,{material:h,position:[0,0,-.52],rotation:[-Math.PI/2,0,0],children:(0,K.jsx)(`coneGeometry`,{args:[.07,.22,8]})}),(0,K.jsx)(`mesh`,{ref:f,material:g,position:[.26,.24,.05],rotation:[.35,0,.5],scale:[1,.08,.55],children:(0,K.jsx)(`sphereGeometry`,{args:[.3,10,10]})}),(0,K.jsx)(`mesh`,{ref:p,material:g,position:[-.26,.24,.05],rotation:[.35,0,-.5],scale:[1,.08,.55],children:(0,K.jsx)(`sphereGeometry`,{args:[.3,10,10]})})]})})})}),(0,K.jsx)(`pointLight`,{ref:m,color:i,intensity:2.6,distance:8,decay:1.7}),r===`tool_call`&&(0,K.jsx)(It,{toolName:e.currentTool,color:i}),r===`thinking`&&(0,K.jsxs)(`mesh`,{position:[0,.95,0],rotation:[-Math.PI/2,0,0],children:[(0,K.jsx)(`ringGeometry`,{args:[.42,.52,6]}),(0,K.jsx)(`meshBasicMaterial`,{color:i,transparent:!0,opacity:.42,blending:2,depthWrite:!1})]}),r===`stuck`&&(0,K.jsxs)(`mesh`,{position:[0,1.05,0],rotation:[-Math.PI/2,0,0],children:[(0,K.jsx)(`ringGeometry`,{args:[.52,.68,6]}),(0,K.jsx)(`meshBasicMaterial`,{color:`#fb7185`,transparent:!0,opacity:.86,blending:2,depthWrite:!1})]}),e.currentTask&&(0,K.jsx)(W,{position:[0,1.55,0],center:!0,distanceFactor:17,className:`pointer-events-none select-none`,children:(0,K.jsxs)(`div`,{className:`office3d-task-chip`,style:{"--chip-color":i},children:[(0,K.jsx)(`span`,{className:`office3d-task-chip-prefix`,children:`◈`}),` `,e.currentTask]})}),y&&(0,K.jsx)(W,{position:[0,e.currentTask?1.05:1.3,0],center:!0,distanceFactor:17,className:`pointer-events-none select-none`,children:(0,K.jsx)(`div`,{className:`office3d-tool-chip`,style:{"--chip-color":i},children:y})}),(0,K.jsx)(W,{position:[0,-.85,0],center:!0,distanceFactor:16,className:`pointer-events-none select-none`,zIndexRange:[10,0],children:(0,K.jsxs)(`div`,{className:`office3d-name-plate ${a?`is-active`:``}`,style:{"--chip-color":i},children:[(0,K.jsx)(`span`,{className:`office3d-name-dot office3d-name-dot--${r}`}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`strong`,{children:n.name}),(0,K.jsx)(`small`,{children:n.description||`Agente especialista`})]})]})})]})}var Wt=new Set([`failed`,`aborted`,`review_failed`,`blocked`]);function Gt(e){return Wt.has(e)?4200:e===`completed`?3200:2800}function Kt(e){return Wt.has(e)}function qt(e,t){return e.some(e=>e.eventId===t.eventId)?e:(Kt(t.phase)?[t,...e]:[...e,t]).slice(0,3)}function Jt(e){switch(e){case`delegated`:return`Delegando trabajo`;case`review_passed`:return`Revisión aprobada`;case`review_failed`:return`Revisión no aprobada`;case`completed`:return`Entregando resultado`;case`failed`:return`Trabajo fallido`;case`aborted`:return`Trabajo interrumpido`;case`blocked`:return`Agente bloqueado`}}function Yt(e){return e===`failed`||e===`aborted`||e===`review_failed`?`alert`:e===`completed`||e===`review_passed`?`done`:`work`}var Xt=new w(0,4.4,0),Zt=2.25,Qt=0;function $t(e,t){let n=Yt(e.phase);return n===`alert`?`#fb7185`:n===`done`?`#86efac`:n===`review`?`#67e8f9`:t??`#f59e0b`}function en({desks:e,events:t,swarmRef:n,coordinatorId:r,coordinatorName:i}){let[a,o]=(0,V.useState)([]),s=(0,V.useRef)(new Set),c=(0,V.useRef)(!1);return(0,V.useEffect)(()=>{if(!c.current){t.forEach(e=>s.current.add(e.eventId)),c.current=!0;return}let n=new Map(e.map(e=>[e.agent.id,e])),a=e=>e===r?i:n.get(e)?.agent.name??`Agente`,l=[];for(let e of t){if(s.current.has(e.eventId))continue;s.current.add(e.eventId);let t=e.targetId||r;t&&l.push({id:++Qt,event:e,startId:e.actorId,endId:t,sourceName:a(e.actorId),targetName:a(t),color:$t(e,n.get(t)?.color??n.get(e.actorId)?.color)})}l.length>0&&o(e=>[...e,...l].slice(-8))},[r,i,e,t]),(0,K.jsx)(`group`,{children:a.map(e=>(0,K.jsx)(tn,{transfer:e,swarmRef:n,coordinatorId:r,onDone:()=>o(t=>t.filter(t=>t.id!==e.id))},e.id))})}function tn({transfer:e,swarmRef:t,coordinatorId:n,onDone:r}){let i=(0,V.useRef)(null),a=(0,V.useRef)(null),o=(0,V.useRef)(null),s=(0,V.useRef)(0),c=(0,V.useRef)(!1),l=(0,V.useRef)(new w),u=(0,V.useRef)(new w);k((d,f)=>{if(c.current||!i.current)return;s.current=Math.min(Zt,s.current+f);let p=e.startId===n?Xt:t.current.get(e.startId)?.pos,m=e.endId===n?Xt:t.current.get(e.endId)?.pos;if(!p||!m){i.current.visible=!1,s.current>=Zt&&(c.current=!0,r());return}i.current.visible=!0,l.current.copy(p),u.current.copy(m);let h=s.current/Zt,g=1-(1-Math.min(1,Math.max(0,(h-.14)/.86)))**3;if(i.current.position.lerpVectors(l.current,u.current,g),i.current.position.y+=Math.sin(g*Math.PI)*2.2,i.current.rotation.x+=f*2.4,i.current.rotation.y+=f*3.2,o.current?.position.copy(i.current.position),a.current){a.current.position.copy(l.current),a.current.visible=h<.46;let e=.8+h*5.2%1*1.35;a.current.scale.setScalar(e),a.current.rotation.y+=f*.8}s.current>=Zt&&(c.current=!0,r())});let d=e.event.phase===`delegated`?`${e.sourceName} llama a ${e.targetName}`:e.event.phase===`completed`?`${e.sourceName} entrega a ${e.targetName}`:`${e.sourceName} informa a ${e.targetName}`;return(0,K.jsxs)(`group`,{children:[(0,K.jsx)(`group`,{ref:a,children:[.72,1.08].map((t,n)=>(0,K.jsxs)(`mesh`,{rotation:[Math.PI/2,0,0],children:[(0,K.jsx)(`torusGeometry`,{args:[t,n===0?.055:.035,6,28]}),(0,K.jsx)(`meshBasicMaterial`,{color:e.color,transparent:!0,opacity:n===0?.72:.42,blending:2,depthWrite:!1})]},t))}),(0,K.jsxs)(`mesh`,{ref:i,children:[(0,K.jsx)(`octahedronGeometry`,{args:[.3,0]}),(0,K.jsx)(`meshBasicMaterial`,{color:e.color,transparent:!0,opacity:.98,blending:2,depthWrite:!1})]}),(0,K.jsx)(`group`,{ref:o,children:(0,K.jsx)(W,{position:[0,.75,0],center:!0,distanceFactor:20,className:`pointer-events-none select-none`,children:(0,K.jsxs)(`div`,{className:`office3d-transfer-label is-compact is-${Yt(e.event.phase)}`,style:{"--chip-color":e.color},children:[(0,K.jsx)(`span`,{children:d}),(0,K.jsx)(`strong`,{children:Jt(e.event.phase).toUpperCase()})]})})})]})}function nn({events:e,desks:t,coordinatorId:n}){let r=H(e=>e.setActiveCue),i=(0,V.useRef)(new Set),a=(0,V.useRef)(!1),o=(0,V.useRef)([]),s=(0,V.useRef)(null),c=(0,V.useRef)(null),l=(0,V.useRef)(new Map),u=(0,V.useRef)(!1),d=(0,V.useCallback)(function e(){if(s.current||o.current.length===0)return;let t=o.current.shift()??null;s.current=t,r(t),t&&(c.current=setTimeout(()=>{s.current=null,r(null),c.current=null,e()},Gt(t.phase)))},[r]),f=(0,V.useCallback)(e=>{Kt(e.phase)&&s.current&&!Kt(s.current.phase)&&(c.current&&clearTimeout(c.current),o.current=qt(o.current,s.current),s.current=null,r(null)),o.current=qt(o.current,e),d()},[d,r]);return(0,V.useEffect)(()=>{if(!a.current){e.forEach(e=>i.current.add(e.eventId)),a.current=!0;return}for(let t of e)i.current.has(t.eventId)||(i.current.add(t.eventId),f(t))},[e,f]),(0,V.useEffect)(()=>{if(!u.current){l.current=new Map(t.map(e=>[e.agent.id,e.state])),u.current=!0;return}for(let e of t){let t=l.current.get(e.agent.id);e.state===`stuck`&&t!==`stuck`&&f({eventId:`blocked:${e.agent.id}:${Date.now()}`,phase:`blocked`,taskRef:e.taskId??`agent:${e.agent.id}`,taskName:e.currentTask??`Ejecución del agente`,actorId:e.agent.id,targetId:n,detail:`El agente necesita atención`,timestamp:Date.now()}),l.current.set(e.agent.id,e.state)}},[n,t,f]),(0,V.useEffect)(()=>()=>{c.current&&clearTimeout(c.current),r(null)},[r]),null}function rn({desks:e,coordinator:t,interactions:n,workEvents:r}){let i=H(e=>e.quality),a=H(e=>e.setQuality),o=H(e=>e.motion),s=typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`off`:o,c=H(e=>e.selectedAgentId),l=H(e=>e.select),u=(0,V.useRef)(new Map),d=e.some(e=>e.state===`thinking`||e.state===`tool_call`||e.state===`stuck`);return(0,K.jsxs)(re,{dpr:i===`high`?[1,1.75]:1,gl:{antialias:!1,alpha:!1,powerPreference:`high-performance`},camera:{fov:42,near:.1,far:220,position:[0,46,62]},onPointerMissed:()=>l(null),children:[(0,K.jsx)(`color`,{attach:`background`,args:[`#04060c`]}),(0,K.jsx)(`fog`,{attach:`fog`,args:[`#04060c`,34,100]}),(0,K.jsx)(`ambientLight`,{intensity:.35}),(0,K.jsx)(`directionalLight`,{position:[12,24,8],intensity:.35,color:`#9db8ff`}),(0,K.jsxs)(V.Suspense,{fallback:null,children:[(0,K.jsx)(nn,{events:r,desks:e,coordinatorId:t?.id??null}),(0,K.jsx)(At,{desks:e,swarmRef:u,motion:s}),(0,K.jsx)(Ge,{coordinatorId:t?.id??null,selectedAgentId:c,swarmRef:u,motion:s}),(0,K.jsx)(Je,{}),(0,K.jsx)(it,{coordinator:t,active:d,swarmRef:u}),e.map(e=>(0,K.jsx)(Ut,{desk:e,swarmRef:u},e.agent.id)),(0,K.jsx)(mt,{desks:e,interactions:n,swarmRef:u,coordinatorId:t?.id??null}),s===`calm`&&(0,K.jsx)(en,{desks:e,events:r,swarmRef:u,coordinatorId:t?.id??null,coordinatorName:t?.name??`Coordinador`}),s===`calm`&&i===`high`&&(0,K.jsx)(Dt,{desks:e,swarmRef:u}),s===`calm`&&i===`high`&&(0,K.jsx)(Ct,{}),(0,K.jsx)(kt,{quality:i}),(0,K.jsx)(Le,{bounds:e=>[Math.min(42,e*.68),e*.92],onDecline:()=>{i===`high`&&a(`low`)}})]})]})}function an({events:e}){return(0,K.jsxs)(`div`,{className:`office3d-ticker`,children:[(0,K.jsx)(`div`,{className:`office3d-ticker-title`,children:`Actividad`}),(0,K.jsxs)(`div`,{className:`office3d-ticker-list`,role:`log`,"aria-live":`polite`,"aria-relevant":`additions`,children:[e.length===0&&(0,K.jsx)(`div`,{className:`office3d-ticker-empty`,children:`Sin eventos todavía…`}),e.slice(0,6).map(e=>(0,K.jsxs)(`div`,{className:`office3d-ticker-item office3d-ticker-item--${e.kind}`,children:[(0,K.jsx)(`span`,{className:`office3d-ticker-dot`,style:{background:e.color}}),(0,K.jsx)(`span`,{className:`office3d-ticker-text`,children:e.text}),(0,K.jsx)(`span`,{className:`office3d-ticker-time`,children:e.time})]},e.id))]})]})}var on=0;function sn(e,t){return t===`tool_call`&&!e.currentTask?{text:`${e.agent.name} · ${Mt(e.currentTool)??`Ejecutando herramienta`}`,color:e.color,kind:`work`}:t===`thinking`&&!e.currentTask?{text:`${e.agent.name} está pensando…`,color:e.color,kind:`info`}:t===`stuck`?{text:`${e.agent.name} necesita ayuda`,color:`#f87171`,kind:`warn`}:null}function cn(e,t,n,r){let[i,a]=(0,V.useState)([]),o=(0,V.useRef)(new Map),s=(0,V.useRef)(new Set),c=(0,V.useRef)(!1);return(0,V.useEffect)(()=>{let i=o.current,l=new Map(e.map(e=>[e.agent.id,e])),u=[],d=new Date().toLocaleTimeString(`es`,{hour12:!1}),f=e=>e===n?.id?n.name:l.get(e)?.agent.name??e;if(c.current)for(let e of r){if(s.current.has(e.eventId))continue;s.current.add(e.eventId);let t=Yt(e.phase);u.push({id:++on,time:new Date(e.timestamp).toLocaleTimeString(`es`,{hour12:!1}),text:`${Jt(e.phase)} · ${f(e.actorId)}${e.targetId?` → ${f(e.targetId)}`:``}: «${e.taskName}»`,color:t===`alert`?`#fb7185`:t===`done`?`#86efac`:l.get(e.targetId??``)?.color??`#f59e0b`,kind:t===`alert`?`warn`:t===`done`?`done`:`work`})}else{r.forEach(e=>s.current.add(e.eventId));for(let e of t)u.push({id:++on,time:d,text:`${f(e.sourceId)} → ${f(e.targetId)}: «${e.taskName??`Flujo activo`}»`,color:l.get(e.targetId)?.color??`#f59e0b`,kind:`work`});c.current=!0}for(let t of e){let e=i.get(t.agent.id);if(e&&e.state!==t.state){let e=sn(t,t.state);e&&u.push({id:++on,time:d,...e})}i.set(t.agent.id,{state:t.state})}u.length&&a(e=>[...u.reverse(),...e].slice(0,24))},[e,t,n,r]),i}var ln={archived:`Archivado manualmente`,disabled:`Desactivado`,idle:`En espera`,thinking:`Pensando`,tool_call:`Ejecutando herramienta`,stuck:`Atascado`};function un({desk:e,delegatorName:t}){let n=H(e=>e.select);if(!e)return null;let{agent:r}=e;return(0,K.jsxs)(`aside`,{className:`office3d-inspector`,style:{"--agent-color":e.color},children:[(0,K.jsx)(`button`,{type:`button`,className:`office3d-inspector-close`,onClick:()=>n(null),"aria-label":`Cerrar`,children:(0,K.jsx)(S,{size:14})}),(0,K.jsxs)(`div`,{className:`office3d-inspector-head`,children:[(0,K.jsx)(`span`,{className:`office3d-inspector-orb`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h3`,{className:`office3d-inspector-name`,children:r.name}),(0,K.jsx)(`span`,{className:`office3d-inspector-id`,children:r.id})]})]}),(0,K.jsxs)(`div`,{className:`office3d-inspector-row`,children:[(0,K.jsx)(`span`,{className:`office3d-inspector-label`,children:`Rol`}),(0,K.jsx)(`span`,{children:r.role===`coordinator`?`Coordinador`:`Especialista`})]}),(0,K.jsxs)(`div`,{className:`office3d-inspector-row`,children:[(0,K.jsx)(`span`,{className:`office3d-inspector-label`,children:`Estado`}),(0,K.jsx)(`span`,{className:`office3d-state-chip office3d-state-chip--${e.state}`,children:ln[e.state]})]}),e.currentTask&&(0,K.jsxs)(`div`,{className:`office3d-inspector-row`,children:[(0,K.jsx)(`span`,{className:`office3d-inspector-label`,children:`Tarea`}),(0,K.jsx)(`span`,{className:`office3d-inspector-task`,children:e.currentTask})]}),e.delegatedBy&&(0,K.jsxs)(`div`,{className:`office3d-inspector-row`,children:[(0,K.jsx)(`span`,{className:`office3d-inspector-label`,children:`Delegado por`}),(0,K.jsx)(`span`,{children:t})]}),e.currentTool&&(0,K.jsxs)(`div`,{className:`office3d-inspector-row`,children:[(0,K.jsx)(`span`,{className:`office3d-inspector-label`,children:`Herramienta`}),(0,K.jsx)(`span`,{className:`office3d-inspector-tool`,children:Mt(e.currentTool)})]}),(0,K.jsxs)(`div`,{className:`office3d-inspector-row`,children:[(0,K.jsx)(`span`,{className:`office3d-inspector-label`,children:`Workers`}),(0,K.jsx)(`span`,{className:`font-mono`,children:e.workerCount})]}),r.description&&(0,K.jsx)(`p`,{className:`office3d-inspector-desc`,children:r.description})]})}function dn({coordinator:e}){let t=H(e=>e.select);return e?(0,K.jsxs)(`aside`,{className:`office3d-inspector office3d-inspector--coordinator`,style:{"--agent-color":`#f59e0b`},children:[(0,K.jsx)(`button`,{type:`button`,className:`office3d-inspector-close`,onClick:()=>t(null),"aria-label":`Cerrar`,children:(0,K.jsx)(S,{size:14})}),(0,K.jsxs)(`div`,{className:`office3d-inspector-head`,children:[(0,K.jsx)(`span`,{className:`office3d-inspector-orb`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`office3d-inspector-eyebrow`,children:`Coordinador principal`}),(0,K.jsx)(`h3`,{className:`office3d-inspector-name`,children:e.name})]})]}),(0,K.jsxs)(`div`,{className:`office3d-inspector-row`,children:[(0,K.jsx)(`span`,{className:`office3d-inspector-label`,children:`Función`}),(0,K.jsx)(`span`,{children:`Asigna y supervisa`})]}),(0,K.jsxs)(`div`,{className:`office3d-inspector-row`,children:[(0,K.jsx)(`span`,{className:`office3d-inspector-label`,children:`Estado`}),(0,K.jsx)(`span`,{className:`office3d-state-chip office3d-state-chip--${e.status}`,children:e.status===`tool_call`?`Ejecutando herramienta`:e.status===`thinking`?`Pensando`:`En espera`})]}),typeof e.description==`string`&&(0,K.jsx)(`p`,{className:`office3d-inspector-desc`,children:e.description})]}):null}var fn={archived:`Archivado`,disabled:`Desactivado`,idle:`Disponible`,thinking:`Pensando`,tool_call:`Ejecutando`,stuck:`Necesita ayuda`};function pn(e){let t=e.agent.description?.trim();return t?t.length>62?`${t.slice(0,59)}…`:t:`Agente especialista`}function mn({coordinator:e,desks:t,interactions:n,workEvents:r}){let[i,a]=(0,V.useState)(!1),l=H(e=>e.selectedAgentId),u=H(e=>e.select),f=new Map(t.map(e=>[e.agent.id,e])),p=t=>t===e?.id?e.name:f.get(t)?.agent.name??t,m=new Map;for(let e of r)m.set(e.taskRef,e);return(0,K.jsxs)(`aside`,{className:`office3d-roster office3d-glass ${i?`is-collapsed`:``}`,"aria-label":`Equipo y flujo de trabajo`,children:[(0,K.jsxs)(`div`,{className:`office3d-roster-heading`,children:[(0,K.jsxs)(`div`,{className:`office3d-roster-title`,children:[(0,K.jsx)(`span`,{className:`office3d-section-kicker`,children:`CENTRO DE OPERACIONES`}),(0,K.jsx)(`h2`,{children:`Quién hace qué`})]}),(0,K.jsx)(`span`,{className:`office3d-roster-live`,"aria-label":`${n.length} flujos activos`,children:(0,K.jsx)(d,{size:15,className:n.length?`is-active`:``})}),(0,K.jsx)(`button`,{type:`button`,className:`office3d-roster-toggle`,onClick:()=>a(e=>!e),"aria-expanded":!i,"aria-label":i?`Abrir centro de operaciones`:`Colapsar centro de operaciones`,title:i?`Abrir centro de operaciones`:`Colapsar centro de operaciones`,children:i?(0,K.jsx)(s,{size:16}):(0,K.jsx)(c,{size:16})})]}),(0,K.jsxs)(`div`,{className:`office3d-roster-content`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`office3d-roster-coordinator ${l===e?.id?`is-selected`:``}`,onClick:()=>e&&u(l===e.id?null:e.id),disabled:!e,children:[(0,K.jsx)(se,{size:17}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`small`,{children:`ABEJA REINA · COORDINADOR`}),(0,K.jsx)(`strong`,{children:e?.name??`Conectando…`}),(0,K.jsx)(`em`,{children:`Asigna · supervisa · recibe`})]})]}),(0,K.jsxs)(`div`,{className:`office3d-flow`,children:[(0,K.jsxs)(`div`,{className:`office3d-section-title`,children:[`Flujo activo `,(0,K.jsx)(`span`,{children:n.length})]}),n.length===0?(0,K.jsx)(`p`,{className:`office3d-flow-empty`,children:`El equipo está disponible. Las delegaciones aparecerán aquí.`}):n.map(e=>{let t=f.get(e.targetId),n=e.taskId?m.get(e.taskId):null,r=n?.phase===`completed`||n?.phase===`review_passed`?3:e.kind===`reviews`?2:+(t?.state===`thinking`||t?.state===`tool_call`),i=n?.phase===`failed`||n?.phase===`aborted`||n?.phase===`review_failed`||n?.phase===`blocked`;return(0,K.jsxs)(`div`,{className:`office3d-flow-item ${i?`is-failed`:``}`,children:[(0,K.jsx)(`span`,{children:p(e.sourceId)}),(0,K.jsx)(o,{size:12}),(0,K.jsx)(`span`,{children:p(e.targetId)}),(0,K.jsx)(`strong`,{children:e.kind===`reviews`?`Revisión`:`Delegación`}),e.taskName&&(0,K.jsx)(`small`,{children:e.taskName}),(0,K.jsx)(`div`,{className:`office3d-flow-steps`,"aria-label":`Progreso del trabajo`,children:[`Delegado`,`Trabajando`,`Revisando`,i?`Atención`:`Entregado`].map((e,t)=>(0,K.jsx)(`span`,{className:`${t<r?`is-done`:``} ${t===r?`is-current`:``}`,children:e},e))})]},e.id)})]}),(0,K.jsxs)(`div`,{className:`office3d-agents-list`,children:[(0,K.jsxs)(`div`,{className:`office3d-section-title`,children:[`Especialistas `,(0,K.jsx)(`span`,{children:t.length})]}),t.map(e=>(0,K.jsxs)(`button`,{type:`button`,className:`office3d-agent-row ${l===e.agent.id?`is-selected`:``}`,onClick:()=>u(l===e.agent.id?null:e.agent.id),style:{"--agent-color":e.color},children:[(0,K.jsx)(`span`,{className:`office3d-agent-status office3d-name-dot--${e.state}`}),(0,K.jsxs)(`span`,{className:`office3d-agent-copy`,children:[(0,K.jsx)(`strong`,{children:e.agent.name}),(0,K.jsx)(`small`,{children:e.currentTask||pn(e)})]}),(0,K.jsx)(`em`,{children:fn[e.state]})]},e.agent.id))]})]})]})}function hn({coordinator:e,desks:t}){let n=H(e=>e.activeCue);if(!n)return null;let r=new Map(t.map(e=>[e.agent.id,e])),i=t=>t?t===e?.id?e.name:r.get(t)?.agent.name??`Agente`:e?.name??`Coordinador`,a=Yt(n.phase),o=a===`alert`?y:a===`done`?l:a===`review`?B:n.phase===`delegated`?f:d;return(0,K.jsxs)(`section`,{className:`office3d-now office3d-glass is-${a}`,"aria-live":a===`alert`?`assertive`:`polite`,"aria-atomic":`true`,children:[(0,K.jsx)(`div`,{className:`office3d-now-icon`,children:(0,K.jsx)(o,{size:17})}),(0,K.jsxs)(`div`,{className:`office3d-now-copy`,children:[(0,K.jsx)(`span`,{children:`AHORA OCURRE`}),(0,K.jsx)(`strong`,{children:Jt(n.phase)}),(0,K.jsxs)(`p`,{children:[i(n.actorId),(0,K.jsx)(`b`,{children:`→`}),i(n.targetId)]}),(0,K.jsx)(`small`,{children:n.taskName}),n.detail&&(0,K.jsx)(`em`,{children:n.detail})]})]})}var $=null;function gn(){if(!(typeof window>`u`))try{$??=new AudioContext,$.state===`suspended`&&$.resume()}catch{$=null}}var _n={delegated:[520,680],review_passed:[720,960],review_failed:[260,190],completed:[660,880],failed:[220,150],aborted:[280,210],blocked:[240,180]};function vn(e){if(gn(),!$||$.state!==`running`)return;let[t,n]=_n[e.phase],r=$.currentTime,i=$.createGain();i.gain.setValueAtTime(1e-4,r),i.gain.exponentialRampToValueAtTime(.045,r+.018),i.gain.exponentialRampToValueAtTime(1e-4,r+.34),i.connect($.destination);for(let[e,a]of[[t,0],[n,.12]]){let t=$.createOscillator();t.type=`sine`,t.frequency.setValueAtTime(e,r+a),t.connect(i),t.start(r+a),t.stop(r+a+.2)}}function yn({desks:e,coordinator:t,interactions:n,workEvents:r,isConnected:i,selectedDesk:o,coordinatorSelected:s,coordinatorName:c}){let l=H(e=>e.quality),d=H(e=>e.setQuality),f=H(e=>e.motion),_=H(e=>e.setMotion),v=H(e=>e.soundEnabled),y=H(e=>e.setSoundEnabled),b=cn(e,n,t,r),S=(0,V.useRef)(new Set),C=(0,V.useRef)(!1);(0,V.useEffect)(()=>{if(!C.current){r.forEach(e=>S.current.add(e.eventId)),C.current=!0;return}for(let e of r)S.current.has(e.eventId)||(S.current.add(e.eventId),v&&vn(e))},[v,r]);let w=e.filter(e=>e.state===`thinking`||e.state===`tool_call`).length,T=o?.delegatedBy?e.find(e=>e.agent.id===o.delegatedBy)?.agent.name??c:c;return(0,K.jsxs)(`div`,{className:`office3d-hud`,children:[(0,K.jsxs)(`header`,{className:`office3d-topbar office3d-glass`,children:[(0,K.jsxs)(`div`,{className:`office3d-topbar-left`,children:[(0,K.jsx)(`div`,{className:`office3d-logo`,children:(0,K.jsx)(x,{size:18})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h1`,{className:`office3d-title`,children:`HoloHive · Oficina 3D`}),(0,K.jsxs)(`p`,{className:`office3d-subtitle`,children:[e.length,` especialistas · `,w,` trabajando`]})]})]}),(0,K.jsxs)(`div`,{className:`office3d-topbar-right`,children:[(0,K.jsxs)(`span`,{className:`office3d-live-badge ${i?`is-live`:`is-off`}`,children:[i?(0,K.jsx)(g,{size:12}):(0,K.jsx)(h,{size:12}),i?`LIVE`:`OFFLINE`]}),(0,K.jsxs)(`button`,{type:`button`,className:`office3d-hud-btn`,onClick:()=>d(l===`high`?`low`:`high`),title:`Alternar calidad gráfica`,children:[(0,K.jsx)(u,{size:13}),l===`high`?`Alta`:`Eco`]}),(0,K.jsxs)(`button`,{type:`button`,className:`office3d-hud-btn ${f===`calm`?`is-on`:``}`,onClick:()=>_(f===`calm`?`off`:`calm`),title:`Alternar enfoque y movimiento de eventos`,children:[(0,K.jsx)(a,{size:13}),f===`calm`?`Enfoque`:`Fijo`]}),(0,K.jsxs)(`button`,{type:`button`,className:`office3d-hud-btn ${v?`is-on`:``}`,onClick:()=>{v||gn(),y(!v)},title:v?`Desactivar sonido de eventos`:`Activar sonido de eventos`,"aria-pressed":v,children:[v?(0,K.jsx)(p,{size:13}):(0,K.jsx)(m,{size:13}),v?`Audio`:`Silencio`]})]})]}),(0,K.jsx)(hn,{coordinator:t,desks:e}),(0,K.jsx)(mn,{coordinator:t,desks:e,interactions:n,workEvents:r}),(0,K.jsx)(`div`,{className:`office3d-bottom-left`,children:(0,K.jsx)(an,{events:b})}),(0,K.jsx)(un,{desk:o,delegatorName:T}),s&&(0,K.jsx)(dn,{coordinator:t})]})}function bn(){let{coordinator:e,desks:t,interactions:n,workEvents:r,isConnected:i}=ce(),a=H(e=>e.selectedAgentId),o=t.find(e=>e.agent.id===a)??null,s=!!e&&a===e.id,c=e?.name??`Coordinador`;return(0,K.jsxs)(`div`,{className:`office3d-root`,children:[(0,K.jsx)(rn,{desks:t,coordinator:e??null,interactions:n,workEvents:r}),(0,K.jsx)(yn,{desks:t,coordinator:e??null,interactions:n,workEvents:r,isConnected:i,selectedDesk:o,coordinatorSelected:s,coordinatorName:c})]})}export{bn as default};
|