@sleep2agi/agent-network-dashboard 0.4.5-preview.24 → 0.4.5-preview.26
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 +6 -6
- 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.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/admin.html +1 -1
- package/.next/server/app/admin.rsc +1 -1
- package/.next/server/app/admin.segments/_full.segment.rsc +1 -1
- package/.next/server/app/admin.segments/_head.segment.rsc +1 -1
- package/.next/server/app/admin.segments/_index.segment.rsc +1 -1
- package/.next/server/app/admin.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/admin.segments/admin/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/admin.segments/admin.segment.rsc +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +1 -1
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +1 -1
- package/.next/server/app/login.segments/_full.segment.rsc +1 -1
- package/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/server/app/login.segments/_index.segment.rsc +1 -1
- package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/.next/server/app/logs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/logs.html +2 -2
- package/.next/server/app/logs.rsc +2 -2
- package/.next/server/app/logs.segments/_full.segment.rsc +2 -2
- package/.next/server/app/logs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/logs.segments/_index.segment.rsc +1 -1
- package/.next/server/app/logs.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/logs.segments/logs/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/logs.segments/logs.segment.rsc +1 -1
- package/.next/server/app/messages/page_client-reference-manifest.js +1 -1
- package/.next/server/app/messages.html +2 -2
- package/.next/server/app/messages.rsc +2 -2
- package/.next/server/app/messages.segments/_full.segment.rsc +2 -2
- package/.next/server/app/messages.segments/_head.segment.rsc +1 -1
- package/.next/server/app/messages.segments/_index.segment.rsc +1 -1
- package/.next/server/app/messages.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/messages.segments/messages/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/messages.segments/messages.segment.rsc +1 -1
- package/.next/server/app/node.html +1 -1
- package/.next/server/app/node.rsc +1 -1
- package/.next/server/app/node.segments/_full.segment.rsc +1 -1
- package/.next/server/app/node.segments/_head.segment.rsc +1 -1
- package/.next/server/app/node.segments/_index.segment.rsc +1 -1
- package/.next/server/app/node.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/node.segments/node/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/node.segments/node.segment.rsc +1 -1
- package/.next/server/app/nodes.html +1 -1
- package/.next/server/app/nodes.rsc +1 -1
- package/.next/server/app/nodes.segments/_full.segment.rsc +1 -1
- package/.next/server/app/nodes.segments/_head.segment.rsc +1 -1
- package/.next/server/app/nodes.segments/_index.segment.rsc +1 -1
- package/.next/server/app/nodes.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/nodes.segments/nodes/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/nodes.segments/nodes.segment.rsc +1 -1
- package/.next/server/app/server-logs.html +1 -1
- package/.next/server/app/server-logs.rsc +1 -1
- package/.next/server/app/server-logs.segments/_full.segment.rsc +1 -1
- package/.next/server/app/server-logs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/server-logs.segments/_index.segment.rsc +1 -1
- package/.next/server/app/server-logs.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/server-logs.segments/server-logs/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/server-logs.segments/server-logs.segment.rsc +1 -1
- package/.next/server/app/settings/networks.html +1 -1
- package/.next/server/app/settings/networks.rsc +1 -1
- package/.next/server/app/settings/networks.segments/_full.segment.rsc +1 -1
- package/.next/server/app/settings/networks.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings/networks.segments/_index.segment.rsc +1 -1
- package/.next/server/app/settings/networks.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/settings/networks.segments/settings/networks/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/settings/networks.segments/settings/networks.segment.rsc +1 -1
- package/.next/server/app/settings/networks.segments/settings.segment.rsc +1 -1
- package/.next/server/app/settings/tokens.html +1 -1
- package/.next/server/app/settings/tokens.rsc +1 -1
- package/.next/server/app/settings/tokens.segments/_full.segment.rsc +1 -1
- package/.next/server/app/settings/tokens.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings/tokens.segments/_index.segment.rsc +1 -1
- package/.next/server/app/settings/tokens.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/settings/tokens.segments/settings/tokens/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/settings/tokens.segments/settings/tokens.segment.rsc +1 -1
- package/.next/server/app/settings/tokens.segments/settings.segment.rsc +1 -1
- package/.next/server/app/settings.html +1 -1
- package/.next/server/app/settings.rsc +1 -1
- package/.next/server/app/settings.segments/_full.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_index.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
- package/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tasks.html +2 -2
- package/.next/server/app/tasks.rsc +2 -2
- package/.next/server/app/tasks.segments/_full.segment.rsc +2 -2
- package/.next/server/app/tasks.segments/_head.segment.rsc +1 -1
- package/.next/server/app/tasks.segments/_index.segment.rsc +1 -1
- package/.next/server/app/tasks.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/tasks.segments/tasks/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/tasks.segments/tasks.segment.rsc +1 -1
- package/.next/server/chunks/ssr/app_0.zbtn5._.js +1 -1
- package/.next/server/chunks/ssr/app_0.zbtn5._.js.map +1 -1
- package/.next/server/chunks/ssr/app_0_agk0r._.js +1 -1
- package/.next/server/chunks/ssr/app_0_agk0r._.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 +1 -1
- 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/{169v~dd1tdxdm.js → 05q0hb5.1ust6.js} +2 -2
- package/.next/static/chunks/{10-ka4k4ni9u2.js → 0w2qookzji.jr.js} +1 -1
- package/.next/static/chunks/14r_.uh5d2r_e.js +1 -0
- package/.next/trace +2 -2
- package/.next/trace-build +1 -1
- package/app/components/TaskDrawer.tsx +10 -5
- package/app/logs/page.tsx +6 -4
- package/app/messages/page.tsx +6 -3
- package/package.json +1 -1
- package/.next/static/chunks/0eajktwdxy7qt.js +0 -1
- /package/.next/static/{RDAJRcyAgDTmWYawG6reI → -QuV308VJodU6OydFIUaR}/_buildManifest.js +0 -0
- /package/.next/static/{RDAJRcyAgDTmWYawG6reI → -QuV308VJodU6OydFIUaR}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{RDAJRcyAgDTmWYawG6reI → -QuV308VJodU6OydFIUaR}/_ssgManifest.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18150,e=>{"use strict";e.s(["formatUptime",0,function(e){let t=Math.floor(e/3600),s=Math.floor(e%3600/60);return t>0?`${t}h ${s}m`:`${s}m`},"timeAgo",0,function(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}])},69874,e=>{"use strict";var t=e.i(18050);let s=[180,200,220,270,300,330,30,90];e.s(["AliasAvatar",0,function({alias:e,size:a=28,className:r=""}){let n=function(e){let t=0;for(let s=0;s<e.length;s++)t=31*t+e.charCodeAt(s)>>>0;let a=s[t%s.length];return{bg:`hsl(${a} 55% 22%)`,ring:`hsl(${a} 60% 45%)`,text:`hsl(${a} 80% 78%)`}}(e),l=Math.max(9,Math.round(.42*a));return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${r}`,style:{width:a,height:a,fontSize:l,backgroundColor:n.bg,borderColor:n.ring,color:n.text},title:e,"aria-hidden":!0,children:e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"})}])},95356,e=>{"use strict";var t=e.i(18050),s=e.i(22016);let a={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function r({variant:e,size:s}){let a={width:s,height:s},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",...a,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",...a,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",...a,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",...a,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",...a,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",...a,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",...a,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:l,sub:i,cta:o,compact:c=!1}){let x=a[e],d=l??x.title,h=i??x.sub;return(0,t.jsxs)("div",{className:`text-center ${c?"py-8":"py-16"} px-4`,role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)(r,{variant:e,size:c?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${c?"text-sm":"text-base"}`,children:d}),h&&(0,t.jsx)("p",{className:`text-gray-500 ${c?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:h}),o&&(0,t.jsx)("div",{className:"mt-4",children:o.href?(0,t.jsxs)(s.default,{href:o.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,t.jsxs)("button",{onClick:o.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}e.s(["EmptyState",0,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"}})}])},65822,e=>{"use strict";var t=e.i(83599),s=e.i(58963);let a=async e=>{let t=await fetch(e);if(401===t.status)throw window.location.assign("/login"),Error("unauthorized");return t.json()},r={refreshInterval:5e3,dedupingInterval:3e3};function n(e,t){if(!t)return e;let s=e.includes("?")?"&":"?";return`${e}${s}network_id=${encodeURIComponent(t)}`}e.s(["useAnetConfig",0,function(){let{data:e}=(0,t.default)("/api/anet/config",a,{refreshInterval:3e4});return{config:e||null}},"useHealth",0,function(){let{data:e,error:s}=(0,t.default)("/api/hub/health",a,r);return{health:e||null,error:s}},"useLicense",0,function(){let{data:e,error:s}=(0,t.default)("/api/hub/license",a,{refreshInterval:6e4});return{license:e?.ok?e:null,error:s}},"useMessages",0,function(e=100){let{networkId:l}=(0,s.useNetworkId)(),{data:i,error:o,isLoading:c}=(0,t.default)(n(`/api/hub/messages?limit=${e}`,l),a,r);return{messages:i?.messages||[],error:o,isLoading:c}},"useSessions",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:l,error:i,isLoading:o}=(0,t.default)(n("/api/hub/status",e),a,r);return{sessions:l?.sessions||[],hint:l?._hint,error:i,isLoading:o}},"useStats",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:l,error:i}=(0,t.default)(n("/api/hub/stats",e),a,r);return{stats:l?.ok?l:null,error:i}},"useTasks",0,function(e){let{networkId:l}=(0,s.useNetworkId)(),i=new URLSearchParams({limit:"100",...e}).toString(),{data:o,error:c,isLoading:x}=(0,t.default)(n(`/api/hub/tasks?${i}`,l),a,r);return{tasks:o?.tasks||[],count:o?.count??0,source:o?.source,error:c,isLoading:x}}])},82756,e=>{"use strict";var t=e.i(18050),s=e.i(71645),a=e.i(65822),r=e.i(18150),n=e.i(95356),l=e.i(69874);let i={task:"bg-green-500/10 text-green-300 border-green-500/20",message:"bg-blue-500/10 text-blue-300 border-blue-500/20",broadcast:"bg-purple-500/10 text-purple-300 border-purple-500/20",reply:"bg-cyan-500/10 text-cyan-300 border-cyan-500/20"};function o(e){return e?new Date(e.replace(" ","T")+"Z").getTime():0}function c(e){return"broadcast"===e.type?"broadcast":"dashboard"===(e.from_alias||"").toLowerCase()?"outgoing":"incoming"}function x(e,s){let a=e||"--",r=s.trim();if(!r||r.startsWith("from:"))return a;let n=a.toLowerCase().indexOf(r.toLowerCase());return n<0?a:(0,t.jsxs)(t.Fragment,{children:[a.slice(0,n),(0,t.jsx)("mark",{className:"bg-yellow-500/30 text-yellow-200 rounded px-0.5",children:a.slice(n,n+r.length)}),a.slice(n+r.length)]})}e.s(["default",0,function(){let{messages:e,isLoading:d}=(0,a.useMessages)(200),[h,m]=(0,s.useState)(""),[u,p]=(0,s.useState)(""),[g,y]=(0,s.useState)(!1),[b,j]=(0,s.useState)("timeline"),f=(0,s.useMemo)(()=>{let t=new Set;return e.forEach(e=>{let s=e.from_alias?.trim();s&&"dashboard"!==s.toLowerCase()&&t.add(s)}),[...t].slice(0,8)},[e]),v=(0,s.useMemo)(()=>{let t=u.trim().toLowerCase(),s=t.startsWith("from:")?t.slice(5).trim():"";return[...e].filter(e=>(!h||e.type===h)&&(s?(e.from_alias||"").toLowerCase().includes(s):!t||(e.from_alias||"").toLowerCase().includes(t)||(e.to_alias||"").toLowerCase().includes(t)||(e.content||"").toLowerCase().includes(t))).sort((e,t)=>o(e.created_at)-o(t.created_at))},[h,e,u]),w=(0,s.useMemo)(()=>{let e=new Map;return v.forEach(t=>{let s=t.from_alias||"?",a=t.to_alias||"?",r=[s,a].sort().join("↔"),n=e.get(r)||{participants:[s,a].sort(),messages:[],lastTime:0};n.messages.push(t),n.lastTime=Math.max(n.lastTime,o(t.created_at)),e.set(r,n)}),[...e.values()].sort((e,t)=>t.lastTime-e.lastTime)},[v]);return(0,t.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-white lg:ml-0 ml-10",children:"Messages"}),(0,t.jsx)("span",{className:"text-xs bg-blue-900/30 text-blue-400 px-2 py-0.5 rounded-full border border-blue-800/30",children:e.length}),v.length>0&&(0,t.jsx)("button",{onClick:()=>{let e=v.map(e=>`**${e.from_alias||"?"}** → ${e.to_alias||"?"} (${e.type||"?"}) — ${e.created_at||""}
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18150,e=>{"use strict";e.s(["formatUptime",0,function(e){let t=Math.floor(e/3600),s=Math.floor(e%3600/60);return t>0?`${t}h ${s}m`:`${s}m`},"timeAgo",0,function(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}])},69874,e=>{"use strict";var t=e.i(18050);let s=[180,200,220,270,300,330,30,90];e.s(["AliasAvatar",0,function({alias:e,size:a=28,className:r=""}){let n=function(e){let t=0;for(let s=0;s<e.length;s++)t=31*t+e.charCodeAt(s)>>>0;let a=s[t%s.length];return{bg:`hsl(${a} 55% 22%)`,ring:`hsl(${a} 60% 45%)`,text:`hsl(${a} 80% 78%)`}}(e),l=Math.max(9,Math.round(.42*a));return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${r}`,style:{width:a,height:a,fontSize:l,backgroundColor:n.bg,borderColor:n.ring,color:n.text},title:e,"aria-hidden":!0,children:e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"})}])},95356,e=>{"use strict";var t=e.i(18050),s=e.i(22016);let a={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function r({variant:e,size:s}){let a={width:s,height:s},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",...a,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",...a,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",...a,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",...a,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",...a,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",...a,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",...a,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:l,sub:i,cta:o,compact:c=!1}){let x=a[e],d=l??x.title,m=i??x.sub;return(0,t.jsxs)("div",{className:`text-center ${c?"py-8":"py-16"} px-4`,role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)(r,{variant:e,size:c?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${c?"text-sm":"text-base"}`,children:d}),m&&(0,t.jsx)("p",{className:`text-gray-500 ${c?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:m}),o&&(0,t.jsx)("div",{className:"mt-4",children:o.href?(0,t.jsxs)(s.default,{href:o.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,t.jsxs)("button",{onClick:o.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}e.s(["EmptyState",0,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"}})}])},65822,e=>{"use strict";var t=e.i(83599),s=e.i(58963);let a=async e=>{let t=await fetch(e);if(401===t.status)throw window.location.assign("/login"),Error("unauthorized");return t.json()},r={refreshInterval:5e3,dedupingInterval:3e3};function n(e,t){if(!t)return e;let s=e.includes("?")?"&":"?";return`${e}${s}network_id=${encodeURIComponent(t)}`}e.s(["useAnetConfig",0,function(){let{data:e}=(0,t.default)("/api/anet/config",a,{refreshInterval:3e4});return{config:e||null}},"useHealth",0,function(){let{data:e,error:s}=(0,t.default)("/api/hub/health",a,r);return{health:e||null,error:s}},"useLicense",0,function(){let{data:e,error:s}=(0,t.default)("/api/hub/license",a,{refreshInterval:6e4});return{license:e?.ok?e:null,error:s}},"useMessages",0,function(e=100){let{networkId:l}=(0,s.useNetworkId)(),{data:i,error:o,isLoading:c}=(0,t.default)(n(`/api/hub/messages?limit=${e}`,l),a,r);return{messages:i?.messages||[],error:o,isLoading:c}},"useSessions",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:l,error:i,isLoading:o}=(0,t.default)(n("/api/hub/status",e),a,r);return{sessions:l?.sessions||[],hint:l?._hint,error:i,isLoading:o}},"useStats",0,function(){let{networkId:e}=(0,s.useNetworkId)(),{data:l,error:i}=(0,t.default)(n("/api/hub/stats",e),a,r);return{stats:l?.ok?l:null,error:i}},"useTasks",0,function(e){let{networkId:l}=(0,s.useNetworkId)(),i=new URLSearchParams({limit:"100",...e}).toString(),{data:o,error:c,isLoading:x}=(0,t.default)(n(`/api/hub/tasks?${i}`,l),a,r);return{tasks:o?.tasks||[],count:o?.count??0,source:o?.source,error:c,isLoading:x}}])},82756,e=>{"use strict";var t=e.i(18050),s=e.i(71645),a=e.i(65822),r=e.i(18150),n=e.i(95356),l=e.i(69874);let i={task:"bg-green-500/10 text-green-300 border-green-500/20",message:"bg-blue-500/10 text-blue-300 border-blue-500/20",broadcast:"bg-purple-500/10 text-purple-300 border-purple-500/20",reply:"bg-cyan-500/10 text-cyan-300 border-cyan-500/20"};function o(e){return e?new Date(e.replace(" ","T")+"Z").getTime():0}function c(e){return"broadcast"===e.type?"broadcast":"dashboard"===(e.from_alias||"").toLowerCase()?"outgoing":"incoming"}function x(e,s){let a=e||"--",r=s.trim();if(!r||r.startsWith("from:"))return a;let n=a.toLowerCase().indexOf(r.toLowerCase());return n<0?a:(0,t.jsxs)(t.Fragment,{children:[a.slice(0,n),(0,t.jsx)("mark",{className:"bg-yellow-500/30 text-yellow-200 rounded px-0.5",children:a.slice(n,n+r.length)}),a.slice(n+r.length)]})}e.s(["default",0,function(){let{messages:e,isLoading:d}=(0,a.useMessages)(200),[m,h]=(0,s.useState)(""),[u,p]=(0,s.useState)(""),[g,y]=(0,s.useState)(!1),[b,j]=(0,s.useState)("timeline"),f=(0,s.useMemo)(()=>{let t=new Set;return e.forEach(e=>{let s=e.from_alias?.trim();s&&"dashboard"!==s.toLowerCase()&&t.add(s)}),[...t].slice(0,8)},[e]),v=(0,s.useMemo)(()=>{let t=u.trim().toLowerCase(),s=t.startsWith("from:")?t.slice(5).trim():"";return[...e].filter(e=>(!m||e.type===m)&&(s?(e.from_alias||"").toLowerCase().includes(s):!t||(e.from_alias||"").toLowerCase().includes(t)||(e.to_alias||"").toLowerCase().includes(t)||(e.content||"").toLowerCase().includes(t))).sort((e,t)=>o(e.created_at)-o(t.created_at))},[m,e,u]),w=(0,s.useMemo)(()=>{let e=new Map;return v.forEach(t=>{let s=t.from_alias||"?",a=t.to_alias||"?",r=[s,a].sort().join("↔"),n=e.get(r)||{participants:[s,a].sort(),messages:[],lastTime:0};n.messages.push(t),n.lastTime=Math.max(n.lastTime,o(t.created_at)),e.set(r,n)}),[...e.values()].sort((e,t)=>t.lastTime-e.lastTime)},[v]);return(0,t.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-white lg:ml-0 ml-10",children:"Messages"}),(0,t.jsx)("span",{className:"text-xs bg-blue-900/30 text-blue-400 px-2 py-0.5 rounded-full border border-blue-800/30",children:e.length}),v.length>0&&(0,t.jsx)("button",{onClick:()=>{let e=v.map(e=>`**${e.from_alias||"?"}** → ${e.to_alias||"?"} (${e.type||"?"}) — ${e.created_at||""}
|
|
2
2
|
|
|
3
3
|
${e.content||"--"}
|
|
4
4
|
|
|
5
5
|
---`).join("\n\n"),t=new Blob([`# Messages Export
|
|
6
6
|
|
|
7
|
-
${e}`],{type:"text/markdown"}),s=URL.createObjectURL(t),a=document.createElement("a");a.href=s,a.download=`messages-${new Date().toISOString().slice(0,10)}.md`,a.click(),URL.revokeObjectURL(s)},className:"text-xs text-gray-500 hover:text-gray-300 border border-gray-700/50 px-2.5 py-1 rounded-lg transition-colors",children:"Export MD"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-3 mb-3",children:[(0,t.jsx)("input",{type:"text",value:u,onChange:e=>p(e.target.value),placeholder:"Search from/to/content or use from:alias",className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-blue-500/50 focus:outline-none w-full sm:w-72"}),(0,t.jsxs)("select",{value:
|
|
7
|
+
${e}`],{type:"text/markdown"}),s=URL.createObjectURL(t),a=document.createElement("a");a.href=s,a.download=`messages-${new Date().toISOString().slice(0,10)}.md`,a.click(),URL.revokeObjectURL(s)},className:"text-xs text-gray-500 hover:text-gray-300 border border-gray-700/50 px-2.5 py-1 rounded-lg transition-colors",children:"Export MD"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-3 mb-3",children:[(0,t.jsx)("input",{type:"text",value:u,onChange:e=>p(e.target.value),placeholder:"Search from/to/content or use from:alias",className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white placeholder-gray-600 focus:border-blue-500/50 focus:outline-none w-full sm:w-72"}),(0,t.jsxs)("select",{value:m,onChange:e=>h(e.target.value),className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white focus:border-blue-500/50 focus:outline-none",children:[(0,t.jsx)("option",{value:"",children:"All types"}),(0,t.jsx)("option",{value:"task",children:"task"}),(0,t.jsx)("option",{value:"message",children:"message"}),(0,t.jsx)("option",{value:"broadcast",children:"broadcast"}),(0,t.jsx)("option",{value:"reply",children:"reply"})]}),(0,t.jsx)("div",{className:"flex rounded-lg border border-[#2a2a4a] bg-[#111128] p-0.5",children:["timeline","grouped"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>j(e),className:`rounded-md px-2.5 py-1.5 text-xs transition-colors ${b===e?"bg-cyan-500/10 text-cyan-300":"text-gray-500 hover:text-gray-200"}`,children:"timeline"===e?"Timeline":"Grouped"},e))}),(0,t.jsx)("button",{onClick:()=>y(!g),className:`text-xs px-3 py-2 rounded-lg border transition-colors ${g?"bg-yellow-500/10 text-yellow-300 border-yellow-500/20":"text-gray-500 border-gray-700/50 hover:text-gray-300"}`,children:g?"Debug ON":"Debug"})]}),f.length>0&&(0,t.jsxs)("div",{className:"mb-6 flex flex-wrap gap-2",children:[f.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>p(`from:${e}`),className:`rounded-full border px-3 py-1 text-xs transition-colors ${u===`from:${e}`?"border-cyan-500/30 bg-cyan-500/10 text-cyan-300":"border-[#2a2a4a] bg-[#111128] text-gray-400 hover:text-gray-200"}`,children:["from:",e]},e)),u.startsWith("from:")&&(0,t.jsx)("button",{type:"button",onClick:()=>p(""),className:"rounded-full border border-gray-700 px-3 py-1 text-xs text-gray-500 hover:text-gray-200",children:"Clear"})]}),d?(0,t.jsx)("div",{className:"animate-pulse space-y-3",children:[1,2,3,4,5].map(e=>(0,t.jsx)("div",{className:"h-20 rounded-2xl bg-gray-800/20"},e))}):0===v.length?(0,t.jsx)(n.EmptyState,{variant:"messages"}):"grouped"===b?(0,t.jsx)("div",{className:"space-y-4",children:w.map((e,s)=>(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl overflow-hidden",children:[(0,t.jsxs)("div",{className:"px-4 py-2.5 border-b border-[#2a2a4a] flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.AliasAvatar,{alias:e.participants[0],size:16}),(0,t.jsx)("span",{className:"text-sm text-gray-200 font-medium",children:e.participants[0]}),(0,t.jsx)("span",{className:"text-gray-600 text-xs",children:"↔"}),(0,t.jsx)(l.AliasAvatar,{alias:e.participants[1],size:16}),(0,t.jsx)("span",{className:"text-sm text-gray-200 font-medium",children:e.participants[1]})]}),(0,t.jsxs)("span",{className:"text-[10px] text-gray-600",children:[e.messages.length," messages"]})]}),(0,t.jsx)("div",{className:"px-4 py-2 space-y-2 max-h-64 overflow-y-auto",children:e.messages.map(e=>(0,t.jsxs)("div",{className:"flex items-start gap-2 text-xs py-1",children:[e.from_alias&&(0,t.jsx)(l.AliasAvatar,{alias:e.from_alias,size:14}),(0,t.jsx)("span",{className:"shrink-0 font-medium text-gray-200",children:e.from_alias}),(0,t.jsx)("span",{className:"text-gray-400 flex-1",children:e.content?.slice(0,120)||"--"}),(0,t.jsx)("span",{className:"text-[9px] text-gray-600 shrink-0",children:(0,r.timeAgo)(e.created_at||"")})]},e.id))})]},s))}):(0,t.jsx)("div",{className:"space-y-1",children:v.map((e,s)=>{var a;let n=v[s-1],d=!!n&&o(e.created_at)-o(n.created_at)>3e5,m=c(e),h=!!n&&!d&&c(n)===m&&(n.from_alias||"")===(e.from_alias||"")&&(n.to_alias||"")===(e.to_alias||""),p=e.from_alias||"?";return(0,t.jsxs)("div",{children:[d&&(0,t.jsxs)("div",{className:"my-4 flex items-center gap-3",children:[(0,t.jsx)("div",{className:"h-px flex-1 bg-[#2a2a4a]"}),(0,t.jsx)("div",{className:"text-[11px] text-gray-600",children:(a=e.created_at)?new Date(a.replace(" ","T")+"Z").toLocaleString():"Time gap"}),(0,t.jsx)("div",{className:"h-px flex-1 bg-[#2a2a4a]"})]}),"broadcast"===m?(0,t.jsx)("div",{className:h?"mt-1":"mt-3",children:(0,t.jsxs)("div",{className:"rounded-2xl border border-purple-500/20 bg-purple-500/10 px-4 py-3 shadow-sm w-full",children:[(0,t.jsxs)("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-md border ${i[e.type||""]||"bg-gray-500/10 text-gray-400 border-gray-500/20"}`,children:e.type||"unknown"}),(0,t.jsx)("span",{className:"text-sm font-medium text-purple-200",children:p}),e.to_alias&&(0,t.jsxs)("span",{className:"text-xs text-purple-200/80",children:["to ",e.to_alias]}),"high"===e.priority&&(0,t.jsx)("span",{className:"text-xs text-red-400",children:"HIGH"}),(0,t.jsx)("span",{className:"ml-auto text-xs text-gray-500",children:e.created_at?(0,r.timeAgo)(e.created_at):"--"})]}),(0,t.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-relaxed text-gray-200",children:x(e.content,u)})]})}):(0,t.jsxs)("div",{className:`${h?"mt-1":"mt-3"} flex gap-2 ${"outgoing"===m?"flex-row-reverse":"flex-row"}`,children:[(0,t.jsx)("div",{className:"w-8 shrink-0 pt-1",children:!h&&(0,t.jsx)(l.AliasAvatar,{alias:p,size:32})}),(0,t.jsxs)("div",{className:`min-w-0 max-w-3xl rounded-2xl border px-4 py-3 shadow-sm ${"outgoing"===m?"border-green-500/20 bg-green-500/10":"border-blue-500/20 bg-blue-500/10"}`,children:[!h&&(0,t.jsxs)("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-md border ${i[e.type||""]||"bg-gray-500/10 text-gray-400 border-gray-500/20"}`,children:e.type||"unknown"}),(0,t.jsx)("span",{className:`text-sm font-medium ${"outgoing"===m?"text-green-300":"text-blue-300"}`,children:p}),(0,t.jsx)("span",{className:"text-xs text-gray-600",children:"→"}),(0,t.jsx)("span",{className:"text-sm text-gray-300",children:e.to_alias||"--"}),"high"===e.priority&&(0,t.jsx)("span",{className:"text-xs text-red-400",children:"HIGH"}),(0,t.jsx)("span",{className:"ml-auto text-xs text-gray-500",children:e.created_at?(0,r.timeAgo)(e.created_at):"--"})]}),(0,t.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-relaxed text-gray-200",children:x(e.content,u)}),h&&(0,t.jsx)("div",{className:"mt-1 text-[10px] text-gray-600 text-right",children:e.created_at?(0,r.timeAgo)(e.created_at):""}),g&&(0,t.jsxs)("div",{className:"mt-3 border-t border-white/10 pt-3 text-xs text-gray-500 space-y-1",children:[(0,t.jsxs)("div",{children:["ID: ",e.id]}),e.task_id&&(0,t.jsxs)("div",{children:["Task ID: ",e.task_id]}),(0,t.jsxs)("div",{children:["Created: ",e.created_at]})]})]})]})]},e.id)})})]})}])}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18150,e=>{"use strict";e.s(["formatUptime",0,function(e){let t=Math.floor(e/3600),s=Math.floor(e%3600/60);return t>0?`${t}h ${s}m`:`${s}m`},"timeAgo",0,function(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}])},69874,e=>{"use strict";var t=e.i(18050);let s=[180,200,220,270,300,330,30,90];e.s(["AliasAvatar",0,function({alias:e,size:a=28,className:r=""}){let n=function(e){let t=0;for(let s=0;s<e.length;s++)t=31*t+e.charCodeAt(s)>>>0;let a=s[t%s.length];return{bg:`hsl(${a} 55% 22%)`,ring:`hsl(${a} 60% 45%)`,text:`hsl(${a} 80% 78%)`}}(e),i=Math.max(9,Math.round(.42*a));return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${r}`,style:{width:a,height:a,fontSize:i,backgroundColor:n.bg,borderColor:n.ring,color:n.text},title:e,"aria-hidden":!0,children:e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"})}])},95356,e=>{"use strict";var t=e.i(18050),s=e.i(22016);let a={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function r({variant:e,size:s}){let a={width:s,height:s},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",...a,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",...a,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",...a,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",...a,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",...a,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",...a,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",...a,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:o,compact:c=!1}){let x=a[e],d=i??x.title,h=l??x.sub;return(0,t.jsxs)("div",{className:`text-center ${c?"py-8":"py-16"} px-4`,role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)(r,{variant:e,size:c?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${c?"text-sm":"text-base"}`,children:d}),h&&(0,t.jsx)("p",{className:`text-gray-500 ${c?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:h}),o&&(0,t.jsx)("div",{className:"mt-4",children:o.href?(0,t.jsxs)(s.default,{href:o.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,t.jsxs)("button",{onClick:o.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}e.s(["EmptyState",0,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"}})}])},79365,e=>{"use strict";var t=e.i(18050),s=e.i(71645),a=e.i(22016),r=e.i(18150),n=e.i(58963),i=e.i(95356),l=e.i(69874);let o={register:"bg-green-500/10 text-green-300 border-green-500/20",login:"bg-blue-500/10 text-blue-300 border-blue-500/20",login_failed:"bg-red-500/10 text-red-300 border-red-500/20",create_network:"bg-purple-500/10 text-purple-300 border-purple-500/20",send_task:"bg-cyan-500/10 text-cyan-300 border-cyan-500/20"},c={register:"#4ade80",login:"#60a5fa",login_failed:"#ef4444",create_network:"#a78bfa",send_task:"#22d3ee"};e.s(["default",0,function(){let e,{networkId:x}=(0,n.useNetworkId)(),[d,h]=(0,s.useState)([]),[g,m]=(0,s.useState)(!0),[u,y]=(0,s.useState)(""),[p,j]=(0,s.useState)(""),b=(0,s.useCallback)(async()=>{try{let e=new URLSearchParams({limit:"100"});x&&e.set("network_id",x),p&&e.set("action",p);let t=sessionStorage.getItem("anet_v3_auth");if(t)try{let s=JSON.parse(t);s.token&&e.set("token",s.token)}catch{}let s=await fetch(`/api/hub/audit-log?${e.toString()}`);if(401===s.status)return void window.location.assign("/login");let a=await s.json();h(a.logs||[]),y(a.error&&!a.logs?.length?a.error:"")}catch(e){y(e instanceof Error?e.message:"fetch failed")}finally{m(!1)}},[p,x]);return(0,s.useEffect)(()=>{m(!0),b();let e=setInterval(b,1e4);return()=>clearInterval(e)},[b]),(0,t.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-white lg:ml-0 ml-10",children:"Logs"}),(0,t.jsx)("span",{className:"text-xs bg-gray-900/30 text-gray-400 px-2 py-0.5 rounded-full border border-gray-800/30",children:"Audit Log"})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-3 mb-6",children:(0,t.jsxs)("select",{value:p,onChange:e=>j(e.target.value),className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white focus:border-blue-500/50 focus:outline-none",children:[(0,t.jsx)("option",{value:"",children:"All actions"}),(0,t.jsx)("option",{value:"register",children:"register"}),(0,t.jsx)("option",{value:"login",children:"login"}),(0,t.jsx)("option",{value:"login_failed",children:"login_failed"}),(0,t.jsx)("option",{value:"create_network",children:"create_network"}),(0,t.jsx)("option",{value:"send_task",children:"send_task"})]})}),u&&(e=/unauthor|401|forbidden|403|admin/i.test(u),(0,t.jsxs)("div",{className:"anet-warn-chip bg-yellow-900/20 border border-yellow-800/40 text-yellow-300 px-4 py-3 rounded-lg mb-6 text-sm flex items-start gap-3",role:"alert",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"text-base leading-none",children:"⚠"}),(0,t.jsx)("div",{className:"flex-1",children: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-1",children:"审计日志记录用户注册 / 登录 / 网络变更等事件,需要 admin 角色。"}),(0,t.jsx)(a.default,{href:"/login",className:"inline-block mt-2 text-xs font-medium underline underline-offset-4 hover:opacity-80",children:"切到 admin 账号 →"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"font-medium",children:"加载失败"}),(0,t.jsx)("div",{className:"text-xs opacity-80 mt-1",children:"请检查 CommHub 是否在线,或稍后重试。"}),(0,t.jsx)("button",{onClick:()=>window.location.reload(),className:"inline-block mt-2 text-xs font-medium underline underline-offset-4 hover:opacity-80",children:"重新加载 →"})]})})]})),g?(0,t.jsx)("div",{className:"animate-pulse space-y-2",children:[1,2,3,4,5].map(e=>(0,t.jsx)("div",{className:"h-14 bg-gray-800/20 rounded-lg"},e))}):0===d.length?(0,t.jsx)(i.EmptyState,{variant:"logs"}):(0,t.jsx)("div",{className:"space-y-2",children:d.map(e=>{let s=e.username||e.user_id;return(0,t.jsxs)("div",{className:"relative bg-[#111128] border border-[#2a2a4a] rounded-lg pl-4 pr-4 py-3 hover:border-[#3a3a5a] transition-colors overflow-hidden",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute left-0 top-0 bottom-0 w-0.5",style:{backgroundColor:c[e.action]||"transparent"}}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-md border ${o[e.action]||"bg-gray-500/10 text-gray-400 border-gray-500/20"}`,children:e.action}),s&&(0,t.jsx)(l.AliasAvatar,{alias:s,size:16}),(0,t.jsx)("span",{className:"text-sm text-gray-200 font-medium",children:s}),e.target_type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-xs text-gray-600",children:"→"}),(0,t.jsxs)("span",{className:"text-xs text-gray-400",children:[e.target_type,e.target_id?`:${e.target_id.slice(0,12)}`:""]})]}),(0,t.jsx)("span",{className:"text-xs text-gray-600 ml-auto",children:(0,r.timeAgo)(e.created_at)})]}),e.detail&&(0,t.jsx)("div",{className:"text-xs text-gray-500",children:e.detail}),e.ip&&"unknown"!==e.ip&&(0,t.jsxs)("div",{className:"text-[10px] text-gray-700",children:["IP: ",e.ip]})]},e.id)})})]})}])}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18150,e=>{"use strict";e.s(["formatUptime",0,function(e){let t=Math.floor(e/3600),s=Math.floor(e%3600/60);return t>0?`${t}h ${s}m`:`${s}m`},"timeAgo",0,function(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}])},69874,e=>{"use strict";var t=e.i(18050);let s=[180,200,220,270,300,330,30,90];e.s(["AliasAvatar",0,function({alias:e,size:a=28,className:r=""}){let n=function(e){let t=0;for(let s=0;s<e.length;s++)t=31*t+e.charCodeAt(s)>>>0;let a=s[t%s.length];return{bg:`hsl(${a} 55% 22%)`,ring:`hsl(${a} 60% 45%)`,text:`hsl(${a} 80% 78%)`}}(e),i=Math.max(9,Math.round(.42*a));return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${r}`,style:{width:a,height:a,fontSize:i,backgroundColor:n.bg,borderColor:n.ring,color:n.text},title:e,"aria-hidden":!0,children:e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"})}])},95356,e=>{"use strict";var t=e.i(18050),s=e.i(22016);let a={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function r({variant:e,size:s}){let a={width:s,height:s},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",...a,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",...a,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",...a,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",...a,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",...a,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",...a,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",...a,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:o,compact:c=!1}){let x=a[e],d=i??x.title,h=l??x.sub;return(0,t.jsxs)("div",{className:`text-center ${c?"py-8":"py-16"} px-4`,role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)(r,{variant:e,size:c?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${c?"text-sm":"text-base"}`,children:d}),h&&(0,t.jsx)("p",{className:`text-gray-500 ${c?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:h}),o&&(0,t.jsx)("div",{className:"mt-4",children:o.href?(0,t.jsxs)(s.default,{href:o.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,t.jsxs)("button",{onClick:o.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[o.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}e.s(["EmptyState",0,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"}})}])},79365,e=>{"use strict";var t=e.i(18050),s=e.i(71645),a=e.i(22016),r=e.i(18150),n=e.i(58963),i=e.i(95356),l=e.i(69874);let o={register:"bg-green-500/10 text-green-300 border-green-500/20",login:"bg-blue-500/10 text-blue-300 border-blue-500/20",login_failed:"bg-red-500/10 text-red-300 border-red-500/20",create_network:"bg-purple-500/10 text-purple-300 border-purple-500/20",send_task:"bg-cyan-500/10 text-cyan-300 border-cyan-500/20"},c={register:"#4ade80",login:"#60a5fa",login_failed:"#ef4444",create_network:"#a78bfa",send_task:"#22d3ee"};e.s(["default",0,function(){let e,{networkId:x}=(0,n.useNetworkId)(),[d,h]=(0,s.useState)([]),[g,u]=(0,s.useState)(!0),[m,y]=(0,s.useState)(""),[p,j]=(0,s.useState)(""),b=(0,s.useCallback)(async()=>{try{let e=new URLSearchParams({limit:"100"});x&&e.set("network_id",x),p&&e.set("action",p);let t=sessionStorage.getItem("anet_v3_auth");if(t)try{let s=JSON.parse(t);s.token&&e.set("token",s.token)}catch{}let s=await fetch(`/api/hub/audit-log?${e.toString()}`);if(401===s.status)return void window.location.assign("/login");let a=await s.json();h(a.logs||[]),y(a.error&&!a.logs?.length?a.error:"")}catch(e){y(e instanceof Error?e.message:"fetch failed")}finally{u(!1)}},[p,x]);return(0,s.useEffect)(()=>{u(!0),b();let e=setInterval(b,1e4);return()=>clearInterval(e)},[b]),(0,t.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-white lg:ml-0 ml-10",children:"Audit Log"}),d.length>0&&(0,t.jsx)("span",{className:"text-xs bg-blue-900/30 text-blue-400 px-2 py-0.5 rounded-full border border-blue-800/30",children:d.length})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-3 mb-6",children:(0,t.jsxs)("select",{value:p,onChange:e=>j(e.target.value),className:"bg-[#111128] border border-[#2a2a4a] rounded-lg px-3 py-2 text-sm text-white focus:border-blue-500/50 focus:outline-none",children:[(0,t.jsx)("option",{value:"",children:"All actions"}),(0,t.jsx)("option",{value:"register",children:"register"}),(0,t.jsx)("option",{value:"login",children:"login"}),(0,t.jsx)("option",{value:"login_failed",children:"login_failed"}),(0,t.jsx)("option",{value:"create_network",children:"create_network"}),(0,t.jsx)("option",{value:"send_task",children:"send_task"})]})}),m&&(e=/unauthor|401|forbidden|403|admin/i.test(m),(0,t.jsxs)("div",{className:"anet-warn-chip bg-yellow-900/20 border border-yellow-800/40 text-yellow-300 px-4 py-3 rounded-lg mb-6 text-sm flex items-start gap-3",role:"alert",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"text-base leading-none",children:"⚠"}),(0,t.jsx)("div",{className:"flex-1",children: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-1",children:"审计日志记录用户注册 / 登录 / 网络变更等事件,需要 admin 角色。"}),(0,t.jsx)(a.default,{href:"/login",className:"inline-block mt-2 text-xs font-medium underline underline-offset-4 hover:opacity-80",children:"切到 admin 账号 →"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"font-medium",children:"加载失败"}),(0,t.jsx)("div",{className:"text-xs opacity-80 mt-1",children:"请检查 CommHub 是否在线,或稍后重试。"}),(0,t.jsx)("button",{onClick:()=>window.location.reload(),className:"inline-block mt-2 text-xs font-medium underline underline-offset-4 hover:opacity-80",children:"重新加载 →"})]})})]})),g?(0,t.jsx)("div",{className:"animate-pulse space-y-2",children:[1,2,3,4,5].map(e=>(0,t.jsx)("div",{className:"h-14 bg-gray-800/20 rounded-lg"},e))}):0===d.length?(0,t.jsx)(i.EmptyState,{variant:"logs"}):(0,t.jsx)("div",{className:"space-y-2",children:d.map(e=>{let s=e.username||e.user_id;return(0,t.jsxs)("div",{className:"relative bg-[#111128] border border-[#2a2a4a] rounded-lg pl-4 pr-4 py-3 hover:border-[#3a3a5a] transition-colors overflow-hidden",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute left-0 top-0 bottom-0 w-0.5",style:{backgroundColor:c[e.action]||"transparent"}}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded-md border ${o[e.action]||"bg-gray-500/10 text-gray-400 border-gray-500/20"}`,children:e.action}),s&&(0,t.jsx)(l.AliasAvatar,{alias:s,size:16}),(0,t.jsx)("span",{className:"text-sm text-gray-200 font-medium",children:s}),e.target_type&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-xs text-gray-600",children:"→"}),(0,t.jsxs)("span",{className:"text-xs text-gray-400",children:[e.target_type,e.target_id?`:${e.target_id.slice(0,12)}`:""]})]}),(0,t.jsx)("span",{className:"text-xs text-gray-600 ml-auto",children:(0,r.timeAgo)(e.created_at)})]}),e.detail&&(0,t.jsx)("div",{className:"text-xs text-gray-500",children:e.detail}),e.ip&&"unknown"!==e.ip&&(0,t.jsxs)("div",{className:"text-[10px] text-gray-700",children:["IP: ",e.ip]})]},e.id)})})]})}])}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18150,e=>{"use strict";e.s(["formatUptime",0,function(e){let t=Math.floor(e/3600),a=Math.floor(e%3600/60);return t>0?`${t}h ${a}m`:`${a}m`},"timeAgo",0,function(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}])},69874,e=>{"use strict";var t=e.i(18050);let a=[180,200,220,270,300,330,30,90];e.s(["AliasAvatar",0,function({alias:e,size:s=28,className:r=""}){let l=function(e){let t=0;for(let a=0;a<e.length;a++)t=31*t+e.charCodeAt(a)>>>0;let s=a[t%a.length];return{bg:`hsl(${s} 55% 22%)`,ring:`hsl(${s} 60% 45%)`,text:`hsl(${s} 80% 78%)`}}(e),n=Math.max(9,Math.round(.42*s));return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${r}`,style:{width:s,height:s,fontSize:n,backgroundColor:l.bg,borderColor:l.ring,color:l.text},title:e,"aria-hidden":!0,children:e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"})}])},95356,e=>{"use strict";var t=e.i(18050),a=e.i(22016);let s={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function r({variant:e,size:a}){let s={width:a,height:a},l={fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"nodes":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...l,children:[(0,t.jsx)("circle",{cx:"32",cy:"14",r:"4"}),(0,t.jsx)("circle",{cx:"14",cy:"44",r:"4"}),(0,t.jsx)("circle",{cx:"50",cy:"44",r:"4"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"14",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"50",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"18",y1:"44",x2:"46",y2:"44",strokeDasharray:"3 3",opacity:"0.6"})]})});case"tasks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...l,children:[(0,t.jsx)("rect",{x:"14",y:"14",width:"36",height:"6",rx:"1.5"}),(0,t.jsx)("rect",{x:"14",y:"26",width:"36",height:"6",rx:"1.5",opacity:"0.6"}),(0,t.jsx)("rect",{x:"14",y:"38",width:"36",height:"6",rx:"1.5",opacity:"0.35"})]})});case"messages":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...l,children:[(0,t.jsx)("path",{d:"M14 18 h36 a3 3 0 0 1 3 3 v18 a3 3 0 0 1 -3 3 h-18 l-8 6 v-6 h-10 a3 3 0 0 1 -3 -3 v-18 a3 3 0 0 1 3 -3 z"}),(0,t.jsx)("line",{x1:"22",y1:"28",x2:"42",y2:"28",opacity:"0.5"}),(0,t.jsx)("line",{x1:"22",y1:"34",x2:"36",y2:"34",opacity:"0.5"})]})});case"logs":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...l,children:[(0,t.jsx)("path",{d:"M18 12 h22 l8 8 v32 a2 2 0 0 1 -2 2 h-28 a2 2 0 0 1 -2 -2 v-38 a2 2 0 0 1 2 -2 z"}),(0,t.jsx)("path",{d:"M40 12 v8 h8",opacity:"0.6"}),(0,t.jsx)("line",{x1:"24",y1:"32",x2:"40",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"24",y1:"38",x2:"40",y2:"38",opacity:"0.4"}),(0,t.jsx)("line",{x1:"24",y1:"44",x2:"34",y2:"44",opacity:"0.25"})]})});case"tokens":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...l,children:[(0,t.jsx)("circle",{cx:"22",cy:"32",r:"8"}),(0,t.jsx)("line",{x1:"30",y1:"32",x2:"54",y2:"32"}),(0,t.jsx)("line",{x1:"44",y1:"32",x2:"44",y2:"38"}),(0,t.jsx)("line",{x1:"50",y1:"32",x2:"50",y2:"40"})]})});case"networks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...l,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"18"}),(0,t.jsx)("ellipse",{cx:"32",cy:"32",rx:"18",ry:"9",opacity:"0.55"}),(0,t.jsx)("line",{x1:"14",y1:"32",x2:"50",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"32",y1:"14",x2:"32",y2:"50",opacity:"0.55"})]})});default:return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...l,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"14",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"32",cy:"32",r:"3"})]})})}}function l({variant:e="generic",title:n,sub:i,cta:d,compact:c=!1}){let o=s[e],x=n??o.title,m=i??o.sub;return(0,t.jsxs)("div",{className:`text-center ${c?"py-8":"py-16"} px-4`,role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)(r,{variant:e,size:c?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${c?"text-sm":"text-base"}`,children:x}),m&&(0,t.jsx)("p",{className:`text-gray-500 ${c?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:m}),d&&(0,t.jsx)("div",{className:"mt-4",children:d.href?(0,t.jsxs)(a.default,{href:d.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[d.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,t.jsxs)("button",{onClick:d.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[d.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}e.s(["EmptyState",0,l,"NodesEmptyState",0,function({hint:e}){return e?.global_count?(0,t.jsx)(l,{variant:"nodes",title:"No agents in this network",sub:`Server has ${e.global_count} nodes globally, but none are registered to the current network. Switch network or contact admin.`}):(0,t.jsx)(l,{variant:"nodes",cta:{label:"Run anet quickstart",href:"https://anet.sh"}})}])},96527,e=>{"use strict";var t=e.i(18050),a=e.i(71645),s=e.i(18566),r=e.i(58963),l=e.i(18150),n=e.i(69874);let i={created:"text-gray-400",delivered:"text-blue-400",running:"text-green-400",replied:"text-purple-400",failed:"text-red-400",closed:"text-gray-500"};function d({taskId:e,onClose:s}){let[r,c]=(0,a.useState)(null),[o,x]=(0,a.useState)([]),[m,h]=(0,a.useState)(!0);(0,a.useEffect)(()=>{(async()=>{try{let[t,a]=await Promise.all([fetch(`/api/hub/tasks?task_id=${encodeURIComponent(e)}`),fetch(`/api/hub/task-events?task_id=${encodeURIComponent(e)}&limit=50`)]),s=await t.json(),r=await a.json();s.tasks?.[0]&&c(s.tasks[0]),x(r.events||[])}catch{}finally{h(!1)}})()},[e]);let p=r?[{key:"created",label:"Created",time:r.created_at,color:"bg-gray-400"},{key:"delivered",label:"Delivered",time:r.delivered_at,color:"bg-blue-400"},{key:"started",label:"Started",time:r.started_at,color:"bg-green-400"},{key:"completed",label:"Completed",time:r.completed_at,color:"bg-purple-400"}].map(e=>({...e,done:!!e.time})):[],g=p.findIndex(e=>!e.done),u=r&&"completed"!==r.status&&"failed"!==r.status&&"expired"!==r.status&&"cancelled"!==r.status,y=r?.started_at&&r?.completed_at?Math.round((new Date(r.completed_at).getTime()-new Date(r.started_at).getTime())/1e3):null;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/30 z-40 anet-fade-in",onClick:s}),(0,t.jsxs)("div",{className:"fixed top-0 right-0 h-full w-full lg:w-[500px] bg-[#0a0a1a] border-l border-[#2a2a4a] z-50 flex flex-col shadow-2xl shadow-black/60 overflow-y-auto animate-slide-in",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 border-b border-[#2a2a4a] bg-[#0d0d1a] sticky top-0",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-white",children:"Task Detail"}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-500 mt-0.5",children:[e.slice(0,16),"..."]})]}),(0,t.jsx)("button",{onClick:s,className:"text-gray-500 hover:text-white p-1.5 rounded-lg hover:bg-[#1a1a2a]",children:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),m?(0,t.jsx)("div",{className:"flex justify-center py-16",children:(0,t.jsx)("div",{className:"w-6 h-6 border-2 border-cyan-500/30 border-t-cyan-500 rounded-full animate-spin"})}):r?(0,t.jsxs)("div",{className:"px-5 py-5 space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:`text-lg font-bold ${i[r.status]||"text-gray-400"}`,children:r.status}),"normal"!==r.priority&&(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded border ${"high"===r.priority?"text-red-300 border-red-500/20":"text-gray-400 border-gray-600/20"}`,children:r.priority}),null!==y&&(0,t.jsxs)("span",{className:"text-xs text-gray-500",children:["⏱ ",y<60?`${y}s`:`${Math.floor(y/60)}m ${y%60}s`]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm flex-wrap",children:[r.from_name&&(0,t.jsx)(n.AliasAvatar,{alias:r.from_name,size:18}),(0,t.jsx)("span",{className:"text-gray-200 font-medium",children:r.from_name||"--"}),(0,t.jsx)("span",{className:"text-gray-600",children:"→"}),r.to_name&&(0,t.jsx)(n.AliasAvatar,{alias:r.to_name,size:18}),(0,t.jsx)("span",{className:"text-gray-200 font-medium",children:r.to_name||"--"})]}),(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 uppercase tracking-wide",children:"Timeline"}),null!==y&&(0,t.jsxs)("div",{className:"text-[10px] text-gray-600",children:[y<60?`${y}s`:`${Math.floor(y/60)}m ${y%60}s`," runtime"]})]}),(0,t.jsx)("div",{className:"space-y-3",children:p.map((e,a)=>{let s=u&&a===g,r=!!p[a+1]?.done;return(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center pt-0.5",children:[(0,t.jsx)("span",{className:`relative w-3 h-3 rounded-full shrink-0 ${e.done?e.color:"bg-gray-700"}`,children:s&&(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute -inset-1 rounded-full border border-current opacity-60 anet-current-step-pulse",style:{borderColor:"currentColor"}})}),a<p.length-1&&(0,t.jsx)("div",{className:`w-0.5 h-5 mt-1 ${e.done&&r?"bg-gray-500":e.done?"bg-gradient-to-b from-gray-500 to-gray-800":"bg-gray-800"}`})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:`text-xs font-medium flex items-center gap-2 ${e.done?"text-gray-200":s?"text-cyan-300":"text-gray-600"}`,children:[(0,t.jsx)("span",{children:e.label}),s&&(0,t.jsx)("span",{className:"text-[9px] uppercase tracking-wide text-cyan-400",children:"in progress"})]}),(0,t.jsx)("div",{className:"text-[10px] text-gray-500",title:e.time||void 0,children:e.time?(0,l.timeAgo)(e.time):s?"—":"Pending"})]})]},e.key)})})]}),(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 uppercase mb-2",children:"Input"}),(0,t.jsx)("div",{className:"text-sm text-gray-300 whitespace-pre-wrap",children:r.content||"--"})]}),r.result&&(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 uppercase mb-2",children:"Output"}),(0,t.jsx)("div",{className:"text-sm text-gray-300 whitespace-pre-wrap max-h-64 overflow-y-auto",children:r.result})]}),o.length>0&&(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsxs)("div",{className:"text-xs text-gray-500 uppercase mb-2",children:["Events (",o.length,")"]}),(0,t.jsx)("div",{className:"space-y-1.5 max-h-40 overflow-y-auto",children:o.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[11px]",children:[(0,t.jsx)("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${"running"===e.to_status?"bg-green-400":"replied"===e.to_status?"bg-purple-400":"failed"===e.to_status?"bg-red-400":"bg-blue-400"}`}),(0,t.jsx)("span",{className:"text-gray-400",children:e.event_type}),e.from_status&&(0,t.jsxs)("span",{className:"text-gray-600",children:[e.from_status,"→",e.to_status]}),(0,t.jsx)("span",{className:"text-gray-600 ml-auto",children:(0,l.timeAgo)(e.created_at)})]},e.id))})]}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-600 space-y-1",children:[(0,t.jsxs)("div",{children:["Task ID: ",r.task_id]}),r.expires_at&&(0,t.jsxs)("div",{children:["Expires: ",r.expires_at]})]})]}):(0,t.jsx)("div",{className:"text-center py-16 text-gray-500",children:"Task not found"})]})]})}var c=e.i(95356);let o=["","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"},m={created:"#9ca3af",delivered:"#60a5fa",acked:"#22d3ee",running:"#4ade80",replied:"#a78bfa",closed:"#6b7280",failed:"#f87171",cancelled:"#facc15",expired:"#fb923c"};function h(e){let t=x[e]||"bg-gray-500/10 text-gray-400 border-gray-500/20";return`text-xs px-2 py-0.5 rounded-md border ${t}`}function p(e){return"high"===e?"text-red-400":"low"===e?"text-gray-600":"text-gray-400"}function g(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function u(){let e,l,i,u=(0,s.useSearchParams)(),{networkId:y}=(0,r.useNetworkId)(),[b,j]=(0,a.useState)([]),[v,f]=(0,a.useState)(0),[N,w]=(0,a.useState)(!0),[k,_]=(0,a.useState)(""),[$,C]=(0,a.useState)(new Set),[S,A]=(0,a.useState)(u.get("status")||""),[M,T]=(0,a.useState)(""),[D,B]=(0,a.useState)(""),[I,L]=(0,a.useState)(null),z=e=>{C(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})},E=(0,a.useCallback)(async()=>{try{let e=new URLSearchParams;y&&e.set("network_id",y),S&&e.set("status",S),M&&e.set("from_name",M),D&&e.set("to_name",D),e.set("limit","100");let t=await fetch(`/api/hub/tasks?${e.toString()}`);if(401===t.status)return void window.location.assign("/login");let a=await t.json();j(a.tasks||[]),f(a.count??(a.tasks?.length||0)),_("")}catch(e){_(e instanceof Error?e.message:"fetch failed")}finally{w(!1)}},[S,M,D,y]);return(0,a.useEffect)(()=>{w(!0),E();let e=setInterval(E,5e3);return()=>clearInterval(e)},[E]),(0,t.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-white lg:ml-0 ml-10",children:"Tasks"}),(0,t.jsx)("span",{className:"text-xs bg-blue-900/30 text-blue-400 px-2 py-0.5 rounded-full border border-blue-800/30",children:v})]}),(0,t.jsx)("div",{className:"anet-tabstrip-wrap mb-4",children:(0,t.jsx)("div",{className:"anet-tabstrip flex sm:flex-wrap gap-1 bg-[#111128] rounded-lg border border-[#2a2a4a] p-1 overflow-x-auto sm:overflow-x-visible scrollbar-thin",children:["",...o.filter(Boolean)].map(e=>(0,t.jsxs)("button",{onClick:()=>A(e),className:`px-3 py-1.5 rounded-md text-xs transition-colors flex items-center gap-1.5 shrink-0 whitespace-nowrap ${S===e?`${x[e]||"bg-cyan-500/10 text-cyan-300 border-cyan-500/20"} border`:"text-gray-500 hover:text-gray-300 hover:bg-[#1a1a2a]/40"}`,children:[e&&(0,t.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:m[e]||"#6b7280"}}),(0,t.jsx)("span",{children:e||"All"})]},e))})}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 rounded-lg border border-[#2a2a4a] bg-[#111128] px-2.5 py-1.5 focus-within:border-blue-500/40",children:[(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-gray-600",children:"From"}),(0,t.jsx)("input",{type:"text",value:M,onChange:e=>T(e.target.value),placeholder:"any node",className:"w-28 bg-transparent text-sm text-white placeholder-gray-700 focus:outline-none"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 rounded-lg border border-[#2a2a4a] bg-[#111128] px-2.5 py-1.5 focus-within:border-blue-500/40",children:[(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-gray-600",children:"To"}),(0,t.jsx)("input",{type:"text",value:D,onChange:e=>B(e.target.value),placeholder:"any node",className:"w-28 bg-transparent text-sm text-white placeholder-gray-700 focus:outline-none"})]}),(S||M||D)&&(0,t.jsx)("button",{type:"button",onClick:()=>{A(""),T(""),B("")},className:"rounded-lg border border-gray-700 px-2.5 py-1.5 text-[11px] text-gray-500 hover:text-gray-200 hover:border-gray-600",children:"Clear filters"})]}),b.length>0&&!S&&(e={},b.forEach(t=>{e[t.status]=(e[t.status]||0)+1}),l=b.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(a=>(0,t.jsx)("div",{className:a.color,style:{width:`${e[a.key]/l*100}%`}},a.key))}),(0,t.jsx)("div",{className:"flex flex-wrap gap-3 mt-1.5 text-[10px] text-gray-500",children:i.map(a=>(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:`inline-block w-2 h-2 rounded-full ${a.color} mr-1`}),e[a.key]," ",a.key]},a.key))})]}):null),k&&(0,t.jsx)("div",{className:"bg-red-900/20 border border-red-800/40 text-red-300 px-4 py-2 rounded-lg mb-6 text-sm",children:k}),N?(0,t.jsx)("div",{className:"animate-pulse space-y-3",children:[1,2,3,4,5].map(e=>(0,t.jsx)("div",{className:"h-20 bg-gray-800/20 rounded-lg border border-gray-800/40"},e))}):0===b.length?(0,t.jsx)(c.EmptyState,{variant:"tasks",sub:S||M||D?"No tasks match the current filters. Try clearing them.":"Tasks will appear here when agents send them via CommHub."}):(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"hidden sm:grid sm:grid-cols-12 gap-2 px-4 py-2 text-xs text-gray-600 uppercase",children:[(0,t.jsx)("div",{className:"col-span-1",children:"Status"}),(0,t.jsx)("div",{className:"col-span-2",children:"From"}),(0,t.jsx)("div",{className:"col-span-2",children:"To"}),(0,t.jsx)("div",{className:"col-span-4",children:"Content"}),(0,t.jsx)("div",{className:"col-span-1",children:"Priority"}),(0,t.jsx)("div",{className:"col-span-2",children:"Time"})]}),b.map(e=>{let a=$.has(e.task_id);return(0,t.jsxs)("div",{className:`anet-task-row group bg-[#111128] border rounded-lg px-4 py-3 transition-all duration-200 cursor-pointer ${a?"border-[#3a3a5a] shadow-lg shadow-black/20":"border-[#2a2a4a] hover:border-[#3a3a5a] hover:bg-[#15152e]"}`,onClick:()=>z(e.task_id),role:"button",tabIndex:0,"aria-expanded":a,onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),z(e.task_id))},children:[(0,t.jsxs)("div",{className:"hidden sm:grid sm:grid-cols-12 gap-2 items-center",children:[(0,t.jsx)("div",{className:"col-span-1",children:(0,t.jsx)("span",{className:h(e.status),children:e.status})}),(0,t.jsxs)("div",{className:"col-span-2 flex items-center gap-1.5 min-w-0",title:e.from_name,children:[e.from_name&&(0,t.jsx)(n.AliasAvatar,{alias:e.from_name,size:18}),(0,t.jsx)("span",{className:"truncate text-sm text-gray-200",children:e.from_name||"--"})]}),(0,t.jsxs)("div",{className:"col-span-2 flex items-center gap-1.5 min-w-0",title:e.to_name,children:[e.to_name&&(0,t.jsx)(n.AliasAvatar,{alias:e.to_name,size:18}),(0,t.jsx)("span",{className:"truncate text-sm text-gray-200",children:e.to_name||"--"})]}),(0,t.jsx)("div",{className:"col-span-4 text-xs text-gray-400 truncate",title:e.content,children:e.content||"--"}),(0,t.jsx)("div",{className:"col-span-1",children:(0,t.jsx)("span",{className:`text-xs ${p(e.priority)}`,children:e.priority||"normal"})}),(0,t.jsxs)("div",{className:"col-span-2 text-xs text-gray-500 flex items-center justify-between gap-2",title:e.created_at,children:[(0,t.jsx)("span",{className:"truncate",children:g(e.created_at)}),(0,t.jsx)("svg",{"aria-hidden":!0,className:`shrink-0 text-gray-600 group-hover:text-gray-400 transition-transform duration-200 ${a?"rotate-180":""}`,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 9l6 6 6-6"})})]})]}),(0,t.jsxs)("div",{className:"sm:hidden space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:h(e.status),children:e.status}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:`text-xs ${p(e.priority)}`,children:e.priority||"normal"}),(0,t.jsx)("svg",{"aria-hidden":!0,className:`text-gray-600 transition-transform duration-200 ${a?"rotate-180":""}`,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 9l6 6 6-6"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-gray-300 min-w-0",children:[e.from_name&&(0,t.jsx)(n.AliasAvatar,{alias:e.from_name,size:16}),(0,t.jsx)("span",{className:"truncate max-w-[40%]",children:e.from_name||"--"}),(0,t.jsx)("span",{className:"text-gray-600",children:"→"}),e.to_name&&(0,t.jsx)(n.AliasAvatar,{alias:e.to_name,size:16}),(0,t.jsx)("span",{className:"truncate max-w-[40%]",children:e.to_name||"--"})]}),(0,t.jsx)("div",{className:"text-xs text-gray-400 line-clamp-1",children:e.content||"--"}),(0,t.jsx)("div",{className:"text-xs text-gray-600",children:g(e.created_at)})]}),(0,t.jsx)("div",{className:`grid transition-all duration-300 ease-out ${a?"grid-rows-[1fr] opacity-100 mt-3":"grid-rows-[0fr] opacity-0"}`,"aria-hidden":!a,children:(0,t.jsx)("div",{className:"overflow-hidden",children:(0,t.jsxs)("div",{className:"pt-3 border-t border-[#2a2a4a] space-y-3",children:[e.content&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-xs text-gray-600 mb-1",children:"Content"}),(0,t.jsx)("div",{className:"text-xs text-gray-300 whitespace-pre-wrap bg-[#0a0a15] rounded-lg px-3 py-2 border border-[#1a1a2a]",children:e.content})]}),e.result&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-xs text-gray-600 mb-1",children:"Result"}),(0,t.jsx)("div",{className:"text-xs text-gray-300 whitespace-pre-wrap bg-[#0a0a15] rounded-lg px-3 py-2 border border-[#1a1a2a] max-h-48 overflow-y-auto",children:e.result})]}),(0,t.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[["Created",e.created_at],["Delivered",e.delivered_at],["Started",e.started_at],["Completed",e.completed_at]].map(([e,a])=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"text-gray-600",children:[e,": "]}),(0,t.jsx)("span",{className:"text-gray-400",children:a?g(a):"--"})]},e))}),e.expires_at&&(0,t.jsxs)("div",{className:"text-xs",children:[(0,t.jsx)("span",{className:"text-gray-600",children:"Expires: "}),(0,t.jsx)("span",{className:"text-orange-400",children:e.expires_at})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"text-xs text-gray-600 truncate",title:e.task_id,children:["ID: ",e.task_id]}),(0,t.jsxs)("div",{className:"flex gap-2 shrink-0",children:[("failed"===e.status||"expired"===e.status)&&(0,t.jsx)("button",{onClick:async t=>{t.stopPropagation(),await fetch("/api/hub/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({alias:e.to_name,task:e.content,priority:e.priority})}),E()},className:"text-xs text-orange-400 hover:text-orange-300 px-2 py-0.5 rounded border border-orange-500/20 hover:bg-orange-500/10",children:"Retry"}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),L(e.task_id)},className:"text-xs text-cyan-400 hover:text-cyan-300",children:"Detail →"})]})]})]})})})]},e.task_id)})]}),I&&(0,t.jsx)(d,{taskId:I,onClose:()=>L(null)})]})}e.s(["default",0,function(){return(0,t.jsx)(a.Suspense,{fallback:(0,t.jsx)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-6 font-mono",children:"Loading tasks..."}),children:(0,t.jsx)(u,{})})}],96527)}]);
|
package/.next/trace
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
[{"name":"generate-buildid","duration":334,"timestamp":197777965269,"id":4,"parentId":1,"tags":{},"startTime":1778569263790,"traceId":"dee239da1f71740f"},{"name":"load-custom-routes","duration":522,"timestamp":197777965781,"id":5,"parentId":1,"tags":{},"startTime":1778569263790,"traceId":"dee239da1f71740f"},{"name":"create-dist-dir","duration":431,"timestamp":197777966365,"id":6,"parentId":1,"tags":{},"startTime":1778569263791,"traceId":"dee239da1f71740f"},{"name":"clean","duration":548,"timestamp":197777967500,"id":7,"parentId":1,"tags":{},"startTime":1778569263792,"traceId":"dee239da1f71740f"},{"name":"discover-routes","duration":8894,"timestamp":197778058499,"id":8,"parentId":1,"tags":{},"startTime":1778569263883,"traceId":"dee239da1f71740f"},{"name":"create-root-mapping","duration":121,"timestamp":197778067463,"id":9,"parentId":1,"tags":{},"startTime":1778569263892,"traceId":"dee239da1f71740f"},{"name":"generate-route-types","duration":31311,"timestamp":197778069861,"id":10,"parentId":1,"tags":{},"startTime":1778569263895,"traceId":"dee239da1f71740f"},{"name":"public-dir-conflict-check","duration":103,"timestamp":197778101366,"id":11,"parentId":1,"tags":{},"startTime":1778569263926,"traceId":"dee239da1f71740f"},{"name":"generate-routes-manifest","duration":4227,"timestamp":197778101671,"id":12,"parentId":1,"tags":{},"startTime":1778569263926,"traceId":"dee239da1f71740f"},{"name":"run-turbopack","duration":8338637,"timestamp":197778111895,"id":14,"parentId":1,"tags":{},"startTime":1778569263937,"traceId":"dee239da1f71740f"},{"name":"turbopack-build-events","duration":83,"timestamp":197778413321,"id":15,"parentId":1,"tags":{},"startTime":1778569264238,"traceId":"dee239da1f71740f"},{"name":"run-typescript","duration":8924358,"timestamp":197786459232,"id":16,"parentId":1,"tags":{},"startTime":1778569272284,"traceId":"dee239da1f71740f"},{"name":"generate-required-server-files","duration":2821,"timestamp":197795387275,"id":18,"parentId":1,"tags":{},"startTime":1778569281212,"traceId":"dee239da1f71740f"},{"name":"check-static-error-page","duration":46408,"timestamp":197795479495,"id":20,"parentId":19,"tags":{},"startTime":1778569281304,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":523109,"timestamp":197795534088,"id":63,"parentId":25,"tags":{},"startTime":1778569281359,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":559161,"timestamp":197795498163,"id":25,"parentId":19,"tags":{"page":"/api/auth/login"},"startTime":1778569281323,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":528947,"timestamp":197795533951,"id":62,"parentId":22,"tags":{},"startTime":1778569281359,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":574298,"timestamp":197795488681,"id":22,"parentId":19,"tags":{"page":"/_global-error"},"startTime":1778569281313,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":537667,"timestamp":197795534234,"id":64,"parentId":26,"tags":{},"startTime":1778569281359,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":573588,"timestamp":197795498378,"id":26,"parentId":19,"tags":{"page":"/api/auth/logout"},"startTime":1778569281323,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":568490,"timestamp":197795534311,"id":66,"parentId":28,"tags":{},"startTime":1778569281359,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":601124,"timestamp":197795501760,"id":28,"parentId":19,"tags":{"page":"/api/hub/audit-log"},"startTime":1778569281326,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":582274,"timestamp":197795534354,"id":67,"parentId":29,"tags":{},"startTime":1778569281359,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":614673,"timestamp":197795502038,"id":29,"parentId":19,"tags":{"page":"/api/hub/auth"},"startTime":1778569281327,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":587561,"timestamp":197795534388,"id":68,"parentId":30,"tags":{},"startTime":1778569281359,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":619247,"timestamp":197795502783,"id":30,"parentId":19,"tags":{"page":"/api/hub/broadcast"},"startTime":1778569281327,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":593729,"timestamp":197795534424,"id":69,"parentId":32,"tags":{},"startTime":1778569281359,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":623777,"timestamp":197795504440,"id":32,"parentId":19,"tags":{"page":"/api/hub/health"},"startTime":1778569281329,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":602289,"timestamp":197795534521,"id":70,"parentId":33,"tags":{},"startTime":1778569281359,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":632186,"timestamp":197795504692,"id":33,"parentId":19,"tags":{"page":"/api/hub/inbox"},"startTime":1778569281329,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":605846,"timestamp":197795534566,"id":71,"parentId":34,"tags":{},"startTime":1778569281359,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":635142,"timestamp":197795505330,"id":34,"parentId":19,"tags":{"page":"/api/hub/license"},"startTime":1778569281330,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":607973,"timestamp":197795533016,"id":61,"parentId":21,"tags":{},"startTime":1778569281358,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":656909,"timestamp":197795484138,"id":21,"parentId":19,"tags":{"page":"/_not-found"},"startTime":1778569281309,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":609944,"timestamp":197795534584,"id":72,"parentId":35,"tags":{},"startTime":1778569281359,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":638477,"timestamp":197795506097,"id":35,"parentId":19,"tags":{"page":"/api/hub/messages"},"startTime":1778569281331,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":612041,"timestamp":197795537066,"id":74,"parentId":37,"tags":{},"startTime":1778569281362,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":640859,"timestamp":197795508319,"id":37,"parentId":19,"tags":{"page":"/api/hub/nodes"},"startTime":1778569281333,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":615295,"timestamp":197795537076,"id":75,"parentId":38,"tags":{},"startTime":1778569281362,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":643888,"timestamp":197795508536,"id":38,"parentId":19,"tags":{"page":"/api/hub/register"},"startTime":1778569281333,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":619984,"timestamp":197795537083,"id":76,"parentId":39,"tags":{},"startTime":1778569281362,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":648364,"timestamp":197795508765,"id":39,"parentId":19,"tags":{"page":"/api/hub/send"},"startTime":1778569281333,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":622576,"timestamp":197795537089,"id":77,"parentId":40,"tags":{},"startTime":1778569281362,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":650745,"timestamp":197795508979,"id":40,"parentId":19,"tags":{"page":"/api/hub/server-logs"},"startTime":1778569281334,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":626286,"timestamp":197795537096,"id":78,"parentId":41,"tags":{},"startTime":1778569281362,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":653829,"timestamp":197795509602,"id":41,"parentId":19,"tags":{"page":"/api/hub/session"},"startTime":1778569281334,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":630154,"timestamp":197795537101,"id":79,"parentId":42,"tags":{},"startTime":1778569281362,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":657887,"timestamp":197795509724,"id":42,"parentId":19,"tags":{"page":"/api/hub/stats"},"startTime":1778569281334,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":633968,"timestamp":197795537106,"id":80,"parentId":43,"tags":{},"startTime":1778569281362,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":661329,"timestamp":197795509793,"id":43,"parentId":19,"tags":{"page":"/api/hub/status"},"startTime":1778569281334,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":639984,"timestamp":197795537111,"id":81,"parentId":44,"tags":{},"startTime":1778569281362,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":667289,"timestamp":197795509864,"id":44,"parentId":19,"tags":{"page":"/api/hub/task-events"},"startTime":1778569281335,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":640369,"timestamp":197795537116,"id":82,"parentId":45,"tags":{},"startTime":1778569281362,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":667587,"timestamp":197795509929,"id":45,"parentId":19,"tags":{"page":"/api/hub/tasks"},"startTime":1778569281335,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":645785,"timestamp":197795534275,"id":65,"parentId":27,"tags":{},"startTime":1778569281359,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":681618,"timestamp":197795498482,"id":27,"parentId":19,"tags":{"page":"/api/auth/v3"},"startTime":1778569281323,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":647379,"timestamp":197795537121,"id":83,"parentId":46,"tags":{},"startTime":1778569281362,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":673905,"timestamp":197795510645,"id":46,"parentId":19,"tags":{"page":"/api/hub/tmux"},"startTime":1778569281335,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":653100,"timestamp":197795537131,"id":85,"parentId":48,"tags":{},"startTime":1778569281362,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":679443,"timestamp":197795510846,"id":48,"parentId":19,"tags":{"page":"/favicon.ico"},"startTime":1778569281336,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":663734,"timestamp":197795537126,"id":84,"parentId":47,"tags":{},"startTime":1778569281362,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":690161,"timestamp":197795510772,"id":47,"parentId":19,"tags":{"page":"/api/hub/tokens"},"startTime":1778569281335,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":659172,"timestamp":197795543727,"id":86,"parentId":24,"tags":{},"startTime":1778569281368,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":711222,"timestamp":197795491738,"id":24,"parentId":19,"tags":{"page":"/api/anet/config"},"startTime":1778569281316,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":672734,"timestamp":197795547453,"id":87,"parentId":31,"tags":{},"startTime":1778569281372,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":717342,"timestamp":197795502907,"id":31,"parentId":19,"tags":{"page":"/api/hub/events"},"startTime":1778569281328,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":721113,"timestamp":197795537017,"id":73,"parentId":36,"tags":{},"startTime":1778569281362,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":750435,"timestamp":197795507758,"id":36,"parentId":19,"tags":{"page":"/api/hub/networks"},"startTime":1778569281332,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":697085,"timestamp":197795569275,"id":90,"parentId":50,"tags":{},"startTime":1778569281394,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":754221,"timestamp":197795512200,"id":50,"parentId":19,"tags":{"page":"/logs"},"startTime":1778569281337,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":709262,"timestamp":197795569268,"id":89,"parentId":49,"tags":{},"startTime":1778569281394,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":767142,"timestamp":197795511452,"id":49,"parentId":19,"tags":{"page":"/login"},"startTime":1778569281336,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":710318,"timestamp":197795569284,"id":91,"parentId":51,"tags":{},"startTime":1778569281394,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":767280,"timestamp":197795512360,"id":51,"parentId":19,"tags":{"page":"/messages"},"startTime":1778569281337,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":718214,"timestamp":197795569292,"id":92,"parentId":52,"tags":{},"startTime":1778569281394,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":775035,"timestamp":197795512531,"id":52,"parentId":19,"tags":{"page":"/node"},"startTime":1778569281337,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":718409,"timestamp":197795569298,"id":93,"parentId":53,"tags":{},"startTime":1778569281394,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":774999,"timestamp":197795512732,"id":53,"parentId":19,"tags":{"page":"/nodes"},"startTime":1778569281337,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":723863,"timestamp":197795569227,"id":88,"parentId":23,"tags":{},"startTime":1778569281394,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":804244,"timestamp":197795488931,"id":23,"parentId":19,"tags":{"page":"/admin"},"startTime":1778569281314,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":726793,"timestamp":197795569320,"id":96,"parentId":58,"tags":{},"startTime":1778569281394,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":772971,"timestamp":197795523198,"id":58,"parentId":19,"tags":{"page":"/settings/tokens"},"startTime":1778569281348,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":729517,"timestamp":197795569306,"id":94,"parentId":55,"tags":{},"startTime":1778569281394,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":784042,"timestamp":197795514834,"id":55,"parentId":19,"tags":{"page":"/server-logs"},"startTime":1778569281340,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":739890,"timestamp":197795569338,"id":98,"parentId":60,"tags":{},"startTime":1778569281394,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":783654,"timestamp":197795525634,"id":60,"parentId":19,"tags":{"page":"/tasks"},"startTime":1778569281350,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":740165,"timestamp":197795569328,"id":97,"parentId":59,"tags":{},"startTime":1778569281394,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":784949,"timestamp":197795524577,"id":59,"parentId":19,"tags":{"page":"/tasks/[id]"},"startTime":1778569281349,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":745258,"timestamp":197795569346,"id":99,"parentId":54,"tags":{},"startTime":1778569281394,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":800417,"timestamp":197795514252,"id":54,"parentId":19,"tags":{"page":"/"},"startTime":1778569281339,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":728329,"timestamp":197795587270,"id":100,"parentId":57,"tags":{},"startTime":1778569281412,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":799287,"timestamp":197795516356,"id":57,"parentId":19,"tags":{"page":"/settings"},"startTime":1778569281341,"traceId":"dee239da1f71740f"},{"name":"is-page-static","duration":746675,"timestamp":197795569315,"id":95,"parentId":56,"tags":{},"startTime":1778569281394,"traceId":"dee239da1f71740f"},{"name":"check-page","duration":799859,"timestamp":197795516180,"id":56,"parentId":19,"tags":{"page":"/settings/networks"},"startTime":1778569281341,"traceId":"dee239da1f71740f"},{"name":"static-check","duration":843411,"timestamp":197795472672,"id":19,"parentId":1,"tags":{},"startTime":1778569281297,"traceId":"dee239da1f71740f"},{"name":"write-routes-manifest","duration":350,"timestamp":197796326295,"id":102,"parentId":1,"tags":{},"startTime":1778569282151,"traceId":"dee239da1f71740f"},{"name":"load-dotenv","duration":55,"timestamp":197796339154,"id":105,"parentId":104,"tags":{},"startTime":1778569282164,"traceId":"dee239da1f71740f"},{"name":"run-export-path-map","duration":799,"timestamp":197796344347,"id":106,"parentId":104,"tags":{},"startTime":1778569282169,"traceId":"dee239da1f71740f"},{"name":"next-export","duration":709956,"timestamp":197796337897,"id":104,"parentId":1,"tags":{},"startTime":1778569282163,"traceId":"dee239da1f71740f"},{"name":"move-exported-app-not-found-","duration":750,"timestamp":197797052786,"id":107,"parentId":103,"tags":{},"startTime":1778569282877,"traceId":"dee239da1f71740f"},{"name":"move-exported-app-global-error-","duration":494,"timestamp":197797053682,"id":108,"parentId":103,"tags":{},"startTime":1778569282878,"traceId":"dee239da1f71740f"}]
|
|
2
|
-
[{"name":"static-generation","duration":
|
|
1
|
+
[{"name":"generate-buildid","duration":375,"timestamp":199227972017,"id":4,"parentId":1,"tags":{},"startTime":1778570713797,"traceId":"7676b22e95bc18db"},{"name":"load-custom-routes","duration":511,"timestamp":199227972555,"id":5,"parentId":1,"tags":{},"startTime":1778570713797,"traceId":"7676b22e95bc18db"},{"name":"create-dist-dir","duration":761,"timestamp":199227973109,"id":6,"parentId":1,"tags":{},"startTime":1778570713798,"traceId":"7676b22e95bc18db"},{"name":"clean","duration":1236,"timestamp":199227974952,"id":7,"parentId":1,"tags":{},"startTime":1778570713800,"traceId":"7676b22e95bc18db"},{"name":"discover-routes","duration":32026,"timestamp":199228088958,"id":8,"parentId":1,"tags":{},"startTime":1778570713914,"traceId":"7676b22e95bc18db"},{"name":"create-root-mapping","duration":122,"timestamp":199228121088,"id":9,"parentId":1,"tags":{},"startTime":1778570713946,"traceId":"7676b22e95bc18db"},{"name":"generate-route-types","duration":34824,"timestamp":199228123405,"id":10,"parentId":1,"tags":{},"startTime":1778570713948,"traceId":"7676b22e95bc18db"},{"name":"public-dir-conflict-check","duration":109,"timestamp":199228158451,"id":11,"parentId":1,"tags":{},"startTime":1778570713983,"traceId":"7676b22e95bc18db"},{"name":"generate-routes-manifest","duration":4856,"timestamp":199228158688,"id":12,"parentId":1,"tags":{},"startTime":1778570713983,"traceId":"7676b22e95bc18db"},{"name":"run-turbopack","duration":14477389,"timestamp":199228181106,"id":14,"parentId":1,"tags":{},"startTime":1778570714006,"traceId":"7676b22e95bc18db"},{"name":"turbopack-build-events","duration":79,"timestamp":199228498298,"id":15,"parentId":1,"tags":{},"startTime":1778570714323,"traceId":"7676b22e95bc18db"},{"name":"run-typescript","duration":12324315,"timestamp":199242677150,"id":16,"parentId":1,"tags":{},"startTime":1778570728502,"traceId":"7676b22e95bc18db"},{"name":"generate-required-server-files","duration":3356,"timestamp":199255003133,"id":18,"parentId":1,"tags":{},"startTime":1778570740828,"traceId":"7676b22e95bc18db"},{"name":"check-static-error-page","duration":39534,"timestamp":199255147355,"id":20,"parentId":19,"tags":{},"startTime":1778570740972,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":702351,"timestamp":199255192815,"id":62,"parentId":22,"tags":{},"startTime":1778570741018,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":739213,"timestamp":199255156077,"id":22,"parentId":19,"tags":{"page":"/_global-error"},"startTime":1778570740981,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":881159,"timestamp":199255193070,"id":64,"parentId":26,"tags":{},"startTime":1778570741018,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":913422,"timestamp":199255160887,"id":26,"parentId":19,"tags":{"page":"/api/auth/logout"},"startTime":1778570740986,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":954060,"timestamp":199255193114,"id":65,"parentId":27,"tags":{},"startTime":1778570741018,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":989996,"timestamp":199255161129,"id":27,"parentId":19,"tags":{"page":"/api/auth/v3"},"startTime":1778570740986,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":982244,"timestamp":199255193156,"id":66,"parentId":28,"tags":{},"startTime":1778570741018,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1014161,"timestamp":199255161329,"id":28,"parentId":19,"tags":{"page":"/api/hub/audit-log"},"startTime":1778570740986,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":995200,"timestamp":199255193193,"id":67,"parentId":29,"tags":{},"startTime":1778570741018,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1026948,"timestamp":199255161534,"id":29,"parentId":19,"tags":{"page":"/api/hub/auth"},"startTime":1778570740986,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1006366,"timestamp":199255193227,"id":68,"parentId":30,"tags":{},"startTime":1778570741018,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1038516,"timestamp":199255161947,"id":30,"parentId":19,"tags":{"page":"/api/hub/broadcast"},"startTime":1778570740987,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1008234,"timestamp":199255192903,"id":63,"parentId":25,"tags":{},"startTime":1778570741018,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1040641,"timestamp":199255160559,"id":25,"parentId":19,"tags":{"page":"/api/auth/login"},"startTime":1778570740985,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1013852,"timestamp":199255193262,"id":69,"parentId":32,"tags":{},"startTime":1778570741018,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1040886,"timestamp":199255166291,"id":32,"parentId":19,"tags":{"page":"/api/hub/health"},"startTime":1778570740991,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1018036,"timestamp":199255194659,"id":71,"parentId":34,"tags":{},"startTime":1778570741019,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1046221,"timestamp":199255166557,"id":34,"parentId":19,"tags":{"page":"/api/hub/license"},"startTime":1778570740991,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1025661,"timestamp":199255194690,"id":72,"parentId":35,"tags":{},"startTime":1778570741019,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1053339,"timestamp":199255167086,"id":35,"parentId":19,"tags":{"page":"/api/hub/messages"},"startTime":1778570740992,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1031741,"timestamp":199255194750,"id":73,"parentId":36,"tags":{},"startTime":1778570741019,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1059024,"timestamp":199255167534,"id":36,"parentId":19,"tags":{"page":"/api/hub/networks"},"startTime":1778570740992,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1037014,"timestamp":199255192316,"id":61,"parentId":21,"tags":{},"startTime":1778570741017,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1079009,"timestamp":199255150387,"id":21,"parentId":19,"tags":{"page":"/_not-found"},"startTime":1778570740975,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1038968,"timestamp":199255194769,"id":74,"parentId":37,"tags":{},"startTime":1778570741019,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1066599,"timestamp":199255167689,"id":37,"parentId":19,"tags":{"page":"/api/hub/nodes"},"startTime":1778570740992,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1051164,"timestamp":199255194791,"id":76,"parentId":39,"tags":{},"startTime":1778570741019,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1078199,"timestamp":199255167876,"id":39,"parentId":19,"tags":{"page":"/api/hub/send"},"startTime":1778570740993,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1051739,"timestamp":199255194576,"id":70,"parentId":33,"tags":{},"startTime":1778570741019,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1079915,"timestamp":199255166446,"id":33,"parentId":19,"tags":{"page":"/api/hub/inbox"},"startTime":1778570740991,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1065765,"timestamp":199255194797,"id":77,"parentId":40,"tags":{},"startTime":1778570741019,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1092696,"timestamp":199255167953,"id":40,"parentId":19,"tags":{"page":"/api/hub/server-logs"},"startTime":1778570740993,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1066095,"timestamp":199255194804,"id":78,"parentId":41,"tags":{},"startTime":1778570741019,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1091014,"timestamp":199255169941,"id":41,"parentId":19,"tags":{"page":"/api/hub/session"},"startTime":1778570740995,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1071553,"timestamp":199255194814,"id":80,"parentId":43,"tags":{},"startTime":1778570741020,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1093107,"timestamp":199255173316,"id":43,"parentId":19,"tags":{"page":"/api/hub/status"},"startTime":1778570740998,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1072735,"timestamp":199255194809,"id":79,"parentId":42,"tags":{},"startTime":1778570741019,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1095243,"timestamp":199255173151,"id":42,"parentId":19,"tags":{"page":"/api/hub/stats"},"startTime":1778570740998,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1076671,"timestamp":199255194821,"id":81,"parentId":44,"tags":{},"startTime":1778570741020,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1098122,"timestamp":199255173409,"id":44,"parentId":19,"tags":{"page":"/api/hub/task-events"},"startTime":1778570740998,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1080362,"timestamp":199255194829,"id":82,"parentId":45,"tags":{},"startTime":1778570741020,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1101768,"timestamp":199255173475,"id":45,"parentId":19,"tags":{"page":"/api/hub/tasks"},"startTime":1778570740998,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1082180,"timestamp":199255194837,"id":83,"parentId":46,"tags":{},"startTime":1778570741020,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1103484,"timestamp":199255173573,"id":46,"parentId":19,"tags":{"page":"/api/hub/tmux"},"startTime":1778570740998,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1087074,"timestamp":199255194855,"id":85,"parentId":48,"tags":{},"startTime":1778570741020,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1108124,"timestamp":199255173850,"id":48,"parentId":19,"tags":{"page":"/favicon.ico"},"startTime":1778570740999,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1086435,"timestamp":199255200601,"id":86,"parentId":24,"tags":{},"startTime":1778570741025,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1130474,"timestamp":199255156609,"id":24,"parentId":19,"tags":{"page":"/api/anet/config"},"startTime":1778570740981,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1088380,"timestamp":199255201426,"id":87,"parentId":31,"tags":{},"startTime":1778570741026,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1125889,"timestamp":199255163962,"id":31,"parentId":19,"tags":{"page":"/api/hub/events"},"startTime":1778570740989,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1096337,"timestamp":199255194846,"id":84,"parentId":47,"tags":{},"startTime":1778570741020,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1117487,"timestamp":199255173762,"id":47,"parentId":19,"tags":{"page":"/api/hub/tokens"},"startTime":1778570740998,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1149665,"timestamp":199255194778,"id":75,"parentId":38,"tags":{},"startTime":1778570741019,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1176697,"timestamp":199255167802,"id":38,"parentId":19,"tags":{"page":"/api/hub/register"},"startTime":1778570740992,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1125487,"timestamp":199255226704,"id":90,"parentId":50,"tags":{},"startTime":1778570741051,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1177810,"timestamp":199255174438,"id":50,"parentId":19,"tags":{"page":"/logs"},"startTime":1778570740999,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1134760,"timestamp":199255226709,"id":91,"parentId":51,"tags":{},"startTime":1778570741051,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1186951,"timestamp":199255174583,"id":51,"parentId":19,"tags":{"page":"/messages"},"startTime":1778570740999,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1142397,"timestamp":199255226718,"id":92,"parentId":52,"tags":{},"startTime":1778570741051,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1194400,"timestamp":199255174769,"id":52,"parentId":19,"tags":{"page":"/node"},"startTime":1778570740999,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1148333,"timestamp":199255226727,"id":93,"parentId":53,"tags":{},"startTime":1778570741051,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1199936,"timestamp":199255175181,"id":53,"parentId":19,"tags":{"page":"/nodes"},"startTime":1778570741000,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1165383,"timestamp":199255226732,"id":94,"parentId":55,"tags":{},"startTime":1778570741051,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1212715,"timestamp":199255179464,"id":55,"parentId":19,"tags":{"page":"/server-logs"},"startTime":1778570741004,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1170053,"timestamp":199255226740,"id":95,"parentId":56,"tags":{},"startTime":1778570741051,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1217057,"timestamp":199255179810,"id":56,"parentId":19,"tags":{"page":"/settings/networks"},"startTime":1778570741005,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1180716,"timestamp":199255226637,"id":88,"parentId":23,"tags":{},"startTime":1778570741051,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1251052,"timestamp":199255156383,"id":23,"parentId":19,"tags":{"page":"/admin"},"startTime":1778570740981,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1185378,"timestamp":199255226749,"id":96,"parentId":58,"tags":{},"startTime":1778570741051,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1225937,"timestamp":199255186254,"id":58,"parentId":19,"tags":{"page":"/settings/tokens"},"startTime":1778570741011,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1200340,"timestamp":199255226768,"id":98,"parentId":60,"tags":{},"startTime":1778570741051,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1240536,"timestamp":199255186635,"id":60,"parentId":19,"tags":{"page":"/tasks"},"startTime":1778570741011,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1202241,"timestamp":199255226692,"id":89,"parentId":49,"tags":{},"startTime":1778570741051,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1254715,"timestamp":199255174269,"id":49,"parentId":19,"tags":{"page":"/login"},"startTime":1778570740999,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1203497,"timestamp":199255226783,"id":99,"parentId":54,"tags":{},"startTime":1778570741051,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1254481,"timestamp":199255175840,"id":54,"parentId":19,"tags":{"page":"/"},"startTime":1778570741001,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1209426,"timestamp":199255226754,"id":97,"parentId":59,"tags":{},"startTime":1778570741051,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1249736,"timestamp":199255186500,"id":59,"parentId":19,"tags":{"page":"/tasks/[id]"},"startTime":1778570741011,"traceId":"7676b22e95bc18db"},{"name":"is-page-static","duration":1196936,"timestamp":199255239363,"id":100,"parentId":57,"tags":{},"startTime":1778570741064,"traceId":"7676b22e95bc18db"},{"name":"check-page","duration":1256294,"timestamp":199255180032,"id":57,"parentId":19,"tags":{"page":"/settings"},"startTime":1778570741005,"traceId":"7676b22e95bc18db"},{"name":"static-check","duration":1291322,"timestamp":199255145031,"id":19,"parentId":1,"tags":{},"startTime":1778570740970,"traceId":"7676b22e95bc18db"},{"name":"write-routes-manifest","duration":658,"timestamp":199256448696,"id":102,"parentId":1,"tags":{},"startTime":1778570742273,"traceId":"7676b22e95bc18db"},{"name":"load-dotenv","duration":51,"timestamp":199256466109,"id":105,"parentId":104,"tags":{},"startTime":1778570742291,"traceId":"7676b22e95bc18db"},{"name":"run-export-path-map","duration":988,"timestamp":199256470069,"id":106,"parentId":104,"tags":{},"startTime":1778570742295,"traceId":"7676b22e95bc18db"},{"name":"next-export","duration":835786,"timestamp":199256464686,"id":104,"parentId":1,"tags":{},"startTime":1778570742289,"traceId":"7676b22e95bc18db"},{"name":"move-exported-app-not-found-","duration":921,"timestamp":199257311258,"id":107,"parentId":103,"tags":{},"startTime":1778570743136,"traceId":"7676b22e95bc18db"},{"name":"move-exported-app-global-error-","duration":2152,"timestamp":199257312297,"id":108,"parentId":103,"tags":{},"startTime":1778570743137,"traceId":"7676b22e95bc18db"}]
|
|
2
|
+
[{"name":"static-generation","duration":867676,"timestamp":199256456127,"id":103,"parentId":1,"tags":{},"startTime":1778570742281,"traceId":"7676b22e95bc18db"},{"name":"write-routes-manifest","duration":446,"timestamp":199257324739,"id":109,"parentId":1,"tags":{},"startTime":1778570743149,"traceId":"7676b22e95bc18db"},{"name":"print-tree-view","duration":3973,"timestamp":199257345276,"id":110,"parentId":1,"tags":{},"startTime":1778570743170,"traceId":"7676b22e95bc18db"},{"name":"write-route-bundle-stats","duration":24286,"timestamp":199257349289,"id":111,"parentId":1,"tags":{},"startTime":1778570743174,"traceId":"7676b22e95bc18db"},{"name":"telemetry-flush","duration":16151,"timestamp":199257373620,"id":112,"parentId":1,"tags":{},"startTime":1778570743198,"traceId":"7676b22e95bc18db"},{"name":"next-build","duration":29484520,"timestamp":199227905294,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1778570713730,"traceId":"7676b22e95bc18db"}]
|
package/.next/trace-build
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"run-turbopack","duration":
|
|
1
|
+
[{"name":"run-turbopack","duration":14477389,"timestamp":199228181106,"id":14,"parentId":1,"tags":{},"startTime":1778570714006,"traceId":"7676b22e95bc18db"},{"name":"turbopack-build-events","duration":79,"timestamp":199228498298,"id":15,"parentId":1,"tags":{},"startTime":1778570714323,"traceId":"7676b22e95bc18db"},{"name":"run-typescript","duration":12324315,"timestamp":199242677150,"id":16,"parentId":1,"tags":{},"startTime":1778570728502,"traceId":"7676b22e95bc18db"},{"name":"static-check","duration":1291322,"timestamp":199255145031,"id":19,"parentId":1,"tags":{},"startTime":1778570740970,"traceId":"7676b22e95bc18db"},{"name":"static-generation","duration":867676,"timestamp":199256456127,"id":103,"parentId":1,"tags":{},"startTime":1778570742281,"traceId":"7676b22e95bc18db"},{"name":"telemetry-flush","duration":16151,"timestamp":199257373620,"id":112,"parentId":1,"tags":{},"startTime":1778570743198,"traceId":"7676b22e95bc18db"},{"name":"next-build","duration":29484520,"timestamp":199227905294,"id":1,"tags":{"buildMode":"default","version":"16.2.3","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1778570713730,"traceId":"7676b22e95bc18db"}]
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
4
|
import { timeAgo } from './utils';
|
|
5
5
|
import Link from 'next/link';
|
|
6
|
+
import { AliasAvatar } from './AliasAvatar';
|
|
6
7
|
|
|
7
8
|
interface TaskDetail {
|
|
8
9
|
task_id: string;
|
|
@@ -113,11 +114,15 @@ export function TaskDrawer({ taskId, onClose }: TaskDrawerProps) {
|
|
|
113
114
|
)}
|
|
114
115
|
</div>
|
|
115
116
|
|
|
116
|
-
{/* From → To
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
<
|
|
117
|
+
{/* From → To — round 41: use AliasAvatar so from/to colours
|
|
118
|
+
match the rest of the app instead of the legacy blue/cyan
|
|
119
|
+
hardcode. */}
|
|
120
|
+
<div className="flex items-center gap-2 text-sm flex-wrap">
|
|
121
|
+
{task.from_name && <AliasAvatar alias={task.from_name} size={18} />}
|
|
122
|
+
<span className="text-gray-200 font-medium">{task.from_name || '--'}</span>
|
|
123
|
+
<span className="text-gray-600">→</span>
|
|
124
|
+
{task.to_name && <AliasAvatar alias={task.to_name} size={18} />}
|
|
125
|
+
<span className="text-gray-200 font-medium">{task.to_name || '--'}</span>
|
|
121
126
|
</div>
|
|
122
127
|
|
|
123
128
|
{/* Timeline — round 36 polish: relative timestamps, current-step
|
package/app/logs/page.tsx
CHANGED
|
@@ -77,10 +77,12 @@ export default function LogsPage() {
|
|
|
77
77
|
return (
|
|
78
78
|
<div className="min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono">
|
|
79
79
|
<div className="flex items-center gap-4 mb-6">
|
|
80
|
-
<h1 className="text-2xl font-bold text-white lg:ml-0 ml-10">
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
<h1 className="text-2xl font-bold text-white lg:ml-0 ml-10">Audit Log</h1>
|
|
81
|
+
{logs.length > 0 && (
|
|
82
|
+
<span className="text-xs bg-blue-900/30 text-blue-400 px-2 py-0.5 rounded-full border border-blue-800/30">
|
|
83
|
+
{logs.length}
|
|
84
|
+
</span>
|
|
85
|
+
)}
|
|
84
86
|
</div>
|
|
85
87
|
|
|
86
88
|
<div className="flex flex-wrap gap-3 mb-6">
|
package/app/messages/page.tsx
CHANGED
|
@@ -206,16 +206,19 @@ export default function MessagesPage() {
|
|
|
206
206
|
<div key={ci} className="bg-[#111128] border border-[#2a2a4a] rounded-xl overflow-hidden">
|
|
207
207
|
<div className="px-4 py-2.5 border-b border-[#2a2a4a] flex items-center justify-between">
|
|
208
208
|
<div className="flex items-center gap-2">
|
|
209
|
-
<
|
|
209
|
+
<AliasAvatar alias={conv.participants[0]} size={16} />
|
|
210
|
+
<span className="text-sm text-gray-200 font-medium">{conv.participants[0]}</span>
|
|
210
211
|
<span className="text-gray-600 text-xs">↔</span>
|
|
211
|
-
<
|
|
212
|
+
<AliasAvatar alias={conv.participants[1]} size={16} />
|
|
213
|
+
<span className="text-sm text-gray-200 font-medium">{conv.participants[1]}</span>
|
|
212
214
|
</div>
|
|
213
215
|
<span className="text-[10px] text-gray-600">{conv.messages.length} messages</span>
|
|
214
216
|
</div>
|
|
215
217
|
<div className="px-4 py-2 space-y-2 max-h-64 overflow-y-auto">
|
|
216
218
|
{conv.messages.map(m => (
|
|
217
219
|
<div key={m.id} className="flex items-start gap-2 text-xs py-1">
|
|
218
|
-
|
|
220
|
+
{m.from_alias && <AliasAvatar alias={m.from_alias} size={14} />}
|
|
221
|
+
<span className="shrink-0 font-medium text-gray-200">{m.from_alias}</span>
|
|
219
222
|
<span className="text-gray-400 flex-1">{m.content?.slice(0, 120) || '--'}</span>
|
|
220
223
|
<span className="text-[9px] text-gray-600 shrink-0">{timeAgo(m.created_at || '')}</span>
|
|
221
224
|
</div>
|
package/package.json
CHANGED
|
@@ -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),a=Math.floor(e%3600/60);return t>0?`${t}h ${a}m`:`${a}m`},"timeAgo",0,function(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}])},69874,e=>{"use strict";var t=e.i(18050);let a=[180,200,220,270,300,330,30,90];e.s(["AliasAvatar",0,function({alias:e,size:s=28,className:r=""}){let l=function(e){let t=0;for(let a=0;a<e.length;a++)t=31*t+e.charCodeAt(a)>>>0;let s=a[t%a.length];return{bg:`hsl(${s} 55% 22%)`,ring:`hsl(${s} 60% 45%)`,text:`hsl(${s} 80% 78%)`}}(e),n=Math.max(9,Math.round(.42*s));return(0,t.jsx)("span",{className:`anet-alias-avatar inline-flex items-center justify-center rounded-full border shrink-0 font-semibold ${r}`,style:{width:s,height:s,fontSize:n,backgroundColor:l.bg,borderColor:l.ring,color:l.text},title:e,"aria-hidden":!0,children:e?(e.trim().match(/[\p{L}\p{N}]/u)?.[0]||e.trim()[0]||"·").toUpperCase():"·"})}])},95356,e=>{"use strict";var t=e.i(18050),a=e.i(22016);let s={nodes:{title:"No agents in this network",sub:"Agent sessions will appear here once they connect to the CommHub."},tasks:{title:"No tasks yet",sub:"Tasks will appear here when agents send them via CommHub."},messages:{title:"No messages",sub:"Messages between agents will appear here."},logs:{title:"No audit logs",sub:"Events will appear here when users register, login, or perform actions."},tokens:{title:"No API tokens",sub:"Create one to authenticate CLI tools and external integrations."},networks:{title:"No networks found",sub:"Create one or sign in with V3 auth to see your networks."},generic:{title:"Nothing here yet",sub:"Data will appear here once available."}};function r({variant:e,size:a}){let s={width:a,height:a},l={fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"nodes":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...l,children:[(0,t.jsx)("circle",{cx:"32",cy:"14",r:"4"}),(0,t.jsx)("circle",{cx:"14",cy:"44",r:"4"}),(0,t.jsx)("circle",{cx:"50",cy:"44",r:"4"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"14",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"32",y1:"18",x2:"50",y2:"40",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("line",{x1:"18",y1:"44",x2:"46",y2:"44",strokeDasharray:"3 3",opacity:"0.6"})]})});case"tasks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...l,children:[(0,t.jsx)("rect",{x:"14",y:"14",width:"36",height:"6",rx:"1.5"}),(0,t.jsx)("rect",{x:"14",y:"26",width:"36",height:"6",rx:"1.5",opacity:"0.6"}),(0,t.jsx)("rect",{x:"14",y:"38",width:"36",height:"6",rx:"1.5",opacity:"0.35"})]})});case"messages":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...l,children:[(0,t.jsx)("path",{d:"M14 18 h36 a3 3 0 0 1 3 3 v18 a3 3 0 0 1 -3 3 h-18 l-8 6 v-6 h-10 a3 3 0 0 1 -3 -3 v-18 a3 3 0 0 1 3 -3 z"}),(0,t.jsx)("line",{x1:"22",y1:"28",x2:"42",y2:"28",opacity:"0.5"}),(0,t.jsx)("line",{x1:"22",y1:"34",x2:"36",y2:"34",opacity:"0.5"})]})});case"logs":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...l,children:[(0,t.jsx)("path",{d:"M18 12 h22 l8 8 v32 a2 2 0 0 1 -2 2 h-28 a2 2 0 0 1 -2 -2 v-38 a2 2 0 0 1 2 -2 z"}),(0,t.jsx)("path",{d:"M40 12 v8 h8",opacity:"0.6"}),(0,t.jsx)("line",{x1:"24",y1:"32",x2:"40",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"24",y1:"38",x2:"40",y2:"38",opacity:"0.4"}),(0,t.jsx)("line",{x1:"24",y1:"44",x2:"34",y2:"44",opacity:"0.25"})]})});case"tokens":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...l,children:[(0,t.jsx)("circle",{cx:"22",cy:"32",r:"8"}),(0,t.jsx)("line",{x1:"30",y1:"32",x2:"54",y2:"32"}),(0,t.jsx)("line",{x1:"44",y1:"32",x2:"44",y2:"38"}),(0,t.jsx)("line",{x1:"50",y1:"32",x2:"50",y2:"40"})]})});case"networks":return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...l,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"18"}),(0,t.jsx)("ellipse",{cx:"32",cy:"32",rx:"18",ry:"9",opacity:"0.55"}),(0,t.jsx)("line",{x1:"14",y1:"32",x2:"50",y2:"32",opacity:"0.55"}),(0,t.jsx)("line",{x1:"32",y1:"14",x2:"32",y2:"50",opacity:"0.55"})]})});default:return(0,t.jsx)("svg",{viewBox:"0 0 64 64",...s,children:(0,t.jsxs)("g",{...l,children:[(0,t.jsx)("circle",{cx:"32",cy:"32",r:"14",strokeDasharray:"3 3",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"32",cy:"32",r:"3"})]})})}}function l({variant:e="generic",title:n,sub:i,cta:d,compact:c=!1}){let o=s[e],x=n??o.title,h=i??o.sub;return(0,t.jsxs)("div",{className:`text-center ${c?"py-8":"py-16"} px-4`,role:"status",children:[(0,t.jsx)("div",{className:"anet-empty-glyph inline-flex items-center justify-center mb-4 text-gray-500","aria-hidden":!0,children:(0,t.jsx)(r,{variant:e,size:c?40:56})}),(0,t.jsx)("h3",{className:`font-medium text-gray-300 ${c?"text-sm":"text-base"}`,children:x}),h&&(0,t.jsx)("p",{className:`text-gray-500 ${c?"text-xs mt-1.5":"text-sm mt-2"} max-w-md mx-auto leading-relaxed`,children:h}),d&&(0,t.jsx)("div",{className:"mt-4",children:d.href?(0,t.jsxs)(a.default,{href:d.href,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[d.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]}):(0,t.jsxs)("button",{onClick:d.onClick,className:"inline-flex items-center gap-1.5 text-sm font-medium text-cyan-400 hover:text-cyan-300",children:[d.label,(0,t.jsx)("span",{"aria-hidden":!0,children:"→"})]})})]})}e.s(["EmptyState",0,l,"NodesEmptyState",0,function({hint:e}){return e?.global_count?(0,t.jsx)(l,{variant:"nodes",title:"No agents in this network",sub:`Server has ${e.global_count} nodes globally, but none are registered to the current network. Switch network or contact admin.`}):(0,t.jsx)(l,{variant:"nodes",cta:{label:"Run anet quickstart",href:"https://anet.sh"}})}])},96527,e=>{"use strict";var t=e.i(18050),a=e.i(71645),s=e.i(18566),r=e.i(58963),l=e.i(18150);let n={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 i({taskId:e,onClose:s}){let[r,d]=(0,a.useState)(null),[c,o]=(0,a.useState)([]),[x,h]=(0,a.useState)(!0);(0,a.useEffect)(()=>{(async()=>{try{let[t,a]=await Promise.all([fetch(`/api/hub/tasks?task_id=${encodeURIComponent(e)}`),fetch(`/api/hub/task-events?task_id=${encodeURIComponent(e)}&limit=50`)]),s=await t.json(),r=await a.json();s.tasks?.[0]&&d(s.tasks[0]),o(r.events||[])}catch{}finally{h(!1)}})()},[e]);let m=r?[{key:"created",label:"Created",time:r.created_at,color:"bg-gray-400"},{key:"delivered",label:"Delivered",time:r.delivered_at,color:"bg-blue-400"},{key:"started",label:"Started",time:r.started_at,color:"bg-green-400"},{key:"completed",label:"Completed",time:r.completed_at,color:"bg-purple-400"}].map(e=>({...e,done:!!e.time})):[],p=m.findIndex(e=>!e.done),g=r&&"completed"!==r.status&&"failed"!==r.status&&"expired"!==r.status&&"cancelled"!==r.status,u=r?.started_at&&r?.completed_at?Math.round((new Date(r.completed_at).getTime()-new Date(r.started_at).getTime())/1e3):null;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/30 z-40 anet-fade-in",onClick:s}),(0,t.jsxs)("div",{className:"fixed top-0 right-0 h-full w-full lg:w-[500px] bg-[#0a0a1a] border-l border-[#2a2a4a] z-50 flex flex-col shadow-2xl shadow-black/60 overflow-y-auto animate-slide-in",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 border-b border-[#2a2a4a] bg-[#0d0d1a] sticky top-0",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-white",children:"Task Detail"}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-500 mt-0.5",children:[e.slice(0,16),"..."]})]}),(0,t.jsx)("button",{onClick:s,className:"text-gray-500 hover:text-white p-1.5 rounded-lg hover:bg-[#1a1a2a]",children:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),x?(0,t.jsx)("div",{className:"flex justify-center py-16",children:(0,t.jsx)("div",{className:"w-6 h-6 border-2 border-cyan-500/30 border-t-cyan-500 rounded-full animate-spin"})}):r?(0,t.jsxs)("div",{className:"px-5 py-5 space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:`text-lg font-bold ${n[r.status]||"text-gray-400"}`,children:r.status}),"normal"!==r.priority&&(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded border ${"high"===r.priority?"text-red-300 border-red-500/20":"text-gray-400 border-gray-600/20"}`,children:r.priority}),null!==u&&(0,t.jsxs)("span",{className:"text-xs text-gray-500",children:["⏱ ",u<60?`${u}s`:`${Math.floor(u/60)}m ${u%60}s`]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"text-blue-400 font-medium",children:r.from_name||"--"}),(0,t.jsx)("span",{className:"text-gray-600",children:"→"}),(0,t.jsx)("span",{className:"text-cyan-400 font-medium",children:r.to_name||"--"})]}),(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 uppercase tracking-wide",children:"Timeline"}),null!==u&&(0,t.jsxs)("div",{className:"text-[10px] text-gray-600",children:[u<60?`${u}s`:`${Math.floor(u/60)}m ${u%60}s`," runtime"]})]}),(0,t.jsx)("div",{className:"space-y-3",children:m.map((e,a)=>{let s=g&&a===p,r=!!m[a+1]?.done;return(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center pt-0.5",children:[(0,t.jsx)("span",{className:`relative w-3 h-3 rounded-full shrink-0 ${e.done?e.color:"bg-gray-700"}`,children:s&&(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute -inset-1 rounded-full border border-current opacity-60 anet-current-step-pulse",style:{borderColor:"currentColor"}})}),a<m.length-1&&(0,t.jsx)("div",{className:`w-0.5 h-5 mt-1 ${e.done&&r?"bg-gray-500":e.done?"bg-gradient-to-b from-gray-500 to-gray-800":"bg-gray-800"}`})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:`text-xs font-medium flex items-center gap-2 ${e.done?"text-gray-200":s?"text-cyan-300":"text-gray-600"}`,children:[(0,t.jsx)("span",{children:e.label}),s&&(0,t.jsx)("span",{className:"text-[9px] uppercase tracking-wide text-cyan-400",children:"in progress"})]}),(0,t.jsx)("div",{className:"text-[10px] text-gray-500",title:e.time||void 0,children:e.time?(0,l.timeAgo)(e.time):s?"—":"Pending"})]})]},e.key)})})]}),(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 uppercase mb-2",children:"Input"}),(0,t.jsx)("div",{className:"text-sm text-gray-300 whitespace-pre-wrap",children:r.content||"--"})]}),r.result&&(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 uppercase mb-2",children:"Output"}),(0,t.jsx)("div",{className:"text-sm text-gray-300 whitespace-pre-wrap max-h-64 overflow-y-auto",children:r.result})]}),c.length>0&&(0,t.jsxs)("div",{className:"bg-[#111128] border border-[#2a2a4a] rounded-xl p-4",children:[(0,t.jsxs)("div",{className:"text-xs text-gray-500 uppercase mb-2",children:["Events (",c.length,")"]}),(0,t.jsx)("div",{className:"space-y-1.5 max-h-40 overflow-y-auto",children:c.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[11px]",children:[(0,t.jsx)("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${"running"===e.to_status?"bg-green-400":"replied"===e.to_status?"bg-purple-400":"failed"===e.to_status?"bg-red-400":"bg-blue-400"}`}),(0,t.jsx)("span",{className:"text-gray-400",children:e.event_type}),e.from_status&&(0,t.jsxs)("span",{className:"text-gray-600",children:[e.from_status,"→",e.to_status]}),(0,t.jsx)("span",{className:"text-gray-600 ml-auto",children:(0,l.timeAgo)(e.created_at)})]},e.id))})]}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-600 space-y-1",children:[(0,t.jsxs)("div",{children:["Task ID: ",r.task_id]}),r.expires_at&&(0,t.jsxs)("div",{children:["Expires: ",r.expires_at]})]})]}):(0,t.jsx)("div",{className:"text-center py-16 text-gray-500",children:"Task not found"})]})]})}var d=e.i(95356),c=e.i(69874);let o=["","created","delivered","acked","running","replied","closed","failed","cancelled","expired"],x={created:"bg-gray-500/10 text-gray-400 border-gray-500/20",delivered:"bg-blue-500/10 text-blue-300 border-blue-500/20",acked:"bg-cyan-500/10 text-cyan-300 border-cyan-500/20",running:"bg-green-500/10 text-green-300 border-green-500/20",replied:"bg-purple-500/10 text-purple-300 border-purple-500/20",closed:"bg-gray-500/10 text-gray-500 border-gray-500/20",failed:"bg-red-500/10 text-red-300 border-red-500/20",cancelled:"bg-yellow-500/10 text-yellow-300 border-yellow-500/20",expired:"bg-orange-500/10 text-orange-300 border-orange-500/20"},h={created:"#9ca3af",delivered:"#60a5fa",acked:"#22d3ee",running:"#4ade80",replied:"#a78bfa",closed:"#6b7280",failed:"#f87171",cancelled:"#facc15",expired:"#fb923c"};function m(e){let t=x[e]||"bg-gray-500/10 text-gray-400 border-gray-500/20";return`text-xs px-2 py-0.5 rounded-md border ${t}`}function p(e){return"high"===e?"text-red-400":"low"===e?"text-gray-600":"text-gray-400"}function g(e){if(!e)return"--";let t=Math.floor((Date.now()-new Date(e.replace(" ","T")+"Z").getTime())/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function u(){let e,l,n,u=(0,s.useSearchParams)(),{networkId:y}=(0,r.useNetworkId)(),[b,j]=(0,a.useState)([]),[v,f]=(0,a.useState)(0),[N,w]=(0,a.useState)(!0),[k,_]=(0,a.useState)(""),[$,C]=(0,a.useState)(new Set),[S,M]=(0,a.useState)(u.get("status")||""),[T,A]=(0,a.useState)(""),[D,B]=(0,a.useState)(""),[I,L]=(0,a.useState)(null),E=e=>{C(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})},P=(0,a.useCallback)(async()=>{try{let e=new URLSearchParams;y&&e.set("network_id",y),S&&e.set("status",S),T&&e.set("from_name",T),D&&e.set("to_name",D),e.set("limit","100");let t=await fetch(`/api/hub/tasks?${e.toString()}`);if(401===t.status)return void window.location.assign("/login");let a=await t.json();j(a.tasks||[]),f(a.count??(a.tasks?.length||0)),_("")}catch(e){_(e instanceof Error?e.message:"fetch failed")}finally{w(!1)}},[S,T,D,y]);return(0,a.useEffect)(()=>{w(!0),P();let e=setInterval(P,5e3);return()=>clearInterval(e)},[P]),(0,t.jsxs)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-4 sm:p-6 font-mono",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-white lg:ml-0 ml-10",children:"Tasks"}),(0,t.jsx)("span",{className:"text-xs bg-blue-900/30 text-blue-400 px-2 py-0.5 rounded-full border border-blue-800/30",children:v})]}),(0,t.jsx)("div",{className:"anet-tabstrip-wrap mb-4",children:(0,t.jsx)("div",{className:"anet-tabstrip flex sm:flex-wrap gap-1 bg-[#111128] rounded-lg border border-[#2a2a4a] p-1 overflow-x-auto sm:overflow-x-visible scrollbar-thin",children:["",...o.filter(Boolean)].map(e=>(0,t.jsxs)("button",{onClick:()=>M(e),className:`px-3 py-1.5 rounded-md text-xs transition-colors flex items-center gap-1.5 shrink-0 whitespace-nowrap ${S===e?`${x[e]||"bg-cyan-500/10 text-cyan-300 border-cyan-500/20"} border`:"text-gray-500 hover:text-gray-300 hover:bg-[#1a1a2a]/40"}`,children:[e&&(0,t.jsx)("span",{"aria-hidden":!0,className:"inline-block w-1.5 h-1.5 rounded-full shrink-0",style:{backgroundColor:h[e]||"#6b7280"}}),(0,t.jsx)("span",{children:e||"All"})]},e))})}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 rounded-lg border border-[#2a2a4a] bg-[#111128] px-2.5 py-1.5 focus-within:border-blue-500/40",children:[(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-gray-600",children:"From"}),(0,t.jsx)("input",{type:"text",value:T,onChange:e=>A(e.target.value),placeholder:"any node",className:"w-28 bg-transparent text-sm text-white placeholder-gray-700 focus:outline-none"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 rounded-lg border border-[#2a2a4a] bg-[#111128] px-2.5 py-1.5 focus-within:border-blue-500/40",children:[(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-gray-600",children:"To"}),(0,t.jsx)("input",{type:"text",value:D,onChange:e=>B(e.target.value),placeholder:"any node",className:"w-28 bg-transparent text-sm text-white placeholder-gray-700 focus:outline-none"})]}),(S||T||D)&&(0,t.jsx)("button",{type:"button",onClick:()=>{M(""),A(""),B("")},className:"rounded-lg border border-gray-700 px-2.5 py-1.5 text-[11px] text-gray-500 hover:text-gray-200 hover:border-gray-600",children:"Clear filters"})]}),b.length>0&&!S&&(e={},b.forEach(t=>{e[t.status]=(e[t.status]||0)+1}),l=b.length||1,(n=[{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:n.map(a=>(0,t.jsx)("div",{className:a.color,style:{width:`${e[a.key]/l*100}%`}},a.key))}),(0,t.jsx)("div",{className:"flex flex-wrap gap-3 mt-1.5 text-[10px] text-gray-500",children:n.map(a=>(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:`inline-block w-2 h-2 rounded-full ${a.color} mr-1`}),e[a.key]," ",a.key]},a.key))})]}):null),k&&(0,t.jsx)("div",{className:"bg-red-900/20 border border-red-800/40 text-red-300 px-4 py-2 rounded-lg mb-6 text-sm",children:k}),N?(0,t.jsx)("div",{className:"animate-pulse space-y-3",children:[1,2,3,4,5].map(e=>(0,t.jsx)("div",{className:"h-20 bg-gray-800/20 rounded-lg border border-gray-800/40"},e))}):0===b.length?(0,t.jsx)(d.EmptyState,{variant:"tasks",sub:S||T||D?"No tasks match the current filters. Try clearing them.":"Tasks will appear here when agents send them via CommHub."}):(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"hidden sm:grid sm:grid-cols-12 gap-2 px-4 py-2 text-xs text-gray-600 uppercase",children:[(0,t.jsx)("div",{className:"col-span-1",children:"Status"}),(0,t.jsx)("div",{className:"col-span-2",children:"From"}),(0,t.jsx)("div",{className:"col-span-2",children:"To"}),(0,t.jsx)("div",{className:"col-span-4",children:"Content"}),(0,t.jsx)("div",{className:"col-span-1",children:"Priority"}),(0,t.jsx)("div",{className:"col-span-2",children:"Time"})]}),b.map(e=>{let a=$.has(e.task_id);return(0,t.jsxs)("div",{className:`anet-task-row group bg-[#111128] border rounded-lg px-4 py-3 transition-all duration-200 cursor-pointer ${a?"border-[#3a3a5a] shadow-lg shadow-black/20":"border-[#2a2a4a] hover:border-[#3a3a5a] hover:bg-[#15152e]"}`,onClick:()=>E(e.task_id),role:"button",tabIndex:0,"aria-expanded":a,onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),E(e.task_id))},children:[(0,t.jsxs)("div",{className:"hidden sm:grid sm:grid-cols-12 gap-2 items-center",children:[(0,t.jsx)("div",{className:"col-span-1",children:(0,t.jsx)("span",{className:m(e.status),children:e.status})}),(0,t.jsxs)("div",{className:"col-span-2 flex items-center gap-1.5 min-w-0",title:e.from_name,children:[e.from_name&&(0,t.jsx)(c.AliasAvatar,{alias:e.from_name,size:18}),(0,t.jsx)("span",{className:"truncate text-sm text-gray-200",children:e.from_name||"--"})]}),(0,t.jsxs)("div",{className:"col-span-2 flex items-center gap-1.5 min-w-0",title:e.to_name,children:[e.to_name&&(0,t.jsx)(c.AliasAvatar,{alias:e.to_name,size:18}),(0,t.jsx)("span",{className:"truncate text-sm text-gray-200",children:e.to_name||"--"})]}),(0,t.jsx)("div",{className:"col-span-4 text-xs text-gray-400 truncate",title:e.content,children:e.content||"--"}),(0,t.jsx)("div",{className:"col-span-1",children:(0,t.jsx)("span",{className:`text-xs ${p(e.priority)}`,children:e.priority||"normal"})}),(0,t.jsxs)("div",{className:"col-span-2 text-xs text-gray-500 flex items-center justify-between gap-2",title:e.created_at,children:[(0,t.jsx)("span",{className:"truncate",children:g(e.created_at)}),(0,t.jsx)("svg",{"aria-hidden":!0,className:`shrink-0 text-gray-600 group-hover:text-gray-400 transition-transform duration-200 ${a?"rotate-180":""}`,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 9l6 6 6-6"})})]})]}),(0,t.jsxs)("div",{className:"sm:hidden space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:m(e.status),children:e.status}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:`text-xs ${p(e.priority)}`,children:e.priority||"normal"}),(0,t.jsx)("svg",{"aria-hidden":!0,className:`text-gray-600 transition-transform duration-200 ${a?"rotate-180":""}`,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 9l6 6 6-6"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-gray-300 min-w-0",children:[e.from_name&&(0,t.jsx)(c.AliasAvatar,{alias:e.from_name,size:16}),(0,t.jsx)("span",{className:"truncate max-w-[40%]",children:e.from_name||"--"}),(0,t.jsx)("span",{className:"text-gray-600",children:"→"}),e.to_name&&(0,t.jsx)(c.AliasAvatar,{alias:e.to_name,size:16}),(0,t.jsx)("span",{className:"truncate max-w-[40%]",children:e.to_name||"--"})]}),(0,t.jsx)("div",{className:"text-xs text-gray-400 line-clamp-1",children:e.content||"--"}),(0,t.jsx)("div",{className:"text-xs text-gray-600",children:g(e.created_at)})]}),(0,t.jsx)("div",{className:`grid transition-all duration-300 ease-out ${a?"grid-rows-[1fr] opacity-100 mt-3":"grid-rows-[0fr] opacity-0"}`,"aria-hidden":!a,children:(0,t.jsx)("div",{className:"overflow-hidden",children:(0,t.jsxs)("div",{className:"pt-3 border-t border-[#2a2a4a] space-y-3",children:[e.content&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-xs text-gray-600 mb-1",children:"Content"}),(0,t.jsx)("div",{className:"text-xs text-gray-300 whitespace-pre-wrap bg-[#0a0a15] rounded-lg px-3 py-2 border border-[#1a1a2a]",children:e.content})]}),e.result&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-xs text-gray-600 mb-1",children:"Result"}),(0,t.jsx)("div",{className:"text-xs text-gray-300 whitespace-pre-wrap bg-[#0a0a15] rounded-lg px-3 py-2 border border-[#1a1a2a] max-h-48 overflow-y-auto",children:e.result})]}),(0,t.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[["Created",e.created_at],["Delivered",e.delivered_at],["Started",e.started_at],["Completed",e.completed_at]].map(([e,a])=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"text-gray-600",children:[e,": "]}),(0,t.jsx)("span",{className:"text-gray-400",children:a?g(a):"--"})]},e))}),e.expires_at&&(0,t.jsxs)("div",{className:"text-xs",children:[(0,t.jsx)("span",{className:"text-gray-600",children:"Expires: "}),(0,t.jsx)("span",{className:"text-orange-400",children:e.expires_at})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"text-xs text-gray-600 truncate",title:e.task_id,children:["ID: ",e.task_id]}),(0,t.jsxs)("div",{className:"flex gap-2 shrink-0",children:[("failed"===e.status||"expired"===e.status)&&(0,t.jsx)("button",{onClick:async t=>{t.stopPropagation(),await fetch("/api/hub/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({alias:e.to_name,task:e.content,priority:e.priority})}),P()},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(),L(e.task_id)},className:"text-xs text-cyan-400 hover:text-cyan-300",children:"Detail →"})]})]})]})})})]},e.task_id)})]}),I&&(0,t.jsx)(i,{taskId:I,onClose:()=>L(null)})]})}e.s(["default",0,function(){return(0,t.jsx)(a.Suspense,{fallback:(0,t.jsx)("div",{className:"min-h-screen bg-[#0a0a1a] text-gray-100 p-6 font-mono",children:"Loading tasks..."}),children:(0,t.jsx)(u,{})})}],96527)}]);
|
|
File without changes
|
/package/.next/static/{RDAJRcyAgDTmWYawG6reI → -QuV308VJodU6OydFIUaR}/_clientMiddlewareManifest.js
RENAMED
|
File without changes
|