@sleep2agi/agent-network-dashboard 0.4.6-preview.27 → 0.4.6-preview.29

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 (176) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +1 -0
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/diagnostics/route-bundle-stats.json +31 -31
  5. package/.next/fallback-build-manifest.json +3 -3
  6. package/.next/prerender-manifest.json +3 -3
  7. package/.next/routes-manifest.json +6 -0
  8. package/.next/server/app/_global-error.html +1 -1
  9. package/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  16. package/.next/server/app/_not-found.html +2 -2
  17. package/.next/server/app/_not-found.rsc +11 -11
  18. package/.next/server/app/_not-found.segments/_full.segment.rsc +11 -11
  19. package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  20. package/.next/server/app/_not-found.segments/_index.segment.rsc +6 -6
  21. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  22. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  23. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  24. package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  25. package/.next/server/app/admin.html +2 -2
  26. package/.next/server/app/admin.rsc +13 -13
  27. package/.next/server/app/admin.segments/_full.segment.rsc +13 -13
  28. package/.next/server/app/admin.segments/_head.segment.rsc +4 -4
  29. package/.next/server/app/admin.segments/_index.segment.rsc +6 -6
  30. package/.next/server/app/admin.segments/_tree.segment.rsc +1 -1
  31. package/.next/server/app/admin.segments/admin/__PAGE__.segment.rsc +4 -4
  32. package/.next/server/app/admin.segments/admin.segment.rsc +3 -3
  33. package/.next/server/app/api/hub/servers/route/app-paths-manifest.json +3 -0
  34. package/.next/server/app/api/hub/servers/route/build-manifest.json +9 -0
  35. package/.next/server/app/api/hub/servers/route/server-reference-manifest.json +4 -0
  36. package/.next/server/app/api/hub/servers/route.js +7 -0
  37. package/.next/server/app/api/hub/servers/route.js.map +5 -0
  38. package/.next/server/app/api/hub/servers/route.js.nft.json +1 -0
  39. package/.next/server/app/api/hub/servers/route_client-reference-manifest.js +3 -0
  40. package/.next/server/app/index.html +2 -2
  41. package/.next/server/app/index.rsc +13 -13
  42. package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  43. package/.next/server/app/index.segments/_full.segment.rsc +13 -13
  44. package/.next/server/app/index.segments/_head.segment.rsc +4 -4
  45. package/.next/server/app/index.segments/_index.segment.rsc +6 -6
  46. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  47. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  48. package/.next/server/app/login.html +2 -2
  49. package/.next/server/app/login.rsc +13 -13
  50. package/.next/server/app/login.segments/_full.segment.rsc +13 -13
  51. package/.next/server/app/login.segments/_head.segment.rsc +4 -4
  52. package/.next/server/app/login.segments/_index.segment.rsc +6 -6
  53. package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  54. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
  55. package/.next/server/app/login.segments/login.segment.rsc +3 -3
  56. package/.next/server/app/logs/page_client-reference-manifest.js +1 -1
  57. package/.next/server/app/logs.html +2 -2
  58. package/.next/server/app/logs.rsc +13 -13
  59. package/.next/server/app/logs.segments/_full.segment.rsc +13 -13
  60. package/.next/server/app/logs.segments/_head.segment.rsc +4 -4
  61. package/.next/server/app/logs.segments/_index.segment.rsc +6 -6
  62. package/.next/server/app/logs.segments/_tree.segment.rsc +1 -1
  63. package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +4 -4
  64. package/.next/server/app/logs.segments/logs.segment.rsc +3 -3
  65. package/.next/server/app/messages/page_client-reference-manifest.js +1 -1
  66. package/.next/server/app/messages.html +2 -2
  67. package/.next/server/app/messages.rsc +13 -13
  68. package/.next/server/app/messages.segments/_full.segment.rsc +13 -13
  69. package/.next/server/app/messages.segments/_head.segment.rsc +4 -4
  70. package/.next/server/app/messages.segments/_index.segment.rsc +6 -6
  71. package/.next/server/app/messages.segments/_tree.segment.rsc +1 -1
  72. package/.next/server/app/messages.segments/messages/__PAGE__.segment.rsc +4 -4
  73. package/.next/server/app/messages.segments/messages.segment.rsc +3 -3
  74. package/.next/server/app/node/page_client-reference-manifest.js +1 -1
  75. package/.next/server/app/node.html +2 -2
  76. package/.next/server/app/node.rsc +13 -13
  77. package/.next/server/app/node.segments/_full.segment.rsc +13 -13
  78. package/.next/server/app/node.segments/_head.segment.rsc +4 -4
  79. package/.next/server/app/node.segments/_index.segment.rsc +6 -6
  80. package/.next/server/app/node.segments/_tree.segment.rsc +1 -1
  81. package/.next/server/app/node.segments/node/__PAGE__.segment.rsc +4 -4
  82. package/.next/server/app/node.segments/node.segment.rsc +3 -3
  83. package/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
  84. package/.next/server/app/nodes.html +2 -2
  85. package/.next/server/app/nodes.rsc +13 -13
  86. package/.next/server/app/nodes.segments/_full.segment.rsc +13 -13
  87. package/.next/server/app/nodes.segments/_head.segment.rsc +4 -4
  88. package/.next/server/app/nodes.segments/_index.segment.rsc +6 -6
  89. package/.next/server/app/nodes.segments/_tree.segment.rsc +1 -1
  90. package/.next/server/app/nodes.segments/nodes/__PAGE__.segment.rsc +4 -4
  91. package/.next/server/app/nodes.segments/nodes.segment.rsc +3 -3
  92. package/.next/server/app/page_client-reference-manifest.js +1 -1
  93. package/.next/server/app/server-logs/page_client-reference-manifest.js +1 -1
  94. package/.next/server/app/server-logs.html +2 -2
  95. package/.next/server/app/server-logs.rsc +13 -13
  96. package/.next/server/app/server-logs.segments/_full.segment.rsc +13 -13
  97. package/.next/server/app/server-logs.segments/_head.segment.rsc +4 -4
  98. package/.next/server/app/server-logs.segments/_index.segment.rsc +6 -6
  99. package/.next/server/app/server-logs.segments/_tree.segment.rsc +1 -1
  100. package/.next/server/app/server-logs.segments/server-logs/__PAGE__.segment.rsc +4 -4
  101. package/.next/server/app/server-logs.segments/server-logs.segment.rsc +3 -3
  102. package/.next/server/app/settings/networks/page_client-reference-manifest.js +1 -1
  103. package/.next/server/app/settings/networks.html +2 -2
  104. package/.next/server/app/settings/networks.rsc +13 -13
  105. package/.next/server/app/settings/networks.segments/_full.segment.rsc +13 -13
  106. package/.next/server/app/settings/networks.segments/_head.segment.rsc +4 -4
  107. package/.next/server/app/settings/networks.segments/_index.segment.rsc +6 -6
  108. package/.next/server/app/settings/networks.segments/_tree.segment.rsc +1 -1
  109. package/.next/server/app/settings/networks.segments/settings/networks/__PAGE__.segment.rsc +4 -4
  110. package/.next/server/app/settings/networks.segments/settings/networks.segment.rsc +3 -3
  111. package/.next/server/app/settings/networks.segments/settings.segment.rsc +3 -3
  112. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  113. package/.next/server/app/settings/tokens/page_client-reference-manifest.js +1 -1
  114. package/.next/server/app/settings/tokens.html +2 -2
  115. package/.next/server/app/settings/tokens.rsc +13 -13
  116. package/.next/server/app/settings/tokens.segments/_full.segment.rsc +13 -13
  117. package/.next/server/app/settings/tokens.segments/_head.segment.rsc +4 -4
  118. package/.next/server/app/settings/tokens.segments/_index.segment.rsc +6 -6
  119. package/.next/server/app/settings/tokens.segments/_tree.segment.rsc +1 -1
  120. package/.next/server/app/settings/tokens.segments/settings/tokens/__PAGE__.segment.rsc +4 -4
  121. package/.next/server/app/settings/tokens.segments/settings/tokens.segment.rsc +3 -3
  122. package/.next/server/app/settings/tokens.segments/settings.segment.rsc +3 -3
  123. package/.next/server/app/settings.html +2 -2
  124. package/.next/server/app/settings.rsc +13 -13
  125. package/.next/server/app/settings.segments/_full.segment.rsc +13 -13
  126. package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
  127. package/.next/server/app/settings.segments/_index.segment.rsc +6 -6
  128. package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  129. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
  130. package/.next/server/app/settings.segments/settings.segment.rsc +3 -3
  131. package/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
  132. package/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
  133. package/.next/server/app/tasks.html +2 -2
  134. package/.next/server/app/tasks.rsc +13 -13
  135. package/.next/server/app/tasks.segments/_full.segment.rsc +13 -13
  136. package/.next/server/app/tasks.segments/_head.segment.rsc +4 -4
  137. package/.next/server/app/tasks.segments/_index.segment.rsc +6 -6
  138. package/.next/server/app/tasks.segments/_tree.segment.rsc +1 -1
  139. package/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +4 -4
  140. package/.next/server/app/tasks.segments/tasks.segment.rsc +3 -3
  141. package/.next/server/app-paths-manifest.json +1 -0
  142. package/.next/server/chunks/0ykm__next-internal_server_app_api_hub_servers_route_actions_08-m-cs.js +3 -0
  143. package/.next/server/chunks/0ykm__next-internal_server_app_api_hub_servers_route_actions_08-m-cs.js.map +1 -0
  144. package/.next/server/chunks/[root-of-the-server]__0tx8s8i._.js +3 -0
  145. package/.next/server/chunks/[root-of-the-server]__0tx8s8i._.js.map +1 -0
  146. package/.next/server/chunks/ssr/agent-network-dashboard_09kk21a._.js +1 -1
  147. package/.next/server/chunks/ssr/agent-network-dashboard_09kk21a._.js.map +1 -1
  148. package/.next/server/chunks/ssr/agent-network-dashboard_app_01jhlxz._.js +1 -1
  149. package/.next/server/chunks/ssr/agent-network-dashboard_app_01jhlxz._.js.map +1 -1
  150. package/.next/server/chunks/ssr/agent-network-dashboard_app_09d29my._.js +1 -1
  151. package/.next/server/chunks/ssr/agent-network-dashboard_app_09d29my._.js.map +1 -1
  152. package/.next/server/chunks/ssr/agent-network-dashboard_app_components_0mvyi-4._.js +1 -1
  153. package/.next/server/chunks/ssr/agent-network-dashboard_app_components_0mvyi-4._.js.map +1 -1
  154. package/.next/server/middleware-build-manifest.js +3 -3
  155. package/.next/server/pages/404.html +2 -2
  156. package/.next/server/pages/500.html +1 -1
  157. package/.next/server/server-reference-manifest.js +1 -1
  158. package/.next/server/server-reference-manifest.json +1 -1
  159. package/.next/static/chunks/0.v4shwnaii1l.js +1 -0
  160. package/.next/static/chunks/{15gj.t675_yw3.js → 02hf~nv.u117s.js} +1 -1
  161. package/.next/static/chunks/{0fqy_0wj_1xa7.js → 0pl7l_.2im.j0.js} +3 -3
  162. package/.next/static/chunks/{04ppgi-mphhr6.js → 0zh53kf--qs63.js} +1 -1
  163. package/.next/trace +2 -2
  164. package/.next/trace-build +1 -1
  165. package/.next/types/routes.d.ts +2 -1
  166. package/.next/types/validator.ts +9 -0
  167. package/app/api/hub/servers/route.ts +39 -0
  168. package/app/components/ServersDrawer.tsx +64 -27
  169. package/app/components/TopoGraph.tsx +9 -1
  170. package/package.json +1 -1
  171. package/scripts/servers-drawer-live-test.mjs +96 -0
  172. package/scripts/topo-pan-cursor-test.mjs +62 -0
  173. package/.next/static/chunks/0zs511wcsq~0j.js +0 -1
  174. /package/.next/static/{kk1qr2sXSqVvoqBT7fk1x → T_govTa_ITLMC4HUegXx1}/_buildManifest.js +0 -0
  175. /package/.next/static/{kk1qr2sXSqVvoqBT7fk1x → T_govTa_ITLMC4HUegXx1}/_clientMiddlewareManifest.js +0 -0
  176. /package/.next/static/{kk1qr2sXSqVvoqBT7fk1x → T_govTa_ITLMC4HUegXx1}/_ssgManifest.js +0 -0
@@ -1,7 +1,7 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24156,e=>{"use strict";var t=e.i(22381),a=e.i(23910);let s=[{id:"cyber",label:"Cyber",emoji:"🌃",desc:"默认深色"},{id:"light",label:"Light",emoji:"☀️",desc:"浅色简洁"},{id:"mint",label:"Mint",emoji:"🌿",desc:"薄荷绿"},{id:"sunset",label:"Sunset",emoji:"🌅",desc:"暖色橙紫"}],r="anet-theme";function n(e){"u">typeof document&&document.documentElement.setAttribute("data-theme",e)}e.s(["ThemeProvider",0,function({children:e}){return(0,a.useEffect)(()=>{n(localStorage.getItem(r)||"cyber")},[]),(0,t.jsx)(t.Fragment,{children:e})},"ThemeSwitcher",0,function({compact:e=!1}){let[l,o]=(0,a.useState)("cyber"),[i,c]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=localStorage.getItem(r)||"cyber";o(e),n(e)},[]);let d=s.find(e=>e.id===l)||s[0];return(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("button",{"aria-label":"切换主题",onClick:()=>c(!i),className:"px-2.5 py-1.5 rounded-md text-xs flex items-center gap-1.5 hover:opacity-80 transition-opacity",style:{background:"var(--bg-elevated)",color:"var(--fg)",border:"1px solid var(--border)"},children:[(0,t.jsx)("span",{"aria-hidden":!0,children:d.emoji}),!e&&(0,t.jsx)("span",{children:d.label})]}),i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-40",onClick:()=>c(!1)}),(0,t.jsx)("div",{className:"absolute right-0 top-full mt-1 z-50 rounded-md min-w-[160px] py-1 shadow-lg",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:s.map(e=>(0,t.jsxs)("button",{onClick:()=>{var t;o(t=e.id),localStorage.setItem(r,t),n(t),c(!1)},className:"w-full px-3 py-2 text-left text-xs flex items-center gap-2 hover:opacity-80",style:{background:e.id===l?"var(--bg-elevated)":"transparent",color:"var(--fg)"},children:[(0,t.jsx)("span",{"aria-hidden":!0,children:e.emoji}),(0,t.jsx)("span",{className:"flex-1",children:e.label}),(0,t.jsx)("span",{style:{color:"var(--fg-dim)"},className:"text-[10px]",children:e.desc}),e.id===l&&(0,t.jsx)("span",{style:{color:"var(--accent)"},children:"•"})]},e.id))})]})]})}])},22485,e=>{"use strict";var t=e.i(22381),a=e.i(56058),s=e.i(56839),r=e.i(23910),n=e.i(12629),l=e.i(11449),o=e.i(24156);let i=e=>fetch(e).then(e=>e.ok?e.json():{networks:[]}),c=[{href:"/",label:"Overview",icon:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"},{href:"/tasks",label:"Tasks",icon:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"},{href:"/nodes",label:"Nodes",icon:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"},{href:"/messages",label:"Messages",icon:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"},{href:"/settings/networks",label:"Networks",icon:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},{href:"/logs",label:"Audit Log",icon:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},{href:"/server-logs",label:"Server Logs",icon:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"},{href:"/admin",label:"Admin",icon:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"},{href:"/settings",label:"Settings",icon:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z"}],d={owner:"⭐",admin:"🔧",member:"👤",viewer:"👁"};function m(){let e=(0,a.usePathname)(),[m,u]=(0,r.useState)(!1),[p,g]=(0,r.useState)(!1),{networkId:f,setNetworkId:b}=(0,l.useNetworkId)(),{data:v}=(0,n.default)("/api/hub/networks",i,{refreshInterval:15e3,dedupingInterval:1e4}),{data:y}=(0,n.default)("/api/hub/status",h,{refreshInterval:15e3,dedupingInterval:1e4}),j=v?.networks||[],k=(()=>{let e=new Map;for(let t of y?.sessions||[])t.network_id&&e.set(t.network_id,(e.get(t.network_id)||0)+1);let t=new Set(j.map(e=>e.network_id));return[...j,...[...e.keys()].filter(e=>!t.has(e)).map(e=>({network_id:e,network_name:e}))].map(t=>({...t,agentCount:e.get(t.network_id)||0}))})(),w=(0,t.jsx)("nav",{className:"flex flex-col gap-1 px-2 py-4",children:c.map(a=>{var r;return(0,t.jsxs)(s.default,{href:a.href,prefetch:!1,onClick:()=>g(!1),title:m?a.label:void 0,className:`relative flex items-center gap-3 px-3 py-3 rounded-lg text-sm transition-colors active:bg-[#1a1a3a] ${("/"===(r=a.href)?"/"===e:"/settings"===r?"/settings"===e:e.startsWith(r))?"bg-cyan-500/10 text-cyan-300 border border-cyan-500/20 anet-nav-active":"text-gray-400 hover:text-gray-200 hover:bg-[#1a1a2a]"} ${m?"justify-center px-0":""}`,children:[(0,t.jsx)("svg",{className:"w-5 h-5 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:a.icon})}),!m&&(0,t.jsx)("span",{children:a.label})]},a.href)})});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>g(!p),className:"fixed top-4 left-3 z-50 lg:hidden bg-[#111128] border border-[#2a2a4a] rounded-lg p-2.5 text-gray-400 hover:text-white active:bg-[#1a1a3a]","aria-label":"Toggle menu",children:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p?(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),p&&(0,t.jsx)("div",{className:"fixed inset-0 bg-black/50 z-30 lg:hidden anet-fade-in",onClick:()=>g(!1)}),(0,t.jsxs)("aside",{"data-anet-sidebar":"true",className:`
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24156,e=>{"use strict";var t=e.i(22381),a=e.i(23910);let s=[{id:"cyber",label:"Cyber",emoji:"🌃",desc:"默认深色"},{id:"light",label:"Light",emoji:"☀️",desc:"浅色简洁"},{id:"mint",label:"Mint",emoji:"🌿",desc:"薄荷绿"},{id:"sunset",label:"Sunset",emoji:"🌅",desc:"暖色橙紫"}],r="anet-theme";function n(e){"u">typeof document&&document.documentElement.setAttribute("data-theme",e)}e.s(["ThemeProvider",0,function({children:e}){return(0,a.useEffect)(()=>{n(localStorage.getItem(r)||"cyber")},[]),(0,t.jsx)(t.Fragment,{children:e})},"ThemeSwitcher",0,function({compact:e=!1}){let[l,o]=(0,a.useState)("cyber"),[i,c]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=localStorage.getItem(r)||"cyber";o(e),n(e)},[]);let d=s.find(e=>e.id===l)||s[0];return(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("button",{"aria-label":"切换主题",onClick:()=>c(!i),className:"px-2.5 py-1.5 rounded-md text-xs flex items-center gap-1.5 hover:opacity-80 transition-opacity",style:{background:"var(--bg-elevated)",color:"var(--fg)",border:"1px solid var(--border)"},children:[(0,t.jsx)("span",{"aria-hidden":!0,children:d.emoji}),!e&&(0,t.jsx)("span",{children:d.label})]}),i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-40",onClick:()=>c(!1)}),(0,t.jsx)("div",{className:"absolute right-0 top-full mt-1 z-50 rounded-md min-w-[160px] py-1 shadow-lg",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:s.map(e=>(0,t.jsxs)("button",{onClick:()=>{var t;o(t=e.id),localStorage.setItem(r,t),n(t),c(!1)},className:"w-full px-3 py-2 text-left text-xs flex items-center gap-2 hover:opacity-80",style:{background:e.id===l?"var(--bg-elevated)":"transparent",color:"var(--fg)"},children:[(0,t.jsx)("span",{"aria-hidden":!0,children:e.emoji}),(0,t.jsx)("span",{className:"flex-1",children:e.label}),(0,t.jsx)("span",{style:{color:"var(--fg-dim)"},className:"text-[10px]",children:e.desc}),e.id===l&&(0,t.jsx)("span",{style:{color:"var(--accent)"},children:"•"})]},e.id))})]})]})}])},22485,e=>{"use strict";var t=e.i(22381),a=e.i(56058),s=e.i(56839),r=e.i(23910),n=e.i(12629),l=e.i(11449),o=e.i(24156);let i=e=>fetch(e).then(e=>e.ok?e.json():{networks:[]}),c=[{href:"/",label:"Overview",icon:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"},{href:"/tasks",label:"Tasks",icon:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"},{href:"/nodes",label:"Nodes",icon:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"},{href:"/messages",label:"Messages",icon:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"},{href:"/settings/networks",label:"Networks",icon:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},{href:"/logs",label:"Audit Log",icon:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},{href:"/server-logs",label:"Server Logs",icon:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"},{href:"/admin",label:"Admin",icon:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"},{href:"/settings",label:"Settings",icon:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z"}],d={owner:"⭐",admin:"🔧",member:"👤",viewer:"👁"};function h(){let e=(0,a.usePathname)(),[h,u]=(0,r.useState)(!1),[p,g]=(0,r.useState)(!1),{networkId:f,setNetworkId:b}=(0,l.useNetworkId)(),{data:v}=(0,n.default)("/api/hub/networks",i,{refreshInterval:15e3,dedupingInterval:1e4}),{data:y}=(0,n.default)("/api/hub/status",m,{refreshInterval:15e3,dedupingInterval:1e4}),j=v?.networks||[],k=(()=>{let e=new Map;for(let t of y?.sessions||[])t.network_id&&e.set(t.network_id,(e.get(t.network_id)||0)+1);let t=new Set(j.map(e=>e.network_id));return[...j,...[...e.keys()].filter(e=>!t.has(e)).map(e=>({network_id:e,network_name:e}))].map(t=>({...t,agentCount:e.get(t.network_id)||0}))})(),w=(0,t.jsx)("nav",{className:"flex flex-col gap-1 px-2 py-4",children:c.map(a=>{var r;return(0,t.jsxs)(s.default,{href:a.href,prefetch:!1,onClick:()=>g(!1),title:h?a.label:void 0,className:`relative flex items-center gap-3 px-3 py-3 rounded-lg text-sm transition-colors active:bg-[#1a1a3a] ${("/"===(r=a.href)?"/"===e:"/settings"===r?"/settings"===e:e.startsWith(r))?"bg-cyan-500/10 text-cyan-300 border border-cyan-500/20 anet-nav-active":"text-gray-400 hover:text-gray-200 hover:bg-[#1a1a2a]"} ${h?"justify-center px-0":""}`,children:[(0,t.jsx)("svg",{className:"w-5 h-5 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:a.icon})}),!h&&(0,t.jsx)("span",{children:a.label})]},a.href)})});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>g(!p),className:"fixed top-4 left-3 z-50 lg:hidden bg-[#111128] border border-[#2a2a4a] rounded-lg p-2.5 text-gray-400 hover:text-white active:bg-[#1a1a3a]","aria-label":"Toggle menu",children:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:p?(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),p&&(0,t.jsx)("div",{className:"fixed inset-0 bg-black/50 z-30 lg:hidden anet-fade-in",onClick:()=>g(!1)}),(0,t.jsxs)("aside",{"data-anet-sidebar":"true",className:`
2
2
  fixed top-0 left-0 h-full z-40 bg-[#0d0d1a] border-r border-[#2a2a4a]
3
3
  transition-transform duration-200 ease-out
4
- ${m?"w-16":"w-52"}
4
+ ${h?"w-16":"w-52"}
5
5
  ${p?"translate-x-0 shadow-2xl shadow-black/40 lg:shadow-none":"-translate-x-full"}
6
6
  lg:translate-x-0 lg:static lg:shrink-0 lg:shadow-none
7
- `,children:[(0,t.jsx)(x,{collapsed:m}),(0,t.jsx)("div",{className:"border-b border-[#2a2a4a]"}),!m&&k.length>0&&(0,t.jsxs)("div",{className:"px-2 py-3 border-b border-[#2a2a4a]",children:[(0,t.jsx)("div",{className:"px-3 text-[10px] text-gray-600 uppercase mb-2",children:"Networks"}),(0,t.jsx)("div",{className:"space-y-0.5 max-h-32 overflow-y-auto",children:k.map(e=>(0,t.jsxs)("button",{onClick:()=>{b(e.network_id),g(!1)},title:e.network_id,className:`w-full flex items-center gap-2 px-3 py-1.5 rounded-md text-xs transition-colors text-left ${f===e.network_id?"bg-cyan-500/10 text-cyan-300":"text-gray-500 hover:text-gray-300 hover:bg-[#1a1a2a]"}`,children:[(0,t.jsx)("span",{children:d[e.role||"member"]||"👤"}),(0,t.jsx)("span",{className:"truncate flex-1",children:e.network_name}),e.agentCount?(0,t.jsx)("span",{className:"shrink-0 tabular-nums text-[10px] text-gray-600",children:e.agentCount}):null]},e.network_id))})]}),(0,t.jsx)("div",{className:"pb-20",children:w}),(0,t.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 border-t border-[#2a2a4a] bg-[#0d0d1a]",children:[(0,t.jsxs)("button",{onClick:()=>{window.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,ctrlKey:!0}))},title:m?"Quick search (⌘K)":void 0,className:`w-full flex items-center text-[11px] text-gray-600 hover:text-gray-400 hover:bg-[#1a1a2a] transition-colors ${m?"justify-center px-0 py-2.5":"justify-between gap-2 px-5 py-2"}`,"aria-label":"Open command palette",children:[(0,t.jsxs)("span",{className:`flex items-center ${m?"":"gap-2"}`,children:[(0,t.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),!m&&"Quick search"]}),!m&&(0,t.jsx)("kbd",{className:"text-[10px] border border-current rounded px-1 py-0.5 opacity-60 font-mono",children:"⌘K"})]}),(0,t.jsxs)("button",{onClick:async()=>{await fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),sessionStorage.removeItem("anet_v3_auth"),window.location.assign("/login")},title:m?"Sign out":void 0,className:`w-full flex items-center text-xs text-gray-500 hover:text-red-400 hover:bg-red-500/5 transition-colors ${m?"justify-center px-0 py-2.5":"gap-3 px-5 py-3"}`,children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})}),!m&&"Sign out"]}),(0,t.jsxs)("div",{className:`flex items-center gap-2 ${m?"flex-col px-0 py-2":"px-3 py-2 justify-between"}`,children:[(0,t.jsx)(o.ThemeSwitcher,{compact:m}),(0,t.jsx)("button",{onClick:()=>u(!m),title:m?"Expand sidebar":"Collapse sidebar",className:"hidden lg:flex p-1.5 rounded text-gray-600 hover:text-gray-400 transition-colors","aria-label":m?"Expand sidebar":"Collapse sidebar",children:(0,t.jsx)("svg",{className:`w-4 h-4 transition-transform ${m?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})})})]})]})]})]})}let h=e=>fetch(e).then(e=>e.ok?e.json():{sessions:[]});function x({collapsed:e}){let{data:a}=(0,n.default)("/api/hub/status",h,{refreshInterval:1e4,dedupingInterval:4e3}),r=a?.sessions||[],l=r.filter(e=>e.status&&"offline"!==e.status).length,o=r.length;return e?(0,t.jsx)(s.default,{href:"/",className:"block px-3 py-4 flex justify-center hover:opacity-80 transition-opacity","aria-label":"Agent Network — home",children:(0,t.jsx)(u,{size:32})}):(0,t.jsxs)(s.default,{href:"/",className:"block px-4 py-4 flex items-center gap-3 hover:bg-[#11112a]/40 transition-colors rounded-r-xl","aria-label":"Agent Network — home",children:[(0,t.jsx)(u,{size:32}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-white text-[13px] font-semibold leading-tight",children:"Agent Network"}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-500 flex items-center gap-1.5 mt-0.5",children:[(0,t.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${l>0?"bg-emerald-400 anet-brand-pulse":"bg-gray-600"}`,"aria-hidden":!0}),0===o?(0,t.jsx)("span",{children:"waiting for agents"}):(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"text-gray-300 font-medium tabular-nums",children:l}),(0,t.jsxs)("span",{className:"text-gray-600",children:["/",o]})," online"]})]})]})]})}function u({size:e}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 32 32","aria-hidden":!0,className:"shrink-0",children:[(0,t.jsx)("circle",{cx:"16",cy:"16",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",opacity:"0.2",className:"text-cyan-400"}),(0,t.jsx)("line",{x1:"16",y1:"10",x2:"10",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.45",className:"text-cyan-400"}),(0,t.jsx)("line",{x1:"16",y1:"10",x2:"22",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.45",className:"text-cyan-400"}),(0,t.jsx)("line",{x1:"10",y1:"20",x2:"22",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.45",className:"text-cyan-400"}),(0,t.jsx)("circle",{cx:"16",cy:"10",r:"2.5",fill:"currentColor",className:"text-cyan-400"}),(0,t.jsx)("circle",{cx:"10",cy:"20",r:"2.5",fill:"currentColor",className:"text-green-400"}),(0,t.jsx)("circle",{cx:"22",cy:"20",r:"2.5",fill:"currentColor",className:"text-violet-400"})]})}let p=async e=>{let t=await fetch(e);if(!t.ok)throw Error(String(t.status));return t.json()};function g(){let e,a,{data:l,error:o}=(0,n.default)("/api/hub/stats",p,{refreshInterval:15e3,dedupingInterval:5e3,shouldRetryOnError:!1}),{data:i,error:c}=(0,n.default)("/api/hub/health",p,{refreshInterval:15e3,dedupingInterval:5e3,shouldRetryOnError:!1}),[d,m]=(0,r.useState)(()=>"1"===sessionStorage.getItem("anet-hb-dismissed"));if(d)return null;let h=o&&c||i&&!1===i.ok,x=l?.tasks?.by_status?.find(e=>"failed"===e.status)?.count||0,u=l?.nodes?.total===0,g=null;if(h?(e="red",a="CommHub unreachable — agents may be offline",g={label:"Open Settings",href:"/settings"}):x>0?(e="amber",a=`${x} task${x>1?"s":""} failed recently`,g={label:"Review failures",href:"/tasks?status=failed"}):(u?(e="green",a="Waiting for first agent"):(e="green",a="All systems go"),g=null),"green"===e&&!l)return null;let f={red:"bg-red-500/8 border-red-500/25 text-red-300",amber:"bg-amber-500/8 border-amber-500/25 text-amber-300",green:"bg-emerald-500/6 border-emerald-500/20 text-emerald-300"}[e],b={red:"bg-red-400",amber:"bg-amber-400 anet-brand-pulse",green:"bg-emerald-400"}[e];return(0,t.jsxs)("div",{role:"status",className:`anet-health-banner sticky top-0 z-30 border-b ${f} pl-14 pr-3 sm:px-6 py-1.5 text-[12px] flex items-center justify-between gap-3 backdrop-blur-sm`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${b}`,"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate",children:a})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[g&&(0,t.jsxs)(s.default,{href:g.href,className:"text-[11px] font-medium underline-offset-2 hover:underline opacity-90 hover:opacity-100 hidden sm:inline",children:[g.label," →"]}),g&&(0,t.jsx)(s.default,{href:g.href,"aria-label":g.label,className:"sm:hidden text-[11px] font-medium opacity-90 hover:opacity-100",children:"→"}),(0,t.jsx)("button",{onClick:()=>{m(!0);try{sessionStorage.setItem("anet-hb-dismissed","1")}catch{}},"aria-label":"Dismiss banner",className:"opacity-50 hover:opacity-100 leading-none px-1",children:"×"})]})]})}let f="anet-cmdk-recents";function b(){try{let e=sessionStorage.getItem(f);return e?JSON.parse(e):[]}catch{return[]}}function v(e){try{let t=b().filter(t=>t!==e);t.unshift(e),sessionStorage.setItem(f,JSON.stringify(t.slice(0,4)))}catch{}}function y(e,t){if(!t)return{score:0,indices:[]};let a=e.toLowerCase(),s=t.toLowerCase(),r=0,n=0,l=0,o=0,i=[];for(;r<a.length&&n<s.length;)a[r]===s[n]?(l+=2+o,o++,i.push(r),(0===r||/[\s·:_/-]/.test(a[r-1]))&&(l+=4),n++):o=0,r++;return n<s.length?{score:-1,indices:[]}:{score:l-.05*Math.max(0,a.length-s.length),indices:i}}function j({text:e,indices:a}){if(!a.length)return(0,t.jsx)(t.Fragment,{children:e});let s=new Set(a),r=Array.from(e);return(0,t.jsx)(t.Fragment,{children:r.map((e,a)=>s.has(a)?(0,t.jsx)("mark",{className:"anet-cmdk-mark",children:e},a):(0,t.jsx)("span",{children:e},a))})}function k({d:e}){return(0,t.jsx)("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}let w=[{id:"go-overview",title:"Go to Overview",hint:"Fleet at a glance",group:"Navigate",icon:(0,t.jsx)(k,{d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3"}),perform:e=>e.push("/")},{id:"go-tasks",title:"Go to Tasks",hint:"All task statuses",group:"Navigate",icon:(0,t.jsx)(k,{d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"}),perform:e=>e.push("/tasks")},{id:"go-tasks-failed",title:"Go to Failed tasks",hint:"Filter status=failed",group:"Navigate",icon:(0,t.jsx)(k,{d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}),perform:e=>e.push("/tasks?status=failed")},{id:"go-nodes",title:"Go to Nodes",hint:"Agent fleet",group:"Navigate",icon:(0,t.jsx)(k,{d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"}),perform:e=>e.push("/nodes")},{id:"go-messages",title:"Go to Messages",hint:"Inter-agent chat",group:"Navigate",icon:(0,t.jsx)(k,{d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"}),perform:e=>e.push("/messages")},{id:"go-networks",title:"Go to Networks",hint:"Manage networks",group:"Navigate",icon:(0,t.jsx)(k,{d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"}),perform:e=>e.push("/settings/networks")},{id:"go-logs",title:"Go to Audit Log",hint:"Register / login / actions",group:"Navigate",icon:(0,t.jsx)(k,{d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"}),perform:e=>e.push("/logs")},{id:"go-server-logs",title:"Go to Server Logs",hint:"CommHub stdout/stderr",group:"Navigate",icon:(0,t.jsx)(k,{d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"}),perform:e=>e.push("/server-logs")},{id:"go-admin",title:"Go to Admin",hint:"Server overview + broadcast",group:"Navigate",icon:(0,t.jsx)(k,{d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"}),perform:e=>e.push("/admin")},{id:"go-settings",title:"Go to Settings",hint:"Connection / Account / Resources",group:"Navigate",icon:(0,t.jsx)(k,{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),perform:e=>e.push("/settings")},{id:"act-toggle-theme",title:"Toggle theme",hint:"cyber ↔ light",group:"Actions",icon:(0,t.jsx)(k,{d:"M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"}),perform:()=>{let e=document.documentElement.getAttribute("data-theme")||"cyber",t="light"===e||"mint"===e?"cyber":"light";document.documentElement.setAttribute("data-theme",t);try{localStorage.setItem("anet-theme",t)}catch{}}},{id:"act-copy-url",title:"Copy current URL",hint:"page link to clipboard",group:"Actions",icon:(0,t.jsx)(k,{d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"}),perform:()=>{try{navigator.clipboard.writeText(window.location.href)}catch{}}},{id:"act-sign-out",title:"Sign out",hint:"clear session",group:"Actions",icon:(0,t.jsx)(k,{d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"}),perform:()=>{fetch("/api/auth/logout",{method:"POST"}).catch(()=>{});try{sessionStorage.removeItem("anet_v3_auth")}catch{}window.location.assign("/login")}},{id:"act-help",title:"Show keyboard shortcuts",hint:"press ? — works on mobile too",group:"Actions",icon:(0,t.jsx)(k,{d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),perform:()=>{window.dispatchEvent(new KeyboardEvent("keydown",{key:"?"}))}}];function N(){let e=(0,a.useRouter)(),[s,n]=(0,r.useState)(!1),[l,o]=(0,r.useState)(""),[i,c]=(0,r.useState)(0),d=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=e=>{if((e.metaKey||e.ctrlKey)&&"k"===e.key.toLowerCase()){e.preventDefault(),n(e=>!e);return}if("/"===e.key&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA"&&!s){e.preventDefault(),n(!0);return}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[s]),(0,r.useEffect)(()=>{s&&(o(""),c(0),setTimeout(()=>d.current?.focus(),50))},[s]);let[m,h]=(0,r.useState)([]);(0,r.useEffect)(()=>{s&&h(b())},[s]);let[x,u]=(0,r.useState)([]);(0,r.useEffect)(()=>{if(!s)return;let e=!1;return(async()=>{try{let[a,s]=await Promise.all([fetch("/api/hub/status").then(e=>e.ok?e.json():{sessions:[]}),fetch("/api/hub/tasks?limit=20").then(e=>e.ok?e.json():{tasks:[]})]);if(e)return;let r=(a.sessions||[]).filter(e=>e.alias).slice(0,20).map(e=>({id:`agent-${e.alias}`,title:`Go to agent ${e.alias}`,hint:`${e.agent||"agent"} \xb7 ${e.status||"unknown"}`,group:"Agents",icon:(0,t.jsx)(k,{d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"}),perform:t=>t.push(`/node?alias=${encodeURIComponent(e.alias)}`)})),n=(s.tasks||[]).filter(e=>e.task_id).slice(0,15).map(e=>({id:`task-${e.task_id}`,title:`Open task: ${(e.content||e.task_id||"").slice(0,50)}`,hint:`${e.from_name||"?"} → ${e.to_name||"?"} \xb7 ${e.status||""}`,group:"Tasks",icon:(0,t.jsx)(k,{d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"}),perform:t=>t.push(`/tasks/${encodeURIComponent(e.task_id)}`)}));u([...r,...n])}catch{}})(),()=>{e=!0}},[s]);let p=(0,r.useMemo)(()=>{let e=[...w,...x];if(!l.trim()){let t=m.map(t=>e.find(e=>e.id===t)).filter(e=>!!e).map(e=>({...e,group:"Recents"})),a=new Set(m);return[...t,...w.filter(e=>!a.has(e.id))]}let t=e.map(e=>{let t=y(e.title,l),a=e.hint?y(e.hint,l):{score:-1,indices:[]},s=y(e.id,l);return{c:e,score:Math.max(t.score>=0?+t.score:-1/0,a.score>=0?.6*a.score:-1/0,s.score>=0?.3*s.score:-1/0),_titleHi:t.score>=0?t.indices:[],_hintHi:a.score>=0?a.indices:[]}}).filter(e=>e.score>-1/0);return t.sort((e,t)=>t.score-e.score),t.map(e=>({...e.c,_titleHi:e._titleHi,_hintHi:e._hintHi}))},[l,m,x]);if((0,r.useEffect)(()=>{i>=p.length&&c(0)},[p.length,i]),!s)return null;let g={};for(let e of p)(g[e.group]||=[]).push(e);let f=0;return(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Command palette",className:"anet-cmdk fixed inset-0 z-[100] flex items-start justify-center pt-[10vh] sm:pt-[15vh] px-4",onClick:()=>n(!1),onKeyDown:t=>{if("Escape"===t.key)return void n(!1);if("ArrowDown"===t.key){t.preventDefault(),c(e=>Math.min(e+1,p.length-1));return}if("ArrowUp"===t.key){t.preventDefault(),c(e=>Math.max(e-1,0));return}if("Enter"===t.key){t.preventDefault();let a=p[i];a&&(v(a.id),a.perform(e),n(!1))}},children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm","aria-hidden":!0}),(0,t.jsxs)("div",{className:"relative w-full max-w-xl rounded-xl border border-[#2a2a4a] bg-[#0d0d1a] shadow-2xl shadow-black/40 overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-[#2a2a4a] px-3 py-2.5",children:[(0,t.jsx)("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",className:"text-gray-500 shrink-0",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),(0,t.jsx)("input",{ref:d,value:l,onChange:e=>{o(e.target.value),c(0)},placeholder:"Type a command or search…",className:"flex-1 bg-transparent text-sm text-gray-200 placeholder-gray-600 focus:outline-none"}),(0,t.jsx)("kbd",{className:"text-[10px] text-gray-600 border border-[#2a2a4a] rounded px-1.5 py-0.5 font-mono",children:"esc"})]}),(0,t.jsx)("div",{className:"max-h-[60vh] overflow-y-auto py-2",children:0===p.length?(0,t.jsxs)("div",{className:"px-4 py-8 text-center text-xs text-gray-600",children:['No commands match "',l,'"']}):Object.entries(g).map(([a,s])=>(0,t.jsxs)("div",{className:"mb-2 last:mb-0",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-[0.12em] text-gray-600 px-3 py-1",children:a}),s.map(a=>{let s=f++,r=s===i;return(0,t.jsxs)("button",{onMouseEnter:()=>c(s),onClick:()=>{v(a.id),a.perform(e),n(!1)},className:`anet-cmdk-row w-full flex items-center gap-3 px-3 py-2 text-left text-sm ${r?"bg-cyan-500/10 text-cyan-300":"text-gray-300 hover:bg-[#1a1a2a]/50"}`,children:[(0,t.jsx)("span",{className:r?"text-cyan-400":"text-gray-500",children:a.icon}),(0,t.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"block truncate",children:(0,t.jsx)(j,{text:a.title,indices:a._titleHi||[]})}),a.hint&&(0,t.jsx)("span",{className:"block text-[11px] text-gray-600 truncate",children:(0,t.jsx)(j,{text:a.hint,indices:a._hintHi||[]})})]}),r&&(0,t.jsx)("span",{className:"text-[10px] text-gray-500",children:"↵"})]},a.id)})]},a))}),(0,t.jsxs)("div",{className:"border-t border-[#2a2a4a] px-3 py-1.5 flex items-center justify-between text-[10px] text-gray-600",children:[(0,t.jsxs)("span",{className:"flex items-center gap-3",children:[(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"font-mono",children:"↑↓"})," navigate"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"font-mono",children:"↵"})," select"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"font-mono",children:"esc"})," close"]})]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"font-mono",children:"⌘K"})," toggle"]})]})]})]})}let M=[{group:"Global",items:[{keys:["⌘","K"],label:"Open command palette (also Ctrl+K)"},{keys:["/"],label:"Open command palette"},{keys:["?"],label:"Toggle this help overlay"},{keys:["Esc"],label:"Close any open modal"}]},{group:"Navigate (vim-style)",items:[{keys:["g","o"],label:"Go to Overview"},{keys:["g","t"],label:"Go to Tasks"},{keys:["g","n"],label:"Go to Nodes"},{keys:["g","m"],label:"Go to Messages"},{keys:["g","w"],label:"Go to Networks"},{keys:["g","a"],label:"Go to Admin"},{keys:["g","l"],label:"Go to Audit Log"},{keys:["g","s"],label:"Go to Settings"}]},{group:"Command palette",items:[{keys:["↑","↓"],label:"Move selection"},{keys:["↵"],label:"Activate selected command"},{keys:["type"],label:"Filter — searches commands, agents, tasks"}]}],_={o:"/",t:"/tasks",n:"/nodes",m:"/messages",w:"/settings/networks",a:"/admin",l:"/logs",s:"/settings"};function C(){let[e,s]=(0,r.useState)(!1),n=(0,a.useRouter)(),l=(0,r.useRef)(0);return((0,r.useEffect)(()=>{let t=t=>{let a=document.activeElement?.tagName,r="INPUT"===a||"TEXTAREA"===a||document.activeElement?.isContentEditable;if("?"===t.key&&!r){t.preventDefault(),s(e=>!e);return}if("Escape"===t.key&&e&&s(!1),!r&&!t.metaKey&&!t.ctrlKey&&!t.altKey){if("g"===t.key){l.current=Date.now();return}if(Date.now()-l.current<1500){let e=_[t.key.toLowerCase()];e&&(t.preventDefault(),l.current=0,n.push(e))}}};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,n]),e)?(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",className:"anet-help fixed inset-0 z-[101] flex items-center justify-center px-4",onClick:()=>s(!1),children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm","aria-hidden":!0}),(0,t.jsxs)("div",{className:"relative w-full max-w-md rounded-xl border border-[#2a2a4a] bg-[#0d0d1a] shadow-2xl shadow-black/40 overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-[#2a2a4a] px-4 py-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-gray-200",children:[(0,t.jsx)("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",className:"text-gray-500",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Keyboard shortcuts"]}),(0,t.jsx)("button",{onClick:()=>s(!1),"aria-label":"Close help",className:"text-gray-500 hover:text-gray-300 text-lg leading-none px-1",children:"×"})]}),(0,t.jsx)("div",{className:"px-4 py-3 max-h-[70vh] overflow-y-auto",children:M.map(e=>(0,t.jsxs)("div",{className:"mb-3 last:mb-0",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-[0.12em] text-gray-600 mb-1.5",children:e.group}),(0,t.jsx)("ul",{className:"space-y-1.5",children:e.items.map((e,a)=>(0,t.jsxs)("li",{className:"flex items-center gap-3 text-xs",children:[(0,t.jsx)("span",{className:"flex items-center gap-1",children:e.keys.map((e,a)=>(0,t.jsx)("kbd",{className:"text-[10px] font-mono border border-[#2a2a4a] rounded px-1.5 py-0.5 text-gray-400 bg-[#1a1a2a]/40",children:e},a))}),(0,t.jsx)("span",{className:"text-gray-400 flex-1",children:e.label})]},a))})]},e.group))}),(0,t.jsxs)("div",{className:"border-t border-[#2a2a4a] px-4 py-1.5 text-[10px] text-gray-600 flex items-center justify-between",children:[(0,t.jsxs)("span",{children:["Press ",(0,t.jsx)("kbd",{className:"font-mono",children:"?"})," to toggle"]}),(0,t.jsxs)("span",{children:["or ",(0,t.jsx)("kbd",{className:"font-mono",children:"esc"})," to close"]})]})]})]}):null}let S=[{hostname:"iZrj93pr",ip:"127.0.0.1",cpu_load_1min:3.05,cpu_cores:8,mem_used_gb:10.4,mem_total_gb:61.4,agent_count:30,status:"online",note:"本机"},{hostname:"iZ0jlc8",cpu_load_1min:.5,cpu_cores:4,mem_used_gb:1.2,mem_total_gb:8,agent_count:1,status:"online"},{hostname:"elaine-Sys",cpu_load_1min:null,cpu_cores:0,mem_used_gb:null,mem_total_gb:null,agent_count:2,status:"offline"}];function A({pct:e,label:a}){let s=e>=85?{fill:"#ef4444",track:"rgb(239 68 68 / 0.16)"}:e>=60?{fill:"#f59e0b",track:"rgb(245 158 11 / 0.16)"}:{fill:"#10b981",track:"rgb(16 185 129 / 0.16)"},r=Math.max(0,Math.min(100,e));return(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex justify-between text-[10px] text-[var(--fg-muted)] font-mono",children:[(0,t.jsx)("span",{children:a}),(0,t.jsxs)("span",{className:"tabular-nums",children:[Math.round(r),"%"]})]}),(0,t.jsx)("div",{className:"h-1.5 rounded-full overflow-hidden",style:{background:s.track},children:(0,t.jsx)("div",{className:"h-full transition-[width] duration-300 ease-out",style:{width:`${r}%`,background:s.fill}})})]})}function E(){let[e,a]=(0,r.useState)(!1);(0,r.useEffect)(()=>{try{"1"===localStorage.getItem("anet-servers-drawer")&&a(!0)}catch{}},[]);let s=S.filter(e=>"online"===e.status).length;return(0,t.jsxs)("aside",{className:"fixed right-0 top-20 z-40 hidden lg:flex flex-col rounded-l-xl border border-r-0 shadow-xl shadow-black/30 anet-fade-in",style:{background:"var(--bg-secondary)",borderColor:"var(--border)",width:e?296:40,maxHeight:"calc(100vh - 6rem)",transition:"width 200ms ease-out"},"aria-label":"Servers panel",children:[(0,t.jsxs)("button",{onClick:()=>a(e=>{let t=!e;try{localStorage.setItem("anet-servers-drawer",t?"1":"0")}catch{}return t}),"aria-expanded":e,"aria-label":e?"Collapse servers panel":"Expand servers panel",className:"flex items-center gap-2 px-2.5 py-2 border-b text-[11px] font-semibold tracking-wide select-none",style:{color:"var(--fg)",borderColor:"var(--border)"},children:[(0,t.jsxs)("svg",{className:"w-4 h-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"3",y:"4",width:"18",height:"6",rx:"1.5"}),(0,t.jsx)("rect",{x:"3",y:"14",width:"18",height:"6",rx:"1.5"}),(0,t.jsx)("circle",{cx:"7",cy:"7",r:"0.7",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"7",cy:"17",r:"0.7",fill:"currentColor"})]}),e&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"flex-1 text-left",children:"Servers"}),(0,t.jsxs)("span",{className:"text-[10px] text-[var(--fg-muted)] font-mono",children:[s,"/",S.length]})]})]}),e&&(0,t.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto px-2 py-2 space-y-2",children:[S.map(e=>{let a="offline"===e.status,s=null!=e.cpu_load_1min&&e.cpu_cores>0?e.cpu_load_1min/e.cpu_cores*100:null,r=null!=e.mem_used_gb&&null!=e.mem_total_gb&&e.mem_total_gb>0?e.mem_used_gb/e.mem_total_gb*100:null;return(0,t.jsxs)("div",{className:"rounded-lg border px-2.5 py-2 space-y-1.5",style:{background:"var(--bg)",borderColor:"var(--border)",opacity:a?.55:1},title:e.ip?`${e.hostname} \xb7 ${e.ip}`:e.hostname,children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex items-baseline gap-1.5",children:[(0,t.jsx)("span",{className:"font-mono text-[12px] font-semibold truncate",style:{color:"var(--fg)"},children:e.hostname}),e.note&&(0,t.jsxs)("span",{className:"text-[9px] text-[var(--fg-dim)]",children:["(",e.note,")"]})]}),(0,t.jsxs)("span",{className:"text-[10px] text-[var(--fg-muted)] font-mono tabular-nums shrink-0",children:[e.agent_count," agent",1===e.agent_count?"":"s"]})]}),!a&&null!=s&&(0,t.jsx)(A,{pct:s,label:`CPU ${e.cpu_load_1min.toFixed(2)}/${e.cpu_cores}`}),!a&&null!=r&&(0,t.jsx)(A,{pct:r,label:`RAM ${e.mem_used_gb.toFixed(1)}/${e.mem_total_gb.toFixed(1)}G`}),a&&(0,t.jsx)("div",{className:"text-[10px] text-[var(--fg-dim)] font-mono italic",children:"CPU n/a · RAM n/a · offline"})]},e.hostname)}),(0,t.jsxs)("div",{className:"pt-1 text-[9px] text-[var(--fg-dim)] font-mono text-center",children:["mock data · live when ",(0,t.jsx)("span",{className:"text-[var(--fg-muted)]",children:"/api/servers"})," ships"]})]})]})}let L=["/login"];e.s(["AppShell",0,function({children:e}){let s=(0,a.usePathname)();return L.includes(s)?(0,t.jsx)(t.Fragment,{children:e}):(0,t.jsxs)("div",{className:"flex min-h-screen",children:[(0,t.jsx)(m,{}),(0,t.jsxs)("main",{className:"flex-1 min-w-0 flex flex-col",children:[(0,t.jsx)(g,{}),(0,t.jsx)("div",{className:"flex-1 min-w-0",children:e})]}),(0,t.jsx)(N,{}),(0,t.jsx)(C,{}),(0,t.jsx)(E,{})]})}],22485)}]);
7
+ `,children:[(0,t.jsx)(x,{collapsed:h}),(0,t.jsx)("div",{className:"border-b border-[#2a2a4a]"}),!h&&k.length>0&&(0,t.jsxs)("div",{className:"px-2 py-3 border-b border-[#2a2a4a]",children:[(0,t.jsx)("div",{className:"px-3 text-[10px] text-gray-600 uppercase mb-2",children:"Networks"}),(0,t.jsx)("div",{className:"space-y-0.5 max-h-32 overflow-y-auto",children:k.map(e=>(0,t.jsxs)("button",{onClick:()=>{b(e.network_id),g(!1)},title:e.network_id,className:`w-full flex items-center gap-2 px-3 py-1.5 rounded-md text-xs transition-colors text-left ${f===e.network_id?"bg-cyan-500/10 text-cyan-300":"text-gray-500 hover:text-gray-300 hover:bg-[#1a1a2a]"}`,children:[(0,t.jsx)("span",{children:d[e.role||"member"]||"👤"}),(0,t.jsx)("span",{className:"truncate flex-1",children:e.network_name}),e.agentCount?(0,t.jsx)("span",{className:"shrink-0 tabular-nums text-[10px] text-gray-600",children:e.agentCount}):null]},e.network_id))})]}),(0,t.jsx)("div",{className:"pb-20",children:w}),(0,t.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 border-t border-[#2a2a4a] bg-[#0d0d1a]",children:[(0,t.jsxs)("button",{onClick:()=>{window.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,ctrlKey:!0}))},title:h?"Quick search (⌘K)":void 0,className:`w-full flex items-center text-[11px] text-gray-600 hover:text-gray-400 hover:bg-[#1a1a2a] transition-colors ${h?"justify-center px-0 py-2.5":"justify-between gap-2 px-5 py-2"}`,"aria-label":"Open command palette",children:[(0,t.jsxs)("span",{className:`flex items-center ${h?"":"gap-2"}`,children:[(0,t.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),!h&&"Quick search"]}),!h&&(0,t.jsx)("kbd",{className:"text-[10px] border border-current rounded px-1 py-0.5 opacity-60 font-mono",children:"⌘K"})]}),(0,t.jsxs)("button",{onClick:async()=>{await fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),sessionStorage.removeItem("anet_v3_auth"),window.location.assign("/login")},title:h?"Sign out":void 0,className:`w-full flex items-center text-xs text-gray-500 hover:text-red-400 hover:bg-red-500/5 transition-colors ${h?"justify-center px-0 py-2.5":"gap-3 px-5 py-3"}`,children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})}),!h&&"Sign out"]}),(0,t.jsxs)("div",{className:`flex items-center gap-2 ${h?"flex-col px-0 py-2":"px-3 py-2 justify-between"}`,children:[(0,t.jsx)(o.ThemeSwitcher,{compact:h}),(0,t.jsx)("button",{onClick:()=>u(!h),title:h?"Expand sidebar":"Collapse sidebar",className:"hidden lg:flex p-1.5 rounded text-gray-600 hover:text-gray-400 transition-colors","aria-label":h?"Expand sidebar":"Collapse sidebar",children:(0,t.jsx)("svg",{className:`w-4 h-4 transition-transform ${h?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})})})]})]})]})]})}let m=e=>fetch(e).then(e=>e.ok?e.json():{sessions:[]});function x({collapsed:e}){let{data:a}=(0,n.default)("/api/hub/status",m,{refreshInterval:1e4,dedupingInterval:4e3}),r=a?.sessions||[],l=r.filter(e=>e.status&&"offline"!==e.status).length,o=r.length;return e?(0,t.jsx)(s.default,{href:"/",className:"block px-3 py-4 flex justify-center hover:opacity-80 transition-opacity","aria-label":"Agent Network — home",children:(0,t.jsx)(u,{size:32})}):(0,t.jsxs)(s.default,{href:"/",className:"block px-4 py-4 flex items-center gap-3 hover:bg-[#11112a]/40 transition-colors rounded-r-xl","aria-label":"Agent Network — home",children:[(0,t.jsx)(u,{size:32}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-white text-[13px] font-semibold leading-tight",children:"Agent Network"}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-500 flex items-center gap-1.5 mt-0.5",children:[(0,t.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${l>0?"bg-emerald-400 anet-brand-pulse":"bg-gray-600"}`,"aria-hidden":!0}),0===o?(0,t.jsx)("span",{children:"waiting for agents"}):(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"text-gray-300 font-medium tabular-nums",children:l}),(0,t.jsxs)("span",{className:"text-gray-600",children:["/",o]})," online"]})]})]})]})}function u({size:e}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 32 32","aria-hidden":!0,className:"shrink-0",children:[(0,t.jsx)("circle",{cx:"16",cy:"16",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",opacity:"0.2",className:"text-cyan-400"}),(0,t.jsx)("line",{x1:"16",y1:"10",x2:"10",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.45",className:"text-cyan-400"}),(0,t.jsx)("line",{x1:"16",y1:"10",x2:"22",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.45",className:"text-cyan-400"}),(0,t.jsx)("line",{x1:"10",y1:"20",x2:"22",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.45",className:"text-cyan-400"}),(0,t.jsx)("circle",{cx:"16",cy:"10",r:"2.5",fill:"currentColor",className:"text-cyan-400"}),(0,t.jsx)("circle",{cx:"10",cy:"20",r:"2.5",fill:"currentColor",className:"text-green-400"}),(0,t.jsx)("circle",{cx:"22",cy:"20",r:"2.5",fill:"currentColor",className:"text-violet-400"})]})}let p=async e=>{let t=await fetch(e);if(!t.ok)throw Error(String(t.status));return t.json()};function g(){let e,a,{data:l,error:o}=(0,n.default)("/api/hub/stats",p,{refreshInterval:15e3,dedupingInterval:5e3,shouldRetryOnError:!1}),{data:i,error:c}=(0,n.default)("/api/hub/health",p,{refreshInterval:15e3,dedupingInterval:5e3,shouldRetryOnError:!1}),[d,h]=(0,r.useState)(()=>"1"===sessionStorage.getItem("anet-hb-dismissed"));if(d)return null;let m=o&&c||i&&!1===i.ok,x=l?.tasks?.by_status?.find(e=>"failed"===e.status)?.count||0,u=l?.nodes?.total===0,g=null;if(m?(e="red",a="CommHub unreachable — agents may be offline",g={label:"Open Settings",href:"/settings"}):x>0?(e="amber",a=`${x} task${x>1?"s":""} failed recently`,g={label:"Review failures",href:"/tasks?status=failed"}):(u?(e="green",a="Waiting for first agent"):(e="green",a="All systems go"),g=null),"green"===e&&!l)return null;let f={red:"bg-red-500/8 border-red-500/25 text-red-300",amber:"bg-amber-500/8 border-amber-500/25 text-amber-300",green:"bg-emerald-500/6 border-emerald-500/20 text-emerald-300"}[e],b={red:"bg-red-400",amber:"bg-amber-400 anet-brand-pulse",green:"bg-emerald-400"}[e];return(0,t.jsxs)("div",{role:"status",className:`anet-health-banner sticky top-0 z-30 border-b ${f} pl-14 pr-3 sm:px-6 py-1.5 text-[12px] flex items-center justify-between gap-3 backdrop-blur-sm`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${b}`,"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate",children:a})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[g&&(0,t.jsxs)(s.default,{href:g.href,className:"text-[11px] font-medium underline-offset-2 hover:underline opacity-90 hover:opacity-100 hidden sm:inline",children:[g.label," →"]}),g&&(0,t.jsx)(s.default,{href:g.href,"aria-label":g.label,className:"sm:hidden text-[11px] font-medium opacity-90 hover:opacity-100",children:"→"}),(0,t.jsx)("button",{onClick:()=>{h(!0);try{sessionStorage.setItem("anet-hb-dismissed","1")}catch{}},"aria-label":"Dismiss banner",className:"opacity-50 hover:opacity-100 leading-none px-1",children:"×"})]})]})}let f="anet-cmdk-recents";function b(){try{let e=sessionStorage.getItem(f);return e?JSON.parse(e):[]}catch{return[]}}function v(e){try{let t=b().filter(t=>t!==e);t.unshift(e),sessionStorage.setItem(f,JSON.stringify(t.slice(0,4)))}catch{}}function y(e,t){if(!t)return{score:0,indices:[]};let a=e.toLowerCase(),s=t.toLowerCase(),r=0,n=0,l=0,o=0,i=[];for(;r<a.length&&n<s.length;)a[r]===s[n]?(l+=2+o,o++,i.push(r),(0===r||/[\s·:_/-]/.test(a[r-1]))&&(l+=4),n++):o=0,r++;return n<s.length?{score:-1,indices:[]}:{score:l-.05*Math.max(0,a.length-s.length),indices:i}}function j({text:e,indices:a}){if(!a.length)return(0,t.jsx)(t.Fragment,{children:e});let s=new Set(a),r=Array.from(e);return(0,t.jsx)(t.Fragment,{children:r.map((e,a)=>s.has(a)?(0,t.jsx)("mark",{className:"anet-cmdk-mark",children:e},a):(0,t.jsx)("span",{children:e},a))})}function k({d:e}){return(0,t.jsx)("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}let w=[{id:"go-overview",title:"Go to Overview",hint:"Fleet at a glance",group:"Navigate",icon:(0,t.jsx)(k,{d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3"}),perform:e=>e.push("/")},{id:"go-tasks",title:"Go to Tasks",hint:"All task statuses",group:"Navigate",icon:(0,t.jsx)(k,{d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"}),perform:e=>e.push("/tasks")},{id:"go-tasks-failed",title:"Go to Failed tasks",hint:"Filter status=failed",group:"Navigate",icon:(0,t.jsx)(k,{d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}),perform:e=>e.push("/tasks?status=failed")},{id:"go-nodes",title:"Go to Nodes",hint:"Agent fleet",group:"Navigate",icon:(0,t.jsx)(k,{d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"}),perform:e=>e.push("/nodes")},{id:"go-messages",title:"Go to Messages",hint:"Inter-agent chat",group:"Navigate",icon:(0,t.jsx)(k,{d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"}),perform:e=>e.push("/messages")},{id:"go-networks",title:"Go to Networks",hint:"Manage networks",group:"Navigate",icon:(0,t.jsx)(k,{d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"}),perform:e=>e.push("/settings/networks")},{id:"go-logs",title:"Go to Audit Log",hint:"Register / login / actions",group:"Navigate",icon:(0,t.jsx)(k,{d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"}),perform:e=>e.push("/logs")},{id:"go-server-logs",title:"Go to Server Logs",hint:"CommHub stdout/stderr",group:"Navigate",icon:(0,t.jsx)(k,{d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"}),perform:e=>e.push("/server-logs")},{id:"go-admin",title:"Go to Admin",hint:"Server overview + broadcast",group:"Navigate",icon:(0,t.jsx)(k,{d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"}),perform:e=>e.push("/admin")},{id:"go-settings",title:"Go to Settings",hint:"Connection / Account / Resources",group:"Navigate",icon:(0,t.jsx)(k,{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),perform:e=>e.push("/settings")},{id:"act-toggle-theme",title:"Toggle theme",hint:"cyber ↔ light",group:"Actions",icon:(0,t.jsx)(k,{d:"M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"}),perform:()=>{let e=document.documentElement.getAttribute("data-theme")||"cyber",t="light"===e||"mint"===e?"cyber":"light";document.documentElement.setAttribute("data-theme",t);try{localStorage.setItem("anet-theme",t)}catch{}}},{id:"act-copy-url",title:"Copy current URL",hint:"page link to clipboard",group:"Actions",icon:(0,t.jsx)(k,{d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"}),perform:()=>{try{navigator.clipboard.writeText(window.location.href)}catch{}}},{id:"act-sign-out",title:"Sign out",hint:"clear session",group:"Actions",icon:(0,t.jsx)(k,{d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"}),perform:()=>{fetch("/api/auth/logout",{method:"POST"}).catch(()=>{});try{sessionStorage.removeItem("anet_v3_auth")}catch{}window.location.assign("/login")}},{id:"act-help",title:"Show keyboard shortcuts",hint:"press ? — works on mobile too",group:"Actions",icon:(0,t.jsx)(k,{d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),perform:()=>{window.dispatchEvent(new KeyboardEvent("keydown",{key:"?"}))}}];function N(){let e=(0,a.useRouter)(),[s,n]=(0,r.useState)(!1),[l,o]=(0,r.useState)(""),[i,c]=(0,r.useState)(0),d=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=e=>{if((e.metaKey||e.ctrlKey)&&"k"===e.key.toLowerCase()){e.preventDefault(),n(e=>!e);return}if("/"===e.key&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA"&&!s){e.preventDefault(),n(!0);return}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[s]),(0,r.useEffect)(()=>{s&&(o(""),c(0),setTimeout(()=>d.current?.focus(),50))},[s]);let[h,m]=(0,r.useState)([]);(0,r.useEffect)(()=>{s&&m(b())},[s]);let[x,u]=(0,r.useState)([]);(0,r.useEffect)(()=>{if(!s)return;let e=!1;return(async()=>{try{let[a,s]=await Promise.all([fetch("/api/hub/status").then(e=>e.ok?e.json():{sessions:[]}),fetch("/api/hub/tasks?limit=20").then(e=>e.ok?e.json():{tasks:[]})]);if(e)return;let r=(a.sessions||[]).filter(e=>e.alias).slice(0,20).map(e=>({id:`agent-${e.alias}`,title:`Go to agent ${e.alias}`,hint:`${e.agent||"agent"} \xb7 ${e.status||"unknown"}`,group:"Agents",icon:(0,t.jsx)(k,{d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"}),perform:t=>t.push(`/node?alias=${encodeURIComponent(e.alias)}`)})),n=(s.tasks||[]).filter(e=>e.task_id).slice(0,15).map(e=>({id:`task-${e.task_id}`,title:`Open task: ${(e.content||e.task_id||"").slice(0,50)}`,hint:`${e.from_name||"?"} → ${e.to_name||"?"} \xb7 ${e.status||""}`,group:"Tasks",icon:(0,t.jsx)(k,{d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"}),perform:t=>t.push(`/tasks/${encodeURIComponent(e.task_id)}`)}));u([...r,...n])}catch{}})(),()=>{e=!0}},[s]);let p=(0,r.useMemo)(()=>{let e=[...w,...x];if(!l.trim()){let t=h.map(t=>e.find(e=>e.id===t)).filter(e=>!!e).map(e=>({...e,group:"Recents"})),a=new Set(h);return[...t,...w.filter(e=>!a.has(e.id))]}let t=e.map(e=>{let t=y(e.title,l),a=e.hint?y(e.hint,l):{score:-1,indices:[]},s=y(e.id,l);return{c:e,score:Math.max(t.score>=0?+t.score:-1/0,a.score>=0?.6*a.score:-1/0,s.score>=0?.3*s.score:-1/0),_titleHi:t.score>=0?t.indices:[],_hintHi:a.score>=0?a.indices:[]}}).filter(e=>e.score>-1/0);return t.sort((e,t)=>t.score-e.score),t.map(e=>({...e.c,_titleHi:e._titleHi,_hintHi:e._hintHi}))},[l,h,x]);if((0,r.useEffect)(()=>{i>=p.length&&c(0)},[p.length,i]),!s)return null;let g={};for(let e of p)(g[e.group]||=[]).push(e);let f=0;return(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Command palette",className:"anet-cmdk fixed inset-0 z-[100] flex items-start justify-center pt-[10vh] sm:pt-[15vh] px-4",onClick:()=>n(!1),onKeyDown:t=>{if("Escape"===t.key)return void n(!1);if("ArrowDown"===t.key){t.preventDefault(),c(e=>Math.min(e+1,p.length-1));return}if("ArrowUp"===t.key){t.preventDefault(),c(e=>Math.max(e-1,0));return}if("Enter"===t.key){t.preventDefault();let a=p[i];a&&(v(a.id),a.perform(e),n(!1))}},children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm","aria-hidden":!0}),(0,t.jsxs)("div",{className:"relative w-full max-w-xl rounded-xl border border-[#2a2a4a] bg-[#0d0d1a] shadow-2xl shadow-black/40 overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-[#2a2a4a] px-3 py-2.5",children:[(0,t.jsx)("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",className:"text-gray-500 shrink-0",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),(0,t.jsx)("input",{ref:d,value:l,onChange:e=>{o(e.target.value),c(0)},placeholder:"Type a command or search…",className:"flex-1 bg-transparent text-sm text-gray-200 placeholder-gray-600 focus:outline-none"}),(0,t.jsx)("kbd",{className:"text-[10px] text-gray-600 border border-[#2a2a4a] rounded px-1.5 py-0.5 font-mono",children:"esc"})]}),(0,t.jsx)("div",{className:"max-h-[60vh] overflow-y-auto py-2",children:0===p.length?(0,t.jsxs)("div",{className:"px-4 py-8 text-center text-xs text-gray-600",children:['No commands match "',l,'"']}):Object.entries(g).map(([a,s])=>(0,t.jsxs)("div",{className:"mb-2 last:mb-0",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-[0.12em] text-gray-600 px-3 py-1",children:a}),s.map(a=>{let s=f++,r=s===i;return(0,t.jsxs)("button",{onMouseEnter:()=>c(s),onClick:()=>{v(a.id),a.perform(e),n(!1)},className:`anet-cmdk-row w-full flex items-center gap-3 px-3 py-2 text-left text-sm ${r?"bg-cyan-500/10 text-cyan-300":"text-gray-300 hover:bg-[#1a1a2a]/50"}`,children:[(0,t.jsx)("span",{className:r?"text-cyan-400":"text-gray-500",children:a.icon}),(0,t.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"block truncate",children:(0,t.jsx)(j,{text:a.title,indices:a._titleHi||[]})}),a.hint&&(0,t.jsx)("span",{className:"block text-[11px] text-gray-600 truncate",children:(0,t.jsx)(j,{text:a.hint,indices:a._hintHi||[]})})]}),r&&(0,t.jsx)("span",{className:"text-[10px] text-gray-500",children:"↵"})]},a.id)})]},a))}),(0,t.jsxs)("div",{className:"border-t border-[#2a2a4a] px-3 py-1.5 flex items-center justify-between text-[10px] text-gray-600",children:[(0,t.jsxs)("span",{className:"flex items-center gap-3",children:[(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"font-mono",children:"↑↓"})," navigate"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"font-mono",children:"↵"})," select"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"font-mono",children:"esc"})," close"]})]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"font-mono",children:"⌘K"})," toggle"]})]})]})]})}let M=[{group:"Global",items:[{keys:["⌘","K"],label:"Open command palette (also Ctrl+K)"},{keys:["/"],label:"Open command palette"},{keys:["?"],label:"Toggle this help overlay"},{keys:["Esc"],label:"Close any open modal"}]},{group:"Navigate (vim-style)",items:[{keys:["g","o"],label:"Go to Overview"},{keys:["g","t"],label:"Go to Tasks"},{keys:["g","n"],label:"Go to Nodes"},{keys:["g","m"],label:"Go to Messages"},{keys:["g","w"],label:"Go to Networks"},{keys:["g","a"],label:"Go to Admin"},{keys:["g","l"],label:"Go to Audit Log"},{keys:["g","s"],label:"Go to Settings"}]},{group:"Command palette",items:[{keys:["↑","↓"],label:"Move selection"},{keys:["↵"],label:"Activate selected command"},{keys:["type"],label:"Filter — searches commands, agents, tasks"}]}],C={o:"/",t:"/tasks",n:"/nodes",m:"/messages",w:"/settings/networks",a:"/admin",l:"/logs",s:"/settings"};function _(){let[e,s]=(0,r.useState)(!1),n=(0,a.useRouter)(),l=(0,r.useRef)(0);return((0,r.useEffect)(()=>{let t=t=>{let a=document.activeElement?.tagName,r="INPUT"===a||"TEXTAREA"===a||document.activeElement?.isContentEditable;if("?"===t.key&&!r){t.preventDefault(),s(e=>!e);return}if("Escape"===t.key&&e&&s(!1),!r&&!t.metaKey&&!t.ctrlKey&&!t.altKey){if("g"===t.key){l.current=Date.now();return}if(Date.now()-l.current<1500){let e=C[t.key.toLowerCase()];e&&(t.preventDefault(),l.current=0,n.push(e))}}};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,n]),e)?(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",className:"anet-help fixed inset-0 z-[101] flex items-center justify-center px-4",onClick:()=>s(!1),children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm","aria-hidden":!0}),(0,t.jsxs)("div",{className:"relative w-full max-w-md rounded-xl border border-[#2a2a4a] bg-[#0d0d1a] shadow-2xl shadow-black/40 overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-[#2a2a4a] px-4 py-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-gray-200",children:[(0,t.jsx)("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",className:"text-gray-500",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Keyboard shortcuts"]}),(0,t.jsx)("button",{onClick:()=>s(!1),"aria-label":"Close help",className:"text-gray-500 hover:text-gray-300 text-lg leading-none px-1",children:"×"})]}),(0,t.jsx)("div",{className:"px-4 py-3 max-h-[70vh] overflow-y-auto",children:M.map(e=>(0,t.jsxs)("div",{className:"mb-3 last:mb-0",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-[0.12em] text-gray-600 mb-1.5",children:e.group}),(0,t.jsx)("ul",{className:"space-y-1.5",children:e.items.map((e,a)=>(0,t.jsxs)("li",{className:"flex items-center gap-3 text-xs",children:[(0,t.jsx)("span",{className:"flex items-center gap-1",children:e.keys.map((e,a)=>(0,t.jsx)("kbd",{className:"text-[10px] font-mono border border-[#2a2a4a] rounded px-1.5 py-0.5 text-gray-400 bg-[#1a1a2a]/40",children:e},a))}),(0,t.jsx)("span",{className:"text-gray-400 flex-1",children:e.label})]},a))})]},e.group))}),(0,t.jsxs)("div",{className:"border-t border-[#2a2a4a] px-4 py-1.5 text-[10px] text-gray-600 flex items-center justify-between",children:[(0,t.jsxs)("span",{children:["Press ",(0,t.jsx)("kbd",{className:"font-mono",children:"?"})," to toggle"]}),(0,t.jsxs)("span",{children:["or ",(0,t.jsx)("kbd",{className:"font-mono",children:"esc"})," to close"]})]})]})]}):null}let S=async e=>{let t=await fetch(e);if(401===t.status)throw window.location.assign("/login"),Error("unauthorized");if(!t.ok)throw Error(`hub ${t.status}`);return t.json()};function E({pct:e,label:a}){let s=e>=85?{fill:"#ef4444",track:"rgb(239 68 68 / 0.16)"}:e>=60?{fill:"#f59e0b",track:"rgb(245 158 11 / 0.16)"}:{fill:"#10b981",track:"rgb(16 185 129 / 0.16)"},r=Math.max(0,Math.min(100,e));return(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("div",{className:"flex justify-between text-[10px] text-[var(--fg-muted)] font-mono",children:[(0,t.jsx)("span",{children:a}),(0,t.jsxs)("span",{className:"tabular-nums",children:[Math.round(r),"%"]})]}),(0,t.jsx)("div",{className:"h-1.5 rounded-full overflow-hidden",style:{background:s.track},children:(0,t.jsx)("div",{className:"h-full transition-[width] duration-300 ease-out",style:{width:`${r}%`,background:s.fill}})})]})}function A(){let[e,a]=(0,r.useState)(!1);(0,r.useEffect)(()=>{try{"1"===localStorage.getItem("anet-servers-drawer")&&a(!0)}catch{}},[]);let{data:s,error:l}=(0,n.default)(e?"/api/hub/servers":null,S,{refreshInterval:5e3,dedupingInterval:3e3}),o=s?.servers??[],i=s?.unavailable===!0,c=o.filter(e=>"online"===e.status).length,d=e&&!s&&!l;return(0,t.jsxs)("aside",{className:"fixed right-0 top-20 z-40 hidden lg:flex flex-col rounded-l-xl border border-r-0 shadow-xl shadow-black/30 anet-fade-in",style:{background:"var(--bg-secondary)",borderColor:"var(--border)",width:e?296:40,maxHeight:"calc(100vh - 6rem)",transition:"width 200ms ease-out"},"aria-label":"Servers panel",children:[(0,t.jsxs)("button",{onClick:()=>a(e=>{let t=!e;try{localStorage.setItem("anet-servers-drawer",t?"1":"0")}catch{}return t}),"aria-expanded":e,"aria-label":e?"Collapse servers panel":"Expand servers panel",className:"flex items-center gap-2 px-2.5 py-2 border-b text-[11px] font-semibold tracking-wide select-none",style:{color:"var(--fg)",borderColor:"var(--border)"},children:[(0,t.jsxs)("svg",{className:"w-4 h-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"3",y:"4",width:"18",height:"6",rx:"1.5"}),(0,t.jsx)("rect",{x:"3",y:"14",width:"18",height:"6",rx:"1.5"}),(0,t.jsx)("circle",{cx:"7",cy:"7",r:"0.7",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"7",cy:"17",r:"0.7",fill:"currentColor"})]}),e&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"flex-1 text-left",children:"Servers"}),(0,t.jsxs)("span",{className:"text-[10px] text-[var(--fg-muted)] font-mono",children:[c,"/",o.length]})]})]}),e&&(0,t.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto px-2 py-2 space-y-2","data-servers-body":!0,children:[d&&(0,t.jsx)("div",{className:"text-[10px] text-[var(--fg-muted)] font-mono text-center py-4",children:"loading servers…"}),l&&!s&&(0,t.jsx)("div",{className:"rounded-md border px-2.5 py-2 text-[10px] font-mono",style:{background:"rgb(239 68 68 / 0.06)",borderColor:"rgb(239 68 68 / 0.25)",color:"#ef4444"},children:"hub unreachable · retrying every 5s"}),i&&(0,t.jsxs)("div",{className:"text-[10px] text-[var(--fg-muted)] font-mono text-center py-3 leading-relaxed",children:["host telemetry not available",(0,t.jsx)("br",{}),(0,t.jsx)("span",{className:"text-[var(--fg-dim)]",children:"upgrade commhub-server ≥ 0.8.1-preview.2"})]}),!d&&!l&&!i&&0===o.length&&(0,t.jsx)("div",{className:"text-[10px] text-[var(--fg-muted)] font-mono text-center py-4",children:"no servers reporting yet"}),o.map(e=>{let a="offline"===e.status,s=null!=e.cpu_load_1min&&e.cpu_cores>0?e.cpu_load_1min/e.cpu_cores*100:null,r=null!=e.mem_used_gb&&null!=e.mem_total_gb&&e.mem_total_gb>0?e.mem_used_gb/e.mem_total_gb*100:null;return(0,t.jsxs)("div",{className:"rounded-lg border px-2.5 py-2 space-y-1.5",style:{background:"var(--bg)",borderColor:"var(--border)",opacity:a?.55:1},title:e.ip?`${e.hostname} \xb7 ${e.ip}`:e.hostname,children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex items-baseline gap-1.5",children:[(0,t.jsx)("span",{className:"font-mono text-[12px] font-semibold truncate",style:{color:"var(--fg)"},children:e.hostname}),e.note&&(0,t.jsxs)("span",{className:"text-[9px] text-[var(--fg-dim)]",children:["(",e.note,")"]})]}),(0,t.jsxs)("span",{className:"text-[10px] text-[var(--fg-muted)] font-mono tabular-nums shrink-0",children:[e.agent_count," agent",1===e.agent_count?"":"s"]})]}),!a&&null!=s&&(0,t.jsx)(E,{pct:s,label:`CPU ${e.cpu_load_1min.toFixed(2)}/${e.cpu_cores}`}),!a&&null!=r&&(0,t.jsx)(E,{pct:r,label:`RAM ${e.mem_used_gb.toFixed(1)}/${e.mem_total_gb.toFixed(1)}G`}),a&&(0,t.jsx)("div",{className:"text-[10px] text-[var(--fg-dim)] font-mono italic",children:"CPU n/a · RAM n/a · offline"})]},e.hostname)}),o.length>0&&(0,t.jsx)("div",{className:"pt-1 text-[9px] text-[var(--fg-dim)] font-mono text-center",children:"live · refreshing every 5s"})]})]})}let L=["/login"];e.s(["AppShell",0,function({children:e}){let s=(0,a.usePathname)();return L.includes(s)?(0,t.jsx)(t.Fragment,{children:e}):(0,t.jsxs)("div",{className:"flex min-h-screen",children:[(0,t.jsx)(h,{}),(0,t.jsxs)("main",{className:"flex-1 min-w-0 flex flex-col",children:[(0,t.jsx)(g,{}),(0,t.jsx)("div",{className:"flex-1 min-w-0",children:e})]}),(0,t.jsx)(N,{}),(0,t.jsx)(_,{}),(0,t.jsx)(A,{})]})}],22485)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,70286,e=>{"use strict";e.s(["DASHBOARD_VERSION",0,"0.4.6-preview.27"],70286)},48941,e=>{"use strict";var t=e.i(22381),r=e.i(23910),a=e.i(70286);e.s(["default",0,function(){let[e,s]=(0,r.useState)("login"),[n,o]=(0,r.useState)(""),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(!1),[x,g]=(0,r.useState)(""),[h,m]=(0,r.useState)(!1),u=async t=>{t.preventDefault(),m(!0),g("");try{let t=await fetch("/api/auth/v3",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,username:n,password:i})}),r=await t.json();if(r.ok){r.token&&sessionStorage.setItem("anet_v3_auth",JSON.stringify({user:r.user,token:r.token,networks:r.networks||[],currentNetwork:r.network_id||r.networks?.[0]?.network_id||""})),window.location.assign("/");return}g(r.error||"Login failed")}catch{g("Connection failed")}m(!1)};return(0,t.jsxs)("main",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 font-mono flex items-center justify-center relative overflow-hidden px-4 py-10 sm:py-16",children:[(0,t.jsx)("div",{className:"absolute inset-0 pointer-events-none anet-login-bg","aria-hidden":!0}),(0,t.jsxs)("div",{className:"relative w-full max-w-sm",children:[(0,t.jsxs)("div",{className:"text-center mb-7",children:[(0,t.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 mb-4 rounded-2xl bg-[#111128] border border-[#2a2a4a] anet-login-mark",children:(0,t.jsxs)("svg",{className:"w-9 h-9",viewBox:"0 0 32 32","aria-hidden":!0,children:[(0,t.jsx)("circle",{cx:"16",cy:"16",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",opacity:"0.25",className:"text-cyan-400 anet-login-mark-ring"}),(0,t.jsx)("line",{x1:"16",y1:"10",x2:"10",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.5",className:"text-cyan-400 anet-login-mark-edge"}),(0,t.jsx)("line",{x1:"16",y1:"10",x2:"22",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.5",className:"text-cyan-400 anet-login-mark-edge"}),(0,t.jsx)("line",{x1:"10",y1:"20",x2:"22",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.5",className:"text-cyan-400 anet-login-mark-edge"}),(0,t.jsx)("circle",{cx:"16",cy:"10",r:"3",fill:"currentColor",className:"text-cyan-400 anet-login-mark-node-a"}),(0,t.jsx)("circle",{cx:"10",cy:"20",r:"3",fill:"currentColor",className:"text-green-400 anet-login-mark-node-b"}),(0,t.jsx)("circle",{cx:"22",cy:"20",r:"3",fill:"currentColor",className:"text-violet-400 anet-login-mark-node-c"})]})}),(0,t.jsx)("h1",{className:"text-[22px] sm:text-2xl font-semibold text-white tracking-tight",children:"Agent Network"}),(0,t.jsx)("p",{className:"text-[13px] text-gray-500 mt-1.5 leading-snug",children:"login"===e?(0,t.jsxs)(t.Fragment,{children:["Welcome back · ",(0,t.jsx)("span",{className:"text-gray-600",children:"Tasks · Mesh · Messages"})]}):(0,t.jsxs)(t.Fragment,{children:["Create your account · ",(0,t.jsx)("span",{className:"text-gray-600",children:"Free preview · no credit card"})]})})]}),(0,t.jsx)("div",{className:"flex rounded-lg border border-[#2a2a4a] bg-[#111128] p-1 mb-4",children:["login","register"].map(r=>(0,t.jsx)("button",{type:"button",onClick:()=>{s(r),g("")},className:`flex-1 rounded-md px-3 py-2 text-sm transition-colors ${e===r?"bg-cyan-500/10 text-cyan-300":"text-gray-500 hover:text-gray-200"}`,children:"login"===r?"Sign in":"Register"},r))}),(0,t.jsxs)("form",{onSubmit:u,className:"border border-[#2a2a4a] bg-[#111128]/80 backdrop-blur-sm rounded-xl p-6 shadow-2xl shadow-black/30",children:[(0,t.jsx)("label",{htmlFor:"username",className:"block text-xs text-gray-500 mb-2 uppercase tracking-wider",children:"Username"}),(0,t.jsx)("input",{id:"username",type:"text",value:n,onChange:e=>o(e.target.value),autoFocus:!0,placeholder:"Enter username",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-4 py-3 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:ring-1 focus:ring-cyan-500/20 focus:outline-none transition-all mb-4"}),(0,t.jsx)("label",{htmlFor:"password",className:"block text-xs text-gray-500 mb-2 uppercase tracking-wider",children:"Password"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("input",{id:"password",type:c?"text":"password",value:i,onChange:e=>l(e.target.value),placeholder:"Enter password",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-4 pr-11 py-3 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:ring-1 focus:ring-cyan-500/20 focus:outline-none transition-all"}),(0,t.jsx)("button",{type:"button",onClick:()=>d(e=>!e),tabIndex:-1,"aria-label":c?"Hide password":"Show password",className:"absolute inset-y-0 right-0 flex items-center px-3 text-gray-600 hover:text-gray-300 transition-colors",children:c?(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),(0,t.jsx)("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})})]}),x&&(0,t.jsx)("div",{className:"mt-3 text-sm text-red-300 bg-red-500/5 border border-red-500/10 rounded-lg px-3 py-2",children:x}),(0,t.jsxs)("button",{type:"submit",disabled:h||!i||!n.trim(),className:"mt-5 w-full flex items-center justify-center gap-2 px-4 py-3 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-lg transition-all shadow-lg shadow-cyan-500/10 hover:shadow-cyan-500/20 disabled:shadow-none",children:[h&&(0,t.jsxs)("svg",{"aria-hidden":!0,className:"w-4 h-4 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",opacity:"0.25"}),(0,t.jsx)("path",{d:"M4 12a8 8 0 018-8",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]}),(0,t.jsx)("span",{children:h?"login"===e?"Signing in…":"Registering…":"login"===e?"Sign in":"Create account"})]})]}),(0,t.jsxs)("p",{className:"text-center text-[11px] text-gray-700 mt-6",children:["Sleep2AGI · Apache-2.0 · ",(0,t.jsx)("a",{href:"https://anet.sh",className:"hover:text-gray-500 transition-colors",children:"anet.sh"}),(0,t.jsx)("span",{className:"mx-1 text-gray-800",children:"·"}),(0,t.jsxs)("span",{className:"font-mono",title:"@sleep2agi/agent-network-dashboard",children:["v",a.DASHBOARD_VERSION]})]})]})]})}])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,70286,e=>{"use strict";e.s(["DASHBOARD_VERSION",0,"0.4.6-preview.29"],70286)},48941,e=>{"use strict";var t=e.i(22381),r=e.i(23910),a=e.i(70286);e.s(["default",0,function(){let[e,s]=(0,r.useState)("login"),[n,o]=(0,r.useState)(""),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(!1),[x,g]=(0,r.useState)(""),[h,m]=(0,r.useState)(!1),u=async t=>{t.preventDefault(),m(!0),g("");try{let t=await fetch("/api/auth/v3",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,username:n,password:i})}),r=await t.json();if(r.ok){r.token&&sessionStorage.setItem("anet_v3_auth",JSON.stringify({user:r.user,token:r.token,networks:r.networks||[],currentNetwork:r.network_id||r.networks?.[0]?.network_id||""})),window.location.assign("/");return}g(r.error||"Login failed")}catch{g("Connection failed")}m(!1)};return(0,t.jsxs)("main",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 font-mono flex items-center justify-center relative overflow-hidden px-4 py-10 sm:py-16",children:[(0,t.jsx)("div",{className:"absolute inset-0 pointer-events-none anet-login-bg","aria-hidden":!0}),(0,t.jsxs)("div",{className:"relative w-full max-w-sm",children:[(0,t.jsxs)("div",{className:"text-center mb-7",children:[(0,t.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 mb-4 rounded-2xl bg-[#111128] border border-[#2a2a4a] anet-login-mark",children:(0,t.jsxs)("svg",{className:"w-9 h-9",viewBox:"0 0 32 32","aria-hidden":!0,children:[(0,t.jsx)("circle",{cx:"16",cy:"16",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",opacity:"0.25",className:"text-cyan-400 anet-login-mark-ring"}),(0,t.jsx)("line",{x1:"16",y1:"10",x2:"10",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.5",className:"text-cyan-400 anet-login-mark-edge"}),(0,t.jsx)("line",{x1:"16",y1:"10",x2:"22",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.5",className:"text-cyan-400 anet-login-mark-edge"}),(0,t.jsx)("line",{x1:"10",y1:"20",x2:"22",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.5",className:"text-cyan-400 anet-login-mark-edge"}),(0,t.jsx)("circle",{cx:"16",cy:"10",r:"3",fill:"currentColor",className:"text-cyan-400 anet-login-mark-node-a"}),(0,t.jsx)("circle",{cx:"10",cy:"20",r:"3",fill:"currentColor",className:"text-green-400 anet-login-mark-node-b"}),(0,t.jsx)("circle",{cx:"22",cy:"20",r:"3",fill:"currentColor",className:"text-violet-400 anet-login-mark-node-c"})]})}),(0,t.jsx)("h1",{className:"text-[22px] sm:text-2xl font-semibold text-white tracking-tight",children:"Agent Network"}),(0,t.jsx)("p",{className:"text-[13px] text-gray-500 mt-1.5 leading-snug",children:"login"===e?(0,t.jsxs)(t.Fragment,{children:["Welcome back · ",(0,t.jsx)("span",{className:"text-gray-600",children:"Tasks · Mesh · Messages"})]}):(0,t.jsxs)(t.Fragment,{children:["Create your account · ",(0,t.jsx)("span",{className:"text-gray-600",children:"Free preview · no credit card"})]})})]}),(0,t.jsx)("div",{className:"flex rounded-lg border border-[#2a2a4a] bg-[#111128] p-1 mb-4",children:["login","register"].map(r=>(0,t.jsx)("button",{type:"button",onClick:()=>{s(r),g("")},className:`flex-1 rounded-md px-3 py-2 text-sm transition-colors ${e===r?"bg-cyan-500/10 text-cyan-300":"text-gray-500 hover:text-gray-200"}`,children:"login"===r?"Sign in":"Register"},r))}),(0,t.jsxs)("form",{onSubmit:u,className:"border border-[#2a2a4a] bg-[#111128]/80 backdrop-blur-sm rounded-xl p-6 shadow-2xl shadow-black/30",children:[(0,t.jsx)("label",{htmlFor:"username",className:"block text-xs text-gray-500 mb-2 uppercase tracking-wider",children:"Username"}),(0,t.jsx)("input",{id:"username",type:"text",value:n,onChange:e=>o(e.target.value),autoFocus:!0,placeholder:"Enter username",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-4 py-3 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:ring-1 focus:ring-cyan-500/20 focus:outline-none transition-all mb-4"}),(0,t.jsx)("label",{htmlFor:"password",className:"block text-xs text-gray-500 mb-2 uppercase tracking-wider",children:"Password"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("input",{id:"password",type:c?"text":"password",value:i,onChange:e=>l(e.target.value),placeholder:"Enter password",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-4 pr-11 py-3 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:ring-1 focus:ring-cyan-500/20 focus:outline-none transition-all"}),(0,t.jsx)("button",{type:"button",onClick:()=>d(e=>!e),tabIndex:-1,"aria-label":c?"Hide password":"Show password",className:"absolute inset-y-0 right-0 flex items-center px-3 text-gray-600 hover:text-gray-300 transition-colors",children:c?(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),(0,t.jsx)("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})})]}),x&&(0,t.jsx)("div",{className:"mt-3 text-sm text-red-300 bg-red-500/5 border border-red-500/10 rounded-lg px-3 py-2",children:x}),(0,t.jsxs)("button",{type:"submit",disabled:h||!i||!n.trim(),className:"mt-5 w-full flex items-center justify-center gap-2 px-4 py-3 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-lg transition-all shadow-lg shadow-cyan-500/10 hover:shadow-cyan-500/20 disabled:shadow-none",children:[h&&(0,t.jsxs)("svg",{"aria-hidden":!0,className:"w-4 h-4 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",opacity:"0.25"}),(0,t.jsx)("path",{d:"M4 12a8 8 0 018-8",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]}),(0,t.jsx)("span",{children:h?"login"===e?"Signing in…":"Registering…":"login"===e?"Sign in":"Create account"})]})]}),(0,t.jsxs)("p",{className:"text-center text-[11px] text-gray-700 mt-6",children:["Sleep2AGI · Apache-2.0 · ",(0,t.jsx)("a",{href:"https://anet.sh",className:"hover:text-gray-500 transition-colors",children:"anet.sh"}),(0,t.jsx)("span",{className:"mx-1 text-gray-800",children:"·"}),(0,t.jsxs)("span",{className:"font-mono",title:"@sleep2agi/agent-network-dashboard",children:["v",a.DASHBOARD_VERSION]})]})]})]})}])}]);
package/.next/trace CHANGED
@@ -1,2 +1,2 @@
1
- [{"name":"generate-buildid","duration":248,"timestamp":11832262271,"id":4,"parentId":1,"tags":{},"startTime":1778819804509,"traceId":"cc16e53cdf6464d7"},{"name":"load-custom-routes","duration":691,"timestamp":11832262654,"id":5,"parentId":1,"tags":{},"startTime":1778819804509,"traceId":"cc16e53cdf6464d7"},{"name":"create-dist-dir","duration":767,"timestamp":11832263389,"id":6,"parentId":1,"tags":{},"startTime":1778819804510,"traceId":"cc16e53cdf6464d7"},{"name":"clean","duration":442,"timestamp":11832265138,"id":7,"parentId":1,"tags":{},"startTime":1778819804511,"traceId":"cc16e53cdf6464d7"},{"name":"discover-routes","duration":8825,"timestamp":11832347110,"id":8,"parentId":1,"tags":{},"startTime":1778819804593,"traceId":"cc16e53cdf6464d7"},{"name":"create-root-mapping","duration":146,"timestamp":11832356018,"id":9,"parentId":1,"tags":{},"startTime":1778819804602,"traceId":"cc16e53cdf6464d7"},{"name":"generate-route-types","duration":38363,"timestamp":11832358594,"id":10,"parentId":1,"tags":{},"startTime":1778819804605,"traceId":"cc16e53cdf6464d7"},{"name":"public-dir-conflict-check","duration":105,"timestamp":11832397134,"id":11,"parentId":1,"tags":{},"startTime":1778819804643,"traceId":"cc16e53cdf6464d7"},{"name":"generate-routes-manifest","duration":4338,"timestamp":11832397352,"id":12,"parentId":1,"tags":{},"startTime":1778819804644,"traceId":"cc16e53cdf6464d7"},{"name":"run-turbopack","duration":5026414,"timestamp":11832406774,"id":14,"parentId":1,"tags":{},"startTime":1778819804653,"traceId":"cc16e53cdf6464d7"},{"name":"turbopack-build-events","duration":107,"timestamp":11832724804,"id":15,"parentId":1,"tags":{},"startTime":1778819804971,"traceId":"cc16e53cdf6464d7"},{"name":"run-typescript","duration":8182650,"timestamp":11837441137,"id":16,"parentId":1,"tags":{},"startTime":1778819809687,"traceId":"cc16e53cdf6464d7"},{"name":"generate-required-server-files","duration":2790,"timestamp":11845625370,"id":18,"parentId":1,"tags":{},"startTime":1778819817872,"traceId":"cc16e53cdf6464d7"},{"name":"check-static-error-page","duration":15307,"timestamp":11845786076,"id":20,"parentId":19,"tags":{},"startTime":1778819818032,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":445415,"timestamp":11845804477,"id":62,"parentId":22,"tags":{},"startTime":1778819818051,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":460853,"timestamp":11845789226,"id":22,"parentId":19,"tags":{"page":"/_global-error"},"startTime":1778819818036,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":494595,"timestamp":11845805024,"id":66,"parentId":28,"tags":{},"startTime":1778819818051,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":506925,"timestamp":11845792793,"id":28,"parentId":19,"tags":{"page":"/api/hub/audit-log"},"startTime":1778819818039,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":505059,"timestamp":11845805483,"id":69,"parentId":32,"tags":{},"startTime":1778819818052,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":517034,"timestamp":11845793586,"id":32,"parentId":19,"tags":{"page":"/api/hub/health"},"startTime":1778819818040,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":523421,"timestamp":11845805557,"id":70,"parentId":33,"tags":{},"startTime":1778819818052,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":535330,"timestamp":11845793745,"id":33,"parentId":19,"tags":{"page":"/api/hub/inbox"},"startTime":1778819818040,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":529544,"timestamp":11845805635,"id":71,"parentId":34,"tags":{},"startTime":1778819818052,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":541364,"timestamp":11845793902,"id":34,"parentId":19,"tags":{"page":"/api/hub/license"},"startTime":1778819818040,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":536895,"timestamp":11845805664,"id":72,"parentId":35,"tags":{},"startTime":1778819818052,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":548546,"timestamp":11845794095,"id":35,"parentId":19,"tags":{"page":"/api/hub/messages"},"startTime":1778819818040,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":540283,"timestamp":11845805774,"id":73,"parentId":36,"tags":{},"startTime":1778819818052,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":551508,"timestamp":11845794614,"id":36,"parentId":19,"tags":{"page":"/api/hub/networks"},"startTime":1778819818041,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":544426,"timestamp":11845805801,"id":74,"parentId":37,"tags":{},"startTime":1778819818052,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":555481,"timestamp":11845794799,"id":37,"parentId":19,"tags":{"page":"/api/hub/nodes"},"startTime":1778819818041,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":550508,"timestamp":11845805814,"id":75,"parentId":38,"tags":{},"startTime":1778819818052,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":561420,"timestamp":11845794970,"id":38,"parentId":19,"tags":{"page":"/api/hub/register"},"startTime":1778819818041,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":552879,"timestamp":11845805825,"id":76,"parentId":39,"tags":{},"startTime":1778819818052,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":563620,"timestamp":11845795119,"id":39,"parentId":19,"tags":{"page":"/api/hub/send"},"startTime":1778819818041,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":556424,"timestamp":11845805312,"id":68,"parentId":30,"tags":{},"startTime":1778819818052,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":568630,"timestamp":11845793150,"id":30,"parentId":19,"tags":{"page":"/api/hub/broadcast"},"startTime":1778819818039,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":556625,"timestamp":11845805834,"id":77,"parentId":40,"tags":{},"startTime":1778819818052,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":567260,"timestamp":11845795241,"id":40,"parentId":19,"tags":{"page":"/api/hub/server-logs"},"startTime":1778819818042,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":560400,"timestamp":11845805866,"id":79,"parentId":42,"tags":{},"startTime":1778819818052,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":570825,"timestamp":11845795479,"id":42,"parentId":19,"tags":{"page":"/api/hub/stats"},"startTime":1778819818042,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":564245,"timestamp":11845805844,"id":78,"parentId":41,"tags":{},"startTime":1778819818052,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":574777,"timestamp":11845795356,"id":41,"parentId":19,"tags":{"page":"/api/hub/session"},"startTime":1778819818042,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":564425,"timestamp":11845805876,"id":80,"parentId":43,"tags":{},"startTime":1778819818052,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":574745,"timestamp":11845795593,"id":43,"parentId":19,"tags":{"page":"/api/hub/status"},"startTime":1778819818042,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":567640,"timestamp":11845804174,"id":61,"parentId":21,"tags":{},"startTime":1778819818050,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":584285,"timestamp":11845787589,"id":21,"parentId":19,"tags":{"page":"/_not-found"},"startTime":1778819818034,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":566993,"timestamp":11845805177,"id":67,"parentId":29,"tags":{},"startTime":1778819818051,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":579270,"timestamp":11845792953,"id":29,"parentId":19,"tags":{"page":"/api/hub/auth"},"startTime":1778819818039,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":568572,"timestamp":11845805896,"id":82,"parentId":45,"tags":{},"startTime":1778819818052,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":578679,"timestamp":11845795824,"id":45,"parentId":19,"tags":{"page":"/api/hub/tasks"},"startTime":1778819818042,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":580389,"timestamp":11845805915,"id":84,"parentId":47,"tags":{},"startTime":1778819818052,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":590220,"timestamp":11845796127,"id":47,"parentId":19,"tags":{"page":"/api/hub/tokens"},"startTime":1778819818042,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":580878,"timestamp":11845807393,"id":85,"parentId":48,"tags":{},"startTime":1778819818054,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":592070,"timestamp":11845796246,"id":48,"parentId":19,"tags":{"page":"/favicon.ico"},"startTime":1778819818043,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":586725,"timestamp":11845804563,"id":63,"parentId":25,"tags":{},"startTime":1778819818051,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":599006,"timestamp":11845792322,"id":25,"parentId":19,"tags":{"page":"/api/auth/login"},"startTime":1778819818039,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":580227,"timestamp":11845812981,"id":87,"parentId":31,"tags":{},"startTime":1778819818059,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":599956,"timestamp":11845793291,"id":31,"parentId":19,"tags":{"page":"/api/hub/events"},"startTime":1778819818040,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":582332,"timestamp":11845811754,"id":86,"parentId":24,"tags":{},"startTime":1778819818058,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":604347,"timestamp":11845789782,"id":24,"parentId":19,"tags":{"page":"/api/anet/config"},"startTime":1778819818036,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":591746,"timestamp":11845804632,"id":64,"parentId":26,"tags":{},"startTime":1778819818051,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":603925,"timestamp":11845792492,"id":26,"parentId":19,"tags":{"page":"/api/auth/logout"},"startTime":1778819818039,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":598324,"timestamp":11845805886,"id":81,"parentId":44,"tags":{},"startTime":1778819818052,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":608547,"timestamp":11845795713,"id":44,"parentId":19,"tags":{"page":"/api/hub/task-events"},"startTime":1778819818042,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":605778,"timestamp":11845804741,"id":65,"parentId":27,"tags":{},"startTime":1778819818051,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":617916,"timestamp":11845792649,"id":27,"parentId":19,"tags":{"page":"/api/auth/v3"},"startTime":1778819818039,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":648344,"timestamp":11845805906,"id":83,"parentId":46,"tags":{},"startTime":1778819818052,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":658341,"timestamp":11845795987,"id":46,"parentId":19,"tags":{"page":"/api/hub/tmux"},"startTime":1778819818042,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":643038,"timestamp":11845815670,"id":89,"parentId":49,"tags":{},"startTime":1778819818062,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":660619,"timestamp":11845798146,"id":49,"parentId":19,"tags":{"page":"/login"},"startTime":1778819818044,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":648093,"timestamp":11845815745,"id":94,"parentId":55,"tags":{},"startTime":1778819818062,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":664012,"timestamp":11845799910,"id":55,"parentId":19,"tags":{"page":"/server-logs"},"startTime":1778819818046,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":653392,"timestamp":11845815764,"id":95,"parentId":56,"tags":{},"startTime":1778819818062,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":669065,"timestamp":11845800149,"id":56,"parentId":19,"tags":{"page":"/settings/networks"},"startTime":1778819818046,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":664653,"timestamp":11845815776,"id":96,"parentId":58,"tags":{},"startTime":1778819818062,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":679721,"timestamp":11845800778,"id":58,"parentId":19,"tags":{"page":"/settings/tokens"},"startTime":1778819818047,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":665736,"timestamp":11845815642,"id":88,"parentId":23,"tags":{},"startTime":1778819818062,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":691917,"timestamp":11845789505,"id":23,"parentId":19,"tags":{"page":"/admin"},"startTime":1778819818036,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":672948,"timestamp":11845815810,"id":98,"parentId":60,"tags":{},"startTime":1778819818062,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":687705,"timestamp":11845801125,"id":60,"parentId":19,"tags":{"page":"/tasks"},"startTime":1778819818047,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":668101,"timestamp":11845821684,"id":99,"parentId":57,"tags":{},"startTime":1778819818068,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":689492,"timestamp":11845800347,"id":57,"parentId":19,"tags":{"page":"/settings"},"startTime":1778819818047,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":674961,"timestamp":11845815791,"id":97,"parentId":59,"tags":{},"startTime":1778819818062,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":689871,"timestamp":11845800940,"id":59,"parentId":19,"tags":{"page":"/tasks/[id]"},"startTime":1778819818047,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":676010,"timestamp":11845815688,"id":90,"parentId":50,"tags":{},"startTime":1778819818062,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":693396,"timestamp":11845798349,"id":50,"parentId":19,"tags":{"page":"/logs"},"startTime":1778819818045,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":658060,"timestamp":11845838209,"id":100,"parentId":54,"tags":{},"startTime":1778819818084,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":696994,"timestamp":11845799311,"id":54,"parentId":19,"tags":{"page":"/"},"startTime":1778819818046,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":681941,"timestamp":11845815704,"id":91,"parentId":51,"tags":{},"startTime":1778819818062,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":699135,"timestamp":11845798548,"id":51,"parentId":19,"tags":{"page":"/messages"},"startTime":1778819818045,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":683246,"timestamp":11845815730,"id":93,"parentId":53,"tags":{},"startTime":1778819818062,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":700000,"timestamp":11845799042,"id":53,"parentId":19,"tags":{"page":"/nodes"},"startTime":1778819818045,"traceId":"cc16e53cdf6464d7"},{"name":"is-page-static","duration":684787,"timestamp":11845815718,"id":92,"parentId":52,"tags":{},"startTime":1778819818062,"traceId":"cc16e53cdf6464d7"},{"name":"check-page","duration":701769,"timestamp":11845798771,"id":52,"parentId":19,"tags":{"page":"/node"},"startTime":1778819818045,"traceId":"cc16e53cdf6464d7"},{"name":"static-check","duration":715632,"timestamp":11845784939,"id":19,"parentId":1,"tags":{},"startTime":1778819818031,"traceId":"cc16e53cdf6464d7"},{"name":"write-routes-manifest","duration":461,"timestamp":11846508659,"id":102,"parentId":1,"tags":{},"startTime":1778819818755,"traceId":"cc16e53cdf6464d7"},{"name":"load-dotenv","duration":76,"timestamp":11846519837,"id":105,"parentId":104,"tags":{},"startTime":1778819818766,"traceId":"cc16e53cdf6464d7"},{"name":"run-export-path-map","duration":848,"timestamp":11846523586,"id":106,"parentId":104,"tags":{},"startTime":1778819818770,"traceId":"cc16e53cdf6464d7"},{"name":"next-export","duration":665859,"timestamp":11846518034,"id":104,"parentId":1,"tags":{},"startTime":1778819818764,"traceId":"cc16e53cdf6464d7"},{"name":"move-exported-app-not-found-","duration":459,"timestamp":11847187128,"id":107,"parentId":103,"tags":{},"startTime":1778819819433,"traceId":"cc16e53cdf6464d7"},{"name":"move-exported-app-global-error-","duration":364,"timestamp":11847187670,"id":108,"parentId":103,"tags":{},"startTime":1778819819434,"traceId":"cc16e53cdf6464d7"}]
2
- [{"name":"static-generation","duration":678934,"timestamp":11846512906,"id":103,"parentId":1,"tags":{},"startTime":1778819818759,"traceId":"cc16e53cdf6464d7"},{"name":"write-routes-manifest","duration":423,"timestamp":11847192086,"id":109,"parentId":1,"tags":{},"startTime":1778819819438,"traceId":"cc16e53cdf6464d7"},{"name":"print-tree-view","duration":3739,"timestamp":11847208392,"id":110,"parentId":1,"tags":{},"startTime":1778819819455,"traceId":"cc16e53cdf6464d7"},{"name":"write-route-bundle-stats","duration":12976,"timestamp":11847212163,"id":111,"parentId":1,"tags":{},"startTime":1778819819458,"traceId":"cc16e53cdf6464d7"},{"name":"telemetry-flush","duration":21210,"timestamp":11847225174,"id":112,"parentId":1,"tags":{},"startTime":1778819819471,"traceId":"cc16e53cdf6464d7"},{"name":"next-build","duration":15032545,"timestamp":11832213875,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1778819804460,"traceId":"cc16e53cdf6464d7"}]
1
+ [{"name":"generate-buildid","duration":265,"timestamp":12508710026,"id":4,"parentId":1,"tags":{},"startTime":1778820480956,"traceId":"20fb9853e63ac103"},{"name":"load-custom-routes","duration":439,"timestamp":12508710430,"id":5,"parentId":1,"tags":{},"startTime":1778820480957,"traceId":"20fb9853e63ac103"},{"name":"create-dist-dir","duration":610,"timestamp":12508710922,"id":6,"parentId":1,"tags":{},"startTime":1778820480957,"traceId":"20fb9853e63ac103"},{"name":"clean","duration":437,"timestamp":12508712197,"id":7,"parentId":1,"tags":{},"startTime":1778820480958,"traceId":"20fb9853e63ac103"},{"name":"discover-routes","duration":9168,"timestamp":12508790817,"id":8,"parentId":1,"tags":{},"startTime":1778820481037,"traceId":"20fb9853e63ac103"},{"name":"create-root-mapping","duration":106,"timestamp":12508800073,"id":9,"parentId":1,"tags":{},"startTime":1778820481046,"traceId":"20fb9853e63ac103"},{"name":"generate-route-types","duration":30740,"timestamp":12508802502,"id":10,"parentId":1,"tags":{},"startTime":1778820481049,"traceId":"20fb9853e63ac103"},{"name":"public-dir-conflict-check","duration":91,"timestamp":12508833393,"id":11,"parentId":1,"tags":{},"startTime":1778820481080,"traceId":"20fb9853e63ac103"},{"name":"generate-routes-manifest","duration":4458,"timestamp":12508833594,"id":12,"parentId":1,"tags":{},"startTime":1778820481080,"traceId":"20fb9853e63ac103"},{"name":"run-turbopack","duration":5649981,"timestamp":12508843345,"id":14,"parentId":1,"tags":{},"startTime":1778820481090,"traceId":"20fb9853e63ac103"},{"name":"turbopack-build-events","duration":94,"timestamp":12509118598,"id":15,"parentId":1,"tags":{},"startTime":1778820481365,"traceId":"20fb9853e63ac103"},{"name":"run-typescript","duration":8213776,"timestamp":12514502504,"id":16,"parentId":1,"tags":{},"startTime":1778820486749,"traceId":"20fb9853e63ac103"},{"name":"generate-required-server-files","duration":1911,"timestamp":12522717122,"id":18,"parentId":1,"tags":{},"startTime":1778820494963,"traceId":"20fb9853e63ac103"},{"name":"check-static-error-page","duration":10869,"timestamp":12522870814,"id":20,"parentId":19,"tags":{},"startTime":1778820495117,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":364217,"timestamp":12522884553,"id":63,"parentId":22,"tags":{},"startTime":1778820495131,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":375711,"timestamp":12522873230,"id":22,"parentId":19,"tags":{"page":"/_global-error"},"startTime":1778820495120,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":507318,"timestamp":12522884279,"id":62,"parentId":21,"tags":{},"startTime":1778820495131,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":519587,"timestamp":12522872109,"id":21,"parentId":19,"tags":{"page":"/_not-found"},"startTime":1778820495118,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":514371,"timestamp":12522884730,"id":65,"parentId":26,"tags":{},"startTime":1778820495131,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":523571,"timestamp":12522875593,"id":26,"parentId":19,"tags":{"page":"/api/auth/logout"},"startTime":1778820495122,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":517464,"timestamp":12522886645,"id":71,"parentId":33,"tags":{},"startTime":1778820495133,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":527524,"timestamp":12522876639,"id":33,"parentId":19,"tags":{"page":"/api/hub/inbox"},"startTime":1778820495123,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":535672,"timestamp":12522886389,"id":69,"parentId":30,"tags":{},"startTime":1778820495133,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":545974,"timestamp":12522876155,"id":30,"parentId":19,"tags":{"page":"/api/hub/broadcast"},"startTime":1778820495122,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":540591,"timestamp":12522886811,"id":73,"parentId":35,"tags":{},"startTime":1778820495133,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":550587,"timestamp":12522876879,"id":35,"parentId":19,"tags":{"page":"/api/hub/messages"},"startTime":1778820495123,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":545460,"timestamp":12522884837,"id":66,"parentId":27,"tags":{},"startTime":1778820495131,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":554637,"timestamp":12522875713,"id":27,"parentId":19,"tags":{"page":"/api/auth/v3"},"startTime":1778820495122,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":544472,"timestamp":12522886052,"id":67,"parentId":28,"tags":{},"startTime":1778820495132,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":554740,"timestamp":12522875829,"id":28,"parentId":19,"tags":{"page":"/api/hub/audit-log"},"startTime":1778820495122,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":545382,"timestamp":12522886951,"id":74,"parentId":36,"tags":{},"startTime":1778820495133,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":555003,"timestamp":12522877378,"id":36,"parentId":19,"tags":{"page":"/api/hub/networks"},"startTime":1778820495124,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":549699,"timestamp":12522886771,"id":72,"parentId":34,"tags":{},"startTime":1778820495133,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":559756,"timestamp":12522876753,"id":34,"parentId":19,"tags":{"page":"/api/hub/license"},"startTime":1778820495123,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":549608,"timestamp":12522887048,"id":77,"parentId":39,"tags":{},"startTime":1778820495133,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":558855,"timestamp":12522877826,"id":39,"parentId":19,"tags":{"page":"/api/hub/send"},"startTime":1778820495124,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":555330,"timestamp":12522887070,"id":79,"parentId":41,"tags":{},"startTime":1778820495133,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":564379,"timestamp":12522878064,"id":41,"parentId":19,"tags":{"page":"/api/hub/servers"},"startTime":1778820495124,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":555608,"timestamp":12522886988,"id":75,"parentId":37,"tags":{},"startTime":1778820495133,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":565056,"timestamp":12522877571,"id":37,"parentId":19,"tags":{"page":"/api/hub/nodes"},"startTime":1778820495124,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":561145,"timestamp":12522887092,"id":81,"parentId":43,"tags":{},"startTime":1778820495133,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":570039,"timestamp":12522878243,"id":43,"parentId":19,"tags":{"page":"/api/hub/stats"},"startTime":1778820495125,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":562784,"timestamp":12522887083,"id":80,"parentId":42,"tags":{},"startTime":1778820495133,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":571734,"timestamp":12522878172,"id":42,"parentId":19,"tags":{"page":"/api/hub/session"},"startTime":1778820495124,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":570486,"timestamp":12522887033,"id":76,"parentId":38,"tags":{},"startTime":1778820495133,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":579839,"timestamp":12522877716,"id":38,"parentId":19,"tags":{"page":"/api/hub/register"},"startTime":1778820495124,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":573226,"timestamp":12522884642,"id":64,"parentId":25,"tags":{},"startTime":1778820495131,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":582491,"timestamp":12522875425,"id":25,"parentId":19,"tags":{"page":"/api/auth/login"},"startTime":1778820495122,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":570887,"timestamp":12522887241,"id":82,"parentId":44,"tags":{},"startTime":1778820495134,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":579849,"timestamp":12522878306,"id":44,"parentId":19,"tags":{"page":"/api/hub/status"},"startTime":1778820495125,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":573496,"timestamp":12522887058,"id":78,"parentId":40,"tags":{},"startTime":1778820495133,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":582635,"timestamp":12522877950,"id":40,"parentId":19,"tags":{"page":"/api/hub/server-logs"},"startTime":1778820495124,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":573444,"timestamp":12522887263,"id":83,"parentId":45,"tags":{},"startTime":1778820495134,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":582359,"timestamp":12522878375,"id":45,"parentId":19,"tags":{"page":"/api/hub/task-events"},"startTime":1778820495125,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":576982,"timestamp":12522887300,"id":86,"parentId":48,"tags":{},"startTime":1778820495134,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":585736,"timestamp":12522878584,"id":48,"parentId":19,"tags":{"page":"/api/hub/tokens"},"startTime":1778820495125,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":582758,"timestamp":12522887313,"id":87,"parentId":49,"tags":{},"startTime":1778820495134,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":591468,"timestamp":12522878647,"id":49,"parentId":19,"tags":{"page":"/favicon.ico"},"startTime":1778820495125,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":578670,"timestamp":12522891788,"id":89,"parentId":31,"tags":{},"startTime":1778820495138,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":594219,"timestamp":12522876269,"id":31,"parentId":19,"tags":{"page":"/api/hub/events"},"startTime":1778820495123,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":580058,"timestamp":12522890559,"id":88,"parentId":24,"tags":{},"startTime":1778820495137,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":597040,"timestamp":12522873607,"id":24,"parentId":19,"tags":{"page":"/api/anet/config"},"startTime":1778820495120,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":585379,"timestamp":12522887277,"id":84,"parentId":46,"tags":{},"startTime":1778820495134,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":594271,"timestamp":12522878430,"id":46,"parentId":19,"tags":{"page":"/api/hub/tasks"},"startTime":1778820495125,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":596452,"timestamp":12522886577,"id":70,"parentId":32,"tags":{},"startTime":1778820495133,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":606575,"timestamp":12522876504,"id":32,"parentId":19,"tags":{"page":"/api/hub/health"},"startTime":1778820495123,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":601089,"timestamp":12522887286,"id":85,"parentId":47,"tags":{},"startTime":1778820495134,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":609906,"timestamp":12522878517,"id":47,"parentId":19,"tags":{"page":"/api/hub/tmux"},"startTime":1778820495125,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":602349,"timestamp":12522886239,"id":68,"parentId":29,"tags":{},"startTime":1778820495133,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":612637,"timestamp":12522875977,"id":29,"parentId":19,"tags":{"page":"/api/hub/auth"},"startTime":1778820495122,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":596572,"timestamp":12522894273,"id":94,"parentId":53,"tags":{},"startTime":1778820495141,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":611431,"timestamp":12522879465,"id":53,"parentId":19,"tags":{"page":"/node"},"startTime":1778820495126,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":603929,"timestamp":12522894314,"id":97,"parentId":57,"tags":{},"startTime":1778820495141,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":617734,"timestamp":12522880550,"id":57,"parentId":19,"tags":{"page":"/settings/networks"},"startTime":1778820495127,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":611828,"timestamp":12522894324,"id":98,"parentId":59,"tags":{},"startTime":1778820495141,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":625147,"timestamp":12522881048,"id":59,"parentId":19,"tags":{"page":"/settings/tokens"},"startTime":1778820495127,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":625909,"timestamp":12522894343,"id":99,"parentId":60,"tags":{},"startTime":1778820495141,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":639101,"timestamp":12522881208,"id":60,"parentId":19,"tags":{"page":"/tasks/[id]"},"startTime":1778820495127,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":634968,"timestamp":12522894361,"id":100,"parentId":61,"tags":{},"startTime":1778820495141,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":648025,"timestamp":12522881369,"id":61,"parentId":19,"tags":{"page":"/tasks"},"startTime":1778820495128,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":641624,"timestamp":12522894263,"id":93,"parentId":52,"tags":{},"startTime":1778820495141,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":656674,"timestamp":12522879271,"id":52,"parentId":19,"tags":{"page":"/messages"},"startTime":1778820495126,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":636249,"timestamp":12522900176,"id":101,"parentId":58,"tags":{},"startTime":1778820495146,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":655757,"timestamp":12522880714,"id":58,"parentId":19,"tags":{"page":"/settings"},"startTime":1778820495127,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":643882,"timestamp":12522894248,"id":92,"parentId":51,"tags":{},"startTime":1778820495141,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":659031,"timestamp":12522879137,"id":51,"parentId":19,"tags":{"page":"/logs"},"startTime":1778820495125,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":644327,"timestamp":12522894232,"id":91,"parentId":50,"tags":{},"startTime":1778820495141,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":659604,"timestamp":12522878972,"id":50,"parentId":19,"tags":{"page":"/login"},"startTime":1778820495125,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":646548,"timestamp":12522894206,"id":90,"parentId":23,"tags":{},"startTime":1778820495140,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":667363,"timestamp":12522873426,"id":23,"parentId":19,"tags":{"page":"/admin"},"startTime":1778820495120,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":633150,"timestamp":12522909625,"id":102,"parentId":55,"tags":{},"startTime":1778820495156,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":662939,"timestamp":12522879868,"id":55,"parentId":19,"tags":{"page":"/"},"startTime":1778820495126,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":657339,"timestamp":12522894287,"id":95,"parentId":54,"tags":{},"startTime":1778820495141,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":671998,"timestamp":12522879653,"id":54,"parentId":19,"tags":{"page":"/nodes"},"startTime":1778820495126,"traceId":"20fb9853e63ac103"},{"name":"is-page-static","duration":666523,"timestamp":12522894301,"id":96,"parentId":56,"tags":{},"startTime":1778820495141,"traceId":"20fb9853e63ac103"},{"name":"check-page","duration":680536,"timestamp":12522880329,"id":56,"parentId":19,"tags":{"page":"/server-logs"},"startTime":1778820495127,"traceId":"20fb9853e63ac103"},{"name":"static-check","duration":691020,"timestamp":12522869889,"id":19,"parentId":1,"tags":{},"startTime":1778820495116,"traceId":"20fb9853e63ac103"},{"name":"write-routes-manifest","duration":396,"timestamp":12523567021,"id":104,"parentId":1,"tags":{},"startTime":1778820495813,"traceId":"20fb9853e63ac103"},{"name":"load-dotenv","duration":48,"timestamp":12523578062,"id":107,"parentId":106,"tags":{},"startTime":1778820495824,"traceId":"20fb9853e63ac103"},{"name":"run-export-path-map","duration":614,"timestamp":12523580569,"id":108,"parentId":106,"tags":{},"startTime":1778820495827,"traceId":"20fb9853e63ac103"},{"name":"next-export","duration":566457,"timestamp":12523576800,"id":106,"parentId":1,"tags":{},"startTime":1778820495823,"traceId":"20fb9853e63ac103"}]
2
+ [{"name":"move-exported-app-not-found-","duration":2095,"timestamp":12524146596,"id":109,"parentId":105,"tags":{},"startTime":1778820496393,"traceId":"20fb9853e63ac103"},{"name":"move-exported-app-global-error-","duration":650,"timestamp":12524148780,"id":110,"parentId":105,"tags":{},"startTime":1778820496395,"traceId":"20fb9853e63ac103"},{"name":"static-generation","duration":580005,"timestamp":12523571060,"id":105,"parentId":1,"tags":{},"startTime":1778820495817,"traceId":"20fb9853e63ac103"},{"name":"write-routes-manifest","duration":360,"timestamp":12524151217,"id":111,"parentId":1,"tags":{},"startTime":1778820496397,"traceId":"20fb9853e63ac103"},{"name":"print-tree-view","duration":5104,"timestamp":12524166165,"id":112,"parentId":1,"tags":{},"startTime":1778820496412,"traceId":"20fb9853e63ac103"},{"name":"write-route-bundle-stats","duration":13137,"timestamp":12524171299,"id":113,"parentId":1,"tags":{},"startTime":1778820496418,"traceId":"20fb9853e63ac103"},{"name":"telemetry-flush","duration":26935,"timestamp":12524184460,"id":114,"parentId":1,"tags":{},"startTime":1778820496431,"traceId":"20fb9853e63ac103"},{"name":"next-build","duration":15549447,"timestamp":12508661972,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1778820480908,"traceId":"20fb9853e63ac103"}]
package/.next/trace-build CHANGED
@@ -1 +1 @@
1
- [{"name":"run-turbopack","duration":5026414,"timestamp":11832406774,"id":14,"parentId":1,"tags":{},"startTime":1778819804653,"traceId":"cc16e53cdf6464d7"},{"name":"turbopack-build-events","duration":107,"timestamp":11832724804,"id":15,"parentId":1,"tags":{},"startTime":1778819804971,"traceId":"cc16e53cdf6464d7"},{"name":"run-typescript","duration":8182650,"timestamp":11837441137,"id":16,"parentId":1,"tags":{},"startTime":1778819809687,"traceId":"cc16e53cdf6464d7"},{"name":"static-check","duration":715632,"timestamp":11845784939,"id":19,"parentId":1,"tags":{},"startTime":1778819818031,"traceId":"cc16e53cdf6464d7"},{"name":"static-generation","duration":678934,"timestamp":11846512906,"id":103,"parentId":1,"tags":{},"startTime":1778819818759,"traceId":"cc16e53cdf6464d7"},{"name":"telemetry-flush","duration":21210,"timestamp":11847225174,"id":112,"parentId":1,"tags":{},"startTime":1778819819471,"traceId":"cc16e53cdf6464d7"},{"name":"next-build","duration":15032545,"timestamp":11832213875,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1778819804460,"traceId":"cc16e53cdf6464d7"}]
1
+ [{"name":"run-turbopack","duration":5649981,"timestamp":12508843345,"id":14,"parentId":1,"tags":{},"startTime":1778820481090,"traceId":"20fb9853e63ac103"},{"name":"turbopack-build-events","duration":94,"timestamp":12509118598,"id":15,"parentId":1,"tags":{},"startTime":1778820481365,"traceId":"20fb9853e63ac103"},{"name":"run-typescript","duration":8213776,"timestamp":12514502504,"id":16,"parentId":1,"tags":{},"startTime":1778820486749,"traceId":"20fb9853e63ac103"},{"name":"static-check","duration":691020,"timestamp":12522869889,"id":19,"parentId":1,"tags":{},"startTime":1778820495116,"traceId":"20fb9853e63ac103"},{"name":"static-generation","duration":580005,"timestamp":12523571060,"id":105,"parentId":1,"tags":{},"startTime":1778820495817,"traceId":"20fb9853e63ac103"},{"name":"telemetry-flush","duration":26935,"timestamp":12524184460,"id":114,"parentId":1,"tags":{},"startTime":1778820496431,"traceId":"20fb9853e63ac103"},{"name":"next-build","duration":15549447,"timestamp":12508661972,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1778820480908,"traceId":"20fb9853e63ac103"}]
@@ -2,7 +2,7 @@
2
2
  // Do not edit this file manually
3
3
 
4
4
  type AppRoutes = "/" | "/admin" | "/login" | "/logs" | "/messages" | "/node" | "/nodes" | "/server-logs" | "/settings" | "/settings/networks" | "/settings/tokens" | "/tasks" | "/tasks/[id]"
5
- type AppRouteHandlerRoutes = "/api/anet/config" | "/api/auth/login" | "/api/auth/logout" | "/api/auth/v3" | "/api/hub/audit-log" | "/api/hub/auth" | "/api/hub/broadcast" | "/api/hub/events" | "/api/hub/health" | "/api/hub/inbox" | "/api/hub/license" | "/api/hub/messages" | "/api/hub/networks" | "/api/hub/nodes" | "/api/hub/register" | "/api/hub/send" | "/api/hub/server-logs" | "/api/hub/session" | "/api/hub/stats" | "/api/hub/status" | "/api/hub/task-events" | "/api/hub/tasks" | "/api/hub/tmux" | "/api/hub/tokens"
5
+ type AppRouteHandlerRoutes = "/api/anet/config" | "/api/auth/login" | "/api/auth/logout" | "/api/auth/v3" | "/api/hub/audit-log" | "/api/hub/auth" | "/api/hub/broadcast" | "/api/hub/events" | "/api/hub/health" | "/api/hub/inbox" | "/api/hub/license" | "/api/hub/messages" | "/api/hub/networks" | "/api/hub/nodes" | "/api/hub/register" | "/api/hub/send" | "/api/hub/server-logs" | "/api/hub/servers" | "/api/hub/session" | "/api/hub/stats" | "/api/hub/status" | "/api/hub/task-events" | "/api/hub/tasks" | "/api/hub/tmux" | "/api/hub/tokens"
6
6
  type PageRoutes = never
7
7
  type LayoutRoutes = "/"
8
8
  type RedirectRoutes = never
@@ -30,6 +30,7 @@ interface ParamMap {
30
30
  "/api/hub/register": {}
31
31
  "/api/hub/send": {}
32
32
  "/api/hub/server-logs": {}
33
+ "/api/hub/servers": {}
33
34
  "/api/hub/session": {}
34
35
  "/api/hub/stats": {}
35
36
  "/api/hub/status": {}
@@ -317,6 +317,15 @@ type RouteHandlerConfig<Route extends AppRouteHandlerRoutes = AppRouteHandlerRou
317
317
  type __Unused = __Check
318
318
  }
319
319
 
320
+ // Validate ../../app/api/hub/servers/route.ts
321
+ {
322
+ type __IsExpected<Specific extends RouteHandlerConfig<"/api/hub/servers">> = Specific
323
+ const handler = {} as typeof import("../../app/api/hub/servers/route.js")
324
+ type __Check = __IsExpected<typeof handler>
325
+ // @ts-ignore
326
+ type __Unused = __Check
327
+ }
328
+
320
329
  // Validate ../../app/api/hub/session/route.ts
321
330
  {
322
331
  type __IsExpected<Specific extends RouteHandlerConfig<"/api/hub/session">> = Specific
@@ -0,0 +1,39 @@
1
+ import { requireDashboardAuth, getV3UserToken } from '@/app/lib/dashboard-auth';
2
+
3
+ const HUB_URL = process.env.COMMHUB_URL || 'http://127.0.0.1:9200';
4
+
5
+ async function hubHeaders(): Promise<Record<string, string>> {
6
+ const userToken = await getV3UserToken();
7
+ const h: Record<string, string> = {};
8
+ if (userToken) h['Authorization'] = `Bearer ${userToken}`;
9
+ return h;
10
+ }
11
+
12
+ /**
13
+ * Proxy: GET /api/servers from CommHub. Aggregates host telemetry across
14
+ * sessions and returns one card per server (hostname, ip, cpu/mem load,
15
+ * agent_count, status). Per issue #119; lands in v0.8.1-preview.2 of the
16
+ * commhub-server (通信牛). The dashboard <ServersDrawer> mounts in
17
+ * AppShell and refreshes every 5s when expanded.
18
+ */
19
+ export async function GET() {
20
+ const authFailure = await requireDashboardAuth();
21
+ if (authFailure) return authFailure;
22
+
23
+ try {
24
+ const res = await fetch(`${HUB_URL}/api/servers`, {
25
+ headers: await hubHeaders(),
26
+ next: { revalidate: 0 },
27
+ });
28
+ if (!res.ok) {
29
+ // 404 means the upstream hub predates v0.8.1-preview.2 — surface a
30
+ // 'feature unavailable' shape so the drawer can render a friendly
31
+ // empty state instead of an angry error.
32
+ if (res.status === 404) return Response.json({ servers: [], unavailable: true });
33
+ return Response.json({ error: `hub ${res.status}` }, { status: res.status });
34
+ }
35
+ return Response.json(await res.json());
36
+ } catch (e: unknown) {
37
+ return Response.json({ error: 'hub unreachable', detail: e instanceof Error ? e.message : String(e) }, { status: 502 });
38
+ }
39
+ }