@sleep2agi/agent-network-dashboard 0.4.5-preview.4 → 0.4.5-preview.41

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 (256) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/diagnostics/route-bundle-stats.json +50 -50
  4. package/.next/fallback-build-manifest.json +3 -3
  5. package/.next/prerender-manifest.json +3 -3
  6. package/.next/server/app/_global-error.html +1 -1
  7. package/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/_not-found.html +4 -4
  15. package/.next/server/app/_not-found.rsc +12 -12
  16. package/.next/server/app/_not-found.segments/_full.segment.rsc +12 -12
  17. package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  18. package/.next/server/app/_not-found.segments/_index.segment.rsc +7 -7
  19. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  20. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  21. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  22. package/.next/server/app/admin/page.js.nft.json +1 -1
  23. package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  24. package/.next/server/app/admin.html +4 -4
  25. package/.next/server/app/admin.rsc +14 -14
  26. package/.next/server/app/admin.segments/_full.segment.rsc +14 -14
  27. package/.next/server/app/admin.segments/_head.segment.rsc +4 -4
  28. package/.next/server/app/admin.segments/_index.segment.rsc +7 -7
  29. package/.next/server/app/admin.segments/_tree.segment.rsc +2 -2
  30. package/.next/server/app/admin.segments/admin/__PAGE__.segment.rsc +4 -4
  31. package/.next/server/app/admin.segments/admin.segment.rsc +3 -3
  32. package/.next/server/app/index.html +4 -4
  33. package/.next/server/app/index.rsc +14 -14
  34. package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  35. package/.next/server/app/index.segments/_full.segment.rsc +14 -14
  36. package/.next/server/app/index.segments/_head.segment.rsc +4 -4
  37. package/.next/server/app/index.segments/_index.segment.rsc +7 -7
  38. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  39. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  40. package/.next/server/app/login.html +2 -2
  41. package/.next/server/app/login.rsc +14 -14
  42. package/.next/server/app/login.segments/_full.segment.rsc +14 -14
  43. package/.next/server/app/login.segments/_head.segment.rsc +4 -4
  44. package/.next/server/app/login.segments/_index.segment.rsc +7 -7
  45. package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  46. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
  47. package/.next/server/app/login.segments/login.segment.rsc +3 -3
  48. package/.next/server/app/logs/page.js.nft.json +1 -1
  49. package/.next/server/app/logs/page_client-reference-manifest.js +1 -1
  50. package/.next/server/app/logs.html +4 -4
  51. package/.next/server/app/logs.rsc +14 -14
  52. package/.next/server/app/logs.segments/_full.segment.rsc +14 -14
  53. package/.next/server/app/logs.segments/_head.segment.rsc +4 -4
  54. package/.next/server/app/logs.segments/_index.segment.rsc +7 -7
  55. package/.next/server/app/logs.segments/_tree.segment.rsc +2 -2
  56. package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +4 -4
  57. package/.next/server/app/logs.segments/logs.segment.rsc +3 -3
  58. package/.next/server/app/messages/page.js.nft.json +1 -1
  59. package/.next/server/app/messages/page_client-reference-manifest.js +1 -1
  60. package/.next/server/app/messages.html +4 -4
  61. package/.next/server/app/messages.rsc +14 -14
  62. package/.next/server/app/messages.segments/_full.segment.rsc +14 -14
  63. package/.next/server/app/messages.segments/_head.segment.rsc +4 -4
  64. package/.next/server/app/messages.segments/_index.segment.rsc +7 -7
  65. package/.next/server/app/messages.segments/_tree.segment.rsc +2 -2
  66. package/.next/server/app/messages.segments/messages/__PAGE__.segment.rsc +4 -4
  67. package/.next/server/app/messages.segments/messages.segment.rsc +3 -3
  68. package/.next/server/app/node/page.js.nft.json +1 -1
  69. package/.next/server/app/node/page_client-reference-manifest.js +1 -1
  70. package/.next/server/app/node.html +4 -4
  71. package/.next/server/app/node.rsc +14 -14
  72. package/.next/server/app/node.segments/_full.segment.rsc +14 -14
  73. package/.next/server/app/node.segments/_head.segment.rsc +4 -4
  74. package/.next/server/app/node.segments/_index.segment.rsc +7 -7
  75. package/.next/server/app/node.segments/_tree.segment.rsc +2 -2
  76. package/.next/server/app/node.segments/node/__PAGE__.segment.rsc +4 -4
  77. package/.next/server/app/node.segments/node.segment.rsc +3 -3
  78. package/.next/server/app/nodes/page.js.nft.json +1 -1
  79. package/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
  80. package/.next/server/app/nodes.html +4 -4
  81. package/.next/server/app/nodes.rsc +14 -14
  82. package/.next/server/app/nodes.segments/_full.segment.rsc +14 -14
  83. package/.next/server/app/nodes.segments/_head.segment.rsc +4 -4
  84. package/.next/server/app/nodes.segments/_index.segment.rsc +7 -7
  85. package/.next/server/app/nodes.segments/_tree.segment.rsc +2 -2
  86. package/.next/server/app/nodes.segments/nodes/__PAGE__.segment.rsc +4 -4
  87. package/.next/server/app/nodes.segments/nodes.segment.rsc +3 -3
  88. package/.next/server/app/page.js.nft.json +1 -1
  89. package/.next/server/app/page_client-reference-manifest.js +1 -1
  90. package/.next/server/app/server-logs/page_client-reference-manifest.js +1 -1
  91. package/.next/server/app/server-logs.html +4 -4
  92. package/.next/server/app/server-logs.rsc +14 -14
  93. package/.next/server/app/server-logs.segments/_full.segment.rsc +14 -14
  94. package/.next/server/app/server-logs.segments/_head.segment.rsc +4 -4
  95. package/.next/server/app/server-logs.segments/_index.segment.rsc +7 -7
  96. package/.next/server/app/server-logs.segments/_tree.segment.rsc +2 -2
  97. package/.next/server/app/server-logs.segments/server-logs/__PAGE__.segment.rsc +4 -4
  98. package/.next/server/app/server-logs.segments/server-logs.segment.rsc +3 -3
  99. package/.next/server/app/settings/networks/page.js.nft.json +1 -1
  100. package/.next/server/app/settings/networks/page_client-reference-manifest.js +1 -1
  101. package/.next/server/app/settings/networks.html +4 -4
  102. package/.next/server/app/settings/networks.rsc +14 -14
  103. package/.next/server/app/settings/networks.segments/_full.segment.rsc +14 -14
  104. package/.next/server/app/settings/networks.segments/_head.segment.rsc +4 -4
  105. package/.next/server/app/settings/networks.segments/_index.segment.rsc +7 -7
  106. package/.next/server/app/settings/networks.segments/_tree.segment.rsc +2 -2
  107. package/.next/server/app/settings/networks.segments/settings/networks/__PAGE__.segment.rsc +4 -4
  108. package/.next/server/app/settings/networks.segments/settings/networks.segment.rsc +3 -3
  109. package/.next/server/app/settings/networks.segments/settings.segment.rsc +3 -3
  110. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  111. package/.next/server/app/settings/tokens/page_client-reference-manifest.js +1 -1
  112. package/.next/server/app/settings/tokens.html +4 -4
  113. package/.next/server/app/settings/tokens.rsc +14 -14
  114. package/.next/server/app/settings/tokens.segments/_full.segment.rsc +14 -14
  115. package/.next/server/app/settings/tokens.segments/_head.segment.rsc +4 -4
  116. package/.next/server/app/settings/tokens.segments/_index.segment.rsc +7 -7
  117. package/.next/server/app/settings/tokens.segments/_tree.segment.rsc +2 -2
  118. package/.next/server/app/settings/tokens.segments/settings/tokens/__PAGE__.segment.rsc +4 -4
  119. package/.next/server/app/settings/tokens.segments/settings/tokens.segment.rsc +3 -3
  120. package/.next/server/app/settings/tokens.segments/settings.segment.rsc +3 -3
  121. package/.next/server/app/settings.html +4 -4
  122. package/.next/server/app/settings.rsc +14 -14
  123. package/.next/server/app/settings.segments/_full.segment.rsc +14 -14
  124. package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
  125. package/.next/server/app/settings.segments/_index.segment.rsc +7 -7
  126. package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  127. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
  128. package/.next/server/app/settings.segments/settings.segment.rsc +3 -3
  129. package/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
  130. package/.next/server/app/tasks/page.js.nft.json +1 -1
  131. package/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
  132. package/.next/server/app/tasks.html +4 -4
  133. package/.next/server/app/tasks.rsc +14 -14
  134. package/.next/server/app/tasks.segments/_full.segment.rsc +14 -14
  135. package/.next/server/app/tasks.segments/_head.segment.rsc +4 -4
  136. package/.next/server/app/tasks.segments/_index.segment.rsc +7 -7
  137. package/.next/server/app/tasks.segments/_tree.segment.rsc +2 -2
  138. package/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +4 -4
  139. package/.next/server/app/tasks.segments/tasks.segment.rsc +3 -3
  140. package/.next/server/chunks/ssr/[root-of-the-server]__02ee4km._.js +3 -0
  141. package/.next/server/chunks/ssr/[root-of-the-server]__02ee4km._.js.map +1 -0
  142. package/.next/server/chunks/ssr/[root-of-the-server]__0jjqrcf._.js +3 -0
  143. package/.next/server/chunks/ssr/[root-of-the-server]__0jjqrcf._.js.map +1 -0
  144. package/.next/server/chunks/ssr/[root-of-the-server]__0o8yj3c._.js +3 -0
  145. package/.next/server/chunks/ssr/[root-of-the-server]__0o8yj3c._.js.map +1 -0
  146. package/.next/server/chunks/ssr/[root-of-the-server]__0xm3h9x._.js +1 -1
  147. package/.next/server/chunks/ssr/[root-of-the-server]__0xm3h9x._.js.map +1 -1
  148. package/.next/server/chunks/ssr/_0nne7mz._.js +3 -0
  149. package/.next/server/chunks/ssr/_0nne7mz._.js.map +1 -0
  150. package/.next/server/chunks/ssr/app_0.zbtn5._.js +9 -0
  151. package/.next/server/chunks/ssr/app_0.zbtn5._.js.map +1 -0
  152. package/.next/server/chunks/ssr/app_04n78pr._.js +3 -0
  153. package/.next/server/chunks/ssr/app_04n78pr._.js.map +1 -0
  154. package/.next/server/chunks/ssr/app_0_agk0r._.js +3 -0
  155. package/.next/server/chunks/ssr/app_0_agk0r._.js.map +1 -0
  156. package/.next/server/chunks/ssr/app_0dk5wao._.js +1 -1
  157. package/.next/server/chunks/ssr/app_0dk5wao._.js.map +1 -1
  158. package/.next/server/chunks/ssr/app_0izi28j._.js +1 -1
  159. package/.next/server/chunks/ssr/app_0izi28j._.js.map +1 -1
  160. package/.next/server/chunks/ssr/app_0tncr1_._.js +3 -0
  161. package/.next/server/chunks/ssr/app_0tncr1_._.js.map +1 -0
  162. package/.next/server/chunks/ssr/app_components_08ys5y3._.js +5 -5
  163. package/.next/server/chunks/ssr/app_components_08ys5y3._.js.map +1 -1
  164. package/.next/server/chunks/ssr/app_components_0lhp_k.._.js +3 -0
  165. package/.next/server/chunks/ssr/app_components_0lhp_k.._.js.map +1 -0
  166. package/.next/server/chunks/ssr/app_login_page_tsx_0z71ad3._.js +1 -1
  167. package/.next/server/chunks/ssr/app_login_page_tsx_0z71ad3._.js.map +1 -1
  168. package/.next/server/chunks/ssr/app_server-logs_page_tsx_0_kpp1p._.js +1 -1
  169. package/.next/server/chunks/ssr/app_server-logs_page_tsx_0_kpp1p._.js.map +1 -1
  170. package/.next/server/chunks/ssr/app_tasks_page_tsx_0z-d6mp._.js +1 -1
  171. package/.next/server/chunks/ssr/app_tasks_page_tsx_0z-d6mp._.js.map +1 -1
  172. package/.next/server/middleware-build-manifest.js +3 -3
  173. package/.next/server/pages/404.html +4 -4
  174. package/.next/server/pages/500.html +1 -1
  175. package/.next/server/server-reference-manifest.js +1 -1
  176. package/.next/server/server-reference-manifest.json +1 -1
  177. package/.next/static/chunks/02oje7pf-g1v5.js +1 -0
  178. package/.next/static/chunks/06x7w8nwggx~~.js +1 -0
  179. package/.next/static/chunks/0943n0t.9c-o2.js +1 -0
  180. package/.next/static/chunks/{07okhs5561y5y.js → 0c1bp~g7.8ru..js} +1 -1
  181. package/.next/static/chunks/0csmku~3y472t.js +1 -0
  182. package/.next/static/chunks/0df0py1glk9xm.js +1 -0
  183. package/.next/static/chunks/0edt_z0rlxgfk.js +1 -0
  184. package/.next/static/chunks/0g394kqz_d5.x.js +1 -0
  185. package/.next/static/chunks/0irkayokwc1fm.js +1 -0
  186. package/.next/static/chunks/0j8ee64jv6zb7.js +7 -0
  187. package/.next/static/chunks/0qe_pfeioih-5.css +2 -0
  188. package/.next/static/chunks/0qnpc7rbxn12u.js +1 -0
  189. package/.next/static/chunks/0xdl435t_mf1c.js +1 -0
  190. package/.next/static/chunks/0~n.cadw9_e8s.js +7 -0
  191. package/.next/static/chunks/11_n-vjzf735y.js +1 -0
  192. package/.next/static/chunks/15c9pv6gxir.5.js +1 -0
  193. package/.next/trace +2 -2
  194. package/.next/trace-build +1 -1
  195. package/app/admin/page.tsx +77 -25
  196. package/app/components/AgentCard.tsx +19 -5
  197. package/app/components/AliasAvatar.tsx +51 -0
  198. package/app/components/BroadcastBar.tsx +22 -4
  199. package/app/components/DispatchPanel.tsx +9 -5
  200. package/app/components/EmptyState.tsx +77 -4
  201. package/app/components/HealthBanner.tsx +1 -1
  202. package/app/components/HelpOverlay.tsx +50 -10
  203. package/app/components/InboxPanel.tsx +6 -3
  204. package/app/components/Sidebar.tsx +49 -41
  205. package/app/components/TaskChatPanel.tsx +8 -10
  206. package/app/components/TaskDrawer.tsx +72 -28
  207. package/app/components/TopoGraph.tsx +118 -24
  208. package/app/globals.css +90 -0
  209. package/app/lib/version.ts +7 -0
  210. package/app/login/page.tsx +37 -7
  211. package/app/logs/page.tsx +72 -21
  212. package/app/messages/page.tsx +85 -51
  213. package/app/node/page.tsx +32 -15
  214. package/app/nodes/page.tsx +21 -23
  215. package/app/page.tsx +71 -13
  216. package/app/server-logs/page.tsx +37 -3
  217. package/app/settings/networks/page.tsx +37 -13
  218. package/app/settings/page.tsx +38 -10
  219. package/app/tasks/page.tsx +77 -41
  220. package/package.json +1 -1
  221. package/.next/server/chunks/ssr/[root-of-the-server]__0_jnflc._.js +0 -3
  222. package/.next/server/chunks/ssr/[root-of-the-server]__0_jnflc._.js.map +0 -1
  223. package/.next/server/chunks/ssr/[root-of-the-server]__0nrckjd._.js +0 -3
  224. package/.next/server/chunks/ssr/[root-of-the-server]__0nrckjd._.js.map +0 -1
  225. package/.next/server/chunks/ssr/[root-of-the-server]__12mpoig._.js +0 -3
  226. package/.next/server/chunks/ssr/[root-of-the-server]__12mpoig._.js.map +0 -1
  227. package/.next/server/chunks/ssr/_0d-fuox._.js +0 -3
  228. package/.next/server/chunks/ssr/_0d-fuox._.js.map +0 -1
  229. package/.next/server/chunks/ssr/app_0.0wpa~._.js +0 -3
  230. package/.next/server/chunks/ssr/app_0.0wpa~._.js.map +0 -1
  231. package/.next/server/chunks/ssr/app_0ap_oiq._.js +0 -3
  232. package/.next/server/chunks/ssr/app_0ap_oiq._.js.map +0 -1
  233. package/.next/server/chunks/ssr/app_0et5yua._.js +0 -3
  234. package/.next/server/chunks/ssr/app_0et5yua._.js.map +0 -1
  235. package/.next/server/chunks/ssr/app_0ff~kjj._.js +0 -9
  236. package/.next/server/chunks/ssr/app_0ff~kjj._.js.map +0 -1
  237. package/.next/server/chunks/ssr/app_page_tsx_0es_sk2._.js +0 -3
  238. package/.next/server/chunks/ssr/app_page_tsx_0es_sk2._.js.map +0 -1
  239. package/.next/static/chunks/02flrewxlf_m_.js +0 -1
  240. package/.next/static/chunks/03sm_xa792mxv.css +0 -2
  241. package/.next/static/chunks/051gslfjka1kj.js +0 -1
  242. package/.next/static/chunks/06t_vzei8s9_h.js +0 -1
  243. package/.next/static/chunks/07oobuohrpigy.js +0 -1
  244. package/.next/static/chunks/0e7c40p~wq665.js +0 -1
  245. package/.next/static/chunks/0g7m7zk.v7g6h.js +0 -1
  246. package/.next/static/chunks/0khpyxpdrp~ty.js +0 -1
  247. package/.next/static/chunks/0lo_g.q1fm-hr.js +0 -7
  248. package/.next/static/chunks/0m328uz90rp81.js +0 -1
  249. package/.next/static/chunks/0ogeals5ufhho.js +0 -1
  250. package/.next/static/chunks/1031v6nw33ud3.js +0 -1
  251. package/.next/static/chunks/10ir.g.n~hre0.js +0 -7
  252. package/.next/static/chunks/10njj7kn9ylkf.js +0 -1
  253. package/.next/static/chunks/13.dst7liziwo.js +0 -1
  254. /package/.next/static/{dvKGMaUCm52sSTROKhYVL → t8ckUU0UVyOpv2ymrRHll}/_buildManifest.js +0 -0
  255. /package/.next/static/{dvKGMaUCm52sSTROKhYVL → t8ckUU0UVyOpv2ymrRHll}/_clientMiddlewareManifest.js +0 -0
  256. /package/.next/static/{dvKGMaUCm52sSTROKhYVL → t8ckUU0UVyOpv2ymrRHll}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18150,e=>{"use strict";e.s(["formatUptime",0,function(e){let a=Math.floor(e/3600),t=Math.floor(e%3600/60);return a>0?`${a}h ${t}m`:`${t}m`},"timeAgo",0,function(e){if(!e)return"--";let a=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return a<60?`${a}s ago`:a<3600?`${Math.floor(a/60)}m ago`:a<86400?`${Math.floor(a/3600)}h ago`:`${Math.floor(a/86400)}d ago`}])},69874,e=>{"use strict";var a=e.i(18050);let t=[180,200,220,270,300,330,30,90];e.s(["AliasAvatar",0,function({alias:e,size:s=28,className:l=""}){let r=function(e){let a=0;for(let t=0;t<e.length;t++)a=31*a+e.charCodeAt(t)>>>0;let s=t[a%t.length];return{bg:`hsl(${s} 55% 22%)`,ring:`hsl(${s} 60% 45%)`,text:`hsl(${s} 80% 78%)`}}(e),n=Math.max(9,Math.round(.42*s));return(0,a.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${l}`,style:{width:s,height:s,fontSize:n,backgroundColor:r.bg,borderColor:r.ring,color:r.text},title:e,"aria-hidden":!0,children:e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"})}])},53136,e=>{"use strict";var a=e.i(18050),t=e.i(71645),s=e.i(18566),l=e.i(22016),r=e.i(58442),n=e.i(18150),i=e.i(69874);function o({tmuxName:e}){let[s,l]=(0,t.useState)(""),[r,n]=(0,t.useState)(!1),[i,d]=(0,t.useState)(!1),c=async()=>{n(!0);try{let a=await fetch(`/api/hub/tmux?name=${encodeURIComponent(e)}`),t=await a.json();l(t.output||t.error||"No output")}catch{l("Failed to fetch")}n(!1)};return(0,a.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("h2",{className:"text-sm font-semibold text-gray-300",children:["Terminal (",e,")"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{onClick:c,disabled:r,className:"text-xs text-cyan-400 hover:text-cyan-300 disabled:text-gray-600",children:r?"Loading...":"Capture"}),s&&(0,a.jsx)("button",{onClick:()=>d(!i),className:"text-xs text-gray-500 hover:text-gray-300",children:i?"Collapse":"Expand"})]})]}),s&&(0,a.jsx)("pre",{className:`text-[11px] text-green-300 bg-[#050510] rounded-lg px-3 py-2 border border-[#1a1a2a] overflow-x-auto whitespace-pre font-mono ${i?"max-h-96":"max-h-32"} overflow-y-auto`,children:s}),!s&&(0,a.jsx)("p",{className:"text-xs text-gray-600",children:"Click Capture to view terminal output"})]})}function d(){let e=(0,s.useSearchParams)().get("alias")||"",[r,n]=(0,t.useState)(null),[o,d]=(0,t.useState)([]),[x,h]=(0,t.useState)(0),[u,m]=(0,t.useState)(""),[b,p]=(0,t.useState)(""),[g,f]=(0,t.useState)(!1),v=(0,t.useCallback)(async()=>{if(e)try{let a=await fetch(`/api/hub/session?alias=${encodeURIComponent(e)}`),t=await a.json();t.session&&n(t.session),t.inbox&&d(t.inbox),h(t.sse||0),m("")}catch(e){m(e instanceof Error?e.message:"fetch failed")}},[e]);(0,t.useEffect)(()=>{v();let e=setInterval(v,5e3);return()=>clearInterval(e)},[v]);let[y,j]=(0,t.useState)(""),w=async()=>{if(b.trim()&&e){f(!0),j("");try{let a=await fetch("/api/hub/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({alias:e,task:b})}),t=await a.json();t.ok?(p(""),setTimeout(v,2e3)):j(t.error||"Send failed")}catch(e){j(e instanceof Error?e.message:"Send failed")}f(!1)}};if(!e)return(0,a.jsx)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-6 font-mono flex items-center justify-center",children:(0,a.jsxs)("p",{className:"text-gray-500",children:["No alias specified. ",(0,a.jsx)(l.default,{href:"/",className:"text-blue-400 hover:underline",children:"Back to dashboard"})]})});let N=r?.status==="working"?"text-green-400":r?.status==="idle"?"text-blue-400":"text-gray-500";return(0,a.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-6 lg:ml-0 ml-10",children:[(0,a.jsx)(l.default,{href:"/nodes",className:"text-gray-500 hover:text-gray-300 text-sm shrink-0",children:"← Nodes"}),(0,a.jsx)(i.AliasAvatar,{alias:e,size:32}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h1",{className:"text-xl sm:text-2xl font-bold text-white truncate",children:e}),(0,a.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${x>0?r?.status==="working"?"bg-green-500 animate-pulse":"bg-emerald-400":"bg-gray-500"}`}),(0,a.jsx)("span",{className:`text-[10px] uppercase tracking-wide font-semibold ${N}`,children:r?.status||"unknown"})]}),r?.agent&&(0,a.jsxs)("div",{className:"text-xs text-gray-500 truncate",children:[r.agent,r.server?(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsx)("span",{className:"text-gray-700 mx-1",children:"·"})," ",r.server]}):null]})]})]}),u&&(0,a.jsx)("div",{className:"bg-red-900/20 border border-red-800/40 text-red-300 px-4 py-2 rounded-lg mb-6 text-sm",children:u}),(0,a.jsx)(c,{alias:e,session:r,sse:x,sendMsg:b,setSendMsg:p,sending:g,sendTask:w,sendError:y})]})}function c({alias:e,session:s,sse:l,sendMsg:n,setSendMsg:i,sending:d,sendTask:x,sendError:u}){let[m,b]=(0,t.useState)("chat"),[p,g]=(0,t.useState)([]),[f,v]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{"events"!==m||f||fetch("/api/hub/task-events?limit=50").then(e=>e.json()).then(e=>{g(e.events||[]),v(!0)}).catch(()=>v(!0))},[m,f]),(0,a.jsxs)("div",{className:"bg-[#0d0d1a] border border-[#2a2a4a] rounded-xl overflow-hidden h-[calc(100vh-140px)] flex flex-col",children:[(0,a.jsx)("div",{className:"flex border-b border-[#2a2a4a] bg-[#0a0a15] shrink-0",children:[{id:"chat",label:"Chat",icon:"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"},{id:"events",label:"Events",icon:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z M14 2v6h6 M16 13H8 M16 17H8 M10 9H8"},{id:"info",label:"Info",icon:"M12 21a9 9 0 100-18 9 9 0 000 18z M12 8h.01 M11 12h1v4h1"}].map(e=>(0,a.jsxs)("button",{onClick:()=>b(e.id),className:`flex items-center gap-2 px-5 py-3 text-sm font-medium border-b-2 transition-colors ${m===e.id?"border-cyan-400 text-cyan-300":"border-transparent text-gray-500 hover:text-gray-300"}`,children:[(0,a.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:e.icon})}),(0,a.jsx)("span",{children:e.label})]},e.id))}),(0,a.jsxs)("div",{className:"flex-1 overflow-hidden",children:["chat"===m&&(0,a.jsx)(r.TaskChatPanel,{alias:e,onClose:()=>{},inline:!0}),"events"===m&&(0,a.jsx)(h,{events:p,loading:!f}),"info"===m&&(0,a.jsxs)("div",{className:"p-4 overflow-y-auto h-full space-y-4 max-w-2xl",children:[(0,a.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-3",children:"Node Info"}),(0,a.jsx)("div",{className:"space-y-2 text-xs",children:[{label:"Node ID",value:s?.node_id,alwaysShow:!0},{label:"Session ID",value:s?.session_id,alwaysShow:!0},{label:"Resume ID",value:s?.resume_id,alwaysShow:!0},{label:"Alias",value:s?.alias,alwaysShow:!0},{label:"Agent",value:s?.agent,alwaysShow:!0},{label:"Model",value:s?.model,alwaysShow:!0},{label:"Version",value:s?.version},{label:"Server",value:s?.server,alwaysShow:!0},{label:"Hostname",value:s?.hostname,alwaysShow:!0},{label:"IP",value:s?.ip,alwaysShow:!0},{label:"Project",value:s?.project_dir},{label:"Config",value:s?.config_path,alwaysShow:!0},{label:"Channels",value:s?.channels?.length?Array.isArray(s.channels)?s.channels.join(", "):s.channels:null,alwaysShow:!0},{label:"Tmux",value:s?.tmux_name},{label:"SSE",value:l>0?`Connected (${l})`:"Disconnected",alwaysShow:!0},{label:"Progress",value:s?.progress?`${s.progress}%`:null},{label:"Score",value:s?.score},{label:"Last Seen",value:s?.last_seen_at,alwaysShow:!0},{label:"Registered",value:s?.registered_at,alwaysShow:!0},{label:"Updated",value:s?.updated_at,alwaysShow:!0}].map(({label:e,value:t,alwaysShow:s})=>t||s?(0,a.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,a.jsx)("span",{className:"text-gray-500 shrink-0",children:e}),(0,a.jsx)("span",{className:"text-gray-300 truncate max-w-[200px]",title:t?String(t):"--",children:t?String(t):"--"})]},e):null)})]}),s?.task&&(0,a.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-2",children:"Current Task"}),(0,a.jsx)("p",{className:"text-xs text-gray-400 whitespace-pre-wrap",children:s.task})]}),s?.output&&(0,a.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-2",children:"Last Output"}),(0,a.jsx)("p",{className:"text-xs text-gray-400 whitespace-pre-wrap max-h-48 overflow-y-auto",children:s.output})]}),(0,a.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-2",children:"Send Task"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:n,onChange:e=>i(e.target.value),onKeyDown:e=>"Enter"===e.key&&x(),placeholder:`Send task to ${e}...`,className:"flex-1 bg-[#0a0a15] border border-[#2a2a4a] rounded px-3 py-2 text-xs text-white placeholder-gray-600 focus:border-blue-500 focus:outline-none"}),(0,a.jsx)("button",{onClick:x,disabled:d||!n.trim(),className:"px-3 py-2 bg-blue-600 hover:bg-blue-500 disabled:bg-gray-700 text-white text-xs rounded transition-colors",children:d?"...":"Send"})]}),u&&(0,a.jsx)("div",{className:"mt-2 text-xs text-red-400",children:u})]}),s?.tmux_name&&(0,a.jsx)(o,{tmuxName:s.tmux_name})]})]})]})}let x={delivered:{dot:"bg-blue-400",line:"bg-blue-500/30",icon:"📬"},acked:{dot:"bg-yellow-400",line:"bg-yellow-500/30",icon:"✅"},running:{dot:"bg-green-400",line:"bg-green-500/30",icon:"⚡"},replied:{dot:"bg-purple-400",line:"bg-purple-500/30",icon:"💬"},failed:{dot:"bg-red-400",line:"bg-red-500/30",icon:"❌"},created:{dot:"bg-gray-400",line:"bg-gray-500/30",icon:"📝"}};function h({events:e,loading:t}){if(t)return(0,a.jsx)("div",{className:"flex justify-center py-8",children:(0,a.jsx)("div",{className:"w-5 h-5 border-2 border-cyan-500/30 border-t-cyan-500 rounded-full animate-spin"})});if(0===e.length)return(0,a.jsx)("div",{className:"text-center py-12 text-gray-600 text-xs",children:"No task events yet"});let s=new Map;return e.forEach(e=>{let a=e.task_id||`ungrouped-${e.id}`,t=s.get(a)||[];t.push(e),s.set(a,t)}),(0,a.jsx)("div",{className:"p-4 overflow-y-auto h-full space-y-4",children:[...s.entries()].map(([e,t])=>(0,a.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,a.jsxs)("div",{className:"text-[10px] text-gray-600 mb-3 truncate",children:["Task: ",e.slice(0,20),"..."]}),(0,a.jsxs)("div",{className:"relative pl-6",children:[(0,a.jsx)("div",{className:"absolute left-[9px] top-2 bottom-2 w-0.5 bg-[#1a1a2a]"}),t.map((e,t)=>{let s=x[e.to_status]||x.created;return(0,a.jsxs)("div",{className:"relative pb-4 last:pb-0",children:[(0,a.jsx)("div",{className:`absolute -left-6 top-0.5 w-[18px] h-[18px] rounded-full ${s.dot} flex items-center justify-center text-[9px] z-10 border-2 border-[#111128]`,children:s.icon.length<=2?s.icon:""}),(0,a.jsxs)("div",{className:"ml-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-medium ${"failed"===e.to_status?"text-red-400":"replied"===e.to_status?"text-purple-400":"text-gray-300"}`,children:e.event_type}),e.from_status&&(0,a.jsxs)("span",{className:"text-[10px] text-gray-600",children:[e.from_status," → ",e.to_status]}),(0,a.jsx)("span",{className:"text-[10px] text-gray-600 ml-auto",children:(0,n.timeAgo)(e.created_at)})]}),e.detail&&(0,a.jsxs)("div",{className:"text-[11px] text-gray-500 mt-0.5 truncate",children:[e.detail.slice(0,50),e.detail.length>50?"...":""]})]})]},e.id)})]})]},e))})}e.s(["default",0,function(){return(0,a.jsx)(t.Suspense,{fallback:(0,a.jsx)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-6 font-mono",children:"Loading..."}),children:(0,a.jsx)(d,{})})}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18150,e=>{"use strict";e.s(["formatUptime",0,function(e){let t=Math.floor(e/3600),s=Math.floor(e%3600/60);return t>0?`${t}h ${s}m`:`${s}m`},"timeAgo",0,function(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}])},69874,e=>{"use strict";var t=e.i(18050);let s=[180,200,220,270,300,330,30,90];e.s(["AliasAvatar",0,function({alias:e,size:r=28,className:n=""}){let i=function(e){let t=0;for(let s=0;s<e.length;s++)t=31*t+e.charCodeAt(s)>>>0;let r=s[t%s.length];return{bg:`hsl(${r} 55% 22%)`,ring:`hsl(${r} 60% 45%)`,text:`hsl(${r} 80% 78%)`}}(e),a=Math.max(9,Math.round(.42*r));return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${n}`,style:{width:r,height:r,fontSize:a,backgroundColor:i.bg,borderColor:i.ring,color:i.text},title:e,"aria-hidden":!0,children:e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"})}])},95356,e=>{"use strict";var t=e.i(18050),s=e.i(71645),r=e.i(22016);let n={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function i({variant:e,size:s}){let r={width:s,height:s},n={fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"nodes":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...n,children:[(0,t.jsx)("circle",{cx:"32",cy:"14",r:"4"}),(0,t.jsx)("circle",{cx:"14",cy:"44",r:"4"}),(0,t.jsx)("circle",{cx:"50",cy:"44",r:"4"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"14",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"50",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"18",y1:"44",x2:"46",y2:"44",strokeDasharray:"3 3",opacity:"0.6"})]})});case"tasks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...n,children:[(0,t.jsx)("rect",{x:"14",y:"14",width:"36",height:"6",rx:"1.5"}),(0,t.jsx)("rect",{x:"14",y:"26",width:"36",height:"6",rx:"1.5",opacity:"0.6"}),(0,t.jsx)("rect",{x:"14",y:"38",width:"36",height:"6",rx:"1.5",opacity:"0.35"})]})});case"messages":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...n,children:[(0,t.jsx)("path",{d:"M14 18 h36 a3 3 0 0 1 3 3 v18 a3 3 0 0 1 -3 3 h-18 l-8 6 v-6 h-10 a3 3 0 0 1 -3 -3 v-18 a3 3 0 0 1 3 -3 z"}),(0,t.jsx)("line",{x1:"22",y1:"28",x2:"42",y2:"28",opacity:"0.5"}),(0,t.jsx)("line",{x1:"22",y1:"34",x2:"36",y2:"34",opacity:"0.5"})]})});case"logs":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...n,children:[(0,t.jsx)("path",{d:"M18 12 h22 l8 8 v32 a2 2 0 0 1 -2 2 h-28 a2 2 0 0 1 -2 -2 v-38 a2 2 0 0 1 2 -2 z"}),(0,t.jsx)("path",{d:"M40 12 v8 h8",opacity:"0.6"}),(0,t.jsx)("line",{x1:"24",y1:"32",x2:"40",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"24",y1:"38",x2:"40",y2:"38",opacity:"0.4"}),(0,t.jsx)("line",{x1:"24",y1:"44",x2:"34",y2:"44",opacity:"0.25"})]})});case"tokens":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...n,children:[(0,t.jsx)("circle",{cx:"22",cy:"32",r:"8"}),(0,t.jsx)("line",{x1:"30",y1:"32",x2:"54",y2:"32"}),(0,t.jsx)("line",{x1:"44",y1:"32",x2:"44",y2:"38"}),(0,t.jsx)("line",{x1:"50",y1:"32",x2:"50",y2:"40"})]})});case"networks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...n,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"18"}),(0,t.jsx)("ellipse",{cx:"32",cy:"32",rx:"18",ry:"9",opacity:"0.55"}),(0,t.jsx)("line",{x1:"14",y1:"32",x2:"50",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"32",y1:"14",x2:"32",y2:"50",opacity:"0.55"})]})});default:return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...n,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"14",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"32",cy:"32",r:"3"})]})})}}function a({variant:e="generic",title:s,sub:l,cta:o,compact:c=!1}){let x=n[e],h=s??x.title,d=l??x.sub;return(0,t.jsxs)("div",{className:`text-center ${c?"py-8":"py-16"} px-4`,role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)(i,{variant:e,size:c?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${c?"text-sm":"text-base"}`,children:h}),d&&(0,t.jsx)("p",{className:`text-gray-500 ${c?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:d}),o&&(0,t.jsx)("div",{className:"mt-4",children:o.href?(0,t.jsxs)(r.default,{href:o.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,t.jsxs)("button",{onClick:o.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}function l({cmd:e}){let[r,n]=(0,s.useState)(!1),i=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1800)}catch{}};return(0,t.jsxs)("div",{className:"anet-empty-cmd flex items-center gap-2 bg-[#0a0a15] border border-[#2a2a4a] rounded-lg pl-4 pr-1.5 py-1.5 text-xs sm:text-sm",children:[(0,t.jsx)("code",{className:"text-cyan-300 font-mono select-all",children:e}),(0,t.jsx)("button",{type:"button",onClick:i,"aria-label":r?"Copied":"Copy command",className:"shrink-0 rounded-md px-2 py-1.5 text-[11px] text-gray-500 hover:text-gray-200 hover:bg-[#1a1a2a] transition-colors",children:r?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-green-400",children:[(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5"})}),"Copied"]}):(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Copy"]})})]})}e.s(["EmptyState",0,a,"NodesEmptyState",0,function({hint:e}){return e?.global_count?(0,t.jsx)(a,{variant:"nodes",title:"No agents in this network",sub:`Server has ${e.global_count} nodes globally, but none are registered to the current network. Switch network or contact admin.`}):(0,t.jsxs)("div",{className:"text-center py-16 px-4",role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)("svg",{viewBox:"0 0 64 64",width:56,height:56,children:(0,t.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[(0,t.jsx)("rect",{x:"10",y:"20",width:"44",height:"28",rx:"2"}),(0,t.jsx)("rect",{x:"20",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"32",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"44",y:"32",width:"4",height:"8",opacity:"0.5"}),(0,t.jsx)("line",{x1:"10",y1:"26",x2:"54",y2:"26",opacity:"0.4"}),(0,t.jsx)("circle",{cx:"14",cy:"23",r:"0.8",fill:"currentColor"})]})})}),(0,t.jsx)("h3",{className:"font-medium text-gray-300 text-base",children:"Spin up your first agent"}),(0,t.jsx)("p",{className:"text-gray-500 text-sm mt-2 max-w-md mx-auto leading-relaxed",children:"Run this in a fresh terminal to register an agent with this CommHub:"}),(0,t.jsx)("div",{className:"mt-4 inline-block",children:(0,t.jsx)(l,{cmd:"npx --yes @sleep2agi/agent-network init"})}),(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsxs)("a",{href:"https://anet.sh",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium text-gray-500 hover:text-cyan-300",children:["Full quickstart guide",(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}])},65822,e=>{"use strict";var t=e.i(83599),s=e.i(58963);let r=async e=>{let t=await fetch(e);if(401===t.status)throw window.location.assign("/login"),Error("unauthorized");return t.json()},n={refreshInterval:5e3,dedupingInterval:3e3};function i(e,t){if(!t)return e;let s=e.includes("?")?"&":"?";return`${e}${s}network_id=${encodeURIComponent(t)}`}e.s(["useAnetConfig",0,function(){let{data:e}=(0,t.default)("/api/anet/config",r,{refreshInterval:3e4});return{config:e||null}},"useHealth",0,function(){let{data:e,error:s}=(0,t.default)("/api/hub/health",r,n);return{health:e||null,error:s}},"useLicense",0,function(){let{data:e,error:s}=(0,t.default)("/api/hub/license",r,{refreshInterval:6e4});return{license:e?.ok?e:null,error:s}},"useMessages",0,function(e=100){let{networkId:a}=(0,s.useNetworkId)(),{data:l,error:o,isLoading:c}=(0,t.default)(i(`/api/hub/messages?limit=${e}`,a),r,n);return{messages:l?.messages||[],error:o,isLoading:c}},"useSessions",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:a,error:l,isLoading:o}=(0,t.default)(i("/api/hub/status",e),r,n);return{sessions:a?.sessions||[],hint:a?._hint,error:l,isLoading:o}},"useStats",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:a,error:l}=(0,t.default)(i("/api/hub/stats",e),r,n);return{stats:a?.ok?a:null,error:l}},"useTasks",0,function(e){let{networkId:a}=(0,s.useNetworkId)(),l=new URLSearchParams({limit:"100",...e}).toString(),{data:o,error:c,isLoading:x}=(0,t.default)(i(`/api/hub/tasks?${l}`,a),r,n);return{tasks:o?.tasks||[],count:o?.count??0,source:o?.source,error:c,isLoading:x}}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18150,e=>{"use strict";e.s(["formatUptime",0,function(e){let t=Math.floor(e/3600),s=Math.floor(e%3600/60);return t>0?`${t}h ${s}m`:`${s}m`},"timeAgo",0,function(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}])},95356,e=>{"use strict";var t=e.i(18050),s=e.i(71645),a=e.i(22016);let r={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function n({variant:e,size:s}){let a={width:s,height:s},r={fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"nodes":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"14",r:"4"}),(0,t.jsx)("circle",{cx:"14",cy:"44",r:"4"}),(0,t.jsx)("circle",{cx:"50",cy:"44",r:"4"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"14",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"50",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"18",y1:"44",x2:"46",y2:"44",strokeDasharray:"3 3",opacity:"0.6"})]})});case"tasks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("rect",{x:"14",y:"14",width:"36",height:"6",rx:"1.5"}),(0,t.jsx)("rect",{x:"14",y:"26",width:"36",height:"6",rx:"1.5",opacity:"0.6"}),(0,t.jsx)("rect",{x:"14",y:"38",width:"36",height:"6",rx:"1.5",opacity:"0.35"})]})});case"messages":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M14 18 h36 a3 3 0 0 1 3 3 v18 a3 3 0 0 1 -3 3 h-18 l-8 6 v-6 h-10 a3 3 0 0 1 -3 -3 v-18 a3 3 0 0 1 3 -3 z"}),(0,t.jsx)("line",{x1:"22",y1:"28",x2:"42",y2:"28",opacity:"0.5"}),(0,t.jsx)("line",{x1:"22",y1:"34",x2:"36",y2:"34",opacity:"0.5"})]})});case"logs":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M18 12 h22 l8 8 v32 a2 2 0 0 1 -2 2 h-28 a2 2 0 0 1 -2 -2 v-38 a2 2 0 0 1 2 -2 z"}),(0,t.jsx)("path",{d:"M40 12 v8 h8",opacity:"0.6"}),(0,t.jsx)("line",{x1:"24",y1:"32",x2:"40",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"24",y1:"38",x2:"40",y2:"38",opacity:"0.4"}),(0,t.jsx)("line",{x1:"24",y1:"44",x2:"34",y2:"44",opacity:"0.25"})]})});case"tokens":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"22",cy:"32",r:"8"}),(0,t.jsx)("line",{x1:"30",y1:"32",x2:"54",y2:"32"}),(0,t.jsx)("line",{x1:"44",y1:"32",x2:"44",y2:"38"}),(0,t.jsx)("line",{x1:"50",y1:"32",x2:"50",y2:"40"})]})});case"networks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"18"}),(0,t.jsx)("ellipse",{cx:"32",cy:"32",rx:"18",ry:"9",opacity:"0.55"}),(0,t.jsx)("line",{x1:"14",y1:"32",x2:"50",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"32",y1:"14",x2:"32",y2:"50",opacity:"0.55"})]})});default:return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"14",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"32",cy:"32",r:"3"})]})})}}function i({variant:e="generic",title:s,sub:o,cta:l,compact:c=!1}){let x=r[e],d=s??x.title,h=o??x.sub;return(0,t.jsxs)("div",{className:`text-center ${c?"py-8":"py-16"} px-4`,role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)(n,{variant:e,size:c?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${c?"text-sm":"text-base"}`,children:d}),h&&(0,t.jsx)("p",{className:`text-gray-500 ${c?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:h}),l&&(0,t.jsx)("div",{className:"mt-4",children:l.href?(0,t.jsxs)(a.default,{href:l.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[l.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,t.jsxs)("button",{onClick:l.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[l.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}function o({cmd:e}){let[a,r]=(0,s.useState)(!1),n=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1800)}catch{}};return(0,t.jsxs)("div",{className:"anet-empty-cmd flex items-center gap-2 bg-[#0a0a15] border border-[#2a2a4a] rounded-lg pl-4 pr-1.5 py-1.5 text-xs sm:text-sm",children:[(0,t.jsx)("code",{className:"text-cyan-300 font-mono select-all",children:e}),(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":a?"Copied":"Copy command",className:"shrink-0 rounded-md px-2 py-1.5 text-[11px] text-gray-500 hover:text-gray-200 hover:bg-[#1a1a2a] transition-colors",children:a?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-green-400",children:[(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5"})}),"Copied"]}):(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Copy"]})})]})}e.s(["EmptyState",0,i,"NodesEmptyState",0,function({hint:e}){return e?.global_count?(0,t.jsx)(i,{variant:"nodes",title:"No agents in this network",sub:`Server has ${e.global_count} nodes globally, but none are registered to the current network. Switch network or contact admin.`}):(0,t.jsxs)("div",{className:"text-center py-16 px-4",role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)("svg",{viewBox:"0 0 64 64",width:56,height:56,children:(0,t.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[(0,t.jsx)("rect",{x:"10",y:"20",width:"44",height:"28",rx:"2"}),(0,t.jsx)("rect",{x:"20",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"32",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"44",y:"32",width:"4",height:"8",opacity:"0.5"}),(0,t.jsx)("line",{x1:"10",y1:"26",x2:"54",y2:"26",opacity:"0.4"}),(0,t.jsx)("circle",{cx:"14",cy:"23",r:"0.8",fill:"currentColor"})]})})}),(0,t.jsx)("h3",{className:"font-medium text-gray-300 text-base",children:"Spin up your first agent"}),(0,t.jsx)("p",{className:"text-gray-500 text-sm mt-2 max-w-md mx-auto leading-relaxed",children:"Run this in a fresh terminal to register an agent with this CommHub:"}),(0,t.jsx)("div",{className:"mt-4 inline-block",children:(0,t.jsx)(o,{cmd:"npx --yes @sleep2agi/agent-network init"})}),(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsxs)("a",{href:"https://anet.sh",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium text-gray-500 hover:text-cyan-300",children:["Full quickstart guide",(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}])},28523,e=>{"use strict";var t=e.i(18050),s=e.i(71645),a=e.i(22016),r=e.i(18150),n=e.i(95356);e.s(["default",0,function(){let[e,i]=(0,s.useState)([]),[o,l]=(0,s.useState)(!0),[c,x]=(0,s.useState)(""),[d,h]=(0,s.useState)({}),m=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/hub/tokens"),t=await e.json();i(t.tokens||[])}catch{}finally{l(!1)}},[]);(0,s.useEffect)(()=>{m()},[m]);let y=async()=>{if(c.trim())try{let e=sessionStorage.getItem("anet_v3_auth");if(!e)return;let{token:t}=JSON.parse(e),s=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create_token",token:t,name:c})}),a=await s.json();a.ok?(h({token:a.token}),x(""),m()):h({error:a.error})}catch{h({error:"Failed"})}},g=async e=>{try{let t=sessionStorage.getItem("anet_v3_auth");if(!t)return;let{token:s}=JSON.parse(t);await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"revoke_token",token:s,token_id:e})}),m()}catch{}};return(0,t.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,t.jsx)(a.default,{href:"/settings",className:"text-gray-500 hover:text-gray-300 text-sm lg:ml-0 ml-10",children:"← Settings"}),(0,t.jsx)("h1",{className:"text-2xl font-bold text-white",children:"API Tokens"})]}),(0,t.jsxs)("div",{className:"max-w-2xl space-y-6",children:[(0,t.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-3",children:"Create Token"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("input",{type:"text",value:c,onChange:e=>x(e.target.value),placeholder:"Token name (e.g. my-cli)",className:"flex-1 bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,t.jsx)("button",{onClick:y,disabled:!c.trim(),className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-500 disabled:bg-gray-800 text-white text-sm rounded-lg transition-colors",children:"Create"})]}),d.token&&(0,t.jsxs)("div",{className:"mt-3 bg-green-500/5 border border-green-500/20 rounded-lg px-3 py-2",children:[(0,t.jsx)("div",{className:"text-xs text-green-400 mb-1",children:"Token created (copy now, shown only once):"}),(0,t.jsx)("code",{className:"text-sm text-green-300 break-all select-all",children:d.token})]}),d.error&&(0,t.jsx)("div",{className:"mt-2 text-xs text-red-400",children:d.error})]}),(0,t.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,t.jsxs)("h2",{className:"text-sm font-semibold text-gray-300 mb-3",children:["Active Tokens (",e.length,")"]}),o?(0,t.jsx)("div",{className:"animate-pulse space-y-2",children:[1,2].map(e=>(0,t.jsx)("div",{className:"h-12 bg-gray-800/20 rounded"},e))}):0===e.length?(0,t.jsx)(n.EmptyState,{variant:"tokens",compact:!0,sub:"Tokens authenticate CLI tools and external integrations. Sign in with V3 auth, then create one above."}):(0,t.jsx)("div",{className:"space-y-2",children:e.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between bg-[#0a0a15] rounded-lg px-3 py-2 border border-[#1a1a2a]",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm text-white font-medium",children:e.name}),(0,t.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded border ${"full"===e.scope?"text-cyan-300 border-cyan-500/20 bg-cyan-500/5":"text-gray-400 border-gray-600/20"}`,children:e.scope})]}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-500",children:[e.token_id," · network: ",e.network_id?.slice(0,12)||"--"," · used ",(0,r.timeAgo)(e.last_used_at)]})]}),(0,t.jsx)("button",{onClick:()=>g(e.token_id),className:"text-xs text-red-400 hover:text-red-300 px-2 py-1 rounded border border-red-800/30 hover:bg-red-500/10 transition-colors",children:"Revoke"})]},e.token_id))})]})]})]})}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,16015,(e,t,s)=>{},98547,(e,t,s)=>{var r=e.i(47167);e.r(16015);var a=e.r(71645),n=a&&"object"==typeof a&&"default"in a?a:{default:a},l=void 0!==r.default&&r.default.env&&!0,i=function(e){return"[object String]"===Object.prototype.toString.call(e)},o=function(){function e(e){var t=void 0===e?{}:e,s=t.name,r=void 0===s?"stylesheet":s,a=t.optimizeForSpeed,n=void 0===a?l:a;d(i(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",d("boolean"==typeof n,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=n,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var o="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=o?o.getAttribute("content"):null}var t,s=e.prototype;return s.setOptimizeForSpeed=function(e){d("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),d(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},s.isOptimizeForSpeed=function(){return this._optimizeForSpeed},s.inject=function(){var e=this;if(d(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(l||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,s){return"number"==typeof s?e._serverSheet.cssRules[s]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),s},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},s.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},s.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},s.insertRule=function(e,t){if(d(i(e),"`insertRule` accepts only strings"),"u"<typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var s=this.getSheet();"number"!=typeof t&&(t=s.cssRules.length);try{s.insertRule(e,t)}catch(t){return l||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var r=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,r))}return this._rulesCount++},s.replaceRule=function(e,t){if(this._optimizeForSpeed||"u"<typeof window){var s="u">typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!s.cssRules[e])return e;s.deleteRule(e);try{s.insertRule(t,e)}catch(r){l||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),s.insertRule(this._deletedRulePlaceholder,e)}}else{var r=this._tags[e];d(r,"old rule at index `"+e+"` not found"),r.textContent=t}return e},s.deleteRule=function(e){if("u"<typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];d(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},s.flush=function(){this._injected=!1,this._rulesCount=0,"u">typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},s.cssRules=function(){var e=this;return"u"<typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,s){return s?t=t.concat(Array.prototype.map.call(e.getSheetForTag(s).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},s.makeStyleTag=function(e,t,s){t&&d(i(t),"makeStyleTag accepts only strings as second parameter");var r=document.createElement("style");this._nonce&&r.setAttribute("nonce",this._nonce),r.type="text/css",r.setAttribute("data-"+e,""),t&&r.appendChild(document.createTextNode(t));var a=document.head||document.getElementsByTagName("head")[0];return s?a.insertBefore(r,s):a.appendChild(r),r},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var s=0;s<t.length;s++){var r=t[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function d(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var c=function(e){for(var t=5381,s=e.length;s;)t=33*t^e.charCodeAt(--s);return t>>>0},x={};function h(e,t){if(!t)return"jsx-"+e;var s=String(t),r=e+s;return x[r]||(x[r]="jsx-"+c(e+"-"+s)),x[r]}function u(e,t){"u"<typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var s=e+t;return x[s]||(x[s]=t.replace(/__jsx-style-dynamic-selector/g,e)),x[s]}var f=function(){function e(e){var t=void 0===e?{}:e,s=t.styleSheet,r=void 0===s?null:s,a=t.optimizeForSpeed,n=void 0!==a&&a;this._sheet=r||new o({name:"styled-jsx",optimizeForSpeed:n}),this._sheet.inject(),r&&"boolean"==typeof n&&(this._sheet.setOptimizeForSpeed(n),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"u">typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var s=this.getIdAndRules(e),r=s.styleId,a=s.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var n=a.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=n,this._instancesCounts[r]=1},t.remove=function(e){var t=this,s=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(s in this._instancesCounts,"styleId: `"+s+"` not found"),this._instancesCounts[s]-=1,this._instancesCounts[s]<1){var r=this._fromServer&&this._fromServer[s];r?(r.parentNode.removeChild(r),delete this._fromServer[s]):(this._indices[s].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[s]),delete this._instancesCounts[s]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],s=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return s[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,s;return t=this.cssRules(),void 0===(s=e)&&(s={}),t.map(function(e){var t=e[0],r=e[1];return n.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:s.nonce?s.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,s=e.dynamic,r=e.id;if(s){var a=h(r,s);return{styleId:a,rules:Array.isArray(t)?t.map(function(e){return u(a,e)}):[u(a,t)]}}return{styleId:h(r),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),p=a.createContext(null);function m(){return new f}function g(){return a.useContext(p)}p.displayName="StyleSheetContext";var b=n.default.useInsertionEffect||n.default.useLayoutEffect,y="u">typeof window?m():void 0;function j(e){var t=y||g();return t&&("u"<typeof window?t.add(e):b(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}j.dynamic=function(e){return e.map(function(e){return h(e[0],e[1])}).join(" ")},s.StyleRegistry=function(e){var t=e.registry,s=e.children,r=a.useContext(p),l=a.useState(function(){return r||t||m()})[0];return n.default.createElement(p.Provider,{value:l},s)},s.createStyleRegistry=m,s.style=j,s.useStyleRegistry=g},21373,(e,t,s)=>{t.exports=e.r(98547).style},31713,e=>{"use strict";var t=e.i(47167),s=e.i(18050),r=e.i(71645),a=e.i(22016),n=e.i(18150);function l({online:e,working:t,total:r,version:a,uptime:n}){let o=r>0?Math.round(e/r*100):0;return(0,s.jsxs)("div",{className:"mb-8",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mb-4",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-white tracking-tight",children:"Agent Network"}),(0,s.jsxs)("span",{className:"text-xs text-gray-500",children:["CommHub ",a," · ",n]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[(0,s.jsx)(i,{value:e,label:"Online",sub:`${o}% of fleet`,color:"text-green-400",accent:"from-green-500/20 to-green-500/0",border:"border-green-500/15"}),(0,s.jsx)(i,{value:t,label:"Working",sub:e>0?`${Math.round(t/e*100)}% utilization`:"--",color:"text-cyan-400",accent:"from-cyan-500/20 to-cyan-500/0",border:"border-cyan-500/15"}),(0,s.jsx)(i,{value:r-e,label:"Offline",sub:r-e==0?"All systems go":`${r-e} disconnected`,color:"text-gray-400",accent:"from-gray-500/10 to-gray-500/0",border:"border-gray-500/15"}),(0,s.jsx)(i,{value:r,label:"Total",sub:"Registered nodes",color:"text-white",accent:"from-blue-500/15 to-blue-500/0",border:"border-blue-500/15"})]})]})}function i({value:e,label:t,sub:r,color:a,accent:n,border:l}){let o=a.replace("text-","").split("-")[0];return(0,s.jsxs)("div",{"data-anet-stat-card":o,className:`anet-stat-card relative overflow-hidden rounded-xl border ${l} bg-[#111128] px-4 py-3 transition-all`,children:[(0,s.jsx)("div",{className:`absolute inset-0 bg-gradient-to-br ${n} pointer-events-none`}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:`text-3xl font-bold ${a} tabular-nums leading-tight`,children:e}),(0,s.jsx)("div",{className:"text-sm text-gray-300 mt-0.5",children:t}),(0,s.jsx)("div",{className:"text-xs text-gray-600 mt-1",children:r})]})]})}function o(){let[e,t]=(0,r.useState)(""),[a,n]=(0,r.useState)(!1),[l,i]=(0,r.useState)(""),o=async()=>{if(e.trim()){n(!0),i("");try{let s=await fetch("/api/hub/broadcast",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}),r=await s.json();r.ok?(i(`Broadcast sent to ${r.recipients} node(s)`),t("")):i(`Failed: ${r.error||"Send error"}`)}catch(e){i(`Failed: ${e instanceof Error?e.message:"Send error"}`)}n(!1),setTimeout(()=>i(""),5e3)}};return(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"text",value:e,onChange:e=>t(e.target.value),onKeyDown:e=>"Enter"===e.key&&o(),placeholder:"Broadcast message to all online agents...",maxLength:500,"aria-label":"Broadcast message",className:"flex-1 bg-[#111128] border border-[#2a2a4a] rounded-lg px-4 py-2.5 text-sm text-white placeholder-gray-600 focus:border-blue-500/50 focus:ring-1 focus:ring-blue-500/20 focus:outline-none transition-colors"}),(0,s.jsx)("button",{onClick:o,disabled:a||!e.trim(),"aria-label":"Send broadcast",className:"flex items-center gap-2 px-5 py-2.5 bg-blue-600 hover:bg-blue-500 disabled:bg-gray-800 disabled:text-gray-600 text-white text-sm rounded-lg transition-all font-medium cursor-pointer disabled:cursor-not-allowed",children:a?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("svg",{"aria-hidden":!0,className:"w-4 h-4 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",opacity:"0.25"}),(0,s.jsx)("path",{d:"M4 12a8 8 0 018-8",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]}),(0,s.jsx)("span",{children:"Sending…"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("svg",{"aria-hidden":!0,className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M3 11v3a1 1 0 0 0 1 1h2l3.29 3.29a1 1 0 0 0 1.71-.71V7.42a1 1 0 0 0-1.71-.71L6 10H4a1 1 0 0 0-1 1Z"}),(0,s.jsx)("path",{d:"M16 8a5 5 0 0 1 0 6",opacity:"0.7"}),(0,s.jsx)("path",{d:"M19 5a9 9 0 0 1 0 12",opacity:"0.45"})]}),(0,s.jsx)("span",{children:"Broadcast"})]})})]}),e.length>0&&(0,s.jsxs)("div",{className:"text-right text-xs text-gray-600 mt-1 tabular-nums",children:[e.length,"/500"]}),l&&(0,s.jsx)("div",{className:`mt-3 text-sm text-center anet-fade-in ${l.startsWith("Failed")?"text-red-400":"text-green-400/80"}`,children:l})]})}function d(e,t,s,r=0){let a=t<=2?Math.PI:1.78*Math.PI,n=-Math.PI/2-a/2,l=t<=1?-Math.PI/2:n+a*e/(t-1)+r;return{x:500+s*Math.cos(l),y:330+s*Math.sin(l)}}function c(e,t,s=0){let r=(e.x+t.x)/2,a=(e.y+t.y)/2,n=t.x-e.x,l=t.y-e.y,i=Math.hypot(n,l)||1,o={x:r+-l/i*s,y:a+n/i*s};return`M${e.x},${e.y} Q${o.x},${o.y} ${t.x},${t.y}`}function x(e,t){return e.length>t?`${e.slice(0,t-1)}...`:e}let h={panelStops:["#0b1220","#080814","#101018"],radarStops:[{color:"#22d3ee",opacity:.18},{color:"#22c55e",opacity:.045},{color:"#020617",opacity:0}],arrowFill:"#67e8f9",ringStroke:"#164e63",spokeStroke:{active:"#22d3ee",idle:"#155e75"},flowEdge:"#67e8f9",flowPath:"#e0f2fe",flowParticle:"#fef08a",nodeFill:{online:"#020617",offline:"#080814"},labelBox:{fill:"#020617",stroke:"#1f2937"},legendBox:{fill:"#020617",stroke:"#1f2937"},legendText:"#94a3b8",legendHeadline:"#e5e7eb",legendAccent:"#67e8f9",containerBg:"#080814",containerBorder:"#2a2a4a",topRailGradient:"from-transparent via-cyan-400/70 to-transparent"},u={panelStops:["#f8fafc","#ffffff","#f1f5f9"],radarStops:[{color:"#10b981",opacity:.06},{color:"#3b82f6",opacity:.03},{color:"#ffffff",opacity:0}],arrowFill:"#10b981",ringStroke:"#cbd5e1",spokeStroke:{active:"#10b981",idle:"#cbd5e1"},flowEdge:"#10b981",flowPath:"#475569",flowParticle:"#f59e0b",nodeFill:{online:"#ffffff",offline:"#f8fafc"},labelBox:{fill:"#ffffff",stroke:"#e2e8f0"},legendBox:{fill:"#ffffff",stroke:"#e2e8f0"},legendText:"#475569",legendHeadline:"#0f172a",legendAccent:"#0d9488",containerBg:"#ffffff",containerBorder:"#e3e6eb",topRailGradient:"from-transparent via-emerald-500/40 to-transparent"};function f({sessions:e,sseSessions:t}){let a="light"===function(){let[e,t]=(0,r.useState)("dark");return(0,r.useEffect)(()=>{let e=()=>{let e=document.documentElement.getAttribute("data-theme")||"cyber";t("light"===e||"mint"===e?"light":"dark")};e();let s=new MutationObserver(e);return s.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>s.disconnect()},[]),e}(),n=a?u:h,[l,i]=(0,r.useState)([]);(0,r.useEffect)(()=>{let e=async()=>{try{let e=await fetch("/api/hub/messages?limit=50");if(401===e.status)return void window.location.assign("/login");let t=await e.json();i(t.messages||[])}catch{}};e();let t=setInterval(e,5e3);return()=>clearInterval(t)},[]);let{onlineNodes:o,offlineNodes:p,nodePositions:m,flowLinks:g,activeAliases:b}=(0,r.useMemo)(()=>{let s,r=e=>(e.network_id?t[`${e.network_id}:${e.alias}`]:void 0)??t[e.alias],a=e.filter(e=>"offline"!==e.status||r(e)),n=e.filter(e=>"offline"===e.status&&!r(e)),i={};a.forEach((e,t)=>{i[e.alias]=d(t,Math.max(a.length,1),220)});let o=a.length<=2?Math.PI:1.78*Math.PI,c=a.length>1?o/(a.length-1):0,x=a.length>0?c/2:0,h=315+6*Math.max(0,n.length-4);n.forEach((e,t)=>{i[e.alias]=d(t,Math.max(n.length,1),h,x)});let u=(s=new Map,l.forEach(e=>{if(!i[e.from_alias]||!i[e.to_alias]||e.from_alias===e.to_alias)return;let t=`${e.from_alias}->${e.to_alias}`,r=s.get(t);s.set(t,{key:t,from:e.from_alias,to:e.to_alias,count:(r?.count||0)+1,content:r?.content||e.content})}),[...s.values()].slice(0,18)),f=new Set;return u.forEach(e=>{f.add(e.from),f.add(e.to)}),{onlineNodes:a,offlineNodes:n,nodePositions:i,flowLinks:u,activeAliases:f}},[l,e,t]),y=o.filter(e=>"working"===e.status).length;return(0,s.jsxs)("section",{className:"w-full max-w-6xl mx-auto mb-8",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between mb-3 px-1",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-xs uppercase text-gray-600 tracking-wider",children:"Network Topology"}),(0,s.jsx)("h2",{className:"text-lg text-white font-semibold",children:"Command mesh"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs",children:[(0,s.jsxs)("span",{className:"px-2.5 py-1 rounded-md bg-green-500/10 text-green-300 border border-green-500/20",children:[y," working"]}),(0,s.jsxs)("span",{className:"px-2.5 py-1 rounded-md bg-cyan-500/10 text-cyan-300 border border-cyan-500/20",children:[o.length," online"]}),(0,s.jsxs)("span",{className:"px-2.5 py-1 rounded-md bg-gray-500/10 text-gray-400 border border-gray-500/20",children:[g.length," active links"]})]})]}),(0,s.jsxs)("div",{className:`relative overflow-hidden rounded-lg border shadow-2xl ${a?"shadow-zinc-900/5":"shadow-cyan-950/30"}`,style:{background:n.containerBg,borderColor:n.containerBorder},children:[(0,s.jsx)("div",{className:`absolute inset-x-0 top-0 h-px bg-gradient-to-r ${n.topRailGradient}`}),(0,s.jsxs)("svg",{viewBox:"0 0 1000 680",className:"w-full h-auto block",preserveAspectRatio:"xMidYMid meet",children:[(0,s.jsxs)("defs",{children:[(0,s.jsxs)("linearGradient",{id:"topo-panel",x1:"0",x2:"1",y1:"0",y2:"1",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:n.panelStops[0]}),(0,s.jsx)("stop",{offset:"48%",stopColor:n.panelStops[1]}),(0,s.jsx)("stop",{offset:"100%",stopColor:n.panelStops[2]})]}),(0,s.jsxs)("radialGradient",{id:"topo-radar",cx:"50%",cy:"50%",r:"55%",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:n.radarStops[0].color,stopOpacity:n.radarStops[0].opacity}),(0,s.jsx)("stop",{offset:"45%",stopColor:n.radarStops[1].color,stopOpacity:n.radarStops[1].opacity}),(0,s.jsx)("stop",{offset:"100%",stopColor:n.radarStops[2].color,stopOpacity:n.radarStops[2].opacity})]}),!a&&(0,s.jsxs)("filter",{id:"topo-glow",children:[(0,s.jsx)("feGaussianBlur",{stdDeviation:"4",result:"blur"}),(0,s.jsxs)("feMerge",{children:[(0,s.jsx)("feMergeNode",{in:"blur"}),(0,s.jsx)("feMergeNode",{in:"SourceGraphic"})]})]}),(0,s.jsx)("marker",{id:"topo-arrow",viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"5",markerHeight:"5",orient:"auto-start-reverse",children:(0,s.jsx)("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:n.arrowFill})}),(0,s.jsxs)("radialGradient",{id:"topo-sweep",cx:"0%",cy:"50%",r:"100%",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:a?"#0d9488":"#22d3ee",stopOpacity:a?.18:.32}),(0,s.jsx)("stop",{offset:"70%",stopColor:a?"#0d9488":"#22d3ee",stopOpacity:a?.1:.18}),(0,s.jsx)("stop",{offset:"100%",stopColor:a?"#0d9488":"#22d3ee",stopOpacity:"0"})]})]}),(0,s.jsx)("rect",{width:"1000",height:"680",fill:"url(#topo-panel)"}),(0,s.jsx)("circle",{cx:500,cy:330,r:"330",fill:"url(#topo-radar)"}),!a&&(0,s.jsx)("g",{opacity:"0.5",children:Array.from({length:28}).map((e,t)=>{let r=9301*t+49297;return(0,s.jsx)("circle",{cx:13*r%1e3,cy:7*r%680,r:t%3==0?1.2:.7,fill:"#a5b4fc",opacity:.35+t%4*.05},t)})}),(0,s.jsx)("g",{style:{transformOrigin:"500px 330px",transformBox:"view-box"},className:"anet-topo-sweep",opacity:a?.7:1,children:(0,s.jsx)("path",{d:`M 500 330 L 830 330 A 330 330 0 0 0 ${500+330*Math.cos(-Math.PI/4.5)} ${330+330*Math.sin(-Math.PI/4.5)} Z`,fill:"url(#topo-sweep)"})}),[90,170,250,330].map(e=>(0,s.jsx)("circle",{cx:500,cy:330,r:e,fill:"none",stroke:n.ringStroke,strokeWidth:"1",opacity:a?.6:.35},e)),!a&&[0,.25,.5,.75].map((e,t)=>(0,s.jsx)("g",{children:(0,s.jsx)("circle",{cx:830,cy:330,r:0===t?2.8:2.2,fill:"#22d3ee",opacity:.9,filter:"url(#topo-glow)",children:(0,s.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:`${360*e} 500 330`,to:`${360*e+360} 500 330`,dur:"16s",repeatCount:"indefinite"})})},`orbit-${t}`)),[0,30,60,90,120,150].map(e=>(0,s.jsx)("line",{x1:500-360*Math.cos(e*Math.PI/180),y1:330-360*Math.sin(e*Math.PI/180),x2:500+360*Math.cos(e*Math.PI/180),y2:330+360*Math.sin(e*Math.PI/180),stroke:n.ringStroke,strokeWidth:"1",opacity:a?.35:.18},e)),o.map((e,t)=>{let r=m[e.alias];if(!r)return null;let a=c({x:500,y:330},r,0),l=b.has(e.alias);return(0,s.jsx)("path",{d:a,fill:"none",stroke:l?n.spokeStroke.active:n.spokeStroke.idle,strokeWidth:l?2:1,strokeDasharray:l?"none":"6 14",opacity:l?.7:.45,className:l?void 0:"anet-topo-spoke-flow",style:l?void 0:{animationDelay:`${-(.25*t)}s`}},`hub-${e.alias}`)}),g.map((e,t)=>{let r=m[e.from],l=m[e.to];if(!r||!l)return null;let i=c(r,l,t%2==0?36:-36),o=Math.min(2+e.count,7);return(0,s.jsxs)("g",{children:[(0,s.jsx)("path",{d:i,fill:"none",stroke:n.flowEdge,strokeWidth:o,opacity:a?.22:.28,filter:a?void 0:"url(#topo-glow)",markerEnd:"url(#topo-arrow)"}),(0,s.jsx)("path",{id:`flow-path-${t}`,d:i,fill:"none",stroke:n.flowPath,strokeWidth:"1",strokeDasharray:"2 12",opacity:a?.4:.75}),(0,s.jsx)("circle",{r:"4",fill:n.flowParticle,filter:a?void 0:"url(#topo-glow)",children:(0,s.jsx)("animateMotion",{dur:`${2.2+t%5*.32}s`,repeatCount:"indefinite",path:i})})]},e.key)}),(0,s.jsxs)("g",{children:[(0,s.jsx)("circle",{cx:500,cy:330,r:"18",fill:a?"#d1fae5":"#10b981",opacity:a?.35:.1}),(0,s.jsxs)("circle",{cx:500,cy:330,r:"10",fill:"none",stroke:"#10b981",strokeWidth:"1.5",children:[(0,s.jsx)("animate",{attributeName:"r",values:"10;38;10",dur:"2.4s",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"opacity",values:"0.55;0;0.55",dur:"2.4s",repeatCount:"indefinite"})]}),(0,s.jsxs)("circle",{cx:500,cy:330,r:"10",fill:"none",stroke:"#10b981",strokeWidth:"1.5",opacity:"0",children:[(0,s.jsx)("animate",{attributeName:"r",values:"10;38;10",dur:"2.4s",begin:"1.2s",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"opacity",values:"0.45;0;0.45",dur:"2.4s",begin:"1.2s",repeatCount:"indefinite"})]}),(0,s.jsx)("circle",{cx:500,cy:330,r:"10",fill:a?"#059669":"#10b981"}),(0,s.jsx)("circle",{cx:500,cy:330,r:"5",fill:"#d1fae5",opacity:"0.9"})]}),[...o,...p].map(e=>{let r=m[e.alias];if(!r)return null;let l=(e.network_id?t[`${e.network_id}:${e.alias}`]:void 0)??t[e.alias],i="offline"!==e.status||!!l,o=i?"working"===e.status?{label:"working",primary:a?"#059669":"#22c55e",halo:a?"#d1fae5":"#14532d",text:a?"#065f46":"#dcfce7"}:"idle"===e.status?{label:"idle",primary:a?"#0d9488":"#2dd4bf",halo:a?"#ccfbf1":"#134e4a",text:a?"#115e59":"#ccfbf1"}:{label:e.status||"online",primary:a?"#0284c7":"#38bdf8",halo:a?"#dbeafe":"#0c4a6e",text:a?"#0c4a6e":"#e0f2fe"}:{label:"offline",primary:a?"#94a3b8":"#6b7280",halo:a?"#e2e8f0":"#111827",text:a?"#475569":"#9ca3af"},d=b.has(e.alias),c=i?26:18;return(0,s.jsxs)("g",{className:"transition-opacity",children:[d&&(0,s.jsxs)("circle",{cx:r.x,cy:r.y,r:c+14,fill:o.primary,opacity:a?.08:.12,children:[(0,s.jsx)("animate",{attributeName:"r",values:`${c+8};${c+22};${c+8}`,dur:"2.4s",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"opacity",values:a?"0.12;0.02;0.12":"0.18;0.04;0.18",dur:"2.4s",repeatCount:"indefinite"})]}),(0,s.jsx)("circle",{cx:r.x,cy:r.y,r:c+8,fill:o.halo,opacity:i?a?.85:.65:a?.4:.25}),(0,s.jsx)("circle",{cx:r.x,cy:r.y,r:c,fill:i?n.nodeFill.online:n.nodeFill.offline,stroke:o.primary,strokeWidth:i?3:1.5,strokeDasharray:i?"none":"5 5",filter:i&&!a?"url(#topo-glow)":void 0}),(0,s.jsx)("circle",{cx:r.x,cy:r.y,r:i?8:5,fill:o.primary}),"working"===e.status&&(0,s.jsx)("path",{d:`M${r.x-9},${r.y+11} h18`,stroke:n.flowParticle,strokeWidth:"3",strokeLinecap:"round",children:(0,s.jsx)("animate",{attributeName:"opacity",values:"1;0.25;1",dur:"1.1s",repeatCount:"indefinite"})}),(0,s.jsxs)("g",{transform:`translate(${r.x}, ${r.y+c+22})`,children:[(0,s.jsx)("rect",{x:"-62",y:"-14",width:"124",height:"42",rx:"6",fill:n.labelBox.fill,stroke:n.labelBox.stroke,opacity:a?1:.94}),(0,s.jsx)("text",{x:"0",y:"1",textAnchor:"middle",fill:o.text,fontSize:"12",fontFamily:"monospace",fontWeight:"700",children:x(e.alias,14)}),(0,s.jsxs)("text",{x:"0",y:"17",textAnchor:"middle",fill:o.primary,fontSize:"9",fontFamily:"monospace",children:[o.label,i&&null!=l?` sse:${l}`:""]})]})]},e.alias)}),(0,s.jsxs)("g",{transform:"translate(28, 34)",children:[(0,s.jsx)("rect",{x:"0",y:"0",width:"285",height:60+20*Math.min(g.length,4),rx:"8",fill:n.legendBox.fill,stroke:n.legendBox.stroke,opacity:a?1:.94}),(0,s.jsx)("text",{x:"16",y:"26",fill:n.legendHeadline,fontSize:"13",fontFamily:"monospace",fontWeight:"700",children:"recent signal"}),(0,s.jsxs)("text",{x:"178",y:"26",fill:n.legendAccent,fontSize:"11",fontFamily:"monospace",children:[l.length," messages"]}),g.slice(0,4).map((e,t)=>(0,s.jsxs)("text",{x:"16",y:54+20*t,fill:n.legendText,fontSize:"10",fontFamily:"monospace",children:[x(e.from,8)," ","->"," ",x(e.to,8)," / ",e.count," / ",x(e.content,18)]},e.key))]}),(0,s.jsxs)("g",{transform:"translate(720, 34)",children:[(0,s.jsx)("rect",{x:"0",y:"0",width:"250",height:"112",rx:"8",fill:n.legendBox.fill,stroke:n.legendBox.stroke,opacity:a?1:.94}),(0,s.jsx)("circle",{cx:"18",cy:"26",r:"6",fill:a?"#059669":"#22c55e"}),(0,s.jsx)("text",{x:"34",y:"30",fill:n.legendText,fontSize:"11",fontFamily:"monospace",children:"working node"}),(0,s.jsx)("circle",{cx:"18",cy:"52",r:"6",fill:a?"#0d9488":"#2dd4bf"}),(0,s.jsx)("text",{x:"34",y:"56",fill:n.legendText,fontSize:"11",fontFamily:"monospace",children:"online idle"}),(0,s.jsx)("circle",{cx:"18",cy:"78",r:"6",fill:a?"#94a3b8":"#6b7280"}),(0,s.jsx)("text",{x:"34",y:"82",fill:n.legendText,fontSize:"11",fontFamily:"monospace",children:"offline / no SSE"}),(0,s.jsx)("path",{d:"M150,78 Q176,52 210,78",fill:"none",stroke:n.flowEdge,strokeWidth:"3",markerEnd:"url(#topo-arrow)"})]})]})]})]})}var p=e.i(69874);let m={working:{bg:"bg-green-900/30 border-green-800/30",text:"text-green-300",dot:"bg-green-500",glow:"shadow-green-500/10"},idle:{bg:"bg-cyan-900/30 border-cyan-800/30",text:"text-cyan-300",dot:"bg-cyan-400",glow:"shadow-cyan-500/5"},blocked:{bg:"bg-yellow-900/30 border-yellow-800/30",text:"text-yellow-300",dot:"bg-yellow-500",glow:""},error:{bg:"bg-red-900/30 border-red-800/30",text:"text-red-300",dot:"bg-red-500",glow:""}},g={bg:"bg-gray-800/50 border-gray-700/30",text:"text-gray-500",dot:"bg-gray-500",glow:""};function b({session:e,hasSse:t,sseCount:r,onChat:l}){let i=t&&m[e.status]||g;return(0,s.jsxs)(a.default,{href:`/node?alias=${encodeURIComponent(e.alias)}`,prefetch:!1,className:`anet-agent-card group relative block rounded-xl border p-4 transition-all duration-300 cursor-pointer hover:-translate-y-0.5 ${t?`bg-[#111128] border-[#2a2a4a] hover:border-cyan-500/30 hover:shadow-lg ${i.glow}`:"bg-[#0d0d1a] border-[#1a1a2a] opacity-40"}`,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsx)(p.AliasAvatar,{alias:e.alias,size:22}),(0,s.jsx)("span",{className:"font-semibold text-white truncate text-sm",title:e.alias,children:e.alias}),(0,s.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${i.dot} ${t&&"working"===e.status?"animate-pulse":""}`})]}),(0,s.jsx)("span",{className:`text-[11px] px-2 py-0.5 rounded-md border shrink-0 ${i.bg} ${i.text}`,children:t?e.status:"offline"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,s.jsx)("span",{className:"text-xs text-gray-600 bg-[#0a0a15] px-2 py-0.5 rounded border border-[#1a1a2a]",children:e.agent||"unknown"}),t&&(0,s.jsxs)("span",{className:"text-[10px] text-green-500",children:["SSE:",r]})]}),e.task?(0,s.jsx)("div",{className:"text-xs text-gray-400 bg-[#0a0a15] rounded-lg px-3 py-2 border border-[#1a1a2a] line-clamp-2",title:e.task,children:e.task}):(0,s.jsx)("div",{className:"text-xs text-gray-700 italic",children:"No active task"}),e.progress>0&&(0,s.jsxs)("div",{className:"mt-3",children:[(0,s.jsxs)("div",{className:"flex justify-between text-[10px] mb-1",children:[(0,s.jsx)("span",{className:"text-gray-600",children:"Progress"}),(0,s.jsxs)("span",{className:i.text,children:[e.progress,"%"]})]}),(0,s.jsx)("div",{className:"w-full bg-gray-800 rounded-full h-1.5 overflow-hidden",children:(0,s.jsx)("div",{className:`h-1.5 rounded-full transition-all duration-700 ${"working"===e.status?"bg-green-500":"bg-cyan-500"}`,style:{width:`${Math.min(e.progress,100)}%`}})})]}),(0,s.jsxs)("div",{className:"mt-3 flex justify-between items-center text-[10px] text-gray-600",children:[(0,s.jsx)("span",{className:"truncate",title:e.server||"",children:e.server||"--"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[l&&t&&(0,s.jsx)("button",{onClick:t=>{t.preventDefault(),t.stopPropagation(),l(e.alias)},className:"text-cyan-400 hover:text-cyan-300 px-1.5 py-0.5 rounded border border-cyan-500/20 hover:bg-cyan-500/10 transition-colors",children:"Chat"}),(0,s.jsx)("span",{children:(0,n.timeAgo)(e.updated_at)}),(0,s.jsx)("svg",{"aria-hidden":!0,className:"w-3 h-3 text-gray-700 opacity-0 -translate-x-1 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-200",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,s.jsx)("path",{d:"M9 18l6-6-6-6"})})]})]})]})}function y({messages:e}){return 0===e.length?null:(0,s.jsxs)("div",{className:"mt-8",children:[(0,s.jsxs)("h2",{className:"text-lg font-semibold text-white mb-3 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Inbox"}),(0,s.jsx)("span",{className:"text-xs bg-blue-900/30 text-blue-400 px-2 py-0.5 rounded-full border border-blue-800/30",children:e.length})]}),(0,s.jsx)("div",{className:"space-y-2 max-h-96 overflow-y-auto pr-1 scrollbar-thin",children:e.map(e=>(0,s.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-4 py-3 text-sm transition-colors hover:border-[#3a3a5a]",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs mb-1.5",children:[e.from_session&&(0,s.jsx)(p.AliasAvatar,{alias:e.from_session,size:16}),(0,s.jsx)("span",{className:"text-gray-200 font-medium truncate",children:e.from_session}),(0,s.jsx)("span",{className:"ml-auto text-gray-600 shrink-0",title:e.created_at,children:(0,n.timeAgo)(e.created_at)})]}),(0,s.jsx)("div",{className:"text-gray-300 leading-relaxed",children:e.content})]},e.id))})]})}function j(){return(0,s.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,s.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-8 anet-skeleton-pulse",children:[1,2,3,4].map(e=>(0,s.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] px-4 py-3",children:[(0,s.jsx)(v,{w:"2.5rem",h:"1.75rem"}),(0,s.jsx)(v,{w:"3.5rem",h:"0.75rem",className:"mt-2"}),(0,s.jsx)(v,{w:"5rem",h:"0.625rem",className:"mt-1"})]},e))}),(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-3 anet-skeleton-pulse",children:[(0,s.jsx)(v,{w:"6rem",h:"2.5rem",rounded:"0.75rem"}),(0,s.jsxs)("div",{className:"flex-1 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-2.5 flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-full anet-skeleton-bar"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)(v,{w:"6rem",h:"0.875rem"}),(0,s.jsx)(v,{w:"10rem",h:"0.625rem",className:"mt-1"})]})]})]}),(0,s.jsx)("div",{className:"mb-6 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 anet-skeleton-pulse",children:(0,s.jsx)(v,{w:"14rem",h:"0.875rem"})}),(0,s.jsx)("div",{className:"grid grid-cols-3 gap-2 sm:gap-3 mb-3 anet-skeleton-pulse",children:[1,2,3].map(e=>(0,s.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] px-3 py-3",children:[(0,s.jsx)(v,{w:"2rem",h:"1.25rem"}),(0,s.jsx)(v,{w:"2.5rem",h:"0.75rem",className:"mt-1"}),(0,s.jsx)(v,{w:"3.5rem",h:"0.625rem",className:"mt-px"})]},e))}),(0,s.jsx)("div",{className:"grid grid-cols-3 gap-2 sm:gap-3 mb-6 anet-skeleton-pulse",children:[1,2,3].map(e=>(0,s.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] px-3 py-2.5 flex items-center justify-center gap-2",children:[(0,s.jsx)("div",{className:"w-4 h-4 rounded anet-skeleton-bar"}),(0,s.jsx)(v,{w:"4rem",h:"0.75rem"})]},e))}),(0,s.jsxs)("div",{className:"mb-6 flex gap-2 anet-skeleton-pulse",children:[(0,s.jsx)("div",{className:"flex-1 h-10 rounded-lg border border-[#2a2a4a] bg-[#111128]"}),(0,s.jsx)("div",{className:"w-28 h-10 rounded-lg anet-skeleton-bar"})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-3 sm:gap-4 anet-skeleton-pulse",children:[1,2,3,4].map(e=>(0,s.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] p-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,s.jsx)("div",{className:"w-2 h-2 rounded-full anet-skeleton-bar"}),(0,s.jsx)(v,{w:"6rem",h:"0.875rem"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(v,{w:"100%",h:"0.625rem"}),(0,s.jsx)(v,{w:"75%",h:"0.625rem"}),(0,s.jsx)(v,{w:"55%",h:"0.625rem"})]})]},e))})]})}function v({w:e,h:t,rounded:r,className:a}){return(0,s.jsx)("div",{className:`anet-skeleton-bar ${a||""}`,style:{width:e,height:t,borderRadius:r||"0.375rem"}})}var w=e.i(95356),k=e.i(58963);function N(){let{setNetworkId:e}=(0,k.useNetworkId)(),[t,a]=(0,r.useState)({user:null,networks:[],currentNetwork:"",token:""}),[n,l]=(0,r.useState)(!1),[i,o]=(0,r.useState)(""),[d,c]=(0,r.useState)(""),[x,h]=(0,r.useState)(""),[u,f]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=sessionStorage.getItem("anet_v3_auth");if(e)try{a(JSON.parse(e))}catch{}},[]);let[p,m]=(0,r.useState)(!1),[g,b]=(0,r.useState)(""),[y,j]=(0,r.useState)(""),v=async()=>{try{await fetch(`/api/hub/auth?token=${t.token}&endpoint=/api/auth/me`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update_profile",token:t.token,display_name:g,email:y})});let e=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update_profile",token:t.token,display_name:g,email:y})}),s=await e.json();if(s.ok&&s.user){let e={...t,user:s.user};a(e),sessionStorage.setItem("anet_v3_auth",JSON.stringify(e)),m(!1)}}catch{}};if(!t.user)return null;let w=(t.user.display_name||t.user.username).slice(0,2).toUpperCase();return(0,s.jsxs)("div",{className:"flex items-center justify-between bg-[#111128] border border-[#2a2a4a] rounded-lg px-4 py-2.5 mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-full bg-gradient-to-br from-cyan-500 to-blue-600 flex items-center justify-center text-xs font-bold text-white",children:w}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm text-white font-medium",children:t.user.display_name||t.user.username}),(0,s.jsxs)("div",{className:"text-[10px] text-gray-500",children:[t.user.role," · ",t.user.user_id]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[t.networks.length>0&&(0,s.jsx)("select",{value:t.currentNetwork,onChange:s=>{let r={...t,currentNetwork:s.target.value};a(r),e(s.target.value),sessionStorage.setItem("anet_v3_auth",JSON.stringify(r))},className:"bg-[#0a0a15] border border-[#2a2a4a] rounded px-2 py-1 text-xs text-white focus:outline-none",children:t.networks.map(e=>(0,s.jsx)("option",{value:e.network_id,children:e.network_name},e.network_id))}),(0,s.jsxs)("button",{onClick:()=>{b(t.user?.display_name||""),j(""),m(!p)},className:"text-xs text-gray-500 hover:text-gray-300 whitespace-nowrap","aria-label":"Edit profile",children:[(0,s.jsx)("span",{className:"hidden sm:inline",children:"Edit"}),(0,s.jsx)("svg",{className:"sm:hidden w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.862 4.487z"})})]}),(0,s.jsxs)("button",{onClick:()=>{a({user:null,networks:[],currentNetwork:"",token:""}),sessionStorage.removeItem("anet_v3_auth")},className:"text-xs text-gray-500 hover:text-gray-300 whitespace-nowrap","aria-label":"Sign out",children:[(0,s.jsx)("span",{className:"hidden sm:inline",children:"Sign out"}),(0,s.jsx)("svg",{className:"sm:hidden w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})})]})]}),p&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-2 pt-2 border-t border-[#2a2a4a]",children:[(0,s.jsx)("input",{type:"text",value:g,onChange:e=>b(e.target.value),placeholder:"Display name",className:"bg-[#0a0a15] border border-[#2a2a4a] rounded px-2 py-1 text-xs text-white placeholder-gray-600 focus:outline-none w-32"}),(0,s.jsx)("input",{type:"email",value:y,onChange:e=>j(e.target.value),placeholder:"Email",className:"bg-[#0a0a15] border border-[#2a2a4a] rounded px-2 py-1 text-xs text-white placeholder-gray-600 focus:outline-none w-40"}),(0,s.jsx)("button",{onClick:v,className:"px-2 py-1 bg-cyan-600 hover:bg-cyan-500 text-white text-xs rounded",children:"Save"})]})]})}var S=e.i(21373),_=e.i(58442);function C({tabs:e,activeTab:t,onOpenTab:r,onCloseTab:a,onSetActive:n,onClose:l}){return 0===e.length?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{onClick:l,className:"jsx-f7cf3d1a6fdfc074 fixed inset-0 bg-black/30 z-40 lg:hidden"}),(0,s.jsxs)("div",{className:"jsx-f7cf3d1a6fdfc074 fixed top-0 right-0 h-full w-full lg:w-[500px] bg-[#0a0a1a] border-l border-[#2a2a4a] z-50 flex flex-col shadow-2xl shadow-black/60 animate-slide-in",children:[(0,s.jsxs)("div",{className:"jsx-f7cf3d1a6fdfc074 flex items-center border-b border-[#2a2a4a] bg-[#0d0d1a] overflow-x-auto",children:[(0,s.jsx)("div",{className:"jsx-f7cf3d1a6fdfc074 flex-1 flex min-w-0",children:e.map(e=>(0,s.jsxs)("button",{onClick:()=>n(e),className:`jsx-f7cf3d1a6fdfc074 flex items-center gap-1.5 px-3 py-2.5 text-xs border-b-2 transition-colors shrink-0 ${t===e?"border-cyan-400 text-cyan-300 bg-cyan-500/5":"border-transparent text-gray-500 hover:text-gray-300"}`,children:[(0,s.jsx)("div",{className:`jsx-f7cf3d1a6fdfc074 w-2 h-2 rounded-full ${t===e?"bg-cyan-400":"bg-gray-600"}`}),(0,s.jsx)("span",{className:"jsx-f7cf3d1a6fdfc074 max-w-[80px] truncate",children:e}),(0,s.jsx)("button",{onClick:t=>{t.stopPropagation(),a(e)},className:"jsx-f7cf3d1a6fdfc074 ml-1 text-gray-600 hover:text-gray-300 p-0.5",children:"×"})]},e))}),(0,s.jsx)("button",{onClick:l,className:"jsx-f7cf3d1a6fdfc074 text-gray-500 hover:text-white px-3 py-2.5 shrink-0 border-l border-[#2a2a4a]",children:(0,s.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,className:"jsx-f7cf3d1a6fdfc074 w-4 h-4",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12",className:"jsx-f7cf3d1a6fdfc074"})})})]}),(0,s.jsx)("div",{className:"jsx-f7cf3d1a6fdfc074 flex-1 relative overflow-hidden",children:e.map(e=>(0,s.jsx)("div",{className:`jsx-f7cf3d1a6fdfc074 absolute inset-0 ${t===e?"block":"hidden"}`,children:(0,s.jsx)($,{alias:e})},e))})]}),(0,s.jsx)(S.default,{id:"f7cf3d1a6fdfc074",children:"@keyframes slide-in{0%{transform:translate(100%)}to{transform:translate(0)}}.animate-slide-in{animation:.2s ease-out slide-in}"})]})}function $({alias:e}){return(0,s.jsx)(_.TaskChatPanel,{alias:e,onClose:()=>{},inline:!0})}function M({sessions:e,onClose:t}){let[a,n]=(0,r.useState)(new Set),[l,i]=(0,r.useState)(""),[o,d]=(0,r.useState)("normal"),[c,x]=(0,r.useState)(!1),[h,u]=(0,r.useState)([]),[f,m]=(0,r.useState)(""),g=e.filter(e=>"offline"!==e.status).filter(e=>!f||e.alias.toLowerCase().includes(f.toLowerCase())||(e.agent||"").toLowerCase().includes(f.toLowerCase())),b=async()=>{if(!l.trim()||0===a.size||c)return;x(!0),u([]);let e=[...a].map(async e=>{try{let t=await fetch("/api/hub/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({alias:e,task:l,priority:o})}),s=await t.json();return{alias:e,ok:!!s.ok,error:s.error}}catch(t){return{alias:e,ok:!1,error:"send failed"}}});u(await Promise.all(e)),x(!1)},y=h.filter(e=>e.ok).length;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed inset-0 bg-black/50 z-40 anet-fade-in",onClick:t}),(0,s.jsxs)("div",{className:"fixed inset-4 lg:inset-x-[15%] lg:inset-y-[5%] bg-[#0a0a1a] border border-[#2a2a4a] rounded-2xl z-50 flex flex-col shadow-2xl shadow-black/70 overflow-hidden anet-fade-in",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-[#2a2a4a] bg-[#0d0d1a]",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-bold text-white",children:"Dispatch Task"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:"Send a task to one or more agents"})]}),(0,s.jsx)("button",{onClick:t,className:"text-gray-500 hover:text-white p-1.5 rounded-lg hover:bg-[#1a1a2a]",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,s.jsxs)("div",{className:"flex-1 flex flex-col lg:flex-row overflow-hidden",children:[(0,s.jsxs)("div",{className:"lg:w-[280px] border-b lg:border-b-0 lg:border-r border-[#2a2a4a] flex flex-col",children:[(0,s.jsxs)("div",{className:"px-4 py-3 border-b border-[#2a2a4a]",children:[(0,s.jsx)("input",{type:"text",value:f,onChange:e=>m(e.target.value),placeholder:"Filter agents...",className:"w-full bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-xs text-white placeholder-gray-600 focus:border-cyan-500/40 focus:outline-none"}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-2",children:[(0,s.jsx)("button",{onClick:()=>{a.size===g.length?n(new Set):n(new Set(g.map(e=>e.alias)))},className:"text-[10px] text-cyan-400 hover:text-cyan-300",children:a.size===g.length?"Deselect all":`Select all (${g.length})`}),(0,s.jsxs)("span",{className:"text-[10px] text-gray-600",children:[a.size," selected"]})]})]}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto px-2 py-2 space-y-0.5 max-h-[200px] lg:max-h-none",children:[g.map(e=>(0,s.jsxs)("button",{onClick:()=>{var t;return t=e.alias,void n(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg text-xs text-left transition-colors ${a.has(e.alias)?"bg-cyan-500/10 text-cyan-300 border border-cyan-500/20":"text-gray-400 hover:bg-[#1a1a2a]"}`,children:[(0,s.jsx)(p.AliasAvatar,{alias:e.alias,size:16}),(0,s.jsx)("div",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${"working"===e.status?"bg-green-400":"idle"===e.status?"bg-cyan-400":"bg-gray-500"}`}),(0,s.jsx)("span",{className:"truncate flex-1",children:e.alias}),(0,s.jsx)("span",{className:"text-[9px] text-gray-600",children:e.agent||"--"})]},e.alias)),0===g.length&&(0,s.jsx)("div",{className:"text-center text-xs text-gray-600 py-4",children:"No online agents"})]})]}),(0,s.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,s.jsxs)("div",{className:"flex-1 px-6 py-4 flex flex-col",children:[(0,s.jsx)("label",{className:"text-xs text-gray-500 uppercase mb-2",children:"Task Prompt"}),(0,s.jsx)("textarea",{value:l,onChange:e=>i(e.target.value),placeholder:"Enter the task you want to dispatch...",className:"flex-1 min-h-[120px] bg-[#111128] border border-[#2a2a4a] rounded-xl px-4 py-3 text-sm text-white placeholder-gray-600 focus:border-cyan-500/40 focus:outline-none resize-none"}),(0,s.jsxs)("div",{className:"flex items-center gap-3 mt-4",children:[(0,s.jsxs)("select",{value:o,onChange:e=>d(e.target.value),className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-xs text-white focus:outline-none",children:[(0,s.jsx)("option",{value:"normal",children:"Normal priority"}),(0,s.jsx)("option",{value:"high",children:"High priority"}),(0,s.jsx)("option",{value:"low",children:"Low priority"})]}),(0,s.jsx)("div",{className:"flex-1"}),(0,s.jsx)("button",{onClick:b,disabled:c||!l.trim()||0===a.size,className:"px-6 py-2.5 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 disabled:from-gray-800 disabled:to-gray-800 disabled:text-gray-600 text-white text-sm font-medium rounded-xl transition-all shadow-lg shadow-cyan-500/10 disabled:shadow-none active:scale-95",children:c?(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Sending..."]}):`Dispatch to ${a.size} agent${a.size>1?"s":""}`})]})]}),h.length>0&&(0,s.jsxs)("div",{className:"px-6 py-3 border-t border-[#2a2a4a] bg-[#0d0d1a]",children:[(0,s.jsxs)("div",{className:"text-xs text-gray-500 mb-2",children:[y,"/",h.length," dispatched successfully"]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:h.map(e=>(0,s.jsxs)("span",{className:`flex items-center gap-1.5 text-[10px] pl-1 pr-2 py-0.5 rounded-full border ${e.ok?"text-green-300 border-green-500/20 bg-green-500/5":"text-red-300 border-red-500/20 bg-red-500/5"}`,children:[(0,s.jsx)(p.AliasAvatar,{alias:e.alias,size:14}),(0,s.jsx)("span",{children:e.alias}),(0,s.jsx)("span",{"aria-hidden":!0,children:e.ok?"✓":e.error||"✗"})]},e.alias))})]})]})]})]})]})}var z=e.i(65822),F=e.i(51280),T=e.i(71235);e.s(["default",0,function(){let e,i,d,c,x;(0,r.useEffect)(()=>{sessionStorage.getItem("anet_v3_auth")||(fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),window.location.assign("/login"))},[]);let{sessions:h,hint:u,error:m,isLoading:g}=(0,z.useSessions)(),{health:v}=(0,z.useHealth)(),{config:k}=(0,z.useAnetConfig)(),{tasks:S}=(0,z.useTasks)({limit:"500"}),{stats:_}=(0,z.useStats)(),{license:$}=(0,z.useLicense)(),[A,R]=(0,r.useState)(window.innerWidth>=1024),[E,O]=(0,r.useState)(!1),P=function(){let[e,t]=(0,r.useState)([]),[s,a]=(0,r.useState)("");return{tabs:e,activeTab:s,openTab:e=>{t(t=>t.includes(e)?t:[...t,e]),a(e)},closeTab:e=>{t(t=>{let r=t.filter(t=>t!==e);return s===e&&a(r[r.length-1]||""),r})},closeAll:()=>{t([]),a("")},setActiveTab:a}}(),[B,L]=(0,r.useState)(!1),[I,W]=(0,r.useState)([]),[H,D]=(0,r.useState)("all"),{mutate:G}=(0,T.useSWRConfig)(),J="1"!==t.default.env.NEXT_PUBLIC_DISABLE_SSE,{connected:U,supported:V}=(0,F.useSSE)({url:"/api/hub/events",enabled:J,onEvent:e=>{["new_task","new_message","new_reply","node_status_changed","broadcast"].includes(e.type)&&(G("/api/hub/status"),G(e=>"string"==typeof e&&e.startsWith("/api/hub/tasks"),void 0,{revalidate:!0}))}});if((0,r.useEffect)(()=>{let e=()=>{fetch("/api/hub/inbox").then(e=>e.json()).then(e=>{e.messages?.length&&W(t=>{let s=new Set(t.map(e=>e.id));return[...e.messages.filter(e=>!s.has(e.id)),...t].slice(0,100)})}).catch(()=>{})};e();let t=setInterval(e,1e4);return()=>clearInterval(t)},[]),g)return(0,s.jsx)(j,{});let q=v?.sse_sessions||{},K=e=>(e.network_id?q[`${e.network_id}:${e.alias}`]:void 0)??q[e.alias],Q=e=>"offline"!==e.status||!!K(e),X=h.filter(Q).length,Y=h.length,Z=h.filter(e=>"working"===e.status).length,ee=v?(0,n.formatUptime)(v.uptime):"--",et=v?.version||"--",es=!!(k?.hub&&k.tokenConfigured),er=k?.source==="file"?"Local config":k?.source==="runtime-env"?"Runtime env":"Config missing",ea={};if(_?.tasks?.by_status?.length)for(let e of _.tasks.by_status)ea[e.status]=e.count;else for(let e of S)ea[e.status]=(ea[e.status]||0)+1;let en=[...h].sort((e,t)=>{let s=+!!Q(e),r=+!!Q(t);if(s!==r)return r-s;let a=+("working"===e.status);return("working"===t.status)-a});return(0,s.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,s.jsx)("div",{className:"lg:ml-0 ml-10",children:(0,s.jsx)(l,{online:X,working:Z,total:Y,version:et,uptime:ee})}),(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,s.jsx)("button",{onClick:()=>L(!0),className:"px-4 py-2 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 text-white text-sm font-medium rounded-xl shadow-lg shadow-cyan-500/10 transition-all active:scale-95 shrink-0",children:"⚡ Dispatch"}),(0,s.jsx)("div",{className:"flex-1",children:(0,s.jsx)(N,{})})]}),(0,s.jsxs)("section",{className:"mb-6 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 shadow-lg shadow-black/20",children:[(0,s.jsxs)("button",{onClick:()=>O(!E),className:"w-full flex items-center justify-between text-left",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,s.jsx)("span",{className:"uppercase text-gray-600",children:"Config"}),(0,s.jsx)("span",{className:`w-2 h-2 rounded-full ${es?"bg-green-400":"bg-red-400"}`}),(0,s.jsx)("span",{className:"text-gray-500",children:er})]}),(0,s.jsx)("svg",{className:`w-4 h-4 text-gray-600 transition-transform ${E?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),E&&(0,s.jsxs)("div",{className:"mt-3 pt-3 border-t border-[#2a2a4a]",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("div",{className:"min-w-0",children:(0,s.jsxs)("div",{className:"text-gray-100 truncate text-sm",title:k?.hub||void 0,children:["Hub: ",(0,s.jsx)("span",{className:k?.hub?"text-cyan-300":"text-red-300",children:k?.hub?.trim()||"not configured"})]})}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2 text-xs",children:(0,s.jsxs)("span",{className:`px-2.5 py-1 rounded-md border ${k?.tokenConfigured?"bg-blue-500/5 text-blue-300 border-blue-500/20":"bg-gray-500/5 text-gray-400 border-gray-500/20"}`,children:["Token: ",k?.tokenPreview||"not configured"]})})]}),k?.error&&(0,s.jsx)("div",{className:"mt-2 text-xs text-gray-600",children:k.error})]})]}),Object.keys(ea).length>0&&(0,s.jsxs)("section",{className:"mb-6 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 shadow-lg shadow-black/20",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("div",{className:"text-xs uppercase text-gray-600",children:"Task Status"}),(0,s.jsx)(a.default,{href:"/tasks",prefetch:!1,className:"text-xs text-cyan-400 hover:text-cyan-300",children:"View all →"})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:[{key:"running",color:"bg-green-500/10 text-green-300 border-green-500/20"},{key:"delivered",color:"bg-blue-500/10 text-blue-300 border-blue-500/20"},{key:"acked",color:"bg-cyan-500/10 text-cyan-300 border-cyan-500/20"},{key:"replied",color:"bg-purple-500/10 text-purple-300 border-purple-500/20"},{key:"failed",color:"bg-red-500/10 text-red-300 border-red-500/20"},{key:"cancelled",color:"bg-yellow-500/10 text-yellow-300 border-yellow-500/20"},{key:"expired",color:"bg-orange-500/10 text-orange-300 border-orange-500/20"},{key:"closed",color:"bg-gray-500/10 text-gray-500 border-gray-500/20"}].filter(({key:e})=>ea[e]).map(({key:e,color:t})=>(0,s.jsxs)(a.default,{href:`/tasks?status=${e}`,prefetch:!1,className:`px-2.5 py-1 rounded-md border text-xs ${t} hover:opacity-80 transition-opacity`,children:[e,": ",ea[e]]},e))})]}),(0,s.jsx)("div",{className:"text-[10px] uppercase tracking-[0.12em] text-gray-600 mb-2",children:"Quick navigation"}),(0,s.jsx)("section",{className:"mb-3 grid grid-cols-3 gap-2 sm:gap-3",children:(e=h.filter(e=>Q(e)&&"working"!==e.status).length,i=Y-X,d=S.filter(e=>"failed"===e.status).length,[{href:"/nodes",label:"Nodes",value:`${X}/${Y}`,sub:`${Y>0?Math.round(X/Y*100):0}% online`,color:"text-green-400 border-green-500/20",popover:0===Y?null:[{k:"working",v:Z,dot:"",color:"#4ade80"},{k:"idle",v:e,dot:"",color:"#22d3ee"},{k:"offline",v:i,dot:"",color:"#9ca3af"}]},{href:"/tasks",label:"Tasks",value:String(Object.values(ea).reduce((e,t)=>e+t,0)||0),sub:"all-time",color:"text-cyan-400 border-cyan-500/20",popover:0===Object.keys(ea).length?null:["running","replied","failed","cancelled","expired","closed","created","delivered","acked"].filter(e=>ea[e]).map(e=>({k:e,v:ea[e],dot:"",color:({running:"#4ade80",replied:"#a78bfa",failed:"#f87171",cancelled:"#facc15",expired:"#fb923c",closed:"#9ca3af",created:"#9ca3af",delivered:"#60a5fa",acked:"#22d3ee"})[e]||"#9ca3af"}))},{href:"/tasks?status=failed",label:"Failed",value:String(ea.failed||0),sub:ea.failed?"needs review":"none",color:ea.failed?"text-red-400 border-red-500/25":"text-gray-500 border-gray-700/30",popover:d?[{k:`${d} in current view`,v:"",dot:"",color:"#f87171"}]:[{k:"no failures yet",v:"",dot:"",color:"#4b5563"}]}].map(e=>(0,s.jsxs)(a.default,{href:e.href,prefetch:!1,className:`anet-stat-link group relative rounded-xl border ${e.color} bg-[#111128] px-3 py-3 transition-all hover:-translate-y-px`,children:[(0,s.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,s.jsx)("div",{className:`text-xl font-semibold tabular-nums ${e.color.split(" ")[0]}`,children:e.value}),(0,s.jsx)("div",{className:"hidden sm:block text-[10px] text-gray-600 group-hover:text-gray-400 transition-colors",children:"View →"})]}),(0,s.jsx)("div",{className:"text-[11px] text-gray-400 mt-0.5",children:e.label}),(0,s.jsx)("div",{className:"text-[10px] text-gray-600 mt-px",children:e.sub}),e.popover&&e.popover.length>0&&(0,s.jsxs)("div",{className:"anet-stat-popover hidden md:block pointer-events-none absolute left-2 right-2 top-full mt-1 z-20 rounded-lg border border-[#2a2a4a] bg-[#0d0d1a] shadow-lg shadow-black/30 px-3 py-2 opacity-0 translate-y-[-2px] group-hover:opacity-100 group-hover:translate-y-0 transition-all duration-150 delay-100",children:[(0,s.jsx)("div",{className:"text-[10px] text-gray-600 uppercase tracking-wider mb-1.5",children:"Breakdown"}),(0,s.jsx)("ul",{className:"space-y-1",children:e.popover.map(e=>(0,s.jsxs)("li",{className:"flex items-center gap-2 text-[11px]",children:[(0,s.jsx)("span",{className:"inline-block w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:e.color},"aria-hidden":!0}),(0,s.jsx)("span",{className:"text-gray-400 capitalize",children:e.k}),""!==e.v&&(0,s.jsx)("span",{className:"ml-auto text-gray-300 tabular-nums font-medium",children:e.v})]},e.k))})]})]},e.href)))}),(0,s.jsx)("section",{className:"mb-6 grid grid-cols-3 gap-2 sm:gap-3",children:[{href:"/messages",label:"Messages",icon:"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"},{href:"/logs",label:"Audit log",icon:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z M14 2v6h6 M16 13H8 M16 17H8 M10 9H8"},{href:"/admin",label:"Admin",icon:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4z M6 21v-2a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v2"}].map(e=>(0,s.jsxs)(a.default,{href:e.href,prefetch:!1,className:"anet-nav-tile flex items-center justify-center gap-2 rounded-xl border border-[#2a2a4a] bg-[#111128] px-3 py-2.5 text-[12px] text-gray-400 hover:text-gray-200 transition-colors",children:[(0,s.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,s.jsx)("path",{d:e.icon})}),(0,s.jsx)("span",{children:e.label})]},e.href))}),(0,s.jsx)(o,{}),S.length>0&&(0,s.jsxs)("section",{className:"mb-6 bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"Recent Activity"}),(0,s.jsx)(a.default,{href:"/tasks",className:"text-xs text-cyan-400 hover:text-cyan-300",children:"All tasks →"})]}),(0,s.jsx)("div",{className:"space-y-2 max-h-40 overflow-y-auto",children:S.slice(0,5).map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,s.jsx)("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${"replied"===e.status?"bg-purple-400":"running"===e.status?"bg-green-400":"failed"===e.status?"bg-red-400":"bg-blue-400"}`}),e.from_name&&(0,s.jsx)(p.AliasAvatar,{alias:e.from_name,size:14}),(0,s.jsx)("span",{className:"text-gray-300 shrink-0 max-w-[20%] truncate",children:e.from_name||"?"}),(0,s.jsx)("span",{className:"text-gray-600",children:"→"}),e.to_name&&(0,s.jsx)(p.AliasAvatar,{alias:e.to_name,size:14}),(0,s.jsx)("span",{className:"text-gray-300 shrink-0 max-w-[20%] truncate",children:e.to_name||"?"}),(0,s.jsx)("span",{className:"text-gray-500 truncate flex-1",children:e.content?.slice(0,40)||"--"}),(0,s.jsx)("span",{className:`shrink-0 px-1.5 py-0.5 rounded text-[10px] border ${"replied"===e.status?"text-purple-300 border-purple-500/20":"failed"===e.status?"text-red-300 border-red-500/20":"text-gray-500 border-gray-700/30"}`,children:e.status})]},e.task_id))})]}),m&&(0,s.jsxs)("div",{className:"bg-red-900/20 border border-red-800/40 text-red-300 px-4 py-3 rounded-lg mb-6 text-sm flex items-center justify-between",role:"alert",children:[(0,s.jsx)("span",{children:String(m)}),(0,s.jsx)("span",{className:"text-gray-500 text-xs",children:"Check CommHub connection"})]}),h.length>0&&(0,s.jsx)("div",{className:"flex justify-center mb-4",children:(0,s.jsx)("button",{onClick:()=>R(!A),className:"text-xs text-gray-500 hover:text-gray-300 border border-gray-700/50 px-4 py-1.5 rounded-lg transition-colors hover:border-gray-600 cursor-pointer",children:A?"Hide Topology":"Show Topology"})}),!A&&h.length>0&&(0,s.jsx)("div",{className:"lg:hidden text-center text-xs text-gray-600 mb-4",children:"Topology hidden on mobile for better readability"}),A&&h.length>0&&(0,s.jsx)(f,{sessions:h,sseSessions:q}),0!==h.length||m?(c={all:en.length,working:en.filter(e=>Q(e)&&"working"===e.status).length,idle:en.filter(e=>Q(e)&&"working"!==e.status).length,offline:en.filter(e=>!Q(e)).length},x=en.filter(e=>"all"===H||("offline"===H?!Q(e):"working"===H?Q(e)&&"working"===e.status:"idle"!==H||Q(e)&&"working"!==e.status)),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mb-3 flex flex-wrap items-center gap-1",children:[{key:"all",label:"All"},{key:"working",label:"Working",dot:"#4ade80"},{key:"idle",label:"Idle",dot:"#22d3ee"},{key:"offline",label:"Offline",dot:"#6b7280"}].map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>D(e.key),disabled:0===c[e.key]&&"all"!==e.key,className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs transition-colors disabled:opacity-30 disabled:cursor-not-allowed ${H===e.key?"bg-cyan-500/10 text-cyan-300 border border-cyan-500/30":"text-gray-500 hover:text-gray-200 hover:bg-[#1a1a2a] border border-transparent"}`,children:[e.dot&&(0,s.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full",style:{backgroundColor:e.dot}}),(0,s.jsx)("span",{children:e.label}),(0,s.jsx)("span",{className:`text-[10px] tabular-nums ${H===e.key?"text-cyan-400":"text-gray-600"}`,children:c[e.key]})]},e.key))}),(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4 gap-3 sm:gap-4",children:x.map(e=>(0,s.jsx)(b,{session:e,hasSse:Q(e),sseCount:K(e)||0,onChat:P.openTab},e.alias))}),0===x.length&&(0,s.jsxs)("div",{className:"mt-4 text-center text-xs text-gray-600",children:['No agents match "',H,'" — ',(0,s.jsx)("button",{onClick:()=>D("all"),className:"underline hover:text-gray-400",children:"Show all"})]})]})):(0,s.jsx)(w.NodesEmptyState,{hint:u}),(0,s.jsx)(y,{messages:I}),(0,s.jsxs)("div",{className:"mt-8 text-center text-xs text-gray-600 flex items-center justify-center gap-2 flex-wrap",children:[V&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${U?"bg-green-400":"bg-gray-600"}`}),U?"SSE live":"SWR polling"]}),$?.license&&(0,s.jsxs)(s.Fragment,{children:[V&&(0,s.jsx)(s.Fragment,{children:"·"}),(0,s.jsxs)("span",{className:$.license.days_left<=7?"text-red-400":"pro"===$.license.type?"text-green-400":"text-yellow-400",children:[$.license.type," (",$.license.days_left,"d left)"]})]})]}),B&&(0,s.jsx)(M,{sessions:h,onClose:()=>L(!1)}),P.tabs.length>0&&(0,s.jsx)(C,{tabs:P.tabs,activeTab:P.activeTab,onOpenTab:P.openTab,onCloseTab:P.closeTab,onSetActive:P.setActiveTab,onClose:P.closeAll})]})}],31713)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18150,e=>{"use strict";e.s(["formatUptime",0,function(e){let t=Math.floor(e/3600),s=Math.floor(e%3600/60);return t>0?`${t}h ${s}m`:`${s}m`},"timeAgo",0,function(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}])},69874,e=>{"use strict";var t=e.i(18050);let s=[180,200,220,270,300,330,30,90];e.s(["AliasAvatar",0,function({alias:e,size:r=28,className:a=""}){let n=function(e){let t=0;for(let s=0;s<e.length;s++)t=31*t+e.charCodeAt(s)>>>0;let r=s[t%s.length];return{bg:`hsl(${r} 55% 22%)`,ring:`hsl(${r} 60% 45%)`,text:`hsl(${r} 80% 78%)`}}(e),i=Math.max(9,Math.round(.42*r));return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${a}`,style:{width:r,height:r,fontSize:i,backgroundColor:n.bg,borderColor:n.ring,color:n.text},title:e,"aria-hidden":!0,children:e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"})}])},95356,e=>{"use strict";var t=e.i(18050),s=e.i(71645),r=e.i(22016);let a={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function n({variant:e,size:s}){let r={width:s,height:s},a={fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"nodes":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...a,children:[(0,t.jsx)("circle",{cx:"32",cy:"14",r:"4"}),(0,t.jsx)("circle",{cx:"14",cy:"44",r:"4"}),(0,t.jsx)("circle",{cx:"50",cy:"44",r:"4"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"14",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"50",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"18",y1:"44",x2:"46",y2:"44",strokeDasharray:"3 3",opacity:"0.6"})]})});case"tasks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...a,children:[(0,t.jsx)("rect",{x:"14",y:"14",width:"36",height:"6",rx:"1.5"}),(0,t.jsx)("rect",{x:"14",y:"26",width:"36",height:"6",rx:"1.5",opacity:"0.6"}),(0,t.jsx)("rect",{x:"14",y:"38",width:"36",height:"6",rx:"1.5",opacity:"0.35"})]})});case"messages":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...a,children:[(0,t.jsx)("path",{d:"M14 18 h36 a3 3 0 0 1 3 3 v18 a3 3 0 0 1 -3 3 h-18 l-8 6 v-6 h-10 a3 3 0 0 1 -3 -3 v-18 a3 3 0 0 1 3 -3 z"}),(0,t.jsx)("line",{x1:"22",y1:"28",x2:"42",y2:"28",opacity:"0.5"}),(0,t.jsx)("line",{x1:"22",y1:"34",x2:"36",y2:"34",opacity:"0.5"})]})});case"logs":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...a,children:[(0,t.jsx)("path",{d:"M18 12 h22 l8 8 v32 a2 2 0 0 1 -2 2 h-28 a2 2 0 0 1 -2 -2 v-38 a2 2 0 0 1 2 -2 z"}),(0,t.jsx)("path",{d:"M40 12 v8 h8",opacity:"0.6"}),(0,t.jsx)("line",{x1:"24",y1:"32",x2:"40",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"24",y1:"38",x2:"40",y2:"38",opacity:"0.4"}),(0,t.jsx)("line",{x1:"24",y1:"44",x2:"34",y2:"44",opacity:"0.25"})]})});case"tokens":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...a,children:[(0,t.jsx)("circle",{cx:"22",cy:"32",r:"8"}),(0,t.jsx)("line",{x1:"30",y1:"32",x2:"54",y2:"32"}),(0,t.jsx)("line",{x1:"44",y1:"32",x2:"44",y2:"38"}),(0,t.jsx)("line",{x1:"50",y1:"32",x2:"50",y2:"40"})]})});case"networks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...a,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"18"}),(0,t.jsx)("ellipse",{cx:"32",cy:"32",rx:"18",ry:"9",opacity:"0.55"}),(0,t.jsx)("line",{x1:"14",y1:"32",x2:"50",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"32",y1:"14",x2:"32",y2:"50",opacity:"0.55"})]})});default:return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...a,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"14",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"32",cy:"32",r:"3"})]})})}}function i({variant:e="generic",title:s,sub:l,cta:o,compact:c=!1}){let x=a[e],d=s??x.title,h=l??x.sub;return(0,t.jsxs)("div",{className:`text-center ${c?"py-8":"py-16"} px-4`,role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)(n,{variant:e,size:c?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${c?"text-sm":"text-base"}`,children:d}),h&&(0,t.jsx)("p",{className:`text-gray-500 ${c?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:h}),o&&(0,t.jsx)("div",{className:"mt-4",children:o.href?(0,t.jsxs)(r.default,{href:o.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,t.jsxs)("button",{onClick:o.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}function l({cmd:e}){let[r,a]=(0,s.useState)(!1),n=async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),1800)}catch{}};return(0,t.jsxs)("div",{className:"anet-empty-cmd flex items-center gap-2 bg-[#0a0a15] border border-[#2a2a4a] rounded-lg pl-4 pr-1.5 py-1.5 text-xs sm:text-sm",children:[(0,t.jsx)("code",{className:"text-cyan-300 font-mono select-all",children:e}),(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":r?"Copied":"Copy command",className:"shrink-0 rounded-md px-2 py-1.5 text-[11px] text-gray-500 hover:text-gray-200 hover:bg-[#1a1a2a] transition-colors",children:r?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-green-400",children:[(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5"})}),"Copied"]}):(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Copy"]})})]})}e.s(["EmptyState",0,i,"NodesEmptyState",0,function({hint:e}){return e?.global_count?(0,t.jsx)(i,{variant:"nodes",title:"No agents in this network",sub:`Server has ${e.global_count} nodes globally, but none are registered to the current network. Switch network or contact admin.`}):(0,t.jsxs)("div",{className:"text-center py-16 px-4",role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)("svg",{viewBox:"0 0 64 64",width:56,height:56,children:(0,t.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[(0,t.jsx)("rect",{x:"10",y:"20",width:"44",height:"28",rx:"2"}),(0,t.jsx)("rect",{x:"20",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"32",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"44",y:"32",width:"4",height:"8",opacity:"0.5"}),(0,t.jsx)("line",{x1:"10",y1:"26",x2:"54",y2:"26",opacity:"0.4"}),(0,t.jsx)("circle",{cx:"14",cy:"23",r:"0.8",fill:"currentColor"})]})})}),(0,t.jsx)("h3",{className:"font-medium text-gray-300 text-base",children:"Spin up your first agent"}),(0,t.jsx)("p",{className:"text-gray-500 text-sm mt-2 max-w-md mx-auto leading-relaxed",children:"Run this in a fresh terminal to register an agent with this CommHub:"}),(0,t.jsx)("div",{className:"mt-4 inline-block",children:(0,t.jsx)(l,{cmd:"npx --yes @sleep2agi/agent-network init"})}),(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsxs)("a",{href:"https://anet.sh",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium text-gray-500 hover:text-cyan-300",children:["Full quickstart guide",(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}])},18581,e=>{"use strict";var t=e.i(18050),s=e.i(71645),r=e.i(22016),a=e.i(18150),n=e.i(95356),i=e.i(69874),l=e.i(83599);let o=e=>fetch(e).then(e=>e.json());e.s(["default",0,function(){let{data:e,mutate:c}=(0,l.default)("/api/hub/networks",o,{refreshInterval:1e4}),x=e?.networks||[],d=!e,[h,m]=(0,s.useState)(""),[u,p]=(0,s.useState)(""),[g,y]=(0,s.useState)(""),[j,b]=(0,s.useState)(null),[v,w]=(0,s.useState)(null),[f,k]=(0,s.useState)({}),[N,C]=(0,s.useState)("member"),[_,S]=(0,s.useState)(""),$=()=>{try{let e=sessionStorage.getItem("anet_v3_auth");if(e)return JSON.parse(e).token}catch{}return""},T=async()=>{if(!h.trim())return;let e=$();if(!e)return void y("V3 auth required — sign in via Agent Network login");let t=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create_network",token:e,name:h,description:u})}),s=await t.json();y(s.ok?`Created: ${s.network_id}`:`Failed: ${s.error}`),s.ok&&(m(""),p(""),c()),setTimeout(()=>y(""),5e3)},M=async e=>{let t=$();if(!t)return;let s=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"delete_network",token:t,network_id:e})}),r=await s.json();y(r.ok?"Deleted":`Failed: ${r.error}`),b(null),r.ok&&c(),setTimeout(()=>y(""),5e3)},A=async e=>{let t=$();if(!t)return;let s=await fetch(`/api/hub/auth?endpoint=/api/networks/${e}/members&token=${t}`),r=await s.json();k(t=>({...t,[e]:r.members||[]}))},B=async e=>{let t=$();if(!t)return;let s=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"invite_member",token:t,network_id:e,role:N})}),r=await s.json();r.ok&&r.invite_code?S(r.invite_code):y(`Invite failed: ${r.error}`)};return(0,t.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,t.jsx)(r.default,{href:"/settings",className:"text-gray-500 hover:text-gray-300 text-sm lg:ml-0 ml-10",children:"← Settings"}),(0,t.jsx)("h1",{className:"text-2xl font-bold text-white",children:"Networks"}),(0,t.jsx)("span",{className:"text-xs bg-blue-900/30 text-blue-400 px-2 py-0.5 rounded-full border border-blue-800/30",children:x.length})]}),(0,t.jsxs)("div",{className:"max-w-2xl space-y-6",children:[(0,t.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-3",children:"Create Network"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("input",{type:"text",value:h,onChange:e=>m(e.target.value),placeholder:"Network name",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,t.jsx)("input",{type:"text",value:u,onChange:e=>p(e.target.value),placeholder:"Description (optional)",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,t.jsx)("button",{onClick:T,disabled:!h.trim(),className:"px-4 py-2 bg-green-600 hover:bg-green-500 disabled:bg-gray-800 text-white text-sm rounded-lg transition-colors",children:"Create"})]}),g&&(0,t.jsx)("div",{className:`mt-2 text-xs ${g.startsWith("Failed")||g.startsWith("V3")||g.startsWith("Invite")?"text-red-400":"text-green-400"}`,children:g})]}),(0,t.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"My Networks"}),x.length>0&&(0,t.jsxs)("span",{className:"text-[10px] text-gray-600 uppercase tracking-wide",children:[x.length," total"]})]}),d?(0,t.jsx)("div",{className:"animate-pulse space-y-2",children:[1,2].map(e=>(0,t.jsx)("div",{className:"h-14 bg-gray-800/20 rounded"},e))}):0===x.length?(0,t.jsx)(n.EmptyState,{variant:"networks",compact:!0,sub:"Create your first network above, or sign in with V3 auth to see existing ones."}):(0,t.jsx)("div",{className:"space-y-3",children:x.map(e=>(0,t.jsxs)("div",{className:"bg-[#0a0a15] rounded-lg px-4 py-3 border border-[#1a1a2a]",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3 min-w-0",children:[(0,t.jsx)(i.AliasAvatar,{alias:e.network_name,size:28}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-sm text-white font-medium truncate",children:e.network_name}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-500 font-mono truncate",title:e.network_id,children:[e.network_id," · ",(0,a.timeAgo)(e.created_at)]}),e.description&&(0,t.jsx)("div",{className:"text-xs text-gray-400 mt-1",children:e.description})]})]}),(0,t.jsxs)("div",{className:"flex gap-2 shrink-0",children:[(0,t.jsx)("button",{onClick:()=>{v===e.network_id?w(null):(w(e.network_id),A(e.network_id))},className:"text-xs text-cyan-400 hover:text-cyan-300 px-2 py-1 rounded border border-cyan-800/30 hover:bg-cyan-500/10",children:v===e.network_id?"Hide":"Members"}),j===e.network_id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>M(e.network_id),className:"text-xs text-red-400 px-2 py-1 rounded border border-red-800/30 bg-red-500/10",children:"Confirm"}),(0,t.jsx)("button",{onClick:()=>b(null),className:"text-xs text-gray-500",children:"Cancel"})]}):(0,t.jsx)("button",{onClick:()=>b(e.network_id),className:"text-xs text-red-400 hover:text-red-300 px-2 py-1 rounded border border-red-800/30 hover:bg-red-500/10",children:"Delete"})]})]}),v===e.network_id&&(0,t.jsxs)("div",{className:"mt-3 pt-3 border-t border-[#1a1a2a]",children:[(0,t.jsxs)("div",{className:"text-xs text-gray-500 mb-2",children:["Members (",(f[e.network_id]||[]).length,")"]}),0===(f[e.network_id]||[]).length?(0,t.jsx)("div",{className:"text-[10px] text-gray-600",children:"No members or V3 auth required"}):(f[e.network_id]||[]).map(e=>{let s=e.username||e.display_name||"?";return(0,t.jsxs)("div",{className:"flex items-center gap-2 justify-between text-xs py-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)(i.AliasAvatar,{alias:s,size:16}),(0,t.jsx)("span",{className:"text-gray-300 truncate",children:s})]}),(0,t.jsx)("span",{className:`px-1.5 py-0.5 rounded border text-[10px] shrink-0 ${"owner"===e.role?"text-yellow-300 border-yellow-500/20":"text-gray-400 border-gray-600/20"}`,children:e.role})]},e.user_id)}),(0,t.jsxs)("div",{className:"mt-3 pt-3 border-t border-[#1a1a2a]",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 mb-2",children:"Invite"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("select",{value:N,onChange:e=>C(e.target.value),className:"bg-[#0a0a15] border border-[#2a2a4a] rounded px-2 py-1 text-xs text-white focus:outline-none",children:[(0,t.jsx)("option",{value:"member",children:"member"}),(0,t.jsx)("option",{value:"admin",children:"admin"}),(0,t.jsx)("option",{value:"viewer",children:"viewer"})]}),(0,t.jsx)("button",{onClick:()=>B(e.network_id),className:"px-2 py-1 bg-green-600 hover:bg-green-500 text-white text-xs rounded",children:"Generate Code"})]}),_&&(0,t.jsxs)("div",{className:"mt-2 bg-green-500/5 border border-green-500/20 rounded px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("div",{className:"text-[10px] text-green-400 uppercase tracking-wide",children:"Invite code"}),(0,t.jsx)("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(_).catch(()=>{})},className:"text-[10px] text-green-300 hover:text-green-200 px-1.5 py-0.5 rounded border border-green-500/20 hover:bg-green-500/10",children:"Copy"})]}),(0,t.jsx)("code",{className:"text-xs text-green-300 select-all break-all",children:_})]})]})]})]},e.network_id))})]})]})]})}])}]);
@@ -0,0 +1,7 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18150,e=>{"use strict";e.s(["formatUptime",0,function(e){let t=Math.floor(e/3600),s=Math.floor(e%3600/60);return t>0?`${t}h ${s}m`:`${s}m`},"timeAgo",0,function(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}])},69874,e=>{"use strict";var t=e.i(18050);let s=[180,200,220,270,300,330,30,90];e.s(["AliasAvatar",0,function({alias:e,size:a=28,className:r=""}){let i=function(e){let t=0;for(let s=0;s<e.length;s++)t=31*t+e.charCodeAt(s)>>>0;let a=s[t%s.length];return{bg:`hsl(${a} 55% 22%)`,ring:`hsl(${a} 60% 45%)`,text:`hsl(${a} 80% 78%)`}}(e),n=Math.max(9,Math.round(.42*a));return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${r}`,style:{width:a,height:a,fontSize:n,backgroundColor:i.bg,borderColor:i.ring,color:i.text},title:e,"aria-hidden":!0,children:e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"})}])},95356,e=>{"use strict";var t=e.i(18050),s=e.i(71645),a=e.i(22016);let r={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function i({variant:e,size:s}){let a={width:s,height:s},r={fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"nodes":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"14",r:"4"}),(0,t.jsx)("circle",{cx:"14",cy:"44",r:"4"}),(0,t.jsx)("circle",{cx:"50",cy:"44",r:"4"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"14",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"50",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"18",y1:"44",x2:"46",y2:"44",strokeDasharray:"3 3",opacity:"0.6"})]})});case"tasks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("rect",{x:"14",y:"14",width:"36",height:"6",rx:"1.5"}),(0,t.jsx)("rect",{x:"14",y:"26",width:"36",height:"6",rx:"1.5",opacity:"0.6"}),(0,t.jsx)("rect",{x:"14",y:"38",width:"36",height:"6",rx:"1.5",opacity:"0.35"})]})});case"messages":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M14 18 h36 a3 3 0 0 1 3 3 v18 a3 3 0 0 1 -3 3 h-18 l-8 6 v-6 h-10 a3 3 0 0 1 -3 -3 v-18 a3 3 0 0 1 3 -3 z"}),(0,t.jsx)("line",{x1:"22",y1:"28",x2:"42",y2:"28",opacity:"0.5"}),(0,t.jsx)("line",{x1:"22",y1:"34",x2:"36",y2:"34",opacity:"0.5"})]})});case"logs":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M18 12 h22 l8 8 v32 a2 2 0 0 1 -2 2 h-28 a2 2 0 0 1 -2 -2 v-38 a2 2 0 0 1 2 -2 z"}),(0,t.jsx)("path",{d:"M40 12 v8 h8",opacity:"0.6"}),(0,t.jsx)("line",{x1:"24",y1:"32",x2:"40",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"24",y1:"38",x2:"40",y2:"38",opacity:"0.4"}),(0,t.jsx)("line",{x1:"24",y1:"44",x2:"34",y2:"44",opacity:"0.25"})]})});case"tokens":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"22",cy:"32",r:"8"}),(0,t.jsx)("line",{x1:"30",y1:"32",x2:"54",y2:"32"}),(0,t.jsx)("line",{x1:"44",y1:"32",x2:"44",y2:"38"}),(0,t.jsx)("line",{x1:"50",y1:"32",x2:"50",y2:"40"})]})});case"networks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"18"}),(0,t.jsx)("ellipse",{cx:"32",cy:"32",rx:"18",ry:"9",opacity:"0.55"}),(0,t.jsx)("line",{x1:"14",y1:"32",x2:"50",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"32",y1:"14",x2:"32",y2:"50",opacity:"0.55"})]})});default:return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"14",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"32",cy:"32",r:"3"})]})})}}function n({variant:e="generic",title:s,sub:l,cta:o,compact:c=!1}){let x=r[e],d=s??x.title,h=l??x.sub;return(0,t.jsxs)("div",{className:`text-center ${c?"py-8":"py-16"} px-4`,role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)(i,{variant:e,size:c?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${c?"text-sm":"text-base"}`,children:d}),h&&(0,t.jsx)("p",{className:`text-gray-500 ${c?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:h}),o&&(0,t.jsx)("div",{className:"mt-4",children:o.href?(0,t.jsxs)(a.default,{href:o.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,t.jsxs)("button",{onClick:o.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}function l({cmd:e}){let[a,r]=(0,s.useState)(!1),i=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1800)}catch{}};return(0,t.jsxs)("div",{className:"anet-empty-cmd flex items-center gap-2 bg-[#0a0a15] border border-[#2a2a4a] rounded-lg pl-4 pr-1.5 py-1.5 text-xs sm:text-sm",children:[(0,t.jsx)("code",{className:"text-cyan-300 font-mono select-all",children:e}),(0,t.jsx)("button",{type:"button",onClick:i,"aria-label":a?"Copied":"Copy command",className:"shrink-0 rounded-md px-2 py-1.5 text-[11px] text-gray-500 hover:text-gray-200 hover:bg-[#1a1a2a] transition-colors",children:a?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-green-400",children:[(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5"})}),"Copied"]}):(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Copy"]})})]})}e.s(["EmptyState",0,n,"NodesEmptyState",0,function({hint:e}){return e?.global_count?(0,t.jsx)(n,{variant:"nodes",title:"No agents in this network",sub:`Server has ${e.global_count} nodes globally, but none are registered to the current network. Switch network or contact admin.`}):(0,t.jsxs)("div",{className:"text-center py-16 px-4",role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)("svg",{viewBox:"0 0 64 64",width:56,height:56,children:(0,t.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[(0,t.jsx)("rect",{x:"10",y:"20",width:"44",height:"28",rx:"2"}),(0,t.jsx)("rect",{x:"20",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"32",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"44",y:"32",width:"4",height:"8",opacity:"0.5"}),(0,t.jsx)("line",{x1:"10",y1:"26",x2:"54",y2:"26",opacity:"0.4"}),(0,t.jsx)("circle",{cx:"14",cy:"23",r:"0.8",fill:"currentColor"})]})})}),(0,t.jsx)("h3",{className:"font-medium text-gray-300 text-base",children:"Spin up your first agent"}),(0,t.jsx)("p",{className:"text-gray-500 text-sm mt-2 max-w-md mx-auto leading-relaxed",children:"Run this in a fresh terminal to register an agent with this CommHub:"}),(0,t.jsx)("div",{className:"mt-4 inline-block",children:(0,t.jsx)(l,{cmd:"npx --yes @sleep2agi/agent-network init"})}),(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsxs)("a",{href:"https://anet.sh",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium text-gray-500 hover:text-cyan-300",children:["Full quickstart guide",(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}])},65822,e=>{"use strict";var t=e.i(83599),s=e.i(58963);let a=async e=>{let t=await fetch(e);if(401===t.status)throw window.location.assign("/login"),Error("unauthorized");return t.json()},r={refreshInterval:5e3,dedupingInterval:3e3};function i(e,t){if(!t)return e;let s=e.includes("?")?"&":"?";return`${e}${s}network_id=${encodeURIComponent(t)}`}e.s(["useAnetConfig",0,function(){let{data:e}=(0,t.default)("/api/anet/config",a,{refreshInterval:3e4});return{config:e||null}},"useHealth",0,function(){let{data:e,error:s}=(0,t.default)("/api/hub/health",a,r);return{health:e||null,error:s}},"useLicense",0,function(){let{data:e,error:s}=(0,t.default)("/api/hub/license",a,{refreshInterval:6e4});return{license:e?.ok?e:null,error:s}},"useMessages",0,function(e=100){let{networkId:n}=(0,s.useNetworkId)(),{data:l,error:o,isLoading:c}=(0,t.default)(i(`/api/hub/messages?limit=${e}`,n),a,r);return{messages:l?.messages||[],error:o,isLoading:c}},"useSessions",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:n,error:l,isLoading:o}=(0,t.default)(i("/api/hub/status",e),a,r);return{sessions:n?.sessions||[],hint:n?._hint,error:l,isLoading:o}},"useStats",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:n,error:l}=(0,t.default)(i("/api/hub/stats",e),a,r);return{stats:n?.ok?n:null,error:l}},"useTasks",0,function(e){let{networkId:n}=(0,s.useNetworkId)(),l=new URLSearchParams({limit:"100",...e}).toString(),{data:o,error:c,isLoading:x}=(0,t.default)(i(`/api/hub/tasks?${l}`,n),a,r);return{tasks:o?.tasks||[],count:o?.count??0,source:o?.source,error:c,isLoading:x}}])},82756,e=>{"use strict";var t=e.i(18050),s=e.i(71645),a=e.i(65822),r=e.i(18150),i=e.i(95356),n=e.i(69874);let l={task:"bg-green-500/10 text-green-300 border-green-500/20",message:"bg-blue-500/10 text-blue-300 border-blue-500/20",broadcast:"bg-purple-500/10 text-purple-300 border-purple-500/20",reply:"bg-cyan-500/10 text-cyan-300 border-cyan-500/20"};function o(e){return e?new Date(e.replace(" ","T")+"Z").getTime():0}function c(e){return"broadcast"===e.type?"broadcast":"dashboard"===(e.from_alias||"").toLowerCase()?"outgoing":"incoming"}function x(e,s){let a=e||"--",r=s.trim();if(!r||r.startsWith("from:"))return a;let i=a.toLowerCase().indexOf(r.toLowerCase());return i<0?a:(0,t.jsxs)(t.Fragment,{children:[a.slice(0,i),(0,t.jsx)("mark",{className:"bg-yellow-500/30 text-yellow-200 rounded px-0.5",children:a.slice(i,i+r.length)}),a.slice(i+r.length)]})}e.s(["default",0,function(){let{messages:e,isLoading:d}=(0,a.useMessages)(200),[h,m]=(0,s.useState)(""),[u,p]=(0,s.useState)(""),[g,y]=(0,s.useState)(!1),[j,b]=(0,s.useState)("timeline"),f=(0,s.useMemo)(()=>{let t=new Set;return e.forEach(e=>{let s=e.from_alias?.trim();s&&"dashboard"!==s.toLowerCase()&&t.add(s)}),[...t].slice(0,8)},[e]),v=(0,s.useMemo)(()=>{let t=u.trim().toLowerCase(),s=t.startsWith("from:")?t.slice(5).trim():"";return[...e].filter(e=>(!h||e.type===h)&&(s?(e.from_alias||"").toLowerCase().includes(s):!t||(e.from_alias||"").toLowerCase().includes(t)||(e.to_alias||"").toLowerCase().includes(t)||(e.content||"").toLowerCase().includes(t))).sort((e,t)=>o(e.created_at)-o(t.created_at))},[h,e,u]),w=(0,s.useMemo)(()=>{let e=new Map;return v.forEach(t=>{let s=t.from_alias||"?",a=t.to_alias||"?",r=[s,a].sort().join("↔"),i=e.get(r)||{participants:[s,a].sort(),messages:[],lastTime:0};i.messages.push(t),i.lastTime=Math.max(i.lastTime,o(t.created_at)),e.set(r,i)}),[...e.values()].sort((e,t)=>t.lastTime-e.lastTime)},[v]);return(0,t.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-white lg:ml-0 ml-10",children:"Messages"}),(0,t.jsx)("span",{className:"text-xs bg-blue-900/30 text-blue-400 px-2 py-0.5 rounded-full border border-blue-800/30",children:e.length}),v.length>0&&(0,t.jsx)("button",{onClick:()=>{let e=v.map(e=>`**${e.from_alias||"?"}** → ${e.to_alias||"?"} (${e.type||"?"}) — ${e.created_at||""}
2
+
3
+ ${e.content||"--"}
4
+
5
+ ---`).join("\n\n"),t=new Blob([`# Messages Export
6
+
7
+ ${e}`],{type:"text/markdown"}),s=URL.createObjectURL(t),a=document.createElement("a");a.href=s,a.download=`messages-${new Date().toISOString().slice(0,10)}.md`,a.click(),URL.revokeObjectURL(s)},className:"text-xs text-gray-500 hover:text-gray-300 border border-gray-700/50 px-2.5 py-1 rounded-lg transition-colors",children:"Export MD"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-3 mb-3",children:[(0,t.jsx)("input",{type:"text",value:u,onChange:e=>p(e.target.value),placeholder:"Search from/to/content or use from:alias",className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-blue-500/50 focus:outline-none w-full sm:w-72"}),(0,t.jsxs)("select",{value:h,onChange:e=>m(e.target.value),className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white focus:border-blue-500/50 focus:outline-none",children:[(0,t.jsx)("option",{value:"",children:"All types"}),(0,t.jsx)("option",{value:"task",children:"task"}),(0,t.jsx)("option",{value:"message",children:"message"}),(0,t.jsx)("option",{value:"broadcast",children:"broadcast"}),(0,t.jsx)("option",{value:"reply",children:"reply"})]}),(0,t.jsx)("div",{className:"flex rounded-lg border border-[#2a2a4a] bg-[#111128] p-0.5",children:["timeline","grouped"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>b(e),className:`rounded-md px-2.5 py-1.5 text-xs transition-colors ${j===e?"bg-cyan-500/10 text-cyan-300":"text-gray-500 hover:text-gray-200"}`,children:"timeline"===e?"Timeline":"Grouped"},e))}),(0,t.jsx)("button",{onClick:()=>y(!g),className:`text-xs px-3 py-2 rounded-lg border transition-colors ${g?"bg-yellow-500/10 text-yellow-300 border-yellow-500/20":"text-gray-500 border-gray-700/50 hover:text-gray-300"}`,children:g?"Debug ON":"Debug"})]}),f.length>0&&(0,t.jsxs)("div",{className:"mb-6 flex flex-wrap gap-2",children:[f.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>p(`from:${e}`),className:`rounded-full border px-3 py-1 text-xs transition-colors ${u===`from:${e}`?"border-cyan-500/30 bg-cyan-500/10 text-cyan-300":"border-[#2a2a4a] bg-[#111128] text-gray-400 hover:text-gray-200"}`,children:["from:",e]},e)),u.startsWith("from:")&&(0,t.jsx)("button",{type:"button",onClick:()=>p(""),className:"rounded-full border border-gray-700 px-3 py-1 text-xs text-gray-500 hover:text-gray-200",children:"Clear"})]}),d?(0,t.jsx)("div",{className:"animate-pulse space-y-3",children:[1,2,3,4,5].map(e=>(0,t.jsx)("div",{className:"h-20 rounded-2xl bg-gray-800/20"},e))}):0===v.length?(0,t.jsx)(i.EmptyState,{variant:"messages"}):"grouped"===j?(0,t.jsx)("div",{className:"space-y-4",children:w.map((e,s)=>(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl overflow-hidden",children:[(0,t.jsxs)("div",{className:"px-4 py-2.5 border-b border-[#2a2a4a] flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.AliasAvatar,{alias:e.participants[0],size:16}),(0,t.jsx)("span",{className:"text-sm text-gray-200 font-medium",children:e.participants[0]}),(0,t.jsx)("span",{className:"text-gray-600 text-xs",children:"↔"}),(0,t.jsx)(n.AliasAvatar,{alias:e.participants[1],size:16}),(0,t.jsx)("span",{className:"text-sm text-gray-200 font-medium",children:e.participants[1]})]}),(0,t.jsxs)("span",{className:"text-[10px] text-gray-600",children:[e.messages.length," messages"]})]}),(0,t.jsx)("div",{className:"px-4 py-2 space-y-2 max-h-64 overflow-y-auto",children:e.messages.map(e=>(0,t.jsxs)("div",{className:"flex items-start gap-2 text-xs py-1",children:[e.from_alias&&(0,t.jsx)(n.AliasAvatar,{alias:e.from_alias,size:14}),(0,t.jsx)("span",{className:"shrink-0 font-medium text-gray-200",children:e.from_alias}),(0,t.jsx)("span",{className:"text-gray-400 flex-1",children:e.content?.slice(0,120)||"--"}),(0,t.jsx)("span",{className:"text-[9px] text-gray-600 shrink-0",children:(0,r.timeAgo)(e.created_at||"")})]},e.id))})]},s))}):(0,t.jsx)("div",{className:"space-y-1",children:v.map((e,s)=>{var a;let i=v[s-1],d=!!i&&o(e.created_at)-o(i.created_at)>3e5,h=c(e),m=!!i&&!d&&c(i)===h&&(i.from_alias||"")===(e.from_alias||"")&&(i.to_alias||"")===(e.to_alias||""),p=e.from_alias||"?";return(0,t.jsxs)("div",{children:[d&&(0,t.jsxs)("div",{className:"my-4 flex items-center gap-3",children:[(0,t.jsx)("div",{className:"h-px flex-1 bg-[#2a2a4a]"}),(0,t.jsx)("div",{className:"text-[11px] text-gray-600",children:(a=e.created_at)?new Date(a.replace(" ","T")+"Z").toLocaleString():"Time gap"}),(0,t.jsx)("div",{className:"h-px flex-1 bg-[#2a2a4a]"})]}),"broadcast"===h?(0,t.jsx)("div",{className:m?"mt-1":"mt-3",children:(0,t.jsxs)("div",{className:"rounded-2xl border border-purple-500/20 bg-purple-500/10 px-4 py-3 shadow-sm w-full",children:[(0,t.jsxs)("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-md border ${l[e.type||""]||"bg-gray-500/10 text-gray-400 border-gray-500/20"}`,children:e.type||"unknown"}),(0,t.jsx)("span",{className:"text-sm font-medium text-purple-200",children:p}),e.to_alias&&(0,t.jsxs)("span",{className:"text-xs text-purple-200/80",children:["to ",e.to_alias]}),"high"===e.priority&&(0,t.jsx)("span",{className:"text-xs text-red-400",children:"HIGH"}),(0,t.jsx)("span",{className:"ml-auto text-xs text-gray-500",children:e.created_at?(0,r.timeAgo)(e.created_at):"--"})]}),(0,t.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-relaxed text-gray-200",children:x(e.content,u)})]})}):(0,t.jsxs)("div",{className:`${m?"mt-1":"mt-3"} flex gap-2 ${"outgoing"===h?"flex-row-reverse":"flex-row"}`,children:[(0,t.jsx)("div",{className:"w-8 shrink-0 pt-1",children:!m&&(0,t.jsx)(n.AliasAvatar,{alias:p,size:32})}),(0,t.jsxs)("div",{className:`min-w-0 max-w-3xl rounded-2xl border px-4 py-3 shadow-sm ${"outgoing"===h?"border-green-500/20 bg-green-500/10":"border-blue-500/20 bg-blue-500/10"}`,children:[!m&&(0,t.jsxs)("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-md border ${l[e.type||""]||"bg-gray-500/10 text-gray-400 border-gray-500/20"}`,children:e.type||"unknown"}),(0,t.jsx)("span",{className:`text-sm font-medium ${"outgoing"===h?"text-green-300":"text-blue-300"}`,children:p}),(0,t.jsx)("span",{className:"text-xs text-gray-600",children:"→"}),(0,t.jsx)("span",{className:"text-sm text-gray-300",children:e.to_alias||"--"}),"high"===e.priority&&(0,t.jsx)("span",{className:"text-xs text-red-400",children:"HIGH"}),(0,t.jsx)("span",{className:"ml-auto text-xs text-gray-500",children:e.created_at?(0,r.timeAgo)(e.created_at):"--"})]}),(0,t.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-relaxed text-gray-200",children:x(e.content,u)}),m&&(0,t.jsx)("div",{className:"mt-1 text-[10px] text-gray-600 text-right",children:e.created_at?(0,r.timeAgo)(e.created_at):""}),g&&(0,t.jsxs)("div",{className:"mt-3 border-t border-white/10 pt-3 text-xs text-gray-500 space-y-1",children:[(0,t.jsxs)("div",{children:["ID: ",e.id]}),e.task_id&&(0,t.jsxs)("div",{children:["Task ID: ",e.task_id]}),(0,t.jsxs)("div",{children:["Created: ",e.created_at]})]})]})]})]},e.id)})})]})}])}]);