@sleep2agi/agent-network-dashboard 0.4.3-preview.0 → 0.4.3-preview.1

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/diagnostics/route-bundle-stats.json +2 -2
  4. package/.next/fallback-build-manifest.json +3 -3
  5. package/.next/prerender-manifest.json +3 -3
  6. package/.next/server/app/_global-error.html +1 -1
  7. package/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/server/app/_not-found.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/index.html +2 -2
  30. package/.next/server/app/index.rsc +2 -2
  31. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  32. package/.next/server/app/index.segments/_full.segment.rsc +2 -2
  33. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  34. package/.next/server/app/index.segments/_index.segment.rsc +1 -1
  35. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  36. package/.next/server/app/login.html +1 -1
  37. package/.next/server/app/login.rsc +1 -1
  38. package/.next/server/app/login.segments/_full.segment.rsc +1 -1
  39. package/.next/server/app/login.segments/_head.segment.rsc +1 -1
  40. package/.next/server/app/login.segments/_index.segment.rsc +1 -1
  41. package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  42. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
  43. package/.next/server/app/login.segments/login.segment.rsc +1 -1
  44. package/.next/server/app/logs.html +1 -1
  45. package/.next/server/app/logs.rsc +1 -1
  46. package/.next/server/app/logs.segments/_full.segment.rsc +1 -1
  47. package/.next/server/app/logs.segments/_head.segment.rsc +1 -1
  48. package/.next/server/app/logs.segments/_index.segment.rsc +1 -1
  49. package/.next/server/app/logs.segments/_tree.segment.rsc +1 -1
  50. package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +1 -1
  51. package/.next/server/app/logs.segments/logs.segment.rsc +1 -1
  52. package/.next/server/app/messages.html +1 -1
  53. package/.next/server/app/messages.rsc +1 -1
  54. package/.next/server/app/messages.segments/_full.segment.rsc +1 -1
  55. package/.next/server/app/messages.segments/_head.segment.rsc +1 -1
  56. package/.next/server/app/messages.segments/_index.segment.rsc +1 -1
  57. package/.next/server/app/messages.segments/_tree.segment.rsc +1 -1
  58. package/.next/server/app/messages.segments/messages/__PAGE__.segment.rsc +1 -1
  59. package/.next/server/app/messages.segments/messages.segment.rsc +1 -1
  60. package/.next/server/app/node.html +1 -1
  61. package/.next/server/app/node.rsc +1 -1
  62. package/.next/server/app/node.segments/_full.segment.rsc +1 -1
  63. package/.next/server/app/node.segments/_head.segment.rsc +1 -1
  64. package/.next/server/app/node.segments/_index.segment.rsc +1 -1
  65. package/.next/server/app/node.segments/_tree.segment.rsc +1 -1
  66. package/.next/server/app/node.segments/node/__PAGE__.segment.rsc +1 -1
  67. package/.next/server/app/node.segments/node.segment.rsc +1 -1
  68. package/.next/server/app/nodes.html +1 -1
  69. package/.next/server/app/nodes.rsc +1 -1
  70. package/.next/server/app/nodes.segments/_full.segment.rsc +1 -1
  71. package/.next/server/app/nodes.segments/_head.segment.rsc +1 -1
  72. package/.next/server/app/nodes.segments/_index.segment.rsc +1 -1
  73. package/.next/server/app/nodes.segments/_tree.segment.rsc +1 -1
  74. package/.next/server/app/nodes.segments/nodes/__PAGE__.segment.rsc +1 -1
  75. package/.next/server/app/nodes.segments/nodes.segment.rsc +1 -1
  76. package/.next/server/app/page_client-reference-manifest.js +1 -1
  77. package/.next/server/app/server-logs.html +1 -1
  78. package/.next/server/app/server-logs.rsc +1 -1
  79. package/.next/server/app/server-logs.segments/_full.segment.rsc +1 -1
  80. package/.next/server/app/server-logs.segments/_head.segment.rsc +1 -1
  81. package/.next/server/app/server-logs.segments/_index.segment.rsc +1 -1
  82. package/.next/server/app/server-logs.segments/_tree.segment.rsc +1 -1
  83. package/.next/server/app/server-logs.segments/server-logs/__PAGE__.segment.rsc +1 -1
  84. package/.next/server/app/server-logs.segments/server-logs.segment.rsc +1 -1
  85. package/.next/server/app/settings/networks.html +1 -1
  86. package/.next/server/app/settings/networks.rsc +1 -1
  87. package/.next/server/app/settings/networks.segments/_full.segment.rsc +1 -1
  88. package/.next/server/app/settings/networks.segments/_head.segment.rsc +1 -1
  89. package/.next/server/app/settings/networks.segments/_index.segment.rsc +1 -1
  90. package/.next/server/app/settings/networks.segments/_tree.segment.rsc +1 -1
  91. package/.next/server/app/settings/networks.segments/settings/networks/__PAGE__.segment.rsc +1 -1
  92. package/.next/server/app/settings/networks.segments/settings/networks.segment.rsc +1 -1
  93. package/.next/server/app/settings/networks.segments/settings.segment.rsc +1 -1
  94. package/.next/server/app/settings/tokens.html +1 -1
  95. package/.next/server/app/settings/tokens.rsc +1 -1
  96. package/.next/server/app/settings/tokens.segments/_full.segment.rsc +1 -1
  97. package/.next/server/app/settings/tokens.segments/_head.segment.rsc +1 -1
  98. package/.next/server/app/settings/tokens.segments/_index.segment.rsc +1 -1
  99. package/.next/server/app/settings/tokens.segments/_tree.segment.rsc +1 -1
  100. package/.next/server/app/settings/tokens.segments/settings/tokens/__PAGE__.segment.rsc +1 -1
  101. package/.next/server/app/settings/tokens.segments/settings/tokens.segment.rsc +1 -1
  102. package/.next/server/app/settings/tokens.segments/settings.segment.rsc +1 -1
  103. package/.next/server/app/settings.html +1 -1
  104. package/.next/server/app/settings.rsc +1 -1
  105. package/.next/server/app/settings.segments/_full.segment.rsc +1 -1
  106. package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  107. package/.next/server/app/settings.segments/_index.segment.rsc +1 -1
  108. package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  109. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
  110. package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  111. package/.next/server/app/tasks.html +1 -1
  112. package/.next/server/app/tasks.rsc +1 -1
  113. package/.next/server/app/tasks.segments/_full.segment.rsc +1 -1
  114. package/.next/server/app/tasks.segments/_head.segment.rsc +1 -1
  115. package/.next/server/app/tasks.segments/_index.segment.rsc +1 -1
  116. package/.next/server/app/tasks.segments/_tree.segment.rsc +1 -1
  117. package/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +1 -1
  118. package/.next/server/app/tasks.segments/tasks.segment.rsc +1 -1
  119. package/.next/server/chunks/ssr/app_page_tsx_0es_sk2._.js +1 -1
  120. package/.next/server/chunks/ssr/app_page_tsx_0es_sk2._.js.map +1 -1
  121. package/.next/server/middleware-build-manifest.js +3 -3
  122. package/.next/server/pages/404.html +1 -1
  123. package/.next/server/pages/500.html +1 -1
  124. package/.next/server/server-reference-manifest.js +1 -1
  125. package/.next/server/server-reference-manifest.json +1 -1
  126. package/.next/static/chunks/0ttvcv6~g0f6i.js +1 -0
  127. package/.next/trace +2 -2
  128. package/.next/trace-build +1 -1
  129. package/app/components/TopoGraph.tsx +20 -13
  130. package/package.json +3 -2
  131. package/.next/static/chunks/15zvpw79~w1am.js +0 -1
  132. package/.vercel/README.txt +0 -11
  133. package/.vercel/project.json +0 -16
  134. package/docs/light-theme-audit-v0.4.2.md +0 -229
  135. package/sleep2agi-agent-network-dashboard-0.1.0-preview.2.tgz +0 -0
  136. package/test-results/.last-run.json +0 -4
  137. package/tsconfig.tsbuildinfo +0 -1
  138. /package/.next/static/{PjaeJDylF_V_Owoar118p → 7dwKlhAm5uyghPmkAubQK}/_buildManifest.js +0 -0
  139. /package/.next/static/{PjaeJDylF_V_Owoar118p → 7dwKlhAm5uyghPmkAubQK}/_clientMiddlewareManifest.js +0 -0
  140. /package/.next/static/{PjaeJDylF_V_Owoar118p → 7dwKlhAm5uyghPmkAubQK}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
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=>(e.network_id?t[`${e.network_id}:${e.alias}`]:void 0)??t[e.alias],l=e.filter(e=>"offline"!==e.status||a(e)),n=e.filter(e=>"offline"===e.status&&!a(e)),i={};l.forEach((e,t)=>{i[e.alias]=d(t,Math.max(l.length,1),220)}),n.forEach((e,t)=>{i[e.alias]=d(t,Math.max(n.length,1),315)});let o=(s=new Map,r.forEach(e=>{if(!i[e.from_alias]||!i[e.to_alias]||e.from_alias===e.to_alias)return;let t=`${e.from_alias}->${e.to_alias}`,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)),c=new Set;return o.forEach(e=>{c.add(e.from),c.add(e.to)}),{onlineNodes:l,offlineNodes:n,nodePositions:i,flowLinks:o,activeAliases:c}},[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=(e.network_id?t[`${e.network_id}:${e.alias}`]:void 0)??t[e.alias],l="offline"!==e.status||!!r,n=l?"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"},i=u.has(e.alias),d=l?26:18;return(0,s.jsxs)("g",{className:"transition-opacity",children:[i&&(0,s.jsxs)("circle",{cx:a.x,cy:a.y,r:d+14,fill:n.primary,opacity:"0.12",children:[(0,s.jsx)("animate",{attributeName:"r",values:`${d+8};${d+22};${d+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:d+8,fill:n.halo,opacity:l?.55:.25}),(0,s.jsx)("circle",{cx:a.x,cy:a.y,r:d,fill:l?"#020617":"#080814",stroke:n.primary,strokeWidth:l?3:1.5,strokeDasharray:l?"none":"5 5",filter:l?"url(#topo-glow)":void 0}),(0,s.jsx)("circle",{cx:a.x,cy:a.y,r:l?8:5,fill:n.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+d+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:n.text,fontSize:"12",fontFamily:"monospace",fontWeight:"700",children:x(e.alias,14)}),(0,s.jsxs)("text",{x:"0",y:"17",textAnchor:"middle",fill:n.primary,fontSize:"9",fontFamily:"monospace",children:[n.label,l&&null!=r?` sse:${r}`:""]})]})]},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)(""),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: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 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:()=>{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: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,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)(),[w,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=>(e.network_id?B[`${e.network_id}:${e.alias}`]:void 0)??B[e.alias],R=e=>"offline"!==e.status||!!D(e),H=e.filter(R).length,J=e.length,U=e.filter(e=>"working"===e.status).length,G=x?(0,l.formatUptime)(x.uptime):"--",K=x?.version||"--",Q=!!(m?.hub&&m.tokenConfigured),X=m?.source==="file"?"Local config":m?.source==="runtime-env"?"Runtime env":"Config missing",Y={};if(y?.tasks?.by_status?.length)for(let e of y.tasks.by_status)Y[e.status]=e.count;else for(let e of u)Y[e.status]=(Y[e.status]||0)+1;let V=[...e].sort((e,t)=>{let s=+!!R(e),a=+!!R(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:H,working:U,total:J,version:K,uptime:G})}),(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 ${Q?"bg-green-400":"bg-red-400"}`}),(0,s.jsx)("span",{className:"text-gray-500",children:X})]}),(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(Y).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})=>Y[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,": ",Y[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:`${H}/${J}`,color:"text-green-400 border-green-500/15"},{href:"/tasks",label:"Tasks",value:String(Object.values(Y).reduce((e,t)=>e+t,0)||"--"),color:"text-cyan-400 border-cyan-500/15"},{href:"/tasks?status=failed",label:"Failed",value:String(Y.failed||0),color:Y.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(!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)(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:V.map(e=>(0,s.jsx)(g,{session:e,hasSse:R(e),sseCount:D(e)||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)(N,{tabs:z.tabs,activeTab:z.activeTab,onOpenTab:z.openTab,onCloseTab:z.closeTab,onSetActive:z.setActiveTab,onClose:z.closeAll})]})}],31713)}]);
@@ -1,11 +0,0 @@
1
- > Why do I have a folder named ".vercel" in my project?
2
- The ".vercel" folder is created when you link a directory to a Vercel project.
3
-
4
- > What does the "project.json" file contain?
5
- The "project.json" file contains:
6
- - The ID of the Vercel project that you linked ("projectId")
7
- - The ID of the user or team your Vercel project is owned by ("orgId")
8
-
9
- > Should I commit the ".vercel" folder?
10
- No, you should not share the ".vercel" folder with anyone.
11
- Upon creation, it will be automatically added to your ".gitignore" file.
@@ -1,16 +0,0 @@
1
- {
2
- "projectId": "prj_vUeOShb7wyrgWZ51Ed5MlylOVQ8y",
3
- "orgId": "team_3SDh1gZJ7SR2jSWEAsB6oXDq",
4
- "projectName": "agent-network-dashboard",
5
- "settings": {
6
- "createdAt": 1775702062990,
7
- "framework": "nextjs",
8
- "devCommand": null,
9
- "installCommand": null,
10
- "buildCommand": null,
11
- "outputDirectory": null,
12
- "rootDirectory": null,
13
- "directoryListing": false,
14
- "nodeVersion": "24.x"
15
- }
16
- }
@@ -1,229 +0,0 @@
1
- # Light Theme Audit & Polish Proposal · v0.4.2 → v0.4.3-preview.0
2
-
3
- **Author**: N站马 (Dashboard owner)
4
- **Reviewers**: 通信龙 (gate), Vincent (final)
5
- **Status**: 🟡 design-review — DO NOT implement until 通信龙 OKs direction
6
-
7
- ## TL;DR
8
-
9
- Light theme is **functionally correct** (Issue #4 fix shipped in 0.3.4 made all themed surfaces light), but the visual story is unfinished. The 0.4.x line plugged bug-leaks; 0.4.3 should make light feel **deliberate**, not "Cyber-minus-the-dark".
10
-
11
- I propose direction = **cool-professional, breathable** (Stripe Dashboard / Vercel / Linear). Three high-impact moves:
12
-
13
- 1. Sidebar gets **white** (`bg-secondary`) — currently same color as page bg, so it doesn't visually separate.
14
- 2. Active-nav state simplifies from **4 emerald cues** to **1**: thin left border + slight bg tint, NO emerald text.
15
- 3. Empty / disabled / error states stop showing **raw `[{"error":...}]`** and double-dash `--` — replace with iconified empathy states.
16
-
17
- The big optional swing is a Command Mesh **light SVG variant** (currently a dark radar canvas inside an otherwise light page). High polish, ~150 lines SVG rewrite. Recommend: do it, gated on 通信龙's call.
18
-
19
- If those land, the rest is per-component cleanup (~10 small commits). Target release: `@sleep2agi/agent-network-dashboard@0.4.3-preview.0`, preview tag only.
20
-
21
- ---
22
-
23
- ## 1. Audit method
24
-
25
- - Local `next dev` on port 3030
26
- - Playwright (chromium headless 1440×1100, fullPage)
27
- - 11 pages screenshotted: login, overview, nodes, tasks, messages, networks, logs, server-logs, admin, settings, settings/tokens
28
- - For each page also collected: dark-residual elements (computed bg with R<80, RGB sum <220) and low-contrast text pairs (luminance delta < 120)
29
- - Empty-state coverage (no real agents in local network) — known limitation; need to re-audit with seeded data once we have a staging hub
30
-
31
- Screenshots and `findings.json` archived at `/tmp/audit-light/` (12 files).
32
-
33
- ---
34
-
35
- ## 2. Direction call — needs 通信龙 sign-off
36
-
37
- ### Proposal: **cool-professional, breathable**
38
-
39
- | dimension | direction |
40
- |---|---|
41
- | feel | crisp, technical, ops-oriented — like Stripe Dashboard / Vercel / Linear |
42
- | temperature | cool (zinc + emerald), NOT warm (amber/orange/peach) |
43
- | density | breathable — same info density as Cyber but card padding +1 step, vertical gaps +30% |
44
- | accent usage | minimal — emerald only on (1) CTA buttons, (2) current-page nav, (3) key status numbers |
45
- | typography | keep `font-mono` for code/IDs/timestamps; consider sans-serif for body labels (deferred — separate decision) |
46
- | elevation | real soft shadows (2 levels: rest + hover), NOT border-only |
47
- | illustration | none — no icons-with-faces, no doodles, no curved arrows |
48
-
49
- ### Why not "warm/friendly"
50
-
51
- This is an **ops tool** for managing AI agent armies (Vincent's framing). Warm undermines the "monitoring console" feel. Cyber dark and Light cool are the same designer-brain — two surfaces of one product.
52
-
53
- ### Why not "minimalist/flat"
54
-
55
- Minimal would mean stripping the gradient accents and shadows; we'd lose the data-density signaling that makes the Cyber theme legible. Keep the structure, polish the surfaces.
56
-
57
- ### Alternatives if 通信龙 wants different
58
-
59
- - **warm/friendly**: switch emerald → coral or amber, add soft illustrations, larger padding, friendlier copy
60
- - **brutalist**: kill all gradients, kill all rounded corners >6px, monochrome with one hot accent
61
- - **glass-morphism**: backdrop-blur on cards, layered translucent panels — feels modern but heavy on perf and visually busy
62
-
63
- Pick one before I touch code.
64
-
65
- ---
66
-
67
- ## 3. Per-page findings
68
-
69
- ### 3.1 Sidebar (global — affects every page)
70
-
71
- **Issues:**
72
- - **P0** Sidebar bg currently = `var(--bg)` (#f6f7f9) = page bg → sidebar reads as part of the page, only the thin right border separates it. Cards on the right (white) look "in front of" the page; sidebar looks like negative space.
73
- - **P1** Header "Agent Network / Dashboard" is plain text with no logo/mark. No visual anchor.
74
- - **P0** Active nav state stacks 4 emerald cues: `bg-cyan-500/10` + `border border-cyan-500/20` + `text-cyan-300 (→ var(--accent))`. Muddy.
75
- - **P2** Network list inside sidebar (collapsed by default in screenshots, but exists) — when present, role icons (⭐/🔧/👤/👁) feel out of register with otherwise sober typography.
76
- - **P2** Bottom theme switcher button + collapse arrow are tight together — easy to misclick on mobile.
77
-
78
- **Proposed fixes:**
79
-
80
- ```diff
81
- - bg-[#0d0d1a] // resolves to var(--bg) in light
82
- + bg-[var(--bg-secondary)] // white, sits as its own surface
83
-
84
- - /* active nav: bg-cyan-500/10 + border + text-cyan */
85
- + /* active nav: 4px left border emerald + text-fg, NO bg tint */
86
- ```
87
-
88
- ### 3.2 Login
89
-
90
- **Issues:**
91
- - **P2** Logo area: 64×64 emerald rounded square is OK; could carry product mark (svg from `/favicon.svg`?) instead of being a flat square. Low priority.
92
- - **P3** Big empty space above logo (~250px) — could center tighter on small screens.
93
- - ✅ Sign in button (solid emerald) and field focus rings work in light.
94
-
95
- ### 3.3 Overview
96
-
97
- **Issues:**
98
- - **P0** KPI cards (Online/Working/Offline/Total) — the radial gradient tint (`from-green-500/20 to-green-500/0`) on white reads as a pale wash; **add a 2px colored top-strip** instead of/in addition to the wash. Clearer color coding without the muddy gradient.
99
- - **P1** "fake / Edit / Sign out" user bar — Edit + Sign out links are right-aligned text-only; very low affordance for "click here to do action". Convert to ghost buttons.
100
- - **P1** Config bar is a one-line collapsible section taking full row width. Visually thin; should either merge into a header strip or get more presence.
101
- - **P0** Quick Actions row mixes data ("0/0", "0", "—") and placeholders ("→"). The arrows feel like "go to" affordances but the same row also acts as a stat dashboard. Two competing intents. Pick: either it's a stat strip or it's a nav strip, not both.
102
- - **P1** Empty state "— / No agents in this network" — the "—" double-dash is visually loud (24pt+) for what is essentially an "empty" message. Use an icon, smaller text.
103
- - **P1** "Hide Topology" toggle is a tiny outlined button mid-page. Should be a small icon-toggle in the topology section header.
104
-
105
- ### 3.4 Nodes
106
-
107
- **Issues:**
108
- - **P2** Header "Nodes 0 online 0 total" — chip alignment OK, but "0 online" emerald chip vs "0 total" grey chip have different vertical alignment with the H1 (looks off-by-a-pixel).
109
- - **P2** Search nodes input + "All" dropdown — `<select>` element is **native browser styled**, doesn't match our themed inputs (you can see it visually clashes — a chunky arrow, default font weight). Need to replace with custom dropdown OR style the native select.
110
- - **P3** List/Grid toggle top-right — fine.
111
-
112
- ### 3.5 Tasks
113
-
114
- **Issues:**
115
- - **P1** Tab strip has 10 tabs (All + 9 statuses). On 1440px desktop it fits; on narrower viewports it wraps. **Pills should color-code by status** to match the chip system used elsewhere (running=green, failed=red, etc.) — currently they're all neutral except active.
116
- - **P2** From/To node filters are bare inputs with no labels — fine for power users, opaque for new users.
117
-
118
- ### 3.6 Messages
119
-
120
- **Issues:**
121
- - **P2** "All types" select again native-styled, same issue as Nodes.
122
- - **P2** "Debug" toggle button looks identical to "Timeline/Grouped" view toggle — should visually differentiate (debug = dev affordance, view = display mode).
123
-
124
- ### 3.7 Networks (Settings → Networks)
125
-
126
- **Issues:**
127
- - **P2** Create form button "Create" is muted (disabled-looking) when fields empty — by design. But the "Create" button when active is solid emerald, when disabled it's the muted grey we shipped in 0.3.4. Works correctly but the **transition between disabled→enabled feels abrupt** (no animation).
128
- - ✅ My Networks empty state ("No networks found. Create one or sign in with V3 auth.") is well-written.
129
-
130
- ### 3.8 Logs (Audit Log)
131
-
132
- **Issues:**
133
- - **P0** Error state shows **raw JSON**: `[{"error":"unauthorized"}] (Audit log may require V3 auth token)` in a yellow chip. Two problems:
134
- 1. JSON should never leak to users — pretty-print or replace with human message
135
- 2. The "(Audit log may require V3 auth token)" parenthetical is helpful but undersold — should be the primary message with a "Sign in" CTA
136
- - **P3** "All actions" select native styled.
137
-
138
- ### 3.9 Server Logs
139
-
140
- **Issues:**
141
- - **P0** Error chip: `X hub 401 (admin 角色才能看 server logs)` — exposes HTTP status to user. Should be "You need admin role to view server logs."
142
- - **P1** "加载失败" (Chinese for "loading failed") shown plain-text on white card — should be styled error state with icon + retry CTA.
143
- - **P2** Top controls (Pause / auto-refresh / Reload) jammed together — Pause is a chip-style button, auto-refresh is a checkbox-label, Reload is an outlined button. Visually heterogeneous; should be one button group.
144
- - **P2** Tab filter (all/log/info/warn/error) — same as Tasks tab strip, should color-code.
145
-
146
- ### 3.10 Admin
147
-
148
- **Issues:**
149
- - **P0** "Server Overview" mini-stats (`0 Online / 0 Offline / 6 SSE Connections / -- Total Tasks`) — the "6" for SSE Connections lights up emerald with no context. New users won't know what SSE Connections means. Add tooltip or sub-label.
150
- - **P1** "Register User (V3)" button is full-width muted grey (disabled when empty). Visually weak — looks like a placeholder. When enabled it'll be full-width emerald, which is a lot of emerald.
151
- - **P2** Two-column layout works but left column is denser than right — could rebalance.
152
-
153
- ### 3.11 Settings
154
-
155
- **Issues:**
156
- - **P1** Long card list with no section grouping → feels like a list, not an org. Add section headings: "Connection", "Account", "Resources", "Advanced".
157
- - **P1** License "type · trial" shown as orange text — should be a chip.
158
- - **P2** "anet-XXXX-XXXX-XXXX-XXXX" license code input is empty-styled (light grey bg with placeholder); enter key UX unclear.
159
- - **P3** Session card at bottom — red "Session" label is a slight misdirection (looks like an error). Should probably read "Sign out" with a less alarming color.
160
-
161
- ### 3.12 Settings → Tokens
162
-
163
- **Issues:**
164
- - **P2** Same disabled-button pattern as Networks. Works correctly, just the abrupt enable transition.
165
-
166
- ---
167
-
168
- ## 4. Cross-cutting issues (apply globally)
169
-
170
- 1. **CSS hex-class shim is fragile** — every theme bug fix so far has been "add `bg-[#xxxxxx]` to the override list in globals.css". Real fix: migrate components from `bg-[#0a0a1a]` → `bg-[var(--bg)]` or themed Tailwind tokens. Scope: ~30 files, ~150 instances. Not urgent for 0.4.3 but the right long-term play.
171
- 2. **Native `<select>` not themed** — 4 occurrences across pages (Nodes filter, Messages filter, Logs filter, Settings password change). Either style them or replace with custom dropdown.
172
- 3. **Empty states inconsistent** — sometimes "--" + text, sometimes only text. Standardize: icon + headline + sub-text + optional CTA.
173
- 4. **Error states inconsistent** — sometimes raw JSON, sometimes plain text, sometimes styled chip. Standardize: red chip + human message + recovery CTA.
174
- 5. **Disabled button confusion** — disabled + enabled muted-grey-vs-emerald is too binary. Add an outline or subtle text-decoration to disabled state to make affordance clearer.
175
-
176
- ---
177
-
178
- ## 5. Command Mesh — decide separately
179
-
180
- **Current state:** Cyber radar SVG (linear gradient `#0b1220→#080814→#101018`, cyan rings, neon edges, animated flow particles) rendered as-is in light theme. Looks great in Cyber, looks like a black hole inside a white page in light.
181
-
182
- **Option A (recommend):** Build a light variant.
183
- - White SVG bg with very subtle grid lines (`#e3e6eb` 1px every 80px)
184
- - Emerald node circles (no glow)
185
- - Soft grey edges (no animated particles, or slowed-down + lower contrast)
186
- - Cost: ~150 LOC new SVG block, conditional on `data-theme="light"` (detect via `matchMedia` or pass theme prop)
187
-
188
- **Option B:** Hide topology in light theme.
189
- - Cheaper. Add "(hidden in light theme)" message + show-anyway button. Cost: 5 LOC.
190
- - Worse UX — users lose a feature in light mode.
191
-
192
- **Option C:** Keep dark canvas in light page.
193
- - Free. Status quo. Visually disruptive but functional.
194
-
195
- **My recommendation: A.** It's the highest-perceived-polish change in this whole proposal.
196
-
197
- ---
198
-
199
- ## 6. Implementation plan (after 通信龙 OK)
200
-
201
- Sequence (10 small commits, each independently shippable):
202
-
203
- 1. **Sidebar surface** — change bg to `bg-secondary`, simplify active nav state, add right divider shadow. Touches `app/components/Sidebar.tsx` + globals.css.
204
- 2. **KPI card accent** — replace gradient wash with 2px top strip; touches `app/components/StatsBar.tsx`.
205
- 3. **Empty states standardization** — extract `<EmptyState>` component with icon prop; touches `app/components/LoadingSkeleton.tsx` (already exports EmptyState) + 6 page files.
206
- 4. **Error states standardization** — same pattern, `<ErrorBanner>` component. Touches logs page, server-logs page.
207
- 5. **Native select theming** — apply `appearance-none` + custom chevron SVG bg. globals.css.
208
- 6. **Tab strip color coding** — Tasks + Server Logs tabs get color tints matching status. Touches `app/tasks/page.tsx`, `app/server-logs/page.tsx`.
209
- 7. **Disabled button outline** — globals.css; add dashed border to `disabled:bg-gray-800` in light/mint.
210
- 8. **Settings section grouping** — wrap cards in `<section>` groups with H3 headings. Touches `app/settings/page.tsx`.
211
- 9. **Quick Actions disambiguation** — split into pure-stat-row + pure-nav-row, OR make all 6 carry data. Touches `app/page.tsx`.
212
- 10. **Command Mesh light variant** (if Option A) — new SVG block conditional on theme. Touches `app/components/TopoGraph.tsx`.
213
-
214
- Each commit builds + Playwright-screenshots + diffs against the audit screenshots stored in `/tmp/audit-light/`.
215
-
216
- Bump to `0.4.3-preview.0`, `npm publish --tag preview`. **Do NOT** touch CLI `PINNED_DASHBOARD_VERSION` (stays 0.4.2 stable). **Do NOT** `vercel deploy --prod` (preview testing via `npx ...@preview` only).
217
-
218
- ---
219
-
220
- ## 7. Questions for 通信龙
221
-
222
- 1. **Direction** — cool-professional confirmed? Or pick alternative (warm / brutalist / glass).
223
- 2. **Command Mesh light variant** — Option A (build it) / B (hide) / C (keep dark canvas in light page).
224
- 3. **CTA color** — keep emerald `#009e7e` or swap brand?
225
- 4. **Sans-serif body** — defer to a separate decision (typography is a multi-week call)?
226
- 5. **Mobile audit** — do this in 0.4.3 or defer to 0.4.4?
227
- 6. **Native `<select>` replacement** — style them (cheap) or build custom dropdown (right)?
228
-
229
- Awaiting your call on 1–6. Phase 3 implementation starts when you OK direction.
@@ -1,4 +0,0 @@
1
- {
2
- "status": "passed",
3
- "failedTests": []
4
- }