@johpaz/hive-agents 0.0.28 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/README.md +27 -17
  2. package/dist/hive.js +11349 -12001
  3. package/dist/ui/assets/AgentCreateForm-BmRLLGIL.js +1 -0
  4. package/dist/ui/assets/AgentDetailPage-BOVOgECU.js +1 -0
  5. package/dist/ui/assets/AgentNewPage-BCMuhksF.js +1 -0
  6. package/dist/ui/assets/AgentsPage-BYGTwib8.js +10 -0
  7. package/dist/ui/assets/BridgePage-CEMpmdql.js +1 -0
  8. package/dist/ui/assets/CanvasPage-Dcmx4S1-.js +33 -0
  9. package/dist/ui/assets/ChannelsPage-B_PiavjN.js +8 -0
  10. package/dist/ui/assets/DashboardPage-sSu1NU7V.js +6 -0
  11. package/dist/ui/assets/LoginPage-D1kejzak.js +1 -0
  12. package/dist/ui/assets/LogsPage-CaD4OOff.js +1 -0
  13. package/dist/ui/assets/MeetingPage-C0iKxHOI.js +1 -0
  14. package/dist/ui/assets/NotFound-CBnwE5nh.js +1 -0
  15. package/dist/ui/assets/ProjectsPage-DGliWwpu.js +1 -0
  16. package/dist/ui/assets/ProvidersPage-_O0WMMVK.js +1 -0
  17. package/dist/ui/assets/RecoverPage-DVESenp8.js +1 -0
  18. package/dist/ui/assets/SettingsPage-BKCZqIq2.js +9 -0
  19. package/dist/ui/assets/SetupPage-IjKq_kLj.js +1 -0
  20. package/dist/ui/assets/WebChatPage-D-zO53Yt.js +16 -0
  21. package/dist/ui/assets/accordion-_sozXeaB.js +1 -0
  22. package/dist/ui/assets/activity-BB8JBT7a.js +1 -0
  23. package/dist/ui/assets/alert-Bgqky__w.js +1 -0
  24. package/dist/ui/assets/alert-dialog-B12geoBt.js +1 -0
  25. package/dist/ui/assets/arrow-left-WQsWOWW_.js +1 -0
  26. package/dist/ui/assets/badge-BY-VUaxL.js +1 -0
  27. package/dist/ui/assets/calendar-D_GHXR8q.js +1 -0
  28. package/dist/ui/assets/card-CE_kGxdL.js +1 -0
  29. package/dist/ui/assets/chevron-down-DLfCQOQA.js +1 -0
  30. package/dist/ui/assets/chevron-left-5XF9hbEm.js +1 -0
  31. package/dist/ui/assets/chevron-right-B60x0b2L.js +1 -0
  32. package/dist/ui/assets/chevron-up-GfewdYph.js +1 -0
  33. package/dist/ui/assets/circle-DLFOVgkH.js +1 -0
  34. package/dist/ui/assets/circle-alert-Qf59MV-u.js +1 -0
  35. package/dist/ui/assets/circle-check-BhwUUu4Z.js +1 -0
  36. package/dist/ui/assets/circle-minus-BcF7EW2K.js +1 -0
  37. package/dist/ui/assets/circle-x-C55wB-DP.js +1 -0
  38. package/dist/ui/assets/cpu-BxFtjoPn.js +1 -0
  39. package/dist/ui/assets/dialog-CWlGzRqi.js +1 -0
  40. package/dist/ui/assets/download-DRO1cmbw.js +1 -0
  41. package/dist/ui/assets/dropdown-menu-CdulmYlU.js +1 -0
  42. package/dist/ui/assets/es-JYPdzK5t.js +1 -0
  43. package/dist/ui/assets/external-link-BULKsDvk.js +1 -0
  44. package/dist/ui/assets/eye-SOUMoM2-.js +1 -0
  45. package/dist/ui/assets/file-text-CxAwK_Ze.js +1 -0
  46. package/dist/ui/assets/folder-open-BnXDc8BG.js +1 -0
  47. package/dist/ui/assets/format-CR2WWfql.js +1 -0
  48. package/dist/ui/assets/gauge-DYmZYnET.js +1 -0
  49. package/dist/ui/assets/globe-C7sirxEy.js +1 -0
  50. package/dist/ui/assets/hexagon-BGGuDxI7.js +1 -0
  51. package/dist/ui/assets/history-vA8Y7XQq.js +1 -0
  52. package/dist/ui/assets/index-9GZvkGGW.css +2 -0
  53. package/dist/ui/assets/index-B4lS14UW.js +116 -0
  54. package/dist/ui/assets/info-CFGdNsZs.js +1 -0
  55. package/dist/ui/assets/key-DFIqRGXl.js +1 -0
  56. package/dist/ui/assets/label-CplWBwSz.js +1 -0
  57. package/dist/ui/assets/loader-circle-BaadtldT.js +1 -0
  58. package/dist/ui/assets/lock-DUwqtzEo.js +1 -0
  59. package/dist/ui/assets/pause-BsToEchU.js +1 -0
  60. package/dist/ui/assets/play-Rmf5Px63.js +1 -0
  61. package/dist/ui/assets/plus-CqJyiQvM.js +1 -0
  62. package/dist/ui/assets/progress-CFpWXmru.js +1 -0
  63. package/dist/ui/assets/refresh-cw-Yf5FGfA5.js +1 -0
  64. package/dist/ui/assets/save-Diu387yr.js +1 -0
  65. package/dist/ui/assets/scroll-area-B3bGhGnD.js +1 -0
  66. package/dist/ui/assets/search-CnhAnemg.js +1 -0
  67. package/dist/ui/assets/send-CU73wLDC.js +1 -0
  68. package/dist/ui/assets/settings-OcD7AWkq.js +1 -0
  69. package/dist/ui/assets/slider-B7ibzqE3.js +14 -0
  70. package/dist/ui/assets/sparkles-Dnx_Tpre.js +1 -0
  71. package/dist/ui/assets/square-PyIpnS-W.js +1 -0
  72. package/dist/ui/assets/switch-CQf9jQKN.js +1 -0
  73. package/dist/ui/assets/table-CN6cGA9v.js +1 -0
  74. package/dist/ui/assets/terminal-CNLY74vg.js +1 -0
  75. package/dist/ui/assets/textarea-CPuZn8Rg.js +1 -0
  76. package/dist/ui/assets/trash-2-CUqHaFaC.js +1 -0
  77. package/dist/ui/assets/triangle-alert-vUtWDfZd.js +1 -0
  78. package/dist/ui/assets/useProviders-77fYN2hY.js +1 -0
  79. package/dist/ui/assets/vendor-charts-Bu2lyBKP.js +65 -0
  80. package/dist/ui/assets/vendor-query-DsWPbQdG.js +1 -0
  81. package/dist/ui/assets/vendor-radix-JY4ncZrD.js +63 -0
  82. package/dist/ui/assets/vendor-react-CscwQerf.js +1 -0
  83. package/dist/ui/assets/vendor-router-4QM6Fwg6.js +3 -0
  84. package/dist/ui/assets/volume-2-B8dkjcEZ.js +1 -0
  85. package/dist/ui/assets/wifi-DK-RxSqc.js +1 -0
  86. package/dist/ui/assets/zap-BD57u2UH.js +1 -0
  87. package/dist/ui/dist/assets/AgentCreateForm-BmRLLGIL.js +1 -0
  88. package/dist/ui/dist/assets/AgentDetailPage-BOVOgECU.js +1 -0
  89. package/dist/ui/dist/assets/AgentNewPage-BCMuhksF.js +1 -0
  90. package/dist/ui/dist/assets/AgentsPage-BYGTwib8.js +10 -0
  91. package/dist/ui/dist/assets/BridgePage-CEMpmdql.js +1 -0
  92. package/dist/ui/dist/assets/CanvasPage-Dcmx4S1-.js +33 -0
  93. package/dist/ui/dist/assets/ChannelsPage-B_PiavjN.js +8 -0
  94. package/dist/ui/dist/assets/DashboardPage-sSu1NU7V.js +6 -0
  95. package/dist/ui/dist/assets/LoginPage-D1kejzak.js +1 -0
  96. package/dist/ui/dist/assets/LogsPage-CaD4OOff.js +1 -0
  97. package/dist/ui/dist/assets/MeetingPage-C0iKxHOI.js +1 -0
  98. package/dist/ui/dist/assets/NotFound-CBnwE5nh.js +1 -0
  99. package/dist/ui/dist/assets/ProjectsPage-DGliWwpu.js +1 -0
  100. package/dist/ui/dist/assets/ProvidersPage-_O0WMMVK.js +1 -0
  101. package/dist/ui/dist/assets/RecoverPage-DVESenp8.js +1 -0
  102. package/dist/ui/dist/assets/SettingsPage-BKCZqIq2.js +9 -0
  103. package/dist/ui/dist/assets/SetupPage-IjKq_kLj.js +1 -0
  104. package/dist/ui/dist/assets/WebChatPage-D-zO53Yt.js +16 -0
  105. package/dist/ui/dist/assets/accordion-_sozXeaB.js +1 -0
  106. package/dist/ui/dist/assets/activity-BB8JBT7a.js +1 -0
  107. package/dist/ui/dist/assets/alert-Bgqky__w.js +1 -0
  108. package/dist/ui/dist/assets/alert-dialog-B12geoBt.js +1 -0
  109. package/dist/ui/dist/assets/arrow-left-WQsWOWW_.js +1 -0
  110. package/dist/ui/dist/assets/badge-BY-VUaxL.js +1 -0
  111. package/dist/ui/dist/assets/calendar-D_GHXR8q.js +1 -0
  112. package/dist/ui/dist/assets/card-CE_kGxdL.js +1 -0
  113. package/dist/ui/dist/assets/chevron-down-DLfCQOQA.js +1 -0
  114. package/dist/ui/dist/assets/chevron-left-5XF9hbEm.js +1 -0
  115. package/dist/ui/dist/assets/chevron-right-B60x0b2L.js +1 -0
  116. package/dist/ui/dist/assets/chevron-up-GfewdYph.js +1 -0
  117. package/dist/ui/dist/assets/circle-DLFOVgkH.js +1 -0
  118. package/dist/ui/dist/assets/circle-alert-Qf59MV-u.js +1 -0
  119. package/dist/ui/dist/assets/circle-check-BhwUUu4Z.js +1 -0
  120. package/dist/ui/dist/assets/circle-minus-BcF7EW2K.js +1 -0
  121. package/dist/ui/dist/assets/circle-x-C55wB-DP.js +1 -0
  122. package/dist/ui/dist/assets/cpu-BxFtjoPn.js +1 -0
  123. package/dist/ui/dist/assets/dialog-CWlGzRqi.js +1 -0
  124. package/dist/ui/dist/assets/download-DRO1cmbw.js +1 -0
  125. package/dist/ui/dist/assets/dropdown-menu-CdulmYlU.js +1 -0
  126. package/dist/ui/dist/assets/es-JYPdzK5t.js +1 -0
  127. package/dist/ui/dist/assets/external-link-BULKsDvk.js +1 -0
  128. package/dist/ui/dist/assets/eye-SOUMoM2-.js +1 -0
  129. package/dist/ui/dist/assets/file-text-CxAwK_Ze.js +1 -0
  130. package/dist/ui/dist/assets/folder-open-BnXDc8BG.js +1 -0
  131. package/dist/ui/dist/assets/format-CR2WWfql.js +1 -0
  132. package/dist/ui/dist/assets/gauge-DYmZYnET.js +1 -0
  133. package/dist/ui/dist/assets/globe-C7sirxEy.js +1 -0
  134. package/dist/ui/dist/assets/hexagon-BGGuDxI7.js +1 -0
  135. package/dist/ui/dist/assets/history-vA8Y7XQq.js +1 -0
  136. package/dist/ui/dist/assets/index-9GZvkGGW.css +2 -0
  137. package/dist/ui/dist/assets/index-B4lS14UW.js +116 -0
  138. package/dist/ui/dist/assets/info-CFGdNsZs.js +1 -0
  139. package/dist/ui/dist/assets/key-DFIqRGXl.js +1 -0
  140. package/dist/ui/dist/assets/label-CplWBwSz.js +1 -0
  141. package/dist/ui/dist/assets/loader-circle-BaadtldT.js +1 -0
  142. package/dist/ui/dist/assets/lock-DUwqtzEo.js +1 -0
  143. package/dist/ui/dist/assets/pause-BsToEchU.js +1 -0
  144. package/dist/ui/dist/assets/play-Rmf5Px63.js +1 -0
  145. package/dist/ui/dist/assets/plus-CqJyiQvM.js +1 -0
  146. package/dist/ui/dist/assets/progress-CFpWXmru.js +1 -0
  147. package/dist/ui/dist/assets/refresh-cw-Yf5FGfA5.js +1 -0
  148. package/dist/ui/dist/assets/save-Diu387yr.js +1 -0
  149. package/dist/ui/dist/assets/scroll-area-B3bGhGnD.js +1 -0
  150. package/dist/ui/dist/assets/search-CnhAnemg.js +1 -0
  151. package/dist/ui/dist/assets/send-CU73wLDC.js +1 -0
  152. package/dist/ui/dist/assets/settings-OcD7AWkq.js +1 -0
  153. package/dist/ui/dist/assets/slider-B7ibzqE3.js +14 -0
  154. package/dist/ui/dist/assets/sparkles-Dnx_Tpre.js +1 -0
  155. package/dist/ui/dist/assets/square-PyIpnS-W.js +1 -0
  156. package/dist/ui/dist/assets/switch-CQf9jQKN.js +1 -0
  157. package/dist/ui/dist/assets/table-CN6cGA9v.js +1 -0
  158. package/dist/ui/dist/assets/terminal-CNLY74vg.js +1 -0
  159. package/dist/ui/dist/assets/textarea-CPuZn8Rg.js +1 -0
  160. package/dist/ui/dist/assets/trash-2-CUqHaFaC.js +1 -0
  161. package/dist/ui/dist/assets/triangle-alert-vUtWDfZd.js +1 -0
  162. package/dist/ui/dist/assets/useProviders-77fYN2hY.js +1 -0
  163. package/dist/ui/dist/assets/vendor-charts-Bu2lyBKP.js +65 -0
  164. package/dist/ui/dist/assets/vendor-query-DsWPbQdG.js +1 -0
  165. package/dist/ui/dist/assets/vendor-radix-JY4ncZrD.js +63 -0
  166. package/dist/ui/dist/assets/vendor-react-CscwQerf.js +1 -0
  167. package/dist/ui/dist/assets/vendor-router-4QM6Fwg6.js +3 -0
  168. package/dist/ui/dist/assets/volume-2-B8dkjcEZ.js +1 -0
  169. package/dist/ui/dist/assets/wifi-DK-RxSqc.js +1 -0
  170. package/dist/ui/dist/assets/zap-BD57u2UH.js +1 -0
  171. package/dist/ui/dist/index.html +30 -25
  172. package/dist/ui/index.html +30 -25
  173. package/package.json +3 -5
  174. package/dist/ui/assets/index-BPhhlVgu.js +0 -344
  175. package/dist/ui/assets/index-D-gAnNFM.css +0 -2
  176. package/dist/ui/assets/react-C63RN3Ve.js +0 -1
  177. package/dist/ui/assets/ui-CHpVij2M.css +0 -1
  178. package/dist/ui/assets/ui-Cw_eF3wo.js +0 -22
  179. package/dist/ui/dist/assets/index-BPhhlVgu.js +0 -344
  180. package/dist/ui/dist/assets/index-D-gAnNFM.css +0 -2
  181. package/dist/ui/dist/assets/react-C63RN3Ve.js +0 -1
  182. package/dist/ui/dist/assets/ui-CHpVij2M.css +0 -1
  183. package/dist/ui/dist/assets/ui-Cw_eF3wo.js +0 -22
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{_ as t}from"./vendor-charts-Bu2lyBKP.js";import{o as n}from"./vendor-query-DsWPbQdG.js";import{a as r,c as i,l as a,n as o,r as s,s as c,t as l}from"./switch-CQf9jQKN.js";import{t as u}from"./circle-alert-Qf59MV-u.js";import{t as d}from"./cpu-BxFtjoPn.js";import{t as f}from"./external-link-BULKsDvk.js";import{t as p}from"./folder-open-BnXDc8BG.js";import{t as m}from"./loader-circle-BaadtldT.js";import{t as h}from"./save-Diu387yr.js";import{n as g,t as _}from"./textarea-CPuZn8Rg.js";import{t as v}from"./sparkles-Dnx_Tpre.js";import{B as y,H as b,N as x,P as S,f as C,m as w,s as T,t as E}from"./index-B4lS14UW.js";import{t as D}from"./label-CplWBwSz.js";import{a as O,c as k,i as ee,n as A,o as j,r as M,s as N,t as P}from"./dialog-CWlGzRqi.js";import{t as F}from"./badge-BY-VUaxL.js";import{a as I,n as L,o as R,r as z,t as B}from"./card-CE_kGxdL.js";import"./useProviders-77fYN2hY.js";var V=e(t(),1),H=n();function U({selectedProviderId:e,selectedModelId:t,onProviderChange:n,onModelChange:a,disabled:l=!1,typeFilter:u}){let{providers:d,models:f}=T(),p=e=>{if(e.id===`ollama`)return!0;let t=e.base_url||e.baseUrl||``;return t.includes(`localhost`)||t.includes(`127.0.0.1`)?!0:!!e.has_api_key},m=e=>{if(e.id===`ollama`)return!0;let t=e.base_url||e.baseUrl||``;return t.includes(`localhost`)||t.includes(`127.0.0.1`)},h=d.filter(e=>(e.enabled||e.active)&&p(e)),g=d.find(t=>t.id===e),_=!!g&&!h.some(e=>e.id===g.id),v=(0,V.useMemo)(()=>e?f.filter(t=>{let n=(t.provider_id||t.providerId)===e,r=!u||t.model_type===u;return n&&r}):[],[e,f,u]),y=(0,V.useMemo)(()=>v.filter(e=>e.enabled||e.active),[v]),b=v.find(e=>e.id===t),x=!!b&&!y.some(e=>e.id===b.id);(0,V.useEffect)(()=>{t&&v.length>0&&!v.find(e=>e.id===t)&&a(``)},[v,t,a]);let S=e=>{if(!e)return[];try{return JSON.parse(e)}catch{return[]}};return(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(D,{htmlFor:`provider`,children:`Proveedor de IA`}),(0,H.jsxs)(o,{value:e||``,onValueChange:n,disabled:l||h.length===0,children:[(0,H.jsx)(c,{id:`provider`,className:`w-full`,children:(0,H.jsx)(i,{placeholder:`Selecciona un proveedor`,children:e&&g?(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{children:g.name}),_&&(0,H.jsx)(`span`,{className:`text-[10px] text-amber-400/80`,children:`(inactivo)`}),m(g)?(0,H.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,H.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,H.jsx)(s,{children:h.length===0?(0,H.jsx)(r,{value:`none`,disabled:!0,children:`No hay proveedores configurados`}):h.map(e=>(0,H.jsx)(r,{value:e.id,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{children:e.name}),m(e)?(0,H.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,H.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))})]}),_&&g&&(0,H.jsxs)(`p`,{className:`text-[10px] text-amber-400/80`,children:[`El proveedor "`,g.name,`" está inactivo. Selecciona uno activo para cambiar.`]}),h.length===0&&(0,H.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Configura un proveedor en`,` `,(0,H.jsx)(`a`,{href:`/providers`,className:`text-primary underline`,children:`Settings > Providers`})]})]}),e&&(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(D,{htmlFor:`model`,children:`Modelo`}),(0,H.jsxs)(o,{value:t||``,onValueChange:a,disabled:l||y.length===0,children:[(0,H.jsx)(c,{id:`model`,className:`w-full`,children:(0,H.jsx)(i,{placeholder:`Selecciona un modelo`,children:t&&b?(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{children:b.name}),x&&(0,H.jsx)(`span`,{className:`text-[10px] text-amber-400/80`,children:`(inactivo)`})]}):`Selecciona un modelo`})}),(0,H.jsx)(s,{children:y.length===0?(0,H.jsx)(r,{value:`none`,disabled:!0,children:`No hay modelos disponibles`}):y.map(e=>(0,H.jsx)(r,{value:e.id,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{children:e.name}),e.contextWindow&&(0,H.jsxs)(F,{variant:`secondary`,className:`text-[10px]`,children:[(e.contextWindow/1e3).toFixed(0),`K ctx`]})]})},e.id))})]}),x&&b&&(0,H.jsxs)(`p`,{className:`text-[10px] text-amber-400/80`,children:[`El modelo "`,b.name,`" está inactivo. Selecciona uno activo para cambiar.`]}),t&&v.find(e=>e.id===t)&&(0,H.jsx)(B,{className:`mt-2`,children:(0,H.jsxs)(L,{className:`p-3 space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-sm font-medium`,children:v.find(e=>e.id===t)?.name}),(0,H.jsx)(F,{variant:`outline`,children:d.find(t=>t.id===e)?.name})]}),(()=>{let e=S(v.find(e=>e.id===t)?.capabilities);return e.length>0?(0,H.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.slice(0,5).map(e=>(0,H.jsx)(F,{variant:`secondary`,className:`text-[10px]`,children:e},e))}):null})()]})})]})]})}var W=[{value:`friendly`,label:`Amigable`},{value:`professional`,label:`Profesional`},{value:`casual`,label:`Casual`},{value:`formal`,label:`Formal`},{value:`creative`,label:`Creativo`}];function G({initialData:e,onSuccess:t,onCancel:n}){let{createAgent:F,updateAgent:G,isLoading:K,error:q}=E(),{activeProviders:te}=T(),[J,Y]=(0,V.useState)({isValidating:!1,exists:!1,accessible:!1}),[X,Z]=(0,V.useState)({name:``,description:``,tone:`professional`,provider_id:``,model_id:``,role:`coordinator`,enabled:!0,systemPrompt:``,workspace:e?.workspace||``});(0,V.useEffect)(()=>{e&&Z({...e,provider_id:e.provider_id||e.providerId||``,model_id:e.model_id||e.modelId||``})},[e]);let Q=async e=>{if(!e||e.trim()===``){Y({isValidating:!1,exists:!1,accessible:!1});return}Y({isValidating:!0,exists:!1,accessible:!1});try{let t=await C(`/api/workspace/validate`,{method:`POST`,body:{path:e}});Y({isValidating:!1,exists:t.exists,accessible:t.accessible,error:t.error,message:t.message})}catch(e){Y({isValidating:!1,exists:!1,accessible:!1,error:e.message})}},ne=async()=>{if(X.workspace)try{await C(`/api/workspace/create`,{method:`POST`,body:{path:X.workspace},showLoader:`Creando directorio...`,showSuccess:`Directorio creado exitosamente`}),await Q(X.workspace)}catch(e){w.fire(`Error`,e.message,`error`)}},re=async()=>{if(X.workspace)try{await C(`/api/workspace/open?path=${encodeURIComponent(X.workspace)}`,{method:`GET`})}catch(e){w.fire(`Error`,e.message,`error`)}},ie=async n=>{if(n.preventDefault(),!X.provider_id||!X.model_id){w.fire(`Incompleto`,`Por favor selecciona un proveedor y modelo`,`warning`);return}try{e?.id?await G(e.id,X):await F(X),t&&t()}catch(e){console.error(e)}},$=!!e?.id;return(0,H.jsxs)(B,{className:`hive-card--form group`,children:[(0,H.jsx)(`div`,{className:`hive-glow-blob--card absolute -top-24 -right-24 h-48 w-48 bg-blue-600/10 group-hover:bg-blue-600/20`,style:{borderRadius:`50%`,filter:`blur(80px)`}}),(0,H.jsx)(I,{className:`relative`,children:(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`div`,{className:`hive-icon-wrap hive-icon-wrap--primary`,children:$?(0,H.jsx)(h,{className:`h-5 w-5`}):(0,H.jsx)(v,{className:`h-5 w-5`})}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(R,{className:`text-xl font-bold text-white/90`,children:$?`Configurar Nodo`:`Desplegar Nuevo Nodo`}),(0,H.jsx)(z,{className:`text-white/40`,children:$?`Ajusta los parámetros de tu agente inteligente.`:`Crea una nueva entidad inteligente para tu colmena.`})]})]}),n&&(0,H.jsx)(S,{variant:`ghost`,size:`icon`,onClick:n,className:`text-white/40 hover:text-white hover:bg-white/5`,children:(0,H.jsx)(b,{className:`h-5 w-5`})})]})}),(0,H.jsx)(L,{className:`relative space-y-6 pt-2`,children:(0,H.jsxs)(`form`,{onSubmit:ie,className:`space-y-8`,children:[(0,H.jsxs)(`div`,{className:`grid gap-6`,children:[(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(D,{htmlFor:`name`,className:`hive-label--field`,children:`Nombre del Agente`}),(0,H.jsx)(x,{id:`name`,placeholder:`Ej: Analista de Mercado`,className:`hive-input`,value:X.name,onChange:e=>Z({...X,name:e.target.value}),disabled:K,required:!0})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(D,{htmlFor:`description`,className:`hive-label--field`,children:`Descripción / Rol`}),(0,H.jsx)(_,{id:`description`,placeholder:`Describe qué hace este agente y cuáles son sus objetivos...`,className:`hive-textarea`,value:X.description,onChange:e=>Z({...X,description:e.target.value}),disabled:K})]})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(D,{htmlFor:`systemPrompt`,className:`hive-label--field`,children:`System Prompt`}),(0,H.jsxs)(P,{children:[(0,H.jsx)(k,{asChild:!0,children:(0,H.jsx)(S,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-3 text-xs bg-blue-500/10 hover:bg-blue-500/20 text-blue-400 border-blue-500/30 transition-colors`,children:`Modifica acá el System Prompt`})}),(0,H.jsxs)(M,{className:`sm:max-w-3xl bg-[#0a0a0c] border-white/10 text-white shadow-2xl [&>button]:text-white/50 hover:[&>button]:text-white`,children:[(0,H.jsxs)(j,{children:[(0,H.jsx)(N,{className:`text-xl`,children:`Editar System Prompt`}),(0,H.jsx)(ee,{className:`text-sm text-white/50`,children:`El prompt base de comportamiento del agente. Se recomienda formato Markdown.`})]}),(0,H.jsx)(`div`,{className:`py-2`,children:(0,H.jsx)(_,{value:X.systemPrompt||``,onChange:e=>Z({...X,systemPrompt:e.target.value}),className:`min-h-[400px] font-mono text-sm bg-black/40 border-white/10 text-white/90 focus-visible:ring-blue-500/50 resize-y`,placeholder:`Escribe el system prompt detallado aquí...`,disabled:K})}),(0,H.jsx)(O,{children:(0,H.jsx)(A,{asChild:!0,children:(0,H.jsx)(S,{type:`button`,className:`bg-blue-600 hover:bg-blue-500 text-white shadow-[0_0_15px_rgba(37,99,235,0.3)]`,children:`Guardar Cambios`})})})]})]})]}),X.systemPrompt?(0,H.jsxs)(`p`,{className:`text-xs text-white/40 line-clamp-1 italic border border-white/5 bg-white/[0.02] p-2 rounded-md`,children:[`"`,X.systemPrompt,`"`]}):(0,H.jsx)(`p`,{className:`text-xs text-white/30 italic`,children:`Sin system prompt configurado...`})]}),(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,H.jsx)(p,{className:`h-4 w-4 text-emerald-400`}),(0,H.jsx)(`h3`,{className:`hive-title-section`,children:`Workspace Directory`})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(D,{htmlFor:`workspace`,className:`hive-label--field`,children:`Directorio de Trabajo del Agente`}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(x,{id:`workspace`,placeholder:`Ej: /home/user/proyectos, D:\\Work, /Volumes/USB`,className:`hive-input flex-1 font-mono text-sm`,value:X.workspace,onChange:e=>{Z({...X,workspace:e.target.value}),Q(e.target.value)},disabled:K}),X.workspace&&J.exists&&J.accessible&&(0,H.jsx)(S,{type:`button`,variant:`outline`,size:`icon`,onClick:re,className:`shrink-0 border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10`,title:`Abrir en el explorador`,children:(0,H.jsx)(f,{className:`h-4 w-4`})})]}),(0,H.jsx)(`p`,{className:`text-xs text-white/40 leading-relaxed`,children:`Directorio donde el agente creará archivos, carpetas y ejecutará comandos. Puede ser cualquier ubicación en tu sistema (disco duro, USB, red, etc.).`}),X.workspace&&X.workspace.trim()!==``&&(0,H.jsxs)(`div`,{className:y(`flex items-center gap-2 text-xs p-2.5 rounded-lg border backdrop-blur-md transition-all`,J.isValidating&&`bg-blue-500/10 border-blue-500/20 text-blue-400`,!J.isValidating&&J.exists&&J.accessible&&`bg-emerald-500/10 border-emerald-500/20 text-emerald-400`,!J.isValidating&&J.exists&&!J.accessible&&`bg-amber-500/10 border-amber-500/20 text-amber-400`,!J.isValidating&&!J.exists&&`bg-purple-500/10 border-purple-500/20 text-purple-400`),children:[J.isValidating&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(m,{className:`h-3.5 w-3.5 animate-spin`}),(0,H.jsx)(`span`,{children:`Validando directorio...`})]}),!J.isValidating&&J.exists&&J.accessible&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(a,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:J.message||`Directorio válido y accesible`})]}),!J.isValidating&&J.exists&&!J.accessible&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(u,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:J.message||`El directorio existe pero no tiene permisos de lectura/escritura`})]}),!J.isValidating&&!J.exists&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(p,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:J.message||`El directorio no existe`}),!J.error&&(0,H.jsx)(S,{type:`button`,variant:`outline`,size:`sm`,onClick:ne,className:`ml-auto h-6 px-2 text-xs bg-purple-500/20 hover:bg-purple-500/30 text-purple-300 border-purple-500/30`,children:`Crear directorio`})]})]})]})]}),(0,H.jsx)(`div`,{className:`hive-card-divider`}),(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,H.jsx)(d,{className:`h-4 w-4 text-blue-400`}),(0,H.jsx)(`h3`,{className:`hive-title-section`,children:`Motor de Inteligencia`})]}),(0,H.jsx)(U,{selectedProviderId:X.provider_id||void 0,selectedModelId:X.model_id||void 0,onProviderChange:e=>Z({...X,provider_id:e,model_id:``}),onModelChange:e=>Z({...X,model_id:e}),disabled:K,typeFilter:`llm`})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(D,{htmlFor:`tone`,className:`hive-label--field`,children:`Tono de Voz`}),(0,H.jsxs)(o,{value:X.tone,onValueChange:e=>Z({...X,tone:e}),disabled:K,children:[(0,H.jsx)(c,{className:`hive-select-trigger`,children:(0,H.jsx)(i,{placeholder:`Selecciona un tono`})}),(0,H.jsx)(s,{className:`hive-select-content`,children:W.map(e=>(0,H.jsx)(r,{value:e.value,className:`hive-select-item`,children:e.label},e.value))})]})]}),(0,H.jsxs)(`div`,{className:`hive-toggle-panel`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(g,{className:`h-3.5 w-3.5 text-purple-400`}),(0,H.jsx)(D,{htmlFor:`role`,className:`text-xs font-medium text-white/70`,children:`Rol`})]}),(0,H.jsxs)(o,{value:X.role,onValueChange:e=>Z({...X,role:e}),disabled:K,children:[(0,H.jsx)(c,{className:`w-[120px] bg-white/5 border-white/10 text-white`,children:(0,H.jsx)(i,{})}),(0,H.jsxs)(s,{className:`bg-zinc-900 border-white/10`,children:[(0,H.jsx)(r,{value:`coordinator`,children:`Coordinador`}),(0,H.jsx)(r,{value:`worker`,children:`Worker`})]})]})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`div`,{className:`h-2 w-2 rounded-full ${X.enabled?`bg-blue-400`:`bg-zinc-600`}`}),(0,H.jsx)(D,{htmlFor:`enabled`,className:`text-xs font-medium text-white/70`,children:`Habilitado`})]}),(0,H.jsx)(l,{id:`enabled`,checked:X.enabled,onCheckedChange:e=>Z({...X,enabled:e}),disabled:K})]})]})]}),q&&(0,H.jsx)(`div`,{className:`hive-form-error`,children:q}),(0,H.jsxs)(`div`,{className:`flex items-center gap-3 pt-4`,children:[n&&(0,H.jsx)(S,{type:`button`,variant:`outline`,onClick:n,disabled:K,className:`hive-btn--form-cancel`,children:`Cancelar`}),(0,H.jsx)(S,{type:`submit`,disabled:K,className:`hive-btn--form-submit`,children:K?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(m,{className:`mr-2 h-4 w-4 animate-spin`}),`Procesando...`]}):(0,H.jsx)(H.Fragment,{children:$?`Actualizar Agente`:`Desplegar Agente`})})]})]})})]})}export{G as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{_ as t}from"./vendor-charts-Bu2lyBKP.js";import{o as n}from"./vendor-query-DsWPbQdG.js";import{t as r}from"./activity-BB8JBT7a.js";import{t as i}from"./calendar-D_GHXR8q.js";import{a,c as o,l as s,n as c,r as l,s as u,t as d}from"./switch-CQf9jQKN.js";import{t as f}from"./chevron-left-5XF9hbEm.js";import{t as ee}from"./circle-alert-Qf59MV-u.js";import{t as p}from"./cpu-BxFtjoPn.js";import{t as te}from"./external-link-BULKsDvk.js";import{t as m}from"./folder-open-BnXDc8BG.js";import{t as ne}from"./globe-C7sirxEy.js";import{t as re}from"./loader-circle-BaadtldT.js";import{t as ie}from"./save-Diu387yr.js";import{n as h,t as g}from"./textarea-CPuZn8Rg.js";import{t as ae}from"./sparkles-Dnx_Tpre.js";import{t as _}from"./zap-BD57u2UH.js";import{c as v,l as y}from"./vendor-router-4QM6Fwg6.js";import{B as oe,G as se,N as b,P as x,f as S,h as C,o as w,p as T,s as E,t as D,tt as O}from"./index-B4lS14UW.js";import{t as k}from"./label-CplWBwSz.js";import{a as A,c as j,i as M,n as N,o as P,r as F,s as ce,t as le}from"./dialog-CWlGzRqi.js";import{t as I}from"./badge-BY-VUaxL.js";import{n as L,t as R}from"./es-JYPdzK5t.js";import{t as z}from"./format-CR2WWfql.js";var B=O(`Fingerprint`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),V=O(`LayoutGrid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),H=e(t(),1),U=n();function W({icon:e,...t}){return(0,U.jsx)(e,{...t})}function G({agentId:e}){let{agents:t,updateAgent:n,fetchAgents:i}=D(),{providers:f,fetchProviders:p}=E(),{models:_,fetchModels:v}=w();(0,H.useEffect)(()=>{i(),p(),v()},[i,p,v]);let y=t.find(t=>t.id===e),[O,I]=(0,H.useState)({name:``,description:``,provider_id:``,model_id:``,tone:``,role:`coordinator`,enabled:!0,headers:``,systemPrompt:``,workspace:``}),[L,R]=(0,H.useState)({isValidating:!1,exists:!1,accessible:!1});(0,H.useEffect)(()=>{y&&(I({name:y.name||``,description:y.description||``,provider_id:y.provider_id||y.providerId||``,model_id:y.model_id||y.modelId||``,tone:y.tone||``,role:y.role||`coordinator`,enabled:!!y.enabled,headers:``,systemPrompt:y.systemPrompt||``,workspace:y.workspace||``}),y.workspace&&z(y.workspace))},[y]);let z=async e=>{if(!e||e.trim()===``){R({isValidating:!1,exists:!1,accessible:!1});return}R({isValidating:!0,exists:!1,accessible:!1});try{let t=await S(`/api/workspace/validate`,{method:`POST`,body:{path:e}});R({isValidating:!1,exists:t.exists,accessible:t.accessible,error:t.error,message:t.message})}catch(e){R({isValidating:!1,exists:!1,accessible:!1,error:e.message})}},B=async()=>{if(O.workspace)try{await S(`/api/workspace/create`,{method:`POST`,body:{path:O.workspace},showLoader:`Creando directorio...`,showSuccess:`Directorio creado exitosamente`}),await z(O.workspace)}catch(e){T.fire({icon:`error`,title:e.message})}},V=async()=>{if(O.workspace)try{await S(`/api/workspace/open?path=${encodeURIComponent(O.workspace)}`,{method:`GET`})}catch(e){T.fire({icon:`error`,title:e.message})}},G=async()=>{C.show(`Sincronizando configuración del agente...`);try{await n(e,{...O,role:O.role,enabled:+!!O.enabled,workspace:O.workspace||null}),T.fire({icon:`success`,title:`Cambios sincronizados correctamente`})}catch(e){T.fire({icon:`error`,title:e instanceof Error?e.message:`Error al sincronizar cambios`})}finally{C.hide()}};if(!y)return(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center p-12 text-center space-y-4 rounded-3xl border border-dashed border-white/10 bg-white/5`,children:[(0,U.jsx)(W,{icon:r,className:`h-12 w-12 text-white/10 animate-pulse`}),(0,U.jsx)(`p`,{className:`text-white/40 font-medium`,children:`Buscando nodo en la colmena...`})]});let K=e=>{if(e.id===`ollama`)return!0;let t=e.base_url||e.baseUrl||``;return t.includes(`localhost`)||t.includes(`127.0.0.1`)?!0:!!e.has_api_key},q=e=>{if(e.id===`ollama`)return!0;let t=e.base_url||e.baseUrl||``;return t.includes(`localhost`)||t.includes(`127.0.0.1`)},J=f.filter(e=>(e.enabled||e.active)&&K(e)),Y=_.filter(e=>(e.provider_id||e.providerId)===O.provider_id&&(e.enabled||e.active)),X=f.find(e=>e.id===O.provider_id),Z=!!X&&!J.some(e=>e.id===X.id),Q=_.filter(e=>(e.provider_id||e.providerId)===O.provider_id).find(e=>e.id===O.model_id),$=!!Q&&!Y.some(e=>e.id===Q.id);return(0,U.jsx)(`div`,{className:`space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500`,children:(0,U.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-8`,children:[(0,U.jsxs)(`div`,{className:`lg:col-span-1 space-y-6`,children:[(0,U.jsxs)(`div`,{className:`p-6 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-6`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`div`,{className:`p-2 rounded-xl bg-blue-500/10 border border-blue-500/20`,children:(0,U.jsx)(W,{icon:se,className:`h-4 w-4 text-blue-400`})}),(0,U.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Identidad Base`})]}),(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(k,{htmlFor:`name`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Nombre Público`}),(0,U.jsx)(b,{id:`name`,value:O.name,onChange:e=>I(t=>({...t,name:e.target.value})),className:`bg-white/5 border-white/10 focus:border-blue-500/50 rounded-xl h-11`,placeholder:`Nombre del nodo`})]}),(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(k,{htmlFor:`tone`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Tono Cognitivo`}),(0,U.jsx)(b,{id:`tone`,value:O.tone,onChange:e=>I(t=>({...t,tone:e.target.value})),className:`bg-white/5 border-white/10 focus:border-blue-500/50 rounded-xl h-11`,placeholder:`Ej: Analítico, Conciso...`})]})]})]}),(0,U.jsxs)(`div`,{className:`p-6 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-6`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`div`,{className:`p-2 rounded-xl bg-purple-500/10 border border-purple-500/20`,children:(0,U.jsx)(W,{icon:h,className:`h-4 w-4 text-purple-400`})}),(0,U.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Permisos de Red`})]}),(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between p-3 rounded-2xl bg-white/5 hover:bg-white/10 transition-colors`,children:[(0,U.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,U.jsx)(k,{className:`text-sm font-semibold`,children:`Rol`}),(0,U.jsx)(`p`,{className:`text-[10px] text-white/30`,children:`Coordinador o Worker`})]}),(0,U.jsxs)(c,{value:O.role,onValueChange:e=>I(t=>({...t,role:e})),children:[(0,U.jsx)(u,{className:`w-[120px] bg-white/5 border-white/10 text-white`,children:(0,U.jsx)(o,{})}),(0,U.jsxs)(l,{className:`bg-zinc-900 border-white/10`,children:[(0,U.jsx)(a,{value:`coordinator`,children:`Coordinador`}),(0,U.jsx)(a,{value:`worker`,children:`Worker`})]})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between p-3 rounded-2xl bg-white/5 hover:bg-white/10 transition-colors`,children:[(0,U.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,U.jsx)(k,{className:`text-sm font-semibold`,children:`Nodo Activo`}),(0,U.jsx)(`p`,{className:`text-[10px] text-white/30`,children:`Disponible para la colmena`})]}),(0,U.jsx)(d,{checked:O.enabled,onCheckedChange:e=>I(t=>({...t,enabled:e}))})]})]})]}),(0,U.jsxs)(`div`,{className:`p-6 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-6`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`div`,{className:`p-2 rounded-xl bg-emerald-500/10 border border-emerald-500/20`,children:(0,U.jsx)(W,{icon:m,className:`h-4 w-4 text-emerald-400`})}),(0,U.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Workspace Directory`})]}),(0,U.jsx)(`div`,{className:`space-y-4`,children:(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(k,{htmlFor:`workspace`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Directorio de Trabajo`}),(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsx)(b,{id:`workspace`,value:O.workspace,onChange:e=>{I(t=>({...t,workspace:e.target.value})),z(e.target.value)},className:`bg-white/5 border-white/10 focus:border-emerald-500/50 rounded-xl h-11 font-mono text-sm flex-1`,placeholder:`Ej: /home/user/proyectos, D:\\Work`}),O.workspace&&L.exists&&L.accessible&&(0,U.jsx)(x,{type:`button`,variant:`outline`,size:`icon`,onClick:V,className:`shrink-0 border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10 h-11 w-11`,title:`Abrir en el explorador`,children:(0,U.jsx)(te,{className:`h-4 w-4`})})]}),(0,U.jsx)(`p`,{className:`text-xs text-white/40 leading-relaxed`,children:`Directorio donde el agente operará. Puede ser cualquier ubicación (disco, USB, red).`}),O.workspace&&O.workspace.trim()!==``&&(0,U.jsxs)(`div`,{className:oe(`flex items-center gap-2 text-xs p-2.5 rounded-lg border backdrop-blur-md transition-all`,L.isValidating&&`bg-blue-500/10 border-blue-500/20 text-blue-400`,!L.isValidating&&L.exists&&L.accessible&&`bg-emerald-500/10 border-emerald-500/20 text-emerald-400`,!L.isValidating&&L.exists&&!L.accessible&&`bg-amber-500/10 border-amber-500/20 text-amber-400`,!L.isValidating&&!L.exists&&`bg-purple-500/10 border-purple-500/20 text-purple-400`),children:[L.isValidating&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(re,{className:`h-3.5 w-3.5 animate-spin`}),(0,U.jsx)(`span`,{children:`Validando directorio...`})]}),!L.isValidating&&L.exists&&L.accessible&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(s,{className:`h-3.5 w-3.5`}),(0,U.jsx)(`span`,{children:L.message||`Directorio válido y accesible`})]}),!L.isValidating&&L.exists&&!L.accessible&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ee,{className:`h-3.5 w-3.5`}),(0,U.jsx)(`span`,{children:L.message||`Sin permisos de lectura/escritura`})]}),!L.isValidating&&!L.exists&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(m,{className:`h-3.5 w-3.5`}),(0,U.jsx)(`span`,{children:L.message||`El directorio no existe`}),!L.error&&(0,U.jsx)(x,{type:`button`,variant:`outline`,size:`sm`,onClick:B,className:`ml-auto h-6 px-2 text-xs bg-purple-500/20 hover:bg-purple-500/30 text-purple-300 border-purple-500/30`,children:`Crear`})]})]})]})})]})]}),(0,U.jsx)(`div`,{className:`lg:col-span-2 space-y-6`,children:(0,U.jsxs)(`div`,{className:`p-8 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-8`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`div`,{className:`p-2 rounded-xl bg-amber-500/10 border border-amber-500/20`,children:(0,U.jsx)(W,{icon:ae,className:`h-4 w-4 text-amber-400`})}),(0,U.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Configuración Cognitiva`})]}),(0,U.jsxs)(x,{onClick:G,className:`bg-blue-600 hover:bg-blue-500 text-white font-bold rounded-xl px-6 shadow-[0_4px_15px_rgba(37,99,235,0.3)] transition-all active:scale-95 gap-2`,children:[(0,U.jsx)(W,{icon:ie,className:`h-4 w-4`}),`Sincronizar Cambios`]})]}),(0,U.jsxs)(`div`,{className:`space-y-6`,children:[(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(k,{htmlFor:`description`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Directiva de Misión (Descripción)`}),(0,U.jsx)(g,{id:`description`,value:O.description,onChange:e=>I(t=>({...t,description:e.target.value})),className:`bg-white/5 border-white/10 focus:border-blue-500/50 rounded-2xl min-h-[80px] resize-none`,placeholder:`Define el propósito general de este nodo...`})]}),(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between pl-1`,children:[(0,U.jsx)(k,{className:`text-xs text-white/40 uppercase tracking-widest`,children:`System Prompt (Markdown)`}),(0,U.jsxs)(le,{children:[(0,U.jsx)(j,{asChild:!0,children:(0,U.jsx)(x,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-3 text-xs bg-blue-500/10 hover:bg-blue-500/20 text-blue-400 border-blue-500/30 transition-colors`,children:`Modifica acá el System Prompt`})}),(0,U.jsxs)(F,{className:`sm:max-w-3xl bg-[#0a0a0c] border-white/10 text-white shadow-2xl [&>button]:text-white/50 hover:[&>button]:text-white`,children:[(0,U.jsxs)(P,{children:[(0,U.jsx)(ce,{className:`text-xl`,children:`Editar System Prompt`}),(0,U.jsx)(M,{className:`text-sm text-white/50`,children:`El comportamiento principal del agente. Se recomienda usar Markdown.`})]}),(0,U.jsx)(`div`,{className:`py-2`,children:(0,U.jsx)(g,{value:O.systemPrompt,onChange:e=>I(t=>({...t,systemPrompt:e.target.value})),className:`min-h-[400px] font-mono text-sm bg-black/40 border-white/10 text-white/90 focus-visible:ring-blue-500/50 resize-y`,placeholder:`Escribe el system prompt detallado aquí...`})}),(0,U.jsx)(A,{children:(0,U.jsx)(N,{asChild:!0,children:(0,U.jsx)(x,{type:`button`,className:`bg-blue-600 hover:bg-blue-500 text-white shadow-[0_0_15px_rgba(37,99,235,0.3)]`,children:`Listo`})})})]})]})]}),O.systemPrompt?(0,U.jsx)(`div`,{className:`bg-white/[0.02] border border-white/5 rounded-2xl p-4 max-h-[120px] overflow-y-auto custom-scrollbar`,children:(0,U.jsx)(`p`,{className:`text-xs text-white/60 font-mono whitespace-pre-wrap italic`,children:O.systemPrompt})}):(0,U.jsx)(`div`,{className:`bg-white/[0.02] border border-white/5 rounded-2xl p-4`,children:(0,U.jsx)(`p`,{className:`text-xs text-white/30 italic`,children:`Sin system prompt configurado...`})})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between pl-1`,children:[(0,U.jsx)(k,{className:`text-xs text-white/40 uppercase tracking-widest`,children:`Proveedor`}),J.length===0&&(0,U.jsx)(`span`,{className:`text-[10px] text-amber-400/80`,children:`Sin providers activos`})]}),(0,U.jsxs)(c,{value:O.provider_id,onValueChange:e=>I(t=>({...t,provider_id:e,model_id:``})),children:[(0,U.jsx)(u,{className:`bg-white/5 border-white/10 rounded-xl h-11`,children:(0,U.jsx)(o,{placeholder:`Seleccionar proveedor`,children:O.provider_id&&X?(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{children:X.name}),Z&&(0,U.jsx)(`span`,{className:`text-[10px] text-amber-400/80`,children:`(inactivo)`}),q(X)?(0,U.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,U.jsx)(`span`,{className:`text-[9px] font-bold px-1.5 py-0.5 rounded-full bg-emerald-500/20 text-emerald-400`,children:`API`})]}):`Seleccionar proveedor`})}),(0,U.jsxs)(l,{className:`bg-zinc-900 border-white/10 text-white`,children:[J.length===0&&(0,U.jsx)(`div`,{className:`px-3 py-4 text-center text-xs text-white/30`,children:`Activa al menos un provider con API key en la sección de Providers`}),J.map(e=>{let t=q(e);return(0,U.jsx)(a,{value:e.id,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{children:e.name}),(0,U.jsx)(`span`,{className:`text-[9px] font-bold px-1.5 py-0.5 rounded-full ${t?`bg-amber-500/20 text-amber-400`:`bg-emerald-500/20 text-emerald-400`}`,children:t?`LOCAL`:`API`})]})},e.id)})]})]}),Z&&X&&(0,U.jsxs)(`p`,{className:`text-[10px] text-amber-400/80 pl-1`,children:[`El proveedor "`,X.name,`" está inactivo. Selecciona uno activo para cambiar.`]})]}),(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between pl-1`,children:[(0,U.jsx)(k,{className:`text-xs text-white/40 uppercase tracking-widest`,children:`Modelo`}),O.provider_id&&Y.length===0&&(0,U.jsx)(`span`,{className:`text-[10px] text-amber-400/80`,children:`Sin modelos activos`})]}),(0,U.jsxs)(c,{value:O.model_id,onValueChange:e=>I(t=>({...t,model_id:e})),disabled:!O.provider_id||Y.length===0,children:[(0,U.jsx)(u,{className:`bg-white/5 border-white/10 rounded-xl h-11 disabled:opacity-50`,children:(0,U.jsx)(o,{placeholder:O.provider_id?Y.length===0?`Activa modelos en el provider`:`Seleccionar modelo`:`Primero selecciona un proveedor`,children:O.model_id&&Q?(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`font-mono text-sm`,children:Q.name}),$&&(0,U.jsx)(`span`,{className:`text-[10px] text-amber-400/80`,children:`(inactivo)`})]}):void 0})}),(0,U.jsx)(l,{className:`bg-zinc-900 border-white/10 text-white`,children:Y.map(e=>(0,U.jsx)(a,{value:e.id,children:(0,U.jsx)(`span`,{className:`font-mono text-sm`,children:e.name})},e.id))})]}),$&&Q&&(0,U.jsxs)(`p`,{className:`text-[10px] text-amber-400/80 pl-1`,children:[`El modelo "`,Q.name,`" está inactivo. Selecciona uno activo para cambiar.`]})]})]})]}),(0,U.jsxs)(`div`,{className:`mt-8 p-4 rounded-2xl bg-white/[0.03] border border-white/5 flex items-start gap-4 italic`,children:[(0,U.jsx)(W,{icon:ne,className:`h-5 w-5 text-white/20 mt-0.5`}),(0,U.jsx)(`p`,{className:`text-[11px] text-white/30 leading-relaxed`,children:`Las credenciales de acceso y llaves de cifrado para los headers personalizados se gestionan en una capa segura y no son visibles en texto plano para mantener la integridad de la red.`})]})]})})]})})}function K({agent:e}){let{providers:t}=E(),{models:n}=w(),a=e.role===`coordinator`,o=e.provider_id||e.providerId,s=e.model_id||e.modelId,c=e.created_at||e.createdAt,l=c?z(typeof c==`string`?new Date(c):new Date(c*1e3),`PPP`,{locale:R}):`Fecha desconocida`,u=t.find(e=>e.id===o)?.name||o,d=n.find(e=>e.id===s)?.name||s;return(0,U.jsxs)(`div`,{className:`hive-card--internal group ${e.enabled?`hive-card--internal-active`:`hive-card--internal-disabled`}`,children:[e.enabled&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`absolute -top-24 -right-24 h-64 w-64 bg-blue-600/10 rounded-full blur-[100px] pointer-events-none group-hover:bg-blue-600/20 transition-all duration-700`}),(0,U.jsx)(`div`,{className:`absolute -bottom-24 -left-24 h-64 w-64 bg-purple-600/10 rounded-full blur-[100px] pointer-events-none group-hover:bg-purple-600/20 transition-all duration-700`})]}),(0,U.jsxs)(`div`,{className:`relative flex flex-col md:flex-row gap-8 items-start justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex-1 space-y-6`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`div`,{className:`hive-icon-wrap--internal ${e.enabled?`hive-icon-wrap--internal-active`:`hive-icon-wrap--internal-disabled`}`,children:(0,U.jsx)(B,{className:`h-6 w-6 ${e.enabled?`text-blue-400`:`text-white/20`}`})}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,U.jsx)(`span`,{className:`hive-page-header__label ${!e.enabled&&`text-white/20`}`,children:`Identidad de Nodo`}),a&&(0,U.jsx)(I,{className:`hive-tag--coordinator ${!e.enabled&&`bg-white/5 text-white/20 border-white/10`}`,children:`Coordinador`})]}),(0,U.jsx)(`h1`,{className:`text-4xl font-black tracking-tighter ${e.enabled?`text-white`:`text-white/40`}`,children:e.name})]})]}),(0,U.jsxs)(`p`,{className:`text-lg leading-relaxed max-w-2xl font-light italic ${e.enabled?`text-white/60`:`text-white/20`}`,children:[`"`,e.description||`Este agente no tiene una descripción definida aún.`,`"`]})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4`,children:[(0,U.jsx)(q,{icon:p,label:`Infraestructura`,value:u,subValue:d,color:e.enabled?`text-blue-400`:`text-white/20`,enabled:e.enabled}),(0,U.jsx)(q,{icon:_,label:`Personalidad`,value:e.tone||`Neutral`,color:e.enabled?`text-purple-400`:`text-white/20`,enabled:e.enabled}),(0,U.jsx)(q,{icon:i,label:`Desplegado el`,value:l,color:e.enabled?`text-emerald-400`:`text-white/20`,enabled:e.enabled})]})]}),(0,U.jsxs)(`div`,{className:`flex flex-col items-center md:items-end gap-6 min-w-[200px]`,children:[(0,U.jsxs)(`div`,{className:`text-center md:text-right space-y-2`,children:[(0,U.jsx)(`span`,{className:`hive-label block`,children:`Estado Operativo`}),(0,U.jsx)(L,{status:e.enabled?e.status:`hibernated`,className:`px-6 py-2 text-sm border-2`})]}),(0,U.jsxs)(`div`,{className:`hive-network-panel md:w-auto`,children:[(0,U.jsxs)(`div`,{className:`flex-1`,children:[(0,U.jsx)(`p`,{className:`hive-label mb-1`,children:`Carga de Red`}),(0,U.jsx)(`div`,{className:`hive-network-track`,children:e.enabled&&(0,U.jsx)(`div`,{className:`hive-network-fill`})})]}),(0,U.jsx)(r,{className:`h-5 w-5 ${e.enabled?`text-blue-400 animate-pulse`:`text-white/10`}`})]})]})]}),(0,U.jsx)(`div`,{className:`hive-strip--bottom ${!e.enabled&&`opacity-20`}`}),(0,U.jsxs)(`div`,{className:`absolute top-4 right-8 hive-mono hidden md:block`,children:[`NODE_UID: `,e.id]})]})}function q({icon:e,label:t,value:n,subValue:r,color:i,enabled:a}){return(0,U.jsxs)(`div`,{className:`hive-info-card ${a?`hive-info-card--active`:`hive-info-card--disabled`}`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,U.jsx)(e,{className:`h-3.5 w-3.5 ${i}`}),(0,U.jsx)(`span`,{className:`hive-info-card__label`,children:t})]}),(0,U.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,U.jsx)(`p`,{className:`hive-info-card__value ${a?`text-white/80 group-hover/item:text-white`:`text-white/20`}`,children:n}),r&&(0,U.jsx)(`p`,{className:`hive-info-card__sub ${a?`text-white/40`:`text-white/10`}`,children:r})]})]})}function J(){let{id:e}=y(),t=v(),n=e??`unknown`,{agents:i,fetchAgents:a,isLoading:o}=D();(0,H.useEffect)(()=>{a()},[a]);let s=i.find(e=>e.id===n);return(0,U.jsx)(`div`,{className:`min-h-screen bg-transparent pb-20`,children:(0,U.jsxs)(`div`,{className:`max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 animate-in fade-in slide-in-from-bottom-4 duration-700`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-8`,children:[(0,U.jsxs)(x,{variant:`ghost`,onClick:()=>t(`/agents`),className:`group flex items-center gap-2 text-white/40 hover:text-white hover:bg-white/5 px-4 py-2 rounded-xl transition-all`,children:[(0,U.jsx)(f,{className:`h-4 w-4 transition-transform group-hover:-translate-x-1`}),(0,U.jsx)(`span`,{className:`text-sm font-bold uppercase tracking-widest`,children:`Volver a la Colmena`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-4 text-white/20`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(V,{className:`h-4 w-4`}),(0,U.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-widest`,children:`Agentes`})]}),(0,U.jsx)(`div`,{className:`h-4 w-px bg-white/10`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(r,{className:`h-4 w-4`}),(0,U.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-widest`,children:`Detalles Operativos`})]})]})]}),s?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(K,{agent:s}),(0,U.jsx)(`div`,{className:`grid grid-cols-1 gap-8`,children:(0,U.jsx)(G,{agentId:n})})]}):(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-[60vh] text-center space-y-6`,children:[(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(`div`,{className:`h-24 w-24 rounded-full border-4 border-t-blue-500 border-white/5 animate-spin`}),(0,U.jsx)(r,{className:`absolute inset-0 m-auto h-8 w-8 text-blue-400 animate-pulse`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-xl font-bold text-white mb-2`,children:`Sincronizando con el Nodo`}),(0,U.jsx)(`p`,{className:`text-white/40 max-w-xs mx-auto`,children:`Estamos recuperando la configuración cuántica de este agente desde la base de datos central.`})]})]})]})})}export{J as AgentDetailPage};
@@ -0,0 +1 @@
1
+ import{o as e}from"./vendor-query-DsWPbQdG.js";import{t}from"./AgentCreateForm-BmRLLGIL.js";var n=e();function r(){return(0,n.jsx)(t,{})}export{r as AgentNewPage};
@@ -0,0 +1,10 @@
1
+ import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{_ as t}from"./vendor-charts-Bu2lyBKP.js";import{o as n}from"./vendor-query-DsWPbQdG.js";import{t as r}from"./activity-BB8JBT7a.js";import{t as i}from"./calendar-D_GHXR8q.js";import{t as a}from"./cpu-BxFtjoPn.js";import{n as o,o as s,r as c,s as l,t as u}from"./dropdown-menu-CdulmYlU.js";import{t as d}from"./file-text-CxAwK_Ze.js";import{t as f}from"./folder-open-BnXDc8BG.js";import{t as p}from"./gauge-DYmZYnET.js";import{t as m}from"./lock-DUwqtzEo.js";import{t as h}from"./plus-CqJyiQvM.js";import{t as g}from"./refresh-cw-Yf5FGfA5.js";import{n as _}from"./textarea-CPuZn8Rg.js";import{t as v}from"./trash-2-CUqHaFaC.js";import{t as y}from"./zap-BD57u2UH.js";import{c as b}from"./vendor-router-4QM6Fwg6.js";import{H as x,P as S,U as C,et as w,m as T,o as E,s as D,t as O,tt as k}from"./index-B4lS14UW.js";import{n as A,t as j}from"./es-JYPdzK5t.js";import{t as M}from"./format-CR2WWfql.js";import{t as N}from"./AgentCreateForm-BmRLLGIL.js";var P=k(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),F=k(`Pen`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),I=e(t(),1),L=n();function R({agent:e,onEdit:t}){let n=b(),{deleteAgent:h}=O(),{providers:g}=D(),{models:x}=E(),w=t=>{t.target.closest(`[role="menuitem"]`)||t.target.closest(`button`)||n(`/agents/${e.id}`)},k=async t=>{if(t.stopPropagation(),(await T.fire({title:`¿Eliminar Agente?`,text:`¿Estás seguro de que deseas eliminar al agente "${e.name}"? Esta acción eliminará permanentemente su configuración.`,icon:`warning`,showCancelButton:!0,confirmButtonText:`Sí, eliminar`,cancelButtonText:`Cancelar`,reverseButtons:!0,background:`#09090b`,color:`#fff`,customClass:{popup:`border border-white/10 rounded-xl`,confirmButton:`bg-red-500 hover:bg-red-600 text-white`,cancelButton:`bg-white/10 hover:bg-white/20 text-white`}})).isConfirmed)try{await h(e.id)}catch(e){console.error(e)}},N=e.role===`coordinator`,I=e.provider_id||e.providerId,R=e.model_id||e.modelId,z=g.find(e=>e.id===I)?.name||I,B=x.find(e=>e.id===R)?.name||R,V=e.enabled?e.status:`hibernated`,H=e.toolsJson?JSON.parse(e.toolsJson):[],U=e.skillsJson?JSON.parse(e.skillsJson):[],W=H.length||0,G=U.length||0,K=!!e.systemPrompt,q=e.maxIterations||10,J=(e=>{if(!e)return null;try{return M(new Date(e),`dd MMM yyyy`,{locale:j})}catch{return null}})(e.created_at||e.createdAt);return(0,L.jsxs)(`div`,{role:`button`,tabIndex:0,className:`group relative overflow-hidden rounded-2xl border bg-black/40 backdrop-blur-xl transition-all duration-500 cursor-pointer flex flex-col h-full
2
+ ${e.enabled?N?`border-purple-500/20 hover:border-purple-500/50 hover:bg-white/[0.03] hover:shadow-[0_0_30px_rgba(168,85,247,0.15)]`:`border-white/10 hover:border-blue-500/50 hover:bg-white/[0.03] hover:shadow-[0_0_30px_rgba(59,130,246,0.15)]`:`border-white/5 opacity-70 grayscale hover:grayscale-0`}
3
+ `,onClick:w,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&n(`/agents/${e.id}`)},children:[e.enabled&&(0,L.jsx)(`div`,{className:`absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent ${N?`via-purple-500/60`:`via-blue-500/50`} to-transparent`}),e.enabled&&(0,L.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-br ${N?`from-purple-500/10 via-transparent to-blue-500/5`:`from-blue-500/10 via-transparent to-purple-500/10`} opacity-0 transition-opacity duration-500 group-hover:opacity-100 pointer-events-none`}),(0,L.jsxs)(`div`,{className:`p-5 flex flex-col flex-1 relative z-10`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3 mb-4`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsx)(`div`,{className:`w-11 h-11 rounded-xl flex items-center justify-center shrink-0 border transition-colors
4
+ ${N?`bg-purple-500/10 border-purple-500/20 group-hover:border-purple-500/40`:`bg-blue-500/10 border-blue-500/20 group-hover:border-blue-500/40`}`,children:N?(0,L.jsx)(_,{className:`h-5 w-5 text-purple-400`}):(0,L.jsx)(a,{className:`h-5 w-5 text-blue-400`})}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`h3`,{className:`text-base font-bold tracking-tight transition-colors truncate ${e.enabled?`text-white/95 group-hover:text-white`:`text-white/40`}`,children:e.name}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5 mt-0.5 flex-wrap`,children:[(0,L.jsx)(`span`,{className:`text-[9px] px-2 py-0.5 rounded-full font-bold uppercase border
5
+ ${N?`bg-purple-500/10 text-purple-400 border-purple-500/20`:`bg-blue-500/10 text-blue-400 border-blue-500/20`}`,children:N?`Coordinador`:`Worker`}),e.hasHeaders&&(0,L.jsx)(`span`,{title:`Credenciales Mapeadas`,className:`flex items-center justify-center p-0.5 rounded bg-emerald-500/10 border border-emerald-500/20`,children:(0,L.jsx)(m,{className:`h-2.5 w-2.5 text-emerald-400`})}),e.parentId&&(0,L.jsx)(`span`,{title:`Sub-agente`,className:`flex items-center justify-center p-0.5 rounded bg-amber-500/10 border border-amber-500/20`,children:(0,L.jsx)(P,{className:`h-2.5 w-2.5 text-amber-400`})})]})]})]}),(0,L.jsxs)(`div`,{className:`flex flex-col items-end gap-2 shrink-0`,children:[(0,L.jsx)(A,{status:V}),(0,L.jsxs)(u,{children:[(0,L.jsx)(s,{asChild:!0,children:(0,L.jsx)(S,{variant:`ghost`,size:`icon`,className:`h-8 w-8 text-white/40 hover:text-white hover:bg-white/10 rounded-full transition-colors`,children:(0,L.jsx)(l,{className:`h-4 w-4`})})}),(0,L.jsxs)(o,{align:`end`,className:`w-48 bg-black/90 backdrop-blur-xl border-white/10 text-white p-1 rounded-xl shadow-2xl`,children:[(0,L.jsxs)(c,{onClick:()=>t?.(e),className:`gap-2 cursor-pointer focus:bg-white/10 focus:text-white rounded-lg px-3 py-2 text-sm transition-colors`,children:[(0,L.jsx)(F,{className:`h-4 w-4 text-blue-400`}),(0,L.jsx)(`span`,{children:`Editar Configuración`})]}),(0,L.jsxs)(c,{onClick:k,className:`gap-2 cursor-pointer focus:bg-red-500/20 focus:text-red-400 rounded-lg px-3 py-2 text-sm text-red-400 transition-colors`,children:[(0,L.jsx)(v,{className:`h-4 w-4`}),(0,L.jsx)(`span`,{children:`Eliminar Agente`})]})]})]})]})]}),(0,L.jsx)(`p`,{className:`text-xs text-white/50 line-clamp-2 leading-relaxed font-light mb-1`,children:e.description||`Sin descripción`}),(0,L.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[I&&(0,L.jsxs)(`div`,{className:`px-2.5 py-1 rounded-md text-[10px] font-medium uppercase tracking-wider flex items-center gap-1.5 border backdrop-blur-md transition-colors
6
+ ${e.enabled?`bg-white/5 border-white/10 text-white/80 group-hover:bg-white/10 group-hover:border-white/20`:`bg-transparent border-white/5 text-white/30`}`,children:[(0,L.jsx)(a,{className:`h-3 w-3`}),z]}),R&&(0,L.jsx)(`div`,{className:`px-2.5 py-1 rounded-md text-[10px] font-medium tracking-wider border backdrop-blur-md transition-colors truncate max-w-[120px]
7
+ ${e.enabled?`bg-white/5 border-white/10 text-white/80 group-hover:bg-white/10 group-hover:border-white/20`:`bg-transparent border-white/5 text-white/30`}`,title:B,children:B}),e.tone&&(0,L.jsxs)(`div`,{className:`px-2.5 py-1 rounded-md text-[10px] font-medium uppercase tracking-wider flex items-center gap-1.5 border backdrop-blur-md transition-colors
8
+ ${e.enabled?`bg-white/5 border-white/10 text-white/80 group-hover:bg-white/10 group-hover:border-white/20`:`bg-transparent border-white/5 text-white/30`}`,children:[(0,L.jsx)(r,{className:`h-3 w-3`}),e.tone]}),e.workspace&&(0,L.jsxs)(`div`,{className:`px-2.5 py-1 rounded-md text-[10px] font-medium uppercase tracking-wider flex items-center gap-1.5 border backdrop-blur-md transition-colors
9
+ ${e.enabled?`bg-emerald-500/5 border-emerald-500/20 text-emerald-300 group-hover:bg-emerald-500/10 group-hover:border-emerald-500/30`:`bg-transparent border-white/5 text-white/30`}`,title:`Workspace: ${e.workspace}`,children:[(0,L.jsx)(f,{className:`h-3 w-3`}),(0,L.jsx)(`span`,{className:`truncate max-w-[100px]`,children:`Workspace`})]})]}),(0,L.jsxs)(`div`,{className:`mt-6 pt-5 border-t border-white/5 grid grid-cols-4 gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1 items-start bg-white/[0.02] rounded-lg p-2.5 border border-white/5 group-hover:border-white/10 transition-colors`,children:[(0,L.jsxs)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-white/40 flex items-center gap-1.5`,children:[(0,L.jsx)(C,{className:`h-3 w-3 text-emerald-400/70`}),`Tools`]}),(0,L.jsx)(`span`,{className:`text-sm font-semibold font-mono ${e.enabled?`text-white/90`:`text-white/30`}`,children:W})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1 items-start bg-white/[0.02] rounded-lg p-2.5 border border-white/5 group-hover:border-white/10 transition-colors`,children:[(0,L.jsxs)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-white/40 flex items-center gap-1.5`,children:[(0,L.jsx)(y,{className:`h-3 w-3 text-amber-400/70`}),`Skills`]}),(0,L.jsx)(`span`,{className:`text-sm font-semibold font-mono ${e.enabled?`text-white/90`:`text-white/30`}`,children:G})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1 items-start bg-white/[0.02] rounded-lg p-2.5 border border-white/5 group-hover:border-white/10 transition-colors`,children:[(0,L.jsxs)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-white/40 flex items-center gap-1.5`,children:[(0,L.jsx)(d,{className:`h-3 w-3 text-blue-400/70`}),`Prompt`]}),(0,L.jsx)(`span`,{className:`text-sm font-bold ${e.enabled?K?`text-emerald-400`:`text-white/30`:`text-white/20`}`,children:K?`✓`:`—`})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1 items-start bg-white/[0.02] rounded-lg p-2.5 border border-white/5 group-hover:border-white/10 transition-colors`,children:[(0,L.jsxs)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-white/40 flex items-center gap-1.5`,children:[(0,L.jsx)(p,{className:`h-3 w-3 text-purple-400/70`}),`Iters`]}),(0,L.jsx)(`span`,{className:`text-sm font-semibold font-mono ${e.enabled?`text-white/90`:`text-white/30`}`,children:q})]})]}),e.systemPrompt&&(0,L.jsxs)(`div`,{className:`mt-3 bg-white/[0.02] rounded-lg p-3 border border-white/5 group-hover:border-white/10 transition-colors`,children:[(0,L.jsxs)(`span`,{className:`text-[10px] font-medium tracking-wider text-white/40 uppercase mb-1.5 flex items-center gap-1.5`,children:[(0,L.jsx)(d,{className:`h-3 w-3 text-blue-400/70`}),`System Prompt`]}),(0,L.jsxs)(`p`,{className:`text-xs text-white/60 font-mono line-clamp-2 leading-relaxed italic`,children:[`"`,e.systemPrompt,`"`]})]}),(0,L.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between bg-white/[0.02] rounded-lg p-2.5 border border-white/5 group-hover:border-white/10 transition-colors`,children:[(0,L.jsx)(`span`,{className:`text-[10px] font-medium tracking-wider text-white/40 uppercase`,children:`Tareas`}),(0,L.jsx)(`span`,{className:`text-sm font-semibold font-mono ${e.enabled?`text-white/90`:`text-white/30`}`,children:e.taskCount||0})]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between bg-white/[0.02] rounded-lg p-2.5 border border-white/5 group-hover:border-white/10 transition-colors`,children:[(0,L.jsx)(`span`,{className:`text-[10px] font-medium tracking-wider text-white/40 uppercase`,children:`Éxito`}),(0,L.jsxs)(`span`,{className:`text-sm font-semibold font-mono ${e.enabled?`text-emerald-400/90`:`text-white/30`}`,children:[e.successRate||0,`%`]})]})]}),(0,L.jsxs)(`div`,{className:`mt-auto pt-5 flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`div`,{className:`h-2 w-2 rounded-full ${e.enabled?`bg-blue-400 shadow-[0_0_8px_rgba(96,165,250,0.8)] animate-pulse`:`bg-white/20`}`}),(0,L.jsx)(`span`,{className:`text-[10px] font-bold tracking-widest uppercase ${e.enabled?`text-blue-400`:`text-white/30`}`,children:e.enabled?`ACTIVO`:`INACTIVO`})]}),J&&(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] text-white/30 font-medium tracking-wider pl-3 border-l border-white/10`,children:[(0,L.jsx)(i,{className:`h-3 w-3`}),J]})]}),(0,L.jsxs)(`div`,{className:`text-xs font-semibold tracking-wide flex items-center gap-1.5 transition-all
10
+ ${e.enabled?`text-white/70 group-hover:text-blue-400 translate-x-1 group-hover:translate-x-0`:`text-white/20`}`,children:[`INGRESAR`,(0,L.jsx)(`span`,{className:`transition-transform group-hover:translate-x-1 opacity-0 group-hover:opacity-100 hidden sm:inline-block`,children:`→`})]})]})]})]})}var z=Math.sqrt(3),B=92;function V(e,t){return{x:B*1.5*e,y:B*(z/2*e+z*t)}}var H=[{q:1,r:0},{q:1,r:-1},{q:0,r:-1},{q:-1,r:0},{q:-1,r:1},{q:0,r:1}],U=[{q:2,r:0},{q:2,r:-1},{q:2,r:-2},{q:1,r:-2},{q:0,r:-2},{q:-1,r:-1},{q:-2,r:0},{q:-2,r:1},{q:-2,r:2},{q:-1,r:2},{q:0,r:2},{q:1,r:1}],W=`polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%)`,G={active:{bg:`#22c55e22`,dot:`#22c55e`,glow:`0 0 12px #22c55e88`},idle:{bg:`#f59e0b22`,dot:`#f59e0b`,glow:`0 0 12px #f59e0b88`},thinking:{bg:`#6366f122`,dot:`#818cf8`,glow:`0 0 12px #6366f188`},error:{bg:`#ef444422`,dot:`#ef4444`,glow:`0 0 12px #ef444488`},hibernated:{bg:`#1f293700`,dot:`#4b5563`,glow:`none`}};function K({agents:e,onEdit:t}){let n=b(),{deleteAgent:r}=O(),[i,o]=(0,I.useState)(null),{coordinator:s,workers:c}=(0,I.useMemo)(()=>{let t=e.find(e=>e.role===`coordinator`)??e[0];return{coordinator:t,workers:e.filter(e=>e.id!==t?.id)}},[e]),l=(0,I.useMemo)(()=>[...H.map(({q:e,r:t})=>V(e,t)),...U.map(({q:e,r:t})=>V(e,t))],[]),u=c.slice(0,l.length),d=c.length>6?2:1,f=d===2?740:540,p=d===2?800:540,m=f/2,h=p/2,g=Math.round(172*z/2),x=Math.round(130*z/2),S=async(e,t)=>{if(t.stopPropagation(),(await T.fire({title:`¿Eliminar Agente?`,text:`¿Eliminar "${e.name}"?`,icon:`warning`,showCancelButton:!0,confirmButtonText:`Sí, eliminar`,cancelButtonText:`Cancelar`,background:`#09090b`,color:`#fff`})).isConfirmed)try{await r(e.id)}catch{}},w=s?G[s.enabled?s.status:`hibernated`]??G.hibernated:G.hibernated;return(0,L.jsxs)(`div`,{className:`w-full overflow-x-auto overflow-y-visible pb-4`,children:[(0,L.jsxs)(`div`,{className:`relative mx-auto select-none`,style:{width:f,height:p},children:[(0,L.jsx)(`div`,{className:`absolute pointer-events-none rounded-full blur-[80px] opacity-30`,style:{width:260,height:260,left:m-130,top:h-130,background:`radial-gradient(circle, rgba(245,158,11,0.6) 0%, transparent 70%)`}}),(0,L.jsxs)(`svg`,{className:`absolute inset-0 pointer-events-none`,width:f,height:p,xmlns:`http://www.w3.org/2000/svg`,children:[(0,L.jsxs)(`defs`,{children:[(0,L.jsx)(`pattern`,{id:`hc-hex`,x:`0`,y:`0`,width:`52`,height:`30`,patternUnits:`userSpaceOnUse`,children:(0,L.jsx)(`polygon`,{points:`26,1 51,15.5 51,29 26,29 1,15.5 1,1`,fill:`none`,stroke:`rgba(255,255,255,0.03)`,strokeWidth:`1`})}),(0,L.jsxs)(`radialGradient`,{id:`fade-mask`,cx:`50%`,cy:`50%`,r:`50%`,children:[(0,L.jsx)(`stop`,{offset:`0%`,stopColor:`white`,stopOpacity:`0.08`}),(0,L.jsx)(`stop`,{offset:`100%`,stopColor:`white`,stopOpacity:`0`})]})]}),(0,L.jsx)(`rect`,{width:f,height:p,fill:`url(#hc-hex)`}),(0,L.jsx)(`rect`,{width:f,height:p,fill:`url(#fade-mask)`}),u.map((e,t)=>{let n=l[t],r=i===e.id;return(0,L.jsxs)(`g`,{children:[(0,L.jsx)(`line`,{x1:m,y1:h,x2:m+n.x,y2:h+n.y,stroke:r?`rgba(245,158,11,0.5)`:`rgba(245,158,11,0.12)`,strokeWidth:r?2:1,strokeDasharray:`5 5`,style:{transition:`all 0.3s ease`}}),e.enabled&&(0,L.jsx)(`circle`,{r:`3`,fill:`rgba(245,158,11,0.7)`,children:(0,L.jsx)(`animateMotion`,{dur:`${2.5+t*.4}s`,repeatCount:`indefinite`,path:`M ${m} ${h} L ${m+n.x} ${h+n.y}`})})]},`line-${e.id}`)})]}),s&&(0,L.jsxs)(`div`,{className:`absolute cursor-pointer group z-20`,style:{left:m-172/2,top:h-g/2,width:172,height:g},onMouseEnter:()=>o(s.id),onMouseLeave:()=>o(null),children:[(0,L.jsx)(`div`,{className:`absolute inset-[-6px] opacity-40 group-hover:opacity-80 transition-opacity duration-500 blur-[10px]`,style:{clipPath:W,background:`rgba(245,158,11,0.5)`}}),(0,L.jsx)(`div`,{className:`absolute inset-0 transition-transform duration-300 group-hover:scale-105`,style:{clipPath:W,background:`rgba(245,158,11,0.55)`},children:(0,L.jsx)(`div`,{className:`absolute inset-[2px]`,style:{clipPath:W,background:`linear-gradient(145deg, #1c1100 0%, #0d0b00 60%, #120d00 100%)`},children:(0,L.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-1.5 px-3`,children:[(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(_,{className:`h-8 w-8 text-amber-400 drop-shadow-[0_0_8px_rgba(245,158,11,0.8)]`}),(0,L.jsx)(`div`,{className:`absolute -bottom-0.5 -right-0.5 h-2.5 w-2.5 rounded-full border-2 border-black`,style:{backgroundColor:w.dot,boxShadow:w.glow}})]}),(0,L.jsx)(`span`,{className:`text-[10px] font-black text-amber-300 tracking-[0.12em] text-center leading-tight uppercase line-clamp-2`,children:s.name}),(0,L.jsx)(`span`,{className:`text-[8px] text-amber-500/70 tracking-widest uppercase font-semibold`,children:`Coordinadora`})]})})}),(0,L.jsxs)(`div`,{className:`absolute -bottom-8 left-1/2 -translate-x-1/2 hidden group-hover:flex gap-1 z-30 animate-in fade-in duration-200`,children:[(0,L.jsx)(`button`,{className:`p-1.5 rounded bg-black/80 border border-amber-500/30 text-amber-400 hover:bg-amber-500/20 transition-colors`,onClick:e=>{e.stopPropagation(),t?.(s)},title:`Editar`,children:(0,L.jsx)(F,{className:`h-3 w-3`})}),(0,L.jsx)(`button`,{className:`p-1.5 rounded bg-black/80 border border-white/10 text-white/50 hover:text-white hover:border-white/20 transition-colors`,onClick:e=>{e.stopPropagation(),n(`/agents/${s.id}`)},title:`Ver detalle`,children:(0,L.jsx)(`span`,{className:`text-[9px] px-0.5`,children:`→`})})]})]}),u.map((e,r)=>{let s=l[r],c=m+s.x-130/2,u=h+s.y-x/2,d=G[e.enabled?e.status:`hibernated`]??G.hibernated,f=e.toolsJson?JSON.parse(e.toolsJson).length:0,p=e.skillsJson?JSON.parse(e.skillsJson).length:0,g=i===e.id,_=e.enabled?g?`rgba(96,165,250,0.9)`:`rgba(59,130,246,0.45)`:`rgba(255,255,255,0.08)`,b=e.enabled?`linear-gradient(145deg, #050d1c 0%, #020912 60%, #040a18 100%)`:`#0a0a0b`;return(0,L.jsxs)(`div`,{className:`absolute cursor-pointer group z-10`,style:{left:c,top:u,width:130,height:x},onMouseEnter:()=>o(e.id),onMouseLeave:()=>o(null),children:[e.enabled&&(0,L.jsx)(`div`,{className:`absolute inset-[-5px] transition-opacity duration-300 blur-[8px]`,style:{clipPath:W,background:`rgba(59,130,246,0.35)`,opacity:g?.8:.2}}),(0,L.jsx)(`div`,{className:`absolute inset-0 transition-transform duration-300`,style:{clipPath:W,background:_,transform:g?`scale(1.08)`:`scale(1)`},children:(0,L.jsx)(`div`,{className:`absolute inset-[1.5px]`,style:{clipPath:W,background:b},children:(0,L.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-1 px-2`,children:[(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(a,{className:`h-5 w-5 transition-colors duration-300`,style:{color:e.enabled?`#60a5fa`:`#374151`}}),(0,L.jsx)(`div`,{className:`absolute -bottom-0.5 -right-0.5 h-2 w-2 rounded-full border border-[#020912]`,style:{backgroundColor:d.dot,boxShadow:d.glow}})]}),(0,L.jsx)(`span`,{className:`text-[8px] font-bold tracking-wide text-center leading-tight uppercase line-clamp-2 transition-colors duration-300`,style:{color:e.enabled?`#93c5fd`:`#374151`},children:e.name}),(f>0||p>0)&&(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5 mt-0.5`,children:[f>0&&(0,L.jsxs)(`span`,{className:`flex items-center gap-0.5 text-[7px] text-emerald-400/70`,children:[(0,L.jsx)(C,{className:`h-2 w-2`}),f]}),p>0&&(0,L.jsxs)(`span`,{className:`flex items-center gap-0.5 text-[7px] text-amber-400/70`,children:[(0,L.jsx)(y,{className:`h-2 w-2`}),p]})]})]})})}),(0,L.jsx)(`div`,{className:`absolute -bottom-7 left-1/2 -translate-x-1/2 z-30 transition-all duration-200`,style:{opacity:+!!g,pointerEvents:g?`auto`:`none`},children:(0,L.jsxs)(`div`,{className:`flex gap-1`,children:[(0,L.jsx)(`button`,{className:`p-1 rounded bg-black/80 border border-blue-500/30 text-blue-400 hover:bg-blue-500/20 transition-colors`,onClick:n=>{n.stopPropagation(),t?.(e)},title:`Editar`,children:(0,L.jsx)(F,{className:`h-2.5 w-2.5`})}),(0,L.jsx)(`button`,{className:`p-1 rounded bg-black/80 border border-white/10 text-white/50 hover:text-white transition-colors`,onClick:t=>{t.stopPropagation(),n(`/agents/${e.id}`)},title:`Ver`,children:(0,L.jsx)(`span`,{className:`text-[8px]`,children:`→`})}),(0,L.jsx)(`button`,{className:`p-1 rounded bg-black/80 border border-red-500/20 text-red-400/60 hover:text-red-400 transition-colors`,onClick:t=>S(e,t),title:`Eliminar`,children:(0,L.jsx)(v,{className:`h-2.5 w-2.5`})})]})})]},e.id)}),c.length>l.length&&(0,L.jsxs)(`div`,{className:`absolute bottom-6 right-6 text-[11px] text-white/50 bg-white/5 rounded-full px-3 py-1 border border-white/10 backdrop-blur-sm`,children:[`+`,c.length-l.length,` agentes en lista`]})]}),c.length>l.length&&(0,L.jsx)(`div`,{className:`mt-4 grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 max-w-[740px] mx-auto px-4`,children:c.slice(l.length).map(e=>(0,L.jsxs)(`button`,{className:`flex items-center gap-2 px-3 py-2 rounded-lg border border-white/10 bg-white/[0.03] hover:bg-white/[0.06] transition-all text-left group`,onClick:()=>n(`/agents/${e.id}`),children:[(0,L.jsx)(a,{className:`h-4 w-4 text-blue-400/60 shrink-0`}),(0,L.jsx)(`span`,{className:`text-xs text-white/60 group-hover:text-white/90 truncate transition-colors`,children:e.name})]},e.id))})]})}function q({agents:e,onEdit:t}){return e.length===0?(0,L.jsxs)(`div`,{className:`hive-empty-state`,children:[(0,L.jsx)(`div`,{className:`p-4 rounded-full bg-white/5 mb-4`,children:(0,L.jsx)(`div`,{className:`h-10 w-10 border-2 border-dashed border-white/20 rounded-full`})}),(0,L.jsx)(`p`,{className:`hive-label uppercase`,children:`No se detectaron nodos activos`}),(0,L.jsx)(`p`,{className:`text-xs text-white/20 mt-1`,children:`Comienza desplegando un nuevo agente en tu red.`})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`hidden md:block`,children:(0,L.jsx)(K,{agents:e,onEdit:t})}),(0,L.jsx)(`div`,{className:`grid gap-6 sm:grid-cols-2 pb-20 md:hidden`,children:e.map(e=>(0,L.jsx)(R,{agent:e,onEdit:t},e.id))})]})}function J(){let{agents:e,isLoading:t,error:n,fetchAgents:r}=O(),{fetchProviders:i}=D(),{fetchModels:a}=E(),[o,s]=(0,I.useState)(!1),[c,l]=(0,I.useState)(void 0);(0,I.useEffect)(()=>{r(),i(),a()},[r,i,a]);let u=e=>{l(e),s(!0)},d=()=>{l(void 0),s(!0)};return(0,L.jsxs)(`div`,{className:`hive-page mt-10 animate-in fade-in duration-700`,children:[(0,L.jsxs)(`div`,{className:`hive-page-container`,children:[(0,L.jsxs)(`div`,{className:`hive-page-header flex flex-col sm:flex-row sm:items-end justify-between gap-6 relative z-10 mb-8`,children:[(0,L.jsxs)(`div`,{className:`relative z-10 animate-in slide-in-from-left-8 duration-700`,children:[(0,L.jsxs)(`div`,{className:`hive-page-header__eyebrow mb-3 opacity-80`,children:[(0,L.jsx)(`div`,{className:`hive-page-header__dot animate-pulse shadow-[0_0_10px_rgba(59,130,246,0.6)]`}),(0,L.jsx)(`span`,{className:`hive-page-header__label tracking-widest font-semibold text-blue-400`,children:`NEXO CENTRAL`})]}),(0,L.jsxs)(`h2`,{className:`text-4xl md:text-5xl font-black tracking-tight text-white drop-shadow-lg mb-4`,children:[`Agentes `,(0,L.jsx)(`span`,{className:`text-transparent bg-clip-text bg-gradient-to-r from-blue-400 to-purple-500`,children:`Inteligentes`})]}),(0,L.jsx)(`p`,{className:`text-white/60 text-sm max-w-xl leading-relaxed font-light`,children:`Configura y despliega inteligencias autónomas. Cada nodo amplía las capacidades de tu infraestructura personal y de negocio con precisión absoluta.`})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 relative z-10 animate-in slide-in-from-right-8 duration-700`,children:[(0,L.jsxs)(`button`,{className:`px-4 py-2 bg-white/5 hover:bg-white/10 text-white/70 hover:text-white rounded-lg border border-white/10 hover:border-white/20 transition-all duration-300 flex items-center gap-2 font-medium text-sm backdrop-blur-sm group`,onClick:()=>r(),disabled:t,children:[(0,L.jsx)(g,{className:`h-4 w-4 transition-transform duration-500 group-hover:rotate-180 text-blue-400 ${t?`animate-spin`:``}`}),(0,L.jsx)(`span`,{children:`Sincronizar`})]}),(0,L.jsxs)(`button`,{onClick:d,className:`px-4 py-2 bg-blue-600 hover:bg-blue-500 text-white rounded-lg border border-blue-500/50 hover:border-blue-400/50 shadow-[0_0_15px_rgba(37,99,235,0.3)] hover:shadow-[0_0_25px_rgba(59,130,246,0.5)] transition-all duration-300 flex items-center gap-2 font-medium text-sm group`,children:[(0,L.jsx)(h,{className:`h-4 w-4 transition-transform duration-300 group-hover:rotate-90`}),(0,L.jsx)(`span`,{children:`Desplegar Nodo`})]})]})]}),(0,L.jsxs)(`div`,{className:`relative mt-8`,children:[(0,L.jsx)(`div`,{className:`absolute -top-40 -left-40 h-[500px] w-[500px] bg-blue-600/10 rounded-full blur-[120px] pointer-events-none mix-blend-screen opacity-50`}),(0,L.jsx)(`div`,{className:`absolute top-40 -right-40 h-[400px] w-[400px] bg-purple-600/10 rounded-full blur-[100px] pointer-events-none mix-blend-screen opacity-50`}),n?(0,L.jsxs)(`div`,{className:`relative overflow-hidden rounded-2xl border border-red-500/20 bg-red-500/5 backdrop-blur-lg`,children:[(0,L.jsx)(`div`,{className:`absolute top-0 left-0 w-1 h-full bg-red-500`}),(0,L.jsxs)(`div`,{className:`px-6 py-5 flex items-center gap-4 text-red-400 relative z-10`,children:[(0,L.jsx)(`div`,{className:`p-3 rounded-xl bg-red-500/10 border border-red-500/20 shadow-[0_0_15px_rgba(239,68,68,0.15)]`,children:(0,L.jsx)(x,{className:`h-6 w-6`})}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-sm font-bold uppercase tracking-widest drop-shadow-sm`,children:`Error de Enlace`}),(0,L.jsx)(`p`,{className:`text-sm text-red-300/70 mt-1 font-light`,children:n})]})]})]}):(0,L.jsx)(`div`,{className:`relative z-10`,children:t&&e.length===0?(0,L.jsx)(`div`,{className:`grid gap-6 sm:grid-cols-2 lg:grid-cols-3`,children:[1,2,3].map(e=>(0,L.jsx)(`div`,{className:`h-64 rounded-2xl border border-white/5 bg-white/[0.02] animate-pulse`},e))}):e.length===0?(0,L.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20 px-4 text-center border border-white/5 rounded-3xl bg-black/20 backdrop-blur-sm animate-in fade-in duration-1000`,children:[(0,L.jsx)(`div`,{className:`h-20 w-20 rounded-full bg-blue-500/10 border border-blue-500/20 flex items-center justify-center mb-6 shadow-[0_0_30px_rgba(59,130,246,0.15)]`,children:(0,L.jsx)(w,{className:`h-10 w-10 text-blue-400`})}),(0,L.jsx)(`h3`,{className:`text-xl font-bold text-white mb-2`,children:`Colmena inactiva`}),(0,L.jsx)(`p`,{className:`text-white/50 max-w-md mx-auto mb-8 leading-relaxed`,children:`La red neuronal está esperando ser poblada. Despliega tu primer nodo agente para comenzar a automatizar tus operaciones.`}),(0,L.jsxs)(`button`,{onClick:d,className:`px-6 py-3 bg-blue-600 hover:bg-blue-500 text-white rounded-xl border border-blue-500/50 hover:border-blue-400/50 shadow-[0_0_20px_rgba(37,99,235,0.4)] transition-all duration-300 flex items-center gap-2 font-bold group`,children:[(0,L.jsx)(h,{className:`h-5 w-5 transition-transform duration-300 group-hover:scale-125`}),(0,L.jsx)(`span`,{children:`INICIAR DESPLIEGUE`})]})]}):(0,L.jsx)(`div`,{className:`animate-in slide-in-from-bottom-8 duration-1000 fade-in fill-mode-both`,children:(0,L.jsx)(q,{agents:e,onEdit:u})})})]})]}),o&&(0,L.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6 animate-in fade-in duration-300`,children:[(0,L.jsx)(`div`,{className:`absolute inset-0 bg-black/60 backdrop-blur-md transition-opacity`,onClick:()=>s(!1)}),(0,L.jsx)(`div`,{className:`relative w-full max-w-4xl max-h-[90vh] overflow-y-auto bg-[#09090b] border border-white/10 rounded-2xl shadow-2xl animate-in zoom-in-95 duration-300`,children:(0,L.jsx)(N,{initialData:c,onSuccess:()=>{s(!1),l(void 0)},onCancel:()=>s(!1)})})]})]})}export{J as AgentsPage};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{_ as t}from"./vendor-charts-Bu2lyBKP.js";import{o as n}from"./vendor-query-DsWPbQdG.js";import{t as r}from"./circle-check-BhwUUu4Z.js";import{t as i}from"./circle-x-C55wB-DP.js";import{t as a}from"./loader-circle-BaadtldT.js";import{t as o}from"./refresh-cw-Yf5FGfA5.js";import{t as s}from"./terminal-CNLY74vg.js";import{t as c}from"./trash-2-CUqHaFaC.js";import{C as l,P as u,tt as d,w as f}from"./index-B4lS14UW.js";import{t as p}from"./badge-BY-VUaxL.js";import{a as m,n as h,o as g,t as _}from"./card-CE_kGxdL.js";import{t as v}from"./progress-CFpWXmru.js";import{t as y}from"./scroll-area-B3bGhGnD.js";var b=d(`CircleStop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),x=e(t(),1),S=n(),C={connected:{label:`Conectado`,className:`bg-hive-connected/15 text-hive-connected border-hive-connected/30`},connecting:{label:`Conectando…`,className:`bg-hive-thinking/15 text-hive-thinking border-hive-thinking/30 animate-pulse-slow`},disconnected:{label:`Desconectado`,className:`bg-destructive/15 text-destructive border-destructive/30`},error:{label:`Error`,className:`bg-destructive/15 text-destructive border-destructive/30`}};function w({status:e}){let t=C[e];return(0,S.jsxs)(p,{variant:`outline`,className:t.className,children:[(0,S.jsx)(`span`,{className:`mr-1.5 inline-block h-1.5 w-1.5 rounded-full bg-current`}),t.label]})}var T=window.location.hostname===`0.0.0.0`?`localhost`:window.location.hostname,E=window.location.protocol===`https:`?`wss:`:`ws:`,D=`${E}//${T}:18791/ws`,O=`${l()}/bridge-events`;function k(){return Math.random().toString(36).substring(2,15)}function A(e,t,n=`system`){return{id:k(),processId:n,level:e,message:t,timestamp:new Date().toISOString()}}var j=!1,M=0,N=3,P=!1,F=null,I=null,L=f((e,t)=>({processes:[],logs:[],isConnected:!1,socket:null,gatewaySocket:null,addProcess:t=>e(e=>({processes:[...e.processes,t]})),removeProcess:t=>e(e=>({processes:e.processes.filter(e=>e.id!==t)})),updateProcess:(t,n)=>e(e=>({processes:e.processes.map(e=>e.id===t?{...e,...n}:e)})),addLog:t=>e(e=>({logs:[t,...e.logs].slice(0,500)})),clearLogs:()=>e({logs:[]}),sendCommand:e=>{let{socket:n,isConnected:r}=t();n&&r&&n.send(JSON.stringify(e))},connect:()=>{let{socket:n,isConnected:r}=t();if(!(n||r)&&E!==`wss:`){j=!0;try{let n=new WebSocket(D);n.onmessage=r=>{try{let i=JSON.parse(r.data);if(i.type===`ping`){n.send(JSON.stringify({cmd:`ping`}));return}if(i.type===`pong`)return;if(i.type===`code-bridge:status`&&Array.isArray(i.agents)&&e({processes:i.agents.map(e=>({id:e.taskId,name:e.role,command:e.cli,status:e.state,pid:e.pid,startedAt:new Date().toISOString(),output:[]}))}),i.type===`agent:started`){let e={id:i.taskId,name:i.role,command:i.cli,status:`running`,pid:i.pid,startedAt:new Date().toISOString(),output:[]};t().addProcess(e),t().addLog(A(`info`,`Agent started: ${i.role} (PID: ${i.pid})`,i.taskId))}if(i.type===`agent:output`){let e=t().processes.find(e=>e.id===i.taskId);e&&t().updateProcess(i.taskId,{output:[...e.output,i.chunk]})}i.type===`agent:finished`&&(t().updateProcess(i.taskId,{status:`completed`}),t().addLog(A(`info`,`Agent finished: ${i.role}`,i.taskId))),i.type===`agent:error`&&(t().updateProcess(i.taskId,{status:`error`}),t().addLog(A(`error`,i.message,i.taskId))),i.type===`agent:cancelled`&&(t().updateProcess(i.taskId,{status:`stopped`}),t().addLog(A(`warn`,`Agent cancelled: ${i.role}`,i.taskId)))}catch{}},n.onopen=()=>{M=0,e({isConnected:!0,socket:n}),t().addLog(A(`info`,`Connected to Code Bridge`)),t().sendCommand({cmd:`status`}),F&&clearInterval(F),F=setInterval(()=>{n.readyState===WebSocket.OPEN&&n.send(JSON.stringify({cmd:`ping`}))},15e3)},n.onerror=()=>{},n.onclose=()=>{if(F&&=(clearInterval(F),null),e({isConnected:!1,socket:null}),j){if(M++,M>N){j=!1;return}setTimeout(()=>{j&&!t().isConnected&&t().connect()},5e3)}},e({socket:n})}catch{e({isConnected:!1,socket:null})}}},connectGateway:()=>{let{gatewaySocket:n}=t();if(!n){P=!0;try{let n=new WebSocket(O);n.onopen=()=>{e({isConnected:!0}),t().addLog(A(`info`,`Connected to gateway bridge events`)),I&&clearInterval(I),I=setInterval(()=>{n.readyState===WebSocket.OPEN&&n.send(JSON.stringify({type:`ping`}))},3e4)},n.onmessage=e=>{try{let n=JSON.parse(e.data);if(n.type===`bridge:cmd_start`){let e=n.data,r={id:e.processId,name:e.name??`terminal`,command:e.command,status:`running`,pid:0,startedAt:new Date().toISOString(),output:[]};t().addProcess(r),t().addLog(A(`info`,`$ ${e.command}${e.cwd?` (in ${e.cwd})`:``}`,e.processId))}if(n.type===`bridge:cmd_output`){let e=n.data,r=t().processes.find(t=>t.id===e.processId);r&&t().updateProcess(e.processId,{output:[...r.output,e.chunk]}),t().addLog(A(e.stream===`stderr`?`warn`:`info`,e.chunk,e.processId))}if(n.type===`bridge:cmd_done`){let e=n.data;t().updateProcess(e.processId,{status:e.success?`completed`:`error`}),t().addLog(A(e.success?`info`:`error`,`Exit code: ${e.exitCode}`,e.processId))}if(n.type===`bridge:cmd_error`){let e=n.data;t().updateProcess(e.processId,{status:`error`}),t().addLog(A(`error`,e.message,e.processId))}}catch{}},n.onerror=()=>{},n.onclose=()=>{I&&=(clearInterval(I),null),e({gatewaySocket:null,isConnected:!1}),P&&setTimeout(()=>{P&&!t().gatewaySocket&&t().connectGateway()},5e3)},e({gatewaySocket:n})}catch{e({gatewaySocket:null})}}},disconnect:()=>{j=!1,P=!1,F&&=(clearInterval(F),null),I&&=(clearInterval(I),null);let{socket:n,gatewaySocket:r}=t();n&&(n.close(),e({socket:null,isConnected:!1})),r&&(r.close(),e({gatewaySocket:null}))}})),R={running:`bg-yellow-500/10 text-yellow-400 border-yellow-500/20`,completed:`bg-green-500/10 text-green-400 border-green-500/20`,finished:`bg-green-500/10 text-green-400 border-green-500/20`,error:`bg-red-500/10 text-red-400 border-red-500/20`,stopped:`bg-gray-500/10 text-gray-400 border-gray-500/20`};function z({status:e}){switch(e){case`running`:return(0,S.jsx)(a,{className:`h-3.5 w-3.5 text-yellow-400 animate-spin`});case`completed`:case`finished`:return(0,S.jsx)(r,{className:`h-3.5 w-3.5 text-green-400`});case`error`:return(0,S.jsx)(i,{className:`h-3.5 w-3.5 text-red-400`});case`stopped`:return(0,S.jsx)(b,{className:`h-3.5 w-3.5 text-gray-400`});default:return(0,S.jsx)(s,{className:`h-3.5 w-3.5 text-muted-foreground`})}}function B(){let e=L(e=>e.processes);return e.length===0?(0,S.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-8 text-center text-muted-foreground`,children:[(0,S.jsx)(s,{className:`h-8 w-8 opacity-30 mb-2`}),(0,S.jsx)(`p`,{className:`text-sm`,children:`Sin procesos activos`}),(0,S.jsx)(`p`,{className:`text-xs opacity-60 mt-1`,children:`Los comandos ejecutados por el agente aparecerán aquí`})]}):(0,S.jsx)(`div`,{className:`space-y-2 p-1`,children:e.map(e=>(0,S.jsxs)(`div`,{className:`rounded-lg border border-border bg-card/50 p-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,S.jsx)(z,{status:e.status}),(0,S.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,S.jsx)(`span`,{className:`text-sm font-medium font-mono truncate`,children:e.name}),e.pid>0&&(0,S.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`PID: `,e.pid]}),(0,S.jsx)(p,{variant:`outline`,className:`text-[10px] px-1.5 py-0 ml-auto ${R[e.status]??``}`,children:e.status})]}),e.command&&(0,S.jsxs)(`p`,{className:`text-xs text-muted-foreground font-mono mt-0.5 truncate`,children:[`$ `,e.command]}),e.status===`running`&&(0,S.jsx)(v,{value:void 0,className:`h-0.5 mt-2`})]})]}),e.output.length>0&&(0,S.jsx)(`div`,{className:`mt-2 rounded bg-black/30 px-2 py-1.5 max-h-24 overflow-y-auto`,children:(0,S.jsx)(`pre`,{className:`text-[10px] font-mono text-green-400/80 whitespace-pre-wrap break-all`,children:e.output.slice(-20).join(``)})})]},e.id))})}var V={info:`text-foreground/80`,warn:`text-yellow-400`,error:`text-red-400`,debug:`text-muted-foreground/60`},H={info:` `,warn:`! `,error:`✗ `,debug:`· `};function U(){let e=L(e=>e.logs),t=L(e=>e.clearLogs);return(0,S.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,S.jsx)(s,{className:`h-3.5 w-3.5`}),(0,S.jsx)(`span`,{className:`font-mono uppercase tracking-wider`,children:`Terminal Log`}),(0,S.jsxs)(`span`,{className:`text-muted-foreground/50`,children:[`(`,e.length,`)`]})]}),e.length>0&&(0,S.jsxs)(u,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:t,children:[(0,S.jsx)(c,{className:`h-3 w-3 mr-1`}),`Clear`]})]}),(0,S.jsx)(y,{className:`flex-1 font-mono text-xs`,children:e.length===0?(0,S.jsx)(`div`,{className:`flex items-center justify-center h-32 text-muted-foreground/50`,children:(0,S.jsx)(`p`,{children:`No logs yet — run a command to see output here`})}):(0,S.jsx)(`div`,{className:`p-3 space-y-0.5`,children:e.map(e=>(0,S.jsxs)(`div`,{className:`flex gap-2 ${V[e.level]??`text-foreground/80`}`,children:[(0,S.jsx)(`span`,{className:`text-muted-foreground/40 shrink-0 w-[72px] truncate`,children:new Date(e.timestamp).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}),(0,S.jsx)(`span`,{className:`shrink-0 w-4`,children:H[e.level]??` `}),(0,S.jsx)(`span`,{className:`break-all whitespace-pre-wrap`,children:e.message})]},e.id))})})]})}function W(){let{isConnected:e,connect:t,connectGateway:n,processes:r,logs:i}=L();(0,x.useEffect)(()=>{t(),n()},[t,n]);let a=e?`connected`:`disconnected`,c=r.filter(e=>e.status===`running`).length;return(0,S.jsx)(`div`,{className:`hive-page mt-10`,children:(0,S.jsxs)(`div`,{className:`hive-page-container`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsxs)(`h1`,{className:`text-xl font-semibold flex items-center gap-2`,children:[(0,S.jsx)(s,{className:`h-5 w-5`}),`Code Bridge`]}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground mt-0.5`,children:`Monitoreo de comandos CLI y procesos del agente`})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-3`,children:[c>0&&(0,S.jsxs)(`span`,{className:`text-xs text-yellow-400 font-mono`,children:[c,` proceso`,c>1?`s`:``,` activo`,c>1?`s`:``]}),(0,S.jsx)(w,{status:a}),(0,S.jsxs)(u,{variant:`outline`,size:`sm`,onClick:()=>{t(),n()},children:[(0,S.jsx)(o,{className:`h-3.5 w-3.5 mr-1.5`}),`Reconectar`]})]})]}),(0,S.jsxs)(`div`,{className:`mt-4 grid grid-cols-1 lg:grid-cols-2 gap-4 h-[calc(100vh-14rem)]`,children:[(0,S.jsxs)(_,{className:`flex flex-col overflow-hidden`,children:[(0,S.jsx)(m,{className:`py-3 px-4 border-b`,children:(0,S.jsxs)(g,{className:`text-sm flex items-center justify-between`,children:[(0,S.jsx)(`span`,{children:`Procesos`}),(0,S.jsxs)(`span`,{className:`text-xs text-muted-foreground font-normal`,children:[r.length,` total`]})]})}),(0,S.jsx)(h,{className:`flex-1 overflow-y-auto p-2`,children:(0,S.jsx)(B,{})})]}),(0,S.jsxs)(_,{className:`flex flex-col overflow-hidden`,children:[(0,S.jsx)(m,{className:`py-3 px-4 border-b`,children:(0,S.jsxs)(g,{className:`text-sm flex items-center justify-between`,children:[(0,S.jsx)(`span`,{children:`Logs`}),(0,S.jsxs)(`span`,{className:`text-xs text-muted-foreground font-normal`,children:[i.length,` entradas`]})]})}),(0,S.jsx)(h,{className:`flex-1 overflow-hidden p-0`,children:(0,S.jsx)(U,{})})]})]})]})})}export{W as BridgePage};