@sleep2agi/agent-network-dashboard 0.6.3-preview.15 → 0.6.3-preview.17

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 (186) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/diagnostics/route-bundle-stats.json +11 -11
  4. package/.next/fallback-build-manifest.json +3 -3
  5. package/.next/prerender-manifest.json +3 -3
  6. package/.next/server/app/_global-error.html +1 -1
  7. package/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/_not-found.html +2 -2
  15. package/.next/server/app/_not-found.rsc +2 -2
  16. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  17. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  19. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  20. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  21. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  22. package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  23. package/.next/server/app/admin.html +2 -2
  24. package/.next/server/app/admin.rsc +2 -2
  25. package/.next/server/app/admin.segments/_full.segment.rsc +2 -2
  26. package/.next/server/app/admin.segments/_head.segment.rsc +1 -1
  27. package/.next/server/app/admin.segments/_index.segment.rsc +2 -2
  28. package/.next/server/app/admin.segments/_tree.segment.rsc +2 -2
  29. package/.next/server/app/admin.segments/admin/__PAGE__.segment.rsc +1 -1
  30. package/.next/server/app/admin.segments/admin.segment.rsc +1 -1
  31. package/.next/server/app/index.html +2 -2
  32. package/.next/server/app/index.rsc +3 -3
  33. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  34. package/.next/server/app/index.segments/_full.segment.rsc +3 -3
  35. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  36. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  37. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  38. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  39. package/.next/server/app/login.html +2 -2
  40. package/.next/server/app/login.rsc +3 -3
  41. package/.next/server/app/login.segments/_full.segment.rsc +3 -3
  42. package/.next/server/app/login.segments/_head.segment.rsc +1 -1
  43. package/.next/server/app/login.segments/_index.segment.rsc +2 -2
  44. package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  45. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  46. package/.next/server/app/login.segments/login.segment.rsc +1 -1
  47. package/.next/server/app/logs/page_client-reference-manifest.js +1 -1
  48. package/.next/server/app/logs.html +2 -2
  49. package/.next/server/app/logs.rsc +2 -2
  50. package/.next/server/app/logs.segments/_full.segment.rsc +2 -2
  51. package/.next/server/app/logs.segments/_head.segment.rsc +1 -1
  52. package/.next/server/app/logs.segments/_index.segment.rsc +2 -2
  53. package/.next/server/app/logs.segments/_tree.segment.rsc +2 -2
  54. package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +1 -1
  55. package/.next/server/app/logs.segments/logs.segment.rsc +1 -1
  56. package/.next/server/app/messages/page_client-reference-manifest.js +1 -1
  57. package/.next/server/app/messages.html +2 -2
  58. package/.next/server/app/messages.rsc +2 -2
  59. package/.next/server/app/messages.segments/_full.segment.rsc +2 -2
  60. package/.next/server/app/messages.segments/_head.segment.rsc +1 -1
  61. package/.next/server/app/messages.segments/_index.segment.rsc +2 -2
  62. package/.next/server/app/messages.segments/_tree.segment.rsc +2 -2
  63. package/.next/server/app/messages.segments/messages/__PAGE__.segment.rsc +1 -1
  64. package/.next/server/app/messages.segments/messages.segment.rsc +1 -1
  65. package/.next/server/app/node/page_client-reference-manifest.js +1 -1
  66. package/.next/server/app/node.html +2 -2
  67. package/.next/server/app/node.rsc +3 -3
  68. package/.next/server/app/node.segments/_full.segment.rsc +3 -3
  69. package/.next/server/app/node.segments/_head.segment.rsc +1 -1
  70. package/.next/server/app/node.segments/_index.segment.rsc +2 -2
  71. package/.next/server/app/node.segments/_tree.segment.rsc +2 -2
  72. package/.next/server/app/node.segments/node/__PAGE__.segment.rsc +2 -2
  73. package/.next/server/app/node.segments/node.segment.rsc +1 -1
  74. package/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
  75. package/.next/server/app/nodes.html +2 -2
  76. package/.next/server/app/nodes.rsc +3 -3
  77. package/.next/server/app/nodes.segments/_full.segment.rsc +3 -3
  78. package/.next/server/app/nodes.segments/_head.segment.rsc +1 -1
  79. package/.next/server/app/nodes.segments/_index.segment.rsc +2 -2
  80. package/.next/server/app/nodes.segments/_tree.segment.rsc +2 -2
  81. package/.next/server/app/nodes.segments/nodes/__PAGE__.segment.rsc +2 -2
  82. package/.next/server/app/nodes.segments/nodes.segment.rsc +1 -1
  83. package/.next/server/app/page_client-reference-manifest.js +1 -1
  84. package/.next/server/app/providers/page_client-reference-manifest.js +1 -1
  85. package/.next/server/app/providers.html +2 -2
  86. package/.next/server/app/providers.rsc +2 -2
  87. package/.next/server/app/providers.segments/_full.segment.rsc +2 -2
  88. package/.next/server/app/providers.segments/_head.segment.rsc +1 -1
  89. package/.next/server/app/providers.segments/_index.segment.rsc +2 -2
  90. package/.next/server/app/providers.segments/_tree.segment.rsc +2 -2
  91. package/.next/server/app/providers.segments/providers/__PAGE__.segment.rsc +1 -1
  92. package/.next/server/app/providers.segments/providers.segment.rsc +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 +2 -2
  96. package/.next/server/app/server-logs.segments/_full.segment.rsc +2 -2
  97. package/.next/server/app/server-logs.segments/_head.segment.rsc +1 -1
  98. package/.next/server/app/server-logs.segments/_index.segment.rsc +2 -2
  99. package/.next/server/app/server-logs.segments/_tree.segment.rsc +2 -2
  100. package/.next/server/app/server-logs.segments/server-logs/__PAGE__.segment.rsc +1 -1
  101. package/.next/server/app/server-logs.segments/server-logs.segment.rsc +1 -1
  102. package/.next/server/app/servers/page_client-reference-manifest.js +1 -1
  103. package/.next/server/app/servers.html +2 -2
  104. package/.next/server/app/servers.rsc +2 -2
  105. package/.next/server/app/servers.segments/_full.segment.rsc +2 -2
  106. package/.next/server/app/servers.segments/_head.segment.rsc +1 -1
  107. package/.next/server/app/servers.segments/_index.segment.rsc +2 -2
  108. package/.next/server/app/servers.segments/_tree.segment.rsc +2 -2
  109. package/.next/server/app/servers.segments/servers/__PAGE__.segment.rsc +1 -1
  110. package/.next/server/app/servers.segments/servers.segment.rsc +1 -1
  111. package/.next/server/app/settings/networks/page_client-reference-manifest.js +1 -1
  112. package/.next/server/app/settings/networks.html +2 -2
  113. package/.next/server/app/settings/networks.rsc +2 -2
  114. package/.next/server/app/settings/networks.segments/_full.segment.rsc +2 -2
  115. package/.next/server/app/settings/networks.segments/_head.segment.rsc +1 -1
  116. package/.next/server/app/settings/networks.segments/_index.segment.rsc +2 -2
  117. package/.next/server/app/settings/networks.segments/_tree.segment.rsc +2 -2
  118. package/.next/server/app/settings/networks.segments/settings/networks/__PAGE__.segment.rsc +1 -1
  119. package/.next/server/app/settings/networks.segments/settings/networks.segment.rsc +1 -1
  120. package/.next/server/app/settings/networks.segments/settings.segment.rsc +1 -1
  121. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  122. package/.next/server/app/settings/tokens/page_client-reference-manifest.js +1 -1
  123. package/.next/server/app/settings/tokens.html +2 -2
  124. package/.next/server/app/settings/tokens.rsc +2 -2
  125. package/.next/server/app/settings/tokens.segments/_full.segment.rsc +2 -2
  126. package/.next/server/app/settings/tokens.segments/_head.segment.rsc +1 -1
  127. package/.next/server/app/settings/tokens.segments/_index.segment.rsc +2 -2
  128. package/.next/server/app/settings/tokens.segments/_tree.segment.rsc +2 -2
  129. package/.next/server/app/settings/tokens.segments/settings/tokens/__PAGE__.segment.rsc +1 -1
  130. package/.next/server/app/settings/tokens.segments/settings/tokens.segment.rsc +1 -1
  131. package/.next/server/app/settings/tokens.segments/settings.segment.rsc +1 -1
  132. package/.next/server/app/settings.html +2 -2
  133. package/.next/server/app/settings.rsc +3 -3
  134. package/.next/server/app/settings.segments/_full.segment.rsc +3 -3
  135. package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  136. package/.next/server/app/settings.segments/_index.segment.rsc +2 -2
  137. package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  138. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
  139. package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  140. package/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
  141. package/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
  142. package/.next/server/app/tasks.html +2 -2
  143. package/.next/server/app/tasks.rsc +2 -2
  144. package/.next/server/app/tasks.segments/_full.segment.rsc +2 -2
  145. package/.next/server/app/tasks.segments/_head.segment.rsc +1 -1
  146. package/.next/server/app/tasks.segments/_index.segment.rsc +2 -2
  147. package/.next/server/app/tasks.segments/_tree.segment.rsc +2 -2
  148. package/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +1 -1
  149. package/.next/server/app/tasks.segments/tasks.segment.rsc +1 -1
  150. package/.next/server/chunks/ssr/[root-of-the-server]__091su60._.js +2 -2
  151. package/.next/server/chunks/ssr/[root-of-the-server]__091su60._.js.map +1 -1
  152. package/.next/server/chunks/ssr/[root-of-the-server]__0vc.3k7._.js +1 -1
  153. package/.next/server/chunks/ssr/[root-of-the-server]__0vc.3k7._.js.map +1 -1
  154. package/.next/server/chunks/ssr/dash-loop-wt_0rh8p9o._.js +1 -1
  155. package/.next/server/chunks/ssr/dash-loop-wt_0rh8p9o._.js.map +1 -1
  156. package/.next/server/chunks/ssr/dash-loop-wt_app_0~.1~ew._.js +1 -1
  157. package/.next/server/chunks/ssr/dash-loop-wt_app_0~.1~ew._.js.map +1 -1
  158. package/.next/server/chunks/ssr/dash-loop-wt_app_13k3-ai._.js +1 -1
  159. package/.next/server/chunks/ssr/dash-loop-wt_app_13k3-ai._.js.map +1 -1
  160. package/.next/server/chunks/ssr/dash-loop-wt_app_nodes_page_tsx_0ma3oqt._.js +1 -1
  161. package/.next/server/chunks/ssr/dash-loop-wt_app_nodes_page_tsx_0ma3oqt._.js.map +1 -1
  162. package/.next/server/middleware-build-manifest.js +3 -3
  163. package/.next/server/pages/404.html +2 -2
  164. package/.next/server/pages/500.html +1 -1
  165. package/.next/server/server-reference-manifest.js +1 -1
  166. package/.next/server/server-reference-manifest.json +1 -1
  167. package/.next/static/chunks/{0mh28v-4j9dng.js → 0.~m9qqwfhyh5.js} +1 -1
  168. package/.next/static/chunks/{0_87-ekkmdd5n.js → 07odbdjmv1fqn.js} +1 -1
  169. package/.next/static/chunks/09t~.chkcxn2g.js +4 -0
  170. package/.next/static/chunks/{0ck-p90gm54x_.js → 0n8tkdk74r.vt.js} +1 -1
  171. package/.next/static/chunks/{11q_-4rnr__r..js → 0udw~n2wgg_d1.js} +1 -1
  172. package/.next/static/chunks/10d-uor6dhc8s.css +1 -0
  173. package/.next/static/chunks/{06qwjph2.xkng.js → 18314oga3ygn-.js} +2 -2
  174. package/.next/trace +2 -2
  175. package/.next/trace-build +1 -1
  176. package/app/components/AgentCard.tsx +6 -0
  177. package/app/components/CommandCenter.tsx +13 -3
  178. package/app/components/TaskChatPanel.tsx +230 -20
  179. package/app/lib/chat-drafts.ts +46 -0
  180. package/app/nodes/page.tsx +10 -0
  181. package/package.json +1 -1
  182. package/.next/static/chunks/02w_tb38yr0xe.css +0 -1
  183. package/.next/static/chunks/0ljzzrki8sm14.js +0 -4
  184. /package/.next/static/{R5eL5ZqEdEjOLN_5qjTqM → J1Y93nS-feaCGcOYyyskP}/_buildManifest.js +0 -0
  185. /package/.next/static/{R5eL5ZqEdEjOLN_5qjTqM → J1Y93nS-feaCGcOYyyskP}/_clientMiddlewareManifest.js +0 -0
  186. /package/.next/static/{R5eL5ZqEdEjOLN_5qjTqM → J1Y93nS-feaCGcOYyyskP}/_ssgManifest.js +0 -0
@@ -1,2 +1,2 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,27113,e=>{"use strict";var t=e.i(53116);e.s(["previewContent",0,function(e){return e&&e.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\s+/g," ").trim()||"--"},"timeAgo",0,function(e){return(0,t.relativeAgo)(e)??"--"}])},24373,e=>{"use strict";var t=e.i(66239);let s=[180,200,220,270,300,330,30,90];function a(e){let t=0;for(let s=0;s<e.length;s++)t=31*t+e.charCodeAt(s)>>>0;let a=s[t%s.length];return{bg:`hsl(${a} 55% 22%)`,ring:`hsl(${a} 60% 45%)`,text:`hsl(${a} 80% 78%)`}}function r(e){return e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"}e.s(["AliasAvatar",0,function({alias:e,size:s=28,className:n=""}){if(/\bgrok\b|grok-build|grok测试员|grok-demo/i.test(e))return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border border-emerald-500/45 bg-emerald-950/70 shrink-0 ${n}`,style:{width:s,height:s,backgroundImage:"url(/vendors/grok.svg)",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"68% 68%"},title:e,"aria-hidden":!0});let l=a(e),i=Math.max(9,Math.round(.42*s));return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${n}`,style:{width:s,height:s,fontSize:i,backgroundColor:l.bg,borderColor:l.ring,color:l.text},title:e,"aria-hidden":!0,children:r(e)})},"aliasAvatarColors",0,a,"aliasInitial",0,r])},93226,e=>{"use strict";var t=e.i(66239),s=e.i(91723),a=e.i(49357);let r={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function n({variant:e,size:s}){let a={width:s,height:s},r={fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"nodes":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"14",r:"4"}),(0,t.jsx)("circle",{cx:"14",cy:"44",r:"4"}),(0,t.jsx)("circle",{cx:"50",cy:"44",r:"4"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"14",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"50",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"18",y1:"44",x2:"46",y2:"44",strokeDasharray:"3 3",opacity:"0.6"})]})});case"tasks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("rect",{x:"14",y:"14",width:"36",height:"6",rx:"1.5"}),(0,t.jsx)("rect",{x:"14",y:"26",width:"36",height:"6",rx:"1.5",opacity:"0.6"}),(0,t.jsx)("rect",{x:"14",y:"38",width:"36",height:"6",rx:"1.5",opacity:"0.35"})]})});case"messages":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M14 18 h36 a3 3 0 0 1 3 3 v18 a3 3 0 0 1 -3 3 h-18 l-8 6 v-6 h-10 a3 3 0 0 1 -3 -3 v-18 a3 3 0 0 1 3 -3 z"}),(0,t.jsx)("line",{x1:"22",y1:"28",x2:"42",y2:"28",opacity:"0.5"}),(0,t.jsx)("line",{x1:"22",y1:"34",x2:"36",y2:"34",opacity:"0.5"})]})});case"logs":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M18 12 h22 l8 8 v32 a2 2 0 0 1 -2 2 h-28 a2 2 0 0 1 -2 -2 v-38 a2 2 0 0 1 2 -2 z"}),(0,t.jsx)("path",{d:"M40 12 v8 h8",opacity:"0.6"}),(0,t.jsx)("line",{x1:"24",y1:"32",x2:"40",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"24",y1:"38",x2:"40",y2:"38",opacity:"0.4"}),(0,t.jsx)("line",{x1:"24",y1:"44",x2:"34",y2:"44",opacity:"0.25"})]})});case"tokens":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"22",cy:"32",r:"8"}),(0,t.jsx)("line",{x1:"30",y1:"32",x2:"54",y2:"32"}),(0,t.jsx)("line",{x1:"44",y1:"32",x2:"44",y2:"38"}),(0,t.jsx)("line",{x1:"50",y1:"32",x2:"50",y2:"40"})]})});case"networks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"18"}),(0,t.jsx)("ellipse",{cx:"32",cy:"32",rx:"18",ry:"9",opacity:"0.55"}),(0,t.jsx)("line",{x1:"14",y1:"32",x2:"50",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"32",y1:"14",x2:"32",y2:"50",opacity:"0.55"})]})});default:return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"14",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"32",cy:"32",r:"3"})]})})}}function l({variant:e="generic",title:s,sub:i,cta:d,compact:o=!1}){let c=r[e],x=s??c.title,u=i??c.sub;return(0,t.jsxs)("div",{className:`text-center ${o?"py-8":"py-16"} px-4`,role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)(n,{variant:e,size:o?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${o?"text-sm":"text-base"}`,children:x}),u&&(0,t.jsx)("p",{className:`text-gray-500 ${o?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:u}),d&&(0,t.jsx)("div",{className:"mt-4",children:d.href?(0,t.jsxs)(a.default,{href:d.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[d.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,t.jsxs)("button",{onClick:d.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[d.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}function i({children:e}){return(0,t.jsx)("div",{className:"max-w-2xl mx-auto rounded-xl border border-[#26262b] bg-[#161618] shadow-lg shadow-black/20",children:e})}function d({cmd:e}){let[a,r]=(0,s.useState)(!1),n=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1800)}catch{}};return(0,t.jsxs)("div",{className:"anet-empty-cmd flex items-start sm:items-center gap-2 bg-[#0e0e10] border border-[#26262b] rounded-lg pl-4 pr-1.5 py-1.5 text-xs sm:text-sm",children:[(0,t.jsx)("code",{className:"text-cyan-300 font-mono select-all min-w-0 break-all sm:break-normal",children:e}),(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":a?"Copied":"Copy command",className:"shrink-0 rounded-md px-2 py-1.5 text-[11px] text-gray-500 hover:text-gray-200 hover:bg-[#1c1c1f] transition-colors",children:a?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-green-400",children:[(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5"})}),"Copied"]}):(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Copy"]})})]})}e.s(["EmptyState",0,l,"NodesEmptyState",0,function({hint:e,taskHistoryCount:s=0}){return e?.global_count?(0,t.jsx)(i,{children:(0,t.jsx)(l,{variant:"nodes",title:"No agents in this network",sub:`Server has ${e.global_count} nodes globally, but none are registered to the current network. Switch network or contact admin.`})}):s>0?(0,t.jsx)(i,{children:(0,t.jsx)(l,{variant:"nodes",title:"No agents online",sub:`Every agent in this network is currently offline. ${s.toLocaleString()} task${1===s?"":"s"} in history — they may have finished their work or disconnected.`,cta:{label:"View task history",href:"/tasks"}})}):(0,t.jsx)(i,{children:(0,t.jsxs)("div",{className:"text-center py-16 px-4",role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)("svg",{viewBox:"0 0 64 64",width:56,height:56,children:(0,t.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[(0,t.jsx)("rect",{x:"10",y:"20",width:"44",height:"28",rx:"2"}),(0,t.jsx)("rect",{x:"20",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"32",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"44",y:"32",width:"4",height:"8",opacity:"0.5"}),(0,t.jsx)("line",{x1:"10",y1:"26",x2:"54",y2:"26",opacity:"0.4"}),(0,t.jsx)("circle",{cx:"14",cy:"23",r:"0.8",fill:"currentColor"})]})})}),(0,t.jsx)("h3",{className:"font-medium text-gray-300 text-base",children:"Spin up your first agent"}),(0,t.jsx)("p",{className:"text-gray-500 text-sm mt-2 max-w-md mx-auto leading-relaxed",children:"Run this in a fresh terminal to register an agent with this CommHub:"}),(0,t.jsx)("div",{className:"mt-4 inline-block",children:(0,t.jsx)(d,{cmd:"npx --yes @sleep2agi/agent-network init"})}),(0,t.jsx)("p",{className:"text-gray-600 text-xs mt-3 max-w-md mx-auto",children:"Once the agent connects, it appears here automatically within a few seconds — no refresh needed."}),(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsxs)("a",{href:"https://anet.sh",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium text-gray-500 hover:text-cyan-300",children:["Full quickstart guide",(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})})}])},39704,e=>{"use strict";e.s(["SESSION_STATUS_CHIP_CLASS",0,{working:"bg-green-500/10 text-green-300 border-green-500/20",idle:"bg-gray-500/10 text-gray-300 border-gray-500/20",blocked:"bg-yellow-500/10 text-yellow-300 border-yellow-500/20",error:"bg-red-500/10 text-red-300 border-red-500/20",offline:"bg-gray-500/10 text-gray-500 border-gray-500/20"},"SESSION_STATUS_TEXT_CLASS",0,{working:"text-green-400",idle:"text-gray-400",blocked:"text-yellow-400",error:"text-red-400",offline:"text-gray-500"},"STATUS_BAR_CLASS",0,{created:"bg-gray-500",delivered:"bg-gray-400",acked:"bg-gray-300",running:"bg-green-500",replied:"bg-gray-400",closed:"bg-gray-600",failed:"bg-red-500",cancelled:"bg-gray-600",expired:"bg-gray-600"},"STATUS_CHIP_CLASS",0,{created:"bg-gray-500/10 text-gray-400 border-gray-500/20",delivered:"bg-gray-500/10 text-gray-300 border-gray-500/20",acked:"bg-gray-500/10 text-gray-300 border-gray-500/20",running:"bg-green-500/10 text-green-300 border-green-500/20",replied:"bg-gray-500/10 text-gray-300 border-gray-500/20",closed:"bg-gray-500/10 text-gray-500 border-gray-500/20",failed:"bg-red-500/10 text-red-300 border-red-500/20",cancelled:"bg-gray-500/10 text-gray-500 border-gray-500/20",expired:"bg-gray-500/10 text-gray-500 border-gray-500/20"},"STATUS_DOT_HEX",0,{created:"#9ca3af",delivered:"#9ca3af",acked:"#9ca3af",running:"#4ade80",replied:"#9ca3af",closed:"#6b7280",failed:"#f87171",cancelled:"#6b7280",expired:"#6b7280"},"TASK_STATUSES",0,["created","delivered","acked","running","replied","closed","failed","cancelled","expired"]])},8005,e=>{"use strict";var t=e.i(16309),s=e.i(33431);let a=async e=>{let t=await fetch(e);if(401===t.status)throw window.location.assign("/login"),Error("unauthorized");return t.json()},r={refreshInterval:5e3,dedupingInterval:3e3};function n(e,t){if(!t)return e;let s=e.includes("?")?"&":"?";return`${e}${s}network_id=${encodeURIComponent(t)}`}e.s(["useAnetConfig",0,function(){let{data:e}=(0,t.default)("/api/anet/config",a,{refreshInterval:3e4});return{config:e||null}},"useHealth",0,function(){let{data:e,error:s}=(0,t.default)("/api/hub/health",a,r);return{health:e||null,error:s}},"useMessages",0,function(e=100){let{networkId:l}=(0,s.useNetworkId)(),{data:i,error:d,isLoading:o}=(0,t.default)(n(`/api/hub/messages?limit=${e}`,l),a,{...r,keepPreviousData:!0});return{messages:i?.messages||[],error:d,isLoading:o}},"useNodeLifecycle",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:l,error:i}=(0,t.default)(n("/api/hub/nodes",e),a,r),d={},o={};for(let e of l?.nodes??[])e.alias&&"string"==typeof e.lifecycle_state&&(d[e.alias]=e.lifecycle_state),e.alias&&"string"==typeof e.node_id&&(o[e.alias]=e.node_id);return{lifecycleByAlias:d,nodeIdByAlias:o,error:i}},"useSessions",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:l,error:i,isLoading:d}=(0,t.default)(n("/api/hub/status",e),a,r);return{sessions:l?.sessions||[],hint:l?._hint,error:i,isLoading:d}},"useStats",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:l,error:i}=(0,t.default)(n("/api/hub/stats",e),a,r);return{stats:l?.ok?l:null,error:i}},"useTasks",0,function(e){let{networkId:l}=(0,s.useNetworkId)(),i=new URLSearchParams({limit:"100",...e}).toString(),{data:d,error:o,isLoading:c}=(0,t.default)(n(`/api/hub/tasks?${i}`,l),a,r);return{tasks:d?.tasks||[],count:d?.count??0,source:d?.source,error:o,isLoading:c}}])},40652,e=>{"use strict";var t=e.i(66239),s=e.i(91723);e.s(["useCollapsibleSearch",0,function({value:e,onChange:a,placeholder:r="Search…",label:n="Search",enabled:l=!0}){let[i,d]=(0,s.useState)(!1),o=(0,s.useCallback)(()=>{a(""),d(!1)},[a]);return{Button:(0,s.useCallback)(()=>{if(!l)return(0,t.jsx)(t.Fragment,{});let s=i||e;return(0,t.jsxs)("button",{type:"button",onClick:()=>d(e=>!e),"aria-label":i?`Close ${n.toLowerCase()}`:`Open ${n.toLowerCase()}`,"aria-pressed":i,title:i?`Close ${n.toLowerCase()}`:n,className:`relative shrink-0 inline-flex items-center justify-center rounded-full border w-9 h-9 transition-colors ${s?"border-cyan-500/40 bg-cyan-500/10 text-cyan-300":"border-[#26262b] bg-[#161618] text-gray-400 hover:text-gray-200 hover:border-[#3a3a41]"}`,children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,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"})}),e&&!i&&(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-cyan-400 ring-2 ring-[#0b0b0d]"})]})},[i,e,n,l]),Row:(0,s.useCallback)(()=>l&&(i||e)?(0,t.jsxs)("div",{className:"mb-3 sm:mb-4 flex items-center gap-2",children:[(0,t.jsx)("input",{type:"text",value:e,onChange:e=>a(e.target.value),onKeyDown:e=>{"Escape"===e.key&&o()},placeholder:r,autoFocus:i,className:"flex-1 bg-[#161618] border border-[#26262b] rounded-lg px-3 py-2 text-base sm:text-sm text-white placeholder-gray-600 focus:border-cyan-500/40 focus:outline-none"}),(0,t.jsx)("button",{type:"button",onClick:o,className:"shrink-0 text-xs text-gray-500 hover:text-gray-300 px-2 py-2","aria-label":"Clear and close search",children:"Cancel"})]}):null,[i,e,a,r,o,l]),value:e,reset:o}}])},44421,e=>{"use strict";var t=e.i(66239),s=e.i(91723),a=e.i(16309);function r(){let{data:e}=(0,a.default)("/api/anet/node-lifecycle",e=>fetch(e).then(e=>e.json()),{revalidateOnFocus:!1,dedupingInterval:6e4,shouldRetryOnError:!1});return e?.ok&&e.tools?e.tools:null}async function n(e,t){try{let s=await fetch("/api/anet/node-lifecycle",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,...t})});return{...await s.json().catch(()=>({})),httpStatus:s.status}}catch(e){return{ok:!1,error:"network_error",message:e instanceof Error?e.message:String(e),httpStatus:0}}}function l({alias:e,nodeId:a,networkId:r,onClose:i,onCompleted:d}){let[o,c]=(0,s.useState)(!1),[x,u]=(0,s.useState)(!1),[m,h]=(0,s.useState)(null);(0,s.useEffect)(()=>{let e=e=>{"Escape"!==e.key||o||i()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[i,o]);let p=m&&"number"==typeof m.in_flight_count?m.in_flight_count:0,g=async()=>{c(!0),h(null);let e=await n("stop",{node_id:a,...r?{network_id:r}:{},...x?{force:!0}:{}});(c(!1),e.ok)?d():h(e)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50",onClick:o?void 0:i,"aria-hidden":!0}),(0,t.jsxs)("div",{role:"dialog","aria-label":`停止节点 ${e}`,className:"fixed left-1/2 top-1/2 z-50 w-[min(92vw,420px)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-[#26262b] bg-[#161618] shadow-2xl",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-[#26262b] px-4 py-3",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-white",children:"停止节点"}),(0,t.jsx)("button",{onClick:o?void 0:i,"aria-label":"关闭",className:"text-gray-500 hover:text-white",children:"×"})]}),(0,t.jsxs)("div",{className:"space-y-3 px-4 py-4",children:[(0,t.jsxs)("div",{className:"text-sm text-gray-300",children:["将停止 ",(0,t.jsx)("span",{className:"font-mono text-cyan-300",children:e})," 子进程(SIGTERM,~10s 内)。配置目录保留,可通过「启动」恢复。"]}),m&&!1===m.ok&&(0,t.jsxs)("div",{className:"rounded-md border border-red-700/40 bg-red-900/20 px-3 py-2 text-xs text-red-200",children:[(0,t.jsx)("div",{className:"font-semibold",children:m.error}),m.message?(0,t.jsx)("div",{className:"mt-0.5 text-red-300/80",children:m.message}):null,"number"==typeof m.in_flight_count&&(0,t.jsxs)("div",{className:"mt-0.5 text-red-300/80",children:["当前 in-flight 任务: ",m.in_flight_count]}),m.hint?(0,t.jsx)("div",{className:"mt-1 text-red-300/60",children:m.hint}):null]}),(p>0||x)&&(0,t.jsxs)("label",{className:"flex items-start gap-2 rounded-md border border-amber-700/40 bg-amber-900/10 px-3 py-2 text-xs text-amber-200",children:[(0,t.jsx)("input",{type:"checkbox",checked:x,onChange:e=>u(e.target.checked),className:"mt-0.5"}),(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"font-semibold text-amber-300",children:"强制停止"}),p>0?`(会丢弃 ${p} 条待处理任务)`:"(覆盖 in-flight 拒绝;hub 会写 audit 行)"]})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2 border-t border-[#26262b] px-4 py-3",children:[(0,t.jsx)("button",{type:"button",disabled:o,onClick:i,className:"rounded-md px-3 py-1.5 text-sm text-gray-400 hover:text-gray-200 disabled:opacity-50",children:"取消"}),(0,t.jsx)("button",{type:"button",disabled:o||p>0&&!x,onClick:g,className:"rounded-md bg-cyan-600 px-4 py-1.5 text-sm font-medium text-white hover:bg-cyan-500 disabled:cursor-not-allowed disabled:opacity-50",children:o?"停止中…":"确认停止"})]})]})]})}function i({alias:e,nodeId:a,networkId:r,onClose:l,onCompleted:d}){let[o,c]=(0,s.useState)(!1),[x,u]=(0,s.useState)(""),[m,h]=(0,s.useState)(!1),[p,g]=(0,s.useState)(!1),[b,y]=(0,s.useState)(null);(0,s.useEffect)(()=>{let e=e=>{"Escape"!==e.key||o||l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[l,o]);let f=b&&"number"==typeof b.in_flight_count?b.in_flight_count:0,j=x===e,v=async()=>{if(!j)return;c(!0),y(null);let e=await n("delete",{node_id:a,confirm_alias:x,...r?{network_id:r}:{},...m?{force:!0}:{},...p?{delete_config:!1}:{}});(c(!1),e.ok)?d():y(e)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50",onClick:o?void 0:l,"aria-hidden":!0}),(0,t.jsxs)("div",{role:"dialog","aria-label":`删除节点 ${e}`,className:"fixed left-1/2 top-1/2 z-50 w-[min(94vw,480px)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-red-700/40 bg-[#161618] shadow-2xl",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-[#26262b] px-4 py-3",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-red-300",children:"删除节点"}),(0,t.jsx)("button",{onClick:o?void 0:l,"aria-label":"关闭",className:"text-gray-500 hover:text-white",children:"×"})]}),(0,t.jsxs)("div",{className:"space-y-3 px-4 py-4 text-sm text-gray-300",children:[(0,t.jsx)("div",{children:"这将:"}),(0,t.jsxs)("ul",{className:"list-inside list-disc space-y-1 pl-2 text-xs text-gray-400",children:[(0,t.jsxs)("li",{children:["停止 ",(0,t.jsx)("span",{className:"font-mono text-cyan-300",children:e})," 子进程(SIGTERM ~10s)"]}),(0,t.jsx)("li",{children:"从 hub 注销该节点"}),(0,t.jsx)("li",{children:"撤销该节点的 ntok"}),!p&&(0,t.jsxs)("li",{children:["配置文件备份到 ",(0,t.jsxs)("code",{className:"text-amber-300",children:["~/.anet/deleted/<ts>-",e,"/"]}),"(30 天后自动清除)"]}),p&&(0,t.jsx)("li",{className:"text-amber-300",children:"配置文件保留原地(不备份不清理 — 你勾选了「保留配置」)"})]}),b&&!1===b.ok&&(0,t.jsxs)("div",{className:"rounded-md border border-red-700/40 bg-red-900/20 px-3 py-2 text-xs text-red-200",children:[(0,t.jsx)("div",{className:"font-semibold",children:b.error}),b.message?(0,t.jsx)("div",{className:"mt-0.5 text-red-300/80",children:b.message}):null,"number"==typeof b.in_flight_count&&(0,t.jsxs)("div",{className:"mt-0.5 text-red-300/80",children:["当前 in-flight 任务: ",b.in_flight_count]}),b.hint?(0,t.jsx)("div",{className:"mt-1 text-red-300/60",children:b.hint}):null]}),(f>0||m)&&(0,t.jsxs)("label",{className:"flex items-start gap-2 rounded-md border border-amber-700/40 bg-amber-900/10 px-3 py-2 text-xs text-amber-200",children:[(0,t.jsx)("input",{type:"checkbox",checked:m,onChange:e=>h(e.target.checked),className:"mt-0.5"}),(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"font-semibold text-amber-300",children:"强制删除"}),f>0?`(会丢弃 ${f} 条待处理任务)`:"(覆盖 in-flight 拒绝)"]})]}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs text-gray-400",children:[(0,t.jsx)("input",{type:"checkbox",checked:p,onChange:e=>g(e.target.checked)}),"保留配置目录(不备份;高级用法)"]}),(0,t.jsxs)("label",{className:"block space-y-1",children:[(0,t.jsxs)("span",{className:"text-xs text-gray-400",children:["输入节点名字 ",(0,t.jsx)("span",{className:"font-mono text-cyan-300",children:e})," 确认"]}),(0,t.jsx)("input",{autoFocus:!0,value:x,onChange:e=>u(e.target.value),placeholder:e,className:"w-full rounded-md border border-[#26262b] bg-[#0e0e10] px-3 py-2 text-sm text-gray-200 focus:border-red-500 focus:outline-none",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1}),x&&!j&&(0,t.jsx)("span",{className:"text-[11px] text-red-400",children:"名字不匹配(区分大小写)"})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2 border-t border-[#26262b] px-4 py-3",children:[(0,t.jsx)("button",{type:"button",disabled:o,onClick:l,className:"rounded-md px-3 py-1.5 text-sm text-gray-400 hover:text-gray-200 disabled:opacity-50",children:"取消"}),(0,t.jsx)("button",{type:"button",disabled:o||!j||f>0&&!m,onClick:v,className:"rounded-md bg-red-600 px-4 py-1.5 text-sm font-medium text-white hover:bg-red-500 disabled:cursor-not-allowed disabled:opacity-50",children:o?"删除中…":`删除 ${e}`})]})]})]})}e.s(["NodeLifecycleMenu",0,function({nodeId:e,alias:a,lifecycleState:d,networkId:o,onCompleted:c}){let x=r(),[u,m]=(0,s.useState)(!1),[h,p]=(0,s.useState)(!1),[g,b]=(0,s.useState)(!1),[y,f]=(0,s.useState)(!1),[j,v]=(0,s.useState)(null),N=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!u)return;let e=e=>{N.current&&!N.current.contains(e.target)&&m(!1)},t=e=>{"Escape"===e.key&&m(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[u]);let k=(0,s.useCallback)(async()=>{m(!1),v(null),f(!0);let t=await n("restart",{node_id:e,...o?{network_id:o}:{}});(f(!1),t.ok)?c?.():v(t)},[e,o,c]),w="string"==typeof d&&d.length>0?d:"active",C=[];return"stopping"===w||"deleting"===w?C.push({label:"stopping"===w?"停止中…":"删除中…",key:"loading",disabled:!0,onClick:()=>{}}):"active"===w?(C.push({label:y?"重启中…":"重启节点",key:"restart",disabled:y,onClick:k}),(null===x||x.stop)&&C.push({label:"停止节点",key:"stop",onClick:()=>{m(!1),p(!0)}}),(null===x||x.delete)&&C.push({label:"删除节点",key:"delete",danger:!0,onClick:()=>{m(!1),b(!0)}})):"stopped"===w||"stop_failed"===w?(C.push({label:y?"启动中…":"启动节点",key:"restart",disabled:y,onClick:k}),C.push({label:"删除节点",key:"delete",danger:!0,onClick:()=>{m(!1),b(!0)}})):C.push({label:`状态 ${w} (不识别)`,key:"unknown",disabled:!0,onClick:()=>{}}),(0,t.jsxs)("div",{ref:N,className:"relative inline-block",onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("button",{type:"button","aria-label":`节点 ${a} 生命周期操作`,"aria-haspopup":"menu","aria-expanded":u,onClick:()=>m(e=>!e),className:"inline-flex h-8 w-8 items-center justify-center rounded-md text-gray-400 hover:bg-white/5 hover:text-white focus:outline-none focus:ring-1 focus:ring-cyan-500/50",children:(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[(0,t.jsx)("circle",{cx:"12",cy:"5",r:"1.6"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"1.6"}),(0,t.jsx)("circle",{cx:"12",cy:"19",r:"1.6"})]})}),u&&(0,t.jsx)("div",{role:"menu",className:"absolute right-0 z-40 mt-1 w-44 overflow-hidden rounded-md border border-[#26262b] bg-[#161618] shadow-xl",children:C.map(e=>(0,t.jsx)("button",{type:"button",role:"menuitem",disabled:e.disabled,onClick:e.onClick,className:`block w-full px-3 py-2 text-left text-sm transition-colors ${e.disabled?"text-gray-600 cursor-not-allowed":e.danger?"text-red-300 hover:bg-red-900/20":"text-gray-200 hover:bg-white/5"}`,children:e.label},e.key))}),j&&!1===j.ok&&!h&&!g&&(0,t.jsx)("div",{className:"absolute right-0 z-40 mt-1 w-72 rounded-md border border-red-700/40 bg-red-900/20 px-3 py-2 text-xs text-red-200",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"font-semibold",children:j.error||"error"}),j.message?(0,t.jsx)("div",{className:"mt-0.5 text-red-300/80",children:j.message}):null,"number"==typeof j.in_flight_count&&(0,t.jsxs)("div",{className:"mt-0.5 text-red-300/80",children:["in-flight: ",j.in_flight_count]}),j.hint?(0,t.jsx)("div",{className:"mt-1 text-red-300/60",children:j.hint}):null]}),(0,t.jsx)("button",{type:"button",onClick:()=>v(null),className:"shrink-0 text-red-400 hover:text-red-200","aria-label":"关闭",children:"×"})]})}),h&&(0,t.jsx)(l,{alias:a,nodeId:e,networkId:o,onClose:()=>p(!1),onCompleted:()=>{p(!1),c?.()}}),g&&(0,t.jsx)(i,{alias:a,nodeId:e,networkId:o,onClose:()=>b(!1),onCompleted:()=>{b(!1),c?.()}})]})},"useLifecycleCaps",0,r])},43462,e=>{"use strict";var t=e.i(66239),s=e.i(91723),a=e.i(27113),r=e.i(8005),n=e.i(10451),l=e.i(49093),i=e.i(33431);function d({networkId:e,value:a,onChange:r}){let[n,l]=(0,s.useState)("loading"),[i,x]=(0,s.useState)([]),[u,m]=(0,s.useState)(""),[h,p]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{let t=!0;return l("loading"),m(""),fetch(e?`/api/anet/host-supervisors?network_id=${encodeURIComponent(e)}`:"/api/anet/host-supervisors",{cache:"no-store"}).then(e=>e.json().then(t=>({status:e.status,body:t}))).then(({status:e,body:s})=>{if(!t)return;if(501===e||s?.unconfirmed){l("unconfirmed"),m(s?.error||"hub /api/host-supervisors unavailable — upgrade to >=0.9.0-preview.8"),x([]);return}if(!s?.ok){l("error"),m(s?.error||`hub ${e}`),x([]);return}let n=Array.isArray(s.daemons)?s.daemons:[];x(n),l("ready"),1!==n.length||a||r(n[0].daemon_node_id,n[0])}).catch(e=>{t&&(l("error"),m(e instanceof Error?e.message:String(e)),x([]))}),()=>{t=!1}},[e]),"loading"===n)return(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-[#26262b] bg-[#0e0e10] px-3 py-3 text-xs text-gray-500",children:[(0,t.jsxs)("svg",{className:"h-3.5 w-3.5 animate-spin",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-90",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),"正在查询可用的 host_supervisor 节点…"]});if("unconfirmed"===n)return(0,t.jsxs)("div",{className:"rounded-md border border-amber-700/40 bg-amber-900/10 px-3 py-3 text-xs text-amber-200",children:[(0,t.jsx)("div",{className:"font-semibold mb-1",children:"hub 暂未升级"}),(0,t.jsx)("div",{className:"text-amber-200/80",children:u}),(0,t.jsxs)("div",{className:"mt-1 text-[11px] text-amber-200/60",children:["升级到 ",(0,t.jsx)("code",{className:"rounded bg-black/40 px-1 py-0.5",children:"@sleep2agi/commhub-server@0.9.0-preview.8"})," 后选服务器功能才会出现。"]})]});if("error"===n)return(0,t.jsxs)("div",{className:"rounded-md border border-red-700/40 bg-red-900/10 px-3 py-3 text-xs text-red-200",children:["查询 host_supervisor 节点失败:",u]});if(0===i.length)return(0,t.jsxs)("div",{className:"rounded-md border border-[#26262b] bg-[#0e0e10] px-3 py-4 text-xs text-gray-300",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-gray-200",children:"还没有可用的 host_supervisor 节点"}),(0,t.jsx)("p",{className:"mt-1 text-gray-500",children:"要在某台机器上创建节点,先在那台机器上跑一次 daemon 初始化命令:"}),(0,t.jsx)("pre",{className:"mt-2 overflow-x-auto rounded bg-black/40 p-2 text-[11px] text-cyan-300",children:`# 任选一台目标机器(你的笔记本 / 一台服务器都行)
2
- anet daemon up my-daemon`}),(0,t.jsx)("p",{className:"mt-2 text-gray-500",children:"注册成功后这里会自动出现,无需刷新。"})]});if(1===i.length&&!h){let e=i[0];return(0,t.jsxs)("div",{className:"rounded-md border border-cyan-700/40 bg-cyan-900/10 px-3 py-3 text-xs text-cyan-100",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-cyan-400/80",children:"将在"})," ",(0,t.jsx)("span",{className:"font-semibold",children:e.alias}),(0,t.jsxs)("span",{className:"text-cyan-300/60",children:[" (",e.hostname||"—",") "]}),(0,t.jsx)("span",{className:"text-cyan-400/80",children:"上创建"})]}),(0,t.jsx)("button",{type:"button",onClick:()=>p(!0),className:"text-[11px] text-cyan-400 hover:text-cyan-200 underline-offset-2 hover:underline",children:"详情 →"})]}),(0,t.jsx)(c,{runtimes:e.runtimes_supported,className:"mt-1"})]})}return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[(0,t.jsxs)("span",{children:["选择一台 host_supervisor 节点(",i.length," 台在线)"]}),h&&1===i.length&&(0,t.jsx)("button",{type:"button",onClick:()=>p(!1),className:"text-[11px] text-gray-500 hover:text-gray-300",children:"← 折叠"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-2 lg:grid-cols-3",children:i.map(e=>(0,t.jsx)(o,{daemon:e,selected:e.daemon_node_id===a,onClick:()=>r(e.daemon_node_id,e)},e.daemon_node_id))})]})}function o({daemon:e,selected:s,onClick:a}){let r=e.host_telemetry?.alert_level||"gray";return(0,t.jsxs)("button",{type:"button",onClick:a,"aria-pressed":s,className:`flex w-full flex-col gap-1.5 rounded-md border px-3 py-2.5 text-left text-xs transition-colors ${s?"border-cyan-600 bg-cyan-900/15 text-cyan-100":"border-[#26262b] bg-[#0e0e10] text-gray-300 hover:border-[#3a3a41]"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"truncate font-semibold",children:e.alias}),(0,t.jsx)(x,{level:r})]}),(0,t.jsx)("div",{className:"truncate text-[11px] text-gray-500",children:e.hostname||"—"}),(0,t.jsx)(c,{runtimes:e.runtimes_supported}),(e.host_telemetry?.cpu_cores!=null||e.host_telemetry?.mem_gb!=null)&&(0,t.jsxs)("div",{className:"flex gap-3 text-[10px] text-gray-500",children:[e.host_telemetry?.cpu_cores!=null&&(0,t.jsxs)("span",{children:[e.host_telemetry.cpu_cores," 核"]}),e.host_telemetry?.mem_gb!=null&&(0,t.jsxs)("span",{children:[e.host_telemetry.mem_gb," GB"]})]})]})}function c({runtimes:e,className:s=""}){return e&&0!==e.length?(0,t.jsx)("div",{className:`flex flex-wrap gap-1 ${s}`,children:e.map(e=>(0,t.jsx)("span",{className:"rounded bg-[#1c1c1f] px-1.5 py-0.5 text-[10px] text-gray-400",children:e},e))}):(0,t.jsx)("div",{className:`text-[10px] text-gray-600 ${s}`,children:"runtimes_supported: —"})}function x({level:e}){return(0,t.jsx)("span",{className:`rounded border px-1.5 py-0.5 text-[10px] ${{green:"bg-green-600/20 text-green-300 border-green-700/40",yellow:"bg-amber-600/20 text-amber-300 border-amber-700/40",red:"bg-red-600/20 text-red-300 border-red-700/40",gray:"bg-gray-600/20 text-gray-400 border-gray-700/40"}[e]}`,children:{green:"正常",yellow:"注意",red:"警报",gray:"离线"}[e]})}let u=[{id:"claude-agent-sdk",label:"Claude Agent SDK",models:["deepseek-v4-pro","MiniMax-M3","claude-sonnet-4-6","claude-opus-4-x"],defaultModel:"claude-sonnet-4-6"},{id:"codex-sdk",label:"Codex SDK",models:["gpt-5.5"],defaultModel:"gpt-5.5"},{id:"grok-build-acp",label:"Grok (build-acp)",models:["grok-build"],defaultModel:"grok-build"}],m=["default","acceptEdits","plan","bypassPermissions"],h=["服务器","名字","Runtime","模型","参数","确认"];function p({networkId:e,onClose:a,onCreated:r}){let[n,l]=(0,s.useState)(0),[o,c]=(0,s.useState)(null),[x,g]=(0,s.useState)(null),[b,y]=(0,s.useState)(""),[f,j]=(0,s.useState)(u[0].id),[v,N]=(0,s.useState)(""),[k,w]=(0,s.useState)("default"),[C,S]=(0,s.useState)(""),[_,$]=(0,s.useState)(""),[A,T]=(0,s.useState)(""),[L,I]=(0,s.useState)("form"),[E,M]=(0,s.useState)(""),[B,z]=(0,s.useState)(!1),{networkId:O}=(0,i.useNetworkId)(),U=e||O;(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&"creating"!==L&&a()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[a,L]),(0,s.useEffect)(()=>{if("done"!==L||B)return;let e=!0,t=0,s=b.trim(),a=async()=>{t+=1;try{let t=U?`/api/hub/status?network_id=${encodeURIComponent(U)}`:"/api/hub/status",a=await fetch(t,{cache:"no-store"}),r=await a.json().catch(()=>({})),n=Array.isArray(r?.sessions)?r.sessions:Array.isArray(r)?r:[];if(e&&n.some(e=>e?.alias===s))return void z(!0)}catch{}e&&t<16&&window.setTimeout(a,1500)},r=window.setTimeout(a,1200);return()=>{e=!1,window.clearTimeout(r)}},[L,B,U,b]);let P=u.find(e=>e.id===f)||u[0],R=b.trim().length>0,H=0===n&&!!o||1===n&&R||n>=2&&n<h.length,D="creating"===L;async function W(){I("creating"),M("");let t=e=>""===e.trim()?void 0:Number(e),s=v||P.defaultModel,a={name:b.trim(),runtime:f,model:s,flags:{permissionMode:k,maxTurns:t(C),budget:t(_),timeout:t(A)}};try{let t=await fetch("/api/anet/node-create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node_spec:a,...o?{daemon_node_id:o}:{},...e?{network_id:e}:{}})}),s=await t.json().catch(()=>({}));t.ok&&s?.ok?(I("done"),M("创建请求已下发,节点正在拉起…"),r?.(s.result)):s?.unconfirmed?(I("unconfirmed"),M(`后端 create_node 未就绪:${s?.error||"不可用"}(测试 hub 可能未含 #299)`)):(I("error"),M(s?.error?`创建失败:${s.error}`:"创建失败"))}catch(e){I("error"),M(`创建失败:${e instanceof Error?e.message:"网络错误"}`)}}let F="w-full rounded-md border border-[#26262b] bg-[#0e0e10] px-3 py-2 text-sm text-gray-200 focus:border-cyan-600 focus:outline-none";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:a,"aria-hidden":!0}),(0,t.jsxs)("div",{role:"dialog","aria-label":"新建节点",className:"fixed left-1/2 top-1/2 z-50 w-[min(94vw,440px)] md:w-[min(92vw,720px)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-[#26262b] bg-[#161618] shadow-2xl",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-[#26262b] px-4 py-3",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-white",children:"新建节点"}),(0,t.jsx)("button",{onClick:a,"aria-label":"关闭",className:"inline-flex h-8 w-8 items-center justify-center rounded-md text-gray-500 hover:bg-white/5 hover:text-white",children:(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:(0,t.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})})]}),(0,t.jsx)("div",{className:"flex items-center gap-1.5 px-4 pt-3",children:h.map((e,s)=>(0,t.jsxs)("div",{className:"flex flex-1 flex-col items-center gap-1",children:[(0,t.jsx)("div",{className:`h-1 w-full rounded-full ${s<=n?"bg-cyan-500":"bg-[#26262b]"}`}),(0,t.jsx)("span",{className:`text-[10px] ${s===n?"text-cyan-300":"text-gray-600"}`,children:e})]},e))}),(0,t.jsx)("div",{className:"min-h-[180px] px-4 py-4",children:"form"!==L?(0,t.jsxs)("div",{className:"flex h-[180px] flex-col items-center justify-center gap-3 text-center",children:[D&&(0,t.jsxs)("svg",{className:"h-7 w-7 animate-spin text-cyan-400",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-90",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),(0,t.jsx)("div",{className:`text-sm ${"done"===L?"text-green-300":"error"===L?"text-red-300":"unconfirmed"===L?"text-amber-300":"text-gray-300"}`,children:D?"正在创建…":"done"===L&&B?`✓ ${b.trim()} 已上线`:E}),"done"===L&&(B?(0,t.jsx)("p",{className:"text-[11px] text-green-500/80",children:"节点已注册,已出现在节点列表。"}):(0,t.jsxs)("p",{className:"inline-flex items-center gap-1.5 text-[11px] text-gray-500",children:[(0,t.jsxs)("svg",{className:"h-3 w-3 animate-spin",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-90",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),"正在监测 ",b.trim()," 注册…(最长 ~24s)"]}))]}):(0,t.jsxs)(t.Fragment,{children:[0===n&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"在哪台机器上创建"}),(0,t.jsx)(d,{networkId:U||void 0,value:o,onChange:(e,t)=>{c(e),g(t);let s=t?.runtimes_supported;s&&s.length>0&&!s.includes(f)&&(j(s[0]),N(""))}}),!o&&(0,t.jsxs)("p",{className:"text-[11px] text-gray-600",children:["没选服务器之前无法继续;如果列表是空的,按提示在目标机器上跑 ",(0,t.jsx)("code",{className:"rounded bg-black/40 px-1 py-0.5",children:"anet daemon up <name>"}),"。"]})]}),1===n&&(0,t.jsxs)("label",{className:"block space-y-1.5",children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"节点名字"}),(0,t.jsx)("input",{autoFocus:!0,value:b,onChange:e=>y(e.target.value),placeholder:"例如 my-agent-1",className:F}),!R&&(0,t.jsx)("span",{className:"text-[11px] text-gray-600",children:"名字不能为空"})]}),2===n&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("span",{className:"text-xs text-gray-400",children:["Runtime",x?`(${x.alias} 支持)`:""]}),u.map(e=>{let s=x?.runtimes_supported,a=Array.isArray(s)&&s.length>0&&!s.includes(e.id),r=f===e.id;return(0,t.jsxs)("button",{type:"button",disabled:a,onClick:()=>{a||(j(e.id),N(""))},title:a?`${x?.alias||"该 daemon"} 未声明支持此 runtime`:void 0,className:`flex w-full items-center justify-between rounded-md border px-3 py-2 text-sm transition-colors ${a?"border-[#1c1c1f] bg-[#0a0a0c] text-gray-600 cursor-not-allowed":r?"border-cyan-600 bg-cyan-900/15 text-cyan-200":"border-[#26262b] bg-[#0e0e10] text-gray-300 hover:border-[#3a3a41]"}`,children:[(0,t.jsxs)("span",{children:[e.label,a&&(0,t.jsx)("span",{className:"ml-2 text-[10px] text-gray-700",children:"该 daemon 不支持"})]}),r&&!a&&(0,t.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5"})})]},e.id)})]}),3===n&&(0,t.jsxs)("label",{className:"block space-y-1.5",children:[(0,t.jsxs)("span",{className:"text-xs text-gray-400",children:["模型(",P.label,")"]}),(0,t.jsxs)("select",{value:v,onChange:e=>N(e.target.value),className:F,children:[(0,t.jsxs)("option",{value:"",children:["默认(",P.defaultModel,")"]}),P.models.map(e=>(0,t.jsx)("option",{value:e,children:e},e))]})]}),4===n&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("label",{className:"block space-y-1.5",children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"permissionMode"}),(0,t.jsx)("select",{value:k,onChange:e=>w(e.target.value),className:F,children:m.map(e=>(0,t.jsx)("option",{value:e,children:e},e))})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,t.jsxs)("label",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-[11px] text-gray-500",children:"maxTurns"}),(0,t.jsx)("input",{inputMode:"numeric",value:C,onChange:e=>S(e.target.value),className:F})]}),(0,t.jsxs)("label",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-[11px] text-gray-500",children:"budget"}),(0,t.jsx)("input",{inputMode:"numeric",value:_,onChange:e=>$(e.target.value),className:F})]}),(0,t.jsxs)("label",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-[11px] text-gray-500",children:"timeout"}),(0,t.jsx)("input",{inputMode:"numeric",value:A,onChange:e=>T(e.target.value),className:F})]})]})]}),5===n&&(0,t.jsx)("div",{className:"space-y-2 text-sm",children:(0,t.jsx)("div",{className:"rounded-md border border-[#26262b] bg-[#0e0e10] divide-y divide-[#1c1c1f]",children:[["服务器",o?`${o.slice(0,24)}…`:"—"],["名字",b.trim()||"—"],["Runtime",P.label],["模型",v||`默认(${P.defaultModel})`],["permissionMode",k],["maxTurns / budget / timeout",`${C||"—"} / ${_||"—"} / ${A||"—"}`]].map(([e,s])=>(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3 px-3 py-2",children:[(0,t.jsx)("span",{className:"shrink-0 text-gray-500 text-xs",children:e}),(0,t.jsx)("span",{className:"text-right text-gray-200 text-xs break-all",children:s})]},e))})})]})}),"form"===L?(0,t.jsxs)("div",{className:"flex items-center justify-between border-t border-[#26262b] px-4 py-3",children:[(0,t.jsx)("button",{type:"button",onClick:()=>0===n?a():l(n-1),className:"rounded-md px-3 py-1.5 text-sm text-gray-400 hover:text-gray-200",children:0===n?"取消":"上一步"}),n<h.length-1?(0,t.jsx)("button",{type:"button",disabled:!H,onClick:()=>l(n+1),className:`rounded-md px-4 py-1.5 text-sm font-medium ${H?"bg-cyan-600 text-white hover:bg-cyan-500":"bg-[#1c1c1f] text-gray-600 cursor-not-allowed"}`,children:"下一步"}):(0,t.jsx)("button",{type:"button",onClick:W,className:"rounded-md bg-green-600 px-4 py-1.5 text-sm font-medium text-white hover:bg-green-500",children:"创建节点"})]}):(0,t.jsxs)("div",{className:"flex items-center justify-end border-t border-[#26262b] px-4 py-3",children:[(0,t.jsx)("button",{type:"button",onClick:a,className:"rounded-md bg-[#1c1c1f] px-4 py-1.5 text-sm text-gray-200 hover:bg-[#26262b]",children:"done"===L?"完成":"关闭"}),("error"===L||"unconfirmed"===L)&&(0,t.jsx)("button",{type:"button",onClick:()=>I("form"),className:"ml-2 rounded-md bg-cyan-600 px-4 py-1.5 text-sm text-white hover:bg-cyan-500",children:"返回修改"})]})]})]})}var g=e.i(44421),b=e.i(93226),y=e.i(24373),f=e.i(40652),j=e.i(39704),v=e.i(71257);function N(e){return e?e.length>12?`${e.slice(0,8)}…`:e:"—"}e.s(["default",0,function(){let{sessions:e,isLoading:i}=(0,r.useSessions)(),{health:d}=(0,r.useHealth)(),{lifecycleByAlias:o,nodeIdByAlias:c}=(0,r.useNodeLifecycle)(),{hasUnread:x,unreadCount:u}=(0,v.useChatUnread)(),{mutate:m}=(0,n.useSWRConfig)(),h=()=>{m(e=>"string"==typeof e&&(e.startsWith("/api/hub/nodes")||e.startsWith("/api/hub/status")))},k=d?.sse_sessions||{},w=e=>(e.network_id?k[`${e.network_id}:${e.alias}`]:void 0)??k[e.alias],[C,S]=(0,s.useState)(""),[_,$]=(0,s.useState)(""),[A,T]=(0,s.useState)("list"),[L,I]=(0,s.useState)(null),[E,M]=(0,s.useState)(!1),B=(0,f.useCollapsibleSearch)({value:_,onChange:$,placeholder:"Search nodes…",label:"Search nodes",enabled:e.length>0}),z=e.map(e=>({...e,online:!!w(e)})).filter(e=>"online"===C?e.online:"offline"===C?!e.online:!C||C===e.status).filter(e=>!_||e.alias.toLowerCase().includes(_.toLowerCase())||(e.agent||"").toLowerCase().includes(_.toLowerCase())).sort((e,t)=>!!t.online-!!e.online||("working"===t.status)-("working"===e.status)),O=e.filter(e=>w(e)).length;return(0,t.jsxs)("div",{className:"min-h-screen max-w-full overflow-x-hidden bg-[#0b0b0d] text-gray-100 p-4 sm:p-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-4 sm:mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-white lg:ml-0 ml-10",children:"Nodes"}),(0,t.jsxs)("span",{className:"text-xs bg-green-900/30 text-green-400 px-2 py-0.5 rounded-full border border-green-800/30 shrink-0",children:[O," online"]}),(0,t.jsxs)("span",{className:"text-xs bg-gray-900/30 text-gray-400 px-2 py-0.5 rounded-full border border-gray-800/30 shrink-0",children:[e.length," total"]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>M(!0),"aria-label":"新建节点",className:"inline-flex items-center gap-1 rounded-lg border border-cyan-700/50 bg-cyan-900/15 px-3 py-1.5 text-sm font-medium text-cyan-300 hover:bg-cyan-900/25 transition-colors",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"text-base leading-none",children:"+"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"新建节点"})]}),(0,t.jsx)(B.Button,{})]})]}),E&&(0,t.jsx)(p,{onClose:()=>M(!1)}),(0,t.jsx)(B.Row,{}),e.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-3 mb-4 sm:mb-6",children:[(0,t.jsxs)("select",{value:C,onChange:e=>S(e.target.value),className:"bg-[#161618] border border-[#26262b] rounded-lg px-3 py-2 text-base sm:text-sm text-white focus:border-blue-500/50 focus:outline-none",children:[(0,t.jsx)("option",{value:"",children:"All"}),(0,t.jsx)("option",{value:"online",children:"Online"}),(0,t.jsx)("option",{value:"offline",children:"Offline"}),(0,t.jsx)("option",{value:"working",children:"Working"}),(0,t.jsx)("option",{value:"idle",children:"Idle"}),(0,t.jsx)("option",{value:"blocked",children:"Blocked"}),(0,t.jsx)("option",{value:"error",children:"Error"})]}),(0,t.jsx)("div",{className:"hidden sm:flex ml-auto rounded-lg border border-[#26262b] bg-[#161618] p-1 text-sm",children:["list","grid"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>T(e),className:`rounded-md px-3 py-1.5 transition-colors ${A===e?"bg-cyan-500/10 text-cyan-300":"text-gray-500 hover:text-gray-200"}`,children:"list"===e?"List":"Grid"},e))})]}),i?(0,t.jsx)("div",{className:"animate-pulse space-y-2",children:[1,2,3,4].map(e=>(0,t.jsx)("div",{className:"h-16 bg-gray-800/20 rounded-lg"},e))}):0===z.length?0===e.length?(0,t.jsx)(b.NodesEmptyState,{}):(0,t.jsx)(b.EmptyState,{variant:"nodes",title:"No nodes match your filters",sub:"Try clearing search or status filters, or wait for an agent to register."}):"grid"===A?(0,t.jsx)("div",{className:"grid min-w-0 grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:z.map(e=>{let s=e.online?e.status:"offline",r="number"==typeof e.progress?e.progress:0,n=x(e.alias);return(0,t.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>I(e.alias),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),I(e.alias))},className:`relative min-w-0 max-w-full overflow-hidden rounded-xl border border-[#26262b] bg-[#161618] p-4 transition-colors hover:border-cyan-500/40 cursor-pointer ${!e.online?"opacity-60":""}`,children:[!e.online&&(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:(0,t.jsx)("span",{className:"rotate-[-20deg] rounded-xl border border-white/10 bg-black/20 px-5 py-2 text-xl font-bold uppercase tracking-[0.35em] text-white/10",children:"Offline"})}),(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsxs)("div",{className:"relative shrink-0",children:[(0,t.jsxs)("span",{className:"relative inline-flex shrink-0",children:[(0,t.jsx)(y.AliasAvatar,{alias:e.alias,size:36}),u(e.alias)>0&&(0,t.jsx)("span",{"aria-label":`${u(e.alias)} 条未读`,className:"absolute -top-1 -right-1.5 min-w-[16px] h-4 px-1 rounded-full bg-red-500 text-white text-[9px] font-semibold leading-4 text-center ring-2 ring-[#161618]",children:u(e.alias)>99?"99+":u(e.alias)})]}),n&&(0,t.jsx)("span",{className:"absolute -right-1 -top-1 h-3 w-3 rounded-full border-2 border-[#161618] bg-red-500"})]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate text-base font-semibold text-white",children:e.alias}),n&&(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-red-500/15 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-red-300",children:"New"}),(0,t.jsx)("span",{className:`shrink-0 rounded-md border px-2 py-0.5 text-[10px] uppercase tracking-wide ${j.SESSION_STATUS_CHIP_CLASS[s]||j.SESSION_STATUS_CHIP_CLASS.offline}`,children:s})]}),(0,t.jsxs)("div",{className:"mt-0.5 truncate text-xs text-gray-500",children:[e.agent||"—",(0,t.jsx)("span",{className:"text-gray-700 mx-1.5",children:"·"}),(0,t.jsx)("span",{title:e.server||"",children:N(e.server)})]})]}),(0,t.jsx)("span",{className:"hidden shrink-0 rounded-lg border border-cyan-500/15 bg-cyan-500/5 px-2 py-1 text-[10px] text-cyan-300/70 sm:inline",children:"Tap to chat"}),(0,t.jsx)(g.NodeLifecycleMenu,{nodeId:c[e.alias]||e.node_id||e.alias,alias:e.alias,lifecycleState:o[e.alias],networkId:e.network_id||null,onCompleted:h})]}),(0,t.jsxs)("div",{className:"mt-3 rounded-lg border border-[#1c1c1f] bg-[#0e0e10] px-3 py-2 text-xs",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-gray-600",children:"Current task"}),(0,t.jsx)("span",{className:"text-[10px] text-gray-600",children:(0,a.timeAgo)(e.last_seen_at||e.updated_at)})]}),(0,t.jsx)("div",{className:`mt-1 line-clamp-2 ${e.task?"text-gray-300":"text-gray-600 italic"}`,children:e.task||"No current task"})]}),r>0&&r<100&&(0,t.jsx)("div",{className:"mt-3 h-1.5 overflow-hidden rounded-full bg-gray-800",children:(0,t.jsx)("div",{className:"h-1.5 rounded-full bg-cyan-400 transition-all",style:{width:`${r}%`}})})]},e.alias)})}):(0,t.jsxs)("div",{className:"space-y-1 sm:space-y-2",children:[(0,t.jsxs)("div",{className:"hidden sm:grid sm:grid-cols-10 gap-2 px-4 py-2 text-xs text-gray-600 uppercase",children:[(0,t.jsx)("div",{className:"col-span-1",children:"Status"}),(0,t.jsx)("div",{className:"col-span-2",children:"Alias"}),(0,t.jsx)("div",{className:"col-span-2",children:"Agent · Server"}),(0,t.jsx)("div",{className:"col-span-4",children:"Current Task"}),(0,t.jsx)("div",{className:"col-span-1",children:"Updated"})]}),z.map(e=>{let s=e.online?e.status:"offline",r=x(e.alias);return(0,t.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>I(e.alias),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),I(e.alias))},className:`rounded-lg border border-[#26262b] bg-[#161618] px-3 py-2 sm:px-4 sm:py-3 transition-colors hover:border-cyan-500/40 cursor-pointer ${!e.online?"opacity-50":""}`,children:[(0,t.jsxs)("div",{className:"hidden sm:grid sm:grid-cols-10 gap-2 items-center",children:[(0,t.jsx)("div",{className:"col-span-1",children:(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-md border ${j.SESSION_STATUS_CHIP_CLASS[s]||j.SESSION_STATUS_CHIP_CLASS.offline}`,children:s})}),(0,t.jsx)("div",{className:"col-span-2 min-w-0",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsxs)("div",{className:"relative shrink-0",children:[(0,t.jsxs)("span",{className:"relative inline-flex shrink-0",children:[(0,t.jsx)(y.AliasAvatar,{alias:e.alias,size:20}),u(e.alias)>0&&(0,t.jsx)("span",{"aria-label":`${u(e.alias)} 条未读`,className:"absolute -top-1.5 -right-2 min-w-[15px] h-[15px] px-1 rounded-full bg-red-500 text-white text-[9px] font-semibold leading-[15px] text-center",children:u(e.alias)>99?"99+":u(e.alias)})]}),r&&(0,t.jsx)("span",{className:"absolute -right-1 -top-1 h-2.5 w-2.5 rounded-full border border-[#161618] bg-red-500"})]}),(0,t.jsx)("span",{className:"truncate text-sm font-medium text-white",children:e.alias}),r&&(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-red-500/15 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-red-300",children:"New"})]})}),(0,t.jsx)("div",{className:"col-span-2 truncate text-xs text-gray-400",title:e.server||"",children:(0,t.jsxs)("span",{className:"truncate",children:[e.agent||"--",(0,t.jsx)("span",{className:"text-gray-700 mx-1.5",children:"·"}),N(e.server)]})}),(0,t.jsx)("div",{className:"col-span-4 truncate text-xs text-gray-500",title:e.task||"",children:e.task||"--"}),(0,t.jsxs)("div",{className:"col-span-1 flex items-center justify-between gap-2 text-xs text-gray-500",children:[(0,t.jsx)("span",{className:"truncate",children:(0,a.timeAgo)(e.last_seen_at||e.updated_at)}),(0,t.jsx)(g.NodeLifecycleMenu,{nodeId:c[e.alias]||e.node_id||e.alias,alias:e.alias,lifecycleState:o[e.alias],networkId:e.network_id||null,onCompleted:h})]})]}),(0,t.jsxs)("div",{className:"sm:hidden space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsxs)("div",{className:"relative shrink-0",children:[(0,t.jsx)(y.AliasAvatar,{alias:e.alias,size:28}),r&&(0,t.jsx)("span",{className:"absolute -right-1 -top-1 h-3 w-3 rounded-full border-2 border-[#161618] bg-red-500"})]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)("div",{className:"truncate text-sm font-medium text-white",children:e.alias}),r&&(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-red-500/15 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-red-300",children:"New"})]}),(0,t.jsxs)("div",{className:"truncate text-[10px] text-gray-500",children:[e.agent||"—"," · ",(0,a.timeAgo)(e.last_seen_at||e.updated_at)]})]}),(0,t.jsx)("span",{className:`shrink-0 text-xs px-2 py-0.5 rounded-md border ${j.SESSION_STATUS_CHIP_CLASS[s]||j.SESSION_STATUS_CHIP_CLASS.offline}`,children:s}),(0,t.jsx)(g.NodeLifecycleMenu,{nodeId:c[e.alias]||e.node_id||e.alias,alias:e.alias,lifecycleState:o[e.alias],networkId:e.network_id||null,onCompleted:h})]}),e.task&&(0,t.jsx)("div",{className:"truncate text-xs text-gray-500",children:e.task})]})]},e.alias)})]}),L&&(0,t.jsx)(l.TaskChatPanel,{alias:L,onClose:()=>I(null)})]})}],43462)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,27113,e=>{"use strict";var t=e.i(53116);e.s(["previewContent",0,function(e){return e&&e.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\s+/g," ").trim()||"--"},"timeAgo",0,function(e){return(0,t.relativeAgo)(e)??"--"}])},24373,e=>{"use strict";var t=e.i(66239);let s=[180,200,220,270,300,330,30,90];function a(e){let t=0;for(let s=0;s<e.length;s++)t=31*t+e.charCodeAt(s)>>>0;let a=s[t%s.length];return{bg:`hsl(${a} 55% 22%)`,ring:`hsl(${a} 60% 45%)`,text:`hsl(${a} 80% 78%)`}}function r(e){return e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"}e.s(["AliasAvatar",0,function({alias:e,size:s=28,className:n=""}){if(/\bgrok\b|grok-build|grok测试员|grok-demo/i.test(e))return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border border-emerald-500/45 bg-emerald-950/70 shrink-0 ${n}`,style:{width:s,height:s,backgroundImage:"url(/vendors/grok.svg)",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"68% 68%"},title:e,"aria-hidden":!0});let l=a(e),i=Math.max(9,Math.round(.42*s));return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${n}`,style:{width:s,height:s,fontSize:i,backgroundColor:l.bg,borderColor:l.ring,color:l.text},title:e,"aria-hidden":!0,children:r(e)})},"aliasAvatarColors",0,a,"aliasInitial",0,r])},93226,e=>{"use strict";var t=e.i(66239),s=e.i(91723),a=e.i(49357);let r={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function n({variant:e,size:s}){let a={width:s,height:s},r={fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"nodes":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"14",r:"4"}),(0,t.jsx)("circle",{cx:"14",cy:"44",r:"4"}),(0,t.jsx)("circle",{cx:"50",cy:"44",r:"4"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"14",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"50",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"18",y1:"44",x2:"46",y2:"44",strokeDasharray:"3 3",opacity:"0.6"})]})});case"tasks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("rect",{x:"14",y:"14",width:"36",height:"6",rx:"1.5"}),(0,t.jsx)("rect",{x:"14",y:"26",width:"36",height:"6",rx:"1.5",opacity:"0.6"}),(0,t.jsx)("rect",{x:"14",y:"38",width:"36",height:"6",rx:"1.5",opacity:"0.35"})]})});case"messages":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M14 18 h36 a3 3 0 0 1 3 3 v18 a3 3 0 0 1 -3 3 h-18 l-8 6 v-6 h-10 a3 3 0 0 1 -3 -3 v-18 a3 3 0 0 1 3 -3 z"}),(0,t.jsx)("line",{x1:"22",y1:"28",x2:"42",y2:"28",opacity:"0.5"}),(0,t.jsx)("line",{x1:"22",y1:"34",x2:"36",y2:"34",opacity:"0.5"})]})});case"logs":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M18 12 h22 l8 8 v32 a2 2 0 0 1 -2 2 h-28 a2 2 0 0 1 -2 -2 v-38 a2 2 0 0 1 2 -2 z"}),(0,t.jsx)("path",{d:"M40 12 v8 h8",opacity:"0.6"}),(0,t.jsx)("line",{x1:"24",y1:"32",x2:"40",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"24",y1:"38",x2:"40",y2:"38",opacity:"0.4"}),(0,t.jsx)("line",{x1:"24",y1:"44",x2:"34",y2:"44",opacity:"0.25"})]})});case"tokens":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"22",cy:"32",r:"8"}),(0,t.jsx)("line",{x1:"30",y1:"32",x2:"54",y2:"32"}),(0,t.jsx)("line",{x1:"44",y1:"32",x2:"44",y2:"38"}),(0,t.jsx)("line",{x1:"50",y1:"32",x2:"50",y2:"40"})]})});case"networks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"18"}),(0,t.jsx)("ellipse",{cx:"32",cy:"32",rx:"18",ry:"9",opacity:"0.55"}),(0,t.jsx)("line",{x1:"14",y1:"32",x2:"50",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"32",y1:"14",x2:"32",y2:"50",opacity:"0.55"})]})});default:return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"14",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"32",cy:"32",r:"3"})]})})}}function l({variant:e="generic",title:s,sub:i,cta:d,compact:o=!1}){let c=r[e],x=s??c.title,u=i??c.sub;return(0,t.jsxs)("div",{className:`text-center ${o?"py-8":"py-16"} px-4`,role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)(n,{variant:e,size:o?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${o?"text-sm":"text-base"}`,children:x}),u&&(0,t.jsx)("p",{className:`text-gray-500 ${o?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:u}),d&&(0,t.jsx)("div",{className:"mt-4",children:d.href?(0,t.jsxs)(a.default,{href:d.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[d.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,t.jsxs)("button",{onClick:d.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[d.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}function i({children:e}){return(0,t.jsx)("div",{className:"max-w-2xl mx-auto rounded-xl border border-[#26262b] bg-[#161618] shadow-lg shadow-black/20",children:e})}function d({cmd:e}){let[a,r]=(0,s.useState)(!1),n=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1800)}catch{}};return(0,t.jsxs)("div",{className:"anet-empty-cmd flex items-start sm:items-center gap-2 bg-[#0e0e10] border border-[#26262b] rounded-lg pl-4 pr-1.5 py-1.5 text-xs sm:text-sm",children:[(0,t.jsx)("code",{className:"text-cyan-300 font-mono select-all min-w-0 break-all sm:break-normal",children:e}),(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":a?"Copied":"Copy command",className:"shrink-0 rounded-md px-2 py-1.5 text-[11px] text-gray-500 hover:text-gray-200 hover:bg-[#1c1c1f] transition-colors",children:a?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-green-400",children:[(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5"})}),"Copied"]}):(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Copy"]})})]})}e.s(["EmptyState",0,l,"NodesEmptyState",0,function({hint:e,taskHistoryCount:s=0}){return e?.global_count?(0,t.jsx)(i,{children:(0,t.jsx)(l,{variant:"nodes",title:"No agents in this network",sub:`Server has ${e.global_count} nodes globally, but none are registered to the current network. Switch network or contact admin.`})}):s>0?(0,t.jsx)(i,{children:(0,t.jsx)(l,{variant:"nodes",title:"No agents online",sub:`Every agent in this network is currently offline. ${s.toLocaleString()} task${1===s?"":"s"} in history — they may have finished their work or disconnected.`,cta:{label:"View task history",href:"/tasks"}})}):(0,t.jsx)(i,{children:(0,t.jsxs)("div",{className:"text-center py-16 px-4",role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)("svg",{viewBox:"0 0 64 64",width:56,height:56,children:(0,t.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[(0,t.jsx)("rect",{x:"10",y:"20",width:"44",height:"28",rx:"2"}),(0,t.jsx)("rect",{x:"20",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"32",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"44",y:"32",width:"4",height:"8",opacity:"0.5"}),(0,t.jsx)("line",{x1:"10",y1:"26",x2:"54",y2:"26",opacity:"0.4"}),(0,t.jsx)("circle",{cx:"14",cy:"23",r:"0.8",fill:"currentColor"})]})})}),(0,t.jsx)("h3",{className:"font-medium text-gray-300 text-base",children:"Spin up your first agent"}),(0,t.jsx)("p",{className:"text-gray-500 text-sm mt-2 max-w-md mx-auto leading-relaxed",children:"Run this in a fresh terminal to register an agent with this CommHub:"}),(0,t.jsx)("div",{className:"mt-4 inline-block",children:(0,t.jsx)(d,{cmd:"npx --yes @sleep2agi/agent-network init"})}),(0,t.jsx)("p",{className:"text-gray-600 text-xs mt-3 max-w-md mx-auto",children:"Once the agent connects, it appears here automatically within a few seconds — no refresh needed."}),(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsxs)("a",{href:"https://anet.sh",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium text-gray-500 hover:text-cyan-300",children:["Full quickstart guide",(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})})}])},39704,e=>{"use strict";e.s(["SESSION_STATUS_CHIP_CLASS",0,{working:"bg-green-500/10 text-green-300 border-green-500/20",idle:"bg-gray-500/10 text-gray-300 border-gray-500/20",blocked:"bg-yellow-500/10 text-yellow-300 border-yellow-500/20",error:"bg-red-500/10 text-red-300 border-red-500/20",offline:"bg-gray-500/10 text-gray-500 border-gray-500/20"},"SESSION_STATUS_TEXT_CLASS",0,{working:"text-green-400",idle:"text-gray-400",blocked:"text-yellow-400",error:"text-red-400",offline:"text-gray-500"},"STATUS_BAR_CLASS",0,{created:"bg-gray-500",delivered:"bg-gray-400",acked:"bg-gray-300",running:"bg-green-500",replied:"bg-gray-400",closed:"bg-gray-600",failed:"bg-red-500",cancelled:"bg-gray-600",expired:"bg-gray-600"},"STATUS_CHIP_CLASS",0,{created:"bg-gray-500/10 text-gray-400 border-gray-500/20",delivered:"bg-gray-500/10 text-gray-300 border-gray-500/20",acked:"bg-gray-500/10 text-gray-300 border-gray-500/20",running:"bg-green-500/10 text-green-300 border-green-500/20",replied:"bg-gray-500/10 text-gray-300 border-gray-500/20",closed:"bg-gray-500/10 text-gray-500 border-gray-500/20",failed:"bg-red-500/10 text-red-300 border-red-500/20",cancelled:"bg-gray-500/10 text-gray-500 border-gray-500/20",expired:"bg-gray-500/10 text-gray-500 border-gray-500/20"},"STATUS_DOT_HEX",0,{created:"#9ca3af",delivered:"#9ca3af",acked:"#9ca3af",running:"#4ade80",replied:"#9ca3af",closed:"#6b7280",failed:"#f87171",cancelled:"#6b7280",expired:"#6b7280"},"TASK_STATUSES",0,["created","delivered","acked","running","replied","closed","failed","cancelled","expired"]])},8005,e=>{"use strict";var t=e.i(16309),s=e.i(33431);let a=async e=>{let t=await fetch(e);if(401===t.status)throw window.location.assign("/login"),Error("unauthorized");return t.json()},r={refreshInterval:5e3,dedupingInterval:3e3};function n(e,t){if(!t)return e;let s=e.includes("?")?"&":"?";return`${e}${s}network_id=${encodeURIComponent(t)}`}e.s(["useAnetConfig",0,function(){let{data:e}=(0,t.default)("/api/anet/config",a,{refreshInterval:3e4});return{config:e||null}},"useHealth",0,function(){let{data:e,error:s}=(0,t.default)("/api/hub/health",a,r);return{health:e||null,error:s}},"useMessages",0,function(e=100){let{networkId:l}=(0,s.useNetworkId)(),{data:i,error:d,isLoading:o}=(0,t.default)(n(`/api/hub/messages?limit=${e}`,l),a,{...r,keepPreviousData:!0});return{messages:i?.messages||[],error:d,isLoading:o}},"useNodeLifecycle",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:l,error:i}=(0,t.default)(n("/api/hub/nodes",e),a,r),d={},o={};for(let e of l?.nodes??[])e.alias&&"string"==typeof e.lifecycle_state&&(d[e.alias]=e.lifecycle_state),e.alias&&"string"==typeof e.node_id&&(o[e.alias]=e.node_id);return{lifecycleByAlias:d,nodeIdByAlias:o,error:i}},"useSessions",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:l,error:i,isLoading:d}=(0,t.default)(n("/api/hub/status",e),a,r);return{sessions:l?.sessions||[],hint:l?._hint,error:i,isLoading:d}},"useStats",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:l,error:i}=(0,t.default)(n("/api/hub/stats",e),a,r);return{stats:l?.ok?l:null,error:i}},"useTasks",0,function(e){let{networkId:l}=(0,s.useNetworkId)(),i=new URLSearchParams({limit:"100",...e}).toString(),{data:d,error:o,isLoading:c}=(0,t.default)(n(`/api/hub/tasks?${i}`,l),a,r);return{tasks:d?.tasks||[],count:d?.count??0,source:d?.source,error:o,isLoading:c}}])},40652,e=>{"use strict";var t=e.i(66239),s=e.i(91723);e.s(["useCollapsibleSearch",0,function({value:e,onChange:a,placeholder:r="Search…",label:n="Search",enabled:l=!0}){let[i,d]=(0,s.useState)(!1),o=(0,s.useCallback)(()=>{a(""),d(!1)},[a]);return{Button:(0,s.useCallback)(()=>{if(!l)return(0,t.jsx)(t.Fragment,{});let s=i||e;return(0,t.jsxs)("button",{type:"button",onClick:()=>d(e=>!e),"aria-label":i?`Close ${n.toLowerCase()}`:`Open ${n.toLowerCase()}`,"aria-pressed":i,title:i?`Close ${n.toLowerCase()}`:n,className:`relative shrink-0 inline-flex items-center justify-center rounded-full border w-9 h-9 transition-colors ${s?"border-cyan-500/40 bg-cyan-500/10 text-cyan-300":"border-[#26262b] bg-[#161618] text-gray-400 hover:text-gray-200 hover:border-[#3a3a41]"}`,children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,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"})}),e&&!i&&(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-cyan-400 ring-2 ring-[#0b0b0d]"})]})},[i,e,n,l]),Row:(0,s.useCallback)(()=>l&&(i||e)?(0,t.jsxs)("div",{className:"mb-3 sm:mb-4 flex items-center gap-2",children:[(0,t.jsx)("input",{type:"text",value:e,onChange:e=>a(e.target.value),onKeyDown:e=>{"Escape"===e.key&&o()},placeholder:r,autoFocus:i,className:"flex-1 bg-[#161618] border border-[#26262b] rounded-lg px-3 py-2 text-base sm:text-sm text-white placeholder-gray-600 focus:border-cyan-500/40 focus:outline-none"}),(0,t.jsx)("button",{type:"button",onClick:o,className:"shrink-0 text-xs text-gray-500 hover:text-gray-300 px-2 py-2","aria-label":"Clear and close search",children:"Cancel"})]}):null,[i,e,a,r,o,l]),value:e,reset:o}}])},44421,e=>{"use strict";var t=e.i(66239),s=e.i(91723),a=e.i(16309);function r(){let{data:e}=(0,a.default)("/api/anet/node-lifecycle",e=>fetch(e).then(e=>e.json()),{revalidateOnFocus:!1,dedupingInterval:6e4,shouldRetryOnError:!1});return e?.ok&&e.tools?e.tools:null}async function n(e,t){try{let s=await fetch("/api/anet/node-lifecycle",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,...t})});return{...await s.json().catch(()=>({})),httpStatus:s.status}}catch(e){return{ok:!1,error:"network_error",message:e instanceof Error?e.message:String(e),httpStatus:0}}}function l({alias:e,nodeId:a,networkId:r,onClose:i,onCompleted:d}){let[o,c]=(0,s.useState)(!1),[x,u]=(0,s.useState)(!1),[m,h]=(0,s.useState)(null);(0,s.useEffect)(()=>{let e=e=>{"Escape"!==e.key||o||i()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[i,o]);let p=m&&"number"==typeof m.in_flight_count?m.in_flight_count:0,g=async()=>{c(!0),h(null);let e=await n("stop",{node_id:a,...r?{network_id:r}:{},...x?{force:!0}:{}});(c(!1),e.ok)?d():h(e)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50",onClick:o?void 0:i,"aria-hidden":!0}),(0,t.jsxs)("div",{role:"dialog","aria-label":`停止节点 ${e}`,className:"fixed left-1/2 top-1/2 z-50 w-[min(92vw,420px)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-[#26262b] bg-[#161618] shadow-2xl",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-[#26262b] px-4 py-3",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-white",children:"停止节点"}),(0,t.jsx)("button",{onClick:o?void 0:i,"aria-label":"关闭",className:"text-gray-500 hover:text-white",children:"×"})]}),(0,t.jsxs)("div",{className:"space-y-3 px-4 py-4",children:[(0,t.jsxs)("div",{className:"text-sm text-gray-300",children:["将停止 ",(0,t.jsx)("span",{className:"font-mono text-cyan-300",children:e})," 子进程(SIGTERM,~10s 内)。配置目录保留,可通过「启动」恢复。"]}),m&&!1===m.ok&&(0,t.jsxs)("div",{className:"rounded-md border border-red-700/40 bg-red-900/20 px-3 py-2 text-xs text-red-200",children:[(0,t.jsx)("div",{className:"font-semibold",children:m.error}),m.message?(0,t.jsx)("div",{className:"mt-0.5 text-red-300/80",children:m.message}):null,"number"==typeof m.in_flight_count&&(0,t.jsxs)("div",{className:"mt-0.5 text-red-300/80",children:["当前 in-flight 任务: ",m.in_flight_count]}),m.hint?(0,t.jsx)("div",{className:"mt-1 text-red-300/60",children:m.hint}):null]}),(p>0||x)&&(0,t.jsxs)("label",{className:"flex items-start gap-2 rounded-md border border-amber-700/40 bg-amber-900/10 px-3 py-2 text-xs text-amber-200",children:[(0,t.jsx)("input",{type:"checkbox",checked:x,onChange:e=>u(e.target.checked),className:"mt-0.5"}),(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"font-semibold text-amber-300",children:"强制停止"}),p>0?`(会丢弃 ${p} 条待处理任务)`:"(覆盖 in-flight 拒绝;hub 会写 audit 行)"]})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2 border-t border-[#26262b] px-4 py-3",children:[(0,t.jsx)("button",{type:"button",disabled:o,onClick:i,className:"rounded-md px-3 py-1.5 text-sm text-gray-400 hover:text-gray-200 disabled:opacity-50",children:"取消"}),(0,t.jsx)("button",{type:"button",disabled:o||p>0&&!x,onClick:g,className:"rounded-md bg-cyan-600 px-4 py-1.5 text-sm font-medium text-white hover:bg-cyan-500 disabled:cursor-not-allowed disabled:opacity-50",children:o?"停止中…":"确认停止"})]})]})]})}function i({alias:e,nodeId:a,networkId:r,onClose:l,onCompleted:d}){let[o,c]=(0,s.useState)(!1),[x,u]=(0,s.useState)(""),[m,h]=(0,s.useState)(!1),[p,g]=(0,s.useState)(!1),[b,y]=(0,s.useState)(null);(0,s.useEffect)(()=>{let e=e=>{"Escape"!==e.key||o||l()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[l,o]);let j=b&&"number"==typeof b.in_flight_count?b.in_flight_count:0,f=x===e,v=async()=>{if(!f)return;c(!0),y(null);let e=await n("delete",{node_id:a,confirm_alias:x,...r?{network_id:r}:{},...m?{force:!0}:{},...p?{delete_config:!1}:{}});(c(!1),e.ok)?d():y(e)};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50",onClick:o?void 0:l,"aria-hidden":!0}),(0,t.jsxs)("div",{role:"dialog","aria-label":`删除节点 ${e}`,className:"fixed left-1/2 top-1/2 z-50 w-[min(94vw,480px)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-red-700/40 bg-[#161618] shadow-2xl",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-[#26262b] px-4 py-3",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-red-300",children:"删除节点"}),(0,t.jsx)("button",{onClick:o?void 0:l,"aria-label":"关闭",className:"text-gray-500 hover:text-white",children:"×"})]}),(0,t.jsxs)("div",{className:"space-y-3 px-4 py-4 text-sm text-gray-300",children:[(0,t.jsx)("div",{children:"这将:"}),(0,t.jsxs)("ul",{className:"list-inside list-disc space-y-1 pl-2 text-xs text-gray-400",children:[(0,t.jsxs)("li",{children:["停止 ",(0,t.jsx)("span",{className:"font-mono text-cyan-300",children:e})," 子进程(SIGTERM ~10s)"]}),(0,t.jsx)("li",{children:"从 hub 注销该节点"}),(0,t.jsx)("li",{children:"撤销该节点的 ntok"}),!p&&(0,t.jsxs)("li",{children:["配置文件备份到 ",(0,t.jsxs)("code",{className:"text-amber-300",children:["~/.anet/deleted/<ts>-",e,"/"]}),"(30 天后自动清除)"]}),p&&(0,t.jsx)("li",{className:"text-amber-300",children:"配置文件保留原地(不备份不清理 — 你勾选了「保留配置」)"})]}),b&&!1===b.ok&&(0,t.jsxs)("div",{className:"rounded-md border border-red-700/40 bg-red-900/20 px-3 py-2 text-xs text-red-200",children:[(0,t.jsx)("div",{className:"font-semibold",children:b.error}),b.message?(0,t.jsx)("div",{className:"mt-0.5 text-red-300/80",children:b.message}):null,"number"==typeof b.in_flight_count&&(0,t.jsxs)("div",{className:"mt-0.5 text-red-300/80",children:["当前 in-flight 任务: ",b.in_flight_count]}),b.hint?(0,t.jsx)("div",{className:"mt-1 text-red-300/60",children:b.hint}):null]}),(j>0||m)&&(0,t.jsxs)("label",{className:"flex items-start gap-2 rounded-md border border-amber-700/40 bg-amber-900/10 px-3 py-2 text-xs text-amber-200",children:[(0,t.jsx)("input",{type:"checkbox",checked:m,onChange:e=>h(e.target.checked),className:"mt-0.5"}),(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"font-semibold text-amber-300",children:"强制删除"}),j>0?`(会丢弃 ${j} 条待处理任务)`:"(覆盖 in-flight 拒绝)"]})]}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs text-gray-400",children:[(0,t.jsx)("input",{type:"checkbox",checked:p,onChange:e=>g(e.target.checked)}),"保留配置目录(不备份;高级用法)"]}),(0,t.jsxs)("label",{className:"block space-y-1",children:[(0,t.jsxs)("span",{className:"text-xs text-gray-400",children:["输入节点名字 ",(0,t.jsx)("span",{className:"font-mono text-cyan-300",children:e})," 确认"]}),(0,t.jsx)("input",{autoFocus:!0,value:x,onChange:e=>u(e.target.value),placeholder:e,className:"w-full rounded-md border border-[#26262b] bg-[#0e0e10] px-3 py-2 text-sm text-gray-200 focus:border-red-500 focus:outline-none",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1}),x&&!f&&(0,t.jsx)("span",{className:"text-[11px] text-red-400",children:"名字不匹配(区分大小写)"})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2 border-t border-[#26262b] px-4 py-3",children:[(0,t.jsx)("button",{type:"button",disabled:o,onClick:l,className:"rounded-md px-3 py-1.5 text-sm text-gray-400 hover:text-gray-200 disabled:opacity-50",children:"取消"}),(0,t.jsx)("button",{type:"button",disabled:o||!f||j>0&&!m,onClick:v,className:"rounded-md bg-red-600 px-4 py-1.5 text-sm font-medium text-white hover:bg-red-500 disabled:cursor-not-allowed disabled:opacity-50",children:o?"删除中…":`删除 ${e}`})]})]})]})}e.s(["NodeLifecycleMenu",0,function({nodeId:e,alias:a,lifecycleState:d,networkId:o,onCompleted:c}){let x=r(),[u,m]=(0,s.useState)(!1),[h,p]=(0,s.useState)(!1),[g,b]=(0,s.useState)(!1),[y,j]=(0,s.useState)(!1),[f,v]=(0,s.useState)(null),N=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!u)return;let e=e=>{N.current&&!N.current.contains(e.target)&&m(!1)},t=e=>{"Escape"===e.key&&m(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[u]);let k=(0,s.useCallback)(async()=>{m(!1),v(null),j(!0);let t=await n("restart",{node_id:e,...o?{network_id:o}:{}});(j(!1),t.ok)?c?.():v(t)},[e,o,c]),w="string"==typeof d&&d.length>0?d:"active",C=[];return"stopping"===w||"deleting"===w?C.push({label:"stopping"===w?"停止中…":"删除中…",key:"loading",disabled:!0,onClick:()=>{}}):"active"===w?(C.push({label:y?"重启中…":"重启节点",key:"restart",disabled:y,onClick:k}),(null===x||x.stop)&&C.push({label:"停止节点",key:"stop",onClick:()=>{m(!1),p(!0)}}),(null===x||x.delete)&&C.push({label:"删除节点",key:"delete",danger:!0,onClick:()=>{m(!1),b(!0)}})):"stopped"===w||"stop_failed"===w?(C.push({label:y?"启动中…":"启动节点",key:"restart",disabled:y,onClick:k}),C.push({label:"删除节点",key:"delete",danger:!0,onClick:()=>{m(!1),b(!0)}})):C.push({label:`状态 ${w} (不识别)`,key:"unknown",disabled:!0,onClick:()=>{}}),(0,t.jsxs)("div",{ref:N,className:"relative inline-block",onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("button",{type:"button","aria-label":`节点 ${a} 生命周期操作`,"aria-haspopup":"menu","aria-expanded":u,onClick:()=>m(e=>!e),className:"inline-flex h-8 w-8 items-center justify-center rounded-md text-gray-400 hover:bg-white/5 hover:text-white focus:outline-none focus:ring-1 focus:ring-cyan-500/50",children:(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[(0,t.jsx)("circle",{cx:"12",cy:"5",r:"1.6"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"1.6"}),(0,t.jsx)("circle",{cx:"12",cy:"19",r:"1.6"})]})}),u&&(0,t.jsx)("div",{role:"menu",className:"absolute right-0 z-40 mt-1 w-44 overflow-hidden rounded-md border border-[#26262b] bg-[#161618] shadow-xl",children:C.map(e=>(0,t.jsx)("button",{type:"button",role:"menuitem",disabled:e.disabled,onClick:e.onClick,className:`block w-full px-3 py-2 text-left text-sm transition-colors ${e.disabled?"text-gray-600 cursor-not-allowed":e.danger?"text-red-300 hover:bg-red-900/20":"text-gray-200 hover:bg-white/5"}`,children:e.label},e.key))}),f&&!1===f.ok&&!h&&!g&&(0,t.jsx)("div",{className:"absolute right-0 z-40 mt-1 w-72 rounded-md border border-red-700/40 bg-red-900/20 px-3 py-2 text-xs text-red-200",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"font-semibold",children:f.error||"error"}),f.message?(0,t.jsx)("div",{className:"mt-0.5 text-red-300/80",children:f.message}):null,"number"==typeof f.in_flight_count&&(0,t.jsxs)("div",{className:"mt-0.5 text-red-300/80",children:["in-flight: ",f.in_flight_count]}),f.hint?(0,t.jsx)("div",{className:"mt-1 text-red-300/60",children:f.hint}):null]}),(0,t.jsx)("button",{type:"button",onClick:()=>v(null),className:"shrink-0 text-red-400 hover:text-red-200","aria-label":"关闭",children:"×"})]})}),h&&(0,t.jsx)(l,{alias:a,nodeId:e,networkId:o,onClose:()=>p(!1),onCompleted:()=>{p(!1),c?.()}}),g&&(0,t.jsx)(i,{alias:a,nodeId:e,networkId:o,onClose:()=>b(!1),onCompleted:()=>{b(!1),c?.()}})]})},"useLifecycleCaps",0,r])},43462,e=>{"use strict";var t=e.i(66239),s=e.i(91723),a=e.i(27113),r=e.i(8005),n=e.i(10451),l=e.i(49093),i=e.i(33431);function d({networkId:e,value:a,onChange:r}){let[n,l]=(0,s.useState)("loading"),[i,x]=(0,s.useState)([]),[u,m]=(0,s.useState)(""),[h,p]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{let t=!0;return l("loading"),m(""),fetch(e?`/api/anet/host-supervisors?network_id=${encodeURIComponent(e)}`:"/api/anet/host-supervisors",{cache:"no-store"}).then(e=>e.json().then(t=>({status:e.status,body:t}))).then(({status:e,body:s})=>{if(!t)return;if(501===e||s?.unconfirmed){l("unconfirmed"),m(s?.error||"hub /api/host-supervisors unavailable — upgrade to >=0.9.0-preview.8"),x([]);return}if(!s?.ok){l("error"),m(s?.error||`hub ${e}`),x([]);return}let n=Array.isArray(s.daemons)?s.daemons:[];x(n),l("ready"),1!==n.length||a||r(n[0].daemon_node_id,n[0])}).catch(e=>{t&&(l("error"),m(e instanceof Error?e.message:String(e)),x([]))}),()=>{t=!1}},[e]),"loading"===n)return(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-[#26262b] bg-[#0e0e10] px-3 py-3 text-xs text-gray-500",children:[(0,t.jsxs)("svg",{className:"h-3.5 w-3.5 animate-spin",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-90",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),"正在查询可用的 host_supervisor 节点…"]});if("unconfirmed"===n)return(0,t.jsxs)("div",{className:"rounded-md border border-amber-700/40 bg-amber-900/10 px-3 py-3 text-xs text-amber-200",children:[(0,t.jsx)("div",{className:"font-semibold mb-1",children:"hub 暂未升级"}),(0,t.jsx)("div",{className:"text-amber-200/80",children:u}),(0,t.jsxs)("div",{className:"mt-1 text-[11px] text-amber-200/60",children:["升级到 ",(0,t.jsx)("code",{className:"rounded bg-black/40 px-1 py-0.5",children:"@sleep2agi/commhub-server@0.9.0-preview.8"})," 后选服务器功能才会出现。"]})]});if("error"===n)return(0,t.jsxs)("div",{className:"rounded-md border border-red-700/40 bg-red-900/10 px-3 py-3 text-xs text-red-200",children:["查询 host_supervisor 节点失败:",u]});if(0===i.length)return(0,t.jsxs)("div",{className:"rounded-md border border-[#26262b] bg-[#0e0e10] px-3 py-4 text-xs text-gray-300",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-gray-200",children:"还没有可用的 host_supervisor 节点"}),(0,t.jsx)("p",{className:"mt-1 text-gray-500",children:"要在某台机器上创建节点,先在那台机器上跑一次 daemon 初始化命令:"}),(0,t.jsx)("pre",{className:"mt-2 overflow-x-auto rounded bg-black/40 p-2 text-[11px] text-cyan-300",children:`# 任选一台目标机器(你的笔记本 / 一台服务器都行)
2
+ anet daemon up my-daemon`}),(0,t.jsx)("p",{className:"mt-2 text-gray-500",children:"注册成功后这里会自动出现,无需刷新。"})]});if(1===i.length&&!h){let e=i[0];return(0,t.jsxs)("div",{className:"rounded-md border border-cyan-700/40 bg-cyan-900/10 px-3 py-3 text-xs text-cyan-100",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-cyan-400/80",children:"将在"})," ",(0,t.jsx)("span",{className:"font-semibold",children:e.alias}),(0,t.jsxs)("span",{className:"text-cyan-300/60",children:[" (",e.hostname||"—",") "]}),(0,t.jsx)("span",{className:"text-cyan-400/80",children:"上创建"})]}),(0,t.jsx)("button",{type:"button",onClick:()=>p(!0),className:"text-[11px] text-cyan-400 hover:text-cyan-200 underline-offset-2 hover:underline",children:"详情 →"})]}),(0,t.jsx)(c,{runtimes:e.runtimes_supported,className:"mt-1"})]})}return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[(0,t.jsxs)("span",{children:["选择一台 host_supervisor 节点(",i.length," 台在线)"]}),h&&1===i.length&&(0,t.jsx)("button",{type:"button",onClick:()=>p(!1),className:"text-[11px] text-gray-500 hover:text-gray-300",children:"← 折叠"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-2 lg:grid-cols-3",children:i.map(e=>(0,t.jsx)(o,{daemon:e,selected:e.daemon_node_id===a,onClick:()=>r(e.daemon_node_id,e)},e.daemon_node_id))})]})}function o({daemon:e,selected:s,onClick:a}){let r=e.host_telemetry?.alert_level||"gray";return(0,t.jsxs)("button",{type:"button",onClick:a,"aria-pressed":s,className:`flex w-full flex-col gap-1.5 rounded-md border px-3 py-2.5 text-left text-xs transition-colors ${s?"border-cyan-600 bg-cyan-900/15 text-cyan-100":"border-[#26262b] bg-[#0e0e10] text-gray-300 hover:border-[#3a3a41]"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"truncate font-semibold",children:e.alias}),(0,t.jsx)(x,{level:r})]}),(0,t.jsx)("div",{className:"truncate text-[11px] text-gray-500",children:e.hostname||"—"}),(0,t.jsx)(c,{runtimes:e.runtimes_supported}),(e.host_telemetry?.cpu_cores!=null||e.host_telemetry?.mem_gb!=null)&&(0,t.jsxs)("div",{className:"flex gap-3 text-[10px] text-gray-500",children:[e.host_telemetry?.cpu_cores!=null&&(0,t.jsxs)("span",{children:[e.host_telemetry.cpu_cores," 核"]}),e.host_telemetry?.mem_gb!=null&&(0,t.jsxs)("span",{children:[e.host_telemetry.mem_gb," GB"]})]})]})}function c({runtimes:e,className:s=""}){return e&&0!==e.length?(0,t.jsx)("div",{className:`flex flex-wrap gap-1 ${s}`,children:e.map(e=>(0,t.jsx)("span",{className:"rounded bg-[#1c1c1f] px-1.5 py-0.5 text-[10px] text-gray-400",children:e},e))}):(0,t.jsx)("div",{className:`text-[10px] text-gray-600 ${s}`,children:"runtimes_supported: —"})}function x({level:e}){return(0,t.jsx)("span",{className:`rounded border px-1.5 py-0.5 text-[10px] ${{green:"bg-green-600/20 text-green-300 border-green-700/40",yellow:"bg-amber-600/20 text-amber-300 border-amber-700/40",red:"bg-red-600/20 text-red-300 border-red-700/40",gray:"bg-gray-600/20 text-gray-400 border-gray-700/40"}[e]}`,children:{green:"正常",yellow:"注意",red:"警报",gray:"离线"}[e]})}let u=[{id:"claude-agent-sdk",label:"Claude Agent SDK",models:["deepseek-v4-pro","MiniMax-M3","claude-sonnet-4-6","claude-opus-4-x"],defaultModel:"claude-sonnet-4-6"},{id:"codex-sdk",label:"Codex SDK",models:["gpt-5.5"],defaultModel:"gpt-5.5"},{id:"grok-build-acp",label:"Grok (build-acp)",models:["grok-build"],defaultModel:"grok-build"}],m=["default","acceptEdits","plan","bypassPermissions"],h=["服务器","名字","Runtime","模型","参数","确认"];function p({networkId:e,onClose:a,onCreated:r}){let[n,l]=(0,s.useState)(0),[o,c]=(0,s.useState)(null),[x,g]=(0,s.useState)(null),[b,y]=(0,s.useState)(""),[j,f]=(0,s.useState)(u[0].id),[v,N]=(0,s.useState)(""),[k,w]=(0,s.useState)("default"),[C,S]=(0,s.useState)(""),[_,$]=(0,s.useState)(""),[A,T]=(0,s.useState)(""),[L,I]=(0,s.useState)("form"),[E,M]=(0,s.useState)(""),[B,z]=(0,s.useState)(!1),{networkId:O}=(0,i.useNetworkId)(),U=e||O;(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&"creating"!==L&&a()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[a,L]),(0,s.useEffect)(()=>{if("done"!==L||B)return;let e=!0,t=0,s=b.trim(),a=async()=>{t+=1;try{let t=U?`/api/hub/status?network_id=${encodeURIComponent(U)}`:"/api/hub/status",a=await fetch(t,{cache:"no-store"}),r=await a.json().catch(()=>({})),n=Array.isArray(r?.sessions)?r.sessions:Array.isArray(r)?r:[];if(e&&n.some(e=>e?.alias===s))return void z(!0)}catch{}e&&t<16&&window.setTimeout(a,1500)},r=window.setTimeout(a,1200);return()=>{e=!1,window.clearTimeout(r)}},[L,B,U,b]);let H=u.find(e=>e.id===j)||u[0],P=b.trim().length>0,R=0===n&&!!o||1===n&&P||n>=2&&n<h.length,D="creating"===L;async function W(){I("creating"),M("");let t=e=>""===e.trim()?void 0:Number(e),s=v||H.defaultModel,a={name:b.trim(),runtime:j,model:s,flags:{permissionMode:k,maxTurns:t(C),budget:t(_),timeout:t(A)}};try{let t=await fetch("/api/anet/node-create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node_spec:a,...o?{daemon_node_id:o}:{},...e?{network_id:e}:{}})}),s=await t.json().catch(()=>({}));t.ok&&s?.ok?(I("done"),M("创建请求已下发,节点正在拉起…"),r?.(s.result)):s?.unconfirmed?(I("unconfirmed"),M(`后端 create_node 未就绪:${s?.error||"不可用"}(测试 hub 可能未含 #299)`)):(I("error"),M(s?.error?`创建失败:${s.error}`:"创建失败"))}catch(e){I("error"),M(`创建失败:${e instanceof Error?e.message:"网络错误"}`)}}let F="w-full rounded-md border border-[#26262b] bg-[#0e0e10] px-3 py-2 text-sm text-gray-200 focus:border-cyan-600 focus:outline-none";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:a,"aria-hidden":!0}),(0,t.jsxs)("div",{role:"dialog","aria-label":"新建节点",className:"fixed left-1/2 top-1/2 z-50 w-[min(94vw,440px)] md:w-[min(92vw,720px)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-[#26262b] bg-[#161618] shadow-2xl",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-[#26262b] px-4 py-3",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-white",children:"新建节点"}),(0,t.jsx)("button",{onClick:a,"aria-label":"关闭",className:"inline-flex h-8 w-8 items-center justify-center rounded-md text-gray-500 hover:bg-white/5 hover:text-white",children:(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:(0,t.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})})]}),(0,t.jsx)("div",{className:"flex items-center gap-1.5 px-4 pt-3",children:h.map((e,s)=>(0,t.jsxs)("div",{className:"flex flex-1 flex-col items-center gap-1",children:[(0,t.jsx)("div",{className:`h-1 w-full rounded-full ${s<=n?"bg-cyan-500":"bg-[#26262b]"}`}),(0,t.jsx)("span",{className:`text-[10px] ${s===n?"text-cyan-300":"text-gray-600"}`,children:e})]},e))}),(0,t.jsx)("div",{className:"min-h-[180px] px-4 py-4",children:"form"!==L?(0,t.jsxs)("div",{className:"flex h-[180px] flex-col items-center justify-center gap-3 text-center",children:[D&&(0,t.jsxs)("svg",{className:"h-7 w-7 animate-spin text-cyan-400",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-90",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),(0,t.jsx)("div",{className:`text-sm ${"done"===L?"text-green-300":"error"===L?"text-red-300":"unconfirmed"===L?"text-amber-300":"text-gray-300"}`,children:D?"正在创建…":"done"===L&&B?`✓ ${b.trim()} 已上线`:E}),"done"===L&&(B?(0,t.jsx)("p",{className:"text-[11px] text-green-500/80",children:"节点已注册,已出现在节点列表。"}):(0,t.jsxs)("p",{className:"inline-flex items-center gap-1.5 text-[11px] text-gray-500",children:[(0,t.jsxs)("svg",{className:"h-3 w-3 animate-spin",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-90",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),"正在监测 ",b.trim()," 注册…(最长 ~24s)"]}))]}):(0,t.jsxs)(t.Fragment,{children:[0===n&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"在哪台机器上创建"}),(0,t.jsx)(d,{networkId:U||void 0,value:o,onChange:(e,t)=>{c(e),g(t);let s=t?.runtimes_supported;s&&s.length>0&&!s.includes(j)&&(f(s[0]),N(""))}}),!o&&(0,t.jsxs)("p",{className:"text-[11px] text-gray-600",children:["没选服务器之前无法继续;如果列表是空的,按提示在目标机器上跑 ",(0,t.jsx)("code",{className:"rounded bg-black/40 px-1 py-0.5",children:"anet daemon up <name>"}),"。"]})]}),1===n&&(0,t.jsxs)("label",{className:"block space-y-1.5",children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"节点名字"}),(0,t.jsx)("input",{autoFocus:!0,value:b,onChange:e=>y(e.target.value),placeholder:"例如 my-agent-1",className:F}),!P&&(0,t.jsx)("span",{className:"text-[11px] text-gray-600",children:"名字不能为空"})]}),2===n&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("span",{className:"text-xs text-gray-400",children:["Runtime",x?`(${x.alias} 支持)`:""]}),u.map(e=>{let s=x?.runtimes_supported,a=Array.isArray(s)&&s.length>0&&!s.includes(e.id),r=j===e.id;return(0,t.jsxs)("button",{type:"button",disabled:a,onClick:()=>{a||(f(e.id),N(""))},title:a?`${x?.alias||"该 daemon"} 未声明支持此 runtime`:void 0,className:`flex w-full items-center justify-between rounded-md border px-3 py-2 text-sm transition-colors ${a?"border-[#1c1c1f] bg-[#0a0a0c] text-gray-600 cursor-not-allowed":r?"border-cyan-600 bg-cyan-900/15 text-cyan-200":"border-[#26262b] bg-[#0e0e10] text-gray-300 hover:border-[#3a3a41]"}`,children:[(0,t.jsxs)("span",{children:[e.label,a&&(0,t.jsx)("span",{className:"ml-2 text-[10px] text-gray-700",children:"该 daemon 不支持"})]}),r&&!a&&(0,t.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5"})})]},e.id)})]}),3===n&&(0,t.jsxs)("label",{className:"block space-y-1.5",children:[(0,t.jsxs)("span",{className:"text-xs text-gray-400",children:["模型(",H.label,")"]}),(0,t.jsxs)("select",{value:v,onChange:e=>N(e.target.value),className:F,children:[(0,t.jsxs)("option",{value:"",children:["默认(",H.defaultModel,")"]}),H.models.map(e=>(0,t.jsx)("option",{value:e,children:e},e))]})]}),4===n&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("label",{className:"block space-y-1.5",children:[(0,t.jsx)("span",{className:"text-xs text-gray-400",children:"permissionMode"}),(0,t.jsx)("select",{value:k,onChange:e=>w(e.target.value),className:F,children:m.map(e=>(0,t.jsx)("option",{value:e,children:e},e))})]}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,t.jsxs)("label",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-[11px] text-gray-500",children:"maxTurns"}),(0,t.jsx)("input",{inputMode:"numeric",value:C,onChange:e=>S(e.target.value),className:F})]}),(0,t.jsxs)("label",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-[11px] text-gray-500",children:"budget"}),(0,t.jsx)("input",{inputMode:"numeric",value:_,onChange:e=>$(e.target.value),className:F})]}),(0,t.jsxs)("label",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-[11px] text-gray-500",children:"timeout"}),(0,t.jsx)("input",{inputMode:"numeric",value:A,onChange:e=>T(e.target.value),className:F})]})]})]}),5===n&&(0,t.jsx)("div",{className:"space-y-2 text-sm",children:(0,t.jsx)("div",{className:"rounded-md border border-[#26262b] bg-[#0e0e10] divide-y divide-[#1c1c1f]",children:[["服务器",o?`${o.slice(0,24)}…`:"—"],["名字",b.trim()||"—"],["Runtime",H.label],["模型",v||`默认(${H.defaultModel})`],["permissionMode",k],["maxTurns / budget / timeout",`${C||"—"} / ${_||"—"} / ${A||"—"}`]].map(([e,s])=>(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3 px-3 py-2",children:[(0,t.jsx)("span",{className:"shrink-0 text-gray-500 text-xs",children:e}),(0,t.jsx)("span",{className:"text-right text-gray-200 text-xs break-all",children:s})]},e))})})]})}),"form"===L?(0,t.jsxs)("div",{className:"flex items-center justify-between border-t border-[#26262b] px-4 py-3",children:[(0,t.jsx)("button",{type:"button",onClick:()=>0===n?a():l(n-1),className:"rounded-md px-3 py-1.5 text-sm text-gray-400 hover:text-gray-200",children:0===n?"取消":"上一步"}),n<h.length-1?(0,t.jsx)("button",{type:"button",disabled:!R,onClick:()=>l(n+1),className:`rounded-md px-4 py-1.5 text-sm font-medium ${R?"bg-cyan-600 text-white hover:bg-cyan-500":"bg-[#1c1c1f] text-gray-600 cursor-not-allowed"}`,children:"下一步"}):(0,t.jsx)("button",{type:"button",onClick:W,className:"rounded-md bg-green-600 px-4 py-1.5 text-sm font-medium text-white hover:bg-green-500",children:"创建节点"})]}):(0,t.jsxs)("div",{className:"flex items-center justify-end border-t border-[#26262b] px-4 py-3",children:[(0,t.jsx)("button",{type:"button",onClick:a,className:"rounded-md bg-[#1c1c1f] px-4 py-1.5 text-sm text-gray-200 hover:bg-[#26262b]",children:"done"===L?"完成":"关闭"}),("error"===L||"unconfirmed"===L)&&(0,t.jsx)("button",{type:"button",onClick:()=>I("form"),className:"ml-2 rounded-md bg-cyan-600 px-4 py-1.5 text-sm text-white hover:bg-cyan-500",children:"返回修改"})]})]})]})}var g=e.i(44421),b=e.i(93226),y=e.i(24373),j=e.i(74821),f=e.i(40652),v=e.i(39704),N=e.i(71257);function k(e){return e?e.length>12?`${e.slice(0,8)}…`:e:"—"}function w({alias:e}){return(0,j.useHasDraft)(e)?(0,t.jsx)("span",{className:"shrink-0 text-[9px] text-red-400/90","aria-label":"有未发送草稿",children:"[草稿]"}):null}e.s(["default",0,function(){let{sessions:e,isLoading:i}=(0,r.useSessions)(),{health:d}=(0,r.useHealth)(),{lifecycleByAlias:o,nodeIdByAlias:c}=(0,r.useNodeLifecycle)(),{hasUnread:x,unreadCount:u}=(0,N.useChatUnread)(),{mutate:m}=(0,n.useSWRConfig)(),h=()=>{m(e=>"string"==typeof e&&(e.startsWith("/api/hub/nodes")||e.startsWith("/api/hub/status")))},j=d?.sse_sessions||{},C=e=>(e.network_id?j[`${e.network_id}:${e.alias}`]:void 0)??j[e.alias],[S,_]=(0,s.useState)(""),[$,A]=(0,s.useState)(""),[T,L]=(0,s.useState)("list"),[I,E]=(0,s.useState)(null),[M,B]=(0,s.useState)(!1),z=(0,f.useCollapsibleSearch)({value:$,onChange:A,placeholder:"Search nodes…",label:"Search nodes",enabled:e.length>0}),O=e.map(e=>({...e,online:!!C(e)})).filter(e=>"online"===S?e.online:"offline"===S?!e.online:!S||S===e.status).filter(e=>!$||e.alias.toLowerCase().includes($.toLowerCase())||(e.agent||"").toLowerCase().includes($.toLowerCase())).sort((e,t)=>!!t.online-!!e.online||("working"===t.status)-("working"===e.status)),U=e.filter(e=>C(e)).length;return(0,t.jsxs)("div",{className:"min-h-screen max-w-full overflow-x-hidden bg-[#0b0b0d] text-gray-100 p-4 sm:p-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-4 sm:mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-white lg:ml-0 ml-10",children:"Nodes"}),(0,t.jsxs)("span",{className:"text-xs bg-green-900/30 text-green-400 px-2 py-0.5 rounded-full border border-green-800/30 shrink-0",children:[U," online"]}),(0,t.jsxs)("span",{className:"text-xs bg-gray-900/30 text-gray-400 px-2 py-0.5 rounded-full border border-gray-800/30 shrink-0",children:[e.length," total"]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>B(!0),"aria-label":"新建节点",className:"inline-flex items-center gap-1 rounded-lg border border-cyan-700/50 bg-cyan-900/15 px-3 py-1.5 text-sm font-medium text-cyan-300 hover:bg-cyan-900/25 transition-colors",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"text-base leading-none",children:"+"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"新建节点"})]}),(0,t.jsx)(z.Button,{})]})]}),M&&(0,t.jsx)(p,{onClose:()=>B(!1)}),(0,t.jsx)(z.Row,{}),e.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-3 mb-4 sm:mb-6",children:[(0,t.jsxs)("select",{value:S,onChange:e=>_(e.target.value),className:"bg-[#161618] border border-[#26262b] rounded-lg px-3 py-2 text-base sm:text-sm text-white focus:border-blue-500/50 focus:outline-none",children:[(0,t.jsx)("option",{value:"",children:"All"}),(0,t.jsx)("option",{value:"online",children:"Online"}),(0,t.jsx)("option",{value:"offline",children:"Offline"}),(0,t.jsx)("option",{value:"working",children:"Working"}),(0,t.jsx)("option",{value:"idle",children:"Idle"}),(0,t.jsx)("option",{value:"blocked",children:"Blocked"}),(0,t.jsx)("option",{value:"error",children:"Error"})]}),(0,t.jsx)("div",{className:"hidden sm:flex ml-auto rounded-lg border border-[#26262b] bg-[#161618] p-1 text-sm",children:["list","grid"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>L(e),className:`rounded-md px-3 py-1.5 transition-colors ${T===e?"bg-cyan-500/10 text-cyan-300":"text-gray-500 hover:text-gray-200"}`,children:"list"===e?"List":"Grid"},e))})]}),i?(0,t.jsx)("div",{className:"animate-pulse space-y-2",children:[1,2,3,4].map(e=>(0,t.jsx)("div",{className:"h-16 bg-gray-800/20 rounded-lg"},e))}):0===O.length?0===e.length?(0,t.jsx)(b.NodesEmptyState,{}):(0,t.jsx)(b.EmptyState,{variant:"nodes",title:"No nodes match your filters",sub:"Try clearing search or status filters, or wait for an agent to register."}):"grid"===T?(0,t.jsx)("div",{className:"grid min-w-0 grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:O.map(e=>{let s=e.online?e.status:"offline",r="number"==typeof e.progress?e.progress:0,n=x(e.alias);return(0,t.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>E(e.alias),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),E(e.alias))},className:`relative min-w-0 max-w-full overflow-hidden rounded-xl border border-[#26262b] bg-[#161618] p-4 transition-colors hover:border-cyan-500/40 cursor-pointer ${!e.online?"opacity-60":""}`,children:[!e.online&&(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:(0,t.jsx)("span",{className:"rotate-[-20deg] rounded-xl border border-white/10 bg-black/20 px-5 py-2 text-xl font-bold uppercase tracking-[0.35em] text-white/10",children:"Offline"})}),(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsxs)("div",{className:"relative shrink-0",children:[(0,t.jsxs)("span",{className:"relative inline-flex shrink-0",children:[(0,t.jsx)(y.AliasAvatar,{alias:e.alias,size:36}),u(e.alias)>0&&(0,t.jsx)("span",{"aria-label":`${u(e.alias)} 条未读`,className:"absolute -top-1 -right-1.5 min-w-[16px] h-4 px-1 rounded-full bg-red-500 text-white text-[9px] font-semibold leading-4 text-center ring-2 ring-[#161618]",children:u(e.alias)>99?"99+":u(e.alias)})]}),n&&(0,t.jsx)("span",{className:"absolute -right-1 -top-1 h-3 w-3 rounded-full border-2 border-[#161618] bg-red-500"})]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate text-base font-semibold text-white",children:e.alias}),(0,t.jsx)(w,{alias:e.alias}),n&&(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-red-500/15 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-red-300",children:"New"}),(0,t.jsx)("span",{className:`shrink-0 rounded-md border px-2 py-0.5 text-[10px] uppercase tracking-wide ${v.SESSION_STATUS_CHIP_CLASS[s]||v.SESSION_STATUS_CHIP_CLASS.offline}`,children:s})]}),(0,t.jsxs)("div",{className:"mt-0.5 truncate text-xs text-gray-500",children:[e.agent||"—",(0,t.jsx)("span",{className:"text-gray-700 mx-1.5",children:"·"}),(0,t.jsx)("span",{title:e.server||"",children:k(e.server)})]})]}),(0,t.jsx)("span",{className:"hidden shrink-0 rounded-lg border border-cyan-500/15 bg-cyan-500/5 px-2 py-1 text-[10px] text-cyan-300/70 sm:inline",children:"Tap to chat"}),(0,t.jsx)(g.NodeLifecycleMenu,{nodeId:c[e.alias]||e.node_id||e.alias,alias:e.alias,lifecycleState:o[e.alias],networkId:e.network_id||null,onCompleted:h})]}),(0,t.jsxs)("div",{className:"mt-3 rounded-lg border border-[#1c1c1f] bg-[#0e0e10] px-3 py-2 text-xs",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-gray-600",children:"Current task"}),(0,t.jsx)("span",{className:"text-[10px] text-gray-600",children:(0,a.timeAgo)(e.last_seen_at||e.updated_at)})]}),(0,t.jsx)("div",{className:`mt-1 line-clamp-2 ${e.task?"text-gray-300":"text-gray-600 italic"}`,children:e.task||"No current task"})]}),r>0&&r<100&&(0,t.jsx)("div",{className:"mt-3 h-1.5 overflow-hidden rounded-full bg-gray-800",children:(0,t.jsx)("div",{className:"h-1.5 rounded-full bg-cyan-400 transition-all",style:{width:`${r}%`}})})]},e.alias)})}):(0,t.jsxs)("div",{className:"space-y-1 sm:space-y-2",children:[(0,t.jsxs)("div",{className:"hidden sm:grid sm:grid-cols-10 gap-2 px-4 py-2 text-xs text-gray-600 uppercase",children:[(0,t.jsx)("div",{className:"col-span-1",children:"Status"}),(0,t.jsx)("div",{className:"col-span-2",children:"Alias"}),(0,t.jsx)("div",{className:"col-span-2",children:"Agent · Server"}),(0,t.jsx)("div",{className:"col-span-4",children:"Current Task"}),(0,t.jsx)("div",{className:"col-span-1",children:"Updated"})]}),O.map(e=>{let s=e.online?e.status:"offline",r=x(e.alias);return(0,t.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>E(e.alias),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),E(e.alias))},className:`rounded-lg border border-[#26262b] bg-[#161618] px-3 py-2 sm:px-4 sm:py-3 transition-colors hover:border-cyan-500/40 cursor-pointer ${!e.online?"opacity-50":""}`,children:[(0,t.jsxs)("div",{className:"hidden sm:grid sm:grid-cols-10 gap-2 items-center",children:[(0,t.jsx)("div",{className:"col-span-1",children:(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-md border ${v.SESSION_STATUS_CHIP_CLASS[s]||v.SESSION_STATUS_CHIP_CLASS.offline}`,children:s})}),(0,t.jsx)("div",{className:"col-span-2 min-w-0",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsxs)("div",{className:"relative shrink-0",children:[(0,t.jsxs)("span",{className:"relative inline-flex shrink-0",children:[(0,t.jsx)(y.AliasAvatar,{alias:e.alias,size:20}),u(e.alias)>0&&(0,t.jsx)("span",{"aria-label":`${u(e.alias)} 条未读`,className:"absolute -top-1.5 -right-2 min-w-[15px] h-[15px] px-1 rounded-full bg-red-500 text-white text-[9px] font-semibold leading-[15px] text-center",children:u(e.alias)>99?"99+":u(e.alias)})]}),r&&(0,t.jsx)("span",{className:"absolute -right-1 -top-1 h-2.5 w-2.5 rounded-full border border-[#161618] bg-red-500"})]}),(0,t.jsx)("span",{className:"truncate text-sm font-medium text-white",children:e.alias}),(0,t.jsx)(w,{alias:e.alias}),r&&(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-red-500/15 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-red-300",children:"New"})]})}),(0,t.jsx)("div",{className:"col-span-2 truncate text-xs text-gray-400",title:e.server||"",children:(0,t.jsxs)("span",{className:"truncate",children:[e.agent||"--",(0,t.jsx)("span",{className:"text-gray-700 mx-1.5",children:"·"}),k(e.server)]})}),(0,t.jsx)("div",{className:"col-span-4 truncate text-xs text-gray-500",title:e.task||"",children:e.task||"--"}),(0,t.jsxs)("div",{className:"col-span-1 flex items-center justify-between gap-2 text-xs text-gray-500",children:[(0,t.jsx)("span",{className:"truncate",children:(0,a.timeAgo)(e.last_seen_at||e.updated_at)}),(0,t.jsx)(g.NodeLifecycleMenu,{nodeId:c[e.alias]||e.node_id||e.alias,alias:e.alias,lifecycleState:o[e.alias],networkId:e.network_id||null,onCompleted:h})]})]}),(0,t.jsxs)("div",{className:"sm:hidden space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsxs)("div",{className:"relative shrink-0",children:[(0,t.jsx)(y.AliasAvatar,{alias:e.alias,size:28}),r&&(0,t.jsx)("span",{className:"absolute -right-1 -top-1 h-3 w-3 rounded-full border-2 border-[#161618] bg-red-500"})]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)("div",{className:"truncate text-sm font-medium text-white",children:e.alias}),r&&(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-red-500/15 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-red-300",children:"New"})]}),(0,t.jsxs)("div",{className:"truncate text-[10px] text-gray-500",children:[e.agent||"—"," · ",(0,a.timeAgo)(e.last_seen_at||e.updated_at)]})]}),(0,t.jsx)("span",{className:`shrink-0 text-xs px-2 py-0.5 rounded-md border ${v.SESSION_STATUS_CHIP_CLASS[s]||v.SESSION_STATUS_CHIP_CLASS.offline}`,children:s}),(0,t.jsx)(g.NodeLifecycleMenu,{nodeId:c[e.alias]||e.node_id||e.alias,alias:e.alias,lifecycleState:o[e.alias],networkId:e.network_id||null,onCompleted:h})]}),e.task&&(0,t.jsx)("div",{className:"truncate text-xs text-gray-500",children:e.task})]})]},e.alias)})]}),I&&(0,t.jsx)(l.TaskChatPanel,{alias:I,onClose:()=>E(null)})]})}],43462)}]);
package/.next/trace CHANGED
@@ -1,2 +1,2 @@
1
- [{"name":"generate-buildid","duration":314,"timestamp":5781306415033,"id":4,"parentId":1,"tags":{},"startTime":1784589278661,"traceId":"55ea1ce62d465966"},{"name":"load-custom-routes","duration":809,"timestamp":5781306415559,"id":5,"parentId":1,"tags":{},"startTime":1784589278662,"traceId":"55ea1ce62d465966"},{"name":"create-dist-dir","duration":932,"timestamp":5781306416435,"id":6,"parentId":1,"tags":{},"startTime":1784589278663,"traceId":"55ea1ce62d465966"},{"name":"clean","duration":40056,"timestamp":5781306418090,"id":7,"parentId":1,"tags":{},"startTime":1784589278664,"traceId":"55ea1ce62d465966"},{"name":"discover-routes","duration":26389,"timestamp":5781306555878,"id":8,"parentId":1,"tags":{},"startTime":1784589278802,"traceId":"55ea1ce62d465966"},{"name":"create-root-mapping","duration":135,"timestamp":5781306582352,"id":9,"parentId":1,"tags":{},"startTime":1784589278829,"traceId":"55ea1ce62d465966"},{"name":"generate-route-types","duration":20617,"timestamp":5781306585300,"id":10,"parentId":1,"tags":{},"startTime":1784589278832,"traceId":"55ea1ce62d465966"},{"name":"public-dir-conflict-check","duration":121,"timestamp":5781306606116,"id":11,"parentId":1,"tags":{},"startTime":1784589278852,"traceId":"55ea1ce62d465966"},{"name":"generate-routes-manifest","duration":6166,"timestamp":5781306606366,"id":12,"parentId":1,"tags":{},"startTime":1784589278853,"traceId":"55ea1ce62d465966"},{"name":"run-turbopack","duration":8784078,"timestamp":5781306619525,"id":14,"parentId":1,"tags":{},"startTime":1784589278866,"traceId":"55ea1ce62d465966"},{"name":"turbopack-build-events","duration":130,"timestamp":5781307028484,"id":15,"parentId":1,"tags":{},"startTime":1784589279275,"traceId":"55ea1ce62d465966"},{"name":"run-typescript","duration":13556194,"timestamp":5781315413521,"id":16,"parentId":1,"tags":{},"startTime":1784589287660,"traceId":"55ea1ce62d465966"},{"name":"generate-required-server-files","duration":4210,"timestamp":5781328971890,"id":18,"parentId":1,"tags":{},"startTime":1784589301218,"traceId":"55ea1ce62d465966"},{"name":"check-static-error-page","duration":18502,"timestamp":5781329239867,"id":20,"parentId":19,"tags":{},"startTime":1784589301486,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":744807,"timestamp":5781329263035,"id":80,"parentId":34,"tags":{},"startTime":1784589301509,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":760637,"timestamp":5781329247406,"id":34,"parentId":19,"tags":{"page":"/api/auth/v3"},"startTime":1784589301494,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":751790,"timestamp":5781329263187,"id":81,"parentId":35,"tags":{},"startTime":1784589301509,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":767524,"timestamp":5781329247550,"id":35,"parentId":19,"tags":{"page":"/api/hub/audit-log"},"startTime":1784589301494,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":816354,"timestamp":5781329263399,"id":82,"parentId":36,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":831483,"timestamp":5781329248371,"id":36,"parentId":19,"tags":{"page":"/api/hub/auth"},"startTime":1784589301495,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":856185,"timestamp":5781329263478,"id":83,"parentId":37,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":871142,"timestamp":5781329248606,"id":37,"parentId":19,"tags":{"page":"/api/hub/broadcast"},"startTime":1784589301495,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":880823,"timestamp":5781329263552,"id":84,"parentId":39,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":893834,"timestamp":5781329250624,"id":39,"parentId":19,"tags":{"page":"/api/hub/health"},"startTime":1784589301497,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":900572,"timestamp":5781329263585,"id":85,"parentId":40,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":913497,"timestamp":5781329250755,"id":40,"parentId":19,"tags":{"page":"/api/hub/inbox"},"startTime":1784589301497,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":907147,"timestamp":5781329263708,"id":86,"parentId":41,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":920096,"timestamp":5781329250848,"id":41,"parentId":19,"tags":{"page":"/api/hub/messages"},"startTime":1784589301497,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":913108,"timestamp":5781329263741,"id":87,"parentId":42,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":925989,"timestamp":5781329250938,"id":42,"parentId":19,"tags":{"page":"/api/hub/networks"},"startTime":1784589301497,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":919157,"timestamp":5781329263760,"id":88,"parentId":43,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":931963,"timestamp":5781329251061,"id":43,"parentId":19,"tags":{"page":"/api/hub/nodes"},"startTime":1784589301497,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":929537,"timestamp":5781329263774,"id":89,"parentId":44,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":942222,"timestamp":5781329251181,"id":44,"parentId":19,"tags":{"page":"/api/hub/register"},"startTime":1784589301497,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":938610,"timestamp":5781329263784,"id":90,"parentId":45,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":951205,"timestamp":5781329251281,"id":45,"parentId":19,"tags":{"page":"/api/hub/send"},"startTime":1784589301498,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":944432,"timestamp":5781329263798,"id":91,"parentId":46,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":956926,"timestamp":5781329251392,"id":46,"parentId":19,"tags":{"page":"/api/hub/server-logs"},"startTime":1784589301498,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":947652,"timestamp":5781329262482,"id":77,"parentId":30,"tags":{},"startTime":1784589301509,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":963766,"timestamp":5781329246440,"id":30,"parentId":19,"tags":{"page":"/api/anet/providers/probe"},"startTime":1784589301493,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":952679,"timestamp":5781329263825,"id":93,"parentId":50,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":964200,"timestamp":5781329252760,"id":50,"parentId":19,"tags":{"page":"/api/hub/session"},"startTime":1784589301499,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":959291,"timestamp":5781329263811,"id":92,"parentId":48,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":971007,"timestamp":5781329252196,"id":48,"parentId":19,"tags":{"page":"/api/hub/server/[hostname]/health"},"startTime":1784589301498,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":961471,"timestamp":5781329263849,"id":95,"parentId":52,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":972313,"timestamp":5781329253072,"id":52,"parentId":19,"tags":{"page":"/api/hub/status"},"startTime":1784589301499,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":976764,"timestamp":5781329263863,"id":96,"parentId":53,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":987528,"timestamp":5781329253203,"id":53,"parentId":19,"tags":{"page":"/api/hub/task-events"},"startTime":1784589301499,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":984924,"timestamp":5781329262220,"id":75,"parentId":22,"tags":{},"startTime":1784589301508,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1004861,"timestamp":5781329242379,"id":22,"parentId":19,"tags":{"page":"/_global-error"},"startTime":1784589301489,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":984935,"timestamp":5781329262864,"id":79,"parentId":33,"tags":{},"startTime":1784589301509,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1000595,"timestamp":5781329247259,"id":33,"parentId":19,"tags":{"page":"/api/auth/logout"},"startTime":1784589301494,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":985770,"timestamp":5781329263875,"id":97,"parentId":54,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":996412,"timestamp":5781329253281,"id":54,"parentId":19,"tags":{"page":"/api/hub/tasks"},"startTime":1784589301500,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":991893,"timestamp":5781329263903,"id":99,"parentId":56,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1002446,"timestamp":5781329253422,"id":56,"parentId":19,"tags":{"page":"/api/hub/tokens"},"startTime":1784589301500,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":995988,"timestamp":5781329263916,"id":100,"parentId":57,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1006490,"timestamp":5781329253472,"id":57,"parentId":19,"tags":{"page":"/api/hub/upload"},"startTime":1784589301500,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":1002859,"timestamp":5781329263835,"id":94,"parentId":51,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1013856,"timestamp":5781329252902,"id":51,"parentId":19,"tags":{"page":"/api/hub/stats"},"startTime":1784589301499,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":1009564,"timestamp":5781329263938,"id":102,"parentId":61,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1019531,"timestamp":5781329254037,"id":61,"parentId":19,"tags":{"page":"/manifest.webmanifest"},"startTime":1784589301500,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":1022695,"timestamp":5781329263925,"id":101,"parentId":58,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1033181,"timestamp":5781329253529,"id":58,"parentId":19,"tags":{"page":"/favicon.ico"},"startTime":1784589301500,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":989786,"timestamp":5781329306918,"id":104,"parentId":25,"tags":{},"startTime":1784589301553,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1051812,"timestamp":5781329244970,"id":25,"parentId":19,"tags":{"page":"/api/anet/host-supervisors"},"startTime":1784589301491,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":1008267,"timestamp":5781329288750,"id":103,"parentId":24,"tags":{},"startTime":1784589301535,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1054086,"timestamp":5781329242981,"id":24,"parentId":19,"tags":{"page":"/api/anet/config"},"startTime":1784589301489,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":975864,"timestamp":5781329325467,"id":105,"parentId":26,"tags":{},"startTime":1784589301572,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1059116,"timestamp":5781329245293,"id":26,"parentId":19,"tags":{"page":"/api/anet/node-config"},"startTime":1784589301492,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":909963,"timestamp":5781329394731,"id":107,"parentId":28,"tags":{},"startTime":1784589301641,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1058907,"timestamp":5781329245839,"id":28,"parentId":19,"tags":{"page":"/api/anet/node-lifecycle"},"startTime":1784589301492,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":977980,"timestamp":5781329330309,"id":106,"parentId":27,"tags":{},"startTime":1784589301577,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1062772,"timestamp":5781329245585,"id":27,"parentId":19,"tags":{"page":"/api/anet/node-create"},"startTime":1784589301492,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":883020,"timestamp":5781329446421,"id":108,"parentId":31,"tags":{},"startTime":1784589301693,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1082906,"timestamp":5781329246617,"id":31,"parentId":19,"tags":{"page":"/api/anet/providers"},"startTime":1784589301493,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":878151,"timestamp":5781329455617,"id":109,"parentId":38,"tags":{},"startTime":1784589301702,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1083620,"timestamp":5781329250229,"id":38,"parentId":19,"tags":{"page":"/api/hub/events"},"startTime":1784589301497,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":880283,"timestamp":5781329456625,"id":110,"parentId":47,"tags":{},"startTime":1784589301703,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1085557,"timestamp":5781329251491,"id":47,"parentId":19,"tags":{"page":"/api/hub/server/[hostname]/agents"},"startTime":1784589301498,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":887440,"timestamp":5781329457638,"id":111,"parentId":49,"tags":{},"startTime":1784589301704,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1092832,"timestamp":5781329252357,"id":49,"parentId":19,"tags":{"page":"/api/hub/servers"},"startTime":1784589301499,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":1106680,"timestamp":5781329262594,"id":78,"parentId":32,"tags":{},"startTime":1784589301509,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1122284,"timestamp":5781329247078,"id":32,"parentId":19,"tags":{"page":"/api/auth/login"},"startTime":1784589301493,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":906433,"timestamp":5781329534169,"id":112,"parentId":23,"tags":{},"startTime":1784589301780,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1197968,"timestamp":5781329242710,"id":23,"parentId":19,"tags":{"page":"/admin"},"startTime":1784589301489,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":1195903,"timestamp":5781329263889,"id":98,"parentId":55,"tags":{},"startTime":1784589301510,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1206504,"timestamp":5781329253367,"id":55,"parentId":19,"tags":{"page":"/api/hub/tmux"},"startTime":1784589301500,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":930653,"timestamp":5781329534397,"id":116,"parentId":63,"tags":{},"startTime":1784589301781,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1210723,"timestamp":5781329254388,"id":63,"parentId":19,"tags":{"page":"/node"},"startTime":1784589301501,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":951916,"timestamp":5781329534422,"id":118,"parentId":66,"tags":{},"startTime":1784589301781,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1229918,"timestamp":5781329256492,"id":66,"parentId":19,"tags":{"page":"/providers"},"startTime":1784589301503,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":969379,"timestamp":5781329534435,"id":119,"parentId":67,"tags":{},"startTime":1784589301781,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1247164,"timestamp":5781329256731,"id":67,"parentId":19,"tags":{"page":"/server-logs"},"startTime":1784589301503,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":973179,"timestamp":5781329534378,"id":115,"parentId":62,"tags":{},"startTime":1784589301781,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1253479,"timestamp":5781329254158,"id":62,"parentId":19,"tags":{"page":"/messages"},"startTime":1784589301500,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":983935,"timestamp":5781329534466,"id":121,"parentId":69,"tags":{},"startTime":1784589301781,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1261427,"timestamp":5781329257060,"id":69,"parentId":19,"tags":{"page":"/settings/networks"},"startTime":1784589301503,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":984844,"timestamp":5781329534449,"id":120,"parentId":68,"tags":{},"startTime":1784589301781,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1262428,"timestamp":5781329256917,"id":68,"parentId":19,"tags":{"page":"/servers"},"startTime":1784589301503,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":991029,"timestamp":5781329534242,"id":113,"parentId":59,"tags":{},"startTime":1784589301781,"traceId":"55ea1ce62d465966"}]
2
- [{"name":"check-page","duration":1271764,"timestamp":5781329253803,"id":59,"parentId":19,"tags":{"page":"/login"},"startTime":1784589301500,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":995764,"timestamp":5781329534260,"id":114,"parentId":60,"tags":{},"startTime":1784589301781,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1276163,"timestamp":5781329253907,"id":60,"parentId":19,"tags":{"page":"/logs"},"startTime":1784589301500,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":1267908,"timestamp":5781329262355,"id":76,"parentId":29,"tags":{},"startTime":1784589301509,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1284057,"timestamp":5781329246243,"id":29,"parentId":19,"tags":{"page":"/api/anet/providers/probe-results"},"startTime":1784589301493,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":999123,"timestamp":5781329534503,"id":124,"parentId":73,"tags":{},"startTime":1784589301781,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1275579,"timestamp":5781329258087,"id":73,"parentId":19,"tags":{"page":"/tasks"},"startTime":1784589301504,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":1003676,"timestamp":5781329534476,"id":122,"parentId":71,"tags":{},"startTime":1784589301781,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1280506,"timestamp":5781329257693,"id":71,"parentId":19,"tags":{"page":"/settings/tokens"},"startTime":1784589301504,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":1004089,"timestamp":5781329534513,"id":125,"parentId":65,"tags":{},"startTime":1784589301781,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1283788,"timestamp":5781329254853,"id":65,"parentId":19,"tags":{"page":"/"},"startTime":1784589301501,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":1008891,"timestamp":5781329534489,"id":123,"parentId":72,"tags":{},"startTime":1784589301781,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1285606,"timestamp":5781329257818,"id":72,"parentId":19,"tags":{"page":"/tasks/[id]"},"startTime":1784589301504,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":1307130,"timestamp":5781329261746,"id":74,"parentId":21,"tags":{},"startTime":1784589301508,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1327907,"timestamp":5781329241045,"id":21,"parentId":19,"tags":{"page":"/_not-found"},"startTime":1784589301487,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":1045628,"timestamp":5781329534412,"id":117,"parentId":64,"tags":{},"startTime":1784589301781,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1325535,"timestamp":5781329254608,"id":64,"parentId":19,"tags":{"page":"/nodes"},"startTime":1784589301501,"traceId":"55ea1ce62d465966"},{"name":"is-page-static","duration":1076013,"timestamp":5781329534526,"id":126,"parentId":70,"tags":{},"startTime":1784589301781,"traceId":"55ea1ce62d465966"},{"name":"check-page","duration":1353340,"timestamp":5781329257288,"id":70,"parentId":19,"tags":{"page":"/settings"},"startTime":1784589301504,"traceId":"55ea1ce62d465966"},{"name":"static-check","duration":1371735,"timestamp":5781329238949,"id":19,"parentId":1,"tags":{},"startTime":1784589301485,"traceId":"55ea1ce62d465966"},{"name":"write-routes-manifest","duration":621,"timestamp":5781330621865,"id":128,"parentId":1,"tags":{},"startTime":1784589302868,"traceId":"55ea1ce62d465966"},{"name":"load-dotenv","duration":88,"timestamp":5781330645538,"id":131,"parentId":130,"tags":{},"startTime":1784589302892,"traceId":"55ea1ce62d465966"},{"name":"run-export-path-map","duration":1147,"timestamp":5781330649658,"id":132,"parentId":130,"tags":{},"startTime":1784589302896,"traceId":"55ea1ce62d465966"},{"name":"next-export","duration":828693,"timestamp":5781330642803,"id":130,"parentId":1,"tags":{},"startTime":1784589302889,"traceId":"55ea1ce62d465966"},{"name":"move-exported-app-not-found-","duration":850,"timestamp":5781331475377,"id":133,"parentId":129,"tags":{},"startTime":1784589303722,"traceId":"55ea1ce62d465966"},{"name":"move-exported-app-global-error-","duration":415,"timestamp":5781331476343,"id":134,"parentId":129,"tags":{},"startTime":1784589303723,"traceId":"55ea1ce62d465966"},{"name":"static-generation","duration":847267,"timestamp":5781330631913,"id":129,"parentId":1,"tags":{},"startTime":1784589302878,"traceId":"55ea1ce62d465966"},{"name":"write-routes-manifest","duration":437,"timestamp":5781331479396,"id":135,"parentId":1,"tags":{},"startTime":1784589303726,"traceId":"55ea1ce62d465966"},{"name":"print-tree-view","duration":4862,"timestamp":5781331489430,"id":136,"parentId":1,"tags":{},"startTime":1784589303736,"traceId":"55ea1ce62d465966"},{"name":"write-route-bundle-stats","duration":23917,"timestamp":5781331494326,"id":137,"parentId":1,"tags":{},"startTime":1784589303741,"traceId":"55ea1ce62d465966"},{"name":"telemetry-flush","duration":17798,"timestamp":5781331518292,"id":138,"parentId":1,"tags":{},"startTime":1784589303765,"traceId":"55ea1ce62d465966"},{"name":"next-build","duration":25177230,"timestamp":5781306358907,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1784589278605,"traceId":"55ea1ce62d465966"}]
1
+ [{"name":"generate-buildid","duration":464,"timestamp":5785145362933,"id":4,"parentId":1,"tags":{},"startTime":1784593117609,"traceId":"fa176a3eeb26525f"},{"name":"load-custom-routes","duration":772,"timestamp":5785145363633,"id":5,"parentId":1,"tags":{},"startTime":1784593117610,"traceId":"fa176a3eeb26525f"},{"name":"create-dist-dir","duration":1093,"timestamp":5785145364477,"id":6,"parentId":1,"tags":{},"startTime":1784593117611,"traceId":"fa176a3eeb26525f"},{"name":"clean","duration":51263,"timestamp":5785145366608,"id":7,"parentId":1,"tags":{},"startTime":1784593117613,"traceId":"fa176a3eeb26525f"},{"name":"discover-routes","duration":45199,"timestamp":5785145517113,"id":8,"parentId":1,"tags":{},"startTime":1784593117763,"traceId":"fa176a3eeb26525f"},{"name":"create-root-mapping","duration":194,"timestamp":5785145562422,"id":9,"parentId":1,"tags":{},"startTime":1784593117809,"traceId":"fa176a3eeb26525f"},{"name":"generate-route-types","duration":31210,"timestamp":5785145567286,"id":10,"parentId":1,"tags":{},"startTime":1784593117814,"traceId":"fa176a3eeb26525f"},{"name":"public-dir-conflict-check","duration":105,"timestamp":5785145598670,"id":11,"parentId":1,"tags":{},"startTime":1784593117845,"traceId":"fa176a3eeb26525f"},{"name":"generate-routes-manifest","duration":5551,"timestamp":5785145598900,"id":12,"parentId":1,"tags":{},"startTime":1784593117845,"traceId":"fa176a3eeb26525f"},{"name":"run-turbopack","duration":8650502,"timestamp":5785145621480,"id":14,"parentId":1,"tags":{},"startTime":1784593117868,"traceId":"fa176a3eeb26525f"},{"name":"turbopack-build-events","duration":133,"timestamp":5785145943379,"id":15,"parentId":1,"tags":{},"startTime":1784593118190,"traceId":"fa176a3eeb26525f"},{"name":"run-typescript","duration":13569209,"timestamp":5785154301205,"id":16,"parentId":1,"tags":{},"startTime":1784593126547,"traceId":"fa176a3eeb26525f"},{"name":"generate-required-server-files","duration":3303,"timestamp":5785167871737,"id":18,"parentId":1,"tags":{},"startTime":1784593140118,"traceId":"fa176a3eeb26525f"},{"name":"check-static-error-page","duration":26166,"timestamp":5785168146322,"id":20,"parentId":19,"tags":{},"startTime":1784593140393,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":479874,"timestamp":5785168178172,"id":75,"parentId":22,"tags":{},"startTime":1784593140424,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":507768,"timestamp":5785168150451,"id":22,"parentId":19,"tags":{"page":"/_global-error"},"startTime":1784593140397,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":590296,"timestamp":5785168178501,"id":77,"parentId":30,"tags":{},"startTime":1784593140425,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":609778,"timestamp":5785168159125,"id":30,"parentId":19,"tags":{"page":"/api/anet/providers/probe"},"startTime":1784593140405,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":612286,"timestamp":5785168179444,"id":82,"parentId":36,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":629550,"timestamp":5785168162413,"id":36,"parentId":19,"tags":{"page":"/api/hub/auth"},"startTime":1784593140409,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":629050,"timestamp":5785168179253,"id":81,"parentId":35,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":646410,"timestamp":5785168161969,"id":35,"parentId":19,"tags":{"page":"/api/hub/audit-log"},"startTime":1784593140408,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":666266,"timestamp":5785168179574,"id":83,"parentId":37,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":683375,"timestamp":5785168162546,"id":37,"parentId":19,"tags":{"page":"/api/hub/broadcast"},"startTime":1784593140409,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":676718,"timestamp":5785168179696,"id":85,"parentId":40,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":693552,"timestamp":5785168162952,"id":40,"parentId":19,"tags":{"page":"/api/hub/inbox"},"startTime":1784593140409,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":680277,"timestamp":5785168179831,"id":86,"parentId":41,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":697108,"timestamp":5785168163079,"id":41,"parentId":19,"tags":{"page":"/api/hub/messages"},"startTime":1784593140409,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":689029,"timestamp":5785168179864,"id":87,"parentId":42,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":705789,"timestamp":5785168163176,"id":42,"parentId":19,"tags":{"page":"/api/hub/networks"},"startTime":1784593140409,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":693887,"timestamp":5785168179884,"id":88,"parentId":43,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":710584,"timestamp":5785168163271,"id":43,"parentId":19,"tags":{"page":"/api/hub/nodes"},"startTime":1784593140410,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":699150,"timestamp":5785168179900,"id":89,"parentId":44,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":715756,"timestamp":5785168163369,"id":44,"parentId":19,"tags":{"page":"/api/hub/register"},"startTime":1784593140410,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":705787,"timestamp":5785168179916,"id":90,"parentId":45,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":722322,"timestamp":5785168163456,"id":45,"parentId":19,"tags":{"page":"/api/hub/send"},"startTime":1784593140410,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":710602,"timestamp":5785168179933,"id":91,"parentId":46,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":727041,"timestamp":5785168163562,"id":46,"parentId":19,"tags":{"page":"/api/hub/server-logs"},"startTime":1784593140410,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":725216,"timestamp":5785168179952,"id":92,"parentId":48,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":741441,"timestamp":5785168163834,"id":48,"parentId":19,"tags":{"page":"/api/hub/server/[hostname]/health"},"startTime":1784593140410,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":726569,"timestamp":5785168179100,"id":80,"parentId":34,"tags":{},"startTime":1784593140425,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":743902,"timestamp":5785168161826,"id":34,"parentId":19,"tags":{"page":"/api/auth/v3"},"startTime":1784593140408,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":728150,"timestamp":5785168179967,"id":93,"parentId":50,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":743921,"timestamp":5785168164252,"id":50,"parentId":19,"tags":{"page":"/api/hub/session"},"startTime":1784593140411,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":733775,"timestamp":5785168179993,"id":95,"parentId":52,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":749182,"timestamp":5785168164643,"id":52,"parentId":19,"tags":{"page":"/api/hub/status"},"startTime":1784593140411,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":739560,"timestamp":5785168180037,"id":96,"parentId":53,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":754940,"timestamp":5785168164726,"id":53,"parentId":19,"tags":{"page":"/api/hub/task-events"},"startTime":1784593140411,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":742701,"timestamp":5785168179659,"id":84,"parentId":39,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":759594,"timestamp":5785168162837,"id":39,"parentId":19,"tags":{"page":"/api/hub/health"},"startTime":1784593140409,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":744734,"timestamp":5785168180051,"id":97,"parentId":54,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":760057,"timestamp":5785168164782,"id":54,"parentId":19,"tags":{"page":"/api/hub/tasks"},"startTime":1784593140411,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":751386,"timestamp":5785168180083,"id":99,"parentId":56,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":766607,"timestamp":5785168164919,"id":56,"parentId":19,"tags":{"page":"/api/hub/tokens"},"startTime":1784593140411,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":756493,"timestamp":5785168180100,"id":100,"parentId":57,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":771831,"timestamp":5785168164970,"id":57,"parentId":19,"tags":{"page":"/api/hub/upload"},"startTime":1784593140411,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":760832,"timestamp":5785168180113,"id":101,"parentId":58,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":774280,"timestamp":5785168166745,"id":58,"parentId":19,"tags":{"page":"/favicon.ico"},"startTime":1784593140413,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":766683,"timestamp":5785168180067,"id":98,"parentId":55,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":781951,"timestamp":5785168164863,"id":55,"parentId":19,"tags":{"page":"/api/hub/tmux"},"startTime":1784593140411,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":766862,"timestamp":5785168180128,"id":102,"parentId":61,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":779270,"timestamp":5785168167808,"id":61,"parentId":19,"tags":{"page":"/manifest.webmanifest"},"startTime":1784593140414,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":771944,"timestamp":5785168179978,"id":94,"parentId":51,"tags":{},"startTime":1784593140426,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":787467,"timestamp":5785168164510,"id":51,"parentId":19,"tags":{"page":"/api/hub/stats"},"startTime":1784593140411,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":748353,"timestamp":5785168211495,"id":104,"parentId":25,"tags":{},"startTime":1784593140458,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":803138,"timestamp":5785168156773,"id":25,"parentId":19,"tags":{"page":"/api/anet/host-supervisors"},"startTime":1784593140403,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":758743,"timestamp":5785168202064,"id":103,"parentId":24,"tags":{},"startTime":1784593140448,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":807216,"timestamp":5785168153644,"id":24,"parentId":19,"tags":{"page":"/api/anet/config"},"startTime":1784593140400,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":716775,"timestamp":5785168252491,"id":107,"parentId":31,"tags":{},"startTime":1784593140499,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":810109,"timestamp":5785168159300,"id":31,"parentId":19,"tags":{"page":"/api/anet/providers"},"startTime":1784593140406,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":731221,"timestamp":5785168238681,"id":106,"parentId":28,"tags":{},"startTime":1784593140485,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":811451,"timestamp":5785168158512,"id":28,"parentId":19,"tags":{"page":"/api/anet/node-lifecycle"},"startTime":1784593140405,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":716640,"timestamp":5785168269153,"id":108,"parentId":26,"tags":{},"startTime":1784593140515,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":828675,"timestamp":5785168157203,"id":26,"parentId":19,"tags":{"page":"/api/anet/node-config"},"startTime":1784593140403,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":780124,"timestamp":5785168214511,"id":105,"parentId":27,"tags":{},"startTime":1784593140461,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":836635,"timestamp":5785168158080,"id":27,"parentId":19,"tags":{"page":"/api/anet/node-create"},"startTime":1784593140404,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":722279,"timestamp":5785168272635,"id":110,"parentId":49,"tags":{},"startTime":1784593140519,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":831031,"timestamp":5785168163923,"id":49,"parentId":19,"tags":{"page":"/api/hub/servers"},"startTime":1784593140410,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":733152,"timestamp":5785168271162,"id":109,"parentId":38,"tags":{},"startTime":1784593140517,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":841781,"timestamp":5785168162620,"id":38,"parentId":19,"tags":{"page":"/api/hub/events"},"startTime":1784593140409,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":732878,"timestamp":5785168277952,"id":111,"parentId":47,"tags":{},"startTime":1784593140524,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":847271,"timestamp":5785168163627,"id":47,"parentId":19,"tags":{"page":"/api/hub/server/[hostname]/agents"},"startTime":1784593140410,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":834568,"timestamp":5785168178368,"id":76,"parentId":29,"tags":{},"startTime":1784593140425,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":858165,"timestamp":5785168158901,"id":29,"parentId":19,"tags":{"page":"/api/anet/providers/probe-results"},"startTime":1784593140405,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":859856,"timestamp":5785168178893,"id":79,"parentId":33,"tags":{},"startTime":1784593140425,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":878919,"timestamp":5785168159908,"id":33,"parentId":19,"tags":{"page":"/api/auth/logout"},"startTime":1784593140406,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":743603,"timestamp":5785168331842,"id":114,"parentId":60,"tags":{},"startTime":1784593140578,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":907939,"timestamp":5785168167581,"id":60,"parentId":19,"tags":{"page":"/logs"},"startTime":1784593140414,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":746344,"timestamp":5785168331759,"id":112,"parentId":23,"tags":{},"startTime":1784593140578,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":927225,"timestamp":5785168150931,"id":23,"parentId":19,"tags":{"page":"/admin"},"startTime":1784593140397,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":756136,"timestamp":5785168331888,"id":118,"parentId":66,"tags":{},"startTime":1784593140578,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":918517,"timestamp":5785168169582,"id":66,"parentId":19,"tags":{"page":"/providers"},"startTime":1784593140416,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":761159,"timestamp":5785168331876,"id":117,"parentId":64,"tags":{},"startTime":1784593140578,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":924442,"timestamp":5785168168649,"id":64,"parentId":19,"tags":{"page":"/nodes"},"startTime":1784593140415,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":764383,"timestamp":5785168331899,"id":119,"parentId":67,"tags":{},"startTime":1784593140578,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":926479,"timestamp":5785168169850,"id":67,"parentId":19,"tags":{"page":"/server-logs"},"startTime":1784593140416,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":767678,"timestamp":5785168331854,"id":115,"parentId":62,"tags":{},"startTime":1784593140578,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":931640,"timestamp":5785168167937,"id":62,"parentId":19,"tags":{"page":"/messages"},"startTime":1784593140414,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":772680,"timestamp":5785168331923,"id":121,"parentId":69,"tags":{},"startTime":1784593140578,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":934111,"timestamp":5785168170539,"id":69,"parentId":19,"tags":{"page":"/settings/networks"},"startTime":1784593140417,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":781646,"timestamp":5785168331911,"id":120,"parentId":68,"tags":{},"startTime":1784593140578,"traceId":"fa176a3eeb26525f"}]
2
+ [{"name":"check-page","duration":943496,"timestamp":5785168170349,"id":68,"parentId":19,"tags":{"page":"/servers"},"startTime":1784593140417,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":784200,"timestamp":5785168331933,"id":122,"parentId":71,"tags":{},"startTime":1784593140578,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":944747,"timestamp":5785168171428,"id":71,"parentId":19,"tags":{"page":"/settings/tokens"},"startTime":1784593140418,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":799243,"timestamp":5785168331955,"id":124,"parentId":73,"tags":{},"startTime":1784593140578,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":959195,"timestamp":5785168172061,"id":73,"parentId":19,"tags":{"page":"/tasks"},"startTime":1784593140418,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":802717,"timestamp":5785168331945,"id":123,"parentId":72,"tags":{},"startTime":1784593140578,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":963080,"timestamp":5785168171635,"id":72,"parentId":19,"tags":{"page":"/tasks/[id]"},"startTime":1784593140418,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":802972,"timestamp":5785168331827,"id":113,"parentId":59,"tags":{},"startTime":1784593140578,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":967474,"timestamp":5785168167349,"id":59,"parentId":19,"tags":{"page":"/login"},"startTime":1784593140414,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":808494,"timestamp":5785168331977,"id":126,"parentId":70,"tags":{},"startTime":1784593140578,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":969717,"timestamp":5785168170794,"id":70,"parentId":19,"tags":{"page":"/settings"},"startTime":1784593140417,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":853859,"timestamp":5785168331966,"id":125,"parentId":65,"tags":{},"startTime":1784593140578,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":1016865,"timestamp":5785168169016,"id":65,"parentId":19,"tags":{"page":"/"},"startTime":1784593140415,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":869482,"timestamp":5785168331865,"id":116,"parentId":63,"tags":{},"startTime":1784593140578,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":1033110,"timestamp":5785168168315,"id":63,"parentId":19,"tags":{"page":"/node"},"startTime":1784593140415,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":1139532,"timestamp":5785168177323,"id":74,"parentId":21,"tags":{},"startTime":1784593140424,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":1168425,"timestamp":5785168148505,"id":21,"parentId":19,"tags":{"page":"/_not-found"},"startTime":1784593140395,"traceId":"fa176a3eeb26525f"},{"name":"is-page-static","duration":1203258,"timestamp":5785168178618,"id":78,"parentId":32,"tags":{},"startTime":1784593140425,"traceId":"fa176a3eeb26525f"},{"name":"check-page","duration":1222210,"timestamp":5785168159753,"id":32,"parentId":19,"tags":{"page":"/api/auth/login"},"startTime":1784593140406,"traceId":"fa176a3eeb26525f"},{"name":"static-check","duration":1237922,"timestamp":5785168144141,"id":19,"parentId":1,"tags":{},"startTime":1784593140390,"traceId":"fa176a3eeb26525f"},{"name":"write-routes-manifest","duration":602,"timestamp":5785169391231,"id":128,"parentId":1,"tags":{},"startTime":1784593141638,"traceId":"fa176a3eeb26525f"},{"name":"load-dotenv","duration":70,"timestamp":5785169406517,"id":131,"parentId":130,"tags":{},"startTime":1784593141653,"traceId":"fa176a3eeb26525f"},{"name":"run-export-path-map","duration":1876,"timestamp":5785169409945,"id":132,"parentId":130,"tags":{},"startTime":1784593141656,"traceId":"fa176a3eeb26525f"},{"name":"next-export","duration":890250,"timestamp":5785169404619,"id":130,"parentId":1,"tags":{},"startTime":1784593141651,"traceId":"fa176a3eeb26525f"},{"name":"move-exported-app-not-found-","duration":754,"timestamp":5785170299216,"id":133,"parentId":129,"tags":{},"startTime":1784593142545,"traceId":"fa176a3eeb26525f"},{"name":"move-exported-app-global-error-","duration":488,"timestamp":5785170300140,"id":134,"parentId":129,"tags":{},"startTime":1784593142546,"traceId":"fa176a3eeb26525f"},{"name":"static-generation","duration":906807,"timestamp":5785169396443,"id":129,"parentId":1,"tags":{},"startTime":1784593141643,"traceId":"fa176a3eeb26525f"},{"name":"write-routes-manifest","duration":563,"timestamp":5785170303573,"id":135,"parentId":1,"tags":{},"startTime":1784593142550,"traceId":"fa176a3eeb26525f"},{"name":"print-tree-view","duration":6835,"timestamp":5785170337346,"id":136,"parentId":1,"tags":{},"startTime":1784593142584,"traceId":"fa176a3eeb26525f"},{"name":"write-route-bundle-stats","duration":27446,"timestamp":5785170344238,"id":137,"parentId":1,"tags":{},"startTime":1784593142591,"traceId":"fa176a3eeb26525f"},{"name":"telemetry-flush","duration":137,"timestamp":5785170371738,"id":138,"parentId":1,"tags":{},"startTime":1784593142618,"traceId":"fa176a3eeb26525f"},{"name":"next-build","duration":25096430,"timestamp":5785145275472,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1784593117522,"traceId":"fa176a3eeb26525f"}]
package/.next/trace-build CHANGED
@@ -1 +1 @@
1
- [{"name":"run-turbopack","duration":8784078,"timestamp":5781306619525,"id":14,"parentId":1,"tags":{},"startTime":1784589278866,"traceId":"55ea1ce62d465966"},{"name":"turbopack-build-events","duration":130,"timestamp":5781307028484,"id":15,"parentId":1,"tags":{},"startTime":1784589279275,"traceId":"55ea1ce62d465966"},{"name":"run-typescript","duration":13556194,"timestamp":5781315413521,"id":16,"parentId":1,"tags":{},"startTime":1784589287660,"traceId":"55ea1ce62d465966"},{"name":"static-check","duration":1371735,"timestamp":5781329238949,"id":19,"parentId":1,"tags":{},"startTime":1784589301485,"traceId":"55ea1ce62d465966"},{"name":"static-generation","duration":847267,"timestamp":5781330631913,"id":129,"parentId":1,"tags":{},"startTime":1784589302878,"traceId":"55ea1ce62d465966"},{"name":"telemetry-flush","duration":17798,"timestamp":5781331518292,"id":138,"parentId":1,"tags":{},"startTime":1784589303765,"traceId":"55ea1ce62d465966"},{"name":"next-build","duration":25177230,"timestamp":5781306358907,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1784589278605,"traceId":"55ea1ce62d465966"}]
1
+ [{"name":"run-turbopack","duration":8650502,"timestamp":5785145621480,"id":14,"parentId":1,"tags":{},"startTime":1784593117868,"traceId":"fa176a3eeb26525f"},{"name":"turbopack-build-events","duration":133,"timestamp":5785145943379,"id":15,"parentId":1,"tags":{},"startTime":1784593118190,"traceId":"fa176a3eeb26525f"},{"name":"run-typescript","duration":13569209,"timestamp":5785154301205,"id":16,"parentId":1,"tags":{},"startTime":1784593126547,"traceId":"fa176a3eeb26525f"},{"name":"static-check","duration":1237922,"timestamp":5785168144141,"id":19,"parentId":1,"tags":{},"startTime":1784593140390,"traceId":"fa176a3eeb26525f"},{"name":"static-generation","duration":906807,"timestamp":5785169396443,"id":129,"parentId":1,"tags":{},"startTime":1784593141643,"traceId":"fa176a3eeb26525f"},{"name":"telemetry-flush","duration":137,"timestamp":5785170371738,"id":138,"parentId":1,"tags":{},"startTime":1784593142618,"traceId":"fa176a3eeb26525f"},{"name":"next-build","duration":25096430,"timestamp":5785145275472,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1784593117522,"traceId":"fa176a3eeb26525f"}]
@@ -5,6 +5,7 @@ import Link from 'next/link';
5
5
  import { Session } from './types';
6
6
  import { timeAgo } from './utils';
7
7
  import { AliasAvatar } from './AliasAvatar';
8
+ import { useHasDraft } from '../lib/chat-drafts';
8
9
  import { NodeSettingsPanel } from './NodeSettingsPanel';
9
10
 
10
11
  interface AgentCardProps {
@@ -28,6 +29,10 @@ const STATUS_CONFIG: Record<string, { bg: string; text: string; dot: string; glo
28
29
  const DEFAULT_STATUS = { bg: 'bg-gray-800/50 border-gray-700/30', text: 'text-gray-500', dot: 'bg-gray-500', glow: '' };
29
30
 
30
31
  function AgentCardInner({ session: s, hasSse, sseCount, onChat, unreadCount = 0 }: AgentCardProps) {
32
+ // R10 微信草稿闭环: list surfaces show which conversation has an unsent
33
+ // draft. Internal subscription (useSyncExternalStore) so the memo
34
+ // comparator stays untouched — a draft change re-renders only this card.
35
+ const hasDraft = useHasDraft(s.alias);
31
36
  const cfg = hasSse ? (STATUS_CONFIG[s.status] || DEFAULT_STATUS) : DEFAULT_STATUS;
32
37
  // #260: per-node settings panel (UI-only stub). Local open state — the
33
38
  // panel itself is presentational and issues no backend calls.
@@ -81,6 +86,7 @@ function AgentCardInner({ session: s, hasSse, sseCount, onChat, unreadCount = 0
81
86
  )}
82
87
  </span>
83
88
  <span className="font-semibold text-white truncate text-sm" title={s.alias}>{s.alias}</span>
89
+ {hasDraft && <span className="shrink-0 text-[9px] text-red-400/90" aria-label="有未发送草稿">[草稿]</span>}
84
90
  <span className={`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${cfg.dot} ${hasSse && s.status === 'working' ? 'animate-pulse' : ''}`} />
85
91
  </div>
86
92
  <div className="flex items-center gap-1 shrink-0">