@sleep2agi/agent-network-dashboard 0.4.5-preview.4 → 0.4.5-preview.41
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.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/diagnostics/route-bundle-stats.json +50 -50
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +4 -4
- package/.next/server/app/_not-found.rsc +12 -12
- package/.next/server/app/_not-found.segments/_full.segment.rsc +12 -12
- package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/server/app/_not-found.segments/_index.segment.rsc +7 -7
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/admin/page.js.nft.json +1 -1
- package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin.html +4 -4
- package/.next/server/app/admin.rsc +14 -14
- package/.next/server/app/admin.segments/_full.segment.rsc +14 -14
- package/.next/server/app/admin.segments/_head.segment.rsc +4 -4
- package/.next/server/app/admin.segments/_index.segment.rsc +7 -7
- package/.next/server/app/admin.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/admin.segments/admin/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/admin.segments/admin.segment.rsc +3 -3
- package/.next/server/app/index.html +4 -4
- package/.next/server/app/index.rsc +14 -14
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/index.segments/_full.segment.rsc +14 -14
- package/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/server/app/index.segments/_index.segment.rsc +7 -7
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +2 -2
- package/.next/server/app/login.rsc +14 -14
- package/.next/server/app/login.segments/_full.segment.rsc +14 -14
- package/.next/server/app/login.segments/_head.segment.rsc +4 -4
- package/.next/server/app/login.segments/_index.segment.rsc +7 -7
- package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/login.segments/login.segment.rsc +3 -3
- package/.next/server/app/logs/page.js.nft.json +1 -1
- package/.next/server/app/logs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/logs.html +4 -4
- package/.next/server/app/logs.rsc +14 -14
- package/.next/server/app/logs.segments/_full.segment.rsc +14 -14
- package/.next/server/app/logs.segments/_head.segment.rsc +4 -4
- package/.next/server/app/logs.segments/_index.segment.rsc +7 -7
- package/.next/server/app/logs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/logs.segments/logs.segment.rsc +3 -3
- package/.next/server/app/messages/page.js.nft.json +1 -1
- package/.next/server/app/messages/page_client-reference-manifest.js +1 -1
- package/.next/server/app/messages.html +4 -4
- package/.next/server/app/messages.rsc +14 -14
- package/.next/server/app/messages.segments/_full.segment.rsc +14 -14
- package/.next/server/app/messages.segments/_head.segment.rsc +4 -4
- package/.next/server/app/messages.segments/_index.segment.rsc +7 -7
- package/.next/server/app/messages.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/messages.segments/messages/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/messages.segments/messages.segment.rsc +3 -3
- package/.next/server/app/node/page.js.nft.json +1 -1
- package/.next/server/app/node/page_client-reference-manifest.js +1 -1
- package/.next/server/app/node.html +4 -4
- package/.next/server/app/node.rsc +14 -14
- package/.next/server/app/node.segments/_full.segment.rsc +14 -14
- package/.next/server/app/node.segments/_head.segment.rsc +4 -4
- package/.next/server/app/node.segments/_index.segment.rsc +7 -7
- package/.next/server/app/node.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/node.segments/node/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/node.segments/node.segment.rsc +3 -3
- package/.next/server/app/nodes/page.js.nft.json +1 -1
- package/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
- package/.next/server/app/nodes.html +4 -4
- package/.next/server/app/nodes.rsc +14 -14
- package/.next/server/app/nodes.segments/_full.segment.rsc +14 -14
- package/.next/server/app/nodes.segments/_head.segment.rsc +4 -4
- package/.next/server/app/nodes.segments/_index.segment.rsc +7 -7
- package/.next/server/app/nodes.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/nodes.segments/nodes/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/nodes.segments/nodes.segment.rsc +3 -3
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/server-logs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/server-logs.html +4 -4
- package/.next/server/app/server-logs.rsc +14 -14
- package/.next/server/app/server-logs.segments/_full.segment.rsc +14 -14
- package/.next/server/app/server-logs.segments/_head.segment.rsc +4 -4
- package/.next/server/app/server-logs.segments/_index.segment.rsc +7 -7
- package/.next/server/app/server-logs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/server-logs.segments/server-logs/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/server-logs.segments/server-logs.segment.rsc +3 -3
- package/.next/server/app/settings/networks/page.js.nft.json +1 -1
- package/.next/server/app/settings/networks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/networks.html +4 -4
- package/.next/server/app/settings/networks.rsc +14 -14
- package/.next/server/app/settings/networks.segments/_full.segment.rsc +14 -14
- package/.next/server/app/settings/networks.segments/_head.segment.rsc +4 -4
- package/.next/server/app/settings/networks.segments/_index.segment.rsc +7 -7
- package/.next/server/app/settings/networks.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings/networks.segments/settings/networks/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/settings/networks.segments/settings/networks.segment.rsc +3 -3
- package/.next/server/app/settings/networks.segments/settings.segment.rsc +3 -3
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/tokens/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/tokens.html +4 -4
- package/.next/server/app/settings/tokens.rsc +14 -14
- package/.next/server/app/settings/tokens.segments/_full.segment.rsc +14 -14
- package/.next/server/app/settings/tokens.segments/_head.segment.rsc +4 -4
- package/.next/server/app/settings/tokens.segments/_index.segment.rsc +7 -7
- package/.next/server/app/settings/tokens.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings/tokens.segments/settings/tokens/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/settings/tokens.segments/settings/tokens.segment.rsc +3 -3
- package/.next/server/app/settings/tokens.segments/settings.segment.rsc +3 -3
- package/.next/server/app/settings.html +4 -4
- package/.next/server/app/settings.rsc +14 -14
- package/.next/server/app/settings.segments/_full.segment.rsc +14 -14
- package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
- package/.next/server/app/settings.segments/_index.segment.rsc +7 -7
- package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/settings.segments/settings.segment.rsc +3 -3
- package/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tasks/page.js.nft.json +1 -1
- package/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tasks.html +4 -4
- package/.next/server/app/tasks.rsc +14 -14
- package/.next/server/app/tasks.segments/_full.segment.rsc +14 -14
- package/.next/server/app/tasks.segments/_head.segment.rsc +4 -4
- package/.next/server/app/tasks.segments/_index.segment.rsc +7 -7
- package/.next/server/app/tasks.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/tasks.segments/tasks.segment.rsc +3 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__02ee4km._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__02ee4km._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0jjqrcf._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0jjqrcf._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0o8yj3c._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0o8yj3c._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0xm3h9x._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0xm3h9x._.js.map +1 -1
- package/.next/server/chunks/ssr/_0nne7mz._.js +3 -0
- package/.next/server/chunks/ssr/_0nne7mz._.js.map +1 -0
- package/.next/server/chunks/ssr/app_0.zbtn5._.js +9 -0
- package/.next/server/chunks/ssr/app_0.zbtn5._.js.map +1 -0
- package/.next/server/chunks/ssr/app_04n78pr._.js +3 -0
- package/.next/server/chunks/ssr/app_04n78pr._.js.map +1 -0
- package/.next/server/chunks/ssr/app_0_agk0r._.js +3 -0
- package/.next/server/chunks/ssr/app_0_agk0r._.js.map +1 -0
- package/.next/server/chunks/ssr/app_0dk5wao._.js +1 -1
- package/.next/server/chunks/ssr/app_0dk5wao._.js.map +1 -1
- package/.next/server/chunks/ssr/app_0izi28j._.js +1 -1
- package/.next/server/chunks/ssr/app_0izi28j._.js.map +1 -1
- package/.next/server/chunks/ssr/app_0tncr1_._.js +3 -0
- package/.next/server/chunks/ssr/app_0tncr1_._.js.map +1 -0
- package/.next/server/chunks/ssr/app_components_08ys5y3._.js +5 -5
- package/.next/server/chunks/ssr/app_components_08ys5y3._.js.map +1 -1
- package/.next/server/chunks/ssr/app_components_0lhp_k.._.js +3 -0
- package/.next/server/chunks/ssr/app_components_0lhp_k.._.js.map +1 -0
- package/.next/server/chunks/ssr/app_login_page_tsx_0z71ad3._.js +1 -1
- package/.next/server/chunks/ssr/app_login_page_tsx_0z71ad3._.js.map +1 -1
- package/.next/server/chunks/ssr/app_server-logs_page_tsx_0_kpp1p._.js +1 -1
- package/.next/server/chunks/ssr/app_server-logs_page_tsx_0_kpp1p._.js.map +1 -1
- package/.next/server/chunks/ssr/app_tasks_page_tsx_0z-d6mp._.js +1 -1
- package/.next/server/chunks/ssr/app_tasks_page_tsx_0z-d6mp._.js.map +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +4 -4
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/02oje7pf-g1v5.js +1 -0
- package/.next/static/chunks/06x7w8nwggx~~.js +1 -0
- package/.next/static/chunks/0943n0t.9c-o2.js +1 -0
- package/.next/static/chunks/{07okhs5561y5y.js → 0c1bp~g7.8ru..js} +1 -1
- package/.next/static/chunks/0csmku~3y472t.js +1 -0
- package/.next/static/chunks/0df0py1glk9xm.js +1 -0
- package/.next/static/chunks/0edt_z0rlxgfk.js +1 -0
- package/.next/static/chunks/0g394kqz_d5.x.js +1 -0
- package/.next/static/chunks/0irkayokwc1fm.js +1 -0
- package/.next/static/chunks/0j8ee64jv6zb7.js +7 -0
- package/.next/static/chunks/0qe_pfeioih-5.css +2 -0
- package/.next/static/chunks/0qnpc7rbxn12u.js +1 -0
- package/.next/static/chunks/0xdl435t_mf1c.js +1 -0
- package/.next/static/chunks/0~n.cadw9_e8s.js +7 -0
- package/.next/static/chunks/11_n-vjzf735y.js +1 -0
- package/.next/static/chunks/15c9pv6gxir.5.js +1 -0
- package/.next/trace +2 -2
- package/.next/trace-build +1 -1
- package/app/admin/page.tsx +77 -25
- package/app/components/AgentCard.tsx +19 -5
- package/app/components/AliasAvatar.tsx +51 -0
- package/app/components/BroadcastBar.tsx +22 -4
- package/app/components/DispatchPanel.tsx +9 -5
- package/app/components/EmptyState.tsx +77 -4
- package/app/components/HealthBanner.tsx +1 -1
- package/app/components/HelpOverlay.tsx +50 -10
- package/app/components/InboxPanel.tsx +6 -3
- package/app/components/Sidebar.tsx +49 -41
- package/app/components/TaskChatPanel.tsx +8 -10
- package/app/components/TaskDrawer.tsx +72 -28
- package/app/components/TopoGraph.tsx +118 -24
- package/app/globals.css +90 -0
- package/app/lib/version.ts +7 -0
- package/app/login/page.tsx +37 -7
- package/app/logs/page.tsx +72 -21
- package/app/messages/page.tsx +85 -51
- package/app/node/page.tsx +32 -15
- package/app/nodes/page.tsx +21 -23
- package/app/page.tsx +71 -13
- package/app/server-logs/page.tsx +37 -3
- package/app/settings/networks/page.tsx +37 -13
- package/app/settings/page.tsx +38 -10
- package/app/tasks/page.tsx +77 -41
- package/package.json +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0_jnflc._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0_jnflc._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0nrckjd._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0nrckjd._.js.map +0 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__12mpoig._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__12mpoig._.js.map +0 -1
- package/.next/server/chunks/ssr/_0d-fuox._.js +0 -3
- package/.next/server/chunks/ssr/_0d-fuox._.js.map +0 -1
- package/.next/server/chunks/ssr/app_0.0wpa~._.js +0 -3
- package/.next/server/chunks/ssr/app_0.0wpa~._.js.map +0 -1
- package/.next/server/chunks/ssr/app_0ap_oiq._.js +0 -3
- package/.next/server/chunks/ssr/app_0ap_oiq._.js.map +0 -1
- package/.next/server/chunks/ssr/app_0et5yua._.js +0 -3
- package/.next/server/chunks/ssr/app_0et5yua._.js.map +0 -1
- package/.next/server/chunks/ssr/app_0ff~kjj._.js +0 -9
- package/.next/server/chunks/ssr/app_0ff~kjj._.js.map +0 -1
- package/.next/server/chunks/ssr/app_page_tsx_0es_sk2._.js +0 -3
- package/.next/server/chunks/ssr/app_page_tsx_0es_sk2._.js.map +0 -1
- package/.next/static/chunks/02flrewxlf_m_.js +0 -1
- package/.next/static/chunks/03sm_xa792mxv.css +0 -2
- package/.next/static/chunks/051gslfjka1kj.js +0 -1
- package/.next/static/chunks/06t_vzei8s9_h.js +0 -1
- package/.next/static/chunks/07oobuohrpigy.js +0 -1
- package/.next/static/chunks/0e7c40p~wq665.js +0 -1
- package/.next/static/chunks/0g7m7zk.v7g6h.js +0 -1
- package/.next/static/chunks/0khpyxpdrp~ty.js +0 -1
- package/.next/static/chunks/0lo_g.q1fm-hr.js +0 -7
- package/.next/static/chunks/0m328uz90rp81.js +0 -1
- package/.next/static/chunks/0ogeals5ufhho.js +0 -1
- package/.next/static/chunks/1031v6nw33ud3.js +0 -1
- package/.next/static/chunks/10ir.g.n~hre0.js +0 -7
- package/.next/static/chunks/10njj7kn9ylkf.js +0 -1
- package/.next/static/chunks/13.dst7liziwo.js +0 -1
- /package/.next/static/{dvKGMaUCm52sSTROKhYVL → t8ckUU0UVyOpv2ymrRHll}/_buildManifest.js +0 -0
- /package/.next/static/{dvKGMaUCm52sSTROKhYVL → t8ckUU0UVyOpv2ymrRHll}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{dvKGMaUCm52sSTROKhYVL → t8ckUU0UVyOpv2ymrRHll}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18150,e=>{"use strict";e.s(["formatUptime",0,function(e){let t=Math.floor(e/3600),s=Math.floor(e%3600/60);return t>0?`${t}h ${s}m`:`${s}m`},"timeAgo",0,function(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}])},95356,e=>{"use strict";var t=e.i(18050),s=e.i(22016);let r={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function a({variant:e,size:s}){let r={width:s,height:s},n={fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"nodes":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...n,children:[(0,t.jsx)("circle",{cx:"32",cy:"14",r:"4"}),(0,t.jsx)("circle",{cx:"14",cy:"44",r:"4"}),(0,t.jsx)("circle",{cx:"50",cy:"44",r:"4"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"14",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"50",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"18",y1:"44",x2:"46",y2:"44",strokeDasharray:"3 3",opacity:"0.6"})]})});case"tasks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...n,children:[(0,t.jsx)("rect",{x:"14",y:"14",width:"36",height:"6",rx:"1.5"}),(0,t.jsx)("rect",{x:"14",y:"26",width:"36",height:"6",rx:"1.5",opacity:"0.6"}),(0,t.jsx)("rect",{x:"14",y:"38",width:"36",height:"6",rx:"1.5",opacity:"0.35"})]})});case"messages":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...n,children:[(0,t.jsx)("path",{d:"M14 18 h36 a3 3 0 0 1 3 3 v18 a3 3 0 0 1 -3 3 h-18 l-8 6 v-6 h-10 a3 3 0 0 1 -3 -3 v-18 a3 3 0 0 1 3 -3 z"}),(0,t.jsx)("line",{x1:"22",y1:"28",x2:"42",y2:"28",opacity:"0.5"}),(0,t.jsx)("line",{x1:"22",y1:"34",x2:"36",y2:"34",opacity:"0.5"})]})});case"logs":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...n,children:[(0,t.jsx)("path",{d:"M18 12 h22 l8 8 v32 a2 2 0 0 1 -2 2 h-28 a2 2 0 0 1 -2 -2 v-38 a2 2 0 0 1 2 -2 z"}),(0,t.jsx)("path",{d:"M40 12 v8 h8",opacity:"0.6"}),(0,t.jsx)("line",{x1:"24",y1:"32",x2:"40",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"24",y1:"38",x2:"40",y2:"38",opacity:"0.4"}),(0,t.jsx)("line",{x1:"24",y1:"44",x2:"34",y2:"44",opacity:"0.25"})]})});case"tokens":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...n,children:[(0,t.jsx)("circle",{cx:"22",cy:"32",r:"8"}),(0,t.jsx)("line",{x1:"30",y1:"32",x2:"54",y2:"32"}),(0,t.jsx)("line",{x1:"44",y1:"32",x2:"44",y2:"38"}),(0,t.jsx)("line",{x1:"50",y1:"32",x2:"50",y2:"40"})]})});case"networks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...n,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"18"}),(0,t.jsx)("ellipse",{cx:"32",cy:"32",rx:"18",ry:"9",opacity:"0.55"}),(0,t.jsx)("line",{x1:"14",y1:"32",x2:"50",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"32",y1:"14",x2:"32",y2:"50",opacity:"0.55"})]})});default:return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...r,children:(0,t.jsxs)("g",{...n,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"14",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"32",cy:"32",r:"3"})]})})}}function n({variant:e="generic",title:i,sub:l,cta:c,compact:o=!1}){let d=r[e],x=i??d.title,h=l??d.sub;return(0,t.jsxs)("div",{className:`text-center ${o?"py-8":"py-16"} px-4`,role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)(a,{variant:e,size:o?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${o?"text-sm":"text-base"}`,children:x}),h&&(0,t.jsx)("p",{className:`text-gray-500 ${o?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:h}),c&&(0,t.jsx)("div",{className:"mt-4",children:c.href?(0,t.jsxs)(s.default,{href:c.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[c.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,t.jsxs)("button",{onClick:c.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[c.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}e.s(["EmptyState",0,n,"NodesEmptyState",0,function({hint:e}){return e?.global_count?(0,t.jsx)(n,{variant:"nodes",title:"No agents in this network",sub:`Server has ${e.global_count} nodes globally, but none are registered to the current network. Switch network or contact admin.`}):(0,t.jsx)(n,{variant:"nodes",cta:{label:"Run anet quickstart",href:"https://anet.sh"}})}])},16015,(e,t,s)=>{},98547,(e,t,s)=>{var r=e.i(47167);e.r(16015);var a=e.r(71645),n=a&&"object"==typeof a&&"default"in a?a:{default:a},i=void 0!==r.default&&r.default.env&&!0,l=function(e){return"[object String]"===Object.prototype.toString.call(e)},c=function(){function e(e){var t=void 0===e?{}:e,s=t.name,r=void 0===s?"stylesheet":s,a=t.optimizeForSpeed,n=void 0===a?i:a;o(l(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",o("boolean"==typeof n,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=n,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var c="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=c?c.getAttribute("content"):null}var t,s=e.prototype;return s.setOptimizeForSpeed=function(e){o("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),o(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(o(!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||(i||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(o(l(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 i||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var r=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,r))}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(r){i||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 r=this._tags[e];o(r,"old rule at index `"+e+"` not found"),r.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];o(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&&o(l(t),"makeStyleTag accepts only strings as second parameter");var r=document.createElement("style");this._nonce&&r.setAttribute("nonce",this._nonce),r.type="text/css",r.setAttribute("data-"+e,""),t&&r.appendChild(document.createTextNode(t));var a=document.head||document.getElementsByTagName("head")[0];return s?a.insertBefore(r,s):a.appendChild(r),r},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var s=0;s<t.length;s++){var r=t[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function o(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var d=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),r=e+s;return x[r]||(x[r]="jsx-"+d(e+"-"+s)),x[r]}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 m=function(){function e(e){var t=void 0===e?{}:e,s=t.styleSheet,r=void 0===s?null:s,a=t.optimizeForSpeed,n=void 0!==a&&a;this._sheet=r||new c({name:"styled-jsx",optimizeForSpeed:n}),this._sheet.inject(),r&&"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),r=s.styleId,a=s.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var n=a.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=n,this._instancesCounts[r]=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 r=this._fromServer&&this._fromServer[s];r?(r.parentNode.removeChild(r),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],r=e[1];return n.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:s.nonce?s.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,s=e.dynamic,r=e.id;if(s){var a=h(r,s);return{styleId:a,rules:Array.isArray(t)?t.map(function(e){return u(a,e)}):[u(a,t)]}}return{styleId:h(r),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}(),p=a.createContext(null);function g(){return new m}function y(){return a.useContext(p)}p.displayName="StyleSheetContext";var f=n.default.useInsertionEffect||n.default.useLayoutEffect,b="u">typeof window?g():void 0;function j(e){var t=b||y();return t&&("u"<typeof window?t.add(e):f(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,r=a.useContext(p),i=a.useState(function(){return r||t||g()})[0];return n.default.createElement(p.Provider,{value:i},s)},s.createStyleRegistry=g,s.style=j,s.useStyleRegistry=y},21373,(e,t,s)=>{t.exports=e.r(98547).style},96527,e=>{"use strict";var t=e.i(18050),s=e.i(71645),r=e.i(18566),a=e.i(58963),n=e.i(21373),i=e.i(18150);let l={created:"text-gray-400",delivered:"text-blue-400",running:"text-green-400",replied:"text-purple-400",failed:"text-red-400",closed:"text-gray-500"};function c({taskId:e,onClose:r}){let[a,o]=(0,s.useState)(null),[d,x]=(0,s.useState)([]),[h,u]=(0,s.useState)(!0);(0,s.useEffect)(()=>{(async()=>{try{let[t,s]=await Promise.all([fetch(`/api/hub/tasks?task_id=${encodeURIComponent(e)}`),fetch(`/api/hub/task-events?task_id=${encodeURIComponent(e)}&limit=50`)]),r=await t.json(),a=await s.json();r.tasks?.[0]&&o(r.tasks[0]),x(a.events||[])}catch{}finally{u(!1)}})()},[e]);let m=a?[{label:"Created",time:a.created_at,color:"bg-gray-400"},{label:"Delivered",time:a.delivered_at,color:"bg-blue-400"},{label:"Started",time:a.started_at,color:"bg-green-400"},{label:"Completed",time:a.completed_at,color:"bg-purple-400"}]:[],p=a?.started_at&&a?.completed_at?Math.round((new Date(a.completed_at).getTime()-new Date(a.started_at).getTime())/1e3):null;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{onClick:r,className:"jsx-c3e56cbc81656d9 fixed inset-0 bg-black/30 z-40"}),(0,t.jsxs)("div",{className:"jsx-c3e56cbc81656d9 fixed top-0 right-0 h-full w-full lg:w-[500px] bg-[#0a0a1a] border-l border-[#2a2a4a] z-50 flex flex-col shadow-2xl shadow-black/60 overflow-y-auto animate-slide-in",children:[(0,t.jsxs)("div",{className:"jsx-c3e56cbc81656d9 flex items-center justify-between px-5 py-4 border-b border-[#2a2a4a] bg-[#0d0d1a] sticky top-0",children:[(0,t.jsxs)("div",{className:"jsx-c3e56cbc81656d9",children:[(0,t.jsx)("div",{className:"jsx-c3e56cbc81656d9 text-sm font-semibold text-white",children:"Task Detail"}),(0,t.jsxs)("div",{className:"jsx-c3e56cbc81656d9 text-[10px] text-gray-500 mt-0.5",children:[e.slice(0,16),"..."]})]}),(0,t.jsx)("button",{onClick:r,className:"jsx-c3e56cbc81656d9 text-gray-500 hover:text-white p-1.5 rounded-lg hover:bg-[#1a1a2a]",children:(0,t.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,className:"jsx-c3e56cbc81656d9 w-5 h-5",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12",className:"jsx-c3e56cbc81656d9"})})})]}),h?(0,t.jsx)("div",{className:"jsx-c3e56cbc81656d9 flex justify-center py-16",children:(0,t.jsx)("div",{className:"jsx-c3e56cbc81656d9 w-6 h-6 border-2 border-cyan-500/30 border-t-cyan-500 rounded-full animate-spin"})}):a?(0,t.jsxs)("div",{className:"jsx-c3e56cbc81656d9 px-5 py-5 space-y-5",children:[(0,t.jsxs)("div",{className:"jsx-c3e56cbc81656d9 flex items-center gap-3",children:[(0,t.jsx)("span",{className:`jsx-c3e56cbc81656d9 text-lg font-bold ${l[a.status]||"text-gray-400"}`,children:a.status}),"normal"!==a.priority&&(0,t.jsx)("span",{className:`jsx-c3e56cbc81656d9 text-xs px-2 py-0.5 rounded border ${"high"===a.priority?"text-red-300 border-red-500/20":"text-gray-400 border-gray-600/20"}`,children:a.priority}),null!==p&&(0,t.jsxs)("span",{className:"jsx-c3e56cbc81656d9 text-xs text-gray-500",children:["⏱ ",p<60?`${p}s`:`${Math.floor(p/60)}m ${p%60}s`]})]}),(0,t.jsxs)("div",{className:"jsx-c3e56cbc81656d9 flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"jsx-c3e56cbc81656d9 text-blue-400 font-medium",children:a.from_name||"--"}),(0,t.jsx)("span",{className:"jsx-c3e56cbc81656d9 text-gray-600",children:"→"}),(0,t.jsx)("span",{className:"jsx-c3e56cbc81656d9 text-cyan-400 font-medium",children:a.to_name||"--"})]}),(0,t.jsxs)("div",{className:"jsx-c3e56cbc81656d9 bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsx)("div",{className:"jsx-c3e56cbc81656d9 text-xs text-gray-500 uppercase mb-3",children:"Timeline"}),(0,t.jsx)("div",{className:"jsx-c3e56cbc81656d9 space-y-3",children:m.map((e,s)=>(0,t.jsxs)("div",{className:"jsx-c3e56cbc81656d9 flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"jsx-c3e56cbc81656d9 flex flex-col items-center",children:[(0,t.jsx)("div",{className:`jsx-c3e56cbc81656d9 w-3 h-3 rounded-full ${e.time?e.color:"bg-gray-700"}`}),s<m.length-1&&(0,t.jsx)("div",{className:`jsx-c3e56cbc81656d9 w-0.5 h-4 mt-1 ${e.time&&m[s+1]?.time?"bg-gray-600":"bg-gray-800"}`})]}),(0,t.jsxs)("div",{className:"jsx-c3e56cbc81656d9 flex-1",children:[(0,t.jsx)("div",{className:`jsx-c3e56cbc81656d9 text-xs font-medium ${e.time?"text-gray-300":"text-gray-600"}`,children:e.label}),(0,t.jsx)("div",{className:"jsx-c3e56cbc81656d9 text-[10px] text-gray-500",children:e.time||"Pending"})]})]},e.label))})]}),(0,t.jsxs)("div",{className:"jsx-c3e56cbc81656d9 bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsx)("div",{className:"jsx-c3e56cbc81656d9 text-xs text-gray-500 uppercase mb-2",children:"Input"}),(0,t.jsx)("div",{className:"jsx-c3e56cbc81656d9 text-sm text-gray-300 whitespace-pre-wrap",children:a.content||"--"})]}),a.result&&(0,t.jsxs)("div",{className:"jsx-c3e56cbc81656d9 bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsx)("div",{className:"jsx-c3e56cbc81656d9 text-xs text-gray-500 uppercase mb-2",children:"Output"}),(0,t.jsx)("div",{className:"jsx-c3e56cbc81656d9 text-sm text-gray-300 whitespace-pre-wrap max-h-64 overflow-y-auto",children:a.result})]}),d.length>0&&(0,t.jsxs)("div",{className:"jsx-c3e56cbc81656d9 bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsxs)("div",{className:"jsx-c3e56cbc81656d9 text-xs text-gray-500 uppercase mb-2",children:["Events (",d.length,")"]}),(0,t.jsx)("div",{className:"jsx-c3e56cbc81656d9 space-y-1.5 max-h-40 overflow-y-auto",children:d.map(e=>(0,t.jsxs)("div",{className:"jsx-c3e56cbc81656d9 flex items-center gap-2 text-[11px]",children:[(0,t.jsx)("span",{className:`jsx-c3e56cbc81656d9 w-1.5 h-1.5 rounded-full shrink-0 ${"running"===e.to_status?"bg-green-400":"replied"===e.to_status?"bg-purple-400":"failed"===e.to_status?"bg-red-400":"bg-blue-400"}`}),(0,t.jsx)("span",{className:"jsx-c3e56cbc81656d9 text-gray-400",children:e.event_type}),e.from_status&&(0,t.jsxs)("span",{className:"jsx-c3e56cbc81656d9 text-gray-600",children:[e.from_status,"→",e.to_status]}),(0,t.jsx)("span",{className:"jsx-c3e56cbc81656d9 text-gray-600 ml-auto",children:(0,i.timeAgo)(e.created_at)})]},e.id))})]}),(0,t.jsxs)("div",{className:"jsx-c3e56cbc81656d9 text-[10px] text-gray-600 space-y-1",children:[(0,t.jsxs)("div",{className:"jsx-c3e56cbc81656d9",children:["Task ID: ",a.task_id]}),a.expires_at&&(0,t.jsxs)("div",{className:"jsx-c3e56cbc81656d9",children:["Expires: ",a.expires_at]})]})]}):(0,t.jsx)("div",{className:"jsx-c3e56cbc81656d9 text-center py-16 text-gray-500",children:"Task not found"})]}),(0,t.jsx)(n.default,{id:"c3e56cbc81656d9",children:"@keyframes slide-in{0%{transform:translate(100%)}to{transform:translate(0)}}.animate-slide-in{animation:.2s ease-out slide-in}"})]})}var o=e.i(95356);let d=["","created","delivered","acked","running","replied","closed","failed","cancelled","expired"],x={created:"bg-gray-500/10 text-gray-400 border-gray-500/20",delivered:"bg-blue-500/10 text-blue-300 border-blue-500/20",acked:"bg-cyan-500/10 text-cyan-300 border-cyan-500/20",running:"bg-green-500/10 text-green-300 border-green-500/20",replied:"bg-purple-500/10 text-purple-300 border-purple-500/20",closed:"bg-gray-500/10 text-gray-500 border-gray-500/20",failed:"bg-red-500/10 text-red-300 border-red-500/20",cancelled:"bg-yellow-500/10 text-yellow-300 border-yellow-500/20",expired:"bg-orange-500/10 text-orange-300 border-orange-500/20"},h={created:"#9ca3af",delivered:"#60a5fa",acked:"#22d3ee",running:"#4ade80",replied:"#a78bfa",closed:"#6b7280",failed:"#f87171",cancelled:"#facc15",expired:"#fb923c"};function u(e){let t=x[e]||"bg-gray-500/10 text-gray-400 border-gray-500/20";return`text-xs px-2 py-0.5 rounded-md border ${t}`}function m(e){return"high"===e?"text-red-400":"low"===e?"text-gray-600":"text-gray-400"}function p(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function g(){let e,n,i,l=(0,r.useSearchParams)(),{networkId:g}=(0,a.useNetworkId)(),[y,f]=(0,s.useState)([]),[b,j]=(0,s.useState)(0),[v,_]=(0,s.useState)(!0),[w,N]=(0,s.useState)(""),[S,k]=(0,s.useState)(new Set),[C,R]=(0,s.useState)(l.get("status")||""),[$,T]=(0,s.useState)(""),[F,z]=(0,s.useState)(""),[A,E]=(0,s.useState)(null),I=e=>{k(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},M=(0,s.useCallback)(async()=>{try{let e=new URLSearchParams;g&&e.set("network_id",g),C&&e.set("status",C),$&&e.set("from_name",$),F&&e.set("to_name",F),e.set("limit","100");let t=await fetch(`/api/hub/tasks?${e.toString()}`);if(401===t.status)return void window.location.assign("/login");let s=await t.json();f(s.tasks||[]),j(s.count??(s.tasks?.length||0)),N("")}catch(e){N(e instanceof Error?e.message:"fetch failed")}finally{_(!1)}},[C,$,F,g]);return(0,s.useEffect)(()=>{_(!0),M();let e=setInterval(M,5e3);return()=>clearInterval(e)},[M]),(0,t.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-white lg:ml-0 ml-10",children:"Tasks"}),(0,t.jsx)("span",{className:"text-xs bg-blue-900/30 text-blue-400 px-2 py-0.5 rounded-full border border-blue-800/30",children:b})]}),(0,t.jsx)("div",{className:"anet-tabstrip-wrap mb-4",children:(0,t.jsx)("div",{className:"anet-tabstrip flex sm:flex-wrap gap-1 bg-[#111128] rounded-lg border border-[#2a2a4a] p-1 overflow-x-auto sm:overflow-x-visible scrollbar-thin",children:["",...d.filter(Boolean)].map(e=>(0,t.jsxs)("button",{onClick:()=>R(e),className:`px-3 py-1.5 rounded-md text-xs transition-colors flex items-center gap-1.5 shrink-0 whitespace-nowrap ${C===e?`${x[e]||"bg-cyan-500/10 text-cyan-300 border-cyan-500/20"} border`:"text-gray-500 hover:text-gray-300 hover:bg-[#1a1a2a]/40"}`,children:[e&&(0,t.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:h[e]||"#6b7280"}}),(0,t.jsx)("span",{children:e||"All"})]},e))})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-3 mb-6",children:[(0,t.jsx)("input",{type:"text",value:$,onChange:e=>T(e.target.value),placeholder:"From node...",className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-blue-500/50 focus:outline-none w-40"}),(0,t.jsx)("input",{type:"text",value:F,onChange:e=>z(e.target.value),placeholder:"To node...",className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-blue-500/50 focus:outline-none w-40"})]}),y.length>0&&!C&&(e={},y.forEach(t=>{e[t.status]=(e[t.status]||0)+1}),n=y.length||1,(i=[{key:"running",color:"bg-green-500",text:"text-green-400"},{key:"delivered",color:"bg-blue-500",text:"text-blue-400"},{key:"replied",color:"bg-purple-500",text:"text-purple-400"},{key:"failed",color:"bg-red-500",text:"text-red-400"},{key:"expired",color:"bg-orange-500",text:"text-orange-400"}].filter(t=>e[t.key])).length?(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)("div",{className:"flex h-2 rounded-full overflow-hidden bg-gray-800",children:i.map(s=>(0,t.jsx)("div",{className:s.color,style:{width:`${e[s.key]/n*100}%`}},s.key))}),(0,t.jsx)("div",{className:"flex flex-wrap gap-3 mt-1.5 text-[10px] text-gray-500",children:i.map(s=>(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:`inline-block w-2 h-2 rounded-full ${s.color} mr-1`}),e[s.key]," ",s.key]},s.key))})]}):null),w&&(0,t.jsx)("div",{className:"bg-red-900/20 border border-red-800/40 text-red-300 px-4 py-2 rounded-lg mb-6 text-sm",children:w}),v?(0,t.jsx)("div",{className:"animate-pulse space-y-3",children:[1,2,3,4,5].map(e=>(0,t.jsx)("div",{className:"h-20 bg-gray-800/20 rounded-lg border border-gray-800/40"},e))}):0===y.length?(0,t.jsx)(o.EmptyState,{variant:"tasks",sub:C||$||F?"No tasks match the current filters. Try clearing them.":"Tasks will appear here when agents send them via CommHub."}):(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"hidden sm:grid sm:grid-cols-12 gap-2 px-4 py-2 text-xs text-gray-600 uppercase",children:[(0,t.jsx)("div",{className:"col-span-1",children:"Status"}),(0,t.jsx)("div",{className:"col-span-2",children:"From"}),(0,t.jsx)("div",{className:"col-span-2",children:"To"}),(0,t.jsx)("div",{className:"col-span-4",children:"Content"}),(0,t.jsx)("div",{className:"col-span-1",children:"Priority"}),(0,t.jsx)("div",{className:"col-span-2",children:"Time"})]}),y.map(e=>{let s=S.has(e.task_id);return(0,t.jsxs)("div",{className:`anet-task-row group bg-[#111128] border rounded-lg px-4 py-3 transition-all duration-200 cursor-pointer ${s?"border-[#3a3a5a] shadow-lg shadow-black/20":"border-[#2a2a4a] hover:border-[#3a3a5a] hover:bg-[#15152e]"}`,onClick:()=>I(e.task_id),role:"button",tabIndex:0,"aria-expanded":s,onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),I(e.task_id))},children:[(0,t.jsxs)("div",{className:"hidden sm:grid sm:grid-cols-12 gap-2 items-center",children:[(0,t.jsx)("div",{className:"col-span-1",children:(0,t.jsx)("span",{className:u(e.status),children:e.status})}),(0,t.jsx)("div",{className:"col-span-2 text-sm text-blue-400 truncate",title:e.from_name,children:e.from_name||"--"}),(0,t.jsx)("div",{className:"col-span-2 text-sm text-cyan-400 truncate",title:e.to_name,children:e.to_name||"--"}),(0,t.jsx)("div",{className:"col-span-4 text-xs text-gray-400 truncate",title:e.content,children:e.content||"--"}),(0,t.jsx)("div",{className:"col-span-1",children:(0,t.jsx)("span",{className:`text-xs ${m(e.priority)}`,children:e.priority||"normal"})}),(0,t.jsxs)("div",{className:"col-span-2 text-xs text-gray-500 flex items-center justify-between gap-2",title:e.created_at,children:[(0,t.jsx)("span",{className:"truncate",children:p(e.created_at)}),(0,t.jsx)("svg",{"aria-hidden":!0,className:`shrink-0 text-gray-600 group-hover:text-gray-400 transition-transform duration-200 ${s?"rotate-180":""}`,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 9l6 6 6-6"})})]})]}),(0,t.jsxs)("div",{className:"sm:hidden space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:u(e.status),children:e.status}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:`text-xs ${m(e.priority)}`,children:e.priority||"normal"}),(0,t.jsx)("svg",{"aria-hidden":!0,className:`text-gray-600 transition-transform duration-200 ${s?"rotate-180":""}`,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 9l6 6 6-6"})})]})]}),(0,t.jsxs)("div",{className:"text-xs text-gray-500",children:[(0,t.jsx)("span",{className:"text-blue-400",children:e.from_name||"--"}),(0,t.jsx)("span",{className:"text-gray-600 mx-1",children:"→"}),(0,t.jsx)("span",{className:"text-cyan-400",children:e.to_name||"--"})]}),(0,t.jsx)("div",{className:"text-xs text-gray-400 line-clamp-1",children:e.content||"--"}),(0,t.jsx)("div",{className:"text-xs text-gray-600",children:p(e.created_at)})]}),(0,t.jsx)("div",{className:`grid transition-all duration-300 ease-out ${s?"grid-rows-[1fr] opacity-100 mt-3":"grid-rows-[0fr] opacity-0"}`,"aria-hidden":!s,children:(0,t.jsx)("div",{className:"overflow-hidden",children:(0,t.jsxs)("div",{className:"pt-3 border-t border-[#2a2a4a] space-y-3",children:[e.content&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-xs text-gray-600 mb-1",children:"Content"}),(0,t.jsx)("div",{className:"text-xs text-gray-300 whitespace-pre-wrap bg-[#0a0a15] rounded-lg px-3 py-2 border border-[#1a1a2a]",children:e.content})]}),e.result&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-xs text-gray-600 mb-1",children:"Result"}),(0,t.jsx)("div",{className:"text-xs text-gray-300 whitespace-pre-wrap bg-[#0a0a15] rounded-lg px-3 py-2 border border-[#1a1a2a] max-h-48 overflow-y-auto",children:e.result})]}),(0,t.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[["Created",e.created_at],["Delivered",e.delivered_at],["Started",e.started_at],["Completed",e.completed_at]].map(([e,s])=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"text-gray-600",children:[e,": "]}),(0,t.jsx)("span",{className:"text-gray-400",children:s?p(s):"--"})]},e))}),e.expires_at&&(0,t.jsxs)("div",{className:"text-xs",children:[(0,t.jsx)("span",{className:"text-gray-600",children:"Expires: "}),(0,t.jsx)("span",{className:"text-orange-400",children:e.expires_at})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"text-xs text-gray-600 truncate",title:e.task_id,children:["ID: ",e.task_id]}),(0,t.jsxs)("div",{className:"flex gap-2 shrink-0",children:[("failed"===e.status||"expired"===e.status)&&(0,t.jsx)("button",{onClick:async t=>{t.stopPropagation(),await fetch("/api/hub/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({alias:e.to_name,task:e.content,priority:e.priority})}),M()},className:"text-xs text-orange-400 hover:text-orange-300 px-2 py-0.5 rounded border border-orange-500/20 hover:bg-orange-500/10",children:"Retry"}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),E(e.task_id)},className:"text-xs text-cyan-400 hover:text-cyan-300",children:"Detail →"})]})]})]})})})]},e.task_id)})]}),A&&(0,t.jsx)(c,{taskId:A,onClose:()=>E(null)})]})}e.s(["default",0,function(){return(0,t.jsx)(s.Suspense,{fallback:(0,t.jsx)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-6 font-mono",children:"Loading tasks..."}),children:(0,t.jsx)(g,{})})}],96527)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18150,e=>{"use strict";e.s(["formatUptime",0,function(e){let t=Math.floor(e/3600),s=Math.floor(e%3600/60);return t>0?`${t}h ${s}m`:`${s}m`},"timeAgo",0,function(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}])},16015,(e,t,s)=>{},98547,(e,t,s)=>{var r=e.i(47167);e.r(16015);var n=e.r(71645),a=n&&"object"==typeof n&&"default"in n?n:{default:n},i=void 0!==r.default&&r.default.env&&!0,l=function(e){return"[object String]"===Object.prototype.toString.call(e)},o=function(){function e(e){var t=void 0===e?{}:e,s=t.name,r=void 0===s?"stylesheet":s,n=t.optimizeForSpeed,a=void 0===n?i:n;d(l(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",d("boolean"==typeof a,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=a,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||(i||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(l(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 i||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var r=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,r))}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(r){i||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 r=this._tags[e];d(r,"old rule at index `"+e+"` not found"),r.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(l(t),"makeStyleTag accepts only strings as second parameter");var r=document.createElement("style");this._nonce&&r.setAttribute("nonce",this._nonce),r.type="text/css",r.setAttribute("data-"+e,""),t&&r.appendChild(document.createTextNode(t));var n=document.head||document.getElementsByTagName("head")[0];return s?n.insertBefore(r,s):n.appendChild(r),r},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var s=0;s<t.length;s++){var r=t[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(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},u={};function h(e,t){if(!t)return"jsx-"+e;var s=String(t),r=e+s;return u[r]||(u[r]="jsx-"+c(e+"-"+s)),u[r]}function m(e,t){"u"<typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var s=e+t;return u[s]||(u[s]=t.replace(/__jsx-style-dynamic-selector/g,e)),u[s]}var p=function(){function e(e){var t=void 0===e?{}:e,s=t.styleSheet,r=void 0===s?null:s,n=t.optimizeForSpeed,a=void 0!==n&&n;this._sheet=r||new o({name:"styled-jsx",optimizeForSpeed:a}),this._sheet.inject(),r&&"boolean"==typeof a&&(this._sheet.setOptimizeForSpeed(a),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),r=s.styleId,n=s.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var a=n.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=a,this._instancesCounts[r]=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 r=this._fromServer&&this._fromServer[s];r?(r.parentNode.removeChild(r),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],r=e[1];return a.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:s.nonce?s.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,s=e.dynamic,r=e.id;if(s){var n=h(r,s);return{styleId:n,rules:Array.isArray(t)?t.map(function(e){return m(n,e)}):[m(n,t)]}}return{styleId:h(r),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}(),f=n.createContext(null);function x(){return new p}function y(){return n.useContext(f)}f.displayName="StyleSheetContext";var g=a.default.useInsertionEffect||a.default.useLayoutEffect,v="u">typeof window?x():void 0;function b(e){var t=v||y();return t&&("u"<typeof window?t.add(e):g(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}b.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,r=n.useContext(f),i=n.useState(function(){return r||t||x()})[0];return a.default.createElement(f.Provider,{value:i},s)},s.createStyleRegistry=x,s.style=b,s.useStyleRegistry=y},21373,(e,t,s)=>{t.exports=e.r(98547).style},53136,e=>{"use strict";var t=e.i(18050),s=e.i(71645),r=e.i(18566),n=e.i(22016),a=e.i(58442),i=e.i(18150);function l({tmuxName:e}){let[r,n]=(0,s.useState)(""),[a,i]=(0,s.useState)(!1),[o,d]=(0,s.useState)(!1),c=async()=>{i(!0);try{let t=await fetch(`/api/hub/tmux?name=${encodeURIComponent(e)}`),s=await t.json();n(s.output||s.error||"No output")}catch{n("Failed to fetch")}i(!1)};return(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("h2",{className:"text-sm font-semibold text-gray-300",children:["Terminal (",e,")"]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("button",{onClick:c,disabled:a,className:"text-xs text-cyan-400 hover:text-cyan-300 disabled:text-gray-600",children:a?"Loading...":"Capture"}),r&&(0,t.jsx)("button",{onClick:()=>d(!o),className:"text-xs text-gray-500 hover:text-gray-300",children:o?"Collapse":"Expand"})]})]}),r&&(0,t.jsx)("pre",{className:`text-[11px] text-green-300 bg-[#050510] rounded-lg px-3 py-2 border border-[#1a1a2a] overflow-x-auto whitespace-pre font-mono ${o?"max-h-96":"max-h-32"} overflow-y-auto`,children:r}),!r&&(0,t.jsx)("p",{className:"text-xs text-gray-600",children:"Click Capture to view terminal output"})]})}function o(){let e=(0,r.useSearchParams)().get("alias")||"",[a,i]=(0,s.useState)(null),[l,o]=(0,s.useState)([]),[c,u]=(0,s.useState)(0),[h,m]=(0,s.useState)(""),[p,f]=(0,s.useState)(""),[x,y]=(0,s.useState)(!1),g=(0,s.useCallback)(async()=>{if(e)try{let t=await fetch(`/api/hub/session?alias=${encodeURIComponent(e)}`),s=await t.json();s.session&&i(s.session),s.inbox&&o(s.inbox),u(s.sse||0),m("")}catch(e){m(e instanceof Error?e.message:"fetch failed")}},[e]);(0,s.useEffect)(()=>{g();let e=setInterval(g,5e3);return()=>clearInterval(e)},[g]);let[v,b]=(0,s.useState)(""),S=async()=>{if(p.trim()&&e){y(!0),b("");try{let t=await fetch("/api/hub/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({alias:e,task:p})}),s=await t.json();s.ok?(f(""),setTimeout(g,2e3)):b(s.error||"Send failed")}catch(e){b(e instanceof Error?e.message:"Send failed")}y(!1)}};if(!e)return(0,t.jsx)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-6 font-mono flex items-center justify-center",children:(0,t.jsxs)("p",{className:"text-gray-500",children:["No alias specified. ",(0,t.jsx)(n.default,{href:"/",className:"text-blue-400 hover:underline",children:"Back to dashboard"})]})});let _=a?.status==="working"?"text-green-400":a?.status==="idle"?"text-blue-400":"text-gray-500";return(0,t.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,t.jsx)(n.default,{href:"/nodes",className:"text-gray-500 hover:text-gray-300 text-sm lg:ml-0 ml-10",children:"← Nodes"}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:`inline-block w-3 h-3 rounded-full ${c>0?a?.status==="working"?"bg-green-500 animate-pulse":"bg-emerald-400":"bg-gray-500"}`}),(0,t.jsx)("h1",{className:"text-2xl font-bold text-white",children:e}),(0,t.jsx)("span",{className:`text-sm ${_}`,children:a?.status||"unknown"})]})]}),h&&(0,t.jsx)("div",{className:"bg-red-900/20 border border-red-800/40 text-red-300 px-4 py-2 rounded-lg mb-6 text-sm",children:h}),(0,t.jsx)(d,{alias:e,session:a,sse:c,sendMsg:p,setSendMsg:f,sending:x,sendTask:S,sendError:v})]})}function d({alias:e,session:r,sse:n,sendMsg:i,setSendMsg:o,sending:c,sendTask:h,sendError:m}){let[p,f]=(0,s.useState)("chat"),[x,y]=(0,s.useState)([]),[g,v]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{"events"!==p||g||fetch("/api/hub/task-events?limit=50").then(e=>e.json()).then(e=>{y(e.events||[]),v(!0)}).catch(()=>v(!0))},[p,g]),(0,t.jsxs)("div",{className:"bg-[#0d0d1a] border border-[#2a2a4a] rounded-xl overflow-hidden h-[calc(100vh-140px)] flex flex-col",children:[(0,t.jsx)("div",{className:"flex border-b border-[#2a2a4a] bg-[#0a0a15] shrink-0",children:["chat","events","info"].map(e=>(0,t.jsx)("button",{onClick:()=>f(e),className:`px-5 py-3 text-sm font-medium border-b-2 transition-colors ${p===e?"border-cyan-400 text-cyan-300":"border-transparent text-gray-500 hover:text-gray-300"}`,children:"chat"===e?"💬 Chat":"events"===e?"📋 Events":"📊 Info"},e))}),(0,t.jsxs)("div",{className:"flex-1 overflow-hidden",children:["chat"===p&&(0,t.jsx)(a.TaskChatPanel,{alias:e,onClose:()=>{},inline:!0}),"events"===p&&(0,t.jsx)(u,{events:x,loading:!g}),"info"===p&&(0,t.jsxs)("div",{className:"p-4 overflow-y-auto h-full space-y-4 max-w-2xl",children:[(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-3",children:"Node Info"}),(0,t.jsx)("div",{className:"space-y-2 text-xs",children:[{label:"Node ID",value:r?.node_id,alwaysShow:!0},{label:"Session ID",value:r?.session_id,alwaysShow:!0},{label:"Resume ID",value:r?.resume_id,alwaysShow:!0},{label:"Alias",value:r?.alias,alwaysShow:!0},{label:"Agent",value:r?.agent,alwaysShow:!0},{label:"Model",value:r?.model,alwaysShow:!0},{label:"Version",value:r?.version},{label:"Server",value:r?.server,alwaysShow:!0},{label:"Hostname",value:r?.hostname,alwaysShow:!0},{label:"IP",value:r?.ip,alwaysShow:!0},{label:"Project",value:r?.project_dir},{label:"Config",value:r?.config_path,alwaysShow:!0},{label:"Channels",value:r?.channels?.length?Array.isArray(r.channels)?r.channels.join(", "):r.channels:null,alwaysShow:!0},{label:"Tmux",value:r?.tmux_name},{label:"SSE",value:n>0?`Connected (${n})`:"Disconnected",alwaysShow:!0},{label:"Progress",value:r?.progress?`${r.progress}%`:null},{label:"Score",value:r?.score},{label:"Last Seen",value:r?.last_seen_at,alwaysShow:!0},{label:"Registered",value:r?.registered_at,alwaysShow:!0},{label:"Updated",value:r?.updated_at,alwaysShow:!0}].map(({label:e,value:s,alwaysShow:r})=>s||r?(0,t.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,t.jsx)("span",{className:"text-gray-500 shrink-0",children:e}),(0,t.jsx)("span",{className:"text-gray-300 truncate max-w-[200px]",title:s?String(s):"--",children:s?String(s):"--"})]},e):null)})]}),r?.task&&(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-2",children:"Current Task"}),(0,t.jsx)("p",{className:"text-xs text-gray-400 whitespace-pre-wrap",children:r.task})]}),r?.output&&(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-2",children:"Last Output"}),(0,t.jsx)("p",{className:"text-xs text-gray-400 whitespace-pre-wrap max-h-48 overflow-y-auto",children:r.output})]}),(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-2",children:"Send Task"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("input",{type:"text",value:i,onChange:e=>o(e.target.value),onKeyDown:e=>"Enter"===e.key&&h(),placeholder:`Send task to ${e}...`,className:"flex-1 bg-[#0a0a15] border border-[#2a2a4a] rounded px-3 py-2 text-xs text-white placeholder-gray-600 focus:border-blue-500 focus:outline-none"}),(0,t.jsx)("button",{onClick:h,disabled:c||!i.trim(),className:"px-3 py-2 bg-blue-600 hover:bg-blue-500 disabled:bg-gray-700 text-white text-xs rounded transition-colors",children:c?"...":"Send"})]}),m&&(0,t.jsx)("div",{className:"mt-2 text-xs text-red-400",children:m})]}),r?.tmux_name&&(0,t.jsx)(l,{tmuxName:r.tmux_name})]})]})]})}let c={delivered:{dot:"bg-blue-400",line:"bg-blue-500/30",icon:"📬"},acked:{dot:"bg-yellow-400",line:"bg-yellow-500/30",icon:"✅"},running:{dot:"bg-green-400",line:"bg-green-500/30",icon:"⚡"},replied:{dot:"bg-purple-400",line:"bg-purple-500/30",icon:"💬"},failed:{dot:"bg-red-400",line:"bg-red-500/30",icon:"❌"},created:{dot:"bg-gray-400",line:"bg-gray-500/30",icon:"📝"}};function u({events:e,loading:s}){if(s)return(0,t.jsx)("div",{className:"flex justify-center py-8",children:(0,t.jsx)("div",{className:"w-5 h-5 border-2 border-cyan-500/30 border-t-cyan-500 rounded-full animate-spin"})});if(0===e.length)return(0,t.jsx)("div",{className:"text-center py-12 text-gray-600 text-xs",children:"No task events yet"});let r=new Map;return e.forEach(e=>{let t=e.task_id||`ungrouped-${e.id}`,s=r.get(t)||[];s.push(e),r.set(t,s)}),(0,t.jsx)("div",{className:"p-4 overflow-y-auto h-full space-y-4",children:[...r.entries()].map(([e,s])=>(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsxs)("div",{className:"text-[10px] text-gray-600 mb-3 truncate",children:["Task: ",e.slice(0,20),"..."]}),(0,t.jsxs)("div",{className:"relative pl-6",children:[(0,t.jsx)("div",{className:"absolute left-[9px] top-2 bottom-2 w-0.5 bg-[#1a1a2a]"}),s.map((e,s)=>{let r=c[e.to_status]||c.created;return(0,t.jsxs)("div",{className:"relative pb-4 last:pb-0",children:[(0,t.jsx)("div",{className:`absolute -left-6 top-0.5 w-[18px] h-[18px] rounded-full ${r.dot} flex items-center justify-center text-[9px] z-10 border-2 border-[#111128]`,children:r.icon.length<=2?r.icon:""}),(0,t.jsxs)("div",{className:"ml-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:`text-xs font-medium ${"failed"===e.to_status?"text-red-400":"replied"===e.to_status?"text-purple-400":"text-gray-300"}`,children:e.event_type}),e.from_status&&(0,t.jsxs)("span",{className:"text-[10px] text-gray-600",children:[e.from_status," → ",e.to_status]}),(0,t.jsx)("span",{className:"text-[10px] text-gray-600 ml-auto",children:(0,i.timeAgo)(e.created_at)})]}),e.detail&&(0,t.jsxs)("div",{className:"text-[11px] text-gray-500 mt-0.5 truncate",children:[e.detail.slice(0,50),e.detail.length>50?"...":""]})]})]},e.id)})]})]},e))})}e.s(["default",0,function(){return(0,t.jsx)(s.Suspense,{fallback:(0,t.jsx)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-6 font-mono",children:"Loading..."}),children:(0,t.jsx)(o,{})})}])}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,31713,e=>{"use strict";var t=e.i(47167),a=e.i(18050),s=e.i(71645),r=e.i(22016),l=e.i(18150);function n({online:e,working:t,total:s,version:r,uptime:l}){let i=s>0?Math.round(e/s*100):0;return(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mb-4",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-white tracking-tight",children:"Agent Network"}),(0,a.jsxs)("span",{className:"text-xs text-gray-500",children:["CommHub ",r," · ",l]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[(0,a.jsx)(o,{value:e,label:"Online",sub:`${i}% of fleet`,color:"text-green-400",accent:"from-green-500/20 to-green-500/0",border:"border-green-500/15"}),(0,a.jsx)(o,{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,a.jsx)(o,{value:s-e,label:"Offline",sub:s-e==0?"All systems go":`${s-e} disconnected`,color:"text-gray-400",accent:"from-gray-500/10 to-gray-500/0",border:"border-gray-500/15"}),(0,a.jsx)(o,{value:s,label:"Total",sub:"Registered nodes",color:"text-white",accent:"from-blue-500/15 to-blue-500/0",border:"border-blue-500/15"})]})]})}function o({value:e,label:t,sub:s,color:r,accent:l,border:n}){let i=r.replace("text-","").split("-")[0];return(0,a.jsxs)("div",{"data-anet-stat-card":i,className:`anet-stat-card relative overflow-hidden rounded-xl border ${n} bg-[#111128] px-4 py-3 transition-all`,children:[(0,a.jsx)("div",{className:`absolute inset-0 bg-gradient-to-br ${l} pointer-events-none`}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:`text-3xl font-bold ${r} tabular-nums leading-tight`,children:e}),(0,a.jsx)("div",{className:"text-sm text-gray-300 mt-0.5",children:t}),(0,a.jsx)("div",{className:"text-xs text-gray-600 mt-1",children:s})]})]})}function i(){let[e,t]=(0,s.useState)(""),[r,l]=(0,s.useState)(!1),[n,o]=(0,s.useState)(""),i=async()=>{if(e.trim()){l(!0),o("");try{let a=await fetch("/api/hub/broadcast",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}),s=await a.json();s.ok?(o(`Broadcast sent to ${s.recipients} node(s)`),t("")):o(`Failed: ${s.error||"Send error"}`)}catch(e){o(`Failed: ${e instanceof Error?e.message:"Send error"}`)}l(!1),setTimeout(()=>o(""),5e3)}};return(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:e,onChange:e=>t(e.target.value),onKeyDown:e=>"Enter"===e.key&&i(),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,a.jsx)("button",{onClick:i,disabled:r||!e.trim(),"aria-label":"Send broadcast",className:"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?"Sending...":"Broadcast"})]}),e.length>0&&(0,a.jsxs)("div",{className:"text-right text-xs text-gray-600 mt-1",children:[e.length,"/500"]}),n&&(0,a.jsx)("div",{className:`mt-3 text-sm text-center ${n.startsWith("Failed")?"text-red-400":"text-green-400/80"} animate-fade-in`,children:n})]})}function d(e,t,a){let s=t<=2?Math.PI:1.78*Math.PI,r=-Math.PI/2-s/2,l=t<=1?-Math.PI/2:r+s*e/(t-1);return{x:500+a*Math.cos(l),y:330+a*Math.sin(l)}}function c(e,t,a=0){let s=(e.x+t.x)/2,r=(e.y+t.y)/2,l=t.x-e.x,n=t.y-e.y,o=Math.hypot(l,n)||1,i={x:s+-n/o*a,y:r+l/o*a};return`M${e.x},${e.y} Q${i.x},${i.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"},m={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,s.useState)("dark");return(0,s.useEffect)(()=>{let e=()=>{let e=document.documentElement.getAttribute("data-theme")||"cyber";t("light"===e||"mint"===e?"light":"dark")};e();let a=new MutationObserver(e);return a.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>a.disconnect()},[]),e}(),l=r?m:h,[n,o]=(0,s.useState)([]);(0,s.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();o(t.messages||[])}catch{}};e();let t=setInterval(e,5e3);return()=>clearInterval(t)},[]);let{onlineNodes:i,offlineNodes:u,nodePositions:g,flowLinks:p,activeAliases:b}=(0,s.useMemo)(()=>{let a,s=e=>(e.network_id?t[`${e.network_id}:${e.alias}`]:void 0)??t[e.alias],r=e.filter(e=>"offline"!==e.status||s(e)),l=e.filter(e=>"offline"===e.status&&!s(e)),o={};r.forEach((e,t)=>{o[e.alias]=d(t,Math.max(r.length,1),220)}),l.forEach((e,t)=>{o[e.alias]=d(t,Math.max(l.length,1),315)});let i=(a=new Map,n.forEach(e=>{if(!o[e.from_alias]||!o[e.to_alias]||e.from_alias===e.to_alias)return;let t=`${e.from_alias}->${e.to_alias}`,s=a.get(t);a.set(t,{key:t,from:e.from_alias,to:e.to_alias,count:(s?.count||0)+1,content:s?.content||e.content})}),[...a.values()].slice(0,18)),c=new Set;return i.forEach(e=>{c.add(e.from),c.add(e.to)}),{onlineNodes:r,offlineNodes:l,nodePositions:o,flowLinks:i,activeAliases:c}},[n,e,t]),y=i.filter(e=>"working"===e.status).length;return(0,a.jsxs)("section",{className:"w-full max-w-6xl mx-auto mb-8",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between mb-3 px-1",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-xs uppercase text-gray-600 tracking-wider",children:"Network Topology"}),(0,a.jsx)("h2",{className:"text-lg text-white font-semibold",children:"Command mesh"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs",children:[(0,a.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,a.jsxs)("span",{className:"px-2.5 py-1 rounded-md bg-cyan-500/10 text-cyan-300 border border-cyan-500/20",children:[i.length," online"]}),(0,a.jsxs)("span",{className:"px-2.5 py-1 rounded-md bg-gray-500/10 text-gray-400 border border-gray-500/20",children:[p.length," active links"]})]})]}),(0,a.jsxs)("div",{className:`relative overflow-hidden rounded-lg border shadow-2xl ${r?"shadow-zinc-900/5":"shadow-cyan-950/30"}`,style:{background:l.containerBg,borderColor:l.containerBorder},children:[(0,a.jsx)("div",{className:`absolute inset-x-0 top-0 h-px bg-gradient-to-r ${l.topRailGradient}`}),(0,a.jsxs)("svg",{viewBox:"0 0 1000 680",className:"w-full h-auto block",preserveAspectRatio:"xMidYMid meet",children:[(0,a.jsxs)("defs",{children:[(0,a.jsxs)("linearGradient",{id:"topo-panel",x1:"0",x2:"1",y1:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:l.panelStops[0]}),(0,a.jsx)("stop",{offset:"48%",stopColor:l.panelStops[1]}),(0,a.jsx)("stop",{offset:"100%",stopColor:l.panelStops[2]})]}),(0,a.jsxs)("radialGradient",{id:"topo-radar",cx:"50%",cy:"50%",r:"55%",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:l.radarStops[0].color,stopOpacity:l.radarStops[0].opacity}),(0,a.jsx)("stop",{offset:"45%",stopColor:l.radarStops[1].color,stopOpacity:l.radarStops[1].opacity}),(0,a.jsx)("stop",{offset:"100%",stopColor:l.radarStops[2].color,stopOpacity:l.radarStops[2].opacity})]}),!r&&(0,a.jsxs)("filter",{id:"topo-glow",children:[(0,a.jsx)("feGaussianBlur",{stdDeviation:"4",result:"blur"}),(0,a.jsxs)("feMerge",{children:[(0,a.jsx)("feMergeNode",{in:"blur"}),(0,a.jsx)("feMergeNode",{in:"SourceGraphic"})]})]}),(0,a.jsx)("marker",{id:"topo-arrow",viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"5",markerHeight:"5",orient:"auto-start-reverse",children:(0,a.jsx)("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:l.arrowFill})})]}),(0,a.jsx)("rect",{width:"1000",height:"680",fill:"url(#topo-panel)"}),(0,a.jsx)("circle",{cx:500,cy:330,r:"330",fill:"url(#topo-radar)"}),[90,170,250,330].map(e=>(0,a.jsx)("circle",{cx:500,cy:330,r:e,fill:"none",stroke:l.ringStroke,strokeWidth:"1",opacity:r?.6:.35},e)),[0,30,60,90,120,150].map(e=>(0,a.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:l.ringStroke,strokeWidth:"1",opacity:r?.35:.18},e)),i.map(e=>{let t=g[e.alias];if(!t)return null;let s=c({x:500,y:330},t,0);return(0,a.jsx)("path",{d:s,fill:"none",stroke:b.has(e.alias)?l.spokeStroke.active:l.spokeStroke.idle,strokeWidth:b.has(e.alias)?2:1,strokeDasharray:b.has(e.alias)?"none":"8 10",opacity:b.has(e.alias)?.65:.35},`hub-${e.alias}`)}),p.map((e,t)=>{let s=g[e.from],n=g[e.to];if(!s||!n)return null;let o=c(s,n,t%2==0?36:-36),i=Math.min(2+e.count,7);return(0,a.jsxs)("g",{children:[(0,a.jsx)("path",{d:o,fill:"none",stroke:l.flowEdge,strokeWidth:i,opacity:r?.22:.28,filter:r?void 0:"url(#topo-glow)",markerEnd:"url(#topo-arrow)"}),(0,a.jsx)("path",{id:`flow-path-${t}`,d:o,fill:"none",stroke:l.flowPath,strokeWidth:"1",strokeDasharray:"2 12",opacity:r?.4:.75}),(0,a.jsx)("circle",{r:"4",fill:l.flowParticle,filter:r?void 0:"url(#topo-glow)",children:(0,a.jsx)("animateMotion",{dur:`${2.2+t%5*.32}s`,repeatCount:"indefinite",path:o})})]},e.key)}),(0,a.jsxs)("g",{children:[(0,a.jsxs)("circle",{cx:500,cy:330,r:"6",fill:"none",stroke:"#10b981",strokeWidth:"1.5",children:[(0,a.jsx)("animate",{attributeName:"r",values:"6;28;6",dur:"2.4s",repeatCount:"indefinite"}),(0,a.jsx)("animate",{attributeName:"opacity",values:"0.55;0;0.55",dur:"2.4s",repeatCount:"indefinite"})]}),(0,a.jsxs)("circle",{cx:500,cy:330,r:"6",fill:"none",stroke:"#10b981",strokeWidth:"1.5",opacity:"0",children:[(0,a.jsx)("animate",{attributeName:"r",values:"6;28;6",dur:"2.4s",begin:"1.2s",repeatCount:"indefinite"}),(0,a.jsx)("animate",{attributeName:"opacity",values:"0.45;0;0.45",dur:"2.4s",begin:"1.2s",repeatCount:"indefinite"})]}),(0,a.jsx)("circle",{cx:500,cy:330,r:"6",fill:"#10b981"}),(0,a.jsx)("circle",{cx:500,cy:330,r:"3",fill:"#d1fae5",opacity:"0.9"})]}),[...i,...u].map(e=>{let s=g[e.alias];if(!s)return null;let n=(e.network_id?t[`${e.network_id}:${e.alias}`]:void 0)??t[e.alias],o="offline"!==e.status||!!n,i=o?"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=o?26:18;return(0,a.jsxs)("g",{className:"transition-opacity",children:[d&&(0,a.jsxs)("circle",{cx:s.x,cy:s.y,r:c+14,fill:i.primary,opacity:r?.08:.12,children:[(0,a.jsx)("animate",{attributeName:"r",values:`${c+8};${c+22};${c+8}`,dur:"2.4s",repeatCount:"indefinite"}),(0,a.jsx)("animate",{attributeName:"opacity",values:r?"0.12;0.02;0.12":"0.18;0.04;0.18",dur:"2.4s",repeatCount:"indefinite"})]}),(0,a.jsx)("circle",{cx:s.x,cy:s.y,r:c+8,fill:i.halo,opacity:o?r?.85:.55:r?.4:.25}),(0,a.jsx)("circle",{cx:s.x,cy:s.y,r:c,fill:o?l.nodeFill.online:l.nodeFill.offline,stroke:i.primary,strokeWidth:o?3:1.5,strokeDasharray:o?"none":"5 5",filter:o&&!r?"url(#topo-glow)":void 0}),(0,a.jsx)("circle",{cx:s.x,cy:s.y,r:o?8:5,fill:i.primary}),"working"===e.status&&(0,a.jsx)("path",{d:`M${s.x-9},${s.y+11} h18`,stroke:l.flowParticle,strokeWidth:"3",strokeLinecap:"round",children:(0,a.jsx)("animate",{attributeName:"opacity",values:"1;0.25;1",dur:"1.1s",repeatCount:"indefinite"})}),(0,a.jsxs)("g",{transform:`translate(${s.x}, ${s.y+c+22})`,children:[(0,a.jsx)("rect",{x:"-62",y:"-14",width:"124",height:"42",rx:"6",fill:l.labelBox.fill,stroke:l.labelBox.stroke,opacity:r?1:.94}),(0,a.jsx)("text",{x:"0",y:"1",textAnchor:"middle",fill:i.text,fontSize:"12",fontFamily:"monospace",fontWeight:"700",children:x(e.alias,14)}),(0,a.jsxs)("text",{x:"0",y:"17",textAnchor:"middle",fill:i.primary,fontSize:"9",fontFamily:"monospace",children:[i.label,o&&null!=n?` sse:${n}`:""]})]})]},e.alias)}),(0,a.jsxs)("g",{transform:"translate(28, 34)",children:[(0,a.jsx)("rect",{x:"0",y:"0",width:"285",height:60+20*Math.min(p.length,4),rx:"8",fill:l.legendBox.fill,stroke:l.legendBox.stroke,opacity:r?1:.94}),(0,a.jsx)("text",{x:"16",y:"26",fill:l.legendHeadline,fontSize:"13",fontFamily:"monospace",fontWeight:"700",children:"recent signal"}),(0,a.jsxs)("text",{x:"178",y:"26",fill:l.legendAccent,fontSize:"11",fontFamily:"monospace",children:[n.length," messages"]}),p.slice(0,4).map((e,t)=>(0,a.jsxs)("text",{x:"16",y:54+20*t,fill:l.legendText,fontSize:"10",fontFamily:"monospace",children:[x(e.from,8)," ","->"," ",x(e.to,8)," / ",e.count," / ",x(e.content,18)]},e.key))]}),(0,a.jsxs)("g",{transform:"translate(720, 34)",children:[(0,a.jsx)("rect",{x:"0",y:"0",width:"250",height:"112",rx:"8",fill:l.legendBox.fill,stroke:l.legendBox.stroke,opacity:r?1:.94}),(0,a.jsx)("circle",{cx:"18",cy:"26",r:"6",fill:r?"#059669":"#22c55e"}),(0,a.jsx)("text",{x:"34",y:"30",fill:l.legendText,fontSize:"11",fontFamily:"monospace",children:"working node"}),(0,a.jsx)("circle",{cx:"18",cy:"52",r:"6",fill:r?"#0d9488":"#2dd4bf"}),(0,a.jsx)("text",{x:"34",y:"56",fill:l.legendText,fontSize:"11",fontFamily:"monospace",children:"online idle"}),(0,a.jsx)("circle",{cx:"18",cy:"78",r:"6",fill:r?"#94a3b8":"#6b7280"}),(0,a.jsx)("text",{x:"34",y:"82",fill:l.legendText,fontSize:"11",fontFamily:"monospace",children:"offline / no SSE"}),(0,a.jsx)("path",{d:"M150,78 Q176,52 210,78",fill:"none",stroke:l.flowEdge,strokeWidth:"3",markerEnd:"url(#topo-arrow)"})]})]})]})]})}let u={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 p({session:e,hasSse:t,sseCount:s,onChat:n}){let o=t&&u[e.status]||g;return(0,a.jsxs)(r.default,{href:`/node?alias=${encodeURIComponent(e.alias)}`,prefetch:!1,className:`block rounded-xl border p-4 transition-all duration-300 cursor-pointer ${t?`bg-[#111128] border-[#2a2a4a] hover:border-cyan-500/30 hover:shadow-lg ${o.glow}`:"bg-[#0d0d1a] border-[#1a1a2a] opacity-40"}`,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${o.dot} ${t&&"working"===e.status?"animate-pulse":""}`}),(0,a.jsx)("span",{className:"font-semibold text-white truncate text-sm",title:e.alias,children:e.alias})]}),(0,a.jsx)("span",{className:`text-[11px] px-2 py-0.5 rounded-md border shrink-0 ${o.bg} ${o.text}`,children:t?e.status:"offline"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.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,a.jsxs)("span",{className:"text-[10px] text-green-500",children:["SSE:",s]})]}),e.task?(0,a.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,a.jsx)("div",{className:"text-xs text-gray-700 italic",children:"No active task"}),e.progress>0&&(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsxs)("div",{className:"flex justify-between text-[10px] mb-1",children:[(0,a.jsx)("span",{className:"text-gray-600",children:"Progress"}),(0,a.jsxs)("span",{className:o.text,children:[e.progress,"%"]})]}),(0,a.jsx)("div",{className:"w-full bg-gray-800 rounded-full h-1.5 overflow-hidden",children:(0,a.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,a.jsxs)("div",{className:"mt-3 flex justify-between items-center text-[10px] text-gray-600",children:[(0,a.jsx)("span",{children:e.server||"--"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[n&&t&&(0,a.jsx)("button",{onClick:t=>{t.preventDefault(),t.stopPropagation(),n(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,a.jsx)("span",{children:(0,l.timeAgo)(e.updated_at)})]})]})]})}function b({messages:e}){return 0===e.length?null:(0,a.jsxs)("div",{className:"mt-8",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-white mb-3 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-gray-500",children:"Inbox"}),(0,a.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,a.jsx)("div",{className:"space-y-2 max-h-96 overflow-y-auto pr-1 scrollbar-thin",children:e.map(e=>(0,a.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-4 py-3 text-sm transition-colors hover:border-[#3a3a5a]",children:[(0,a.jsxs)("div",{className:"flex justify-between text-xs text-gray-500 mb-1.5",children:[(0,a.jsx)("span",{className:"text-blue-400 font-medium",children:e.from_session}),(0,a.jsx)("span",{children:e.created_at})]}),(0,a.jsx)("div",{className:"text-gray-300 leading-relaxed",children:e.content})]},e.id))})]})}function y(){return(0,a.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,a.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,a.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] px-4 py-3",children:[(0,a.jsx)(j,{w:"2.5rem",h:"1.75rem"}),(0,a.jsx)(j,{w:"3.5rem",h:"0.75rem",className:"mt-2"}),(0,a.jsx)(j,{w:"5rem",h:"0.625rem",className:"mt-1"})]},e))}),(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-3 anet-skeleton-pulse",children:[(0,a.jsx)(j,{w:"6rem",h:"2.5rem",rounded:"0.75rem"}),(0,a.jsxs)("div",{className:"flex-1 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-2.5 flex items-center gap-3",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-full anet-skeleton-bar"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)(j,{w:"6rem",h:"0.875rem"}),(0,a.jsx)(j,{w:"10rem",h:"0.625rem",className:"mt-1"})]})]})]}),(0,a.jsx)("div",{className:"mb-6 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 anet-skeleton-pulse",children:(0,a.jsx)(j,{w:"14rem",h:"0.875rem"})}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-2 sm:gap-3 mb-3 anet-skeleton-pulse",children:[1,2,3].map(e=>(0,a.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] px-3 py-3",children:[(0,a.jsx)(j,{w:"2rem",h:"1.25rem"}),(0,a.jsx)(j,{w:"2.5rem",h:"0.75rem",className:"mt-1"}),(0,a.jsx)(j,{w:"3.5rem",h:"0.625rem",className:"mt-px"})]},e))}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-2 sm:gap-3 mb-6 anet-skeleton-pulse",children:[1,2,3].map(e=>(0,a.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] px-3 py-2.5 flex items-center justify-center gap-2",children:[(0,a.jsx)("div",{className:"w-4 h-4 rounded anet-skeleton-bar"}),(0,a.jsx)(j,{w:"4rem",h:"0.75rem"})]},e))}),(0,a.jsxs)("div",{className:"mb-6 flex gap-2 anet-skeleton-pulse",children:[(0,a.jsx)("div",{className:"flex-1 h-10 rounded-lg border border-[#2a2a4a] bg-[#111128]"}),(0,a.jsx)("div",{className:"w-28 h-10 rounded-lg anet-skeleton-bar"})]}),(0,a.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,a.jsxs)("div",{className:"rounded-xl border border-[#2a2a4a] bg-[#111128] p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("div",{className:"w-2 h-2 rounded-full anet-skeleton-bar"}),(0,a.jsx)(j,{w:"6rem",h:"0.875rem"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(j,{w:"100%",h:"0.625rem"}),(0,a.jsx)(j,{w:"75%",h:"0.625rem"}),(0,a.jsx)(j,{w:"55%",h:"0.625rem"})]})]},e))})]})}function j({w:e,h:t,rounded:s,className:r}){return(0,a.jsx)("div",{className:`anet-skeleton-bar ${r||""}`,style:{width:e,height:t,borderRadius:s||"0.375rem"}})}var v=e.i(95356),w=e.i(58963);function k(){let{setNetworkId:e}=(0,w.useNetworkId)(),[t,r]=(0,s.useState)({user:null,networks:[],currentNetwork:"",token:""}),[l,n]=(0,s.useState)(!1),[o,i]=(0,s.useState)(""),[d,c]=(0,s.useState)(""),[x,h]=(0,s.useState)(""),[m,f]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e=sessionStorage.getItem("anet_v3_auth");if(e)try{r(JSON.parse(e))}catch{}},[]);let[u,g]=(0,s.useState)(!1),[p,b]=(0,s.useState)(""),[y,j]=(0,s.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:p,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:p,email:y})}),a=await e.json();if(a.ok&&a.user){let e={...t,user:a.user};r(e),sessionStorage.setItem("anet_v3_auth",JSON.stringify(e)),g(!1)}}catch{}};if(!t.user)return null;let k=(t.user.display_name||t.user.username).slice(0,2).toUpperCase();return(0,a.jsxs)("div",{className:"flex items-center justify-between bg-[#111128] border border-[#2a2a4a] rounded-lg px-4 py-2.5 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.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:k}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm text-white font-medium",children:t.user.display_name||t.user.username}),(0,a.jsxs)("div",{className:"text-[10px] text-gray-500",children:[t.user.role," · ",t.user.user_id]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[t.networks.length>0&&(0,a.jsx)("select",{value:t.currentNetwork,onChange:a=>{let s={...t,currentNetwork:a.target.value};r(s),e(a.target.value),sessionStorage.setItem("anet_v3_auth",JSON.stringify(s))},className:"bg-[#0a0a15] border border-[#2a2a4a] rounded px-2 py-1 text-xs text-white focus:outline-none",children:t.networks.map(e=>(0,a.jsx)("option",{value:e.network_id,children:e.network_name},e.network_id))}),(0,a.jsxs)("button",{onClick:()=>{b(t.user?.display_name||""),j(""),g(!u)},className:"text-xs text-gray-500 hover:text-gray-300 whitespace-nowrap","aria-label":"Edit profile",children:[(0,a.jsx)("span",{className:"hidden sm:inline",children:"Edit"}),(0,a.jsx)("svg",{className:"sm:hidden w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",children:(0,a.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,a.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,a.jsx)("span",{className:"hidden sm:inline",children:"Sign out"}),(0,a.jsx)("svg",{className:"sm:hidden w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",children:(0,a.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"})})]})]}),u&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-2 pt-2 border-t border-[#2a2a4a]",children:[(0,a.jsx)("input",{type:"text",value:p,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,a.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,a.jsx)("button",{onClick:v,className:"px-2 py-1 bg-cyan-600 hover:bg-cyan-500 text-white text-xs rounded",children:"Save"})]})]})}var N=e.i(21373),S=e.i(58442);function C({tabs:e,activeTab:t,onOpenTab:s,onCloseTab:r,onSetActive:l,onClose:n}){return 0===e.length?null:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{onClick:n,className:"jsx-f7cf3d1a6fdfc074 fixed inset-0 bg-black/30 z-40 lg:hidden"}),(0,a.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,a.jsxs)("div",{className:"jsx-f7cf3d1a6fdfc074 flex items-center border-b border-[#2a2a4a] bg-[#0d0d1a] overflow-x-auto",children:[(0,a.jsx)("div",{className:"jsx-f7cf3d1a6fdfc074 flex-1 flex min-w-0",children:e.map(e=>(0,a.jsxs)("button",{onClick:()=>l(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,a.jsx)("div",{className:`jsx-f7cf3d1a6fdfc074 w-2 h-2 rounded-full ${t===e?"bg-cyan-400":"bg-gray-600"}`}),(0,a.jsx)("span",{className:"jsx-f7cf3d1a6fdfc074 max-w-[80px] truncate",children:e}),(0,a.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,a.jsx)("button",{onClick:n,className:"jsx-f7cf3d1a6fdfc074 text-gray-500 hover:text-white px-3 py-2.5 shrink-0 border-l border-[#2a2a4a]",children:(0,a.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,className:"jsx-f7cf3d1a6fdfc074 w-4 h-4",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12",className:"jsx-f7cf3d1a6fdfc074"})})})]}),(0,a.jsx)("div",{className:"jsx-f7cf3d1a6fdfc074 flex-1 relative overflow-hidden",children:e.map(e=>(0,a.jsx)("div",{className:`jsx-f7cf3d1a6fdfc074 absolute inset-0 ${t===e?"block":"hidden"}`,children:(0,a.jsx)($,{alias:e})},e))})]}),(0,a.jsx)(N.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 $({alias:e}){return(0,a.jsx)(S.TaskChatPanel,{alias:e,onClose:()=>{},inline:!0})}function _({sessions:e,onClose:t}){let[r,l]=(0,s.useState)(new Set),[n,o]=(0,s.useState)(""),[i,d]=(0,s.useState)("normal"),[c,x]=(0,s.useState)(!1),[h,m]=(0,s.useState)([]),[f,u]=(0,s.useState)(""),g=e.filter(e=>"offline"!==e.status).filter(e=>!f||e.alias.toLowerCase().includes(f.toLowerCase())||(e.agent||"").toLowerCase().includes(f.toLowerCase())),p=async()=>{if(!n.trim()||0===r.size||c)return;x(!0),m([]);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:n,priority:i})}),a=await t.json();return{alias:e,ok:!!a.ok,error:a.error}}catch(t){return{alias:e,ok:!1,error:"send failed"}}});m(await Promise.all(e)),x(!1)},b=h.filter(e=>e.ok).length;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:t}),(0,a.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",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-[#2a2a4a] bg-[#0d0d1a]",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg font-bold text-white",children:"Dispatch Task"}),(0,a.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:"Send a task to one or more agents"})]}),(0,a.jsx)("button",{onClick:t,className:"text-gray-500 hover:text-white p-1.5 rounded-lg hover:bg-[#1a1a2a]",children:(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col lg:flex-row overflow-hidden",children:[(0,a.jsxs)("div",{className:"lg:w-[280px] border-b lg:border-b-0 lg:border-r border-[#2a2a4a] flex flex-col",children:[(0,a.jsxs)("div",{className:"px-4 py-3 border-b border-[#2a2a4a]",children:[(0,a.jsx)("input",{type:"text",value:f,onChange:e=>u(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,a.jsxs)("div",{className:"flex items-center justify-between mt-2",children:[(0,a.jsx)("button",{onClick:()=>{r.size===g.length?l(new Set):l(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,a.jsxs)("span",{className:"text-[10px] text-gray-600",children:[r.size," selected"]})]})]}),(0,a.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,a.jsxs)("button",{onClick:()=>{var t;return t=e.alias,void l(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a})},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,a.jsx)("div",{className:`w-2 h-2 rounded-full shrink-0 ${"working"===e.status?"bg-green-400":"idle"===e.status?"bg-cyan-400":"bg-gray-500"}`}),(0,a.jsx)("span",{className:"truncate flex-1",children:e.alias}),(0,a.jsx)("span",{className:"text-[9px] text-gray-600",children:e.agent||"--"})]},e.alias)),0===g.length&&(0,a.jsx)("div",{className:"text-center text-xs text-gray-600 py-4",children:"No online agents"})]})]}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,a.jsxs)("div",{className:"flex-1 px-6 py-4 flex flex-col",children:[(0,a.jsx)("label",{className:"text-xs text-gray-500 uppercase mb-2",children:"Task Prompt"}),(0,a.jsx)("textarea",{value:n,onChange:e=>o(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,a.jsxs)("div",{className:"flex items-center gap-3 mt-4",children:[(0,a.jsxs)("select",{value:i,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,a.jsx)("option",{value:"normal",children:"Normal priority"}),(0,a.jsx)("option",{value:"high",children:"High priority"}),(0,a.jsx)("option",{value:"low",children:"Low priority"})]}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsx)("button",{onClick:p,disabled:c||!n.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,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.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,a.jsxs)("div",{className:"px-6 py-3 border-t border-[#2a2a4a] bg-[#0d0d1a]",children:[(0,a.jsxs)("div",{className:"text-xs text-gray-500 mb-2",children:[b,"/",h.length," dispatched successfully"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:h.map(e=>(0,a.jsxs)("span",{className:`text-[10px] px-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:[e.alias,": ",e.ok?"✓":e.error||"✗"]},e.alias))})]})]})]})]})]})}var M=e.i(65822),T=e.i(51280),B=e.i(71235);e.s(["default",0,function(){let e,o,d;(0,s.useEffect)(()=>{sessionStorage.getItem("anet_v3_auth")||(fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),window.location.assign("/login"))},[]);let{sessions:c,hint:x,error:h,isLoading:m}=(0,M.useSessions)(),{health:u}=(0,M.useHealth)(),{config:g}=(0,M.useAnetConfig)(),{tasks:j}=(0,M.useTasks)({limit:"500"}),{stats:w}=(0,M.useStats)(),{license:N}=(0,M.useLicense)(),[S,$]=(0,s.useState)(window.innerWidth>=1024),[E,L]=(0,s.useState)(!1),P=function(){let[e,t]=(0,s.useState)([]),[a,r]=(0,s.useState)("");return{tabs:e,activeTab:a,openTab:e=>{t(t=>t.includes(e)?t:[...t,e]),r(e)},closeTab:e=>{t(t=>{let s=t.filter(t=>t!==e);return a===e&&r(s[s.length-1]||""),s})},closeAll:()=>{t([]),r("")},setActiveTab:r}}(),[z,F]=(0,s.useState)(!1),[A,W]=(0,s.useState)([]),{mutate:O}=(0,B.useSWRConfig)(),I="1"!==t.default.env.NEXT_PUBLIC_DISABLE_SSE,{connected:H,supported:R}=(0,T.useSSE)({url:"/api/hub/events",enabled:I,onEvent:e=>{["new_task","new_message","new_reply","node_status_changed","broadcast"].includes(e.type)&&(O("/api/hub/status"),O(e=>"string"==typeof e&&e.startsWith("/api/hub/tasks"),void 0,{revalidate:!0}))}});if((0,s.useEffect)(()=>{let e=()=>{fetch("/api/hub/inbox").then(e=>e.json()).then(e=>{e.messages?.length&&W(t=>{let a=new Set(t.map(e=>e.id));return[...e.messages.filter(e=>!a.has(e.id)),...t].slice(0,100)})}).catch(()=>{})};e();let t=setInterval(e,1e4);return()=>clearInterval(t)},[]),m)return(0,a.jsx)(y,{});let D=u?.sse_sessions||{},G=e=>(e.network_id?D[`${e.network_id}:${e.alias}`]:void 0)??D[e.alias],J=e=>"offline"!==e.status||!!G(e),U=c.filter(J).length,V=c.length,K=c.filter(e=>"working"===e.status).length,Q=u?(0,l.formatUptime)(u.uptime):"--",X=u?.version||"--",Y=!!(g?.hub&&g.tokenConfigured),q=g?.source==="file"?"Local config":g?.source==="runtime-env"?"Runtime env":"Config missing",Z={};if(w?.tasks?.by_status?.length)for(let e of w.tasks.by_status)Z[e.status]=e.count;else for(let e of j)Z[e.status]=(Z[e.status]||0)+1;let ee=[...c].sort((e,t)=>{let a=+!!J(e),s=+!!J(t);if(a!==s)return s-a;let r=+("working"===e.status);return("working"===t.status)-r});return(0,a.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,a.jsx)("div",{className:"lg:ml-0 ml-10",children:(0,a.jsx)(n,{online:U,working:K,total:V,version:X,uptime:Q})}),(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("button",{onClick:()=>F(!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,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(k,{})})]}),(0,a.jsxs)("section",{className:"mb-6 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 shadow-lg shadow-black/20",children:[(0,a.jsxs)("button",{onClick:()=>L(!E),className:"w-full flex items-center justify-between text-left",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,a.jsx)("span",{className:"uppercase text-gray-600",children:"Config"}),(0,a.jsx)("span",{className:`w-2 h-2 rounded-full ${Y?"bg-green-400":"bg-red-400"}`}),(0,a.jsx)("span",{className:"text-gray-500",children:q})]}),(0,a.jsx)("svg",{className:`w-4 h-4 text-gray-600 transition-transform ${E?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),E&&(0,a.jsxs)("div",{className:"mt-3 pt-3 border-t border-[#2a2a4a]",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("div",{className:"min-w-0",children:(0,a.jsxs)("div",{className:"text-gray-100 truncate text-sm",title:g?.hub||void 0,children:["Hub: ",(0,a.jsx)("span",{className:g?.hub?"text-cyan-300":"text-red-300",children:g?.hub?.trim()||"not configured"})]})}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2 text-xs",children:(0,a.jsxs)("span",{className:`px-2.5 py-1 rounded-md border ${g?.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: ",g?.tokenPreview||"not configured"]})})]}),g?.error&&(0,a.jsx)("div",{className:"mt-2 text-xs text-gray-600",children:g.error})]})]}),Object.keys(Z).length>0&&(0,a.jsxs)("section",{className:"mb-6 rounded-lg border border-[#2a2a4a] bg-[#111128] px-4 py-3 shadow-lg shadow-black/20",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("div",{className:"text-xs uppercase text-gray-600",children:"Task Status"}),(0,a.jsx)(r.default,{href:"/tasks",prefetch:!1,className:"text-xs text-cyan-400 hover:text-cyan-300",children:"View all →"})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:[{key:"running",color:"bg-green-500/10 text-green-300 border-green-500/20"},{key:"delivered",color:"bg-blue-500/10 text-blue-300 border-blue-500/20"},{key:"acked",color:"bg-cyan-500/10 text-cyan-300 border-cyan-500/20"},{key:"replied",color:"bg-purple-500/10 text-purple-300 border-purple-500/20"},{key:"failed",color:"bg-red-500/10 text-red-300 border-red-500/20"},{key:"cancelled",color:"bg-yellow-500/10 text-yellow-300 border-yellow-500/20"},{key:"expired",color:"bg-orange-500/10 text-orange-300 border-orange-500/20"},{key:"closed",color:"bg-gray-500/10 text-gray-500 border-gray-500/20"}].filter(({key:e})=>Z[e]).map(({key:e,color:t})=>(0,a.jsxs)(r.default,{href:`/tasks?status=${e}`,prefetch:!1,className:`px-2.5 py-1 rounded-md border text-xs ${t} hover:opacity-80 transition-opacity`,children:[e,": ",Z[e]]},e))})]}),(0,a.jsx)("section",{className:"mb-3 grid grid-cols-3 gap-2 sm:gap-3",children:(e=c.filter(e=>J(e)&&"working"!==e.status).length,o=V-U,d=j.filter(e=>"failed"===e.status).length,[{href:"/nodes",label:"Nodes",value:`${U}/${V}`,sub:`${V>0?Math.round(U/V*100):0}% online`,color:"text-green-400 border-green-500/20",popover:0===V?null:[{k:"working",v:K,dot:"",color:"#4ade80"},{k:"idle",v:e,dot:"",color:"#22d3ee"},{k:"offline",v:o,dot:"",color:"#9ca3af"}]},{href:"/tasks",label:"Tasks",value:String(Object.values(Z).reduce((e,t)=>e+t,0)||0),sub:"all-time",color:"text-cyan-400 border-cyan-500/20",popover:0===Object.keys(Z).length?null:["running","replied","failed","cancelled","expired","closed","created","delivered","acked"].filter(e=>Z[e]).map(e=>({k:e,v:Z[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(Z.failed||0),sub:Z.failed?"needs review":"none",color:Z.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,a.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,a.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,a.jsx)("div",{className:`text-xl font-semibold tabular-nums ${e.color.split(" ")[0]}`,children:e.value}),(0,a.jsx)("div",{className:"hidden sm:block text-[10px] text-gray-600 group-hover:text-gray-400 transition-colors",children:"View →"})]}),(0,a.jsx)("div",{className:"text-[11px] text-gray-400 mt-0.5",children:e.label}),(0,a.jsx)("div",{className:"text-[10px] text-gray-600 mt-px",children:e.sub}),e.popover&&e.popover.length>0&&(0,a.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,a.jsx)("div",{className:"text-[10px] text-gray-600 uppercase tracking-wider mb-1.5",children:"Breakdown"}),(0,a.jsx)("ul",{className:"space-y-1",children:e.popover.map(e=>(0,a.jsxs)("li",{className:"flex items-center gap-2 text-[11px]",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:e.color},"aria-hidden":!0}),(0,a.jsx)("span",{className:"text-gray-400 capitalize",children:e.k}),""!==e.v&&(0,a.jsx)("span",{className:"ml-auto text-gray-300 tabular-nums font-medium",children:e.v})]},e.k))})]})]},e.href)))}),(0,a.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,a.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,a.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:e.icon})}),(0,a.jsx)("span",{children:e.label})]},e.href))}),(0,a.jsx)(i,{}),j.length>0&&(0,a.jsxs)("section",{className:"mb-6 bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:"Recent Activity"}),(0,a.jsx)(r.default,{href:"/tasks",className:"text-xs text-cyan-400 hover:text-cyan-300",children:"All tasks →"})]}),(0,a.jsx)("div",{className:"space-y-2 max-h-40 overflow-y-auto",children:j.slice(0,5).map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,a.jsx)("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${"replied"===e.status?"bg-purple-400":"running"===e.status?"bg-green-400":"failed"===e.status?"bg-red-400":"bg-blue-400"}`}),(0,a.jsx)("span",{className:"text-blue-400 shrink-0",children:e.from_name||"?"}),(0,a.jsx)("span",{className:"text-gray-600",children:"→"}),(0,a.jsx)("span",{className:"text-cyan-400 shrink-0",children:e.to_name||"?"}),(0,a.jsx)("span",{className:"text-gray-500 truncate flex-1",children:e.content?.slice(0,40)||"--"}),(0,a.jsx)("span",{className:`shrink-0 px-1.5 py-0.5 rounded text-[10px] border ${"replied"===e.status?"text-purple-300 border-purple-500/20":"failed"===e.status?"text-red-300 border-red-500/20":"text-gray-500 border-gray-700/30"}`,children:e.status})]},e.task_id))})]}),h&&(0,a.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,a.jsx)("span",{children:String(h)}),(0,a.jsx)("span",{className:"text-gray-500 text-xs",children:"Check CommHub connection"})]}),c.length>0&&(0,a.jsx)("div",{className:"flex justify-center mb-4",children:(0,a.jsx)("button",{onClick:()=>$(!S),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:S?"Hide Topology":"Show Topology"})}),!S&&c.length>0&&(0,a.jsx)("div",{className:"lg:hidden text-center text-xs text-gray-600 mb-4",children:"Topology hidden on mobile for better readability"}),S&&c.length>0&&(0,a.jsx)(f,{sessions:c,sseSessions:D}),0!==c.length||h?(0,a.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",children:ee.map(e=>(0,a.jsx)(p,{session:e,hasSse:J(e),sseCount:G(e)||0,onChat:P.openTab},e.alias))}):(0,a.jsx)(v.NodesEmptyState,{hint:x}),(0,a.jsx)(b,{messages:A}),(0,a.jsxs)("div",{className:"mt-8 text-center text-xs text-gray-600 flex items-center justify-center gap-2 flex-wrap",children:[R&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${H?"bg-green-400":"bg-gray-600"}`}),H?"SSE live":"SWR polling"]}),N?.license&&(0,a.jsxs)(a.Fragment,{children:[R&&(0,a.jsx)(a.Fragment,{children:"·"}),(0,a.jsxs)("span",{className:N.license.days_left<=7?"text-red-400":"pro"===N.license.type?"text-green-400":"text-yellow-400",children:[N.license.type," (",N.license.days_left,"d left)"]})]})]}),z&&(0,a.jsx)(_,{sessions:c,onClose:()=>F(!1)}),P.tabs.length>0&&(0,a.jsx)(C,{tabs:P.tabs,activeTab:P.activeTab,onOpenTab:P.openTab,onCloseTab:P.closeTab,onSetActive:P.setActiveTab,onClose:P.closeAll})]})}],31713)}]);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18566,(e,t,a)=>{t.exports=e.r(76562)},84128,e=>{"use strict";var t=e.i(18050),a=e.i(71645);let s=[{id:"cyber",label:"Cyber",emoji:"🌃",desc:"默认深色"},{id:"light",label:"Light",emoji:"☀️",desc:"浅色简洁"},{id:"mint",label:"Mint",emoji:"🌿",desc:"薄荷绿"},{id:"sunset",label:"Sunset",emoji:"🌅",desc:"暖色橙紫"}],r="anet-theme";function n(e){"u">typeof document&&document.documentElement.setAttribute("data-theme",e)}e.s(["ThemeProvider",0,function({children:e}){return(0,a.useEffect)(()=>{n(localStorage.getItem(r)||"cyber")},[]),(0,t.jsx)(t.Fragment,{children:e})},"ThemeSwitcher",0,function({compact:e=!1}){let[l,i]=(0,a.useState)("cyber"),[o,c]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=localStorage.getItem(r)||"cyber";i(e),n(e)},[]);let d=s.find(e=>e.id===l)||s[0];return(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("button",{"aria-label":"切换主题",onClick:()=>c(!o),className:"px-2.5 py-1.5 rounded-md text-xs flex items-center gap-1.5 hover:opacity-80 transition-opacity",style:{background:"var(--bg-elevated)",color:"var(--fg)",border:"1px solid var(--border)"},children:[(0,t.jsx)("span",{"aria-hidden":!0,children:d.emoji}),!e&&(0,t.jsx)("span",{children:d.label})]}),o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-40",onClick:()=>c(!1)}),(0,t.jsx)("div",{className:"absolute right-0 top-full mt-1 z-50 rounded-md min-w-[160px] py-1 shadow-lg",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:s.map(e=>(0,t.jsxs)("button",{onClick:()=>{var t;i(t=e.id),localStorage.setItem(r,t),n(t),c(!1)},className:"w-full px-3 py-2 text-left text-xs flex items-center gap-2 hover:opacity-80",style:{background:e.id===l?"var(--bg-elevated)":"transparent",color:"var(--fg)"},children:[(0,t.jsx)("span",{"aria-hidden":!0,children:e.emoji}),(0,t.jsx)("span",{className:"flex-1",children:e.label}),(0,t.jsx)("span",{style:{color:"var(--fg-dim)"},className:"text-[10px]",children:e.desc}),e.id===l&&(0,t.jsx)("span",{style:{color:"var(--accent)"},children:"•"})]},e.id))})]})]})}])},25045,e=>{"use strict";var t=e.i(18050),a=e.i(18566),s=e.i(22016),r=e.i(71645),n=e.i(83599),l=e.i(58963),i=e.i(84128);let o=e=>fetch(e).then(e=>e.ok?e.json():{networks:[]}),c=[{href:"/",label:"Overview",icon:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"},{href:"/tasks",label:"Tasks",icon:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"},{href:"/nodes",label:"Nodes",icon:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"},{href:"/messages",label:"Messages",icon:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"},{href:"/settings/networks",label:"Networks",icon:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},{href:"/logs",label:"Audit Log",icon:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},{href:"/server-logs",label:"Server Logs",icon:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"},{href:"/admin",label:"Admin",icon:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"},{href:"/settings",label:"Settings",icon:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z"}],d={owner:"⭐",admin:"🔧",member:"👤",viewer:"👁"};function h(){let e=(0,a.usePathname)(),[h,m]=(0,r.useState)(!1),[u,p]=(0,r.useState)(!1),{networkId:g,setNetworkId:f}=(0,l.useNetworkId)(),{data:b}=(0,n.default)("/api/hub/networks",o,{refreshInterval:15e3,dedupingInterval:1e4}),v=b?.networks||[],j=(0,t.jsx)("nav",{className:"flex flex-col gap-1 px-2 py-4",children:c.map(a=>{var r;return(0,t.jsxs)(s.default,{href:a.href,prefetch:!1,onClick:()=>p(!1),className:`relative flex items-center gap-3 px-3 py-3 rounded-lg text-sm transition-colors active:bg-[#1a1a3a] ${("/"===(r=a.href)?"/"===e:"/settings"===r?"/settings"===e:e.startsWith(r))?"bg-cyan-500/10 text-cyan-300 border border-cyan-500/20 anet-nav-active":"text-gray-400 hover:text-gray-200 hover:bg-[#1a1a2a]"} ${h?"justify-center":""}`,children:[(0,t.jsx)("svg",{className:"w-5 h-5 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:a.icon})}),!h&&(0,t.jsx)("span",{children:a.label})]},a.href)})});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>p(!u),className:"fixed top-4 left-3 z-50 lg:hidden bg-[#111128] border border-[#2a2a4a] rounded-lg p-2.5 text-gray-400 hover:text-white active:bg-[#1a1a3a]","aria-label":"Toggle menu",children:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:u?(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),u&&(0,t.jsx)("div",{className:"fixed inset-0 bg-black/50 z-30 lg:hidden",onClick:()=>p(!1)}),(0,t.jsxs)("aside",{"data-anet-sidebar":"true",className:`
|
|
2
|
-
fixed top-0 left-0 h-full z-40 bg-[#0d0d1a] border-r border-[#2a2a4a]
|
|
3
|
-
transition-all duration-200
|
|
4
|
-
${h?"w-16":"w-52"}
|
|
5
|
-
${u?"translate-x-0":"-translate-x-full"}
|
|
6
|
-
lg:translate-x-0 lg:static lg:shrink-0
|
|
7
|
-
`,children:[(0,t.jsx)(x,{collapsed:h}),(0,t.jsx)("div",{className:"border-b border-[#2a2a4a]"}),!h&&v.length>0&&(0,t.jsxs)("div",{className:"px-2 py-3 border-b border-[#2a2a4a]",children:[(0,t.jsx)("div",{className:"px-3 text-[10px] text-gray-600 uppercase mb-2",children:"Networks"}),(0,t.jsx)("div",{className:"space-y-0.5 max-h-32 overflow-y-auto",children:v.map(e=>(0,t.jsxs)("button",{onClick:()=>{f(e.network_id),p(!1)},className:`w-full flex items-center gap-2 px-3 py-1.5 rounded-md text-xs transition-colors text-left ${g===e.network_id?"bg-cyan-500/10 text-cyan-300":"text-gray-500 hover:text-gray-300 hover:bg-[#1a1a2a]"}`,children:[(0,t.jsx)("span",{children:d[e.role||"member"]||"👤"}),(0,t.jsx)("span",{className:"truncate",children:e.network_name})]},e.network_id))})]}),(0,t.jsx)("div",{className:"pb-20",children:j}),(0,t.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 border-t border-[#2a2a4a] bg-[#0d0d1a]",children:[!h&&(0,t.jsxs)("button",{onClick:async()=>{await fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),sessionStorage.removeItem("anet_v3_auth"),window.location.assign("/login")},className:"w-full flex items-center gap-3 px-5 py-3 text-xs text-gray-500 hover:text-red-400 hover:bg-red-500/5 transition-colors",children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})}),"Sign out"]}),!h&&(0,t.jsxs)("button",{onClick:()=>{window.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,ctrlKey:!0}))},className:"w-full flex items-center justify-between gap-2 px-5 py-2 text-[11px] text-gray-600 hover:text-gray-400 hover:bg-[#1a1a2a] transition-colors","aria-label":"Open command palette",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),"Quick search"]}),(0,t.jsx)("kbd",{className:"text-[10px] border border-current rounded px-1 py-0.5 opacity-60 font-mono",children:"⌘K"})]}),(0,t.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 ${h?"justify-center":"justify-between"}`,children:[(0,t.jsx)(i.ThemeSwitcher,{compact:h}),(0,t.jsx)("button",{onClick:()=>m(!h),className:"hidden lg:flex p-1.5 rounded text-gray-600 hover:text-gray-400 transition-colors","aria-label":h?"Expand sidebar":"Collapse sidebar",children:(0,t.jsx)("svg",{className:`w-4 h-4 transition-transform ${h?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})})})]})]})]})]})}let m=e=>fetch(e).then(e=>e.ok?e.json():{sessions:[]});function x({collapsed:e}){let{data:a}=(0,n.default)("/api/hub/status",m,{refreshInterval:1e4,dedupingInterval:4e3}),r=a?.sessions||[],l=r.filter(e=>e.status&&"offline"!==e.status).length,i=r.length;return e?(0,t.jsx)(s.default,{href:"/",className:"block px-3 py-4 flex justify-center hover:opacity-80 transition-opacity","aria-label":"Agent Network — home",children:(0,t.jsx)(u,{size:32})}):(0,t.jsxs)(s.default,{href:"/",className:"block px-4 py-4 flex items-center gap-3 hover:bg-[#11112a]/40 transition-colors rounded-r-xl","aria-label":"Agent Network — home",children:[(0,t.jsx)(u,{size:32}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-white text-[13px] font-semibold leading-tight",children:"Agent Network"}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-500 flex items-center gap-1.5 mt-0.5",children:[(0,t.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${l>0?"bg-emerald-400 anet-brand-pulse":"bg-gray-600"}`,"aria-hidden":!0}),0===i?(0,t.jsx)("span",{children:"waiting for agents"}):(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"text-gray-300 font-medium tabular-nums",children:l}),(0,t.jsxs)("span",{className:"text-gray-600",children:["/",i]})," online"]})]})]})]})}function u({size:e}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 32 32","aria-hidden":!0,className:"shrink-0",children:[(0,t.jsx)("circle",{cx:"16",cy:"16",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",opacity:"0.2",className:"text-cyan-400"}),(0,t.jsx)("line",{x1:"16",y1:"10",x2:"10",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.45",className:"text-cyan-400"}),(0,t.jsx)("line",{x1:"16",y1:"10",x2:"22",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.45",className:"text-cyan-400"}),(0,t.jsx)("line",{x1:"10",y1:"20",x2:"22",y2:"20",stroke:"currentColor",strokeWidth:"1",opacity:"0.45",className:"text-cyan-400"}),(0,t.jsx)("circle",{cx:"16",cy:"10",r:"2.5",fill:"currentColor",className:"text-cyan-400"}),(0,t.jsx)("circle",{cx:"10",cy:"20",r:"2.5",fill:"currentColor",className:"text-green-400"}),(0,t.jsx)("circle",{cx:"22",cy:"20",r:"2.5",fill:"currentColor",className:"text-violet-400"})]})}let p=async e=>{let t=await fetch(e);if(!t.ok)throw Error(String(t.status));return t.json()};function g(){let e,a,{data:l,error:i}=(0,n.default)("/api/hub/stats",p,{refreshInterval:15e3,dedupingInterval:5e3,shouldRetryOnError:!1}),{data:o,error:c}=(0,n.default)("/api/hub/health",p,{refreshInterval:15e3,dedupingInterval:5e3,shouldRetryOnError:!1}),[d,h]=(0,r.useState)(()=>"1"===sessionStorage.getItem("anet-hb-dismissed"));if(d)return null;let m=i&&c||o&&!1===o.ok,x=l?.tasks?.by_status?.find(e=>"failed"===e.status)?.count||0,u=null;if(m?(e="red",a="CommHub unreachable — agents may be offline",u={label:"Open Settings",href:"/settings"}):x>0?(e="amber",a=`${x} task${x>1?"s":""} failed recently`,u={label:"Review failures",href:"/tasks?status=failed"}):(e="green",a="All systems go",u=null),"green"===e&&!l)return null;let g={red:"bg-red-500/8 border-red-500/25 text-red-300",amber:"bg-amber-500/8 border-amber-500/25 text-amber-300",green:"bg-emerald-500/6 border-emerald-500/20 text-emerald-300"}[e],f={red:"bg-red-400",amber:"bg-amber-400 anet-brand-pulse",green:"bg-emerald-400"}[e];return(0,t.jsxs)("div",{role:"status",className:`anet-health-banner border-b ${g} pl-14 pr-3 sm:px-6 py-1.5 text-[12px] flex items-center justify-between gap-3`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${f}`,"aria-hidden":!0}),(0,t.jsx)("span",{className:"truncate",children:a})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[u&&(0,t.jsxs)(s.default,{href:u.href,className:"text-[11px] font-medium underline-offset-2 hover:underline opacity-90 hover:opacity-100 hidden sm:inline",children:[u.label," →"]}),u&&(0,t.jsx)(s.default,{href:u.href,"aria-label":u.label,className:"sm:hidden text-[11px] font-medium opacity-90 hover:opacity-100",children:"→"}),(0,t.jsx)("button",{onClick:()=>{h(!0);try{sessionStorage.setItem("anet-hb-dismissed","1")}catch{}},"aria-label":"Dismiss banner",className:"opacity-50 hover:opacity-100 leading-none px-1",children:"×"})]})]})}let f="anet-cmdk-recents";function b(){try{let e=sessionStorage.getItem(f);return e?JSON.parse(e):[]}catch{return[]}}function v(e){try{let t=b().filter(t=>t!==e);t.unshift(e),sessionStorage.setItem(f,JSON.stringify(t.slice(0,4)))}catch{}}function j(e,t){if(!t)return{score:0,indices:[]};let a=e.toLowerCase(),s=t.toLowerCase(),r=0,n=0,l=0,i=0,o=[];for(;r<a.length&&n<s.length;)a[r]===s[n]?(l+=2+i,i++,o.push(r),(0===r||/[\s·:_/-]/.test(a[r-1]))&&(l+=4),n++):i=0,r++;return n<s.length?{score:-1,indices:[]}:{score:l-.05*Math.max(0,a.length-s.length),indices:o}}function y({text:e,indices:a}){if(!a.length)return(0,t.jsx)(t.Fragment,{children:e});let s=new Set(a),r=Array.from(e);return(0,t.jsx)(t.Fragment,{children:r.map((e,a)=>s.has(a)?(0,t.jsx)("mark",{className:"anet-cmdk-mark",children:e},a):(0,t.jsx)("span",{children:e},a))})}function k({d:e}){return(0,t.jsx)("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}let w=[{id:"go-overview",title:"Go to Overview",hint:"Fleet at a glance",group:"Navigate",icon:(0,t.jsx)(k,{d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3"}),perform:e=>e.push("/")},{id:"go-tasks",title:"Go to Tasks",hint:"All task statuses",group:"Navigate",icon:(0,t.jsx)(k,{d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"}),perform:e=>e.push("/tasks")},{id:"go-tasks-failed",title:"Go to Failed tasks",hint:"Filter status=failed",group:"Navigate",icon:(0,t.jsx)(k,{d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}),perform:e=>e.push("/tasks?status=failed")},{id:"go-nodes",title:"Go to Nodes",hint:"Agent fleet",group:"Navigate",icon:(0,t.jsx)(k,{d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"}),perform:e=>e.push("/nodes")},{id:"go-messages",title:"Go to Messages",hint:"Inter-agent chat",group:"Navigate",icon:(0,t.jsx)(k,{d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"}),perform:e=>e.push("/messages")},{id:"go-networks",title:"Go to Networks",hint:"Manage networks",group:"Navigate",icon:(0,t.jsx)(k,{d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"}),perform:e=>e.push("/settings/networks")},{id:"go-logs",title:"Go to Audit Log",hint:"Register / login / actions",group:"Navigate",icon:(0,t.jsx)(k,{d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"}),perform:e=>e.push("/logs")},{id:"go-server-logs",title:"Go to Server Logs",hint:"CommHub stdout/stderr",group:"Navigate",icon:(0,t.jsx)(k,{d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"}),perform:e=>e.push("/server-logs")},{id:"go-admin",title:"Go to Admin",hint:"Server overview + broadcast",group:"Navigate",icon:(0,t.jsx)(k,{d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"}),perform:e=>e.push("/admin")},{id:"go-settings",title:"Go to Settings",hint:"Connection / Account / Resources",group:"Navigate",icon:(0,t.jsx)(k,{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),perform:e=>e.push("/settings")},{id:"act-toggle-theme",title:"Toggle theme",hint:"cyber ↔ light",group:"Actions",icon:(0,t.jsx)(k,{d:"M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"}),perform:()=>{let e=document.documentElement.getAttribute("data-theme")||"cyber",t="light"===e||"mint"===e?"cyber":"light";document.documentElement.setAttribute("data-theme",t);try{localStorage.setItem("anet-theme",t)}catch{}}},{id:"act-copy-url",title:"Copy current URL",hint:"page link to clipboard",group:"Actions",icon:(0,t.jsx)(k,{d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"}),perform:()=>{try{navigator.clipboard.writeText(window.location.href)}catch{}}},{id:"act-sign-out",title:"Sign out",hint:"clear session",group:"Actions",icon:(0,t.jsx)(k,{d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"}),perform:()=>{fetch("/api/auth/logout",{method:"POST"}).catch(()=>{});try{sessionStorage.removeItem("anet_v3_auth")}catch{}window.location.assign("/login")}},{id:"act-help",title:"Show keyboard shortcuts",hint:"press ? — works on mobile too",group:"Actions",icon:(0,t.jsx)(k,{d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),perform:()=>{window.dispatchEvent(new KeyboardEvent("keydown",{key:"?"}))}}];function N(){let e=(0,a.useRouter)(),[s,n]=(0,r.useState)(!1),[l,i]=(0,r.useState)(""),[o,c]=(0,r.useState)(0),d=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=e=>{if((e.metaKey||e.ctrlKey)&&"k"===e.key.toLowerCase()){e.preventDefault(),n(e=>!e);return}if("/"===e.key&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA"&&!s){e.preventDefault(),n(!0);return}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[s]),(0,r.useEffect)(()=>{s&&(i(""),c(0),setTimeout(()=>d.current?.focus(),50))},[s]);let[h,m]=(0,r.useState)([]);(0,r.useEffect)(()=>{s&&m(b())},[s]);let[x,u]=(0,r.useState)([]);(0,r.useEffect)(()=>{if(!s)return;let e=!1;return(async()=>{try{let[a,s]=await Promise.all([fetch("/api/hub/status").then(e=>e.ok?e.json():{sessions:[]}),fetch("/api/hub/tasks?limit=20").then(e=>e.ok?e.json():{tasks:[]})]);if(e)return;let r=(a.sessions||[]).filter(e=>e.alias).slice(0,20).map(e=>({id:`agent-${e.alias}`,title:`Go to agent ${e.alias}`,hint:`${e.agent||"agent"} \xb7 ${e.status||"unknown"}`,group:"Agents",icon:(0,t.jsx)(k,{d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"}),perform:t=>t.push(`/node?alias=${encodeURIComponent(e.alias)}`)})),n=(s.tasks||[]).filter(e=>e.task_id).slice(0,15).map(e=>({id:`task-${e.task_id}`,title:`Open task: ${(e.content||e.task_id||"").slice(0,50)}`,hint:`${e.from_name||"?"} → ${e.to_name||"?"} \xb7 ${e.status||""}`,group:"Tasks",icon:(0,t.jsx)(k,{d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"}),perform:t=>t.push(`/tasks/${encodeURIComponent(e.task_id)}`)}));u([...r,...n])}catch{}})(),()=>{e=!0}},[s]);let p=(0,r.useMemo)(()=>{let e=[...w,...x];if(!l.trim()){let t=h.map(t=>e.find(e=>e.id===t)).filter(e=>!!e).map(e=>({...e,group:"Recents"})),a=new Set(h);return[...t,...w.filter(e=>!a.has(e.id))]}let t=e.map(e=>{let t=j(e.title,l),a=e.hint?j(e.hint,l):{score:-1,indices:[]},s=j(e.id,l);return{c:e,score:Math.max(t.score>=0?+t.score:-1/0,a.score>=0?.6*a.score:-1/0,s.score>=0?.3*s.score:-1/0),_titleHi:t.score>=0?t.indices:[],_hintHi:a.score>=0?a.indices:[]}}).filter(e=>e.score>-1/0);return t.sort((e,t)=>t.score-e.score),t.map(e=>({...e.c,_titleHi:e._titleHi,_hintHi:e._hintHi}))},[l,h,x]);if((0,r.useEffect)(()=>{o>=p.length&&c(0)},[p.length,o]),!s)return null;let g={};for(let e of p)(g[e.group]||=[]).push(e);let f=0;return(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Command palette",className:"anet-cmdk fixed inset-0 z-[100] flex items-start justify-center pt-[10vh] sm:pt-[15vh] px-4",onClick:()=>n(!1),onKeyDown:t=>{if("Escape"===t.key)return void n(!1);if("ArrowDown"===t.key){t.preventDefault(),c(e=>Math.min(e+1,p.length-1));return}if("ArrowUp"===t.key){t.preventDefault(),c(e=>Math.max(e-1,0));return}if("Enter"===t.key){t.preventDefault();let a=p[o];a&&(v(a.id),a.perform(e),n(!1))}},children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm","aria-hidden":!0}),(0,t.jsxs)("div",{className:"relative w-full max-w-xl rounded-xl border border-[#2a2a4a] bg-[#0d0d1a] shadow-2xl shadow-black/40 overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-[#2a2a4a] px-3 py-2.5",children:[(0,t.jsx)("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",className:"text-gray-500 shrink-0",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),(0,t.jsx)("input",{ref:d,value:l,onChange:e=>{i(e.target.value),c(0)},placeholder:"Type a command or search…",className:"flex-1 bg-transparent text-sm text-gray-200 placeholder-gray-600 focus:outline-none"}),(0,t.jsx)("kbd",{className:"text-[10px] text-gray-600 border border-[#2a2a4a] rounded px-1.5 py-0.5 font-mono",children:"esc"})]}),(0,t.jsx)("div",{className:"max-h-[60vh] overflow-y-auto py-2",children:0===p.length?(0,t.jsxs)("div",{className:"px-4 py-8 text-center text-xs text-gray-600",children:['No commands match "',l,'"']}):Object.entries(g).map(([a,s])=>(0,t.jsxs)("div",{className:"mb-2 last:mb-0",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-[0.12em] text-gray-600 px-3 py-1",children:a}),s.map(a=>{let s=f++,r=s===o;return(0,t.jsxs)("button",{onMouseEnter:()=>c(s),onClick:()=>{v(a.id),a.perform(e),n(!1)},className:`anet-cmdk-row w-full flex items-center gap-3 px-3 py-2 text-left text-sm ${r?"bg-cyan-500/10 text-cyan-300":"text-gray-300 hover:bg-[#1a1a2a]/50"}`,children:[(0,t.jsx)("span",{className:r?"text-cyan-400":"text-gray-500",children:a.icon}),(0,t.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"block truncate",children:(0,t.jsx)(y,{text:a.title,indices:a._titleHi||[]})}),a.hint&&(0,t.jsx)("span",{className:"block text-[11px] text-gray-600 truncate",children:(0,t.jsx)(y,{text:a.hint,indices:a._hintHi||[]})})]}),r&&(0,t.jsx)("span",{className:"text-[10px] text-gray-500",children:"↵"})]},a.id)})]},a))}),(0,t.jsxs)("div",{className:"border-t border-[#2a2a4a] px-3 py-1.5 flex items-center justify-between text-[10px] text-gray-600",children:[(0,t.jsxs)("span",{className:"flex items-center gap-3",children:[(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"font-mono",children:"↑↓"})," navigate"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"font-mono",children:"↵"})," select"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"font-mono",children:"esc"})," close"]})]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"font-mono",children:"⌘K"})," toggle"]})]})]})]})}let M=[{group:"Global",items:[{keys:["⌘","K"],label:"Open command palette (also Ctrl+K)"},{keys:["/"],label:"Open command palette"},{keys:["?"],label:"Toggle this help overlay"},{keys:["Esc"],label:"Close any open modal"}]},{group:"Command palette",items:[{keys:["↑","↓"],label:"Move selection"},{keys:["↵"],label:"Activate selected command"},{keys:["type"],label:"Filter — searches commands, agents, tasks"}]},{group:"Pages",items:[{keys:["click","sidebar logo"],label:"Back to Overview"},{keys:["Cmd+K","Go to agent X"],label:"Jump straight to a node"}]}];function C(){let[e,a]=(0,r.useState)(!1);return((0,r.useEffect)(()=>{let t=t=>{if("?"===t.key&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA"){t.preventDefault(),a(e=>!e);return}"Escape"===t.key&&e&&a(!1)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]),e)?(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",className:"anet-help fixed inset-0 z-[101] flex items-center justify-center px-4",onClick:()=>a(!1),children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm","aria-hidden":!0}),(0,t.jsxs)("div",{className:"relative w-full max-w-md rounded-xl border border-[#2a2a4a] bg-[#0d0d1a] shadow-2xl shadow-black/40 overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-[#2a2a4a] px-4 py-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-gray-200",children:[(0,t.jsx)("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5",className:"text-gray-500",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Keyboard shortcuts"]}),(0,t.jsx)("button",{onClick:()=>a(!1),"aria-label":"Close help",className:"text-gray-500 hover:text-gray-300 text-lg leading-none px-1",children:"×"})]}),(0,t.jsx)("div",{className:"px-4 py-3 max-h-[70vh] overflow-y-auto",children:M.map(e=>(0,t.jsxs)("div",{className:"mb-3 last:mb-0",children:[(0,t.jsx)("div",{className:"text-[10px] uppercase tracking-[0.12em] text-gray-600 mb-1.5",children:e.group}),(0,t.jsx)("ul",{className:"space-y-1.5",children:e.items.map((e,a)=>(0,t.jsxs)("li",{className:"flex items-center gap-3 text-xs",children:[(0,t.jsx)("span",{className:"flex items-center gap-1",children:e.keys.map((e,a)=>(0,t.jsx)("kbd",{className:"text-[10px] font-mono border border-[#2a2a4a] rounded px-1.5 py-0.5 text-gray-400 bg-[#1a1a2a]/40",children:e},a))}),(0,t.jsx)("span",{className:"text-gray-400 flex-1",children:e.label})]},a))})]},e.group))}),(0,t.jsxs)("div",{className:"border-t border-[#2a2a4a] px-4 py-1.5 text-[10px] text-gray-600 flex items-center justify-between",children:[(0,t.jsxs)("span",{children:["Press ",(0,t.jsx)("kbd",{className:"font-mono",children:"?"})," to toggle"]}),(0,t.jsxs)("span",{children:["or ",(0,t.jsx)("kbd",{className:"font-mono",children:"esc"})," to close"]})]})]})]}):null}let S=["/login"];e.s(["AppShell",0,function({children:e}){let s=(0,a.usePathname)();return S.includes(s)?(0,t.jsx)(t.Fragment,{children:e}):(0,t.jsxs)("div",{className:"flex min-h-screen",children:[(0,t.jsx)(h,{}),(0,t.jsxs)("main",{className:"flex-1 min-w-0 flex flex-col",children:[(0,t.jsx)(g,{}),(0,t.jsx)("div",{className:"flex-1 min-w-0",children:e})]}),(0,t.jsx)(N,{}),(0,t.jsx)(C,{})]})}],25045)}]);
|
|
@@ -1 +0,0 @@
|
|
|
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"};e.s(["default",0,function(){let e,[n,i]=(0,r.useState)([]),[c,d]=(0,r.useState)(null),[o,x]=(0,r.useState)(!1),[m,u]=(0,r.useState)("all"),[h,b]=(0,r.useState)(""),[g,p]=(0,r.useState)(!0),f=(0,r.useRef)(""),y=(0,r.useCallback)(async(e=!1)=>{try{let t=new URLSearchParams({limit:"500"});!e&&f.current&&t.set("since",f.current);let r=await fetch(`/api/hub/server-logs?${t.toString()}`),a=await r.json();if(!r.ok||!a.ok)return void d(a.error||`HTTP ${r.status}`);d(null);let s=a.logs||[];if(0===s.length)return;f.current=s[0].ts,e?i(s):i(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){d(e instanceof Error?e.message:"fetch failed")}},[]);(0,r.useEffect)(()=>{y(!0)},[y]),(0,r.useEffect)(()=>{if(!g||o)return;let e=setInterval(()=>y(!1),2e3);return()=>clearInterval(e)},[g,o,y]);let v=n.filter(e=>("all"===m||e.level===m)&&(!h||!!e.line.toLowerCase().includes(h.toLowerCase()))),j={log:0,info:0,warn:0,error:0};for(let e of n)j[e.level]++;return(0,t.jsxs)("div",{className:"p-6 max-w-[1600px] mx-auto",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between mb-4",children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-3",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",children:"CommHub stdout/stderr · 最新在上"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)("button",{onClick:()=>x(e=>!e),className:`px-3 py-1 rounded border ${o?"bg-amber-500/10 text-amber-300 border-amber-500/30":"bg-cyan-500/10 text-cyan-300 border-cyan-500/30"}`,children:o?"▶ Resume":"⏸ Pause"}),(0,t.jsxs)("label",{className:"flex items-center gap-1 text-gray-400 select-none",children:[(0,t.jsx)("input",{type:"checkbox",checked:g,onChange:e=>p(e.target.checked),className:"accent-cyan-500"}),"auto-refresh"]}),(0,t.jsx)("button",{onClick:()=>y(!0),className:"px-3 py-1 rounded border bg-gray-500/10 text-gray-300 border-gray-500/20 hover:bg-gray-500/20",children:"↻ Reload"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsx)("div",{className:"flex items-center gap-1 text-xs",children:["all","log","info","warn","error"].map(e=>(0,t.jsxs)("button",{onClick:()=>u(e),className:`px-2.5 py-1 rounded border ${m===e?"bg-cyan-500/15 text-cyan-200 border-cyan-500/40":"bg-[#11111c] text-gray-400 border-[#2a2a4a] hover:bg-[#1a1a2a]"}`,children:[e,"all"!==e&&j[e]>0?` (${j[e]})`:""]},e))}),(0,t.jsx)("input",{value:h,onChange:e=>b(e.target.value),placeholder:"搜索关键字 (alias / task_id / error message)",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"}),(0,t.jsxs)("span",{className:"text-[10px] text-gray-600",children:[v.length," / ",n.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===n.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:"px-3 py-1 hover:bg-[#0a0a14] flex gap-3",children:[(0,t.jsx)("span",{className:"text-gray-600 shrink-0 w-[110px] text-[10px]",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:e.line})]},`${e.ts}-${r}`))})})]})}])}]);
|
|
@@ -1 +0,0 @@
|
|
|
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}}])},32545,e=>{"use strict";var s=e.i(18050),a=e.i(71645),t=e.i(22016),r=e.i(65822);e.s(["default",0,function(){let{config:e}=(0,r.useAnetConfig)(),{health:n}=(0,r.useHealth)(),{license:l}=(0,r.useLicense)(),[i,c]=(0,a.useState)(""),[d,o]=(0,a.useState)(""),[x,m]=(0,a.useState)(""),[h,u]=(0,a.useState)(""),[g,p]=(0,a.useState)(""),N="flex flex-col gap-1 sm:flex-row sm:items-start sm:justify-between",b="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-6 lg:ml-0 ml-10",children:"Settings"}),(0,s.jsxs)("div",{className:"max-w-2xl space-y-8",children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{className:"text-[10px] uppercase tracking-[0.12em] text-gray-600 px-1",children:"Connection"}),(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:N,children:[(0,s.jsx)("span",{className:"text-gray-500 shrink-0",children:"Hub URL"}),(0,s.jsx)("span",{className:`text-cyan-300 ${b}`,children:e?.hub||"not configured"})]}),(0,s.jsxs)("div",{className:N,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Config Source"}),(0,s.jsx)("span",{className:`text-gray-300 ${b}`,children:e?.source==="file"?"Local file (~/.anet/config.json)":e?.source==="runtime-env"?"Vercel env vars":"Missing"})]}),(0,s.jsxs)("div",{className:N,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"} ${b}`,children:e?.tokenConfigured?`Configured (${e.tokenPreview})`:"Not configured"})]}),(0,s.jsxs)("div",{className:N,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Server Auth"}),(0,s.jsx)("span",{className:`${n?.auth==="enabled"?"text-green-400":"text-yellow-400"} sm:text-right`,children:n?.auth||"--"})]}),e?.error&&(0,s.jsx)("div",{className:"border-t border-[#2a2a4a] pt-3 text-xs text-gray-600",children:e.error})]})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Server Info"}),(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,s.jsxs)("div",{className:N,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,s.jsx)("span",{className:`text-gray-300 ${b}`,children:n?.version||"--"})]}),(0,s.jsxs)("div",{className:N,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Sessions"}),(0,s.jsx)("span",{className:`text-gray-300 ${b}`,children:n?.sessions??"--"})]}),(0,s.jsxs)("div",{className:N,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"SSE Connections"}),(0,s.jsx)("span",{className:`text-gray-300 ${b}`,children:n?.sse_connections??"--"})]}),(0,s.jsxs)("div",{className:N,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Uptime"}),(0,s.jsx)("span",{className:`text-gray-300 ${b}`,children:n?.uptime?`${Math.floor(n.uptime/3600)}h ${Math.floor(n.uptime%3600/60)}m`:"--"})]})]})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Dashboard"}),(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,s.jsxs)("div",{className:N,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Version"}),(0,s.jsx)("span",{className:`text-gray-300 ${b}`,children:"V2.1"})]}),(0,s.jsxs)("div",{className:N,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Data Layer"}),(0,s.jsx)("span",{className:`text-gray-300 ${b}`,children:"SWR (5s refresh, 3s dedup)"})]}),(0,s.jsxs)("div",{className:N,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Pages"}),(0,s.jsx)("span",{className:`text-gray-300 ${b}`,children:"Overview, Tasks, Nodes, Messages, Settings"})]})]})]})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{className:"text-[10px] uppercase tracking-[0.12em] text-gray-600 px-1",children:"Account"}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsxs)("h2",{className:"text-sm font-semibold text-gray-300 mb-4 flex items-center gap-2",children:["License",l?.license&&(0,s.jsxs)("span",{className:`inline-flex items-center gap-1.5 text-[10px] font-medium px-2 py-0.5 rounded-full border ${"pro"===l.license.type?"text-green-300 bg-green-500/10 border-green-500/30":l.license.days_left<=7?"text-red-300 bg-red-500/10 border-red-500/30":"text-amber-300 bg-amber-500/10 border-amber-500/30"}`,children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"w-1.5 h-1.5 rounded-full bg-current"}),l.license.type,l.license.days_left?` \xb7 ${l.license.days_left}d left`:""]})]}),l?.license?(0,s.jsxs)("div",{className:"space-y-3 text-sm",children:[l.license.days_left<=7&&(0,s.jsxs)("div",{className:N,children:[(0,s.jsx)("span",{className:"text-red-400 font-medium",children:"⚠ Expiring soon"}),(0,s.jsxs)("span",{className:"text-red-400",children:[l.license.days_left," days left"]})]}),(0,s.jsxs)("div",{className:N,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Expires"}),(0,s.jsx)("span",{className:`text-gray-300 ${b}`,children:l.license.expires_at})]}),l.limits&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:N,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Max Agents"}),(0,s.jsx)("span",{className:`text-gray-300 ${b}`,children:l.limits.max_agents})]}),(0,s.jsxs)("div",{className:N,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Max Networks"}),(0,s.jsx)("span",{className:`text-gray-300 ${b}`,children:l.limits.max_networks})]}),(0,s.jsxs)("div",{className:N,children:[(0,s.jsx)("span",{className:"text-gray-500",children:"Tasks/Day"}),(0,s.jsx)("span",{className:`text-gray-300 ${b}`,children:l.limits.max_tasks_day})]})]}),(0,s.jsxs)("div",{className:"pt-3 border-t border-[#2a2a4a]",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"text",value:i,onChange:e=>c(e.target.value),placeholder:"anet-XXXX-XXXX-XXXX-XXXX",className:"flex-1 bg-[#0a0a15] border border-[#2a2a4a] rounded px-3 py-2 text-xs text-white placeholder-gray-600 focus:outline-none"}),(0,s.jsx)("button",{onClick:async()=>{if(!i.trim())return;let e=await fetch("/api/hub/license",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:i})}),s=await e.json();o(s.ok?`Activated: ${s.type}`:`Failed: ${s.error}`),s.ok&&c(""),setTimeout(()=>o(""),5e3)},className:"px-3 py-2 bg-cyan-600 hover:bg-cyan-500 text-white text-xs rounded transition-colors",children:"Activate"})]}),d&&(0,s.jsx)("div",{className:`mt-2 text-xs ${d.startsWith("Failed")?"text-red-400":"text-green-400"}`,children:d})]})]}):(0,s.jsx)("div",{className:"text-xs text-gray-600",children:"License info not available"})]}),(0,s.jsxs)("section",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-5",children:[(0,s.jsx)("h2",{className:"text-sm font-semibold text-gray-300 mb-4",children:"Change Password"}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("input",{type:"password",value:x,onChange:e=>m(e.target.value),placeholder:"Current password",className:"w-full bg-[#0a0a15] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-cyan-500/50 focus:outline-none"}),(0,s.jsx)("input",{type:"password",value:h,onChange:e=>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(!x||!h)return;let e=sessionStorage.getItem("anet_v3_auth");if(!e)return void p("Not logged in with V3 auth");let{token:s}=JSON.parse(e),a=await fetch("/api/hub/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"change_password",token:s,current_password:x,new_password:h})}),t=await a.json();if(p(t.ok?"Password changed":`Failed: ${t.error}`),t.ok){if(t.token){let s=JSON.parse(e);sessionStorage.setItem("anet_v3_auth",JSON.stringify({...s,token:t.token}))}m(""),u("")}setTimeout(()=>p(""),5e3)},disabled:!x||!h,className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-500 disabled:bg-gray-800 disabled:text-gray-600 text-white text-sm rounded-lg transition-colors",children:"Change Password"})]}),g&&(0,s.jsx)("div",{className:`mt-2 text-xs ${g.startsWith("Failed")?"text-red-400":"text-green-400"}`,children:g})]}),(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",{className:"space-y-4",children:[(0,s.jsx)("div",{className:"text-[10px] uppercase tracking-[0.12em] text-gray-600 px-1",children:"Resources"}),(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 →"})]})]})]})]})]})}])}]);
|
|
File without changes
|
/package/.next/static/{dvKGMaUCm52sSTROKhYVL → t8ckUU0UVyOpv2ymrRHll}/_clientMiddlewareManifest.js
RENAMED
|
File without changes
|
|
File without changes
|