@sleep2agi/agent-network-dashboard 0.4.6-preview.41 → 0.4.6-preview.415

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 (545) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +2 -0
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/diagnostics/route-bundle-stats.json +41 -41
  5. package/.next/fallback-build-manifest.json +3 -3
  6. package/.next/prerender-manifest.json +3 -3
  7. package/.next/routes-manifest.json +16 -0
  8. package/.next/server/app/_global-error.html +1 -1
  9. package/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  16. package/.next/server/app/_not-found.html +2 -2
  17. package/.next/server/app/_not-found.rsc +12 -12
  18. package/.next/server/app/_not-found.segments/_full.segment.rsc +12 -12
  19. package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  20. package/.next/server/app/_not-found.segments/_index.segment.rsc +7 -7
  21. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  22. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  23. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  24. package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  25. package/.next/server/app/admin.html +2 -2
  26. package/.next/server/app/admin.rsc +14 -14
  27. package/.next/server/app/admin.segments/_full.segment.rsc +14 -14
  28. package/.next/server/app/admin.segments/_head.segment.rsc +4 -4
  29. package/.next/server/app/admin.segments/_index.segment.rsc +7 -7
  30. package/.next/server/app/admin.segments/_tree.segment.rsc +2 -2
  31. package/.next/server/app/admin.segments/admin/__PAGE__.segment.rsc +4 -4
  32. package/.next/server/app/admin.segments/admin.segment.rsc +3 -3
  33. package/.next/server/app/api/hub/server/[hostname]/agents/route/app-paths-manifest.json +3 -0
  34. package/.next/server/app/api/hub/server/[hostname]/agents/route/build-manifest.json +9 -0
  35. package/.next/server/app/api/hub/server/[hostname]/agents/route/server-reference-manifest.json +4 -0
  36. package/.next/server/app/api/hub/server/[hostname]/agents/route.js +7 -0
  37. package/.next/server/app/api/hub/server/[hostname]/agents/route.js.map +5 -0
  38. package/.next/server/app/api/hub/server/[hostname]/agents/route.js.nft.json +1 -0
  39. package/.next/server/app/api/hub/server/[hostname]/agents/route_client-reference-manifest.js +3 -0
  40. package/.next/server/app/api/hub/server/[hostname]/health/route/app-paths-manifest.json +3 -0
  41. package/.next/server/app/api/hub/server/[hostname]/health/route/build-manifest.json +9 -0
  42. package/.next/server/app/api/hub/server/[hostname]/health/route/server-reference-manifest.json +4 -0
  43. package/.next/server/app/api/hub/server/[hostname]/health/route.js +7 -0
  44. package/.next/server/app/api/hub/server/[hostname]/health/route.js.map +5 -0
  45. package/.next/server/app/api/hub/server/[hostname]/health/route.js.nft.json +1 -0
  46. package/.next/server/app/api/hub/server/[hostname]/health/route_client-reference-manifest.js +3 -0
  47. package/.next/server/app/index.html +2 -2
  48. package/.next/server/app/index.rsc +14 -14
  49. package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  50. package/.next/server/app/index.segments/_full.segment.rsc +14 -14
  51. package/.next/server/app/index.segments/_head.segment.rsc +4 -4
  52. package/.next/server/app/index.segments/_index.segment.rsc +7 -7
  53. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  54. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  55. package/.next/server/app/login.html +2 -2
  56. package/.next/server/app/login.rsc +14 -14
  57. package/.next/server/app/login.segments/_full.segment.rsc +14 -14
  58. package/.next/server/app/login.segments/_head.segment.rsc +4 -4
  59. package/.next/server/app/login.segments/_index.segment.rsc +7 -7
  60. package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  61. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
  62. package/.next/server/app/login.segments/login.segment.rsc +3 -3
  63. package/.next/server/app/logs/page_client-reference-manifest.js +1 -1
  64. package/.next/server/app/logs.html +2 -2
  65. package/.next/server/app/logs.rsc +14 -14
  66. package/.next/server/app/logs.segments/_full.segment.rsc +14 -14
  67. package/.next/server/app/logs.segments/_head.segment.rsc +4 -4
  68. package/.next/server/app/logs.segments/_index.segment.rsc +7 -7
  69. package/.next/server/app/logs.segments/_tree.segment.rsc +2 -2
  70. package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +4 -4
  71. package/.next/server/app/logs.segments/logs.segment.rsc +3 -3
  72. package/.next/server/app/messages/page_client-reference-manifest.js +1 -1
  73. package/.next/server/app/messages.html +2 -2
  74. package/.next/server/app/messages.rsc +14 -14
  75. package/.next/server/app/messages.segments/_full.segment.rsc +14 -14
  76. package/.next/server/app/messages.segments/_head.segment.rsc +4 -4
  77. package/.next/server/app/messages.segments/_index.segment.rsc +7 -7
  78. package/.next/server/app/messages.segments/_tree.segment.rsc +2 -2
  79. package/.next/server/app/messages.segments/messages/__PAGE__.segment.rsc +4 -4
  80. package/.next/server/app/messages.segments/messages.segment.rsc +3 -3
  81. package/.next/server/app/node/page_client-reference-manifest.js +1 -1
  82. package/.next/server/app/node.html +2 -2
  83. package/.next/server/app/node.rsc +14 -14
  84. package/.next/server/app/node.segments/_full.segment.rsc +14 -14
  85. package/.next/server/app/node.segments/_head.segment.rsc +4 -4
  86. package/.next/server/app/node.segments/_index.segment.rsc +7 -7
  87. package/.next/server/app/node.segments/_tree.segment.rsc +2 -2
  88. package/.next/server/app/node.segments/node/__PAGE__.segment.rsc +4 -4
  89. package/.next/server/app/node.segments/node.segment.rsc +3 -3
  90. package/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
  91. package/.next/server/app/nodes.html +2 -2
  92. package/.next/server/app/nodes.rsc +14 -14
  93. package/.next/server/app/nodes.segments/_full.segment.rsc +14 -14
  94. package/.next/server/app/nodes.segments/_head.segment.rsc +4 -4
  95. package/.next/server/app/nodes.segments/_index.segment.rsc +7 -7
  96. package/.next/server/app/nodes.segments/_tree.segment.rsc +2 -2
  97. package/.next/server/app/nodes.segments/nodes/__PAGE__.segment.rsc +4 -4
  98. package/.next/server/app/nodes.segments/nodes.segment.rsc +3 -3
  99. package/.next/server/app/page_client-reference-manifest.js +1 -1
  100. package/.next/server/app/server-logs/page_client-reference-manifest.js +1 -1
  101. package/.next/server/app/server-logs.html +2 -2
  102. package/.next/server/app/server-logs.rsc +14 -14
  103. package/.next/server/app/server-logs.segments/_full.segment.rsc +14 -14
  104. package/.next/server/app/server-logs.segments/_head.segment.rsc +4 -4
  105. package/.next/server/app/server-logs.segments/_index.segment.rsc +7 -7
  106. package/.next/server/app/server-logs.segments/_tree.segment.rsc +2 -2
  107. package/.next/server/app/server-logs.segments/server-logs/__PAGE__.segment.rsc +4 -4
  108. package/.next/server/app/server-logs.segments/server-logs.segment.rsc +3 -3
  109. package/.next/server/app/settings/networks/page_client-reference-manifest.js +1 -1
  110. package/.next/server/app/settings/networks.html +2 -2
  111. package/.next/server/app/settings/networks.rsc +14 -14
  112. package/.next/server/app/settings/networks.segments/_full.segment.rsc +14 -14
  113. package/.next/server/app/settings/networks.segments/_head.segment.rsc +4 -4
  114. package/.next/server/app/settings/networks.segments/_index.segment.rsc +7 -7
  115. package/.next/server/app/settings/networks.segments/_tree.segment.rsc +2 -2
  116. package/.next/server/app/settings/networks.segments/settings/networks/__PAGE__.segment.rsc +4 -4
  117. package/.next/server/app/settings/networks.segments/settings/networks.segment.rsc +3 -3
  118. package/.next/server/app/settings/networks.segments/settings.segment.rsc +3 -3
  119. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  120. package/.next/server/app/settings/tokens/page_client-reference-manifest.js +1 -1
  121. package/.next/server/app/settings/tokens.html +2 -2
  122. package/.next/server/app/settings/tokens.rsc +14 -14
  123. package/.next/server/app/settings/tokens.segments/_full.segment.rsc +14 -14
  124. package/.next/server/app/settings/tokens.segments/_head.segment.rsc +4 -4
  125. package/.next/server/app/settings/tokens.segments/_index.segment.rsc +7 -7
  126. package/.next/server/app/settings/tokens.segments/_tree.segment.rsc +2 -2
  127. package/.next/server/app/settings/tokens.segments/settings/tokens/__PAGE__.segment.rsc +4 -4
  128. package/.next/server/app/settings/tokens.segments/settings/tokens.segment.rsc +3 -3
  129. package/.next/server/app/settings/tokens.segments/settings.segment.rsc +3 -3
  130. package/.next/server/app/settings.html +2 -2
  131. package/.next/server/app/settings.rsc +14 -14
  132. package/.next/server/app/settings.segments/_full.segment.rsc +14 -14
  133. package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
  134. package/.next/server/app/settings.segments/_index.segment.rsc +7 -7
  135. package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  136. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
  137. package/.next/server/app/settings.segments/settings.segment.rsc +3 -3
  138. package/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
  139. package/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
  140. package/.next/server/app/tasks.html +2 -2
  141. package/.next/server/app/tasks.rsc +14 -14
  142. package/.next/server/app/tasks.segments/_full.segment.rsc +14 -14
  143. package/.next/server/app/tasks.segments/_head.segment.rsc +4 -4
  144. package/.next/server/app/tasks.segments/_index.segment.rsc +7 -7
  145. package/.next/server/app/tasks.segments/_tree.segment.rsc +2 -2
  146. package/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +4 -4
  147. package/.next/server/app/tasks.segments/tasks.segment.rsc +3 -3
  148. package/.next/server/app-paths-manifest.json +2 -0
  149. package/.next/server/chunks/0dk5_next-internal_server_app_api_hub_server_[hostname]_agents_route_actions_0vr92s4.js +3 -0
  150. package/.next/server/chunks/0dk5_next-internal_server_app_api_hub_server_[hostname]_agents_route_actions_0vr92s4.js.map +1 -0
  151. package/.next/server/chunks/0dk5_next-internal_server_app_api_hub_server_[hostname]_health_route_actions_0vr-bv5.js +3 -0
  152. package/.next/server/chunks/0dk5_next-internal_server_app_api_hub_server_[hostname]_health_route_actions_0vr-bv5.js.map +1 -0
  153. package/.next/server/chunks/[root-of-the-server]__05nyivw._.js +3 -0
  154. package/.next/server/chunks/[root-of-the-server]__05nyivw._.js.map +1 -0
  155. package/.next/server/chunks/[root-of-the-server]__0floe3h._.js +3 -0
  156. package/.next/server/chunks/[root-of-the-server]__0floe3h._.js.map +1 -0
  157. package/.next/server/chunks/[root-of-the-server]__0tx8s8i._.js +1 -1
  158. package/.next/server/chunks/[root-of-the-server]__0tx8s8i._.js.map +1 -1
  159. package/.next/server/chunks/ssr/[root-of-the-server]__03b.f76._.js +1 -1
  160. package/.next/server/chunks/ssr/[root-of-the-server]__03b.f76._.js.map +1 -1
  161. package/.next/server/chunks/ssr/[root-of-the-server]__0fhoq8i._.js +1 -1
  162. package/.next/server/chunks/ssr/[root-of-the-server]__0fhoq8i._.js.map +1 -1
  163. package/.next/server/chunks/ssr/[root-of-the-server]__0nw~zhp._.js +1 -1
  164. package/.next/server/chunks/ssr/[root-of-the-server]__0nw~zhp._.js.map +1 -1
  165. package/.next/server/chunks/ssr/agent-network-dashboard_09kk21a._.js +4 -1
  166. package/.next/server/chunks/ssr/agent-network-dashboard_09kk21a._.js.map +1 -1
  167. package/.next/server/chunks/ssr/agent-network-dashboard_app_01jhlxz._.js +1 -1
  168. package/.next/server/chunks/ssr/agent-network-dashboard_app_01jhlxz._.js.map +1 -1
  169. package/.next/server/chunks/ssr/agent-network-dashboard_app_057q.ne._.js +1 -1
  170. package/.next/server/chunks/ssr/agent-network-dashboard_app_057q.ne._.js.map +1 -1
  171. package/.next/server/chunks/ssr/agent-network-dashboard_app_09d29my._.js +1 -1
  172. package/.next/server/chunks/ssr/agent-network-dashboard_app_09d29my._.js.map +1 -1
  173. package/.next/server/chunks/ssr/agent-network-dashboard_app_0_d45-d._.js +1 -1
  174. package/.next/server/chunks/ssr/agent-network-dashboard_app_0_d45-d._.js.map +1 -1
  175. package/.next/server/chunks/ssr/agent-network-dashboard_app_0i3759l._.js +1 -1
  176. package/.next/server/chunks/ssr/agent-network-dashboard_app_0i3759l._.js.map +1 -1
  177. package/.next/server/chunks/ssr/agent-network-dashboard_app_0xgney8._.js +1 -1
  178. package/.next/server/chunks/ssr/agent-network-dashboard_app_0xgney8._.js.map +1 -1
  179. package/.next/server/chunks/ssr/agent-network-dashboard_app_10hjgv4._.js +1 -1
  180. package/.next/server/chunks/ssr/agent-network-dashboard_app_10hjgv4._.js.map +1 -1
  181. package/.next/server/chunks/ssr/agent-network-dashboard_app_1153xeb._.js +1 -1
  182. package/.next/server/chunks/ssr/agent-network-dashboard_app_1153xeb._.js.map +1 -1
  183. package/.next/server/chunks/ssr/agent-network-dashboard_app_12l4oto._.js +1 -1
  184. package/.next/server/chunks/ssr/agent-network-dashboard_app_12l4oto._.js.map +1 -1
  185. package/.next/server/chunks/ssr/agent-network-dashboard_app_components_0mvyi-4._.js +1 -1
  186. package/.next/server/chunks/ssr/agent-network-dashboard_app_components_0mvyi-4._.js.map +1 -1
  187. package/.next/server/middleware-build-manifest.js +3 -3
  188. package/.next/server/pages/404.html +2 -2
  189. package/.next/server/pages/500.html +1 -1
  190. package/.next/server/server-reference-manifest.js +1 -1
  191. package/.next/server/server-reference-manifest.json +1 -1
  192. package/.next/static/chunks/0-mpa_947ipeq.js +1 -0
  193. package/.next/static/chunks/01lmbsd37fybu.js +1 -0
  194. package/.next/static/chunks/03o.h6kvmw4l_.js +1 -0
  195. package/.next/static/chunks/03~~oirxz7~vc.js +1 -0
  196. package/.next/static/chunks/05uk96gc~9mni.js +1 -0
  197. package/.next/static/chunks/08kf-.bgs10ze.js +1 -0
  198. package/.next/static/chunks/0_cxs7bhk9fy-.js +1 -0
  199. package/.next/static/chunks/0aauz~36q5n2a.css +2 -0
  200. package/.next/static/chunks/0glmrdj9112tc.js +7 -0
  201. package/.next/static/chunks/0l_~q07bhpkcx.js +7 -0
  202. package/.next/static/chunks/0rxrez_cjn.eh.js +1 -0
  203. package/.next/static/chunks/0s7~zeuhn0t35.js +4 -0
  204. package/.next/static/chunks/0vo1q0pvypqub.js +1 -0
  205. package/.next/static/chunks/0x8x.29hkju5a.js +1 -0
  206. package/.next/static/chunks/174re5ar~kxne.js +1 -0
  207. package/.next/trace +2 -2
  208. package/.next/trace-build +1 -1
  209. package/.next/types/routes.d.ts +3 -1
  210. package/.next/types/validator.ts +18 -0
  211. package/app/api/hub/server/[hostname]/agents/route.ts +62 -0
  212. package/app/api/hub/server/[hostname]/health/route.ts +58 -0
  213. package/app/api/hub/servers/route.ts +88 -1
  214. package/app/components/ChatPopover.tsx +38 -2
  215. package/app/components/CommandPalette.tsx +107 -0
  216. package/app/components/HelpOverlay.tsx +109 -1
  217. package/app/components/ServersDrawer.tsx +181 -5
  218. package/app/components/TopoGraph.tsx +6552 -282
  219. package/app/components/utils.ts +8 -7
  220. package/app/globals.css +110 -5
  221. package/app/lib/time.ts +36 -0
  222. package/app/lib/vendorIdentity.ts +14 -3
  223. package/docs/rfc/v0.10.0-hero3-dashboard-upgrade.md +230 -0
  224. package/package.json +2 -2
  225. package/public/sleep2agi-logo.svg +11 -0
  226. package/public/vendors/claude.svg +11 -0
  227. package/public/vendors/minimax.svg +11 -0
  228. package/public/vendors/openai.svg +12 -0
  229. package/screenshots/r293-p0/after-full.png +0 -0
  230. package/screenshots/r293-p0/after-topo.png +0 -0
  231. package/screenshots/r293-p0/baseline-full.png +0 -0
  232. package/screenshots/r293-p0/baseline-topo.png +0 -0
  233. package/screenshots/r293-p0/logo-integrated-full.png +0 -0
  234. package/screenshots/r293-p0/logo-integrated-topo.png +0 -0
  235. package/screenshots/r293-p0/servers-drawer-v0.10.0-full.png +0 -0
  236. package/screenshots/r293-p0/servers-drawer-v0.10.0.png +0 -0
  237. package/screenshots/r293-p0/wave1-after-full.png +0 -0
  238. package/screenshots/r293-p0/wave1-after-topo.png +0 -0
  239. package/scripts/p0-servers-drawer-screenshot.mjs +99 -0
  240. package/scripts/p0-topo-screenshot.mjs +82 -0
  241. package/scripts/topo-active-filter-pill-test.mjs +101 -0
  242. package/scripts/topo-active-links-chip-hover-test.mjs +103 -0
  243. package/scripts/topo-active-links-chip-nav-test.mjs +117 -0
  244. package/scripts/topo-active-links-chip-self-hover-test.mjs +171 -0
  245. package/scripts/topo-active-links-chip-test.mjs +73 -0
  246. package/scripts/topo-active-links-empty-recede-test.mjs +125 -0
  247. package/scripts/topo-active-links-freshness-test.mjs +113 -0
  248. package/scripts/topo-active-links-tooltip-test.mjs +79 -0
  249. package/scripts/topo-active-pulse-ease-test.mjs +120 -0
  250. package/scripts/topo-brand-logo-transition-test.mjs +94 -0
  251. package/scripts/topo-brand-watermark-test.mjs +97 -0
  252. package/scripts/topo-canvas-aria-test.mjs +108 -0
  253. package/scripts/topo-canvas-brand-fade-test.mjs +87 -0
  254. package/scripts/topo-chat-target-breath-test.mjs +84 -0
  255. package/scripts/topo-chat-target-ring-ease-test.mjs +82 -0
  256. package/scripts/topo-chat-target-ring-fade-test.mjs +124 -0
  257. package/scripts/topo-chip-empty-recede-test.mjs +116 -0
  258. package/scripts/topo-chip-focus-test.mjs +95 -0
  259. package/scripts/topo-chip-pin-mirror-test.mjs +113 -0
  260. package/scripts/topo-chip-row-gap-test.mjs +90 -0
  261. package/scripts/topo-chip-row-semantic-gap-test.mjs +97 -0
  262. package/scripts/topo-chip-row-tabular-test.mjs +111 -0
  263. package/scripts/topo-chip-unit-demotion-test.mjs +93 -0
  264. package/scripts/topo-chiprow-data-weight-test.mjs +94 -0
  265. package/scripts/topo-chrome-a11y-test.mjs +107 -0
  266. package/scripts/topo-chrome-active-weight-test.mjs +104 -0
  267. package/scripts/topo-chrome-focus-ring-unify-test.mjs +100 -0
  268. package/scripts/topo-chrome-gap-test.mjs +73 -0
  269. package/scripts/topo-chrome-icon-stroke-test.mjs +95 -0
  270. package/scripts/topo-chrome-inactive-color-test.mjs +90 -0
  271. package/scripts/topo-chrome-pop-extension-test.mjs +98 -0
  272. package/scripts/topo-chrome-pop-nodesize-test.mjs +88 -0
  273. package/scripts/topo-chrome-press-state-test.mjs +135 -0
  274. package/scripts/topo-chrome-strip-semantic-gap-test.mjs +99 -0
  275. package/scripts/topo-chrome-strip-theme-ease-test.mjs +99 -0
  276. package/scripts/topo-chrome-zoom-level-pop-test.mjs +122 -0
  277. package/scripts/topo-chrome-zoom-pop-test.mjs +130 -0
  278. package/scripts/topo-chrome-zoom-readout-weight-test.mjs +81 -0
  279. package/scripts/topo-click-ripple-ease-test.mjs +94 -0
  280. package/scripts/topo-cmdk-edge-clear-test.mjs +109 -0
  281. package/scripts/topo-cmdk-layout-view-test.mjs +108 -0
  282. package/scripts/topo-cmdk-pin-test.mjs +123 -0
  283. package/scripts/topo-cmdk-vendor-clear-test.mjs +133 -0
  284. package/scripts/topo-cmdk-vendor-pin-test.mjs +103 -0
  285. package/scripts/topo-corner-radius-unify-test.mjs +103 -0
  286. package/scripts/topo-dblclick-reset-test.mjs +74 -0
  287. package/scripts/topo-dense-alias-fill-transition-test.mjs +133 -0
  288. package/scripts/topo-discrete-zoom-smooth-test.mjs +125 -0
  289. package/scripts/topo-edge-badge-click-pin-test.mjs +94 -0
  290. package/scripts/topo-edge-badge-crossfade-test.mjs +138 -0
  291. package/scripts/topo-edge-badge-hot-test.mjs +115 -0
  292. package/scripts/topo-edge-badge-hover-test.mjs +85 -0
  293. package/scripts/topo-edge-badge-lift-test.mjs +150 -0
  294. package/scripts/topo-edge-badge-ripple-test.mjs +111 -0
  295. package/scripts/topo-edge-badge-stroke-transition-test.mjs +118 -0
  296. package/scripts/topo-edge-badge-text-pin-test.mjs +121 -0
  297. package/scripts/topo-edge-badge-theme-ease-test.mjs +89 -0
  298. package/scripts/topo-edge-count-badge-test.mjs +86 -0
  299. package/scripts/topo-edge-endpoint-highlight-test.mjs +111 -0
  300. package/scripts/topo-edge-fadein-test.mjs +106 -0
  301. package/scripts/topo-edge-focus-test.mjs +113 -0
  302. package/scripts/topo-edge-hover-test.mjs +93 -0
  303. package/scripts/topo-edge-pill-hot-test.mjs +129 -0
  304. package/scripts/topo-edge-pill-test.mjs +105 -0
  305. package/scripts/topo-edge-ping-pulse-retired-test.mjs +119 -0
  306. package/scripts/topo-edge-stroke-ease-test.mjs +100 -0
  307. package/scripts/topo-edge-stroke-transition-test.mjs +132 -0
  308. package/scripts/topo-edge-tooltip-test.mjs +70 -0
  309. package/scripts/topo-empty-hint-tracking-test.mjs +84 -0
  310. package/scripts/topo-empty-state-breath-test.mjs +150 -0
  311. package/scripts/topo-empty-state-crossfade-test.mjs +130 -0
  312. package/scripts/topo-empty-state-recenter-test.mjs +107 -0
  313. package/scripts/topo-empty-subhint-tracking-test.mjs +87 -0
  314. package/scripts/topo-endpoint-ring-fade-test.mjs +132 -0
  315. package/scripts/topo-endpoint-ring-test.mjs +93 -0
  316. package/scripts/topo-endpoint-ring-thicken-test.mjs +112 -0
  317. package/scripts/topo-esc-clears-pin-test.mjs +98 -0
  318. package/scripts/topo-filter-pill-aliases-test.mjs +121 -0
  319. package/scripts/topo-filter-pill-body-click-test.mjs +112 -0
  320. package/scripts/topo-filter-pill-count-tabular-test.mjs +135 -0
  321. package/scripts/topo-filter-pill-count-test.mjs +110 -0
  322. package/scripts/topo-filter-pill-mobile-test.mjs +90 -0
  323. package/scripts/topo-freshness-chip-test.mjs +74 -0
  324. package/scripts/topo-freshness-chip-transition-test.mjs +80 -0
  325. package/scripts/topo-freshness-chip-weight-test.mjs +90 -0
  326. package/scripts/topo-freshness-conditional-render-test.mjs +92 -0
  327. package/scripts/topo-fullscreen-active-test.mjs +115 -0
  328. package/scripts/topo-group-box-pinned-state-test.mjs +95 -0
  329. package/scripts/topo-group-count-test.mjs +6 -1
  330. package/scripts/topo-group-label-a11y-test.mjs +113 -0
  331. package/scripts/topo-group-label-count-inherit-test.mjs +99 -0
  332. package/scripts/topo-group-label-hover-test.mjs +119 -0
  333. package/scripts/topo-group-label-pin-spacing-test.mjs +136 -0
  334. package/scripts/topo-group-label-tint-test.mjs +99 -0
  335. package/scripts/topo-group-label-title-test.mjs +83 -0
  336. package/scripts/topo-group-pin-test.mjs +119 -0
  337. package/scripts/topo-group-pip-fadein-test.mjs +104 -0
  338. package/scripts/topo-group-pip-singletier-drop-test.mjs +131 -0
  339. package/scripts/topo-group-pip-tabular-test.mjs +95 -0
  340. package/scripts/topo-group-status-pips-test.mjs +103 -0
  341. package/scripts/topo-groupbox-fadein-test.mjs +95 -0
  342. package/scripts/topo-groupbox-hover-lift-test.mjs +127 -0
  343. package/scripts/topo-groupbox-hubcore-ease-test.mjs +106 -0
  344. package/scripts/topo-groupbox-live-test.mjs +100 -0
  345. package/scripts/topo-groupbox-march-busyness-test.mjs +155 -0
  346. package/scripts/topo-groupbox-test.mjs +4 -2
  347. package/scripts/topo-header-gap-test.mjs +94 -0
  348. package/scripts/topo-help-overlay-r109-test.mjs +67 -0
  349. package/scripts/topo-help-overlay-r118-test.mjs +69 -0
  350. package/scripts/topo-help-overlay-r123-test.mjs +69 -0
  351. package/scripts/topo-help-overlay-r134-test.mjs +74 -0
  352. package/scripts/topo-help-overlay-r137-test.mjs +81 -0
  353. package/scripts/topo-help-overlay-r141-test.mjs +86 -0
  354. package/scripts/topo-help-overlay-r153-test.mjs +85 -0
  355. package/scripts/topo-help-overlay-r59-test.mjs +67 -0
  356. package/scripts/topo-help-overlay-r65-test.mjs +64 -0
  357. package/scripts/topo-help-overlay-r70-test.mjs +63 -0
  358. package/scripts/topo-help-overlay-r78-test.mjs +59 -0
  359. package/scripts/topo-help-overlay-r81-test.mjs +58 -0
  360. package/scripts/topo-help-overlay-r87-test.mjs +64 -0
  361. package/scripts/topo-help-overlay-r91-test.mjs +65 -0
  362. package/scripts/topo-hot-tail-crossfade-test.mjs +117 -0
  363. package/scripts/topo-html-overlay-padding-unify-test.mjs +120 -0
  364. package/scripts/topo-hub-a11y-test.mjs +112 -0
  365. package/scripts/topo-hub-busyness-test.mjs +100 -0
  366. package/scripts/topo-hub-center-crossfade-test.mjs +124 -0
  367. package/scripts/topo-hub-click-fit-test.mjs +137 -0
  368. package/scripts/topo-hub-digit-scale-test.mjs +129 -0
  369. package/scripts/topo-hub-fadein-test.mjs +88 -0
  370. package/scripts/topo-hub-hover-lift-test.mjs +101 -0
  371. package/scripts/topo-hub-hover-ring-test.mjs +82 -0
  372. package/scripts/topo-hub-pip-theme-ease-test.mjs +116 -0
  373. package/scripts/topo-hub-spoke-ease-test.mjs +120 -0
  374. package/scripts/topo-hub-title-test.mjs +93 -0
  375. package/scripts/topo-hub-working-count-test.mjs +99 -0
  376. package/scripts/topo-ingroup-edge-test.mjs +103 -0
  377. package/scripts/topo-inner-radar-ring-retired-test.mjs +89 -0
  378. package/scripts/topo-kicker-color-test.mjs +93 -0
  379. package/scripts/topo-kicker-tracking-test.mjs +101 -0
  380. package/scripts/topo-kicker-weight-test.mjs +98 -0
  381. package/scripts/topo-label-card-theme-ease-test.mjs +85 -0
  382. package/scripts/topo-label-lift-test.mjs +5 -1
  383. package/scripts/topo-layout-hover-text-preview-test.mjs +101 -0
  384. package/scripts/topo-layout-switch-crossfade-test.mjs +126 -0
  385. package/scripts/topo-layout-toggle-border-unify-test.mjs +104 -0
  386. package/scripts/topo-layout-toggle-test.mjs +131 -0
  387. package/scripts/topo-layout-trailer-mr-test.mjs +82 -0
  388. package/scripts/topo-legend-compress-test.mjs +107 -0
  389. package/scripts/topo-legend-count-empty-test.mjs +126 -0
  390. package/scripts/topo-legend-count-tabular-parity-test.mjs +90 -0
  391. package/scripts/topo-legend-count-tabular-test.mjs +87 -0
  392. package/scripts/topo-legend-count-test.mjs +88 -0
  393. package/scripts/topo-legend-count-tier-fill-test.mjs +121 -0
  394. package/scripts/topo-legend-count-weight-test.mjs +86 -0
  395. package/scripts/topo-legend-header-symmetric-inset-test.mjs +112 -0
  396. package/scripts/topo-legend-hitbox-swatch-center-test.mjs +93 -0
  397. package/scripts/topo-legend-hover-test.mjs +113 -0
  398. package/scripts/topo-legend-offline-delimiter-test.mjs +84 -0
  399. package/scripts/topo-legend-offline-label-simplify-test.mjs +86 -0
  400. package/scripts/topo-legend-panel-count-weight-test.mjs +89 -0
  401. package/scripts/topo-legend-panel-header-test.mjs +83 -0
  402. package/scripts/topo-legend-pin-ring-fade-test.mjs +112 -0
  403. package/scripts/topo-legend-pin-test.mjs +128 -0
  404. package/scripts/topo-legend-row-hover-lift-test.mjs +109 -0
  405. package/scripts/topo-legend-row-labels-simplify-test.mjs +80 -0
  406. package/scripts/topo-legend-row-pin-spacing-test.mjs +124 -0
  407. package/scripts/topo-legend-row-tint-test.mjs +95 -0
  408. package/scripts/topo-legend-row-title-test.mjs +102 -0
  409. package/scripts/topo-legend-swatch-grow-test.mjs +116 -0
  410. package/scripts/topo-legend-swatch-radius-test.mjs +78 -0
  411. package/scripts/topo-minimap-a11y-test.mjs +101 -0
  412. package/scripts/topo-minimap-dot-transition-test.mjs +113 -0
  413. package/scripts/topo-minimap-radius-test.mjs +88 -0
  414. package/scripts/topo-minimap-rect-stroke-test.mjs +94 -0
  415. package/scripts/topo-minimap-viewport-smooth-test.mjs +124 -0
  416. package/scripts/topo-mobile-chips-test.mjs +103 -0
  417. package/scripts/topo-monogram-font-test.mjs +112 -0
  418. package/scripts/topo-monogram-stroke-test.mjs +101 -0
  419. package/scripts/topo-more-flows-letterspacing-test.mjs +111 -0
  420. package/scripts/topo-node-a11y-test.mjs +107 -0
  421. package/scripts/topo-node-alias-chat-pin-test.mjs +95 -0
  422. package/scripts/topo-node-hover-lift-test.mjs +85 -0
  423. package/scripts/topo-node-label-card-elevation-test.mjs +157 -0
  424. package/scripts/topo-node-label-card-stroke-test.mjs +135 -0
  425. package/scripts/topo-node-stroke-transition-test.mjs +103 -0
  426. package/scripts/topo-node-text-fill-transition-test.mjs +119 -0
  427. package/scripts/topo-node-title-peers-test.mjs +107 -0
  428. package/scripts/topo-node-title-test.mjs +101 -0
  429. package/scripts/topo-nodesize-active-hover-test.mjs +109 -0
  430. package/scripts/topo-nodesize-crossfade-test.mjs +141 -0
  431. package/scripts/topo-online-chip-nav-test.mjs +143 -0
  432. package/scripts/topo-orbit-particles-retired-test.mjs +91 -0
  433. package/scripts/topo-panel-count-unit-test.mjs +112 -0
  434. package/scripts/topo-panel-elevation-test.mjs +76 -0
  435. package/scripts/topo-panel-fadein-test.mjs +102 -0
  436. package/scripts/topo-panel-hot-tail-fade-test.mjs +132 -0
  437. package/scripts/topo-panel-hover-elevation-test.mjs +118 -0
  438. package/scripts/topo-panel-rx-test.mjs +90 -0
  439. package/scripts/topo-panel-theme-ease-test.mjs +85 -0
  440. package/scripts/topo-panel-title-fill-ease-test.mjs +91 -0
  441. package/scripts/topo-panel-title-tracking-test.mjs +78 -0
  442. package/scripts/topo-particle-stagger-test.mjs +82 -0
  443. package/scripts/topo-pin-intersection-color-ease-test.mjs +111 -0
  444. package/scripts/topo-pin-intersection-empty-test.mjs +129 -0
  445. package/scripts/topo-pin-intersection-tabular-test.mjs +96 -0
  446. package/scripts/topo-pin-intersection-test.mjs +121 -0
  447. package/scripts/topo-pin-intersection-warning-crossfade-test.mjs +107 -0
  448. package/scripts/topo-pin-mirror-transition-test.mjs +101 -0
  449. package/scripts/topo-pin-persistence-test.mjs +105 -0
  450. package/scripts/topo-popover-meta-test.mjs +78 -0
  451. package/scripts/topo-prefix-opacity-test.mjs +107 -0
  452. package/scripts/topo-prepublish-guard-test.mjs +95 -0
  453. package/scripts/topo-pressure-hover-test.mjs +123 -0
  454. package/scripts/topo-pressure-pin-test.mjs +119 -0
  455. package/scripts/topo-pressure-seg-self-hover-test.mjs +126 -0
  456. package/scripts/topo-pressure-seg-tooltip-test.mjs +98 -0
  457. package/scripts/topo-pressure-seg-transition-test.mjs +107 -0
  458. package/scripts/topo-pulse-dot-crossfade-test.mjs +122 -0
  459. package/scripts/topo-pulse-dot-retired-test.mjs +86 -0
  460. package/scripts/topo-recent-panel-count-freshness-test.mjs +109 -0
  461. package/scripts/topo-recent-panel-count-test.mjs +72 -0
  462. package/scripts/topo-recent-panel-count-weight-test.mjs +91 -0
  463. package/scripts/topo-recent-panel-footer-breath-test.mjs +142 -0
  464. package/scripts/topo-recent-panel-hot-header-test.mjs +132 -0
  465. package/scripts/topo-recent-panel-hot-tabular-test.mjs +113 -0
  466. package/scripts/topo-recent-panel-more-crossfade-test.mjs +124 -0
  467. package/scripts/topo-recent-panel-more-cyan-hover-test.mjs +151 -0
  468. package/scripts/topo-recent-panel-more-nav-test.mjs +127 -0
  469. package/scripts/topo-recent-panel-more-test.mjs +106 -0
  470. package/scripts/topo-recent-panel-readability-bump-test.mjs +151 -0
  471. package/scripts/topo-recent-row-count-fill-test.mjs +129 -0
  472. package/scripts/topo-recent-row-count-weight-test.mjs +112 -0
  473. package/scripts/topo-recent-row-fadein-test.mjs +107 -0
  474. package/scripts/topo-recent-row-freshness-test.mjs +102 -0
  475. package/scripts/topo-recent-row-hot-test.mjs +110 -0
  476. package/scripts/topo-recent-row-hover-lift-test.mjs +128 -0
  477. package/scripts/topo-recent-row-hover-test.mjs +122 -0
  478. package/scripts/topo-recent-row-pin-spacing-test.mjs +137 -0
  479. package/scripts/topo-recent-row-pin-test.mjs +126 -0
  480. package/scripts/topo-recent-row-tint-test.mjs +91 -0
  481. package/scripts/topo-recent-row-title-test.mjs +112 -0
  482. package/scripts/topo-recent-row-ts-alpha-test.mjs +100 -0
  483. package/scripts/topo-recent-row-ts-tabular-test.mjs +108 -0
  484. package/scripts/topo-recent-row-ts-test.mjs +95 -0
  485. package/scripts/topo-recent-row-typography-test.mjs +119 -0
  486. package/scripts/topo-recent-signal-empty-hint-test.mjs +73 -0
  487. package/scripts/topo-recent-signal-empty-test.mjs +63 -0
  488. package/scripts/topo-reduced-motion-test.mjs +77 -0
  489. package/scripts/topo-reset-spin-test.mjs +120 -0
  490. package/scripts/topo-runtime-badge-grow-test.mjs +114 -0
  491. package/scripts/topo-spokes-retired-test.mjs +93 -0
  492. package/scripts/topo-starfield-density-test.mjs +89 -0
  493. package/scripts/topo-status-chip-hover-test.mjs +101 -0
  494. package/scripts/topo-status-chip-tooltip-test.mjs +95 -0
  495. package/scripts/topo-statusbar-chips-self-hover-test.mjs +177 -0
  496. package/scripts/topo-svg-focus-test.mjs +112 -0
  497. package/scripts/topo-sweep-busyness-test.mjs +94 -0
  498. package/scripts/topo-tabular-nums-sweep-test.mjs +93 -0
  499. package/scripts/topo-tier-guide-dashes-test.mjs +86 -0
  500. package/scripts/topo-tier-ring-fadein-test.mjs +107 -0
  501. package/scripts/topo-tier-ring-occupancy-test.mjs +87 -0
  502. package/scripts/topo-tier-ring-test.mjs +69 -0
  503. package/scripts/topo-tier-ring-tint-test.mjs +110 -0
  504. package/scripts/topo-tier-stagger-test.mjs +89 -0
  505. package/scripts/topo-title-block-tight-leading-test.mjs +95 -0
  506. package/scripts/topo-title-tracking-test.mjs +98 -0
  507. package/scripts/topo-titleblock-gap-test.mjs +86 -0
  508. package/scripts/topo-titleblock-margin-test.mjs +83 -0
  509. package/scripts/topo-toggle-inactive-cyan-hover-test.mjs +110 -0
  510. package/scripts/topo-top-rail-theme-ease-test.mjs +89 -0
  511. package/scripts/topo-tz-ghost-test.mjs +69 -0
  512. package/scripts/topo-vendor-chip-hover-test.mjs +111 -0
  513. package/scripts/topo-vendor-chip-self-hover-test.mjs +131 -0
  514. package/scripts/topo-vendor-chip-tabular-test.mjs +92 -0
  515. package/scripts/topo-vendor-chip-threshold-test.mjs +78 -0
  516. package/scripts/topo-vendor-chip-weight-test.mjs +87 -0
  517. package/scripts/topo-vendor-count-suffix-test.mjs +95 -0
  518. package/scripts/topo-vendor-letter-tooltip-test.mjs +92 -0
  519. package/scripts/topo-vendor-pill-test.mjs +125 -0
  520. package/scripts/topo-vendor-pin-test.mjs +125 -0
  521. package/scripts/topo-view-smooth-test.mjs +131 -0
  522. package/scripts/topo-watermark-tracking-test.mjs +99 -0
  523. package/scripts/topo-working-chip-pin-test.mjs +154 -0
  524. package/scripts/topo-working-halo-breath-retired-test.mjs +99 -0
  525. package/scripts/topo-wrapper-flow-arrow-theme-test.mjs +97 -0
  526. package/scripts/topo-wrapper-radius-test.mjs +73 -0
  527. package/scripts/topo-wrapper-shadow-theme-ease-test.mjs +89 -0
  528. package/.next/static/chunks/0-7iowzu4.798.js +0 -1
  529. package/.next/static/chunks/02t5jr4shh.hy.js +0 -1
  530. package/.next/static/chunks/0_qfg5s5uzs7..js +0 -7
  531. package/.next/static/chunks/0elalb9n_.~di.js +0 -1
  532. package/.next/static/chunks/0j_q__o8p6g83.js +0 -1
  533. package/.next/static/chunks/0jl6_w50zh4l5.js +0 -1
  534. package/.next/static/chunks/0mqwn-l7wtcdo.js +0 -7
  535. package/.next/static/chunks/0r4q73.-1bkyl.js +0 -1
  536. package/.next/static/chunks/0r_c8eccg3z2o.js +0 -1
  537. package/.next/static/chunks/0tz5gaflhax.o.js +0 -1
  538. package/.next/static/chunks/10kk9kuoj0ns9.js +0 -1
  539. package/.next/static/chunks/10oi7l-tycgl9.js +0 -1
  540. package/.next/static/chunks/11l042tnn68ye.js +0 -1
  541. package/.next/static/chunks/11uk1izuv3~0t.js +0 -1
  542. package/.next/static/chunks/13.zti9ix.1eh.css +0 -2
  543. /package/.next/static/{zYWeA6KAnt4mH1Rredbmu → BR2xyE5iCb0X3_HnGmumr}/_buildManifest.js +0 -0
  544. /package/.next/static/{zYWeA6KAnt4mH1Rredbmu → BR2xyE5iCb0X3_HnGmumr}/_clientMiddlewareManifest.js +0 -0
  545. /package/.next/static/{zYWeA6KAnt4mH1Rredbmu → BR2xyE5iCb0X3_HnGmumr}/_ssgManifest.js +0 -0
@@ -0,0 +1,97 @@
1
+ /* Round 254 verification: three remaining theme-toggle snaps closed:
2
+ *
3
+ * 1. Top-level TopoGraph wrapper <div> — biggest theme-driven
4
+ * surface (whole canvas bg + border). Probe via [data-topo-svg]
5
+ * ancestor chain; the wrapper has ref={containerRef} but no
6
+ * data attr, so we look up via a known descendant.
7
+ * 2. Legend flow-arrow swatch <path> — added data-legend-flow-arrow.
8
+ * 3. Minimap container (only mounts when view is zoomed/panned) —
9
+ * programmatically zoom in to render minimap, then probe.
10
+ *
11
+ * Test scope:
12
+ * - Container has background-color + border-color transition 200ms
13
+ * - Flow-arrow swatch has stroke 200ms in style.transition
14
+ * - Minimap container has background-color + border-color + color
15
+ * transition 200ms
16
+ */
17
+ import { chromium } from 'playwright';
18
+ import { readFileSync } from 'node:fs';
19
+
20
+ const TOKEN = JSON.parse(readFileSync('/home/vansin/.anet/config.json', 'utf8')).token;
21
+ const browser = await chromium.launch({ headless: true });
22
+ const ctx = await browser.newContext({ viewport: { width: 1500, height: 1500 } });
23
+ await ctx.addCookies([{ name: 'anet_dashboard_session', value: `v3:${TOKEN}`, domain: '127.0.0.1', path: '/' }]);
24
+ await ctx.addInitScript(() => {
25
+ try { localStorage.setItem('anet-theme', 'cyber'); sessionStorage.setItem('anet_v3_auth', '1'); } catch {}
26
+ });
27
+ const fresh = new Date(Date.now() - 60 * 1000).toISOString();
28
+ await ctx.route('**/api/hub/status*', async (route) => {
29
+ const r = await route.fetch();
30
+ const b = await r.json();
31
+ const nid = (b.sessions || [])[0]?.network_id || 'default';
32
+ const mk = (alias) => ({
33
+ alias, status: 'working', model: 'claude-opus-4', runtime: 'claude-code-cli',
34
+ network_id: nid, project_dir: null,
35
+ created_at: fresh, updated_at: fresh, last_seen_at: fresh,
36
+ });
37
+ await route.fulfill({ response: r, json: { ...b, sessions: [
38
+ mk('alpha'), mk('beta'), mk('gamma'), mk('delta'),
39
+ ] } });
40
+ });
41
+ await ctx.route('**/api/hub/messages*', (r2) => r2.fulfill({ json: { messages: [] } }));
42
+ await ctx.route('**/api/hub/tasks*', (r2) => r2.fulfill({ json: { tasks: [] } }));
43
+
44
+ const page = await ctx.newPage();
45
+ await page.goto('http://127.0.0.1:3000/', { waitUntil: 'domcontentloaded' });
46
+ await page.waitForFunction(() => document.querySelectorAll('g[data-node]').length === 4, { timeout: 30000 });
47
+ await page.waitForSelector('[data-legend-flow-arrow]', { timeout: 10000 });
48
+ await page.waitForTimeout(300);
49
+
50
+ // Probe wrapper + flow arrow first
51
+ const baseline = await page.evaluate(() => {
52
+ const flowArrow = document.querySelector('[data-legend-flow-arrow]');
53
+ // Wrapper: the TopoGraph component's outer div sits as the
54
+ // grandparent of <svg> with the topo-panel rect inside. Use a
55
+ // robust climb from a known SVG element.
56
+ const wrapper = document.querySelector('[data-topo-wrapper]');
57
+ return {
58
+ wrapper: wrapper ? { transition: wrapper.style.transition } : null,
59
+ flowArrow: flowArrow ? { transition: flowArrow.style.transition } : null,
60
+ };
61
+ });
62
+
63
+ // Trigger minimap render — programmatically pan/zoom view via the
64
+ // reset button toggle or just dispatch a wheel event. Simpler:
65
+ // click the zoom-in button several times.
66
+ for (let i = 0; i < 3; i++) {
67
+ await page.locator('[data-topo-chrome-zoom-in]').click();
68
+ await page.waitForTimeout(120);
69
+ }
70
+ await page.waitForSelector('[data-topo-minimap]', { timeout: 5000 });
71
+ await page.waitForTimeout(300);
72
+ const minimap = await page.evaluate(() => {
73
+ const mm = document.querySelector('[data-topo-minimap]');
74
+ return mm ? { transition: mm.style.transition } : null;
75
+ });
76
+ await browser.close();
77
+
78
+ const has = (s, prop) => new RegExp(`${prop}\\s+(?:200ms|0\\.2s)`).test(s || '');
79
+
80
+ const results = {
81
+ wrapper_present: baseline.wrapper !== null,
82
+ wrapper_has_bg_color_200: has(baseline.wrapper?.transition, 'background-color'),
83
+ wrapper_has_border_color_200: has(baseline.wrapper?.transition, 'border-color'),
84
+
85
+ flow_arrow_present: baseline.flowArrow !== null,
86
+ flow_arrow_has_stroke_200: has(baseline.flowArrow?.transition, 'stroke'),
87
+
88
+ minimap_present: minimap !== null,
89
+ minimap_has_bg_color_200: has(minimap?.transition, 'background-color'),
90
+ minimap_has_border_color_200: has(minimap?.transition, 'border-color'),
91
+ minimap_has_color_200: has(minimap?.transition, '(?<!background-|border-)color'),
92
+ };
93
+ const ok = Object.values(results).every(Boolean);
94
+ console.log(`${ok ? '✅' : '❌'} wrapper + flow-arrow + minimap theme ease:`, JSON.stringify(results),
95
+ '\n baseline:', baseline,
96
+ '\n minimap:', minimap);
97
+ process.exit(ok ? 0 : 1);
@@ -0,0 +1,73 @@
1
+ /* Round 330 verification (milestone): canvas wrapper rounded-lg →
2
+ * rounded-xl (8px → 12px corner radius). The largest single surface
3
+ * on the dashboard now reads contemporary rather than conservative.
4
+ *
5
+ * Contract:
6
+ * - [data-topo-wrapper] className contains 'rounded-xl' (not
7
+ * 'rounded-lg').
8
+ * - Computed border-top-left-radius === '12px'.
9
+ * - R263 box-shadow transition still in inline transition list
10
+ * (regression: theme-toggle continues to ease).
11
+ * - R317 / R318 / R294 chrome + pulse regressions intact.
12
+ */
13
+ import { chromium } from 'playwright';
14
+ import { readFileSync } from 'node:fs';
15
+
16
+ const TOKEN = JSON.parse(readFileSync('/home/vansin/.anet/config.json', 'utf8')).token;
17
+ const browser = await chromium.launch({ headless: true });
18
+ const ctx = await browser.newContext({ viewport: { width: 1500, height: 1500 } });
19
+ await ctx.addCookies([{ name: 'anet_dashboard_session', value: `v3:${TOKEN}`, domain: '127.0.0.1', path: '/' }]);
20
+ await ctx.addInitScript(() => {
21
+ try { localStorage.setItem('anet-theme', 'cyber'); sessionStorage.setItem('anet_v3_auth', '1'); } catch {}
22
+ });
23
+ const fresh = new Date(Date.now() - 60 * 1000).toISOString();
24
+ await ctx.route('**/api/hub/status*', async (route) => {
25
+ const r = await route.fetch();
26
+ const b = await r.json();
27
+ const nid = (b.sessions || [])[0]?.network_id || 'default';
28
+ const mk = (alias) => ({
29
+ alias, status: 'working', model: 'claude-opus-4', runtime: 'claude-code-cli',
30
+ network_id: nid, project_dir: null,
31
+ created_at: fresh, updated_at: fresh, last_seen_at: fresh,
32
+ });
33
+ await route.fulfill({ response: r, json: { ...b, sessions: [ mk('alpha'), mk('beta') ] } });
34
+ });
35
+ await ctx.route('**/api/hub/messages*', (r) => r.fulfill({ json: { messages: [] } }));
36
+ await ctx.route('**/api/hub/tasks*', (r) => r.fulfill({ json: { tasks: [] } }));
37
+
38
+ const page = await ctx.newPage();
39
+ await page.goto('http://127.0.0.1:3000/', { waitUntil: 'domcontentloaded' });
40
+ await page.waitForSelector('[data-topo-wrapper]', { timeout: 15000 });
41
+ await page.waitForTimeout(300);
42
+
43
+ const probe = await page.evaluate(() => {
44
+ const wrapper = document.querySelector('[data-topo-wrapper]');
45
+ const cs = wrapper ? getComputedStyle(wrapper) : null;
46
+ return {
47
+ wrapperClass: wrapper?.className ?? '',
48
+ wrapperTopLeftRadius: cs?.borderTopLeftRadius ?? null,
49
+ wrapperTransition: cs?.transition ?? null,
50
+ layoutInactiveCls: document.querySelector('[data-topo-chrome-layout="grid"]')?.className ?? '',
51
+ layoutActiveCls: document.querySelector('[data-topo-chrome-layout="ring"]')?.className ?? '',
52
+ pulseCount: document.querySelectorAll('[data-pulse-wrapper]').length,
53
+ };
54
+ });
55
+ await browser.close();
56
+
57
+ const hasBoxShadowTrans = (s) => /box-shadow\s+0?\.?\d*s|box-shadow\s+\d+ms/i.test(s || '');
58
+
59
+ const results = {
60
+ wrapper_has_rounded_xl: probe.wrapperClass.includes('rounded-xl') && !probe.wrapperClass.includes('rounded-lg'),
61
+ wrapper_radius_12px: probe.wrapperTopLeftRadius === '12px',
62
+ // R263 regression: box-shadow transition.
63
+ r263_box_shadow_transition: hasBoxShadowTrans(probe.wrapperTransition),
64
+ // R317 / R318 chrome regression.
65
+ r317_inactive_gray_400: probe.layoutInactiveCls.includes('text-gray-400'),
66
+ r318_active_font_medium: probe.layoutActiveCls.includes('font-medium'),
67
+ r294_pulse_absent: probe.pulseCount === 0,
68
+ };
69
+ const ok = Object.values(results).every(Boolean);
70
+ console.log(`${ok ? '✅' : '❌'} wrapper radius rounded-xl:`, JSON.stringify(results),
71
+ '\n border-top-left-radius:', probe.wrapperTopLeftRadius,
72
+ '\n transition:', probe.wrapperTransition);
73
+ process.exit(ok ? 0 : 1);
@@ -0,0 +1,89 @@
1
+ /* Round 263 verification: wrapper box-shadow joins the theme-toggle
2
+ * transition list — closes R254's holdover gap.
3
+ *
4
+ * Pre-R263 the wrapper's inline transition was:
5
+ * transition: 'background-color 200ms ease-out, border-color 200ms ease-out'
6
+ *
7
+ * The Tailwind class `shadow-2xl ${isLight ? 'shadow-zinc-900/5'
8
+ * : 'shadow-cyan-950/30'}` is THEME-CONDITIONAL — on cyber→light
9
+ * toggle the className swap changes box-shadow color (cyan-950 30%
10
+ * ↔ zinc-900 5%) but the transition list didn't include box-shadow,
11
+ * so the shadow SNAPPED while every other theme-driven element eased.
12
+ *
13
+ * R254 claimed "TopoGraph theme-toggle smoothness TRULY complete" but
14
+ * missed this one surface. R263 closes it:
15
+ * transition: '... , box-shadow 200ms ease-out'
16
+ *
17
+ * CSS box-shadow transitions interpolate the shadow color smoothly
18
+ * even when the value is set indirectly via a Tailwind class — the
19
+ * `transition` property targets the box-shadow CSS property itself,
20
+ * which is transition-eligible regardless of where the new value
21
+ * comes from (class change vs inline style change).
22
+ *
23
+ * Test scope:
24
+ * 1. Wrapper present.
25
+ * 2. Wrapper inline transition includes box-shadow at 200ms (or 0.2s).
26
+ * 3. R254 invariants intact: still has background-color + border-color
27
+ * transitions.
28
+ * 4. Wrapper has a non-empty box-shadow at rest (regression — confirms
29
+ * the shadow class actually applies).
30
+ */
31
+ import { chromium } from 'playwright';
32
+ import { readFileSync } from 'node:fs';
33
+
34
+ const TOKEN = JSON.parse(readFileSync('/home/vansin/.anet/config.json', 'utf8')).token;
35
+ const browser = await chromium.launch({ headless: true });
36
+ const ctx = await browser.newContext({ viewport: { width: 1500, height: 1500 } });
37
+ await ctx.addCookies([{ name: 'anet_dashboard_session', value: `v3:${TOKEN}`, domain: '127.0.0.1', path: '/' }]);
38
+ await ctx.addInitScript(() => {
39
+ try { localStorage.setItem('anet-theme', 'cyber'); sessionStorage.setItem('anet_v3_auth', '1'); } catch {}
40
+ });
41
+ const fresh = new Date(Date.now() - 60 * 1000).toISOString();
42
+ await ctx.route('**/api/hub/status*', async (route) => {
43
+ const r = await route.fetch();
44
+ const b = await r.json();
45
+ const nid = (b.sessions || [])[0]?.network_id || 'default';
46
+ const mk = (alias) => ({
47
+ alias, status: 'working', model: 'claude-opus-4', runtime: 'claude-code-cli',
48
+ network_id: nid, project_dir: null,
49
+ created_at: fresh, updated_at: fresh, last_seen_at: fresh,
50
+ });
51
+ await route.fulfill({ response: r, json: { ...b, sessions: [
52
+ mk('alpha'), mk('beta'), mk('gamma'), mk('delta'),
53
+ ] } });
54
+ });
55
+ await ctx.route('**/api/hub/messages*', (r) => r.fulfill({ json: { messages: [] } }));
56
+ await ctx.route('**/api/hub/tasks*', (r) => r.fulfill({ json: { tasks: [] } }));
57
+
58
+ const page = await ctx.newPage();
59
+ await page.goto('http://127.0.0.1:3000/', { waitUntil: 'domcontentloaded' });
60
+ await page.waitForFunction(() => document.querySelectorAll('g[data-node]').length === 4, { timeout: 30000 });
61
+ await page.waitForSelector('[data-topo-wrapper]', { timeout: 10000 });
62
+ await page.waitForTimeout(300);
63
+
64
+ const probe = await page.evaluate(() => {
65
+ const w = document.querySelector('[data-topo-wrapper]');
66
+ return {
67
+ transition: w?.style.transition ?? null,
68
+ boxShadow: w ? window.getComputedStyle(w).boxShadow : null,
69
+ };
70
+ });
71
+ await browser.close();
72
+
73
+ const has = (s, prop) => new RegExp(`${prop}\\s+(?:200ms|0\\.2s)`).test(s || '');
74
+
75
+ const results = {
76
+ wrapper_present: probe.transition !== null,
77
+ transition_has_box_shadow_200: has(probe.transition, 'box-shadow'),
78
+ // R254 regressions
79
+ transition_has_bg_color_200: has(probe.transition, 'background-color'),
80
+ transition_has_border_color_200: has(probe.transition, 'border-color'),
81
+ // Wrapper actually carries a box-shadow at rest (else the transition
82
+ // would have nothing to interpolate). 'none' = no shadow applied.
83
+ wrapper_has_non_empty_shadow: probe.boxShadow !== null && probe.boxShadow !== 'none' && probe.boxShadow.length > 0,
84
+ };
85
+ const ok = Object.values(results).every(Boolean);
86
+ console.log(`${ok ? '✅' : '❌'} wrapper shadow theme ease:`, JSON.stringify(results),
87
+ '\n transition:', probe.transition,
88
+ '\n boxShadow:', probe.boxShadow);
89
+ process.exit(ok ? 0 : 1);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,98025,e=>{"use strict";e.s(["SESSION_STATUS_CHIP_CLASS",0,{working:"bg-green-500/10 text-green-300 border-green-500/20",idle:"bg-blue-500/10 text-blue-300 border-blue-500/20",blocked:"bg-yellow-500/10 text-yellow-300 border-yellow-500/20",error:"bg-red-500/10 text-red-300 border-red-500/20",offline:"bg-gray-500/10 text-gray-500 border-gray-500/20"},"SESSION_STATUS_TEXT_CLASS",0,{working:"text-green-400",idle:"text-blue-400",blocked:"text-yellow-400",error:"text-red-400",offline:"text-gray-500"},"STATUS_BAR_CLASS",0,{created:"bg-gray-500",delivered:"bg-blue-500",acked:"bg-cyan-500",running:"bg-green-500",replied:"bg-purple-500",closed:"bg-gray-600",failed:"bg-red-500",cancelled:"bg-yellow-500",expired:"bg-orange-500"},"STATUS_CHIP_CLASS",0,{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"},"STATUS_DOT_HEX",0,{created:"#9ca3af",delivered:"#60a5fa",acked:"#22d3ee",running:"#4ade80",replied:"#a78bfa",closed:"#6b7280",failed:"#f87171",cancelled:"#facc15",expired:"#fb923c"},"TASK_STATUSES",0,["created","delivered","acked","running","replied","closed","failed","cancelled","expired"]])},3479,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`},"previewContent",0,function(e){return e&&e.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\s+/g," ").trim()||"--"},"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`}])},46228,e=>{"use strict";var t=e.i(22381);let a=[180,200,220,270,300,330,30,90];function s(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%)`}}function r(e){return e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"}e.s(["AliasAvatar",0,function({alias:e,size:a=28,className:n=""}){let i=s(e),l=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 ${n}`,style:{width:a,height:a,fontSize:l,backgroundColor:i.bg,borderColor:i.ring,color:i.text},title:e,"aria-hidden":!0,children:r(e)})},"aliasAvatarColors",0,s,"aliasInitial",0,r])},76161,e=>{"use strict";var t=e.i(22381),a=e.i(23910),s=e.i(56839);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({children:e}){return(0,t.jsx)("div",{className:"max-w-2xl mx-auto rounded-xl border border-[#2a2a4a] bg-[#111128] shadow-lg shadow-black/20",children:e})}function d({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,taskHistoryCount:a=0}){return e?.global_count?(0,t.jsx)(l,{children:(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.`})}):a>0?(0,t.jsx)(l,{children:(0,t.jsx)(i,{variant:"nodes",title:"No agents online",sub:`Every agent in this network is currently offline. ${a.toLocaleString()} task${1===a?"":"s"} in history — they may have finished their work or disconnected.`,cta:{label:"View task history",href:"/tasks"}})}):(0,t.jsx)(l,{children:(0,t.jsxs)("div",{className:"text-center py-16 px-4",role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)("svg",{viewBox:"0 0 64 64",width:56,height:56,children:(0,t.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[(0,t.jsx)("rect",{x:"10",y:"20",width:"44",height:"28",rx:"2"}),(0,t.jsx)("rect",{x:"20",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"32",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"44",y:"32",width:"4",height:"8",opacity:"0.5"}),(0,t.jsx)("line",{x1:"10",y1:"26",x2:"54",y2:"26",opacity:"0.4"}),(0,t.jsx)("circle",{cx:"14",cy:"23",r:"0.8",fill:"currentColor"})]})})}),(0,t.jsx)("h3",{className:"font-medium text-gray-300 text-base",children:"Spin up your first agent"}),(0,t.jsx)("p",{className:"text-gray-500 text-sm mt-2 max-w-md mx-auto leading-relaxed",children:"Run this in a fresh terminal to register an agent with this CommHub:"}),(0,t.jsx)("div",{className:"mt-4 inline-block",children:(0,t.jsx)(d,{cmd:"npx --yes @sleep2agi/agent-network init"})}),(0,t.jsx)("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:"→"})]})})]})})}])},57602,e=>{"use strict";var t=e.i(22381),a=e.i(23910),s=e.i(56058),r=e.i(11449),n=e.i(3479),i=e.i(46228);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 g=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})):[],p=g.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:g.map((e,a)=>{let s=u&&a===p,r=!!g[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<g.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(76161),c=e.i(98025);function x(e){let t=c.STATUS_CHIP_CLASS[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 h(e){return"high"===e?"text-red-400":"low"===e?"text-gray-600":"text-gray-400"}function m(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 g(){let e,l,g,p,u=(0,s.useSearchParams)(),{networkId:y}=(0,r.useNetworkId)(),[b,j]=(0,a.useState)([]),[f,v]=(0,a.useState)(0),[N,w]=(0,a.useState)(!0),[k,_]=(0,a.useState)(""),[S,C]=(0,a.useState)(new Set),[T,$]=(0,a.useState)(u.get("status")||""),[A,L]=(0,a.useState)(""),[M,E]=(0,a.useState)(""),[D,I]=(0,a.useState)(null),U=e=>{C(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})},B=(0,a.useCallback)(async()=>{try{let e=new URLSearchParams;y&&e.set("network_id",y),T&&e.set("status",T),A&&e.set("from_name",A),M&&e.set("to_name",M),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();j(a.tasks||[]),v(a.count??(a.tasks?.length||0)),_("")}catch(e){_(e instanceof Error?e.message:"fetch failed")}finally{w(!1)}},[T,A,M,y]);return(0,a.useEffect)(()=>{w(!0),B();let e=setInterval(B,5e3);return()=>clearInterval(e)},[B]),(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 tabular-nums",title:b.length<f?`Showing ${b.length} of ${f} tasks`:void 0,children:b.length<f?`${b.length} / ${f}`:f})]}),b.length>0&&(0,t.jsxs)(t.Fragment,{children:[(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:(e={},b.forEach(t=>{e[t.status]=(e[t.status]||0)+1}),["",...c.TASK_STATUSES].map(a=>{let s=""===a?b.length:e[a]||0,r=T===a;return(0,t.jsxs)("button",{onClick:()=>$(a),disabled:0===s&&""!==a&&!r,className:`px-3 py-1.5 rounded-md text-xs transition-colors flex items-center gap-1.5 shrink-0 whitespace-nowrap disabled:opacity-30 disabled:cursor-not-allowed ${r?`${c.STATUS_CHIP_CLASS[a]||"bg-cyan-500/10 text-cyan-300 border-cyan-500/20"} border`:"text-gray-500 hover:text-gray-300 hover:bg-[#1a1a2a]/40"}`,children:[a&&(0,t.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:c.STATUS_DOT_HEX[a]||"#6b7280"}}),(0,t.jsx)("span",{children:a||"All"}),(0,t.jsx)("span",{className:`text-[10px] tabular-nums ${r?"opacity-80":"text-gray-600"}`,children:s})]},a)}))})}),(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:A,onChange:e=>L(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:M,onChange:e=>E(e.target.value),placeholder:"any node",className:"w-28 bg-transparent text-sm text-white placeholder-gray-700 focus:outline-none"})]}),(T||A||M)&&(0,t.jsx)("button",{type:"button",onClick:()=>{$(""),L(""),E("")},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"})]})]}),b.length>0&&!T&&(l={},b.forEach(e=>{l[e.status]=(l[e.status]||0)+1}),g=b.length||1,(p=c.TASK_STATUSES.map(e=>({key:e,color:c.STATUS_BAR_CLASS[e]})).filter(e=>l[e.key])).length?(0,t.jsx)("div",{className:"mb-6",children:(0,t.jsx)("div",{className:"flex h-2 rounded-full overflow-hidden bg-gray-800",children:p.map(e=>(0,t.jsx)("div",{className:e.color,style:{width:`${l[e.key]/g*100}%`},title:`${e.key}: ${l[e.key]}`},e.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===b.length?(0,t.jsx)(o.EmptyState,{variant:"tasks",sub:T||A||M?"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"})]}),b.map(e=>{let a=S.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:()=>U(e.task_id),role:"button",tabIndex:0,"aria-expanded":a,onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),U(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:x(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:(0,n.previewContent)(e.content)}),(0,t.jsx)("div",{className:"col-span-1",children:(0,t.jsx)("span",{className:`text-xs ${h(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:m(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:x(e.status),children:e.status}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:`text-xs ${h(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",title:e.content,children:(0,n.previewContent)(e.content)}),(0,t.jsx)("div",{className:"text-xs text-gray-600",children:m(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?m(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})}),B()},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)})]}),D&&(0,t.jsx)(d,{taskId:D,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)(g,{})})}],57602)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,3479,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`},"previewContent",0,function(e){return e&&e.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\s+/g," ").trim()||"--"},"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`}])},46228,e=>{"use strict";var t=e.i(22381);let a=[180,200,220,270,300,330,30,90];function s(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%)`}}function r(e){return e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"}e.s(["AliasAvatar",0,function({alias:e,size:a=28,className:i=""}){let n=s(e),l=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 ${i}`,style:{width:a,height:a,fontSize:l,backgroundColor:n.bg,borderColor:n.ring,color:n.text},title:e,"aria-hidden":!0,children:r(e)})},"aliasAvatarColors",0,s,"aliasInitial",0,r])},76161,e=>{"use strict";var t=e.i(22381),a=e.i(23910),s=e.i(56839);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: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 n({variant:e="generic",title:a,sub:l,cta:o,compact:c=!1}){let d=r[e],x=a??d.title,h=l??d.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:x}),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:"→"})]})})]})}function l({children:e}){return(0,t.jsx)("div",{className:"max-w-2xl mx-auto rounded-xl border border-[#2a2a4a] bg-[#111128] shadow-lg shadow-black/20",children:e})}function o({cmd:e}){let[s,r]=(0,a.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":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,n,"NodesEmptyState",0,function({hint:e,taskHistoryCount:a=0}){return e?.global_count?(0,t.jsx)(l,{children:(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.`})}):a>0?(0,t.jsx)(l,{children:(0,t.jsx)(n,{variant:"nodes",title:"No agents online",sub:`Every agent in this network is currently offline. ${a.toLocaleString()} task${1===a?"":"s"} in history — they may have finished their work or disconnected.`,cta:{label:"View task history",href:"/tasks"}})}):(0,t.jsx)(l,{children:(0,t.jsxs)("div",{className:"text-center py-16 px-4",role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)("svg",{viewBox:"0 0 64 64",width:56,height:56,children:(0,t.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[(0,t.jsx)("rect",{x:"10",y:"20",width:"44",height:"28",rx:"2"}),(0,t.jsx)("rect",{x:"20",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"32",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"44",y:"32",width:"4",height:"8",opacity:"0.5"}),(0,t.jsx)("line",{x1:"10",y1:"26",x2:"54",y2:"26",opacity:"0.4"}),(0,t.jsx)("circle",{cx:"14",cy:"23",r:"0.8",fill:"currentColor"})]})})}),(0,t.jsx)("h3",{className:"font-medium text-gray-300 text-base",children:"Spin up your first agent"}),(0,t.jsx)("p",{className:"text-gray-500 text-sm mt-2 max-w-md mx-auto leading-relaxed",children:"Run this in a fresh terminal to register an agent with this CommHub:"}),(0,t.jsx)("div",{className:"mt-4 inline-block",children:(0,t.jsx)(o,{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:"→"})]})})]})})}])},46860,e=>{"use strict";var t=e.i(22381),a=e.i(23910),s=e.i(56839),r=e.i(3479),i=e.i(11449),n=e.i(76161),l=e.i(46228);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,d,{networkId:x}=(0,i.useNetworkId)(),[h,m]=(0,a.useState)([]),[g,y]=(0,a.useState)(!0),[u,p]=(0,a.useState)(""),[j,b]=(0,a.useState)(""),f=(0,a.useCallback)(async()=>{try{let e=new URLSearchParams({limit:"100"});x&&e.set("network_id",x),j&&e.set("action",j);let t=sessionStorage.getItem("anet_v3_auth");if(t)try{let a=JSON.parse(t);a.token&&e.set("token",a.token)}catch{}let a=await fetch(`/api/hub/audit-log?${e.toString()}`);if(401===a.status)return void window.location.assign("/login");let s=await a.json();m(s.logs||[]),p(s.error&&!s.logs?.length?s.error:"")}catch(e){p(e instanceof Error?e.message:"fetch failed")}finally{y(!1)}},[j,x]);return(0,a.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.jsx)("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"})}),(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(a=>{let s=""===a.key?h.length:e[a.key]||0,r=j===a.key;return(0,t.jsxs)("button",{type:"button",onClick:()=>b(a.key),disabled:0===s&&""!==a.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:[a.dot&&(0,t.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full",style:{backgroundColor:a.dot}}),(0,t.jsx)("span",{children:a.label}),(0,t.jsx)("span",{className:`text-[10px] tabular-nums ${r?"text-cyan-400":"text-gray-600"}`,children:s})]},a.key||"all")}))}),u&&(d=/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:d?(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)(s.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 a=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}),a&&(0,t.jsx)(l.AliasAvatar,{alias:a,size:16}),(0,t.jsx)("span",{className:"text-sm text-gray-200 font-medium",children:a}),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)})})]})}])}]);
@@ -1,7 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,3479,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`},"previewContent",0,function(e){return e&&e.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\s+/g," ").trim()||"--"},"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`}])},46228,e=>{"use strict";var t=e.i(22381);let s=[180,200,220,270,300,330,30,90];function a(e){let t=0;for(let s=0;s<e.length;s++)t=31*t+e.charCodeAt(s)>>>0;let a=s[t%s.length];return{bg:`hsl(${a} 55% 22%)`,ring:`hsl(${a} 60% 45%)`,text:`hsl(${a} 80% 78%)`}}function r(e){return e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"}e.s(["AliasAvatar",0,function({alias:e,size:s=28,className:n=""}){let i=a(e),l=Math.max(9,Math.round(.42*s));return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${n}`,style:{width:s,height:s,fontSize:l,backgroundColor:i.bg,borderColor:i.ring,color:i.text},title:e,"aria-hidden":!0,children:r(e)})},"aliasAvatarColors",0,a,"aliasInitial",0,r])},76161,e=>{"use strict";var t=e.i(22381),s=e.i(23910),a=e.i(56839);let r={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function n({variant:e,size:s}){let a={width:s,height:s},r={fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"nodes":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"14",r:"4"}),(0,t.jsx)("circle",{cx:"14",cy:"44",r:"4"}),(0,t.jsx)("circle",{cx:"50",cy:"44",r:"4"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"14",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"50",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"18",y1:"44",x2:"46",y2:"44",strokeDasharray:"3 3",opacity:"0.6"})]})});case"tasks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("rect",{x:"14",y:"14",width:"36",height:"6",rx:"1.5"}),(0,t.jsx)("rect",{x:"14",y:"26",width:"36",height:"6",rx:"1.5",opacity:"0.6"}),(0,t.jsx)("rect",{x:"14",y:"38",width:"36",height:"6",rx:"1.5",opacity:"0.35"})]})});case"messages":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M14 18 h36 a3 3 0 0 1 3 3 v18 a3 3 0 0 1 -3 3 h-18 l-8 6 v-6 h-10 a3 3 0 0 1 -3 -3 v-18 a3 3 0 0 1 3 -3 z"}),(0,t.jsx)("line",{x1:"22",y1:"28",x2:"42",y2:"28",opacity:"0.5"}),(0,t.jsx)("line",{x1:"22",y1:"34",x2:"36",y2:"34",opacity:"0.5"})]})});case"logs":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M18 12 h22 l8 8 v32 a2 2 0 0 1 -2 2 h-28 a2 2 0 0 1 -2 -2 v-38 a2 2 0 0 1 2 -2 z"}),(0,t.jsx)("path",{d:"M40 12 v8 h8",opacity:"0.6"}),(0,t.jsx)("line",{x1:"24",y1:"32",x2:"40",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"24",y1:"38",x2:"40",y2:"38",opacity:"0.4"}),(0,t.jsx)("line",{x1:"24",y1:"44",x2:"34",y2:"44",opacity:"0.25"})]})});case"tokens":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"22",cy:"32",r:"8"}),(0,t.jsx)("line",{x1:"30",y1:"32",x2:"54",y2:"32"}),(0,t.jsx)("line",{x1:"44",y1:"32",x2:"44",y2:"38"}),(0,t.jsx)("line",{x1:"50",y1:"32",x2:"50",y2:"40"})]})});case"networks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"18"}),(0,t.jsx)("ellipse",{cx:"32",cy:"32",rx:"18",ry:"9",opacity:"0.55"}),(0,t.jsx)("line",{x1:"14",y1:"32",x2:"50",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"32",y1:"14",x2:"32",y2:"50",opacity:"0.55"})]})});default:return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"14",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"32",cy:"32",r:"3"})]})})}}function i({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)(n,{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({children:e}){return(0,t.jsx)("div",{className:"max-w-2xl mx-auto rounded-xl border border-[#2a2a4a] bg-[#111128] shadow-lg shadow-black/20",children:e})}function o({cmd:e}){let[a,r]=(0,s.useState)(!1),n=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1800)}catch{}};return(0,t.jsxs)("div",{className:"anet-empty-cmd flex items-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":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,i,"NodesEmptyState",0,function({hint:e,taskHistoryCount:s=0}){return e?.global_count?(0,t.jsx)(l,{children:(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.`})}):s>0?(0,t.jsx)(l,{children:(0,t.jsx)(i,{variant:"nodes",title:"No agents online",sub:`Every agent in this network is currently offline. ${s.toLocaleString()} task${1===s?"":"s"} in history — they may have finished their work or disconnected.`,cta:{label:"View task history",href:"/tasks"}})}):(0,t.jsx)(l,{children:(0,t.jsxs)("div",{className:"text-center py-16 px-4",role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)("svg",{viewBox:"0 0 64 64",width:56,height:56,children:(0,t.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[(0,t.jsx)("rect",{x:"10",y:"20",width:"44",height:"28",rx:"2"}),(0,t.jsx)("rect",{x:"20",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"32",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"44",y:"32",width:"4",height:"8",opacity:"0.5"}),(0,t.jsx)("line",{x1:"10",y1:"26",x2:"54",y2:"26",opacity:"0.4"}),(0,t.jsx)("circle",{cx:"14",cy:"23",r:"0.8",fill:"currentColor"})]})})}),(0,t.jsx)("h3",{className:"font-medium text-gray-300 text-base",children:"Spin up your first agent"}),(0,t.jsx)("p",{className:"text-gray-500 text-sm mt-2 max-w-md mx-auto leading-relaxed",children:"Run this in a fresh terminal to register an agent with this CommHub:"}),(0,t.jsx)("div",{className:"mt-4 inline-block",children:(0,t.jsx)(o,{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:"→"})]})})]})})}])},59276,e=>{"use strict";var t=e.i(12629),s=e.i(11449);let a=async e=>{let t=await fetch(e);if(401===t.status)throw window.location.assign("/login"),Error("unauthorized");return t.json()},r={refreshInterval:5e3,dedupingInterval:3e3};function n(e,t){if(!t)return e;let s=e.includes("?")?"&":"?";return`${e}${s}network_id=${encodeURIComponent(t)}`}e.s(["useAnetConfig",0,function(){let{data:e}=(0,t.default)("/api/anet/config",a,{refreshInterval:3e4});return{config:e||null}},"useHealth",0,function(){let{data:e,error:s}=(0,t.default)("/api/hub/health",a,r);return{health:e||null,error:s}},"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:i}=(0,s.useNetworkId)(),{data:l,error:o,isLoading:c}=(0,t.default)(n(`/api/hub/messages?limit=${e}`,i),a,r);return{messages:l?.messages||[],error:o,isLoading:c}},"useSessions",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:i,error:l,isLoading:o}=(0,t.default)(n("/api/hub/status",e),a,r);return{sessions:i?.sessions||[],hint:i?._hint,error:l,isLoading:o}},"useStats",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:i,error:l}=(0,t.default)(n("/api/hub/stats",e),a,r);return{stats:i?.ok?i:null,error:l}},"useTasks",0,function(e){let{networkId:i}=(0,s.useNetworkId)(),l=new URLSearchParams({limit:"100",...e}).toString(),{data:o,error:c,isLoading:x}=(0,t.default)(n(`/api/hub/tasks?${l}`,i),a,r);return{tasks:o?.tasks||[],count:o?.count??0,source:o?.source,error:c,isLoading:x}}])},94108,e=>{"use strict";var t=e.i(22381),s=e.i(23910),a=e.i(59276),r=e.i(3479),n=e.i(76161),i=e.i(46228);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 n=a.toLowerCase().indexOf(r.toLowerCase());return n<0?a:(0,t.jsxs)(t.Fragment,{children:[a.slice(0,n),(0,t.jsx)("mark",{className:"bg-yellow-500/30 text-yellow-200 rounded px-0.5",children:a.slice(n,n+r.length)}),a.slice(n+r.length)]})}e.s(["default",0,function(){let{messages:e,isLoading:d}=(0,a.useMessages)(200),[h,m]=(0,s.useState)(""),[u,g]=(0,s.useState)(""),[p,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("↔"),n=e.get(r)||{participants:[s,a].sort(),messages:[],lastTime:0};n.messages.push(t),n.lastTime=Math.max(n.lastTime,o(t.created_at)),e.set(r,n)}),[...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 tabular-nums",title:v.length<e.length?`Showing ${v.length} of ${e.length} messages`:void 0,children:v.length<e.length?`${v.length} / ${e.length}`: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"})]}),e.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-3 mb-3",children:[(0,t.jsx)("input",{type:"text",value:u,onChange:e=>g(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(!p),className:`text-xs px-3 py-2 rounded-lg border transition-colors ${p?"bg-yellow-500/10 text-yellow-300 border-yellow-500/20":"text-gray-500 border-gray-700/50 hover:text-gray-300"}`,children:p?"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:()=>g(`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:()=>g(""),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)(n.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)(i.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)(i.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)(i.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 truncate",title:e.content||"",children:(0,r.previewContent)(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 n=v[s-1],d=!!n&&o(e.created_at)-o(n.created_at)>3e5,h=c(e),m=!!n&&!d&&c(n)===h&&(n.from_alias||"")===(e.from_alias||"")&&(n.to_alias||"")===(e.to_alias||""),g=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:g}),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 break-words [overflow-wrap:anywhere] 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)(i.AliasAvatar,{alias:g,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:g}),(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 break-words [overflow-wrap:anywhere] 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):""}),p&&(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 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,3479,e=>{"use strict";e.s(["formatUptime",0,function(e){let a=Math.floor(e/3600),t=Math.floor(e%3600/60);return a>0?`${a}h ${t}m`:`${t}m`},"previewContent",0,function(e){return e&&e.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\s+/g," ").trim()||"--"},"timeAgo",0,function(e){if(!e)return"--";let a=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return a<60?`${a}s ago`:a<3600?`${Math.floor(a/60)}m ago`:a<86400?`${Math.floor(a/3600)}h ago`:`${Math.floor(a/86400)}d ago`}])},46228,e=>{"use strict";var a=e.i(22381);let t=[180,200,220,270,300,330,30,90];function s(e){let a=0;for(let t=0;t<e.length;t++)a=31*a+e.charCodeAt(t)>>>0;let s=t[a%t.length];return{bg:`hsl(${s} 55% 22%)`,ring:`hsl(${s} 60% 45%)`,text:`hsl(${s} 80% 78%)`}}function r(e){return e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"}e.s(["AliasAvatar",0,function({alias:e,size:t=28,className:l=""}){let n=s(e),i=Math.max(9,Math.round(.42*t));return(0,a.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${l}`,style:{width:t,height:t,fontSize:i,backgroundColor:n.bg,borderColor:n.ring,color:n.text},title:e,"aria-hidden":!0,children:r(e)})},"aliasAvatarColors",0,s,"aliasInitial",0,r])},98025,e=>{"use strict";e.s(["SESSION_STATUS_CHIP_CLASS",0,{working:"bg-green-500/10 text-green-300 border-green-500/20",idle:"bg-blue-500/10 text-blue-300 border-blue-500/20",blocked:"bg-yellow-500/10 text-yellow-300 border-yellow-500/20",error:"bg-red-500/10 text-red-300 border-red-500/20",offline:"bg-gray-500/10 text-gray-500 border-gray-500/20"},"SESSION_STATUS_TEXT_CLASS",0,{working:"text-green-400",idle:"text-blue-400",blocked:"text-yellow-400",error:"text-red-400",offline:"text-gray-500"},"STATUS_BAR_CLASS",0,{created:"bg-gray-500",delivered:"bg-blue-500",acked:"bg-cyan-500",running:"bg-green-500",replied:"bg-purple-500",closed:"bg-gray-600",failed:"bg-red-500",cancelled:"bg-yellow-500",expired:"bg-orange-500"},"STATUS_CHIP_CLASS",0,{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"},"STATUS_DOT_HEX",0,{created:"#9ca3af",delivered:"#60a5fa",acked:"#22d3ee",running:"#4ade80",replied:"#a78bfa",closed:"#6b7280",failed:"#f87171",cancelled:"#facc15",expired:"#fb923c"},"TASK_STATUSES",0,["created","delivered","acked","running","replied","closed","failed","cancelled","expired"]])},51868,e=>{"use strict";var a=e.i(22381),t=e.i(23910),s=e.i(56058),r=e.i(56839),l=e.i(43058),n=e.i(3479),i=e.i(46228),d=e.i(98025);function o({tmuxName:e}){let[s,r]=(0,t.useState)(""),[l,n]=(0,t.useState)(!1),[i,d]=(0,t.useState)(!1),c=async()=>{n(!0);try{let a=await fetch(`/api/hub/tmux?name=${encodeURIComponent(e)}`),t=await a.json();r(t.output||t.error||"No output")}catch{r("Failed to fetch")}n(!1)};return(0,a.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("h2",{className:"text-sm font-semibold text-gray-300",children:["Terminal (",e,")"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{onClick:c,disabled:l,className:"text-xs text-cyan-400 hover:text-cyan-300 disabled:text-gray-600",children:l?"Loading...":"Capture"}),s&&(0,a.jsx)("button",{onClick:()=>d(!i),className:"text-xs text-gray-500 hover:text-gray-300",children:i?"Collapse":"Expand"})]})]}),s&&(0,a.jsx)("pre",{className:`text-[11px] text-green-300 bg-[#050510] rounded-lg px-3 py-2 border border-[#1a1a2a] overflow-x-auto whitespace-pre font-mono ${i?"max-h-96":"max-h-32"} overflow-y-auto`,children:s}),!s&&(0,a.jsx)("p",{className:"text-xs text-gray-600",children:"Click Capture to view terminal output"})]})}function c(){let e=(0,s.useSearchParams)().get("alias")||"",[l,n]=(0,t.useState)(null),[o,c]=(0,t.useState)([]),[u,h]=(0,t.useState)(0),[b,g]=(0,t.useState)(""),[m,p]=(0,t.useState)(""),[f,y]=(0,t.useState)(!1),v=(0,t.useCallback)(async()=>{if(e)try{let a=await fetch(`/api/hub/session?alias=${encodeURIComponent(e)}`),t=await a.json();t.session&&n(t.session),t.inbox&&c(t.inbox),h(t.sse||0),g("")}catch(e){g(e instanceof Error?e.message:"fetch failed")}},[e]);(0,t.useEffect)(()=>{v();let e=setInterval(v,5e3);return()=>clearInterval(e)},[v]);let[j,S]=(0,t.useState)(""),w=async()=>{if(m.trim()&&e){y(!0),S("");try{let a=await fetch("/api/hub/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({alias:e,task:m})}),t=await a.json();t.ok?(p(""),setTimeout(v,2e3)):S(t.error||"Send failed")}catch(e){S(e instanceof Error?e.message:"Send failed")}y(!1)}};if(!e)return(0,a.jsx)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-6 font-mono flex items-center justify-center",children:(0,a.jsxs)("p",{className:"text-gray-500",children:["No alias specified. ",(0,a.jsx)(r.default,{href:"/",className:"text-blue-400 hover:underline",children:"Back to dashboard"})]})});let N=d.SESSION_STATUS_TEXT_CLASS[l?.status||""]||d.SESSION_STATUS_TEXT_CLASS.offline;return(0,a.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-6 lg:ml-0 ml-10",children:[(0,a.jsx)(r.default,{href:"/nodes",className:"text-gray-500 hover:text-gray-300 text-sm shrink-0",children:"← Nodes"}),(0,a.jsx)(i.AliasAvatar,{alias:e,size:32}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h1",{className:"text-xl sm:text-2xl font-bold text-white truncate",children:e}),(0,a.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${u>0?l?.status==="working"?"bg-green-500 animate-pulse":"bg-emerald-400":"bg-gray-500"}`}),(0,a.jsx)("span",{className:`text-[10px] uppercase tracking-wide font-semibold ${N}`,children:l?.status||"unknown"})]}),l?.agent&&(0,a.jsxs)("div",{className:"text-xs text-gray-500 truncate",children:[l.agent,l.server?(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsx)("span",{className:"text-gray-700 mx-1",children:"·"})," ",l.server]}):null]})]})]}),b&&(0,a.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:b}),(0,a.jsx)(x,{alias:e,session:l,sse:u,sendMsg:m,setSendMsg:p,sending:f,sendTask:w,sendError:j})]})}function x({alias:e,session:s,sse:r,sendMsg:n,setSendMsg:i,sending:d,sendTask:c,sendError:u}){let[b,g]=(0,t.useState)("chat"),[m,p]=(0,t.useState)([]),[f,y]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{"events"!==b||f||fetch("/api/hub/task-events?limit=50").then(e=>e.json()).then(e=>{p(e.events||[]),y(!0)}).catch(()=>y(!0))},[b,f]),(0,a.jsxs)("div",{className:"bg-[#0d0d1a] border border-[#2a2a4a] rounded-xl overflow-hidden h-[calc(100vh-140px)] flex flex-col",children:[(0,a.jsx)("div",{className:"flex border-b border-[#2a2a4a] bg-[#0a0a15] shrink-0",children:[{id:"chat",label:"Chat",icon:"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"},{id:"events",label:"Events",icon:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z M14 2v6h6 M16 13H8 M16 17H8 M10 9H8"},{id:"info",label:"Info",icon:"M12 21a9 9 0 100-18 9 9 0 000 18z M12 8h.01 M11 12h1v4h1"}].map(e=>(0,a.jsxs)("button",{onClick:()=>g(e.id),className:`flex items-center gap-2 px-5 py-3 text-sm font-medium border-b-2 transition-colors ${b===e.id?"border-cyan-400 text-cyan-300":"border-transparent text-gray-500 hover:text-gray-300"}`,children:[(0,a.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:e.icon})}),(0,a.jsx)("span",{children:e.label})]},e.id))}),(0,a.jsxs)("div",{className:"flex-1 overflow-hidden",children:["chat"===b&&(0,a.jsx)(l.TaskChatPanel,{alias:e,onClose:()=>{},inline:!0}),"events"===b&&(0,a.jsx)(h,{events:m,loading:!f}),"info"===b&&(0,a.jsxs)("div",{className:"p-4 overflow-y-auto h-full space-y-4 max-w-2xl",children:[(0,a.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-3",children:"Node Info"}),(0,a.jsx)("div",{className:"space-y-2 text-xs",children:[{label:"Node ID",value:s?.node_id,alwaysShow:!0},{label:"Session ID",value:s?.session_id,alwaysShow:!0},{label:"Resume ID",value:s?.resume_id,alwaysShow:!0},{label:"Alias",value:s?.alias,alwaysShow:!0},{label:"Agent",value:s?.agent,alwaysShow:!0},{label:"Model",value:s?.model,alwaysShow:!0},{label:"Version",value:s?.version},{label:"Server",value:s?.server,alwaysShow:!0},{label:"Hostname",value:s?.hostname,alwaysShow:!0},{label:"IP",value:s?.ip,alwaysShow:!0},{label:"Project",value:s?.project_dir},{label:"Config",value:s?.config_path,alwaysShow:!0},{label:"Channels",value:s?.channels?.length?Array.isArray(s.channels)?s.channels.join(", "):s.channels:null,alwaysShow:!0},{label:"Tmux",value:s?.tmux_name},{label:"SSE",value:r>0?`Connected (${r})`:"Disconnected",alwaysShow:!0},{label:"Progress",value:s?.progress?`${s.progress}%`:null},{label:"Score",value:s?.score},{label:"Last Seen",value:s?.last_seen_at,alwaysShow:!0},{label:"Registered",value:s?.registered_at,alwaysShow:!0},{label:"Updated",value:s?.updated_at,alwaysShow:!0}].map(({label:e,value:t,alwaysShow:s})=>t||s?(0,a.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,a.jsx)("span",{className:"text-gray-500 shrink-0",children:e}),(0,a.jsx)("span",{className:"text-gray-300 truncate max-w-[200px]",title:t?String(t):"--",children:t?String(t):"--"})]},e):null)})]}),s?.task&&(0,a.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-2",children:"Current Task"}),(0,a.jsx)("p",{className:"text-xs text-gray-400 whitespace-pre-wrap",children:s.task})]}),s?.output&&(0,a.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-2",children:"Last Output"}),(0,a.jsx)("p",{className:"text-xs text-gray-400 whitespace-pre-wrap max-h-48 overflow-y-auto",children:s.output})]}),(0,a.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-2",children:"Send Task"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:n,onChange:e=>i(e.target.value),onKeyDown:e=>"Enter"===e.key&&c(),placeholder:`Send task to ${e}...`,className:"flex-1 bg-[#0a0a15] border border-[#2a2a4a] rounded px-3 py-2 text-xs text-white placeholder-gray-600 focus:border-blue-500 focus:outline-none"}),(0,a.jsx)("button",{onClick:c,disabled:d||!n.trim(),className:"px-3 py-2 bg-blue-600 hover:bg-blue-500 disabled:bg-gray-700 text-white text-xs rounded transition-colors",children:d?"...":"Send"})]}),u&&(0,a.jsx)("div",{className:"mt-2 text-xs text-red-400",children:u})]}),s?.tmux_name&&(0,a.jsx)(o,{tmuxName:s.tmux_name})]})]})]})}let u={delivered:{dot:"bg-blue-400",line:"bg-blue-500/30",path:"M12 5v14 M5 12l7 7 7-7"},acked:{dot:"bg-yellow-400",line:"bg-yellow-500/30",path:"M20 6 9 17l-5-5"},running:{dot:"bg-green-400",line:"bg-green-500/30",path:"M13 2L4 14h6l-1 8 10-12h-6l1-8z"},replied:{dot:"bg-purple-400",line:"bg-purple-500/30",path:"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"},failed:{dot:"bg-red-400",line:"bg-red-500/30",path:"M18 6 6 18 M6 6l12 12"},created:{dot:"bg-gray-400",line:"bg-gray-500/30",path:"M12 5v14 M5 12h14"}};function h({events:e,loading:t}){if(t)return(0,a.jsx)("div",{className:"flex justify-center py-8",children:(0,a.jsx)("div",{className:"w-5 h-5 border-2 border-cyan-500/30 border-t-cyan-500 rounded-full animate-spin"})});if(0===e.length)return(0,a.jsx)("div",{className:"text-center py-12 text-gray-600 text-xs",children:"No task events yet"});let s=new Map;return e.forEach(e=>{let a=e.task_id||`ungrouped-${e.id}`,t=s.get(a)||[];t.push(e),s.set(a,t)}),(0,a.jsx)("div",{className:"p-4 overflow-y-auto h-full space-y-4",children:[...s.entries()].map(([e,t])=>(0,a.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,a.jsxs)("div",{className:"text-[10px] text-gray-600 mb-3 truncate",children:["Task: ",e.slice(0,20),"..."]}),(0,a.jsxs)("div",{className:"relative pl-6",children:[(0,a.jsx)("div",{className:"absolute left-[9px] top-2 bottom-2 w-0.5 bg-[#1a1a2a]"}),t.map((e,t)=>{let s=u[e.to_status]||u.created;return(0,a.jsxs)("div",{className:"relative pb-4 last:pb-0",children:[(0,a.jsx)("div",{className:`absolute -left-6 top-0.5 w-[18px] h-[18px] rounded-full ${s.dot} flex items-center justify-center z-10 border-2 border-[#111128]`,children:(0,a.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"#0a0a15",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,a.jsx)("path",{d:s.path})})}),(0,a.jsxs)("div",{className:"ml-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-medium ${"failed"===e.to_status?"text-red-400":"replied"===e.to_status?"text-purple-400":"text-gray-300"}`,children:e.event_type}),e.from_status&&(0,a.jsxs)("span",{className:"text-[10px] text-gray-600",children:[e.from_status," → ",e.to_status]}),(0,a.jsx)("span",{className:"text-[10px] text-gray-600 ml-auto",children:(0,n.timeAgo)(e.created_at)})]}),e.detail&&(0,a.jsxs)("div",{className:"text-[11px] text-gray-500 mt-0.5 truncate",children:[e.detail.slice(0,50),e.detail.length>50?"...":""]})]})]},e.id)})]})]},e))})}e.s(["default",0,function(){return(0,a.jsx)(t.Suspense,{fallback:(0,a.jsx)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-6 font-mono",children:"Loading..."}),children:(0,a.jsx)(c,{})})}])}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,98025,e=>{"use strict";e.s(["SESSION_STATUS_CHIP_CLASS",0,{working:"bg-green-500/10 text-green-300 border-green-500/20",idle:"bg-blue-500/10 text-blue-300 border-blue-500/20",blocked:"bg-yellow-500/10 text-yellow-300 border-yellow-500/20",error:"bg-red-500/10 text-red-300 border-red-500/20",offline:"bg-gray-500/10 text-gray-500 border-gray-500/20"},"SESSION_STATUS_TEXT_CLASS",0,{working:"text-green-400",idle:"text-blue-400",blocked:"text-yellow-400",error:"text-red-400",offline:"text-gray-500"},"STATUS_BAR_CLASS",0,{created:"bg-gray-500",delivered:"bg-blue-500",acked:"bg-cyan-500",running:"bg-green-500",replied:"bg-purple-500",closed:"bg-gray-600",failed:"bg-red-500",cancelled:"bg-yellow-500",expired:"bg-orange-500"},"STATUS_CHIP_CLASS",0,{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"},"STATUS_DOT_HEX",0,{created:"#9ca3af",delivered:"#60a5fa",acked:"#22d3ee",running:"#4ade80",replied:"#a78bfa",closed:"#6b7280",failed:"#f87171",cancelled:"#facc15",expired:"#fb923c"},"TASK_STATUSES",0,["created","delivered","acked","running","replied","closed","failed","cancelled","expired"]])},3479,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`},"previewContent",0,function(e){return e&&e.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\s+/g," ").trim()||"--"},"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`}])},46228,e=>{"use strict";var t=e.i(22381);let s=[180,200,220,270,300,330,30,90];function a(e){let t=0;for(let s=0;s<e.length;s++)t=31*t+e.charCodeAt(s)>>>0;let a=s[t%s.length];return{bg:`hsl(${a} 55% 22%)`,ring:`hsl(${a} 60% 45%)`,text:`hsl(${a} 80% 78%)`}}function r(e){return e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"}e.s(["AliasAvatar",0,function({alias:e,size:s=28,className:n=""}){let l=a(e),i=Math.max(9,Math.round(.42*s));return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${n}`,style:{width:s,height:s,fontSize:i,backgroundColor:l.bg,borderColor:l.ring,color:l.text},title:e,"aria-hidden":!0,children:r(e)})},"aliasAvatarColors",0,a,"aliasInitial",0,r])},76161,e=>{"use strict";var t=e.i(22381),s=e.i(23910),a=e.i(56839);let r={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function n({variant:e,size:s}){let a={width:s,height:s},r={fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"nodes":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"14",r:"4"}),(0,t.jsx)("circle",{cx:"14",cy:"44",r:"4"}),(0,t.jsx)("circle",{cx:"50",cy:"44",r:"4"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"14",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"50",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"18",y1:"44",x2:"46",y2:"44",strokeDasharray:"3 3",opacity:"0.6"})]})});case"tasks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("rect",{x:"14",y:"14",width:"36",height:"6",rx:"1.5"}),(0,t.jsx)("rect",{x:"14",y:"26",width:"36",height:"6",rx:"1.5",opacity:"0.6"}),(0,t.jsx)("rect",{x:"14",y:"38",width:"36",height:"6",rx:"1.5",opacity:"0.35"})]})});case"messages":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M14 18 h36 a3 3 0 0 1 3 3 v18 a3 3 0 0 1 -3 3 h-18 l-8 6 v-6 h-10 a3 3 0 0 1 -3 -3 v-18 a3 3 0 0 1 3 -3 z"}),(0,t.jsx)("line",{x1:"22",y1:"28",x2:"42",y2:"28",opacity:"0.5"}),(0,t.jsx)("line",{x1:"22",y1:"34",x2:"36",y2:"34",opacity:"0.5"})]})});case"logs":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("path",{d:"M18 12 h22 l8 8 v32 a2 2 0 0 1 -2 2 h-28 a2 2 0 0 1 -2 -2 v-38 a2 2 0 0 1 2 -2 z"}),(0,t.jsx)("path",{d:"M40 12 v8 h8",opacity:"0.6"}),(0,t.jsx)("line",{x1:"24",y1:"32",x2:"40",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"24",y1:"38",x2:"40",y2:"38",opacity:"0.4"}),(0,t.jsx)("line",{x1:"24",y1:"44",x2:"34",y2:"44",opacity:"0.25"})]})});case"tokens":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"22",cy:"32",r:"8"}),(0,t.jsx)("line",{x1:"30",y1:"32",x2:"54",y2:"32"}),(0,t.jsx)("line",{x1:"44",y1:"32",x2:"44",y2:"38"}),(0,t.jsx)("line",{x1:"50",y1:"32",x2:"50",y2:"40"})]})});case"networks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"18"}),(0,t.jsx)("ellipse",{cx:"32",cy:"32",rx:"18",ry:"9",opacity:"0.55"}),(0,t.jsx)("line",{x1:"14",y1:"32",x2:"50",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"32",y1:"14",x2:"32",y2:"50",opacity:"0.55"})]})});default:return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...a,children:(0,t.jsxs)("g",{...r,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"14",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"32",cy:"32",r:"3"})]})})}}function l({variant:e="generic",title:s,sub:i,cta:o,compact:d=!1}){let c=r[e],x=s??c.title,h=i??c.sub;return(0,t.jsxs)("div",{className:`text-center ${d?"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:d?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${d?"text-sm":"text-base"}`,children:x}),h&&(0,t.jsx)("p",{className:`text-gray-500 ${d?"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 i({children:e}){return(0,t.jsx)("div",{className:"max-w-2xl mx-auto rounded-xl border border-[#2a2a4a] bg-[#111128] shadow-lg shadow-black/20",children:e})}function o({cmd:e}){let[a,r]=(0,s.useState)(!1),n=async()=>{try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1800)}catch{}};return(0,t.jsxs)("div",{className:"anet-empty-cmd flex items-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":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,l,"NodesEmptyState",0,function({hint:e,taskHistoryCount:s=0}){return e?.global_count?(0,t.jsx)(i,{children:(0,t.jsx)(l,{variant:"nodes",title:"No agents in this network",sub:`Server has ${e.global_count} nodes globally, but none are registered to the current network. Switch network or contact admin.`})}):s>0?(0,t.jsx)(i,{children:(0,t.jsx)(l,{variant:"nodes",title:"No agents online",sub:`Every agent in this network is currently offline. ${s.toLocaleString()} task${1===s?"":"s"} in history — they may have finished their work or disconnected.`,cta:{label:"View task history",href:"/tasks"}})}):(0,t.jsx)(i,{children:(0,t.jsxs)("div",{className:"text-center py-16 px-4",role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)("svg",{viewBox:"0 0 64 64",width:56,height:56,children:(0,t.jsxs)("g",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",children:[(0,t.jsx)("rect",{x:"10",y:"20",width:"44",height:"28",rx:"2"}),(0,t.jsx)("rect",{x:"20",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"32",y:"32",width:"6",height:"8",opacity:"0.5"}),(0,t.jsx)("rect",{x:"44",y:"32",width:"4",height:"8",opacity:"0.5"}),(0,t.jsx)("line",{x1:"10",y1:"26",x2:"54",y2:"26",opacity:"0.4"}),(0,t.jsx)("circle",{cx:"14",cy:"23",r:"0.8",fill:"currentColor"})]})})}),(0,t.jsx)("h3",{className:"font-medium text-gray-300 text-base",children:"Spin up your first agent"}),(0,t.jsx)("p",{className:"text-gray-500 text-sm mt-2 max-w-md mx-auto leading-relaxed",children:"Run this in a fresh terminal to register an agent with this CommHub:"}),(0,t.jsx)("div",{className:"mt-4 inline-block",children:(0,t.jsx)(o,{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:"→"})]})})]})})}])},59276,e=>{"use strict";var t=e.i(12629),s=e.i(11449);let a=async e=>{let t=await fetch(e);if(401===t.status)throw window.location.assign("/login"),Error("unauthorized");return t.json()},r={refreshInterval:5e3,dedupingInterval:3e3};function n(e,t){if(!t)return e;let s=e.includes("?")?"&":"?";return`${e}${s}network_id=${encodeURIComponent(t)}`}e.s(["useAnetConfig",0,function(){let{data:e}=(0,t.default)("/api/anet/config",a,{refreshInterval:3e4});return{config:e||null}},"useHealth",0,function(){let{data:e,error:s}=(0,t.default)("/api/hub/health",a,r);return{health:e||null,error:s}},"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:l}=(0,s.useNetworkId)(),{data:i,error:o,isLoading:d}=(0,t.default)(n(`/api/hub/messages?limit=${e}`,l),a,r);return{messages:i?.messages||[],error:o,isLoading:d}},"useSessions",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:l,error:i,isLoading:o}=(0,t.default)(n("/api/hub/status",e),a,r);return{sessions:l?.sessions||[],hint:l?._hint,error:i,isLoading:o}},"useStats",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:l,error:i}=(0,t.default)(n("/api/hub/stats",e),a,r);return{stats:l?.ok?l:null,error:i}},"useTasks",0,function(e){let{networkId:l}=(0,s.useNetworkId)(),i=new URLSearchParams({limit:"100",...e}).toString(),{data:o,error:d,isLoading:c}=(0,t.default)(n(`/api/hub/tasks?${i}`,l),a,r);return{tasks:o?.tasks||[],count:o?.count??0,source:o?.source,error:d,isLoading:c}}])},70732,e=>{"use strict";var t=e.i(22381),s=e.i(23910),a=e.i(56839),r=e.i(3479),n=e.i(59276),l=e.i(43058),i=e.i(76161),o=e.i(46228),d=e.i(98025);function c(e){return e?e.length>12?`${e.slice(0,8)}…`:e:"—"}e.s(["default",0,function(){let e,x,h,g,{sessions:u,isLoading:p}=(0,n.useSessions)(),{health:m}=(0,n.useHealth)(),y=m?.sse_sessions||{},b=e=>(e.network_id?y[`${e.network_id}:${e.alias}`]:void 0)??y[e.alias],[j,f]=(0,s.useState)(""),[v,N]=(0,s.useState)(""),[w,k]=(0,s.useState)("list"),[S,C]=(0,s.useState)({}),[_,A]=(0,s.useState)(null),[T,$]=(0,s.useState)({}),[I,L]=(0,s.useState)(null),E=u.map(e=>({...e,online:!!b(e)})).filter(e=>"online"===j?e.online:"offline"===j?!e.online:!j||j===e.status).filter(e=>!v||e.alias.toLowerCase().includes(v.toLowerCase())||(e.agent||"").toLowerCase().includes(v.toLowerCase())).sort((e,t)=>!!t.online-!!e.online||("working"===t.status)-("working"===e.status)),U=u.filter(e=>b(e)).length,O=e=>{A(t=>t===e?null:e),$(t=>({...t,[e]:{}}))},H=(e,t)=>{C(s=>({...s,[e]:t}))},M=async e=>{let t=S[e]?.trim()||"";if(t){$(t=>({...t,[e]:{sending:!0}}));try{let s=await fetch("/api/hub/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({alias:e,task:t})}),a=await s.json();if(!s.ok||a?.ok===!1)throw Error(a?.error||"Send failed");C(t=>({...t,[e]:""})),$(t=>({...t,[e]:{success:"Task sent"}})),A(null)}catch(t){$(s=>({...s,[e]:{error:t instanceof Error?t.message:"Send failed"}}))}}};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:"Nodes"}),(0,t.jsxs)("span",{className:"text-xs bg-green-900/30 text-green-400 px-2 py-0.5 rounded-full border border-green-800/30",children:[U," online"]}),(0,t.jsxs)("span",{className:"text-xs bg-gray-900/30 text-gray-400 px-2 py-0.5 rounded-full border border-gray-800/30",children:[u.length," total"]})]}),u.length>0&&(e=E.filter(e=>e.online&&"working"===e.status).length,x=E.filter(e=>e.online&&"idle"===e.status).length,h=E.filter(e=>!e.online).length,g=E.length||1,(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsxs)("div",{className:"flex h-2 rounded-full overflow-hidden bg-gray-800",children:[e>0&&(0,t.jsx)("div",{className:"bg-green-500",style:{width:`${e/g*100}%`}}),x>0&&(0,t.jsx)("div",{className:"bg-cyan-500",style:{width:`${x/g*100}%`}}),h>0&&(0,t.jsx)("div",{className:"bg-gray-600",style:{width:`${h/g*100}%`}})]}),(0,t.jsxs)("div",{className:"flex gap-4 mt-1.5 text-[10px] text-gray-500",children:[e>0&&(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500 mr-1"}),e," working"]}),x>0&&(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-cyan-500 mr-1"}),x," idle"]}),h>0&&(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-gray-600 mr-1"}),h," offline"]})]})]})),u.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-3 mb-6",children:[(0,t.jsx)("input",{type:"text",value:v,onChange:e=>N(e.target.value),placeholder:"Search nodes...",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-48"}),(0,t.jsxs)("select",{value:j,onChange:e=>f(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"}),(0,t.jsx)("option",{value:"online",children:"Online"}),(0,t.jsx)("option",{value:"offline",children:"Offline"}),(0,t.jsx)("option",{value:"working",children:"Working"}),(0,t.jsx)("option",{value:"idle",children:"Idle"}),(0,t.jsx)("option",{value:"blocked",children:"Blocked"}),(0,t.jsx)("option",{value:"error",children:"Error"})]}),(0,t.jsx)("div",{className:"hidden sm:flex ml-auto rounded-lg border border-[#2a2a4a] bg-[#111128] p-1 text-sm",children:["list","grid"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>k(e),className:`rounded-md px-3 py-1.5 transition-colors ${w===e?"bg-cyan-500/10 text-cyan-300":"text-gray-500 hover:text-gray-200"}`,children:"list"===e?"List":"Grid"},e))})]}),p?(0,t.jsx)("div",{className:"animate-pulse space-y-2",children:[1,2,3,4].map(e=>(0,t.jsx)("div",{className:"h-16 bg-gray-800/20 rounded-lg"},e))}):0===E.length?0===u.length?(0,t.jsx)(i.NodesEmptyState,{}):(0,t.jsx)(i.EmptyState,{variant:"nodes",title:"No nodes match your filters",sub:"Try clearing search or status filters, or wait for an agent to register."}):"grid"===w?(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:E.map(e=>{let s=e.online?e.status:"offline",n=T[e.alias]||{},l="number"==typeof e.progress?e.progress:0;return(0,t.jsxs)("div",{className:`relative overflow-hidden rounded-xl border border-[#2a2a4a] bg-[#111128] p-4 transition-colors ${!e.online?"opacity-60":""}`,children:[!e.online&&(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:(0,t.jsx)("span",{className:"rotate-[-20deg] rounded-xl border border-white/10 bg-black/20 px-5 py-2 text-xl font-bold uppercase tracking-[0.35em] text-white/10",children:"Offline"})}),(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(o.AliasAvatar,{alias:e.alias,size:36}),(0,t.jsxs)(a.default,{href:`/node?alias=${encodeURIComponent(e.alias)}`,className:"min-w-0 flex-1 hover:text-cyan-300",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"truncate text-base font-semibold text-white",children:e.alias}),(0,t.jsx)("span",{className:`shrink-0 rounded-md border px-2 py-0.5 text-[10px] uppercase tracking-wide ${d.SESSION_STATUS_CHIP_CLASS[s]||d.SESSION_STATUS_CHIP_CLASS.offline}`,children:s})]}),(0,t.jsxs)("div",{className:"mt-0.5 truncate text-xs text-gray-500",children:[e.agent||"—",(0,t.jsx)("span",{className:"text-gray-700 mx-1.5",children:"·"}),(0,t.jsx)("span",{title:e.server||"",children:c(e.server)})]})]}),(0,t.jsxs)("div",{className:"flex gap-1.5 shrink-0",children:[(0,t.jsx)("button",{type:"button",onClick:()=>L(e.alias),className:"rounded-lg border border-green-500/20 bg-green-500/10 px-3 py-1.5 text-xs text-green-300 transition-colors hover:bg-green-500/20",children:"Chat"}),(0,t.jsx)("button",{type:"button",onClick:()=>O(e.alias),className:"rounded-lg border border-cyan-500/20 bg-cyan-500/10 px-3 py-1.5 text-xs text-cyan-300 transition-colors hover:bg-cyan-500/20",children:"Task"})]})]}),(0,t.jsxs)("div",{className:"mt-3 rounded-lg border border-[#1a1a2a] bg-[#0a0a15] px-3 py-2 text-xs",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-gray-600",children:"Current task"}),(0,t.jsx)("span",{className:"text-[10px] text-gray-600",children:(0,r.timeAgo)(e.last_seen_at||e.updated_at)})]}),(0,t.jsx)("div",{className:`mt-1 line-clamp-2 ${e.task?"text-gray-300":"text-gray-600 italic"}`,children:e.task||"No current task"})]}),l>0&&l<100&&(0,t.jsx)("div",{className:"mt-3 h-1.5 overflow-hidden rounded-full bg-gray-800",children:(0,t.jsx)("div",{className:"h-1.5 rounded-full bg-cyan-400 transition-all",style:{width:`${l}%`}})}),_===e.alias&&(0,t.jsxs)("div",{className:"mt-4 space-y-2 rounded-lg border border-[#2a2a4a] bg-[#0a0a15] p-3",children:[(0,t.jsx)("input",{type:"text",value:S[e.alias]||"",onChange:t=>H(e.alias,t.target.value),onKeyDown:t=>"Enter"===t.key&&M(e.alias),placeholder:`Send task to ${e.alias}...`,className:"w-full rounded-lg border border-[#2a2a4a] bg-[#050510] px-3 py-2 text-xs text-white placeholder-gray-600 focus:border-cyan-500 focus:outline-none"}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>A(null),className:"rounded-lg border border-gray-700 px-3 py-1.5 text-xs text-gray-400 hover:text-gray-200",children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:()=>M(e.alias),disabled:n.sending||!(S[e.alias]||"").trim(),className:"rounded-lg bg-cyan-600 px-3 py-1.5 text-xs text-white hover:bg-cyan-500 disabled:cursor-not-allowed disabled:bg-gray-700",children:n.sending?"Sending...":"Send"})]})]}),n.error&&(0,t.jsx)("div",{className:"mt-2 text-xs text-red-400",children:n.error}),n.success&&_!==e.alias&&(0,t.jsx)("div",{className:"mt-2 text-xs text-green-400",children:n.success})]},e.alias)})}):(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:"Alias"}),(0,t.jsx)("div",{className:"col-span-2",children:"Agent · Server"}),(0,t.jsx)("div",{className:"col-span-4",children:"Current Task"}),(0,t.jsx)("div",{className:"col-span-1",children:"Updated"}),(0,t.jsx)("div",{className:"col-span-2 text-right",children:"Actions"})]}),E.map(e=>{let s=e.online?e.status:"offline",n=T[e.alias]||{};return(0,t.jsxs)("div",{className:`rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 transition-colors hover:border-[#3a3a5a] ${!e.online?"opacity-50":""}`,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:`text-xs px-2 py-0.5 rounded-md border ${d.SESSION_STATUS_CHIP_CLASS[s]||d.SESSION_STATUS_CHIP_CLASS.offline}`,children:s})}),(0,t.jsx)("div",{className:"col-span-2 min-w-0",children:(0,t.jsxs)(a.default,{href:`/node?alias=${encodeURIComponent(e.alias)}`,className:"flex items-center gap-2 min-w-0 hover:text-cyan-300",children:[(0,t.jsx)(o.AliasAvatar,{alias:e.alias,size:20}),(0,t.jsx)("span",{className:"truncate text-sm font-medium text-white",children:e.alias})]})}),(0,t.jsxs)("div",{className:"col-span-2 truncate text-xs text-gray-400",title:e.server||"",children:[e.agent||"--",(0,t.jsx)("span",{className:"text-gray-700 mx-1.5",children:"·"}),c(e.server)]}),(0,t.jsx)("div",{className:"col-span-4 truncate text-xs text-gray-500",title:e.task||"",children:e.task||"--"}),(0,t.jsx)("div",{className:"col-span-1 text-xs text-gray-500",children:(0,r.timeAgo)(e.last_seen_at||e.updated_at)}),(0,t.jsxs)("div",{className:"col-span-2 flex justify-end gap-1.5",children:[(0,t.jsx)("button",{type:"button",onClick:()=>L(e.alias),className:"rounded-lg border border-green-500/20 bg-green-500/10 px-2 py-1 text-xs text-green-300 hover:bg-green-500/20",children:"Chat"}),(0,t.jsx)("button",{type:"button",onClick:()=>O(e.alias),className:"rounded-lg border border-cyan-500/20 bg-cyan-500/10 px-2 py-1 text-xs text-cyan-300 hover:bg-cyan-500/20",children:"Task"})]})]}),(0,t.jsxs)("div",{className:"sm:hidden space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)(o.AliasAvatar,{alias:e.alias,size:28}),(0,t.jsxs)(a.default,{href:`/node?alias=${encodeURIComponent(e.alias)}`,className:"min-w-0 flex-1 hover:text-cyan-300",children:[(0,t.jsx)("div",{className:"truncate text-sm font-medium text-white",children:e.alias}),(0,t.jsxs)("div",{className:"truncate text-[10px] text-gray-500",children:[e.agent||"—"," · ",(0,r.timeAgo)(e.last_seen_at||e.updated_at)]})]}),(0,t.jsx)("span",{className:`shrink-0 text-xs px-2 py-0.5 rounded-md border ${d.SESSION_STATUS_CHIP_CLASS[s]||d.SESSION_STATUS_CHIP_CLASS.offline}`,children:s})]}),e.task&&(0,t.jsx)("div",{className:"truncate text-xs text-gray-500",children:e.task}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>L(e.alias),className:"flex-1 rounded-lg border border-green-500/20 bg-green-500/10 px-3 py-2 text-xs text-green-300 hover:bg-green-500/20",children:"Chat"}),(0,t.jsx)("button",{type:"button",onClick:()=>O(e.alias),className:"flex-1 rounded-lg border border-cyan-500/20 bg-cyan-500/10 px-3 py-2 text-xs text-cyan-300 hover:bg-cyan-500/20",children:"Send Task"})]})]}),_===e.alias&&(0,t.jsxs)("div",{className:"mt-3 space-y-2 border-t border-[#2a2a4a] pt-3",children:[(0,t.jsx)("input",{type:"text",value:S[e.alias]||"",onChange:t=>H(e.alias,t.target.value),onKeyDown:t=>"Enter"===t.key&&M(e.alias),placeholder:`Send task to ${e.alias}...`,className:"w-full rounded-lg border border-[#2a2a4a] bg-[#0a0a15] px-3 py-2 text-xs text-white placeholder-gray-600 focus:border-cyan-500 focus:outline-none"}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>A(null),className:"rounded-lg border border-gray-700 px-3 py-1.5 text-xs text-gray-400 hover:text-gray-200",children:"Cancel"}),(0,t.jsx)("button",{type:"button",onClick:()=>M(e.alias),disabled:n.sending||!(S[e.alias]||"").trim(),className:"rounded-lg bg-cyan-600 px-3 py-1.5 text-xs text-white hover:bg-cyan-500 disabled:cursor-not-allowed disabled:bg-gray-700",children:n.sending?"Sending...":"Send"})]})]}),n.error&&(0,t.jsx)("div",{className:"mt-2 text-xs text-red-400",children:n.error}),n.success&&_!==e.alias&&(0,t.jsx)("div",{className:"mt-2 text-xs text-green-400",children:n.success})]},e.alias)})]}),I&&(0,t.jsx)(l.TaskChatPanel,{alias:I,onClose:()=>L(null)})]})}])}]);