@sleep2agi/agent-network-dashboard 0.4.5-preview.36 → 0.4.5-preview.37

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 (175) 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 +15 -15
  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 +2 -2
  41. package/.next/server/app/login.segments/_full.segment.rsc +2 -2
  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 +1 -1
  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 +3 -3
  50. package/.next/server/app/logs.segments/_full.segment.rsc +3 -3
  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 +2 -2
  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 +3 -3
  59. package/.next/server/app/messages.segments/_full.segment.rsc +3 -3
  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 +2 -2
  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 +2 -2
  68. package/.next/server/app/node.segments/_full.segment.rsc +2 -2
  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 +1 -1
  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/server-logs/page_client-reference-manifest.js +1 -1
  85. package/.next/server/app/server-logs.html +2 -2
  86. package/.next/server/app/server-logs.rsc +2 -2
  87. package/.next/server/app/server-logs.segments/_full.segment.rsc +2 -2
  88. package/.next/server/app/server-logs.segments/_head.segment.rsc +1 -1
  89. package/.next/server/app/server-logs.segments/_index.segment.rsc +2 -2
  90. package/.next/server/app/server-logs.segments/_tree.segment.rsc +2 -2
  91. package/.next/server/app/server-logs.segments/server-logs/__PAGE__.segment.rsc +1 -1
  92. package/.next/server/app/server-logs.segments/server-logs.segment.rsc +1 -1
  93. package/.next/server/app/settings/networks/page_client-reference-manifest.js +1 -1
  94. package/.next/server/app/settings/networks.html +2 -2
  95. package/.next/server/app/settings/networks.rsc +3 -3
  96. package/.next/server/app/settings/networks.segments/_full.segment.rsc +3 -3
  97. package/.next/server/app/settings/networks.segments/_head.segment.rsc +1 -1
  98. package/.next/server/app/settings/networks.segments/_index.segment.rsc +2 -2
  99. package/.next/server/app/settings/networks.segments/_tree.segment.rsc +2 -2
  100. package/.next/server/app/settings/networks.segments/settings/networks/__PAGE__.segment.rsc +2 -2
  101. package/.next/server/app/settings/networks.segments/settings/networks.segment.rsc +1 -1
  102. package/.next/server/app/settings/networks.segments/settings.segment.rsc +1 -1
  103. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  104. package/.next/server/app/settings/tokens/page_client-reference-manifest.js +1 -1
  105. package/.next/server/app/settings/tokens.html +2 -2
  106. package/.next/server/app/settings/tokens.rsc +3 -3
  107. package/.next/server/app/settings/tokens.segments/_full.segment.rsc +3 -3
  108. package/.next/server/app/settings/tokens.segments/_head.segment.rsc +1 -1
  109. package/.next/server/app/settings/tokens.segments/_index.segment.rsc +2 -2
  110. package/.next/server/app/settings/tokens.segments/_tree.segment.rsc +2 -2
  111. package/.next/server/app/settings/tokens.segments/settings/tokens/__PAGE__.segment.rsc +2 -2
  112. package/.next/server/app/settings/tokens.segments/settings/tokens.segment.rsc +1 -1
  113. package/.next/server/app/settings/tokens.segments/settings.segment.rsc +1 -1
  114. package/.next/server/app/settings.html +2 -2
  115. package/.next/server/app/settings.rsc +3 -3
  116. package/.next/server/app/settings.segments/_full.segment.rsc +3 -3
  117. package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  118. package/.next/server/app/settings.segments/_index.segment.rsc +2 -2
  119. package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  120. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
  121. package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  122. package/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
  123. package/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
  124. package/.next/server/app/tasks.html +2 -2
  125. package/.next/server/app/tasks.rsc +3 -3
  126. package/.next/server/app/tasks.segments/_full.segment.rsc +3 -3
  127. package/.next/server/app/tasks.segments/_head.segment.rsc +1 -1
  128. package/.next/server/app/tasks.segments/_index.segment.rsc +2 -2
  129. package/.next/server/app/tasks.segments/_tree.segment.rsc +2 -2
  130. package/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +2 -2
  131. package/.next/server/app/tasks.segments/tasks.segment.rsc +1 -1
  132. package/.next/server/chunks/ssr/[root-of-the-server]__0jjqrcf._.js +1 -1
  133. package/.next/server/chunks/ssr/[root-of-the-server]__0jjqrcf._.js.map +1 -1
  134. package/.next/server/chunks/ssr/[root-of-the-server]__0o8yj3c._.js +1 -1
  135. package/.next/server/chunks/ssr/[root-of-the-server]__0o8yj3c._.js.map +1 -1
  136. package/.next/server/chunks/ssr/app_0.zbtn5._.js +1 -1
  137. package/.next/server/chunks/ssr/app_0.zbtn5._.js.map +1 -1
  138. package/.next/server/chunks/ssr/app_04n78pr._.js +1 -1
  139. package/.next/server/chunks/ssr/app_04n78pr._.js.map +1 -1
  140. package/.next/server/chunks/ssr/app_0_agk0r._.js +1 -1
  141. package/.next/server/chunks/ssr/app_0_agk0r._.js.map +1 -1
  142. package/.next/server/chunks/ssr/app_0dk5wao._.js +1 -1
  143. package/.next/server/chunks/ssr/app_0dk5wao._.js.map +1 -1
  144. package/.next/server/chunks/ssr/app_0izi28j._.js +1 -1
  145. package/.next/server/chunks/ssr/app_0izi28j._.js.map +1 -1
  146. package/.next/server/chunks/ssr/app_components_0lhp_k.._.js +1 -1
  147. package/.next/server/chunks/ssr/app_components_0lhp_k.._.js.map +1 -1
  148. package/.next/server/middleware-build-manifest.js +3 -3
  149. package/.next/server/pages/404.html +2 -2
  150. package/.next/server/pages/500.html +1 -1
  151. package/.next/server/server-reference-manifest.js +1 -1
  152. package/.next/server/server-reference-manifest.json +1 -1
  153. package/.next/static/chunks/02oje7pf-g1v5.js +1 -0
  154. package/.next/static/chunks/{08ka465rplcjn.css → 03udkhr4.adz5.css} +1 -1
  155. package/.next/static/chunks/0df0py1glk9xm.js +1 -0
  156. package/.next/static/chunks/0edt_z0rlxgfk.js +1 -0
  157. package/.next/static/chunks/0irkayokwc1fm.js +1 -0
  158. package/.next/static/chunks/0j8ee64jv6zb7.js +7 -0
  159. package/.next/static/chunks/{124vt8gos08d7.js → 0r9nikv9x5115.js} +1 -1
  160. package/.next/static/chunks/0x0_21kq7yprc.js +1 -0
  161. package/.next/static/chunks/15c9pv6gxir.5.js +1 -0
  162. package/.next/trace +2 -2
  163. package/.next/trace-build +1 -1
  164. package/app/components/EmptyState.tsx +43 -3
  165. package/package.json +1 -1
  166. package/.next/static/chunks/083m.5wlya_1..js +0 -7
  167. package/.next/static/chunks/0bclj8wiocyi-.js +0 -1
  168. package/.next/static/chunks/0etgle5474~16.js +0 -1
  169. package/.next/static/chunks/0fnyg51n6d6xl.js +0 -1
  170. package/.next/static/chunks/0tvo.1t5e0iv4.js +0 -1
  171. package/.next/static/chunks/10l6kxloegrxe.js +0 -1
  172. package/.next/static/chunks/150z3fnk_cn1l.js +0 -1
  173. /package/.next/static/{TQLS6FMbMzRQK7qiCSXgd → yJxQzuXP5gP8su2eIEnHR}/_buildManifest.js +0 -0
  174. /package/.next/static/{TQLS6FMbMzRQK7qiCSXgd → yJxQzuXP5gP8su2eIEnHR}/_clientMiddlewareManifest.js +0 -0
  175. /package/.next/static/{TQLS6FMbMzRQK7qiCSXgd → yJxQzuXP5gP8su2eIEnHR}/_ssgManifest.js +0 -0
@@ -0,0 +1,7 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18150,e=>{"use strict";e.s(["formatUptime",0,function(e){let t=Math.floor(e/3600),s=Math.floor(e%3600/60);return t>0?`${t}h ${s}m`:`${s}m`},"timeAgo",0,function(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}])},69874,e=>{"use strict";var t=e.i(18050);let s=[180,200,220,270,300,330,30,90];e.s(["AliasAvatar",0,function({alias:e,size:a=28,className:r=""}){let i=function(e){let t=0;for(let s=0;s<e.length;s++)t=31*t+e.charCodeAt(s)>>>0;let a=s[t%s.length];return{bg:`hsl(${a} 55% 22%)`,ring:`hsl(${a} 60% 45%)`,text:`hsl(${a} 80% 78%)`}}(e),n=Math.max(9,Math.round(.42*a));return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${r}`,style:{width:a,height:a,fontSize:n,backgroundColor:i.bg,borderColor:i.ring,color:i.text},title:e,"aria-hidden":!0,children:e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"})}])},95356,e=>{"use strict";var t=e.i(18050),s=e.i(71645),a=e.i(22016);let r={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function i({variant:e,size:s}){let a={width:s,height:s},r={fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"nodes":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"14",r:"4"}),(0,t.jsx)("circle",{cx:"14",cy:"44",r:"4"}),(0,t.jsx)("circle",{cx:"50",cy:"44",r:"4"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"14",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"50",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"18",y1:"44",x2:"46",y2:"44",strokeDasharray:"3 3",opacity:"0.6"})]})});case"tasks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("rect",{x:"14",y:"14",width:"36",height:"6",rx:"1.5"}),(0,t.jsx)("rect",{x:"14",y:"26",width:"36",height:"6",rx:"1.5",opacity:"0.6"}),(0,t.jsx)("rect",{x:"14",y:"38",width:"36",height:"6",rx:"1.5",opacity:"0.35"})]})});case"messages":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M14 18 h36 a3 3 0 0 1 3 3 v18 a3 3 0 0 1 -3 3 h-18 l-8 6 v-6 h-10 a3 3 0 0 1 -3 -3 v-18 a3 3 0 0 1 3 -3 z"}),(0,t.jsx)("line",{x1:"22",y1:"28",x2:"42",y2:"28",opacity:"0.5"}),(0,t.jsx)("line",{x1:"22",y1:"34",x2:"36",y2:"34",opacity:"0.5"})]})});case"logs":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M18 12 h22 l8 8 v32 a2 2 0 0 1 -2 2 h-28 a2 2 0 0 1 -2 -2 v-38 a2 2 0 0 1 2 -2 z"}),(0,t.jsx)("path",{d:"M40 12 v8 h8",opacity:"0.6"}),(0,t.jsx)("line",{x1:"24",y1:"32",x2:"40",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"24",y1:"38",x2:"40",y2:"38",opacity:"0.4"}),(0,t.jsx)("line",{x1:"24",y1:"44",x2:"34",y2:"44",opacity:"0.25"})]})});case"tokens":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"22",cy:"32",r:"8"}),(0,t.jsx)("line",{x1:"30",y1:"32",x2:"54",y2:"32"}),(0,t.jsx)("line",{x1:"44",y1:"32",x2:"44",y2:"38"}),(0,t.jsx)("line",{x1:"50",y1:"32",x2:"50",y2:"40"})]})});case"networks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"18"}),(0,t.jsx)("ellipse",{cx:"32",cy:"32",rx:"18",ry:"9",opacity:"0.55"}),(0,t.jsx)("line",{x1:"14",y1:"32",x2:"50",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"32",y1:"14",x2:"32",y2:"50",opacity:"0.55"})]})});default:return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"14",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"32",cy:"32",r:"3"})]})})}}function n({variant:e="generic",title:s,sub:l,cta:o,compact:c=!1}){let x=r[e],d=s??x.title,h=l??x.sub;return(0,t.jsxs)("div",{className:`text-center ${c?"py-8":"py-16"} px-4`,role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)(i,{variant:e,size:c?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${c?"text-sm":"text-base"}`,children:d}),h&&(0,t.jsx)("p",{className:`text-gray-500 ${c?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:h}),o&&(0,t.jsx)("div",{className:"mt-4",children:o.href?(0,t.jsxs)(a.default,{href:o.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,t.jsxs)("button",{onClick:o.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}function l({cmd:e}){let[a,r]=(0,s.useState)(!1),i=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1800)}catch{}};return(0,t.jsxs)("div",{className:"anet-empty-cmd flex items-center gap-2 bg-[#0a0a15] border border-[#2a2a4a] rounded-lg pl-4 pr-1.5 py-1.5 text-xs sm:text-sm",children:[(0,t.jsx)("code",{className:"text-cyan-300 font-mono select-all",children:e}),(0,t.jsx)("button",{type:"button",onClick:i,"aria-label":a?"Copied":"Copy command",className:"shrink-0 rounded-md px-2 py-1.5 text-[11px] text-gray-500 hover:text-gray-200 hover:bg-[#1a1a2a] transition-colors",children:a?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-green-400",children:[(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5"})}),"Copied"]}):(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Copy"]})})]})}e.s(["EmptyState",0,n,"NodesEmptyState",0,function({hint:e}){return e?.global_count?(0,t.jsx)(n,{variant:"nodes",title:"No agents in this network",sub:`Server has ${e.global_count} nodes globally, but none are registered to the current network. Switch network or contact admin.`}):(0,t.jsxs)("div",{className:"text-center py-16 px-4",role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)("svg",{viewBox:"0 0 64 64",width:56,height:56,children:(0,t.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[(0,t.jsx)("rect",{x:"10",y:"20",width:"44",height:"28",rx:"2"}),(0,t.jsx)("rect",{x:"20",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"32",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"44",y:"32",width:"4",height:"8",opacity:"0.5"}),(0,t.jsx)("line",{x1:"10",y1:"26",x2:"54",y2:"26",opacity:"0.4"}),(0,t.jsx)("circle",{cx:"14",cy:"23",r:"0.8",fill:"currentColor"})]})})}),(0,t.jsx)("h3",{className:"font-medium text-gray-300 text-base",children:"Spin up your first agent"}),(0,t.jsx)("p",{className:"text-gray-500 text-sm mt-2 max-w-md mx-auto leading-relaxed",children:"Run this in a fresh terminal to register an agent with this CommHub:"}),(0,t.jsx)("div",{className:"mt-4 inline-block",children:(0,t.jsx)(l,{cmd:"npx --yes @sleep2agi/agent-network init"})}),(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsxs)("a",{href:"https://anet.sh",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium text-gray-500 hover:text-cyan-300",children:["Full quickstart guide",(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}])},65822,e=>{"use strict";var t=e.i(83599),s=e.i(58963);let a=async e=>{let t=await fetch(e);if(401===t.status)throw window.location.assign("/login"),Error("unauthorized");return t.json()},r={refreshInterval:5e3,dedupingInterval:3e3};function i(e,t){if(!t)return e;let s=e.includes("?")?"&":"?";return`${e}${s}network_id=${encodeURIComponent(t)}`}e.s(["useAnetConfig",0,function(){let{data:e}=(0,t.default)("/api/anet/config",a,{refreshInterval:3e4});return{config:e||null}},"useHealth",0,function(){let{data:e,error:s}=(0,t.default)("/api/hub/health",a,r);return{health:e||null,error:s}},"useLicense",0,function(){let{data:e,error:s}=(0,t.default)("/api/hub/license",a,{refreshInterval:6e4});return{license:e?.ok?e:null,error:s}},"useMessages",0,function(e=100){let{networkId:n}=(0,s.useNetworkId)(),{data:l,error:o,isLoading:c}=(0,t.default)(i(`/api/hub/messages?limit=${e}`,n),a,r);return{messages:l?.messages||[],error:o,isLoading:c}},"useSessions",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:n,error:l,isLoading:o}=(0,t.default)(i("/api/hub/status",e),a,r);return{sessions:n?.sessions||[],hint:n?._hint,error:l,isLoading:o}},"useStats",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:n,error:l}=(0,t.default)(i("/api/hub/stats",e),a,r);return{stats:n?.ok?n:null,error:l}},"useTasks",0,function(e){let{networkId:n}=(0,s.useNetworkId)(),l=new URLSearchParams({limit:"100",...e}).toString(),{data:o,error:c,isLoading:x}=(0,t.default)(i(`/api/hub/tasks?${l}`,n),a,r);return{tasks:o?.tasks||[],count:o?.count??0,source:o?.source,error:c,isLoading:x}}])},82756,e=>{"use strict";var t=e.i(18050),s=e.i(71645),a=e.i(65822),r=e.i(18150),i=e.i(95356),n=e.i(69874);let l={task:"bg-green-500/10 text-green-300 border-green-500/20",message:"bg-blue-500/10 text-blue-300 border-blue-500/20",broadcast:"bg-purple-500/10 text-purple-300 border-purple-500/20",reply:"bg-cyan-500/10 text-cyan-300 border-cyan-500/20"};function o(e){return e?new Date(e.replace(" ","T")+"Z").getTime():0}function c(e){return"broadcast"===e.type?"broadcast":"dashboard"===(e.from_alias||"").toLowerCase()?"outgoing":"incoming"}function x(e,s){let a=e||"--",r=s.trim();if(!r||r.startsWith("from:"))return a;let i=a.toLowerCase().indexOf(r.toLowerCase());return i<0?a:(0,t.jsxs)(t.Fragment,{children:[a.slice(0,i),(0,t.jsx)("mark",{className:"bg-yellow-500/30 text-yellow-200 rounded px-0.5",children:a.slice(i,i+r.length)}),a.slice(i+r.length)]})}e.s(["default",0,function(){let{messages:e,isLoading:d}=(0,a.useMessages)(200),[h,m]=(0,s.useState)(""),[u,p]=(0,s.useState)(""),[g,y]=(0,s.useState)(!1),[j,b]=(0,s.useState)("timeline"),f=(0,s.useMemo)(()=>{let t=new Set;return e.forEach(e=>{let s=e.from_alias?.trim();s&&"dashboard"!==s.toLowerCase()&&t.add(s)}),[...t].slice(0,8)},[e]),v=(0,s.useMemo)(()=>{let t=u.trim().toLowerCase(),s=t.startsWith("from:")?t.slice(5).trim():"";return[...e].filter(e=>(!h||e.type===h)&&(s?(e.from_alias||"").toLowerCase().includes(s):!t||(e.from_alias||"").toLowerCase().includes(t)||(e.to_alias||"").toLowerCase().includes(t)||(e.content||"").toLowerCase().includes(t))).sort((e,t)=>o(e.created_at)-o(t.created_at))},[h,e,u]),w=(0,s.useMemo)(()=>{let e=new Map;return v.forEach(t=>{let s=t.from_alias||"?",a=t.to_alias||"?",r=[s,a].sort().join("↔"),i=e.get(r)||{participants:[s,a].sort(),messages:[],lastTime:0};i.messages.push(t),i.lastTime=Math.max(i.lastTime,o(t.created_at)),e.set(r,i)}),[...e.values()].sort((e,t)=>t.lastTime-e.lastTime)},[v]);return(0,t.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-white lg:ml-0 ml-10",children:"Messages"}),(0,t.jsx)("span",{className:"text-xs bg-blue-900/30 text-blue-400 px-2 py-0.5 rounded-full border border-blue-800/30",children:e.length}),v.length>0&&(0,t.jsx)("button",{onClick:()=>{let e=v.map(e=>`**${e.from_alias||"?"}** → ${e.to_alias||"?"} (${e.type||"?"}) — ${e.created_at||""}
2
+
3
+ ${e.content||"--"}
4
+
5
+ ---`).join("\n\n"),t=new Blob([`# Messages Export
6
+
7
+ ${e}`],{type:"text/markdown"}),s=URL.createObjectURL(t),a=document.createElement("a");a.href=s,a.download=`messages-${new Date().toISOString().slice(0,10)}.md`,a.click(),URL.revokeObjectURL(s)},className:"text-xs text-gray-500 hover:text-gray-300 border border-gray-700/50 px-2.5 py-1 rounded-lg transition-colors",children:"Export MD"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-3 mb-3",children:[(0,t.jsx)("input",{type:"text",value:u,onChange:e=>p(e.target.value),placeholder:"Search from/to/content or use from:alias",className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-blue-500/50 focus:outline-none w-full sm:w-72"}),(0,t.jsxs)("select",{value:h,onChange:e=>m(e.target.value),className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white focus:border-blue-500/50 focus:outline-none",children:[(0,t.jsx)("option",{value:"",children:"All types"}),(0,t.jsx)("option",{value:"task",children:"task"}),(0,t.jsx)("option",{value:"message",children:"message"}),(0,t.jsx)("option",{value:"broadcast",children:"broadcast"}),(0,t.jsx)("option",{value:"reply",children:"reply"})]}),(0,t.jsx)("div",{className:"flex rounded-lg border border-[#2a2a4a] bg-[#111128] p-0.5",children:["timeline","grouped"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>b(e),className:`rounded-md px-2.5 py-1.5 text-xs transition-colors ${j===e?"bg-cyan-500/10 text-cyan-300":"text-gray-500 hover:text-gray-200"}`,children:"timeline"===e?"Timeline":"Grouped"},e))}),(0,t.jsx)("button",{onClick:()=>y(!g),className:`text-xs px-3 py-2 rounded-lg border transition-colors ${g?"bg-yellow-500/10 text-yellow-300 border-yellow-500/20":"text-gray-500 border-gray-700/50 hover:text-gray-300"}`,children:g?"Debug ON":"Debug"})]}),f.length>0&&(0,t.jsxs)("div",{className:"mb-6 flex flex-wrap gap-2",children:[f.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>p(`from:${e}`),className:`rounded-full border px-3 py-1 text-xs transition-colors ${u===`from:${e}`?"border-cyan-500/30 bg-cyan-500/10 text-cyan-300":"border-[#2a2a4a] bg-[#111128] text-gray-400 hover:text-gray-200"}`,children:["from:",e]},e)),u.startsWith("from:")&&(0,t.jsx)("button",{type:"button",onClick:()=>p(""),className:"rounded-full border border-gray-700 px-3 py-1 text-xs text-gray-500 hover:text-gray-200",children:"Clear"})]}),d?(0,t.jsx)("div",{className:"animate-pulse space-y-3",children:[1,2,3,4,5].map(e=>(0,t.jsx)("div",{className:"h-20 rounded-2xl bg-gray-800/20"},e))}):0===v.length?(0,t.jsx)(i.EmptyState,{variant:"messages"}):"grouped"===j?(0,t.jsx)("div",{className:"space-y-4",children:w.map((e,s)=>(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl overflow-hidden",children:[(0,t.jsxs)("div",{className:"px-4 py-2.5 border-b border-[#2a2a4a] flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.AliasAvatar,{alias:e.participants[0],size:16}),(0,t.jsx)("span",{className:"text-sm text-gray-200 font-medium",children:e.participants[0]}),(0,t.jsx)("span",{className:"text-gray-600 text-xs",children:"↔"}),(0,t.jsx)(n.AliasAvatar,{alias:e.participants[1],size:16}),(0,t.jsx)("span",{className:"text-sm text-gray-200 font-medium",children:e.participants[1]})]}),(0,t.jsxs)("span",{className:"text-[10px] text-gray-600",children:[e.messages.length," messages"]})]}),(0,t.jsx)("div",{className:"px-4 py-2 space-y-2 max-h-64 overflow-y-auto",children:e.messages.map(e=>(0,t.jsxs)("div",{className:"flex items-start gap-2 text-xs py-1",children:[e.from_alias&&(0,t.jsx)(n.AliasAvatar,{alias:e.from_alias,size:14}),(0,t.jsx)("span",{className:"shrink-0 font-medium text-gray-200",children:e.from_alias}),(0,t.jsx)("span",{className:"text-gray-400 flex-1",children:e.content?.slice(0,120)||"--"}),(0,t.jsx)("span",{className:"text-[9px] text-gray-600 shrink-0",children:(0,r.timeAgo)(e.created_at||"")})]},e.id))})]},s))}):(0,t.jsx)("div",{className:"space-y-1",children:v.map((e,s)=>{var a;let i=v[s-1],d=!!i&&o(e.created_at)-o(i.created_at)>3e5,h=c(e),m=!!i&&!d&&c(i)===h&&(i.from_alias||"")===(e.from_alias||"")&&(i.to_alias||"")===(e.to_alias||""),p=e.from_alias||"?";return(0,t.jsxs)("div",{children:[d&&(0,t.jsxs)("div",{className:"my-4 flex items-center gap-3",children:[(0,t.jsx)("div",{className:"h-px flex-1 bg-[#2a2a4a]"}),(0,t.jsx)("div",{className:"text-[11px] text-gray-600",children:(a=e.created_at)?new Date(a.replace(" ","T")+"Z").toLocaleString():"Time gap"}),(0,t.jsx)("div",{className:"h-px flex-1 bg-[#2a2a4a]"})]}),"broadcast"===h?(0,t.jsx)("div",{className:m?"mt-1":"mt-3",children:(0,t.jsxs)("div",{className:"rounded-2xl border border-purple-500/20 bg-purple-500/10 px-4 py-3 shadow-sm w-full",children:[(0,t.jsxs)("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-md border ${l[e.type||""]||"bg-gray-500/10 text-gray-400 border-gray-500/20"}`,children:e.type||"unknown"}),(0,t.jsx)("span",{className:"text-sm font-medium text-purple-200",children:p}),e.to_alias&&(0,t.jsxs)("span",{className:"text-xs text-purple-200/80",children:["to ",e.to_alias]}),"high"===e.priority&&(0,t.jsx)("span",{className:"text-xs text-red-400",children:"HIGH"}),(0,t.jsx)("span",{className:"ml-auto text-xs text-gray-500",children:e.created_at?(0,r.timeAgo)(e.created_at):"--"})]}),(0,t.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-relaxed text-gray-200",children:x(e.content,u)})]})}):(0,t.jsxs)("div",{className:`${m?"mt-1":"mt-3"} flex gap-2 ${"outgoing"===h?"flex-row-reverse":"flex-row"}`,children:[(0,t.jsx)("div",{className:"w-8 shrink-0 pt-1",children:!m&&(0,t.jsx)(n.AliasAvatar,{alias:p,size:32})}),(0,t.jsxs)("div",{className:`min-w-0 max-w-3xl rounded-2xl border px-4 py-3 shadow-sm ${"outgoing"===h?"border-green-500/20 bg-green-500/10":"border-blue-500/20 bg-blue-500/10"}`,children:[!m&&(0,t.jsxs)("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-md border ${l[e.type||""]||"bg-gray-500/10 text-gray-400 border-gray-500/20"}`,children:e.type||"unknown"}),(0,t.jsx)("span",{className:`text-sm font-medium ${"outgoing"===h?"text-green-300":"text-blue-300"}`,children:p}),(0,t.jsx)("span",{className:"text-xs text-gray-600",children:"→"}),(0,t.jsx)("span",{className:"text-sm text-gray-300",children:e.to_alias||"--"}),"high"===e.priority&&(0,t.jsx)("span",{className:"text-xs text-red-400",children:"HIGH"}),(0,t.jsx)("span",{className:"ml-auto text-xs text-gray-500",children:e.created_at?(0,r.timeAgo)(e.created_at):"--"})]}),(0,t.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-relaxed text-gray-200",children:x(e.content,u)}),m&&(0,t.jsx)("div",{className:"mt-1 text-[10px] text-gray-600 text-right",children:e.created_at?(0,r.timeAgo)(e.created_at):""}),g&&(0,t.jsxs)("div",{className:"mt-3 border-t border-white/10 pt-3 text-xs text-gray-500 space-y-1",children:[(0,t.jsxs)("div",{children:["ID: ",e.id]}),e.task_id&&(0,t.jsxs)("div",{children:["Task ID: ",e.task_id]}),(0,t.jsxs)("div",{children:["Created: ",e.created_at]})]})]})]})]},e.id)})})]})}])}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,65822,e=>{"use strict";var s=e.i(83599),a=e.i(58963);let t=async e=>{let s=await fetch(e);if(401===s.status)throw window.location.assign("/login"),Error("unauthorized");return s.json()},r={refreshInterval:5e3,dedupingInterval:3e3};function n(e,s){if(!s)return e;let a=e.includes("?")?"&":"?";return`${e}${a}network_id=${encodeURIComponent(s)}`}e.s(["useAnetConfig",0,function(){let{data:e}=(0,s.default)("/api/anet/config",t,{refreshInterval:3e4});return{config:e||null}},"useHealth",0,function(){let{data:e,error:a}=(0,s.default)("/api/hub/health",t,r);return{health:e||null,error:a}},"useLicense",0,function(){let{data:e,error:a}=(0,s.default)("/api/hub/license",t,{refreshInterval:6e4});return{license:e?.ok?e:null,error:a}},"useMessages",0,function(e=100){let{networkId:l}=(0,a.useNetworkId)(),{data:i,error:c,isLoading:o}=(0,s.default)(n(`/api/hub/messages?limit=${e}`,l),t,r);return{messages:i?.messages||[],error:c,isLoading:o}},"useSessions",0,function(){let{networkId:e}=(0,a.useNetworkId)(),{data:l,error:i,isLoading:c}=(0,s.default)(n("/api/hub/status",e),t,r);return{sessions:l?.sessions||[],hint:l?._hint,error:i,isLoading:c}},"useStats",0,function(){let{networkId:e}=(0,a.useNetworkId)(),{data:l,error:i}=(0,s.default)(n("/api/hub/stats",e),t,r);return{stats:l?.ok?l:null,error:i}},"useTasks",0,function(e){let{networkId:l}=(0,a.useNetworkId)(),i=new URLSearchParams({limit:"100",...e}).toString(),{data:c,error:o,isLoading:d}=(0,s.default)(n(`/api/hub/tasks?${i}`,l),t,r);return{tasks:c?.tasks||[],count:c?.count??0,source:c?.source,error:o,isLoading:d}}])},32545,e=>{"use strict";var s=e.i(18050),a=e.i(71645),t=e.i(22016),r=e.i(65822);e.s(["default",0,function(){let{config:e}=(0,r.useAnetConfig)(),{health:n}=(0,r.useHealth)(),{license:l}=(0,r.useLicense)(),[i,c]=(0,a.useState)(""),[o,d]=(0,a.useState)(""),[x,m]=(0,a.useState)(""),[h,g]=(0,a.useState)(""),[u,p]=(0,a.useState)(""),b="flex flex-col gap-1 sm:flex-row sm:items-start sm:justify-between",N="break-all sm:max-w-[320px] sm:text-right";return(0,s.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-white mb-3 lg:ml-0 ml-10",children:"Settings"}),(0,s.jsx)("nav",{className:"mb-8 flex flex-wrap gap-1 text-xs",children:[{href:"#connection",label:"Connection"},{href:"#account",label:"Account"},{href:"#resources",label:"Resources"}].map(e=>(0,s.jsx)("a",{href:e.href,className:"rounded-md px-2.5 py-1 text-gray-500 hover:text-cyan-300 hover:bg-cyan-500/10 transition-colors",children:e.label},e.href))}),(0,s.jsxs)("div",{className:"max-w-2xl space-y-10",children:[(0,s.jsxs)("div",{id:"connection",className:"space-y-4 scroll-mt-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,s.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Connection"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"CommHub Connection"}),(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500 shrink-0",children:"Hub URL"}),(0,s.jsx)("span",{className:`text-cyan-300 ${N}`,children:e?.hub||"not configured"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Config Source"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:e?.source==="file"?"Local file (~/.anet/config.json)":e?.source==="runtime-env"?"Vercel env vars":"Missing"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Auth Token"}),(0,s.jsx)("span",{className:`${e?.tokenConfigured?"text-green-400":"text-red-400"} ${N}`,children:e?.tokenConfigured?`Configured (${e.tokenPreview})`:"Not configured"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Server Auth"}),(0,s.jsx)("span",{className:`${n?.auth==="enabled"?"text-green-400":"text-yellow-400"} sm:text-right`,children:n?.auth||"--"})]}),e?.error&&(0,s.jsx)("div",{className:"border-t border-[#2a2a4a] pt-3 text-xs text-gray-600",children:e.error})]})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Server Info"}),(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:n?.version||"--"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Sessions"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:n?.sessions??"--"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"SSE Connections"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:n?.sse_connections??"--"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Uptime"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:n?.uptime?`${Math.floor(n.uptime/3600)}h ${Math.floor(n.uptime%3600/60)}m`:"--"})]})]})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Dashboard"}),(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,s.jsx)("span",{className:`text-gray-300 font-mono ${N}`,title:"From package.json @sleep2agi/agent-network-dashboard",children:"0.4.5-preview.36"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Data Layer"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:"SWR (5s refresh, 3s dedup)"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Pages"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:"Overview, Tasks, Nodes, Messages, Networks, Audit, Server Logs, Admin, Settings"})]})]})]})]}),(0,s.jsxs)("div",{id:"account",className:"space-y-4 scroll-mt-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,s.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Account"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsxs)("h2",{className:"text-sm font-semibold text-gray-300 mb-4 flex items-center gap-2",children:["License",l?.license&&(0,s.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded-full border ${"pro"===l.license.type?"text-green-300 bg-green-500/10 border-green-500/30":l.license.days_left<=7?"text-red-300 bg-red-500/10 border-red-500/30":"text-amber-300 bg-amber-500/10 border-amber-500/30"}`,children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"w-1.5 h-1.5 rounded-full bg-current"}),l.license.type,l.license.days_left?` \xb7 ${l.license.days_left}d left`:""]})]}),l?.license?(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[l.license.days_left<=7&&(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-red-400 font-medium",children:"⚠ Expiring soon"}),(0,s.jsxs)("span",{className:"text-red-400",children:[l.license.days_left," days left"]})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Expires"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:l.license.expires_at})]}),l.limits&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Max Agents"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:l.limits.max_agents})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Max Networks"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:l.limits.max_networks})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Tasks/Day"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:l.limits.max_tasks_day})]})]}),(0,s.jsxs)("div",{className:"pt-3 border-t border-[#2a2a4a]",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"text",value:i,onChange:e=>c(e.target.value),placeholder:"anet-XXXX-XXXX-XXXX-XXXX",className:"flex-1 bg-[#0a0a15] border border-[#2a2a4a] rounded px-3 py-2 text-xs text-white placeholder-gray-600 focus:outline-none"}),(0,s.jsx)("button",{onClick:async()=>{if(!i.trim())return;let e=await fetch("/api/hub/license",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:i})}),s=await e.json();d(s.ok?`Activated: ${s.type}`:`Failed: ${s.error}`),s.ok&&c(""),setTimeout(()=>d(""),5e3)},className:"px-3 py-2 bg-cyan-600 hover:bg-cyan-500 text-white text-xs rounded transition-colors",children:"Activate"})]}),o&&(0,s.jsx)("div",{className:`mt-2 text-xs ${o.startsWith("Failed")?"text-red-400":"text-green-400"}`,children:o})]})]}):(0,s.jsx)("div",{className:"text-xs text-gray-600",children:"License info not available"})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Change Password"}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("input",{type:"password",value:x,onChange:e=>m(e.target.value),placeholder:"Current password",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,s.jsx)("input",{type:"password",value:h,onChange:e=>g(e.target.value),placeholder:"New password",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,s.jsx)("button",{onClick:async()=>{if(!x||!h)return;let e=sessionStorage.getItem("anet_v3_auth");if(!e)return void p("Not logged in with V3 auth");let{token:s}=JSON.parse(e),a=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"change_password",token:s,current_password:x,new_password:h})}),t=await a.json();if(p(t.ok?"Password changed":`Failed: ${t.error}`),t.ok){if(t.token){let s=JSON.parse(e);sessionStorage.setItem("anet_v3_auth",JSON.stringify({...s,token:t.token}))}m(""),g("")}setTimeout(()=>p(""),5e3)},disabled:!x||!h,className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-500 disabled:bg-gray-800 disabled:text-gray-600 text-white text-sm rounded-lg transition-colors",children:"Change Password"})]}),u&&(0,s.jsx)("div",{className:`mt-2 text-xs ${u.startsWith("Failed")?"text-red-400":"text-green-400"}`,children:u})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Sign out"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mb-3",children:"Signing out clears your dashboard session cookie. You'll return to the login page."}),(0,s.jsx)("button",{onClick:async()=>{await fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),window.location.assign("/login")},className:"px-4 py-2 bg-transparent hover:bg-[#1a1a2a] text-gray-300 text-sm rounded-lg border border-[#2a2a4a] hover:border-[#3a3a5a] transition-colors",children:"Sign out"})]})]}),(0,s.jsxs)("div",{id:"resources",className:"space-y-4 scroll-mt-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,s.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Resources"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,s.jsxs)(t.default,{href:"/settings/tokens",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"API Tokens"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Create and manage tokens for CLI access."}),(0,s.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Manage →"})]}),(0,s.jsxs)(t.default,{href:"/settings/networks",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"Networks"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Create, manage, and delete agent networks."}),(0,s.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Manage →"})]})]})]})]})]})}],32545)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,65822,e=>{"use strict";var s=e.i(83599),a=e.i(58963);let t=async e=>{let s=await fetch(e);if(401===s.status)throw window.location.assign("/login"),Error("unauthorized");return s.json()},r={refreshInterval:5e3,dedupingInterval:3e3};function n(e,s){if(!s)return e;let a=e.includes("?")?"&":"?";return`${e}${a}network_id=${encodeURIComponent(s)}`}e.s(["useAnetConfig",0,function(){let{data:e}=(0,s.default)("/api/anet/config",t,{refreshInterval:3e4});return{config:e||null}},"useHealth",0,function(){let{data:e,error:a}=(0,s.default)("/api/hub/health",t,r);return{health:e||null,error:a}},"useLicense",0,function(){let{data:e,error:a}=(0,s.default)("/api/hub/license",t,{refreshInterval:6e4});return{license:e?.ok?e:null,error:a}},"useMessages",0,function(e=100){let{networkId:l}=(0,a.useNetworkId)(),{data:i,error:c,isLoading:o}=(0,s.default)(n(`/api/hub/messages?limit=${e}`,l),t,r);return{messages:i?.messages||[],error:c,isLoading:o}},"useSessions",0,function(){let{networkId:e}=(0,a.useNetworkId)(),{data:l,error:i,isLoading:c}=(0,s.default)(n("/api/hub/status",e),t,r);return{sessions:l?.sessions||[],hint:l?._hint,error:i,isLoading:c}},"useStats",0,function(){let{networkId:e}=(0,a.useNetworkId)(),{data:l,error:i}=(0,s.default)(n("/api/hub/stats",e),t,r);return{stats:l?.ok?l:null,error:i}},"useTasks",0,function(e){let{networkId:l}=(0,a.useNetworkId)(),i=new URLSearchParams({limit:"100",...e}).toString(),{data:c,error:o,isLoading:d}=(0,s.default)(n(`/api/hub/tasks?${i}`,l),t,r);return{tasks:c?.tasks||[],count:c?.count??0,source:c?.source,error:o,isLoading:d}}])},32545,e=>{"use strict";var s=e.i(18050),a=e.i(71645),t=e.i(22016),r=e.i(65822);e.s(["default",0,function(){let{config:e}=(0,r.useAnetConfig)(),{health:n}=(0,r.useHealth)(),{license:l}=(0,r.useLicense)(),[i,c]=(0,a.useState)(""),[o,d]=(0,a.useState)(""),[x,m]=(0,a.useState)(""),[h,g]=(0,a.useState)(""),[u,p]=(0,a.useState)(""),b="flex flex-col gap-1 sm:flex-row sm:items-start sm:justify-between",N="break-all sm:max-w-[320px] sm:text-right";return(0,s.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-white mb-3 lg:ml-0 ml-10",children:"Settings"}),(0,s.jsx)("nav",{className:"mb-8 flex flex-wrap gap-1 text-xs",children:[{href:"#connection",label:"Connection"},{href:"#account",label:"Account"},{href:"#resources",label:"Resources"}].map(e=>(0,s.jsx)("a",{href:e.href,className:"rounded-md px-2.5 py-1 text-gray-500 hover:text-cyan-300 hover:bg-cyan-500/10 transition-colors",children:e.label},e.href))}),(0,s.jsxs)("div",{className:"max-w-2xl space-y-10",children:[(0,s.jsxs)("div",{id:"connection",className:"space-y-4 scroll-mt-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,s.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Connection"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"CommHub Connection"}),(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500 shrink-0",children:"Hub URL"}),(0,s.jsx)("span",{className:`text-cyan-300 ${N}`,children:e?.hub||"not configured"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Config Source"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:e?.source==="file"?"Local file (~/.anet/config.json)":e?.source==="runtime-env"?"Vercel env vars":"Missing"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Auth Token"}),(0,s.jsx)("span",{className:`${e?.tokenConfigured?"text-green-400":"text-red-400"} ${N}`,children:e?.tokenConfigured?`Configured (${e.tokenPreview})`:"Not configured"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Server Auth"}),(0,s.jsx)("span",{className:`${n?.auth==="enabled"?"text-green-400":"text-yellow-400"} sm:text-right`,children:n?.auth||"--"})]}),e?.error&&(0,s.jsx)("div",{className:"border-t border-[#2a2a4a] pt-3 text-xs text-gray-600",children:e.error})]})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Server Info"}),(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:n?.version||"--"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Sessions"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:n?.sessions??"--"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"SSE Connections"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:n?.sse_connections??"--"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Uptime"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:n?.uptime?`${Math.floor(n.uptime/3600)}h ${Math.floor(n.uptime%3600/60)}m`:"--"})]})]})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Dashboard"}),(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,s.jsx)("span",{className:`text-gray-300 font-mono ${N}`,title:"From package.json @sleep2agi/agent-network-dashboard",children:"0.4.5-preview.37"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Data Layer"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:"SWR (5s refresh, 3s dedup)"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Pages"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:"Overview, Tasks, Nodes, Messages, Networks, Audit, Server Logs, Admin, Settings"})]})]})]})]}),(0,s.jsxs)("div",{id:"account",className:"space-y-4 scroll-mt-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,s.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Account"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsxs)("h2",{className:"text-sm font-semibold text-gray-300 mb-4 flex items-center gap-2",children:["License",l?.license&&(0,s.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded-full border ${"pro"===l.license.type?"text-green-300 bg-green-500/10 border-green-500/30":l.license.days_left<=7?"text-red-300 bg-red-500/10 border-red-500/30":"text-amber-300 bg-amber-500/10 border-amber-500/30"}`,children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"w-1.5 h-1.5 rounded-full bg-current"}),l.license.type,l.license.days_left?` \xb7 ${l.license.days_left}d left`:""]})]}),l?.license?(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[l.license.days_left<=7&&(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-red-400 font-medium",children:"⚠ Expiring soon"}),(0,s.jsxs)("span",{className:"text-red-400",children:[l.license.days_left," days left"]})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Expires"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:l.license.expires_at})]}),l.limits&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Max Agents"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:l.limits.max_agents})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Max Networks"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:l.limits.max_networks})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Tasks/Day"}),(0,s.jsx)("span",{className:`text-gray-300 ${N}`,children:l.limits.max_tasks_day})]})]}),(0,s.jsxs)("div",{className:"pt-3 border-t border-[#2a2a4a]",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"text",value:i,onChange:e=>c(e.target.value),placeholder:"anet-XXXX-XXXX-XXXX-XXXX",className:"flex-1 bg-[#0a0a15] border border-[#2a2a4a] rounded px-3 py-2 text-xs text-white placeholder-gray-600 focus:outline-none"}),(0,s.jsx)("button",{onClick:async()=>{if(!i.trim())return;let e=await fetch("/api/hub/license",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:i})}),s=await e.json();d(s.ok?`Activated: ${s.type}`:`Failed: ${s.error}`),s.ok&&c(""),setTimeout(()=>d(""),5e3)},className:"px-3 py-2 bg-cyan-600 hover:bg-cyan-500 text-white text-xs rounded transition-colors",children:"Activate"})]}),o&&(0,s.jsx)("div",{className:`mt-2 text-xs ${o.startsWith("Failed")?"text-red-400":"text-green-400"}`,children:o})]})]}):(0,s.jsx)("div",{className:"text-xs text-gray-600",children:"License info not available"})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Change Password"}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("input",{type:"password",value:x,onChange:e=>m(e.target.value),placeholder:"Current password",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,s.jsx)("input",{type:"password",value:h,onChange:e=>g(e.target.value),placeholder:"New password",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,s.jsx)("button",{onClick:async()=>{if(!x||!h)return;let e=sessionStorage.getItem("anet_v3_auth");if(!e)return void p("Not logged in with V3 auth");let{token:s}=JSON.parse(e),a=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"change_password",token:s,current_password:x,new_password:h})}),t=await a.json();if(p(t.ok?"Password changed":`Failed: ${t.error}`),t.ok){if(t.token){let s=JSON.parse(e);sessionStorage.setItem("anet_v3_auth",JSON.stringify({...s,token:t.token}))}m(""),g("")}setTimeout(()=>p(""),5e3)},disabled:!x||!h,className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-500 disabled:bg-gray-800 disabled:text-gray-600 text-white text-sm rounded-lg transition-colors",children:"Change Password"})]}),u&&(0,s.jsx)("div",{className:`mt-2 text-xs ${u.startsWith("Failed")?"text-red-400":"text-green-400"}`,children:u})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Sign out"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mb-3",children:"Signing out clears your dashboard session cookie. You'll return to the login page."}),(0,s.jsx)("button",{onClick:async()=>{await fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),window.location.assign("/login")},className:"px-4 py-2 bg-transparent hover:bg-[#1a1a2a] text-gray-300 text-sm rounded-lg border border-[#2a2a4a] hover:border-[#3a3a5a] transition-colors",children:"Sign out"})]})]}),(0,s.jsxs)("div",{id:"resources",className:"space-y-4 scroll-mt-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,s.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Resources"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,s.jsxs)(t.default,{href:"/settings/tokens",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"API Tokens"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Create and manage tokens for CLI access."}),(0,s.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Manage →"})]}),(0,s.jsxs)(t.default,{href:"/settings/networks",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"Networks"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Create, manage, and delete agent networks."}),(0,s.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Manage →"})]})]})]})]})]})}],32545)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18150,e=>{"use strict";e.s(["formatUptime",0,function(e){let t=Math.floor(e/3600),a=Math.floor(e%3600/60);return t>0?`${t}h ${a}m`:`${a}m`},"timeAgo",0,function(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}])},69874,e=>{"use strict";var t=e.i(18050);let a=[180,200,220,270,300,330,30,90];e.s(["AliasAvatar",0,function({alias:e,size:s=28,className:r=""}){let n=function(e){let t=0;for(let a=0;a<e.length;a++)t=31*t+e.charCodeAt(a)>>>0;let s=a[t%a.length];return{bg:`hsl(${s} 55% 22%)`,ring:`hsl(${s} 60% 45%)`,text:`hsl(${s} 80% 78%)`}}(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 ${r}`,style:{width:s,height:s,fontSize:i,backgroundColor:n.bg,borderColor:n.ring,color:n.text},title:e,"aria-hidden":!0,children:e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"})}])},95356,e=>{"use strict";var t=e.i(18050),a=e.i(71645),s=e.i(22016);let r={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function n({variant:e,size:a}){let s={width:a,height:a},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",...s,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",...s,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",...s,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",...s,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",...s,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",...s,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",...s,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"14",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"32",cy:"32",r:"3"})]})})}}function i({variant:e="generic",title:a,sub:l,cta:d,compact:o=!1}){let c=r[e],x=a??c.title,h=l??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}),h&&(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:h}),d&&(0,t.jsx)("div",{className:"mt-4",children:d.href?(0,t.jsxs)(s.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 l({cmd:e}){let[s,r]=(0,a.useState)(!1),n=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1800)}catch{}};return(0,t.jsxs)("div",{className:"anet-empty-cmd flex items-center gap-2 bg-[#0a0a15] border border-[#2a2a4a] rounded-lg pl-4 pr-1.5 py-1.5 text-xs sm:text-sm",children:[(0,t.jsx)("code",{className:"text-cyan-300 font-mono select-all",children:e}),(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":s?"Copied":"Copy command",className:"shrink-0 rounded-md px-2 py-1.5 text-[11px] text-gray-500 hover:text-gray-200 hover:bg-[#1a1a2a] transition-colors",children:s?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-green-400",children:[(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5"})}),"Copied"]}):(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Copy"]})})]})}e.s(["EmptyState",0,i,"NodesEmptyState",0,function({hint:e}){return e?.global_count?(0,t.jsx)(i,{variant:"nodes",title:"No agents in this network",sub:`Server has ${e.global_count} nodes globally, but none are registered to the current network. Switch network or contact admin.`}):(0,t.jsxs)("div",{className:"text-center py-16 px-4",role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)("svg",{viewBox:"0 0 64 64",width:56,height:56,children:(0,t.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[(0,t.jsx)("rect",{x:"10",y:"20",width:"44",height:"28",rx:"2"}),(0,t.jsx)("rect",{x:"20",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"32",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"44",y:"32",width:"4",height:"8",opacity:"0.5"}),(0,t.jsx)("line",{x1:"10",y1:"26",x2:"54",y2:"26",opacity:"0.4"}),(0,t.jsx)("circle",{cx:"14",cy:"23",r:"0.8",fill:"currentColor"})]})})}),(0,t.jsx)("h3",{className:"font-medium text-gray-300 text-base",children:"Spin up your first agent"}),(0,t.jsx)("p",{className:"text-gray-500 text-sm mt-2 max-w-md mx-auto leading-relaxed",children:"Run this in a fresh terminal to register an agent with this CommHub:"}),(0,t.jsx)("div",{className:"mt-4 inline-block",children:(0,t.jsx)(l,{cmd:"npx --yes @sleep2agi/agent-network init"})}),(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsxs)("a",{href:"https://anet.sh",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium text-gray-500 hover:text-cyan-300",children:["Full quickstart guide",(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}])},96527,e=>{"use strict";var t=e.i(18050),a=e.i(71645),s=e.i(18566),r=e.i(58963),n=e.i(18150),i=e.i(69874);let l={created:"text-gray-400",delivered:"text-blue-400",running:"text-green-400",replied:"text-purple-400",failed:"text-red-400",closed:"text-gray-500"};function d({taskId:e,onClose:s}){let[r,o]=(0,a.useState)(null),[c,x]=(0,a.useState)([]),[h,m]=(0,a.useState)(!0);(0,a.useEffect)(()=>{(async()=>{try{let[t,a]=await Promise.all([fetch(`/api/hub/tasks?task_id=${encodeURIComponent(e)}`),fetch(`/api/hub/task-events?task_id=${encodeURIComponent(e)}&limit=50`)]),s=await t.json(),r=await a.json();s.tasks?.[0]&&o(s.tasks[0]),x(r.events||[])}catch{}finally{m(!1)}})()},[e]);let p=r?[{key:"created",label:"Created",time:r.created_at,color:"bg-gray-400"},{key:"delivered",label:"Delivered",time:r.delivered_at,color:"bg-blue-400"},{key:"started",label:"Started",time:r.started_at,color:"bg-green-400"},{key:"completed",label:"Completed",time:r.completed_at,color:"bg-purple-400"}].map(e=>({...e,done:!!e.time})):[],g=p.findIndex(e=>!e.done),u=r&&"completed"!==r.status&&"failed"!==r.status&&"expired"!==r.status&&"cancelled"!==r.status,y=r?.started_at&&r?.completed_at?Math.round((new Date(r.completed_at).getTime()-new Date(r.started_at).getTime())/1e3):null;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/30 z-40 anet-fade-in",onClick:s}),(0,t.jsxs)("div",{className:"fixed top-0 right-0 h-full w-full lg:w-[500px] bg-[#0a0a1a] border-l border-[#2a2a4a] z-50 flex flex-col shadow-2xl shadow-black/60 overflow-y-auto animate-slide-in",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 border-b border-[#2a2a4a] bg-[#0d0d1a] sticky top-0",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-white",children:"Task Detail"}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-500 mt-0.5",children:[e.slice(0,16),"..."]})]}),(0,t.jsx)("button",{onClick:s,className:"text-gray-500 hover:text-white p-1.5 rounded-lg hover:bg-[#1a1a2a]",children:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),h?(0,t.jsx)("div",{className:"flex justify-center py-16",children:(0,t.jsx)("div",{className:"w-6 h-6 border-2 border-cyan-500/30 border-t-cyan-500 rounded-full animate-spin"})}):r?(0,t.jsxs)("div",{className:"px-5 py-5 space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:`text-lg font-bold ${l[r.status]||"text-gray-400"}`,children:r.status}),"normal"!==r.priority&&(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded border ${"high"===r.priority?"text-red-300 border-red-500/20":"text-gray-400 border-gray-600/20"}`,children:r.priority}),null!==y&&(0,t.jsxs)("span",{className:"text-xs text-gray-500",children:["⏱ ",y<60?`${y}s`:`${Math.floor(y/60)}m ${y%60}s`]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm flex-wrap",children:[r.from_name&&(0,t.jsx)(i.AliasAvatar,{alias:r.from_name,size:18}),(0,t.jsx)("span",{className:"text-gray-200 font-medium",children:r.from_name||"--"}),(0,t.jsx)("span",{className:"text-gray-600",children:"→"}),r.to_name&&(0,t.jsx)(i.AliasAvatar,{alias:r.to_name,size:18}),(0,t.jsx)("span",{className:"text-gray-200 font-medium",children:r.to_name||"--"})]}),(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 uppercase tracking-wide",children:"Timeline"}),null!==y&&(0,t.jsxs)("div",{className:"text-[10px] text-gray-600",children:[y<60?`${y}s`:`${Math.floor(y/60)}m ${y%60}s`," runtime"]})]}),(0,t.jsx)("div",{className:"space-y-3",children:p.map((e,a)=>{let s=u&&a===g,r=!!p[a+1]?.done;return(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center pt-0.5",children:[(0,t.jsx)("span",{className:`relative w-3 h-3 rounded-full shrink-0 ${e.done?e.color:"bg-gray-700"}`,children:s&&(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute -inset-1 rounded-full border border-current opacity-60 anet-current-step-pulse",style:{borderColor:"currentColor"}})}),a<p.length-1&&(0,t.jsx)("div",{className:`w-0.5 h-5 mt-1 ${e.done&&r?"bg-gray-500":e.done?"bg-gradient-to-b from-gray-500 to-gray-800":"bg-gray-800"}`})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:`text-xs font-medium flex items-center gap-2 ${e.done?"text-gray-200":s?"text-cyan-300":"text-gray-600"}`,children:[(0,t.jsx)("span",{children:e.label}),s&&(0,t.jsx)("span",{className:"text-[9px] uppercase tracking-wide text-cyan-400",children:"in progress"})]}),(0,t.jsx)("div",{className:"text-[10px] text-gray-500",title:e.time||void 0,children:e.time?(0,n.timeAgo)(e.time):s?"—":"Pending"})]})]},e.key)})})]}),(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 uppercase mb-2",children:"Input"}),(0,t.jsx)("div",{className:"text-sm text-gray-300 whitespace-pre-wrap",children:r.content||"--"})]}),r.result&&(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 uppercase mb-2",children:"Output"}),(0,t.jsx)("div",{className:"text-sm text-gray-300 whitespace-pre-wrap max-h-64 overflow-y-auto",children:r.result})]}),c.length>0&&(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsxs)("div",{className:"text-xs text-gray-500 uppercase mb-2",children:["Events (",c.length,")"]}),(0,t.jsx)("div",{className:"space-y-1.5 max-h-40 overflow-y-auto",children:c.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[11px]",children:[(0,t.jsx)("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${"running"===e.to_status?"bg-green-400":"replied"===e.to_status?"bg-purple-400":"failed"===e.to_status?"bg-red-400":"bg-blue-400"}`}),(0,t.jsx)("span",{className:"text-gray-400",children:e.event_type}),e.from_status&&(0,t.jsxs)("span",{className:"text-gray-600",children:[e.from_status,"→",e.to_status]}),(0,t.jsx)("span",{className:"text-gray-600 ml-auto",children:(0,n.timeAgo)(e.created_at)})]},e.id))})]}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-600 space-y-1",children:[(0,t.jsxs)("div",{children:["Task ID: ",r.task_id]}),r.expires_at&&(0,t.jsxs)("div",{children:["Expires: ",r.expires_at]})]})]}):(0,t.jsx)("div",{className:"text-center py-16 text-gray-500",children:"Task not found"})]})]})}var o=e.i(95356);let c=["","created","delivered","acked","running","replied","closed","failed","cancelled","expired"],x={created:"bg-gray-500/10 text-gray-400 border-gray-500/20",delivered:"bg-blue-500/10 text-blue-300 border-blue-500/20",acked:"bg-cyan-500/10 text-cyan-300 border-cyan-500/20",running:"bg-green-500/10 text-green-300 border-green-500/20",replied:"bg-purple-500/10 text-purple-300 border-purple-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-yellow-500/10 text-yellow-300 border-yellow-500/20",expired:"bg-orange-500/10 text-orange-300 border-orange-500/20"},h={created:"#9ca3af",delivered:"#60a5fa",acked:"#22d3ee",running:"#4ade80",replied:"#a78bfa",closed:"#6b7280",failed:"#f87171",cancelled:"#facc15",expired:"#fb923c"};function m(e){let t=x[e]||"bg-gray-500/10 text-gray-400 border-gray-500/20";return`text-xs px-2 py-0.5 rounded-md border ${t}`}function p(e){return"high"===e?"text-red-400":"low"===e?"text-gray-600":"text-gray-400"}function g(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function u(){let e,n,l,u=(0,s.useSearchParams)(),{networkId:y}=(0,r.useNetworkId)(),[j,b]=(0,a.useState)([]),[v,f]=(0,a.useState)(0),[N,w]=(0,a.useState)(!0),[k,_]=(0,a.useState)(""),[C,$]=(0,a.useState)(new Set),[S,M]=(0,a.useState)(u.get("status")||""),[T,A]=(0,a.useState)(""),[D,L]=(0,a.useState)(""),[B,I]=(0,a.useState)(null),z=e=>{$(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})},E=(0,a.useCallback)(async()=>{try{let e=new URLSearchParams;y&&e.set("network_id",y),S&&e.set("status",S),T&&e.set("from_name",T),D&&e.set("to_name",D),e.set("limit","100");let t=await fetch(`/api/hub/tasks?${e.toString()}`);if(401===t.status)return void window.location.assign("/login");let a=await t.json();b(a.tasks||[]),f(a.count??(a.tasks?.length||0)),_("")}catch(e){_(e instanceof Error?e.message:"fetch failed")}finally{w(!1)}},[S,T,D,y]);return(0,a.useEffect)(()=>{w(!0),E();let e=setInterval(E,5e3);return()=>clearInterval(e)},[E]),(0,t.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-white lg:ml-0 ml-10",children:"Tasks"}),(0,t.jsx)("span",{className:"text-xs bg-blue-900/30 text-blue-400 px-2 py-0.5 rounded-full border border-blue-800/30",children:v})]}),(0,t.jsx)("div",{className:"anet-tabstrip-wrap mb-4",children:(0,t.jsx)("div",{className:"anet-tabstrip flex sm:flex-wrap gap-1 bg-[#111128] rounded-lg border border-[#2a2a4a] p-1 overflow-x-auto sm:overflow-x-visible scrollbar-thin",children:["",...c.filter(Boolean)].map(e=>(0,t.jsxs)("button",{onClick:()=>M(e),className:`px-3 py-1.5 rounded-md text-xs transition-colors flex items-center gap-1.5 shrink-0 whitespace-nowrap ${S===e?`${x[e]||"bg-cyan-500/10 text-cyan-300 border-cyan-500/20"} border`:"text-gray-500 hover:text-gray-300 hover:bg-[#1a1a2a]/40"}`,children:[e&&(0,t.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:h[e]||"#6b7280"}}),(0,t.jsx)("span",{children:e||"All"})]},e))})}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 rounded-lg border border-[#2a2a4a] bg-[#111128] px-2.5 py-1.5 focus-within:border-blue-500/40",children:[(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-gray-600",children:"From"}),(0,t.jsx)("input",{type:"text",value:T,onChange:e=>A(e.target.value),placeholder:"any node",className:"w-28 bg-transparent text-sm text-white placeholder-gray-700 focus:outline-none"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 rounded-lg border border-[#2a2a4a] bg-[#111128] px-2.5 py-1.5 focus-within:border-blue-500/40",children:[(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-gray-600",children:"To"}),(0,t.jsx)("input",{type:"text",value:D,onChange:e=>L(e.target.value),placeholder:"any node",className:"w-28 bg-transparent text-sm text-white placeholder-gray-700 focus:outline-none"})]}),(S||T||D)&&(0,t.jsx)("button",{type:"button",onClick:()=>{M(""),A(""),L("")},className:"rounded-lg border border-gray-700 px-2.5 py-1.5 text-[11px] text-gray-500 hover:text-gray-200 hover:border-gray-600",children:"Clear filters"})]}),j.length>0&&!S&&(e={},j.forEach(t=>{e[t.status]=(e[t.status]||0)+1}),n=j.length||1,(l=[{key:"running",color:"bg-green-500",text:"text-green-400"},{key:"delivered",color:"bg-blue-500",text:"text-blue-400"},{key:"replied",color:"bg-purple-500",text:"text-purple-400"},{key:"failed",color:"bg-red-500",text:"text-red-400"},{key:"expired",color:"bg-orange-500",text:"text-orange-400"}].filter(t=>e[t.key])).length?(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)("div",{className:"flex h-2 rounded-full overflow-hidden bg-gray-800",children:l.map(a=>(0,t.jsx)("div",{className:a.color,style:{width:`${e[a.key]/n*100}%`}},a.key))}),(0,t.jsx)("div",{className:"flex flex-wrap gap-3 mt-1.5 text-[10px] text-gray-500",children:l.map(a=>(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:`inline-block w-2 h-2 rounded-full ${a.color} mr-1`}),e[a.key]," ",a.key]},a.key))})]}):null),k&&(0,t.jsx)("div",{className:"bg-red-900/20 border border-red-800/40 text-red-300 px-4 py-2 rounded-lg mb-6 text-sm",children:k}),N?(0,t.jsx)("div",{className:"animate-pulse space-y-3",children:[1,2,3,4,5].map(e=>(0,t.jsx)("div",{className:"h-20 bg-gray-800/20 rounded-lg border border-gray-800/40"},e))}):0===j.length?(0,t.jsx)(o.EmptyState,{variant:"tasks",sub:S||T||D?"No tasks match the current filters. Try clearing them.":"Tasks will appear here when agents send them via CommHub."}):(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"hidden sm:grid sm:grid-cols-12 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:"From"}),(0,t.jsx)("div",{className:"col-span-2",children:"To"}),(0,t.jsx)("div",{className:"col-span-4",children:"Content"}),(0,t.jsx)("div",{className:"col-span-1",children:"Priority"}),(0,t.jsx)("div",{className:"col-span-2",children:"Time"})]}),j.map(e=>{let a=C.has(e.task_id);return(0,t.jsxs)("div",{className:`anet-task-row group bg-[#111128] border rounded-lg px-4 py-3 transition-all duration-200 cursor-pointer ${a?"border-[#3a3a5a] shadow-lg shadow-black/20":"border-[#2a2a4a] hover:border-[#3a3a5a] hover:bg-[#15152e]"}`,onClick:()=>z(e.task_id),role:"button",tabIndex:0,"aria-expanded":a,onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),z(e.task_id))},children:[(0,t.jsxs)("div",{className:"hidden sm:grid sm:grid-cols-12 gap-2 items-center",children:[(0,t.jsx)("div",{className:"col-span-1",children:(0,t.jsx)("span",{className:m(e.status),children:e.status})}),(0,t.jsxs)("div",{className:"col-span-2 flex items-center gap-1.5 min-w-0",title:e.from_name,children:[e.from_name&&(0,t.jsx)(i.AliasAvatar,{alias:e.from_name,size:18}),(0,t.jsx)("span",{className:"truncate text-sm text-gray-200",children:e.from_name||"--"})]}),(0,t.jsxs)("div",{className:"col-span-2 flex items-center gap-1.5 min-w-0",title:e.to_name,children:[e.to_name&&(0,t.jsx)(i.AliasAvatar,{alias:e.to_name,size:18}),(0,t.jsx)("span",{className:"truncate text-sm text-gray-200",children:e.to_name||"--"})]}),(0,t.jsx)("div",{className:"col-span-4 text-xs text-gray-400 truncate",title:e.content,children:e.content||"--"}),(0,t.jsx)("div",{className:"col-span-1",children:(0,t.jsx)("span",{className:`text-xs ${p(e.priority)}`,children:e.priority||"normal"})}),(0,t.jsxs)("div",{className:"col-span-2 text-xs text-gray-500 flex items-center justify-between gap-2",title:e.created_at,children:[(0,t.jsx)("span",{className:"truncate",children:g(e.created_at)}),(0,t.jsx)("svg",{"aria-hidden":!0,className:`shrink-0 text-gray-600 group-hover:text-gray-400 transition-transform duration-200 ${a?"rotate-180":""}`,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 9l6 6 6-6"})})]})]}),(0,t.jsxs)("div",{className:"sm:hidden space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:m(e.status),children:e.status}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:`text-xs ${p(e.priority)}`,children:e.priority||"normal"}),(0,t.jsx)("svg",{"aria-hidden":!0,className:`text-gray-600 transition-transform duration-200 ${a?"rotate-180":""}`,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 9l6 6 6-6"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-gray-300 min-w-0",children:[e.from_name&&(0,t.jsx)(i.AliasAvatar,{alias:e.from_name,size:16}),(0,t.jsx)("span",{className:"truncate max-w-[40%]",children:e.from_name||"--"}),(0,t.jsx)("span",{className:"text-gray-600",children:"→"}),e.to_name&&(0,t.jsx)(i.AliasAvatar,{alias:e.to_name,size:16}),(0,t.jsx)("span",{className:"truncate max-w-[40%]",children:e.to_name||"--"})]}),(0,t.jsx)("div",{className:"text-xs text-gray-400 line-clamp-1",children:e.content||"--"}),(0,t.jsx)("div",{className:"text-xs text-gray-600",children:g(e.created_at)})]}),(0,t.jsx)("div",{className:`grid transition-all duration-300 ease-out ${a?"grid-rows-[1fr] opacity-100 mt-3":"grid-rows-[0fr] opacity-0"}`,"aria-hidden":!a,children:(0,t.jsx)("div",{className:"overflow-hidden",children:(0,t.jsxs)("div",{className:"pt-3 border-t border-[#2a2a4a] space-y-3",children:[e.content&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-xs text-gray-600 mb-1",children:"Content"}),(0,t.jsx)("div",{className:"text-xs text-gray-300 whitespace-pre-wrap bg-[#0a0a15] rounded-lg px-3 py-2 border border-[#1a1a2a]",children:e.content})]}),e.result&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-xs text-gray-600 mb-1",children:"Result"}),(0,t.jsx)("div",{className:"text-xs text-gray-300 whitespace-pre-wrap bg-[#0a0a15] rounded-lg px-3 py-2 border border-[#1a1a2a] max-h-48 overflow-y-auto",children:e.result})]}),(0,t.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[["Created",e.created_at],["Delivered",e.delivered_at],["Started",e.started_at],["Completed",e.completed_at]].map(([e,a])=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"text-gray-600",children:[e,": "]}),(0,t.jsx)("span",{className:"text-gray-400",children:a?g(a):"--"})]},e))}),e.expires_at&&(0,t.jsxs)("div",{className:"text-xs",children:[(0,t.jsx)("span",{className:"text-gray-600",children:"Expires: "}),(0,t.jsx)("span",{className:"text-orange-400",children:e.expires_at})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"text-xs text-gray-600 truncate",title:e.task_id,children:["ID: ",e.task_id]}),(0,t.jsxs)("div",{className:"flex gap-2 shrink-0",children:[("failed"===e.status||"expired"===e.status)&&(0,t.jsx)("button",{onClick:async t=>{t.stopPropagation(),await fetch("/api/hub/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({alias:e.to_name,task:e.content,priority:e.priority})}),E()},className:"text-xs text-orange-400 hover:text-orange-300 px-2 py-0.5 rounded border border-orange-500/20 hover:bg-orange-500/10",children:"Retry"}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),I(e.task_id)},className:"text-xs text-cyan-400 hover:text-cyan-300",children:"Detail →"})]})]})]})})})]},e.task_id)})]}),B&&(0,t.jsx)(d,{taskId:B,onClose:()=>I(null)})]})}e.s(["default",0,function(){return(0,t.jsx)(a.Suspense,{fallback:(0,t.jsx)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-6 font-mono",children:"Loading tasks..."}),children:(0,t.jsx)(u,{})})}],96527)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18150,e=>{"use strict";e.s(["formatUptime",0,function(e){let t=Math.floor(e/3600),s=Math.floor(e%3600/60);return t>0?`${t}h ${s}m`:`${s}m`},"timeAgo",0,function(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}])},69874,e=>{"use strict";var t=e.i(18050);let s=[180,200,220,270,300,330,30,90];e.s(["AliasAvatar",0,function({alias:e,size:a=28,className:r=""}){let i=function(e){let t=0;for(let s=0;s<e.length;s++)t=31*t+e.charCodeAt(s)>>>0;let a=s[t%s.length];return{bg:`hsl(${a} 55% 22%)`,ring:`hsl(${a} 60% 45%)`,text:`hsl(${a} 80% 78%)`}}(e),n=Math.max(9,Math.round(.42*a));return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${r}`,style:{width:a,height:a,fontSize:n,backgroundColor:i.bg,borderColor:i.ring,color:i.text},title:e,"aria-hidden":!0,children:e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"})}])},95356,e=>{"use strict";var t=e.i(18050),s=e.i(71645),a=e.i(22016);let r={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function i({variant:e,size:s}){let a={width:s,height:s},r={fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"nodes":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"14",r:"4"}),(0,t.jsx)("circle",{cx:"14",cy:"44",r:"4"}),(0,t.jsx)("circle",{cx:"50",cy:"44",r:"4"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"14",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"50",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"18",y1:"44",x2:"46",y2:"44",strokeDasharray:"3 3",opacity:"0.6"})]})});case"tasks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("rect",{x:"14",y:"14",width:"36",height:"6",rx:"1.5"}),(0,t.jsx)("rect",{x:"14",y:"26",width:"36",height:"6",rx:"1.5",opacity:"0.6"}),(0,t.jsx)("rect",{x:"14",y:"38",width:"36",height:"6",rx:"1.5",opacity:"0.35"})]})});case"messages":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M14 18 h36 a3 3 0 0 1 3 3 v18 a3 3 0 0 1 -3 3 h-18 l-8 6 v-6 h-10 a3 3 0 0 1 -3 -3 v-18 a3 3 0 0 1 3 -3 z"}),(0,t.jsx)("line",{x1:"22",y1:"28",x2:"42",y2:"28",opacity:"0.5"}),(0,t.jsx)("line",{x1:"22",y1:"34",x2:"36",y2:"34",opacity:"0.5"})]})});case"logs":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M18 12 h22 l8 8 v32 a2 2 0 0 1 -2 2 h-28 a2 2 0 0 1 -2 -2 v-38 a2 2 0 0 1 2 -2 z"}),(0,t.jsx)("path",{d:"M40 12 v8 h8",opacity:"0.6"}),(0,t.jsx)("line",{x1:"24",y1:"32",x2:"40",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"24",y1:"38",x2:"40",y2:"38",opacity:"0.4"}),(0,t.jsx)("line",{x1:"24",y1:"44",x2:"34",y2:"44",opacity:"0.25"})]})});case"tokens":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"22",cy:"32",r:"8"}),(0,t.jsx)("line",{x1:"30",y1:"32",x2:"54",y2:"32"}),(0,t.jsx)("line",{x1:"44",y1:"32",x2:"44",y2:"38"}),(0,t.jsx)("line",{x1:"50",y1:"32",x2:"50",y2:"40"})]})});case"networks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"18"}),(0,t.jsx)("ellipse",{cx:"32",cy:"32",rx:"18",ry:"9",opacity:"0.55"}),(0,t.jsx)("line",{x1:"14",y1:"32",x2:"50",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"32",y1:"14",x2:"32",y2:"50",opacity:"0.55"})]})});default:return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"14",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"32",cy:"32",r:"3"})]})})}}function n({variant:e="generic",title:s,sub:l,cta:o,compact:c=!1}){let x=r[e],d=s??x.title,h=l??x.sub;return(0,t.jsxs)("div",{className:`text-center ${c?"py-8":"py-16"} px-4`,role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)(i,{variant:e,size:c?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${c?"text-sm":"text-base"}`,children:d}),h&&(0,t.jsx)("p",{className:`text-gray-500 ${c?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:h}),o&&(0,t.jsx)("div",{className:"mt-4",children:o.href?(0,t.jsxs)(a.default,{href:o.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,t.jsxs)("button",{onClick:o.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}function l({cmd:e}){let[a,r]=(0,s.useState)(!1),i=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1800)}catch{}};return(0,t.jsxs)("div",{className:"anet-empty-cmd flex items-center gap-2 bg-[#0a0a15] border border-[#2a2a4a] rounded-lg pl-4 pr-1.5 py-1.5 text-xs sm:text-sm",children:[(0,t.jsx)("code",{className:"text-cyan-300 font-mono select-all",children:e}),(0,t.jsx)("button",{type:"button",onClick:i,"aria-label":a?"Copied":"Copy command",className:"shrink-0 rounded-md px-2 py-1.5 text-[11px] text-gray-500 hover:text-gray-200 hover:bg-[#1a1a2a] transition-colors",children:a?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-green-400",children:[(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5"})}),"Copied"]}):(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),"Copy"]})})]})}e.s(["EmptyState",0,n,"NodesEmptyState",0,function({hint:e}){return e?.global_count?(0,t.jsx)(n,{variant:"nodes",title:"No agents in this network",sub:`Server has ${e.global_count} nodes globally, but none are registered to the current network. Switch network or contact admin.`}):(0,t.jsxs)("div",{className:"text-center py-16 px-4",role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)("svg",{viewBox:"0 0 64 64",width:56,height:56,children:(0,t.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[(0,t.jsx)("rect",{x:"10",y:"20",width:"44",height:"28",rx:"2"}),(0,t.jsx)("rect",{x:"20",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"32",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"44",y:"32",width:"4",height:"8",opacity:"0.5"}),(0,t.jsx)("line",{x1:"10",y1:"26",x2:"54",y2:"26",opacity:"0.4"}),(0,t.jsx)("circle",{cx:"14",cy:"23",r:"0.8",fill:"currentColor"})]})})}),(0,t.jsx)("h3",{className:"font-medium text-gray-300 text-base",children:"Spin up your first agent"}),(0,t.jsx)("p",{className:"text-gray-500 text-sm mt-2 max-w-md mx-auto leading-relaxed",children:"Run this in a fresh terminal to register an agent with this CommHub:"}),(0,t.jsx)("div",{className:"mt-4 inline-block",children:(0,t.jsx)(l,{cmd:"npx --yes @sleep2agi/agent-network init"})}),(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsxs)("a",{href:"https://anet.sh",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium text-gray-500 hover:text-cyan-300",children:["Full quickstart guide",(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}])},79365,e=>{"use strict";var t=e.i(18050),s=e.i(71645),a=e.i(22016),r=e.i(18150),i=e.i(58963),n=e.i(95356),l=e.i(69874);let o={register:"bg-green-500/10 text-green-300 border-green-500/20",login:"bg-blue-500/10 text-blue-300 border-blue-500/20",login_failed:"bg-red-500/10 text-red-300 border-red-500/20",create_network:"bg-purple-500/10 text-purple-300 border-purple-500/20",send_task:"bg-cyan-500/10 text-cyan-300 border-cyan-500/20"},c={register:"#4ade80",login:"#60a5fa",login_failed:"#ef4444",create_network:"#a78bfa",send_task:"#22d3ee"};e.s(["default",0,function(){let e,x,{networkId:d}=(0,i.useNetworkId)(),[h,m]=(0,s.useState)([]),[g,y]=(0,s.useState)(!0),[u,p]=(0,s.useState)(""),[j,b]=(0,s.useState)(""),f=(0,s.useCallback)(async()=>{try{let e=new URLSearchParams({limit:"100"});d&&e.set("network_id",d),j&&e.set("action",j);let t=sessionStorage.getItem("anet_v3_auth");if(t)try{let s=JSON.parse(t);s.token&&e.set("token",s.token)}catch{}let s=await fetch(`/api/hub/audit-log?${e.toString()}`);if(401===s.status)return void window.location.assign("/login");let a=await s.json();m(a.logs||[]),p(a.error&&!a.logs?.length?a.error:"")}catch(e){p(e instanceof Error?e.message:"fetch failed")}finally{y(!1)}},[j,d]);return(0,s.useEffect)(()=>{y(!0),f();let e=setInterval(f,1e4);return()=>clearInterval(e)},[f]),(0,t.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-white lg:ml-0 ml-10",children:"Audit Log"}),h.length>0&&(0,t.jsx)("span",{className:"text-xs bg-blue-900/30 text-blue-400 px-2 py-0.5 rounded-full border border-blue-800/30",children:h.length})]}),(0,t.jsx)("div",{className:"mb-6 flex flex-wrap items-center gap-1 anet-tabstrip-wrap overflow-x-auto sm:overflow-x-visible",children:(e={},h.forEach(t=>{e[t.action]=(e[t.action]||0)+1}),[{key:"",label:"All"},{key:"login",label:"login",dot:c.login},{key:"login_failed",label:"login_failed",dot:c.login_failed},{key:"register",label:"register",dot:c.register},{key:"create_network",label:"create_network",dot:c.create_network},{key:"send_task",label:"send_task",dot:c.send_task}].map(s=>{let a=""===s.key?h.length:e[s.key]||0,r=j===s.key;return(0,t.jsxs)("button",{type:"button",onClick:()=>b(s.key),disabled:0===a&&""!==s.key,className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs transition-colors disabled:opacity-30 disabled:cursor-not-allowed shrink-0 whitespace-nowrap ${r?"bg-cyan-500/10 text-cyan-300 border border-cyan-500/30":"text-gray-500 hover:text-gray-200 hover:bg-[#1a1a2a] border border-transparent"}`,children:[s.dot&&(0,t.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full",style:{backgroundColor:s.dot}}),(0,t.jsx)("span",{children:s.label}),(0,t.jsx)("span",{className:`text-[10px] tabular-nums ${r?"text-cyan-400":"text-gray-600"}`,children:a})]},s.key||"all")}))}),u&&(x=/unauthor|401|forbidden|403|admin/i.test(u),(0,t.jsxs)("div",{className:"anet-warn-chip bg-yellow-900/20 border border-yellow-800/40 text-yellow-300 px-4 py-3 rounded-lg mb-6 text-sm flex items-start gap-3",role:"alert",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"text-base leading-none",children:"⚠"}),(0,t.jsx)("div",{className:"flex-1",children:x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"font-medium",children:"需要 admin 权限查看审计日志"}),(0,t.jsx)("div",{className:"text-xs opacity-80 mt-1",children:"审计日志记录用户注册 / 登录 / 网络变更等事件,需要 admin 角色。"}),(0,t.jsx)(a.default,{href:"/login",className:"inline-block mt-2 text-xs font-medium underline underline-offset-4 hover:opacity-80",children:"切到 admin 账号 →"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"font-medium",children:"加载失败"}),(0,t.jsx)("div",{className:"text-xs opacity-80 mt-1",children:"请检查 CommHub 是否在线,或稍后重试。"}),(0,t.jsx)("button",{onClick:()=>window.location.reload(),className:"inline-block mt-2 text-xs font-medium underline underline-offset-4 hover:opacity-80",children:"重新加载 →"})]})})]})),g?(0,t.jsx)("div",{className:"animate-pulse space-y-2",children:[1,2,3,4,5].map(e=>(0,t.jsx)("div",{className:"h-14 bg-gray-800/20 rounded-lg"},e))}):0===h.length?(0,t.jsx)(n.EmptyState,{variant:"logs"}):(0,t.jsx)("div",{className:"space-y-2",children:h.map(e=>{let s=e.username||e.user_id;return(0,t.jsxs)("div",{className:"relative bg-[#111128] border border-[#2a2a4a] rounded-lg pl-4 pr-4 py-3 hover:border-[#3a3a5a] transition-colors overflow-hidden",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute left-0 top-0 bottom-0 w-0.5",style:{backgroundColor:c[e.action]||"transparent"}}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-md border ${o[e.action]||"bg-gray-500/10 text-gray-400 border-gray-500/20"}`,children:e.action}),s&&(0,t.jsx)(l.AliasAvatar,{alias:s,size:16}),(0,t.jsx)("span",{className:"text-sm text-gray-200 font-medium",children:s}),e.target_type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-xs text-gray-600",children:"→"}),(0,t.jsxs)("span",{className:"text-xs text-gray-400",children:[e.target_type,e.target_id?`:${e.target_id.slice(0,12)}`:""]})]}),(0,t.jsx)("span",{className:"text-xs text-gray-600 ml-auto",children:(0,r.timeAgo)(e.created_at)})]}),e.detail&&(0,t.jsx)("div",{className:"text-xs text-gray-500",children:e.detail}),e.ip&&"unknown"!==e.ip&&(0,t.jsxs)("div",{className:"text-[10px] text-gray-700",children:["IP: ",e.ip]})]},e.id)})})]})}])}]);
package/.next/trace CHANGED
@@ -1,2 +1,2 @@
1
- [{"name":"generate-buildid","duration":371,"timestamp":207383309722,"id":4,"parentId":1,"tags":{},"startTime":1778578869134,"traceId":"d7b2bb337563b4c9"},{"name":"load-custom-routes","duration":487,"timestamp":207383310373,"id":5,"parentId":1,"tags":{},"startTime":1778578869135,"traceId":"d7b2bb337563b4c9"},{"name":"create-dist-dir","duration":692,"timestamp":207383310909,"id":6,"parentId":1,"tags":{},"startTime":1778578869136,"traceId":"d7b2bb337563b4c9"},{"name":"clean","duration":1551,"timestamp":207383312408,"id":7,"parentId":1,"tags":{},"startTime":1778578869137,"traceId":"d7b2bb337563b4c9"},{"name":"discover-routes","duration":15204,"timestamp":207383496594,"id":8,"parentId":1,"tags":{},"startTime":1778578869321,"traceId":"d7b2bb337563b4c9"},{"name":"create-root-mapping","duration":169,"timestamp":207383511875,"id":9,"parentId":1,"tags":{},"startTime":1778578869337,"traceId":"d7b2bb337563b4c9"},{"name":"generate-route-types","duration":36332,"timestamp":207383514720,"id":10,"parentId":1,"tags":{},"startTime":1778578869339,"traceId":"d7b2bb337563b4c9"},{"name":"public-dir-conflict-check","duration":201,"timestamp":207383551264,"id":11,"parentId":1,"tags":{},"startTime":1778578869376,"traceId":"d7b2bb337563b4c9"},{"name":"generate-routes-manifest","duration":4944,"timestamp":207383551601,"id":12,"parentId":1,"tags":{},"startTime":1778578869376,"traceId":"d7b2bb337563b4c9"},{"name":"run-turbopack","duration":23936816,"timestamp":207383562404,"id":14,"parentId":1,"tags":{},"startTime":1778578869387,"traceId":"d7b2bb337563b4c9"},{"name":"turbopack-build-events","duration":125,"timestamp":207384184651,"id":15,"parentId":1,"tags":{},"startTime":1778578870009,"traceId":"d7b2bb337563b4c9"},{"name":"run-typescript","duration":19180933,"timestamp":207407522942,"id":16,"parentId":1,"tags":{},"startTime":1778578893348,"traceId":"d7b2bb337563b4c9"},{"name":"generate-required-server-files","duration":7655,"timestamp":207426724536,"id":18,"parentId":1,"tags":{},"startTime":1778578912549,"traceId":"d7b2bb337563b4c9"},{"name":"check-static-error-page","duration":187197,"timestamp":207427136098,"id":20,"parentId":19,"tags":{},"startTime":1778578912961,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":1812035,"timestamp":207427328246,"id":62,"parentId":22,"tags":{},"startTime":1778578913153,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":1926714,"timestamp":207427213690,"id":22,"parentId":19,"tags":{"page":"/_global-error"},"startTime":1778578913038,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2205218,"timestamp":207427327768,"id":61,"parentId":21,"tags":{},"startTime":1778578913152,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2356388,"timestamp":207427176834,"id":21,"parentId":19,"tags":{"page":"/_not-found"},"startTime":1778578913002,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2262932,"timestamp":207427328607,"id":64,"parentId":26,"tags":{},"startTime":1778578913153,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2316694,"timestamp":207427274926,"id":26,"parentId":19,"tags":{"page":"/api/auth/logout"},"startTime":1778578913100,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2319163,"timestamp":207427330780,"id":66,"parentId":28,"tags":{},"startTime":1778578913155,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2372870,"timestamp":207427277173,"id":28,"parentId":19,"tags":{"page":"/api/hub/audit-log"},"startTime":1778578913102,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2328792,"timestamp":207427328391,"id":63,"parentId":25,"tags":{},"startTime":1778578913153,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2383502,"timestamp":207427273788,"id":25,"parentId":19,"tags":{"page":"/api/auth/login"},"startTime":1778578913098,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2342416,"timestamp":207427330836,"id":67,"parentId":29,"tags":{},"startTime":1778578913156,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2395560,"timestamp":207427277778,"id":29,"parentId":19,"tags":{"page":"/api/hub/auth"},"startTime":1778578913102,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2433588,"timestamp":207427330887,"id":68,"parentId":30,"tags":{},"startTime":1778578913156,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2486325,"timestamp":207427278231,"id":30,"parentId":19,"tags":{"page":"/api/hub/broadcast"},"startTime":1778578913103,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2440484,"timestamp":207427330942,"id":69,"parentId":32,"tags":{},"startTime":1778578913156,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2490549,"timestamp":207427280952,"id":32,"parentId":19,"tags":{"page":"/api/hub/health"},"startTime":1778578913106,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2444810,"timestamp":207427331118,"id":70,"parentId":33,"tags":{},"startTime":1778578913156,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2495278,"timestamp":207427281127,"id":33,"parentId":19,"tags":{"page":"/api/hub/inbox"},"startTime":1778578913106,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2460536,"timestamp":207427331243,"id":72,"parentId":35,"tags":{},"startTime":1778578913156,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2510481,"timestamp":207427281384,"id":35,"parentId":19,"tags":{"page":"/api/hub/messages"},"startTime":1778578913106,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2461527,"timestamp":207427331205,"id":71,"parentId":34,"tags":{},"startTime":1778578913156,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2511534,"timestamp":207427281266,"id":34,"parentId":19,"tags":{"page":"/api/hub/license"},"startTime":1778578913106,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2475427,"timestamp":207427331387,"id":74,"parentId":37,"tags":{},"startTime":1778578913156,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2522444,"timestamp":207427284532,"id":37,"parentId":19,"tags":{"page":"/api/hub/nodes"},"startTime":1778578913109,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2475994,"timestamp":207427331353,"id":73,"parentId":36,"tags":{},"startTime":1778578913156,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2525500,"timestamp":207427281892,"id":36,"parentId":19,"tags":{"page":"/api/hub/networks"},"startTime":1778578913107,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2500481,"timestamp":207427330670,"id":65,"parentId":27,"tags":{},"startTime":1778578913155,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2555041,"timestamp":207427276203,"id":27,"parentId":19,"tags":{"page":"/api/auth/v3"},"startTime":1778578913101,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2505544,"timestamp":207427331399,"id":75,"parentId":38,"tags":{},"startTime":1778578913156,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2551764,"timestamp":207427285292,"id":38,"parentId":19,"tags":{"page":"/api/hub/register"},"startTime":1778578913110,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2511506,"timestamp":207427331415,"id":77,"parentId":40,"tags":{},"startTime":1778578913156,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2541487,"timestamp":207427301592,"id":40,"parentId":19,"tags":{"page":"/api/hub/server-logs"},"startTime":1778578913126,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2528794,"timestamp":207427331431,"id":79,"parentId":42,"tags":{},"startTime":1778578913156,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2552014,"timestamp":207427308503,"id":42,"parentId":19,"tags":{"page":"/api/hub/stats"},"startTime":1778578913133,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2546264,"timestamp":207427331407,"id":76,"parentId":39,"tags":{},"startTime":1778578913156,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2580426,"timestamp":207427297341,"id":39,"parentId":19,"tags":{"page":"/api/hub/send"},"startTime":1778578913122,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2546616,"timestamp":207427331439,"id":80,"parentId":43,"tags":{},"startTime":1778578913156,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2569275,"timestamp":207427308826,"id":43,"parentId":19,"tags":{"page":"/api/hub/status"},"startTime":1778578913134,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2546826,"timestamp":207427331423,"id":78,"parentId":41,"tags":{},"startTime":1778578913156,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2570282,"timestamp":207427307992,"id":41,"parentId":19,"tags":{"page":"/api/hub/session"},"startTime":1778578913133,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2575065,"timestamp":207427331455,"id":82,"parentId":45,"tags":{},"startTime":1778578913156,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2597216,"timestamp":207427309378,"id":45,"parentId":19,"tags":{"page":"/api/hub/tasks"},"startTime":1778578913134,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2586850,"timestamp":207427331474,"id":84,"parentId":47,"tags":{},"startTime":1778578913156,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2608511,"timestamp":207427309910,"id":47,"parentId":19,"tags":{"page":"/api/hub/tokens"},"startTime":1778578913135,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2591156,"timestamp":207427331446,"id":81,"parentId":44,"tags":{},"startTime":1778578913156,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2613564,"timestamp":207427309098,"id":44,"parentId":19,"tags":{"page":"/api/hub/task-events"},"startTime":1778578913134,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2601953,"timestamp":207427331463,"id":83,"parentId":46,"tags":{},"startTime":1778578913156,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2623826,"timestamp":207427309650,"id":46,"parentId":19,"tags":{"page":"/api/hub/tmux"},"startTime":1778578913134,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2603044,"timestamp":207427331482,"id":85,"parentId":48,"tags":{},"startTime":1778578913156,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2624380,"timestamp":207427310203,"id":48,"parentId":19,"tags":{"page":"/favicon.ico"},"startTime":1778578913135,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2595792,"timestamp":207427347520,"id":86,"parentId":31,"tags":{},"startTime":1778578913172,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2663534,"timestamp":207427279851,"id":31,"parentId":19,"tags":{"page":"/api/hub/events"},"startTime":1778578913105,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2607777,"timestamp":207427351652,"id":87,"parentId":24,"tags":{},"startTime":1778578913184,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2726252,"timestamp":207427233270,"id":24,"parentId":19,"tags":{"page":"/api/anet/config"},"startTime":1778578913058,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2628709,"timestamp":207427393864,"id":88,"parentId":23,"tags":{},"startTime":1778578913219,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2792727,"timestamp":207427229930,"id":23,"parentId":19,"tags":{"page":"/admin"},"startTime":1778578913056,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2644237,"timestamp":207427393927,"id":91,"parentId":51,"tags":{},"startTime":1778578913219,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2724161,"timestamp":207427314083,"id":51,"parentId":19,"tags":{"page":"/messages"},"startTime":1778578913139,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2666532,"timestamp":207427393937,"id":92,"parentId":52,"tags":{},"startTime":1778578913219,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2746209,"timestamp":207427314350,"id":52,"parentId":19,"tags":{"page":"/node"},"startTime":1778578913139,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2714816,"timestamp":207427393946,"id":93,"parentId":53,"tags":{},"startTime":1778578913219,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2794216,"timestamp":207427314611,"id":53,"parentId":19,"tags":{"page":"/nodes"},"startTime":1778578913139,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2717941,"timestamp":207427393919,"id":90,"parentId":50,"tags":{},"startTime":1778578913219,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2798147,"timestamp":207427313846,"id":50,"parentId":19,"tags":{"page":"/logs"},"startTime":1778578913139,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2751249,"timestamp":207427393953,"id":94,"parentId":55,"tags":{},"startTime":1778578913219,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2828499,"timestamp":207427317366,"id":55,"parentId":19,"tags":{"page":"/server-logs"},"startTime":1778578913142,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2752268,"timestamp":207427393962,"id":95,"parentId":56,"tags":{},"startTime":1778578913219,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2824989,"timestamp":207427321301,"id":56,"parentId":19,"tags":{"page":"/settings/networks"},"startTime":1778578913146,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2776763,"timestamp":207427393976,"id":97,"parentId":59,"tags":{},"startTime":1778578913219,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2848185,"timestamp":207427322656,"id":59,"parentId":19,"tags":{"page":"/tasks/[id]"},"startTime":1778578913147,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2787543,"timestamp":207427393971,"id":96,"parentId":58,"tags":{},"startTime":1778578913219,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2859210,"timestamp":207427322375,"id":58,"parentId":19,"tags":{"page":"/settings/tokens"},"startTime":1778578913147,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2787840,"timestamp":207427393907,"id":89,"parentId":49,"tags":{},"startTime":1778578913219,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2868335,"timestamp":207427313439,"id":49,"parentId":19,"tags":{"page":"/login"},"startTime":1778578913138,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2800468,"timestamp":207427393989,"id":98,"parentId":60,"tags":{},"startTime":1778578913219,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2871621,"timestamp":207427322918,"id":60,"parentId":19,"tags":{"page":"/tasks"},"startTime":1778578913148,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2800574,"timestamp":207427408778,"id":100,"parentId":54,"tags":{},"startTime":1778578913233,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2894560,"timestamp":207427314854,"id":54,"parentId":19,"tags":{"page":"/"},"startTime":1778578913140,"traceId":"d7b2bb337563b4c9"},{"name":"is-page-static","duration":2810911,"timestamp":207427398586,"id":99,"parentId":57,"tags":{},"startTime":1778578913223,"traceId":"d7b2bb337563b4c9"},{"name":"check-page","duration":2887797,"timestamp":207427321722,"id":57,"parentId":19,"tags":{"page":"/settings"},"startTime":1778578913146,"traceId":"d7b2bb337563b4c9"},{"name":"static-check","duration":3083534,"timestamp":207427126027,"id":19,"parentId":1,"tags":{},"startTime":1778578912951,"traceId":"d7b2bb337563b4c9"},{"name":"write-routes-manifest","duration":540,"timestamp":207430253523,"id":102,"parentId":1,"tags":{},"startTime":1778578916078,"traceId":"d7b2bb337563b4c9"},{"name":"load-dotenv","duration":55,"timestamp":207430277769,"id":105,"parentId":104,"tags":{},"startTime":1778578916102,"traceId":"d7b2bb337563b4c9"},{"name":"run-export-path-map","duration":2776,"timestamp":207430283774,"id":106,"parentId":104,"tags":{},"startTime":1778578916108,"traceId":"d7b2bb337563b4c9"},{"name":"next-export","duration":1241862,"timestamp":207430276529,"id":104,"parentId":1,"tags":{},"startTime":1778578916101,"traceId":"d7b2bb337563b4c9"},{"name":"move-exported-app-not-found-","duration":850,"timestamp":207431523921,"id":107,"parentId":103,"tags":{},"startTime":1778578917349,"traceId":"d7b2bb337563b4c9"},{"name":"move-exported-app-global-error-","duration":549,"timestamp":207431524914,"id":108,"parentId":103,"tags":{},"startTime":1778578917350,"traceId":"d7b2bb337563b4c9"}]
2
- [{"name":"static-generation","duration":1271099,"timestamp":207430260275,"id":103,"parentId":1,"tags":{},"startTime":1778578916085,"traceId":"d7b2bb337563b4c9"},{"name":"write-routes-manifest","duration":2374,"timestamp":207431531582,"id":109,"parentId":1,"tags":{},"startTime":1778578917356,"traceId":"d7b2bb337563b4c9"},{"name":"print-tree-view","duration":3986,"timestamp":207431544154,"id":110,"parentId":1,"tags":{},"startTime":1778578917369,"traceId":"d7b2bb337563b4c9"},{"name":"write-route-bundle-stats","duration":36180,"timestamp":207431548181,"id":111,"parentId":1,"tags":{},"startTime":1778578917373,"traceId":"d7b2bb337563b4c9"},{"name":"telemetry-flush","duration":21739,"timestamp":207431584420,"id":112,"parentId":1,"tags":{},"startTime":1778578917409,"traceId":"d7b2bb337563b4c9"},{"name":"next-build","duration":48387145,"timestamp":207383219058,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1778578869044,"traceId":"d7b2bb337563b4c9"}]
1
+ [{"name":"generate-buildid","duration":340,"timestamp":208300281782,"id":4,"parentId":1,"tags":{},"startTime":1778579786106,"traceId":"45a58d09a5e8d059"},{"name":"load-custom-routes","duration":506,"timestamp":208300282284,"id":5,"parentId":1,"tags":{},"startTime":1778579786107,"traceId":"45a58d09a5e8d059"},{"name":"create-dist-dir","duration":24410,"timestamp":208300282837,"id":6,"parentId":1,"tags":{},"startTime":1778579786108,"traceId":"45a58d09a5e8d059"},{"name":"clean","duration":583,"timestamp":208300309595,"id":7,"parentId":1,"tags":{},"startTime":1778579786134,"traceId":"45a58d09a5e8d059"},{"name":"discover-routes","duration":36380,"timestamp":208300535876,"id":8,"parentId":1,"tags":{},"startTime":1778579786361,"traceId":"45a58d09a5e8d059"},{"name":"create-root-mapping","duration":199,"timestamp":208300572334,"id":9,"parentId":1,"tags":{},"startTime":1778579786397,"traceId":"45a58d09a5e8d059"},{"name":"generate-route-types","duration":26277,"timestamp":208300575624,"id":10,"parentId":1,"tags":{},"startTime":1778579786400,"traceId":"45a58d09a5e8d059"},{"name":"public-dir-conflict-check","duration":105,"timestamp":208300602094,"id":11,"parentId":1,"tags":{},"startTime":1778579786427,"traceId":"45a58d09a5e8d059"},{"name":"generate-routes-manifest","duration":4277,"timestamp":208300602515,"id":12,"parentId":1,"tags":{},"startTime":1778579786427,"traceId":"45a58d09a5e8d059"},{"name":"run-turbopack","duration":12593316,"timestamp":208300638500,"id":14,"parentId":1,"tags":{},"startTime":1778579786463,"traceId":"45a58d09a5e8d059"},{"name":"turbopack-build-events","duration":188,"timestamp":208301107259,"id":15,"parentId":1,"tags":{},"startTime":1778579786932,"traceId":"45a58d09a5e8d059"},{"name":"run-typescript","duration":9844264,"timestamp":208313248440,"id":16,"parentId":1,"tags":{},"startTime":1778579799073,"traceId":"45a58d09a5e8d059"},{"name":"generate-required-server-files","duration":2997,"timestamp":208323093914,"id":18,"parentId":1,"tags":{},"startTime":1778579808919,"traceId":"45a58d09a5e8d059"},{"name":"check-static-error-page","duration":28638,"timestamp":208323322533,"id":20,"parentId":19,"tags":{},"startTime":1778579809147,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":460655,"timestamp":208323365319,"id":62,"parentId":22,"tags":{},"startTime":1778579809190,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":493934,"timestamp":208323334252,"id":22,"parentId":19,"tags":{"page":"/_global-error"},"startTime":1778579809159,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":601609,"timestamp":208323365834,"id":64,"parentId":26,"tags":{},"startTime":1778579809191,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":627723,"timestamp":208323339802,"id":26,"parentId":19,"tags":{"page":"/api/auth/logout"},"startTime":1778579809164,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":604754,"timestamp":208323365570,"id":63,"parentId":25,"tags":{},"startTime":1778579809190,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":630842,"timestamp":208323339544,"id":25,"parentId":19,"tags":{"page":"/api/auth/login"},"startTime":1778579809164,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":607483,"timestamp":208323365897,"id":65,"parentId":27,"tags":{},"startTime":1778579809191,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":633508,"timestamp":208323339950,"id":27,"parentId":19,"tags":{"page":"/api/auth/v3"},"startTime":1778579809165,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":611497,"timestamp":208323366026,"id":67,"parentId":29,"tags":{},"startTime":1778579809191,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":637293,"timestamp":208323340283,"id":29,"parentId":19,"tags":{"page":"/api/hub/auth"},"startTime":1778579809165,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":617032,"timestamp":208323366077,"id":68,"parentId":30,"tags":{},"startTime":1778579809191,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":642558,"timestamp":208323340609,"id":30,"parentId":19,"tags":{"page":"/api/hub/broadcast"},"startTime":1778579809165,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":618850,"timestamp":208323366129,"id":69,"parentId":32,"tags":{},"startTime":1778579809191,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":643906,"timestamp":208323341141,"id":32,"parentId":19,"tags":{"page":"/api/hub/health"},"startTime":1778579809166,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":622344,"timestamp":208323366276,"id":70,"parentId":33,"tags":{},"startTime":1778579809191,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":647380,"timestamp":208323341282,"id":33,"parentId":19,"tags":{"page":"/api/hub/inbox"},"startTime":1778579809166,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":624895,"timestamp":208323367523,"id":71,"parentId":34,"tags":{},"startTime":1778579809192,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":651081,"timestamp":208323341396,"id":34,"parentId":19,"tags":{"page":"/api/hub/license"},"startTime":1778579809166,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":628149,"timestamp":208323367563,"id":72,"parentId":35,"tags":{},"startTime":1778579809192,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":654219,"timestamp":208323341535,"id":35,"parentId":19,"tags":{"page":"/api/hub/messages"},"startTime":1778579809166,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":633910,"timestamp":208323367658,"id":73,"parentId":36,"tags":{},"startTime":1778579809192,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":659455,"timestamp":208323342161,"id":36,"parentId":19,"tags":{"page":"/api/hub/networks"},"startTime":1778579809167,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":637208,"timestamp":208323365954,"id":66,"parentId":28,"tags":{},"startTime":1778579809191,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":663056,"timestamp":208323340151,"id":28,"parentId":19,"tags":{"page":"/api/hub/audit-log"},"startTime":1778579809165,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":639395,"timestamp":208323367693,"id":74,"parentId":37,"tags":{},"startTime":1778579809192,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":664414,"timestamp":208323342714,"id":37,"parentId":19,"tags":{"page":"/api/hub/nodes"},"startTime":1778579809167,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":641996,"timestamp":208323367717,"id":76,"parentId":39,"tags":{},"startTime":1778579809192,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":665926,"timestamp":208323343822,"id":39,"parentId":19,"tags":{"page":"/api/hub/send"},"startTime":1778579809169,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":651941,"timestamp":208323363512,"id":61,"parentId":21,"tags":{},"startTime":1778579809188,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":683499,"timestamp":208323332017,"id":21,"parentId":19,"tags":{"page":"/_not-found"},"startTime":1778579809157,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":649277,"timestamp":208323367708,"id":75,"parentId":38,"tags":{},"startTime":1778579809192,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":673429,"timestamp":208323343617,"id":38,"parentId":19,"tags":{"page":"/api/hub/register"},"startTime":1778579809168,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":650820,"timestamp":208323367728,"id":77,"parentId":40,"tags":{},"startTime":1778579809192,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":674412,"timestamp":208323344188,"id":40,"parentId":19,"tags":{"page":"/api/hub/server-logs"},"startTime":1778579809169,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":652636,"timestamp":208323367749,"id":79,"parentId":42,"tags":{},"startTime":1778579809192,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":675937,"timestamp":208323344485,"id":42,"parentId":19,"tags":{"page":"/api/hub/stats"},"startTime":1778579809169,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":655683,"timestamp":208323367761,"id":80,"parentId":43,"tags":{},"startTime":1778579809192,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":678864,"timestamp":208323344640,"id":43,"parentId":19,"tags":{"page":"/api/hub/status"},"startTime":1778579809169,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":659522,"timestamp":208323367782,"id":82,"parentId":45,"tags":{},"startTime":1778579809192,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":682387,"timestamp":208323344955,"id":45,"parentId":19,"tags":{"page":"/api/hub/tasks"},"startTime":1778579809170,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":664342,"timestamp":208323367774,"id":81,"parentId":44,"tags":{},"startTime":1778579809192,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":687364,"timestamp":208323344801,"id":44,"parentId":19,"tags":{"page":"/api/hub/task-events"},"startTime":1778579809169,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":664502,"timestamp":208323367794,"id":83,"parentId":46,"tags":{},"startTime":1778579809192,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":687148,"timestamp":208323345170,"id":46,"parentId":19,"tags":{"page":"/api/hub/tmux"},"startTime":1778579809170,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":667068,"timestamp":208323367807,"id":84,"parentId":47,"tags":{},"startTime":1778579809192,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":689591,"timestamp":208323345328,"id":47,"parentId":19,"tags":{"page":"/api/hub/tokens"},"startTime":1778579809170,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":667489,"timestamp":208323367815,"id":85,"parentId":48,"tags":{},"startTime":1778579809193,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":689876,"timestamp":208323345494,"id":48,"parentId":19,"tags":{"page":"/favicon.ico"},"startTime":1778579809170,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":650753,"timestamp":208323387222,"id":86,"parentId":31,"tags":{},"startTime":1778579809212,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":697296,"timestamp":208323340770,"id":31,"parentId":19,"tags":{"page":"/api/hub/events"},"startTime":1778579809165,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":650896,"timestamp":208323389258,"id":87,"parentId":24,"tags":{},"startTime":1778579809214,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":706788,"timestamp":208323335313,"id":24,"parentId":19,"tags":{"page":"/api/anet/config"},"startTime":1778579809160,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":699784,"timestamp":208323367740,"id":78,"parentId":41,"tags":{},"startTime":1778579809192,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":723258,"timestamp":208323344327,"id":41,"parentId":19,"tags":{"page":"/api/hub/session"},"startTime":1778579809169,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":674925,"timestamp":208323399720,"id":90,"parentId":50,"tags":{},"startTime":1778579809224,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":728259,"timestamp":208323346461,"id":50,"parentId":19,"tags":{"page":"/logs"},"startTime":1778579809171,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":681542,"timestamp":208323399728,"id":91,"parentId":51,"tags":{},"startTime":1778579809224,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":734609,"timestamp":208323346716,"id":51,"parentId":19,"tags":{"page":"/messages"},"startTime":1778579809171,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":681784,"timestamp":208323399669,"id":88,"parentId":23,"tags":{},"startTime":1778579809224,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":746626,"timestamp":208323334847,"id":23,"parentId":19,"tags":{"page":"/admin"},"startTime":1778579809160,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":692778,"timestamp":208323399742,"id":93,"parentId":53,"tags":{},"startTime":1778579809224,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":745197,"timestamp":208323347381,"id":53,"parentId":19,"tags":{"page":"/nodes"},"startTime":1778579809172,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":699165,"timestamp":208323399734,"id":92,"parentId":52,"tags":{},"startTime":1778579809224,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":751914,"timestamp":208323347042,"id":52,"parentId":19,"tags":{"page":"/node"},"startTime":1778579809172,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":704322,"timestamp":208323399751,"id":94,"parentId":55,"tags":{},"startTime":1778579809224,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":754703,"timestamp":208323349446,"id":55,"parentId":19,"tags":{"page":"/server-logs"},"startTime":1778579809174,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":717317,"timestamp":208323399765,"id":96,"parentId":58,"tags":{},"startTime":1778579809224,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":766620,"timestamp":208323350523,"id":58,"parentId":19,"tags":{"page":"/settings/tokens"},"startTime":1778579809175,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":727352,"timestamp":208323399773,"id":97,"parentId":59,"tags":{},"startTime":1778579809224,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":776497,"timestamp":208323350692,"id":59,"parentId":19,"tags":{"page":"/tasks/[id]"},"startTime":1778579809175,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":729466,"timestamp":208323399756,"id":95,"parentId":56,"tags":{},"startTime":1778579809224,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":779541,"timestamp":208323349730,"id":56,"parentId":19,"tags":{"page":"/settings/networks"},"startTime":1778579809174,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":734861,"timestamp":208323399785,"id":98,"parentId":60,"tags":{},"startTime":1778579809224,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":783838,"timestamp":208323350860,"id":60,"parentId":19,"tags":{"page":"/tasks"},"startTime":1778579809176,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":736164,"timestamp":208323399709,"id":89,"parentId":49,"tags":{},"startTime":1778579809224,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":789734,"timestamp":208323346198,"id":49,"parentId":19,"tags":{"page":"/login"},"startTime":1778579809171,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":712799,"timestamp":208323424926,"id":99,"parentId":57,"tags":{},"startTime":1778579809250,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":787813,"timestamp":208323349942,"id":57,"parentId":19,"tags":{"page":"/settings"},"startTime":1778579809175,"traceId":"45a58d09a5e8d059"},{"name":"is-page-static","duration":686843,"timestamp":208323454524,"id":100,"parentId":54,"tags":{},"startTime":1778579809279,"traceId":"45a58d09a5e8d059"},{"name":"check-page","duration":793101,"timestamp":208323348299,"id":54,"parentId":19,"tags":{"page":"/"},"startTime":1778579809173,"traceId":"45a58d09a5e8d059"},{"name":"static-check","duration":825728,"timestamp":208323315707,"id":19,"parentId":1,"tags":{},"startTime":1778579809140,"traceId":"45a58d09a5e8d059"},{"name":"write-routes-manifest","duration":529,"timestamp":208324149404,"id":102,"parentId":1,"tags":{},"startTime":1778579809974,"traceId":"45a58d09a5e8d059"},{"name":"load-dotenv","duration":64,"timestamp":208324168386,"id":105,"parentId":104,"tags":{},"startTime":1778579809993,"traceId":"45a58d09a5e8d059"},{"name":"run-export-path-map","duration":930,"timestamp":208324173214,"id":106,"parentId":104,"tags":{},"startTime":1778579809998,"traceId":"45a58d09a5e8d059"},{"name":"next-export","duration":657911,"timestamp":208324167029,"id":104,"parentId":1,"tags":{},"startTime":1778579809992,"traceId":"45a58d09a5e8d059"},{"name":"move-exported-app-not-found-","duration":601,"timestamp":208324828317,"id":107,"parentId":103,"tags":{},"startTime":1778579810653,"traceId":"45a58d09a5e8d059"},{"name":"move-exported-app-global-error-","duration":397,"timestamp":208324829047,"id":108,"parentId":103,"tags":{},"startTime":1778579810654,"traceId":"45a58d09a5e8d059"}]
2
+ [{"name":"static-generation","duration":677204,"timestamp":208324156332,"id":103,"parentId":1,"tags":{},"startTime":1778579809981,"traceId":"45a58d09a5e8d059"},{"name":"write-routes-manifest","duration":470,"timestamp":208324833757,"id":109,"parentId":1,"tags":{},"startTime":1778579810658,"traceId":"45a58d09a5e8d059"},{"name":"print-tree-view","duration":3548,"timestamp":208324850059,"id":110,"parentId":1,"tags":{},"startTime":1778579810675,"traceId":"45a58d09a5e8d059"},{"name":"write-route-bundle-stats","duration":13326,"timestamp":208324853648,"id":111,"parentId":1,"tags":{},"startTime":1778579810678,"traceId":"45a58d09a5e8d059"},{"name":"telemetry-flush","duration":56620,"timestamp":208324867048,"id":112,"parentId":1,"tags":{},"startTime":1778579810692,"traceId":"45a58d09a5e8d059"},{"name":"next-build","duration":24727321,"timestamp":208300196391,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1778579786021,"traceId":"45a58d09a5e8d059"}]
package/.next/trace-build CHANGED
@@ -1 +1 @@
1
- [{"name":"run-turbopack","duration":23936816,"timestamp":207383562404,"id":14,"parentId":1,"tags":{},"startTime":1778578869387,"traceId":"d7b2bb337563b4c9"},{"name":"turbopack-build-events","duration":125,"timestamp":207384184651,"id":15,"parentId":1,"tags":{},"startTime":1778578870009,"traceId":"d7b2bb337563b4c9"},{"name":"run-typescript","duration":19180933,"timestamp":207407522942,"id":16,"parentId":1,"tags":{},"startTime":1778578893348,"traceId":"d7b2bb337563b4c9"},{"name":"static-check","duration":3083534,"timestamp":207427126027,"id":19,"parentId":1,"tags":{},"startTime":1778578912951,"traceId":"d7b2bb337563b4c9"},{"name":"static-generation","duration":1271099,"timestamp":207430260275,"id":103,"parentId":1,"tags":{},"startTime":1778578916085,"traceId":"d7b2bb337563b4c9"},{"name":"telemetry-flush","duration":21739,"timestamp":207431584420,"id":112,"parentId":1,"tags":{},"startTime":1778578917409,"traceId":"d7b2bb337563b4c9"},{"name":"next-build","duration":48387145,"timestamp":207383219058,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1778578869044,"traceId":"d7b2bb337563b4c9"}]
1
+ [{"name":"run-turbopack","duration":12593316,"timestamp":208300638500,"id":14,"parentId":1,"tags":{},"startTime":1778579786463,"traceId":"45a58d09a5e8d059"},{"name":"turbopack-build-events","duration":188,"timestamp":208301107259,"id":15,"parentId":1,"tags":{},"startTime":1778579786932,"traceId":"45a58d09a5e8d059"},{"name":"run-typescript","duration":9844264,"timestamp":208313248440,"id":16,"parentId":1,"tags":{},"startTime":1778579799073,"traceId":"45a58d09a5e8d059"},{"name":"static-check","duration":825728,"timestamp":208323315707,"id":19,"parentId":1,"tags":{},"startTime":1778579809140,"traceId":"45a58d09a5e8d059"},{"name":"static-generation","duration":677204,"timestamp":208324156332,"id":103,"parentId":1,"tags":{},"startTime":1778579809981,"traceId":"45a58d09a5e8d059"},{"name":"telemetry-flush","duration":56620,"timestamp":208324867048,"id":112,"parentId":1,"tags":{},"startTime":1778579810692,"traceId":"45a58d09a5e8d059"},{"name":"next-build","duration":24727321,"timestamp":208300196391,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1778579786021,"traceId":"45a58d09a5e8d059"}]
@@ -1,5 +1,6 @@
1
1
  'use client';
2
2
 
3
+ import { useState } from 'react';
3
4
  import Link from 'next/link';
4
5
 
5
6
  export type EmptyVariant = 'nodes' | 'tasks' | 'messages' | 'logs' | 'tokens' | 'networks' | 'generic';
@@ -202,9 +203,7 @@ export function NodesEmptyState({ hint }: { hint?: { global_count?: number; filt
202
203
  Run this in a fresh terminal to register an agent with this CommHub:
203
204
  </p>
204
205
  <div className="mt-4 inline-block">
205
- <code className="anet-empty-cmd block bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-4 py-3 text-xs sm:text-sm text-cyan-300 font-mono select-all">
206
- npx --yes @sleep2agi/agent-network init
207
- </code>
206
+ <QuickstartCommand cmd="npx --yes @sleep2agi/agent-network init" />
208
207
  </div>
209
208
  <div className="mt-3">
210
209
  <a
@@ -220,3 +219,44 @@ export function NodesEmptyState({ hint }: { hint?: { global_count?: number; filt
220
219
  </div>
221
220
  );
222
221
  }
222
+
223
+ /** Code block + inline copy button used by the empty-Overview first-run
224
+ * CTA. State lives here so the parent stays stateless. */
225
+ function QuickstartCommand({ cmd }: { cmd: string }) {
226
+ const [copied, setCopied] = useState(false);
227
+ const onCopy = async () => {
228
+ try {
229
+ await navigator.clipboard.writeText(cmd);
230
+ setCopied(true);
231
+ setTimeout(() => setCopied(false), 1800);
232
+ } catch {}
233
+ };
234
+ return (
235
+ <div className="anet-empty-cmd flex items-center gap-2 bg-[#0a0a15] border border-[#2a2a4a] rounded-lg pl-4 pr-1.5 py-1.5 text-xs sm:text-sm">
236
+ <code className="text-cyan-300 font-mono select-all">{cmd}</code>
237
+ <button
238
+ type="button"
239
+ onClick={onCopy}
240
+ aria-label={copied ? 'Copied' : 'Copy command'}
241
+ className="shrink-0 rounded-md px-2 py-1.5 text-[11px] text-gray-500 hover:text-gray-200 hover:bg-[#1a1a2a] transition-colors"
242
+ >
243
+ {copied ? (
244
+ <span className="flex items-center gap-1 text-green-400">
245
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
246
+ <path d="M20 6 9 17l-5-5" />
247
+ </svg>
248
+ Copied
249
+ </span>
250
+ ) : (
251
+ <span className="flex items-center gap-1">
252
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
253
+ <rect x="9" y="9" width="13" height="13" rx="2" ry="2" />
254
+ <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />
255
+ </svg>
256
+ Copy
257
+ </span>
258
+ )}
259
+ </button>
260
+ </div>
261
+ );
262
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network-dashboard",
3
- "version": "0.4.5-preview.36",
3
+ "version": "0.4.5-preview.37",
4
4
  "description": "Agent Network Dashboard — Web UI for managing AI Agent networks",
5
5
  "scripts": {
6
6
  "dev": "next dev",
@@ -1,7 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18150,e=>{"use strict";e.s(["formatUptime",0,function(e){let t=Math.floor(e/3600),s=Math.floor(e%3600/60);return t>0?`${t}h ${s}m`:`${s}m`},"timeAgo",0,function(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}])},69874,e=>{"use strict";var t=e.i(18050);let s=[180,200,220,270,300,330,30,90];e.s(["AliasAvatar",0,function({alias:e,size:a=28,className:r=""}){let i=function(e){let t=0;for(let s=0;s<e.length;s++)t=31*t+e.charCodeAt(s)>>>0;let a=s[t%s.length];return{bg:`hsl(${a} 55% 22%)`,ring:`hsl(${a} 60% 45%)`,text:`hsl(${a} 80% 78%)`}}(e),n=Math.max(9,Math.round(.42*a));return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${r}`,style:{width:a,height:a,fontSize:n,backgroundColor:i.bg,borderColor:i.ring,color:i.text},title:e,"aria-hidden":!0,children:e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"})}])},95356,e=>{"use strict";var t=e.i(18050),s=e.i(22016);let a={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function r({variant:e,size:s}){let a={width:s,height:s},i={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",{...i,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",{...i,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",{...i,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",{...i,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",{...i,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",{...i,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",{...i,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"14",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"32",cy:"32",r:"3"})]})})}}function i({variant:e="generic",title:n,sub:l,cta:o,compact:c=!1}){let x=a[e],d=n??x.title,h=l??x.sub;return(0,t.jsxs)("div",{className:`text-center ${c?"py-8":"py-16"} px-4`,role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)(r,{variant:e,size:c?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${c?"text-sm":"text-base"}`,children:d}),h&&(0,t.jsx)("p",{className:`text-gray-500 ${c?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:h}),o&&(0,t.jsx)("div",{className:"mt-4",children:o.href?(0,t.jsxs)(s.default,{href:o.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,t.jsxs)("button",{onClick:o.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}e.s(["EmptyState",0,i,"NodesEmptyState",0,function({hint:e}){return e?.global_count?(0,t.jsx)(i,{variant:"nodes",title:"No agents in this network",sub:`Server has ${e.global_count} nodes globally, but none are registered to the current network. Switch network or contact admin.`}):(0,t.jsxs)("div",{className:"text-center py-16 px-4",role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)("svg",{viewBox:"0 0 64 64",width:56,height:56,children:(0,t.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[(0,t.jsx)("rect",{x:"10",y:"20",width:"44",height:"28",rx:"2"}),(0,t.jsx)("rect",{x:"20",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"32",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"44",y:"32",width:"4",height:"8",opacity:"0.5"}),(0,t.jsx)("line",{x1:"10",y1:"26",x2:"54",y2:"26",opacity:"0.4"}),(0,t.jsx)("circle",{cx:"14",cy:"23",r:"0.8",fill:"currentColor"})]})})}),(0,t.jsx)("h3",{className:"font-medium text-gray-300 text-base",children:"Spin up your first agent"}),(0,t.jsx)("p",{className:"text-gray-500 text-sm mt-2 max-w-md mx-auto leading-relaxed",children:"Run this in a fresh terminal to register an agent with this CommHub:"}),(0,t.jsx)("div",{className:"mt-4 inline-block",children:(0,t.jsx)("code",{className:"anet-empty-cmd block bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-4 py-3 text-xs sm:text-sm text-cyan-300 font-mono select-all",children:"npx --yes @sleep2agi/agent-network init"})}),(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsxs)("a",{href:"https://anet.sh",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-medium text-gray-500 hover:text-cyan-300",children:["Full quickstart guide",(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}])},65822,e=>{"use strict";var t=e.i(83599),s=e.i(58963);let a=async e=>{let t=await fetch(e);if(401===t.status)throw window.location.assign("/login"),Error("unauthorized");return t.json()},r={refreshInterval:5e3,dedupingInterval:3e3};function i(e,t){if(!t)return e;let s=e.includes("?")?"&":"?";return`${e}${s}network_id=${encodeURIComponent(t)}`}e.s(["useAnetConfig",0,function(){let{data:e}=(0,t.default)("/api/anet/config",a,{refreshInterval:3e4});return{config:e||null}},"useHealth",0,function(){let{data:e,error:s}=(0,t.default)("/api/hub/health",a,r);return{health:e||null,error:s}},"useLicense",0,function(){let{data:e,error:s}=(0,t.default)("/api/hub/license",a,{refreshInterval:6e4});return{license:e?.ok?e:null,error:s}},"useMessages",0,function(e=100){let{networkId:n}=(0,s.useNetworkId)(),{data:l,error:o,isLoading:c}=(0,t.default)(i(`/api/hub/messages?limit=${e}`,n),a,r);return{messages:l?.messages||[],error:o,isLoading:c}},"useSessions",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:n,error:l,isLoading:o}=(0,t.default)(i("/api/hub/status",e),a,r);return{sessions:n?.sessions||[],hint:n?._hint,error:l,isLoading:o}},"useStats",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:n,error:l}=(0,t.default)(i("/api/hub/stats",e),a,r);return{stats:n?.ok?n:null,error:l}},"useTasks",0,function(e){let{networkId:n}=(0,s.useNetworkId)(),l=new URLSearchParams({limit:"100",...e}).toString(),{data:o,error:c,isLoading:x}=(0,t.default)(i(`/api/hub/tasks?${l}`,n),a,r);return{tasks:o?.tasks||[],count:o?.count??0,source:o?.source,error:c,isLoading:x}}])},82756,e=>{"use strict";var t=e.i(18050),s=e.i(71645),a=e.i(65822),r=e.i(18150),i=e.i(95356),n=e.i(69874);let l={task:"bg-green-500/10 text-green-300 border-green-500/20",message:"bg-blue-500/10 text-blue-300 border-blue-500/20",broadcast:"bg-purple-500/10 text-purple-300 border-purple-500/20",reply:"bg-cyan-500/10 text-cyan-300 border-cyan-500/20"};function o(e){return e?new Date(e.replace(" ","T")+"Z").getTime():0}function c(e){return"broadcast"===e.type?"broadcast":"dashboard"===(e.from_alias||"").toLowerCase()?"outgoing":"incoming"}function x(e,s){let a=e||"--",r=s.trim();if(!r||r.startsWith("from:"))return a;let i=a.toLowerCase().indexOf(r.toLowerCase());return i<0?a:(0,t.jsxs)(t.Fragment,{children:[a.slice(0,i),(0,t.jsx)("mark",{className:"bg-yellow-500/30 text-yellow-200 rounded px-0.5",children:a.slice(i,i+r.length)}),a.slice(i+r.length)]})}e.s(["default",0,function(){let{messages:e,isLoading:d}=(0,a.useMessages)(200),[h,m]=(0,s.useState)(""),[u,p]=(0,s.useState)(""),[g,y]=(0,s.useState)(!1),[j,b]=(0,s.useState)("timeline"),f=(0,s.useMemo)(()=>{let t=new Set;return e.forEach(e=>{let s=e.from_alias?.trim();s&&"dashboard"!==s.toLowerCase()&&t.add(s)}),[...t].slice(0,8)},[e]),v=(0,s.useMemo)(()=>{let t=u.trim().toLowerCase(),s=t.startsWith("from:")?t.slice(5).trim():"";return[...e].filter(e=>(!h||e.type===h)&&(s?(e.from_alias||"").toLowerCase().includes(s):!t||(e.from_alias||"").toLowerCase().includes(t)||(e.to_alias||"").toLowerCase().includes(t)||(e.content||"").toLowerCase().includes(t))).sort((e,t)=>o(e.created_at)-o(t.created_at))},[h,e,u]),w=(0,s.useMemo)(()=>{let e=new Map;return v.forEach(t=>{let s=t.from_alias||"?",a=t.to_alias||"?",r=[s,a].sort().join("↔"),i=e.get(r)||{participants:[s,a].sort(),messages:[],lastTime:0};i.messages.push(t),i.lastTime=Math.max(i.lastTime,o(t.created_at)),e.set(r,i)}),[...e.values()].sort((e,t)=>t.lastTime-e.lastTime)},[v]);return(0,t.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-white lg:ml-0 ml-10",children:"Messages"}),(0,t.jsx)("span",{className:"text-xs bg-blue-900/30 text-blue-400 px-2 py-0.5 rounded-full border border-blue-800/30",children:e.length}),v.length>0&&(0,t.jsx)("button",{onClick:()=>{let e=v.map(e=>`**${e.from_alias||"?"}** → ${e.to_alias||"?"} (${e.type||"?"}) — ${e.created_at||""}
2
-
3
- ${e.content||"--"}
4
-
5
- ---`).join("\n\n"),t=new Blob([`# Messages Export
6
-
7
- ${e}`],{type:"text/markdown"}),s=URL.createObjectURL(t),a=document.createElement("a");a.href=s,a.download=`messages-${new Date().toISOString().slice(0,10)}.md`,a.click(),URL.revokeObjectURL(s)},className:"text-xs text-gray-500 hover:text-gray-300 border border-gray-700/50 px-2.5 py-1 rounded-lg transition-colors",children:"Export MD"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-3 mb-3",children:[(0,t.jsx)("input",{type:"text",value:u,onChange:e=>p(e.target.value),placeholder:"Search from/to/content or use from:alias",className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-blue-500/50 focus:outline-none w-full sm:w-72"}),(0,t.jsxs)("select",{value:h,onChange:e=>m(e.target.value),className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white focus:border-blue-500/50 focus:outline-none",children:[(0,t.jsx)("option",{value:"",children:"All types"}),(0,t.jsx)("option",{value:"task",children:"task"}),(0,t.jsx)("option",{value:"message",children:"message"}),(0,t.jsx)("option",{value:"broadcast",children:"broadcast"}),(0,t.jsx)("option",{value:"reply",children:"reply"})]}),(0,t.jsx)("div",{className:"flex rounded-lg border border-[#2a2a4a] bg-[#111128] p-0.5",children:["timeline","grouped"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>b(e),className:`rounded-md px-2.5 py-1.5 text-xs transition-colors ${j===e?"bg-cyan-500/10 text-cyan-300":"text-gray-500 hover:text-gray-200"}`,children:"timeline"===e?"Timeline":"Grouped"},e))}),(0,t.jsx)("button",{onClick:()=>y(!g),className:`text-xs px-3 py-2 rounded-lg border transition-colors ${g?"bg-yellow-500/10 text-yellow-300 border-yellow-500/20":"text-gray-500 border-gray-700/50 hover:text-gray-300"}`,children:g?"Debug ON":"Debug"})]}),f.length>0&&(0,t.jsxs)("div",{className:"mb-6 flex flex-wrap gap-2",children:[f.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>p(`from:${e}`),className:`rounded-full border px-3 py-1 text-xs transition-colors ${u===`from:${e}`?"border-cyan-500/30 bg-cyan-500/10 text-cyan-300":"border-[#2a2a4a] bg-[#111128] text-gray-400 hover:text-gray-200"}`,children:["from:",e]},e)),u.startsWith("from:")&&(0,t.jsx)("button",{type:"button",onClick:()=>p(""),className:"rounded-full border border-gray-700 px-3 py-1 text-xs text-gray-500 hover:text-gray-200",children:"Clear"})]}),d?(0,t.jsx)("div",{className:"animate-pulse space-y-3",children:[1,2,3,4,5].map(e=>(0,t.jsx)("div",{className:"h-20 rounded-2xl bg-gray-800/20"},e))}):0===v.length?(0,t.jsx)(i.EmptyState,{variant:"messages"}):"grouped"===j?(0,t.jsx)("div",{className:"space-y-4",children:w.map((e,s)=>(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl overflow-hidden",children:[(0,t.jsxs)("div",{className:"px-4 py-2.5 border-b border-[#2a2a4a] flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.AliasAvatar,{alias:e.participants[0],size:16}),(0,t.jsx)("span",{className:"text-sm text-gray-200 font-medium",children:e.participants[0]}),(0,t.jsx)("span",{className:"text-gray-600 text-xs",children:"↔"}),(0,t.jsx)(n.AliasAvatar,{alias:e.participants[1],size:16}),(0,t.jsx)("span",{className:"text-sm text-gray-200 font-medium",children:e.participants[1]})]}),(0,t.jsxs)("span",{className:"text-[10px] text-gray-600",children:[e.messages.length," messages"]})]}),(0,t.jsx)("div",{className:"px-4 py-2 space-y-2 max-h-64 overflow-y-auto",children:e.messages.map(e=>(0,t.jsxs)("div",{className:"flex items-start gap-2 text-xs py-1",children:[e.from_alias&&(0,t.jsx)(n.AliasAvatar,{alias:e.from_alias,size:14}),(0,t.jsx)("span",{className:"shrink-0 font-medium text-gray-200",children:e.from_alias}),(0,t.jsx)("span",{className:"text-gray-400 flex-1",children:e.content?.slice(0,120)||"--"}),(0,t.jsx)("span",{className:"text-[9px] text-gray-600 shrink-0",children:(0,r.timeAgo)(e.created_at||"")})]},e.id))})]},s))}):(0,t.jsx)("div",{className:"space-y-1",children:v.map((e,s)=>{var a;let i=v[s-1],d=!!i&&o(e.created_at)-o(i.created_at)>3e5,h=c(e),m=!!i&&!d&&c(i)===h&&(i.from_alias||"")===(e.from_alias||"")&&(i.to_alias||"")===(e.to_alias||""),p=e.from_alias||"?";return(0,t.jsxs)("div",{children:[d&&(0,t.jsxs)("div",{className:"my-4 flex items-center gap-3",children:[(0,t.jsx)("div",{className:"h-px flex-1 bg-[#2a2a4a]"}),(0,t.jsx)("div",{className:"text-[11px] text-gray-600",children:(a=e.created_at)?new Date(a.replace(" ","T")+"Z").toLocaleString():"Time gap"}),(0,t.jsx)("div",{className:"h-px flex-1 bg-[#2a2a4a]"})]}),"broadcast"===h?(0,t.jsx)("div",{className:m?"mt-1":"mt-3",children:(0,t.jsxs)("div",{className:"rounded-2xl border border-purple-500/20 bg-purple-500/10 px-4 py-3 shadow-sm w-full",children:[(0,t.jsxs)("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-md border ${l[e.type||""]||"bg-gray-500/10 text-gray-400 border-gray-500/20"}`,children:e.type||"unknown"}),(0,t.jsx)("span",{className:"text-sm font-medium text-purple-200",children:p}),e.to_alias&&(0,t.jsxs)("span",{className:"text-xs text-purple-200/80",children:["to ",e.to_alias]}),"high"===e.priority&&(0,t.jsx)("span",{className:"text-xs text-red-400",children:"HIGH"}),(0,t.jsx)("span",{className:"ml-auto text-xs text-gray-500",children:e.created_at?(0,r.timeAgo)(e.created_at):"--"})]}),(0,t.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-relaxed text-gray-200",children:x(e.content,u)})]})}):(0,t.jsxs)("div",{className:`${m?"mt-1":"mt-3"} flex gap-2 ${"outgoing"===h?"flex-row-reverse":"flex-row"}`,children:[(0,t.jsx)("div",{className:"w-8 shrink-0 pt-1",children:!m&&(0,t.jsx)(n.AliasAvatar,{alias:p,size:32})}),(0,t.jsxs)("div",{className:`min-w-0 max-w-3xl rounded-2xl border px-4 py-3 shadow-sm ${"outgoing"===h?"border-green-500/20 bg-green-500/10":"border-blue-500/20 bg-blue-500/10"}`,children:[!m&&(0,t.jsxs)("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-md border ${l[e.type||""]||"bg-gray-500/10 text-gray-400 border-gray-500/20"}`,children:e.type||"unknown"}),(0,t.jsx)("span",{className:`text-sm font-medium ${"outgoing"===h?"text-green-300":"text-blue-300"}`,children:p}),(0,t.jsx)("span",{className:"text-xs text-gray-600",children:"→"}),(0,t.jsx)("span",{className:"text-sm text-gray-300",children:e.to_alias||"--"}),"high"===e.priority&&(0,t.jsx)("span",{className:"text-xs text-red-400",children:"HIGH"}),(0,t.jsx)("span",{className:"ml-auto text-xs text-gray-500",children:e.created_at?(0,r.timeAgo)(e.created_at):"--"})]}),(0,t.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-relaxed text-gray-200",children:x(e.content,u)}),m&&(0,t.jsx)("div",{className:"mt-1 text-[10px] text-gray-600 text-right",children:e.created_at?(0,r.timeAgo)(e.created_at):""}),g&&(0,t.jsxs)("div",{className:"mt-3 border-t border-white/10 pt-3 text-xs text-gray-500 space-y-1",children:[(0,t.jsxs)("div",{children:["ID: ",e.id]}),e.task_id&&(0,t.jsxs)("div",{children:["Task ID: ",e.task_id]}),(0,t.jsxs)("div",{children:["Created: ",e.created_at]})]})]})]})]},e.id)})})]})}])}]);