@sleep2agi/agent-network-dashboard 0.4.5-preview.77 → 0.4.5-preview.79

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 (163) hide show
  1. package/.mcp.json +11 -0
  2. package/.next/BUILD_ID +1 -1
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/diagnostics/route-bundle-stats.json +6 -6
  5. package/.next/fallback-build-manifest.json +3 -3
  6. package/.next/prerender-manifest.json +3 -3
  7. package/.next/server/app/_global-error.html +1 -1
  8. package/.next/server/app/_global-error.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/_not-found.html +2 -2
  16. package/.next/server/app/_not-found.rsc +2 -2
  17. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  18. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  20. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  21. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  22. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  23. package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  24. package/.next/server/app/admin.html +2 -2
  25. package/.next/server/app/admin.rsc +2 -2
  26. package/.next/server/app/admin.segments/_full.segment.rsc +2 -2
  27. package/.next/server/app/admin.segments/_head.segment.rsc +1 -1
  28. package/.next/server/app/admin.segments/_index.segment.rsc +2 -2
  29. package/.next/server/app/admin.segments/_tree.segment.rsc +2 -2
  30. package/.next/server/app/admin.segments/admin/__PAGE__.segment.rsc +1 -1
  31. package/.next/server/app/admin.segments/admin.segment.rsc +1 -1
  32. package/.next/server/app/index.html +2 -2
  33. package/.next/server/app/index.rsc +3 -3
  34. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  35. package/.next/server/app/index.segments/_full.segment.rsc +3 -3
  36. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  37. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  38. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  39. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  40. package/.next/server/app/login.html +2 -2
  41. package/.next/server/app/login.rsc +3 -3
  42. package/.next/server/app/login.segments/_full.segment.rsc +3 -3
  43. package/.next/server/app/login.segments/_head.segment.rsc +1 -1
  44. package/.next/server/app/login.segments/_index.segment.rsc +2 -2
  45. package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  46. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  47. package/.next/server/app/login.segments/login.segment.rsc +1 -1
  48. package/.next/server/app/logs/page_client-reference-manifest.js +1 -1
  49. package/.next/server/app/logs.html +2 -2
  50. package/.next/server/app/logs.rsc +2 -2
  51. package/.next/server/app/logs.segments/_full.segment.rsc +2 -2
  52. package/.next/server/app/logs.segments/_head.segment.rsc +1 -1
  53. package/.next/server/app/logs.segments/_index.segment.rsc +2 -2
  54. package/.next/server/app/logs.segments/_tree.segment.rsc +2 -2
  55. package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +1 -1
  56. package/.next/server/app/logs.segments/logs.segment.rsc +1 -1
  57. package/.next/server/app/messages/page_client-reference-manifest.js +1 -1
  58. package/.next/server/app/messages.html +2 -2
  59. package/.next/server/app/messages.rsc +2 -2
  60. package/.next/server/app/messages.segments/_full.segment.rsc +2 -2
  61. package/.next/server/app/messages.segments/_head.segment.rsc +1 -1
  62. package/.next/server/app/messages.segments/_index.segment.rsc +2 -2
  63. package/.next/server/app/messages.segments/_tree.segment.rsc +2 -2
  64. package/.next/server/app/messages.segments/messages/__PAGE__.segment.rsc +1 -1
  65. package/.next/server/app/messages.segments/messages.segment.rsc +1 -1
  66. package/.next/server/app/node/page_client-reference-manifest.js +1 -1
  67. package/.next/server/app/node.html +2 -2
  68. package/.next/server/app/node.rsc +2 -2
  69. package/.next/server/app/node.segments/_full.segment.rsc +2 -2
  70. package/.next/server/app/node.segments/_head.segment.rsc +1 -1
  71. package/.next/server/app/node.segments/_index.segment.rsc +2 -2
  72. package/.next/server/app/node.segments/_tree.segment.rsc +2 -2
  73. package/.next/server/app/node.segments/node/__PAGE__.segment.rsc +1 -1
  74. package/.next/server/app/node.segments/node.segment.rsc +1 -1
  75. package/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
  76. package/.next/server/app/nodes.html +2 -2
  77. package/.next/server/app/nodes.rsc +2 -2
  78. package/.next/server/app/nodes.segments/_full.segment.rsc +2 -2
  79. package/.next/server/app/nodes.segments/_head.segment.rsc +1 -1
  80. package/.next/server/app/nodes.segments/_index.segment.rsc +2 -2
  81. package/.next/server/app/nodes.segments/_tree.segment.rsc +2 -2
  82. package/.next/server/app/nodes.segments/nodes/__PAGE__.segment.rsc +1 -1
  83. package/.next/server/app/nodes.segments/nodes.segment.rsc +1 -1
  84. package/.next/server/app/page_client-reference-manifest.js +1 -1
  85. package/.next/server/app/server-logs/page_client-reference-manifest.js +1 -1
  86. package/.next/server/app/server-logs.html +2 -2
  87. package/.next/server/app/server-logs.rsc +3 -3
  88. package/.next/server/app/server-logs.segments/_full.segment.rsc +3 -3
  89. package/.next/server/app/server-logs.segments/_head.segment.rsc +1 -1
  90. package/.next/server/app/server-logs.segments/_index.segment.rsc +2 -2
  91. package/.next/server/app/server-logs.segments/_tree.segment.rsc +2 -2
  92. package/.next/server/app/server-logs.segments/server-logs/__PAGE__.segment.rsc +2 -2
  93. package/.next/server/app/server-logs.segments/server-logs.segment.rsc +1 -1
  94. package/.next/server/app/settings/networks/page_client-reference-manifest.js +1 -1
  95. package/.next/server/app/settings/networks.html +2 -2
  96. package/.next/server/app/settings/networks.rsc +2 -2
  97. package/.next/server/app/settings/networks.segments/_full.segment.rsc +2 -2
  98. package/.next/server/app/settings/networks.segments/_head.segment.rsc +1 -1
  99. package/.next/server/app/settings/networks.segments/_index.segment.rsc +2 -2
  100. package/.next/server/app/settings/networks.segments/_tree.segment.rsc +2 -2
  101. package/.next/server/app/settings/networks.segments/settings/networks/__PAGE__.segment.rsc +1 -1
  102. package/.next/server/app/settings/networks.segments/settings/networks.segment.rsc +1 -1
  103. package/.next/server/app/settings/networks.segments/settings.segment.rsc +1 -1
  104. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  105. package/.next/server/app/settings/tokens/page_client-reference-manifest.js +1 -1
  106. package/.next/server/app/settings/tokens.html +2 -2
  107. package/.next/server/app/settings/tokens.rsc +2 -2
  108. package/.next/server/app/settings/tokens.segments/_full.segment.rsc +2 -2
  109. package/.next/server/app/settings/tokens.segments/_head.segment.rsc +1 -1
  110. package/.next/server/app/settings/tokens.segments/_index.segment.rsc +2 -2
  111. package/.next/server/app/settings/tokens.segments/_tree.segment.rsc +2 -2
  112. package/.next/server/app/settings/tokens.segments/settings/tokens/__PAGE__.segment.rsc +1 -1
  113. package/.next/server/app/settings/tokens.segments/settings/tokens.segment.rsc +1 -1
  114. package/.next/server/app/settings/tokens.segments/settings.segment.rsc +1 -1
  115. package/.next/server/app/settings.html +2 -2
  116. package/.next/server/app/settings.rsc +3 -3
  117. package/.next/server/app/settings.segments/_full.segment.rsc +3 -3
  118. package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  119. package/.next/server/app/settings.segments/_index.segment.rsc +2 -2
  120. package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  121. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +2 -2
  122. package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  123. package/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
  124. package/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
  125. package/.next/server/app/tasks.html +2 -2
  126. package/.next/server/app/tasks.rsc +2 -2
  127. package/.next/server/app/tasks.segments/_full.segment.rsc +2 -2
  128. package/.next/server/app/tasks.segments/_head.segment.rsc +1 -1
  129. package/.next/server/app/tasks.segments/_index.segment.rsc +2 -2
  130. package/.next/server/app/tasks.segments/_tree.segment.rsc +2 -2
  131. package/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +1 -1
  132. package/.next/server/app/tasks.segments/tasks.segment.rsc +1 -1
  133. package/.next/server/chunks/ssr/_0nne7mz._.js +1 -1
  134. package/.next/server/chunks/ssr/_0nne7mz._.js.map +1 -1
  135. package/.next/server/chunks/ssr/app_0aum_g5._.js +1 -1
  136. package/.next/server/chunks/ssr/app_0aum_g5._.js.map +1 -1
  137. package/.next/server/chunks/ssr/app_0esuljp._.js +1 -1
  138. package/.next/server/chunks/ssr/app_0esuljp._.js.map +1 -1
  139. package/.next/server/chunks/ssr/app_server-logs_page_tsx_0_kpp1p._.js +1 -1
  140. package/.next/server/chunks/ssr/app_server-logs_page_tsx_0_kpp1p._.js.map +1 -1
  141. package/.next/server/middleware-build-manifest.js +3 -3
  142. package/.next/server/pages/404.html +2 -2
  143. package/.next/server/pages/500.html +1 -1
  144. package/.next/server/server-reference-manifest.js +1 -1
  145. package/.next/server/server-reference-manifest.json +1 -1
  146. package/.next/static/chunks/08i3fgrjz9_yj.css +2 -0
  147. package/.next/static/chunks/0g097hh6uutmx.js +1 -0
  148. package/.next/static/chunks/0gtbwcilfu6b7.js +1 -0
  149. package/.next/static/chunks/{0wd.9d9bnbdp5.js → 0ixcv.8rbkqk4.js} +1 -1
  150. package/.next/static/chunks/{0xvy5xvlv9zdk.js → 0upl39n2natlr.js} +1 -1
  151. package/.next/trace +2 -2
  152. package/.next/trace-build +1 -1
  153. package/app/components/TopoGraph.tsx +39 -8
  154. package/app/server-logs/page.tsx +7 -3
  155. package/package.json +1 -1
  156. package/scripts/fold-only.mjs +3 -0
  157. package/scripts/loop-review.mjs +44 -0
  158. package/.next/static/chunks/013_kw~b7_tqy.js +0 -1
  159. package/.next/static/chunks/0uh.dd0_.y_dh.js +0 -1
  160. package/.next/static/chunks/13u~uqoww_0ib.css +0 -2
  161. /package/.next/static/{rQWa5-WjmzvefLI-_ocT9 → oC8ONff7ka5Sin1dUwK-v}/_buildManifest.js +0 -0
  162. /package/.next/static/{rQWa5-WjmzvefLI-_ocT9 → oC8ONff7ka5Sin1dUwK-v}/_clientMiddlewareManifest.js +0 -0
  163. /package/.next/static/{rQWa5-WjmzvefLI-_ocT9 → oC8ONff7ka5Sin1dUwK-v}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,16015,(e,t,s)=>{},98547,(e,t,s)=>{var a=e.i(47167);e.r(16015);var r=e.r(71645),n=r&&"object"==typeof r&&"default"in r?r:{default:r},l=void 0!==a.default&&a.default.env&&!0,i=function(e){return"[object String]"===Object.prototype.toString.call(e)},o=function(){function e(e){var t=void 0===e?{}:e,s=t.name,a=void 0===s?"stylesheet":s,r=t.optimizeForSpeed,n=void 0===r?l:r;d(i(a),"`name` must be a string"),this._name=a,this._deletedRulePlaceholder="#"+a+"-deleted-rule____{}",d("boolean"==typeof n,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=n,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var o="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=o?o.getAttribute("content"):null}var t,s=e.prototype;return s.setOptimizeForSpeed=function(e){d("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),d(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},s.isOptimizeForSpeed=function(){return this._optimizeForSpeed},s.inject=function(){var e=this;if(d(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(l||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,s){return"number"==typeof s?e._serverSheet.cssRules[s]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),s},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},s.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},s.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},s.insertRule=function(e,t){if(d(i(e),"`insertRule` accepts only strings"),"u"<typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var s=this.getSheet();"number"!=typeof t&&(t=s.cssRules.length);try{s.insertRule(e,t)}catch(t){return l||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var a=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,a))}return this._rulesCount++},s.replaceRule=function(e,t){if(this._optimizeForSpeed||"u"<typeof window){var s="u">typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!s.cssRules[e])return e;s.deleteRule(e);try{s.insertRule(t,e)}catch(a){l||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),s.insertRule(this._deletedRulePlaceholder,e)}}else{var a=this._tags[e];d(a,"old rule at index `"+e+"` not found"),a.textContent=t}return e},s.deleteRule=function(e){if("u"<typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];d(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},s.flush=function(){this._injected=!1,this._rulesCount=0,"u">typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},s.cssRules=function(){var e=this;return"u"<typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,s){return s?t=t.concat(Array.prototype.map.call(e.getSheetForTag(s).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},s.makeStyleTag=function(e,t,s){t&&d(i(t),"makeStyleTag accepts only strings as second parameter");var a=document.createElement("style");this._nonce&&a.setAttribute("nonce",this._nonce),a.type="text/css",a.setAttribute("data-"+e,""),t&&a.appendChild(document.createTextNode(t));var r=document.head||document.getElementsByTagName("head")[0];return s?r.insertBefore(a,s):r.appendChild(a),a},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var s=0;s<t.length;s++){var a=t[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}(e.prototype,t),e}();function d(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var c=function(e){for(var t=5381,s=e.length;s;)t=33*t^e.charCodeAt(--s);return t>>>0},x={};function h(e,t){if(!t)return"jsx-"+e;var s=String(t),a=e+s;return x[a]||(x[a]="jsx-"+c(e+"-"+s)),x[a]}function u(e,t){"u"<typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var s=e+t;return x[s]||(x[s]=t.replace(/__jsx-style-dynamic-selector/g,e)),x[s]}var f=function(){function e(e){var t=void 0===e?{}:e,s=t.styleSheet,a=void 0===s?null:s,r=t.optimizeForSpeed,n=void 0!==r&&r;this._sheet=a||new o({name:"styled-jsx",optimizeForSpeed:n}),this._sheet.inject(),a&&"boolean"==typeof n&&(this._sheet.setOptimizeForSpeed(n),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"u">typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var s=this.getIdAndRules(e),a=s.styleId,r=s.rules;if(a in this._instancesCounts){this._instancesCounts[a]+=1;return}var n=r.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[a]=n,this._instancesCounts[a]=1},t.remove=function(e){var t=this,s=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(s in this._instancesCounts,"styleId: `"+s+"` not found"),this._instancesCounts[s]-=1,this._instancesCounts[s]<1){var a=this._fromServer&&this._fromServer[s];a?(a.parentNode.removeChild(a),delete this._fromServer[s]):(this._indices[s].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[s]),delete this._instancesCounts[s]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],s=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return s[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,s;return t=this.cssRules(),void 0===(s=e)&&(s={}),t.map(function(e){var t=e[0],a=e[1];return n.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:s.nonce?s.nonce:void 0,dangerouslySetInnerHTML:{__html:a}})})},t.getIdAndRules=function(e){var t=e.children,s=e.dynamic,a=e.id;if(s){var r=h(a,s);return{styleId:r,rules:Array.isArray(t)?t.map(function(e){return u(r,e)}):[u(r,t)]}}return{styleId:h(a),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),m=r.createContext(null);function p(){return new f}function g(){return r.useContext(m)}m.displayName="StyleSheetContext";var b=n.default.useInsertionEffect||n.default.useLayoutEffect,y="u">typeof window?p():void 0;function j(e){var t=y||g();return t&&("u"<typeof window?t.add(e):b(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}j.dynamic=function(e){return e.map(function(e){return h(e[0],e[1])}).join(" ")},s.StyleRegistry=function(e){var t=e.registry,s=e.children,a=r.useContext(m),l=r.useState(function(){return a||t||p()})[0];return n.default.createElement(m.Provider,{value:l},s)},s.createStyleRegistry=p,s.style=j,s.useStyleRegistry=g},21373,(e,t,s)=>{t.exports=e.r(98547).style},31713,e=>{"use strict";var t=e.i(47167),s=e.i(18050),a=e.i(71645),r=e.i(22016),n=e.i(18150);function l({online:e,working:t,total:a,version:r,uptime:n}){let o=a>0?Math.round(e/a*100):0,d=0===a;return(0,s.jsxs)("div",{className:d?"mb-4":"mb-8",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mb-4",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-white tracking-tight",children:"Agent Network"}),(0,s.jsxs)("span",{className:"text-xs text-gray-500",children:["CommHub ",r," · ",n]})]}),d?(0,s.jsxs)("div",{className:"anet-stat-strip flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-gray-500 border-t border-b border-[#2a2a4a] py-2",children:[(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full bg-gray-600"}),(0,s.jsx)("span",{className:"text-gray-300 tabular-nums",children:"0"})," online"]}),(0,s.jsx)("span",{className:"text-gray-700",children:"·"}),(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full bg-gray-600"}),(0,s.jsx)("span",{className:"text-gray-300 tabular-nums",children:"0"})," working"]}),(0,s.jsx)("span",{className:"text-gray-700",children:"·"}),(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full bg-gray-600"}),(0,s.jsx)("span",{className:"text-gray-300 tabular-nums",children:"0"})," registered"]})]}):(0,s.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[(0,s.jsx)(i,{value:e,label:"Online",sub:`${o}% of fleet`,color:"text-green-400",accent:"from-green-500/20 to-green-500/0",border:"border-green-500/15"}),(0,s.jsx)(i,{value:t,label:"Working",sub:e>0?`${Math.round(t/e*100)}% utilization`:"--",color:"text-cyan-400",accent:"from-cyan-500/20 to-cyan-500/0",border:"border-cyan-500/15"}),(0,s.jsx)(i,{value:a-e,label:"Offline",sub:a-e==0?"All systems go":`${a-e} disconnected`,color:"text-gray-400",accent:"from-gray-500/10 to-gray-500/0",border:"border-gray-500/15"}),(0,s.jsx)(i,{value:a,label:"Total",sub:"Registered nodes",color:"text-white",accent:"from-blue-500/15 to-blue-500/0",border:"border-blue-500/15"})]})]})}function i({value:e,label:t,sub:a,color:r,accent:n,border:l}){let o=r.replace("text-","").split("-")[0];return(0,s.jsxs)("div",{"data-anet-stat-card":o,className:`anet-stat-card relative overflow-hidden rounded-xl border ${l} bg-[#111128] px-4 py-3 transition-all`,children:[(0,s.jsx)("div",{className:`absolute inset-0 bg-gradient-to-br ${n} pointer-events-none`}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:`text-3xl font-bold ${r} tabular-nums leading-tight`,children:e}),(0,s.jsx)("div",{className:"text-sm text-gray-300 mt-0.5",children:t}),(0,s.jsx)("div",{className:"text-xs text-gray-600 mt-1",children:a})]})]})}function o(){let[e,t]=(0,a.useState)(""),[r,n]=(0,a.useState)(!1),[l,i]=(0,a.useState)(""),o=async()=>{if(e.trim()){n(!0),i("");try{let s=await fetch("/api/hub/broadcast",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}),a=await s.json();a.ok?(i(`Broadcast sent to ${a.recipients} node(s)`),t("")):i(`Failed: ${a.error||"Send error"}`)}catch(e){i(`Failed: ${e instanceof Error?e.message:"Send error"}`)}n(!1),setTimeout(()=>i(""),5e3)}};return(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"text",value:e,onChange:e=>t(e.target.value),onKeyDown:e=>"Enter"===e.key&&o(),placeholder:"Broadcast message to all online agents...",maxLength:500,"aria-label":"Broadcast message",className:"flex-1 bg-[#111128] border border-[#2a2a4a] rounded-lg px-4 py-2.5 text-sm text-white placeholder-gray-600 focus:border-blue-500/50 focus:ring-1 focus:ring-blue-500/20 focus:outline-none transition-colors"}),(0,s.jsx)("button",{onClick:o,disabled:r||!e.trim(),"aria-label":"Send broadcast",className:"flex items-center gap-2 px-5 py-2.5 bg-blue-600 hover:bg-blue-500 disabled:bg-gray-800 disabled:text-gray-600 text-white text-sm rounded-lg transition-all font-medium cursor-pointer disabled:cursor-not-allowed",children:r?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("svg",{"aria-hidden":!0,className:"w-4 h-4 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",opacity:"0.25"}),(0,s.jsx)("path",{d:"M4 12a8 8 0 018-8",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]}),(0,s.jsx)("span",{children:"Sending…"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("svg",{"aria-hidden":!0,className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M3 11v3a1 1 0 0 0 1 1h2l3.29 3.29a1 1 0 0 0 1.71-.71V7.42a1 1 0 0 0-1.71-.71L6 10H4a1 1 0 0 0-1 1Z"}),(0,s.jsx)("path",{d:"M16 8a5 5 0 0 1 0 6",opacity:"0.7"}),(0,s.jsx)("path",{d:"M19 5a9 9 0 0 1 0 12",opacity:"0.45"})]}),(0,s.jsx)("span",{children:"Broadcast"})]})})]}),e.length>0&&(0,s.jsxs)("div",{className:"text-right text-xs text-gray-600 mt-1 tabular-nums",children:[e.length,"/500"]}),l&&(0,s.jsx)("div",{className:`mt-3 text-sm text-center anet-fade-in ${l.startsWith("Failed")?"text-red-400":"text-green-400/80"}`,children:l})]})}function d(e,t,s,a=0){let r=t<=2?Math.PI:1.78*Math.PI,n=-Math.PI/2-r/2,l=t<=1?-Math.PI/2:n+r*e/(t-1)+a;return{x:500+s*Math.cos(l),y:330+s*Math.sin(l)}}function c(e,t,s=0){let a=(e.x+t.x)/2,r=(e.y+t.y)/2,n=t.x-e.x,l=t.y-e.y,i=Math.hypot(n,l)||1,o={x:a+-l/i*s,y:r+n/i*s};return`M${e.x},${e.y} Q${o.x},${o.y} ${t.x},${t.y}`}function x(e,t){return e.length>t?`${e.slice(0,t-1)}...`:e}let h={panelStops:["#0b1220","#080814","#101018"],radarStops:[{color:"#22d3ee",opacity:.18},{color:"#22c55e",opacity:.045},{color:"#020617",opacity:0}],arrowFill:"#67e8f9",ringStroke:"#164e63",spokeStroke:{active:"#22d3ee",idle:"#155e75"},flowEdge:"#67e8f9",flowPath:"#e0f2fe",flowParticle:"#fef08a",nodeFill:{online:"#020617",offline:"#080814"},labelBox:{fill:"#020617",stroke:"#1f2937"},legendBox:{fill:"#020617",stroke:"#1f2937"},legendText:"#94a3b8",legendHeadline:"#e5e7eb",legendAccent:"#67e8f9",containerBg:"#080814",containerBorder:"#2a2a4a",topRailGradient:"from-transparent via-cyan-400/70 to-transparent"},u={panelStops:["#f8fafc","#ffffff","#f1f5f9"],radarStops:[{color:"#10b981",opacity:.06},{color:"#3b82f6",opacity:.03},{color:"#ffffff",opacity:0}],arrowFill:"#10b981",ringStroke:"#cbd5e1",spokeStroke:{active:"#10b981",idle:"#cbd5e1"},flowEdge:"#10b981",flowPath:"#475569",flowParticle:"#f59e0b",nodeFill:{online:"#ffffff",offline:"#f8fafc"},labelBox:{fill:"#ffffff",stroke:"#e2e8f0"},legendBox:{fill:"#ffffff",stroke:"#e2e8f0"},legendText:"#475569",legendHeadline:"#0f172a",legendAccent:"#0d9488",containerBg:"#ffffff",containerBorder:"#e3e6eb",topRailGradient:"from-transparent via-emerald-500/40 to-transparent"};function f({sessions:e,sseSessions:t}){let r="light"===function(){let[e,t]=(0,a.useState)("dark");return(0,a.useEffect)(()=>{let e=()=>{let e=document.documentElement.getAttribute("data-theme")||"cyber";t("light"===e||"mint"===e?"light":"dark")};e();let s=new MutationObserver(e);return s.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>s.disconnect()},[]),e}(),n=r?u:h,[l,i]=(0,a.useState)([]);(0,a.useEffect)(()=>{let e=async()=>{try{let e=await fetch("/api/hub/messages?limit=50");if(401===e.status)return void window.location.assign("/login");let t=await e.json();i(t.messages||[])}catch{}};e();let t=setInterval(e,5e3);return()=>clearInterval(t)},[]);let{onlineNodes:o,offlineNodes:m,nodePositions:p,flowLinks:g,activeAliases:b}=(0,a.useMemo)(()=>{let s,a=e=>(e.network_id?t[`${e.network_id}:${e.alias}`]:void 0)??t[e.alias],r=e.filter(e=>"offline"!==e.status||a(e)),n=e.filter(e=>"offline"===e.status&&!a(e)),i={},o=r.length>8;if(o){let e=Math.ceil(r.length/2),t=r.length-e,s=r.slice(0,e),a=r.slice(e);s.forEach((t,s)=>{i[t.alias]=d(s,Math.max(e,1),175)});let n=e<=2?Math.PI:1.78*Math.PI,l=e>1?n/(e-1):0;a.forEach((e,s)=>{i[e.alias]=d(s,Math.max(t,1),260,l/2)})}else r.forEach((e,t)=>{i[e.alias]=d(t,Math.max(r.length,1),220)});let c=o?r.length-Math.ceil(r.length/2):r.length,x=c<=2?Math.PI:1.78*Math.PI,h=c>0?(c>1?x/(c-1):0)/2:0,u=325+6*Math.max(0,n.length-4);n.forEach((e,t)=>{i[e.alias]=d(t,Math.max(n.length,1),u,h)});let f=(s=new Map,l.forEach(e=>{if(!i[e.from_alias]||!i[e.to_alias]||e.from_alias===e.to_alias)return;let t=`${e.from_alias}->${e.to_alias}`,a=s.get(t);s.set(t,{key:t,from:e.from_alias,to:e.to_alias,count:(a?.count||0)+1,content:a?.content||e.content})}),[...s.values()].slice(0,18)),m=new Set;return f.forEach(e=>{m.add(e.from),m.add(e.to)}),{onlineNodes:r,offlineNodes:n,nodePositions:i,flowLinks:f,activeAliases:m}},[l,e,t]),y=o.filter(e=>"working"===e.status).length;return(0,s.jsxs)("section",{className:"w-full max-w-6xl mx-auto mb-8",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between mb-3 px-1",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-xs uppercase text-gray-600 tracking-wider",children:"Network Topology"}),(0,s.jsx)("h2",{className:"text-lg text-white font-semibold",children:"Command mesh"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs",children:[(0,s.jsxs)("span",{className:"px-2.5 py-1 rounded-md bg-green-500/10 text-green-300 border border-green-500/20",children:[y," working"]}),(0,s.jsxs)("span",{className:"px-2.5 py-1 rounded-md bg-cyan-500/10 text-cyan-300 border border-cyan-500/20",children:[o.length," online"]}),(0,s.jsxs)("span",{className:"px-2.5 py-1 rounded-md bg-gray-500/10 text-gray-400 border border-gray-500/20",children:[g.length," active links"]})]})]}),(0,s.jsxs)("div",{className:`relative overflow-hidden rounded-lg border shadow-2xl ${r?"shadow-zinc-900/5":"shadow-cyan-950/30"}`,style:{background:n.containerBg,borderColor:n.containerBorder},children:[(0,s.jsx)("div",{className:`absolute inset-x-0 top-0 h-px bg-gradient-to-r ${n.topRailGradient}`}),(0,s.jsxs)("svg",{viewBox:"0 0 1000 680",className:"w-full h-auto block",preserveAspectRatio:"xMidYMid meet",children:[(0,s.jsxs)("defs",{children:[(0,s.jsxs)("linearGradient",{id:"topo-panel",x1:"0",x2:"1",y1:"0",y2:"1",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:n.panelStops[0]}),(0,s.jsx)("stop",{offset:"48%",stopColor:n.panelStops[1]}),(0,s.jsx)("stop",{offset:"100%",stopColor:n.panelStops[2]})]}),(0,s.jsxs)("radialGradient",{id:"topo-radar",cx:"50%",cy:"50%",r:"55%",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:n.radarStops[0].color,stopOpacity:n.radarStops[0].opacity}),(0,s.jsx)("stop",{offset:"45%",stopColor:n.radarStops[1].color,stopOpacity:n.radarStops[1].opacity}),(0,s.jsx)("stop",{offset:"100%",stopColor:n.radarStops[2].color,stopOpacity:n.radarStops[2].opacity})]}),!r&&(0,s.jsxs)("filter",{id:"topo-glow",children:[(0,s.jsx)("feGaussianBlur",{stdDeviation:"4",result:"blur"}),(0,s.jsxs)("feMerge",{children:[(0,s.jsx)("feMergeNode",{in:"blur"}),(0,s.jsx)("feMergeNode",{in:"SourceGraphic"})]})]}),(0,s.jsx)("marker",{id:"topo-arrow",viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"5",markerHeight:"5",orient:"auto-start-reverse",children:(0,s.jsx)("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:n.arrowFill})}),(0,s.jsxs)("radialGradient",{id:"topo-sweep",cx:"0%",cy:"50%",r:"100%",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:r?"#0d9488":"#22d3ee",stopOpacity:r?.18:.32}),(0,s.jsx)("stop",{offset:"70%",stopColor:r?"#0d9488":"#22d3ee",stopOpacity:r?.1:.18}),(0,s.jsx)("stop",{offset:"100%",stopColor:r?"#0d9488":"#22d3ee",stopOpacity:"0"})]})]}),(0,s.jsx)("rect",{width:"1000",height:"680",fill:"url(#topo-panel)"}),(0,s.jsx)("circle",{cx:500,cy:330,r:"330",fill:"url(#topo-radar)"}),!r&&(0,s.jsx)("g",{opacity:"0.5",children:Array.from({length:28}).map((e,t)=>{let a=9301*t+49297;return(0,s.jsx)("circle",{cx:13*a%1e3,cy:7*a%680,r:t%3==0?1.2:.7,fill:"#a5b4fc",opacity:.35+t%4*.05},t)})}),(0,s.jsx)("g",{style:{transformOrigin:"500px 330px",transformBox:"view-box"},className:"anet-topo-sweep",opacity:r?.7:1,children:(0,s.jsx)("path",{d:`M 500 330 L 830 330 A 330 330 0 0 0 ${500+330*Math.cos(-Math.PI/4.5)} ${330+330*Math.sin(-Math.PI/4.5)} Z`,fill:"url(#topo-sweep)"})}),[90,170,250,330].map(e=>(0,s.jsx)("circle",{cx:500,cy:330,r:e,fill:"none",stroke:n.ringStroke,strokeWidth:"1",opacity:r?.6:.35},e)),!r&&[0,.25,.5,.75].map((e,t)=>(0,s.jsx)("g",{children:(0,s.jsx)("circle",{cx:830,cy:330,r:0===t?2.8:2.2,fill:"#22d3ee",opacity:.9,filter:"url(#topo-glow)",children:(0,s.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:`${360*e} 500 330`,to:`${360*e+360} 500 330`,dur:"16s",repeatCount:"indefinite"})})},`orbit-${t}`)),[0,30,60,90,120,150].map(e=>(0,s.jsx)("line",{x1:500-360*Math.cos(e*Math.PI/180),y1:330-360*Math.sin(e*Math.PI/180),x2:500+360*Math.cos(e*Math.PI/180),y2:330+360*Math.sin(e*Math.PI/180),stroke:n.ringStroke,strokeWidth:"1",opacity:r?.35:.18},e)),o.map((e,t)=>{let a=p[e.alias];if(!a)return null;let r=c({x:500,y:330},a,0),l=b.has(e.alias);return(0,s.jsx)("path",{d:r,fill:"none",stroke:l?n.spokeStroke.active:n.spokeStroke.idle,strokeWidth:l?2:1,strokeDasharray:l?"none":"6 14",opacity:l?.7:.45,className:l?void 0:"anet-topo-spoke-flow",style:l?void 0:{animationDelay:`${-(.25*t)}s`}},`hub-${e.alias}`)}),g.map((e,t)=>{let a=p[e.from],l=p[e.to];if(!a||!l)return null;let i=c(a,l,t%2==0?36:-36),o=Math.min(2+e.count,7);return(0,s.jsxs)("g",{children:[(0,s.jsx)("path",{d:i,fill:"none",stroke:n.flowEdge,strokeWidth:o,opacity:r?.22:.28,filter:r?void 0:"url(#topo-glow)",markerEnd:"url(#topo-arrow)"}),(0,s.jsx)("path",{id:`flow-path-${t}`,d:i,fill:"none",stroke:n.flowPath,strokeWidth:"1",strokeDasharray:"2 12",opacity:r?.4:.75}),(0,s.jsx)("circle",{r:"4",fill:n.flowParticle,filter:r?void 0:"url(#topo-glow)",children:(0,s.jsx)("animateMotion",{dur:`${2.2+t%5*.32}s`,repeatCount:"indefinite",path:i})})]},e.key)}),(0,s.jsxs)("g",{children:[(0,s.jsx)("circle",{cx:500,cy:330,r:"18",fill:r?"#d1fae5":"#10b981",opacity:r?.35:.1}),(0,s.jsxs)("circle",{cx:500,cy:330,r:"10",fill:"none",stroke:"#10b981",strokeWidth:"1.5",children:[(0,s.jsx)("animate",{attributeName:"r",values:"10;38;10",dur:"2.4s",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"opacity",values:"0.55;0;0.55",dur:"2.4s",repeatCount:"indefinite"})]}),(0,s.jsxs)("circle",{cx:500,cy:330,r:"10",fill:"none",stroke:"#10b981",strokeWidth:"1.5",opacity:"0",children:[(0,s.jsx)("animate",{attributeName:"r",values:"10;38;10",dur:"2.4s",begin:"1.2s",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"opacity",values:"0.45;0;0.45",dur:"2.4s",begin:"1.2s",repeatCount:"indefinite"})]}),(0,s.jsx)("circle",{cx:500,cy:330,r:"10",fill:r?"#059669":"#10b981"}),(0,s.jsx)("circle",{cx:500,cy:330,r:"5",fill:"#d1fae5",opacity:"0.9"})]}),[...o,...m].map(e=>{let a=p[e.alias];if(!a)return null;let l=(e.network_id?t[`${e.network_id}:${e.alias}`]:void 0)??t[e.alias],i="offline"!==e.status||!!l,o=i?"working"===e.status?{label:"working",primary:r?"#059669":"#22c55e",halo:r?"#d1fae5":"#14532d",text:r?"#065f46":"#dcfce7"}:"idle"===e.status?{label:"idle",primary:r?"#0d9488":"#2dd4bf",halo:r?"#ccfbf1":"#134e4a",text:r?"#115e59":"#ccfbf1"}:{label:e.status||"online",primary:r?"#0284c7":"#38bdf8",halo:r?"#dbeafe":"#0c4a6e",text:r?"#0c4a6e":"#e0f2fe"}:{label:"offline",primary:r?"#94a3b8":"#6b7280",halo:r?"#e2e8f0":"#111827",text:r?"#475569":"#9ca3af"},d=b.has(e.alias),c=i?26:18;return(0,s.jsxs)("g",{className:"transition-opacity",children:[d&&(0,s.jsxs)("circle",{cx:a.x,cy:a.y,r:c+14,fill:o.primary,opacity:r?.08:.12,children:[(0,s.jsx)("animate",{attributeName:"r",values:`${c+8};${c+22};${c+8}`,dur:"2.4s",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"opacity",values:r?"0.12;0.02;0.12":"0.18;0.04;0.18",dur:"2.4s",repeatCount:"indefinite"})]}),(0,s.jsx)("circle",{cx:a.x,cy:a.y,r:c+8,fill:o.halo,opacity:i?r?.85:.65:r?.4:.25}),(0,s.jsx)("circle",{cx:a.x,cy:a.y,r:c,fill:i?n.nodeFill.online:n.nodeFill.offline,stroke:o.primary,strokeWidth:i?3:1.5,strokeDasharray:i?"none":"5 5",filter:i&&!r?"url(#topo-glow)":void 0}),(0,s.jsx)("circle",{cx:a.x,cy:a.y,r:i?8:5,fill:o.primary}),"working"===e.status&&(0,s.jsx)("path",{d:`M${a.x-9},${a.y+11} h18`,stroke:n.flowParticle,strokeWidth:"3",strokeLinecap:"round",children:(0,s.jsx)("animate",{attributeName:"opacity",values:"1;0.25;1",dur:"1.1s",repeatCount:"indefinite"})}),(0,s.jsxs)("g",{transform:`translate(${a.x}, ${a.y+c+22})`,children:[(0,s.jsx)("rect",{x:"-62",y:"-14",width:"124",height:"42",rx:"6",fill:n.labelBox.fill,stroke:n.labelBox.stroke,opacity:r?1:.94}),(0,s.jsx)("text",{x:"0",y:"1",textAnchor:"middle",fill:o.text,fontSize:"12",fontFamily:"monospace",fontWeight:"700",children:x(e.alias,14)}),(0,s.jsxs)("text",{x:"0",y:"17",textAnchor:"middle",fill:o.primary,fontSize:"9",fontFamily:"monospace",children:[o.label,i&&null!=l?` sse:${l}`:""]})]})]},e.alias)}),(0,s.jsxs)("g",{transform:"translate(28, 34)",children:[(0,s.jsx)("rect",{x:"0",y:"0",width:"285",height:60+20*Math.min(g.length,4),rx:"8",fill:n.legendBox.fill,stroke:n.legendBox.stroke,opacity:r?1:.94}),(0,s.jsx)("text",{x:"16",y:"26",fill:n.legendHeadline,fontSize:"13",fontFamily:"monospace",fontWeight:"700",children:"recent signal"}),(0,s.jsxs)("text",{x:"178",y:"26",fill:n.legendAccent,fontSize:"11",fontFamily:"monospace",children:[l.length," messages"]}),g.slice(0,4).map((e,t)=>(0,s.jsxs)("text",{x:"16",y:54+20*t,fill:n.legendText,fontSize:"10",fontFamily:"monospace",children:[x(e.from,8)," ","->"," ",x(e.to,8)," / ",e.count," / ",x(e.content,18)]},e.key))]}),(0,s.jsxs)("g",{transform:"translate(720, 34)",children:[(0,s.jsx)("rect",{x:"0",y:"0",width:"250",height:"112",rx:"8",fill:n.legendBox.fill,stroke:n.legendBox.stroke,opacity:r?1:.94}),(0,s.jsx)("circle",{cx:"18",cy:"26",r:"6",fill:r?"#059669":"#22c55e"}),(0,s.jsx)("text",{x:"34",y:"30",fill:n.legendText,fontSize:"11",fontFamily:"monospace",children:"working node"}),(0,s.jsx)("circle",{cx:"18",cy:"52",r:"6",fill:r?"#0d9488":"#2dd4bf"}),(0,s.jsx)("text",{x:"34",y:"56",fill:n.legendText,fontSize:"11",fontFamily:"monospace",children:"online idle"}),(0,s.jsx)("circle",{cx:"18",cy:"78",r:"6",fill:r?"#94a3b8":"#6b7280"}),(0,s.jsx)("text",{x:"34",y:"82",fill:n.legendText,fontSize:"11",fontFamily:"monospace",children:"offline / no SSE"}),(0,s.jsx)("path",{d:"M150,78 Q176,52 210,78",fill:"none",stroke:n.flowEdge,strokeWidth:"3",markerEnd:"url(#topo-arrow)"})]})]})]})]})}var m=e.i(69874);let p={working:{bg:"bg-green-900/30 border-green-800/30",text:"text-green-300",dot:"bg-green-500",glow:"shadow-green-500/10"},idle:{bg:"bg-cyan-900/30 border-cyan-800/30",text:"text-cyan-300",dot:"bg-cyan-400",glow:"shadow-cyan-500/5"},blocked:{bg:"bg-yellow-900/30 border-yellow-800/30",text:"text-yellow-300",dot:"bg-yellow-500",glow:""},error:{bg:"bg-red-900/30 border-red-800/30",text:"text-red-300",dot:"bg-red-500",glow:""}},g={bg:"bg-gray-800/50 border-gray-700/30",text:"text-gray-500",dot:"bg-gray-500",glow:""};function b({session:e,hasSse:t,sseCount:a,onChat:l}){let i=t&&p[e.status]||g;return(0,s.jsxs)(r.default,{href:`/node?alias=${encodeURIComponent(e.alias)}`,prefetch:!1,className:`anet-agent-card group relative block rounded-xl border p-4 transition-all duration-300 cursor-pointer hover:-translate-y-0.5 ${t?`bg-[#111128] border-[#2a2a4a] hover:border-cyan-500/30 hover:shadow-lg ${i.glow}`:"bg-[#0d0d1a] border-[#1a1a2a] opacity-40"}`,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsx)(m.AliasAvatar,{alias:e.alias,size:22}),(0,s.jsx)("span",{className:"font-semibold text-white truncate text-sm",title:e.alias,children:e.alias}),(0,s.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${i.dot} ${t&&"working"===e.status?"animate-pulse":""}`})]}),(0,s.jsx)("span",{className:`text-[11px] px-2 py-0.5 rounded-md border shrink-0 ${i.bg} ${i.text}`,children:t?e.status:"offline"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,s.jsx)("span",{className:"text-xs text-gray-600 bg-[#0a0a15] px-2 py-0.5 rounded border border-[#1a1a2a]",children:e.agent||"unknown"}),t&&(0,s.jsxs)("span",{className:"text-[10px] text-green-500",children:["SSE:",a]})]}),e.task?(0,s.jsx)("div",{className:"text-xs text-gray-400 bg-[#0a0a15] rounded-lg px-3 py-2 border border-[#1a1a2a] line-clamp-2",title:e.task,children:e.task}):(0,s.jsx)("div",{className:"text-xs text-gray-700 italic",children:"No active task"}),e.progress>0&&(0,s.jsxs)("div",{className:"mt-3",children:[(0,s.jsxs)("div",{className:"flex justify-between text-[10px] mb-1",children:[(0,s.jsx)("span",{className:"text-gray-600",children:"Progress"}),(0,s.jsxs)("span",{className:i.text,children:[e.progress,"%"]})]}),(0,s.jsx)("div",{className:"w-full bg-gray-800 rounded-full h-1.5 overflow-hidden",children:(0,s.jsx)("div",{className:`h-1.5 rounded-full transition-all duration-700 ${"working"===e.status?"bg-green-500":"bg-cyan-500"}`,style:{width:`${Math.min(e.progress,100)}%`}})})]}),(0,s.jsxs)("div",{className:"mt-3 flex justify-between items-center text-[10px] text-gray-600",children:[(0,s.jsx)("span",{className:"truncate",title:e.server||"",children:e.server||"--"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[l&&t&&(0,s.jsx)("button",{onClick:t=>{t.preventDefault(),t.stopPropagation(),l(e.alias)},className:"text-cyan-400 hover:text-cyan-300 px-1.5 py-0.5 rounded border border-cyan-500/20 hover:bg-cyan-500/10 transition-colors",children:"Chat"}),(0,s.jsx)("span",{children:(0,n.timeAgo)(e.updated_at)}),(0,s.jsx)("svg",{"aria-hidden":!0,className:"w-3 h-3 text-gray-700 opacity-0 -translate-x-1 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-200",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,s.jsx)("path",{d:"M9 18l6-6-6-6"})})]})]})]})}function y({messages:e}){return 0===e.length?null:(0,s.jsxs)("div",{className:"mt-8",children:[(0,s.jsxs)("h2",{className:"text-lg font-semibold text-white mb-3 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Inbox"}),(0,s.jsx)("span",{className:"text-xs bg-blue-900/30 text-blue-400 px-2 py-0.5 rounded-full border border-blue-800/30",children:e.length})]}),(0,s.jsx)("div",{className:"space-y-2 max-h-96 overflow-y-auto pr-1 scrollbar-thin",children:e.map(e=>(0,s.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-4 py-3 text-sm transition-colors hover:border-[#3a3a5a]",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs mb-1.5",children:[e.from_session&&(0,s.jsx)(m.AliasAvatar,{alias:e.from_session,size:16}),(0,s.jsx)("span",{className:"text-gray-200 font-medium truncate",children:e.from_session}),(0,s.jsx)("span",{className:"ml-auto text-gray-600 shrink-0",title:e.created_at,children:(0,n.timeAgo)(e.created_at)})]}),(0,s.jsx)("div",{className:"text-gray-300 leading-relaxed line-clamp-3",title:e.content||"",children:(0,n.previewContent)(e.content)})]},e.id))})]})}function j(){return(0,s.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,s.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-8 anet-skeleton-pulse",children:[1,2,3,4].map(e=>(0,s.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] px-4 py-3",children:[(0,s.jsx)(v,{w:"2.5rem",h:"1.75rem"}),(0,s.jsx)(v,{w:"3.5rem",h:"0.75rem",className:"mt-2"}),(0,s.jsx)(v,{w:"5rem",h:"0.625rem",className:"mt-1"})]},e))}),(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-3 anet-skeleton-pulse",children:[(0,s.jsx)(v,{w:"6rem",h:"2.5rem",rounded:"0.75rem"}),(0,s.jsxs)("div",{className:"flex-1 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-2.5 flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-full anet-skeleton-bar"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)(v,{w:"6rem",h:"0.875rem"}),(0,s.jsx)(v,{w:"10rem",h:"0.625rem",className:"mt-1"})]})]})]}),(0,s.jsx)("div",{className:"mb-6 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 anet-skeleton-pulse",children:(0,s.jsx)(v,{w:"14rem",h:"0.875rem"})}),(0,s.jsx)("div",{className:"grid grid-cols-3 gap-2 sm:gap-3 mb-3 anet-skeleton-pulse",children:[1,2,3].map(e=>(0,s.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] px-3 py-3",children:[(0,s.jsx)(v,{w:"2rem",h:"1.25rem"}),(0,s.jsx)(v,{w:"2.5rem",h:"0.75rem",className:"mt-1"}),(0,s.jsx)(v,{w:"3.5rem",h:"0.625rem",className:"mt-px"})]},e))}),(0,s.jsx)("div",{className:"grid grid-cols-3 gap-2 sm:gap-3 mb-6 anet-skeleton-pulse",children:[1,2,3].map(e=>(0,s.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] px-3 py-2.5 flex items-center justify-center gap-2",children:[(0,s.jsx)("div",{className:"w-4 h-4 rounded anet-skeleton-bar"}),(0,s.jsx)(v,{w:"4rem",h:"0.75rem"})]},e))}),(0,s.jsxs)("div",{className:"mb-6 flex gap-2 anet-skeleton-pulse",children:[(0,s.jsx)("div",{className:"flex-1 h-10 rounded-lg border border-[#2a2a4a] bg-[#111128]"}),(0,s.jsx)("div",{className:"w-28 h-10 rounded-lg anet-skeleton-bar"})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-3 sm:gap-4 anet-skeleton-pulse",children:[1,2,3,4].map(e=>(0,s.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] p-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,s.jsx)("div",{className:"w-2 h-2 rounded-full anet-skeleton-bar"}),(0,s.jsx)(v,{w:"6rem",h:"0.875rem"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(v,{w:"100%",h:"0.625rem"}),(0,s.jsx)(v,{w:"75%",h:"0.625rem"}),(0,s.jsx)(v,{w:"55%",h:"0.625rem"})]})]},e))})]})}function v({w:e,h:t,rounded:a,className:r}){return(0,s.jsx)("div",{className:`anet-skeleton-bar ${r||""}`,style:{width:e,height:t,borderRadius:a||"0.375rem"}})}var w=e.i(95356),k=e.i(28490),N=e.i(58963);function S(){let{setNetworkId:e}=(0,N.useNetworkId)(),[t,r]=(0,a.useState)({user:null,networks:[],currentNetwork:"",token:""}),[n,l]=(0,a.useState)(!1),[i,o]=(0,a.useState)(""),[d,c]=(0,a.useState)(""),[x,h]=(0,a.useState)(""),[u,f]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=sessionStorage.getItem("anet_v3_auth");if(e)try{r(JSON.parse(e))}catch{}},[]);let[m,p]=(0,a.useState)(!1),[g,b]=(0,a.useState)(""),[y,j]=(0,a.useState)(""),v=async()=>{try{await fetch(`/api/hub/auth?token=${t.token}&endpoint=/api/auth/me`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update_profile",token:t.token,display_name:g,email:y})});let e=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update_profile",token:t.token,display_name:g,email:y})}),s=await e.json();if(s.ok&&s.user){let e={...t,user:s.user};r(e),sessionStorage.setItem("anet_v3_auth",JSON.stringify(e)),p(!1)}}catch{}};if(!t.user)return null;let w=(t.user.display_name||t.user.username).slice(0,2).toUpperCase();return(0,s.jsxs)("div",{className:"flex items-center justify-between bg-[#111128] border border-[#2a2a4a] rounded-lg px-4 py-2.5 mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-full bg-gradient-to-br from-cyan-500 to-blue-600 flex items-center justify-center text-xs font-bold text-white",children:w}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm text-white font-medium",children:t.user.display_name||t.user.username}),(0,s.jsxs)("div",{className:"text-[10px] text-gray-500",children:[t.user.role," · ",t.user.user_id]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[t.networks.length>0&&(0,s.jsx)("select",{value:t.currentNetwork,onChange:s=>{let a={...t,currentNetwork:s.target.value};r(a),e(s.target.value),sessionStorage.setItem("anet_v3_auth",JSON.stringify(a))},className:"bg-[#0a0a15] border border-[#2a2a4a] rounded px-2 py-1 text-xs text-white focus:outline-none",children:t.networks.map(e=>(0,s.jsx)("option",{value:e.network_id,children:e.network_name},e.network_id))}),(0,s.jsxs)("button",{onClick:()=>{b(t.user?.display_name||""),j(""),p(!m)},className:"text-xs text-gray-500 hover:text-gray-300 whitespace-nowrap","aria-label":"Edit profile",children:[(0,s.jsx)("span",{className:"hidden sm:inline",children:"Edit"}),(0,s.jsx)("svg",{className:"sm:hidden w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.862 4.487z"})})]}),(0,s.jsxs)("button",{onClick:()=>{r({user:null,networks:[],currentNetwork:"",token:""}),sessionStorage.removeItem("anet_v3_auth")},className:"text-xs text-gray-500 hover:text-gray-300 whitespace-nowrap","aria-label":"Sign out",children:[(0,s.jsx)("span",{className:"hidden sm:inline",children:"Sign out"}),(0,s.jsx)("svg",{className:"sm:hidden w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})})]})]}),m&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-2 pt-2 border-t border-[#2a2a4a]",children:[(0,s.jsx)("input",{type:"text",value:g,onChange:e=>b(e.target.value),placeholder:"Display name",className:"bg-[#0a0a15] border border-[#2a2a4a] rounded px-2 py-1 text-xs text-white placeholder-gray-600 focus:outline-none w-32"}),(0,s.jsx)("input",{type:"email",value:y,onChange:e=>j(e.target.value),placeholder:"Email",className:"bg-[#0a0a15] border border-[#2a2a4a] rounded px-2 py-1 text-xs text-white placeholder-gray-600 focus:outline-none w-40"}),(0,s.jsx)("button",{onClick:v,className:"px-2 py-1 bg-cyan-600 hover:bg-cyan-500 text-white text-xs rounded",children:"Save"})]})]})}var _=e.i(21373),C=e.i(58442);function $({tabs:e,activeTab:t,onOpenTab:a,onCloseTab:r,onSetActive:n,onClose:l}){return 0===e.length?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{onClick:l,className:"jsx-f7cf3d1a6fdfc074 fixed inset-0 bg-black/30 z-40 lg:hidden"}),(0,s.jsxs)("div",{className:"jsx-f7cf3d1a6fdfc074 fixed top-0 right-0 h-full w-full lg:w-[500px] bg-[#0a0a1a] border-l border-[#2a2a4a] z-50 flex flex-col shadow-2xl shadow-black/60 animate-slide-in",children:[(0,s.jsxs)("div",{className:"jsx-f7cf3d1a6fdfc074 flex items-center border-b border-[#2a2a4a] bg-[#0d0d1a] overflow-x-auto",children:[(0,s.jsx)("div",{className:"jsx-f7cf3d1a6fdfc074 flex-1 flex min-w-0",children:e.map(e=>(0,s.jsxs)("button",{onClick:()=>n(e),className:`jsx-f7cf3d1a6fdfc074 flex items-center gap-1.5 px-3 py-2.5 text-xs border-b-2 transition-colors shrink-0 ${t===e?"border-cyan-400 text-cyan-300 bg-cyan-500/5":"border-transparent text-gray-500 hover:text-gray-300"}`,children:[(0,s.jsx)("div",{className:`jsx-f7cf3d1a6fdfc074 w-2 h-2 rounded-full ${t===e?"bg-cyan-400":"bg-gray-600"}`}),(0,s.jsx)("span",{className:"jsx-f7cf3d1a6fdfc074 max-w-[80px] truncate",children:e}),(0,s.jsx)("button",{onClick:t=>{t.stopPropagation(),r(e)},className:"jsx-f7cf3d1a6fdfc074 ml-1 text-gray-600 hover:text-gray-300 p-0.5",children:"×"})]},e))}),(0,s.jsx)("button",{onClick:l,className:"jsx-f7cf3d1a6fdfc074 text-gray-500 hover:text-white px-3 py-2.5 shrink-0 border-l border-[#2a2a4a]",children:(0,s.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,className:"jsx-f7cf3d1a6fdfc074 w-4 h-4",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12",className:"jsx-f7cf3d1a6fdfc074"})})})]}),(0,s.jsx)("div",{className:"jsx-f7cf3d1a6fdfc074 flex-1 relative overflow-hidden",children:e.map(e=>(0,s.jsx)("div",{className:`jsx-f7cf3d1a6fdfc074 absolute inset-0 ${t===e?"block":"hidden"}`,children:(0,s.jsx)(M,{alias:e})},e))})]}),(0,s.jsx)(_.default,{id:"f7cf3d1a6fdfc074",children:"@keyframes slide-in{0%{transform:translate(100%)}to{transform:translate(0)}}.animate-slide-in{animation:.2s ease-out slide-in}"})]})}function M({alias:e}){return(0,s.jsx)(C.TaskChatPanel,{alias:e,onClose:()=>{},inline:!0})}function T({sessions:e,onClose:t}){let[r,n]=(0,a.useState)(new Set),[l,i]=(0,a.useState)(""),[o,d]=(0,a.useState)("normal"),[c,x]=(0,a.useState)(!1),[h,u]=(0,a.useState)([]),[f,p]=(0,a.useState)(""),g=e.filter(e=>"offline"!==e.status).filter(e=>!f||e.alias.toLowerCase().includes(f.toLowerCase())||(e.agent||"").toLowerCase().includes(f.toLowerCase())),b=async()=>{if(!l.trim()||0===r.size||c)return;x(!0),u([]);let e=[...r].map(async e=>{try{let t=await fetch("/api/hub/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({alias:e,task:l,priority:o})}),s=await t.json();return{alias:e,ok:!!s.ok,error:s.error}}catch(t){return{alias:e,ok:!1,error:"send failed"}}});u(await Promise.all(e)),x(!1)},y=h.filter(e=>e.ok).length;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed inset-0 bg-black/50 z-40 anet-fade-in",onClick:t}),(0,s.jsxs)("div",{className:"fixed inset-4 lg:inset-x-[15%] lg:inset-y-[5%] bg-[#0a0a1a] border border-[#2a2a4a] rounded-2xl z-50 flex flex-col shadow-2xl shadow-black/70 overflow-hidden anet-fade-in",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-[#2a2a4a] bg-[#0d0d1a]",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-bold text-white",children:"Dispatch Task"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:"Send a task to one or more agents"})]}),(0,s.jsx)("button",{onClick:t,className:"text-gray-500 hover:text-white p-1.5 rounded-lg hover:bg-[#1a1a2a]",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,s.jsxs)("div",{className:"flex-1 flex flex-col lg:flex-row overflow-hidden",children:[(0,s.jsxs)("div",{className:"lg:w-[280px] border-b lg:border-b-0 lg:border-r border-[#2a2a4a] flex flex-col",children:[(0,s.jsxs)("div",{className:"px-4 py-3 border-b border-[#2a2a4a]",children:[(0,s.jsx)("input",{type:"text",value:f,onChange:e=>p(e.target.value),placeholder:"Filter agents...",className:"w-full bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-xs text-white placeholder-gray-600 focus:border-cyan-500/40 focus:outline-none"}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-2",children:[(0,s.jsx)("button",{onClick:()=>{r.size===g.length?n(new Set):n(new Set(g.map(e=>e.alias)))},className:"text-[10px] text-cyan-400 hover:text-cyan-300",children:r.size===g.length?"Deselect all":`Select all (${g.length})`}),(0,s.jsxs)("span",{className:"text-[10px] text-gray-600",children:[r.size," selected"]})]})]}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto px-2 py-2 space-y-0.5 max-h-[200px] lg:max-h-none",children:[g.map(e=>(0,s.jsxs)("button",{onClick:()=>{var t;return t=e.alias,void n(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:`w-full flex items-center gap-2 px-3 py-2 rounded-lg text-xs text-left transition-colors ${r.has(e.alias)?"bg-cyan-500/10 text-cyan-300 border border-cyan-500/20":"text-gray-400 hover:bg-[#1a1a2a]"}`,children:[(0,s.jsx)(m.AliasAvatar,{alias:e.alias,size:16}),(0,s.jsx)("div",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${"working"===e.status?"bg-green-400":"idle"===e.status?"bg-cyan-400":"bg-gray-500"}`}),(0,s.jsx)("span",{className:"truncate flex-1",children:e.alias}),(0,s.jsx)("span",{className:"text-[9px] text-gray-600",children:e.agent||"--"})]},e.alias)),0===g.length&&(0,s.jsx)("div",{className:"text-center text-xs text-gray-600 py-4",children:"No online agents"})]})]}),(0,s.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,s.jsxs)("div",{className:"flex-1 px-6 py-4 flex flex-col",children:[(0,s.jsx)("label",{className:"text-xs text-gray-500 uppercase mb-2",children:"Task Prompt"}),(0,s.jsx)("textarea",{value:l,onChange:e=>i(e.target.value),placeholder:"Enter the task you want to dispatch...",className:"flex-1 min-h-[120px] bg-[#111128] border border-[#2a2a4a] rounded-xl px-4 py-3 text-sm text-white placeholder-gray-600 focus:border-cyan-500/40 focus:outline-none resize-none"}),(0,s.jsxs)("div",{className:"flex items-center gap-3 mt-4",children:[(0,s.jsxs)("select",{value:o,onChange:e=>d(e.target.value),className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-xs text-white focus:outline-none",children:[(0,s.jsx)("option",{value:"normal",children:"Normal priority"}),(0,s.jsx)("option",{value:"high",children:"High priority"}),(0,s.jsx)("option",{value:"low",children:"Low priority"})]}),(0,s.jsx)("div",{className:"flex-1"}),(0,s.jsx)("button",{onClick:b,disabled:c||!l.trim()||0===r.size,className:"px-6 py-2.5 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 disabled:from-gray-800 disabled:to-gray-800 disabled:text-gray-600 text-white text-sm font-medium rounded-xl transition-all shadow-lg shadow-cyan-500/10 disabled:shadow-none active:scale-95",children:c?(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Sending..."]}):`Dispatch to ${r.size} agent${r.size>1?"s":""}`})]})]}),h.length>0&&(0,s.jsxs)("div",{className:"px-6 py-3 border-t border-[#2a2a4a] bg-[#0d0d1a]",children:[(0,s.jsxs)("div",{className:"text-xs text-gray-500 mb-2",children:[y,"/",h.length," dispatched successfully"]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:h.map(e=>(0,s.jsxs)("span",{className:`flex items-center gap-1.5 text-[10px] pl-1 pr-2 py-0.5 rounded-full border ${e.ok?"text-green-300 border-green-500/20 bg-green-500/5":"text-red-300 border-red-500/20 bg-red-500/5"}`,children:[(0,s.jsx)(m.AliasAvatar,{alias:e.alias,size:14}),(0,s.jsx)("span",{children:e.alias}),(0,s.jsx)("span",{"aria-hidden":!0,children:e.ok?"✓":e.error||"✗"})]},e.alias))})]})]})]})]})]})}var z=e.i(65822),F=e.i(51280),A=e.i(71235);e.s(["default",0,function(){let e,i,d,c,x;(0,a.useEffect)(()=>{sessionStorage.getItem("anet_v3_auth")||(fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),window.location.assign("/login"))},[]);let{sessions:h,hint:u,error:p,isLoading:g}=(0,z.useSessions)(),{health:v}=(0,z.useHealth)(),{config:N}=(0,z.useAnetConfig)(),{tasks:_}=(0,z.useTasks)({limit:"500"}),{stats:C}=(0,z.useStats)(),{license:M}=(0,z.useLicense)(),[R,E]=(0,a.useState)(window.innerWidth>=1024),[P,L]=(0,a.useState)(!1),O=function(){let[e,t]=(0,a.useState)([]),[s,r]=(0,a.useState)("");return{tabs:e,activeTab:s,openTab:e=>{t(t=>t.includes(e)?t:[...t,e]),r(e)},closeTab:e=>{t(t=>{let a=t.filter(t=>t!==e);return s===e&&r(a[a.length-1]||""),a})},closeAll:()=>{t([]),r("")},setActiveTab:r}}(),[I,B]=(0,a.useState)(!1),[W,H]=(0,a.useState)([]),[D,U]=(0,a.useState)("all"),{mutate:G}=(0,A.useSWRConfig)(),J="1"!==t.default.env.NEXT_PUBLIC_DISABLE_SSE,{connected:V,supported:q}=(0,F.useSSE)({url:"/api/hub/events",enabled:J,onEvent:e=>{["new_task","new_message","new_reply","node_status_changed","broadcast"].includes(e.type)&&(G("/api/hub/status"),G(e=>"string"==typeof e&&e.startsWith("/api/hub/tasks"),void 0,{revalidate:!0}))}});if((0,a.useEffect)(()=>{let e=()=>{fetch("/api/hub/inbox").then(e=>e.json()).then(e=>{e.messages?.length&&H(t=>{let s=new Set(t.map(e=>e.id));return[...e.messages.filter(e=>!s.has(e.id)),...t].slice(0,100)})}).catch(()=>{})};e();let t=setInterval(e,1e4);return()=>clearInterval(t)},[]),g)return(0,s.jsx)(j,{});let K=v?.sse_sessions||{},Q=e=>(e.network_id?K[`${e.network_id}:${e.alias}`]:void 0)??K[e.alias],X=e=>"offline"!==e.status||!!Q(e),Y=h.filter(X).length,Z=h.length,ee=h.filter(e=>"working"===e.status).length,et=v?(0,n.formatUptime)(v.uptime):"--",es=v?.version||"--",ea=!!(N?.hub&&N.tokenConfigured),er=N?.source==="file"?"Local config":N?.source==="runtime-env"?"Runtime env":"Config missing",en={};if(C?.tasks?.by_status?.length)for(let e of C.tasks.by_status)en[e.status]=e.count;else for(let e of _)en[e.status]=(en[e.status]||0)+1;let el=[...h].sort((e,t)=>{let s=+!!X(e),a=+!!X(t);if(s!==a)return a-s;let r=+("working"===e.status);return("working"===t.status)-r}),ei=0===h.length&&!p;return(0,s.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,s.jsx)("div",{className:"lg:ml-0 ml-10",children:(0,s.jsx)(l,{online:Y,working:ee,total:Z,version:es,uptime:et})}),(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[!ei&&(0,s.jsx)("button",{onClick:()=>B(!0),className:"px-4 py-2 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 text-white text-sm font-medium rounded-xl shadow-lg shadow-cyan-500/10 transition-all active:scale-95 shrink-0",children:"⚡ Dispatch"}),(0,s.jsx)("div",{className:"flex-1",children:(0,s.jsx)(S,{})})]}),(0,s.jsxs)("section",{className:"mb-6 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 shadow-lg shadow-black/20",children:[(0,s.jsxs)("button",{onClick:()=>L(!P),className:"w-full flex items-center justify-between text-left",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,s.jsx)("span",{className:"uppercase text-gray-600",children:"Config"}),(0,s.jsx)("span",{className:`w-2 h-2 rounded-full ${ea?"bg-green-400":"bg-red-400"}`}),(0,s.jsx)("span",{className:"text-gray-500",children:er})]}),(0,s.jsx)("svg",{className:`w-4 h-4 text-gray-600 transition-transform ${P?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),P&&(0,s.jsxs)("div",{className:"mt-3 pt-3 border-t border-[#2a2a4a]",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("div",{className:"min-w-0",children:(0,s.jsxs)("div",{className:"text-gray-100 truncate text-sm",title:N?.hub||void 0,children:["Hub: ",(0,s.jsx)("span",{className:N?.hub?"text-cyan-300":"text-red-300",children:N?.hub?.trim()||"not configured"})]})}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2 text-xs",children:(0,s.jsxs)("span",{className:`px-2.5 py-1 rounded-md border ${N?.tokenConfigured?"bg-blue-500/5 text-blue-300 border-blue-500/20":"bg-gray-500/5 text-gray-400 border-gray-500/20"}`,children:["Token: ",N?.tokenPreview||"not configured"]})})]}),N?.error&&(0,s.jsx)("div",{className:"mt-2 text-xs text-gray-600",children:N.error})]})]}),Object.keys(en).length>0&&(0,s.jsxs)("section",{className:"mb-6 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 shadow-lg shadow-black/20",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("div",{className:"text-xs uppercase text-gray-600",children:"Task Status"}),(0,s.jsx)(r.default,{href:"/tasks",prefetch:!1,className:"text-xs text-cyan-400 hover:text-cyan-300",children:"View all →"})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:["running","delivered","acked","replied","created","failed","cancelled","expired","closed"].filter(e=>en[e]).map(e=>(0,s.jsxs)(r.default,{href:`/tasks?status=${e}`,prefetch:!1,className:`px-2.5 py-1 rounded-md border text-xs ${k.STATUS_CHIP_CLASS[e]} hover:opacity-80 transition-opacity`,children:[e,": ",en[e]]},e))})]}),!ei&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"text-[10px] uppercase tracking-[0.12em] text-gray-600 mb-2",children:"Quick navigation"}),(0,s.jsx)("section",{className:"mb-3 grid grid-cols-3 gap-2 sm:gap-3",children:(e=h.filter(e=>X(e)&&"working"!==e.status).length,i=Z-Y,d=_.filter(e=>"failed"===e.status).length,[{href:"/nodes",label:"Nodes",value:`${Y}/${Z}`,sub:`${Z>0?Math.round(Y/Z*100):0}% online`,color:"text-green-400 border-green-500/20",popover:0===Z?null:[{k:"working",v:ee,dot:"",color:"#4ade80"},{k:"idle",v:e,dot:"",color:"#22d3ee"},{k:"offline",v:i,dot:"",color:"#9ca3af"}]},{href:"/tasks",label:"Tasks",value:String(Object.values(en).reduce((e,t)=>e+t,0)||0),sub:"all-time",color:"text-cyan-400 border-cyan-500/20",popover:0===Object.keys(en).length?null:["running","replied","failed","cancelled","expired","closed","created","delivered","acked"].filter(e=>en[e]).map(e=>({k:e,v:en[e],dot:"",color:({running:"#4ade80",replied:"#a78bfa",failed:"#f87171",cancelled:"#facc15",expired:"#fb923c",closed:"#9ca3af",created:"#9ca3af",delivered:"#60a5fa",acked:"#22d3ee"})[e]||"#9ca3af"}))},{href:"/tasks?status=failed",label:"Failed",value:String(en.failed||0),sub:en.failed?"needs review":"none",color:en.failed?"text-red-400 border-red-500/25":"text-gray-500 border-gray-700/30",popover:d?[{k:`${d} in current view`,v:"",dot:"",color:"#f87171"}]:[{k:"no failures yet",v:"",dot:"",color:"#4b5563"}]}].map(e=>(0,s.jsxs)(r.default,{href:e.href,prefetch:!1,className:`anet-stat-link group relative rounded-xl border ${e.color} bg-[#111128] px-3 py-3 transition-all hover:-translate-y-px`,children:[(0,s.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,s.jsx)("div",{className:`text-xl font-semibold tabular-nums ${e.color.split(" ")[0]}`,children:e.value}),(0,s.jsx)("div",{className:"hidden sm:block text-[10px] text-gray-600 group-hover:text-gray-400 transition-colors",children:"View →"})]}),(0,s.jsx)("div",{className:"text-[11px] text-gray-400 mt-0.5",children:e.label}),(0,s.jsx)("div",{className:"text-[10px] text-gray-600 mt-px",children:e.sub}),e.popover&&e.popover.length>0&&(0,s.jsxs)("div",{className:"anet-stat-popover hidden md:block pointer-events-none absolute left-2 right-2 top-full mt-1 z-20 rounded-lg border border-[#2a2a4a] bg-[#0d0d1a] shadow-lg shadow-black/30 px-3 py-2 opacity-0 translate-y-[-2px] group-hover:opacity-100 group-hover:translate-y-0 transition-all duration-150 delay-100",children:[(0,s.jsx)("div",{className:"text-[10px] text-gray-600 uppercase tracking-wider mb-1.5",children:"Breakdown"}),(0,s.jsx)("ul",{className:"space-y-1",children:e.popover.map(e=>(0,s.jsxs)("li",{className:"flex items-center gap-2 text-[11px]",children:[(0,s.jsx)("span",{className:"inline-block w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:e.color},"aria-hidden":!0}),(0,s.jsx)("span",{className:"text-gray-400 capitalize",children:e.k}),""!==e.v&&(0,s.jsx)("span",{className:"ml-auto text-gray-300 tabular-nums font-medium",children:e.v})]},e.k))})]})]},e.href)))}),(0,s.jsx)("section",{className:"mb-6 grid grid-cols-3 gap-2 sm:gap-3",children:[{href:"/messages",label:"Messages",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"},{href:"/logs",label:"Audit log",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"},{href:"/admin",label:"Admin",icon:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4z M6 21v-2a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v2"}].map(e=>(0,s.jsxs)(r.default,{href:e.href,prefetch:!1,className:"anet-nav-tile flex items-center justify-center gap-2 rounded-xl border border-[#2a2a4a] bg-[#111128] px-3 py-2.5 text-[12px] text-gray-400 hover:text-gray-200 transition-colors",children:[(0,s.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,s.jsx)("path",{d:e.icon})}),(0,s.jsx)("span",{children:e.label})]},e.href))}),(0,s.jsx)(o,{}),_.length>0&&(0,s.jsxs)("section",{className:"mb-6 bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"Recent Activity"}),(0,s.jsx)(r.default,{href:"/tasks",className:"text-xs text-cyan-400 hover:text-cyan-300",children:"All tasks →"})]}),(0,s.jsx)("div",{className:"space-y-2 max-h-40 overflow-y-auto",children:_.slice(0,5).map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:k.STATUS_DOT_HEX[e.status]||"#6b7280"}}),e.from_name&&(0,s.jsx)(m.AliasAvatar,{alias:e.from_name,size:14}),(0,s.jsx)("span",{className:"text-gray-300 shrink-0 max-w-[20%] truncate",children:e.from_name||"?"}),(0,s.jsx)("span",{className:"text-gray-600",children:"→"}),e.to_name&&(0,s.jsx)(m.AliasAvatar,{alias:e.to_name,size:14}),(0,s.jsx)("span",{className:"text-gray-300 shrink-0 max-w-[20%] truncate",children:e.to_name||"?"}),(0,s.jsx)("span",{className:"text-gray-500 truncate flex-1",title:e.content||"",children:(0,n.previewContent)(e.content).slice(0,60)}),(0,s.jsx)("span",{className:`shrink-0 px-1.5 py-0.5 rounded text-[10px] border ${k.STATUS_CHIP_CLASS[e.status]||"text-gray-500 border-gray-700/30"}`,children:e.status})]},e.task_id))})]})]}),p&&(0,s.jsxs)("div",{className:"bg-red-900/20 border border-red-800/40 text-red-300 px-4 py-3 rounded-lg mb-6 text-sm flex items-center justify-between",role:"alert",children:[(0,s.jsx)("span",{children:String(p)}),(0,s.jsx)("span",{className:"text-gray-500 text-xs",children:"Check CommHub connection"})]}),h.length>0&&(0,s.jsx)("div",{className:"flex justify-center mb-4",children:(0,s.jsx)("button",{onClick:()=>E(!R),className:"text-xs text-gray-500 hover:text-gray-300 border border-gray-700/50 px-4 py-1.5 rounded-lg transition-colors hover:border-gray-600 cursor-pointer",children:R?"Hide Topology":"Show Topology"})}),!R&&h.length>0&&(0,s.jsx)("div",{className:"lg:hidden text-center text-xs text-gray-600 mb-4",children:"Topology hidden on mobile for better readability"}),R&&h.length>0&&(0,s.jsx)(f,{sessions:h,sseSessions:K}),0!==h.length||p?(c={all:el.length,working:el.filter(e=>X(e)&&"working"===e.status).length,idle:el.filter(e=>X(e)&&"working"!==e.status).length,offline:el.filter(e=>!X(e)).length},x=el.filter(e=>"all"===D||("offline"===D?!X(e):"working"===D?X(e)&&"working"===e.status:"idle"!==D||X(e)&&"working"!==e.status)),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mb-3 flex flex-wrap items-center gap-1",children:[{key:"all",label:"All"},{key:"working",label:"Working",dot:"#4ade80"},{key:"idle",label:"Idle",dot:"#22d3ee"},{key:"offline",label:"Offline",dot:"#6b7280"}].map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>U(e.key),disabled:0===c[e.key]&&"all"!==e.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 ${D===e.key?"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:[e.dot&&(0,s.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full",style:{backgroundColor:e.dot}}),(0,s.jsx)("span",{children:e.label}),(0,s.jsx)("span",{className:`text-[10px] tabular-nums ${D===e.key?"text-cyan-400":"text-gray-600"}`,children:c[e.key]})]},e.key))}),(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4 gap-3 sm:gap-4",children:x.map(e=>(0,s.jsx)(b,{session:e,hasSse:X(e),sseCount:Q(e)||0,onChat:O.openTab},e.alias))}),0===x.length&&(0,s.jsxs)("div",{className:"mt-4 text-center text-xs text-gray-600",children:['No agents match "',D,'" — ',(0,s.jsx)("button",{onClick:()=>U("all"),className:"underline hover:text-gray-400",children:"Show all"})]})]})):(0,s.jsx)(w.NodesEmptyState,{hint:u}),(0,s.jsx)(y,{messages:W}),(0,s.jsxs)("div",{className:"mt-8 text-center text-xs text-gray-600 flex items-center justify-center gap-2 flex-wrap",children:[q&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${V?"bg-green-400":"bg-gray-600"}`}),V?"SSE live":"SWR polling"]}),M?.license&&(0,s.jsxs)(s.Fragment,{children:[q&&(0,s.jsx)(s.Fragment,{children:"·"}),(0,s.jsxs)("span",{className:M.license.days_left<=7?"text-red-400":"pro"===M.license.type?"text-green-400":"text-yellow-400",children:[M.license.type," (",M.license.days_left,"d left)"]})]})]}),I&&(0,s.jsx)(T,{sessions:h,onClose:()=>B(!1)}),O.tabs.length>0&&(0,s.jsx)($,{tabs:O.tabs,activeTab:O.activeTab,onOpenTab:O.openTab,onCloseTab:O.closeTab,onSetActive:O.setActiveTab,onClose:O.closeAll})]})}],31713)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,38575,e=>{"use strict";var t=e.i(18050),r=e.i(71645),a=e.i(22016);let s={log:"text-gray-300",info:"text-cyan-300",warn:"text-amber-400",error:"text-red-400"},l={log:"bg-gray-500/10 text-gray-400 border-gray-500/20",info:"bg-cyan-500/10 text-cyan-300 border-cyan-500/30",warn:"bg-amber-500/10 text-amber-300 border-amber-500/30",error:"bg-red-500/10 text-red-300 border-red-500/30"},n={log:"transparent",info:"#22d3ee",warn:"#f59e0b",error:"#ef4444"};e.s(["default",0,function(){let e,[i,d]=(0,r.useState)([]),[c,o]=(0,r.useState)(null),[x,h]=(0,r.useState)(!1),[m,u]=(0,r.useState)("all"),[g,p]=(0,r.useState)(""),[b,f]=(0,r.useState)(!0),j=(0,r.useRef)(""),y=(0,r.useCallback)(async(e=!1)=>{try{let t=new URLSearchParams({limit:"500"});!e&&j.current&&t.set("since",j.current);let r=await fetch(`/api/hub/server-logs?${t.toString()}`),a=await r.json();if(!r.ok||!a.ok)return void o(a.error||`HTTP ${r.status}`);o(null);let s=a.logs||[];if(0===s.length)return;j.current=s[0].ts,e?d(s):d(e=>{let t=new Set(e.map(e=>e.ts+e.line));return[...s.filter(e=>!t.has(e.ts+e.line)),...e].slice(0,1e3)})}catch(e){o(e instanceof Error?e.message:"fetch failed")}},[]);(0,r.useEffect)(()=>{y(!0)},[y]),(0,r.useEffect)(()=>{if(!b||x)return;let e=setInterval(()=>y(!1),2e3);return()=>clearInterval(e)},[b,x,y]);let v=i.filter(e=>("all"===m||e.level===m)&&(!g||!!e.line.toLowerCase().includes(g.toLowerCase()))),w={log:0,info:0,warn:0,error:0};for(let e of i)w[e.level]++;return(0,t.jsxs)("div",{className:"p-6 max-w-[1600px] mx-auto",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4 gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-white",children:"Server Logs"}),(0,t.jsx)("span",{className:"text-xs text-gray-500 hidden sm:inline",children:"CommHub stdout/stderr"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs shrink-0",children:[(0,t.jsx)("button",{onClick:()=>h(e=>!e),className:`flex items-center gap-1.5 px-3 py-1 rounded border ${x?"bg-amber-500/10 text-amber-300 border-amber-500/30":"bg-cyan-500/10 text-cyan-300 border-cyan-500/30"}`,children:x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:(0,t.jsx)("path",{d:"M8 5v14l11-7z"})}),"Resume"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[(0,t.jsx)("rect",{x:"6",y:"5",width:"4",height:"14",rx:"0.5"}),(0,t.jsx)("rect",{x:"14",y:"5",width:"4",height:"14",rx:"0.5"})]}),"Pause"]})}),(0,t.jsxs)("label",{className:"flex items-center gap-1 text-gray-400 select-none",children:[(0,t.jsx)("input",{type:"checkbox",checked:b,onChange:e=>f(e.target.checked),className:"accent-cyan-500"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"auto-refresh"})]}),(0,t.jsxs)("button",{onClick:()=>y(!0),className:"flex items-center gap-1.5 px-3 py-1 rounded border bg-gray-500/10 text-gray-300 border-gray-500/20 hover:bg-gray-500/20",children:[(0,t.jsxs)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,t.jsx)("path",{d:"M3 12a9 9 0 0 1 15.5-6.4L21 8"}),(0,t.jsx)("path",{d:"M21 3v5h-5"}),(0,t.jsx)("path",{d:"M21 12a9 9 0 0 1-15.5 6.4L3 16"}),(0,t.jsx)("path",{d:"M3 21v-5h5"})]}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Reload"})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mb-3",children:[(0,t.jsx)("div",{className:"flex items-center gap-1 text-xs flex-wrap",children:["all","log","info","warn","error"].map(e=>{let r="all"===e?i.length:w[e],a=m===e,s="all"!==e&&0===r&&!a;return(0,t.jsxs)("button",{onClick:()=>u(e),disabled:s,className:`px-2.5 py-1 rounded border flex items-center gap-1 disabled:opacity-30 disabled:cursor-not-allowed ${a?"bg-cyan-500/15 text-cyan-200 border-cyan-500/40":"bg-[#11111c] text-gray-400 border-[#2a2a4a] hover:bg-[#1a1a2a]"}`,children:[(0,t.jsx)("span",{children:e}),(0,t.jsx)("span",{className:`text-[10px] tabular-nums ${a?"opacity-80":"text-gray-600"}`,children:r})]},e)})}),(0,t.jsx)("input",{value:g,onChange:e=>p(e.target.value),placeholder:"搜索关键字 (alias / task_id / error message)",className:"flex-1 min-w-[140px] basis-full sm:basis-0 px-3 py-1.5 text-xs bg-[#11111c] border border-[#2a2a4a] rounded text-gray-200 focus:outline-none focus:border-cyan-500/40"}),(0,t.jsxs)("span",{className:"text-[10px] text-gray-600",children:[v.length," / ",i.length]})]}),c&&(e=/401|unauthor|forbidden|403|admin/i.test(c),(0,t.jsxs)("div",{className:"anet-error-chip mb-3 p-3 rounded border border-red-500/30 bg-red-500/10 text-red-300 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:e?(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-0.5",title:c,children:"服务器日志包含运行时 stdout/stderr,仅 admin 角色可读。"}),(0,t.jsx)(a.default,{href:"/login",className:"inline-block mt-2 text-xs font-medium underline underline-offset-4 hover:opacity-80",children:"切到 admin 账号 →"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"font-medium",children:"服务器日志暂时无法加载"}),(0,t.jsx)("div",{className:"text-xs opacity-80 mt-0.5",title:c,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:"重新加载 →"})]})})]})),(0,t.jsx)("div",{className:"rounded border border-[#1a1a2a] bg-[#050510] font-mono text-[11px] leading-relaxed overflow-hidden",children:0===v.length?(0,t.jsx)("div",{className:"p-8 text-center text-gray-600",children:c?"加载失败":0===i.length?"加载中...":"没有匹配的日志"}):(0,t.jsx)("div",{className:"divide-y divide-[#0d0d18] max-h-[calc(100vh-260px)] overflow-y-auto",children:v.map((e,r)=>(0,t.jsxs)("div",{className:"relative pl-3 pr-3 py-1 hover:bg-[#0a0a14] flex gap-3",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute left-0 top-0 bottom-0 w-0.5",style:{backgroundColor:n[e.level]}}),(0,t.jsx)("span",{className:"text-gray-600 shrink-0 w-[100px] text-[10px] tabular-nums",children:function(e){try{let t=new Date(e);return t.toTimeString().slice(0,8)+"."+String(t.getMilliseconds()).padStart(3,"0")}catch{return e}}(e.ts)}),(0,t.jsx)("span",{className:`shrink-0 px-1.5 rounded border text-[9px] uppercase ${l[e.level]}`,children:e.level}),(0,t.jsx)("span",{className:`break-all whitespace-pre-wrap ${s[e.level]}`,children:function(e,r){if(!r)return e;let a=e.toLowerCase().indexOf(r.toLowerCase());return a<0?e:(0,t.jsxs)(t.Fragment,{children:[e.slice(0,a),(0,t.jsx)("mark",{className:"bg-yellow-500/30 text-yellow-100 rounded-sm px-0.5",children:e.slice(a,a+r.length)}),e.slice(a+r.length)]})}(e.line.replace(/^\[\d{2}:\d{2}:\d{2}\]\s*/,""),g)})]},`${e.ts}-${r}`))})})]})}])}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,65822,e=>{"use strict";var s=e.i(83599),a=e.i(58963);let t=async e=>{let s=await fetch(e);if(401===s.status)throw window.location.assign("/login"),Error("unauthorized");return s.json()},r={refreshInterval:5e3,dedupingInterval:3e3};function n(e,s){if(!s)return e;let a=e.includes("?")?"&":"?";return`${e}${a}network_id=${encodeURIComponent(s)}`}e.s(["useAnetConfig",0,function(){let{data:e}=(0,s.default)("/api/anet/config",t,{refreshInterval:3e4});return{config:e||null}},"useHealth",0,function(){let{data:e,error:a}=(0,s.default)("/api/hub/health",t,r);return{health:e||null,error:a}},"useLicense",0,function(){let{data:e,error:a}=(0,s.default)("/api/hub/license",t,{refreshInterval:6e4});return{license:e?.ok?e:null,error:a}},"useMessages",0,function(e=100){let{networkId:l}=(0,a.useNetworkId)(),{data:i,error:c,isLoading:d}=(0,s.default)(n(`/api/hub/messages?limit=${e}`,l),t,r);return{messages:i?.messages||[],error:c,isLoading:d}},"useSessions",0,function(){let{networkId:e}=(0,a.useNetworkId)(),{data:l,error:i,isLoading:c}=(0,s.default)(n("/api/hub/status",e),t,r);return{sessions:l?.sessions||[],hint:l?._hint,error:i,isLoading:c}},"useStats",0,function(){let{networkId:e}=(0,a.useNetworkId)(),{data:l,error:i}=(0,s.default)(n("/api/hub/stats",e),t,r);return{stats:l?.ok?l:null,error:i}},"useTasks",0,function(e){let{networkId:l}=(0,a.useNetworkId)(),i=new URLSearchParams({limit:"100",...e}).toString(),{data:c,error:d,isLoading:o}=(0,s.default)(n(`/api/hub/tasks?${i}`,l),t,r);return{tasks:c?.tasks||[],count:c?.count??0,source:c?.source,error:d,isLoading:o}}])},94867,e=>{"use strict";e.s(["DASHBOARD_VERSION",0,"0.4.5-preview.77"],94867)},32545,e=>{"use strict";var s=e.i(18050),a=e.i(71645),t=e.i(22016),r=e.i(65822),n=e.i(94867);e.s(["default",0,function(){let{config:e}=(0,r.useAnetConfig)(),{health:l}=(0,r.useHealth)(),{license:i}=(0,r.useLicense)(),[c,d]=(0,a.useState)(""),[o,x]=(0,a.useState)(""),[m,h]=(0,a.useState)(""),[g,u]=(0,a.useState)(""),[p,N]=(0,a.useState)(""),b="flex flex-col gap-1 sm:flex-row sm:items-start sm:justify-between",j="break-all sm:max-w-[320px] sm:text-right";return(0,s.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-white mb-3 lg:ml-0 ml-10",children:"Settings"}),(0,s.jsx)("nav",{className:"mb-8 flex flex-wrap gap-1 text-xs",children:[{href:"#connection",label:"Connection"},{href:"#account",label:"Account"},{href:"#resources",label:"Resources"}].map(e=>(0,s.jsx)("a",{href:e.href,className:"rounded-md px-2.5 py-1 text-gray-500 hover:text-cyan-300 hover:bg-cyan-500/10 transition-colors",children:e.label},e.href))}),(0,s.jsxs)("div",{className:"max-w-2xl space-y-10",children:[(0,s.jsxs)("div",{id:"connection",className:"space-y-4 scroll-mt-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,s.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Connection"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"CommHub Connection"}),(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500 shrink-0",children:"Hub URL"}),(0,s.jsx)("span",{className:`text-cyan-300 ${j}`,children:e?.hub||"not configured"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Config Source"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:e?.source==="file"?"Local file (~/.anet/config.json)":e?.source==="runtime-env"?"Vercel env vars":"Missing"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Auth Token"}),(0,s.jsx)("span",{className:`${e?.tokenConfigured?"text-green-400":"text-red-400"} ${j}`,children:e?.tokenConfigured?`Configured (${e.tokenPreview})`:"Not configured"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Server Auth"}),(0,s.jsx)("span",{className:`${l?.auth==="enabled"?"text-green-400":"text-yellow-400"} sm:text-right`,children:l?.auth||"--"})]}),e?.error&&(0,s.jsx)("div",{className:"border-t border-[#2a2a4a] pt-3 text-xs text-gray-600",children:e.error})]})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Server Info"}),(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:l?.version||"--"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Sessions"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:l?.sessions??"--"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsxs)("span",{className:"text-gray-500",children:["SSE streams ",(0,s.jsx)("span",{className:"text-gray-600",children:"· server"})]}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:l?.sse_connections??"--"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Uptime"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:l?.uptime?`${Math.floor(l.uptime/3600)}h ${Math.floor(l.uptime%3600/60)}m`:"--"})]})]})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Dashboard"}),(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,s.jsx)("span",{className:`text-gray-300 font-mono ${j}`,title:"From package.json @sleep2agi/agent-network-dashboard",children:n.DASHBOARD_VERSION})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Data Layer"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:"SWR (5s refresh, 3s dedup)"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Pages"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:"Overview, Tasks, Nodes, Messages, Networks, Audit, Server Logs, Admin, Settings"})]})]})]})]}),(0,s.jsxs)("div",{id:"account",className:"space-y-4 scroll-mt-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,s.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Account"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsxs)("h2",{className:"text-sm font-semibold text-gray-300 mb-4 flex items-center gap-2",children:["License",i?.license&&(0,s.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded-full border ${"pro"===i.license.type?"text-green-300 bg-green-500/10 border-green-500/30":i.license.days_left<=7?"text-red-300 bg-red-500/10 border-red-500/30":"text-amber-300 bg-amber-500/10 border-amber-500/30"}`,children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"w-1.5 h-1.5 rounded-full bg-current"}),i.license.type,i.license.days_left?` \xb7 ${i.license.days_left}d left`:""]})]}),i?.license?(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[i.license.days_left<=7&&(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-red-400 font-medium",children:"⚠ Expiring soon"}),(0,s.jsxs)("span",{className:"text-red-400",children:[i.license.days_left," days left"]})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Expires"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:i.license.expires_at})]}),i.limits&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Max Agents"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:i.limits.max_agents})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Max Networks"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:i.limits.max_networks})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Tasks/Day"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:i.limits.max_tasks_day})]})]}),(0,s.jsxs)("div",{className:"pt-3 border-t border-[#2a2a4a]",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"text",value:c,onChange:e=>d(e.target.value),placeholder:"anet-XXXX-XXXX-XXXX-XXXX",className:"flex-1 bg-[#0a0a15] border border-[#2a2a4a] rounded px-3 py-2 text-xs text-white placeholder-gray-600 focus:outline-none"}),(0,s.jsx)("button",{onClick:async()=>{if(!c.trim())return;let e=await fetch("/api/hub/license",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:c})}),s=await e.json();x(s.ok?`Activated: ${s.type}`:`Failed: ${s.error}`),s.ok&&d(""),setTimeout(()=>x(""),5e3)},className:"px-3 py-2 bg-cyan-600 hover:bg-cyan-500 text-white text-xs rounded transition-colors",children:"Activate"})]}),o&&(0,s.jsx)("div",{className:`mt-2 text-xs ${o.startsWith("Failed")?"text-red-400":"text-green-400"}`,children:o})]})]}):(0,s.jsx)("div",{className:"text-xs text-gray-600",children:"License info not available"})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Change Password"}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("input",{type:"password",value:m,onChange:e=>h(e.target.value),placeholder:"Current password",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,s.jsx)("input",{type:"password",value:g,onChange:e=>u(e.target.value),placeholder:"New password",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,s.jsx)("button",{onClick:async()=>{if(!m||!g)return;let e=sessionStorage.getItem("anet_v3_auth");if(!e)return void N("Not logged in with V3 auth");let{token:s}=JSON.parse(e),a=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"change_password",token:s,current_password:m,new_password:g})}),t=await a.json();if(N(t.ok?"Password changed":`Failed: ${t.error}`),t.ok){if(t.token){let s=JSON.parse(e);sessionStorage.setItem("anet_v3_auth",JSON.stringify({...s,token:t.token}))}h(""),u("")}setTimeout(()=>N(""),5e3)},disabled:!m||!g,className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-500 disabled:bg-gray-800 disabled:text-gray-600 text-white text-sm rounded-lg transition-colors",children:"Change Password"})]}),p&&(0,s.jsx)("div",{className:`mt-2 text-xs ${p.startsWith("Failed")?"text-red-400":"text-green-400"}`,children:p})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Sign out"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mb-3",children:"Signing out clears your dashboard session cookie. You'll return to the login page."}),(0,s.jsx)("button",{onClick:async()=>{await fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),window.location.assign("/login")},className:"px-4 py-2 bg-transparent hover:bg-[#1a1a2a] text-gray-300 text-sm rounded-lg border border-[#2a2a4a] hover:border-[#3a3a5a] transition-colors",children:"Sign out"})]})]}),(0,s.jsxs)("div",{id:"resources",className:"space-y-4 scroll-mt-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,s.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Resources"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,s.jsxs)(t.default,{href:"/settings/tokens",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"API Tokens"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Create and manage tokens for CLI access."}),(0,s.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Manage →"})]}),(0,s.jsxs)(t.default,{href:"/settings/networks",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"Networks"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Create, manage, and delete agent networks."}),(0,s.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Manage →"})]})]})]})]})]})}])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,65822,e=>{"use strict";var s=e.i(83599),a=e.i(58963);let t=async e=>{let s=await fetch(e);if(401===s.status)throw window.location.assign("/login"),Error("unauthorized");return s.json()},r={refreshInterval:5e3,dedupingInterval:3e3};function n(e,s){if(!s)return e;let a=e.includes("?")?"&":"?";return`${e}${a}network_id=${encodeURIComponent(s)}`}e.s(["useAnetConfig",0,function(){let{data:e}=(0,s.default)("/api/anet/config",t,{refreshInterval:3e4});return{config:e||null}},"useHealth",0,function(){let{data:e,error:a}=(0,s.default)("/api/hub/health",t,r);return{health:e||null,error:a}},"useLicense",0,function(){let{data:e,error:a}=(0,s.default)("/api/hub/license",t,{refreshInterval:6e4});return{license:e?.ok?e:null,error:a}},"useMessages",0,function(e=100){let{networkId:l}=(0,a.useNetworkId)(),{data:i,error:c,isLoading:d}=(0,s.default)(n(`/api/hub/messages?limit=${e}`,l),t,r);return{messages:i?.messages||[],error:c,isLoading:d}},"useSessions",0,function(){let{networkId:e}=(0,a.useNetworkId)(),{data:l,error:i,isLoading:c}=(0,s.default)(n("/api/hub/status",e),t,r);return{sessions:l?.sessions||[],hint:l?._hint,error:i,isLoading:c}},"useStats",0,function(){let{networkId:e}=(0,a.useNetworkId)(),{data:l,error:i}=(0,s.default)(n("/api/hub/stats",e),t,r);return{stats:l?.ok?l:null,error:i}},"useTasks",0,function(e){let{networkId:l}=(0,a.useNetworkId)(),i=new URLSearchParams({limit:"100",...e}).toString(),{data:c,error:d,isLoading:o}=(0,s.default)(n(`/api/hub/tasks?${i}`,l),t,r);return{tasks:c?.tasks||[],count:c?.count??0,source:c?.source,error:d,isLoading:o}}])},94867,e=>{"use strict";e.s(["DASHBOARD_VERSION",0,"0.4.5-preview.79"],94867)},32545,e=>{"use strict";var s=e.i(18050),a=e.i(71645),t=e.i(22016),r=e.i(65822),n=e.i(94867);e.s(["default",0,function(){let{config:e}=(0,r.useAnetConfig)(),{health:l}=(0,r.useHealth)(),{license:i}=(0,r.useLicense)(),[c,d]=(0,a.useState)(""),[o,x]=(0,a.useState)(""),[m,h]=(0,a.useState)(""),[g,u]=(0,a.useState)(""),[p,N]=(0,a.useState)(""),b="flex flex-col gap-1 sm:flex-row sm:items-start sm:justify-between",j="break-all sm:max-w-[320px] sm:text-right";return(0,s.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-white mb-3 lg:ml-0 ml-10",children:"Settings"}),(0,s.jsx)("nav",{className:"mb-8 flex flex-wrap gap-1 text-xs",children:[{href:"#connection",label:"Connection"},{href:"#account",label:"Account"},{href:"#resources",label:"Resources"}].map(e=>(0,s.jsx)("a",{href:e.href,className:"rounded-md px-2.5 py-1 text-gray-500 hover:text-cyan-300 hover:bg-cyan-500/10 transition-colors",children:e.label},e.href))}),(0,s.jsxs)("div",{className:"max-w-2xl space-y-10",children:[(0,s.jsxs)("div",{id:"connection",className:"space-y-4 scroll-mt-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,s.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Connection"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"CommHub Connection"}),(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500 shrink-0",children:"Hub URL"}),(0,s.jsx)("span",{className:`text-cyan-300 ${j}`,children:e?.hub||"not configured"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Config Source"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:e?.source==="file"?"Local file (~/.anet/config.json)":e?.source==="runtime-env"?"Vercel env vars":"Missing"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Auth Token"}),(0,s.jsx)("span",{className:`${e?.tokenConfigured?"text-green-400":"text-red-400"} ${j}`,children:e?.tokenConfigured?`Configured (${e.tokenPreview})`:"Not configured"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Server Auth"}),(0,s.jsx)("span",{className:`${l?.auth==="enabled"?"text-green-400":"text-yellow-400"} sm:text-right`,children:l?.auth||"--"})]}),e?.error&&(0,s.jsx)("div",{className:"border-t border-[#2a2a4a] pt-3 text-xs text-gray-600",children:e.error})]})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Server Info"}),(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:l?.version||"--"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Sessions"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:l?.sessions??"--"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsxs)("span",{className:"text-gray-500",children:["SSE streams ",(0,s.jsx)("span",{className:"text-gray-600",children:"· server"})]}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:l?.sse_connections??"--"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Uptime"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:l?.uptime?`${Math.floor(l.uptime/3600)}h ${Math.floor(l.uptime%3600/60)}m`:"--"})]})]})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Dashboard"}),(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,s.jsx)("span",{className:`text-gray-300 font-mono ${j}`,title:"From package.json @sleep2agi/agent-network-dashboard",children:n.DASHBOARD_VERSION})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Data Layer"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:"SWR (5s refresh, 3s dedup)"})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Pages"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:"Overview, Tasks, Nodes, Messages, Networks, Audit, Server Logs, Admin, Settings"})]})]})]})]}),(0,s.jsxs)("div",{id:"account",className:"space-y-4 scroll-mt-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,s.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Account"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsxs)("h2",{className:"text-sm font-semibold text-gray-300 mb-4 flex items-center gap-2",children:["License",i?.license&&(0,s.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded-full border ${"pro"===i.license.type?"text-green-300 bg-green-500/10 border-green-500/30":i.license.days_left<=7?"text-red-300 bg-red-500/10 border-red-500/30":"text-amber-300 bg-amber-500/10 border-amber-500/30"}`,children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"w-1.5 h-1.5 rounded-full bg-current"}),i.license.type,i.license.days_left?` \xb7 ${i.license.days_left}d left`:""]})]}),i?.license?(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[i.license.days_left<=7&&(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-red-400 font-medium",children:"⚠ Expiring soon"}),(0,s.jsxs)("span",{className:"text-red-400",children:[i.license.days_left," days left"]})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Expires"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:i.license.expires_at})]}),i.limits&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Max Agents"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:i.limits.max_agents})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Max Networks"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:i.limits.max_networks})]}),(0,s.jsxs)("div",{className:b,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Tasks/Day"}),(0,s.jsx)("span",{className:`text-gray-300 ${j}`,children:i.limits.max_tasks_day})]})]}),(0,s.jsxs)("div",{className:"pt-3 border-t border-[#2a2a4a]",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"text",value:c,onChange:e=>d(e.target.value),placeholder:"anet-XXXX-XXXX-XXXX-XXXX",className:"flex-1 bg-[#0a0a15] border border-[#2a2a4a] rounded px-3 py-2 text-xs text-white placeholder-gray-600 focus:outline-none"}),(0,s.jsx)("button",{onClick:async()=>{if(!c.trim())return;let e=await fetch("/api/hub/license",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:c})}),s=await e.json();x(s.ok?`Activated: ${s.type}`:`Failed: ${s.error}`),s.ok&&d(""),setTimeout(()=>x(""),5e3)},className:"px-3 py-2 bg-cyan-600 hover:bg-cyan-500 text-white text-xs rounded transition-colors",children:"Activate"})]}),o&&(0,s.jsx)("div",{className:`mt-2 text-xs ${o.startsWith("Failed")?"text-red-400":"text-green-400"}`,children:o})]})]}):(0,s.jsx)("div",{className:"text-xs text-gray-600",children:"License info not available"})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Change Password"}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("input",{type:"password",value:m,onChange:e=>h(e.target.value),placeholder:"Current password",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,s.jsx)("input",{type:"password",value:g,onChange:e=>u(e.target.value),placeholder:"New password",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,s.jsx)("button",{onClick:async()=>{if(!m||!g)return;let e=sessionStorage.getItem("anet_v3_auth");if(!e)return void N("Not logged in with V3 auth");let{token:s}=JSON.parse(e),a=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"change_password",token:s,current_password:m,new_password:g})}),t=await a.json();if(N(t.ok?"Password changed":`Failed: ${t.error}`),t.ok){if(t.token){let s=JSON.parse(e);sessionStorage.setItem("anet_v3_auth",JSON.stringify({...s,token:t.token}))}h(""),u("")}setTimeout(()=>N(""),5e3)},disabled:!m||!g,className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-500 disabled:bg-gray-800 disabled:text-gray-600 text-white text-sm rounded-lg transition-colors",children:"Change Password"})]}),p&&(0,s.jsx)("div",{className:`mt-2 text-xs ${p.startsWith("Failed")?"text-red-400":"text-green-400"}`,children:p})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Sign out"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mb-3",children:"Signing out clears your dashboard session cookie. You'll return to the login page."}),(0,s.jsx)("button",{onClick:async()=>{await fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),window.location.assign("/login")},className:"px-4 py-2 bg-transparent hover:bg-[#1a1a2a] text-gray-300 text-sm rounded-lg border border-[#2a2a4a] hover:border-[#3a3a5a] transition-colors",children:"Sign out"})]})]}),(0,s.jsxs)("div",{id:"resources",className:"space-y-4 scroll-mt-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,s.jsx)("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400 font-semibold",children:"Resources"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-[#2a2a4a]"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,s.jsxs)(t.default,{href:"/settings/tokens",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"API Tokens"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Create and manage tokens for CLI access."}),(0,s.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Manage →"})]}),(0,s.jsxs)(t.default,{href:"/settings/networks",className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5 hover:border-cyan-500/30 transition-colors",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"Networks"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Create, manage, and delete agent networks."}),(0,s.jsx)("span",{className:"text-xs text-cyan-400 mt-3 inline-block",children:"Manage →"})]})]})]})]})]})}])}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,94867,e=>{"use strict";e.s(["DASHBOARD_VERSION",0,"0.4.5-preview.77"],94867)},89954,e=>{"use strict";var t=e.i(18050),r=e.i(71645),a=e.i(94867);e.s(["default",0,function(){let[e,s]=(0,r.useState)("login"),[n,o]=(0,r.useState)(""),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(!1),[x,g]=(0,r.useState)(""),[h,m]=(0,r.useState)(!1),u=async t=>{t.preventDefault(),m(!0),g("");try{let t=await fetch("/api/auth/v3",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,username:n,password:i})}),r=await t.json();if(r.ok){r.token&&sessionStorage.setItem("anet_v3_auth",JSON.stringify({user:r.user,token:r.token,networks:r.networks||[],currentNetwork:r.network_id||r.networks?.[0]?.network_id||""})),window.location.assign("/");return}g(r.error||"Login failed")}catch{g("Connection failed")}m(!1)};return(0,t.jsxs)("main",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 font-mono flex items-center justify-center relative overflow-hidden px-4 py-10 sm:py-16",children:[(0,t.jsx)("div",{className:"absolute inset-0 pointer-events-none anet-login-bg","aria-hidden":!0}),(0,t.jsxs)("div",{className:"relative w-full max-w-sm",children:[(0,t.jsxs)("div",{className:"text-center mb-7",children:[(0,t.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 mb-4 rounded-2xl bg-[#111128] border border-[#2a2a4a] anet-login-mark",children:(0,t.jsxs)("svg",{className:"w-9 h-9",viewBox:"0 0 32 32","aria-hidden":!0,children:[(0,t.jsx)("circle",{cx:"16",cy:"16",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",opacity:"0.25",className:"text-cyan-400 anet-login-mark-ring"}),(0,t.jsx)("line",{x1:"16",y1:"10",x2:"10",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.5",className:"text-cyan-400 anet-login-mark-edge"}),(0,t.jsx)("line",{x1:"16",y1:"10",x2:"22",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.5",className:"text-cyan-400 anet-login-mark-edge"}),(0,t.jsx)("line",{x1:"10",y1:"20",x2:"22",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.5",className:"text-cyan-400 anet-login-mark-edge"}),(0,t.jsx)("circle",{cx:"16",cy:"10",r:"3",fill:"currentColor",className:"text-cyan-400 anet-login-mark-node-a"}),(0,t.jsx)("circle",{cx:"10",cy:"20",r:"3",fill:"currentColor",className:"text-green-400 anet-login-mark-node-b"}),(0,t.jsx)("circle",{cx:"22",cy:"20",r:"3",fill:"currentColor",className:"text-violet-400 anet-login-mark-node-c"})]})}),(0,t.jsx)("h1",{className:"text-[22px] sm:text-2xl font-semibold text-white tracking-tight",children:"Agent Network"}),(0,t.jsx)("p",{className:"text-[13px] text-gray-500 mt-1.5 leading-snug",children:"login"===e?(0,t.jsxs)(t.Fragment,{children:["Welcome back · ",(0,t.jsx)("span",{className:"text-gray-600",children:"Tasks · Mesh · Messages"})]}):(0,t.jsxs)(t.Fragment,{children:["Create your account · ",(0,t.jsx)("span",{className:"text-gray-600",children:"Free preview · no credit card"})]})})]}),(0,t.jsx)("div",{className:"flex rounded-lg border border-[#2a2a4a] bg-[#111128] p-1 mb-4",children:["login","register"].map(r=>(0,t.jsx)("button",{type:"button",onClick:()=>{s(r),g("")},className:`flex-1 rounded-md px-3 py-2 text-sm transition-colors ${e===r?"bg-cyan-500/10 text-cyan-300":"text-gray-500 hover:text-gray-200"}`,children:"login"===r?"Sign in":"Register"},r))}),(0,t.jsxs)("form",{onSubmit:u,className:"border border-[#2a2a4a] bg-[#111128]/80 backdrop-blur-sm rounded-xl p-6 shadow-2xl shadow-black/30",children:[(0,t.jsx)("label",{htmlFor:"username",className:"block text-xs text-gray-500 mb-2 uppercase tracking-wider",children:"Username"}),(0,t.jsx)("input",{id:"username",type:"text",value:n,onChange:e=>o(e.target.value),autoFocus:!0,placeholder:"Enter username",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-4 py-3 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:ring-1 focus:ring-cyan-500/20 focus:outline-none transition-all mb-4"}),(0,t.jsx)("label",{htmlFor:"password",className:"block text-xs text-gray-500 mb-2 uppercase tracking-wider",children:"Password"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("input",{id:"password",type:c?"text":"password",value:i,onChange:e=>l(e.target.value),placeholder:"Enter password",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-4 pr-11 py-3 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:ring-1 focus:ring-cyan-500/20 focus:outline-none transition-all"}),(0,t.jsx)("button",{type:"button",onClick:()=>d(e=>!e),tabIndex:-1,"aria-label":c?"Hide password":"Show password",className:"absolute inset-y-0 right-0 flex items-center px-3 text-gray-600 hover:text-gray-300 transition-colors",children:c?(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),(0,t.jsx)("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})})]}),x&&(0,t.jsx)("div",{className:"mt-3 text-sm text-red-300 bg-red-500/5 border border-red-500/10 rounded-lg px-3 py-2",children:x}),(0,t.jsxs)("button",{type:"submit",disabled:h||!i||!n.trim(),className:"mt-5 w-full flex items-center justify-center gap-2 px-4 py-3 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 disabled:from-gray-800 disabled:to-gray-800 disabled:text-gray-600 text-white text-sm font-medium rounded-lg transition-all shadow-lg shadow-cyan-500/10 hover:shadow-cyan-500/20 disabled:shadow-none",children:[h&&(0,t.jsxs)("svg",{"aria-hidden":!0,className:"w-4 h-4 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",opacity:"0.25"}),(0,t.jsx)("path",{d:"M4 12a8 8 0 018-8",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]}),(0,t.jsx)("span",{children:h?"login"===e?"Signing in…":"Registering…":"login"===e?"Sign in":"Create account"})]})]}),(0,t.jsxs)("p",{className:"text-center text-[11px] text-gray-700 mt-6",children:["Sleep2AGI · Apache-2.0 · ",(0,t.jsx)("a",{href:"https://anet.sh",className:"hover:text-gray-500 transition-colors",children:"anet.sh"}),(0,t.jsx)("span",{className:"mx-1 text-gray-800",children:"·"}),(0,t.jsxs)("span",{className:"font-mono",title:"@sleep2agi/agent-network-dashboard",children:["v",a.DASHBOARD_VERSION]})]})]})]})}])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,94867,e=>{"use strict";e.s(["DASHBOARD_VERSION",0,"0.4.5-preview.79"],94867)},89954,e=>{"use strict";var t=e.i(18050),r=e.i(71645),a=e.i(94867);e.s(["default",0,function(){let[e,s]=(0,r.useState)("login"),[n,o]=(0,r.useState)(""),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(!1),[x,g]=(0,r.useState)(""),[h,m]=(0,r.useState)(!1),u=async t=>{t.preventDefault(),m(!0),g("");try{let t=await fetch("/api/auth/v3",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,username:n,password:i})}),r=await t.json();if(r.ok){r.token&&sessionStorage.setItem("anet_v3_auth",JSON.stringify({user:r.user,token:r.token,networks:r.networks||[],currentNetwork:r.network_id||r.networks?.[0]?.network_id||""})),window.location.assign("/");return}g(r.error||"Login failed")}catch{g("Connection failed")}m(!1)};return(0,t.jsxs)("main",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 font-mono flex items-center justify-center relative overflow-hidden px-4 py-10 sm:py-16",children:[(0,t.jsx)("div",{className:"absolute inset-0 pointer-events-none anet-login-bg","aria-hidden":!0}),(0,t.jsxs)("div",{className:"relative w-full max-w-sm",children:[(0,t.jsxs)("div",{className:"text-center mb-7",children:[(0,t.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 mb-4 rounded-2xl bg-[#111128] border border-[#2a2a4a] anet-login-mark",children:(0,t.jsxs)("svg",{className:"w-9 h-9",viewBox:"0 0 32 32","aria-hidden":!0,children:[(0,t.jsx)("circle",{cx:"16",cy:"16",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",opacity:"0.25",className:"text-cyan-400 anet-login-mark-ring"}),(0,t.jsx)("line",{x1:"16",y1:"10",x2:"10",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.5",className:"text-cyan-400 anet-login-mark-edge"}),(0,t.jsx)("line",{x1:"16",y1:"10",x2:"22",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.5",className:"text-cyan-400 anet-login-mark-edge"}),(0,t.jsx)("line",{x1:"10",y1:"20",x2:"22",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.5",className:"text-cyan-400 anet-login-mark-edge"}),(0,t.jsx)("circle",{cx:"16",cy:"10",r:"3",fill:"currentColor",className:"text-cyan-400 anet-login-mark-node-a"}),(0,t.jsx)("circle",{cx:"10",cy:"20",r:"3",fill:"currentColor",className:"text-green-400 anet-login-mark-node-b"}),(0,t.jsx)("circle",{cx:"22",cy:"20",r:"3",fill:"currentColor",className:"text-violet-400 anet-login-mark-node-c"})]})}),(0,t.jsx)("h1",{className:"text-[22px] sm:text-2xl font-semibold text-white tracking-tight",children:"Agent Network"}),(0,t.jsx)("p",{className:"text-[13px] text-gray-500 mt-1.5 leading-snug",children:"login"===e?(0,t.jsxs)(t.Fragment,{children:["Welcome back · ",(0,t.jsx)("span",{className:"text-gray-600",children:"Tasks · Mesh · Messages"})]}):(0,t.jsxs)(t.Fragment,{children:["Create your account · ",(0,t.jsx)("span",{className:"text-gray-600",children:"Free preview · no credit card"})]})})]}),(0,t.jsx)("div",{className:"flex rounded-lg border border-[#2a2a4a] bg-[#111128] p-1 mb-4",children:["login","register"].map(r=>(0,t.jsx)("button",{type:"button",onClick:()=>{s(r),g("")},className:`flex-1 rounded-md px-3 py-2 text-sm transition-colors ${e===r?"bg-cyan-500/10 text-cyan-300":"text-gray-500 hover:text-gray-200"}`,children:"login"===r?"Sign in":"Register"},r))}),(0,t.jsxs)("form",{onSubmit:u,className:"border border-[#2a2a4a] bg-[#111128]/80 backdrop-blur-sm rounded-xl p-6 shadow-2xl shadow-black/30",children:[(0,t.jsx)("label",{htmlFor:"username",className:"block text-xs text-gray-500 mb-2 uppercase tracking-wider",children:"Username"}),(0,t.jsx)("input",{id:"username",type:"text",value:n,onChange:e=>o(e.target.value),autoFocus:!0,placeholder:"Enter username",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-4 py-3 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:ring-1 focus:ring-cyan-500/20 focus:outline-none transition-all mb-4"}),(0,t.jsx)("label",{htmlFor:"password",className:"block text-xs text-gray-500 mb-2 uppercase tracking-wider",children:"Password"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("input",{id:"password",type:c?"text":"password",value:i,onChange:e=>l(e.target.value),placeholder:"Enter password",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-4 pr-11 py-3 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:ring-1 focus:ring-cyan-500/20 focus:outline-none transition-all"}),(0,t.jsx)("button",{type:"button",onClick:()=>d(e=>!e),tabIndex:-1,"aria-label":c?"Hide password":"Show password",className:"absolute inset-y-0 right-0 flex items-center px-3 text-gray-600 hover:text-gray-300 transition-colors",children:c?(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),(0,t.jsx)("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})})]}),x&&(0,t.jsx)("div",{className:"mt-3 text-sm text-red-300 bg-red-500/5 border border-red-500/10 rounded-lg px-3 py-2",children:x}),(0,t.jsxs)("button",{type:"submit",disabled:h||!i||!n.trim(),className:"mt-5 w-full flex items-center justify-center gap-2 px-4 py-3 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 disabled:from-gray-800 disabled:to-gray-800 disabled:text-gray-600 text-white text-sm font-medium rounded-lg transition-all shadow-lg shadow-cyan-500/10 hover:shadow-cyan-500/20 disabled:shadow-none",children:[h&&(0,t.jsxs)("svg",{"aria-hidden":!0,className:"w-4 h-4 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",opacity:"0.25"}),(0,t.jsx)("path",{d:"M4 12a8 8 0 018-8",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]}),(0,t.jsx)("span",{children:h?"login"===e?"Signing in…":"Registering…":"login"===e?"Sign in":"Create account"})]})]}),(0,t.jsxs)("p",{className:"text-center text-[11px] text-gray-700 mt-6",children:["Sleep2AGI · Apache-2.0 · ",(0,t.jsx)("a",{href:"https://anet.sh",className:"hover:text-gray-500 transition-colors",children:"anet.sh"}),(0,t.jsx)("span",{className:"mx-1 text-gray-800",children:"·"}),(0,t.jsxs)("span",{className:"font-mono",title:"@sleep2agi/agent-network-dashboard",children:["v",a.DASHBOARD_VERSION]})]})]})]})}])}]);
package/.next/trace CHANGED
@@ -1,2 +1,2 @@
1
- [{"name":"generate-buildid","duration":528,"timestamp":228600185642,"id":4,"parentId":1,"tags":{},"startTime":1778600086010,"traceId":"f4a7855386aaeaa9"},{"name":"load-custom-routes","duration":1023,"timestamp":228600186409,"id":5,"parentId":1,"tags":{},"startTime":1778600086011,"traceId":"f4a7855386aaeaa9"},{"name":"create-dist-dir","duration":593,"timestamp":228600187497,"id":6,"parentId":1,"tags":{},"startTime":1778600086012,"traceId":"f4a7855386aaeaa9"},{"name":"clean","duration":705,"timestamp":228600189083,"id":7,"parentId":1,"tags":{},"startTime":1778600086014,"traceId":"f4a7855386aaeaa9"},{"name":"discover-routes","duration":28083,"timestamp":228600295982,"id":8,"parentId":1,"tags":{},"startTime":1778600086121,"traceId":"f4a7855386aaeaa9"},{"name":"create-root-mapping","duration":132,"timestamp":228600324135,"id":9,"parentId":1,"tags":{},"startTime":1778600086149,"traceId":"f4a7855386aaeaa9"},{"name":"generate-route-types","duration":19780,"timestamp":228600326491,"id":10,"parentId":1,"tags":{},"startTime":1778600086151,"traceId":"f4a7855386aaeaa9"},{"name":"public-dir-conflict-check","duration":135,"timestamp":228600347107,"id":11,"parentId":1,"tags":{},"startTime":1778600086172,"traceId":"f4a7855386aaeaa9"},{"name":"generate-routes-manifest","duration":4501,"timestamp":228600347456,"id":12,"parentId":1,"tags":{},"startTime":1778600086172,"traceId":"f4a7855386aaeaa9"},{"name":"run-turbopack","duration":13372901,"timestamp":228600360473,"id":14,"parentId":1,"tags":{},"startTime":1778600086185,"traceId":"f4a7855386aaeaa9"},{"name":"turbopack-build-events","duration":147,"timestamp":228600812998,"id":15,"parentId":1,"tags":{},"startTime":1778600086638,"traceId":"f4a7855386aaeaa9"},{"name":"run-typescript","duration":9392234,"timestamp":228613745550,"id":16,"parentId":1,"tags":{},"startTime":1778600099570,"traceId":"f4a7855386aaeaa9"},{"name":"generate-required-server-files","duration":2551,"timestamp":228623138833,"id":18,"parentId":1,"tags":{},"startTime":1778600108964,"traceId":"f4a7855386aaeaa9"},{"name":"check-static-error-page","duration":24500,"timestamp":228623218107,"id":20,"parentId":19,"tags":{},"startTime":1778600109043,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":439375,"timestamp":228623247772,"id":62,"parentId":22,"tags":{},"startTime":1778600109072,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":465992,"timestamp":228623221295,"id":22,"parentId":19,"tags":{"page":"/_global-error"},"startTime":1778600109046,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":525451,"timestamp":228623248876,"id":64,"parentId":26,"tags":{},"startTime":1778600109074,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":545910,"timestamp":228623228495,"id":26,"parentId":19,"tags":{"page":"/api/auth/logout"},"startTime":1778600109053,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":533360,"timestamp":228623248708,"id":63,"parentId":25,"tags":{},"startTime":1778600109073,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":555064,"timestamp":228623227075,"id":25,"parentId":19,"tags":{"page":"/api/auth/login"},"startTime":1778600109052,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":541419,"timestamp":228623247420,"id":61,"parentId":21,"tags":{},"startTime":1778600109072,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":569574,"timestamp":228623219321,"id":21,"parentId":19,"tags":{"page":"/_not-found"},"startTime":1778600109044,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":540099,"timestamp":228623248956,"id":66,"parentId":28,"tags":{},"startTime":1778600109074,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":560213,"timestamp":228623228870,"id":28,"parentId":19,"tags":{"page":"/api/hub/audit-log"},"startTime":1778600109054,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":544886,"timestamp":228623248920,"id":65,"parentId":27,"tags":{},"startTime":1778600109074,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":565206,"timestamp":228623228671,"id":27,"parentId":19,"tags":{"page":"/api/auth/v3"},"startTime":1778600109053,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":565293,"timestamp":228623249060,"id":68,"parentId":30,"tags":{},"startTime":1778600109074,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":584841,"timestamp":228623229578,"id":30,"parentId":19,"tags":{"page":"/api/hub/broadcast"},"startTime":1778600109054,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":567242,"timestamp":228623249094,"id":69,"parentId":32,"tags":{},"startTime":1778600109074,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":586351,"timestamp":228623230038,"id":32,"parentId":19,"tags":{"page":"/api/hub/health"},"startTime":1778600109055,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":575032,"timestamp":228623249258,"id":71,"parentId":34,"tags":{},"startTime":1778600109074,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":594099,"timestamp":228623230259,"id":34,"parentId":19,"tags":{"page":"/api/hub/license"},"startTime":1778600109055,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":580067,"timestamp":228623249213,"id":70,"parentId":33,"tags":{},"startTime":1778600109074,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":599186,"timestamp":228623230147,"id":33,"parentId":19,"tags":{"page":"/api/hub/inbox"},"startTime":1778600109055,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":587632,"timestamp":228623249276,"id":72,"parentId":35,"tags":{},"startTime":1778600109074,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":606605,"timestamp":228623230359,"id":35,"parentId":19,"tags":{"page":"/api/hub/messages"},"startTime":1778600109055,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":587886,"timestamp":228623249331,"id":73,"parentId":36,"tags":{},"startTime":1778600109074,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":606556,"timestamp":228623230694,"id":36,"parentId":19,"tags":{"page":"/api/hub/networks"},"startTime":1778600109055,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":591860,"timestamp":228623249957,"id":75,"parentId":38,"tags":{},"startTime":1778600109075,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":610941,"timestamp":228623230928,"id":38,"parentId":19,"tags":{"page":"/api/hub/register"},"startTime":1778600109056,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":592251,"timestamp":228623249872,"id":74,"parentId":37,"tags":{},"startTime":1778600109075,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":611318,"timestamp":228623230832,"id":37,"parentId":19,"tags":{"page":"/api/hub/nodes"},"startTime":1778600109056,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":597677,"timestamp":228623249966,"id":76,"parentId":39,"tags":{},"startTime":1778600109075,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":616697,"timestamp":228623230999,"id":39,"parentId":19,"tags":{"page":"/api/hub/send"},"startTime":1778600109056,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":600166,"timestamp":228623249979,"id":78,"parentId":41,"tags":{},"startTime":1778600109075,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":619010,"timestamp":228623231176,"id":41,"parentId":19,"tags":{"page":"/api/hub/session"},"startTime":1778600109056,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":603852,"timestamp":228623249973,"id":77,"parentId":40,"tags":{},"startTime":1778600109075,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":622792,"timestamp":228623231105,"id":40,"parentId":19,"tags":{"page":"/api/hub/server-logs"},"startTime":1778600109056,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":607409,"timestamp":228623249985,"id":79,"parentId":42,"tags":{},"startTime":1778600109075,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":626183,"timestamp":228623231272,"id":42,"parentId":19,"tags":{"page":"/api/hub/stats"},"startTime":1778600109056,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":607631,"timestamp":228623249991,"id":80,"parentId":43,"tags":{},"startTime":1778600109075,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":626721,"timestamp":228623231339,"id":43,"parentId":19,"tags":{"page":"/api/hub/status"},"startTime":1778600109056,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":609070,"timestamp":228623249997,"id":81,"parentId":44,"tags":{},"startTime":1778600109075,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":627690,"timestamp":228623231412,"id":44,"parentId":19,"tags":{"page":"/api/hub/task-events"},"startTime":1778600109056,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":611707,"timestamp":228623250027,"id":82,"parentId":45,"tags":{},"startTime":1778600109075,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":630303,"timestamp":228623231475,"id":45,"parentId":19,"tags":{"page":"/api/hub/tasks"},"startTime":1778600109056,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":613234,"timestamp":228623250033,"id":83,"parentId":46,"tags":{},"startTime":1778600109075,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":631745,"timestamp":228623231560,"id":46,"parentId":19,"tags":{"page":"/api/hub/tmux"},"startTime":1778600109056,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":615818,"timestamp":228623248999,"id":67,"parentId":29,"tags":{},"startTime":1778600109074,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":635863,"timestamp":228623228989,"id":29,"parentId":19,"tags":{"page":"/api/hub/auth"},"startTime":1778600109054,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":615550,"timestamp":228623250045,"id":85,"parentId":48,"tags":{},"startTime":1778600109075,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":633925,"timestamp":228623231705,"id":48,"parentId":19,"tags":{"page":"/favicon.ico"},"startTime":1778600109056,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":615697,"timestamp":228623250039,"id":84,"parentId":47,"tags":{},"startTime":1778600109075,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":634119,"timestamp":228623231637,"id":47,"parentId":19,"tags":{"page":"/api/hub/tokens"},"startTime":1778600109056,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":611015,"timestamp":228623258761,"id":87,"parentId":31,"tags":{},"startTime":1778600109083,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":640073,"timestamp":228623229745,"id":31,"parentId":19,"tags":{"page":"/api/hub/events"},"startTime":1778600109054,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":616413,"timestamp":228623253520,"id":86,"parentId":24,"tags":{},"startTime":1778600109078,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":647550,"timestamp":228623222401,"id":24,"parentId":19,"tags":{"page":"/api/anet/config"},"startTime":1778600109047,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":580158,"timestamp":228623295287,"id":90,"parentId":50,"tags":{},"startTime":1778600109120,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":641618,"timestamp":228623233873,"id":50,"parentId":19,"tags":{"page":"/logs"},"startTime":1778600109059,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":587633,"timestamp":228623295293,"id":91,"parentId":51,"tags":{},"startTime":1778600109120,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":648959,"timestamp":228623234024,"id":51,"parentId":19,"tags":{"page":"/messages"},"startTime":1778600109059,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":591519,"timestamp":228623295302,"id":92,"parentId":52,"tags":{},"startTime":1778600109120,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":652648,"timestamp":228623234224,"id":52,"parentId":19,"tags":{"page":"/node"},"startTime":1778600109059,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":597016,"timestamp":228623295310,"id":93,"parentId":53,"tags":{},"startTime":1778600109120,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":657972,"timestamp":228623234407,"id":53,"parentId":19,"tags":{"page":"/nodes"},"startTime":1778600109059,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":602571,"timestamp":228623295316,"id":94,"parentId":55,"tags":{},"startTime":1778600109120,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":661406,"timestamp":228623236537,"id":55,"parentId":19,"tags":{"page":"/server-logs"},"startTime":1778600109061,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":608785,"timestamp":228623295325,"id":95,"parentId":56,"tags":{},"startTime":1778600109120,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":667408,"timestamp":228623236776,"id":56,"parentId":19,"tags":{"page":"/settings/networks"},"startTime":1778600109061,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":614505,"timestamp":228623295333,"id":96,"parentId":58,"tags":{},"startTime":1778600109120,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":668033,"timestamp":228623241860,"id":58,"parentId":19,"tags":{"page":"/settings/tokens"},"startTime":1778600109067,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":618865,"timestamp":228623295230,"id":88,"parentId":23,"tags":{},"startTime":1778600109120,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":692021,"timestamp":228623222142,"id":23,"parentId":19,"tags":{"page":"/admin"},"startTime":1778600109047,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":622180,"timestamp":228623295276,"id":89,"parentId":49,"tags":{},"startTime":1778600109120,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":683862,"timestamp":228623233654,"id":49,"parentId":19,"tags":{"page":"/login"},"startTime":1778600109058,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":622290,"timestamp":228623295348,"id":98,"parentId":60,"tags":{},"startTime":1778600109120,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":675363,"timestamp":228623242297,"id":60,"parentId":19,"tags":{"page":"/tasks"},"startTime":1778600109067,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":624714,"timestamp":228623295338,"id":97,"parentId":59,"tags":{},"startTime":1778600109120,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":678024,"timestamp":228623242085,"id":59,"parentId":19,"tags":{"page":"/tasks/[id]"},"startTime":1778600109067,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":627623,"timestamp":228623295360,"id":99,"parentId":54,"tags":{},"startTime":1778600109120,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":688432,"timestamp":228623234614,"id":54,"parentId":19,"tags":{"page":"/"},"startTime":1778600109059,"traceId":"f4a7855386aaeaa9"},{"name":"is-page-static","duration":628130,"timestamp":228623295366,"id":100,"parentId":57,"tags":{},"startTime":1778600109120,"traceId":"f4a7855386aaeaa9"},{"name":"check-page","duration":682219,"timestamp":228623241302,"id":57,"parentId":19,"tags":{"page":"/settings"},"startTime":1778600109066,"traceId":"f4a7855386aaeaa9"},{"name":"static-check","duration":706246,"timestamp":228623217311,"id":19,"parentId":1,"tags":{},"startTime":1778600109042,"traceId":"f4a7855386aaeaa9"},{"name":"write-routes-manifest","duration":439,"timestamp":228623930130,"id":102,"parentId":1,"tags":{},"startTime":1778600109755,"traceId":"f4a7855386aaeaa9"},{"name":"load-dotenv","duration":70,"timestamp":228623945969,"id":105,"parentId":104,"tags":{},"startTime":1778600109771,"traceId":"f4a7855386aaeaa9"},{"name":"run-export-path-map","duration":678,"timestamp":228623948763,"id":106,"parentId":104,"tags":{},"startTime":1778600109773,"traceId":"f4a7855386aaeaa9"},{"name":"next-export","duration":568204,"timestamp":228623944741,"id":104,"parentId":1,"tags":{},"startTime":1778600109769,"traceId":"f4a7855386aaeaa9"},{"name":"move-exported-app-not-found-","duration":749,"timestamp":228624516575,"id":107,"parentId":103,"tags":{},"startTime":1778600110341,"traceId":"f4a7855386aaeaa9"},{"name":"move-exported-app-global-error-","duration":467,"timestamp":228624517428,"id":108,"parentId":103,"tags":{},"startTime":1778600110342,"traceId":"f4a7855386aaeaa9"}]
2
- [{"name":"static-generation","duration":586758,"timestamp":228623935918,"id":103,"parentId":1,"tags":{},"startTime":1778600109761,"traceId":"f4a7855386aaeaa9"},{"name":"write-routes-manifest","duration":507,"timestamp":228624522866,"id":109,"parentId":1,"tags":{},"startTime":1778600110348,"traceId":"f4a7855386aaeaa9"},{"name":"print-tree-view","duration":3547,"timestamp":228624532364,"id":110,"parentId":1,"tags":{},"startTime":1778600110357,"traceId":"f4a7855386aaeaa9"},{"name":"write-route-bundle-stats","duration":13171,"timestamp":228624535949,"id":111,"parentId":1,"tags":{},"startTime":1778600110361,"traceId":"f4a7855386aaeaa9"},{"name":"telemetry-flush","duration":30921,"timestamp":228624549159,"id":112,"parentId":1,"tags":{},"startTime":1778600110374,"traceId":"f4a7855386aaeaa9"},{"name":"next-build","duration":24458610,"timestamp":228600121515,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1778600085946,"traceId":"f4a7855386aaeaa9"}]
1
+ [{"name":"generate-buildid","duration":307,"timestamp":289497931148,"id":4,"parentId":1,"tags":{},"startTime":1778660983756,"traceId":"3d7facc98682b447"},{"name":"load-custom-routes","duration":893,"timestamp":289497931832,"id":5,"parentId":1,"tags":{},"startTime":1778660983757,"traceId":"3d7facc98682b447"},{"name":"create-dist-dir","duration":393,"timestamp":289497932857,"id":6,"parentId":1,"tags":{},"startTime":1778660983758,"traceId":"3d7facc98682b447"},{"name":"clean","duration":510,"timestamp":289497934030,"id":7,"parentId":1,"tags":{},"startTime":1778660983759,"traceId":"3d7facc98682b447"},{"name":"discover-routes","duration":12658,"timestamp":289498034657,"id":8,"parentId":1,"tags":{},"startTime":1778660983859,"traceId":"3d7facc98682b447"},{"name":"create-root-mapping","duration":177,"timestamp":289498047408,"id":9,"parentId":1,"tags":{},"startTime":1778660983872,"traceId":"3d7facc98682b447"},{"name":"generate-route-types","duration":40971,"timestamp":289498050118,"id":10,"parentId":1,"tags":{},"startTime":1778660983875,"traceId":"3d7facc98682b447"},{"name":"public-dir-conflict-check","duration":136,"timestamp":289498091321,"id":11,"parentId":1,"tags":{},"startTime":1778660983916,"traceId":"3d7facc98682b447"},{"name":"generate-routes-manifest","duration":5368,"timestamp":289498091624,"id":12,"parentId":1,"tags":{},"startTime":1778660983916,"traceId":"3d7facc98682b447"},{"name":"run-turbopack","duration":8042174,"timestamp":289498103467,"id":14,"parentId":1,"tags":{},"startTime":1778660983928,"traceId":"3d7facc98682b447"},{"name":"turbopack-build-events","duration":102,"timestamp":289498405957,"id":15,"parentId":1,"tags":{},"startTime":1778660984231,"traceId":"3d7facc98682b447"},{"name":"run-typescript","duration":8551773,"timestamp":289506156271,"id":16,"parentId":1,"tags":{},"startTime":1778660991981,"traceId":"3d7facc98682b447"},{"name":"generate-required-server-files","duration":2484,"timestamp":289514708998,"id":18,"parentId":1,"tags":{},"startTime":1778661000534,"traceId":"3d7facc98682b447"},{"name":"check-static-error-page","duration":17270,"timestamp":289514784949,"id":20,"parentId":19,"tags":{},"startTime":1778661000610,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":461041,"timestamp":289514805401,"id":62,"parentId":22,"tags":{},"startTime":1778661000630,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":479171,"timestamp":289514787395,"id":22,"parentId":19,"tags":{"page":"/_global-error"},"startTime":1778661000612,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":472417,"timestamp":289514805488,"id":63,"parentId":25,"tags":{},"startTime":1778661000630,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":487749,"timestamp":289514790236,"id":25,"parentId":19,"tags":{"page":"/api/auth/login"},"startTime":1778661000615,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":497814,"timestamp":289514805675,"id":65,"parentId":27,"tags":{},"startTime":1778661000630,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":511222,"timestamp":289514792332,"id":27,"parentId":19,"tags":{"page":"/api/auth/v3"},"startTime":1778661000617,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":507640,"timestamp":289514805710,"id":66,"parentId":28,"tags":{},"startTime":1778661000630,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":520904,"timestamp":289514792512,"id":28,"parentId":19,"tags":{"page":"/api/hub/audit-log"},"startTime":1778661000617,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":512097,"timestamp":289514805762,"id":67,"parentId":29,"tags":{},"startTime":1778661000630,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":525271,"timestamp":289514792653,"id":29,"parentId":19,"tags":{"page":"/api/hub/auth"},"startTime":1778661000617,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":517428,"timestamp":289514805797,"id":68,"parentId":30,"tags":{},"startTime":1778661000630,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":530291,"timestamp":289514792997,"id":30,"parentId":19,"tags":{"page":"/api/hub/broadcast"},"startTime":1778661000618,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":523339,"timestamp":289514805836,"id":69,"parentId":32,"tags":{},"startTime":1778661000631,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":534993,"timestamp":289514794247,"id":32,"parentId":19,"tags":{"page":"/api/hub/health"},"startTime":1778661000619,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":528258,"timestamp":289514805932,"id":70,"parentId":33,"tags":{},"startTime":1778661000631,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":539909,"timestamp":289514794347,"id":33,"parentId":19,"tags":{"page":"/api/hub/inbox"},"startTime":1778661000619,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":531672,"timestamp":289514805985,"id":71,"parentId":34,"tags":{},"startTime":1778661000631,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":543292,"timestamp":289514794428,"id":34,"parentId":19,"tags":{"page":"/api/hub/license"},"startTime":1778661000619,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":535924,"timestamp":289514806016,"id":72,"parentId":35,"tags":{},"startTime":1778661000631,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":547486,"timestamp":289514794510,"id":35,"parentId":19,"tags":{"page":"/api/hub/messages"},"startTime":1778661000619,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":540007,"timestamp":289514806081,"id":73,"parentId":36,"tags":{},"startTime":1778661000631,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":551280,"timestamp":289514794863,"id":36,"parentId":19,"tags":{"page":"/api/hub/networks"},"startTime":1778661000620,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":544372,"timestamp":289514806099,"id":74,"parentId":37,"tags":{},"startTime":1778661000631,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":555548,"timestamp":289514794985,"id":37,"parentId":19,"tags":{"page":"/api/hub/nodes"},"startTime":1778661000620,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":551037,"timestamp":289514804271,"id":61,"parentId":21,"tags":{},"startTime":1778661000629,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":569190,"timestamp":289514786180,"id":21,"parentId":19,"tags":{"page":"/_not-found"},"startTime":1778661000611,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":549596,"timestamp":289514806108,"id":75,"parentId":38,"tags":{},"startTime":1778661000631,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":560667,"timestamp":289514795096,"id":38,"parentId":19,"tags":{"page":"/api/hub/register"},"startTime":1778661000620,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":559380,"timestamp":289514806120,"id":77,"parentId":40,"tags":{},"startTime":1778661000631,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":570902,"timestamp":289514795220,"id":40,"parentId":19,"tags":{"page":"/api/hub/server-logs"},"startTime":1778661000620,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":563504,"timestamp":289514806126,"id":78,"parentId":41,"tags":{},"startTime":1778661000631,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":574402,"timestamp":289514795281,"id":41,"parentId":19,"tags":{"page":"/api/hub/session"},"startTime":1778661000620,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":568342,"timestamp":289514806131,"id":79,"parentId":42,"tags":{},"startTime":1778661000631,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":579205,"timestamp":289514795345,"id":42,"parentId":19,"tags":{"page":"/api/hub/stats"},"startTime":1778661000620,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":571058,"timestamp":289514806137,"id":80,"parentId":43,"tags":{},"startTime":1778661000631,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":581838,"timestamp":289514795405,"id":43,"parentId":19,"tags":{"page":"/api/hub/status"},"startTime":1778661000620,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":574839,"timestamp":289514806142,"id":81,"parentId":44,"tags":{},"startTime":1778661000631,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":585578,"timestamp":289514795471,"id":44,"parentId":19,"tags":{"page":"/api/hub/task-events"},"startTime":1778661000620,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":579678,"timestamp":289514805633,"id":64,"parentId":26,"tags":{},"startTime":1778661000630,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":594935,"timestamp":289514790439,"id":26,"parentId":19,"tags":{"page":"/api/auth/logout"},"startTime":1778661000615,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":579424,"timestamp":289514806147,"id":82,"parentId":45,"tags":{},"startTime":1778661000631,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":590071,"timestamp":289514795531,"id":45,"parentId":19,"tags":{"page":"/api/hub/tasks"},"startTime":1778661000620,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":591406,"timestamp":289514806158,"id":84,"parentId":47,"tags":{},"startTime":1778661000631,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":601951,"timestamp":289514795677,"id":47,"parentId":19,"tags":{"page":"/api/hub/tokens"},"startTime":1778661000620,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":607960,"timestamp":289514806153,"id":83,"parentId":46,"tags":{},"startTime":1778661000631,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":618561,"timestamp":289514795615,"id":46,"parentId":19,"tags":{"page":"/api/hub/tmux"},"startTime":1778661000620,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":608134,"timestamp":289514806163,"id":85,"parentId":48,"tags":{},"startTime":1778661000631,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":618589,"timestamp":289514795734,"id":48,"parentId":19,"tags":{"page":"/favicon.ico"},"startTime":1778661000620,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":608294,"timestamp":289514806114,"id":76,"parentId":39,"tags":{},"startTime":1778661000631,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":619266,"timestamp":289514795161,"id":39,"parentId":19,"tags":{"page":"/api/hub/send"},"startTime":1778661000620,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":609526,"timestamp":289514810981,"id":87,"parentId":31,"tags":{},"startTime":1778661000636,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":626737,"timestamp":289514793842,"id":31,"parentId":19,"tags":{"page":"/api/hub/events"},"startTime":1778661000619,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":595805,"timestamp":289514829364,"id":88,"parentId":23,"tags":{},"startTime":1778661000654,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":637603,"timestamp":289514787627,"id":23,"parentId":19,"tags":{"page":"/admin"},"startTime":1778661000612,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":620284,"timestamp":289514810225,"id":86,"parentId":24,"tags":{},"startTime":1778661000635,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":642735,"timestamp":289514787832,"id":24,"parentId":19,"tags":{"page":"/api/anet/config"},"startTime":1778661000613,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":605406,"timestamp":289514829420,"id":90,"parentId":50,"tags":{},"startTime":1778661000654,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":638616,"timestamp":289514796281,"id":50,"parentId":19,"tags":{"page":"/logs"},"startTime":1778661000621,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":610897,"timestamp":289514829440,"id":92,"parentId":52,"tags":{},"startTime":1778661000654,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":643826,"timestamp":289514796584,"id":52,"parentId":19,"tags":{"page":"/node"},"startTime":1778661000621,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":619440,"timestamp":289514829446,"id":93,"parentId":53,"tags":{},"startTime":1778661000654,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":652147,"timestamp":289514796818,"id":53,"parentId":19,"tags":{"page":"/nodes"},"startTime":1778661000622,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":626173,"timestamp":289514829455,"id":94,"parentId":55,"tags":{},"startTime":1778661000654,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":658193,"timestamp":289514797490,"id":55,"parentId":19,"tags":{"page":"/server-logs"},"startTime":1778661000622,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":634650,"timestamp":289514829464,"id":95,"parentId":56,"tags":{},"startTime":1778661000654,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":666537,"timestamp":289514797663,"id":56,"parentId":19,"tags":{"page":"/settings/networks"},"startTime":1778661000622,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":638097,"timestamp":289514829470,"id":96,"parentId":58,"tags":{},"startTime":1778661000654,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":665837,"timestamp":289514801788,"id":58,"parentId":19,"tags":{"page":"/settings/tokens"},"startTime":1778661000626,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":638343,"timestamp":289514829411,"id":89,"parentId":49,"tags":{},"startTime":1778661000654,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":671643,"timestamp":289514796135,"id":49,"parentId":19,"tags":{"page":"/login"},"startTime":1778661000621,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":644009,"timestamp":289514829492,"id":98,"parentId":60,"tags":{},"startTime":1778661000654,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":671528,"timestamp":289514802029,"id":60,"parentId":19,"tags":{"page":"/tasks"},"startTime":1778661000627,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":646384,"timestamp":289514829430,"id":91,"parentId":51,"tags":{},"startTime":1778661000654,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":679462,"timestamp":289514796406,"id":51,"parentId":19,"tags":{"page":"/messages"},"startTime":1778661000621,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":649136,"timestamp":289514829480,"id":97,"parentId":59,"tags":{},"startTime":1778661000654,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":676761,"timestamp":289514801919,"id":59,"parentId":19,"tags":{"page":"/tasks/[id]"},"startTime":1778661000627,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":650279,"timestamp":289514829505,"id":99,"parentId":54,"tags":{},"startTime":1778661000654,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":682795,"timestamp":289514797042,"id":54,"parentId":19,"tags":{"page":"/"},"startTime":1778661000622,"traceId":"3d7facc98682b447"},{"name":"is-page-static","duration":652243,"timestamp":289514829515,"id":100,"parentId":57,"tags":{},"startTime":1778661000654,"traceId":"3d7facc98682b447"},{"name":"check-page","duration":683970,"timestamp":289514797836,"id":57,"parentId":19,"tags":{"page":"/settings"},"startTime":1778661000623,"traceId":"3d7facc98682b447"},{"name":"static-check","duration":698252,"timestamp":289514783595,"id":19,"parentId":1,"tags":{},"startTime":1778661000608,"traceId":"3d7facc98682b447"},{"name":"write-routes-manifest","duration":595,"timestamp":289515488984,"id":102,"parentId":1,"tags":{},"startTime":1778661001314,"traceId":"3d7facc98682b447"},{"name":"load-dotenv","duration":52,"timestamp":289515502055,"id":105,"parentId":104,"tags":{},"startTime":1778661001327,"traceId":"3d7facc98682b447"},{"name":"run-export-path-map","duration":711,"timestamp":289515505494,"id":106,"parentId":104,"tags":{},"startTime":1778661001330,"traceId":"3d7facc98682b447"},{"name":"next-export","duration":763849,"timestamp":289515500778,"id":104,"parentId":1,"tags":{},"startTime":1778661001325,"traceId":"3d7facc98682b447"},{"name":"move-exported-app-not-found-","duration":649,"timestamp":289516268132,"id":107,"parentId":103,"tags":{},"startTime":1778661002093,"traceId":"3d7facc98682b447"},{"name":"move-exported-app-global-error-","duration":403,"timestamp":289516268882,"id":108,"parentId":103,"tags":{},"startTime":1778661002094,"traceId":"3d7facc98682b447"}]
2
+ [{"name":"static-generation","duration":778710,"timestamp":289515495107,"id":103,"parentId":1,"tags":{},"startTime":1778661001320,"traceId":"3d7facc98682b447"},{"name":"write-routes-manifest","duration":454,"timestamp":289516274050,"id":109,"parentId":1,"tags":{},"startTime":1778661002099,"traceId":"3d7facc98682b447"},{"name":"print-tree-view","duration":3816,"timestamp":289516282635,"id":110,"parentId":1,"tags":{},"startTime":1778661002107,"traceId":"3d7facc98682b447"},{"name":"write-route-bundle-stats","duration":14756,"timestamp":289516286494,"id":111,"parentId":1,"tags":{},"startTime":1778661002111,"traceId":"3d7facc98682b447"},{"name":"telemetry-flush","duration":26295,"timestamp":289516301287,"id":112,"parentId":1,"tags":{},"startTime":1778661002126,"traceId":"3d7facc98682b447"},{"name":"next-build","duration":18451408,"timestamp":289497876215,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1778660983701,"traceId":"3d7facc98682b447"}]
package/.next/trace-build CHANGED
@@ -1 +1 @@
1
- [{"name":"run-turbopack","duration":13372901,"timestamp":228600360473,"id":14,"parentId":1,"tags":{},"startTime":1778600086185,"traceId":"f4a7855386aaeaa9"},{"name":"turbopack-build-events","duration":147,"timestamp":228600812998,"id":15,"parentId":1,"tags":{},"startTime":1778600086638,"traceId":"f4a7855386aaeaa9"},{"name":"run-typescript","duration":9392234,"timestamp":228613745550,"id":16,"parentId":1,"tags":{},"startTime":1778600099570,"traceId":"f4a7855386aaeaa9"},{"name":"static-check","duration":706246,"timestamp":228623217311,"id":19,"parentId":1,"tags":{},"startTime":1778600109042,"traceId":"f4a7855386aaeaa9"},{"name":"static-generation","duration":586758,"timestamp":228623935918,"id":103,"parentId":1,"tags":{},"startTime":1778600109761,"traceId":"f4a7855386aaeaa9"},{"name":"telemetry-flush","duration":30921,"timestamp":228624549159,"id":112,"parentId":1,"tags":{},"startTime":1778600110374,"traceId":"f4a7855386aaeaa9"},{"name":"next-build","duration":24458610,"timestamp":228600121515,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1778600085946,"traceId":"f4a7855386aaeaa9"}]
1
+ [{"name":"run-turbopack","duration":8042174,"timestamp":289498103467,"id":14,"parentId":1,"tags":{},"startTime":1778660983928,"traceId":"3d7facc98682b447"},{"name":"turbopack-build-events","duration":102,"timestamp":289498405957,"id":15,"parentId":1,"tags":{},"startTime":1778660984231,"traceId":"3d7facc98682b447"},{"name":"run-typescript","duration":8551773,"timestamp":289506156271,"id":16,"parentId":1,"tags":{},"startTime":1778660991981,"traceId":"3d7facc98682b447"},{"name":"static-check","duration":698252,"timestamp":289514783595,"id":19,"parentId":1,"tags":{},"startTime":1778661000608,"traceId":"3d7facc98682b447"},{"name":"static-generation","duration":778710,"timestamp":289515495107,"id":103,"parentId":1,"tags":{},"startTime":1778661001320,"traceId":"3d7facc98682b447"},{"name":"telemetry-flush","duration":26295,"timestamp":289516301287,"id":112,"parentId":1,"tags":{},"startTime":1778661002126,"traceId":"3d7facc98682b447"},{"name":"next-build","duration":18451408,"timestamp":289497876215,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1778660983701,"traceId":"3d7facc98682b447"}]
@@ -31,7 +31,14 @@ interface FlowLink {
31
31
  const cx = 500;
32
32
  const cy = 330;
33
33
  const onlineRadius = 220;
34
- const offlineRadius = 315;
34
+ // Round 97 (issue #50): tiered online rings when N > 8 so labels stop
35
+ // overlapping each other. Single ring at r=220 already gives ~22° per
36
+ // node at N=14 in a 320° spread; labels are 124px wide so they collide.
37
+ // Splitting into inner (first half) + outer (rest) doubles arc-room.
38
+ const onlineTierThreshold = 8;
39
+ const onlineInnerRadius = 175;
40
+ const onlineOuterRadius = 260;
41
+ const offlineRadius = 325;
35
42
 
36
43
  /** Polar coordinate for a node on a ring. `rotateBy` lets the caller offset
37
44
  * the whole ring so two stacked rings don't align radially (round 25: the
@@ -248,17 +255,41 @@ export function TopoGraph({ sessions, sseSessions }: TopoGraphProps) {
248
255
  const offline = sessions.filter(s => s.status === 'offline' && !sseCount(s));
249
256
  const positions: Record<string, Point> = {};
250
257
 
251
- online.forEach((s, index) => {
252
- positions[s.alias] = polarPoint(index, Math.max(online.length, 1), onlineRadius);
253
- });
258
+ // Round 97 (issue #50): when there are more online agents than a single
259
+ // ring can comfortably show (each 124px label needs ≥130px of arc), split
260
+ // them into two concentric rings. Inner ring gets the first half so the
261
+ // graph "grows outward" as more agents come online. Outer ring is rotated
262
+ // by half the inner step so its nodes sit in the angular gaps.
263
+ const tier = online.length > onlineTierThreshold;
264
+ if (tier) {
265
+ const innerCount = Math.ceil(online.length / 2);
266
+ const outerCount = online.length - innerCount;
267
+ const innerNodes = online.slice(0, innerCount);
268
+ const outerNodes = online.slice(innerCount);
269
+ innerNodes.forEach((s, index) => {
270
+ positions[s.alias] = polarPoint(index, Math.max(innerCount, 1), onlineInnerRadius);
271
+ });
272
+ const innerSpread = innerCount <= 2 ? Math.PI : Math.PI * 1.78;
273
+ const innerStep = innerCount > 1 ? innerSpread / (innerCount - 1) : 0;
274
+ outerNodes.forEach((s, index) => {
275
+ positions[s.alias] = polarPoint(index, Math.max(outerCount, 1), onlineOuterRadius, innerStep / 2);
276
+ });
277
+ } else {
278
+ online.forEach((s, index) => {
279
+ positions[s.alias] = polarPoint(index, Math.max(online.length, 1), onlineRadius);
280
+ });
281
+ }
254
282
 
255
283
  // Offset the offline ring radially by half the online step so offline
256
284
  // bubbles sit in the angular gaps between online bubbles instead of
257
285
  // stacking directly behind them. Also push the outer ring further when
258
- // there are many offline nodes so labels don't crowd the legend.
259
- const spread = online.length <= 2 ? Math.PI : Math.PI * 1.78;
260
- const onlineStep = online.length > 1 ? spread / (online.length - 1) : 0;
261
- const offlineRotation = online.length > 0 ? onlineStep / 2 : 0;
286
+ // there are many offline nodes so labels don't crowd the legend. When
287
+ // tiered, the outer online ring is at r=260, so push offline further so
288
+ // they don't collide with the outer online labels.
289
+ const outerOnlineCount = tier ? online.length - Math.ceil(online.length / 2) : online.length;
290
+ const outerSpreadBase = outerOnlineCount <= 2 ? Math.PI : Math.PI * 1.78;
291
+ const outerStep = outerOnlineCount > 1 ? outerSpreadBase / (outerOnlineCount - 1) : 0;
292
+ const offlineRotation = outerOnlineCount > 0 ? outerStep / 2 : 0;
262
293
  const offlineR = offlineRadius + Math.max(0, offline.length - 4) * 6;
263
294
 
264
295
  offline.forEach((s, index) => {
@@ -161,8 +161,12 @@ export default function ServerLogsPage() {
161
161
  </div>
162
162
  </div>
163
163
 
164
- <div className="flex items-center gap-3 mb-3">
165
- <div className="flex items-center gap-1 text-xs">
164
+ {/* Round 95: flex-wrap + min-w-0 on the search wrapper so the
165
+ search input drops below the chip strip on mobile instead of
166
+ overflowing past the viewport. Desktop layout (single row)
167
+ unchanged because the row has room. */}
168
+ <div className="flex flex-wrap items-center gap-3 mb-3">
169
+ <div className="flex items-center gap-1 text-xs flex-wrap">
166
170
  {/* Round 84: every chip shows its count (matches Tasks r56 +
167
171
  Audit Log r43); zero-count non-active chips are disabled
168
172
  + muted so the eye lands on the levels that actually have
@@ -192,7 +196,7 @@ export default function ServerLogsPage() {
192
196
  value={search}
193
197
  onChange={e => setSearch(e.target.value)}
194
198
  placeholder="搜索关键字 (alias / task_id / error message)"
195
- className="flex-1 px-3 py-1.5 text-xs bg-[#11111c] border border-[#2a2a4a] rounded text-gray-200 focus:outline-none focus:border-cyan-500/40"
199
+ className="flex-1 min-w-[140px] basis-full sm:basis-0 px-3 py-1.5 text-xs bg-[#11111c] border border-[#2a2a4a] rounded text-gray-200 focus:outline-none focus:border-cyan-500/40"
196
200
  />
197
201
  <span className="text-[10px] text-gray-600">
198
202
  {filtered.length} / {logs.length}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleep2agi/agent-network-dashboard",
3
- "version": "0.4.5-preview.77",
3
+ "version": "0.4.5-preview.79",
4
4
  "description": "Agent Network Dashboard — Web UI for managing AI Agent networks",
5
5
  "scripts": {
6
6
  "dev": "next dev",
@@ -19,6 +19,9 @@ const targets = [
19
19
  { name: 'server-logs-cyber-desktop', path: '/server-logs', theme: 'cyber', w: 1440, h: 900 },
20
20
  { name: 'server-logs-cyber-mobile', path: '/server-logs', theme: 'cyber', w: 390, h: 844 },
21
21
  { name: 'admin-cyber-desktop', path: '/admin', theme: 'cyber', w: 1440, h: 900 },
22
+ { name: 'admin-light-desktop', path: '/admin', theme: 'light', w: 1440, h: 900 },
23
+ { name: 'tasks-light-desktop', path: '/tasks', theme: 'light', w: 1440, h: 900 },
24
+ { name: 'server-logs-light-desktop', path: '/server-logs', theme: 'light', w: 1440, h: 900 },
22
25
  ];
23
26
 
24
27
  const browser = await chromium.launch({ headless: true });