@sleep2agi/agent-network-dashboard 0.1.2 → 0.2.0

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 (140) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/diagnostics/route-bundle-stats.json +7 -7
  5. package/.next/fallback-build-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.html +1 -1
  14. package/.next/server/app/_not-found.rsc +1 -1
  15. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  16. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  17. package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  20. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  21. package/.next/server/app/admin.html +1 -1
  22. package/.next/server/app/admin.rsc +1 -1
  23. package/.next/server/app/admin.segments/_full.segment.rsc +1 -1
  24. package/.next/server/app/admin.segments/_head.segment.rsc +1 -1
  25. package/.next/server/app/admin.segments/_index.segment.rsc +1 -1
  26. package/.next/server/app/admin.segments/_tree.segment.rsc +1 -1
  27. package/.next/server/app/admin.segments/admin/__PAGE__.segment.rsc +1 -1
  28. package/.next/server/app/admin.segments/admin.segment.rsc +1 -1
  29. package/.next/server/app/docs.html +1 -1
  30. package/.next/server/app/docs.rsc +1 -1
  31. package/.next/server/app/docs.segments/_full.segment.rsc +1 -1
  32. package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  33. package/.next/server/app/docs.segments/_index.segment.rsc +1 -1
  34. package/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
  35. package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  36. package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  37. package/.next/server/app/index.html +2 -2
  38. package/.next/server/app/index.rsc +2 -2
  39. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  40. package/.next/server/app/index.segments/_full.segment.rsc +2 -2
  41. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  42. package/.next/server/app/index.segments/_index.segment.rsc +1 -1
  43. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  44. package/.next/server/app/login.html +1 -1
  45. package/.next/server/app/login.rsc +1 -1
  46. package/.next/server/app/login.segments/_full.segment.rsc +1 -1
  47. package/.next/server/app/login.segments/_head.segment.rsc +1 -1
  48. package/.next/server/app/login.segments/_index.segment.rsc +1 -1
  49. package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  50. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
  51. package/.next/server/app/login.segments/login.segment.rsc +1 -1
  52. package/.next/server/app/logs.html +1 -1
  53. package/.next/server/app/logs.rsc +1 -1
  54. package/.next/server/app/logs.segments/_full.segment.rsc +1 -1
  55. package/.next/server/app/logs.segments/_head.segment.rsc +1 -1
  56. package/.next/server/app/logs.segments/_index.segment.rsc +1 -1
  57. package/.next/server/app/logs.segments/_tree.segment.rsc +1 -1
  58. package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +1 -1
  59. package/.next/server/app/logs.segments/logs.segment.rsc +1 -1
  60. package/.next/server/app/messages.html +1 -1
  61. package/.next/server/app/messages.rsc +1 -1
  62. package/.next/server/app/messages.segments/_full.segment.rsc +1 -1
  63. package/.next/server/app/messages.segments/_head.segment.rsc +1 -1
  64. package/.next/server/app/messages.segments/_index.segment.rsc +1 -1
  65. package/.next/server/app/messages.segments/_tree.segment.rsc +1 -1
  66. package/.next/server/app/messages.segments/messages/__PAGE__.segment.rsc +1 -1
  67. package/.next/server/app/messages.segments/messages.segment.rsc +1 -1
  68. package/.next/server/app/node/page_client-reference-manifest.js +1 -1
  69. package/.next/server/app/node.html +2 -2
  70. package/.next/server/app/node.rsc +2 -2
  71. package/.next/server/app/node.segments/_full.segment.rsc +2 -2
  72. package/.next/server/app/node.segments/_head.segment.rsc +1 -1
  73. package/.next/server/app/node.segments/_index.segment.rsc +1 -1
  74. package/.next/server/app/node.segments/_tree.segment.rsc +1 -1
  75. package/.next/server/app/node.segments/node/__PAGE__.segment.rsc +2 -2
  76. package/.next/server/app/node.segments/node.segment.rsc +1 -1
  77. package/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
  78. package/.next/server/app/nodes.html +2 -2
  79. package/.next/server/app/nodes.rsc +2 -2
  80. package/.next/server/app/nodes.segments/_full.segment.rsc +2 -2
  81. package/.next/server/app/nodes.segments/_head.segment.rsc +1 -1
  82. package/.next/server/app/nodes.segments/_index.segment.rsc +1 -1
  83. package/.next/server/app/nodes.segments/_tree.segment.rsc +1 -1
  84. package/.next/server/app/nodes.segments/nodes/__PAGE__.segment.rsc +2 -2
  85. package/.next/server/app/nodes.segments/nodes.segment.rsc +1 -1
  86. package/.next/server/app/page_client-reference-manifest.js +1 -1
  87. package/.next/server/app/settings/networks.html +1 -1
  88. package/.next/server/app/settings/networks.rsc +1 -1
  89. package/.next/server/app/settings/networks.segments/_full.segment.rsc +1 -1
  90. package/.next/server/app/settings/networks.segments/_head.segment.rsc +1 -1
  91. package/.next/server/app/settings/networks.segments/_index.segment.rsc +1 -1
  92. package/.next/server/app/settings/networks.segments/_tree.segment.rsc +1 -1
  93. package/.next/server/app/settings/networks.segments/settings/networks/__PAGE__.segment.rsc +1 -1
  94. package/.next/server/app/settings/networks.segments/settings/networks.segment.rsc +1 -1
  95. package/.next/server/app/settings/networks.segments/settings.segment.rsc +1 -1
  96. package/.next/server/app/settings/tokens.html +1 -1
  97. package/.next/server/app/settings/tokens.rsc +1 -1
  98. package/.next/server/app/settings/tokens.segments/_full.segment.rsc +1 -1
  99. package/.next/server/app/settings/tokens.segments/_head.segment.rsc +1 -1
  100. package/.next/server/app/settings/tokens.segments/_index.segment.rsc +1 -1
  101. package/.next/server/app/settings/tokens.segments/_tree.segment.rsc +1 -1
  102. package/.next/server/app/settings/tokens.segments/settings/tokens/__PAGE__.segment.rsc +1 -1
  103. package/.next/server/app/settings/tokens.segments/settings/tokens.segment.rsc +1 -1
  104. package/.next/server/app/settings/tokens.segments/settings.segment.rsc +1 -1
  105. package/.next/server/app/settings.html +1 -1
  106. package/.next/server/app/settings.rsc +1 -1
  107. package/.next/server/app/settings.segments/_full.segment.rsc +1 -1
  108. package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  109. package/.next/server/app/settings.segments/_index.segment.rsc +1 -1
  110. package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  111. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
  112. package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  113. package/.next/server/app/tasks.html +1 -1
  114. package/.next/server/app/tasks.rsc +1 -1
  115. package/.next/server/app/tasks.segments/_full.segment.rsc +1 -1
  116. package/.next/server/app/tasks.segments/_head.segment.rsc +1 -1
  117. package/.next/server/app/tasks.segments/_index.segment.rsc +1 -1
  118. package/.next/server/app/tasks.segments/_tree.segment.rsc +1 -1
  119. package/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +1 -1
  120. package/.next/server/app/tasks.segments/tasks.segment.rsc +1 -1
  121. package/.next/server/chunks/[root-of-the-server]__0nsfjkb._.js +1 -1
  122. package/.next/server/chunks/[root-of-the-server]__0nsfjkb._.js.map +1 -1
  123. package/.next/server/chunks/ssr/[root-of-the-server]__0xm3h9x._.js +1 -1
  124. package/.next/server/chunks/ssr/[root-of-the-server]__0xm3h9x._.js.map +1 -1
  125. package/.next/server/chunks/ssr/app_page_tsx_0es_sk2._.js +1 -1
  126. package/.next/server/chunks/ssr/app_page_tsx_0es_sk2._.js.map +1 -1
  127. package/.next/server/middleware-build-manifest.js +3 -3
  128. package/.next/server/pages/404.html +1 -1
  129. package/.next/server/pages/500.html +1 -1
  130. package/.next/static/chunks/0ep9nej0rnar-.js +1 -0
  131. package/.next/static/chunks/{0krweyme4bfjm.js → 0wkxts8wri2er.js} +1 -1
  132. package/.next/trace +2 -2
  133. package/.next/trace-build +1 -1
  134. package/app/api/hub/events/route.ts +28 -7
  135. package/app/components/TaskChatPanel.tsx +32 -19
  136. package/package.json +1 -1
  137. package/.next/static/chunks/0p96.fb-gibzj.js +0 -1
  138. /package/.next/static/{UaT8UC89b6VNckokigCV- → q-j-l-aUCzasmkiiHyEOp}/_buildManifest.js +0 -0
  139. /package/.next/static/{UaT8UC89b6VNckokigCV- → q-j-l-aUCzasmkiiHyEOp}/_clientMiddlewareManifest.js +0 -0
  140. /package/.next/static/{UaT8UC89b6VNckokigCV- → q-j-l-aUCzasmkiiHyEOp}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,31713,e=>{"use strict";var t=e.i(47167),s=e.i(18050),a=e.i(71645),r=e.i(22016),l=e.i(18150);function n({online:e,working:t,total:a,version:r,uptime:l}){let i=a>0?Math.round(e/a*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 ",r," · ",l]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[(0,s.jsx)(o,{value:e,label:"Online",sub:`${i}% of fleet`,color:"text-green-400",accent:"from-green-500/20 to-green-500/0",border:"border-green-500/15"}),(0,s.jsx)(o,{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)(o,{value:a-e,label:"Offline",sub:a-e==0?"All systems go":`${a-e} disconnected`,color:"text-gray-400",accent:"from-gray-500/10 to-gray-500/0",border:"border-gray-500/15"}),(0,s.jsx)(o,{value:a,label:"Total",sub:"Registered nodes",color:"text-white",accent:"from-blue-500/15 to-blue-500/0",border:"border-blue-500/15"})]})]})}function o({value:e,label:t,sub:a,color:r,accent:l,border:n}){return(0,s.jsxs)("div",{className:`relative overflow-hidden rounded-xl border ${n} bg-[#111128] px-4 py-3`,children:[(0,s.jsx)("div",{className:`absolute inset-0 bg-gradient-to-br ${l} pointer-events-none`}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:`text-3xl font-bold ${r} 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:a})]})]})}function i(){let[e,t]=(0,a.useState)(""),[r,l]=(0,a.useState)(!1),[n,o]=(0,a.useState)(""),i=async()=>{if(e.trim()){l(!0),o("");try{let s=await fetch("/api/hub/broadcast",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}),a=await s.json();a.ok?(o(`Broadcast sent to ${a.recipients} node(s)`),t("")):o(`Failed: ${a.error||"Send error"}`)}catch(e){o(`Failed: ${e instanceof Error?e.message:"Send error"}`)}l(!1),setTimeout(()=>o(""),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&&i(),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:i,disabled:r||!e.trim(),"aria-label":"Send broadcast",className:"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:r?"Sending...":"Broadcast"})]}),e.length>0&&(0,s.jsxs)("div",{className:"text-right text-xs text-gray-600 mt-1",children:[e.length,"/500"]}),n&&(0,s.jsx)("div",{className:`mt-3 text-sm text-center ${n.startsWith("Failed")?"text-red-400":"text-green-400/80"} animate-fade-in`,children:n})]})}function d(e,t,s){let a=t<=2?Math.PI:1.78*Math.PI,r=-Math.PI/2-a/2,l=t<=1?-Math.PI/2:r+a*e/(t-1);return{x:500+s*Math.cos(l),y:330+s*Math.sin(l)}}function c(e,t,s=0){let a=(e.x+t.x)/2,r=(e.y+t.y)/2,l=t.x-e.x,n=t.y-e.y,o=Math.hypot(l,n)||1,i={x:a+-n/o*s,y:r+l/o*s};return`M${e.x},${e.y} Q${i.x},${i.y} ${t.x},${t.y}`}function x(e,t){return e.length>t?`${e.slice(0,t-1)}...`:e}function u({sessions:e,sseSessions:t}){let[r,l]=(0,a.useState)([]);(0,a.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();l(t.messages||[])}catch{}};e();let t=setInterval(e,5e3);return()=>clearInterval(t)},[]);let{onlineNodes:n,offlineNodes:o,nodePositions:i,flowLinks:h,activeAliases:m}=(0,a.useMemo)(()=>{let s,a=e.filter(e=>"offline"!==e.status||t[e.alias]),l=e.filter(e=>"offline"===e.status&&!t[e.alias]),n={};a.forEach((e,t)=>{n[e.alias]=d(t,Math.max(a.length,1),220)}),l.forEach((e,t)=>{n[e.alias]=d(t,Math.max(l.length,1),315)});let o=(s=new Map,r.forEach(e=>{if(!n[e.from_alias]||!n[e.to_alias]||e.from_alias===e.to_alias)return;let t=`${e.from_alias}->${e.to_alias}`,a=s.get(t);s.set(t,{key:t,from:e.from_alias,to:e.to_alias,count:(a?.count||0)+1,content:a?.content||e.content})}),[...s.values()].slice(0,18)),i=new Set;return o.forEach(e=>{i.add(e.from),i.add(e.to)}),{onlineNodes:a,offlineNodes:l,nodePositions:n,flowLinks:o,activeAliases:i}},[r,e,t]),g=n.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:[g," 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:[n.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:[h.length," active links"]})]})]}),(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-lg border border-[#2a2a4a] bg-[#080814] shadow-2xl shadow-cyan-950/30",children:[(0,s.jsx)("div",{className:"absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-cyan-400/70 to-transparent"}),(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:"#0b1220"}),(0,s.jsx)("stop",{offset:"48%",stopColor:"#080814"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#101018"})]}),(0,s.jsxs)("radialGradient",{id:"topo-radar",cx:"50%",cy:"50%",r:"55%",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#22d3ee",stopOpacity:"0.18"}),(0,s.jsx)("stop",{offset:"45%",stopColor:"#22c55e",stopOpacity:"0.045"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#020617",stopOpacity:"0"})]}),(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:"#67e8f9"})})]}),(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)"}),[90,170,250,330].map(e=>(0,s.jsx)("circle",{cx:500,cy:330,r:e,fill:"none",stroke:"#164e63",strokeWidth:"1",opacity:"0.35"},e)),[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:"#164e63",strokeWidth:"1",opacity:"0.18"},e)),n.map(e=>{let t=i[e.alias];if(!t)return null;let a=c({x:500,y:330},t,0);return(0,s.jsx)("path",{d:a,fill:"none",stroke:m.has(e.alias)?"#22d3ee":"#155e75",strokeWidth:m.has(e.alias)?2:1,strokeDasharray:m.has(e.alias)?"none":"8 10",opacity:m.has(e.alias)?.65:.35},`hub-${e.alias}`)}),h.map((e,t)=>{let a=i[e.from],r=i[e.to];if(!a||!r)return null;let l=c(a,r,t%2==0?36:-36),n=Math.min(2+e.count,7);return(0,s.jsxs)("g",{children:[(0,s.jsx)("path",{d:l,fill:"none",stroke:"#67e8f9",strokeWidth:n,opacity:"0.28",filter:"url(#topo-glow)",markerEnd:"url(#topo-arrow)"}),(0,s.jsx)("path",{id:`flow-path-${t}`,d:l,fill:"none",stroke:"#e0f2fe",strokeWidth:"1",strokeDasharray:"2 12",opacity:"0.75"}),(0,s.jsx)("circle",{r:"4",fill:"#fef08a",filter:"url(#topo-glow)",children:(0,s.jsx)("animateMotion",{dur:`${2.2+t%5*.32}s`,repeatCount:"indefinite",path:l})})]},e.key)}),(0,s.jsxs)("g",{filter:"url(#topo-glow)",children:[(0,s.jsx)("circle",{cx:500,cy:330,r:"56",fill:"#020617",stroke:"#67e8f9",strokeWidth:"2"}),(0,s.jsxs)("circle",{cx:500,cy:330,r:"42",fill:"none",stroke:"#22c55e",strokeWidth:"1.5",opacity:"0.8",children:[(0,s.jsx)("animate",{attributeName:"r",values:"42;52;42",dur:"3s",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"opacity",values:"0.8;0.2;0.8",dur:"3s",repeatCount:"indefinite"})]}),(0,s.jsx)("path",{d:"M470 330 h60 M500 300 v60",stroke:"#e0f2fe",strokeWidth:"5",strokeLinecap:"round",opacity:"0.9"}),(0,s.jsx)("text",{x:500,y:408,textAnchor:"middle",fill:"#e5e7eb",fontSize:"16",fontFamily:"monospace",fontWeight:"700",children:"DASHBOARD"}),(0,s.jsx)("text",{x:500,y:426,textAnchor:"middle",fill:"#64748b",fontSize:"10",fontFamily:"monospace",children:"command relay"})]}),[...n,...o].map(e=>{let a=i[e.alias];if(!a)return null;let r="offline"!==e.status||!!t[e.alias],l=r?"working"===e.status?{label:"working",primary:"#22c55e",halo:"#14532d",text:"#dcfce7"}:"idle"===e.status?{label:"idle",primary:"#2dd4bf",halo:"#134e4a",text:"#ccfbf1"}:{label:e.status||"online",primary:"#38bdf8",halo:"#0c4a6e",text:"#e0f2fe"}:{label:"offline",primary:"#6b7280",halo:"#111827",text:"#9ca3af"},n=m.has(e.alias),o=r?26:18;return(0,s.jsxs)("g",{className:"transition-opacity",children:[n&&(0,s.jsxs)("circle",{cx:a.x,cy:a.y,r:o+14,fill:l.primary,opacity:"0.12",children:[(0,s.jsx)("animate",{attributeName:"r",values:`${o+8};${o+22};${o+8}`,dur:"2.4s",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"opacity",values:"0.18;0.04;0.18",dur:"2.4s",repeatCount:"indefinite"})]}),(0,s.jsx)("circle",{cx:a.x,cy:a.y,r:o+8,fill:l.halo,opacity:r?.55:.25}),(0,s.jsx)("circle",{cx:a.x,cy:a.y,r:o,fill:r?"#020617":"#080814",stroke:l.primary,strokeWidth:r?3:1.5,strokeDasharray:r?"none":"5 5",filter:r?"url(#topo-glow)":void 0}),(0,s.jsx)("circle",{cx:a.x,cy:a.y,r:r?8:5,fill:l.primary}),"working"===e.status&&(0,s.jsx)("path",{d:`M${a.x-9},${a.y+11} h18`,stroke:"#fef08a",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(${a.x}, ${a.y+o+22})`,children:[(0,s.jsx)("rect",{x:"-62",y:"-14",width:"124",height:"42",rx:"6",fill:"#020617",stroke:"#1f2937",opacity:"0.94"}),(0,s.jsx)("text",{x:"0",y:"1",textAnchor:"middle",fill:l.text,fontSize:"12",fontFamily:"monospace",fontWeight:"700",children:x(e.alias,14)}),(0,s.jsxs)("text",{x:"0",y:"17",textAnchor:"middle",fill:l.primary,fontSize:"9",fontFamily:"monospace",children:[l.label," ",r?`sse:${t[e.alias]}`:""]})]})]},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(h.length,4),rx:"8",fill:"#020617",stroke:"#1f2937",opacity:"0.94"}),(0,s.jsx)("text",{x:"16",y:"26",fill:"#e5e7eb",fontSize:"13",fontFamily:"monospace",fontWeight:"700",children:"recent signal"}),(0,s.jsxs)("text",{x:"178",y:"26",fill:"#67e8f9",fontSize:"11",fontFamily:"monospace",children:[r.length," messages"]}),h.slice(0,4).map((e,t)=>(0,s.jsxs)("text",{x:"16",y:54+20*t,fill:"#94a3b8",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:"#020617",stroke:"#1f2937",opacity:"0.94"}),(0,s.jsx)("circle",{cx:"18",cy:"26",r:"6",fill:"#22c55e"}),(0,s.jsx)("text",{x:"34",y:"30",fill:"#94a3b8",fontSize:"11",fontFamily:"monospace",children:"working node"}),(0,s.jsx)("circle",{cx:"18",cy:"52",r:"6",fill:"#2dd4bf"}),(0,s.jsx)("text",{x:"34",y:"56",fill:"#94a3b8",fontSize:"11",fontFamily:"monospace",children:"online idle"}),(0,s.jsx)("circle",{cx:"18",cy:"78",r:"6",fill:"#6b7280"}),(0,s.jsx)("text",{x:"34",y:"82",fill:"#94a3b8",fontSize:"11",fontFamily:"monospace",children:"offline / no SSE"}),(0,s.jsx)("path",{d:"M150,78 Q176,52 210,78",fill:"none",stroke:"#67e8f9",strokeWidth:"3",markerEnd:"url(#topo-arrow)"})]})]})]})]})}let h={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:""}},m={bg:"bg-gray-800/50 border-gray-700/30",text:"text-gray-500",dot:"bg-gray-500",glow:""};function g({session:e,hasSse:t,sseCount:a,onChat:n}){let o=t&&h[e.status]||m;return(0,s.jsxs)(r.default,{href:`/node?alias=${encodeURIComponent(e.alias)}`,prefetch:!1,className:`block rounded-xl border p-4 transition-all duration-300 cursor-pointer ${t?`bg-[#111128] border-[#2a2a4a] hover:border-cyan-500/30 hover:shadow-lg ${o.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)("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${o.dot} ${t&&"working"===e.status?"animate-pulse":""}`}),(0,s.jsx)("span",{className:"font-semibold text-white truncate text-sm",title:e.alias,children:e.alias})]}),(0,s.jsx)("span",{className:`text-[11px] px-2 py-0.5 rounded-md border shrink-0 ${o.bg} ${o.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:",a]})]}),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:o.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",{children:e.server||"--"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[n&&t&&(0,s.jsx)("button",{onClick:t=>{t.preventDefault(),t.stopPropagation(),n(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,l.timeAgo)(e.updated_at)})]})]})]})}function f({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 justify-between text-xs text-gray-500 mb-1.5",children:[(0,s.jsx)("span",{className:"text-blue-400 font-medium",children:e.from_session}),(0,s.jsx)("span",{children:e.created_at})]}),(0,s.jsx)("div",{className:"text-gray-300 leading-relaxed",children:e.content})]},e.id))})]})}function b(){return(0,s.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-6 font-mono animate-pulse",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-8",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"h-7 w-48 bg-gray-800 rounded mb-2"}),(0,s.jsx)("div",{className:"h-4 w-64 bg-gray-800/60 rounded"})]}),(0,s.jsx)("div",{className:"flex gap-3",children:[1,2,3].map(e=>(0,s.jsx)("div",{className:"w-[72px] h-[60px] bg-gray-800/40 rounded-lg border border-gray-800"},e))})]}),(0,s.jsxs)("div",{className:"mb-6 flex gap-2",children:[(0,s.jsx)("div",{className:"flex-1 h-10 bg-gray-800/40 rounded-lg"}),(0,s.jsx)("div",{className:"w-28 h-10 bg-gray-800/40 rounded-lg"})]}),(0,s.jsx)("div",{className:"w-full max-w-4xl mx-auto mb-8 h-64 bg-gray-800/20 rounded-xl"}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[1,2,3,4].map(e=>(0,s.jsxs)("div",{className:"rounded-xl border border-gray-800/40 p-4 bg-gray-800/20",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,s.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-gray-700"}),(0,s.jsx)("div",{className:"h-4 w-24 bg-gray-700 rounded"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("div",{className:"h-3 w-full bg-gray-800/60 rounded"}),(0,s.jsx)("div",{className:"h-3 w-3/4 bg-gray-800/60 rounded"}),(0,s.jsx)("div",{className:"h-3 w-1/2 bg-gray-800/60 rounded"})]})]},e))})]})}function p({hint:e}){return(0,s.jsxs)("div",{className:"text-center py-16",children:[(0,s.jsx)("div",{className:"text-gray-600 text-4xl mb-4",children:"--"}),(0,s.jsx)("h3",{className:"text-gray-400 text-lg font-medium mb-2",children:"No agents in this network"}),e?.global_count?(0,s.jsxs)("p",{className:"text-gray-500 text-sm max-w-md mx-auto",children:["Server has ",(0,s.jsx)("span",{className:"text-cyan-400 font-medium",children:e.global_count})," nodes globally, but none are registered to the current network. Switch network or contact admin."]}):(0,s.jsx)("p",{className:"text-gray-600 text-sm max-w-md mx-auto",children:"Agent sessions will appear here once they connect to the CommHub."})]})}var y=e.i(58963);function j(){let{setNetworkId:e}=(0,y.useNetworkId)(),[t,r]=(0,a.useState)({user:null,networks:[],currentNetwork:"",token:""}),[l,n]=(0,a.useState)(!1),[o,i]=(0,a.useState)(""),[d,c]=(0,a.useState)(""),[x,u]=(0,a.useState)(""),[h,m]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=sessionStorage.getItem("anet_v3_auth");if(e)try{r(JSON.parse(e))}catch{}},[]);let[g,f]=(0,a.useState)(!1),[b,p]=(0,a.useState)(""),[j,v]=(0,a.useState)(""),w=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:b,email:j})});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:b,email:j})}),s=await e.json();if(s.ok&&s.user){let e={...t,user:s.user};r(e),sessionStorage.setItem("anet_v3_auth",JSON.stringify(e)),f(!1)}}catch{}};if(!t.user)return null;let N=(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:N}),(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 a={...t,currentNetwork:s.target.value};r(a),e(s.target.value),sessionStorage.setItem("anet_v3_auth",JSON.stringify(a))},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.jsx)("button",{onClick:()=>{p(t.user?.display_name||""),v(""),f(!g)},className:"text-xs text-gray-500 hover:text-gray-300",children:"Edit"}),(0,s.jsx)("button",{onClick:()=>{r({user:null,networks:[],currentNetwork:"",token:""}),sessionStorage.removeItem("anet_v3_auth")},className:"text-xs text-gray-500 hover:text-gray-300",children:"Sign out"})]}),g&&(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:b,onChange:e=>p(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:j,onChange:e=>v(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:w,className:"px-2 py-1 bg-cyan-600 hover:bg-cyan-500 text-white text-xs rounded",children:"Save"})]})]})}var v=e.i(21373),w=e.i(58442);function N({tabs:e,activeTab:t,onOpenTab:a,onCloseTab:r,onSetActive:l,onClose:n}){return 0===e.length?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{onClick:n,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:()=>l(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(),r(e)},className:"jsx-f7cf3d1a6fdfc074 ml-1 text-gray-600 hover:text-gray-300 p-0.5",children:"×"})]},e))}),(0,s.jsx)("button",{onClick:n,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)(k,{alias:e})},e))})]}),(0,s.jsx)(v.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 k({alias:e}){return(0,s.jsx)(w.TaskChatPanel,{alias:e,onClose:()=>{},inline:!0})}function S({sessions:e,onClose:t}){let[r,l]=(0,a.useState)(new Set),[n,o]=(0,a.useState)(""),[i,d]=(0,a.useState)("normal"),[c,x]=(0,a.useState)(!1),[u,h]=(0,a.useState)([]),[m,g]=(0,a.useState)(""),f=e.filter(e=>"offline"!==e.status).filter(e=>!m||e.alias.toLowerCase().includes(m.toLowerCase())||(e.agent||"").toLowerCase().includes(m.toLowerCase())),b=async()=>{if(!n.trim()||0===r.size||c)return;x(!0),h([]);let e=[...r].map(async e=>{try{let t=await fetch("/api/hub/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({alias:e,task:n,priority:i})}),s=await t.json();return{alias:e,ok:!!s.ok,error:s.error}}catch(t){return{alias:e,ok:!1,error:"send failed"}}});h(await Promise.all(e)),x(!1)},p=u.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",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",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:m,onChange:e=>g(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:()=>{r.size===f.length?l(new Set):l(new Set(f.map(e=>e.alias)))},className:"text-[10px] text-cyan-400 hover:text-cyan-300",children:r.size===f.length?"Deselect all":`Select all (${f.length})`}),(0,s.jsxs)("span",{className:"text-[10px] text-gray-600",children:[r.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:[f.map(e=>(0,s.jsxs)("button",{onClick:()=>{var t;return t=e.alias,void l(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 ${r.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)("div",{className:`w-2 h-2 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===f.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:n,onChange:e=>o(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:i,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||!n.trim()||0===r.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 ${r.size} agent${r.size>1?"s":""}`})]})]}),u.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:[p,"/",u.length," dispatched successfully"]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:u.map(e=>(0,s.jsxs)("span",{className:`text-[10px] px-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:[e.alias,": ",e.ok?"✓":e.error||"✗"]},e.alias))})]})]})]})]})]})}var C=e.i(65822),$=e.i(71235);e.s(["default",0,function(){(0,a.useEffect)(()=>{sessionStorage.getItem("anet_v3_auth")||(fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),window.location.assign("/login"))},[]);let{sessions:e,hint:o,error:d,isLoading:c}=(0,C.useSessions)(),{health:x}=(0,C.useHealth)(),{config:h}=(0,C.useAnetConfig)(),{tasks:m}=(0,C.useTasks)({limit:"500"}),{stats:y}=(0,C.useStats)(),{license:v}=(0,C.useLicense)(),[w,k]=(0,a.useState)(window.innerWidth>=1024),[_,M]=(0,a.useState)(!1),T=function(){let[e,t]=(0,a.useState)([]),[s,r]=(0,a.useState)("");return{tabs:e,activeTab:s,openTab:e=>{t(t=>t.includes(e)?t:[...t,e]),r(e)},closeTab:e=>{t(t=>{let a=t.filter(t=>t!==e);return s===e&&r(a[a.length-1]||""),a})},closeAll:()=>{t([]),r("")},setActiveTab:r}}(),[A,E]=(0,a.useState)(!1),[z,L]=(0,a.useState)([]),{mutate:O}=(0,$.useSWRConfig)(),{connected:P,supported:W}=function({url:e,onEvent:t,reconnectDelay:s=3e3,enabled:r=!0}){let[l,n]=(0,a.useState)(!1),[o,i]=(0,a.useState)(null),[d,c]=(0,a.useState)(null),x=(0,a.useRef)(null),u=(0,a.useRef)(void 0),h=(0,a.useRef)(!1),m=(0,a.useRef)(null),g=(0,a.useRef)(!1),f=(0,a.useCallback)(()=>{if(!r||!e||h.current||g.current)return;x.current&&(x.current.close(),x.current=null),m.current&&m.current.abort();let a=e.includes("?")?`${e}&probe=1`:`${e}?probe=1`,l=new AbortController;m.current=l;let o=setTimeout(()=>l.abort(),5e3);fetch(a,{method:"HEAD",cache:"no-store",signal:l.signal}).finally(()=>clearTimeout(o)).then(a=>{if(g.current)return;if("true"!==a.headers.get("x-anet-sse-available")){h.current=!0,n(!1),c(!1);return}c(!0);let r=new EventSource(e);x.current=r,r.onopen=()=>n(!0),r.onmessage=e=>{try{let s=JSON.parse(e.data);i(s),t?.(s)}catch{}},r.onerror=()=>{n(!1),r.close(),x.current=null,g.current||(u.current=setTimeout(f,s))}}).catch(()=>{g.current||(n(!1),c(!1))})},[e,t,s,r]);return(0,a.useEffect)(()=>(h.current=!1,g.current=!1,c(!!r&&null),f(),()=>{g.current=!0,m.current&&(m.current.abort(),m.current=null),x.current&&(x.current.close(),x.current=null),u.current&&clearTimeout(u.current)}),[f]),{connected:l,lastEvent:o,supported:d}}({url:"/api/hub/events",enabled:"1"!==t.default.env.NEXT_PUBLIC_DISABLE_SSE,onEvent:e=>{["new_task","new_message","new_reply","node_status_changed","broadcast"].includes(e.type)&&(O("/api/hub/status"),O(e=>"string"==typeof e&&e.startsWith("/api/hub/tasks"),void 0,{revalidate:!0}))}});if((0,a.useEffect)(()=>{let e=()=>{fetch("/api/hub/inbox").then(e=>e.json()).then(e=>{e.messages?.length&&L(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)},[]),c)return(0,s.jsx)(b,{});let I=x?.sse_sessions||{},F=e=>"offline"!==e.status||!!I[e.alias],B=e.filter(F).length,D=e.length,R=e.filter(e=>"working"===e.status).length,H=x?(0,l.formatUptime)(x.uptime):"--",J=x?.version||"--",U=!!(h?.hub&&h.tokenConfigured),G=h?.source==="file"?"Local config":h?.source==="runtime-env"?"Runtime env":"Config missing",K={};if(y?.tasks?.by_status?.length)for(let e of y.tasks.by_status)K[e.status]=e.count;else for(let e of m)K[e.status]=(K[e.status]||0)+1;let Q=[...e].sort((e,t)=>{let s=+!!F(e),a=+!!F(t);if(s!==a)return a-s;let r=+("working"===e.status);return("working"===t.status)-r});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)(n,{online:B,working:R,total:D,version:J,uptime:H})}),(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,s.jsx)("button",{onClick:()=>E(!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)(j,{})})]}),(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:()=>M(!_),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 ${U?"bg-green-400":"bg-red-400"}`}),(0,s.jsx)("span",{className:"text-gray-500",children:G})]}),(0,s.jsx)("svg",{className:`w-4 h-4 text-gray-600 transition-transform ${_?"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"})})]}),_&&(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:h?.hub||void 0,children:["Hub: ",(0,s.jsx)("span",{className:h?.hub?"text-cyan-300":"text-red-300",children:h?.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 ${h?.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: ",h?.tokenPreview||"not configured"]})})]}),h?.error&&(0,s.jsx)("div",{className:"mt-2 text-xs text-gray-600",children:h.error})]})]}),Object.keys(K).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)(r.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})=>K[e]).map(({key:e,color:t})=>(0,s.jsxs)(r.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,": ",K[e]]},e))})]}),(0,s.jsx)("section",{className:"mb-6 grid grid-cols-3 sm:grid-cols-6 gap-2",children:[{href:"/nodes",label:"Nodes",value:`${B}/${D}`,color:"text-green-400 border-green-500/15"},{href:"/tasks",label:"Tasks",value:String(Object.values(K).reduce((e,t)=>e+t,0)||"--"),color:"text-cyan-400 border-cyan-500/15"},{href:"/tasks?status=failed",label:"Failed",value:String(K.failed||0),color:K.failed?"text-red-400 border-red-500/20":"text-gray-600 border-gray-700/30"},{href:"/messages",label:"Messages",value:"→",color:"text-blue-400 border-blue-500/15"},{href:"/logs",label:"Logs",value:"→",color:"text-purple-400 border-purple-500/15"},{href:"/admin",label:"Admin",value:"→",color:"text-gray-400 border-gray-500/15"}].map(e=>(0,s.jsxs)(r.default,{href:e.href,prefetch:!1,className:`text-center rounded-xl border ${e.color} bg-[#111128] px-3 py-2.5 hover:bg-[#161630] transition-colors`,children:[(0,s.jsx)("div",{className:`text-lg font-bold tabular-nums ${e.color.split(" ")[0]}`,children:e.value}),(0,s.jsx)("div",{className:"text-[10px] text-gray-500",children:e.label})]},e.href))}),(0,s.jsx)(i,{}),m.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)(r.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:m.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"}`}),(0,s.jsx)("span",{className:"text-blue-400 shrink-0",children:e.from_name||"?"}),(0,s.jsx)("span",{className:"text-gray-600",children:"→"}),(0,s.jsx)("span",{className:"text-cyan-400 shrink-0",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))})]}),d&&(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(d)}),(0,s.jsx)("span",{className:"text-gray-500 text-xs",children:"Check CommHub connection"})]}),e.length>0&&(0,s.jsx)("div",{className:"flex justify-center mb-4",children:(0,s.jsx)("button",{onClick:()=>k(!w),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:w?"Hide Topology":"Show Topology"})}),!w&&e.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"}),w&&e.length>0&&(0,s.jsx)(u,{sessions:e,sseSessions:I}),0!==e.length||d?(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",children:Q.map(e=>(0,s.jsx)(g,{session:e,hasSse:F(e),sseCount:I[e.alias]||0,onChat:T.openTab},e.alias))}):(0,s.jsx)(p,{hint:o}),(0,s.jsx)(f,{messages:z}),(0,s.jsxs)("div",{className:"mt-8 text-center text-xs text-gray-600 flex items-center justify-center gap-2 flex-wrap",children:[W&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${P?"bg-green-400":"bg-gray-600"}`}),P?"SSE live":"SWR polling"]}),v?.license&&(0,s.jsxs)(s.Fragment,{children:[W&&(0,s.jsx)(s.Fragment,{children:"·"}),(0,s.jsxs)("span",{className:v.license.days_left<=7?"text-red-400":"pro"===v.license.type?"text-green-400":"text-yellow-400",children:[v.license.type," (",v.license.days_left,"d left)"]})]})]}),A&&(0,s.jsx)(S,{sessions:e,onClose:()=>E(!1)}),T.tabs.length>0&&(0,s.jsx)(N,{tabs:T.tabs,activeTab:T.activeTab,onOpenTab:T.openTab,onCloseTab:T.closeTab,onSetActive:T.setActiveTab,onClose:T.closeAll})]})}],31713)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,31713,e=>{"use strict";var t=e.i(47167),s=e.i(18050),a=e.i(71645),r=e.i(22016),l=e.i(18150);function n({online:e,working:t,total:a,version:r,uptime:l}){let o=a>0?Math.round(e/a*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 ",r," · ",l]})]}),(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:a-e,label:"Offline",sub:a-e==0?"All systems go":`${a-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:a,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:a,color:r,accent:l,border:n}){return(0,s.jsxs)("div",{className:`relative overflow-hidden rounded-xl border ${n} bg-[#111128] px-4 py-3`,children:[(0,s.jsx)("div",{className:`absolute inset-0 bg-gradient-to-br ${l} pointer-events-none`}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:`text-3xl font-bold ${r} 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:a})]})]})}function o(){let[e,t]=(0,a.useState)(""),[r,l]=(0,a.useState)(!1),[n,i]=(0,a.useState)(""),o=async()=>{if(e.trim()){l(!0),i("");try{let s=await fetch("/api/hub/broadcast",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}),a=await s.json();a.ok?(i(`Broadcast sent to ${a.recipients} node(s)`),t("")):i(`Failed: ${a.error||"Send error"}`)}catch(e){i(`Failed: ${e instanceof Error?e.message:"Send error"}`)}l(!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:r||!e.trim(),"aria-label":"Send broadcast",className:"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:r?"Sending...":"Broadcast"})]}),e.length>0&&(0,s.jsxs)("div",{className:"text-right text-xs text-gray-600 mt-1",children:[e.length,"/500"]}),n&&(0,s.jsx)("div",{className:`mt-3 text-sm text-center ${n.startsWith("Failed")?"text-red-400":"text-green-400/80"} animate-fade-in`,children:n})]})}function d(e,t,s){let a=t<=2?Math.PI:1.78*Math.PI,r=-Math.PI/2-a/2,l=t<=1?-Math.PI/2:r+a*e/(t-1);return{x:500+s*Math.cos(l),y:330+s*Math.sin(l)}}function c(e,t,s=0){let a=(e.x+t.x)/2,r=(e.y+t.y)/2,l=t.x-e.x,n=t.y-e.y,i=Math.hypot(l,n)||1,o={x:a+-n/i*s,y:r+l/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}function h({sessions:e,sseSessions:t}){let[r,l]=(0,a.useState)([]);(0,a.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();l(t.messages||[])}catch{}};e();let t=setInterval(e,5e3);return()=>clearInterval(t)},[]);let{onlineNodes:n,offlineNodes:i,nodePositions:o,flowLinks:m,activeAliases:u}=(0,a.useMemo)(()=>{let s,a=e.filter(e=>"offline"!==e.status||t[e.alias]),l=e.filter(e=>"offline"===e.status&&!t[e.alias]),n={};a.forEach((e,t)=>{n[e.alias]=d(t,Math.max(a.length,1),220)}),l.forEach((e,t)=>{n[e.alias]=d(t,Math.max(l.length,1),315)});let i=(s=new Map,r.forEach(e=>{if(!n[e.from_alias]||!n[e.to_alias]||e.from_alias===e.to_alias)return;let t=`${e.from_alias}->${e.to_alias}`,a=s.get(t);s.set(t,{key:t,from:e.from_alias,to:e.to_alias,count:(a?.count||0)+1,content:a?.content||e.content})}),[...s.values()].slice(0,18)),o=new Set;return i.forEach(e=>{o.add(e.from),o.add(e.to)}),{onlineNodes:a,offlineNodes:l,nodePositions:n,flowLinks:i,activeAliases:o}},[r,e,t]),g=n.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:[g," 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:[n.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:[m.length," active links"]})]})]}),(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-lg border border-[#2a2a4a] bg-[#080814] shadow-2xl shadow-cyan-950/30",children:[(0,s.jsx)("div",{className:"absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-cyan-400/70 to-transparent"}),(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:"#0b1220"}),(0,s.jsx)("stop",{offset:"48%",stopColor:"#080814"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#101018"})]}),(0,s.jsxs)("radialGradient",{id:"topo-radar",cx:"50%",cy:"50%",r:"55%",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#22d3ee",stopOpacity:"0.18"}),(0,s.jsx)("stop",{offset:"45%",stopColor:"#22c55e",stopOpacity:"0.045"}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#020617",stopOpacity:"0"})]}),(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:"#67e8f9"})})]}),(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)"}),[90,170,250,330].map(e=>(0,s.jsx)("circle",{cx:500,cy:330,r:e,fill:"none",stroke:"#164e63",strokeWidth:"1",opacity:"0.35"},e)),[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:"#164e63",strokeWidth:"1",opacity:"0.18"},e)),n.map(e=>{let t=o[e.alias];if(!t)return null;let a=c({x:500,y:330},t,0);return(0,s.jsx)("path",{d:a,fill:"none",stroke:u.has(e.alias)?"#22d3ee":"#155e75",strokeWidth:u.has(e.alias)?2:1,strokeDasharray:u.has(e.alias)?"none":"8 10",opacity:u.has(e.alias)?.65:.35},`hub-${e.alias}`)}),m.map((e,t)=>{let a=o[e.from],r=o[e.to];if(!a||!r)return null;let l=c(a,r,t%2==0?36:-36),n=Math.min(2+e.count,7);return(0,s.jsxs)("g",{children:[(0,s.jsx)("path",{d:l,fill:"none",stroke:"#67e8f9",strokeWidth:n,opacity:"0.28",filter:"url(#topo-glow)",markerEnd:"url(#topo-arrow)"}),(0,s.jsx)("path",{id:`flow-path-${t}`,d:l,fill:"none",stroke:"#e0f2fe",strokeWidth:"1",strokeDasharray:"2 12",opacity:"0.75"}),(0,s.jsx)("circle",{r:"4",fill:"#fef08a",filter:"url(#topo-glow)",children:(0,s.jsx)("animateMotion",{dur:`${2.2+t%5*.32}s`,repeatCount:"indefinite",path:l})})]},e.key)}),(0,s.jsxs)("g",{filter:"url(#topo-glow)",children:[(0,s.jsx)("circle",{cx:500,cy:330,r:"56",fill:"#020617",stroke:"#67e8f9",strokeWidth:"2"}),(0,s.jsxs)("circle",{cx:500,cy:330,r:"42",fill:"none",stroke:"#22c55e",strokeWidth:"1.5",opacity:"0.8",children:[(0,s.jsx)("animate",{attributeName:"r",values:"42;52;42",dur:"3s",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"opacity",values:"0.8;0.2;0.8",dur:"3s",repeatCount:"indefinite"})]}),(0,s.jsx)("path",{d:"M470 330 h60 M500 300 v60",stroke:"#e0f2fe",strokeWidth:"5",strokeLinecap:"round",opacity:"0.9"}),(0,s.jsx)("text",{x:500,y:408,textAnchor:"middle",fill:"#e5e7eb",fontSize:"16",fontFamily:"monospace",fontWeight:"700",children:"DASHBOARD"}),(0,s.jsx)("text",{x:500,y:426,textAnchor:"middle",fill:"#64748b",fontSize:"10",fontFamily:"monospace",children:"command relay"})]}),[...n,...i].map(e=>{let a=o[e.alias];if(!a)return null;let r="offline"!==e.status||!!t[e.alias],l=r?"working"===e.status?{label:"working",primary:"#22c55e",halo:"#14532d",text:"#dcfce7"}:"idle"===e.status?{label:"idle",primary:"#2dd4bf",halo:"#134e4a",text:"#ccfbf1"}:{label:e.status||"online",primary:"#38bdf8",halo:"#0c4a6e",text:"#e0f2fe"}:{label:"offline",primary:"#6b7280",halo:"#111827",text:"#9ca3af"},n=u.has(e.alias),i=r?26:18;return(0,s.jsxs)("g",{className:"transition-opacity",children:[n&&(0,s.jsxs)("circle",{cx:a.x,cy:a.y,r:i+14,fill:l.primary,opacity:"0.12",children:[(0,s.jsx)("animate",{attributeName:"r",values:`${i+8};${i+22};${i+8}`,dur:"2.4s",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"opacity",values:"0.18;0.04;0.18",dur:"2.4s",repeatCount:"indefinite"})]}),(0,s.jsx)("circle",{cx:a.x,cy:a.y,r:i+8,fill:l.halo,opacity:r?.55:.25}),(0,s.jsx)("circle",{cx:a.x,cy:a.y,r:i,fill:r?"#020617":"#080814",stroke:l.primary,strokeWidth:r?3:1.5,strokeDasharray:r?"none":"5 5",filter:r?"url(#topo-glow)":void 0}),(0,s.jsx)("circle",{cx:a.x,cy:a.y,r:r?8:5,fill:l.primary}),"working"===e.status&&(0,s.jsx)("path",{d:`M${a.x-9},${a.y+11} h18`,stroke:"#fef08a",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(${a.x}, ${a.y+i+22})`,children:[(0,s.jsx)("rect",{x:"-62",y:"-14",width:"124",height:"42",rx:"6",fill:"#020617",stroke:"#1f2937",opacity:"0.94"}),(0,s.jsx)("text",{x:"0",y:"1",textAnchor:"middle",fill:l.text,fontSize:"12",fontFamily:"monospace",fontWeight:"700",children:x(e.alias,14)}),(0,s.jsxs)("text",{x:"0",y:"17",textAnchor:"middle",fill:l.primary,fontSize:"9",fontFamily:"monospace",children:[l.label," ",r?`sse:${t[e.alias]}`:""]})]})]},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(m.length,4),rx:"8",fill:"#020617",stroke:"#1f2937",opacity:"0.94"}),(0,s.jsx)("text",{x:"16",y:"26",fill:"#e5e7eb",fontSize:"13",fontFamily:"monospace",fontWeight:"700",children:"recent signal"}),(0,s.jsxs)("text",{x:"178",y:"26",fill:"#67e8f9",fontSize:"11",fontFamily:"monospace",children:[r.length," messages"]}),m.slice(0,4).map((e,t)=>(0,s.jsxs)("text",{x:"16",y:54+20*t,fill:"#94a3b8",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:"#020617",stroke:"#1f2937",opacity:"0.94"}),(0,s.jsx)("circle",{cx:"18",cy:"26",r:"6",fill:"#22c55e"}),(0,s.jsx)("text",{x:"34",y:"30",fill:"#94a3b8",fontSize:"11",fontFamily:"monospace",children:"working node"}),(0,s.jsx)("circle",{cx:"18",cy:"52",r:"6",fill:"#2dd4bf"}),(0,s.jsx)("text",{x:"34",y:"56",fill:"#94a3b8",fontSize:"11",fontFamily:"monospace",children:"online idle"}),(0,s.jsx)("circle",{cx:"18",cy:"78",r:"6",fill:"#6b7280"}),(0,s.jsx)("text",{x:"34",y:"82",fill:"#94a3b8",fontSize:"11",fontFamily:"monospace",children:"offline / no SSE"}),(0,s.jsx)("path",{d:"M150,78 Q176,52 210,78",fill:"none",stroke:"#67e8f9",strokeWidth:"3",markerEnd:"url(#topo-arrow)"})]})]})]})]})}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:""}},u={bg:"bg-gray-800/50 border-gray-700/30",text:"text-gray-500",dot:"bg-gray-500",glow:""};function g({session:e,hasSse:t,sseCount:a,onChat:n}){let i=t&&m[e.status]||u;return(0,s.jsxs)(r.default,{href:`/node?alias=${encodeURIComponent(e.alias)}`,prefetch:!1,className:`block rounded-xl border p-4 transition-all duration-300 cursor-pointer ${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)("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${i.dot} ${t&&"working"===e.status?"animate-pulse":""}`}),(0,s.jsx)("span",{className:"font-semibold text-white truncate text-sm",title:e.alias,children:e.alias})]}),(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:",a]})]}),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",{children:e.server||"--"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[n&&t&&(0,s.jsx)("button",{onClick:t=>{t.preventDefault(),t.stopPropagation(),n(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,l.timeAgo)(e.updated_at)})]})]})]})}function f({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 justify-between text-xs text-gray-500 mb-1.5",children:[(0,s.jsx)("span",{className:"text-blue-400 font-medium",children:e.from_session}),(0,s.jsx)("span",{children:e.created_at})]}),(0,s.jsx)("div",{className:"text-gray-300 leading-relaxed",children:e.content})]},e.id))})]})}function p(){return(0,s.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-6 font-mono animate-pulse",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-8",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"h-7 w-48 bg-gray-800 rounded mb-2"}),(0,s.jsx)("div",{className:"h-4 w-64 bg-gray-800/60 rounded"})]}),(0,s.jsx)("div",{className:"flex gap-3",children:[1,2,3].map(e=>(0,s.jsx)("div",{className:"w-[72px] h-[60px] bg-gray-800/40 rounded-lg border border-gray-800"},e))})]}),(0,s.jsxs)("div",{className:"mb-6 flex gap-2",children:[(0,s.jsx)("div",{className:"flex-1 h-10 bg-gray-800/40 rounded-lg"}),(0,s.jsx)("div",{className:"w-28 h-10 bg-gray-800/40 rounded-lg"})]}),(0,s.jsx)("div",{className:"w-full max-w-4xl mx-auto mb-8 h-64 bg-gray-800/20 rounded-xl"}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[1,2,3,4].map(e=>(0,s.jsxs)("div",{className:"rounded-xl border border-gray-800/40 p-4 bg-gray-800/20",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,s.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-gray-700"}),(0,s.jsx)("div",{className:"h-4 w-24 bg-gray-700 rounded"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("div",{className:"h-3 w-full bg-gray-800/60 rounded"}),(0,s.jsx)("div",{className:"h-3 w-3/4 bg-gray-800/60 rounded"}),(0,s.jsx)("div",{className:"h-3 w-1/2 bg-gray-800/60 rounded"})]})]},e))})]})}function b({hint:e}){return(0,s.jsxs)("div",{className:"text-center py-16",children:[(0,s.jsx)("div",{className:"text-gray-600 text-4xl mb-4",children:"--"}),(0,s.jsx)("h3",{className:"text-gray-400 text-lg font-medium mb-2",children:"No agents in this network"}),e?.global_count?(0,s.jsxs)("p",{className:"text-gray-500 text-sm max-w-md mx-auto",children:["Server has ",(0,s.jsx)("span",{className:"text-cyan-400 font-medium",children:e.global_count})," nodes globally, but none are registered to the current network. Switch network or contact admin."]}):(0,s.jsx)("p",{className:"text-gray-600 text-sm max-w-md mx-auto",children:"Agent sessions will appear here once they connect to the CommHub."})]})}var y=e.i(58963);function j(){let{setNetworkId:e}=(0,y.useNetworkId)(),[t,r]=(0,a.useState)({user:null,networks:[],currentNetwork:"",token:""}),[l,n]=(0,a.useState)(!1),[i,o]=(0,a.useState)(""),[d,c]=(0,a.useState)(""),[x,h]=(0,a.useState)(""),[m,u]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=sessionStorage.getItem("anet_v3_auth");if(e)try{r(JSON.parse(e))}catch{}},[]);let[g,f]=(0,a.useState)(!1),[p,b]=(0,a.useState)(""),[j,v]=(0,a.useState)(""),N=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:p,email:j})});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:p,email:j})}),s=await e.json();if(s.ok&&s.user){let e={...t,user:s.user};r(e),sessionStorage.setItem("anet_v3_auth",JSON.stringify(e)),f(!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 a={...t,currentNetwork:s.target.value};r(a),e(s.target.value),sessionStorage.setItem("anet_v3_auth",JSON.stringify(a))},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.jsx)("button",{onClick:()=>{b(t.user?.display_name||""),v(""),f(!g)},className:"text-xs text-gray-500 hover:text-gray-300",children:"Edit"}),(0,s.jsx)("button",{onClick:()=>{r({user:null,networks:[],currentNetwork:"",token:""}),sessionStorage.removeItem("anet_v3_auth")},className:"text-xs text-gray-500 hover:text-gray-300",children:"Sign out"})]}),g&&(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:p,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:j,onChange:e=>v(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:N,className:"px-2 py-1 bg-cyan-600 hover:bg-cyan-500 text-white text-xs rounded",children:"Save"})]})]})}var v=e.i(21373),N=e.i(58442);function w({tabs:e,activeTab:t,onOpenTab:a,onCloseTab:r,onSetActive:l,onClose:n}){return 0===e.length?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{onClick:n,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:()=>l(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(),r(e)},className:"jsx-f7cf3d1a6fdfc074 ml-1 text-gray-600 hover:text-gray-300 p-0.5",children:"×"})]},e))}),(0,s.jsx)("button",{onClick:n,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)(k,{alias:e})},e))})]}),(0,s.jsx)(v.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 k({alias:e}){return(0,s.jsx)(N.TaskChatPanel,{alias:e,onClose:()=>{},inline:!0})}function S({sessions:e,onClose:t}){let[r,l]=(0,a.useState)(new Set),[n,i]=(0,a.useState)(""),[o,d]=(0,a.useState)("normal"),[c,x]=(0,a.useState)(!1),[h,m]=(0,a.useState)([]),[u,g]=(0,a.useState)(""),f=e.filter(e=>"offline"!==e.status).filter(e=>!u||e.alias.toLowerCase().includes(u.toLowerCase())||(e.agent||"").toLowerCase().includes(u.toLowerCase())),p=async()=>{if(!n.trim()||0===r.size||c)return;x(!0),m([]);let e=[...r].map(async e=>{try{let t=await fetch("/api/hub/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({alias:e,task:n,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"}}});m(await Promise.all(e)),x(!1)},b=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",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",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:u,onChange:e=>g(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:()=>{r.size===f.length?l(new Set):l(new Set(f.map(e=>e.alias)))},className:"text-[10px] text-cyan-400 hover:text-cyan-300",children:r.size===f.length?"Deselect all":`Select all (${f.length})`}),(0,s.jsxs)("span",{className:"text-[10px] text-gray-600",children:[r.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:[f.map(e=>(0,s.jsxs)("button",{onClick:()=>{var t;return t=e.alias,void l(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 ${r.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)("div",{className:`w-2 h-2 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===f.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:n,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:p,disabled:c||!n.trim()||0===r.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 ${r.size} agent${r.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:[b,"/",h.length," dispatched successfully"]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:h.map(e=>(0,s.jsxs)("span",{className:`text-[10px] px-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:[e.alias,": ",e.ok?"✓":e.error||"✗"]},e.alias))})]})]})]})]})]})}var C=e.i(65822),$=e.i(51280),_=e.i(71235);e.s(["default",0,function(){(0,a.useEffect)(()=>{sessionStorage.getItem("anet_v3_auth")||(fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),window.location.assign("/login"))},[]);let{sessions:e,hint:i,error:d,isLoading:c}=(0,C.useSessions)(),{health:x}=(0,C.useHealth)(),{config:m}=(0,C.useAnetConfig)(),{tasks:u}=(0,C.useTasks)({limit:"500"}),{stats:y}=(0,C.useStats)(),{license:v}=(0,C.useLicense)(),[N,k]=(0,a.useState)(window.innerWidth>=1024),[M,T]=(0,a.useState)(!1),z=function(){let[e,t]=(0,a.useState)([]),[s,r]=(0,a.useState)("");return{tabs:e,activeTab:s,openTab:e=>{t(t=>t.includes(e)?t:[...t,e]),r(e)},closeTab:e=>{t(t=>{let a=t.filter(t=>t!==e);return s===e&&r(a[a.length-1]||""),a})},closeAll:()=>{t([]),r("")},setActiveTab:r}}(),[L,P]=(0,a.useState)(!1),[W,A]=(0,a.useState)([]),{mutate:E}=(0,_.useSWRConfig)(),O="1"!==t.default.env.NEXT_PUBLIC_DISABLE_SSE,{connected:I,supported:F}=(0,$.useSSE)({url:"/api/hub/events",enabled:O,onEvent:e=>{["new_task","new_message","new_reply","node_status_changed","broadcast"].includes(e.type)&&(E("/api/hub/status"),E(e=>"string"==typeof e&&e.startsWith("/api/hub/tasks"),void 0,{revalidate:!0}))}});if((0,a.useEffect)(()=>{let e=()=>{fetch("/api/hub/inbox").then(e=>e.json()).then(e=>{e.messages?.length&&A(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)},[]),c)return(0,s.jsx)(p,{});let B=x?.sse_sessions||{},D=e=>"offline"!==e.status||!!B[e.alias],R=e.filter(D).length,H=e.length,J=e.filter(e=>"working"===e.status).length,U=x?(0,l.formatUptime)(x.uptime):"--",G=x?.version||"--",K=!!(m?.hub&&m.tokenConfigured),Q=m?.source==="file"?"Local config":m?.source==="runtime-env"?"Runtime env":"Config missing",X={};if(y?.tasks?.by_status?.length)for(let e of y.tasks.by_status)X[e.status]=e.count;else for(let e of u)X[e.status]=(X[e.status]||0)+1;let Y=[...e].sort((e,t)=>{let s=+!!D(e),a=+!!D(t);if(s!==a)return a-s;let r=+("working"===e.status);return("working"===t.status)-r});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)(n,{online:R,working:J,total:H,version:G,uptime:U})}),(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,s.jsx)("button",{onClick:()=>P(!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)(j,{})})]}),(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:()=>T(!M),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 ${K?"bg-green-400":"bg-red-400"}`}),(0,s.jsx)("span",{className:"text-gray-500",children:Q})]}),(0,s.jsx)("svg",{className:`w-4 h-4 text-gray-600 transition-transform ${M?"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"})})]}),M&&(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:m?.hub||void 0,children:["Hub: ",(0,s.jsx)("span",{className:m?.hub?"text-cyan-300":"text-red-300",children:m?.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 ${m?.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: ",m?.tokenPreview||"not configured"]})})]}),m?.error&&(0,s.jsx)("div",{className:"mt-2 text-xs text-gray-600",children:m.error})]})]}),Object.keys(X).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)(r.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})=>X[e]).map(({key:e,color:t})=>(0,s.jsxs)(r.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,": ",X[e]]},e))})]}),(0,s.jsx)("section",{className:"mb-6 grid grid-cols-3 sm:grid-cols-6 gap-2",children:[{href:"/nodes",label:"Nodes",value:`${R}/${H}`,color:"text-green-400 border-green-500/15"},{href:"/tasks",label:"Tasks",value:String(Object.values(X).reduce((e,t)=>e+t,0)||"--"),color:"text-cyan-400 border-cyan-500/15"},{href:"/tasks?status=failed",label:"Failed",value:String(X.failed||0),color:X.failed?"text-red-400 border-red-500/20":"text-gray-600 border-gray-700/30"},{href:"/messages",label:"Messages",value:"→",color:"text-blue-400 border-blue-500/15"},{href:"/logs",label:"Logs",value:"→",color:"text-purple-400 border-purple-500/15"},{href:"/admin",label:"Admin",value:"→",color:"text-gray-400 border-gray-500/15"}].map(e=>(0,s.jsxs)(r.default,{href:e.href,prefetch:!1,className:`text-center rounded-xl border ${e.color} bg-[#111128] px-3 py-2.5 hover:bg-[#161630] transition-colors`,children:[(0,s.jsx)("div",{className:`text-lg font-bold tabular-nums ${e.color.split(" ")[0]}`,children:e.value}),(0,s.jsx)("div",{className:"text-[10px] text-gray-500",children:e.label})]},e.href))}),(0,s.jsx)(o,{}),u.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)(r.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:u.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"}`}),(0,s.jsx)("span",{className:"text-blue-400 shrink-0",children:e.from_name||"?"}),(0,s.jsx)("span",{className:"text-gray-600",children:"→"}),(0,s.jsx)("span",{className:"text-cyan-400 shrink-0",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))})]}),d&&(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(d)}),(0,s.jsx)("span",{className:"text-gray-500 text-xs",children:"Check CommHub connection"})]}),e.length>0&&(0,s.jsx)("div",{className:"flex justify-center mb-4",children:(0,s.jsx)("button",{onClick:()=>k(!N),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:N?"Hide Topology":"Show Topology"})}),!N&&e.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"}),N&&e.length>0&&(0,s.jsx)(h,{sessions:e,sseSessions:B}),0!==e.length||d?(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",children:Y.map(e=>(0,s.jsx)(g,{session:e,hasSse:D(e),sseCount:B[e.alias]||0,onChat:z.openTab},e.alias))}):(0,s.jsx)(b,{hint:i}),(0,s.jsx)(f,{messages:W}),(0,s.jsxs)("div",{className:"mt-8 text-center text-xs text-gray-600 flex items-center justify-center gap-2 flex-wrap",children:[F&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${I?"bg-green-400":"bg-gray-600"}`}),I?"SSE live":"SWR polling"]}),v?.license&&(0,s.jsxs)(s.Fragment,{children:[F&&(0,s.jsx)(s.Fragment,{children:"·"}),(0,s.jsxs)("span",{className:v.license.days_left<=7?"text-red-400":"pro"===v.license.type?"text-green-400":"text-yellow-400",children:[v.license.type," (",v.license.days_left,"d left)"]})]})]}),L&&(0,s.jsx)(S,{sessions:e,onClose:()=>P(!1)}),z.tabs.length>0&&(0,s.jsx)(w,{tabs:z.tabs,activeTab:z.activeTab,onOpenTab:z.openTab,onCloseTab:z.closeTab,onSetActive:z.setActiveTab,onClose:z.closeAll})]})}],31713)}]);
package/.next/trace CHANGED
@@ -1,2 +1,2 @@
1
- [{"name":"generate-buildid","duration":854,"timestamp":1791438783652,"id":4,"parentId":1,"tags":{},"startTime":1777765539230,"traceId":"5593ecad01bf0cb5"},{"name":"load-custom-routes","duration":829,"timestamp":1791438784938,"id":5,"parentId":1,"tags":{},"startTime":1777765539231,"traceId":"5593ecad01bf0cb5"},{"name":"create-dist-dir","duration":1334,"timestamp":1791438785848,"id":6,"parentId":1,"tags":{},"startTime":1777765539232,"traceId":"5593ecad01bf0cb5"},{"name":"clean","duration":163772,"timestamp":1791438789157,"id":7,"parentId":1,"tags":{},"startTime":1777765539236,"traceId":"5593ecad01bf0cb5"},{"name":"discover-routes","duration":198344,"timestamp":1791439274953,"id":8,"parentId":1,"tags":{},"startTime":1777765539721,"traceId":"5593ecad01bf0cb5"},{"name":"create-root-mapping","duration":254,"timestamp":1791439473367,"id":9,"parentId":1,"tags":{},"startTime":1777765539920,"traceId":"5593ecad01bf0cb5"},{"name":"generate-route-types","duration":124592,"timestamp":1791439495952,"id":10,"parentId":1,"tags":{},"startTime":1777765539942,"traceId":"5593ecad01bf0cb5"},{"name":"public-dir-conflict-check","duration":581,"timestamp":1791439621698,"id":11,"parentId":1,"tags":{},"startTime":1777765540068,"traceId":"5593ecad01bf0cb5"},{"name":"generate-routes-manifest","duration":118161,"timestamp":1791439623045,"id":12,"parentId":1,"tags":{},"startTime":1777765540069,"traceId":"5593ecad01bf0cb5"},{"name":"run-turbopack","duration":53458347,"timestamp":1791439794113,"id":14,"parentId":1,"tags":{},"startTime":1777765540240,"traceId":"5593ecad01bf0cb5"},{"name":"turbopack-build-events","duration":157,"timestamp":1791441196344,"id":15,"parentId":1,"tags":{},"startTime":1777765541643,"traceId":"5593ecad01bf0cb5"},{"name":"run-typescript","duration":46677082,"timestamp":1791493309132,"id":16,"parentId":1,"tags":{},"startTime":1777765593755,"traceId":"5593ecad01bf0cb5"},{"name":"generate-required-server-files","duration":11184,"timestamp":1791539995965,"id":18,"parentId":1,"tags":{},"startTime":1777765640442,"traceId":"5593ecad01bf0cb5"},{"name":"check-static-error-page","duration":113720,"timestamp":1791540324508,"id":20,"parentId":19,"tags":{},"startTime":1777765640771,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":2206029,"timestamp":1791540453573,"id":61,"parentId":22,"tags":{},"startTime":1777765640900,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":2316194,"timestamp":1791540343591,"id":22,"parentId":19,"tags":{"page":"/_global-error"},"startTime":1777765640790,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":2782551,"timestamp":1791540469524,"id":63,"parentId":26,"tags":{},"startTime":1777765640916,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":2892207,"timestamp":1791540359956,"id":26,"parentId":19,"tags":{"page":"/api/auth/logout"},"startTime":1777765640806,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":2803522,"timestamp":1791540469201,"id":62,"parentId":25,"tags":{},"startTime":1777765640916,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":2914998,"timestamp":1791540359201,"id":25,"parentId":19,"tags":{"page":"/api/auth/login"},"startTime":1777765640806,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":2883548,"timestamp":1791540469610,"id":64,"parentId":27,"tags":{},"startTime":1777765640916,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":2992948,"timestamp":1791540360377,"id":27,"parentId":19,"tags":{"page":"/api/auth/v3"},"startTime":1777765640807,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":2910632,"timestamp":1791540469918,"id":65,"parentId":28,"tags":{},"startTime":1777765640916,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3019069,"timestamp":1791540361613,"id":28,"parentId":19,"tags":{"page":"/api/hub/audit-log"},"startTime":1777765640808,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":2929828,"timestamp":1791540470135,"id":66,"parentId":29,"tags":{},"startTime":1777765640916,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3035739,"timestamp":1791540364467,"id":29,"parentId":19,"tags":{"page":"/api/hub/auth"},"startTime":1777765640811,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":2959841,"timestamp":1791540470481,"id":68,"parentId":32,"tags":{},"startTime":1777765640917,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3054134,"timestamp":1791540376693,"id":32,"parentId":19,"tags":{"page":"/api/hub/health"},"startTime":1777765640823,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":2981831,"timestamp":1791540452439,"id":60,"parentId":21,"tags":{},"startTime":1777765640899,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3103777,"timestamp":1791540330549,"id":21,"parentId":19,"tags":{"page":"/_not-found"},"startTime":1777765640777,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":2964093,"timestamp":1791540484586,"id":69,"parentId":33,"tags":{},"startTime":1777765640931,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3071371,"timestamp":1791540377497,"id":33,"parentId":19,"tags":{"page":"/api/hub/inbox"},"startTime":1777765640824,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3010287,"timestamp":1791540470290,"id":67,"parentId":30,"tags":{},"startTime":1777765640917,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3115935,"timestamp":1791540370181,"id":30,"parentId":19,"tags":{"page":"/api/hub/broadcast"},"startTime":1777765640817,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":2996549,"timestamp":1791540494449,"id":71,"parentId":35,"tags":{},"startTime":1777765640941,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3112574,"timestamp":1791540378584,"id":35,"parentId":19,"tags":{"page":"/api/hub/messages"},"startTime":1777765640825,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3062943,"timestamp":1791540495996,"id":73,"parentId":37,"tags":{},"startTime":1777765640942,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3177843,"timestamp":1791540381669,"id":37,"parentId":19,"tags":{"page":"/api/hub/nodes"},"startTime":1777765640828,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3087074,"timestamp":1791540495757,"id":72,"parentId":36,"tags":{},"startTime":1777765640942,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3201834,"timestamp":1791540381112,"id":36,"parentId":19,"tags":{"page":"/api/hub/networks"},"startTime":1777765640827,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3119656,"timestamp":1791540496161,"id":75,"parentId":39,"tags":{},"startTime":1777765640943,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3232958,"timestamp":1791540382998,"id":39,"parentId":19,"tags":{"page":"/api/hub/send"},"startTime":1777765640829,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3154083,"timestamp":1791540496172,"id":76,"parentId":40,"tags":{},"startTime":1777765640943,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3267048,"timestamp":1791540383361,"id":40,"parentId":19,"tags":{"page":"/api/hub/session"},"startTime":1777765640830,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3164259,"timestamp":1791540496110,"id":74,"parentId":38,"tags":{},"startTime":1777765640942,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3278121,"timestamp":1791540382402,"id":38,"parentId":19,"tags":{"page":"/api/hub/register"},"startTime":1777765640829,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3183871,"timestamp":1791540496189,"id":77,"parentId":41,"tags":{},"startTime":1777765640943,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3296836,"timestamp":1791540383576,"id":41,"parentId":19,"tags":{"page":"/api/hub/stats"},"startTime":1777765640830,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3188469,"timestamp":1791540496207,"id":78,"parentId":42,"tags":{},"startTime":1777765640943,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3284689,"timestamp":1791540400109,"id":42,"parentId":19,"tags":{"page":"/api/hub/status"},"startTime":1777765640846,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3203306,"timestamp":1791540496539,"id":79,"parentId":43,"tags":{},"startTime":1777765640943,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3304968,"timestamp":1791540402314,"id":43,"parentId":19,"tags":{"page":"/api/hub/task-events"},"startTime":1777765640849,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3212933,"timestamp":1791540496602,"id":80,"parentId":44,"tags":{},"startTime":1777765640943,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3296357,"timestamp":1791540413740,"id":44,"parentId":19,"tags":{"page":"/api/hub/tasks"},"startTime":1777765640860,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3234348,"timestamp":1791540496620,"id":82,"parentId":46,"tags":{},"startTime":1777765640943,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3316048,"timestamp":1791540415507,"id":46,"parentId":19,"tags":{"page":"/api/hub/tokens"},"startTime":1777765640862,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3239094,"timestamp":1791540494344,"id":70,"parentId":34,"tags":{},"startTime":1777765640941,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3355656,"timestamp":1791540377938,"id":34,"parentId":19,"tags":{"page":"/api/hub/license"},"startTime":1777765640824,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3247668,"timestamp":1791540496613,"id":81,"parentId":45,"tags":{},"startTime":1777765640943,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3329810,"timestamp":1791540414642,"id":45,"parentId":19,"tags":{"page":"/api/hub/tmux"},"startTime":1777765640861,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3238346,"timestamp":1791540514298,"id":83,"parentId":48,"tags":{},"startTime":1777765640961,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3333291,"timestamp":1791540419535,"id":48,"parentId":19,"tags":{"page":"/favicon.ico"},"startTime":1777765640866,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3212605,"timestamp":1791540550909,"id":85,"parentId":31,"tags":{},"startTime":1777765640997,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3388320,"timestamp":1791540375272,"id":31,"parentId":19,"tags":{"page":"/api/hub/events"},"startTime":1777765640822,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3222617,"timestamp":1791540545718,"id":84,"parentId":24,"tags":{},"startTime":1777765640992,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3423831,"timestamp":1791540345430,"id":24,"parentId":19,"tags":{"page":"/api/anet/config"},"startTime":1777765640792,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3234755,"timestamp":1791540574526,"id":88,"parentId":50,"tags":{},"startTime":1777765641021,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3383154,"timestamp":1791540426276,"id":50,"parentId":19,"tags":{"page":"/logs"},"startTime":1777765640873,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3262940,"timestamp":1791540574541,"id":89,"parentId":51,"tags":{},"startTime":1777765641021,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3411676,"timestamp":1791540426538,"id":51,"parentId":19,"tags":{"page":"/messages"},"startTime":1777765640873,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3308583,"timestamp":1791540574559,"id":90,"parentId":52,"tags":{},"startTime":1777765641021,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3456370,"timestamp":1791540426934,"id":52,"parentId":19,"tags":{"page":"/node"},"startTime":1777765640873,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3355611,"timestamp":1791540574567,"id":91,"parentId":53,"tags":{},"startTime":1777765641021,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3502938,"timestamp":1791540427338,"id":53,"parentId":19,"tags":{"page":"/nodes"},"startTime":1777765640874,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3384757,"timestamp":1791540574578,"id":92,"parentId":55,"tags":{},"startTime":1777765641021,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3525083,"timestamp":1791540434966,"id":55,"parentId":19,"tags":{"page":"/settings/networks"},"startTime":1777765640881,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3411212,"timestamp":1791540574453,"id":86,"parentId":23,"tags":{},"startTime":1777765641021,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3641259,"timestamp":1791540344625,"id":23,"parentId":19,"tags":{"page":"/admin"},"startTime":1777765640791,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3414286,"timestamp":1791540574593,"id":93,"parentId":57,"tags":{},"startTime":1777765641021,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3554159,"timestamp":1791540436745,"id":57,"parentId":19,"tags":{"page":"/settings/tokens"},"startTime":1777765640883,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3423988,"timestamp":1791540574517,"id":87,"parentId":49,"tags":{},"startTime":1777765641021,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3578822,"timestamp":1791540420442,"id":49,"parentId":19,"tags":{"page":"/login"},"startTime":1777765640867,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3445500,"timestamp":1791540574612,"id":95,"parentId":59,"tags":{},"startTime":1777765641021,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3582414,"timestamp":1791540437805,"id":59,"parentId":19,"tags":{"page":"/tasks"},"startTime":1777765640884,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3435950,"timestamp":1791540603951,"id":96,"parentId":56,"tags":{},"startTime":1777765641050,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3604316,"timestamp":1791540435678,"id":56,"parentId":19,"tags":{"page":"/settings"},"startTime":1777765640882,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3422706,"timestamp":1791540645487,"id":97,"parentId":47,"tags":{},"startTime":1777765641092,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3651511,"timestamp":1791540416765,"id":47,"parentId":19,"tags":{"page":"/docs"},"startTime":1777765640863,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3495711,"timestamp":1791540574601,"id":94,"parentId":58,"tags":{},"startTime":1777765641021,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3633042,"timestamp":1791540437499,"id":58,"parentId":19,"tags":{"page":"/tasks/[id]"},"startTime":1777765640884,"traceId":"5593ecad01bf0cb5"},{"name":"is-page-static","duration":3403434,"timestamp":1791540694116,"id":98,"parentId":54,"tags":{},"startTime":1777765641140,"traceId":"5593ecad01bf0cb5"},{"name":"check-page","duration":3669639,"timestamp":1791540427995,"id":54,"parentId":19,"tags":{"page":"/"},"startTime":1777765640874,"traceId":"5593ecad01bf0cb5"},{"name":"static-check","duration":3778295,"timestamp":1791540319395,"id":19,"parentId":1,"tags":{},"startTime":1777765640766,"traceId":"5593ecad01bf0cb5"},{"name":"write-routes-manifest","duration":1575,"timestamp":1791544135306,"id":100,"parentId":1,"tags":{},"startTime":1777765644582,"traceId":"5593ecad01bf0cb5"},{"name":"load-dotenv","duration":644,"timestamp":1791544189386,"id":103,"parentId":102,"tags":{},"startTime":1777765644636,"traceId":"5593ecad01bf0cb5"},{"name":"run-export-path-map","duration":2968,"timestamp":1791544224625,"id":104,"parentId":102,"tags":{},"startTime":1777765644671,"traceId":"5593ecad01bf0cb5"},{"name":"next-export","duration":3326059,"timestamp":1791544185410,"id":102,"parentId":1,"tags":{},"startTime":1777765644632,"traceId":"5593ecad01bf0cb5"},{"name":"move-exported-app-not-found-","duration":8262,"timestamp":1791547532561,"id":105,"parentId":101,"tags":{},"startTime":1777765647979,"traceId":"5593ecad01bf0cb5"},{"name":"move-exported-app-global-error-","duration":3643,"timestamp":1791547544622,"id":106,"parentId":101,"tags":{},"startTime":1777765647991,"traceId":"5593ecad01bf0cb5"},{"name":"static-generation","duration":3415581,"timestamp":1791544160160,"id":101,"parentId":1,"tags":{},"startTime":1777765644607,"traceId":"5593ecad01bf0cb5"},{"name":"write-routes-manifest","duration":4362,"timestamp":1791547576812,"id":107,"parentId":1,"tags":{},"startTime":1777765648023,"traceId":"5593ecad01bf0cb5"}]
2
- [{"name":"print-tree-view","duration":13471,"timestamp":1791547712224,"id":108,"parentId":1,"tags":{},"startTime":1777765648159,"traceId":"5593ecad01bf0cb5"},{"name":"write-route-bundle-stats","duration":59907,"timestamp":1791547725835,"id":109,"parentId":1,"tags":{},"startTime":1777765648172,"traceId":"5593ecad01bf0cb5"},{"name":"telemetry-flush","duration":246,"timestamp":1791547785936,"id":110,"parentId":1,"tags":{},"startTime":1777765648232,"traceId":"5593ecad01bf0cb5"},{"name":"next-build","duration":109214425,"timestamp":1791438571858,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1777765539018,"traceId":"5593ecad01bf0cb5"}]
1
+ [{"name":"generate-buildid","duration":722,"timestamp":1792920173583,"id":4,"parentId":1,"tags":{},"startTime":1777767020620,"traceId":"29f9aa57b0f36d4d"},{"name":"load-custom-routes","duration":875,"timestamp":1792920174868,"id":5,"parentId":1,"tags":{},"startTime":1777767020621,"traceId":"29f9aa57b0f36d4d"},{"name":"create-dist-dir","duration":11518,"timestamp":1792920175916,"id":6,"parentId":1,"tags":{},"startTime":1777767020623,"traceId":"29f9aa57b0f36d4d"},{"name":"clean","duration":138069,"timestamp":1792920188994,"id":7,"parentId":1,"tags":{},"startTime":1777767020635,"traceId":"29f9aa57b0f36d4d"},{"name":"discover-routes","duration":145534,"timestamp":1792920887552,"id":8,"parentId":1,"tags":{},"startTime":1777767021334,"traceId":"29f9aa57b0f36d4d"},{"name":"create-root-mapping","duration":711,"timestamp":1792921033232,"id":9,"parentId":1,"tags":{},"startTime":1777767021480,"traceId":"29f9aa57b0f36d4d"},{"name":"generate-route-types","duration":112164,"timestamp":1792921048712,"id":10,"parentId":1,"tags":{},"startTime":1777767021495,"traceId":"29f9aa57b0f36d4d"},{"name":"public-dir-conflict-check","duration":949,"timestamp":1792921161316,"id":11,"parentId":1,"tags":{},"startTime":1777767021608,"traceId":"29f9aa57b0f36d4d"},{"name":"generate-routes-manifest","duration":28806,"timestamp":1792921163103,"id":12,"parentId":1,"tags":{},"startTime":1777767021609,"traceId":"29f9aa57b0f36d4d"},{"name":"run-turbopack","duration":52839406,"timestamp":1792921230933,"id":14,"parentId":1,"tags":{},"startTime":1777767021677,"traceId":"29f9aa57b0f36d4d"},{"name":"turbopack-build-events","duration":13443,"timestamp":1792923373931,"id":15,"parentId":1,"tags":{},"startTime":1777767023833,"traceId":"29f9aa57b0f36d4d"},{"name":"run-typescript","duration":47135937,"timestamp":1792974119881,"id":16,"parentId":1,"tags":{},"startTime":1777767074566,"traceId":"29f9aa57b0f36d4d"},{"name":"generate-required-server-files","duration":11161,"timestamp":1793021260737,"id":18,"parentId":1,"tags":{},"startTime":1777767121707,"traceId":"29f9aa57b0f36d4d"},{"name":"check-static-error-page","duration":133066,"timestamp":1793021619361,"id":20,"parentId":19,"tags":{},"startTime":1777767122066,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":2587814,"timestamp":1793021770791,"id":61,"parentId":22,"tags":{},"startTime":1777767122217,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":2710123,"timestamp":1793021648629,"id":22,"parentId":19,"tags":{"page":"/_global-error"},"startTime":1777767122095,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":2816924,"timestamp":1793021772921,"id":62,"parentId":25,"tags":{},"startTime":1777767122219,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":2926147,"timestamp":1793021664255,"id":25,"parentId":19,"tags":{"page":"/api/auth/login"},"startTime":1777767122111,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":2989402,"timestamp":1793021775955,"id":64,"parentId":27,"tags":{},"startTime":1777767122222,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3099899,"timestamp":1793021665665,"id":27,"parentId":19,"tags":{"page":"/api/auth/v3"},"startTime":1777767122112,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3015851,"timestamp":1793021776617,"id":65,"parentId":28,"tags":{},"startTime":1777767122223,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3126193,"timestamp":1793021666604,"id":28,"parentId":19,"tags":{"page":"/api/hub/audit-log"},"startTime":1777767122113,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3056404,"timestamp":1793021776801,"id":66,"parentId":29,"tags":{},"startTime":1777767122223,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3166202,"timestamp":1793021667101,"id":29,"parentId":19,"tags":{"page":"/api/hub/auth"},"startTime":1777767122113,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3081434,"timestamp":1793021777500,"id":67,"parentId":30,"tags":{},"startTime":1777767122224,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3189763,"timestamp":1793021669333,"id":30,"parentId":19,"tags":{"page":"/api/hub/broadcast"},"startTime":1777767122116,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3109532,"timestamp":1793021777608,"id":68,"parentId":32,"tags":{},"startTime":1777767122224,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3216629,"timestamp":1793021670594,"id":32,"parentId":19,"tags":{"page":"/api/hub/health"},"startTime":1777767122117,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3134183,"timestamp":1793021777945,"id":69,"parentId":33,"tags":{},"startTime":1777767122234,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3240983,"timestamp":1793021671211,"id":33,"parentId":19,"tags":{"page":"/api/hub/inbox"},"startTime":1777767122118,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3146850,"timestamp":1793021787694,"id":70,"parentId":34,"tags":{},"startTime":1777767122234,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3258854,"timestamp":1793021675841,"id":34,"parentId":19,"tags":{"page":"/api/hub/license"},"startTime":1777767122122,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3180978,"timestamp":1793021787758,"id":71,"parentId":35,"tags":{},"startTime":1777767122234,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3292277,"timestamp":1793021676526,"id":35,"parentId":19,"tags":{"page":"/api/hub/messages"},"startTime":1777767122123,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3204319,"timestamp":1793021775845,"id":63,"parentId":26,"tags":{},"startTime":1777767122222,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3317665,"timestamp":1793021665130,"id":26,"parentId":19,"tags":{"page":"/api/auth/logout"},"startTime":1777767122111,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3217118,"timestamp":1793021787780,"id":72,"parentId":36,"tags":{},"startTime":1777767122234,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3327148,"timestamp":1793021677876,"id":36,"parentId":19,"tags":{"page":"/api/hub/networks"},"startTime":1777767122124,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3243573,"timestamp":1793021787829,"id":74,"parentId":38,"tags":{},"startTime":1777767122234,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3348661,"timestamp":1793021682821,"id":38,"parentId":19,"tags":{"page":"/api/hub/register"},"startTime":1777767122129,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3273126,"timestamp":1793021787838,"id":75,"parentId":39,"tags":{},"startTime":1777767122234,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3380189,"timestamp":1793021683167,"id":39,"parentId":19,"tags":{"page":"/api/hub/send"},"startTime":1777767122130,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3307251,"timestamp":1793021787851,"id":76,"parentId":40,"tags":{},"startTime":1777767122234,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3411674,"timestamp":1793021683564,"id":40,"parentId":19,"tags":{"page":"/api/hub/session"},"startTime":1777767122130,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3315744,"timestamp":1793021787811,"id":73,"parentId":37,"tags":{},"startTime":1777767122234,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3421203,"timestamp":1793021682575,"id":37,"parentId":19,"tags":{"page":"/api/hub/nodes"},"startTime":1777767122129,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3336539,"timestamp":1793021787870,"id":78,"parentId":42,"tags":{},"startTime":1777767122234,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3440830,"timestamp":1793021683702,"id":42,"parentId":19,"tags":{"page":"/api/hub/status"},"startTime":1777767122130,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3337066,"timestamp":1793021787863,"id":77,"parentId":41,"tags":{},"startTime":1777767122234,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3442087,"timestamp":1793021683642,"id":41,"parentId":19,"tags":{"page":"/api/hub/stats"},"startTime":1777767122130,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3355771,"timestamp":1793021787884,"id":79,"parentId":43,"tags":{},"startTime":1777767122234,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3459958,"timestamp":1793021683764,"id":43,"parentId":19,"tags":{"page":"/api/hub/task-events"},"startTime":1777767122130,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3374258,"timestamp":1793021787897,"id":80,"parentId":44,"tags":{},"startTime":1777767122234,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3481917,"timestamp":1793021683822,"id":44,"parentId":19,"tags":{"page":"/api/hub/tasks"},"startTime":1777767122130,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3386753,"timestamp":1793021787906,"id":81,"parentId":45,"tags":{},"startTime":1777767122234,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3490815,"timestamp":1793021683948,"id":45,"parentId":19,"tags":{"page":"/api/hub/tmux"},"startTime":1777767122130,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3397501,"timestamp":1793021787919,"id":82,"parentId":46,"tags":{},"startTime":1777767122234,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3500360,"timestamp":1793021685179,"id":46,"parentId":19,"tags":{"page":"/api/hub/tokens"},"startTime":1777767122132,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3411045,"timestamp":1793021787940,"id":83,"parentId":48,"tags":{},"startTime":1777767122234,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3508933,"timestamp":1793021690332,"id":48,"parentId":19,"tags":{"page":"/favicon.ico"},"startTime":1777767122137,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3377542,"timestamp":1793021827660,"id":84,"parentId":24,"tags":{},"startTime":1777767122274,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3555503,"timestamp":1793021649826,"id":24,"parentId":19,"tags":{"page":"/api/anet/config"},"startTime":1777767122096,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3381957,"timestamp":1793021841779,"id":85,"parentId":31,"tags":{},"startTime":1777767122288,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3554357,"timestamp":1793021669590,"id":31,"parentId":19,"tags":{"page":"/api/hub/events"},"startTime":1777767122116,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3516360,"timestamp":1793021770258,"id":60,"parentId":21,"tags":{},"startTime":1777767122217,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3642546,"timestamp":1793021644162,"id":21,"parentId":19,"tags":{"page":"/_not-found"},"startTime":1777767122091,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3352726,"timestamp":1793022054792,"id":88,"parentId":50,"tags":{},"startTime":1777767122501,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3701671,"timestamp":1793021717438,"id":50,"parentId":19,"tags":{"page":"/logs"},"startTime":1777767122164,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3395013,"timestamp":1793022054803,"id":89,"parentId":51,"tags":{},"startTime":1777767122501,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3732431,"timestamp":1793021717695,"id":51,"parentId":19,"tags":{"page":"/messages"},"startTime":1777767122164,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3420827,"timestamp":1793022054819,"id":90,"parentId":52,"tags":{},"startTime":1777767122501,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3757489,"timestamp":1793021718278,"id":52,"parentId":19,"tags":{"page":"/node"},"startTime":1777767122165,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3439275,"timestamp":1793022066879,"id":91,"parentId":53,"tags":{},"startTime":1777767122513,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3787193,"timestamp":1793021719148,"id":53,"parentId":19,"tags":{"page":"/nodes"},"startTime":1777767122166,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3487488,"timestamp":1793022066958,"id":92,"parentId":55,"tags":{},"startTime":1777767122513,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3833134,"timestamp":1793021721641,"id":55,"parentId":19,"tags":{"page":"/settings/networks"},"startTime":1777767122168,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3516463,"timestamp":1793022054775,"id":87,"parentId":49,"tags":{},"startTime":1777767122501,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3854572,"timestamp":1793021716801,"id":49,"parentId":19,"tags":{"page":"/login"},"startTime":1777767122163,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3519257,"timestamp":1793022067671,"id":93,"parentId":57,"tags":{},"startTime":1777767122514,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3856534,"timestamp":1793021730559,"id":57,"parentId":19,"tags":{"page":"/settings/tokens"},"startTime":1777767122177,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3547001,"timestamp":1793022067770,"id":94,"parentId":58,"tags":{},"startTime":1777767122514,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3884057,"timestamp":1793021731051,"id":58,"parentId":19,"tags":{"page":"/tasks/[id]"},"startTime":1777767122177,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3550578,"timestamp":1793022067783,"id":95,"parentId":59,"tags":{},"startTime":1777767122514,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3886727,"timestamp":1793021731775,"id":59,"parentId":19,"tags":{"page":"/tasks"},"startTime":1777767122178,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3578184,"timestamp":1793022054718,"id":86,"parentId":23,"tags":{},"startTime":1777767122501,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3983746,"timestamp":1793021649444,"id":23,"parentId":19,"tags":{"page":"/admin"},"startTime":1777767122096,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3581120,"timestamp":1793022067792,"id":96,"parentId":47,"tags":{},"startTime":1777767122514,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3962188,"timestamp":1793021687343,"id":47,"parentId":19,"tags":{"page":"/docs"},"startTime":1777767122134,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3591181,"timestamp":1793022067845,"id":98,"parentId":56,"tags":{},"startTime":1777767122514,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3933700,"timestamp":1793021725394,"id":56,"parentId":19,"tags":{"page":"/settings"},"startTime":1777767122172,"traceId":"29f9aa57b0f36d4d"},{"name":"is-page-static","duration":3592888,"timestamp":1793022067820,"id":97,"parentId":54,"tags":{},"startTime":1777767122514,"traceId":"29f9aa57b0f36d4d"},{"name":"check-page","duration":3940838,"timestamp":1793021719924,"id":54,"parentId":19,"tags":{"page":"/"},"startTime":1777767122166,"traceId":"29f9aa57b0f36d4d"},{"name":"static-check","duration":4043542,"timestamp":1793021617485,"id":19,"parentId":1,"tags":{},"startTime":1777767122064,"traceId":"29f9aa57b0f36d4d"},{"name":"write-routes-manifest","duration":1228,"timestamp":1793025682426,"id":100,"parentId":1,"tags":{},"startTime":1777767126129,"traceId":"29f9aa57b0f36d4d"},{"name":"load-dotenv","duration":145,"timestamp":1793025748322,"id":103,"parentId":102,"tags":{},"startTime":1777767126195,"traceId":"29f9aa57b0f36d4d"},{"name":"run-export-path-map","duration":4961,"timestamp":1793025848073,"id":104,"parentId":102,"tags":{},"startTime":1777767126294,"traceId":"29f9aa57b0f36d4d"},{"name":"next-export","duration":5079335,"timestamp":1793025743363,"id":102,"parentId":1,"tags":{},"startTime":1777767126190,"traceId":"29f9aa57b0f36d4d"},{"name":"move-exported-app-not-found-","duration":2058,"timestamp":1793030833168,"id":105,"parentId":101,"tags":{},"startTime":1777767131280,"traceId":"29f9aa57b0f36d4d"},{"name":"move-exported-app-global-error-","duration":3212,"timestamp":1793030835597,"id":106,"parentId":101,"tags":{},"startTime":1777767131282,"traceId":"29f9aa57b0f36d4d"},{"name":"static-generation","duration":5128859,"timestamp":1793025717830,"id":101,"parentId":1,"tags":{},"startTime":1777767126164,"traceId":"29f9aa57b0f36d4d"},{"name":"write-routes-manifest","duration":5125,"timestamp":1793030847800,"id":107,"parentId":1,"tags":{},"startTime":1777767131294,"traceId":"29f9aa57b0f36d4d"}]
2
+ [{"name":"print-tree-view","duration":13335,"timestamp":1793030959504,"id":108,"parentId":1,"tags":{},"startTime":1777767131406,"traceId":"29f9aa57b0f36d4d"},{"name":"write-route-bundle-stats","duration":86263,"timestamp":1793030972902,"id":109,"parentId":1,"tags":{},"startTime":1777767131419,"traceId":"29f9aa57b0f36d4d"},{"name":"telemetry-flush","duration":78709,"timestamp":1793031059224,"id":110,"parentId":1,"tags":{},"startTime":1777767131506,"traceId":"29f9aa57b0f36d4d"},{"name":"next-build","duration":111180397,"timestamp":1792919957687,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1777767020404,"traceId":"29f9aa57b0f36d4d"}]
package/.next/trace-build CHANGED
@@ -1 +1 @@
1
- [{"name":"run-turbopack","duration":53458347,"timestamp":1791439794113,"id":14,"parentId":1,"tags":{},"startTime":1777765540240,"traceId":"5593ecad01bf0cb5"},{"name":"turbopack-build-events","duration":157,"timestamp":1791441196344,"id":15,"parentId":1,"tags":{},"startTime":1777765541643,"traceId":"5593ecad01bf0cb5"},{"name":"run-typescript","duration":46677082,"timestamp":1791493309132,"id":16,"parentId":1,"tags":{},"startTime":1777765593755,"traceId":"5593ecad01bf0cb5"},{"name":"static-check","duration":3778295,"timestamp":1791540319395,"id":19,"parentId":1,"tags":{},"startTime":1777765640766,"traceId":"5593ecad01bf0cb5"},{"name":"static-generation","duration":3415581,"timestamp":1791544160160,"id":101,"parentId":1,"tags":{},"startTime":1777765644607,"traceId":"5593ecad01bf0cb5"},{"name":"telemetry-flush","duration":246,"timestamp":1791547785936,"id":110,"parentId":1,"tags":{},"startTime":1777765648232,"traceId":"5593ecad01bf0cb5"},{"name":"next-build","duration":109214425,"timestamp":1791438571858,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1777765539018,"traceId":"5593ecad01bf0cb5"}]
1
+ [{"name":"run-turbopack","duration":52839406,"timestamp":1792921230933,"id":14,"parentId":1,"tags":{},"startTime":1777767021677,"traceId":"29f9aa57b0f36d4d"},{"name":"turbopack-build-events","duration":13443,"timestamp":1792923373931,"id":15,"parentId":1,"tags":{},"startTime":1777767023833,"traceId":"29f9aa57b0f36d4d"},{"name":"run-typescript","duration":47135937,"timestamp":1792974119881,"id":16,"parentId":1,"tags":{},"startTime":1777767074566,"traceId":"29f9aa57b0f36d4d"},{"name":"static-check","duration":4043542,"timestamp":1793021617485,"id":19,"parentId":1,"tags":{},"startTime":1777767122064,"traceId":"29f9aa57b0f36d4d"},{"name":"static-generation","duration":5128859,"timestamp":1793025717830,"id":101,"parentId":1,"tags":{},"startTime":1777767126164,"traceId":"29f9aa57b0f36d4d"},{"name":"telemetry-flush","duration":78709,"timestamp":1793031059224,"id":110,"parentId":1,"tags":{},"startTime":1777767131506,"traceId":"29f9aa57b0f36d4d"},{"name":"next-build","duration":111180397,"timestamp":1792919957687,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1777767020404,"traceId":"29f9aa57b0f36d4d"}]
@@ -4,23 +4,44 @@ const HUB_URL = process.env.COMMHUB_URL || 'http://47.77.216.1:9200';
4
4
  const AUTH_TOKEN = process.env.COMMHUB_AUTH_TOKEN || '';
5
5
 
6
6
  /**
7
- * SSE proxy: forwards CommHub /events/Dashboard to the browser.
8
- * This lets the Dashboard receive real-time events without exposing CommHub URL.
7
+ * SSE proxy: forwards CommHub /events/<alias> to the browser.
8
+ * Default alias is the current user's username (so the user receives all
9
+ * task replies routed back to them as from_session). Pass ?alias=other to
10
+ * subscribe to a different channel (e.g. for monitoring a specific agent).
11
+ *
12
+ * Earlier this was hard-coded to /events/Dashboard but server-side replies
13
+ * push to from_session (the original sender's alias), not "Dashboard", so
14
+ * the chat panel never got real-time updates and had to rely on polling.
9
15
  */
10
- export async function GET() {
16
+ export async function GET(req: Request) {
11
17
  const authFailure = await requireDashboardAuth();
12
18
  if (authFailure) return authFailure;
13
19
 
14
- // Prefer the logged-in user's utok_ (V3) over the legacy global token.
15
- // Without this, Dashboards started without COMMHUB_AUTH_TOKEN env get 502
16
- // because the hub rejects the unauthenticated SSE upstream.
17
20
  const userToken = await getV3UserToken();
18
21
  const bearer = userToken || AUTH_TOKEN;
19
22
  const headers: Record<string, string> = {};
20
23
  if (bearer) headers['Authorization'] = `Bearer ${bearer}`;
21
24
 
25
+ // Resolve the SSE channel name: explicit ?alias= wins; otherwise look up
26
+ // the user's username from /api/auth/me so we subscribe to the channel
27
+ // the server pushes replies to.
28
+ let channel = new URL(req.url).searchParams.get('alias') || '';
29
+ if (!channel) {
30
+ try {
31
+ const meRes = await fetch(`${HUB_URL}/api/auth/me`, { headers });
32
+ if (meRes.ok) {
33
+ const me = await meRes.json();
34
+ channel = me?.user?.username || 'Dashboard';
35
+ } else {
36
+ channel = 'Dashboard';
37
+ }
38
+ } catch {
39
+ channel = 'Dashboard';
40
+ }
41
+ }
42
+
22
43
  try {
23
- const upstream = await fetch(`${HUB_URL}/events/Dashboard`, {
44
+ const upstream = await fetch(`${HUB_URL}/events/${encodeURIComponent(channel)}`, {
24
45
  headers,
25
46
  // @ts-expect-error - Next.js fetch doesn't type duplex
26
47
  duplex: 'half',
@@ -58,6 +58,7 @@ function StatusBar({ status }: { status: string }) {
58
58
  // code blocks + bold; tables / headings showed as raw `|---|` text.
59
59
  import ReactMarkdown from 'react-markdown';
60
60
  import remarkGfm from 'remark-gfm';
61
+ import { useSSE } from '../lib/useSSE';
61
62
 
62
63
  function MarkdownContent({ text }: { text: string }) {
63
64
  if (!text) return <span className="text-gray-600 italic">No content</span>;
@@ -171,31 +172,44 @@ export function TaskChatPanel({ alias, onClose, inline, availableNodes }: TaskCh
171
172
  messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });
172
173
  }, [messages]);
173
174
 
174
- // Poll pending tasks for status updates.
175
- // Earlier 120s hard timeout was too short long tool-calling tasks (Claude
176
- // running many Bash steps) easily exceed 2 minutes; the polling stopped
177
- // before the reply arrived and the chat bubble looked stuck "running"
178
- // forever. New scheme: poll every 2s for the first minute, then every 5s
179
- // until the task lands in a terminal state. Cap at 1 hour (matches the
180
- // server-side task TTL).
175
+ // SSE-driven task updates: the server pushes new_reply events to the
176
+ // sender's alias channel (/events/<from_session>), so we just listen for
177
+ // them and patch the matching bubble immediately. No polling needed for
178
+ // the normal path. The polling block below remains as a safety-net for
179
+ // SSE-unavailable environments / disconnect windows.
180
+ useSSE({
181
+ url: '/api/hub/events',
182
+ enabled: pollingIds.size > 0,
183
+ onEvent: async (e: { type?: string; in_reply_to?: string; message_id?: string }) => {
184
+ if (e?.type !== 'new_reply' || !e.in_reply_to) return;
185
+ // Refetch the task to get the full reply text + final status.
186
+ try {
187
+ const res = await fetch(`/api/hub/tasks?task_id=${encodeURIComponent(e.in_reply_to)}`);
188
+ const data = await res.json();
189
+ const updated = data?.tasks?.[0];
190
+ if (!updated) return;
191
+ setMessages(prev => prev.map(m => m.task_id === e.in_reply_to ? { ...m, ...updated } : m));
192
+ if (['replied', 'failed', 'closed', 'expired', 'cancelled'].includes(updated.status)) {
193
+ setPollingIds(prev => { const n = new Set(prev); n.delete(e.in_reply_to!); return n; });
194
+ }
195
+ } catch {}
196
+ },
197
+ });
198
+
199
+ // Polling fallback (SSE-unavailable / proxies stripping events).
200
+ // Slow cadence so we're not the bulk of server load — SSE handles the fast path.
181
201
  useEffect(() => {
182
202
  if (pollingIds.size === 0) return;
203
+ // 30s cadence — the SSE listener handles the fast path. Polling only
204
+ // catches state when the SSE connection is unavailable (proxy stripping
205
+ // events, browser HTTP/2 oddities, etc). Cap 1h to match server TTL.
183
206
  const startTime = Date.now();
184
- let intervalMs = 2000;
185
- let interval: ReturnType<typeof setInterval>;
186
- const tick = async () => {
207
+ const interval = setInterval(async () => {
187
208
  if (Date.now() - startTime > 3600_000) {
188
209
  setPollingIds(new Set());
189
210
  clearInterval(interval);
190
211
  return;
191
212
  }
192
- // After the first minute, slow polling to 5s — most "stuck" tasks are
193
- // long-running tool chains, no need to poll aggressively forever.
194
- if (intervalMs === 2000 && Date.now() - startTime > 60_000) {
195
- clearInterval(interval);
196
- intervalMs = 5000;
197
- interval = setInterval(tick, intervalMs);
198
- }
199
213
  for (const taskId of pollingIds) {
200
214
  try {
201
215
  const res = await fetch(`/api/hub/tasks?task_id=${encodeURIComponent(taskId)}`);
@@ -209,8 +223,7 @@ export function TaskChatPanel({ alias, onClose, inline, availableNodes }: TaskCh
209
223
  }
210
224
  } catch {}
211
225
  }
212
- };
213
- interval = setInterval(tick, intervalMs);
226
+ }, 30_000);
214
227
  return () => clearInterval(interval);
215
228
  }, [pollingIds]);
216
229
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network-dashboard",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "Agent Network Dashboard — Web UI for managing AI Agent networks",
5
5
  "scripts": {
6
6
  "dev": "next dev",