@hivemagnus/magnus-ui 3.0.0 → 3.0.1
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/dist/app/apps/dashboard/.next/BUILD_ID +1 -1
- package/dist/app/apps/dashboard/.next/build-manifest.json +3 -3
- package/dist/app/apps/dashboard/.next/prerender-manifest.json +3 -3
- package/dist/app/apps/dashboard/.next/required-server-files.json +2 -2
- package/dist/app/apps/dashboard/.next/server/app/_global-error.html +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api-docs/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api-docs/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/application-operations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/application-operations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/audit/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/installations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/installations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/commands/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/commands/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page/server-reference-manifest.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/files/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/files/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-map/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-map/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/operations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/operations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-security/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-security/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/incidents/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/incidents/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/library/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/library/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/login/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/logs/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/logs/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/mission-control/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/mission-control/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/notifications/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/notifications/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/retention/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/retention/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/roles/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/roles/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/rollouts/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/rollouts/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page/server-reference-manifest.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__06giq9g4me8eh._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__08sgyyf_y8ab8._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__11pe-l2-ko65_._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/_0caxc2bc6a__r._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/_1oebzzj_en62h._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_0gs_s688kgg1i._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_ardent_installations_page_tsx_0nvqgacugy6nf._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_cron_page_tsx_1i3duyygc0_tg._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_nodes_nodes-client_tsx_0pt4iarhpqbgn._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_skills_page_tsx_0n5zp4xad38in._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_lib_agent-upgrade-view_ts_1nvhevz6hq0t2._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/middleware-build-manifest.js +3 -3
- package/dist/app/apps/dashboard/.next/server/pages/500.html +1 -1
- package/dist/app/apps/dashboard/.next/server/preview-props.json +3 -3
- package/dist/app/apps/dashboard/.next/server/server-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/server-reference-manifest.json +3 -3
- package/dist/app/apps/dashboard/.next/static/chunks/{44dwe88hy6p-v.js → 0vavzfxiifcwc.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{215cfit1tgz2o.js → 1kx48jg-4j5iv.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{0ys--bqqe6t4s.js → 1p-c6o7qsu5ou.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{2_48s79dhn63g.js → 25a8c2es3dpaa.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{3i3g_ym_8f0d3.js → 269qlvth5p8b4.js} +4 -4
- package/dist/app/apps/dashboard/.next/static/chunks/{0_n9q2hjh1o0m.js → 2b1ydgoygp0dh.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{1_4ptlitrm5f-.js → 3gpf_4ytco8dz.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/3s98rvw78e82w.js +1 -0
- package/dist/app/apps/dashboard/package.json +2 -2
- package/dist/app/apps/dashboard/server.js +1 -1
- package/package.json +2 -2
- package/dist/app/apps/dashboard/.next/static/chunks/3y_9v_-9n_gex.js +0 -1
- /package/dist/app/apps/dashboard/.next/static/{ywfB1_CLcZP5CETb_wqH0 → L-DxwQwJQSLJRijzllP8k}/_buildManifest.js +0 -0
- /package/dist/app/apps/dashboard/.next/static/{ywfB1_CLcZP5CETb_wqH0 → L-DxwQwJQSLJRijzllP8k}/_clientMiddlewareManifest.js +0 -0
- /package/dist/app/apps/dashboard/.next/static/{ywfB1_CLcZP5CETb_wqH0 → L-DxwQwJQSLJRijzllP8k}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[81837,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(68415),e=a.i(58299),f=a.i(49521),g=a.i(85063),h=a.i(46997),i=a.i(5739),j=a.i(8897),k=a.i(5050);let l=(0,k.createServerReference)("40eaee6a56695d1a26e01c8974d1a5f7c1e1306daa",k.callServer,void 0,k.findSourceMapURL,"scanCron");var m=a.i(8387),n=a.i(73771),o=a.i(33855),p=a.i(19783),q=a.i(33540),r=a.i(8311),s=a.i(34532),t=a.i(89027),u=a.i(41146),v=a.i(1661),w=a.i(75160),x=a.i(57307),y=a.i(70944),z=a.i(68579),A=a.i(13412),B=a.i(11134);a.s(["default",0,function(){let{activeNode:a}=(0,j.l)(),[k,C]=(0,c.useState)([]),[D,E]=(0,c.useState)(!1),[F,G]=(0,c.useState)(null),[H,I]=(0,c.useState)(!1),[J,K]=(0,c.useState)(""),[L,M]=(0,c.useState)(new Set),[N,O]=(0,c.useState)(null),[P,Q]=(0,c.useState)("1.0.0"),[R,S]=(0,c.useState)(""),[T,U]=(0,c.useState)(!1),V=(0,c.useCallback)(async()=>{E(!0),C([]),G(null);let b=Date.now();try{let b=await l(a.id);if(b.success&&Array.isArray(b.data)){let a=b.data.map(a=>({...a,status:"error"===a.status?"error":"done"}));C(a);let c=new Set(a.filter(a=>a.jobs.length>0).map(a=>a.nodeId));M(c.size>0?c:new Set(a.map(a=>a.nodeId)))}else G(b.error?.message??"Scan returned unsuccessful response")}catch(b){let a=b instanceof Error?b.message:"Scan request failed";G(a)}finally{let a=Date.now()-b;a<1500&&await new Promise(b=>setTimeout(b,1500-a)),E(!1),I(!0)}},[a]);(0,c.useEffect)(()=>{a&&V()},[a,V]);let W=k.reduce((a,b)=>a+("done"===b.status?b.jobs.length:0),0),X=k.filter(a=>"done"===a.status).length,Y=k.filter(a=>"error"===a.status).length,Z=a=>{if(!J)return!0;let b=J.toLowerCase();return a.name.toLowerCase().includes(b)||a.command.toLowerCase().includes(b)||a.schedule.toLowerCase().includes(b)||(a.user?.toLowerCase().includes(b)??!1)},$=async()=>{if(N&&P){U(!0);try{let a=JSON.stringify({name:N.job.name,version:P,schedule:N.job.schedule,command:N.job.command,description:R},null,2);await h.f.library.files.create({name:`${N.job.name} v${P}`,fileName:`${N.job.name}-${P}.json`,mimeType:"application/x-magnus-cronjob",content:a,tags:["cronjob","cron"]}),O(null),Q("1.0.0"),S("")}catch{}finally{U(!1)}}};return(0,b.jsxs)(n.U,{className:"space-y-6",children:[(0,b.jsx)(n.z,{children:(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-lg font-bold uppercase tracking-wider",children:"Cron Jobs"}),(0,b.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:"Discover and manage scheduled jobs across your fleet"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[H&&!D&&(0,b.jsxs)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider mr-2",children:[k.length," node",1!==k.length?"s":""," · ",W," job",1!==W?"s":"",Y>0&&` \xb7 ${Y} error${1!==Y?"s":""}`]}),(0,b.jsxs)(d.K,{variant:"secondary",size:"sm",onClick:()=>void V(),disabled:D,children:[(0,b.jsx)(p.f,{className:(0,m.f)("h-3.5 w-3.5 mr-1.5",D&&"animate-spin")}),D?"Scanning...":"Rescan"]})]})]})}),D&&(0,b.jsx)(n.z,{children:(0,b.jsx)(o.f,{title:"Scanning Nodes for Cron Jobs",description:"Probing all online nodes...",nodes:k.map(a=>({nodeId:a.nodeId,nodeName:a.nodeName,status:a.status,error:a.error})),scanning:!0})}),!D&&H&&W>0&&(0,b.jsx)(n.z,{children:(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(q.f,{className:"absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-text-muted"}),(0,b.jsx)("input",{type:"text",placeholder:"Search jobs by name, command, or schedule...",value:J,onChange:a=>K(a.target.value),className:(0,m.f)(g.W,"pl-9")})]})}),!D&&H&&F&&(0,b.jsx)(n.z,{children:(0,b.jsx)(f.N,{children:(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,b.jsx)(z.f,{className:"h-10 w-10 text-danger/60 mb-3"}),(0,b.jsx)("p",{className:"text-xs font-bold text-danger mb-1",children:"Scan Failed"}),(0,b.jsx)("p",{className:"text-[11px] text-text-muted max-w-md",children:F}),(0,b.jsxs)(d.K,{variant:"secondary",size:"sm",className:"mt-4",onClick:()=>void V(),children:[(0,b.jsx)(p.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Retry Scan"]})]})})}),!D&&H&&!F&&(0,b.jsxs)(b.Fragment,{children:[0===k.length?(0,b.jsx)(n.z,{children:(0,b.jsx)(f.N,{children:(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,b.jsx)(s.f,{className:"h-10 w-10 text-text-muted/40 mb-3"}),(0,b.jsx)("p",{className:"text-xs text-text-muted",children:"No online nodes found to scan. Ensure at least one node agent is running and connected."})]})})}):k.map(a=>{let c=L.has(a.nodeId),g=a.jobs.filter(Z);return(0,b.jsx)(n.z,{children:(0,b.jsxs)(f.N,{className:"overflow-hidden",children:[(0,b.jsxs)("button",{onClick:()=>{var b;return b=a.nodeId,void M(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"w-full flex items-center gap-4 p-4 text-left hover:bg-surface-hover transition-all",children:[(0,b.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded border border-primary/30 bg-primary/5 shrink-0",children:(0,b.jsx)(s.f,{className:"h-4 w-4 text-primary"})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider",children:a.nodeName}),"done"===a.status&&(0,b.jsxs)(e.t,{variant:a.jobs.length>0?"success":"default",children:[a.jobs.length," job",1!==a.jobs.length?"s":""]}),"error"===a.status&&((0,i.f)(a.error)?(0,b.jsx)(e.t,{variant:"default",children:"Disabled"}):(0,b.jsx)(e.t,{variant:"danger",children:"Error"}))]}),"error"===a.status&&a.error&&(0,b.jsx)("p",{className:(0,m.f)("text-[11px] mt-0.5 truncate",(0,i.f)(a.error)?"text-text-muted":"text-danger"),children:(0,i.f)(a.error)??a.error}),"done"===a.status&&0===a.jobs.length&&(0,b.jsx)("p",{className:"text-[11px] text-text-muted mt-0.5",children:"No cron jobs found on this node"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:["done"===a.status?(0,b.jsx)(A.f,{className:"h-4 w-4 text-success"}):(0,b.jsx)(B.f,{className:"h-4 w-4 text-danger"}),c?(0,b.jsx)(t.f,{className:"h-4 w-4 text-text-muted"}):(0,b.jsx)(u.f,{className:"h-4 w-4 text-text-muted"})]})]}),c&&"done"===a.status&&(0,b.jsx)("div",{className:"border-t border-border/50 bg-bg/50",children:0===g.length?(0,b.jsx)("div",{className:"flex items-center justify-center py-8 text-center",children:(0,b.jsx)("p",{className:"text-[11px] text-text-muted",children:0===a.jobs.length?"No cron jobs found on this node.":"No jobs match your search on this node."})}):(0,b.jsx)("div",{className:"divide-y divide-border/30",children:g.map((c,f)=>(0,b.jsxs)("div",{className:"p-4 space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(r.f,{className:"h-4 w-4 text-primary"}),(0,b.jsx)("span",{className:"text-xs font-bold",children:c.name}),c.user&&(0,b.jsx)(e.t,{variant:"default",children:c.user}),(0,b.jsx)(e.t,{variant:"info",children:c.schedule})]}),(0,b.jsxs)(d.K,{size:"sm",variant:"secondary",onClick:()=>{O({job:c,nodeId:a.nodeId,nodeName:a.nodeName}),Q("1.0.0"),S("")},children:[(0,b.jsx)(v.f,{className:"h-3 w-3 mr-1"}),"Publish"]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 text-[11px] text-text-muted",children:[(0,b.jsx)(y.f,{className:"h-3 w-3"}),function(a){let b=a.split(/\s+/);if(b.length<5)return a;let[c,d,e,f,g]=b;return"*"===c&&"*"===d&&"*"===e&&"*"===f&&"*"===g?"Every minute":"0"===c&&"*"===d&&"*"===e&&"*"===f&&"*"===g?"Every hour":"0"===c&&"0"===d&&"*"===e&&"*"===f&&"*"===g?"Daily at midnight":c?.startsWith("*/")?`Every ${c.slice(2)} minutes`:d?.startsWith("*/")?`Every ${d.slice(2)} hours`:a}(c.schedule)]}),(0,b.jsxs)("div",{className:"flex items-start gap-2 rounded border border-border bg-surface p-3",children:[(0,b.jsx)(x.f,{className:"h-3.5 w-3.5 text-primary mt-0.5 shrink-0"}),(0,b.jsx)("pre",{className:"text-xs whitespace-pre-wrap break-all flex-1",children:c.command})]})]},`${c.name}-${f}`))})})]})},a.nodeId)}),k.length>0&&(0,b.jsx)(n.z,{children:(0,b.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-text-muted uppercase tracking-wider",children:[(0,b.jsxs)("span",{children:[X," node",1!==X?"s":""," scanned ·"," ",W," job",1!==W?"s":""," discovered"]}),Y>0&&(0,b.jsxs)("span",{className:"text-danger",children:[Y," node",1!==Y?"s":""," unreachable"]})]})})]}),(0,b.jsx)(g.n,{open:!!N,onClose:()=>O(null),title:"Publish to Library",description:N?.job.name??"",icon:(0,b.jsx)(v.f,{className:"h-5 w-5 text-primary"}),children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("label",{className:"block text-[11px] font-bold uppercase tracking-wider mb-1.5",children:["Version ",(0,b.jsx)("span",{className:"text-accent",children:"*"})]}),(0,b.jsx)("input",{type:"text",value:P,onChange:a=>Q(a.target.value),placeholder:"1.0.0",className:g.W})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-[11px] font-bold uppercase tracking-wider mb-1.5",children:"Description"}),(0,b.jsx)("input",{type:"text",value:R,onChange:a=>S(a.target.value),placeholder:"What does this cron job do?",className:g.W})]}),N&&(0,b.jsxs)("div",{className:"rounded border border-border bg-bg p-3 text-xs space-y-1",children:[(0,b.jsxs)("p",{children:[(0,b.jsx)("span",{className:"text-text-muted",children:"Source:"})," ",N.nodeName]}),(0,b.jsxs)("p",{children:[(0,b.jsx)("span",{className:"text-text-muted",children:"Schedule:"})," ",N.job.schedule]}),(0,b.jsxs)("p",{children:[(0,b.jsx)("span",{className:"text-text-muted",children:"Command:"})," ",(0,b.jsx)("span",{className:"text-primary",children:N.job.command})]})]}),(0,b.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,b.jsx)(d.K,{variant:"secondary",size:"sm",onClick:()=>O(null),children:"Cancel"}),(0,b.jsx)(d.K,{size:"sm",onClick:()=>void $(),disabled:T||!P,children:T?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(w.f,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Publishing..."]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(v.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Publish"]})})]})]})})]})}],81837)}];
|
|
1
|
+
module.exports=[81837,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(68415),e=a.i(58299),f=a.i(49521),g=a.i(85063),h=a.i(46997),i=a.i(5739),j=a.i(8897),k=a.i(5050);let l=(0,k.createServerReference)("407c1f44b72869676d6ad141516322fb58e312dda6",k.callServer,void 0,k.findSourceMapURL,"scanCron");var m=a.i(8387),n=a.i(73771),o=a.i(33855),p=a.i(19783),q=a.i(33540),r=a.i(8311),s=a.i(34532),t=a.i(89027),u=a.i(41146),v=a.i(1661),w=a.i(75160),x=a.i(57307),y=a.i(70944),z=a.i(68579),A=a.i(13412),B=a.i(11134);a.s(["default",0,function(){let{activeNode:a}=(0,j.l)(),[k,C]=(0,c.useState)([]),[D,E]=(0,c.useState)(!1),[F,G]=(0,c.useState)(null),[H,I]=(0,c.useState)(!1),[J,K]=(0,c.useState)(""),[L,M]=(0,c.useState)(new Set),[N,O]=(0,c.useState)(null),[P,Q]=(0,c.useState)("1.0.0"),[R,S]=(0,c.useState)(""),[T,U]=(0,c.useState)(!1),V=(0,c.useCallback)(async()=>{E(!0),C([]),G(null);let b=Date.now();try{let b=await l(a.id);if(b.success&&Array.isArray(b.data)){let a=b.data.map(a=>({...a,status:"error"===a.status?"error":"done"}));C(a);let c=new Set(a.filter(a=>a.jobs.length>0).map(a=>a.nodeId));M(c.size>0?c:new Set(a.map(a=>a.nodeId)))}else G(b.error?.message??"Scan returned unsuccessful response")}catch(b){let a=b instanceof Error?b.message:"Scan request failed";G(a)}finally{let a=Date.now()-b;a<1500&&await new Promise(b=>setTimeout(b,1500-a)),E(!1),I(!0)}},[a]);(0,c.useEffect)(()=>{a&&V()},[a,V]);let W=k.reduce((a,b)=>a+("done"===b.status?b.jobs.length:0),0),X=k.filter(a=>"done"===a.status).length,Y=k.filter(a=>"error"===a.status).length,Z=a=>{if(!J)return!0;let b=J.toLowerCase();return a.name.toLowerCase().includes(b)||a.command.toLowerCase().includes(b)||a.schedule.toLowerCase().includes(b)||(a.user?.toLowerCase().includes(b)??!1)},$=async()=>{if(N&&P){U(!0);try{let a=JSON.stringify({name:N.job.name,version:P,schedule:N.job.schedule,command:N.job.command,description:R},null,2);await h.f.library.files.create({name:`${N.job.name} v${P}`,fileName:`${N.job.name}-${P}.json`,mimeType:"application/x-magnus-cronjob",content:a,tags:["cronjob","cron"]}),O(null),Q("1.0.0"),S("")}catch{}finally{U(!1)}}};return(0,b.jsxs)(n.U,{className:"space-y-6",children:[(0,b.jsx)(n.z,{children:(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-lg font-bold uppercase tracking-wider",children:"Cron Jobs"}),(0,b.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:"Discover and manage scheduled jobs across your fleet"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[H&&!D&&(0,b.jsxs)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider mr-2",children:[k.length," node",1!==k.length?"s":""," · ",W," job",1!==W?"s":"",Y>0&&` \xb7 ${Y} error${1!==Y?"s":""}`]}),(0,b.jsxs)(d.K,{variant:"secondary",size:"sm",onClick:()=>void V(),disabled:D,children:[(0,b.jsx)(p.f,{className:(0,m.f)("h-3.5 w-3.5 mr-1.5",D&&"animate-spin")}),D?"Scanning...":"Rescan"]})]})]})}),D&&(0,b.jsx)(n.z,{children:(0,b.jsx)(o.f,{title:"Scanning Nodes for Cron Jobs",description:"Probing all online nodes...",nodes:k.map(a=>({nodeId:a.nodeId,nodeName:a.nodeName,status:a.status,error:a.error})),scanning:!0})}),!D&&H&&W>0&&(0,b.jsx)(n.z,{children:(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(q.f,{className:"absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-text-muted"}),(0,b.jsx)("input",{type:"text",placeholder:"Search jobs by name, command, or schedule...",value:J,onChange:a=>K(a.target.value),className:(0,m.f)(g.W,"pl-9")})]})}),!D&&H&&F&&(0,b.jsx)(n.z,{children:(0,b.jsx)(f.N,{children:(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,b.jsx)(z.f,{className:"h-10 w-10 text-danger/60 mb-3"}),(0,b.jsx)("p",{className:"text-xs font-bold text-danger mb-1",children:"Scan Failed"}),(0,b.jsx)("p",{className:"text-[11px] text-text-muted max-w-md",children:F}),(0,b.jsxs)(d.K,{variant:"secondary",size:"sm",className:"mt-4",onClick:()=>void V(),children:[(0,b.jsx)(p.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Retry Scan"]})]})})}),!D&&H&&!F&&(0,b.jsxs)(b.Fragment,{children:[0===k.length?(0,b.jsx)(n.z,{children:(0,b.jsx)(f.N,{children:(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,b.jsx)(s.f,{className:"h-10 w-10 text-text-muted/40 mb-3"}),(0,b.jsx)("p",{className:"text-xs text-text-muted",children:"No online nodes found to scan. Ensure at least one node agent is running and connected."})]})})}):k.map(a=>{let c=L.has(a.nodeId),g=a.jobs.filter(Z);return(0,b.jsx)(n.z,{children:(0,b.jsxs)(f.N,{className:"overflow-hidden",children:[(0,b.jsxs)("button",{onClick:()=>{var b;return b=a.nodeId,void M(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"w-full flex items-center gap-4 p-4 text-left hover:bg-surface-hover transition-all",children:[(0,b.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded border border-primary/30 bg-primary/5 shrink-0",children:(0,b.jsx)(s.f,{className:"h-4 w-4 text-primary"})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider",children:a.nodeName}),"done"===a.status&&(0,b.jsxs)(e.t,{variant:a.jobs.length>0?"success":"default",children:[a.jobs.length," job",1!==a.jobs.length?"s":""]}),"error"===a.status&&((0,i.f)(a.error)?(0,b.jsx)(e.t,{variant:"default",children:"Disabled"}):(0,b.jsx)(e.t,{variant:"danger",children:"Error"}))]}),"error"===a.status&&a.error&&(0,b.jsx)("p",{className:(0,m.f)("text-[11px] mt-0.5 truncate",(0,i.f)(a.error)?"text-text-muted":"text-danger"),children:(0,i.f)(a.error)??a.error}),"done"===a.status&&0===a.jobs.length&&(0,b.jsx)("p",{className:"text-[11px] text-text-muted mt-0.5",children:"No cron jobs found on this node"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:["done"===a.status?(0,b.jsx)(A.f,{className:"h-4 w-4 text-success"}):(0,b.jsx)(B.f,{className:"h-4 w-4 text-danger"}),c?(0,b.jsx)(t.f,{className:"h-4 w-4 text-text-muted"}):(0,b.jsx)(u.f,{className:"h-4 w-4 text-text-muted"})]})]}),c&&"done"===a.status&&(0,b.jsx)("div",{className:"border-t border-border/50 bg-bg/50",children:0===g.length?(0,b.jsx)("div",{className:"flex items-center justify-center py-8 text-center",children:(0,b.jsx)("p",{className:"text-[11px] text-text-muted",children:0===a.jobs.length?"No cron jobs found on this node.":"No jobs match your search on this node."})}):(0,b.jsx)("div",{className:"divide-y divide-border/30",children:g.map((c,f)=>(0,b.jsxs)("div",{className:"p-4 space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(r.f,{className:"h-4 w-4 text-primary"}),(0,b.jsx)("span",{className:"text-xs font-bold",children:c.name}),c.user&&(0,b.jsx)(e.t,{variant:"default",children:c.user}),(0,b.jsx)(e.t,{variant:"info",children:c.schedule})]}),(0,b.jsxs)(d.K,{size:"sm",variant:"secondary",onClick:()=>{O({job:c,nodeId:a.nodeId,nodeName:a.nodeName}),Q("1.0.0"),S("")},children:[(0,b.jsx)(v.f,{className:"h-3 w-3 mr-1"}),"Publish"]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 text-[11px] text-text-muted",children:[(0,b.jsx)(y.f,{className:"h-3 w-3"}),function(a){let b=a.split(/\s+/);if(b.length<5)return a;let[c,d,e,f,g]=b;return"*"===c&&"*"===d&&"*"===e&&"*"===f&&"*"===g?"Every minute":"0"===c&&"*"===d&&"*"===e&&"*"===f&&"*"===g?"Every hour":"0"===c&&"0"===d&&"*"===e&&"*"===f&&"*"===g?"Daily at midnight":c?.startsWith("*/")?`Every ${c.slice(2)} minutes`:d?.startsWith("*/")?`Every ${d.slice(2)} hours`:a}(c.schedule)]}),(0,b.jsxs)("div",{className:"flex items-start gap-2 rounded border border-border bg-surface p-3",children:[(0,b.jsx)(x.f,{className:"h-3.5 w-3.5 text-primary mt-0.5 shrink-0"}),(0,b.jsx)("pre",{className:"text-xs whitespace-pre-wrap break-all flex-1",children:c.command})]})]},`${c.name}-${f}`))})})]})},a.nodeId)}),k.length>0&&(0,b.jsx)(n.z,{children:(0,b.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-text-muted uppercase tracking-wider",children:[(0,b.jsxs)("span",{children:[X," node",1!==X?"s":""," scanned ·"," ",W," job",1!==W?"s":""," discovered"]}),Y>0&&(0,b.jsxs)("span",{className:"text-danger",children:[Y," node",1!==Y?"s":""," unreachable"]})]})})]}),(0,b.jsx)(g.n,{open:!!N,onClose:()=>O(null),title:"Publish to Library",description:N?.job.name??"",icon:(0,b.jsx)(v.f,{className:"h-5 w-5 text-primary"}),children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("label",{className:"block text-[11px] font-bold uppercase tracking-wider mb-1.5",children:["Version ",(0,b.jsx)("span",{className:"text-accent",children:"*"})]}),(0,b.jsx)("input",{type:"text",value:P,onChange:a=>Q(a.target.value),placeholder:"1.0.0",className:g.W})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-[11px] font-bold uppercase tracking-wider mb-1.5",children:"Description"}),(0,b.jsx)("input",{type:"text",value:R,onChange:a=>S(a.target.value),placeholder:"What does this cron job do?",className:g.W})]}),N&&(0,b.jsxs)("div",{className:"rounded border border-border bg-bg p-3 text-xs space-y-1",children:[(0,b.jsxs)("p",{children:[(0,b.jsx)("span",{className:"text-text-muted",children:"Source:"})," ",N.nodeName]}),(0,b.jsxs)("p",{children:[(0,b.jsx)("span",{className:"text-text-muted",children:"Schedule:"})," ",N.job.schedule]}),(0,b.jsxs)("p",{children:[(0,b.jsx)("span",{className:"text-text-muted",children:"Command:"})," ",(0,b.jsx)("span",{className:"text-primary",children:N.job.command})]})]}),(0,b.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,b.jsx)(d.K,{variant:"secondary",size:"sm",onClick:()=>O(null),children:"Cancel"}),(0,b.jsx)(d.K,{size:"sm",onClick:()=>void $(),disabled:T||!P,children:T?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(w.f,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Publishing..."]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(v.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Publish"]})})]})]})})]})}],81837)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=apps_dashboard_src_app_cron_page_tsx_1i3duyygc0_tg._.js.map
|
|
@@ -12,6 +12,6 @@ module.exports=[83679,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(49521
|
|
|
12
12
|
`,document.head.appendChild(a)}if(b||k.current)return;let m=new d({cursorBlink:!0,scrollback:1e3,fontFamily:'"JetBrains Mono", "Fira Code", "Cascadia Code", monospace',fontSize:13,theme:{background:"#06060d",foreground:"#e0e0ec",cursor:"#00e5ff",cursorAccent:"#06060d",selectionBackground:"#00e5ff33",black:"#06060d",red:"#ff1744",green:"#00ff41",yellow:"#ffb300",blue:"#00b0ff",magenta:"#ff006e",cyan:"#00e5ff",white:"#e0e0ec",brightBlack:"#5a5a7a",brightRed:"#ff5252",brightGreen:"#69f0ae",brightYellow:"#ffd740",brightBlue:"#40c4ff",brightMagenta:"#ff4081",brightCyan:"#18ffff",brightWhite:"#ffffff"}}),r=new e;if(m.loadAddon(r),h.current=m,i.current=r,g.current&&(m.open(g.current),requestAnimationFrame(()=>{k.current||r.fit()})),b||k.current)return;let s=r.proposeDimensions(),t=s?.cols??120,u=s?.rows??30,v=f.hostname||f.ipAddress;m.write(`\x1b[38;2;138;138;171mConnecting to ${v} as ${v===f.hostname?f.hostname:f.ipAddress}...\x1b[0m\r
|
|
13
13
|
`);try{let a=await fetch("/api/terminal/open",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({host:v,cols:t,rows:u})});if(!a.ok){let b=await a.json().catch(()=>({}));throw Error(b.error??`HTTP ${a.status}`)}j.current=c=(await a.json()).sessionId}catch(c){if(b||k.current)return;let a=c instanceof Error?c.message:"Unknown error";m.write(`\r
|
|
14
14
|
\x1b[31mFailed to open session: ${a}\x1b[0m\r
|
|
15
|
-
`),n("error");return}if(b||k.current)return;n("connected");let w=new AbortController;l.current=w,(async()=>{try{let a=await fetch(`/api/terminal/stream?sessionId=${encodeURIComponent(c)}`,{signal:w.signal});if(!a.ok||!a.body){b||k.current||(m.write("\r\n\x1b[31mFailed to connect output stream\x1b[0m\r\n"),n("error"));return}let d=a.body.getReader();for(;;){let{done:a,value:c}=await d.read();if(a||b||k.current)break;c&&m.write(c)}}catch(a){if(a instanceof DOMException&&"AbortError"===a.name)return}b||k.current||(n("closed"),m.write("\r\n\x1b[38;2;138;138;171m── Session ended ──\x1b[0m\r\n"))})(),m.onData(a=>{!k.current&&j.current&&(o.current+=a,p.current||(p.current=setTimeout(q,16)))}),m.onResize(({cols:a,rows:b})=>{!k.current&&j.current&&fetch("/api/terminal/resize",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:j.current,cols:a,rows:b})}).catch(()=>{})})})();let c=()=>{i.current&&!k.current&&i.current.fit()};return window.addEventListener("resize",c),()=>{b=!0,window.removeEventListener("resize",c),r()}},[d,f,r,q]);let t=(0,c.useCallback)(()=>{r(),e()},[r,e]);return f?(0,b.jsx)(N.n,{open:d,onClose:t,title:`Terminal: ${f.name}`,description:"Interactive SSH session",icon:(0,b.jsx)(s.f,{className:"h-5 w-5 text-primary"}),className:"max-w-5xl",children:(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsxs)("div",{className:"absolute top-0 right-0 z-10 flex items-center gap-1.5 px-2 py-1",children:[(0,b.jsx)("div",{className:`h-1.5 w-1.5 rounded-full ${"connected"===m?"bg-success":"connecting"===m?"bg-warning animate-pulse":"error"===m?"bg-danger":"bg-text-muted"}`}),(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:m})]}),(0,b.jsx)("div",{ref:g,className:"h-[65vh] w-full rounded border border-border/50 bg-[#06060d] p-1 overflow-hidden"})]})}):null}var P=a.i(73771),Q=a.i(4591),R=a.i(5564),S=a.i(85651),T=a.i(2668),U=a.i(90165),V=a.i(68216),W=a.i(13412);let X={name:"clipboard-check",size:24,node:[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]};X.node;let Y=(0,F.f)(X),Z={name:"octagon-x",size:24,node:[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-octagon"]};Z.node;let $=(0,F.f)(Z);var _=a.i(11134),aa=a.i(47515);let ab={pending:{label:"Queued",variant:"default"},requested:{label:"Installing",variant:"info"},watching:{label:"Watching",variant:"info"},ambiguous:{label:"Unknown",variant:"warning"},confirmed:{label:"Upgraded",variant:"success"},reverted:{label:"Reverted",variant:"danger"},failed:{label:"Failed",variant:"danger"},refused:{label:"Refused",variant:"warning"},skipped:{label:"Skipped",variant:"default"}};function ac({open:a,onClose:d,onFinished:g}){let[i,j]=(0,c.useState)(null),[k,l]=(0,c.useState)(new Set),[m,n]=(0,c.useState)(null),[p,r]=(0,c.useState)(null),[s,t]=(0,c.useState)(!1),[u,v]=(0,c.useState)(null),[x,y]=(0,c.useState)(!1),[z,A]=(0,c.useState)(""),B=async a=>r(await (0,aa.s)(a)),C=(0,c.useCallback)(async()=>{r(null);try{let a=await h.f.agentUpgrades.eligibility();j(a),l(new Set(a.nodes.filter(a=>a.eligible).map(a=>a.nodeId))),n(a.latestRun??null)}catch(a){r(await (0,aa.s)(a))}},[]);(0,c.useEffect)(()=>{a&&(n(null),v(null),C())},[a,C]),(0,c.useEffect)(()=>{if(!m||"running"!==m.status)return;let a=window.setInterval(()=>{h.f.agentUpgrades.run(m.id).then(a=>{n(a),"running"!==a.status&&g?.()}).catch(async b=>{window.clearInterval(a),r((0,aa.c)(b)?`Upgrade run ${m.id} is no longer known to the server`:await (0,aa.s)(b)),(0,aa.c)(b)&&n(null)})},5e3);return()=>window.clearInterval(a)},[m,g]);let E=(0,c.useMemo)(()=>i?.nodes.filter(a=>a.eligible).length??0,[i]),F=i?.nodes.filter(a=>"MAJOR_VERSION"===a.code).length??0,G=i&&(!m||"running"!==m.status),H=async a=>{t(!0),r(null);try{n(await a())}catch(a){await B(a)}finally{t(!1)}},I=/^[1-9][0-9]{0,2}$/.test(z)?{maxFailures:Number(z)}:{},J=async()=>{y(!0),r(null);try{v(await h.f.agentUpgrades.check({version:i?.version,...k.size?{nodeIds:[...k]}:{}}))}catch(a){await B(a)}finally{y(!1)}},K=(a=!1)=>m&&H(()=>h.f.agentUpgrades.retry(m.id,a?{acknowledgeSuspicion:a}:{}));return(0,b.jsx)(N.n,{open:a,onClose:d,title:"Upgrade agents",icon:(0,b.jsx)(w.f,{className:"h-4 w-4"}),description:i?(0,aa.Q)(i):void 0,className:"max-h-[calc(100dvh-1.5rem)] max-w-4xl overflow-y-auto",children:(0,b.jsxs)("div",{className:"space-y-4 text-[11px]",children:[p&&(0,b.jsx)("div",{className:"rounded border border-danger/40 bg-danger/10 px-3 py-2 text-danger","data-testid":"agent-upgrade-error",children:p}),i&&!i.upgradesEnabled&&(0,b.jsxs)("div",{className:"rounded border border-warning/40 bg-warning/10 px-3 py-2 text-warning",children:["Agent upgrades are off: ",i.disabledReason]}),!i&&!p&&(0,b.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,b.jsx)(o.f,{className:"h-4 w-4 animate-spin"})," Checking agents…"]}),m&&(0,b.jsxs)("div",{className:"space-y-2","data-testid":"agent-upgrade-run",children:[(0,b.jsxs)("p",{className:"flex flex-wrap items-center gap-2",children:["running"===m.status&&(0,b.jsx)(o.f,{className:"h-4 w-4 animate-spin text-primary"}),"succeeded"===m.status&&(0,b.jsx)(W.f,{className:"h-4 w-4 text-success"}),"partial"===m.status&&(0,b.jsx)(q.f,{className:"h-4 w-4 text-warning"}),("failed"===m.status||"interrupted"===m.status)&&(0,b.jsx)(_.f,{className:"h-4 w-4 text-danger"}),"stopped"===m.status&&(0,b.jsx)($,{className:"h-4 w-4 text-warning"}),(0,b.jsx)("span",{className:"font-bold uppercase tracking-wider",children:"running"===m.status?`Upgrading to ${m.version}${m.stopRequestedBy?" (stopping after the nodes in progress)":""}`:(0,aa.P)(m)})]}),"running"!==m.status&&m.message&&(0,b.jsx)("p",{className:"text-text-muted","data-testid":"agent-upgrade-run-message",children:m.message}),(m.warnings??[]).map(a=>(0,b.jsxs)("p",{className:"text-warning","data-testid":"agent-upgrade-warning",children:[a.name,": ",a.detail]},`${a.nodeId}-${a.code}`)),(0,b.jsxs)("details",{open:"running"===m.status,className:"group",children:[(0,b.jsxs)("summary",{className:"cursor-pointer text-text-muted",children:["running"===m.status?"Current rollout":"Previous rollout"," to ",m.version," · ",m.nodes.length," agent",1===m.nodes.length?"":"s"]}),(0,b.jsxs)("ul",{className:"mt-2 max-h-80 divide-y divide-border/40 overflow-y-auto rounded border border-border",children:[m.nodes.map(a=>(0,b.jsxs)("li",{className:"flex flex-wrap items-center gap-3 px-3 py-2",children:[(0,b.jsxs)("span",{className:"w-40 truncate font-medium text-text",children:[a.name,a.nodeId===(m.canaryNodeId??m.nodes[0]?.nodeId)?" (canary)":""]}),(0,b.jsxs)("span",{className:"num shrink-0 text-text-muted",children:[a.from," → ",m.version]}),(0,b.jsxs)(e.t,{variant:ab[a.state]?.variant??"default",children:["requested"===a.state&&(0,b.jsx)(o.f,{className:"mr-1 inline h-3 w-3 animate-spin"}),"reverted"===a.state&&(0,b.jsx)(D.f,{className:"mr-1 inline h-3 w-3"}),ab[a.state]?.label??a.state]}),(a.attempts??1)>1&&(0,b.jsxs)("span",{className:"num text-text-muted",children:["try ",a.attempts]}),(0,aa.b)(a)&&(0,b.jsx)("span",{className:"w-full break-words text-text-muted",children:(0,aa.b)(a)})]},a.nodeId)),(m.excluded??[]).map(a=>(0,b.jsxs)("li",{className:"flex flex-wrap items-center gap-3 px-3 py-2 text-text-muted",title:a.reason,children:[(0,b.jsx)("span",{className:"w-40 truncate font-medium text-text",children:a.name}),(0,b.jsx)(e.t,{variant:"default",children:"Not included"}),(0,b.jsx)("span",{className:"w-full break-words text-text-muted",children:a.reason})]},`excluded-${a.nodeId}`))]})]}),"running"!==m.status&&(m.attention?.length??0)>0&&(0,b.jsxs)("div",{className:"space-y-2 rounded border border-warning/40 bg-warning/10 px-3 py-2","data-testid":"agent-upgrade-attention",children:[(0,b.jsx)("p",{className:"font-bold uppercase tracking-wider text-warning",children:"Needs attention"}),(0,b.jsx)("ul",{className:"max-h-48 space-y-2 overflow-y-auto",children:m.attention.map(a=>(0,b.jsxs)("li",{children:[(0,b.jsxs)("p",{className:"font-medium text-text",children:[a.name,": ",(0,b.jsx)("span",{className:"num",children:a.code}),"release"===a.failureClass?" (points at the release)":"",a.unknownCode?" (unrecognised code)":""]}),a.detail&&(0,b.jsx)("p",{className:"text-text-muted",children:a.detail}),(0,b.jsx)("p",{className:"text-text",children:a.remedy})]},`${a.nodeId}-${a.code}`))})]})]}),u&&(0,b.jsxs)("div",{className:"space-y-2","data-testid":"agent-upgrade-check",children:[(0,b.jsxs)("p",{className:"font-bold uppercase tracking-wider",children:["Check: ",u.eligible," ready, ",u.blocked," blocked",u.release.verified?"":`; target not verified: ${u.release.reason??"unknown"}`]}),(0,b.jsx)("ul",{className:"max-h-64 divide-y divide-border/40 overflow-y-auto rounded border border-border",children:u.nodes.map(a=>(0,b.jsxs)("li",{className:"space-y-1 px-3 py-2",children:[(0,b.jsxs)("p",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("span",{className:"w-40 truncate font-medium text-text",children:a.name}),(0,b.jsx)(e.t,{variant:a.eligible?"success":a.preflight?.status==="blocked"?"danger":"default",children:a.eligible?"Ready":a.code??"Not eligible"}),(0,b.jsxs)("span",{className:"text-text-muted",children:["preflight ",a.preflight?.status??"not run"]})]}),!a.eligible&&a.reason&&(0,b.jsx)("p",{className:"text-text-muted",children:a.reason}),!a.eligible&&a.remedy&&(0,b.jsx)("p",{className:"text-text",children:a.remedy}),a.preflight?.problems.filter(b=>b.code!==a.code).map(a=>(0,b.jsxs)("p",{className:"text-text-muted",children:[(0,b.jsx)("span",{className:"num",children:a.code}),": ",a.detail,". ",(0,aa.V)(a.code)]},`${a.code}-${a.detail}`))]},a.nodeId))})]}),G&&(0,b.jsxs)("section",{className:"space-y-2","aria-label":"Current upgrade eligibility",children:[(0,b.jsxs)("p",{className:"font-bold uppercase tracking-wider",children:["Target ",i.version,": ",E," ready, ",i.nodes.length-E," unavailable"]}),F>0&&(0,b.jsxs)("div",{className:"space-y-1 rounded border border-warning/40 bg-warning/10 px-3 py-2 text-warning","data-testid":"agent-upgrade-major-notice",children:[(0,b.jsxs)("p",{children:[F," agent",1===F?" requires":"s require"," a manual major-version upgrade to ",i.version,". This dialog only upgrades agents within their current major version."]}),(0,b.jsxs)("p",{children:["Read the ",(0,b.jsx)("a",{href:"https://github.com/ChefTaco/magnus/blob/main/UPGRADING.md#agents",target:"_blank",rel:"noreferrer",className:"underline",children:"agent upgrade guide"}),", then upgrade each affected node using its installation method. A successful rollout to an older version does not complete this upgrade."]})]}),0===E&&(0,b.jsx)("p",{className:"text-text-muted","data-testid":"agent-upgrade-empty",children:"No agents can be upgraded from this dialog right now. Review the reasons below; Check refreshes the readiness report."}),(0,b.jsxs)("ul",{className:"max-h-80 divide-y divide-border/40 overflow-y-auto rounded border border-border","data-testid":"agent-upgrade-candidates",children:[i.nodes.map(a=>(0,b.jsx)("li",{className:"px-3 py-2",children:(0,b.jsxs)("label",{className:"flex items-start gap-3",children:[(0,b.jsx)("input",{type:"checkbox",className:"mt-0.5 shrink-0","aria-label":`Upgrade ${a.name}`,checked:k.has(a.nodeId),disabled:!a.eligible||!i.upgradesEnabled,onChange:()=>{let b;return b=a.nodeId,l(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})}}),(0,b.jsxs)("span",{className:"min-w-0 flex-1 space-y-1",children:[(0,b.jsxs)("span",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[(0,b.jsx)("span",{className:"break-words font-medium text-text",children:a.name}),(0,b.jsxs)("span",{className:"num text-text-muted",children:[a.version,a.eligible?` → ${i.version}`:""]}),a.preflight&&"ok"!==a.preflight.status&&(0,b.jsxs)(e.t,{variant:"blocked"===a.preflight.status?"danger":"default",children:["preflight ",a.preflight.status]})]}),!a.eligible&&(0,b.jsx)("span",{className:"block break-words text-text-muted",children:a.reason})]})]})},a.nodeId)),0===i.nodes.length&&(0,b.jsx)("li",{className:"px-3 py-2 text-text-muted",children:"No nodes registered."})]})]}),(0,b.jsxs)("div",{className:"space-y-3 border-t border-border pt-3",children:[(0,b.jsx)("p",{className:"text-text-muted",children:"The first agent is a canary. Each agent switches back by itself if the new version does not report a heartbeat in time. Only evidence about the release stops the run: a failure on the canary, an integrity mismatch, or too many reverts. A problem of one node is recorded and the run goes on."}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-3",children:[G&&E>0&&(0,b.jsxs)("label",{className:"flex shrink-0 items-center gap-1 text-text-muted",title:"Reverts or failed installs that stop the run after its canary. Empty: the server's setting.",children:["Stop after",(0,b.jsx)("input",{className:"w-12 rounded border border-border bg-transparent px-1 py-0.5 text-text",inputMode:"numeric","aria-label":"Release failures that stop the run",value:z,onChange:a=>A(a.target.value),"data-testid":"agent-upgrade-max-failures"}),"failures"]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)(f.K,{variant:"secondary",size:"sm",onClick:d,children:"Close"}),m?.status==="running"&&(0,b.jsx)(f.K,{variant:"danger",size:"sm",onClick:()=>void(m&&H(()=>h.f.agentUpgrades.stop(m.id))),"data-testid":"agent-upgrade-stop",disabled:s||!!m.stopRequestedBy,icon:(0,b.jsx)($,{className:"h-3.5 w-3.5"}),children:"Stop"}),(0,aa.v)(m)&&i?.upgradesEnabled&&(0,b.jsxs)(f.K,{variant:"secondary",size:"sm",onClick:()=>void K(),"data-testid":"agent-upgrade-retry",disabled:s,icon:(0,b.jsx)(D.f,{className:"h-3.5 w-3.5"}),children:["Retry ",(0,aa.w)(m)," node",1===(0,aa.w)(m)?"":"s"]}),(0,aa.v)(m)&&i?.upgradesEnabled&&(m?.suspectedRelease||m?.excluded?.some(a=>"RETRY_HELD_SUSPECTED"===a.code))&&(0,b.jsx)(f.K,{variant:"danger",size:"sm",onClick:()=>void K(!0),"data-testid":"agent-upgrade-retry-acknowledged",disabled:s,title:"Each attempt on an older agent can strand another lease. Read the agent log first.",icon:(0,b.jsx)(D.f,{className:"h-3.5 w-3.5"}),children:"Retry older agents too"}),G&&(0,b.jsx)(f.K,{variant:"secondary",size:"sm",onClick:()=>void J(),"data-testid":"agent-upgrade-check-button",disabled:s||x,icon:x?(0,b.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(Y,{className:"h-3.5 w-3.5"}),children:"Check"}),G&&(0,b.jsxs)(f.K,{variant:"primary",size:"sm",onClick:()=>void H(()=>h.f.agentUpgrades.start({nodeIds:[...k],version:i?.version,...i?.prerelease?{allowPrerelease:!0}:{},...I})),"data-testid":"agent-upgrade-start",disabled:s||0===k.size||!i?.upgradesEnabled,icon:s?(0,b.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(w.f,{className:"h-3.5 w-3.5"}),children:["Upgrade ",k.size," agent",1===k.size?"":"s"]})]})]})]})]})})}var ad=a.i(33666);function ae(a){try{let b=JSON.parse(a);if("string"==typeof b.deployError)return{label:"Deploy failed",message:b.deployError};if("string"==typeof b.upgradeError)return{label:"Upgrade failed",message:b.upgradeError};return null}catch{return null}}a.s(["default",0,function({initialNodes:a,initialTailscaleSummary:B}){let C,D,{activeNode:E}=(0,i.l)(),[F,G]=(0,c.useState)(a),[H,I]=(0,c.useState)((!!a.length||void 0===a)&&!1),[J,K]=(0,c.useState)(null),[L,N]=(0,c.useState)(!1),[W,X]=(0,c.useState)(!1);(0,c.useEffect)(()=>{"agents"===new URLSearchParams(window.location.search).get("upgrade")&&X(!0)},[]);let[Y,Z]=(0,c.useState)(null),[$,_]=(0,c.useState)(null),[aa,ab]=(0,c.useState)(!1),[af,ag]=(0,c.useState)([]),[ah,ai]=(0,c.useState)(null),[aj,ak]=(0,c.useState)({}),[al,am]=(0,c.useState)(null),[an,ao]=(0,c.useState)(B),ap=(0,c.useRef)(null),aq=(0,c.useRef)({}),[ar,as]=(0,c.useState)(a.length>0),at=(0,c.useCallback)(async(a=!1)=>{try{a||I(!0),K(null);let[b,c,d]=await Promise.all([h.f.nodes.list(),h.f.nodes.systemUpdatesSummary().catch(()=>null),h.f.nodes.tailscaleSummary().catch(()=>null)]),e=b.data.map(a=>{if(a.role)return delete aq.current[a.id],a;let b=aq.current[a.id];return void 0!==b?{...a,role:b}:a});G(e),am(c?.data??null),ao(d?.data??null);let f=await Promise.all(e.map(async a=>{try{let b=await h.f.nodes.health(a.id);return[a.id,b.data]}catch{return[a.id,null]}}));ak(Object.fromEntries(f.filter(a=>null!==a[1])))}catch(d){let b=d instanceof Error?d.message:String(d),c="Failed to fetch"===b||b.includes("TypeError")||b.includes("NetworkError")||b.includes("ECONNREFUSED")||b.includes("timeout");a||K(c?`Control node unreachable (${E.name})`:b)}finally{a||I(!1)}},[E.name]);(0,c.useEffect)(()=>{if(ar){as(!1),(async()=>{a.length>0&&ak(Object.fromEntries((await Promise.all(a.map(async a=>{try{let b=await h.f.nodes.health(a.id);return[a.id,b.data]}catch{return[a.id,null]}}))).filter(a=>null!==a[1])));try{let a=await h.f.nodes.systemUpdatesSummary();am(a.data)}catch{am(null)}try{let a=await h.f.nodes.tailscaleSummary();ao(a.data??null)}catch{ao(null)}})();return}G([]),K(null),ag([]),ak({}),am(null),ao(null),aq.current={},at()},[E.id]),(0,c.useEffect)(()=>{let a=F.some(a=>"PROVISIONING"===a.status||a.agent?.status==="UPDATING");return a&&!ap.current?ap.current=setInterval(()=>{at(!0)},4e3):!a&&ap.current&&(clearInterval(ap.current),ap.current=null),()=>{ap.current&&(clearInterval(ap.current),ap.current=null)}},[F,at]);let au=async a=>{if(confirm(`Delete node "${a.name}"? This will permanently remove it and all associated data.`))try{await h.f.nodes.delete(a.id),at()}catch{}},av=async()=>{ab(!0),ag([]);try{let a=await h.f.discovery.scan(5e3);a.success&&Array.isArray(a.data)&&ag(a.data)}catch{}finally{ab(!1)}};return(0,b.jsxs)(P.U,{className:"space-y-6",children:[(0,b.jsx)(P.z,{children:(0,b.jsx)(R.f,{title:"Nodes",eyebrow:"Fleet",description:"Manage your Magnus fleet nodes",status:F.length>0?(0,b.jsxs)("span",{className:"flex items-center gap-3 text-[10px] uppercase tracking-wider text-text-muted",children:[(0,b.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,b.jsx)(T.f,{status:"ONLINE",size:"xs"}),(0,b.jsx)("span",{className:"num",children:F.filter(a=>"ONLINE"===a.status).length})," online"]}),(0,b.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,b.jsx)(T.f,{status:"OFFLINE",size:"xs",pulse:!1}),(0,b.jsx)("span",{className:"num",children:F.filter(a=>"OFFLINE"===a.status).length})," offline"]})]}):void 0,actions:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f.K,{variant:"secondary",size:"sm",icon:(0,b.jsx)(k.f,{className:"h-3.5 w-3.5"}),onClick:()=>void at(),children:"Refresh"}),(0,b.jsx)(f.K,{variant:"secondary",size:"sm",icon:(0,b.jsx)(w.f,{className:"h-3.5 w-3.5"}),onClick:()=>X(!0),"data-testid":"open-agent-upgrade",children:"Upgrade Agents"}),(0,b.jsx)(f.K,{variant:"secondary",size:"sm",icon:(0,b.jsx)(j.f,{className:"h-3.5 w-3.5"}),onClick:()=>N(!0),children:"Register Node"})]})})}),(0,b.jsx)(P.z,{children:(0,b.jsx)(M,{})}),an&&(0,b.jsx)(P.z,{children:(0,b.jsx)(Q.f,{summary:an,showAction:!1})}),al&&(0,b.jsx)(P.z,{children:(0,b.jsx)("section",{className:"panel-corners overflow-hidden rounded-panel border border-border bg-surface","aria-label":"System update readiness",children:(0,b.jsxs)("div",{className:"grid grid-cols-2 divide-x divide-y divide-border/60 sm:grid-cols-4 sm:divide-y-0",children:[(0,b.jsxs)("div",{className:"col-span-2 flex items-center gap-3 px-4 py-3 sm:col-span-1",children:[(0,b.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-panel border border-primary/30 bg-primary/10 text-primary shadow-[0_0_10px_var(--color-glow)]",children:(0,b.jsx)(t.f,{className:"h-4 w-4"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Auto-update coverage"}),(0,b.jsxs)("p",{className:"num mt-0.5 text-sm font-semibold",children:[al.enabled," / ",al.reporting," enabled"]}),(0,b.jsx)(S.f,{className:"mt-1.5",value:al.reporting>0?al.enabled/al.reporting*100:null,tone:al.enabled===al.reporting?"success":"warning",label:"Auto-update coverage"})]})]}),(0,b.jsxs)("div",{className:"px-4 py-3",children:[(0,b.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Action needed"}),(0,b.jsx)("p",{className:`num mt-1 text-lg font-bold ${al.actionNeeded?"text-warning glow-text-warning":"text-success"}`,children:al.actionNeeded})]}),(0,b.jsxs)("div",{className:"px-4 py-3",children:[(0,b.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Reboot debt"}),(0,b.jsxs)("p",{className:`num mt-1 flex items-center gap-1.5 text-lg font-bold ${al.rebootRequired?"text-danger glow-text-danger":"text-success"}`,children:[al.rebootRequired?(0,b.jsx)(u.f,{className:"h-4 w-4"}):null,al.rebootRequired]})]}),(0,b.jsxs)("div",{className:"px-4 py-3",children:[(0,b.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Reporting"}),(0,b.jsxs)("p",{className:"num mt-1 text-lg font-bold",children:[al.reporting," / ",al.total]})]})]})})}),(0,b.jsx)(P.z,{children:(0,b.jsx)(d.N,{children:J?J.startsWith("Control node unreachable")?(0,b.jsx)(U.f,{tone:"warning",icon:(0,b.jsx)(n.f,{className:"h-5 w-5"}),title:J,description:"Cannot connect to this Control Node. Verify it is running and reachable.",action:(0,b.jsx)(f.K,{variant:"secondary",size:"sm",onClick:()=>void at(),children:"Retry"})}):(0,b.jsx)(U.f,{tone:"danger",icon:(0,b.jsx)(p.f,{className:"h-5 w-5"}),title:"Error loading nodes",description:J,action:(0,b.jsx)(f.K,{variant:"secondary",size:"sm",onClick:()=>void at(),children:"Retry"})}):H?(0,b.jsx)(V.F,{rows:6,cols:9,className:"border-0"}):0===F.length?(0,b.jsx)(U.f,{tone:"primary",icon:(0,b.jsx)(v.f,{className:"h-5 w-5"}),title:"No nodes registered",description:"Register your first Magnus node to get started.",action:(0,b.jsx)(f.K,{size:"sm",icon:(0,b.jsx)(j.f,{className:"h-3.5 w-3.5"}),onClick:()=>N(!0),children:"Register Node"})}):(0,b.jsx)("div",{className:"max-h-[70vh] overflow-auto",children:(0,b.jsxs)("table",{className:"w-full text-[11px]",children:[(0,b.jsx)("thead",{children:(0,b.jsxs)("tr",{className:"sticky top-0 z-10 border-b border-primary/30 bg-surface/95 text-left text-[10px] font-bold uppercase tracking-[0.15em] text-text-muted shadow-[0_1px_0_var(--color-primary),0_4px_12px_-6px_var(--color-glow)] backdrop-blur-sm",children:[(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Name"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Host"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Address"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Status"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Agent"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Role"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"CPU"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Memory"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Persistent Disk"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Updates"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Tailscale key"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Last Heartbeat"}),(0,b.jsx)("th",{className:"pb-3",children:"Actions"})]})}),(0,b.jsx)("tbody",{className:"divide-y divide-border/50",children:F.map(a=>{var c;let d=aj[a.id],h=(function(a){if(Array.isArray(a))return a;if(!a)return[];try{let b=JSON.parse(a);return Array.isArray(b)?b:[]}catch{return[]}})(d?.disks).filter(a=>"/"===a.mountPoint||"/home"===a.mountPoint||a.mountPoint.startsWith("/home/")||a.mountPoint.startsWith("/mnt/")||a.mountPoint.startsWith("/srv/")).filter(a=>!x.some(b=>a.mountPoint===b||a.mountPoint.startsWith(b))).filter(a=>!y.has((a.filesystemType??"").toLowerCase())).sort((a,b)=>b.usagePercent-a.usagePercent)[0]??null,i=h?(c=h.usagePercent)>=95?"critical":c>=80?"warning":"normal":null,j=al?.nodes.find(b=>b.id===a.id)?.systemUpdates??null,k=an?.nodes.find(b=>b.id===a.id)?.tailscale??null;return(0,b.jsxs)("tr",{className:"group/row relative transition-colors hover:bg-primary/[0.03] [&>td:first-child]:shadow-[inset_2px_0_0_transparent] hover:[&>td:first-child]:shadow-[inset_2px_0_0_var(--color-primary)]",children:[(0,b.jsx)("td",{className:"py-3 pl-2 pr-4",children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(T.f,{status:a.status,size:"xs"}),"ONLINE"===a.status&&(0,b.jsx)("button",{onClick:()=>ai(a),title:`Open terminal on ${a.name}`,className:"flex h-6 w-6 items-center justify-center rounded border border-border/50 text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:(0,b.jsx)(s.f,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(z.default,{href:`/nodes/${a.id}`,className:"font-medium text-primary hover:text-primary-hover transition-colors",children:a.name})]})}),(0,b.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:a.hostname}),(0,b.jsxs)("td",{className:"py-3 pr-4 text-text-muted",children:[a.ipAddress,":",a.port]}),(0,b.jsx)("td",{className:"py-3 pr-4",children:(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)(e.t,{variant:(0,e.k)(a.status),children:a.status}),("DEGRADED"===a.status||a.agent?.status==="ERROR")&&ae(a.metadata)&&(0,b.jsx)("span",{title:`${ae(a.metadata).label}: ${ae(a.metadata).message}`,children:(0,b.jsx)(p.f,{className:"h-3.5 w-3.5 text-danger cursor-help"})}),"PROVISIONING"===a.status&&(0,b.jsx)(o.f,{className:"h-3.5 w-3.5 text-info animate-spin"}),(0,b.jsx)(ad.x,{readiness:a.upgradeReadiness})]})}),(0,b.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[a.agent?`v${a.agent.version}`:"—",a.agent?.status==="UPDATING"&&(0,b.jsx)(o.f,{className:"h-3 w-3 text-info animate-spin"})]})}),(0,b.jsx)("td",{className:"py-3 pr-4",children:a.role?(0,b.jsxs)("button",{className:"inline-flex items-center gap-1 rounded border border-primary/30 bg-primary/5 px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider text-primary hover:bg-primary/10 hover:border-primary/50 transition-all cursor-pointer",onClick:()=>_(a),title:"Change role",children:[(0,b.jsx)(r.f,{className:"h-3 w-3"}),a.role.name]}):(0,b.jsx)("button",{className:"text-[10px] text-text-muted hover:text-primary transition-colors cursor-pointer uppercase tracking-wider",onClick:()=>_(a),children:"+ Assign"})}),(0,b.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:d?(0,b.jsx)(S.f,{value:d.cpuUsagePercent,label:`${a.name} CPU`,valueLabel:`${d.cpuUsagePercent.toFixed(1)}%`,showValue:!0,className:"w-28"}):"—"}),(0,b.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:d?(0,b.jsxs)("div",{className:"w-36",children:[(0,b.jsx)(S.f,{value:d.memoryPercent,label:`${a.name} memory`,showValue:!0}),(0,b.jsxs)("span",{className:"num mt-0.5 block text-[10px] text-text-muted/80",children:[(d.memoryUsedBytes/0x40000000).toFixed(1)," / ",(d.memoryTotalBytes/0x40000000).toFixed(1)," GB"]})]}):"—"}),(0,b.jsx)("td",{className:"py-3 pr-4",children:h?(0,b.jsxs)("span",{className:"flex w-36 flex-col gap-0.5",title:`${h.mountPoint} filesystem is ${h.usagePercent}% used${"normal"===i?"":" — disk usage anomaly"}`,children:[(0,b.jsx)(S.f,{value:h.usagePercent,tone:"critical"===i?"danger":"warning"===i?"warning":"success",label:`${a.name} ${h.mountPoint} disk`,valueLabel:`${h.usagePercent.toFixed(0)}%`,glow:"normal"!==i,showValue:!0}),(0,b.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-text-muted",children:["normal"!==i&&(0,b.jsx)(q.f,{"aria-label":`${i} disk usage anomaly`,className:"critical"===i?"h-3 w-3 text-danger":"h-3 w-3 text-warning"}),h.mountPoint]})]}):(0,b.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,b.jsx)("td",{className:"py-3 pr-4",children:j?j.rebootRequired?(0,b.jsx)(e.t,{variant:"danger",children:"reboot required"}):"enabled"===j.automaticUpdates?(0,b.jsx)(e.t,{variant:"success",children:"automatic"}):"unsupported"===j.automaticUpdates?(0,b.jsx)(e.t,{variant:"default",children:"unsupported"}):(0,b.jsx)(e.t,{variant:"warning",children:"enable updates"}):(0,b.jsx)(e.t,{variant:"default",children:"awaiting agent"})}),(0,b.jsx)("td",{className:"py-3 pr-4",title:k?.keyExpiry?`Expires ${k.keyExpiry}`:void 0,children:k?k.expiryEnabled?k.expired?(0,b.jsx)(e.t,{variant:"danger",children:"expired"}):null===k.daysRemaining?(0,b.jsx)(e.t,{variant:"default",children:"unknown"}):k.requiresRenewal?(0,b.jsxs)(e.t,{variant:"warning",children:[k.daysRemaining,"d"]}):(0,b.jsxs)(e.t,{variant:"success",children:[k.daysRemaining,"d"]}):(0,b.jsx)(e.t,{variant:"success",children:"no expiry"}):(0,b.jsx)(e.t,{variant:"default",children:"awaiting agent"})}),(0,b.jsx)("td",{className:"num py-3 pr-4 text-text-muted",children:(0,g.C)(a.lastHeartbeatAt)}),(0,b.jsx)("td",{className:"py-3",children:(0,b.jsxs)("div",{className:"flex gap-1",children:[(0,b.jsx)(z.default,{href:`/nodes/${a.id}`,children:(0,b.jsx)(f.K,{variant:"ghost",size:"sm",children:"View"})}),(0,b.jsx)(f.K,{variant:"ghost",size:"sm",onClick:()=>Z(a),children:(0,b.jsx)(l.f,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(f.K,{variant:"ghost",size:"sm",onClick:()=>void au(a),children:(0,b.jsx)(m.f,{className:"h-3.5 w-3.5 text-danger"})})]})})]},a.id)})})]})})})}),(0,b.jsx)(P.z,{children:(0,b.jsxs)(d.N,{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(n.f,{className:"h-4 w-4 text-primary"}),(0,b.jsx)("h2",{className:"text-xs font-bold uppercase tracking-wider",children:"Network Discovery"}),(0,b.jsx)("span",{className:"text-[11px] text-text-muted",children:"— Unadopted agents found on the local network"})]}),(0,b.jsx)(f.K,{variant:"secondary",size:"sm",icon:aa?(0,b.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(n.f,{className:"h-3.5 w-3.5"}),onClick:()=>void av(),disabled:aa,children:aa?"Scanning…":"Scan Network"})]}),0===af.length?aa?(0,b.jsxs)("div",{className:"flex flex-col items-center gap-3 py-6",children:[(0,b.jsxs)("div",{className:"relative h-16 w-16 overflow-hidden rounded-full border border-primary/30 shadow-[0_0_16px_var(--color-glow)]",children:[(0,b.jsx)("div",{className:"absolute inset-0 animate-sweep rounded-full bg-[conic-gradient(from_0deg,transparent_0deg,transparent_280deg,var(--color-primary)_360deg)] opacity-60"}),(0,b.jsx)("div",{className:"absolute inset-[30%] rounded-full border border-primary/20"})]}),(0,b.jsx)("p",{className:"text-[11px] uppercase tracking-wider text-primary",children:"Broadcasting discovery probe…"})]}):(0,b.jsx)(U.f,{compact:!0,icon:(0,b.jsx)(n.f,{className:"h-4 w-4"}),title:"No scan results yet",description:'Click "Scan Network" to discover unadopted agents on your network.'}):(C=af.filter(a=>!a.registered),D=af.filter(a=>a.registered),0===C.length?(0,b.jsxs)("div",{className:"py-6 text-center text-[11px] text-text-muted",children:["All ",D.length," discovered agent",1!==D.length?"s":""," already registered. No new nodes to adopt."]}):(0,b.jsxs)("div",{className:"overflow-x-auto",children:[(0,b.jsxs)("table",{className:"w-full text-[11px]",children:[(0,b.jsx)("thead",{children:(0,b.jsxs)("tr",{className:"border-b border-primary/20 text-left text-[10px] font-bold uppercase tracking-[0.15em] text-text-muted",children:[(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Hostname"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"IP Address"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Port"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Agent Version"}),(0,b.jsx)("th",{className:"pb-3",children:"Registration"})]})}),(0,b.jsx)("tbody",{className:"divide-y divide-border/50",children:C.map(a=>(0,b.jsxs)("tr",{className:"hover:bg-surface-hover transition-colors",children:[(0,b.jsx)("td",{className:"py-3 pr-4 font-medium",children:a.fqdn||a.hostname}),(0,b.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:a.ip}),(0,b.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:a.port}),(0,b.jsxs)("td",{className:"py-3 pr-4 text-text-muted",children:["v",a.version]}),(0,b.jsx)("td",{className:"py-3 text-text-muted",children:"Use the reviewed key-only agent deploy runbook, then register the authenticated heartbeat."})]},`${a.ip}:${a.port}`))})]}),D.length>0&&(0,b.jsxs)("p",{className:"mt-3 text-xs text-text-muted",children:[D.length," already-registered agent",1!==D.length?"s":""," ","hidden from this list."]})]}))]})}),(0,b.jsx)(ac,{open:W,onClose:()=>X(!1),onFinished:()=>void at()}),(0,b.jsx)(A.M,{open:L,onClose:()=>N(!1),onRegistered:()=>void at()}),(0,b.jsx)(A.F,{open:!!Y,node:Y,onClose:()=>Z(null),onSaved:()=>void at()}),(0,b.jsx)(A.E,{open:!!$,node:$,onClose:()=>_(null),onSaved:a=>{$&&(aq.current[$.id]=a,G(b=>b.map(b=>b.id===$.id?{...b,role:a}:b))),at()}}),(0,b.jsx)(O,{open:!!ah,onClose:()=>ai(null),node:ah})]})}],83679)}];
|
|
15
|
+
`),n("error");return}if(b||k.current)return;n("connected");let w=new AbortController;l.current=w,(async()=>{try{let a=await fetch(`/api/terminal/stream?sessionId=${encodeURIComponent(c)}`,{signal:w.signal});if(!a.ok||!a.body){b||k.current||(m.write("\r\n\x1b[31mFailed to connect output stream\x1b[0m\r\n"),n("error"));return}let d=a.body.getReader();for(;;){let{done:a,value:c}=await d.read();if(a||b||k.current)break;c&&m.write(c)}}catch(a){if(a instanceof DOMException&&"AbortError"===a.name)return}b||k.current||(n("closed"),m.write("\r\n\x1b[38;2;138;138;171m── Session ended ──\x1b[0m\r\n"))})(),m.onData(a=>{!k.current&&j.current&&(o.current+=a,p.current||(p.current=setTimeout(q,16)))}),m.onResize(({cols:a,rows:b})=>{!k.current&&j.current&&fetch("/api/terminal/resize",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:j.current,cols:a,rows:b})}).catch(()=>{})})})();let c=()=>{i.current&&!k.current&&i.current.fit()};return window.addEventListener("resize",c),()=>{b=!0,window.removeEventListener("resize",c),r()}},[d,f,r,q]);let t=(0,c.useCallback)(()=>{r(),e()},[r,e]);return f?(0,b.jsx)(N.n,{open:d,onClose:t,title:`Terminal: ${f.name}`,description:"Interactive SSH session",icon:(0,b.jsx)(s.f,{className:"h-5 w-5 text-primary"}),className:"max-w-5xl",children:(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsxs)("div",{className:"absolute top-0 right-0 z-10 flex items-center gap-1.5 px-2 py-1",children:[(0,b.jsx)("div",{className:`h-1.5 w-1.5 rounded-full ${"connected"===m?"bg-success":"connecting"===m?"bg-warning animate-pulse":"error"===m?"bg-danger":"bg-text-muted"}`}),(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:m})]}),(0,b.jsx)("div",{ref:g,className:"h-[65vh] w-full rounded border border-border/50 bg-[#06060d] p-1 overflow-hidden"})]})}):null}var P=a.i(73771),Q=a.i(4591),R=a.i(5564),S=a.i(85651),T=a.i(2668),U=a.i(90165),V=a.i(68216),W=a.i(13412);let X={name:"clipboard-check",size:24,node:[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]};X.node;let Y=(0,F.f)(X),Z={name:"octagon-x",size:24,node:[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-octagon"]};Z.node;let $=(0,F.f)(Z);var _=a.i(11134),aa=a.i(47515);let ab={pending:{label:"Queued",variant:"default"},requested:{label:"Installing",variant:"info"},watching:{label:"Watching",variant:"info"},ambiguous:{label:"Unknown",variant:"warning"},confirmed:{label:"Upgraded",variant:"success"},reverted:{label:"Reverted",variant:"danger"},failed:{label:"Failed",variant:"danger"},refused:{label:"Refused",variant:"warning"},skipped:{label:"Skipped",variant:"default"}};function ac({open:a,onClose:d,onFinished:g}){let[i,j]=(0,c.useState)(null),[k,l]=(0,c.useState)(new Set),[m,n]=(0,c.useState)(null),[p,r]=(0,c.useState)(null),[s,t]=(0,c.useState)(!1),[u,v]=(0,c.useState)(null),[x,y]=(0,c.useState)(!1),[z,A]=(0,c.useState)(""),B=async a=>r(await (0,aa.s)(a)),C=(0,c.useCallback)(async()=>{r(null);try{let a=await h.f.agentUpgrades.eligibility();j(a),l(new Set(a.nodes.filter(a=>a.eligible).map(a=>a.nodeId))),n(a.latestRun??null)}catch(a){r(await (0,aa.s)(a))}},[]);(0,c.useEffect)(()=>{a&&(n(null),v(null),C())},[a,C]),(0,c.useEffect)(()=>{if(!m||"running"!==m.status)return;let a=window.setInterval(()=>{h.f.agentUpgrades.run(m.id).then(a=>{n(a),"running"!==a.status&&g?.()}).catch(async b=>{window.clearInterval(a),r((0,aa.c)(b)?`Upgrade run ${m.id} is no longer known to the server`:await (0,aa.s)(b)),(0,aa.c)(b)&&n(null)})},5e3);return()=>window.clearInterval(a)},[m,g]);let E=(0,c.useMemo)(()=>i?.nodes.filter(a=>a.eligible).length??0,[i]),F=i?.nodes.filter(a=>"MAJOR_VERSION"===a.code).length??0,G=i&&(!m||"running"!==m.status),H=async a=>{t(!0),r(null);try{n(await a())}catch(a){await B(a)}finally{t(!1)}},I=/^[1-9][0-9]{0,2}$/.test(z)?{maxFailures:Number(z)}:{},J=async()=>{y(!0),r(null);try{v(await h.f.agentUpgrades.check({version:i?.version,...k.size?{nodeIds:[...k]}:{}}))}catch(a){await B(a)}finally{y(!1)}},K=(a=!1)=>m&&H(()=>h.f.agentUpgrades.retry(m.id,a?{acknowledgeSuspicion:a}:{}));return(0,b.jsx)(N.n,{open:a,onClose:d,title:"Upgrade agents",icon:(0,b.jsx)(w.f,{className:"h-4 w-4"}),description:i?(0,aa.Q)(i):void 0,className:"max-h-[calc(100dvh-1.5rem)] max-w-4xl overflow-y-auto",children:(0,b.jsxs)("div",{className:"space-y-4 text-[11px]",children:[p&&(0,b.jsx)("div",{className:"rounded border border-danger/40 bg-danger/10 px-3 py-2 text-danger","data-testid":"agent-upgrade-error",children:p}),i&&!i.upgradesEnabled&&(0,b.jsxs)("div",{className:"rounded border border-warning/40 bg-warning/10 px-3 py-2 text-warning",children:["Agent upgrades are off: ",i.disabledReason]}),!i&&!p&&(0,b.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,b.jsx)(o.f,{className:"h-4 w-4 animate-spin"})," Checking agents…"]}),m&&(0,b.jsxs)("div",{className:"space-y-2","data-testid":"agent-upgrade-run",children:[(0,b.jsxs)("p",{className:"flex flex-wrap items-center gap-2",children:["running"===m.status&&(0,b.jsx)(o.f,{className:"h-4 w-4 animate-spin text-primary"}),"succeeded"===m.status&&(0,b.jsx)(W.f,{className:"h-4 w-4 text-success"}),"partial"===m.status&&(0,b.jsx)(q.f,{className:"h-4 w-4 text-warning"}),("failed"===m.status||"interrupted"===m.status)&&(0,b.jsx)(_.f,{className:"h-4 w-4 text-danger"}),"stopped"===m.status&&(0,b.jsx)($,{className:"h-4 w-4 text-warning"}),(0,b.jsx)("span",{className:"font-bold uppercase tracking-wider",children:"running"===m.status?`Upgrading to ${m.version}${m.stopRequestedBy?" (stopping after the nodes in progress)":""}`:(0,aa.P)(m)})]}),"running"!==m.status&&m.message&&(0,b.jsx)("p",{className:"text-text-muted","data-testid":"agent-upgrade-run-message",children:m.message}),(m.warnings??[]).map(a=>(0,b.jsxs)("p",{className:"text-warning","data-testid":"agent-upgrade-warning",children:[a.name,": ",a.detail]},`${a.nodeId}-${a.code}`)),(0,b.jsxs)("details",{open:"running"===m.status,className:"group",children:[(0,b.jsxs)("summary",{className:"cursor-pointer text-text-muted",children:["running"===m.status?"Current rollout":"Previous rollout"," to ",m.version," · ",m.nodes.length," agent",1===m.nodes.length?"":"s"]}),(0,b.jsxs)("ul",{className:"mt-2 max-h-80 divide-y divide-border/40 overflow-y-auto rounded border border-border",children:[m.nodes.map(a=>(0,b.jsxs)("li",{className:"flex flex-wrap items-center gap-3 px-3 py-2",children:[(0,b.jsxs)("span",{className:"w-40 truncate font-medium text-text",children:[a.name,a.nodeId===(m.canaryNodeId??m.nodes[0]?.nodeId)?" (canary)":""]}),(0,b.jsxs)("span",{className:"num shrink-0 text-text-muted",children:[a.from," → ",m.version]}),(0,b.jsxs)(e.t,{variant:ab[a.state]?.variant??"default",children:["requested"===a.state&&(0,b.jsx)(o.f,{className:"mr-1 inline h-3 w-3 animate-spin"}),"reverted"===a.state&&(0,b.jsx)(D.f,{className:"mr-1 inline h-3 w-3"}),ab[a.state]?.label??a.state]}),(a.attempts??1)>1&&(0,b.jsxs)("span",{className:"num text-text-muted",children:["try ",a.attempts]}),(0,aa.b)(a)&&(0,b.jsx)("span",{className:"w-full break-words text-text-muted",children:(0,aa.b)(a)})]},a.nodeId)),(m.excluded??[]).map(a=>(0,b.jsxs)("li",{className:"flex flex-wrap items-center gap-3 px-3 py-2 text-text-muted",title:a.reason,children:[(0,b.jsx)("span",{className:"w-40 truncate font-medium text-text",children:a.name}),(0,b.jsx)(e.t,{variant:"default",children:"Not included"}),(0,b.jsx)("span",{className:"w-full break-words text-text-muted",children:a.reason})]},`excluded-${a.nodeId}`))]})]}),"running"!==m.status&&(m.attention?.length??0)>0&&(0,b.jsxs)("div",{className:"space-y-2 rounded border border-warning/40 bg-warning/10 px-3 py-2","data-testid":"agent-upgrade-attention",children:[(0,b.jsx)("p",{className:"font-bold uppercase tracking-wider text-warning",children:"Needs attention"}),(0,b.jsx)("ul",{className:"max-h-48 space-y-2 overflow-y-auto",children:m.attention.map(a=>(0,b.jsxs)("li",{children:[(0,b.jsxs)("p",{className:"font-medium text-text",children:[a.name,": ",(0,b.jsx)("span",{className:"num",children:a.code}),"release"===a.failureClass?" (points at the release)":"",a.unknownCode?" (unrecognised code)":""]}),a.detail&&(0,b.jsx)("p",{className:"text-text-muted",children:a.detail}),(0,b.jsx)("p",{className:"text-text",children:a.remedy})]},`${a.nodeId}-${a.code}`))})]})]}),u&&(0,b.jsxs)("div",{className:"space-y-2","data-testid":"agent-upgrade-check",children:[(0,b.jsxs)("p",{className:"font-bold uppercase tracking-wider",children:["Check: ",u.eligible," ready, ",u.blocked," blocked",u.release.verified?"":`; target not verified: ${u.release.reason??"unknown"}`]}),(0,b.jsx)("ul",{className:"max-h-64 divide-y divide-border/40 overflow-y-auto rounded border border-border",children:u.nodes.map(a=>(0,b.jsxs)("li",{className:"space-y-1 px-3 py-2",children:[(0,b.jsxs)("p",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("span",{className:"w-40 truncate font-medium text-text",children:a.name}),(0,b.jsx)(e.t,{variant:a.eligible?"success":a.preflight?.status==="blocked"?"danger":"default",children:a.eligible?"Ready":a.code??"Not eligible"}),(0,b.jsxs)("span",{className:"text-text-muted",children:["preflight ",a.preflight?.status??"not run"]})]}),!a.eligible&&a.reason&&(0,b.jsx)("p",{className:"text-text-muted",children:a.reason}),!a.eligible&&a.remedy&&(0,b.jsx)("p",{className:"text-text",children:a.remedy}),a.preflight?.problems.filter(b=>b.code!==a.code).map(a=>(0,b.jsxs)("p",{className:"text-text-muted",children:[(0,b.jsx)("span",{className:"num",children:a.code}),": ",a.detail,". ",(0,aa.V)(a.code)]},`${a.code}-${a.detail}`))]},a.nodeId))})]}),G&&(0,b.jsxs)("section",{className:"space-y-2","aria-label":"Current upgrade eligibility",children:[(0,b.jsxs)("p",{className:"font-bold uppercase tracking-wider",children:["Target ",i.version,": ",E," ready, ",i.nodes.length-E," unavailable"]}),F>0&&(0,b.jsxs)("div",{className:"space-y-1 rounded border border-warning/40 bg-warning/10 px-3 py-2 text-warning","data-testid":"agent-upgrade-major-notice",children:[(0,b.jsxs)("p",{children:[F," agent",1===F?" requires":"s require"," a manual major-version upgrade to ",i.version,". This dialog only upgrades agents within their current major version."]}),(0,b.jsxs)("p",{children:["Read the ",(0,b.jsx)("a",{href:"https://github.com/ChefTaco/magnus/blob/main/docs/NODE_CREDENTIALS.md#moving-agents-across-a-major-version",target:"_blank",rel:"noreferrer",className:"underline",children:"cross-major procedure"}),": from the server host, ",(0,b.jsxs)("code",{children:["magnus-server agents upgrade --to ",i.version," --allow-major"]})," moves keyed agents of 2.10.3 or later with a server-signed authorization; older agents take 2.10.3 first. A successful rollout to an older version does not complete this upgrade."]})]}),0===E&&(0,b.jsx)("p",{className:"text-text-muted","data-testid":"agent-upgrade-empty",children:"No agents can be upgraded from this dialog right now. Review the reasons below; Check refreshes the readiness report."}),(0,b.jsxs)("ul",{className:"max-h-80 divide-y divide-border/40 overflow-y-auto rounded border border-border","data-testid":"agent-upgrade-candidates",children:[i.nodes.map(a=>(0,b.jsx)("li",{className:"px-3 py-2",children:(0,b.jsxs)("label",{className:"flex items-start gap-3",children:[(0,b.jsx)("input",{type:"checkbox",className:"mt-0.5 shrink-0","aria-label":`Upgrade ${a.name}`,checked:k.has(a.nodeId),disabled:!a.eligible||!i.upgradesEnabled,onChange:()=>{let b;return b=a.nodeId,l(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})}}),(0,b.jsxs)("span",{className:"min-w-0 flex-1 space-y-1",children:[(0,b.jsxs)("span",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[(0,b.jsx)("span",{className:"break-words font-medium text-text",children:a.name}),(0,b.jsxs)("span",{className:"num text-text-muted",children:[a.version,a.eligible?` → ${i.version}`:""]}),a.preflight&&"ok"!==a.preflight.status&&(0,b.jsxs)(e.t,{variant:"blocked"===a.preflight.status?"danger":"default",children:["preflight ",a.preflight.status]})]}),!a.eligible&&(0,b.jsx)("span",{className:"block break-words text-text-muted",children:a.reason})]})]})},a.nodeId)),0===i.nodes.length&&(0,b.jsx)("li",{className:"px-3 py-2 text-text-muted",children:"No nodes registered."})]})]}),(0,b.jsxs)("div",{className:"space-y-3 border-t border-border pt-3",children:[(0,b.jsx)("p",{className:"text-text-muted",children:"The first agent is a canary. Each agent switches back by itself if the new version does not report a heartbeat in time. Only evidence about the release stops the run: a failure on the canary, an integrity mismatch, or too many reverts. A problem of one node is recorded and the run goes on."}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-3",children:[G&&E>0&&(0,b.jsxs)("label",{className:"flex shrink-0 items-center gap-1 text-text-muted",title:"Reverts or failed installs that stop the run after its canary. Empty: the server's setting.",children:["Stop after",(0,b.jsx)("input",{className:"w-12 rounded border border-border bg-transparent px-1 py-0.5 text-text",inputMode:"numeric","aria-label":"Release failures that stop the run",value:z,onChange:a=>A(a.target.value),"data-testid":"agent-upgrade-max-failures"}),"failures"]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)(f.K,{variant:"secondary",size:"sm",onClick:d,children:"Close"}),m?.status==="running"&&(0,b.jsx)(f.K,{variant:"danger",size:"sm",onClick:()=>void(m&&H(()=>h.f.agentUpgrades.stop(m.id))),"data-testid":"agent-upgrade-stop",disabled:s||!!m.stopRequestedBy,icon:(0,b.jsx)($,{className:"h-3.5 w-3.5"}),children:"Stop"}),(0,aa.v)(m)&&i?.upgradesEnabled&&(0,b.jsxs)(f.K,{variant:"secondary",size:"sm",onClick:()=>void K(),"data-testid":"agent-upgrade-retry",disabled:s,icon:(0,b.jsx)(D.f,{className:"h-3.5 w-3.5"}),children:["Retry ",(0,aa.w)(m)," node",1===(0,aa.w)(m)?"":"s"]}),(0,aa.v)(m)&&i?.upgradesEnabled&&(m?.suspectedRelease||m?.excluded?.some(a=>"RETRY_HELD_SUSPECTED"===a.code))&&(0,b.jsx)(f.K,{variant:"danger",size:"sm",onClick:()=>void K(!0),"data-testid":"agent-upgrade-retry-acknowledged",disabled:s,title:"Each attempt on an older agent can strand another lease. Read the agent log first.",icon:(0,b.jsx)(D.f,{className:"h-3.5 w-3.5"}),children:"Retry older agents too"}),G&&(0,b.jsx)(f.K,{variant:"secondary",size:"sm",onClick:()=>void J(),"data-testid":"agent-upgrade-check-button",disabled:s||x,icon:x?(0,b.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(Y,{className:"h-3.5 w-3.5"}),children:"Check"}),G&&(0,b.jsxs)(f.K,{variant:"primary",size:"sm",onClick:()=>void H(()=>h.f.agentUpgrades.start({nodeIds:[...k],version:i?.version,...i?.prerelease?{allowPrerelease:!0}:{},...I})),"data-testid":"agent-upgrade-start",disabled:s||0===k.size||!i?.upgradesEnabled,icon:s?(0,b.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(w.f,{className:"h-3.5 w-3.5"}),children:["Upgrade ",k.size," agent",1===k.size?"":"s"]})]})]})]})]})})}var ad=a.i(33666);function ae(a){try{let b=JSON.parse(a);if("string"==typeof b.deployError)return{label:"Deploy failed",message:b.deployError};if("string"==typeof b.upgradeError)return{label:"Upgrade failed",message:b.upgradeError};return null}catch{return null}}a.s(["default",0,function({initialNodes:a,initialTailscaleSummary:B}){let C,D,{activeNode:E}=(0,i.l)(),[F,G]=(0,c.useState)(a),[H,I]=(0,c.useState)((!!a.length||void 0===a)&&!1),[J,K]=(0,c.useState)(null),[L,N]=(0,c.useState)(!1),[W,X]=(0,c.useState)(!1);(0,c.useEffect)(()=>{"agents"===new URLSearchParams(window.location.search).get("upgrade")&&X(!0)},[]);let[Y,Z]=(0,c.useState)(null),[$,_]=(0,c.useState)(null),[aa,ab]=(0,c.useState)(!1),[af,ag]=(0,c.useState)([]),[ah,ai]=(0,c.useState)(null),[aj,ak]=(0,c.useState)({}),[al,am]=(0,c.useState)(null),[an,ao]=(0,c.useState)(B),ap=(0,c.useRef)(null),aq=(0,c.useRef)({}),[ar,as]=(0,c.useState)(a.length>0),at=(0,c.useCallback)(async(a=!1)=>{try{a||I(!0),K(null);let[b,c,d]=await Promise.all([h.f.nodes.list(),h.f.nodes.systemUpdatesSummary().catch(()=>null),h.f.nodes.tailscaleSummary().catch(()=>null)]),e=b.data.map(a=>{if(a.role)return delete aq.current[a.id],a;let b=aq.current[a.id];return void 0!==b?{...a,role:b}:a});G(e),am(c?.data??null),ao(d?.data??null);let f=await Promise.all(e.map(async a=>{try{let b=await h.f.nodes.health(a.id);return[a.id,b.data]}catch{return[a.id,null]}}));ak(Object.fromEntries(f.filter(a=>null!==a[1])))}catch(d){let b=d instanceof Error?d.message:String(d),c="Failed to fetch"===b||b.includes("TypeError")||b.includes("NetworkError")||b.includes("ECONNREFUSED")||b.includes("timeout");a||K(c?`Control node unreachable (${E.name})`:b)}finally{a||I(!1)}},[E.name]);(0,c.useEffect)(()=>{if(ar){as(!1),(async()=>{a.length>0&&ak(Object.fromEntries((await Promise.all(a.map(async a=>{try{let b=await h.f.nodes.health(a.id);return[a.id,b.data]}catch{return[a.id,null]}}))).filter(a=>null!==a[1])));try{let a=await h.f.nodes.systemUpdatesSummary();am(a.data)}catch{am(null)}try{let a=await h.f.nodes.tailscaleSummary();ao(a.data??null)}catch{ao(null)}})();return}G([]),K(null),ag([]),ak({}),am(null),ao(null),aq.current={},at()},[E.id]),(0,c.useEffect)(()=>{let a=F.some(a=>"PROVISIONING"===a.status||a.agent?.status==="UPDATING");return a&&!ap.current?ap.current=setInterval(()=>{at(!0)},4e3):!a&&ap.current&&(clearInterval(ap.current),ap.current=null),()=>{ap.current&&(clearInterval(ap.current),ap.current=null)}},[F,at]);let au=async a=>{if(confirm(`Delete node "${a.name}"? This will permanently remove it and all associated data.`))try{await h.f.nodes.delete(a.id),at()}catch{}},av=async()=>{ab(!0),ag([]);try{let a=await h.f.discovery.scan(5e3);a.success&&Array.isArray(a.data)&&ag(a.data)}catch{}finally{ab(!1)}};return(0,b.jsxs)(P.U,{className:"space-y-6",children:[(0,b.jsx)(P.z,{children:(0,b.jsx)(R.f,{title:"Nodes",eyebrow:"Fleet",description:"Manage your Magnus fleet nodes",status:F.length>0?(0,b.jsxs)("span",{className:"flex items-center gap-3 text-[10px] uppercase tracking-wider text-text-muted",children:[(0,b.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,b.jsx)(T.f,{status:"ONLINE",size:"xs"}),(0,b.jsx)("span",{className:"num",children:F.filter(a=>"ONLINE"===a.status).length})," online"]}),(0,b.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,b.jsx)(T.f,{status:"OFFLINE",size:"xs",pulse:!1}),(0,b.jsx)("span",{className:"num",children:F.filter(a=>"OFFLINE"===a.status).length})," offline"]})]}):void 0,actions:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f.K,{variant:"secondary",size:"sm",icon:(0,b.jsx)(k.f,{className:"h-3.5 w-3.5"}),onClick:()=>void at(),children:"Refresh"}),(0,b.jsx)(f.K,{variant:"secondary",size:"sm",icon:(0,b.jsx)(w.f,{className:"h-3.5 w-3.5"}),onClick:()=>X(!0),"data-testid":"open-agent-upgrade",children:"Upgrade Agents"}),(0,b.jsx)(f.K,{variant:"secondary",size:"sm",icon:(0,b.jsx)(j.f,{className:"h-3.5 w-3.5"}),onClick:()=>N(!0),children:"Register Node"})]})})}),(0,b.jsx)(P.z,{children:(0,b.jsx)(M,{})}),an&&(0,b.jsx)(P.z,{children:(0,b.jsx)(Q.f,{summary:an,showAction:!1})}),al&&(0,b.jsx)(P.z,{children:(0,b.jsx)("section",{className:"panel-corners overflow-hidden rounded-panel border border-border bg-surface","aria-label":"System update readiness",children:(0,b.jsxs)("div",{className:"grid grid-cols-2 divide-x divide-y divide-border/60 sm:grid-cols-4 sm:divide-y-0",children:[(0,b.jsxs)("div",{className:"col-span-2 flex items-center gap-3 px-4 py-3 sm:col-span-1",children:[(0,b.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-panel border border-primary/30 bg-primary/10 text-primary shadow-[0_0_10px_var(--color-glow)]",children:(0,b.jsx)(t.f,{className:"h-4 w-4"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Auto-update coverage"}),(0,b.jsxs)("p",{className:"num mt-0.5 text-sm font-semibold",children:[al.enabled," / ",al.reporting," enabled"]}),(0,b.jsx)(S.f,{className:"mt-1.5",value:al.reporting>0?al.enabled/al.reporting*100:null,tone:al.enabled===al.reporting?"success":"warning",label:"Auto-update coverage"})]})]}),(0,b.jsxs)("div",{className:"px-4 py-3",children:[(0,b.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Action needed"}),(0,b.jsx)("p",{className:`num mt-1 text-lg font-bold ${al.actionNeeded?"text-warning glow-text-warning":"text-success"}`,children:al.actionNeeded})]}),(0,b.jsxs)("div",{className:"px-4 py-3",children:[(0,b.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Reboot debt"}),(0,b.jsxs)("p",{className:`num mt-1 flex items-center gap-1.5 text-lg font-bold ${al.rebootRequired?"text-danger glow-text-danger":"text-success"}`,children:[al.rebootRequired?(0,b.jsx)(u.f,{className:"h-4 w-4"}):null,al.rebootRequired]})]}),(0,b.jsxs)("div",{className:"px-4 py-3",children:[(0,b.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Reporting"}),(0,b.jsxs)("p",{className:"num mt-1 text-lg font-bold",children:[al.reporting," / ",al.total]})]})]})})}),(0,b.jsx)(P.z,{children:(0,b.jsx)(d.N,{children:J?J.startsWith("Control node unreachable")?(0,b.jsx)(U.f,{tone:"warning",icon:(0,b.jsx)(n.f,{className:"h-5 w-5"}),title:J,description:"Cannot connect to this Control Node. Verify it is running and reachable.",action:(0,b.jsx)(f.K,{variant:"secondary",size:"sm",onClick:()=>void at(),children:"Retry"})}):(0,b.jsx)(U.f,{tone:"danger",icon:(0,b.jsx)(p.f,{className:"h-5 w-5"}),title:"Error loading nodes",description:J,action:(0,b.jsx)(f.K,{variant:"secondary",size:"sm",onClick:()=>void at(),children:"Retry"})}):H?(0,b.jsx)(V.F,{rows:6,cols:9,className:"border-0"}):0===F.length?(0,b.jsx)(U.f,{tone:"primary",icon:(0,b.jsx)(v.f,{className:"h-5 w-5"}),title:"No nodes registered",description:"Register your first Magnus node to get started.",action:(0,b.jsx)(f.K,{size:"sm",icon:(0,b.jsx)(j.f,{className:"h-3.5 w-3.5"}),onClick:()=>N(!0),children:"Register Node"})}):(0,b.jsx)("div",{className:"max-h-[70vh] overflow-auto",children:(0,b.jsxs)("table",{className:"w-full text-[11px]",children:[(0,b.jsx)("thead",{children:(0,b.jsxs)("tr",{className:"sticky top-0 z-10 border-b border-primary/30 bg-surface/95 text-left text-[10px] font-bold uppercase tracking-[0.15em] text-text-muted shadow-[0_1px_0_var(--color-primary),0_4px_12px_-6px_var(--color-glow)] backdrop-blur-sm",children:[(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Name"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Host"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Address"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Status"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Agent"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Role"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"CPU"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Memory"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Persistent Disk"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Updates"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Tailscale key"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Last Heartbeat"}),(0,b.jsx)("th",{className:"pb-3",children:"Actions"})]})}),(0,b.jsx)("tbody",{className:"divide-y divide-border/50",children:F.map(a=>{var c;let d=aj[a.id],h=(function(a){if(Array.isArray(a))return a;if(!a)return[];try{let b=JSON.parse(a);return Array.isArray(b)?b:[]}catch{return[]}})(d?.disks).filter(a=>"/"===a.mountPoint||"/home"===a.mountPoint||a.mountPoint.startsWith("/home/")||a.mountPoint.startsWith("/mnt/")||a.mountPoint.startsWith("/srv/")).filter(a=>!x.some(b=>a.mountPoint===b||a.mountPoint.startsWith(b))).filter(a=>!y.has((a.filesystemType??"").toLowerCase())).sort((a,b)=>b.usagePercent-a.usagePercent)[0]??null,i=h?(c=h.usagePercent)>=95?"critical":c>=80?"warning":"normal":null,j=al?.nodes.find(b=>b.id===a.id)?.systemUpdates??null,k=an?.nodes.find(b=>b.id===a.id)?.tailscale??null;return(0,b.jsxs)("tr",{className:"group/row relative transition-colors hover:bg-primary/[0.03] [&>td:first-child]:shadow-[inset_2px_0_0_transparent] hover:[&>td:first-child]:shadow-[inset_2px_0_0_var(--color-primary)]",children:[(0,b.jsx)("td",{className:"py-3 pl-2 pr-4",children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(T.f,{status:a.status,size:"xs"}),"ONLINE"===a.status&&(0,b.jsx)("button",{onClick:()=>ai(a),title:`Open terminal on ${a.name}`,className:"flex h-6 w-6 items-center justify-center rounded border border-border/50 text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:(0,b.jsx)(s.f,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(z.default,{href:`/nodes/${a.id}`,className:"font-medium text-primary hover:text-primary-hover transition-colors",children:a.name})]})}),(0,b.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:a.hostname}),(0,b.jsxs)("td",{className:"py-3 pr-4 text-text-muted",children:[a.ipAddress,":",a.port]}),(0,b.jsx)("td",{className:"py-3 pr-4",children:(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)(e.t,{variant:(0,e.k)(a.status),children:a.status}),("DEGRADED"===a.status||a.agent?.status==="ERROR")&&ae(a.metadata)&&(0,b.jsx)("span",{title:`${ae(a.metadata).label}: ${ae(a.metadata).message}`,children:(0,b.jsx)(p.f,{className:"h-3.5 w-3.5 text-danger cursor-help"})}),"PROVISIONING"===a.status&&(0,b.jsx)(o.f,{className:"h-3.5 w-3.5 text-info animate-spin"}),(0,b.jsx)(ad.x,{readiness:a.upgradeReadiness})]})}),(0,b.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[a.agent?`v${a.agent.version}`:"—",a.agent?.status==="UPDATING"&&(0,b.jsx)(o.f,{className:"h-3 w-3 text-info animate-spin"})]})}),(0,b.jsx)("td",{className:"py-3 pr-4",children:a.role?(0,b.jsxs)("button",{className:"inline-flex items-center gap-1 rounded border border-primary/30 bg-primary/5 px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider text-primary hover:bg-primary/10 hover:border-primary/50 transition-all cursor-pointer",onClick:()=>_(a),title:"Change role",children:[(0,b.jsx)(r.f,{className:"h-3 w-3"}),a.role.name]}):(0,b.jsx)("button",{className:"text-[10px] text-text-muted hover:text-primary transition-colors cursor-pointer uppercase tracking-wider",onClick:()=>_(a),children:"+ Assign"})}),(0,b.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:d?(0,b.jsx)(S.f,{value:d.cpuUsagePercent,label:`${a.name} CPU`,valueLabel:`${d.cpuUsagePercent.toFixed(1)}%`,showValue:!0,className:"w-28"}):"—"}),(0,b.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:d?(0,b.jsxs)("div",{className:"w-36",children:[(0,b.jsx)(S.f,{value:d.memoryPercent,label:`${a.name} memory`,showValue:!0}),(0,b.jsxs)("span",{className:"num mt-0.5 block text-[10px] text-text-muted/80",children:[(d.memoryUsedBytes/0x40000000).toFixed(1)," / ",(d.memoryTotalBytes/0x40000000).toFixed(1)," GB"]})]}):"—"}),(0,b.jsx)("td",{className:"py-3 pr-4",children:h?(0,b.jsxs)("span",{className:"flex w-36 flex-col gap-0.5",title:`${h.mountPoint} filesystem is ${h.usagePercent}% used${"normal"===i?"":" — disk usage anomaly"}`,children:[(0,b.jsx)(S.f,{value:h.usagePercent,tone:"critical"===i?"danger":"warning"===i?"warning":"success",label:`${a.name} ${h.mountPoint} disk`,valueLabel:`${h.usagePercent.toFixed(0)}%`,glow:"normal"!==i,showValue:!0}),(0,b.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-text-muted",children:["normal"!==i&&(0,b.jsx)(q.f,{"aria-label":`${i} disk usage anomaly`,className:"critical"===i?"h-3 w-3 text-danger":"h-3 w-3 text-warning"}),h.mountPoint]})]}):(0,b.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,b.jsx)("td",{className:"py-3 pr-4",children:j?j.rebootRequired?(0,b.jsx)(e.t,{variant:"danger",children:"reboot required"}):"enabled"===j.automaticUpdates?(0,b.jsx)(e.t,{variant:"success",children:"automatic"}):"unsupported"===j.automaticUpdates?(0,b.jsx)(e.t,{variant:"default",children:"unsupported"}):(0,b.jsx)(e.t,{variant:"warning",children:"enable updates"}):(0,b.jsx)(e.t,{variant:"default",children:"awaiting agent"})}),(0,b.jsx)("td",{className:"py-3 pr-4",title:k?.keyExpiry?`Expires ${k.keyExpiry}`:void 0,children:k?k.expiryEnabled?k.expired?(0,b.jsx)(e.t,{variant:"danger",children:"expired"}):null===k.daysRemaining?(0,b.jsx)(e.t,{variant:"default",children:"unknown"}):k.requiresRenewal?(0,b.jsxs)(e.t,{variant:"warning",children:[k.daysRemaining,"d"]}):(0,b.jsxs)(e.t,{variant:"success",children:[k.daysRemaining,"d"]}):(0,b.jsx)(e.t,{variant:"success",children:"no expiry"}):(0,b.jsx)(e.t,{variant:"default",children:"awaiting agent"})}),(0,b.jsx)("td",{className:"num py-3 pr-4 text-text-muted",children:(0,g.C)(a.lastHeartbeatAt)}),(0,b.jsx)("td",{className:"py-3",children:(0,b.jsxs)("div",{className:"flex gap-1",children:[(0,b.jsx)(z.default,{href:`/nodes/${a.id}`,children:(0,b.jsx)(f.K,{variant:"ghost",size:"sm",children:"View"})}),(0,b.jsx)(f.K,{variant:"ghost",size:"sm",onClick:()=>Z(a),children:(0,b.jsx)(l.f,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(f.K,{variant:"ghost",size:"sm",onClick:()=>void au(a),children:(0,b.jsx)(m.f,{className:"h-3.5 w-3.5 text-danger"})})]})})]},a.id)})})]})})})}),(0,b.jsx)(P.z,{children:(0,b.jsxs)(d.N,{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(n.f,{className:"h-4 w-4 text-primary"}),(0,b.jsx)("h2",{className:"text-xs font-bold uppercase tracking-wider",children:"Network Discovery"}),(0,b.jsx)("span",{className:"text-[11px] text-text-muted",children:"— Unadopted agents found on the local network"})]}),(0,b.jsx)(f.K,{variant:"secondary",size:"sm",icon:aa?(0,b.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(n.f,{className:"h-3.5 w-3.5"}),onClick:()=>void av(),disabled:aa,children:aa?"Scanning…":"Scan Network"})]}),0===af.length?aa?(0,b.jsxs)("div",{className:"flex flex-col items-center gap-3 py-6",children:[(0,b.jsxs)("div",{className:"relative h-16 w-16 overflow-hidden rounded-full border border-primary/30 shadow-[0_0_16px_var(--color-glow)]",children:[(0,b.jsx)("div",{className:"absolute inset-0 animate-sweep rounded-full bg-[conic-gradient(from_0deg,transparent_0deg,transparent_280deg,var(--color-primary)_360deg)] opacity-60"}),(0,b.jsx)("div",{className:"absolute inset-[30%] rounded-full border border-primary/20"})]}),(0,b.jsx)("p",{className:"text-[11px] uppercase tracking-wider text-primary",children:"Broadcasting discovery probe…"})]}):(0,b.jsx)(U.f,{compact:!0,icon:(0,b.jsx)(n.f,{className:"h-4 w-4"}),title:"No scan results yet",description:'Click "Scan Network" to discover unadopted agents on your network.'}):(C=af.filter(a=>!a.registered),D=af.filter(a=>a.registered),0===C.length?(0,b.jsxs)("div",{className:"py-6 text-center text-[11px] text-text-muted",children:["All ",D.length," discovered agent",1!==D.length?"s":""," already registered. No new nodes to adopt."]}):(0,b.jsxs)("div",{className:"overflow-x-auto",children:[(0,b.jsxs)("table",{className:"w-full text-[11px]",children:[(0,b.jsx)("thead",{children:(0,b.jsxs)("tr",{className:"border-b border-primary/20 text-left text-[10px] font-bold uppercase tracking-[0.15em] text-text-muted",children:[(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Hostname"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"IP Address"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Port"}),(0,b.jsx)("th",{className:"pb-3 pr-4",children:"Agent Version"}),(0,b.jsx)("th",{className:"pb-3",children:"Registration"})]})}),(0,b.jsx)("tbody",{className:"divide-y divide-border/50",children:C.map(a=>(0,b.jsxs)("tr",{className:"hover:bg-surface-hover transition-colors",children:[(0,b.jsx)("td",{className:"py-3 pr-4 font-medium",children:a.fqdn||a.hostname}),(0,b.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:a.ip}),(0,b.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:a.port}),(0,b.jsxs)("td",{className:"py-3 pr-4 text-text-muted",children:["v",a.version]}),(0,b.jsx)("td",{className:"py-3 text-text-muted",children:"Use the reviewed key-only agent deploy runbook, then register the authenticated heartbeat."})]},`${a.ip}:${a.port}`))})]}),D.length>0&&(0,b.jsxs)("p",{className:"mt-3 text-xs text-text-muted",children:[D.length," already-registered agent",1!==D.length?"s":""," ","hidden from this list."]})]}))]})}),(0,b.jsx)(ac,{open:W,onClose:()=>X(!1),onFinished:()=>void at()}),(0,b.jsx)(A.M,{open:L,onClose:()=>N(!1),onRegistered:()=>void at()}),(0,b.jsx)(A.F,{open:!!Y,node:Y,onClose:()=>Z(null),onSaved:()=>void at()}),(0,b.jsx)(A.E,{open:!!$,node:$,onClose:()=>_(null),onSaved:a=>{$&&(aq.current[$.id]=a,G(b=>b.map(b=>b.id===$.id?{...b,role:a}:b))),at()}}),(0,b.jsx)(O,{open:!!ah,onClose:()=>ai(null),node:ah})]})}],83679)}];
|
|
16
16
|
|
|
17
17
|
//# sourceMappingURL=apps_dashboard_src_app_nodes_nodes-client_tsx_0pt4iarhpqbgn._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[9121,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(68415),e=a.i(58299),f=a.i(49521),g=a.i(85063),h=a.i(46997),i=a.i(8897),j=a.i(5050);let k=(0,j.createServerReference)("406b408054dae9069a6598eceff6cd79c2d735a7b7",j.callServer,void 0,j.findSourceMapURL,"scanSkills");var l=a.i(8387),m=a.i(73771),n=a.i(33855),o=a.i(19783),p=a.i(33540),q=a.i(92965),r=a.i(34532),s=a.i(64831);let t={name:"tag",size:24,node:[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]};t.node;let u=(0,s.f)(t);var v=a.i(40260),w=a.i(89027),x=a.i(41146),y=a.i(55681),z=a.i(1661),A=a.i(75160),B=a.i(68579),C=a.i(13412),D=a.i(11134);a.s(["default",0,function(){let{activeNode:a}=(0,i.l)(),[j,s]=(0,c.useState)([]),[t,E]=(0,c.useState)(!1),[F,G]=(0,c.useState)(null),[H,I]=(0,c.useState)(!1),[J,K]=(0,c.useState)(""),[L,M]=(0,c.useState)(new Set),[N,O]=(0,c.useState)(null),[P,Q]=(0,c.useState)(null),[R,S]=(0,c.useState)(""),[T,U]=(0,c.useState)(!1),V=(0,c.useCallback)(async()=>{E(!0),s([]),G(null);let b=Date.now();try{let b=await k(a.id);if(b.success&&Array.isArray(b.data)){let a=b.data.map(a=>({...a,status:"error"===a.status?"error":"done",skills:a.skills.map(a=>({...a,files:a.files.map(a=>"string"==typeof a?{name:a,content:""}:a)}))}));s(a);let c=new Set(a.filter(a=>a.skills.length>0).map(a=>a.nodeId));M(c.size>0?c:new Set(a.map(a=>a.nodeId)))}else G(b.error?.message??"Scan returned unsuccessful response")}catch(b){let a=b instanceof Error?b.message:"Scan request failed";G(a)}finally{let a=Date.now()-b;a<1500&&await new Promise(b=>setTimeout(b,1500-a)),E(!1),I(!0)}},[a]);(0,c.useEffect)(()=>{a&&V()},[a,V]);let W=j.reduce((a,b)=>a+("done"===b.status?b.skills.length:0),0),X=j.filter(a=>"done"===a.status).length,Y=j.filter(a=>"error"===a.status).length,Z=a=>{if(!J)return!0;let b=J.toLowerCase();return a.name.toLowerCase().includes(b)||a.description.toLowerCase().includes(b)||a.tags.some(a=>a.toLowerCase().includes(b))},$=async()=>{if(P&&R){U(!0);try{let a={name:P.skill.name,version:R,description:P.skill.description,author:P.skill.author,entryPoint:P.skill.entryPoint,dependencies:P.skill.dependencies,tags:P.skill.tags},b={};for(let a of P.skill.files)b[a.name]=a.content;let c=JSON.stringify({manifest:a,files:b},null,2);await h.f.library.files.create({name:`${P.skill.name} v${R}`,fileName:`${P.skill.name}-${R}.json`,mimeType:"application/x-magnus-skill",content:c,tags:["skill",...P.skill.tags]}),Q(null),S("")}catch{}finally{U(!1)}}};return(0,b.jsxs)(m.U,{className:"space-y-6",children:[(0,b.jsx)(m.z,{children:(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-lg font-bold uppercase tracking-wider",children:"Skills"}),(0,b.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:"Discover and manage Hermes Agent skills across your fleet"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[H&&!t&&(0,b.jsxs)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider mr-2",children:[j.length," node",1!==j.length?"s":""," · ",W," skill",1!==W?"s":"",Y>0&&` \xb7 ${Y} error${1!==Y?"s":""}`]}),(0,b.jsxs)(d.K,{variant:"secondary",size:"sm",onClick:()=>void V(),disabled:t,children:[(0,b.jsx)(o.f,{className:(0,l.f)("h-3.5 w-3.5 mr-1.5",t&&"animate-spin")}),t?"Scanning...":"Rescan"]})]})]})}),t&&(0,b.jsx)(m.z,{children:(0,b.jsx)(n.f,{title:"Scanning Nodes for Skills",description:"Probing all online nodes...",nodes:j.map(a=>({nodeId:a.nodeId,nodeName:a.nodeName,status:a.status,error:a.error})),scanning:!0})}),!t&&H&&W>0&&(0,b.jsx)(m.z,{children:(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(p.f,{className:"absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-text-muted"}),(0,b.jsx)("input",{type:"text",placeholder:"Search skills by name, description, or tag...",value:J,onChange:a=>K(a.target.value),className:(0,l.f)(g.W,"pl-9")})]})}),!t&&H&&F&&(0,b.jsx)(m.z,{children:(0,b.jsx)(f.N,{children:(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,b.jsx)(B.f,{className:"h-10 w-10 text-danger/60 mb-3"}),(0,b.jsx)("p",{className:"text-xs font-bold text-danger mb-1",children:"Scan Failed"}),(0,b.jsx)("p",{className:"text-[11px] text-text-muted max-w-md",children:F}),(0,b.jsxs)(d.K,{variant:"secondary",size:"sm",className:"mt-4",onClick:()=>void V(),children:[(0,b.jsx)(o.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Retry Scan"]})]})})}),!t&&H&&!F&&(0,b.jsxs)(b.Fragment,{children:[0===j.length?(0,b.jsx)(m.z,{children:(0,b.jsx)(f.N,{children:(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,b.jsx)(r.f,{className:"h-10 w-10 text-text-muted/40 mb-3"}),(0,b.jsx)("p",{className:"text-xs text-text-muted",children:"No online nodes found to scan. Ensure at least one node agent is running and connected."})]})})}):j.map(a=>{let c=L.has(a.nodeId),g=a.skills.filter(Z);return(0,b.jsx)(m.z,{children:(0,b.jsxs)(f.N,{className:"overflow-hidden",children:[(0,b.jsxs)("button",{onClick:()=>{var b;return b=a.nodeId,void M(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"w-full flex items-center gap-4 p-4 text-left hover:bg-surface-hover transition-all",children:[(0,b.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded border border-primary/30 bg-primary/5 shrink-0",children:(0,b.jsx)(r.f,{className:"h-4 w-4 text-primary"})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider",children:a.nodeName}),"done"===a.status&&(0,b.jsxs)(e.t,{variant:a.skills.length>0?"success":"default",children:[a.skills.length," skill",1!==a.skills.length?"s":""]}),"error"===a.status&&(0,b.jsx)(e.t,{variant:"danger",children:"Error"})]}),"error"===a.status&&a.error&&(0,b.jsx)("p",{className:"text-[11px] text-danger mt-0.5 truncate",children:a.error}),"done"===a.status&&0===a.skills.length&&(0,b.jsx)("p",{className:"text-[11px] text-text-muted mt-0.5",children:"No skills installed on this node"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:["done"===a.status?(0,b.jsx)(C.f,{className:"h-4 w-4 text-success"}):(0,b.jsx)(D.f,{className:"h-4 w-4 text-danger"}),c?(0,b.jsx)(w.f,{className:"h-4 w-4 text-text-muted"}):(0,b.jsx)(x.f,{className:"h-4 w-4 text-text-muted"})]})]}),c&&"done"===a.status&&(0,b.jsx)("div",{className:"border-t border-border/50 bg-bg/50",children:0===g.length?(0,b.jsx)("div",{className:"flex items-center justify-center py-8 text-center",children:(0,b.jsx)("p",{className:"text-[11px] text-text-muted",children:0===a.skills.length?"No skills installed on this node. Deploy skills from the Library.":"No skills match your search on this node."})}):(0,b.jsx)("div",{className:"divide-y divide-border/30",children:g.map(c=>(0,b.jsxs)("div",{className:"p-4 space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(q.f,{className:"h-4 w-4 text-primary"}),(0,b.jsx)("span",{className:"text-xs font-bold",children:c.name}),(0,b.jsx)(e.t,{variant:"info",children:c.version})]}),(0,b.jsxs)(d.K,{size:"sm",variant:"secondary",onClick:()=>{Q({skill:c,nodeId:a.nodeId,nodeName:a.nodeName}),S(c.version)},children:[(0,b.jsx)(z.f,{className:"h-3 w-3 mr-1"}),"Publish"]})]}),c.description&&(0,b.jsx)("p",{className:"text-[11px] text-text-muted",children:c.description}),c.tags.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap gap-1",children:c.tags.map(a=>(0,b.jsxs)(e.t,{variant:"default",children:[(0,b.jsx)(u,{className:"h-2.5 w-2.5 mr-1"}),a]},a))}),(0,b.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,b.jsxs)("div",{className:"rounded border border-border bg-surface p-2",children:[(0,b.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-wider text-text-muted mb-0.5",children:"Author"}),(0,b.jsx)("p",{className:"text-[11px]",children:c.author||"—"})]}),(0,b.jsxs)("div",{className:"rounded border border-border bg-surface p-2",children:[(0,b.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-wider text-text-muted mb-0.5",children:"Entry Point"}),(0,b.jsx)("p",{className:"text-[11px]",children:c.entryPoint||"—"})]}),(0,b.jsxs)("div",{className:"rounded border border-border bg-surface p-2",children:[(0,b.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-wider text-text-muted mb-0.5",children:"Dependencies"}),(0,b.jsx)("p",{className:"text-[11px]",children:c.dependencies.length>0?c.dependencies.join(", "):"—"})]})]}),c.files.length>0&&(0,b.jsxs)("div",{children:[(0,b.jsxs)("p",{className:"text-[10px] font-bold uppercase tracking-wider text-text-muted mb-1.5",children:["Files (",c.files.length,")"]}),(0,b.jsx)("div",{className:"space-y-1",children:c.files.map(a=>(0,b.jsxs)("button",{onClick:()=>O(a),className:"flex items-center gap-2 rounded border border-border/50 px-3 py-1.5 text-xs hover:border-primary/30 hover:shadow-[0_0_20px_var(--color-glow)] transition-all w-full text-left",children:[(0,b.jsx)(v.f,{className:"h-3 w-3 text-primary"}),(0,b.jsx)("span",{children:a.name}),(0,b.jsx)(y.f,{className:"h-3 w-3 text-text-muted ml-auto"})]},a.name))})]})]},c.name))})})]})},a.nodeId)}),j.length>0&&(0,b.jsx)(m.z,{children:(0,b.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-text-muted uppercase tracking-wider",children:[(0,b.jsxs)("span",{children:[X," node",1!==X?"s":""," scanned ·"," ",W," skill",1!==W?"s":""," discovered"]}),Y>0&&(0,b.jsxs)("span",{className:"text-danger",children:[Y," node",1!==Y?"s":""," unreachable"]})]})})]}),(0,b.jsx)(g.n,{open:!!N,onClose:()=>O(null),title:N?.name??"File",icon:(0,b.jsx)(v.f,{className:"h-5 w-5 text-primary"}),className:"max-w-3xl",children:(0,b.jsx)("pre",{className:"rounded border border-border bg-bg p-4 text-xs overflow-auto max-h-96 whitespace-pre-wrap",children:N?.content||"(empty)"})}),(0,b.jsx)(g.n,{open:!!P,onClose:()=>Q(null),title:"Publish to Library",description:P?.skill.name??"",icon:(0,b.jsx)(z.f,{className:"h-5 w-5 text-primary"}),children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("label",{className:"block text-[11px] font-bold uppercase tracking-wider mb-1.5",children:["Version ",(0,b.jsx)("span",{className:"text-accent",children:"*"})]}),(0,b.jsx)("input",{type:"text",value:R,onChange:a=>S(a.target.value),placeholder:"1.0.0",className:g.W})]}),P&&(0,b.jsxs)("div",{className:"rounded border border-border bg-bg p-3 text-xs space-y-1",children:[(0,b.jsxs)("p",{children:[(0,b.jsx)("span",{className:"text-text-muted",children:"Source:"})," ",P.nodeName]}),(0,b.jsxs)("p",{children:[(0,b.jsx)("span",{className:"text-text-muted",children:"Files:"})," ",P.skill.files.length," files"]}),(0,b.jsxs)("p",{children:[(0,b.jsx)("span",{className:"text-text-muted",children:"Tags:"})," ",["skill",...P.skill.tags].join(", ")]})]}),(0,b.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,b.jsx)(d.K,{variant:"secondary",size:"sm",onClick:()=>Q(null),children:"Cancel"}),(0,b.jsx)(d.K,{size:"sm",onClick:()=>void $(),disabled:T||!R,children:T?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(A.f,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Publishing..."]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(z.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Publish"]})})]})]})})]})}],9121)}];
|
|
1
|
+
module.exports=[9121,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(68415),e=a.i(58299),f=a.i(49521),g=a.i(85063),h=a.i(46997),i=a.i(8897),j=a.i(5050);let k=(0,j.createServerReference)("40621a3491778be6a588165d98886f043ad61ad1d3",j.callServer,void 0,j.findSourceMapURL,"scanSkills");var l=a.i(8387),m=a.i(73771),n=a.i(33855),o=a.i(19783),p=a.i(33540),q=a.i(92965),r=a.i(34532),s=a.i(64831);let t={name:"tag",size:24,node:[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]};t.node;let u=(0,s.f)(t);var v=a.i(40260),w=a.i(89027),x=a.i(41146),y=a.i(55681),z=a.i(1661),A=a.i(75160),B=a.i(68579),C=a.i(13412),D=a.i(11134);a.s(["default",0,function(){let{activeNode:a}=(0,i.l)(),[j,s]=(0,c.useState)([]),[t,E]=(0,c.useState)(!1),[F,G]=(0,c.useState)(null),[H,I]=(0,c.useState)(!1),[J,K]=(0,c.useState)(""),[L,M]=(0,c.useState)(new Set),[N,O]=(0,c.useState)(null),[P,Q]=(0,c.useState)(null),[R,S]=(0,c.useState)(""),[T,U]=(0,c.useState)(!1),V=(0,c.useCallback)(async()=>{E(!0),s([]),G(null);let b=Date.now();try{let b=await k(a.id);if(b.success&&Array.isArray(b.data)){let a=b.data.map(a=>({...a,status:"error"===a.status?"error":"done",skills:a.skills.map(a=>({...a,files:a.files.map(a=>"string"==typeof a?{name:a,content:""}:a)}))}));s(a);let c=new Set(a.filter(a=>a.skills.length>0).map(a=>a.nodeId));M(c.size>0?c:new Set(a.map(a=>a.nodeId)))}else G(b.error?.message??"Scan returned unsuccessful response")}catch(b){let a=b instanceof Error?b.message:"Scan request failed";G(a)}finally{let a=Date.now()-b;a<1500&&await new Promise(b=>setTimeout(b,1500-a)),E(!1),I(!0)}},[a]);(0,c.useEffect)(()=>{a&&V()},[a,V]);let W=j.reduce((a,b)=>a+("done"===b.status?b.skills.length:0),0),X=j.filter(a=>"done"===a.status).length,Y=j.filter(a=>"error"===a.status).length,Z=a=>{if(!J)return!0;let b=J.toLowerCase();return a.name.toLowerCase().includes(b)||a.description.toLowerCase().includes(b)||a.tags.some(a=>a.toLowerCase().includes(b))},$=async()=>{if(P&&R){U(!0);try{let a={name:P.skill.name,version:R,description:P.skill.description,author:P.skill.author,entryPoint:P.skill.entryPoint,dependencies:P.skill.dependencies,tags:P.skill.tags},b={};for(let a of P.skill.files)b[a.name]=a.content;let c=JSON.stringify({manifest:a,files:b},null,2);await h.f.library.files.create({name:`${P.skill.name} v${R}`,fileName:`${P.skill.name}-${R}.json`,mimeType:"application/x-magnus-skill",content:c,tags:["skill",...P.skill.tags]}),Q(null),S("")}catch{}finally{U(!1)}}};return(0,b.jsxs)(m.U,{className:"space-y-6",children:[(0,b.jsx)(m.z,{children:(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-lg font-bold uppercase tracking-wider",children:"Skills"}),(0,b.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:"Discover and manage Hermes Agent skills across your fleet"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[H&&!t&&(0,b.jsxs)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider mr-2",children:[j.length," node",1!==j.length?"s":""," · ",W," skill",1!==W?"s":"",Y>0&&` \xb7 ${Y} error${1!==Y?"s":""}`]}),(0,b.jsxs)(d.K,{variant:"secondary",size:"sm",onClick:()=>void V(),disabled:t,children:[(0,b.jsx)(o.f,{className:(0,l.f)("h-3.5 w-3.5 mr-1.5",t&&"animate-spin")}),t?"Scanning...":"Rescan"]})]})]})}),t&&(0,b.jsx)(m.z,{children:(0,b.jsx)(n.f,{title:"Scanning Nodes for Skills",description:"Probing all online nodes...",nodes:j.map(a=>({nodeId:a.nodeId,nodeName:a.nodeName,status:a.status,error:a.error})),scanning:!0})}),!t&&H&&W>0&&(0,b.jsx)(m.z,{children:(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(p.f,{className:"absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-text-muted"}),(0,b.jsx)("input",{type:"text",placeholder:"Search skills by name, description, or tag...",value:J,onChange:a=>K(a.target.value),className:(0,l.f)(g.W,"pl-9")})]})}),!t&&H&&F&&(0,b.jsx)(m.z,{children:(0,b.jsx)(f.N,{children:(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,b.jsx)(B.f,{className:"h-10 w-10 text-danger/60 mb-3"}),(0,b.jsx)("p",{className:"text-xs font-bold text-danger mb-1",children:"Scan Failed"}),(0,b.jsx)("p",{className:"text-[11px] text-text-muted max-w-md",children:F}),(0,b.jsxs)(d.K,{variant:"secondary",size:"sm",className:"mt-4",onClick:()=>void V(),children:[(0,b.jsx)(o.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Retry Scan"]})]})})}),!t&&H&&!F&&(0,b.jsxs)(b.Fragment,{children:[0===j.length?(0,b.jsx)(m.z,{children:(0,b.jsx)(f.N,{children:(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,b.jsx)(r.f,{className:"h-10 w-10 text-text-muted/40 mb-3"}),(0,b.jsx)("p",{className:"text-xs text-text-muted",children:"No online nodes found to scan. Ensure at least one node agent is running and connected."})]})})}):j.map(a=>{let c=L.has(a.nodeId),g=a.skills.filter(Z);return(0,b.jsx)(m.z,{children:(0,b.jsxs)(f.N,{className:"overflow-hidden",children:[(0,b.jsxs)("button",{onClick:()=>{var b;return b=a.nodeId,void M(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"w-full flex items-center gap-4 p-4 text-left hover:bg-surface-hover transition-all",children:[(0,b.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded border border-primary/30 bg-primary/5 shrink-0",children:(0,b.jsx)(r.f,{className:"h-4 w-4 text-primary"})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider",children:a.nodeName}),"done"===a.status&&(0,b.jsxs)(e.t,{variant:a.skills.length>0?"success":"default",children:[a.skills.length," skill",1!==a.skills.length?"s":""]}),"error"===a.status&&(0,b.jsx)(e.t,{variant:"danger",children:"Error"})]}),"error"===a.status&&a.error&&(0,b.jsx)("p",{className:"text-[11px] text-danger mt-0.5 truncate",children:a.error}),"done"===a.status&&0===a.skills.length&&(0,b.jsx)("p",{className:"text-[11px] text-text-muted mt-0.5",children:"No skills installed on this node"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:["done"===a.status?(0,b.jsx)(C.f,{className:"h-4 w-4 text-success"}):(0,b.jsx)(D.f,{className:"h-4 w-4 text-danger"}),c?(0,b.jsx)(w.f,{className:"h-4 w-4 text-text-muted"}):(0,b.jsx)(x.f,{className:"h-4 w-4 text-text-muted"})]})]}),c&&"done"===a.status&&(0,b.jsx)("div",{className:"border-t border-border/50 bg-bg/50",children:0===g.length?(0,b.jsx)("div",{className:"flex items-center justify-center py-8 text-center",children:(0,b.jsx)("p",{className:"text-[11px] text-text-muted",children:0===a.skills.length?"No skills installed on this node. Deploy skills from the Library.":"No skills match your search on this node."})}):(0,b.jsx)("div",{className:"divide-y divide-border/30",children:g.map(c=>(0,b.jsxs)("div",{className:"p-4 space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(q.f,{className:"h-4 w-4 text-primary"}),(0,b.jsx)("span",{className:"text-xs font-bold",children:c.name}),(0,b.jsx)(e.t,{variant:"info",children:c.version})]}),(0,b.jsxs)(d.K,{size:"sm",variant:"secondary",onClick:()=>{Q({skill:c,nodeId:a.nodeId,nodeName:a.nodeName}),S(c.version)},children:[(0,b.jsx)(z.f,{className:"h-3 w-3 mr-1"}),"Publish"]})]}),c.description&&(0,b.jsx)("p",{className:"text-[11px] text-text-muted",children:c.description}),c.tags.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap gap-1",children:c.tags.map(a=>(0,b.jsxs)(e.t,{variant:"default",children:[(0,b.jsx)(u,{className:"h-2.5 w-2.5 mr-1"}),a]},a))}),(0,b.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,b.jsxs)("div",{className:"rounded border border-border bg-surface p-2",children:[(0,b.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-wider text-text-muted mb-0.5",children:"Author"}),(0,b.jsx)("p",{className:"text-[11px]",children:c.author||"—"})]}),(0,b.jsxs)("div",{className:"rounded border border-border bg-surface p-2",children:[(0,b.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-wider text-text-muted mb-0.5",children:"Entry Point"}),(0,b.jsx)("p",{className:"text-[11px]",children:c.entryPoint||"—"})]}),(0,b.jsxs)("div",{className:"rounded border border-border bg-surface p-2",children:[(0,b.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-wider text-text-muted mb-0.5",children:"Dependencies"}),(0,b.jsx)("p",{className:"text-[11px]",children:c.dependencies.length>0?c.dependencies.join(", "):"—"})]})]}),c.files.length>0&&(0,b.jsxs)("div",{children:[(0,b.jsxs)("p",{className:"text-[10px] font-bold uppercase tracking-wider text-text-muted mb-1.5",children:["Files (",c.files.length,")"]}),(0,b.jsx)("div",{className:"space-y-1",children:c.files.map(a=>(0,b.jsxs)("button",{onClick:()=>O(a),className:"flex items-center gap-2 rounded border border-border/50 px-3 py-1.5 text-xs hover:border-primary/30 hover:shadow-[0_0_20px_var(--color-glow)] transition-all w-full text-left",children:[(0,b.jsx)(v.f,{className:"h-3 w-3 text-primary"}),(0,b.jsx)("span",{children:a.name}),(0,b.jsx)(y.f,{className:"h-3 w-3 text-text-muted ml-auto"})]},a.name))})]})]},c.name))})})]})},a.nodeId)}),j.length>0&&(0,b.jsx)(m.z,{children:(0,b.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-text-muted uppercase tracking-wider",children:[(0,b.jsxs)("span",{children:[X," node",1!==X?"s":""," scanned ·"," ",W," skill",1!==W?"s":""," discovered"]}),Y>0&&(0,b.jsxs)("span",{className:"text-danger",children:[Y," node",1!==Y?"s":""," unreachable"]})]})})]}),(0,b.jsx)(g.n,{open:!!N,onClose:()=>O(null),title:N?.name??"File",icon:(0,b.jsx)(v.f,{className:"h-5 w-5 text-primary"}),className:"max-w-3xl",children:(0,b.jsx)("pre",{className:"rounded border border-border bg-bg p-4 text-xs overflow-auto max-h-96 whitespace-pre-wrap",children:N?.content||"(empty)"})}),(0,b.jsx)(g.n,{open:!!P,onClose:()=>Q(null),title:"Publish to Library",description:P?.skill.name??"",icon:(0,b.jsx)(z.f,{className:"h-5 w-5 text-primary"}),children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("label",{className:"block text-[11px] font-bold uppercase tracking-wider mb-1.5",children:["Version ",(0,b.jsx)("span",{className:"text-accent",children:"*"})]}),(0,b.jsx)("input",{type:"text",value:R,onChange:a=>S(a.target.value),placeholder:"1.0.0",className:g.W})]}),P&&(0,b.jsxs)("div",{className:"rounded border border-border bg-bg p-3 text-xs space-y-1",children:[(0,b.jsxs)("p",{children:[(0,b.jsx)("span",{className:"text-text-muted",children:"Source:"})," ",P.nodeName]}),(0,b.jsxs)("p",{children:[(0,b.jsx)("span",{className:"text-text-muted",children:"Files:"})," ",P.skill.files.length," files"]}),(0,b.jsxs)("p",{children:[(0,b.jsx)("span",{className:"text-text-muted",children:"Tags:"})," ",["skill",...P.skill.tags].join(", ")]})]}),(0,b.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,b.jsx)(d.K,{variant:"secondary",size:"sm",onClick:()=>Q(null),children:"Cancel"}),(0,b.jsx)(d.K,{size:"sm",onClick:()=>void $(),disabled:T||!R,children:T?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(A.f,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Publishing..."]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(z.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Publish"]})})]})]})})]})}],9121)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=apps_dashboard_src_app_skills_page_tsx_0n5zp4xad38in._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[47515,a=>{"use strict";var b=a.i(8884);let c={SELF_UPGRADE_INTEGRITY:{class:"release",stopsRun:!0,cause:"The downloaded tarball does not match the pinned npm integrity.",remedy:"Do not retry. Check the registry or MAGNUS_AGENT_UPGRADE_SOURCE_DIR, and the integrity passed to the run."},SELF_UPGRADE_SOURCE:{class:"release",stopsRun:!0,cause:"The tarball is missing from MAGNUS_AGENT_UPGRADE_SOURCE_DIR.",remedy:"Copy the exact tarball to that directory on the nodes, then retry."},SELF_UPGRADE_FAILED:{class:"release",cause:"The package itself failed on the node: a bad tarball, an install error, missing provenance or a smoke test that failed or hung. An agent older than 1.1.8 also reports environment causes this way.",remedy:"Read the detail and the agent log. If several nodes fail the same way, the release is at fault."},SELF_UPGRADE_REVERTED:{class:"release",cause:"The new version crashed or stayed silent during its trial, and the launcher switched back.",remedy:"Read the reason on the node and in the agent log. To try again, retry with allowRetryReverted (--retry-reverted)."},CONFIRM_TIMEOUT:{class:"release",cause:"The agent accepted the request, but the new version was not confirmed within its trial window.",remedy:"Read the agent log on the node. A later report for this request is still recorded in the run."},AGENT_SILENT:{class:"release",cause:"The agent accepted the request and then stopped sending heartbeats.",remedy:"Check the service on the node. The launcher switches back by itself if it is running."},MUTATION_OUTCOME_UNKNOWN:{class:"node",ambiguous:!0,cause:"The request was sent and no usable answer came back.",remedy:"The run keeps watching the node by request id. If it never reports, check the node, then reconcile the lease of the request (agent-upgrade-<requestId>)."},MANAGED_MUTATION_UNCERTAIN:{class:"node",ambiguous:!0,cause:"The agent cannot say whether a managed request ran. Any version answers this when a handler failed after it may have started; an agent older than 1.1.8 also answers it for every refusal, whatever the real cause. The command lease stays unknown and blocks later managed requests on this node.",remedy:"Read the agent log for the real cause. If the agent holds a receipt for the command (agent-upgrade-<requestId>), settle it with signed evidence: POST /api/v1/commands/<id>/reconcile-resource. If it holds none, an agent older than 1.1.8 offers no way out: upgrade that agent by hand on the node, after which the readiness monitor or `magnus-server agents doctor --heal` can settle the lease. If the cause was a stale fence, first run `magnus-server agents fence NODE VALUE`, or the next request fails the same way."},OUTCOME_UNKNOWN:{class:"node",ambiguous:!0,cause:"The agent ledger holds an unresolved receipt for this command.",remedy:"Inspect the receipt and reconcile it with signed evidence (docs/COMMAND_RESOURCE_LEASES.md)."},RUN_INTERRUPTED:{class:"node",ambiguous:!0,cause:"The server stopped watching this node when the run was interrupted.",remedy:"A later report is recorded in the run. If the node does not report, retry it."},SELF_UPGRADE_ENV_NETWORK:{class:"node",transient:!0,cause:"The node could not reach the registry while fetching the new version.",remedy:"Check the path from the node to the registry, or use MAGNUS_AGENT_UPGRADE_SOURCE_DIR, then retry it."},AGENT_UNREACHABLE:{class:"node",transient:!0,cause:"The server could not open a connection to the agent.",remedy:"Check that the agent is running and that its address and port in the inventory are correct."},SELF_UPGRADE_BUSY:{class:"node",transient:!0,cause:"The agent is already staging an upgrade or another process holds its upgrade lock.",remedy:"Wait for it to finish, then retry the node."},RESOURCE_BUSY:{class:"node",transient:!0,cause:"Another command owns the single execution slot on the node.",remedy:"Wait for the command to finish, then retry the node."},RESOURCE_LEASE_CONFLICT:{class:"node",transient:!0,cause:"The server holds another unsettled command lease for the node.",remedy:"Wait for it to settle. If it stays `unknown`, run `magnus-server agents doctor --heal` or reconcile it."},ENROLLMENT_AUTHORITY_UNAVAILABLE:{class:"node",transient:!0,cause:"The agent could not reach the server to confirm its enrollment.",remedy:"Check the path from the node to the server (CONTROL_API_URL, TLS trust)."},STALE_FENCE:{class:"node",transient:!0,cause:"The agent holds a resource fence at least as high as the one the server sent, and refused without running anything.",remedy:"The server repairs this by itself by moving its generation up, and tries the node again. Nothing to do unless the problem persists."},LEASE_EXPIRED:{class:"node",transient:!0,cause:"The command lease expired before the agent could start it; nothing ran.",remedy:"Retry the node. If this repeats, compare the clocks of the node and the server."},NOT_DISPATCHED:{class:"node",transient:!0,cause:"The server did not send the request.",remedy:"Read the detail, then retry the node."},CHECK_FAILED:{class:"node",transient:!0,cause:"The server could not check this node right before asking it, so it did not ask.",remedy:"Read the detail, usually a database or Redis problem on the server, then retry the node."},AGENT_SILENT_AFTER_LOST_REPLY:{class:"node",ambiguous:!0,cause:"The request may or may not have arrived, and the agent has stopped sending heartbeats.",remedy:"Check the service on the node. A later report for this request is still recorded in the run."},FENCE_UNREPORTED:{class:"node",cause:"This agent is older than 1.1.8, has handled managed requests before, and cannot say what fence it holds. If that fence is ahead of the server, its request fails as MANAGED_MUTATION_UNCERTAIN and strands a lease.",remedy:"Before the wave, read .magnus/command-receipts/fence-*.json on the node and run `magnus-server agents fence NODE VALUE`. Nothing to do if the fence is not ahead."},LEDGER_MISSING:{class:"node",cause:'The agent has no command ledger, so its "no receipt" proves nothing about a lease held for it. The ledger may have moved, or the install may have been rebuilt.',remedy:"Check AGENT_INSTALL_DIR and restore .magnus/command-receipts if it moved; the lease then settles by itself. If it is gone, Magnus has no way to settle the lease: establish by hand what the command did, then change the lease row in the database yourself."},LEDGER_NO_FENCE:{class:"node",cause:"The agent ledger holds neither a fence nor this node's enrollment marker, so nothing shows it is the ledger this command would have used.",remedy:"Check whether .magnus/command-receipts was replaced, and restore it if so; the lease then settles by itself. If it cannot be restored, Magnus has no way to settle the lease: establish by hand what the command did, then change the lease row in the database yourself."},LEDGER_EVIDENCE_INCONSISTENT:{class:"node",cause:"The agent ledger accepted this lease's fence, but holds no receipt, no claim and no record of a failed admission for it. Either a receipt was removed, or an admission failed on an agent build that kept no such record.",remedy:"Inspect .magnus/command-receipts on the node and the agent log around the lease's time. Magnus has no way to settle the lease: establish by hand what the command did, then change the lease row in the database yourself."},ENROLLMENT_MARKER_UNKNOWN:{class:"node",cause:"The agent could not read its managed-enrollment marker, so a mismatch cannot be ruled out.",remedy:"Check .magnus/command-receipts/managed-enrollment.json on the node: its mode, owner and content."},SELF_UPGRADE_ENV_TLS:{class:"node",cause:"npm would not trust the registry's certificate on this node: a wrong clock, an expired certificate or an intercepting proxy.",remedy:"Check the clock on the node and its CA trust for the registry, then retry it."},SELF_UPGRADE_ENV_AUTH:{class:"node",cause:"The registry refused this node's request (401 or 403).",remedy:"Check the npm credentials and registry settings on the node, or use MAGNUS_AGENT_UPGRADE_SOURCE_DIR, then retry it."},SELF_UPGRADE_ENV_RESOURCE:{class:"node",cause:"The node ran out of memory or file handles, npm was killed, or a file was busy. A killed npm is told apart by how the process ended; a lifecycle script killed inside npm still reads as a package fault.",remedy:"Check the memory on the node and its kernel log, then retry it."},RETRY_HELD_SUSPECTED:{class:"node",cause:"The run this one retries stopped because older agents answered ambiguously with nothing confirmed. Each further attempt on an older agent can strand another lease, so this retry leaves them alone.",remedy:"Read the agent log of the nodes that answered, and run `magnus-server agents fence NODE VALUE` where a fence is ahead. Then retry with acknowledgeSuspicion (--acknowledge-suspicion)."},SELF_UPGRADE_ENV_DISK:{class:"node",cause:"The node ran out of disk space or quota, or hit an I/O error, while installing the new version.",remedy:"Free disk space on the node, then retry it."},SELF_UPGRADE_ENV_ACCESS:{class:"node",cause:"The node refused a write while installing the new version.",remedy:"Run `sudo magnus-agent install-service` again on the node, which repairs ownership, then retry it."},RESOURCE_ENROLLMENT_REQUIRED:{class:"node",cause:"Admission refused the request because the node's resource enrollment is not complete.",remedy:"Complete the node's resource enrollment (docs/COMMAND_RESOURCE_LEASES.md)."},FENCE_OVERFLOW:{class:"node",cause:"The agent reports a resource fence above the highest value the server will adopt.",remedy:"Stop the agent, inspect .magnus/command-receipts/fence-*.json on the node, and repair that file by hand. The server does not change its generation."},FENCE_INVALID:{class:"node",cause:"The agent reports a resource fence that is not a decimal value for its own node.",remedy:"Inspect .magnus/command-receipts/fence-*.json on the node."},FENCE_AHEAD:{class:"node",cause:"The agent holds a resource fence above the server generation, so managed requests would be refused.",remedy:"Nothing to do for an upgrade run: it repairs this at its start. `magnus-server agents doctor --heal` repairs it now."},IDEMPOTENCY_CONFLICT:{class:"node",cause:"The agent already has a receipt for this command identifier with different input.",remedy:"Retry the node, which uses a new identifier, and report the conflict if it repeats."},LEDGER_UNAVAILABLE:{class:"node",cause:"The agent could not read or write its command ledger.",remedy:"Check ownership, mode 0700 and free space of .magnus/command-receipts on the node."},LEDGER_UNRESOLVED:{class:"node",cause:"The agent ledger holds a command with an unresolved outcome, which blocks every later managed request.",remedy:"Reconcile that command with signed evidence (docs/COMMAND_RESOURCE_LEASES.md)."},LEASE_HELD:{class:"node",cause:"A command lease on the node is reserved, running or unknown.",remedy:"Wait for it to finish. On a 1.1.8 agent, a lease stuck `unknown` with no receipt is settled by the readiness monitor, a run, or `magnus-server agents doctor --heal`; one with a receipt needs signed reconciliation. On an older agent, see MANAGED_MUTATION_UNCERTAIN."},WORK_HELD:{class:"node",cause:"Participant work, such as a console terminal or SSH session, is still held on the node.",remedy:"Finish or reconcile that work, then retry the node."},UNMANAGED_MUTATION:{class:"node",suspectable:!0,cause:"The agent is enrolled for managed requests and refused a request without a valid claim.",remedy:"Complete the node's resource enrollment on the server (docs/COMMAND_RESOURCE_LEASES.md), or upgrade the agent by hand."},RESOURCE_CLAIM_INVALID:{class:"node",cause:"The server would not confirm the agent's claim for this request.",remedy:"Check the enrollment and inventory host name of the node, then retry."},RESOURCE_TARGET_INVALID:{class:"node",cause:"Admission refused the node: its inventory address changed or its health is not fresh.",remedy:"Wait for a fresh heartbeat, or repair the inventory address."},ADMISSION_FENCE_CLOSED:{class:"node",cause:"A server release closed admission to this node.",remedy:"Release the admission fence (POST /api/v1/resource-leases/admission/<nodeId>/release)."},ENROLLMENT_MISSING:{class:"node",cause:"Resource leases apply to this node but it is not enrolled.",remedy:"Enroll the node (docs/COMMAND_RESOURCE_LEASES.md)."},ENROLLMENT_DRAINING:{class:"node",cause:"The node's resource enrollment is stuck in draining.",remedy:"Finish the drain: POST /api/v1/resource-leases/enrollment/<nodeId>/complete."},ENROLLMENT_HOST_MISMATCH:{class:"node",cause:"The enrollment names another host than the inventory.",remedy:"Correct the host name of the node in the inventory."},ENROLLMENT_INCOMPLETE:{class:"node",cause:"The node's resource enrollment is not complete.",remedy:"Enroll the node (docs/COMMAND_RESOURCE_LEASES.md)."},ENROLLMENT_MARKER_MISMATCH:{class:"node",cause:"The agent holds a local managed-enrollment marker the server does not share.",remedy:"Complete the node's resource enrollment on the server (docs/COMMAND_RESOURCE_LEASES.md), or upgrade the agent by hand."},NODE_OFFLINE:{class:"node",transient:!0,cause:"The node is offline or has no recent heartbeat.",remedy:"Bring the agent back, then retry the node."},NODE_NOT_FOUND:{class:"node",cause:"The node is no longer in the inventory.",remedy:"Register the node again if it should be managed."},VERSION_UNKNOWN:{class:"node",cause:"The agent has not reported a usable version.",remedy:"Wait for a heartbeat, or upgrade the agent by hand."},SELF_UPGRADE_TIMEOUT:{class:"node",cause:"An npm step of the upgrade did not finish in its time budget on the node. A new version that hangs when it is run reports SELF_UPGRADE_FAILED instead. A lifecycle script that hangs inside npm also ends up here: it cannot be told apart.",remedy:"Check the network and disk speed of the node, then retry it. If every node hangs the same way, suspect the release."},SELF_UPGRADE_UNAVAILABLE:{class:"node",cause:"The agent cannot upgrade itself now: its layout, launcher, directories or npm are not usable.",remedy:"Read the detail. Running `sudo magnus-agent install-service` once on the node usually repairs it."},SELF_UPGRADE_LAUNCHER:{class:"node",suspectable:!0,cause:"The new version needs a newer launcher than the node has.",remedy:"Run `sudo magnus-agent install-service` once on the node."},SELF_UPGRADE_ENGINE:{class:"node",suspectable:!0,cause:"The new version does not support the Node.js on this node.",remedy:"Upgrade Node.js on the node."},SELF_UPGRADE_PACKAGE:{class:"node",suspectable:!0,cause:"The agent refused to install a package other than magnus-agent.",remedy:"Report this: the server sent an unexpected package name."},SELF_UPGRADE_REFUSED:{class:"node",suspectable:!0,cause:"The agent refused the version change.",remedy:"Read the detail. Crossing a major version is done by hand."},PREFLIGHT_NOT_WRITABLE:{class:"node",cause:"The agent cannot write to its install directory.",remedy:"Run `sudo magnus-agent install-service` again on the node, which repairs ownership."},PREFLIGHT_DISK_LOW:{class:"node",cause:"The install directory has less free space than an upgrade needs.",remedy:"Free disk space on the node."},PREFLIGHT_NPM:{class:"node",cause:"npm is missing on the node or too old.",remedy:"Install npm beside the agent's Node.js, or set MAGNUS_AGENT_NPM."},PREFLIGHT_FROM_INCOMPLETE:{class:"node",cause:"The running version is not complete under versions/, so a failed upgrade could not switch back.",remedy:"Run `sudo magnus-agent install-service` again on the node."},PREFLIGHT_ENGINE:{class:"node",cause:"The target version does not support the Node.js on this node.",remedy:"Upgrade Node.js on the node."},NOT_REACHED:{class:"node",cause:"The run ended before it reached this node.",remedy:"Retry the run, once what ended it is dealt with. This node was not asked and did not change."},RUN_STOPPED:{class:"node",cause:"Someone stopped the run before it reached this node.",remedy:"Retry the run when you want this node upgraded. This node was not asked and did not change."},NOT_ELIGIBLE:{class:"node",cause:"This node became ineligible at its turn, for a reason without a code of its own.",remedy:"Read the detail, then retry the node."},ALREADY_CURRENT:{class:"node",informational:!0,cause:"The node already runs the target version.",remedy:"Nothing to do."},SELF_UPGRADE_CURRENT:{class:"node",informational:!0,cause:"The agent already runs the target version.",remedy:"Nothing to do."},DOWNGRADE:{class:"node",informational:!0,cause:"The node runs a newer version than the target.",remedy:"Nothing to do, or choose a newer target."},MAJOR_VERSION:{class:"node",informational:!0,cause:"The change crosses a major version.",remedy:"Upgrade this node by hand."},NOT_SELF_UPGRADABLE:{class:"node",informational:!0,cause:"This agent cannot upgrade itself: it is too old, or not set up with the launcher.",remedy:"Run `sudo magnus-agent install-service` once on the node."},PROTOCOL_TOO_OLD:{class:"node",informational:!0,cause:"The agent speaks an older self-upgrade protocol.",remedy:"Upgrade this agent by hand."},SELF_UPGRADE_DISABLED:{class:"node",informational:!0,cause:"An operator switched self-upgrade off on this node, or it runs in a container or the legacy layout.",remedy:"Nothing to do if that is intended. Otherwise set MAGNUS_AGENT_SELF_UPGRADE=true, pull a newer image, or run `sudo magnus-agent install-service` once."},UPGRADE_IN_PROGRESS:{class:"node",cause:"An upgrade is staged or on trial on this node, and it can still switch back.",remedy:"Wait for its trial to end, then retry the node if it did not confirm."},ALREADY_REVERTED:{class:"node",cause:"This node already switched back from this exact version.",remedy:"Read the reason. To try again, use allowRetryReverted (--retry-reverted)."},PREFLIGHT_UNAVAILABLE:{class:"node",informational:!0,cause:"An agent older than 1.1.8 has no preflight check; heartbeat data is used instead.",remedy:"Nothing to do: the agent gains the check when it is upgraded."},PREFLIGHT_UNREACHABLE:{class:"node",informational:!0,cause:"The preflight check got no answer. The node stays in the run, and dispatch decides.",remedy:"Nothing to do unless the node then fails with AGENT_UNREACHABLE."}},d={class:"node",unknown:!0,suspectable:!0,cause:"Unrecognised code: the agent or the server refused this node for a reason the catalogue does not list.",remedy:"Read the detail and the agent log, then retry the node. An agent newer than the server can cause this."};function e(a){return(a?c[a]:void 0)??d}async function f(a){let c=await (0,b.O)(a),d=(0,b.R)(c),e=c?.error?.code;return d?"string"!=typeof e||d.includes(e)?d:`${d} (${e})`:a instanceof Error?a.message:String(a)}let g=["failed","refused","skipped","requested","watching","ambiguous"];function h(a){return a&&"running"!==a.status?a.nodes.filter(a=>g.includes(a.state)).length+(a.excluded??[]).filter(a=>a.code&&!e(a.code).informational).length:0}a.s(["c",0,function(a){return a?.response?.status===404},"t",0,function(a){let b=a=>/^(\d+)\.\d+\.\d+(?:[-+]|$)/.exec(a)?.[1],c=b(a.expected);return void 0===c?0:a.behind.filter(a=>{let d=b(a.version);return void 0!==d&&d!==c}).length},"b",0,function(a){return a.detail?a.code&&!a.detail.includes(a.code)?`${a.code}: ${a.detail}`:a.detail:a.code??null},"K",0,function(a){return a.problems.map(a=>`${a.code}: ${a.detail}. ${a.remedy}`).join("\n")},"V",0,function(a){return e(a).remedy},"w",0,h,"v",0,function(a){return h(a)>0},"P",0,function(a){switch(a.status){case"succeeded":return"Last run: succeeded";case"partial":return`Last run: partial, ${a.attention?.length??0} node(s) need attention`;case"failed":return a.suspectedRelease?"Last run: failed, a release problem is suspected but unproven":"Last run: failed, on evidence about the release";default:return`Last run: ${a.status}`}},"Q",0,function(a){let b=a.version===a.serverVersion?" (the agent version bundled with this server)":"",c=a.release&&!a.release.verified?`; not verified on the registry: ${a.release.reason??"unknown"}`:"";return`Target: magnus-agent ${a.version}${b}${a.prerelease?", a prerelease":""}${c}`},"s",0,f],47515)}];
|
|
1
|
+
module.exports=[47515,a=>{"use strict";var b=a.i(8884);let c={SELF_UPGRADE_INTEGRITY:{class:"release",stopsRun:!0,cause:"The downloaded tarball does not match the pinned npm integrity.",remedy:"Do not retry. Check the registry or MAGNUS_AGENT_UPGRADE_SOURCE_DIR, and the integrity passed to the run."},SELF_UPGRADE_SOURCE:{class:"release",stopsRun:!0,cause:"The tarball is missing from MAGNUS_AGENT_UPGRADE_SOURCE_DIR.",remedy:"Copy the exact tarball to that directory on the nodes, then retry."},SELF_UPGRADE_FAILED:{class:"release",cause:"The package itself failed on the node: a bad tarball, an install error, missing provenance or a smoke test that failed or hung. An agent older than 1.1.8 also reports environment causes this way.",remedy:"Read the detail and the agent log. If several nodes fail the same way, the release is at fault."},SELF_UPGRADE_REVERTED:{class:"release",cause:"The new version crashed or stayed silent during its trial, and the launcher switched back.",remedy:"Read the reason on the node and in the agent log. To try again, retry with allowRetryReverted (--retry-reverted)."},CONFIRM_TIMEOUT:{class:"release",cause:"The agent accepted the request, but the new version was not confirmed within its trial window.",remedy:"Read the agent log on the node. A later report for this request is still recorded in the run."},AGENT_SILENT:{class:"release",cause:"The agent accepted the request and then stopped sending heartbeats.",remedy:"Check the service on the node. The launcher switches back by itself if it is running."},MUTATION_OUTCOME_UNKNOWN:{class:"node",ambiguous:!0,cause:"The request was sent and no usable answer came back.",remedy:"The run keeps watching the node by request id. If it never reports, check the node, then reconcile the lease of the request (agent-upgrade-<requestId>)."},MANAGED_MUTATION_UNCERTAIN:{class:"node",ambiguous:!0,cause:"The agent cannot say whether a managed request ran. Any version answers this when a handler failed after it may have started; an agent older than 1.1.8 also answers it for every refusal, whatever the real cause. The command lease stays unknown and blocks later managed requests on this node.",remedy:"Read the agent log for the real cause. If the agent holds a receipt for the command (agent-upgrade-<requestId>), settle it with signed evidence: POST /api/v1/commands/<id>/reconcile-resource. If it holds none, an agent older than 1.1.8 offers no way out: upgrade that agent by hand on the node, after which the readiness monitor or `magnus-server agents doctor --heal` can settle the lease. If the cause was a stale fence, first run `magnus-server agents fence NODE VALUE`, or the next request fails the same way."},OUTCOME_UNKNOWN:{class:"node",ambiguous:!0,cause:"The agent ledger holds an unresolved receipt for this command.",remedy:"Inspect the receipt and reconcile it with signed evidence (docs/COMMAND_RESOURCE_LEASES.md)."},RUN_INTERRUPTED:{class:"node",ambiguous:!0,cause:"The server stopped watching this node when the run was interrupted.",remedy:"A later report is recorded in the run. If the node does not report, retry it."},SELF_UPGRADE_ENV_NETWORK:{class:"node",transient:!0,cause:"The node could not reach the registry while fetching the new version.",remedy:"Check the path from the node to the registry, or use MAGNUS_AGENT_UPGRADE_SOURCE_DIR, then retry it."},AGENT_UNREACHABLE:{class:"node",transient:!0,cause:"The server could not open a connection to the agent.",remedy:"Check that the agent is running and that its address and port in the inventory are correct."},SELF_UPGRADE_BUSY:{class:"node",transient:!0,cause:"The agent is already staging an upgrade or another process holds its upgrade lock.",remedy:"Wait for it to finish, then retry the node."},RESOURCE_BUSY:{class:"node",transient:!0,cause:"Another command owns the single execution slot on the node.",remedy:"Wait for the command to finish, then retry the node."},RESOURCE_LEASE_CONFLICT:{class:"node",transient:!0,cause:"The server holds another unsettled command lease for the node.",remedy:"Wait for it to settle. If it stays `unknown`, run `magnus-server agents doctor --heal` or reconcile it."},ENROLLMENT_AUTHORITY_UNAVAILABLE:{class:"node",transient:!0,cause:"The agent could not reach the server to confirm its enrollment.",remedy:"Check the path from the node to the server (CONTROL_API_URL, TLS trust)."},STALE_FENCE:{class:"node",transient:!0,cause:"The agent holds a resource fence at least as high as the one the server sent, and refused without running anything.",remedy:"The server repairs this by itself by moving its generation up, and tries the node again. Nothing to do unless the problem persists."},LEASE_EXPIRED:{class:"node",transient:!0,cause:"The command lease expired before the agent could start it; nothing ran.",remedy:"Retry the node. If this repeats, compare the clocks of the node and the server."},NOT_DISPATCHED:{class:"node",transient:!0,cause:"The server did not send the request.",remedy:"Read the detail, then retry the node."},CHECK_FAILED:{class:"node",transient:!0,cause:"The server could not check this node right before asking it, so it did not ask.",remedy:"Read the detail, usually a database or Redis problem on the server, then retry the node."},AGENT_SILENT_AFTER_LOST_REPLY:{class:"node",ambiguous:!0,cause:"The request may or may not have arrived, and the agent has stopped sending heartbeats.",remedy:"Check the service on the node. A later report for this request is still recorded in the run."},FENCE_UNREPORTED:{class:"node",cause:"This agent is older than 1.1.8, has handled managed requests before, and cannot say what fence it holds. If that fence is ahead of the server, its request fails as MANAGED_MUTATION_UNCERTAIN and strands a lease.",remedy:"Before the wave, read .magnus/command-receipts/fence-*.json on the node and run `magnus-server agents fence NODE VALUE`. Nothing to do if the fence is not ahead."},LEDGER_MISSING:{class:"node",cause:'The agent has no command ledger, so its "no receipt" proves nothing about a lease held for it. The ledger may have moved, or the install may have been rebuilt.',remedy:"Check AGENT_INSTALL_DIR and restore .magnus/command-receipts if it moved; the lease then settles by itself. If it is gone, Magnus has no way to settle the lease: establish by hand what the command did, then change the lease row in the database yourself."},LEDGER_NO_FENCE:{class:"node",cause:"The agent ledger holds neither a fence nor this node's enrollment marker, so nothing shows it is the ledger this command would have used.",remedy:"Check whether .magnus/command-receipts was replaced, and restore it if so; the lease then settles by itself. If it cannot be restored, Magnus has no way to settle the lease: establish by hand what the command did, then change the lease row in the database yourself."},LEDGER_EVIDENCE_INCONSISTENT:{class:"node",cause:"The agent ledger accepted this lease's fence, but holds no receipt, no claim and no record of a failed admission for it. Either a receipt was removed, or an admission failed on an agent build that kept no such record.",remedy:"Inspect .magnus/command-receipts on the node and the agent log around the lease's time. Magnus has no way to settle the lease: establish by hand what the command did, then change the lease row in the database yourself."},ENROLLMENT_MARKER_UNKNOWN:{class:"node",cause:"The agent could not read its managed-enrollment marker, so a mismatch cannot be ruled out.",remedy:"Check .magnus/command-receipts/managed-enrollment.json on the node: its mode, owner and content."},SELF_UPGRADE_ENV_TLS:{class:"node",cause:"npm would not trust the registry's certificate on this node: a wrong clock, an expired certificate or an intercepting proxy.",remedy:"Check the clock on the node and its CA trust for the registry, then retry it."},SELF_UPGRADE_ENV_AUTH:{class:"node",cause:"The registry refused this node's request (401 or 403).",remedy:"Check the npm credentials and registry settings on the node, or use MAGNUS_AGENT_UPGRADE_SOURCE_DIR, then retry it."},SELF_UPGRADE_ENV_RESOURCE:{class:"node",cause:"The node ran out of memory or file handles, npm was killed, or a file was busy. A killed npm is told apart by how the process ended; a lifecycle script killed inside npm still reads as a package fault.",remedy:"Check the memory on the node and its kernel log, then retry it."},RETRY_HELD_SUSPECTED:{class:"node",cause:"The run this one retries stopped because older agents answered ambiguously with nothing confirmed. Each further attempt on an older agent can strand another lease, so this retry leaves them alone.",remedy:"Read the agent log of the nodes that answered, and run `magnus-server agents fence NODE VALUE` where a fence is ahead. Then retry with acknowledgeSuspicion (--acknowledge-suspicion)."},SELF_UPGRADE_ENV_DISK:{class:"node",cause:"The node ran out of disk space or quota, or hit an I/O error, while installing the new version.",remedy:"Free disk space on the node, then retry it."},SELF_UPGRADE_ENV_ACCESS:{class:"node",cause:"The node refused a write while installing the new version.",remedy:"Run `sudo magnus-agent install-service` again on the node, which repairs ownership, then retry it."},RESOURCE_ENROLLMENT_REQUIRED:{class:"node",cause:"Admission refused the request because the node's resource enrollment is not complete.",remedy:"Complete the node's resource enrollment (docs/COMMAND_RESOURCE_LEASES.md)."},FENCE_OVERFLOW:{class:"node",cause:"The agent reports a resource fence above the highest value the server will adopt.",remedy:"Stop the agent, inspect .magnus/command-receipts/fence-*.json on the node, and repair that file by hand. The server does not change its generation."},FENCE_INVALID:{class:"node",cause:"The agent reports a resource fence that is not a decimal value for its own node.",remedy:"Inspect .magnus/command-receipts/fence-*.json on the node."},FENCE_AHEAD:{class:"node",cause:"The agent holds a resource fence above the server generation, so managed requests would be refused.",remedy:"Nothing to do for an upgrade run: it repairs this at its start. `magnus-server agents doctor --heal` repairs it now."},IDEMPOTENCY_CONFLICT:{class:"node",cause:"The agent already has a receipt for this command identifier with different input.",remedy:"Retry the node, which uses a new identifier, and report the conflict if it repeats."},LEDGER_UNAVAILABLE:{class:"node",cause:"The agent could not read or write its command ledger.",remedy:"Check ownership, mode 0700 and free space of .magnus/command-receipts on the node."},LEDGER_UNRESOLVED:{class:"node",cause:"The agent ledger holds a command with an unresolved outcome, which blocks every later managed request.",remedy:"Reconcile that command with signed evidence (docs/COMMAND_RESOURCE_LEASES.md)."},LEASE_HELD:{class:"node",cause:"A command lease on the node is reserved, running or unknown.",remedy:"Wait for it to finish. On a 1.1.8 agent, a lease stuck `unknown` with no receipt is settled by the readiness monitor, a run, or `magnus-server agents doctor --heal`; one with a receipt needs signed reconciliation. On an older agent, see MANAGED_MUTATION_UNCERTAIN."},WORK_HELD:{class:"node",cause:"Participant work, such as a console terminal or SSH session, is still held on the node.",remedy:"Finish or reconcile that work, then retry the node."},UNMANAGED_MUTATION:{class:"node",suspectable:!0,cause:"The agent is enrolled for managed requests and refused a request without a valid claim.",remedy:"Complete the node's resource enrollment on the server (docs/COMMAND_RESOURCE_LEASES.md), or upgrade the agent by hand."},RESOURCE_CLAIM_INVALID:{class:"node",cause:"The server would not confirm the agent's claim for this request.",remedy:"Check the enrollment and inventory host name of the node, then retry."},RESOURCE_TARGET_INVALID:{class:"node",cause:"Admission refused the node: its inventory address changed or its health is not fresh.",remedy:"Wait for a fresh heartbeat, or repair the inventory address."},ADMISSION_FENCE_CLOSED:{class:"node",cause:"A server release closed admission to this node.",remedy:"Release the admission fence (POST /api/v1/resource-leases/admission/<nodeId>/release)."},ENROLLMENT_MISSING:{class:"node",cause:"Resource leases apply to this node but it is not enrolled.",remedy:"Enroll the node (docs/COMMAND_RESOURCE_LEASES.md)."},ENROLLMENT_DRAINING:{class:"node",cause:"The node's resource enrollment is stuck in draining.",remedy:"Finish the drain: POST /api/v1/resource-leases/enrollment/<nodeId>/complete."},ENROLLMENT_HOST_MISMATCH:{class:"node",cause:"The enrollment names another host than the inventory.",remedy:"Correct the host name of the node in the inventory."},ENROLLMENT_INCOMPLETE:{class:"node",cause:"The node's resource enrollment is not complete.",remedy:"Enroll the node (docs/COMMAND_RESOURCE_LEASES.md)."},ENROLLMENT_MARKER_MISMATCH:{class:"node",cause:"The agent holds a local managed-enrollment marker the server does not share.",remedy:"Complete the node's resource enrollment on the server (docs/COMMAND_RESOURCE_LEASES.md), or upgrade the agent by hand."},NODE_OFFLINE:{class:"node",transient:!0,cause:"The node is offline or has no recent heartbeat.",remedy:"Bring the agent back, then retry the node."},NODE_NOT_FOUND:{class:"node",cause:"The node is no longer in the inventory.",remedy:"Register the node again if it should be managed."},VERSION_UNKNOWN:{class:"node",cause:"The agent has not reported a usable version.",remedy:"Wait for a heartbeat, or upgrade the agent by hand."},SELF_UPGRADE_TIMEOUT:{class:"node",cause:"An npm step of the upgrade did not finish in its time budget on the node. A new version that hangs when it is run reports SELF_UPGRADE_FAILED instead. A lifecycle script that hangs inside npm also ends up here: it cannot be told apart.",remedy:"Check the network and disk speed of the node, then retry it. If every node hangs the same way, suspect the release."},SELF_UPGRADE_UNAVAILABLE:{class:"node",cause:"The agent cannot upgrade itself now: its layout, launcher, directories or npm are not usable.",remedy:"Read the detail. Running `sudo magnus-agent install-service` once on the node usually repairs it."},SELF_UPGRADE_LAUNCHER:{class:"node",suspectable:!0,cause:"The new version needs a newer launcher than the node has.",remedy:"Run `sudo magnus-agent install-service` once on the node."},SELF_UPGRADE_ENGINE:{class:"node",suspectable:!0,cause:"The new version does not support the Node.js on this node.",remedy:"Upgrade Node.js on the node."},SELF_UPGRADE_PACKAGE:{class:"node",suspectable:!0,cause:"The agent refused to install a package other than magnus-agent.",remedy:"Report this: the server sent an unexpected package name."},SELF_UPGRADE_REFUSED:{class:"node",suspectable:!0,cause:"The agent refused the version change.",remedy:"Read the detail. A major version is crossed with `--allow-major` from 2.10.3 agents on, see docs/NODE_CREDENTIALS.md."},SELF_UPGRADE_MAJOR_UNAUTHORIZED:{class:"node",cause:"The request crosses a major version, and its major-upgrade authorization is missing, expired, for another node, version or tarball, or not signed by a server key this agent pins.",remedy:"Start the run again from a server that authorizes major upgrades (`magnus-server agents upgrade --allow-major`); the node needs a bound node key (`magnus-agent identity show` reports bound)."},PREFLIGHT_NOT_WRITABLE:{class:"node",cause:"The agent cannot write to its install directory.",remedy:"Run `sudo magnus-agent install-service` again on the node, which repairs ownership."},PREFLIGHT_DISK_LOW:{class:"node",cause:"The install directory has less free space than an upgrade needs.",remedy:"Free disk space on the node."},PREFLIGHT_NPM:{class:"node",cause:"npm is missing on the node or too old.",remedy:"Install npm beside the agent's Node.js, or set MAGNUS_AGENT_NPM."},PREFLIGHT_FROM_INCOMPLETE:{class:"node",cause:"The running version is not complete under versions/, so a failed upgrade could not switch back.",remedy:"Run `sudo magnus-agent install-service` again on the node."},PREFLIGHT_ENGINE:{class:"node",cause:"The target version does not support the Node.js on this node.",remedy:"Upgrade Node.js on the node."},NOT_REACHED:{class:"node",cause:"The run ended before it reached this node.",remedy:"Retry the run, once what ended it is dealt with. This node was not asked and did not change."},RUN_STOPPED:{class:"node",cause:"Someone stopped the run before it reached this node.",remedy:"Retry the run when you want this node upgraded. This node was not asked and did not change."},NOT_ELIGIBLE:{class:"node",cause:"This node became ineligible at its turn, for a reason without a code of its own.",remedy:"Read the detail, then retry the node."},ALREADY_CURRENT:{class:"node",informational:!0,cause:"The node already runs the target version.",remedy:"Nothing to do."},SELF_UPGRADE_CURRENT:{class:"node",informational:!0,cause:"The agent already runs the target version.",remedy:"Nothing to do."},DOWNGRADE:{class:"node",informational:!0,cause:"The node runs a newer version than the target.",remedy:"Nothing to do, or choose a newer target."},MAJOR_VERSION:{class:"node",informational:!0,cause:"The change crosses a major version, which a run does only when asked to.",remedy:'Pass --allow-major (allowMajor in the API) after reading the release notes; see docs/NODE_CREDENTIALS.md, "Moving agents across a major version".'},MAJOR_NEEDS_STEPPING_STONE:{class:"node",informational:!0,cause:"This agent cannot verify a major-upgrade authorization: it is older than 2.10.3.",remedy:"Upgrade it within its major first (`magnus-server agents upgrade --to 2.10.3` for 2.10.x agents), then run the major upgrade again."},SERVER_KEY_UNAVAILABLE:{class:"node",cause:"The server could not read its signing key, so it cannot sign the major-upgrade authorization.",remedy:"Check `magnus-server node-auth server-key status` and NODE_AUTH_SERVER_KEY_PATH, then retry the run."},MAJOR_NEEDS_NODE_KEY:{class:"node",informational:!0,cause:"A major upgrade is authorized with the server key for a node key, and this node has no active node key.",remedy:"Enroll the node (`magnus-agent enroll --token-file -`) or let it bind its key, then run the major upgrade again."},NOT_SELF_UPGRADABLE:{class:"node",informational:!0,cause:"This agent cannot upgrade itself: it is too old, or not set up with the launcher.",remedy:"Run `sudo magnus-agent install-service` once on the node."},PROTOCOL_TOO_OLD:{class:"node",informational:!0,cause:"The agent speaks an older self-upgrade protocol.",remedy:"Upgrade this agent by hand."},SELF_UPGRADE_DISABLED:{class:"node",informational:!0,cause:"An operator switched self-upgrade off on this node, or it runs in a container or the legacy layout.",remedy:"Nothing to do if that is intended. Otherwise set MAGNUS_AGENT_SELF_UPGRADE=true, pull a newer image, or run `sudo magnus-agent install-service` once."},UPGRADE_IN_PROGRESS:{class:"node",cause:"An upgrade is staged or on trial on this node, and it can still switch back.",remedy:"Wait for its trial to end, then retry the node if it did not confirm."},ALREADY_REVERTED:{class:"node",cause:"This node already switched back from this exact version.",remedy:"Read the reason. To try again, use allowRetryReverted (--retry-reverted)."},PREFLIGHT_UNAVAILABLE:{class:"node",informational:!0,cause:"An agent older than 1.1.8 has no preflight check; heartbeat data is used instead.",remedy:"Nothing to do: the agent gains the check when it is upgraded."},PREFLIGHT_UNREACHABLE:{class:"node",informational:!0,cause:"The preflight check got no answer. The node stays in the run, and dispatch decides.",remedy:"Nothing to do unless the node then fails with AGENT_UNREACHABLE."}},d={class:"node",unknown:!0,suspectable:!0,cause:"Unrecognised code: the agent or the server refused this node for a reason the catalogue does not list.",remedy:"Read the detail and the agent log, then retry the node. An agent newer than the server can cause this."};function e(a){return(a?c[a]:void 0)??d}async function f(a){let c=await (0,b.O)(a),d=(0,b.R)(c),e=c?.error?.code;return d?"string"!=typeof e||d.includes(e)?d:`${d} (${e})`:a instanceof Error?a.message:String(a)}let g=["failed","refused","skipped","requested","watching","ambiguous"];function h(a){return a&&"running"!==a.status?a.nodes.filter(a=>g.includes(a.state)).length+(a.excluded??[]).filter(a=>a.code&&!e(a.code).informational).length:0}a.s(["c",0,function(a){return a?.response?.status===404},"t",0,function(a){let b=a=>/^(\d+)\.\d+\.\d+(?:[-+]|$)/.exec(a)?.[1],c=b(a.expected);return void 0===c?0:a.behind.filter(a=>{let d=b(a.version);return void 0!==d&&d!==c}).length},"b",0,function(a){return a.detail?a.code&&!a.detail.includes(a.code)?`${a.code}: ${a.detail}`:a.detail:a.code??null},"K",0,function(a){return a.problems.map(a=>`${a.code}: ${a.detail}. ${a.remedy}`).join("\n")},"V",0,function(a){return e(a).remedy},"w",0,h,"v",0,function(a){return h(a)>0},"P",0,function(a){switch(a.status){case"succeeded":return"Last run: succeeded";case"partial":return`Last run: partial, ${a.attention?.length??0} node(s) need attention`;case"failed":return a.suspectedRelease?"Last run: failed, a release problem is suspected but unproven":"Last run: failed, on evidence about the release";default:return`Last run: ${a.status}`}},"Q",0,function(a){let b=a.version===a.serverVersion?" (the agent version bundled with this server)":"",c=a.release&&!a.release.verified?`; not verified on the registry: ${a.release.reason??"unknown"}`:"";return`Target: magnus-agent ${a.version}${b}${a.prerelease?", a prerelease":""}${c}`},"s",0,f],47515)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=apps_dashboard_src_lib_agent-upgrade-view_ts_1nvhevz6hq0t2._.js.map
|
|
@@ -7,9 +7,9 @@ globalThis.__BUILD_MANIFEST = {
|
|
|
7
7
|
"static/chunks/0cz1d0mv5g_q7.js"
|
|
8
8
|
],
|
|
9
9
|
"lowPriorityFiles": [
|
|
10
|
-
"static/
|
|
11
|
-
"static/
|
|
12
|
-
"static/
|
|
10
|
+
"static/L-DxwQwJQSLJRijzllP8k/_buildManifest.js",
|
|
11
|
+
"static/L-DxwQwJQSLJRijzllP8k/_ssgManifest.js",
|
|
12
|
+
"static/L-DxwQwJQSLJRijzllP8k/_clientMiddlewareManifest.js"
|
|
13
13
|
],
|
|
14
14
|
"rootMainFiles": [
|
|
15
15
|
"static/chunks/3y705tc4v-41-.js",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/3y705tc4v-41-.js"/><script src="/_next/static/chunks/1k2w3nq2-wg_-.js" async=""></script><script src="/_next/static/chunks/16uyp1ymdlvpq.js" async=""></script><script src="/_next/static/chunks/3l8w-h8da7s_r.js" async=""></script><script src="/_next/static/chunks/3t6i_3lvi_934.js" async=""></script><script src="/_next/static/chunks/turbopack-2u1d16houkiyo.js" async=""></script><script src="/_next/static/chunks/1ua2kfq9s-me6.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script id="_R_">(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push({"otherChunks":["static/chunks/3y705tc4v-41-.js","static/chunks/1k2w3nq2-wg_-.js","static/chunks/16uyp1ymdlvpq.js","static/chunks/3l8w-h8da7s_r.js","static/chunks/3t6i_3lvi_934.js"],"runtimeModuleIds":[94553]});</script><script src="/_next/static/chunks/3y705tc4v-41-.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:\"/_next/static/chunks/1ua2kfq9s-me6.js\"\n3:I[39756,[\"$2\"],\"default\"]\n4:I[37457,[\"$2\"],\"default\"]\n7:I[97367,[\"$2\"],\"OutletBoundary\"]\n8:\"$Sreact.suspense\"\na:\"ViewportBoundary\"\nb:I[97367,[\"$2\"],\"$a\"]\nd:\"MetadataBoundary\"\ne:I[97367,[\"$2\"],\"$d\"]\n10:I[68027,[\"$2\"],\"default\",1]\n5:X\n6:[[\"children\",{\"s\":\"__PAGE__\",\"h\":528,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L7\",null,{\"children\":[\"$\",\"$8\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@9\"}]}]]}],\"p\":false,\"v\":null}}]]\n0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"t\":{\"t\":{\"s\":\"\",\"h\":528,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],\"p\":false,\"v\":\"$5\"},\"c\":\"$Q6\"},\"h\":{\"r\":[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$Lb\",null,{\"children\":\"$Lc\"}],[\"$\",\"$Le\",null,{\"children\":[[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$8\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lf\"}]}],null]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],\"p\":false,\"v\":null}},\"m\":\"$undefined\",\"G\":[\"$10\",[]],\"S\":true,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"
|
|
1
|
+
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/3y705tc4v-41-.js"/><script src="/_next/static/chunks/1k2w3nq2-wg_-.js" async=""></script><script src="/_next/static/chunks/16uyp1ymdlvpq.js" async=""></script><script src="/_next/static/chunks/3l8w-h8da7s_r.js" async=""></script><script src="/_next/static/chunks/3t6i_3lvi_934.js" async=""></script><script src="/_next/static/chunks/turbopack-2u1d16houkiyo.js" async=""></script><script src="/_next/static/chunks/1ua2kfq9s-me6.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script id="_R_">(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push({"otherChunks":["static/chunks/3y705tc4v-41-.js","static/chunks/1k2w3nq2-wg_-.js","static/chunks/16uyp1ymdlvpq.js","static/chunks/3l8w-h8da7s_r.js","static/chunks/3t6i_3lvi_934.js"],"runtimeModuleIds":[94553]});</script><script src="/_next/static/chunks/3y705tc4v-41-.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:\"/_next/static/chunks/1ua2kfq9s-me6.js\"\n3:I[39756,[\"$2\"],\"default\"]\n4:I[37457,[\"$2\"],\"default\"]\n7:I[97367,[\"$2\"],\"OutletBoundary\"]\n8:\"$Sreact.suspense\"\na:\"ViewportBoundary\"\nb:I[97367,[\"$2\"],\"$a\"]\nd:\"MetadataBoundary\"\ne:I[97367,[\"$2\"],\"$d\"]\n10:I[68027,[\"$2\"],\"default\",1]\n5:X\n6:[[\"children\",{\"s\":\"__PAGE__\",\"h\":528,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L7\",null,{\"children\":[\"$\",\"$8\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@9\"}]}]]}],\"p\":false,\"v\":null}}]]\n0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"t\":{\"t\":{\"s\":\"\",\"h\":528,\"d\":{\"r\":[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],\"p\":false,\"v\":\"$5\"},\"c\":\"$Q6\"},\"h\":{\"r\":[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$Lb\",null,{\"children\":\"$Lc\"}],[\"$\",\"$Le\",null,{\"children\":[[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$8\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lf\"}]}],null]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],\"p\":false,\"v\":null}},\"m\":\"$undefined\",\"G\":[\"$10\",[]],\"S\":true,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"L-DxwQwJQSLJRijzllP8k\"}\n5:C\nc:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n9:null\nf:[]\n"])</script></body></html>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"previewModeId": "
|
|
3
|
-
"previewModeSigningKey": "
|
|
4
|
-
"previewModeEncryptionKey": "
|
|
2
|
+
"previewModeId": "1a6041c78adc5799fa7578830ac89308",
|
|
3
|
+
"previewModeSigningKey": "a4a7460e459f33843e372284e154eb49c60bcc537e0236c73b2664e36d09d36a",
|
|
4
|
+
"previewModeEncryptionKey": "2e329b29d00abd9ca701dbeb5f4a7f26743856dc48e1a97272629052a465a366"
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
self.__RSC_SERVER_MANIFEST="{\n \"node\": {\n \"
|
|
1
|
+
self.__RSC_SERVER_MANIFEST="{\n \"node\": {\n \"407c1f44b72869676d6ad141516322fb58e312dda6\": {\n \"workers\": {\n \"app/cron/page\": {\n \"moduleId\": 80202,\n \"async\": false\n }\n },\n \"filename\": \"apps/dashboard/src/app/actions/scan.ts\",\n \"exportedName\": \"scanCron\"\n },\n \"40621a3491778be6a588165d98886f043ad61ad1d3\": {\n \"workers\": {\n \"app/skills/page\": {\n \"moduleId\": 28111,\n \"async\": false\n }\n },\n \"filename\": \"apps/dashboard/src/app/actions/scan.ts\",\n \"exportedName\": \"scanSkills\"\n }\n },\n \"edge\": {},\n \"encryptionKey\": \"OImhDT8kOIyWpIaRcYoE1TyC93rIn2tvtOp2f9zXV3k=\"\n}"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"node": {
|
|
3
|
-
"
|
|
3
|
+
"407c1f44b72869676d6ad141516322fb58e312dda6": {
|
|
4
4
|
"workers": {
|
|
5
5
|
"app/cron/page": {
|
|
6
6
|
"moduleId": 80202,
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"filename": "apps/dashboard/src/app/actions/scan.ts",
|
|
11
11
|
"exportedName": "scanCron"
|
|
12
12
|
},
|
|
13
|
-
"
|
|
13
|
+
"40621a3491778be6a588165d98886f043ad61ad1d3": {
|
|
14
14
|
"workers": {
|
|
15
15
|
"app/skills/page": {
|
|
16
16
|
"moduleId": 28111,
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"edge": {},
|
|
25
|
-
"encryptionKey": "
|
|
25
|
+
"encryptionKey": "OImhDT8kOIyWpIaRcYoE1TyC93rIn2tvtOp2f9zXV3k="
|
|
26
26
|
}
|