@hivemagnus/magnus-ui 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/dist/app/apps/dashboard/.next/BUILD_ID +1 -1
  2. package/dist/app/apps/dashboard/.next/build-manifest.json +3 -3
  3. package/dist/app/apps/dashboard/.next/prerender-manifest.json +3 -3
  4. package/dist/app/apps/dashboard/.next/required-server-files.json +1 -1
  5. package/dist/app/apps/dashboard/.next/server/app/_global-error.html +1 -1
  6. package/dist/app/apps/dashboard/.next/server/app/_global-error.rsc +1 -1
  7. package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  8. package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  10. package/dist/app/apps/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -1
  11. package/dist/app/apps/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page.js.nft.json +1 -1
  13. package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page_client-reference-manifest.js +1 -1
  14. package/dist/app/apps/dashboard/.next/server/app/anomalies/page.js.nft.json +1 -1
  15. package/dist/app/apps/dashboard/.next/server/app/anomalies/page_client-reference-manifest.js +1 -1
  16. package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page.js.nft.json +1 -1
  17. package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page_client-reference-manifest.js +1 -1
  18. package/dist/app/apps/dashboard/.next/server/app/api-docs/page.js.nft.json +1 -1
  19. package/dist/app/apps/dashboard/.next/server/app/api-docs/page_client-reference-manifest.js +1 -1
  20. package/dist/app/apps/dashboard/.next/server/app/application-operations/page.js.nft.json +1 -1
  21. package/dist/app/apps/dashboard/.next/server/app/application-operations/page_client-reference-manifest.js +1 -1
  22. package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page.js.nft.json +1 -1
  23. package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page_client-reference-manifest.js +1 -1
  24. package/dist/app/apps/dashboard/.next/server/app/ardent/page.js.nft.json +1 -1
  25. package/dist/app/apps/dashboard/.next/server/app/ardent/page_client-reference-manifest.js +1 -1
  26. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page.js.nft.json +1 -1
  27. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page_client-reference-manifest.js +1 -1
  28. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page.js.nft.json +1 -1
  29. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page_client-reference-manifest.js +1 -1
  30. package/dist/app/apps/dashboard/.next/server/app/audit/page.js.nft.json +1 -1
  31. package/dist/app/apps/dashboard/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  32. package/dist/app/apps/dashboard/.next/server/app/codex/installations/page.js.nft.json +1 -1
  33. package/dist/app/apps/dashboard/.next/server/app/codex/installations/page_client-reference-manifest.js +1 -1
  34. package/dist/app/apps/dashboard/.next/server/app/codex/page.js.nft.json +1 -1
  35. package/dist/app/apps/dashboard/.next/server/app/codex/page_client-reference-manifest.js +1 -1
  36. package/dist/app/apps/dashboard/.next/server/app/commands/page.js.nft.json +1 -1
  37. package/dist/app/apps/dashboard/.next/server/app/commands/page_client-reference-manifest.js +1 -1
  38. package/dist/app/apps/dashboard/.next/server/app/cron/page/server-reference-manifest.json +1 -1
  39. package/dist/app/apps/dashboard/.next/server/app/cron/page.js.nft.json +1 -1
  40. package/dist/app/apps/dashboard/.next/server/app/cron/page_client-reference-manifest.js +1 -1
  41. package/dist/app/apps/dashboard/.next/server/app/files/page.js.nft.json +1 -1
  42. package/dist/app/apps/dashboard/.next/server/app/files/page_client-reference-manifest.js +1 -1
  43. package/dist/app/apps/dashboard/.next/server/app/fleet-map/page.js.nft.json +1 -1
  44. package/dist/app/apps/dashboard/.next/server/app/fleet-map/page_client-reference-manifest.js +1 -1
  45. package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page.js.nft.json +1 -1
  46. package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page_client-reference-manifest.js +1 -1
  47. package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page.js.nft.json +1 -1
  48. package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page_client-reference-manifest.js +1 -1
  49. package/dist/app/apps/dashboard/.next/server/app/governor/operations/page.js.nft.json +1 -1
  50. package/dist/app/apps/dashboard/.next/server/app/governor/operations/page_client-reference-manifest.js +1 -1
  51. package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page.js.nft.json +1 -1
  52. package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page_client-reference-manifest.js +1 -1
  53. package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page.js.nft.json +1 -1
  54. package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page_client-reference-manifest.js +1 -1
  55. package/dist/app/apps/dashboard/.next/server/app/hermes-security/page.js.nft.json +1 -1
  56. package/dist/app/apps/dashboard/.next/server/app/hermes-security/page_client-reference-manifest.js +1 -1
  57. package/dist/app/apps/dashboard/.next/server/app/incidents/page.js.nft.json +1 -1
  58. package/dist/app/apps/dashboard/.next/server/app/incidents/page_client-reference-manifest.js +1 -1
  59. package/dist/app/apps/dashboard/.next/server/app/library/page.js.nft.json +1 -1
  60. package/dist/app/apps/dashboard/.next/server/app/library/page_client-reference-manifest.js +1 -1
  61. package/dist/app/apps/dashboard/.next/server/app/login/page.js.nft.json +1 -1
  62. package/dist/app/apps/dashboard/.next/server/app/login/page_client-reference-manifest.js +1 -1
  63. package/dist/app/apps/dashboard/.next/server/app/logs/page.js.nft.json +1 -1
  64. package/dist/app/apps/dashboard/.next/server/app/logs/page_client-reference-manifest.js +1 -1
  65. package/dist/app/apps/dashboard/.next/server/app/mission-control/page.js.nft.json +1 -1
  66. package/dist/app/apps/dashboard/.next/server/app/mission-control/page_client-reference-manifest.js +1 -1
  67. package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page.js.nft.json +1 -1
  68. package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page_client-reference-manifest.js +1 -1
  69. package/dist/app/apps/dashboard/.next/server/app/nodes/page.js.nft.json +1 -1
  70. package/dist/app/apps/dashboard/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
  71. package/dist/app/apps/dashboard/.next/server/app/notifications/page.js.nft.json +1 -1
  72. package/dist/app/apps/dashboard/.next/server/app/notifications/page_client-reference-manifest.js +1 -1
  73. package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page.js.nft.json +1 -1
  74. package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page_client-reference-manifest.js +1 -1
  75. package/dist/app/apps/dashboard/.next/server/app/orchestra/page.js.nft.json +1 -1
  76. package/dist/app/apps/dashboard/.next/server/app/orchestra/page_client-reference-manifest.js +1 -1
  77. package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page.js.nft.json +1 -1
  78. package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page_client-reference-manifest.js +1 -1
  79. package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page.js.nft.json +1 -1
  80. package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page_client-reference-manifest.js +1 -1
  81. package/dist/app/apps/dashboard/.next/server/app/page.js.nft.json +1 -1
  82. package/dist/app/apps/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
  83. package/dist/app/apps/dashboard/.next/server/app/retention/page.js.nft.json +1 -1
  84. package/dist/app/apps/dashboard/.next/server/app/retention/page_client-reference-manifest.js +1 -1
  85. package/dist/app/apps/dashboard/.next/server/app/roles/page.js.nft.json +1 -1
  86. package/dist/app/apps/dashboard/.next/server/app/roles/page_client-reference-manifest.js +1 -1
  87. package/dist/app/apps/dashboard/.next/server/app/rollouts/page.js.nft.json +1 -1
  88. package/dist/app/apps/dashboard/.next/server/app/rollouts/page_client-reference-manifest.js +1 -1
  89. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page.js.nft.json +1 -1
  90. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page_client-reference-manifest.js +1 -1
  91. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page.js.nft.json +1 -1
  92. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page_client-reference-manifest.js +1 -1
  93. package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page.js.nft.json +1 -1
  94. package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page_client-reference-manifest.js +1 -1
  95. package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page.js.nft.json +1 -1
  96. package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page_client-reference-manifest.js +1 -1
  97. package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page.js.nft.json +1 -1
  98. package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page_client-reference-manifest.js +1 -1
  99. package/dist/app/apps/dashboard/.next/server/app/security-fusion/page.js.nft.json +1 -1
  100. package/dist/app/apps/dashboard/.next/server/app/security-fusion/page_client-reference-manifest.js +1 -1
  101. package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page.js.nft.json +1 -1
  102. package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page_client-reference-manifest.js +1 -1
  103. package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page.js.nft.json +1 -1
  104. package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page_client-reference-manifest.js +1 -1
  105. package/dist/app/apps/dashboard/.next/server/app/skills/page/server-reference-manifest.json +1 -1
  106. package/dist/app/apps/dashboard/.next/server/app/skills/page.js.nft.json +1 -1
  107. package/dist/app/apps/dashboard/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  108. package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page.js.nft.json +1 -1
  109. package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page_client-reference-manifest.js +1 -1
  110. package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page.js.nft.json +1 -1
  111. package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page_client-reference-manifest.js +1 -1
  112. package/dist/app/apps/dashboard/.next/server/app/webhooks/page.js.nft.json +1 -1
  113. package/dist/app/apps/dashboard/.next/server/app/webhooks/page_client-reference-manifest.js +1 -1
  114. package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0z6dblsnzx20l._.js +1 -1
  115. package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__10vlrswrzvf4x._.js +1 -1
  116. package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__1cnr5ucuq-tas._.js +1 -1
  117. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_0gs_s688kgg1i._.js +1 -1
  118. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_cron_page_tsx_1i3duyygc0_tg._.js +1 -1
  119. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_skills_page_tsx_0n5zp4xad38in._.js +1 -1
  120. package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_refresh-ccw-dot_1bka5q1p8_fx4.js +1 -1
  121. package/dist/app/apps/dashboard/.next/server/middleware-build-manifest.js +3 -3
  122. package/dist/app/apps/dashboard/.next/server/pages/500.html +1 -1
  123. package/dist/app/apps/dashboard/.next/server/preview-props.json +3 -3
  124. package/dist/app/apps/dashboard/.next/server/server-reference-manifest.js +1 -1
  125. package/dist/app/apps/dashboard/.next/server/server-reference-manifest.json +3 -3
  126. package/dist/app/apps/dashboard/.next/static/chunks/{28q140y6b7-89.js → 15k-qmnbw3cjb.js} +1 -1
  127. package/dist/app/apps/dashboard/.next/static/chunks/{07pjhg_to7dzv.js → 1tnd5uxb6jeaw.js} +1 -1
  128. package/dist/app/apps/dashboard/.next/static/chunks/{36hoxd3zs7thr.js → 2d4ylz_vuib6b.js} +1 -1
  129. package/dist/app/apps/dashboard/.next/static/chunks/{2zfns6xyegode.js → 2zsyn-x33zktn.js} +1 -1
  130. package/dist/app/apps/dashboard/.next/static/chunks/{0akep08qly94l.js → 3snkyozidkred.js} +1 -1
  131. package/dist/app/apps/dashboard/package.json +2 -2
  132. package/dist/app/apps/dashboard/server.js +1 -1
  133. package/package.json +2 -2
  134. /package/dist/app/apps/dashboard/.next/static/{UZn0mscl5hk5YJtZnvSnK → BZlZSgkcAsB8gK9YHwg8e}/_buildManifest.js +0 -0
  135. /package/dist/app/apps/dashboard/.next/static/{UZn0mscl5hk5YJtZnvSnK → BZlZSgkcAsB8gK9YHwg8e}/_clientMiddlewareManifest.js +0 -0
  136. /package/dist/app/apps/dashboard/.next/static/{UZn0mscl5hk5YJtZnvSnK → BZlZSgkcAsB8gK9YHwg8e}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (()=>{"use strict";module.exports=[3319,a=>{var b=a.i(87924),c=a.i(72131),d=a.i(8897);a.i(46997),Date.now();var e=a.i(26926),f=a.i(62190),g=a.i(65802),h=a.i(74290);function i({children:a,...d}){let e=(0,c.useContext)(g.f);(d={...e,...d}).transition=(0,f.f)(d.transition,e.transition),d.isStatic=(0,h.f)(()=>d.isStatic);let j=(0,c.useMemo)(()=>d,[JSON.stringify(d.transition),d.transformPagePoint,d.reducedMotion,d.skipAnimations,d.isValidProp]);return(0,b.jsx)(g.f.Provider,{value:j,children:a})}var j=a.i(73140);a.s(["Providers",0,function({children:a}){return(0,c.useEffect)(()=>((0,j.P)(),()=>{}),[]),(0,b.jsx)(i,{reducedMotion:"user",children:(0,b.jsx)(e.N,{children:(0,b.jsx)(d.v,{children:a})})})}],3319)},12737,a=>{var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(38246),f=a.i(8387),g=a.i(5784),h=a.i(21161),i=a.i(15618),j=a.i(33441),k=a.i(8897),l=a.i(85264),m=a.i(5334),n=a.i(57547);function o({status:a}){let c="online"===a?"Online":"offline"===a?"Offline":"Checking…";return(0,b.jsx)("span",{role:"status","aria-label":c,className:`inline-block h-2 w-2 shrink-0 rounded-full ${"online"===a?"bg-success":"offline"===a?"bg-danger":"bg-text-muted/40 animate-pulse"}`,title:c})}function p(){let{nodes:a,activeNode:d,switchNode:e,loading:f}=(0,k.l)(),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(!1),v=(0,c.useRef)(null),[w,x]=(0,c.useState)({}),y=(0,c.useRef)(null),z=(0,c.useMemo)(()=>a.length>0?a:[m.f],[a]),A=(0,c.useCallback)(async()=>{let a={};await Promise.allSettled(z.map(async b=>{try{let c=(0,n.L)(b.url),d=await fetch("/api/proxy/health",{method:"GET",headers:c,signal:AbortSignal.timeout(6e3)});a[b.id]=d.ok?"online":"offline"}catch{a[b.id]="offline"}})),x(a)},[z]);return((0,c.useEffect)(()=>{A()},[A]),(0,c.useEffect)(()=>{if(p)return A(),y.current=setInterval(()=>void A(),3e4),()=>{y.current&&clearInterval(y.current)}},[p,A]),(0,c.useEffect)(()=>{if(p)return document.addEventListener("mousedown",a),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",b)};function a(a){v.current&&!v.current.contains(a.target)&&q(!1)}function b(a){"Escape"===a.key&&q(!1)}},[p]),f)?(0,b.jsx)("div",{className:"mx-3 mt-2 mb-1 rounded border border-border bg-bg px-3 py-2 text-xs text-text-muted animate-pulse",children:"Loading…"}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"relative mx-3 mt-2 mb-1",ref:v,children:[(0,b.jsx)("div",{className:"mb-1 px-0.5 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Node Controller"}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)("button",{onClick:()=>q(!p),"aria-expanded":p,"aria-haspopup":"listbox","aria-label":`Node controller: ${d.name}`,className:"flex flex-1 items-center gap-2 rounded border border-border bg-bg px-2.5 py-1.5 text-left transition-all hover:bg-surface-hover min-w-0",children:[(0,b.jsx)(o,{status:w[d.id]??"unknown"}),(0,b.jsx)("span",{className:"flex-1 truncate text-xs font-medium",children:d.name}),(0,b.jsx)(g.f,{className:`h-3.5 w-3.5 shrink-0 text-text-muted transition-transform ${p?"rotate-180":""}`})]}),(0,b.jsx)("button",{onClick:function(){u(!1),s(!0)},className:"rounded border border-border bg-bg p-1.5 text-text-muted transition-all hover:bg-surface-hover hover:text-text",title:"Control Node Settings",children:(0,b.jsx)(h.f,{className:"h-3.5 w-3.5"})})]}),p&&(0,b.jsxs)("div",{className:"absolute left-3 right-3 z-50 mt-1 rounded border border-border bg-surface shadow-xl",children:[(0,b.jsx)("div",{role:"listbox","aria-label":"Control nodes",className:"max-h-48 overflow-y-auto py-1",children:z.map(a=>(0,b.jsxs)("button",{role:"option","aria-selected":a.id===d.id,onClick:()=>{e(a.id),q(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-all hover:bg-surface-hover",children:[(0,b.jsx)(o,{status:w[a.id]??"unknown"}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:"font-medium truncate",children:a.name}),(0,b.jsx)("div",{className:"text-text-muted truncate text-[10px]",children:a.url})]}),a.id===d.id&&(0,b.jsx)(j.f,{className:"h-3.5 w-3.5 shrink-0 text-primary"})]},a.id))}),(0,b.jsx)("div",{className:"border-t border-border",children:(0,b.jsxs)("button",{onClick:function(){q(!1),u(!0),s(!0)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-primary transition-all hover:bg-surface-hover",children:[(0,b.jsx)(i.f,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{className:"font-bold",children:"Add Control Node"})]})})]})]}),(0,b.jsx)(l.f,{open:r,onClose:()=>s(!1),createMode:t})]})}var q=a.i(31289),r=a.i(70106);let s=(0,r.f)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);var t=a.i(35125),u=a.i(80386),v=a.i(41710),w=a.i(4720);let x=(0,r.f)("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);var y=a.i(3314),z=a.i(82434),A=a.i(60246),B=a.i(96737),C=a.i(72162),D=a.i(59407),E=a.i(1027);let F=(0,r.f)("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);var G=a.i(53722);let H=(0,r.f)("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var I=a.i(96641);let J=(0,r.f)("HeartPulse",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]]),K=(0,r.f)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var L=a.i(20494);let M=(0,r.f)("GitCompareArrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),N=(0,r.f)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),O=(0,r.f)("SquareActivity",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M17 12h-2l-2 5-2-10-2 5H7",key:"15hlnc"}]]);var P=a.i(4416);let Q=(0,r.f)("ScanSearch",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);var R=a.i(53254),S=a.i(37047),T=a.i(37489),U=a.i(97651);let V=[{id:"fleet",label:"Fleet",tone:"primary",items:[{href:"/mission-control",label:"Mission Control",icon:H},{href:"/",label:"Overview",icon:s,exact:!0},{href:"/nodes",label:"Nodes",icon:t.f},{href:"/application-operations",label:"Applications",icon:J},{href:"/fleet-readiness",label:"Readiness",icon:U.f},{href:"/fleet-timeline",label:"Timeline",icon:K},{href:"/fleet-map",label:"Fleet Map",icon:F},{href:"/commands",label:"Commands",icon:u.f},{href:"/anomalies",label:"Anomalies",icon:B.f},{href:"/anomalies/remediation",label:"Remediation",icon:E.f},{href:"/governor/operations",label:"Operations",icon:C.f},{href:"/rollouts",label:"Rollouts",icon:N},{href:"/incidents",label:"Incidents",icon:O},{href:"/cron",label:"Cron Jobs",icon:v.f},{href:"/files",label:"Files",icon:w.f},{href:"/logs",label:"Logs",icon:x},{href:"/audit",label:"Audit",icon:y.f},{href:"/webhooks",label:"Webhooks",icon:D.f},{href:"/retention",label:"Retention",icon:L.f},{href:"/api-docs",label:"API Docs",icon:G.f}]},{id:"security",label:"Security",tone:"primary",integration:"securityConsole",items:[{href:"/security-fusion",label:"Fleet summary",icon:Q,exact:!0}]},{id:"hermes",label:"Hermes Agent",tone:"accent",integration:"hermes",items:[{href:"/orchestra",label:"Overview",icon:z.f,exact:!0},{href:"/orchestra/installations",label:"Installations",icon:t.f},{href:"/orchestra/profiles",label:"Profiles",icon:A.f},{href:"/hermes-drift",label:"Drift Cockpit",icon:M},{href:"/hermes-security",label:"Proxy Security",icon:P.f},{href:"/orchestra/web-gateway",label:"Web Gateway",icon:I.f}]},{id:"ardent",label:"Magnus Ardent",tone:"primary",items:[{href:"/ardent",label:"Overview",icon:T.f,exact:!0},{href:"/ardent/installations",label:"Installations",icon:t.f},{href:"/ardent/profiles",label:"Profiles",icon:A.f}]},{id:"codex",label:"Codex Agent",tone:"primary",items:[{href:"/codex",label:"Overview",icon:R.f,exact:!0},{href:"/codex/installations",label:"Installations",icon:S.f}]}],W={"/":"Fleet Overview","/mission-control":"Mission Control","/nodes":"Nodes","/application-operations":"Application Operations","/fleet-readiness":"Fleet Readiness","/fleet-timeline":"Fleet Timeline","/fleet-map":"Fleet Map","/commands":"Commands","/anomalies":"Anomalies","/anomalies/remediation":"Auto-Remediation","/governor/operations":"Fleet Operations","/rollouts":"Guided Rollouts","/incidents":"Incident Workspace","/cron":"Cron Jobs","/files":"Files","/logs":"Logs","/audit":"Audit","/webhooks":"Webhooks","/retention":"Retention","/api-docs":"API Docs","/library":"Library","/skills":"Skills","/roles":"Roles","/sync":"Sync","/notifications":"Notification Preferences","/security-fusion":"Security","/orchestra":"Hermes Agent Fleet","/orchestra/installations":"Hermes Installations","/orchestra/profiles":"Hermes Profiles","/orchestra/web-gateway":"Web Gateway","/hermes-drift":"Hermes Drift Cockpit","/hermes-security":"Hermes Proxy Security","/ardent":"Magnus Ardent","/ardent/installations":"Ardent Installations","/ardent/profiles":"Ardent Profiles","/codex":"Codex Agent Fleet","/codex/installations":"Codex Installations"};function X(a,b,c=!1){return"/"===b||c?a===b:a===b||a.startsWith(`${b}/`)}function Y(a){let b=null;for(let c of V)for(let d of c.items)!d.external&&X(a,d.href,d.exact)&&(null===b||d.href.length>b.length)&&(b=d.href);return b}var Z=a.i(33643);let $={security:"from-primary/60 via-accent/20",hermes:"from-accent/50 via-accent/20",ardent:"from-primary/50 via-accent/20",codex:"from-primary/50 via-primary/20"};function _({group:a,activeHref:c}){let d="accent"===a.tone;return(0,b.jsxs)(b.Fragment,{children:["fleet"!==a.id&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"mx-3 my-1",children:(0,b.jsx)("div",{className:(0,f.f)("h-px bg-gradient-to-r to-transparent",$[a.id])})}),(0,b.jsx)("div",{className:"px-4 pb-0.5 pt-2",children:(0,b.jsx)("span",{className:(0,f.f)("text-[9px] font-bold uppercase tracking-[0.25em]",d?"text-accent/60":"text-primary/60"),children:a.label})})]}),(0,b.jsx)("nav",{className:(0,f.f)("space-y-0.5 p-3","fleet"!==a.id&&"pt-1"),"aria-label":a.label,children:a.items.map(a=>{let g=a.href===c,h=a.icon;return(0,b.jsxs)(e.default,{href:a.href,prefetch:!1,target:a.external?"_blank":void 0,rel:a.external?"noopener noreferrer":void 0,"aria-current":g?"page":void 0,className:(0,f.f)("group relative flex items-center gap-3 overflow-hidden rounded-chip px-3 py-2 text-xs uppercase tracking-wider transition-colors duration-200","before:pointer-events-none before:absolute before:inset-y-0 before:-left-1/2 before:w-1/2 before:-skew-x-12 before:bg-gradient-to-r before:from-transparent before:to-transparent before:opacity-0 before:transition-[left,opacity] before:duration-500 hover:before:left-full hover:before:opacity-100",d?"before:via-accent/10":"before:via-primary/10",g?(0,f.f)(d?"text-accent":"text-primary",d?"bg-accent/5":"bg-primary/5"):(0,f.f)("text-text-muted",d?"hover:text-accent":"hover:text-primary")),children:[g&&(0,b.jsx)(q.f.span,{layoutId:"sidebar-indicator",className:(0,f.f)("absolute bottom-1 left-0 top-1 w-0.5 rounded-full",d?"bg-accent":"bg-primary"),style:{boxShadow:d?"0 0 8px var(--color-accent), 0 0 16px var(--color-glow-accent)":"0 0 8px var(--color-primary), 0 0 16px var(--color-glow)"},transition:{type:"spring",stiffness:300,damping:30}}),(0,b.jsx)(h,{className:"relative h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"relative truncate",children:a.label})]},a.href)})})]})}function aa(){return(0,b.jsxs)("div",{className:"relative flex h-8 w-8 items-center justify-center animate-flicker",children:[(0,b.jsxs)("svg",{viewBox:"0 0 32 32",className:"h-8 w-8 overflow-visible","aria-hidden":"true",children:[(0,b.jsx)("rect",{x:"1",y:"1",width:"30",height:"30",rx:"4",fill:"none",stroke:"var(--color-primary)",strokeOpacity:"0.35"}),(0,b.jsx)("path",{d:"M8 23 V9 L16 18 L24 9 V23",fill:"none",stroke:"var(--color-primary)",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",pathLength:100,style:{"--stroke-length":100,strokeDasharray:100,animation:"draw-stroke 1.4s var(--ease-out-expo) both"},className:"drop-shadow-[0_0_4px_var(--color-primary)]"})]}),(0,b.jsx)("div",{className:"absolute inset-0 rounded shadow-[0_0_12px_var(--color-glow)]"})]})}function ab(){let{connected:a}=(0,c.useSyncExternalStore)(Z.f.subscribe,Z.f.getSnapshot,Z.f.getServerSnapshot);return(0,b.jsxs)("span",{className:"flex items-center gap-1.5",title:a?"Live event stream connected":"Live event stream reconnecting",children:[(0,b.jsxs)("span",{className:"relative inline-flex h-1.5 w-1.5",children:[a&&(0,b.jsx)("span",{className:"absolute inset-0 rounded-full bg-success animate-halo"}),(0,b.jsx)("span",{className:(0,f.f)("relative inline-flex h-1.5 w-1.5 rounded-full",a?"bg-success shadow-[0_0_6px_var(--color-success)]":"bg-warning")})]}),(0,b.jsx)("span",{className:a?"text-success/70":"text-warning/70",children:a?"Live":"Offline"})]})}function ac({integrations:a}){let e=Y((0,d.usePathname)()),f=(0,c.useMemo)(()=>(function(a,b=V){return b.filter(b=>{var c;return!b.integration||(c=b.integration,"securityConsole"===c?null!==a.securityConsoleUrl:a.hermes)}).map(b=>"security"===b.id&&a.securityConsoleUrl?{...b,items:[{href:a.securityConsoleUrl,label:"Security console ↗",icon:Q,external:!0},...b.items]}:b)})(a),[a]);return(0,b.jsxs)("aside",{className:"relative flex h-full w-56 flex-col border-r border-border/50 bg-bg",children:[(0,b.jsx)("div",{className:"absolute bottom-0 right-0 top-0 w-px bg-gradient-to-b from-primary/60 via-primary/20 to-transparent"}),(0,b.jsxs)("div",{className:"flex h-14 items-center gap-3 border-b border-border/30 px-4",children:[(0,b.jsx)(aa,{}),(0,b.jsx)("span",{className:"text-sm font-bold uppercase tracking-[0.2em] text-text",children:"Magnus"})]}),(0,b.jsx)(p,{}),(0,b.jsx)("div",{className:"flex-1 overflow-y-auto",children:f.map(a=>(0,b.jsx)(_,{group:a,activeHref:e},a.id))}),(0,b.jsxs)("div",{className:"flex items-center justify-between border-t border-border/30 p-4 text-[10px] uppercase tracking-widest text-primary/40",children:[(0,b.jsxs)("span",{children:["Magnus v","1.0.2"]}),(0,b.jsx)(ab,{})]})]})}var ad=a.i(24552),ae=a.i(69520);let af=(0,r.f)("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);var ag=a.i(87532),ah=a.i(50522);let ai=(0,r.f)("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]),aj=(0,r.f)("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);var ak=a.i(73570),al=a.i(92e3),am=a.i(97063),an=a.i(82478),ao=a.i(68790),ap=a.i(46997);function aq(){let[a,d]=(0,c.useState)(!1),[g,i]=(0,c.useState)([]),[k,l]=(0,c.useState)(0),[m,n]=(0,c.useState)(!1),o=(0,c.useRef)(null),p=(0,c.useCallback)(async()=>{try{let a=await ap.f.notifications.unreadCount();a.success&&a.data&&l(a.data.count)}catch{}},[]),q=(0,c.useCallback)(async()=>{n(!0);try{let a=await ap.f.notifications.list({pageSize:20});if(a.success&&a.data){let b=a.data;i(b.notifications)}}catch{}finally{n(!1)}},[]);(0,c.useEffect)(()=>{p();let a=setInterval(()=>void p(),15e3);return()=>clearInterval(a)},[p]),(0,c.useEffect)(()=>{a&&q()},[a,q]),(0,c.useEffect)(()=>{if(!a)return;let b=a=>{o.current&&!o.current.contains(a.target)&&d(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[a]),(0,c.useEffect)(()=>{if(!a)return;let b=a=>{"Escape"===a.key&&d(!1)};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[a]);let r=async a=>{try{await ap.f.notifications.markRead([a]),i(b=>b.map(b=>b.id===a?{...b,isRead:!0}:b)),l(a=>Math.max(0,a-1))}catch{}},s=async()=>{try{await ap.f.notifications.markAllRead(),i(a=>a.map(a=>({...a,isRead:!0}))),l(0),setTimeout(()=>void p(),500)}catch{}};return(0,b.jsxs)("div",{className:"relative",ref:o,children:[(0,b.jsxs)("button",{className:"relative rounded p-2 text-text-muted transition-all hover:bg-surface-hover hover:text-text",title:"Notifications",type:"button","aria-expanded":a,"aria-controls":"notification-panel","aria-label":k>0?`Notifications (${k} unread)`:"Notifications",onClick:()=>d(a=>!a),children:[(0,b.jsx)(ai,{className:"h-4 w-4"}),k>0&&(0,b.jsx)("span",{className:"absolute right-1 top-1 flex h-4 min-w-[1rem] items-center justify-center rounded-full bg-danger px-1 text-[10px] font-bold text-white",children:k>99?"99+":k})]}),a&&(0,b.jsxs)("div",{id:"notification-panel",role:"region","aria-label":"Notifications",className:"absolute right-0 top-full z-50 mt-2 w-96 overflow-hidden rounded border border-border bg-surface shadow-2xl",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[(0,b.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider text-text",children:"Notifications"}),k>0&&(0,b.jsxs)("button",{className:"flex items-center gap-1 rounded px-2 py-1 text-xs text-primary hover:bg-primary/10 transition-all",onClick:()=>void s(),type:"button",children:[(0,b.jsx)(aj,{className:"h-3 w-3"}),"Mark all read"]})]}),(0,b.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[m&&0===g.length&&(0,b.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,b.jsx)("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-primary border-t-transparent"})}),!m&&0===g.length&&(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-10 text-text-muted",children:[(0,b.jsx)(ai,{className:"mb-2 h-8 w-8 opacity-40"}),(0,b.jsx)("p",{className:"text-xs",children:"No notifications yet"})]}),g.map(a=>(0,b.jsxs)("div",{className:(0,f.f)("group flex items-start gap-3 border-b border-border/50 px-4 py-3 transition-all hover:bg-surface-hover",!a.isRead&&"bg-primary/5"),children:[(0,b.jsx)("div",{className:"mt-0.5 shrink-0",children:function(a){switch(a){case"critical":return(0,b.jsx)(al.f,{className:"h-4 w-4 text-danger"});case"warning":return(0,b.jsx)(ak.f,{className:"h-4 w-4 text-warning"});default:return(0,b.jsx)(am.f,{className:"h-4 w-4 text-primary"})}}(a.severity)}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[function(a){switch(a){case"node.offline":return(0,b.jsx)(t.f,{className:"h-3.5 w-3.5 text-danger"});case"node.degraded":return(0,b.jsx)(t.f,{className:"h-3.5 w-3.5 text-warning"});case"node.recovered":return(0,b.jsx)(J,{className:"h-3.5 w-3.5 text-success"});case"command.failed":return(0,b.jsx)(u.f,{className:"h-3.5 w-3.5 text-warning"});case"deploy.failed":return(0,b.jsx)(an.f,{className:"h-3.5 w-3.5 text-danger"});case"upgrade.failed":return(0,b.jsx)(ao.f,{className:"h-3.5 w-3.5 text-danger"});default:return(0,b.jsx)(ai,{className:"h-3.5 w-3.5 text-text-muted"})}}(a.type),(0,b.jsx)("span",{className:(0,f.f)("text-xs font-bold",a.isRead?"text-text-muted":"text-text"),children:a.title})]}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-text-muted line-clamp-2",children:a.message}),(0,b.jsx)("span",{className:"mt-1 block text-[10px] text-text-muted/60",children:function(a){let b=Math.floor((Date.now()-new Date(a).getTime())/1e3);if(b<60)return"just now";let c=Math.floor(b/60);if(c<60)return`${c}m ago`;let d=Math.floor(c/60);if(d<24)return`${d}h ago`;let e=Math.floor(d/24);return`${e}d ago`}(a.createdAt)})]}),!a.isRead&&(0,b.jsx)("button",{className:"mt-0.5 shrink-0 rounded p-1 text-text-muted opacity-0 transition-all hover:bg-surface-hover hover:text-primary group-hover:opacity-100",title:"Mark as read",type:"button",onClick:()=>void r(a.id),children:(0,b.jsx)(j.f,{className:"h-3.5 w-3.5"})})]},a.id))]}),(0,b.jsx)("div",{className:"border-t border-border px-4 py-2 flex justify-end",children:(0,b.jsxs)(e.default,{href:"/notifications",className:"flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",onClick:()=>d(!1),children:[(0,b.jsx)(h.f,{className:"h-3 w-3"}),"Preferences"]})})]})]})}var ar=a.i(62260);let as=[{keys:["g","m"],label:"Go to Mission Control",description:"Navigate to unified Mission Control home",action:"navigate",target:"/mission-control",category:"navigation"},{keys:["g","o"],label:"Go to Overview",description:"Navigate to fleet overview",action:"navigate",target:"/",category:"navigation"},{keys:["g","n"],label:"Go to Nodes",description:"Navigate to node list",action:"navigate",target:"/nodes",category:"navigation"},{keys:["g","c"],label:"Go to Commands",description:"Navigate to command console",action:"navigate",target:"/commands",category:"navigation"},{keys:["g","j"],label:"Go to Cron Jobs",description:"Navigate to cron jobs",action:"navigate",target:"/cron",category:"navigation"},{keys:["g","f"],label:"Go to Files",description:"Navigate to file editor",action:"navigate",target:"/files",category:"navigation"},{keys:["g","s"],label:"Go to Skills",description:"Navigate to skill marketplace",action:"navigate",target:"/skills",category:"navigation"},{keys:["g","l"],label:"Go to Logs",description:"Navigate to log explorer",action:"navigate",target:"/logs",category:"navigation"},{keys:["g","a"],label:"Go to Audit",description:"Navigate to audit trail",action:"navigate",target:"/audit",category:"navigation"},{keys:["?"],label:"Show Shortcuts",description:"Show keyboard shortcut reference",action:"command",target:"show-shortcuts",category:"general"}];function at(){return"u">typeof navigator&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘":"Ctrl"}function au(){document.body.dispatchEvent(new KeyboardEvent("keydown",{key:"k",ctrlKey:!0,metaKey:!0,bubbles:!0}))}function av({onMenuToggle:a}){let f=(0,d.usePathname)(),g=(0,d.useRouter)(),{title:h,crumbs:i}=function(a){let b=null;for(let c of Object.keys(W))X(a,c)&&(null===b||c.length>b.length)&&(b=c);let c=b?W[b]:"Magnus",d=Y(a),e=d?V.find(a=>a.items.some(a=>a.href===d))?.label??null:null,f=[];if(e&&f.push({label:e}),f.push({label:c,href:b??void 0}),b&&a!==b)for(let c of a.slice("/"===b?1:b.length+1).split("/").filter(Boolean)){let a=decodeURIComponent(c);f.push({label:a.length>18?`${a.slice(0,8)}…${a.slice(-6)}`:a})}return{title:c,group:e,crumbs:f}}(f),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)("Ctrl"),p=(0,c.useRef)(null);async function q(a=!1){let b=await fetch(`/api/auth/logout${a?"?all=true":""}`,{method:"POST"}).catch(()=>null);b?.ok?(g.push("/login"),g.refresh()):window.alert("Session revocation unavailable; retry sign out.")}return(0,c.useEffect)(()=>{o(at()),fetch("/api/auth/me").then(a=>a.ok?a.json():null).then(a=>{a?.username&&k(a.username)}).catch(()=>{})},[]),(0,c.useEffect)(()=>{if(!l)return;let a=a=>{(a instanceof KeyboardEvent?"Escape"!==a.key:p.current?.contains(a.target))||m(!1)};return document.addEventListener("mousedown",a),document.addEventListener("keydown",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",a)}},[l]),(0,b.jsxs)("header",{className:"relative z-(--z-shell) flex h-14 items-center justify-between gap-3 bg-bg/80 px-3 backdrop-blur-sm sm:px-6",children:[(0,b.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-primary/60 via-accent/40 to-transparent"}),(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-2 text-xs uppercase tracking-[0.15em] text-text-muted",children:[a&&(0,b.jsx)("button",{className:"mr-1 rounded p-1.5 text-text-muted hover:text-primary md:hidden",onClick:a,type:"button",title:"Toggle menu",children:(0,b.jsx)(af,{className:"h-5 w-5"})}),(0,b.jsx)("span",{className:"text-primary/60",children:">_"}),(0,b.jsx)("nav",{"aria-label":"Breadcrumb",className:"hidden min-w-0 items-center gap-1 sm:flex",children:i.map((a,c)=>{let d=c===i.length-1;return(0,b.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[c>0&&(0,b.jsx)(ah.f,{className:"h-3 w-3 shrink-0 text-primary/30","aria-hidden":"true"}),a.href&&!d?(0,b.jsx)(e.default,{href:a.href,prefetch:!1,className:"truncate transition-colors hover:text-primary",children:a.label}):(0,b.jsx)("span",{className:d?"truncate text-text":0===c&&i.length>1?"truncate text-text-muted/60":"truncate","aria-current":d?"page":void 0,children:a.label})]},`${a.label}-${c}`)})}),(0,b.jsx)("span",{className:"sr-only sm:hidden",children:h}),(0,b.jsx)("span",{className:"ml-1 hidden h-3.5 w-1.5 shrink-0 bg-primary/80 sm:inline-block",style:{animation:"cursor-blink 1s step-end infinite"}})]}),(0,b.jsx)(ar.J,{className:"hidden max-w-xl flex-1 lg:block"}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-1 sm:gap-2",children:[(0,b.jsxs)("button",{type:"button",onClick:au,className:"hidden items-center gap-2 rounded-chip border border-border bg-surface px-2.5 py-1.5 text-[10px] uppercase tracking-wider text-text-muted transition-colors hover:border-primary/40 hover:text-primary md:flex",title:"Search and jump (command palette)",children:[(0,b.jsx)(ag.f,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:"Search"}),(0,b.jsxs)("kbd",{className:"rounded-chip border border-border bg-bg px-1 text-[9px] text-primary/70",children:[n,"+K"]})]}),(0,b.jsx)("button",{className:"rounded p-2 text-text-muted transition-all hover:text-primary hover:drop-shadow-[0_0_6px_var(--color-glow)]",title:"Refresh",onClick:()=>window.location.reload(),type:"button",children:(0,b.jsx)(ae.f,{className:"h-4 w-4"})}),(0,b.jsx)(aq,{}),(0,b.jsx)("button",{className:"rounded p-2 text-text-muted transition-all hover:text-danger hover:drop-shadow-[0_0_6px_rgba(255,23,68,0.3)]",title:"Sign Out",onClick:()=>void q(),type:"button",children:(0,b.jsx)(ad.f,{className:"h-4 w-4"})}),(0,b.jsxs)("div",{ref:p,className:"relative ml-1",children:[(0,b.jsx)("button",{type:"button",onClick:()=>m(a=>!a),"aria-haspopup":"menu","aria-expanded":l,title:j?`Signed in as ${j}`:"Account",className:"flex h-8 w-8 items-center justify-center rounded border border-accent/40 text-[10px] font-bold uppercase text-accent shadow-[0_0_8px_var(--color-glow-accent)] transition-colors hover:border-accent hover:bg-accent/10",children:j?.[0]??"U"}),l&&(0,b.jsxs)("div",{role:"menu",className:"panel-corners absolute right-0 top-full z-(--z-modal) mt-2 w-60 rounded-panel border border-accent/30 bg-surface/95 p-1 shadow-[0_0_24px_var(--color-glow-accent)] backdrop-blur-sm [--panel-corner-color:var(--color-accent)]",children:[j&&(0,b.jsxs)("div",{className:"border-b border-border px-3 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:["Signed in as ",(0,b.jsx)("span",{className:"text-accent",children:j})]}),(0,b.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>void q(),className:"flex w-full items-center gap-2 rounded-chip px-3 py-2 text-left text-xs text-text-muted transition-colors hover:bg-surface-hover hover:text-text",children:[(0,b.jsx)(ad.f,{className:"h-3.5 w-3.5"})," Sign out"]}),(0,b.jsxs)("button",{type:"button",role:"menuitem","aria-label":"Sign out all local sessions",onClick:()=>void q(!0),className:"flex w-full items-center gap-2 rounded-chip px-3 py-2 text-left text-xs text-text-muted transition-colors hover:bg-danger/10 hover:text-danger",children:[(0,b.jsx)(ad.f,{className:"h-3.5 w-3.5"})," Sign out all local sessions"]})]})]})]})]})}async function aw(a,b){try{let c=await fetch(a,{signal:b,headers:{accept:"application/json"}});if(!c.ok)return null;return await c.json()}catch{return null}}function ax(a,b){return a.trim()?b.map(b=>({e:b,s:function(a,b){if(!a)return 0;let c=a.toLowerCase(),d=b.toLowerCase(),e=d.indexOf(c);if(-1!==e)return e;let f=0,g=0;for(let a of c){let b=d.indexOf(a,f);if(-1===b)return -1;g+=b-f,f=b+1}return 1e3+g}(a,`${b.label} ${b.sublabel??""}`)})).filter(({s:a})=>a>=0).sort((a,b)=>a.s-b.s).map(({e:a})=>a):b}async function ay(a,b={}){let{signal:c,limit:d=10}=b;if(a.trim().length<2)return[];let[e,f,g]=await Promise.all([aw("/api/proxy/nodes",c),aw("/api/proxy/orchestra/installations",c),aw("/api/proxy/orchestra/skill-catalog",c)]),h=[];for(let a of e?.data??[])h.push({kind:"node",id:a.id,label:a.name,sublabel:a.status?`Node \xb7 ${a.status}`:"Node",href:`/nodes/${a.id}`});for(let a of f?.data??[])h.push({kind:"installation",id:a.id,label:a.displayName??a.hostname,sublabel:`Hermes \xb7 ${a.status??"unknown"}`,href:"/orchestra/installations"});for(let a of g?.data??[])h.push({kind:"skill",id:a.id,label:a.name,sublabel:a.description??"Skill",href:"/skills"});return ax(a,[{kind:"action",id:"deploy-agent",label:"Deploy agent to host",sublabel:"Action · Operations",href:"/governor/operations"},{kind:"action",id:"open-terminal",label:"Open node terminal",sublabel:"Action · Nodes",href:"/nodes"},{kind:"action",id:"run-fleet-check",label:"Run fleet check",sublabel:"Action · Fleet readiness",href:"/fleet-readiness"},{kind:"action",id:"view-stale-nodes",label:"View stale nodes",sublabel:"Action · Readiness",href:"/fleet-readiness"},{kind:"action",id:"rotate-node-secret",label:"Rotate node secret",sublabel:"Action · Operations",href:"/governor/operations"},{kind:"action",id:"latest-failed-deploy",label:"Open latest failed deploy",sublabel:"Action · Timeline",href:"/fleet-timeline"},...h]).slice(0,d)}var az=a.i(32860),aA=a.i(64519),aB=a.i(9347);let aC=(0,r.f)("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);var aD=a.i(33508);let aE=(0,r.f)("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);var aF=a.i(96221),aG=a.i(8406),aH=a.i(73140);let aI={"/":s,"/mission-control":H,"/nodes":t.f,"/commands":u.f,"/cron":v.f,"/files":w.f,"/skills":aA.f,"/logs":x,"/audit":y.f,"/library":aB.f},aJ={node:t.f,installation:z.f,skill:aA.f,action:az.f};function aK(){let[a,e]=(0,c.useState)(!1),[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(0),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)("normal"),r=(0,c.useRef)(null),s=(0,d.useRouter)(),t=(0,c.useRef)([]),u=(0,c.useRef)(void 0),v=(0,c.useRef)(void 0),w=(0,c.useRef)(null),x=(f.trim()?as.filter(a=>a.label.toLowerCase().includes(f.toLowerCase())||a.description.toLowerCase().includes(f.toLowerCase())):as).map(a=>({kind:"shortcut",key:`s:${a.keys.join("-")}`,shortcut:a})),y=ax(f,l).map(a=>({kind:"entity",key:`e:${a.kind}:${a.id}`,entity:a})),z=f.trim()?[...y,...x]:x;(0,c.useEffect)(()=>{if(!a)return;let b=f.trim();if(b.length<2){m([]),o(!1);return}v.current&&clearTimeout(v.current),w.current&&w.current.abort();let c=new AbortController;return w.current=c,o(!0),v.current=setTimeout(async()=>{let a=await ay(b,{signal:c.signal,limit:12});c.signal.aborted||(m(a),o(!1))},180),()=>{c.abort(),v.current&&clearTimeout(v.current)}},[f,a]);let A=(0,c.useCallback)(a=>{"navigate"===a.action&&a.target?(s.push(a.target),e(!1),g("")):"show-shortcuts"===a.target&&(k(!0),e(!1),g(""))},[s]),B=(0,c.useCallback)(a=>{"shortcut"===a.kind?A(a.shortcut):(s.push(a.entity.href),e(!1),g(""))},[A,s]);return((0,c.useEffect)(()=>{let b=b=>{let c=b.target,d="INPUT"===c.tagName||"TEXTAREA"===c.tagName||c.isContentEditable;if((b.metaKey||b.ctrlKey)&&"k"===b.key.toLowerCase()){b.preventDefault(),b.stopPropagation(),b.stopImmediatePropagation(),e(a=>!a);return}if("Escape"===b.key){if(a){e(!1),g("");return}return j?void k(!1):void 0}if(!d){if("?"===b.key){b.preventDefault(),k(a=>!a);return}if(1===b.key.length&&!b.metaKey&&!b.ctrlKey&&!b.altKey){for(let a of(clearTimeout(u.current),t.current.push(b.key.toLowerCase()),as))if(a.keys.length===t.current.length&&a.keys.every((a,b)=>a===t.current[b])){b.preventDefault(),t.current=[],A(a);return}u.current=setTimeout(()=>{t.current=[]},800)}}};return window.addEventListener("keydown",b,!0),()=>window.removeEventListener("keydown",b,!0)},[a,j,A]),(0,c.useEffect)(()=>{a&&(i(0),setTimeout(()=>r.current?.focus(),50))},[a]),(0,c.useEffect)(()=>{h>=z.length&&i(Math.max(0,z.length-1))},[z.length,h]),(0,c.useEffect)(()=>{a&&q("low"===document.documentElement.dataset.fx?"low":"normal")},[a]),a||j)?(0,b.jsxs)(b.Fragment,{children:[a&&(0,b.jsxs)("div",{className:"fixed inset-0 z-(--z-modal) flex items-start justify-center pt-[15vh]","data-testid":"command-palette",children:[(0,b.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-[2px]",onClick:()=>{e(!1),g("")}}),(0,b.jsxs)("div",{className:"relative z-10 w-full max-w-lg panel-corners rounded-panel border border-primary/30 bg-surface/95 shadow-[0_0_40px_var(--color-glow)]",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 border-b border-border px-4 py-3",children:[(0,b.jsx)(ag.f,{className:"h-5 w-5 text-primary"}),(0,b.jsx)("input",{ref:r,type:"text",placeholder:"Search nodes, agents, runs, users, commands...",className:"flex-1 bg-transparent text-sm text-text placeholder:text-text-muted/70 caret-primary outline-none",value:f,onChange:a=>{g(a.target.value),i(0)},onKeyDown:a=>{"ArrowDown"===a.key?(a.preventDefault(),i(a=>Math.min(a+1,z.length-1))):"ArrowUp"===a.key?(a.preventDefault(),i(a=>Math.max(a-1,0))):"Enter"===a.key&&z[h]&&(a.preventDefault(),B(z[h]))},"data-testid":"command-palette-input"}),n?(0,b.jsx)(aF.f,{className:"h-4 w-4 animate-spin text-primary"}):(0,b.jsx)("kbd",{className:"rounded-chip border border-border bg-bg px-1.5 py-0.5 text-[10px] text-text-muted",children:"ESC"})]}),(0,b.jsxs)("div",{className:"max-h-96 overflow-y-auto py-2",children:[0===z.length&&!n&&(0,b.jsx)("p",{className:"px-4 py-6 text-center text-xs uppercase tracking-wider text-text-muted",children:"No results found"}),0===z.length&&n&&(0,b.jsx)("p",{className:"px-4 py-6 text-center text-xs uppercase tracking-wider text-text-muted",children:"Searching…"}),z.map((a,c)=>{let d=c===h;if("shortcut"===a.kind){let e=aI[a.shortcut.target??""]??az.f;return(0,b.jsxs)("button",{className:`flex w-full items-center gap-3 px-4 py-2 text-left text-sm transition-colors ${d?"bg-primary/10 text-primary shadow-[inset_2px_0_0_var(--color-primary)]":"text-text hover:bg-surface-hover"}`,onClick:()=>B(a),onMouseEnter:()=>i(c),"data-testid":"command-palette-item","data-item-kind":"shortcut",children:[(0,b.jsx)(e,{className:"h-4 w-4 shrink-0 opacity-70"}),(0,b.jsx)("span",{className:"flex-1",children:a.shortcut.label}),(0,b.jsx)("span",{className:"text-xs text-text-muted",children:a.shortcut.keys.map(a=>a.toUpperCase()).join(" then ")})]},a.key)}let e=aJ[a.entity.kind]??az.f;return(0,b.jsxs)("button",{className:`flex w-full items-center gap-3 px-4 py-2 text-left text-sm transition-colors ${d?"bg-accent/10 text-accent shadow-[inset_2px_0_0_var(--color-accent)]":"text-text hover:bg-surface-hover"}`,onClick:()=>B(a),onMouseEnter:()=>i(c),"data-testid":"command-palette-item","data-item-kind":"entity","data-entity-kind":a.entity.kind,children:[(0,b.jsx)(e,{className:"h-4 w-4 shrink-0 text-accent/80"}),(0,b.jsxs)("span",{className:"flex-1 truncate",children:[(0,b.jsx)("span",{className:"font-medium",children:a.entity.label}),a.entity.sublabel&&(0,b.jsx)("span",{className:"ml-2 text-xs text-text-muted",children:a.entity.sublabel})]}),(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:a.entity.kind})]},a.key)})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4 border-t border-border px-4 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:[(0,b.jsx)("span",{children:"↑↓ navigate"}),(0,b.jsx)("span",{children:"↵ select"}),(0,b.jsx)("span",{children:"esc close"}),(0,b.jsxs)("button",{type:"button",onClick:()=>q((0,aH.W)()),className:"ml-auto flex items-center gap-1 rounded-chip px-1 text-text-muted transition-colors hover:text-primary",title:"Toggle visual effects (scanlines, glow pulses, animated map)","data-testid":"command-palette-fx-toggle",children:[(0,b.jsx)(aG.f,{className:"h-3 w-3"})," fx: ",p]}),(0,b.jsxs)("span",{className:"flex items-center gap-1",children:[(0,b.jsx)(aE,{className:"h-3 w-3"})," ",at(),"+K"]})]})]})]}),j&&(0,b.jsxs)("div",{className:"fixed inset-0 z-(--z-modal) flex items-center justify-center",children:[(0,b.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-[2px]",onClick:()=>k(!1)}),(0,b.jsxs)("div",{className:"relative z-10 w-full max-w-md panel-corners rounded-panel border border-primary/30 bg-surface/95 p-6 shadow-[0_0_40px_var(--color-glow)]",children:[(0,b.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(aC,{className:"h-5 w-5 text-primary"}),(0,b.jsx)("h2",{className:"text-sm font-bold uppercase tracking-wider text-primary glow-text-primary",children:"Keyboard Shortcuts"})]}),(0,b.jsx)("button",{onClick:()=>k(!1),className:"text-text-muted hover:text-text",children:(0,b.jsx)(aD.X,{className:"h-5 w-5"})})]}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"mb-2 text-[10px] font-medium uppercase tracking-[0.2em] text-text-muted",children:"General"}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(aL,{keys:[`${at()}+K`],label:"Open command palette"}),(0,b.jsx)(aL,{keys:["?"],label:"Show this reference"}),(0,b.jsx)(aL,{keys:["Esc"],label:"Close modal / palette"})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"mb-2 text-[10px] font-medium uppercase tracking-[0.2em] text-text-muted",children:"Fleet Navigation"}),(0,b.jsx)("div",{className:"space-y-1",children:as.filter(a=>"navigation"===a.category).map(a=>(0,b.jsx)(aL,{keys:a.keys.map(a=>a.toUpperCase()),label:a.label},a.target))})]})]})]})]})]}):null}function aL({keys:a,label:c}){return(0,b.jsxs)("div",{className:"flex items-center justify-between py-1",children:[(0,b.jsx)("span",{className:"text-xs text-text",children:c}),(0,b.jsx)("div",{className:"flex gap-1",children:a.map((c,d)=>(0,b.jsxs)("span",{children:[(0,b.jsx)("kbd",{className:"rounded-chip border border-border bg-bg px-1.5 py-0.5 text-[11px] text-primary",children:c}),d<a.length-1&&(0,b.jsx)("span",{className:"mx-0.5 text-[10px] text-text-muted/60",children:"then"})]},d))})]})}var aM=a.i(26926);a.s(["DashboardShell",0,function({children:a,integrations:e}){let f=(0,d.usePathname)(),g="/login"===f||f.startsWith("/governor/share/"),[h,i]=(0,c.useState)(!1);!function({enabled:a=!0}={}){let[b,d]=(0,c.useState)(!1),{addToast:e}=(0,aM.d)(),f=(0,c.useRef)(e);f.current=e;let g=(0,c.useRef)(null),h=(0,c.useRef)(null),i=(0,c.useCallback)(()=>{if(!a)return;let b=new EventSource("/api/proxy/events/stream");for(let a of(g.current=b,b.onopen=()=>{d(!0),Z.f.setConnected(!0)},["deploy:status","node:status","command:status","alert:fired"]))b.addEventListener(a,b=>{try{let c=JSON.parse(b.data),d=function(a){let b=a.type??"",c=a.nodeName??"Unknown";switch(b){case"deploy.started":return{title:`Deploying to ${c}`,severity:"info"};case"deploy.completed":return{title:`Deploy complete: ${c}`,severity:"success"};case"deploy.failed":return{title:`Deploy failed: ${c}`,message:a.message??void 0,severity:"error"};case"upgrade.started":return{title:`Upgrading ${c}`,severity:"info"};case"upgrade.completed":return{title:`Upgrade complete: ${c}`,message:`v${a.version}`,severity:"success"};case"upgrade.failed":return{title:`Upgrade failed: ${c}`,message:a.message??void 0,severity:"error"};case"node.recovered":return{title:`${c} back online`,message:`Recovered from ${a.previousStatus}`,severity:"success"};case"command.completed":return{title:"Command completed",message:`${a.command}`,severity:"success"};case"command.failed":return{title:"Command failed",message:`${a.command} (exit ${a.exitCode})`,severity:"error"};case"health.alert":return{title:`Alert: ${a.metric?.replaceAll("_"," ").toUpperCase()} on ${c}`,message:`${a.value?.toFixed(1)}% (threshold: ${a.threshold}%)`,severity:a.severity??"warning"};default:return null}}(c);d&&f.current(d),Z.f.push(d?{...d,channel:a}:{title:String(c.type??a).replaceAll("."," "),message:"string"==typeof c.nodeName?c.nodeName:void 0,severity:"info",channel:a})}catch{}});return b.onerror=()=>{d(!1),Z.f.setConnected(!1),b.close(),fetch("/api/auth/me",{cache:"no-store"}).then(a=>{if(g.current===b){if(401===a.status)return void window.location.replace("/login");h.current=setTimeout(i,5e3)}}).catch(()=>{g.current===b&&(h.current=setTimeout(i,5e3))})},b},[a]);(0,c.useEffect)(()=>{let a=i();return()=>{h.current&&clearTimeout(h.current),a?.close(),g.current?.close(),Z.f.setConnected(!1),g.current=null}},[i])}({enabled:!g}),(0,c.useEffect)(()=>{i(!1)},[f]);let j=(0,c.useCallback)(()=>i(a=>!a),[]);return g?(0,b.jsx)(b.Fragment,{children:a}):(0,b.jsxs)("div",{className:"flex h-screen overflow-hidden",children:[h&&(0,b.jsx)("div",{className:"fixed inset-0 z-40 bg-black/70 backdrop-blur-[2px] md:hidden",onClick:()=>i(!1)}),(0,b.jsx)("div",{className:`
1
+ (()=>{"use strict";module.exports=[3319,a=>{var b=a.i(87924),c=a.i(72131),d=a.i(8897);a.i(46997),Date.now();var e=a.i(26926),f=a.i(62190),g=a.i(65802),h=a.i(74290);function i({children:a,...d}){let e=(0,c.useContext)(g.f);(d={...e,...d}).transition=(0,f.f)(d.transition,e.transition),d.isStatic=(0,h.f)(()=>d.isStatic);let j=(0,c.useMemo)(()=>d,[JSON.stringify(d.transition),d.transformPagePoint,d.reducedMotion,d.skipAnimations,d.isValidProp]);return(0,b.jsx)(g.f.Provider,{value:j,children:a})}var j=a.i(73140);a.s(["Providers",0,function({children:a}){return(0,c.useEffect)(()=>((0,j.P)(),()=>{}),[]),(0,b.jsx)(i,{reducedMotion:"user",children:(0,b.jsx)(e.N,{children:(0,b.jsx)(d.v,{children:a})})})}],3319)},12737,a=>{var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(38246),f=a.i(8387),g=a.i(5784),h=a.i(21161),i=a.i(15618),j=a.i(33441),k=a.i(8897),l=a.i(85264),m=a.i(5334),n=a.i(57547);function o({status:a}){let c="online"===a?"Online":"offline"===a?"Offline":"Checking…";return(0,b.jsx)("span",{role:"status","aria-label":c,className:`inline-block h-2 w-2 shrink-0 rounded-full ${"online"===a?"bg-success":"offline"===a?"bg-danger":"bg-text-muted/40 animate-pulse"}`,title:c})}function p(){let{nodes:a,activeNode:d,switchNode:e,loading:f}=(0,k.l)(),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(!1),v=(0,c.useRef)(null),[w,x]=(0,c.useState)({}),y=(0,c.useRef)(null),z=(0,c.useMemo)(()=>a.length>0?a:[m.f],[a]),A=(0,c.useCallback)(async()=>{let a={};await Promise.allSettled(z.map(async b=>{try{let c=(0,n.L)(b.url),d=await fetch("/api/proxy/health",{method:"GET",headers:c,signal:AbortSignal.timeout(6e3)});a[b.id]=d.ok?"online":"offline"}catch{a[b.id]="offline"}})),x(a)},[z]);return((0,c.useEffect)(()=>{A()},[A]),(0,c.useEffect)(()=>{if(p)return A(),y.current=setInterval(()=>void A(),3e4),()=>{y.current&&clearInterval(y.current)}},[p,A]),(0,c.useEffect)(()=>{if(p)return document.addEventListener("mousedown",a),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",b)};function a(a){v.current&&!v.current.contains(a.target)&&q(!1)}function b(a){"Escape"===a.key&&q(!1)}},[p]),f)?(0,b.jsx)("div",{className:"mx-3 mt-2 mb-1 rounded border border-border bg-bg px-3 py-2 text-xs text-text-muted animate-pulse",children:"Loading…"}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"relative mx-3 mt-2 mb-1",ref:v,children:[(0,b.jsx)("div",{className:"mb-1 px-0.5 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Node Controller"}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)("button",{onClick:()=>q(!p),"aria-expanded":p,"aria-haspopup":"listbox","aria-label":`Node controller: ${d.name}`,className:"flex flex-1 items-center gap-2 rounded border border-border bg-bg px-2.5 py-1.5 text-left transition-all hover:bg-surface-hover min-w-0",children:[(0,b.jsx)(o,{status:w[d.id]??"unknown"}),(0,b.jsx)("span",{className:"flex-1 truncate text-xs font-medium",children:d.name}),(0,b.jsx)(g.f,{className:`h-3.5 w-3.5 shrink-0 text-text-muted transition-transform ${p?"rotate-180":""}`})]}),(0,b.jsx)("button",{onClick:function(){u(!1),s(!0)},className:"rounded border border-border bg-bg p-1.5 text-text-muted transition-all hover:bg-surface-hover hover:text-text",title:"Control Node Settings",children:(0,b.jsx)(h.f,{className:"h-3.5 w-3.5"})})]}),p&&(0,b.jsxs)("div",{className:"absolute left-3 right-3 z-50 mt-1 rounded border border-border bg-surface shadow-xl",children:[(0,b.jsx)("div",{role:"listbox","aria-label":"Control nodes",className:"max-h-48 overflow-y-auto py-1",children:z.map(a=>(0,b.jsxs)("button",{role:"option","aria-selected":a.id===d.id,onClick:()=>{e(a.id),q(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-all hover:bg-surface-hover",children:[(0,b.jsx)(o,{status:w[a.id]??"unknown"}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:"font-medium truncate",children:a.name}),(0,b.jsx)("div",{className:"text-text-muted truncate text-[10px]",children:a.url})]}),a.id===d.id&&(0,b.jsx)(j.f,{className:"h-3.5 w-3.5 shrink-0 text-primary"})]},a.id))}),(0,b.jsx)("div",{className:"border-t border-border",children:(0,b.jsxs)("button",{onClick:function(){q(!1),u(!0),s(!0)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-primary transition-all hover:bg-surface-hover",children:[(0,b.jsx)(i.f,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{className:"font-bold",children:"Add Control Node"})]})})]})]}),(0,b.jsx)(l.f,{open:r,onClose:()=>s(!1),createMode:t})]})}var q=a.i(31289),r=a.i(70106);let s=(0,r.f)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);var t=a.i(35125),u=a.i(80386),v=a.i(41710),w=a.i(4720);let x=(0,r.f)("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);var y=a.i(3314),z=a.i(82434),A=a.i(60246),B=a.i(96737),C=a.i(72162),D=a.i(59407),E=a.i(1027);let F=(0,r.f)("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);var G=a.i(53722);let H=(0,r.f)("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var I=a.i(96641);let J=(0,r.f)("HeartPulse",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]]),K=(0,r.f)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var L=a.i(20494);let M=(0,r.f)("GitCompareArrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),N=(0,r.f)("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]),O=(0,r.f)("SquareActivity",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M17 12h-2l-2 5-2-10-2 5H7",key:"15hlnc"}]]);var P=a.i(4416);let Q=(0,r.f)("ScanSearch",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);var R=a.i(53254),S=a.i(37047),T=a.i(37489),U=a.i(97651);let V=[{id:"fleet",label:"Fleet",tone:"primary",items:[{href:"/mission-control",label:"Mission Control",icon:H},{href:"/",label:"Overview",icon:s,exact:!0},{href:"/nodes",label:"Nodes",icon:t.f},{href:"/application-operations",label:"Applications",icon:J},{href:"/fleet-readiness",label:"Readiness",icon:U.f},{href:"/fleet-timeline",label:"Timeline",icon:K},{href:"/fleet-map",label:"Fleet Map",icon:F},{href:"/commands",label:"Commands",icon:u.f},{href:"/anomalies",label:"Anomalies",icon:B.f},{href:"/anomalies/remediation",label:"Remediation",icon:E.f},{href:"/governor/operations",label:"Operations",icon:C.f},{href:"/rollouts",label:"Rollouts",icon:N},{href:"/incidents",label:"Incidents",icon:O},{href:"/cron",label:"Cron Jobs",icon:v.f},{href:"/files",label:"Files",icon:w.f},{href:"/logs",label:"Logs",icon:x},{href:"/audit",label:"Audit",icon:y.f},{href:"/webhooks",label:"Webhooks",icon:D.f},{href:"/retention",label:"Retention",icon:L.f},{href:"/api-docs",label:"API Docs",icon:G.f}]},{id:"security",label:"Security",tone:"primary",integration:"securityConsole",items:[{href:"/security-fusion",label:"Fleet summary",icon:Q,exact:!0}]},{id:"hermes",label:"Hermes Agent",tone:"accent",integration:"hermes",items:[{href:"/orchestra",label:"Overview",icon:z.f,exact:!0},{href:"/orchestra/installations",label:"Installations",icon:t.f},{href:"/orchestra/profiles",label:"Profiles",icon:A.f},{href:"/hermes-drift",label:"Drift Cockpit",icon:M},{href:"/hermes-security",label:"Proxy Security",icon:P.f},{href:"/orchestra/web-gateway",label:"Web Gateway",icon:I.f}]},{id:"ardent",label:"Magnus Ardent",tone:"primary",items:[{href:"/ardent",label:"Overview",icon:T.f,exact:!0},{href:"/ardent/installations",label:"Installations",icon:t.f},{href:"/ardent/profiles",label:"Profiles",icon:A.f}]},{id:"codex",label:"Codex Agent",tone:"primary",items:[{href:"/codex",label:"Overview",icon:R.f,exact:!0},{href:"/codex/installations",label:"Installations",icon:S.f}]}],W={"/":"Fleet Overview","/mission-control":"Mission Control","/nodes":"Nodes","/application-operations":"Application Operations","/fleet-readiness":"Fleet Readiness","/fleet-timeline":"Fleet Timeline","/fleet-map":"Fleet Map","/commands":"Commands","/anomalies":"Anomalies","/anomalies/remediation":"Auto-Remediation","/governor/operations":"Fleet Operations","/rollouts":"Guided Rollouts","/incidents":"Incident Workspace","/cron":"Cron Jobs","/files":"Files","/logs":"Logs","/audit":"Audit","/webhooks":"Webhooks","/retention":"Retention","/api-docs":"API Docs","/library":"Library","/skills":"Skills","/roles":"Roles","/sync":"Sync","/notifications":"Notification Preferences","/security-fusion":"Security","/orchestra":"Hermes Agent Fleet","/orchestra/installations":"Hermes Installations","/orchestra/profiles":"Hermes Profiles","/orchestra/web-gateway":"Web Gateway","/hermes-drift":"Hermes Drift Cockpit","/hermes-security":"Hermes Proxy Security","/ardent":"Magnus Ardent","/ardent/installations":"Ardent Installations","/ardent/profiles":"Ardent Profiles","/codex":"Codex Agent Fleet","/codex/installations":"Codex Installations"};function X(a,b,c=!1){return"/"===b||c?a===b:a===b||a.startsWith(`${b}/`)}function Y(a){let b=null;for(let c of V)for(let d of c.items)!d.external&&X(a,d.href,d.exact)&&(null===b||d.href.length>b.length)&&(b=d.href);return b}var Z=a.i(33643);let $={security:"from-primary/60 via-accent/20",hermes:"from-accent/50 via-accent/20",ardent:"from-primary/50 via-accent/20",codex:"from-primary/50 via-primary/20"};function _({group:a,activeHref:c}){let d="accent"===a.tone;return(0,b.jsxs)(b.Fragment,{children:["fleet"!==a.id&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"mx-3 my-1",children:(0,b.jsx)("div",{className:(0,f.f)("h-px bg-gradient-to-r to-transparent",$[a.id])})}),(0,b.jsx)("div",{className:"px-4 pb-0.5 pt-2",children:(0,b.jsx)("span",{className:(0,f.f)("text-[9px] font-bold uppercase tracking-[0.25em]",d?"text-accent/60":"text-primary/60"),children:a.label})})]}),(0,b.jsx)("nav",{className:(0,f.f)("space-y-0.5 p-3","fleet"!==a.id&&"pt-1"),"aria-label":a.label,children:a.items.map(a=>{let g=a.href===c,h=a.icon;return(0,b.jsxs)(e.default,{href:a.href,prefetch:!1,target:a.external?"_blank":void 0,rel:a.external?"noopener noreferrer":void 0,"aria-current":g?"page":void 0,className:(0,f.f)("group relative flex items-center gap-3 overflow-hidden rounded-chip px-3 py-2 text-xs uppercase tracking-wider transition-colors duration-200","before:pointer-events-none before:absolute before:inset-y-0 before:-left-1/2 before:w-1/2 before:-skew-x-12 before:bg-gradient-to-r before:from-transparent before:to-transparent before:opacity-0 before:transition-[left,opacity] before:duration-500 hover:before:left-full hover:before:opacity-100",d?"before:via-accent/10":"before:via-primary/10",g?(0,f.f)(d?"text-accent":"text-primary",d?"bg-accent/5":"bg-primary/5"):(0,f.f)("text-text-muted",d?"hover:text-accent":"hover:text-primary")),children:[g&&(0,b.jsx)(q.f.span,{layoutId:"sidebar-indicator",className:(0,f.f)("absolute bottom-1 left-0 top-1 w-0.5 rounded-full",d?"bg-accent":"bg-primary"),style:{boxShadow:d?"0 0 8px var(--color-accent), 0 0 16px var(--color-glow-accent)":"0 0 8px var(--color-primary), 0 0 16px var(--color-glow)"},transition:{type:"spring",stiffness:300,damping:30}}),(0,b.jsx)(h,{className:"relative h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"relative truncate",children:a.label})]},a.href)})})]})}function aa(){return(0,b.jsxs)("div",{className:"relative flex h-8 w-8 items-center justify-center animate-flicker",children:[(0,b.jsxs)("svg",{viewBox:"0 0 32 32",className:"h-8 w-8 overflow-visible","aria-hidden":"true",children:[(0,b.jsx)("rect",{x:"1",y:"1",width:"30",height:"30",rx:"4",fill:"none",stroke:"var(--color-primary)",strokeOpacity:"0.35"}),(0,b.jsx)("path",{d:"M8 23 V9 L16 18 L24 9 V23",fill:"none",stroke:"var(--color-primary)",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",pathLength:100,style:{"--stroke-length":100,strokeDasharray:100,animation:"draw-stroke 1.4s var(--ease-out-expo) both"},className:"drop-shadow-[0_0_4px_var(--color-primary)]"})]}),(0,b.jsx)("div",{className:"absolute inset-0 rounded shadow-[0_0_12px_var(--color-glow)]"})]})}function ab(){let{connected:a}=(0,c.useSyncExternalStore)(Z.f.subscribe,Z.f.getSnapshot,Z.f.getServerSnapshot);return(0,b.jsxs)("span",{className:"flex items-center gap-1.5",title:a?"Live event stream connected":"Live event stream reconnecting",children:[(0,b.jsxs)("span",{className:"relative inline-flex h-1.5 w-1.5",children:[a&&(0,b.jsx)("span",{className:"absolute inset-0 rounded-full bg-success animate-halo"}),(0,b.jsx)("span",{className:(0,f.f)("relative inline-flex h-1.5 w-1.5 rounded-full",a?"bg-success shadow-[0_0_6px_var(--color-success)]":"bg-warning")})]}),(0,b.jsx)("span",{className:a?"text-success/70":"text-warning/70",children:a?"Live":"Offline"})]})}function ac({integrations:a}){let e=Y((0,d.usePathname)()),f=(0,c.useMemo)(()=>(function(a,b=V){return b.filter(b=>{var c;return!b.integration||(c=b.integration,"securityConsole"===c?null!==a.securityConsoleUrl:a.hermes)}).map(b=>"security"===b.id&&a.securityConsoleUrl?{...b,items:[{href:a.securityConsoleUrl,label:"Security console ↗",icon:Q,external:!0},...b.items]}:b)})(a),[a]);return(0,b.jsxs)("aside",{className:"relative flex h-full w-56 flex-col border-r border-border/50 bg-bg",children:[(0,b.jsx)("div",{className:"absolute bottom-0 right-0 top-0 w-px bg-gradient-to-b from-primary/60 via-primary/20 to-transparent"}),(0,b.jsxs)("div",{className:"flex h-14 items-center gap-3 border-b border-border/30 px-4",children:[(0,b.jsx)(aa,{}),(0,b.jsx)("span",{className:"text-sm font-bold uppercase tracking-[0.2em] text-text",children:"Magnus"})]}),(0,b.jsx)(p,{}),(0,b.jsx)("div",{className:"flex-1 overflow-y-auto",children:f.map(a=>(0,b.jsx)(_,{group:a,activeHref:e},a.id))}),(0,b.jsxs)("div",{className:"flex items-center justify-between border-t border-border/30 p-4 text-[10px] uppercase tracking-widest text-primary/40",children:[(0,b.jsxs)("span",{children:["Magnus v","1.0.3"]}),(0,b.jsx)(ab,{})]})]})}var ad=a.i(24552),ae=a.i(69520);let af=(0,r.f)("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);var ag=a.i(87532),ah=a.i(50522);let ai=(0,r.f)("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]),aj=(0,r.f)("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);var ak=a.i(73570),al=a.i(92e3),am=a.i(97063),an=a.i(82478),ao=a.i(68790),ap=a.i(46997);function aq(){let[a,d]=(0,c.useState)(!1),[g,i]=(0,c.useState)([]),[k,l]=(0,c.useState)(0),[m,n]=(0,c.useState)(!1),o=(0,c.useRef)(null),p=(0,c.useCallback)(async()=>{try{let a=await ap.f.notifications.unreadCount();a.success&&a.data&&l(a.data.count)}catch{}},[]),q=(0,c.useCallback)(async()=>{n(!0);try{let a=await ap.f.notifications.list({pageSize:20});if(a.success&&a.data){let b=a.data;i(b.notifications)}}catch{}finally{n(!1)}},[]);(0,c.useEffect)(()=>{p();let a=setInterval(()=>void p(),15e3);return()=>clearInterval(a)},[p]),(0,c.useEffect)(()=>{a&&q()},[a,q]),(0,c.useEffect)(()=>{if(!a)return;let b=a=>{o.current&&!o.current.contains(a.target)&&d(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[a]),(0,c.useEffect)(()=>{if(!a)return;let b=a=>{"Escape"===a.key&&d(!1)};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[a]);let r=async a=>{try{await ap.f.notifications.markRead([a]),i(b=>b.map(b=>b.id===a?{...b,isRead:!0}:b)),l(a=>Math.max(0,a-1))}catch{}},s=async()=>{try{await ap.f.notifications.markAllRead(),i(a=>a.map(a=>({...a,isRead:!0}))),l(0),setTimeout(()=>void p(),500)}catch{}};return(0,b.jsxs)("div",{className:"relative",ref:o,children:[(0,b.jsxs)("button",{className:"relative rounded p-2 text-text-muted transition-all hover:bg-surface-hover hover:text-text",title:"Notifications",type:"button","aria-expanded":a,"aria-controls":"notification-panel","aria-label":k>0?`Notifications (${k} unread)`:"Notifications",onClick:()=>d(a=>!a),children:[(0,b.jsx)(ai,{className:"h-4 w-4"}),k>0&&(0,b.jsx)("span",{className:"absolute right-1 top-1 flex h-4 min-w-[1rem] items-center justify-center rounded-full bg-danger px-1 text-[10px] font-bold text-white",children:k>99?"99+":k})]}),a&&(0,b.jsxs)("div",{id:"notification-panel",role:"region","aria-label":"Notifications",className:"absolute right-0 top-full z-50 mt-2 w-96 overflow-hidden rounded border border-border bg-surface shadow-2xl",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[(0,b.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider text-text",children:"Notifications"}),k>0&&(0,b.jsxs)("button",{className:"flex items-center gap-1 rounded px-2 py-1 text-xs text-primary hover:bg-primary/10 transition-all",onClick:()=>void s(),type:"button",children:[(0,b.jsx)(aj,{className:"h-3 w-3"}),"Mark all read"]})]}),(0,b.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[m&&0===g.length&&(0,b.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,b.jsx)("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-primary border-t-transparent"})}),!m&&0===g.length&&(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-10 text-text-muted",children:[(0,b.jsx)(ai,{className:"mb-2 h-8 w-8 opacity-40"}),(0,b.jsx)("p",{className:"text-xs",children:"No notifications yet"})]}),g.map(a=>(0,b.jsxs)("div",{className:(0,f.f)("group flex items-start gap-3 border-b border-border/50 px-4 py-3 transition-all hover:bg-surface-hover",!a.isRead&&"bg-primary/5"),children:[(0,b.jsx)("div",{className:"mt-0.5 shrink-0",children:function(a){switch(a){case"critical":return(0,b.jsx)(al.f,{className:"h-4 w-4 text-danger"});case"warning":return(0,b.jsx)(ak.f,{className:"h-4 w-4 text-warning"});default:return(0,b.jsx)(am.f,{className:"h-4 w-4 text-primary"})}}(a.severity)}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[function(a){switch(a){case"node.offline":return(0,b.jsx)(t.f,{className:"h-3.5 w-3.5 text-danger"});case"node.degraded":return(0,b.jsx)(t.f,{className:"h-3.5 w-3.5 text-warning"});case"node.recovered":return(0,b.jsx)(J,{className:"h-3.5 w-3.5 text-success"});case"command.failed":return(0,b.jsx)(u.f,{className:"h-3.5 w-3.5 text-warning"});case"deploy.failed":return(0,b.jsx)(an.f,{className:"h-3.5 w-3.5 text-danger"});case"upgrade.failed":return(0,b.jsx)(ao.f,{className:"h-3.5 w-3.5 text-danger"});default:return(0,b.jsx)(ai,{className:"h-3.5 w-3.5 text-text-muted"})}}(a.type),(0,b.jsx)("span",{className:(0,f.f)("text-xs font-bold",a.isRead?"text-text-muted":"text-text"),children:a.title})]}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-text-muted line-clamp-2",children:a.message}),(0,b.jsx)("span",{className:"mt-1 block text-[10px] text-text-muted/60",children:function(a){let b=Math.floor((Date.now()-new Date(a).getTime())/1e3);if(b<60)return"just now";let c=Math.floor(b/60);if(c<60)return`${c}m ago`;let d=Math.floor(c/60);if(d<24)return`${d}h ago`;let e=Math.floor(d/24);return`${e}d ago`}(a.createdAt)})]}),!a.isRead&&(0,b.jsx)("button",{className:"mt-0.5 shrink-0 rounded p-1 text-text-muted opacity-0 transition-all hover:bg-surface-hover hover:text-primary group-hover:opacity-100",title:"Mark as read",type:"button",onClick:()=>void r(a.id),children:(0,b.jsx)(j.f,{className:"h-3.5 w-3.5"})})]},a.id))]}),(0,b.jsx)("div",{className:"border-t border-border px-4 py-2 flex justify-end",children:(0,b.jsxs)(e.default,{href:"/notifications",className:"flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",onClick:()=>d(!1),children:[(0,b.jsx)(h.f,{className:"h-3 w-3"}),"Preferences"]})})]})]})}var ar=a.i(62260);let as=[{keys:["g","m"],label:"Go to Mission Control",description:"Navigate to unified Mission Control home",action:"navigate",target:"/mission-control",category:"navigation"},{keys:["g","o"],label:"Go to Overview",description:"Navigate to fleet overview",action:"navigate",target:"/",category:"navigation"},{keys:["g","n"],label:"Go to Nodes",description:"Navigate to node list",action:"navigate",target:"/nodes",category:"navigation"},{keys:["g","c"],label:"Go to Commands",description:"Navigate to command console",action:"navigate",target:"/commands",category:"navigation"},{keys:["g","j"],label:"Go to Cron Jobs",description:"Navigate to cron jobs",action:"navigate",target:"/cron",category:"navigation"},{keys:["g","f"],label:"Go to Files",description:"Navigate to file editor",action:"navigate",target:"/files",category:"navigation"},{keys:["g","s"],label:"Go to Skills",description:"Navigate to skill marketplace",action:"navigate",target:"/skills",category:"navigation"},{keys:["g","l"],label:"Go to Logs",description:"Navigate to log explorer",action:"navigate",target:"/logs",category:"navigation"},{keys:["g","a"],label:"Go to Audit",description:"Navigate to audit trail",action:"navigate",target:"/audit",category:"navigation"},{keys:["?"],label:"Show Shortcuts",description:"Show keyboard shortcut reference",action:"command",target:"show-shortcuts",category:"general"}];function at(){return"u">typeof navigator&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘":"Ctrl"}function au(){document.body.dispatchEvent(new KeyboardEvent("keydown",{key:"k",ctrlKey:!0,metaKey:!0,bubbles:!0}))}function av({onMenuToggle:a}){let f=(0,d.usePathname)(),g=(0,d.useRouter)(),{title:h,crumbs:i}=function(a){let b=null;for(let c of Object.keys(W))X(a,c)&&(null===b||c.length>b.length)&&(b=c);let c=b?W[b]:"Magnus",d=Y(a),e=d?V.find(a=>a.items.some(a=>a.href===d))?.label??null:null,f=[];if(e&&f.push({label:e}),f.push({label:c,href:b??void 0}),b&&a!==b)for(let c of a.slice("/"===b?1:b.length+1).split("/").filter(Boolean)){let a=decodeURIComponent(c);f.push({label:a.length>18?`${a.slice(0,8)}…${a.slice(-6)}`:a})}return{title:c,group:e,crumbs:f}}(f),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)("Ctrl"),p=(0,c.useRef)(null);async function q(a=!1){let b=await fetch(`/api/auth/logout${a?"?all=true":""}`,{method:"POST"}).catch(()=>null);b?.ok?(g.push("/login"),g.refresh()):window.alert("Session revocation unavailable; retry sign out.")}return(0,c.useEffect)(()=>{o(at()),fetch("/api/auth/me").then(a=>a.ok?a.json():null).then(a=>{a?.username&&k(a.username)}).catch(()=>{})},[]),(0,c.useEffect)(()=>{if(!l)return;let a=a=>{(a instanceof KeyboardEvent?"Escape"!==a.key:p.current?.contains(a.target))||m(!1)};return document.addEventListener("mousedown",a),document.addEventListener("keydown",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",a)}},[l]),(0,b.jsxs)("header",{className:"relative z-(--z-shell) flex h-14 items-center justify-between gap-3 bg-bg/80 px-3 backdrop-blur-sm sm:px-6",children:[(0,b.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-primary/60 via-accent/40 to-transparent"}),(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-2 text-xs uppercase tracking-[0.15em] text-text-muted",children:[a&&(0,b.jsx)("button",{className:"mr-1 rounded p-1.5 text-text-muted hover:text-primary md:hidden",onClick:a,type:"button",title:"Toggle menu",children:(0,b.jsx)(af,{className:"h-5 w-5"})}),(0,b.jsx)("span",{className:"text-primary/60",children:">_"}),(0,b.jsx)("nav",{"aria-label":"Breadcrumb",className:"hidden min-w-0 items-center gap-1 sm:flex",children:i.map((a,c)=>{let d=c===i.length-1;return(0,b.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[c>0&&(0,b.jsx)(ah.f,{className:"h-3 w-3 shrink-0 text-primary/30","aria-hidden":"true"}),a.href&&!d?(0,b.jsx)(e.default,{href:a.href,prefetch:!1,className:"truncate transition-colors hover:text-primary",children:a.label}):(0,b.jsx)("span",{className:d?"truncate text-text":0===c&&i.length>1?"truncate text-text-muted/60":"truncate","aria-current":d?"page":void 0,children:a.label})]},`${a.label}-${c}`)})}),(0,b.jsx)("span",{className:"sr-only sm:hidden",children:h}),(0,b.jsx)("span",{className:"ml-1 hidden h-3.5 w-1.5 shrink-0 bg-primary/80 sm:inline-block",style:{animation:"cursor-blink 1s step-end infinite"}})]}),(0,b.jsx)(ar.J,{className:"hidden max-w-xl flex-1 lg:block"}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-1 sm:gap-2",children:[(0,b.jsxs)("button",{type:"button",onClick:au,className:"hidden items-center gap-2 rounded-chip border border-border bg-surface px-2.5 py-1.5 text-[10px] uppercase tracking-wider text-text-muted transition-colors hover:border-primary/40 hover:text-primary md:flex",title:"Search and jump (command palette)",children:[(0,b.jsx)(ag.f,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:"Search"}),(0,b.jsxs)("kbd",{className:"rounded-chip border border-border bg-bg px-1 text-[9px] text-primary/70",children:[n,"+K"]})]}),(0,b.jsx)("button",{className:"rounded p-2 text-text-muted transition-all hover:text-primary hover:drop-shadow-[0_0_6px_var(--color-glow)]",title:"Refresh",onClick:()=>window.location.reload(),type:"button",children:(0,b.jsx)(ae.f,{className:"h-4 w-4"})}),(0,b.jsx)(aq,{}),(0,b.jsx)("button",{className:"rounded p-2 text-text-muted transition-all hover:text-danger hover:drop-shadow-[0_0_6px_rgba(255,23,68,0.3)]",title:"Sign Out",onClick:()=>void q(),type:"button",children:(0,b.jsx)(ad.f,{className:"h-4 w-4"})}),(0,b.jsxs)("div",{ref:p,className:"relative ml-1",children:[(0,b.jsx)("button",{type:"button",onClick:()=>m(a=>!a),"aria-haspopup":"menu","aria-expanded":l,title:j?`Signed in as ${j}`:"Account",className:"flex h-8 w-8 items-center justify-center rounded border border-accent/40 text-[10px] font-bold uppercase text-accent shadow-[0_0_8px_var(--color-glow-accent)] transition-colors hover:border-accent hover:bg-accent/10",children:j?.[0]??"U"}),l&&(0,b.jsxs)("div",{role:"menu",className:"panel-corners absolute right-0 top-full z-(--z-modal) mt-2 w-60 rounded-panel border border-accent/30 bg-surface/95 p-1 shadow-[0_0_24px_var(--color-glow-accent)] backdrop-blur-sm [--panel-corner-color:var(--color-accent)]",children:[j&&(0,b.jsxs)("div",{className:"border-b border-border px-3 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:["Signed in as ",(0,b.jsx)("span",{className:"text-accent",children:j})]}),(0,b.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>void q(),className:"flex w-full items-center gap-2 rounded-chip px-3 py-2 text-left text-xs text-text-muted transition-colors hover:bg-surface-hover hover:text-text",children:[(0,b.jsx)(ad.f,{className:"h-3.5 w-3.5"})," Sign out"]}),(0,b.jsxs)("button",{type:"button",role:"menuitem","aria-label":"Sign out all local sessions",onClick:()=>void q(!0),className:"flex w-full items-center gap-2 rounded-chip px-3 py-2 text-left text-xs text-text-muted transition-colors hover:bg-danger/10 hover:text-danger",children:[(0,b.jsx)(ad.f,{className:"h-3.5 w-3.5"})," Sign out all local sessions"]})]})]})]})]})}async function aw(a,b){try{let c=await fetch(a,{signal:b,headers:{accept:"application/json"}});if(!c.ok)return null;return await c.json()}catch{return null}}function ax(a,b){return a.trim()?b.map(b=>({e:b,s:function(a,b){if(!a)return 0;let c=a.toLowerCase(),d=b.toLowerCase(),e=d.indexOf(c);if(-1!==e)return e;let f=0,g=0;for(let a of c){let b=d.indexOf(a,f);if(-1===b)return -1;g+=b-f,f=b+1}return 1e3+g}(a,`${b.label} ${b.sublabel??""}`)})).filter(({s:a})=>a>=0).sort((a,b)=>a.s-b.s).map(({e:a})=>a):b}async function ay(a,b={}){let{signal:c,limit:d=10}=b;if(a.trim().length<2)return[];let[e,f,g]=await Promise.all([aw("/api/proxy/nodes",c),aw("/api/proxy/orchestra/installations",c),aw("/api/proxy/orchestra/skill-catalog",c)]),h=[];for(let a of e?.data??[])h.push({kind:"node",id:a.id,label:a.name,sublabel:a.status?`Node \xb7 ${a.status}`:"Node",href:`/nodes/${a.id}`});for(let a of f?.data??[])h.push({kind:"installation",id:a.id,label:a.displayName??a.hostname,sublabel:`Hermes \xb7 ${a.status??"unknown"}`,href:"/orchestra/installations"});for(let a of g?.data??[])h.push({kind:"skill",id:a.id,label:a.name,sublabel:a.description??"Skill",href:"/skills"});return ax(a,[{kind:"action",id:"deploy-agent",label:"Deploy agent to host",sublabel:"Action · Operations",href:"/governor/operations"},{kind:"action",id:"open-terminal",label:"Open node terminal",sublabel:"Action · Nodes",href:"/nodes"},{kind:"action",id:"run-fleet-check",label:"Run fleet check",sublabel:"Action · Fleet readiness",href:"/fleet-readiness"},{kind:"action",id:"view-stale-nodes",label:"View stale nodes",sublabel:"Action · Readiness",href:"/fleet-readiness"},{kind:"action",id:"rotate-node-secret",label:"Rotate node secret",sublabel:"Action · Operations",href:"/governor/operations"},{kind:"action",id:"latest-failed-deploy",label:"Open latest failed deploy",sublabel:"Action · Timeline",href:"/fleet-timeline"},...h]).slice(0,d)}var az=a.i(32860),aA=a.i(64519),aB=a.i(9347);let aC=(0,r.f)("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);var aD=a.i(33508);let aE=(0,r.f)("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);var aF=a.i(96221),aG=a.i(8406),aH=a.i(73140);let aI={"/":s,"/mission-control":H,"/nodes":t.f,"/commands":u.f,"/cron":v.f,"/files":w.f,"/skills":aA.f,"/logs":x,"/audit":y.f,"/library":aB.f},aJ={node:t.f,installation:z.f,skill:aA.f,action:az.f};function aK(){let[a,e]=(0,c.useState)(!1),[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(0),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)("normal"),r=(0,c.useRef)(null),s=(0,d.useRouter)(),t=(0,c.useRef)([]),u=(0,c.useRef)(void 0),v=(0,c.useRef)(void 0),w=(0,c.useRef)(null),x=(f.trim()?as.filter(a=>a.label.toLowerCase().includes(f.toLowerCase())||a.description.toLowerCase().includes(f.toLowerCase())):as).map(a=>({kind:"shortcut",key:`s:${a.keys.join("-")}`,shortcut:a})),y=ax(f,l).map(a=>({kind:"entity",key:`e:${a.kind}:${a.id}`,entity:a})),z=f.trim()?[...y,...x]:x;(0,c.useEffect)(()=>{if(!a)return;let b=f.trim();if(b.length<2){m([]),o(!1);return}v.current&&clearTimeout(v.current),w.current&&w.current.abort();let c=new AbortController;return w.current=c,o(!0),v.current=setTimeout(async()=>{let a=await ay(b,{signal:c.signal,limit:12});c.signal.aborted||(m(a),o(!1))},180),()=>{c.abort(),v.current&&clearTimeout(v.current)}},[f,a]);let A=(0,c.useCallback)(a=>{"navigate"===a.action&&a.target?(s.push(a.target),e(!1),g("")):"show-shortcuts"===a.target&&(k(!0),e(!1),g(""))},[s]),B=(0,c.useCallback)(a=>{"shortcut"===a.kind?A(a.shortcut):(s.push(a.entity.href),e(!1),g(""))},[A,s]);return((0,c.useEffect)(()=>{let b=b=>{let c=b.target,d="INPUT"===c.tagName||"TEXTAREA"===c.tagName||c.isContentEditable;if((b.metaKey||b.ctrlKey)&&"k"===b.key.toLowerCase()){b.preventDefault(),b.stopPropagation(),b.stopImmediatePropagation(),e(a=>!a);return}if("Escape"===b.key){if(a){e(!1),g("");return}return j?void k(!1):void 0}if(!d){if("?"===b.key){b.preventDefault(),k(a=>!a);return}if(1===b.key.length&&!b.metaKey&&!b.ctrlKey&&!b.altKey){for(let a of(clearTimeout(u.current),t.current.push(b.key.toLowerCase()),as))if(a.keys.length===t.current.length&&a.keys.every((a,b)=>a===t.current[b])){b.preventDefault(),t.current=[],A(a);return}u.current=setTimeout(()=>{t.current=[]},800)}}};return window.addEventListener("keydown",b,!0),()=>window.removeEventListener("keydown",b,!0)},[a,j,A]),(0,c.useEffect)(()=>{a&&(i(0),setTimeout(()=>r.current?.focus(),50))},[a]),(0,c.useEffect)(()=>{h>=z.length&&i(Math.max(0,z.length-1))},[z.length,h]),(0,c.useEffect)(()=>{a&&q("low"===document.documentElement.dataset.fx?"low":"normal")},[a]),a||j)?(0,b.jsxs)(b.Fragment,{children:[a&&(0,b.jsxs)("div",{className:"fixed inset-0 z-(--z-modal) flex items-start justify-center pt-[15vh]","data-testid":"command-palette",children:[(0,b.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-[2px]",onClick:()=>{e(!1),g("")}}),(0,b.jsxs)("div",{className:"relative z-10 w-full max-w-lg panel-corners rounded-panel border border-primary/30 bg-surface/95 shadow-[0_0_40px_var(--color-glow)]",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 border-b border-border px-4 py-3",children:[(0,b.jsx)(ag.f,{className:"h-5 w-5 text-primary"}),(0,b.jsx)("input",{ref:r,type:"text",placeholder:"Search nodes, agents, runs, users, commands...",className:"flex-1 bg-transparent text-sm text-text placeholder:text-text-muted/70 caret-primary outline-none",value:f,onChange:a=>{g(a.target.value),i(0)},onKeyDown:a=>{"ArrowDown"===a.key?(a.preventDefault(),i(a=>Math.min(a+1,z.length-1))):"ArrowUp"===a.key?(a.preventDefault(),i(a=>Math.max(a-1,0))):"Enter"===a.key&&z[h]&&(a.preventDefault(),B(z[h]))},"data-testid":"command-palette-input"}),n?(0,b.jsx)(aF.f,{className:"h-4 w-4 animate-spin text-primary"}):(0,b.jsx)("kbd",{className:"rounded-chip border border-border bg-bg px-1.5 py-0.5 text-[10px] text-text-muted",children:"ESC"})]}),(0,b.jsxs)("div",{className:"max-h-96 overflow-y-auto py-2",children:[0===z.length&&!n&&(0,b.jsx)("p",{className:"px-4 py-6 text-center text-xs uppercase tracking-wider text-text-muted",children:"No results found"}),0===z.length&&n&&(0,b.jsx)("p",{className:"px-4 py-6 text-center text-xs uppercase tracking-wider text-text-muted",children:"Searching…"}),z.map((a,c)=>{let d=c===h;if("shortcut"===a.kind){let e=aI[a.shortcut.target??""]??az.f;return(0,b.jsxs)("button",{className:`flex w-full items-center gap-3 px-4 py-2 text-left text-sm transition-colors ${d?"bg-primary/10 text-primary shadow-[inset_2px_0_0_var(--color-primary)]":"text-text hover:bg-surface-hover"}`,onClick:()=>B(a),onMouseEnter:()=>i(c),"data-testid":"command-palette-item","data-item-kind":"shortcut",children:[(0,b.jsx)(e,{className:"h-4 w-4 shrink-0 opacity-70"}),(0,b.jsx)("span",{className:"flex-1",children:a.shortcut.label}),(0,b.jsx)("span",{className:"text-xs text-text-muted",children:a.shortcut.keys.map(a=>a.toUpperCase()).join(" then ")})]},a.key)}let e=aJ[a.entity.kind]??az.f;return(0,b.jsxs)("button",{className:`flex w-full items-center gap-3 px-4 py-2 text-left text-sm transition-colors ${d?"bg-accent/10 text-accent shadow-[inset_2px_0_0_var(--color-accent)]":"text-text hover:bg-surface-hover"}`,onClick:()=>B(a),onMouseEnter:()=>i(c),"data-testid":"command-palette-item","data-item-kind":"entity","data-entity-kind":a.entity.kind,children:[(0,b.jsx)(e,{className:"h-4 w-4 shrink-0 text-accent/80"}),(0,b.jsxs)("span",{className:"flex-1 truncate",children:[(0,b.jsx)("span",{className:"font-medium",children:a.entity.label}),a.entity.sublabel&&(0,b.jsx)("span",{className:"ml-2 text-xs text-text-muted",children:a.entity.sublabel})]}),(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:a.entity.kind})]},a.key)})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4 border-t border-border px-4 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:[(0,b.jsx)("span",{children:"↑↓ navigate"}),(0,b.jsx)("span",{children:"↵ select"}),(0,b.jsx)("span",{children:"esc close"}),(0,b.jsxs)("button",{type:"button",onClick:()=>q((0,aH.W)()),className:"ml-auto flex items-center gap-1 rounded-chip px-1 text-text-muted transition-colors hover:text-primary",title:"Toggle visual effects (scanlines, glow pulses, animated map)","data-testid":"command-palette-fx-toggle",children:[(0,b.jsx)(aG.f,{className:"h-3 w-3"})," fx: ",p]}),(0,b.jsxs)("span",{className:"flex items-center gap-1",children:[(0,b.jsx)(aE,{className:"h-3 w-3"})," ",at(),"+K"]})]})]})]}),j&&(0,b.jsxs)("div",{className:"fixed inset-0 z-(--z-modal) flex items-center justify-center",children:[(0,b.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-[2px]",onClick:()=>k(!1)}),(0,b.jsxs)("div",{className:"relative z-10 w-full max-w-md panel-corners rounded-panel border border-primary/30 bg-surface/95 p-6 shadow-[0_0_40px_var(--color-glow)]",children:[(0,b.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(aC,{className:"h-5 w-5 text-primary"}),(0,b.jsx)("h2",{className:"text-sm font-bold uppercase tracking-wider text-primary glow-text-primary",children:"Keyboard Shortcuts"})]}),(0,b.jsx)("button",{onClick:()=>k(!1),className:"text-text-muted hover:text-text",children:(0,b.jsx)(aD.X,{className:"h-5 w-5"})})]}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"mb-2 text-[10px] font-medium uppercase tracking-[0.2em] text-text-muted",children:"General"}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(aL,{keys:[`${at()}+K`],label:"Open command palette"}),(0,b.jsx)(aL,{keys:["?"],label:"Show this reference"}),(0,b.jsx)(aL,{keys:["Esc"],label:"Close modal / palette"})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"mb-2 text-[10px] font-medium uppercase tracking-[0.2em] text-text-muted",children:"Fleet Navigation"}),(0,b.jsx)("div",{className:"space-y-1",children:as.filter(a=>"navigation"===a.category).map(a=>(0,b.jsx)(aL,{keys:a.keys.map(a=>a.toUpperCase()),label:a.label},a.target))})]})]})]})]})]}):null}function aL({keys:a,label:c}){return(0,b.jsxs)("div",{className:"flex items-center justify-between py-1",children:[(0,b.jsx)("span",{className:"text-xs text-text",children:c}),(0,b.jsx)("div",{className:"flex gap-1",children:a.map((c,d)=>(0,b.jsxs)("span",{children:[(0,b.jsx)("kbd",{className:"rounded-chip border border-border bg-bg px-1.5 py-0.5 text-[11px] text-primary",children:c}),d<a.length-1&&(0,b.jsx)("span",{className:"mx-0.5 text-[10px] text-text-muted/60",children:"then"})]},d))})]})}var aM=a.i(26926);a.s(["DashboardShell",0,function({children:a,integrations:e}){let f=(0,d.usePathname)(),g="/login"===f||f.startsWith("/governor/share/"),[h,i]=(0,c.useState)(!1);!function({enabled:a=!0}={}){let[b,d]=(0,c.useState)(!1),{addToast:e}=(0,aM.d)(),f=(0,c.useRef)(e);f.current=e;let g=(0,c.useRef)(null),h=(0,c.useRef)(null),i=(0,c.useCallback)(()=>{if(!a)return;let b=new EventSource("/api/proxy/events/stream");for(let a of(g.current=b,b.onopen=()=>{d(!0),Z.f.setConnected(!0)},["deploy:status","node:status","command:status","alert:fired"]))b.addEventListener(a,b=>{try{let c=JSON.parse(b.data),d=function(a){let b=a.type??"",c=a.nodeName??"Unknown";switch(b){case"deploy.started":return{title:`Deploying to ${c}`,severity:"info"};case"deploy.completed":return{title:`Deploy complete: ${c}`,severity:"success"};case"deploy.failed":return{title:`Deploy failed: ${c}`,message:a.message??void 0,severity:"error"};case"upgrade.started":return{title:`Upgrading ${c}`,severity:"info"};case"upgrade.completed":return{title:`Upgrade complete: ${c}`,message:`v${a.version}`,severity:"success"};case"upgrade.failed":return{title:`Upgrade failed: ${c}`,message:a.message??void 0,severity:"error"};case"node.recovered":return{title:`${c} back online`,message:`Recovered from ${a.previousStatus}`,severity:"success"};case"command.completed":return{title:"Command completed",message:`${a.command}`,severity:"success"};case"command.failed":return{title:"Command failed",message:`${a.command} (exit ${a.exitCode})`,severity:"error"};case"health.alert":return{title:`Alert: ${a.metric?.replaceAll("_"," ").toUpperCase()} on ${c}`,message:`${a.value?.toFixed(1)}% (threshold: ${a.threshold}%)`,severity:a.severity??"warning"};default:return null}}(c);d&&f.current(d),Z.f.push(d?{...d,channel:a}:{title:String(c.type??a).replaceAll("."," "),message:"string"==typeof c.nodeName?c.nodeName:void 0,severity:"info",channel:a})}catch{}});return b.onerror=()=>{d(!1),Z.f.setConnected(!1),b.close(),fetch("/api/auth/me",{cache:"no-store"}).then(a=>{if(g.current===b){if(401===a.status)return void window.location.replace("/login");h.current=setTimeout(i,5e3)}}).catch(()=>{g.current===b&&(h.current=setTimeout(i,5e3))})},b},[a]);(0,c.useEffect)(()=>{let a=i();return()=>{h.current&&clearTimeout(h.current),a?.close(),g.current?.close(),Z.f.setConnected(!1),g.current=null}},[i])}({enabled:!g}),(0,c.useEffect)(()=>{i(!1)},[f]);let j=(0,c.useCallback)(()=>i(a=>!a),[]);return g?(0,b.jsx)(b.Fragment,{children:a}):(0,b.jsxs)("div",{className:"flex h-screen overflow-hidden",children:[h&&(0,b.jsx)("div",{className:"fixed inset-0 z-40 bg-black/70 backdrop-blur-[2px] md:hidden",onClick:()=>i(!1)}),(0,b.jsx)("div",{className:`
2
2
  fixed inset-y-0 left-0 z-50 transform transition-transform duration-200 ease-in-out md:relative md:h-full md:translate-x-0
3
3
  ${h?"translate-x-0":"-translate-x-full"}
4
4
  `,children:(0,b.jsx)(ac,{integrations:e})}),(0,b.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,b.jsx)(av,{onMenuToggle:j}),(0,b.jsx)("main",{className:"app-backdrop relative flex-1 overflow-y-auto p-3 md:p-6",children:a})]}),(0,b.jsx)(aK,{})]})}],12737)},26926,a=>{var b=a.i(87924),c=a.i(72131),d=a.i(73570),e=a.i(67453),f=a.i(97063),g=a.i(33508),h=a.i(62722);let i=(0,c.createContext)(null),j=0,k={info:{bar:"bg-primary",border:"border-primary/40",text:"text-primary",glow:"shadow-[0_0_20px_var(--color-glow)]",Icon:f.f},success:{bar:"bg-success",border:"border-success/40",text:"text-success",glow:"shadow-[0_0_20px_var(--color-glow-success)]",Icon:e.f},warning:{bar:"bg-warning",border:"border-warning/40",text:"text-warning",glow:"shadow-[0_0_20px_var(--color-glow-warning)]",Icon:d.f},error:{bar:"bg-danger",border:"border-danger/40",text:"text-danger",glow:"shadow-[0_0_20px_var(--color-glow-danger)]",Icon:h.f}};function l({toasts:a,onRemove:c}){return 0===a.length?null:(0,b.jsx)("div",{role:"status","aria-live":"polite",className:"fixed bottom-4 right-4 z-(--z-toast) flex max-w-sm flex-col gap-2",children:a.map(a=>{let d=k[a.severity],e=d.Icon;return(0,b.jsxs)("div",{className:`relative overflow-hidden rounded-panel border ${d.border} ${d.glow} bg-surface/95 py-3 pl-4 pr-3 text-text backdrop-blur-sm animate-toast-in`,children:[(0,b.jsx)("span",{"aria-hidden":"true",className:`absolute inset-y-0 left-0 w-0.5 ${d.bar}`}),(0,b.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,b.jsx)(e,{className:`mt-0.5 h-4 w-4 shrink-0 ${d.text}`,"aria-hidden":"true"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("p",{className:`text-xs font-bold uppercase leading-tight tracking-wider ${d.text}`,children:a.title}),a.message&&(0,b.jsx)("p",{className:"mt-1 line-clamp-2 text-[11px] text-text-muted",children:a.message})]}),(0,b.jsx)("button",{onClick:()=>c(a.id),"aria-label":"Dismiss notification",className:"ml-2 shrink-0 text-text-muted transition-colors hover:text-text",children:(0,b.jsx)(g.X,{className:"h-3.5 w-3.5"})})]}),(0,b.jsx)("span",{"aria-hidden":"true",className:`absolute bottom-0 left-0 h-px w-full origin-left opacity-60 ${d.bar}`,style:{animation:`toast-progress ${"error"===a.severity?10:6}s linear forwards`}})]},a.id)})})}a.s(["N",0,function({children:a}){let[d,e]=(0,c.useState)([]),f=(0,c.useCallback)(a=>{e(b=>b.filter(b=>b.id!==a))},[]),g=(0,c.useCallback)(a=>{let b=`toast-${++j}`,c={...a,id:b,createdAt:Date.now()};e(a=>[...a.slice(-9),c]),setTimeout(()=>f(b),"error"===a.severity?1e4:6e3)},[f]);return(0,b.jsxs)(i.Provider,{value:{toasts:d,addToast:g,removeToast:f},children:[a,(0,b.jsx)(l,{toasts:d,onRemove:f})]})},"d",0,function(){let a=(0,c.useContext)(i);if(!a)throw Error("useToast must be used within a ToastProvider");return a}])}]})();
@@ -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)("405a96f27dc54c02b0c324e62deeb4334729f6c217",k.callServer,void 0,k.findSourceMapURL,"scanCron");var m=a.i(8387),n=a.i(73771),o=a.i(33855),p=a.i(69520),q=a.i(87532),r=a.i(41710),s=a.i(35125),t=a.i(5784),u=a.i(50522),v=a.i(73320),w=a.i(96221),x=a.i(80386),y=a.i(41675),z=a.i(73570),A=a.i(67453),B=a.i(62722);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)("4054c54ac9ff960df5c4a5b1cdf0a0ffb4926401fc",k.callServer,void 0,k.findSourceMapURL,"scanCron");var m=a.i(8387),n=a.i(73771),o=a.i(33855),p=a.i(69520),q=a.i(87532),r=a.i(41710),s=a.i(35125),t=a.i(5784),u=a.i(50522),v=a.i(73320),w=a.i(96221),x=a.i(80386),y=a.i(41675),z=a.i(73570),A=a.i(67453),B=a.i(62722);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
@@ -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)("40d858f94a6d79e55efef6eb915bc193fc6862ce99",j.callServer,void 0,j.findSourceMapURL,"scanSkills");var l=a.i(8387),m=a.i(73771),n=a.i(33855),o=a.i(69520),p=a.i(87532),q=a.i(83497),r=a.i(35125);let s=(0,a.i(70106).f)("Tag",[["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"}]]);var t=a.i(7831),u=a.i(5784),v=a.i(50522),w=a.i(77156),x=a.i(73320),y=a.i(96221),z=a.i(73570),A=a.i(67453),B=a.i(62722);a.s(["default",0,function(){let{activeNode:a}=(0,i.l)(),[j,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)(null),[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 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)}))}));C(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&&!D&&(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:D,children:[(0,b.jsx)(o.f,{className:(0,l.f)("h-3.5 w-3.5 mr-1.5",D&&"animate-spin")}),D?"Scanning...":"Rescan"]})]})]})}),D&&(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})}),!D&&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")})]})}),!D&&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)(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)(o.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Retry Scan"]})]})})}),!D&&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)(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)(u.f,{className:"h-4 w-4 text-text-muted"}):(0,b.jsx)(v.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)(x.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)(s,{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)(t.f,{className:"h-3 w-3 text-primary"}),(0,b.jsx)("span",{children:a.name}),(0,b.jsx)(w.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)(t.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)(x.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)(y.f,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Publishing..."]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(x.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)("40e6891d18db2632e5d3c46d96829260594be328d5",j.callServer,void 0,j.findSourceMapURL,"scanSkills");var l=a.i(8387),m=a.i(73771),n=a.i(33855),o=a.i(69520),p=a.i(87532),q=a.i(83497),r=a.i(35125);let s=(0,a.i(70106).f)("Tag",[["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"}]]);var t=a.i(7831),u=a.i(5784),v=a.i(50522),w=a.i(77156),x=a.i(73320),y=a.i(96221),z=a.i(73570),A=a.i(67453),B=a.i(62722);a.s(["default",0,function(){let{activeNode:a}=(0,i.l)(),[j,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)(null),[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 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)}))}));C(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&&!D&&(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:D,children:[(0,b.jsx)(o.f,{className:(0,l.f)("h-3.5 w-3.5 mr-1.5",D&&"animate-spin")}),D?"Scanning...":"Rescan"]})]})]})}),D&&(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})}),!D&&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")})]})}),!D&&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)(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)(o.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Retry Scan"]})]})})}),!D&&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)(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)(u.f,{className:"h-4 w-4 text-text-muted"}):(0,b.jsx)(v.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)(x.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)(s,{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)(t.f,{className:"h-3 w-3 text-primary"}),(0,b.jsx)("span",{children:a.name}),(0,b.jsx)(w.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)(t.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)(x.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)(y.f,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Publishing..."]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(x.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=[90575,7574,a=>{"use strict";let b=(0,a.i(70106).f)("RefreshCcwDot",[["path",{d:"M3 2v6h6",key:"18ldww"}],["path",{d:"M21 12A9 9 0 0 0 6 5.3L3 8",key:"1pbrqz"}],["path",{d:"M21 22v-6h-6",key:"usdfbe"}],["path",{d:"M3 12a9 9 0 0 0 15 6.7l3-2.7",key:"1hosoe"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);a.s(["f",0,b],90575);var c=a.i(87924),d=a.i(72131),e=a.i(68415),f=a.i(85063),g=a.i(46997),h=a.i(35125),i=a.i(96221);a.s(["E",0,function({open:a,node:b,onClose:j,onSaved:k}){let[l,m]=(0,d.useState)([]),[n,o]=(0,d.useState)(""),[p,q]=(0,d.useState)(!0),[r,s]=(0,d.useState)(!1),[t,u]=(0,d.useState)(""),[v,w]=(0,d.useState)(!1);(0,d.useEffect)(()=>{a&&(u(""),o(b?.role?.id??""),q(!0),w(!0),(async()=>{try{let a=await g.f.roles.list();m(a.data??[])}catch{u("Failed to load roles")}finally{w(!1)}})())},[a,b?.role?.id]);let x=async()=>{if(b){s(!0),u("");try{let a=b.role?.id;a&&a!==n&&await g.f.roles.unassign(a,{nodeIds:[b.id]}),n&&await g.f.roles.assign(n,{nodeIds:[b.id],defer:!p});let c=n?l.find(a=>a.id===n)??null:null;k(c),j()}catch(a){u(a instanceof Error?a.message:"Failed to assign role")}finally{s(!1)}}},y=async()=>{if(b?.role){s(!0),u("");try{await g.f.roles.unassign(b.role.id,{nodeIds:[b.id]}),k(null),j()}catch(a){u(a instanceof Error?a.message:"Failed to unassign role")}finally{s(!1)}}},z=()=>{u(""),s(!1),j()};return(0,c.jsx)(f.n,{open:a,onClose:z,title:b?.role?"Change Role":"Assign Role",description:b?`Node: ${b.name}`:"",icon:(0,c.jsx)(h.f,{className:"h-5 w-5 text-primary"}),children:(0,c.jsxs)("div",{className:"space-y-4",children:[v?(0,c.jsxs)("div",{className:"flex items-center gap-2 py-4 text-xs text-text-muted",children:[(0,c.jsx)(i.f,{className:"h-4 w-4 animate-spin"}),"Loading roles…"]}):0===l.length?(0,c.jsx)("p",{className:"text-xs text-text-muted py-4",children:"No roles found. Create a role first on the Roles page."}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(f.G,{label:"Role",children:(0,c.jsxs)("select",{value:n,onChange:a=>o(a.target.value),className:f.N,children:[(0,c.jsx)("option",{value:"",children:"— No role —"}),l.map(a=>(0,c.jsx)("option",{value:a.id,children:a.name},a.id))]})}),n&&(0,c.jsxs)("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[(0,c.jsx)("input",{type:"checkbox",checked:p,onChange:a=>q(a.target.checked),className:"rounded border-border"}),"Apply role immediately"]})]}),t&&(0,c.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:t}),(0,c.jsxs)("div",{className:"flex justify-between pt-2",children:[(0,c.jsx)("div",{children:b?.role&&(0,c.jsx)(e.K,{variant:"secondary",size:"sm",onClick:()=>void y(),disabled:r,children:"Unassign Role"})}),(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(e.K,{variant:"secondary",size:"sm",onClick:z,children:"Cancel"}),(0,c.jsx)(e.K,{size:"sm",onClick:()=>void x(),disabled:r||!n||0===l.length,icon:r?(0,c.jsx)(i.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:r?"Saving…":b?.role?"Change Role":"Assign Role"})]})]})]})})},"F",0,function({open:a,node:b,onClose:j,onSaved:k}){let[l,m]=(0,d.useState)(""),[n,o]=(0,d.useState)(""),[p,q]=(0,d.useState)(""),[r,s]=(0,d.useState)(!1),[t,u]=(0,d.useState)("");(0,d.useEffect)(()=>{if(b){m(b.name);try{let a=JSON.parse(b.tags);o(a.join(", "))}catch{o("")}q(b.status),u("")}},[b]);let v=async()=>{if(b&&l.trim()){s(!0),u("");try{let a=n.split(",").map(a=>a.trim()).filter(Boolean);await g.f.nodes.update(b.id,{name:l.trim(),tags:a,status:p.toUpperCase()}),k(),j()}catch(a){u(a instanceof Error?a.message:"Failed to update node")}finally{s(!1)}}},w=()=>{u(""),s(!1),j()};return(0,c.jsx)(f.n,{open:a,onClose:w,title:"Edit Node",description:b?`${b.hostname}`:"",icon:(0,c.jsx)(h.f,{className:"h-5 w-5 text-primary"}),children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsx)(f.G,{label:"Name",required:!0,children:(0,c.jsx)("input",{type:"text",value:l,onChange:a=>m(a.target.value),className:f.W})}),(0,c.jsx)(f.G,{label:"Status",children:(0,c.jsxs)("select",{value:p,onChange:a=>q(a.target.value),className:f.N,children:[(0,c.jsx)("option",{value:"ONLINE",children:"ONLINE"}),(0,c.jsx)("option",{value:"OFFLINE",children:"OFFLINE"}),(0,c.jsx)("option",{value:"DEGRADED",children:"DEGRADED"}),(0,c.jsx)("option",{value:"PROVISIONING",children:"PROVISIONING"}),(0,c.jsx)("option",{value:"MAINTENANCE",children:"MAINTENANCE"})]})}),(0,c.jsxs)(f.G,{label:"Tags",children:[(0,c.jsx)("input",{type:"text",value:n,onChange:a=>o(a.target.value),placeholder:"web, production, us-east",className:f.W}),(0,c.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated list of tags"})]}),t&&(0,c.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:t}),(0,c.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,c.jsx)(e.K,{variant:"secondary",size:"sm",onClick:w,children:"Cancel"}),(0,c.jsx)(e.K,{size:"sm",onClick:()=>void v(),disabled:r||!l.trim(),icon:r?(0,c.jsx)(i.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:r?"Saving…":"Save Changes"})]})]})})},"M",0,function({open:a,onClose:b,onRegistered:j}){let[k,l]=(0,d.useState)(""),[m,n]=(0,d.useState)(""),[o,p]=(0,d.useState)("4100"),[q,r]=(0,d.useState)("linux"),[s,t]=(0,d.useState)("x86_64"),[u,v]=(0,d.useState)(""),[w,x]=(0,d.useState)(!1),[y,z]=(0,d.useState)(""),A=async()=>{if(k.trim()&&m.trim()){x(!0),z("");try{let a=u.split(",").map(a=>a.trim()).filter(Boolean);await g.f.nodes.register({name:k.trim(),hostname:m.trim(),ipAddress:m.trim(),port:Number(o)||4100,os:q,arch:s,tags:a,agentVersion:"1.0.2"}),j(),B()}catch(a){z(a instanceof Error?a.message:"Failed to register node")}finally{x(!1)}}},B=()=>{l(""),n(""),p("4100"),r("linux"),t("x86_64"),v(""),z(""),x(!1),b()};return(0,c.jsx)(f.n,{open:a,onClose:B,title:"Register Node",description:"Manually register a node already running the agent",icon:(0,c.jsx)(h.f,{className:"h-5 w-5 text-primary"}),children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsx)(f.G,{label:"Node Name",required:!0,children:(0,c.jsx)("input",{type:"text",value:k,onChange:a=>l(a.target.value),placeholder:"web-server-01",className:f.W,autoFocus:!0})}),(0,c.jsx)(f.G,{label:"FQDN / Hostname",required:!0,children:(0,c.jsx)("input",{type:"text",value:m,onChange:a=>n(a.target.value),placeholder:"node-1.example.com",className:f.W})}),(0,c.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,c.jsx)(f.G,{label:"Port",children:(0,c.jsx)("input",{type:"number",value:o,onChange:a=>p(a.target.value),className:f.W})}),(0,c.jsx)(f.G,{label:"OS",children:(0,c.jsxs)("select",{value:q,onChange:a=>r(a.target.value),className:f.N,children:[(0,c.jsx)("option",{value:"linux",children:"Linux"}),(0,c.jsx)("option",{value:"darwin",children:"macOS"}),(0,c.jsx)("option",{value:"windows",children:"Windows"})]})}),(0,c.jsx)(f.G,{label:"Architecture",children:(0,c.jsxs)("select",{value:s,onChange:a=>t(a.target.value),className:f.N,children:[(0,c.jsx)("option",{value:"x86_64",children:"x86_64"}),(0,c.jsx)("option",{value:"aarch64",children:"aarch64"}),(0,c.jsx)("option",{value:"arm",children:"arm"})]})})]}),(0,c.jsxs)(f.G,{label:"Tags",children:[(0,c.jsx)("input",{type:"text",value:u,onChange:a=>v(a.target.value),placeholder:"web, production, us-east",className:f.W}),(0,c.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated"})]}),y&&(0,c.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:y}),(0,c.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,c.jsx)(e.K,{variant:"secondary",size:"sm",onClick:B,children:"Cancel"}),(0,c.jsx)(e.K,{size:"sm",onClick:()=>void A(),disabled:w||!k.trim()||!m.trim(),icon:w?(0,c.jsx)(i.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:w?"Registering…":"Register Node"})]})]})})}],7574)}];
1
+ module.exports=[90575,7574,a=>{"use strict";let b=(0,a.i(70106).f)("RefreshCcwDot",[["path",{d:"M3 2v6h6",key:"18ldww"}],["path",{d:"M21 12A9 9 0 0 0 6 5.3L3 8",key:"1pbrqz"}],["path",{d:"M21 22v-6h-6",key:"usdfbe"}],["path",{d:"M3 12a9 9 0 0 0 15 6.7l3-2.7",key:"1hosoe"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);a.s(["f",0,b],90575);var c=a.i(87924),d=a.i(72131),e=a.i(68415),f=a.i(85063),g=a.i(46997),h=a.i(35125),i=a.i(96221);a.s(["E",0,function({open:a,node:b,onClose:j,onSaved:k}){let[l,m]=(0,d.useState)([]),[n,o]=(0,d.useState)(""),[p,q]=(0,d.useState)(!0),[r,s]=(0,d.useState)(!1),[t,u]=(0,d.useState)(""),[v,w]=(0,d.useState)(!1);(0,d.useEffect)(()=>{a&&(u(""),o(b?.role?.id??""),q(!0),w(!0),(async()=>{try{let a=await g.f.roles.list();m(a.data??[])}catch{u("Failed to load roles")}finally{w(!1)}})())},[a,b?.role?.id]);let x=async()=>{if(b){s(!0),u("");try{let a=b.role?.id;a&&a!==n&&await g.f.roles.unassign(a,{nodeIds:[b.id]}),n&&await g.f.roles.assign(n,{nodeIds:[b.id],defer:!p});let c=n?l.find(a=>a.id===n)??null:null;k(c),j()}catch(a){u(a instanceof Error?a.message:"Failed to assign role")}finally{s(!1)}}},y=async()=>{if(b?.role){s(!0),u("");try{await g.f.roles.unassign(b.role.id,{nodeIds:[b.id]}),k(null),j()}catch(a){u(a instanceof Error?a.message:"Failed to unassign role")}finally{s(!1)}}},z=()=>{u(""),s(!1),j()};return(0,c.jsx)(f.n,{open:a,onClose:z,title:b?.role?"Change Role":"Assign Role",description:b?`Node: ${b.name}`:"",icon:(0,c.jsx)(h.f,{className:"h-5 w-5 text-primary"}),children:(0,c.jsxs)("div",{className:"space-y-4",children:[v?(0,c.jsxs)("div",{className:"flex items-center gap-2 py-4 text-xs text-text-muted",children:[(0,c.jsx)(i.f,{className:"h-4 w-4 animate-spin"}),"Loading roles…"]}):0===l.length?(0,c.jsx)("p",{className:"text-xs text-text-muted py-4",children:"No roles found. Create a role first on the Roles page."}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(f.G,{label:"Role",children:(0,c.jsxs)("select",{value:n,onChange:a=>o(a.target.value),className:f.N,children:[(0,c.jsx)("option",{value:"",children:"— No role —"}),l.map(a=>(0,c.jsx)("option",{value:a.id,children:a.name},a.id))]})}),n&&(0,c.jsxs)("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[(0,c.jsx)("input",{type:"checkbox",checked:p,onChange:a=>q(a.target.checked),className:"rounded border-border"}),"Apply role immediately"]})]}),t&&(0,c.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:t}),(0,c.jsxs)("div",{className:"flex justify-between pt-2",children:[(0,c.jsx)("div",{children:b?.role&&(0,c.jsx)(e.K,{variant:"secondary",size:"sm",onClick:()=>void y(),disabled:r,children:"Unassign Role"})}),(0,c.jsxs)("div",{className:"flex gap-2",children:[(0,c.jsx)(e.K,{variant:"secondary",size:"sm",onClick:z,children:"Cancel"}),(0,c.jsx)(e.K,{size:"sm",onClick:()=>void x(),disabled:r||!n||0===l.length,icon:r?(0,c.jsx)(i.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:r?"Saving…":b?.role?"Change Role":"Assign Role"})]})]})]})})},"F",0,function({open:a,node:b,onClose:j,onSaved:k}){let[l,m]=(0,d.useState)(""),[n,o]=(0,d.useState)(""),[p,q]=(0,d.useState)(""),[r,s]=(0,d.useState)(!1),[t,u]=(0,d.useState)("");(0,d.useEffect)(()=>{if(b){m(b.name);try{let a=JSON.parse(b.tags);o(a.join(", "))}catch{o("")}q(b.status),u("")}},[b]);let v=async()=>{if(b&&l.trim()){s(!0),u("");try{let a=n.split(",").map(a=>a.trim()).filter(Boolean);await g.f.nodes.update(b.id,{name:l.trim(),tags:a,status:p.toUpperCase()}),k(),j()}catch(a){u(a instanceof Error?a.message:"Failed to update node")}finally{s(!1)}}},w=()=>{u(""),s(!1),j()};return(0,c.jsx)(f.n,{open:a,onClose:w,title:"Edit Node",description:b?`${b.hostname}`:"",icon:(0,c.jsx)(h.f,{className:"h-5 w-5 text-primary"}),children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsx)(f.G,{label:"Name",required:!0,children:(0,c.jsx)("input",{type:"text",value:l,onChange:a=>m(a.target.value),className:f.W})}),(0,c.jsx)(f.G,{label:"Status",children:(0,c.jsxs)("select",{value:p,onChange:a=>q(a.target.value),className:f.N,children:[(0,c.jsx)("option",{value:"ONLINE",children:"ONLINE"}),(0,c.jsx)("option",{value:"OFFLINE",children:"OFFLINE"}),(0,c.jsx)("option",{value:"DEGRADED",children:"DEGRADED"}),(0,c.jsx)("option",{value:"PROVISIONING",children:"PROVISIONING"}),(0,c.jsx)("option",{value:"MAINTENANCE",children:"MAINTENANCE"})]})}),(0,c.jsxs)(f.G,{label:"Tags",children:[(0,c.jsx)("input",{type:"text",value:n,onChange:a=>o(a.target.value),placeholder:"web, production, us-east",className:f.W}),(0,c.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated list of tags"})]}),t&&(0,c.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:t}),(0,c.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,c.jsx)(e.K,{variant:"secondary",size:"sm",onClick:w,children:"Cancel"}),(0,c.jsx)(e.K,{size:"sm",onClick:()=>void v(),disabled:r||!l.trim(),icon:r?(0,c.jsx)(i.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:r?"Saving…":"Save Changes"})]})]})})},"M",0,function({open:a,onClose:b,onRegistered:j}){let[k,l]=(0,d.useState)(""),[m,n]=(0,d.useState)(""),[o,p]=(0,d.useState)("4100"),[q,r]=(0,d.useState)("linux"),[s,t]=(0,d.useState)("x86_64"),[u,v]=(0,d.useState)(""),[w,x]=(0,d.useState)(!1),[y,z]=(0,d.useState)(""),A=async()=>{if(k.trim()&&m.trim()){x(!0),z("");try{let a=u.split(",").map(a=>a.trim()).filter(Boolean);await g.f.nodes.register({name:k.trim(),hostname:m.trim(),ipAddress:m.trim(),port:Number(o)||4100,os:q,arch:s,tags:a,agentVersion:"1.0.3"}),j(),B()}catch(a){z(a instanceof Error?a.message:"Failed to register node")}finally{x(!1)}}},B=()=>{l(""),n(""),p("4100"),r("linux"),t("x86_64"),v(""),z(""),x(!1),b()};return(0,c.jsx)(f.n,{open:a,onClose:B,title:"Register Node",description:"Manually register a node already running the agent",icon:(0,c.jsx)(h.f,{className:"h-5 w-5 text-primary"}),children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsx)(f.G,{label:"Node Name",required:!0,children:(0,c.jsx)("input",{type:"text",value:k,onChange:a=>l(a.target.value),placeholder:"web-server-01",className:f.W,autoFocus:!0})}),(0,c.jsx)(f.G,{label:"FQDN / Hostname",required:!0,children:(0,c.jsx)("input",{type:"text",value:m,onChange:a=>n(a.target.value),placeholder:"node-1.example.com",className:f.W})}),(0,c.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,c.jsx)(f.G,{label:"Port",children:(0,c.jsx)("input",{type:"number",value:o,onChange:a=>p(a.target.value),className:f.W})}),(0,c.jsx)(f.G,{label:"OS",children:(0,c.jsxs)("select",{value:q,onChange:a=>r(a.target.value),className:f.N,children:[(0,c.jsx)("option",{value:"linux",children:"Linux"}),(0,c.jsx)("option",{value:"darwin",children:"macOS"}),(0,c.jsx)("option",{value:"windows",children:"Windows"})]})}),(0,c.jsx)(f.G,{label:"Architecture",children:(0,c.jsxs)("select",{value:s,onChange:a=>t(a.target.value),className:f.N,children:[(0,c.jsx)("option",{value:"x86_64",children:"x86_64"}),(0,c.jsx)("option",{value:"aarch64",children:"aarch64"}),(0,c.jsx)("option",{value:"arm",children:"arm"})]})})]}),(0,c.jsxs)(f.G,{label:"Tags",children:[(0,c.jsx)("input",{type:"text",value:u,onChange:a=>v(a.target.value),placeholder:"web, production, us-east",className:f.W}),(0,c.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated"})]}),y&&(0,c.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:y}),(0,c.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,c.jsx)(e.K,{variant:"secondary",size:"sm",onClick:B,children:"Cancel"}),(0,c.jsx)(e.K,{size:"sm",onClick:()=>void A(),disabled:w||!k.trim()||!m.trim(),icon:w?(0,c.jsx)(i.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:w?"Registering…":"Register Node"})]})]})})}],7574)}];
2
2
 
3
3
  //# sourceMappingURL=node_modules_lucide-react_dist_esm_icons_refresh-ccw-dot_1bka5q1p8_fx4.js.map
@@ -7,9 +7,9 @@ globalThis.__BUILD_MANIFEST = {
7
7
  "static/chunks/0cz1d0mv5g_q7.js"
8
8
  ],
9
9
  "lowPriorityFiles": [
10
- "static/UZn0mscl5hk5YJtZnvSnK/_buildManifest.js",
11
- "static/UZn0mscl5hk5YJtZnvSnK/_ssgManifest.js",
12
- "static/UZn0mscl5hk5YJtZnvSnK/_clientMiddlewareManifest.js"
10
+ "static/BZlZSgkcAsB8gK9YHwg8e/_buildManifest.js",
11
+ "static/BZlZSgkcAsB8gK9YHwg8e/_ssgManifest.js",
12
+ "static/BZlZSgkcAsB8gK9YHwg8e/_clientMiddlewareManifest.js"
13
13
  ],
14
14
  "rootMainFiles": [
15
15
  "static/chunks/0-o74znen4827.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/0-o74znen4827.js"/><script src="/_next/static/chunks/0s2cptn1mmf6r.js" async=""></script><script src="/_next/static/chunks/3ltx1we1130yf.js" async=""></script><script src="/_next/static/chunks/2tcnztotjzug4.js" async=""></script><script src="/_next/static/chunks/2hoi73vy1wqpo.js" async=""></script><script src="/_next/static/chunks/turbopack-3-ry682tkyiqk.js" async=""></script><script src="/_next/static/chunks/42onvq6nokjl2.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,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;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/0-o74znen4827.js","static/chunks/0s2cptn1mmf6r.js","static/chunks/3ltx1we1130yf.js","static/chunks/2tcnztotjzug4.js","static/chunks/2hoi73vy1wqpo.js"],"runtimeModuleIds":[94553]});</script><script src="/_next/static/chunks/0-o74znen4827.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/42onvq6nokjl2.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\":\"UZn0mscl5hk5YJtZnvSnK\"}\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
+ <!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/0-o74znen4827.js"/><script src="/_next/static/chunks/0s2cptn1mmf6r.js" async=""></script><script src="/_next/static/chunks/3ltx1we1130yf.js" async=""></script><script src="/_next/static/chunks/2tcnztotjzug4.js" async=""></script><script src="/_next/static/chunks/2hoi73vy1wqpo.js" async=""></script><script src="/_next/static/chunks/turbopack-3-ry682tkyiqk.js" async=""></script><script src="/_next/static/chunks/42onvq6nokjl2.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,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;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/0-o74znen4827.js","static/chunks/0s2cptn1mmf6r.js","static/chunks/3ltx1we1130yf.js","static/chunks/2tcnztotjzug4.js","static/chunks/2hoi73vy1wqpo.js"],"runtimeModuleIds":[94553]});</script><script src="/_next/static/chunks/0-o74znen4827.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/42onvq6nokjl2.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\":\"BZlZSgkcAsB8gK9YHwg8e\"}\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": "11a718d5b3a0128a386e4089c5dc27fe",
3
- "previewModeSigningKey": "7e121914ce1b52ef168789416a2c4fecd47a2c34cfb43c34690874cc13c93bf5",
4
- "previewModeEncryptionKey": "7d9532fd3dae54ff5d5113dd8e2257fbf0cb4828af389b3d99c32caa0f6d1b49"
2
+ "previewModeId": "790e51f8d3cbcc3be2dc967136931007",
3
+ "previewModeSigningKey": "d6e8c134475a5f08c4d7b1a503f914a3234d8807e7711dfe5614c4ca60c26daa",
4
+ "previewModeEncryptionKey": "8538eea9380802983efbfac8061efdaca0ab173b19f6c843bf7730834cbd9e8d"
5
5
  }
@@ -1 +1 @@
1
- self.__RSC_SERVER_MANIFEST="{\n \"node\": {\n \"405a96f27dc54c02b0c324e62deeb4334729f6c217\": {\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 \"40d858f94a6d79e55efef6eb915bc193fc6862ce99\": {\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\": \"fPB0GdJmUSnlwGIQwRpU9mHyXuvqKLoW7bEECuRTEc8=\"\n}"
1
+ self.__RSC_SERVER_MANIFEST="{\n \"node\": {\n \"4054c54ac9ff960df5c4a5b1cdf0a0ffb4926401fc\": {\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 \"40e6891d18db2632e5d3c46d96829260594be328d5\": {\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\": \"DkXqn3N+5oHqakmRejzA6JZ4mezlBRwbvRMnVNWOvlc=\"\n}"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "node": {
3
- "405a96f27dc54c02b0c324e62deeb4334729f6c217": {
3
+ "4054c54ac9ff960df5c4a5b1cdf0a0ffb4926401fc": {
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
- "40d858f94a6d79e55efef6eb915bc193fc6862ce99": {
13
+ "40e6891d18db2632e5d3c46d96829260594be328d5": {
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": "fPB0GdJmUSnlwGIQwRpU9mHyXuvqKLoW7bEECuRTEc8="
25
+ "encryptionKey": "DkXqn3N+5oHqakmRejzA6JZ4mezlBRwbvRMnVNWOvlc="
26
26
  }