@hivemagnus/magnus-ui 2.3.2 → 2.3.4

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 (192) 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 +2 -2
  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/auth/hive/callback/route.js.nft.json +1 -1
  19. package/dist/app/apps/dashboard/.next/server/app/api/auth/login/route.js.nft.json +1 -1
  20. package/dist/app/apps/dashboard/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  21. package/dist/app/apps/dashboard/.next/server/app/api/auth/me/route.js.nft.json +1 -1
  22. package/dist/app/apps/dashboard/.next/server/app/api/federation/route.js.nft.json +1 -1
  23. package/dist/app/apps/dashboard/.next/server/app/api/hermes/dashboard/[[...path]]/route.js.nft.json +1 -1
  24. package/dist/app/apps/dashboard/.next/server/app/api/hive-router/dashboard/[[...path]]/route.js.nft.json +1 -1
  25. package/dist/app/apps/dashboard/.next/server/app/api/proxy/[...path]/route.js.nft.json +1 -1
  26. package/dist/app/apps/dashboard/.next/server/app/api/terminal/close/route.js.nft.json +1 -1
  27. package/dist/app/apps/dashboard/.next/server/app/api/terminal/input/route.js.nft.json +1 -1
  28. package/dist/app/apps/dashboard/.next/server/app/api/terminal/open/route.js.nft.json +1 -1
  29. package/dist/app/apps/dashboard/.next/server/app/api/terminal/resize/route.js.nft.json +1 -1
  30. package/dist/app/apps/dashboard/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
  31. package/dist/app/apps/dashboard/.next/server/app/api-docs/page.js.nft.json +1 -1
  32. package/dist/app/apps/dashboard/.next/server/app/api-docs/page_client-reference-manifest.js +1 -1
  33. package/dist/app/apps/dashboard/.next/server/app/application-operations/page.js.nft.json +1 -1
  34. package/dist/app/apps/dashboard/.next/server/app/application-operations/page_client-reference-manifest.js +1 -1
  35. package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page.js.nft.json +1 -1
  36. package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page_client-reference-manifest.js +1 -1
  37. package/dist/app/apps/dashboard/.next/server/app/ardent/page.js.nft.json +1 -1
  38. package/dist/app/apps/dashboard/.next/server/app/ardent/page_client-reference-manifest.js +1 -1
  39. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page.js.nft.json +1 -1
  40. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page_client-reference-manifest.js +1 -1
  41. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page.js.nft.json +1 -1
  42. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page_client-reference-manifest.js +1 -1
  43. package/dist/app/apps/dashboard/.next/server/app/audit/page.js.nft.json +1 -1
  44. package/dist/app/apps/dashboard/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  45. package/dist/app/apps/dashboard/.next/server/app/codex/installations/page.js.nft.json +1 -1
  46. package/dist/app/apps/dashboard/.next/server/app/codex/installations/page_client-reference-manifest.js +1 -1
  47. package/dist/app/apps/dashboard/.next/server/app/codex/page.js.nft.json +1 -1
  48. package/dist/app/apps/dashboard/.next/server/app/codex/page_client-reference-manifest.js +1 -1
  49. package/dist/app/apps/dashboard/.next/server/app/commands/page.js.nft.json +1 -1
  50. package/dist/app/apps/dashboard/.next/server/app/commands/page_client-reference-manifest.js +1 -1
  51. package/dist/app/apps/dashboard/.next/server/app/cron/page/server-reference-manifest.json +1 -1
  52. package/dist/app/apps/dashboard/.next/server/app/cron/page.js.nft.json +1 -1
  53. package/dist/app/apps/dashboard/.next/server/app/cron/page_client-reference-manifest.js +1 -1
  54. package/dist/app/apps/dashboard/.next/server/app/files/page.js.nft.json +1 -1
  55. package/dist/app/apps/dashboard/.next/server/app/files/page_client-reference-manifest.js +1 -1
  56. package/dist/app/apps/dashboard/.next/server/app/fleet-map/page.js.nft.json +1 -1
  57. package/dist/app/apps/dashboard/.next/server/app/fleet-map/page_client-reference-manifest.js +1 -1
  58. package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page.js +1 -1
  59. package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page.js.nft.json +1 -1
  60. package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page_client-reference-manifest.js +1 -1
  61. package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page.js.nft.json +1 -1
  62. package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page_client-reference-manifest.js +1 -1
  63. package/dist/app/apps/dashboard/.next/server/app/governor/operations/page.js.nft.json +1 -1
  64. package/dist/app/apps/dashboard/.next/server/app/governor/operations/page_client-reference-manifest.js +1 -1
  65. package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page.js.nft.json +1 -1
  66. package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page_client-reference-manifest.js +1 -1
  67. package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page.js.nft.json +1 -1
  68. package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page_client-reference-manifest.js +1 -1
  69. package/dist/app/apps/dashboard/.next/server/app/hermes-security/page.js.nft.json +1 -1
  70. package/dist/app/apps/dashboard/.next/server/app/hermes-security/page_client-reference-manifest.js +1 -1
  71. package/dist/app/apps/dashboard/.next/server/app/incidents/page.js.nft.json +1 -1
  72. package/dist/app/apps/dashboard/.next/server/app/incidents/page_client-reference-manifest.js +1 -1
  73. package/dist/app/apps/dashboard/.next/server/app/library/page.js.nft.json +1 -1
  74. package/dist/app/apps/dashboard/.next/server/app/library/page_client-reference-manifest.js +1 -1
  75. package/dist/app/apps/dashboard/.next/server/app/login/page.js.nft.json +1 -1
  76. package/dist/app/apps/dashboard/.next/server/app/login/page_client-reference-manifest.js +1 -1
  77. package/dist/app/apps/dashboard/.next/server/app/logs/page.js.nft.json +1 -1
  78. package/dist/app/apps/dashboard/.next/server/app/logs/page_client-reference-manifest.js +1 -1
  79. package/dist/app/apps/dashboard/.next/server/app/mission-control/page.js +1 -1
  80. package/dist/app/apps/dashboard/.next/server/app/mission-control/page.js.nft.json +1 -1
  81. package/dist/app/apps/dashboard/.next/server/app/mission-control/page_client-reference-manifest.js +1 -1
  82. package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page.js.nft.json +1 -1
  83. package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page_client-reference-manifest.js +1 -1
  84. package/dist/app/apps/dashboard/.next/server/app/nodes/page.js.nft.json +1 -1
  85. package/dist/app/apps/dashboard/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
  86. package/dist/app/apps/dashboard/.next/server/app/notifications/page.js.nft.json +1 -1
  87. package/dist/app/apps/dashboard/.next/server/app/notifications/page_client-reference-manifest.js +1 -1
  88. package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page.js.nft.json +1 -1
  89. package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page_client-reference-manifest.js +1 -1
  90. package/dist/app/apps/dashboard/.next/server/app/orchestra/page.js.nft.json +1 -1
  91. package/dist/app/apps/dashboard/.next/server/app/orchestra/page_client-reference-manifest.js +1 -1
  92. package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page.js.nft.json +1 -1
  93. package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page_client-reference-manifest.js +1 -1
  94. package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page.js.nft.json +1 -1
  95. package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page_client-reference-manifest.js +1 -1
  96. package/dist/app/apps/dashboard/.next/server/app/page.js.nft.json +1 -1
  97. package/dist/app/apps/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
  98. package/dist/app/apps/dashboard/.next/server/app/retention/page.js.nft.json +1 -1
  99. package/dist/app/apps/dashboard/.next/server/app/retention/page_client-reference-manifest.js +1 -1
  100. package/dist/app/apps/dashboard/.next/server/app/roles/page.js.nft.json +1 -1
  101. package/dist/app/apps/dashboard/.next/server/app/roles/page_client-reference-manifest.js +1 -1
  102. package/dist/app/apps/dashboard/.next/server/app/rollouts/page.js.nft.json +1 -1
  103. package/dist/app/apps/dashboard/.next/server/app/rollouts/page_client-reference-manifest.js +1 -1
  104. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page.js.nft.json +1 -1
  105. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page_client-reference-manifest.js +1 -1
  106. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page.js.nft.json +1 -1
  107. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page_client-reference-manifest.js +1 -1
  108. package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page.js.nft.json +1 -1
  109. package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page_client-reference-manifest.js +1 -1
  110. package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page.js.nft.json +1 -1
  111. package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page_client-reference-manifest.js +1 -1
  112. package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page.js.nft.json +1 -1
  113. package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page_client-reference-manifest.js +1 -1
  114. package/dist/app/apps/dashboard/.next/server/app/security-fusion/page.js.nft.json +1 -1
  115. package/dist/app/apps/dashboard/.next/server/app/security-fusion/page_client-reference-manifest.js +1 -1
  116. package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page.js.nft.json +1 -1
  117. package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page_client-reference-manifest.js +1 -1
  118. package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page.js.nft.json +1 -1
  119. package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page_client-reference-manifest.js +1 -1
  120. package/dist/app/apps/dashboard/.next/server/app/skills/page/server-reference-manifest.json +1 -1
  121. package/dist/app/apps/dashboard/.next/server/app/skills/page.js.nft.json +1 -1
  122. package/dist/app/apps/dashboard/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  123. package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page.js.nft.json +1 -1
  124. package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page_client-reference-manifest.js +1 -1
  125. package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page.js.nft.json +1 -1
  126. package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page_client-reference-manifest.js +1 -1
  127. package/dist/app/apps/dashboard/.next/server/app/webhooks/page.js.nft.json +1 -1
  128. package/dist/app/apps/dashboard/.next/server/app/webhooks/page_client-reference-manifest.js +1 -1
  129. package/dist/app/apps/dashboard/.next/server/chunks/ssr/1q96_modules_lucide-react_dist_esm_icons_shield-exclamation-point_mjs_1tkr7n-tgo96-._.js +3 -0
  130. package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__06giq9g4me8eh._.js +1 -1
  131. package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__08sgyyf_y8ab8._.js +1 -1
  132. package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__11pe-l2-ko65_._.js +1 -1
  133. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__0wsvm9s-rtmzo._.js → [root-of-the-server]__1puyk1oobvatz._.js} +1 -1
  134. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__0hkl39n6k8s99._.js → [root-of-the-server]__1qgn9450v696_._.js} +1 -1
  135. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{_1ircn2sooizal._.js → _0_1zoskz6tg4y._.js} +2 -2
  136. package/dist/app/apps/dashboard/.next/server/chunks/ssr/_0caxc2bc6a__r._.js +1 -1
  137. package/dist/app/apps/dashboard/.next/server/chunks/ssr/_0sfwhwcsjtppm._.js +3 -0
  138. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{_0f89fican-_s9._.js → _11ouppxul_ebs._.js} +2 -2
  139. package/dist/app/apps/dashboard/.next/server/chunks/ssr/_1ml_bvfb1fitq._.js +1 -1
  140. package/dist/app/apps/dashboard/.next/server/chunks/ssr/_1oebzzj_en62h._.js +1 -1
  141. package/dist/app/apps/dashboard/.next/server/chunks/ssr/_20ln5i8p8muqj._.js +1 -1
  142. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_0gs_s688kgg1i._.js +2 -2
  143. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_anomalies_page_tsx_1oqqex9du4yhn._.js +1 -1
  144. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_codex_page_tsx_113aas0vmxegr._.js +1 -1
  145. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_cron_page_tsx_1i3duyygc0_tg._.js +1 -1
  146. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_dashboard-client_tsx_0o_8papeie86c._.js +1 -1
  147. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_fleet-readiness_page_tsx_129clnb6oplu7._.js +1 -1
  148. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_governor_operations_page_tsx_1tvdkgil8mlgk._.js +1 -1
  149. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_mission-control_page_tsx_0crgxncex_u3w._.js +1 -1
  150. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_nodes_[nodeId]_page_tsx_1q7fqu18oklzc._.js +1 -1
  151. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_nodes_nodes-client_tsx_0pt4iarhpqbgn._.js +1 -1
  152. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_orchestra_web-gateway_page_tsx_1fz12np0wk27t._.js +1 -1
  153. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_roles_roles-client_tsx_1ivvp_kqt5io0._.js +1 -1
  154. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_skills_page_tsx_0n5zp4xad38in._.js +1 -1
  155. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_components_nodes_tailscale-expiry-alert_tsx_1ll2-i32ej6c2._.js +1 -1
  156. package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_1w0trtqcl9-wn._.js +3 -0
  157. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{node_modules_@xterm_1aplmmrj23vvx._.js → node_modules_@xterm_120daugm414or._.js} +1 -1
  158. package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1z36d7pdfx5zy._.js +3 -0
  159. package/dist/app/apps/dashboard/.next/server/middleware-build-manifest.js +3 -3
  160. package/dist/app/apps/dashboard/.next/server/pages/500.html +1 -1
  161. package/dist/app/apps/dashboard/.next/server/preview-props.json +3 -3
  162. package/dist/app/apps/dashboard/.next/server/server-reference-manifest.js +1 -1
  163. package/dist/app/apps/dashboard/.next/server/server-reference-manifest.json +3 -3
  164. package/dist/app/apps/dashboard/.next/static/chunks/{0diifaom2d_cn.js → 07uou-f2ig2z3.js} +1 -1
  165. package/dist/app/apps/dashboard/.next/static/chunks/0c34_gunccud3.css +2 -0
  166. package/dist/app/apps/dashboard/.next/static/chunks/{3wlr0q6eslb1s.js → 0ibqtgsjczdnv.js} +2 -2
  167. package/dist/app/apps/dashboard/.next/static/chunks/{0jd62jw1t6xu7.js → 0lday6tat45ag.js} +1 -1
  168. package/dist/app/apps/dashboard/.next/static/chunks/{1uj8oezn_z82c.js → 1kjl44-64ume7.js} +1 -1
  169. package/dist/app/apps/dashboard/.next/static/chunks/{2h6o1ta-xcjtp.js → 215cfit1tgz2o.js} +1 -1
  170. package/dist/app/apps/dashboard/.next/static/chunks/{2a69e_72vy07_.js → 23o8zfgrdxuhk.js} +1 -1
  171. package/dist/app/apps/dashboard/.next/static/chunks/{16c5-2kp51fpp.js → 2_wq3vs7ksij9.js} +1 -1
  172. package/dist/app/apps/dashboard/.next/static/chunks/{028ezuxrvvye_.js → 2lk4ailve7631.js} +1 -1
  173. package/dist/app/apps/dashboard/.next/static/chunks/{3153ier_x5pc9.js → 2lulmsr2vjuw5.js} +1 -1
  174. package/dist/app/apps/dashboard/.next/static/chunks/{2qb_oa0x7ddra.js → 2m2mtcd712njt.js} +1 -1
  175. package/dist/app/apps/dashboard/.next/static/chunks/{0s7_jk-g-mgvd.js → 2z81u6bbdg2cn.js} +1 -1
  176. package/dist/app/apps/dashboard/.next/static/chunks/{20pxbw2tl9z3c.js → 323du6s7y2l-o.js} +1 -1
  177. package/dist/app/apps/dashboard/.next/static/chunks/{2p26kwyyzgqph.js → 37pb0l96d03rk.js} +1 -1
  178. package/dist/app/apps/dashboard/.next/static/chunks/3gd78w81m3ouh.js +1 -0
  179. package/dist/app/apps/dashboard/.next/static/chunks/{2p-sasidykf0f.js → 3qq-otw-t-6b0.js} +1 -1
  180. package/dist/app/apps/dashboard/.next/static/chunks/{1hcdglofzkp3n.js → 3y_9v_-9n_gex.js} +1 -1
  181. package/dist/app/apps/dashboard/package.json +8 -8
  182. package/dist/app/apps/dashboard/server.js +1 -1
  183. package/package.json +8 -8
  184. package/dist/app/apps/dashboard/.next/server/chunks/ssr/_0wh_e2bpxcaf4._.js +0 -3
  185. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_138fu3pss1hww._.js +0 -3
  186. package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1wnnq70cs49fi._.js +0 -3
  187. package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_shield-alert_mjs_171qztcjn79hl._.js +0 -3
  188. package/dist/app/apps/dashboard/.next/static/chunks/0fy1-ohtdf-xm.css +0 -2
  189. package/dist/app/apps/dashboard/.next/static/chunks/11d-a975loj77.js +0 -1
  190. /package/dist/app/apps/dashboard/.next/static/{6eytCNzYv1-SVfKHYgOWN → 87A-2Gig81uwP9pLfHdYV}/_buildManifest.js +0 -0
  191. /package/dist/app/apps/dashboard/.next/static/{6eytCNzYv1-SVfKHYgOWN → 87A-2Gig81uwP9pLfHdYV}/_clientMiddlewareManifest.js +0 -0
  192. /package/dist/app/apps/dashboard/.next/static/{6eytCNzYv1-SVfKHYgOWN → 87A-2Gig81uwP9pLfHdYV}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[31184,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(49521),f=a.i(90751),g=a.i(92117),h=a.i(85651),i=a.i(2668),j=a.i(90165),k=a.i(68216),l=a.i(64831);let m={name:"chart-line",size:24,node:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],aliases:["line-chart"]};m.node;let n=(0,l.f)(m);var o=a.i(46997),p=a.i(8387),q=a.i(33470);let r=["1h","6h","24h"];function s({nodeId:a,height:d=180}){let[e,f]=(0,c.useState)("1h"),[g,h]=(0,c.useState)(null),[i,k]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let b=!1;k(!1);let c=async()=>{try{let[c,d]=await Promise.all([o.f.get(`nodes/${a}/health/timeseries?metric=cpu&period=${e}`),o.f.get(`nodes/${a}/health/timeseries?metric=memory&period=${e}`)]);if(b)return;let f=c.data??{timestamps:[],values:[]},g=d.data??{timestamps:[],values:[]},i=new Map;f.timestamps.forEach((a,b)=>{let c=Date.parse(a);i.set(c,{t:c,cpu:f.values[b]??null,mem:null})}),g.timestamps.forEach((a,b)=>{let c=Date.parse(a),d=i.get(c)??{t:c,cpu:null,mem:null};d.mem=g.values[b]??null,i.set(c,d)}),h([...i.values()].sort((a,b)=>a.t-b.t))}catch{b||(h([]),k(!0))}};c();let d=setInterval(()=>void c(),6e4);return()=>{b=!0,clearInterval(d)}},[a,e]),(0,b.jsxs)("div",{className:"flex min-w-0 flex-col","data-testid":"node-metrics-chart",children:[(0,b.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-2",children:[(0,b.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-text-muted",children:"CPU / memory history"}),(0,b.jsx)("div",{role:"group","aria-label":"History period",className:"flex rounded-chip border border-border bg-bg p-0.5",children:r.map(a=>(0,b.jsx)("button",{type:"button",onClick:()=>f(a),"aria-pressed":e===a,className:(0,p.f)("rounded-chip px-2 py-0.5 text-[10px] uppercase tracking-wider transition-colors",e===a?"bg-primary/15 text-primary shadow-[0_0_8px_var(--color-glow)]":"text-text-muted hover:text-text"),children:a},a))})]}),null===g?(0,b.jsx)("div",{className:"skeleton w-full",style:{height:d}}):g.length<2?(0,b.jsx)(j.f,{compact:!0,icon:(0,b.jsx)(n,{className:"h-4 w-4"}),title:i?"History unavailable":"Not enough samples yet",description:i?"The health timeseries endpoint did not answer.":`No health snapshots in the last ${e}.`,tone:i?"warning":"muted",className:"flex-1"}):(0,b.jsx)(q.f,{data:g,xKey:"t",percent:!0,height:d,formatX:a=>new Date(Number(a)).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),series:[{key:"cpu",label:"CPU",tone:"primary"},{key:"mem",label:"Memory",tone:"accent"}]})]})}var t=a.i(33838);let u={name:"shield-off",size:24,node:[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]};u.node;let v=(0,l.f)(u);var w=a.i(58299);function x({metadata:a}){let c=function(a){let b=a;if("string"==typeof a)try{b=JSON.parse(a)}catch{return}return b?.agentSelfUpgrade}(a);return c?c.upgrade?.state==="reverted"?(0,b.jsx)("span",{title:c.upgrade.reason??void 0,children:(0,b.jsxs)(w.t,{variant:"danger",children:[(0,b.jsx)(t.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade to ",c.upgrade.to," reverted"]})}):c.upgrade?.state==="failed"?(0,b.jsx)("span",{title:c.upgrade.reason??void 0,children:(0,b.jsxs)(w.t,{variant:"danger",children:[(0,b.jsx)(t.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade to ",c.upgrade.to," failed"]})}):c.enabled?null:(0,b.jsx)("span",{title:c.reason??void 0,"data-testid":"agent-self-upgrade-off",children:(0,b.jsxs)(w.t,{variant:"default",children:[(0,b.jsx)(v,{className:"mr-1 inline h-3 w-3"}),"Self-upgrade off"]})}):null}var y=a.i(33666),z=a.i(33231),A=a.i(68415),B=a.i(85063),C=a.i(29147),D=a.i(90629),E=a.i(51675),F=a.i(19107),G=a.i(48819),H=a.i(97546),I=a.i(75160),J=a.i(68370),K=a.i(36273),L=a.i(82260),M=a.i(99101),N=a.i(50354),O=a.i(33540);let P={name:"mouse-pointer-click",size:24,node:[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]};P.node;let Q=(0,l.f)(P);var R=a.i(90363),S=a.i(13931),T=a.i(34532),U=a.i(7574),V=a.i(57307),W=a.i(19783),X=a.i(14258),Y=a.i(38688),Z=a.i(36670),$=a.i(90702),_=a.i(13412),aa=a.i(11134),ab=a.i(8311);let ac=[{id:"apt-update",label:"apt update",command:"sudo",args:["apt","update"],icon:(0,b.jsx)(Z.f,{className:"h-3.5 w-3.5"}),variant:"secondary",timeoutSeconds:120},{id:"apt-upgrade",label:"apt upgrade",command:"sudo",args:["apt","upgrade","-y"],icon:(0,b.jsx)(W.f,{className:"h-3.5 w-3.5"}),variant:"secondary",confirm:"This will upgrade all packages on the node. Continue?",timeoutSeconds:300},{id:"magnus-status",label:"magnus status",command:"systemctl",args:["status","magnus-agent","--no-pager"],icon:(0,b.jsx)(Y.f,{className:"h-3.5 w-3.5"}),variant:"primary",timeoutSeconds:15},{id:"magnus-update",label:"magnus update",command:"sudo",args:["systemctl","restart","magnus-agent"],icon:(0,b.jsx)(X.f,{className:"h-3.5 w-3.5"}),variant:"secondary",confirm:"This will restart the Magnus agent. Continue?",timeoutSeconds:30},{id:"dmesg",label:"dmesg",command:"sudo",args:["dmesg","--time-format=reltime","-T"],icon:(0,b.jsx)($.f,{className:"h-3.5 w-3.5"}),variant:"secondary",timeoutSeconds:15},{id:"reboot",label:"Reboot",command:"sudo",args:["reboot"],icon:(0,b.jsx)(S.f,{className:"h-3.5 w-3.5"}),variant:"danger",confirm:"Are you sure you want to REBOOT this node? It will go offline temporarily.",timeoutSeconds:10}];function ad({nodeId:a,nodeStatus:d}){let[e,f]=(0,c.useState)(!1),[g,h]=(0,c.useState)(!1),[i,j]=(0,c.useState)(null),[k,l]=(0,c.useState)(null),[m,n]=(0,c.useState)(null),p="ONLINE"!==d,q=async b=>{if(!b.confirm||confirm(b.confirm)){j(b),l(null),n(null),h(!0),f(!0);try{let c=await o.f.quickCommand.exec(a,{command:b.command,args:b.args,timeoutSeconds:b.timeoutSeconds});l(c.data)}catch(a){n(a instanceof Error?a.message:"Command execution failed")}finally{h(!1)}}};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"rounded border border-border bg-surface p-3",children:(0,b.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-text-muted mr-2",children:[(0,b.jsx)(V.f,{className:"h-4 w-4"}),(0,b.jsx)("span",{className:"font-bold uppercase tracking-wider",children:"Quick Commands"})]}),ac.map(a=>(0,b.jsx)(A.K,{variant:a.variant,size:"sm",icon:a.icon,disabled:p,onClick:()=>void q(a),children:a.label},a.id)),p&&(0,b.jsx)("span",{className:"ml-2 text-xs text-text-muted",children:"Node must be ONLINE to run commands"})]})}),(0,b.jsx)(B.n,{open:e,onClose:()=>f(!1),title:i?.label??"Command",description:i?`${i.command} ${(i.args??[]).join(" ")}`:void 0,icon:(0,b.jsx)(V.f,{className:"h-5 w-5 text-primary"}),className:"max-w-3xl",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("div",{className:"flex items-center gap-2",children:g?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(I.f,{className:"h-4 w-4 animate-spin text-primary"}),(0,b.jsx)("span",{className:"text-xs text-primary",children:"Executing…"})]}):m?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(aa.f,{className:"h-4 w-4 text-danger"}),(0,b.jsx)("span",{className:"text-xs text-danger",children:"Error"})]}):k?(0,b.jsxs)(b.Fragment,{children:[0===k.exitCode?(0,b.jsx)(_.f,{className:"h-4 w-4 text-success"}):(0,b.jsx)(aa.f,{className:"h-4 w-4 text-danger"}),(0,b.jsxs)("span",{className:`text-xs ${0===k.exitCode?"text-success":"text-danger"}`,children:["Exit code: ",k.exitCode]}),(0,b.jsxs)("span",{className:"text-xs text-text-muted flex items-center gap-1 ml-auto",children:[(0,b.jsx)(ab.f,{className:"h-3 w-3"}),(k.durationMs/1e3).toFixed(2),"s"]})]}):null}),m&&(0,b.jsx)("div",{className:"rounded bg-danger/10 border border-danger/30 p-3",children:(0,b.jsx)("p",{className:"text-xs text-danger",children:m})}),k&&(0,b.jsxs)("div",{className:"space-y-3",children:[k.stdout&&(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[11px] font-bold uppercase tracking-wider text-text-muted mb-1",children:"stdout"}),(0,b.jsx)("pre",{className:"max-h-80 overflow-auto rounded bg-bg border border-border p-3 text-xs text-success whitespace-pre-wrap",children:k.stdout})]}),k.stderr&&(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[11px] font-bold uppercase tracking-wider text-text-muted mb-1",children:"stderr"}),(0,b.jsx)("pre",{className:"max-h-40 overflow-auto rounded bg-bg border border-danger/20 p-3 text-xs text-danger whitespace-pre-wrap",children:k.stderr})]}),!k.stdout&&!k.stderr&&(0,b.jsx)("p",{className:"text-xs text-text-muted italic",children:"No output captured"}),k.truncated&&(0,b.jsx)("p",{className:"text-xs text-warning",children:"⚠ Output was truncated (exceeded 1MB)"})]}),g&&(0,b.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,b.jsxs)("div",{className:"text-center",children:[(0,b.jsx)(I.f,{className:"h-8 w-8 animate-spin text-primary mx-auto mb-2"}),(0,b.jsx)("p",{className:"text-xs text-text-muted",children:"Executing command on remote node…"})]})}),(0,b.jsx)("div",{className:"flex justify-end pt-2",children:(0,b.jsx)(A.K,{variant:"ghost",size:"sm",onClick:()=>f(!1),children:"Close"})})]})})]})}var ae=a.i(83375),af=a.i(86708);let ag={workhorse:{name:"Workhorse",emoji:"🐴",description:"Steady, reliable, never complains.",accent:"success"},"drama-queen":{name:"Drama Queen",emoji:"🎭",description:"High variance, loves spiking CPU for attention.",accent:"warning"},"zen-master":{name:"Zen Master",emoji:"🧘",description:"Low usage, mind always clear, never stressed.",accent:"info"},sprinter:{name:"Sprinter",emoji:"⚡",description:"Bursts of intense activity followed by calm recovery.",accent:"info"},groundhog:{name:"Groundhog",emoji:"🌀",description:"Keeps rebooting — might see its own shadow again.",accent:"warning"},ghost:{name:"Ghost",emoji:"👻",description:"Often unreachable. Is it even there?",accent:"danger"},marathoner:{name:"Marathoner",emoji:"🏃",description:"Long uptime, steady pace, built to last.",accent:"success"},rookie:{name:"Rookie",emoji:"🌱",description:"Not enough history yet — still finding its rhythm.",accent:"default"}};function ah(a){return 0===a.length?0:a.reduce((a,b)=>a+b,0)/a.length}function ai({node:a}){let[d,f]=(0,c.useState)([]),[g,h]=(0,c.useState)(!0),[i,j]=(0,c.useState)(null),[k,l]=(0,c.useState)(0);(0,c.useEffect)(()=>{let b=!1;return(async()=>{h(!0),j(null);try{let c=await o.f.get(`nodes/${a.id}/health/history?limit=100`);if(b)return;let d=c.data,e=[];Array.isArray(d)?e=d:d?.items&&(e=d.items),f([...e].reverse())}catch(a){b||(f([]),j(a instanceof Error?a.message:"Failed to load history"))}finally{b||h(!1)}})(),()=>{b=!0}},[a.id,k]);let m=(0,c.useMemo)(()=>{let b,c,e,f,g,h,i,j,k;return b=d.map(a=>a.cpuUsagePercent).filter(a=>Number.isFinite(a)),c=d.map(a=>a.memoryPercent).filter(a=>Number.isFinite(a)),e=ah(b),f=function(a){if(a.length<2)return 0;let b=ah(a);return Math.sqrt(a.reduce((a,c)=>a+(c-b)*(c-b),0)/(a.length-1))}(b),g=ah(c),h=b.filter(a=>a>80).length,i="rookie",j=ag[i="OFFLINE"===a.status||a.lastHeartbeatAt&&Date.now()-new Date(a.lastHeartbeatAt).getTime()>6e5?"ghost":d.length<3?"rookie":f>25||h/Math.max(1,b.length)>.25?h/Math.max(1,b.length)>.4?"drama-queen":"sprinter":e<15&&f<10?"zen-master":e>40&&e<75&&f<15?"workhorse":e<40&&f<15&&d.length>20?"marathoner":"workhorse"]??ag.rookie??{name:"Rookie",emoji:"🌱",description:"",accent:"default"},k=function(a,b,c){var d;let e,f=Math.floor(Date.now()/6048e5);for(let b=0;b<a.id.length;b++)f=31*f+a.id.charCodeAt(b)|0;let g={workhorse:[`Steady as they come — averaging ${c.cpuAvg.toFixed(0)}% CPU without a single complaint this week.`,`The dependable one. ${a.hostname} just keeps grinding through the workload.`,`Quietly productive at ~${c.cpuAvg.toFixed(0)}% CPU. Gets the job done and asks for nothing.`],"drama-queen":[`Lives for the spotlight — ${c.spikes} CPU spikes this week and counting.`,`${a.hostname} likes to keep things interesting with a \xb1${c.cpuSD.toFixed(0)}% swing.`,"A connoisseur of chaos. Never a dull moment with this one."],"zen-master":[`Practices minimalism. Barely breaks a sweat at ${c.cpuAvg.toFixed(0)}% CPU.`,`${a.hostname} is in its happy place — calm, cool, collected.`,"Achieving enlightenment one idle cycle at a time."],sprinter:[`Bursts of energy, then recovery. ${c.spikes} sprints logged this week.`,`${a.hostname} runs hot, then cools down. Classic sprinter cadence.`,"Lives in intervals — full throttle, then full zen."],groundhog:["Déjà vu all over again. Might want to check the uptime.",`${a.hostname} keeps hitting the reset button.`],ghost:["Hasn't been seen in a while. Anyone home?",`${a.hostname} is currently out of contact. Check the heartbeat.`],marathoner:[`In it for the long haul — ${c.samples} data points of pure consistency.`,`${a.hostname} doesn't sprint. It endures.`],rookie:["Still new around here — gathering experience.",`${a.hostname} is just getting started. Check back soon.`]};return e=Math.abs(f)%(d=g[b.name.toLowerCase().replace(" ","-")]??g.rookie??["…"]).length,d[e]}(a,j,{cpuAvg:e,cpuSD:f,memAvg:g,samples:b.length,spikes:h}),{archetype:j,archetypeKey:i,bio:k,stats:{cpuAvg:e,cpuStdDev:f,memAvg:g,samples:b.length,spikes:h}}},[a,d]),n=d.map(a=>a.cpuUsagePercent).slice(-40),p=d.map(a=>a.memoryPercent).slice(-40);return(0,b.jsx)(e.N,{title:"Personality",action:(0,b.jsx)("button",{onClick:()=>l(a=>a+1),className:"text-text-muted hover:text-text transition p-1",title:"Refresh personality","data-testid":"node-personality-refresh",children:(0,b.jsx)(W.f,{className:"h-3.5 w-3.5"})}),children:(0,b.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"node-personality-card","data-archetype":m.archetypeKey,children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("span",{className:"flex h-12 w-12 items-center justify-center rounded-full border border-accent/40 bg-bg text-2xl shadow-[0_0_16px_var(--color-glow-accent)]","aria-hidden":"true",children:m.archetype.emoji}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{"data-testid":"node-archetype-badge",children:(0,b.jsx)(w.t,{variant:m.archetype.accent,children:m.archetype.name})}),g&&(0,b.jsx)("span",{className:"text-xs text-text-muted italic",children:"analyzing…"})]}),(0,b.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:m.archetype.description})]})]}),(0,b.jsx)(af.f,{className:"h-4 w-4 text-accent mt-1"})]}),(0,b.jsxs)("blockquote",{className:"border-l-2 border-accent/40 pl-3 text-sm italic text-text","data-testid":"node-personality-bio",children:["“",m.bio,"”"]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-4 pt-2 border-t border-border/30",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,b.jsx)("span",{className:"text-xs uppercase tracking-wider text-text-muted",children:"CPU trend"}),(0,b.jsxs)("span",{className:"text-xs tabular-nums text-text-muted",children:["avg ",m.stats.cpuAvg.toFixed(0),"%"]})]}),(0,b.jsx)(ae.f,{values:n,tone:"primary",percent:!0,stretch:!0,threshold:80,testId:"node-personality-cpu-sparkline",label:`CPU trend, average ${m.stats.cpuAvg.toFixed(0)}%`})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,b.jsx)("span",{className:"text-xs uppercase tracking-wider text-text-muted",children:"Memory trend"}),(0,b.jsxs)("span",{className:"text-xs tabular-nums text-text-muted",children:["avg ",m.stats.memAvg.toFixed(0),"%"]})]}),(0,b.jsx)(ae.f,{values:p,tone:"accent",percent:!0,stretch:!0,threshold:80,testId:"node-personality-mem-sparkline",label:`Memory trend, average ${m.stats.memAvg.toFixed(0)}%`})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4 text-[11px] text-text-muted",children:[(0,b.jsxs)("span",{children:[m.stats.samples," samples"]}),(0,b.jsxs)("span",{children:["σ ",m.stats.cpuStdDev.toFixed(1),"%"]}),(0,b.jsxs)("span",{children:[m.stats.spikes," spikes"]}),i&&(0,b.jsxs)("span",{className:"text-warning",children:["· ",i]})]})]})})}let aj={name:"fan",size:24,node:[["path",{d:"M10.827 16.379a6.082 6.082 0 0 1-8.618-7.002l5.412 1.45a6.082 6.082 0 0 1 7.002-8.618l-1.45 5.412a6.082 6.082 0 0 1 8.618 7.002l-5.412-1.45a6.082 6.082 0 0 1-7.002 8.618l1.45-5.412Z",key:"484a7f"}],["path",{d:"M12 12v.01",key:"u5ubse"}]]};aj.node;let ak=(0,l.f)(aj);var al=a.i(6024);let am={name:"thermometer",size:24,node:[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]};am.node;let an=(0,l.f)(am);function ao(a,b){let c=a.map(a=>({timestamp:new Date(a.sampledAt).getTime(),value:b(a)})).filter(a=>null!==a.value);if(0===c.length)return"";let d=c[0].timestamp,e=Math.max(1,c.at(-1).timestamp-d);return c.map(({timestamp:a,value:b})=>{let c=104-.88*Math.max(0,Math.min(100,b));return`${((a-d)/e*600).toFixed(1)},${c.toFixed(1)}`}).join(" ")}function ap(a,b="%"){return null===a?"not reported":`${a.toFixed(1)}${b}`}function aq({telemetry:a}){let c=a?.latest??null,d=c?.devices??[],f=ao(a?.history??[],a=>a.maxUtilizationPercent),g=ao(a?.history??[],a=>a.maxFanPercent);return(0,b.jsx)(e.N,{title:"GPU telemetry",description:"30-second load and cooling history",action:c?(0,b.jsxs)(w.t,{variant:"default",children:["sampled ",(0,C.C)(c.sampledAt)]}):void 0,children:c&&0!==d.length?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:d.map(a=>(0,b.jsxs)("div",{className:"rounded-panel border border-border/70 bg-surface-raised/60 p-3 transition-colors hover:border-primary/30",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"truncate text-xs font-medium text-text",children:a.name}),(0,b.jsxs)("p",{className:"mt-0.5 text-[10px] uppercase tracking-wide text-text-muted",children:[a.vendor," · gpu ",a.index]})]}),100===a.fanPercent&&(0,b.jsx)(w.t,{variant:"danger",children:"fan saturated"})]}),(0,b.jsxs)("dl",{className:"mt-3 grid grid-cols-3 gap-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,b.jsx)(al.f,{className:"h-3 w-3"}),"Load"]}),(0,b.jsx)("dd",{className:"mt-1 num text-sm text-primary",children:ap(a.utilizationPercent)})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,b.jsx)(ak,{className:"h-3 w-3"}),"Fan"]}),(0,b.jsx)("dd",{className:`mt-1 num text-sm ${100===a.fanPercent?"text-danger glow-text-danger":"text-warning"}`,children:ap(a.fanPercent)})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,b.jsx)(an,{className:"h-3 w-3"}),"Temp"]}),(0,b.jsx)("dd",{className:"mt-1 num text-sm text-text",children:ap(a.temperatureCelsius,"°C")})]})]}),(0,b.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,b.jsx)(h.f,{value:a.utilizationPercent,tone:"primary",label:`${a.name} load`}),(0,b.jsx)(h.f,{value:a.fanPercent,thresholds:{warn:80,crit:100},label:`${a.name} fan`})]})]},`${a.vendor}-${a.uuid??a.index}`))}),(0,b.jsxs)("div",{className:"panel-corners rounded-panel border border-border/70 bg-bg/60 p-3",children:[(0,b.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[(0,b.jsx)("p",{className:"text-[10px] font-medium uppercase tracking-[0.16em] text-text-muted",children:"Host maximum · last 24 hours"}),(0,b.jsxs)("div",{className:"flex items-center gap-3 text-[10px] text-text-muted",children:[(0,b.jsxs)("span",{className:"flex items-center gap-1",children:[(0,b.jsx)("span",{className:"h-0.5 w-3 bg-primary shadow-[0_0_4px_var(--color-primary)]"}),"load"]}),(0,b.jsxs)("span",{className:"flex items-center gap-1",children:[(0,b.jsx)("span",{className:"h-0.5 w-3 bg-warning"}),"fan"]})]})]}),(0,b.jsxs)("svg",{viewBox:"0 0 600 112",className:"h-28 w-full",role:"img","aria-label":"GPU load and fan percentage over the last 24 hours",children:[(0,b.jsx)("line",{x1:"0",y1:"16",x2:"600",y2:"16",stroke:"var(--color-danger)",strokeOpacity:"0.45",strokeDasharray:"5 5"}),(0,b.jsx)("line",{x1:"0",y1:"60",x2:"600",y2:"60",stroke:"currentColor",strokeOpacity:"0.12"}),(0,b.jsx)("line",{x1:"0",y1:"104",x2:"600",y2:"104",stroke:"currentColor",strokeOpacity:"0.2"}),(0,b.jsx)("defs",{children:(0,b.jsxs)("linearGradient",{id:"gpu-load-fill",x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,b.jsx)("stop",{offset:"0%",stopColor:"var(--color-primary)",stopOpacity:"0.35"}),(0,b.jsx)("stop",{offset:"100%",stopColor:"var(--color-primary)",stopOpacity:"0"})]})}),f&&(0,b.jsx)("polygon",{points:`0,104 ${f} 600,104`,fill:"url(#gpu-load-fill)"}),f&&(0,b.jsx)("polyline",{points:f,fill:"none",stroke:"var(--color-primary)",strokeWidth:"2",vectorEffect:"non-scaling-stroke"}),g&&(0,b.jsx)("polyline",{points:g,fill:"none",stroke:"var(--color-warning)",strokeWidth:"2",vectorEffect:"non-scaling-stroke"})]}),(0,b.jsxs)("div",{className:"mt-1 flex justify-between num text-[9px] text-text-muted",children:[(0,b.jsx)("span",{children:"24h ago"}),(0,b.jsx)("span",{children:"100% saturation line"}),(0,b.jsx)("span",{children:"now"})]})]})]}):(0,b.jsx)("div",{className:"rounded-panel border border-dashed border-border px-4 py-6 text-center text-xs text-text-muted",children:c?.status==="error"?"The GPU probe did not complete. Magnus will retry on the next heartbeat.":"No supported NVIDIA or AMD GPU was detected in the latest sample."})})}function ar(a){if("string"==typeof a)try{return JSON.parse(a)}catch{return[]}return a??[]}function as(a){if(!a)return[];if("string"==typeof a)try{return JSON.parse(a)}catch{return[]}return a}function at(a){return!!(a&&"not_installed"!==a.status)}function au(a){let b=a.status.toLowerCase();return b.includes("enabled")&&!b.includes("not enabled")&&!b.includes("disabled")}function av(a,b){let c=a.filter(au).find(a=>{let c=`${a.slug} ${a.pluginType} ${a.metadata?.description??""}`.toLowerCase();return"search"===b?/\b(search|web)\b/.test(c):/\b(crawl|browser|firecrawl|browserbase|browser-use)\b/.test(c)});return c?`${c.slug}${c.version?` ${c.version}`:""}`:"none enabled"}a.s(["default",0,function(){var a,l;let m,n,p,q=(0,d.useParams)(),r=(0,d.useRouter)(),[t,u]=(0,c.useState)(null),[v,P]=(0,c.useState)(null),[V,W]=(0,c.useState)([]),[X,Y]=(0,c.useState)(null),[Z,$]=(0,c.useState)(!0),[_,aa]=(0,c.useState)(!1),[ab,ac]=(0,c.useState)(!1),[ae,af]=(0,c.useState)([]),[ag,ah]=(0,c.useState)({}),[aj,ak]=(0,c.useState)(null),[al,am]=(0,c.useState)(!1),[an,ao]=(0,c.useState)(null),[ap,au]=(0,c.useState)(null),[aw,ax]=(0,c.useState)(null),[ay,az]=(0,c.useState)(!1),[aA,aB]=(0,c.useState)(null),[aC,aD]=(0,c.useState)(!1),[aE,aF]=(0,c.useState)(!1),[aG,aH]=(0,c.useState)(null),[aI,aJ]=(0,c.useState)(!1),[aK,aL]=(0,c.useState)(null),[aM,aN]=(0,c.useState)(null),[aO,aP]=(0,c.useState)(!1),aQ=(0,c.useRef)(null),aR=(0,c.useRef)(void 0),aS=(0,c.useCallback)(async(a=!1)=>{try{a||$(!0);let[b,c,d,e,f]=await Promise.all([o.f.nodes.get(q.nodeId),o.f.nodes.health(q.nodeId).catch(()=>null),o.f.nodes.forecast(q.nodeId).catch(()=>null),o.f.hermes.installations().catch(()=>null),o.f.nodes.gpu(q.nodeId).catch(()=>null)]),g=b.data;g.role||void 0===aR.current?g.role&&(aR.current=g.role):g.role=aR.current,u(g),c&&P(c.data),W(d?.data?.forecasts??[]),Y(f?.data??null);let h=e?.data??[];ak(h.find(a=>a.nodeId===g.id)??h.find(a=>a.hostname===g.hostname||a.hostname===g.ipAddress)??null);try{let a=await o.f.roles.applications.list({nodeId:q.nodeId});af(a.data??[])}catch{}}catch{}finally{a||$(!1)}},[q.nodeId]);(0,c.useEffect)(()=>{aS()},[aS]);let aT=async()=>{if(t&&confirm(`Deploy Hermes Agent to "${t.name}"?`)){aJ(!0),aL(null),aN(null);try{let a,b=await o.f.hermes.deploy({nodeId:t.id,hermesHome:"~/.hermes",hermesBin:"hermes",installMethod:"official-script",dashboardPort:9119,enableDashboard:!0,enableDashboardTui:!0,startGateway:!0},(a="u">typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2),`hermes-node-deploy-${Date.now()}-${a}`));aL(`Hermes Agent deployment started. Job ${b.data?.id.slice(0,10)}...`),aS(!0)}catch(a){aN(a instanceof Error?a.message:"Hermes Agent deployment failed")}finally{aJ(!1)}}};(0,c.useEffect)(()=>{let a=t?.status==="PROVISIONING"||t?.agent?.status==="UPDATING"||!!(aK&&!at(aj));return a&&!aQ.current?aQ.current=setInterval(()=>{aS(!0)},4e3):!a&&aQ.current&&(clearInterval(aQ.current),aQ.current=null),()=>{aQ.current&&(clearInterval(aQ.current),aQ.current=null)}},[t?.status,t?.agent?.status,t?.agent?.version,aS,aK,aj]);let aU=async()=>{if(t&&confirm(`Delete node "${t.name}"? This will permanently remove it and all associated data.`))try{await o.f.nodes.delete(t.id),r.push("/nodes")}catch{}},aV=(0,c.useCallback)(async()=>{if(t?.status==="ONLINE"){am(!0),ao(null);try{let a='version_or_na() { local cmd="$1"; shift; if command -v "$cmd" >/dev/null 2>&1; then ("$@" 2>/dev/null || "$cmd" --version 2>/dev/null || "$cmd" -v 2>/dev/null || echo "unknown") | head -n 1; else echo "not installed"; fi; }; echo "node=$(version_or_na node node --version)"; echo "npm=$(version_or_na npm npm --version)"; echo "python3=$(version_or_na python3 python3 --version)"; echo "redis=$(version_or_na redis-cli redis-cli --version)"; echo "docker=$(version_or_na docker docker --version)"; echo "tailscale=$(version_or_na tailscale tailscale version)"; agent_manifest=/opt/magnus-agent/node_modules/@hivemagnus/magnus-agent/package.json; [ -f "$agent_manifest" ] || agent_manifest=/opt/magnus-agent/package.json; if [ -f "$agent_manifest" ]; then echo "magnus-agent=$(node -e \'process.stdout.write(require(process.argv[1]).version)\' "$agent_manifest" 2>/dev/null || echo unknown)"; else echo "magnus-agent=not installed"; fi'.replace(/'/g,"'\\''"),b=((await o.f.quickCommand.exec(t.id,{command:`bash -lc '${a}'`,args:[],timeoutSeconds:60})).data.stdout??"").trim(),c=Object.fromEntries(b.split("\n").map(a=>a.trim()).filter(a=>a.includes("=")).map(a=>{let[b,...c]=a.split("=");return[b,c.join("=").trim()||"unknown"]}));ah(c)}catch(a){ao(a instanceof Error?a.message:"Failed to load software revisions")}finally{am(!1)}}},[t?.id,t?.status]),aW=(0,c.useCallback)(async()=>{if(t?.status==="ONLINE"){az(!0),aB(null);try{let a="set -euo pipefail; (sudo apt-get update -qq || apt-get update -qq) >/dev/null 2>&1; apt list --upgradable 2>/dev/null | sed '1d' | sed '/^Listing/d' | wc -l".replace(/'/g,"'\\''"),b=((await o.f.quickCommand.exec(t.id,{command:`bash -lc '${a}'`,args:[],timeoutSeconds:180})).data.stdout??"").trim(),c=Number.parseInt(b.split("\n").at(-1)??"",10);au(Number.isFinite(c)?c:null),ax(new Date().toISOString())}catch(a){aB(a instanceof Error?a.message:"Failed to refresh apt updates")}finally{az(!1)}}},[t?.id,t?.status]),aX=async()=>{if(t&&confirm(`Run apt upgrade on "${t.name}"?`)){aD(!0);try{let a=`apt-upgrade-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,b=(await o.f.commands.dispatch({nodeIds:[t.id],command:"sudo",args:["apt","upgrade","-y"],timeoutSeconds:1800,idempotencyKey:a},a)).data,c=b.commands?.[0]?.id;alert(c?`APT Upgrade dispatched (command ${c.slice(0,12)}…). Check Commands for progress.`:"APT Upgrade dispatched. Check Commands for progress."),await aW()}catch(a){alert(`APT Upgrade failed to dispatch: ${a instanceof Error?a.message:String(a)}`)}finally{aD(!1)}}},aY=async()=>{if(t&&confirm(`Enable unattended apt update and apt upgrade on "${t.name}"? Magnus will install unattended-upgrades and enable the apt timers.`)){aF(!0),aH(null);try{await o.f.nodes.enableSystemUpdates(t.id),await aS(!0)}catch(a){aH(a instanceof Error?a.message:"Failed to enable automatic updates")}finally{aF(!1)}}};if((0,c.useEffect)(()=>{aV(),aW()},[aV,aW]),(0,c.useEffect)(()=>{if(!t||"ONLINE"!==t.status)return;let a=setInterval(()=>{aW()},36e5);return()=>clearInterval(a)},[t,aW]),Z)return(0,b.jsxs)("div",{className:"space-y-6","aria-busy":"true",children:[(0,b.jsx)("div",{className:"skeleton h-56 w-full rounded-panel opacity-70"}),(0,b.jsx)(k.g,{}),(0,b.jsx)("span",{className:"sr-only",children:"Loading node details…"})]});if(!t)return(0,b.jsx)(j.f,{tone:"accent",icon:(0,b.jsx)(T.f,{className:"h-5 w-5"}),title:"Node not found",description:"It may have been decommissioned or belong to another control node.",action:(0,b.jsx)(A.K,{variant:"secondary",size:"sm",onClick:()=>r.push("/nodes"),children:"Back to nodes"}),className:"mt-12"});let aZ=at(aj)?Array.isArray(aj.rawStatus?.skills)?aj.rawStatus.skills:[]:[],a$=at(aj)?Array.isArray(aj.rawStatus?.plugins)?aj.rawStatus.plugins:[]:[],a_=aZ.filter(a=>a.enabled),a0=aj?.configuration?.modelProvider??"unknown",a1=aj?.configuration?.modelName??"unknown",a2=av(a$,"search"),a3=av(a$,"crawl"),a4=function(a){if(!a)return null;try{let b="string"==typeof a?JSON.parse(a):a;if("boolean"!=typeof b.installed||!["active","inactive","failed","not_installed","unknown"].includes(b.serviceStatus)||!["enabled","disabled","static","unknown"].includes(b.enabled)||null!==b.version&&"string"!=typeof b.version||!Array.isArray(b.managerAddresses))return null;return b}catch{return null}}(v?.wazuh),a5=function(a){if(!a)return null;try{let b="string"==typeof a?JSON.parse(a):a;if("boolean"!=typeof b.supported||"string"!=typeof b.platform||!["enabled","disabled","partial","unsupported","unknown"].includes(b.automaticUpdates??"")||"boolean"!=typeof b.rebootRequired||!Array.isArray(b.timers)||!Array.isArray(b.rebootRequiredPackages))return null;return{...b,fullUpgradePolicyEnabled:!0===b.fullUpgradePolicyEnabled}}catch{return null}}(v?.systemUpdates);return(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)(f.f,{hero:!0,padding:"lg",tone:"ONLINE"===t.status?"primary":"OFFLINE"===t.status?"danger":"warning",testId:"node-cockpit",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,b.jsx)(A.K,{variant:"ghost",size:"sm",onClick:()=>r.push("/nodes"),"aria-label":"Back to nodes",children:(0,b.jsx)(F.f,{className:"h-4 w-4"})}),(0,b.jsx)(i.f,{status:t.status}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h1",{className:"truncate text-2xl font-bold text-primary glow-text-primary",children:t.name}),(0,b.jsxs)("p",{className:"num mt-1 truncate text-xs text-text-muted",children:[t.hostname,":",t.port,t.agent&&(0,b.jsxs)("span",{className:"ml-3 text-primary/70",children:["agent v",t.agent.version]}),v?.source&&(0,b.jsxs)("span",{className:"ml-3 uppercase tracking-wider",children:["source: ",v.source]})]})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)(w.t,{variant:(0,w.k)(t.status),children:t.status}),t.agent?.status==="UPDATING"&&(0,b.jsxs)(w.t,{variant:"info",children:[(0,b.jsx)(I.f,{className:"h-3 w-3 animate-spin mr-1 inline"}),"Upgrading…"]}),(0,b.jsx)(x,{metadata:t.metadata}),(0,b.jsx)(y.x,{readiness:t.upgradeReadiness}),(0,b.jsx)(A.K,{variant:"secondary",size:"sm",icon:(0,b.jsx)(D.f,{className:"h-3.5 w-3.5"}),onClick:()=>aa(!0),children:"Edit"}),(0,b.jsx)(A.K,{variant:"danger",size:"sm",icon:(0,b.jsx)(E.f,{className:"h-3.5 w-3.5"}),onClick:()=>void aU(),children:"Delete"})]})]}),t.upgradeReadiness?.status==="not-ready"&&(0,b.jsx)("div",{className:"mt-4",children:(0,b.jsx)(y.a,{readiness:t.upgradeReadiness})}),(0,b.jsxs)("div",{className:"mt-6 grid gap-6 xl:grid-cols-[auto_minmax(0,1fr)]",children:[(0,b.jsxs)("div",{className:"flex flex-wrap justify-center gap-4 sm:justify-start",children:[(0,b.jsx)(g.f,{value:v?.cpuUsagePercent??null,label:"CPU Usage",size:128,testId:"node-gauge-cpu"}),(0,b.jsx)(g.f,{value:v?.memoryPercent??null,label:"Memory",size:128,sublabel:v?`${(0,C.L)(v.memoryUsedBytes)}`:void 0,testId:"node-gauge-memory"}),(p=(v?ar(v.disks):[]).reduce((a,b)=>!a||b.usagePercent>a.usagePercent?b:a,null),(0,b.jsx)(g.f,{value:p?.usagePercent??null,label:"Disk",size:128,thresholds:{warn:80,crit:90},sublabel:p?.mountPoint,testId:"node-gauge-disk"}))]}),(0,b.jsx)(s,{nodeId:t.id,height:170})]})]}),("DEGRADED"===t.status||t.agent?.status==="ERROR")&&(()=>{try{let a=JSON.parse(t.metadata),c="string"==typeof a.deployError?a.deployError:null,d="string"==typeof a.upgradeError?a.upgradeError:null,e=c??d;if(e)return(0,b.jsx)("div",{className:"rounded-panel border border-danger/40 bg-danger/5 p-4 shadow-[inset_3px_0_0_var(--color-danger),0_0_20px_var(--color-glow-danger)]",children:(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)(H.f,{className:"h-5 w-5 text-danger shrink-0 mt-0.5"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-sm font-medium text-danger",children:c?"Deploy Failed":"Agent Upgrade Failed"}),(0,b.jsx)("pre",{className:"mt-1 text-xs text-text-muted whitespace-pre-wrap font-mono",children:e})]})]})})}catch{}return null})(),"PROVISIONING"===t.status&&(0,b.jsx)("div",{className:"rounded-panel border border-info/40 bg-info/5 p-4 shadow-[inset_3px_0_0_var(--color-info)]",children:(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)(I.f,{className:"h-5 w-5 text-info animate-spin"}),(0,b.jsx)("p",{className:"text-xs uppercase tracking-wider text-info",children:"Deploying agent… Status will update automatically."})]})}),t.agent?.status==="UPDATING"&&(0,b.jsx)("div",{className:"rounded-panel border border-info/40 bg-info/5 p-4 shadow-[inset_3px_0_0_var(--color-info)]",children:(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)(I.f,{className:"h-5 w-5 text-info animate-spin"}),(0,b.jsx)("p",{className:"text-xs uppercase tracking-wider text-info",children:"Agent upgrade in progress… Status will update automatically."})]})}),(0,b.jsx)(ad,{nodeId:t.id,nodeStatus:t.status}),(0,b.jsx)(aq,{telemetry:X}),(0,b.jsx)(ai,{node:{id:t.id,name:t.name,hostname:t.hostname,status:t.status,lastHeartbeatAt:t.lastHeartbeatAt}}),(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]",children:[(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)(e.N,{title:"Node Information",children:(0,b.jsxs)("dl",{className:"space-y-2 text-sm",children:[[["OS",t.os],["Architecture",t.arch],["Address",`${t.ipAddress}:${t.port}`],["Tags",(()=>{try{let a=JSON.parse(t.tags);return a.length?a.join(", "):"—"}catch{return"—"}})()]].map(([a,c])=>(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:a}),(0,b.jsx)("dd",{className:"font-medium",children:c})]},a)),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Agent Version"}),(0,b.jsx)("dd",{className:"font-medium flex items-center gap-1.5",children:t.agent?.version??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Role"}),(0,b.jsx)("dd",{className:"font-medium",children:t.role?(0,b.jsxs)("button",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary hover:bg-primary/20 transition-colors cursor-pointer",onClick:()=>ac(!0),title:"Change role",children:[(0,b.jsx)(K.f,{className:"h-3 w-3"}),t.role.name]}):(0,b.jsx)("button",{className:"text-xs text-text-muted hover:text-primary transition-colors cursor-pointer",onClick:()=>ac(!0),children:"+ Assign Role"})})]}),[["Agent Status",t.agent?.status??"—"],["Last Heartbeat",(0,C.C)(t.lastHeartbeatAt)]].map(([a,c])=>(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:a}),(0,b.jsx)("dd",{className:"font-medium",children:c})]},a)),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Cockpit"}),(0,b.jsx)("dd",{className:"font-medium",children:v?.cockpitAvailable?(0,b.jsxs)("a",{href:`https://${t.ipAddress}:9090`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["Available",(0,b.jsx)(J.f,{className:"h-3 w-3"})]}):(0,b.jsx)("span",{className:"text-text-muted",children:"Not Available"})})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"CPU Cores"}),(0,b.jsx)("dd",{className:"font-medium",children:v?.cpuCores??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Memory Used"}),(0,b.jsx)("dd",{className:"font-medium",children:v?`${(0,C.L)(v.memoryUsedBytes)} / ${(0,C.L)(v.memoryTotalBytes)}`:"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Swap Used"}),(0,b.jsx)("dd",{className:"font-medium",children:v&&v.swapTotalBytes?`${(0,C.L)(v.swapUsedBytes??0)} / ${(0,C.L)(v.swapTotalBytes)}`:"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Last Health Sample"}),(0,b.jsx)("dd",{className:"font-medium",children:v?(0,C.C)(v.timestamp):"—"})]})]})}),(0,b.jsx)(e.N,{title:"Hermes Agent",description:at(aj)?aj.displayName??aj.hostname:"No Hermes Agent installed or found",action:at(aj)?(0,b.jsx)(w.t,{variant:(0,w.k)(aj.status),children:aj.status}):void 0,children:at(aj)?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("dl",{className:"grid gap-2 text-sm sm:grid-cols-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Version"}),(0,b.jsx)("dd",{className:"font-mono text-xs",children:aj.version??"unknown"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Home"}),(0,b.jsx)("dd",{className:"font-mono text-xs break-all",children:aj.hermesHome})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Dashboard"}),(0,b.jsxs)("dd",{className:"mt-1 flex items-center gap-2",children:[(0,b.jsx)(w.t,{variant:(0,w.k)(aj.dashboardStatus),children:aj.dashboardStatus}),(0,b.jsx)("span",{className:"font-mono text-xs",children:(n=""===(m=(l=aj).dashboardHost.trim().toLowerCase().replace(/^\[|\]$/g,""))||"0.0.0.0"===m||"127.0.0.1"===m||"localhost"===m||"::"===m||"::1"===m?l.hostname:l.dashboardHost,`${n}:${l.dashboardPort}`)})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Gateway"}),(0,b.jsx)("dd",{className:"mt-1",children:(0,b.jsx)(w.t,{variant:(0,w.k)(aj.gatewayStatus),children:aj.gatewayStatus})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"API Server"}),(0,b.jsx)("dd",{className:"font-mono text-xs",children:aj.apiServerEnabled?`${aj.apiServerHost}:${aj.apiServerPort??"—"}`:"disabled"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Primary Provider"}),(0,b.jsxs)("dd",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[(0,b.jsx)(w.t,{variant:"unknown"===a0?"warning":"success",children:a0}),aj.configuration?.magnusRouterConfigured&&(0,b.jsx)(w.t,{variant:"success",children:"Magnus routed"})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Default Model"}),(0,b.jsx)("dd",{className:"font-mono text-xs break-all",children:a1})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"OpenAI Runtime"}),(0,b.jsx)("dd",{className:"mt-1",children:(0,b.jsx)(w.t,{variant:aj.configuration?.openaiRuntime==="codex_app_server"?"success":"warning",children:aj.configuration?.openaiRuntime==="codex_app_server"?"Codex app-server":"Hermes default"})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Web Search"}),(0,b.jsxs)("dd",{className:"mt-1 flex items-center gap-2 text-xs",children:[(0,b.jsx)(O.f,{className:"h-3.5 w-3.5 text-text-muted"}),(0,b.jsx)("span",{className:"font-mono break-all",children:a2})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Crawling"}),(0,b.jsxs)("dd",{className:"mt-1 flex items-center gap-2 text-xs",children:[(0,b.jsx)(Q,{className:"h-3.5 w-3.5 text-text-muted"}),(0,b.jsx)("span",{className:"font-mono break-all",children:a3})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Memory"}),(0,b.jsxs)("dd",{className:"mt-1",children:[(0,b.jsx)(w.t,{variant:aj.configuration?.hiveMemConfigured?"success":"warning",children:aj.configuration?.memoryProvider??"not configured"}),(0,b.jsx)(z.f,{configuration:aj.configuration})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Skills"}),(0,b.jsx)("dd",{className:"mt-1",children:(0,b.jsxs)("button",{type:"button",onClick:()=>aP(!0),className:"inline-flex items-center gap-1.5 rounded border border-border px-2 py-1 text-xs text-text hover:border-primary/60 hover:text-primary disabled:cursor-not-allowed disabled:opacity-50",disabled:0===aZ.length,children:[(0,b.jsx)(N.f,{className:"h-3.5 w-3.5"}),function(a){if(0===a.length)return"0 synced";let b=a.filter(a=>a.enabled).length;return`${b} enabled / ${a.length} total`}(aZ)]})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Last Sync"}),(0,b.jsx)("dd",{className:"text-xs",children:(0,C.C)(aj.lastSyncedAt)})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[aj.configuration?.modelBaseUrl&&(0,b.jsxs)("p",{className:"text-xs text-text-muted",children:["Base URL: ",(0,b.jsx)("span",{className:"font-mono",children:aj.configuration.modelBaseUrl})]}),aj.configuration?.configPath&&(0,b.jsxs)("p",{className:"text-xs text-text-muted",children:["Config: ",(0,b.jsx)("span",{className:"font-mono",children:aj.configuration.configPath})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(aj.profiles??[]).slice(0,6).map(a=>(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-text-muted",children:[(0,b.jsx)(L.f,{className:"h-3 w-3"}),a.name]},a.id)),(aj.profiles?.length??0)===0&&(0,b.jsx)("span",{className:"text-xs text-text-muted",children:"No profiles synced"})]}),(0,b.jsx)(A.K,{size:"sm",variant:"secondary",icon:(0,b.jsx)(J.f,{className:"h-3.5 w-3.5"}),onClick:()=>r.push(`/orchestra/web-gateway?installationId=${encodeURIComponent(aj.id)}`),children:"Open Dashboard"})]}):(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("p",{className:"text-sm text-text-muted",children:"No Hermes Agent is installed or currently detected on this node."}),aK&&(0,b.jsx)("p",{className:"text-xs text-success",children:aK}),aM&&(0,b.jsx)("p",{className:"text-xs text-danger",children:aM}),(0,b.jsx)(A.K,{size:"sm",variant:"secondary",icon:aI?(0,b.jsx)(I.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(M.f,{className:"h-3.5 w-3.5"}),disabled:!t||"ONLINE"!==t.status||aI,onClick:()=>void aT(),children:aI?"Starting Deployment...":"Deploy Hermes Agent"}),t?.status!=="ONLINE"&&(0,b.jsx)("p",{className:"text-xs text-text-muted",children:"Bring the Magnus agent online before starting automated Hermes deployment."})]})}),(0,b.jsx)(e.N,{title:"Service Checks",children:v&&as(v.services).length>0?(0,b.jsx)("div",{className:"space-y-2 text-sm",children:as(v.services).slice(0,8).map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded border border-border px-2 py-1.5",children:[(0,b.jsx)("span",{className:"font-medium",children:a.name}),(0,b.jsx)(w.t,{variant:"active"===a.status?"success":"failed"===a.status?"danger":"default",children:a.status})]},a.name))}):(0,b.jsx)("p",{className:"text-sm text-text-muted",children:"No service checks available from this node yet."})})]}),(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)(e.N,{title:"System Update Readiness",description:"Automatic apt policy and reboot state from the latest heartbeat",action:a5?(0,b.jsx)(w.t,{variant:a5.rebootRequired?"danger":"enabled"===a5.automaticUpdates?"success":"warning",children:a5.rebootRequired?"reboot required":a5.automaticUpdates.replace("_"," ")}):void 0,children:a5?(0,b.jsxs)("div",{className:"space-y-4",children:[a5.rebootRequired&&(0,b.jsxs)("div",{className:"flex gap-3 rounded border border-danger/30 bg-danger/10 p-3",children:[(0,b.jsx)(S.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-danger"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-sm font-medium text-danger",children:"Restart needed to finish installed updates"}),(0,b.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:a5.rebootRequiredPackages.length?a5.rebootRequiredPackages.slice(0,5).join(", "):"The operating system has set the reboot-required marker."})]})]}),(0,b.jsxs)("dl",{className:"space-y-2 text-sm",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Platform"}),(0,b.jsx)("dd",{className:"font-mono text-xs",children:a5.platform})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Automatic updates"}),(0,b.jsx)("dd",{children:(0,b.jsx)(w.t,{variant:"enabled"===a5.automaticUpdates?"success":"warning",children:a5.automaticUpdates})})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"unattended-upgrades"}),(0,b.jsx)("dd",{children:a5.unattendedUpgradesInstalled?"installed":"not installed"})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"full apt upgrade policy"}),(0,b.jsx)("dd",{children:a5.fullUpgradePolicyEnabled?"enabled":"not enabled"})]}),a5.timers.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)("dt",{className:"font-mono text-[11px] text-text-muted",children:a.name}),(0,b.jsx)("dd",{className:"font-mono text-[11px]",children:a.state})]},a.name))]}),a5.supported&&"enabled"!==a5.automaticUpdates&&(0,b.jsxs)(A.K,{size:"sm",variant:"primary",disabled:"ONLINE"!==t.status||aE,onClick:()=>void aY(),children:[aE?(0,b.jsx)(I.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(R.f,{className:"h-3.5 w-3.5"}),aE?"Enabling…":"Enable automatic updates"]}),aG&&(0,b.jsx)("p",{className:"text-xs text-danger",children:aG})]}):(0,b.jsx)("p",{className:"text-sm text-text-muted",children:"Update posture will appear after agent v1.6.0 reports its first heartbeat."})}),(0,b.jsx)(e.N,{title:"Wazuh Agent",description:"Endpoint-security posture from the latest node heartbeat",action:a4?(0,b.jsx)(w.t,{variant:"active"===(a=a4.serviceStatus)?"success":"failed"===a?"danger":"inactive"===a?"warning":"default",children:a4.serviceStatus.replace("_"," ")}):void 0,children:a4?(0,b.jsxs)("dl",{className:"space-y-2 text-sm",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Installation"}),(0,b.jsx)("dd",{children:(0,b.jsx)(w.t,{variant:a4.installed?"success":"default",children:a4.installed?"installed":"not installed"})})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Startup"}),(0,b.jsx)("dd",{className:"font-medium",children:a4.enabled})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Version"}),(0,b.jsx)("dd",{className:"font-mono text-xs",children:a4.version??"—"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Managers"}),(0,b.jsx)("dd",{className:"mt-1 font-mono text-xs break-all",children:a4.managerAddresses.length?a4.managerAddresses.join(", "):"—"})]})]}):(0,b.jsx)("p",{className:"text-sm text-text-muted",children:"Wazuh posture will appear after this host reports a current Magnus agent heartbeat."})}),(0,b.jsx)(e.N,{title:"Disk Usage",children:v&&ar(v.disks).length?(0,b.jsx)("div",{className:"space-y-3",children:ar(v.disks).map(a=>(0,b.jsxs)("div",{className:"text-sm",children:[(0,b.jsxs)("div",{className:"flex justify-between text-xs",children:[(0,b.jsx)("span",{className:"text-text-muted",children:a.mountPoint}),(0,b.jsxs)("span",{className:"num",children:[(0,C.L)(a.usedBytes)," / ",(0,C.L)(a.totalBytes)]})]}),(0,b.jsx)(h.f,{value:a.usagePercent,thresholds:{warn:80,crit:90},size:"sm",label:`${a.mountPoint} disk usage`,showValue:!0,className:"mt-1"})]},a.mountPoint))}):(0,b.jsx)("p",{className:"text-sm text-text-muted",children:"No disk data available"})}),(0,b.jsx)(e.N,{title:"Capacity Forecast",description:"Per-volume 30-day growth trend and estimated time to full",children:V.length?(0,b.jsx)("div",{className:"space-y-3",children:V.map(a=>(0,b.jsxs)("div",{className:"rounded border border-border/50 p-3 text-xs",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)("span",{className:"font-mono text-text",children:a.mountPoint}),(0,b.jsx)(w.t,{variant:null!==a.daysUntilFull&&a.daysUntilFull<=14?"danger":null!==a.daysUntilFull&&a.daysUntilFull<=30?"warning":"default",children:null===a.daysUntilFull?a.growthRatePerDay>0?"trend uncertain":"stable/shrinking":`${a.daysUntilFull}d to full`})]}),(0,b.jsxs)("div",{className:"mt-2 text-text-muted",children:[a.currentUsagePercent.toFixed(1),"% used · ",(0,C.L)(Math.abs(a.growthRatePerDay)),"/day ",a.growthRatePerDay>=0?"growth":"reclaimed"," · confidence ",(100*a.confidence).toFixed(0),"%"]}),(0,b.jsx)("p",{className:"mt-2 text-text-muted",children:a.recommendation})]},a.mountPoint))}):(0,b.jsx)("p",{className:"text-sm text-text-muted",children:"At least three retained samples are needed for a capacity forecast."})}),(0,b.jsxs)(e.N,{title:"Software Revisions",description:"Major runtime versions and package update status",action:(0,b.jsx)(A.K,{variant:"ghost",size:"sm",onClick:()=>void aV(),children:(0,b.jsx)(G.f,{className:`h-3.5 w-3.5 ${al?"animate-spin":""}`})}),children:[(0,b.jsxs)("div",{className:"space-y-2 text-sm",children:[["node","npm","python3","redis","docker","tailscale","magnus-agent"].map(a=>(0,b.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,b.jsx)("dt",{className:"text-text-muted uppercase text-xs tracking-wide",children:a}),(0,b.jsx)("dd",{className:"font-mono text-right text-xs break-all",children:ag[a]??(al?"Loading…":"—")})]},a)),an&&(0,b.jsx)("p",{className:"text-xs text-danger",children:an})]}),(0,b.jsxs)("div",{className:"mt-4 border-t border-border pt-4 space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-xs uppercase tracking-wide text-text-muted",children:"APT Updates"}),(0,b.jsx)(w.t,{variant:ap&&ap>0?"warning":"success",children:ay?"Checking…":`${ap??"—"} pending`})]}),(0,b.jsxs)("p",{className:"text-xs text-text-muted",children:["Refreshed hourly via apt update",aw?` • Last check: ${(0,C.C)(aw)}`:""]}),aA&&(0,b.jsx)("p",{className:"text-xs text-danger",children:aA}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(A.K,{size:"sm",variant:"secondary",disabled:"ONLINE"!==t.status||ay,onClick:()=>void aW(),children:[(0,b.jsx)(G.f,{className:`h-3.5 w-3.5 ${ay?"animate-spin":""}`}),"Refresh"]}),(0,b.jsxs)(A.K,{size:"sm",variant:"primary",disabled:"ONLINE"!==t.status||aC,onClick:()=>void aX(),children:[aC?(0,b.jsx)(I.f,{className:"h-3.5 w-3.5 animate-spin"}):null,aC?"Dispatching…":"APT Upgrade"]})]})]})]})]})]}),ae.length>0&&(0,b.jsx)(e.N,{title:"Role Applications",children:(0,b.jsx)("div",{className:"space-y-4",children:ae.map(a=>(0,b.jsxs)("div",{className:"rounded-lg border border-border p-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(K.f,{className:"h-4 w-4 text-primary"}),(0,b.jsxs)("span",{className:"text-sm font-medium",children:["apply"===a.action?"Apply":"Remove",": ",a.role?.name??"Unknown"]})]}),(0,b.jsx)(w.t,{variant:"completed"===a.status?"success":"failed"===a.status?"danger":"running"===a.status?"info":"default",children:a.status})]}),a.error&&(0,b.jsx)("div",{className:"mb-2 rounded border border-danger/30 bg-danger/10 px-2 py-1 text-xs text-danger font-mono",children:a.error}),(0,b.jsx)("div",{className:"space-y-1",children:a.steps.map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,b.jsxs)("span",{className:"completed"===a.status?"text-success":"failed"===a.status?"text-danger":"running"===a.status?"text-info":"skipped"===a.status?"text-text-muted/50":"text-text-muted",children:["completed"===a.status&&"✓","failed"===a.status&&"✗","running"===a.status&&"⟳","skipped"===a.status&&"—","pending"===a.status&&"○"]}),(0,b.jsx)("span",{className:"skipped"===a.status?"text-text-muted/50 line-through":"",children:a.name}),a.error&&(0,b.jsx)("span",{className:"text-danger ml-2 truncate max-w-xs",title:a.error,children:a.error})]},a.name))}),(0,b.jsxs)("div",{className:"mt-2 text-[10px] text-text-muted",children:[a.startedAt?`Started: ${(0,C.C)(a.startedAt)}`:"",a.completedAt?` — Completed: ${(0,C.C)(a.completedAt)}`:""]})]},a.id))})}),(0,b.jsx)(B.n,{open:aO,onClose:()=>aP(!1),title:"Hermes Skills",description:`${a_.length} enabled on ${t.name}`,icon:(0,b.jsx)(N.f,{className:"h-5 w-5 text-primary"}),className:"max-w-3xl",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[(0,b.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,b.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Enabled"}),(0,b.jsx)("p",{className:"mt-1 text-lg font-semibold",children:a_.length})]}),(0,b.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,b.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Total"}),(0,b.jsx)("p",{className:"mt-1 text-lg font-semibold",children:aZ.length})]}),(0,b.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,b.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Sources"}),(0,b.jsx)("p",{className:"mt-1 text-sm font-mono",children:Array.from(new Set(aZ.map(a=>a.source))).filter(Boolean).join(", ")||"unknown"})]})]}),(0,b.jsxs)("div",{className:"max-h-[55vh] overflow-auto rounded border border-border",children:[(0,b.jsxs)("table",{className:"w-full text-left text-xs",children:[(0,b.jsx)("thead",{className:"sticky top-0 bg-surface text-[10px] uppercase tracking-wide text-text-muted",children:(0,b.jsxs)("tr",{children:[(0,b.jsx)("th",{className:"px-3 py-2 font-medium",children:"Skill"}),(0,b.jsx)("th",{className:"px-3 py-2 font-medium",children:"Category"}),(0,b.jsx)("th",{className:"px-3 py-2 font-medium",children:"Source"}),(0,b.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"})]})}),(0,b.jsx)("tbody",{className:"divide-y divide-border",children:aZ.slice().sort((a,b)=>Number(b.enabled)-Number(a.enabled)||a.slug.localeCompare(b.slug)).map(a=>(0,b.jsxs)("tr",{className:"bg-bg/20",children:[(0,b.jsx)("td",{className:"px-3 py-2 font-mono",children:a.slug}),(0,b.jsx)("td",{className:"px-3 py-2 text-text-muted",children:a.category??"uncategorized"}),(0,b.jsx)("td",{className:"px-3 py-2 text-text-muted",children:a.source}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(w.t,{variant:a.enabled?"success":"default",children:a.enabled?"enabled":"disabled"})})]},`${a.slug}-${a.source}`))})]}),0===aZ.length&&(0,b.jsx)("div",{className:"p-6 text-sm text-text-muted",children:"No synced Hermes skills were reported for this node."})]})]})}),(0,b.jsx)(U.F,{open:_,node:t,onClose:()=>aa(!1),onSaved:()=>void aS()}),(0,b.jsx)(U.E,{open:ab,node:t?{id:t.id,name:t.name,role:t.role}:null,onClose:()=>ac(!1),onSaved:a=>{aR.current=a,t&&u({...t,role:a}),aS()}})]})}],31184)}];
1
+ module.exports=[31184,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(49521),f=a.i(90751),g=a.i(92117),h=a.i(85651),i=a.i(2668),j=a.i(90165),k=a.i(68216),l=a.i(64831);let m={name:"chart-line",size:24,node:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],aliases:["line-chart"]};m.node;let n=(0,l.f)(m);var o=a.i(46997),p=a.i(8387),q=a.i(33470);let r=["1h","6h","24h"];function s({nodeId:a,height:d=180}){let[e,f]=(0,c.useState)("1h"),[g,h]=(0,c.useState)(null),[i,k]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let b=!1;k(!1);let c=async()=>{try{let[c,d]=await Promise.all([o.f.get(`nodes/${a}/health/timeseries?metric=cpu&period=${e}`),o.f.get(`nodes/${a}/health/timeseries?metric=memory&period=${e}`)]);if(b)return;let f=c.data??{timestamps:[],values:[]},g=d.data??{timestamps:[],values:[]},i=new Map;f.timestamps.forEach((a,b)=>{let c=Date.parse(a);i.set(c,{t:c,cpu:f.values[b]??null,mem:null})}),g.timestamps.forEach((a,b)=>{let c=Date.parse(a),d=i.get(c)??{t:c,cpu:null,mem:null};d.mem=g.values[b]??null,i.set(c,d)}),h([...i.values()].sort((a,b)=>a.t-b.t))}catch{b||(h([]),k(!0))}};c();let d=setInterval(()=>void c(),6e4);return()=>{b=!0,clearInterval(d)}},[a,e]),(0,b.jsxs)("div",{className:"flex min-w-0 flex-col","data-testid":"node-metrics-chart",children:[(0,b.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-2",children:[(0,b.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-text-muted",children:"CPU / memory history"}),(0,b.jsx)("div",{role:"group","aria-label":"History period",className:"flex rounded-chip border border-border bg-bg p-0.5",children:r.map(a=>(0,b.jsx)("button",{type:"button",onClick:()=>f(a),"aria-pressed":e===a,className:(0,p.f)("rounded-chip px-2 py-0.5 text-[10px] uppercase tracking-wider transition-colors",e===a?"bg-primary/15 text-primary shadow-[0_0_8px_var(--color-glow)]":"text-text-muted hover:text-text"),children:a},a))})]}),null===g?(0,b.jsx)("div",{className:"skeleton w-full",style:{height:d}}):g.length<2?(0,b.jsx)(j.f,{compact:!0,icon:(0,b.jsx)(n,{className:"h-4 w-4"}),title:i?"History unavailable":"Not enough samples yet",description:i?"The health timeseries endpoint did not answer.":`No health snapshots in the last ${e}.`,tone:i?"warning":"muted",className:"flex-1"}):(0,b.jsx)(q.f,{data:g,xKey:"t",percent:!0,height:d,formatX:a=>new Date(Number(a)).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),series:[{key:"cpu",label:"CPU",tone:"primary"},{key:"mem",label:"Memory",tone:"accent"}]})]})}var t=a.i(33838);let u={name:"shield-off",size:24,node:[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]};u.node;let v=(0,l.f)(u);var w=a.i(58299);function x({metadata:a}){let c=function(a){let b=a;if("string"==typeof a)try{b=JSON.parse(a)}catch{return}return b?.agentSelfUpgrade}(a);return c?c.upgrade?.state==="reverted"?(0,b.jsx)("span",{title:c.upgrade.reason??void 0,children:(0,b.jsxs)(w.t,{variant:"danger",children:[(0,b.jsx)(t.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade to ",c.upgrade.to," reverted"]})}):c.upgrade?.state==="failed"?(0,b.jsx)("span",{title:c.upgrade.reason??void 0,children:(0,b.jsxs)(w.t,{variant:"danger",children:[(0,b.jsx)(t.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade to ",c.upgrade.to," failed"]})}):c.enabled?null:(0,b.jsx)("span",{title:c.reason??void 0,"data-testid":"agent-self-upgrade-off",children:(0,b.jsxs)(w.t,{variant:"default",children:[(0,b.jsx)(v,{className:"mr-1 inline h-3 w-3"}),"Self-upgrade off"]})}):null}var y=a.i(33666),z=a.i(33231),A=a.i(68415),B=a.i(85063),C=a.i(29147),D=a.i(90629),E=a.i(51675),F=a.i(19107),G=a.i(48819),H=a.i(21327),I=a.i(75160),J=a.i(68370),K=a.i(36273),L=a.i(82260),M=a.i(99101),N=a.i(50354),O=a.i(33540);let P={name:"mouse-pointer-click",size:24,node:[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]};P.node;let Q=(0,l.f)(P);var R=a.i(90363),S=a.i(13931),T=a.i(34532),U=a.i(7574),V=a.i(57307),W=a.i(19783),X=a.i(14258),Y=a.i(38688),Z=a.i(36670),$=a.i(68579),_=a.i(13412),aa=a.i(11134),ab=a.i(8311);let ac=[{id:"apt-update",label:"apt update",command:"sudo",args:["apt","update"],icon:(0,b.jsx)(Z.f,{className:"h-3.5 w-3.5"}),variant:"secondary",timeoutSeconds:120},{id:"apt-upgrade",label:"apt upgrade",command:"sudo",args:["apt","upgrade","-y"],icon:(0,b.jsx)(W.f,{className:"h-3.5 w-3.5"}),variant:"secondary",confirm:"This will upgrade all packages on the node. Continue?",timeoutSeconds:300},{id:"magnus-status",label:"magnus status",command:"systemctl",args:["status","magnus-agent","--no-pager"],icon:(0,b.jsx)(Y.f,{className:"h-3.5 w-3.5"}),variant:"primary",timeoutSeconds:15},{id:"magnus-update",label:"magnus update",command:"sudo",args:["systemctl","restart","magnus-agent"],icon:(0,b.jsx)(X.f,{className:"h-3.5 w-3.5"}),variant:"secondary",confirm:"This will restart the Magnus agent. Continue?",timeoutSeconds:30},{id:"dmesg",label:"dmesg",command:"sudo",args:["dmesg","--time-format=reltime","-T"],icon:(0,b.jsx)($.f,{className:"h-3.5 w-3.5"}),variant:"secondary",timeoutSeconds:15},{id:"reboot",label:"Reboot",command:"sudo",args:["reboot"],icon:(0,b.jsx)(S.f,{className:"h-3.5 w-3.5"}),variant:"danger",confirm:"Are you sure you want to REBOOT this node? It will go offline temporarily.",timeoutSeconds:10}];function ad({nodeId:a,nodeStatus:d}){let[e,f]=(0,c.useState)(!1),[g,h]=(0,c.useState)(!1),[i,j]=(0,c.useState)(null),[k,l]=(0,c.useState)(null),[m,n]=(0,c.useState)(null),p="ONLINE"!==d,q=async b=>{if(!b.confirm||confirm(b.confirm)){j(b),l(null),n(null),h(!0),f(!0);try{let c=await o.f.quickCommand.exec(a,{command:b.command,args:b.args,timeoutSeconds:b.timeoutSeconds});l(c.data)}catch(a){n(a instanceof Error?a.message:"Command execution failed")}finally{h(!1)}}};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"rounded border border-border bg-surface p-3",children:(0,b.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-text-muted mr-2",children:[(0,b.jsx)(V.f,{className:"h-4 w-4"}),(0,b.jsx)("span",{className:"font-bold uppercase tracking-wider",children:"Quick Commands"})]}),ac.map(a=>(0,b.jsx)(A.K,{variant:a.variant,size:"sm",icon:a.icon,disabled:p,onClick:()=>void q(a),children:a.label},a.id)),p&&(0,b.jsx)("span",{className:"ml-2 text-xs text-text-muted",children:"Node must be ONLINE to run commands"})]})}),(0,b.jsx)(B.n,{open:e,onClose:()=>f(!1),title:i?.label??"Command",description:i?`${i.command} ${(i.args??[]).join(" ")}`:void 0,icon:(0,b.jsx)(V.f,{className:"h-5 w-5 text-primary"}),className:"max-w-3xl",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("div",{className:"flex items-center gap-2",children:g?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(I.f,{className:"h-4 w-4 animate-spin text-primary"}),(0,b.jsx)("span",{className:"text-xs text-primary",children:"Executing…"})]}):m?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(aa.f,{className:"h-4 w-4 text-danger"}),(0,b.jsx)("span",{className:"text-xs text-danger",children:"Error"})]}):k?(0,b.jsxs)(b.Fragment,{children:[0===k.exitCode?(0,b.jsx)(_.f,{className:"h-4 w-4 text-success"}):(0,b.jsx)(aa.f,{className:"h-4 w-4 text-danger"}),(0,b.jsxs)("span",{className:`text-xs ${0===k.exitCode?"text-success":"text-danger"}`,children:["Exit code: ",k.exitCode]}),(0,b.jsxs)("span",{className:"text-xs text-text-muted flex items-center gap-1 ml-auto",children:[(0,b.jsx)(ab.f,{className:"h-3 w-3"}),(k.durationMs/1e3).toFixed(2),"s"]})]}):null}),m&&(0,b.jsx)("div",{className:"rounded bg-danger/10 border border-danger/30 p-3",children:(0,b.jsx)("p",{className:"text-xs text-danger",children:m})}),k&&(0,b.jsxs)("div",{className:"space-y-3",children:[k.stdout&&(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[11px] font-bold uppercase tracking-wider text-text-muted mb-1",children:"stdout"}),(0,b.jsx)("pre",{className:"max-h-80 overflow-auto rounded bg-bg border border-border p-3 text-xs text-success whitespace-pre-wrap",children:k.stdout})]}),k.stderr&&(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-[11px] font-bold uppercase tracking-wider text-text-muted mb-1",children:"stderr"}),(0,b.jsx)("pre",{className:"max-h-40 overflow-auto rounded bg-bg border border-danger/20 p-3 text-xs text-danger whitespace-pre-wrap",children:k.stderr})]}),!k.stdout&&!k.stderr&&(0,b.jsx)("p",{className:"text-xs text-text-muted italic",children:"No output captured"}),k.truncated&&(0,b.jsx)("p",{className:"text-xs text-warning",children:"⚠ Output was truncated (exceeded 1MB)"})]}),g&&(0,b.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,b.jsxs)("div",{className:"text-center",children:[(0,b.jsx)(I.f,{className:"h-8 w-8 animate-spin text-primary mx-auto mb-2"}),(0,b.jsx)("p",{className:"text-xs text-text-muted",children:"Executing command on remote node…"})]})}),(0,b.jsx)("div",{className:"flex justify-end pt-2",children:(0,b.jsx)(A.K,{variant:"ghost",size:"sm",onClick:()=>f(!1),children:"Close"})})]})})]})}var ae=a.i(83375),af=a.i(86708);let ag={workhorse:{name:"Workhorse",emoji:"🐴",description:"Steady, reliable, never complains.",accent:"success"},"drama-queen":{name:"Drama Queen",emoji:"🎭",description:"High variance, loves spiking CPU for attention.",accent:"warning"},"zen-master":{name:"Zen Master",emoji:"🧘",description:"Low usage, mind always clear, never stressed.",accent:"info"},sprinter:{name:"Sprinter",emoji:"⚡",description:"Bursts of intense activity followed by calm recovery.",accent:"info"},groundhog:{name:"Groundhog",emoji:"🌀",description:"Keeps rebooting — might see its own shadow again.",accent:"warning"},ghost:{name:"Ghost",emoji:"👻",description:"Often unreachable. Is it even there?",accent:"danger"},marathoner:{name:"Marathoner",emoji:"🏃",description:"Long uptime, steady pace, built to last.",accent:"success"},rookie:{name:"Rookie",emoji:"🌱",description:"Not enough history yet — still finding its rhythm.",accent:"default"}};function ah(a){return 0===a.length?0:a.reduce((a,b)=>a+b,0)/a.length}function ai({node:a}){let[d,f]=(0,c.useState)([]),[g,h]=(0,c.useState)(!0),[i,j]=(0,c.useState)(null),[k,l]=(0,c.useState)(0);(0,c.useEffect)(()=>{let b=!1;return(async()=>{h(!0),j(null);try{let c=await o.f.get(`nodes/${a.id}/health/history?limit=100`);if(b)return;let d=c.data,e=[];Array.isArray(d)?e=d:d?.items&&(e=d.items),f([...e].reverse())}catch(a){b||(f([]),j(a instanceof Error?a.message:"Failed to load history"))}finally{b||h(!1)}})(),()=>{b=!0}},[a.id,k]);let m=(0,c.useMemo)(()=>{let b,c,e,f,g,h,i,j,k;return b=d.map(a=>a.cpuUsagePercent).filter(a=>Number.isFinite(a)),c=d.map(a=>a.memoryPercent).filter(a=>Number.isFinite(a)),e=ah(b),f=function(a){if(a.length<2)return 0;let b=ah(a);return Math.sqrt(a.reduce((a,c)=>a+(c-b)*(c-b),0)/(a.length-1))}(b),g=ah(c),h=b.filter(a=>a>80).length,i="rookie",j=ag[i="OFFLINE"===a.status||a.lastHeartbeatAt&&Date.now()-new Date(a.lastHeartbeatAt).getTime()>6e5?"ghost":d.length<3?"rookie":f>25||h/Math.max(1,b.length)>.25?h/Math.max(1,b.length)>.4?"drama-queen":"sprinter":e<15&&f<10?"zen-master":e>40&&e<75&&f<15?"workhorse":e<40&&f<15&&d.length>20?"marathoner":"workhorse"]??ag.rookie??{name:"Rookie",emoji:"🌱",description:"",accent:"default"},k=function(a,b,c){var d;let e,f=Math.floor(Date.now()/6048e5);for(let b=0;b<a.id.length;b++)f=31*f+a.id.charCodeAt(b)|0;let g={workhorse:[`Steady as they come — averaging ${c.cpuAvg.toFixed(0)}% CPU without a single complaint this week.`,`The dependable one. ${a.hostname} just keeps grinding through the workload.`,`Quietly productive at ~${c.cpuAvg.toFixed(0)}% CPU. Gets the job done and asks for nothing.`],"drama-queen":[`Lives for the spotlight — ${c.spikes} CPU spikes this week and counting.`,`${a.hostname} likes to keep things interesting with a \xb1${c.cpuSD.toFixed(0)}% swing.`,"A connoisseur of chaos. Never a dull moment with this one."],"zen-master":[`Practices minimalism. Barely breaks a sweat at ${c.cpuAvg.toFixed(0)}% CPU.`,`${a.hostname} is in its happy place — calm, cool, collected.`,"Achieving enlightenment one idle cycle at a time."],sprinter:[`Bursts of energy, then recovery. ${c.spikes} sprints logged this week.`,`${a.hostname} runs hot, then cools down. Classic sprinter cadence.`,"Lives in intervals — full throttle, then full zen."],groundhog:["Déjà vu all over again. Might want to check the uptime.",`${a.hostname} keeps hitting the reset button.`],ghost:["Hasn't been seen in a while. Anyone home?",`${a.hostname} is currently out of contact. Check the heartbeat.`],marathoner:[`In it for the long haul — ${c.samples} data points of pure consistency.`,`${a.hostname} doesn't sprint. It endures.`],rookie:["Still new around here — gathering experience.",`${a.hostname} is just getting started. Check back soon.`]};return e=Math.abs(f)%(d=g[b.name.toLowerCase().replace(" ","-")]??g.rookie??["…"]).length,d[e]}(a,j,{cpuAvg:e,cpuSD:f,memAvg:g,samples:b.length,spikes:h}),{archetype:j,archetypeKey:i,bio:k,stats:{cpuAvg:e,cpuStdDev:f,memAvg:g,samples:b.length,spikes:h}}},[a,d]),n=d.map(a=>a.cpuUsagePercent).slice(-40),p=d.map(a=>a.memoryPercent).slice(-40);return(0,b.jsx)(e.N,{title:"Personality",action:(0,b.jsx)("button",{onClick:()=>l(a=>a+1),className:"text-text-muted hover:text-text transition p-1",title:"Refresh personality","data-testid":"node-personality-refresh",children:(0,b.jsx)(W.f,{className:"h-3.5 w-3.5"})}),children:(0,b.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"node-personality-card","data-archetype":m.archetypeKey,children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("span",{className:"flex h-12 w-12 items-center justify-center rounded-full border border-accent/40 bg-bg text-2xl shadow-[0_0_16px_var(--color-glow-accent)]","aria-hidden":"true",children:m.archetype.emoji}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{"data-testid":"node-archetype-badge",children:(0,b.jsx)(w.t,{variant:m.archetype.accent,children:m.archetype.name})}),g&&(0,b.jsx)("span",{className:"text-xs text-text-muted italic",children:"analyzing…"})]}),(0,b.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:m.archetype.description})]})]}),(0,b.jsx)(af.f,{className:"h-4 w-4 text-accent mt-1"})]}),(0,b.jsxs)("blockquote",{className:"border-l-2 border-accent/40 pl-3 text-sm italic text-text","data-testid":"node-personality-bio",children:["“",m.bio,"”"]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-4 pt-2 border-t border-border/30",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,b.jsx)("span",{className:"text-xs uppercase tracking-wider text-text-muted",children:"CPU trend"}),(0,b.jsxs)("span",{className:"text-xs tabular-nums text-text-muted",children:["avg ",m.stats.cpuAvg.toFixed(0),"%"]})]}),(0,b.jsx)(ae.f,{values:n,tone:"primary",percent:!0,stretch:!0,threshold:80,testId:"node-personality-cpu-sparkline",label:`CPU trend, average ${m.stats.cpuAvg.toFixed(0)}%`})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,b.jsx)("span",{className:"text-xs uppercase tracking-wider text-text-muted",children:"Memory trend"}),(0,b.jsxs)("span",{className:"text-xs tabular-nums text-text-muted",children:["avg ",m.stats.memAvg.toFixed(0),"%"]})]}),(0,b.jsx)(ae.f,{values:p,tone:"accent",percent:!0,stretch:!0,threshold:80,testId:"node-personality-mem-sparkline",label:`Memory trend, average ${m.stats.memAvg.toFixed(0)}%`})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4 text-[11px] text-text-muted",children:[(0,b.jsxs)("span",{children:[m.stats.samples," samples"]}),(0,b.jsxs)("span",{children:["σ ",m.stats.cpuStdDev.toFixed(1),"%"]}),(0,b.jsxs)("span",{children:[m.stats.spikes," spikes"]}),i&&(0,b.jsxs)("span",{className:"text-warning",children:["· ",i]})]})]})})}let aj={name:"fan",size:24,node:[["path",{d:"M10.827 16.379a6.082 6.082 0 0 1-8.618-7.002l5.412 1.45a6.082 6.082 0 0 1 7.002-8.618l-1.45 5.412a6.082 6.082 0 0 1 8.618 7.002l-5.412-1.45a6.082 6.082 0 0 1-7.002 8.618l1.45-5.412Z",key:"484a7f"}],["path",{d:"M12 12v.01",key:"u5ubse"}]]};aj.node;let ak=(0,l.f)(aj);var al=a.i(6024);let am={name:"thermometer",size:24,node:[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]};am.node;let an=(0,l.f)(am);function ao(a,b){let c=a.map(a=>({timestamp:new Date(a.sampledAt).getTime(),value:b(a)})).filter(a=>null!==a.value);if(0===c.length)return"";let d=c[0].timestamp,e=Math.max(1,c.at(-1).timestamp-d);return c.map(({timestamp:a,value:b})=>{let c=104-.88*Math.max(0,Math.min(100,b));return`${((a-d)/e*600).toFixed(1)},${c.toFixed(1)}`}).join(" ")}function ap(a,b="%"){return null===a?"not reported":`${a.toFixed(1)}${b}`}function aq({telemetry:a}){let c=a?.latest??null,d=c?.devices??[],f=ao(a?.history??[],a=>a.maxUtilizationPercent),g=ao(a?.history??[],a=>a.maxFanPercent);return(0,b.jsx)(e.N,{title:"GPU telemetry",description:"30-second load and cooling history",action:c?(0,b.jsxs)(w.t,{variant:"default",children:["sampled ",(0,C.C)(c.sampledAt)]}):void 0,children:c&&0!==d.length?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:d.map(a=>(0,b.jsxs)("div",{className:"rounded-panel border border-border/70 bg-surface-raised/60 p-3 transition-colors hover:border-primary/30",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"truncate text-xs font-medium text-text",children:a.name}),(0,b.jsxs)("p",{className:"mt-0.5 text-[10px] uppercase tracking-wide text-text-muted",children:[a.vendor," · gpu ",a.index]})]}),100===a.fanPercent&&(0,b.jsx)(w.t,{variant:"danger",children:"fan saturated"})]}),(0,b.jsxs)("dl",{className:"mt-3 grid grid-cols-3 gap-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,b.jsx)(al.f,{className:"h-3 w-3"}),"Load"]}),(0,b.jsx)("dd",{className:"mt-1 num text-sm text-primary",children:ap(a.utilizationPercent)})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,b.jsx)(ak,{className:"h-3 w-3"}),"Fan"]}),(0,b.jsx)("dd",{className:`mt-1 num text-sm ${100===a.fanPercent?"text-danger glow-text-danger":"text-warning"}`,children:ap(a.fanPercent)})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,b.jsx)(an,{className:"h-3 w-3"}),"Temp"]}),(0,b.jsx)("dd",{className:"mt-1 num text-sm text-text",children:ap(a.temperatureCelsius,"°C")})]})]}),(0,b.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,b.jsx)(h.f,{value:a.utilizationPercent,tone:"primary",label:`${a.name} load`}),(0,b.jsx)(h.f,{value:a.fanPercent,thresholds:{warn:80,crit:100},label:`${a.name} fan`})]})]},`${a.vendor}-${a.uuid??a.index}`))}),(0,b.jsxs)("div",{className:"panel-corners rounded-panel border border-border/70 bg-bg/60 p-3",children:[(0,b.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[(0,b.jsx)("p",{className:"text-[10px] font-medium uppercase tracking-[0.16em] text-text-muted",children:"Host maximum · last 24 hours"}),(0,b.jsxs)("div",{className:"flex items-center gap-3 text-[10px] text-text-muted",children:[(0,b.jsxs)("span",{className:"flex items-center gap-1",children:[(0,b.jsx)("span",{className:"h-0.5 w-3 bg-primary shadow-[0_0_4px_var(--color-primary)]"}),"load"]}),(0,b.jsxs)("span",{className:"flex items-center gap-1",children:[(0,b.jsx)("span",{className:"h-0.5 w-3 bg-warning"}),"fan"]})]})]}),(0,b.jsxs)("svg",{viewBox:"0 0 600 112",className:"h-28 w-full",role:"img","aria-label":"GPU load and fan percentage over the last 24 hours",children:[(0,b.jsx)("line",{x1:"0",y1:"16",x2:"600",y2:"16",stroke:"var(--color-danger)",strokeOpacity:"0.45",strokeDasharray:"5 5"}),(0,b.jsx)("line",{x1:"0",y1:"60",x2:"600",y2:"60",stroke:"currentColor",strokeOpacity:"0.12"}),(0,b.jsx)("line",{x1:"0",y1:"104",x2:"600",y2:"104",stroke:"currentColor",strokeOpacity:"0.2"}),(0,b.jsx)("defs",{children:(0,b.jsxs)("linearGradient",{id:"gpu-load-fill",x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,b.jsx)("stop",{offset:"0%",stopColor:"var(--color-primary)",stopOpacity:"0.35"}),(0,b.jsx)("stop",{offset:"100%",stopColor:"var(--color-primary)",stopOpacity:"0"})]})}),f&&(0,b.jsx)("polygon",{points:`0,104 ${f} 600,104`,fill:"url(#gpu-load-fill)"}),f&&(0,b.jsx)("polyline",{points:f,fill:"none",stroke:"var(--color-primary)",strokeWidth:"2",vectorEffect:"non-scaling-stroke"}),g&&(0,b.jsx)("polyline",{points:g,fill:"none",stroke:"var(--color-warning)",strokeWidth:"2",vectorEffect:"non-scaling-stroke"})]}),(0,b.jsxs)("div",{className:"mt-1 flex justify-between num text-[9px] text-text-muted",children:[(0,b.jsx)("span",{children:"24h ago"}),(0,b.jsx)("span",{children:"100% saturation line"}),(0,b.jsx)("span",{children:"now"})]})]})]}):(0,b.jsx)("div",{className:"rounded-panel border border-dashed border-border px-4 py-6 text-center text-xs text-text-muted",children:c?.status==="error"?"The GPU probe did not complete. Magnus will retry on the next heartbeat.":"No supported NVIDIA or AMD GPU was detected in the latest sample."})})}function ar(a){if("string"==typeof a)try{return JSON.parse(a)}catch{return[]}return a??[]}function as(a){if(!a)return[];if("string"==typeof a)try{return JSON.parse(a)}catch{return[]}return a}function at(a){return!!(a&&"not_installed"!==a.status)}function au(a){let b=a.status.toLowerCase();return b.includes("enabled")&&!b.includes("not enabled")&&!b.includes("disabled")}function av(a,b){let c=a.filter(au).find(a=>{let c=`${a.slug} ${a.pluginType} ${a.metadata?.description??""}`.toLowerCase();return"search"===b?/\b(search|web)\b/.test(c):/\b(crawl|browser|firecrawl|browserbase|browser-use)\b/.test(c)});return c?`${c.slug}${c.version?` ${c.version}`:""}`:"none enabled"}a.s(["default",0,function(){var a,l;let m,n,p,q=(0,d.useParams)(),r=(0,d.useRouter)(),[t,u]=(0,c.useState)(null),[v,P]=(0,c.useState)(null),[V,W]=(0,c.useState)([]),[X,Y]=(0,c.useState)(null),[Z,$]=(0,c.useState)(!0),[_,aa]=(0,c.useState)(!1),[ab,ac]=(0,c.useState)(!1),[ae,af]=(0,c.useState)([]),[ag,ah]=(0,c.useState)({}),[aj,ak]=(0,c.useState)(null),[al,am]=(0,c.useState)(!1),[an,ao]=(0,c.useState)(null),[ap,au]=(0,c.useState)(null),[aw,ax]=(0,c.useState)(null),[ay,az]=(0,c.useState)(!1),[aA,aB]=(0,c.useState)(null),[aC,aD]=(0,c.useState)(!1),[aE,aF]=(0,c.useState)(!1),[aG,aH]=(0,c.useState)(null),[aI,aJ]=(0,c.useState)(!1),[aK,aL]=(0,c.useState)(null),[aM,aN]=(0,c.useState)(null),[aO,aP]=(0,c.useState)(!1),aQ=(0,c.useRef)(null),aR=(0,c.useRef)(void 0),aS=(0,c.useCallback)(async(a=!1)=>{try{a||$(!0);let[b,c,d,e,f]=await Promise.all([o.f.nodes.get(q.nodeId),o.f.nodes.health(q.nodeId).catch(()=>null),o.f.nodes.forecast(q.nodeId).catch(()=>null),o.f.hermes.installations().catch(()=>null),o.f.nodes.gpu(q.nodeId).catch(()=>null)]),g=b.data;g.role||void 0===aR.current?g.role&&(aR.current=g.role):g.role=aR.current,u(g),c&&P(c.data),W(d?.data?.forecasts??[]),Y(f?.data??null);let h=e?.data??[];ak(h.find(a=>a.nodeId===g.id)??h.find(a=>a.hostname===g.hostname||a.hostname===g.ipAddress)??null);try{let a=await o.f.roles.applications.list({nodeId:q.nodeId});af(a.data??[])}catch{}}catch{}finally{a||$(!1)}},[q.nodeId]);(0,c.useEffect)(()=>{aS()},[aS]);let aT=async()=>{if(t&&confirm(`Deploy Hermes Agent to "${t.name}"?`)){aJ(!0),aL(null),aN(null);try{let a,b=await o.f.hermes.deploy({nodeId:t.id,hermesHome:"~/.hermes",hermesBin:"hermes",installMethod:"official-script",dashboardPort:9119,enableDashboard:!0,enableDashboardTui:!0,startGateway:!0},(a="u">typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2),`hermes-node-deploy-${Date.now()}-${a}`));aL(`Hermes Agent deployment started. Job ${b.data?.id.slice(0,10)}...`),aS(!0)}catch(a){aN(a instanceof Error?a.message:"Hermes Agent deployment failed")}finally{aJ(!1)}}};(0,c.useEffect)(()=>{let a=t?.status==="PROVISIONING"||t?.agent?.status==="UPDATING"||!!(aK&&!at(aj));return a&&!aQ.current?aQ.current=setInterval(()=>{aS(!0)},4e3):!a&&aQ.current&&(clearInterval(aQ.current),aQ.current=null),()=>{aQ.current&&(clearInterval(aQ.current),aQ.current=null)}},[t?.status,t?.agent?.status,t?.agent?.version,aS,aK,aj]);let aU=async()=>{if(t&&confirm(`Delete node "${t.name}"? This will permanently remove it and all associated data.`))try{await o.f.nodes.delete(t.id),r.push("/nodes")}catch{}},aV=(0,c.useCallback)(async()=>{if(t?.status==="ONLINE"){am(!0),ao(null);try{let a='version_or_na() { local cmd="$1"; shift; if command -v "$cmd" >/dev/null 2>&1; then ("$@" 2>/dev/null || "$cmd" --version 2>/dev/null || "$cmd" -v 2>/dev/null || echo "unknown") | head -n 1; else echo "not installed"; fi; }; echo "node=$(version_or_na node node --version)"; echo "npm=$(version_or_na npm npm --version)"; echo "python3=$(version_or_na python3 python3 --version)"; echo "redis=$(version_or_na redis-cli redis-cli --version)"; echo "docker=$(version_or_na docker docker --version)"; echo "tailscale=$(version_or_na tailscale tailscale version)"; agent_manifest=/opt/magnus-agent/node_modules/@hivemagnus/magnus-agent/package.json; [ -f "$agent_manifest" ] || agent_manifest=/opt/magnus-agent/package.json; if [ -f "$agent_manifest" ]; then echo "magnus-agent=$(node -e \'process.stdout.write(require(process.argv[1]).version)\' "$agent_manifest" 2>/dev/null || echo unknown)"; else echo "magnus-agent=not installed"; fi'.replace(/'/g,"'\\''"),b=((await o.f.quickCommand.exec(t.id,{command:`bash -lc '${a}'`,args:[],timeoutSeconds:60})).data.stdout??"").trim(),c=Object.fromEntries(b.split("\n").map(a=>a.trim()).filter(a=>a.includes("=")).map(a=>{let[b,...c]=a.split("=");return[b,c.join("=").trim()||"unknown"]}));ah(c)}catch(a){ao(a instanceof Error?a.message:"Failed to load software revisions")}finally{am(!1)}}},[t?.id,t?.status]),aW=(0,c.useCallback)(async()=>{if(t?.status==="ONLINE"){az(!0),aB(null);try{let a="set -euo pipefail; (sudo apt-get update -qq || apt-get update -qq) >/dev/null 2>&1; apt list --upgradable 2>/dev/null | sed '1d' | sed '/^Listing/d' | wc -l".replace(/'/g,"'\\''"),b=((await o.f.quickCommand.exec(t.id,{command:`bash -lc '${a}'`,args:[],timeoutSeconds:180})).data.stdout??"").trim(),c=Number.parseInt(b.split("\n").at(-1)??"",10);au(Number.isFinite(c)?c:null),ax(new Date().toISOString())}catch(a){aB(a instanceof Error?a.message:"Failed to refresh apt updates")}finally{az(!1)}}},[t?.id,t?.status]),aX=async()=>{if(t&&confirm(`Run apt upgrade on "${t.name}"?`)){aD(!0);try{let a=`apt-upgrade-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,b=(await o.f.commands.dispatch({nodeIds:[t.id],command:"sudo",args:["apt","upgrade","-y"],timeoutSeconds:1800,idempotencyKey:a},a)).data,c=b.commands?.[0]?.id;alert(c?`APT Upgrade dispatched (command ${c.slice(0,12)}…). Check Commands for progress.`:"APT Upgrade dispatched. Check Commands for progress."),await aW()}catch(a){alert(`APT Upgrade failed to dispatch: ${a instanceof Error?a.message:String(a)}`)}finally{aD(!1)}}},aY=async()=>{if(t&&confirm(`Enable unattended apt update and apt upgrade on "${t.name}"? Magnus will install unattended-upgrades and enable the apt timers.`)){aF(!0),aH(null);try{await o.f.nodes.enableSystemUpdates(t.id),await aS(!0)}catch(a){aH(a instanceof Error?a.message:"Failed to enable automatic updates")}finally{aF(!1)}}};if((0,c.useEffect)(()=>{aV(),aW()},[aV,aW]),(0,c.useEffect)(()=>{if(!t||"ONLINE"!==t.status)return;let a=setInterval(()=>{aW()},36e5);return()=>clearInterval(a)},[t,aW]),Z)return(0,b.jsxs)("div",{className:"space-y-6","aria-busy":"true",children:[(0,b.jsx)("div",{className:"skeleton h-56 w-full rounded-panel opacity-70"}),(0,b.jsx)(k.g,{}),(0,b.jsx)("span",{className:"sr-only",children:"Loading node details…"})]});if(!t)return(0,b.jsx)(j.f,{tone:"accent",icon:(0,b.jsx)(T.f,{className:"h-5 w-5"}),title:"Node not found",description:"It may have been decommissioned or belong to another control node.",action:(0,b.jsx)(A.K,{variant:"secondary",size:"sm",onClick:()=>r.push("/nodes"),children:"Back to nodes"}),className:"mt-12"});let aZ=at(aj)?Array.isArray(aj.rawStatus?.skills)?aj.rawStatus.skills:[]:[],a$=at(aj)?Array.isArray(aj.rawStatus?.plugins)?aj.rawStatus.plugins:[]:[],a_=aZ.filter(a=>a.enabled),a0=aj?.configuration?.modelProvider??"unknown",a1=aj?.configuration?.modelName??"unknown",a2=av(a$,"search"),a3=av(a$,"crawl"),a4=function(a){if(!a)return null;try{let b="string"==typeof a?JSON.parse(a):a;if("boolean"!=typeof b.installed||!["active","inactive","failed","not_installed","unknown"].includes(b.serviceStatus)||!["enabled","disabled","static","unknown"].includes(b.enabled)||null!==b.version&&"string"!=typeof b.version||!Array.isArray(b.managerAddresses))return null;return b}catch{return null}}(v?.wazuh),a5=function(a){if(!a)return null;try{let b="string"==typeof a?JSON.parse(a):a;if("boolean"!=typeof b.supported||"string"!=typeof b.platform||!["enabled","disabled","partial","unsupported","unknown"].includes(b.automaticUpdates??"")||"boolean"!=typeof b.rebootRequired||!Array.isArray(b.timers)||!Array.isArray(b.rebootRequiredPackages))return null;return{...b,fullUpgradePolicyEnabled:!0===b.fullUpgradePolicyEnabled}}catch{return null}}(v?.systemUpdates);return(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)(f.f,{hero:!0,padding:"lg",tone:"ONLINE"===t.status?"primary":"OFFLINE"===t.status?"danger":"warning",testId:"node-cockpit",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,b.jsx)(A.K,{variant:"ghost",size:"sm",onClick:()=>r.push("/nodes"),"aria-label":"Back to nodes",children:(0,b.jsx)(F.f,{className:"h-4 w-4"})}),(0,b.jsx)(i.f,{status:t.status}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h1",{className:"truncate text-2xl font-bold text-primary glow-text-primary",children:t.name}),(0,b.jsxs)("p",{className:"num mt-1 truncate text-xs text-text-muted",children:[t.hostname,":",t.port,t.agent&&(0,b.jsxs)("span",{className:"ml-3 text-primary/70",children:["agent v",t.agent.version]}),v?.source&&(0,b.jsxs)("span",{className:"ml-3 uppercase tracking-wider",children:["source: ",v.source]})]})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)(w.t,{variant:(0,w.k)(t.status),children:t.status}),t.agent?.status==="UPDATING"&&(0,b.jsxs)(w.t,{variant:"info",children:[(0,b.jsx)(I.f,{className:"h-3 w-3 animate-spin mr-1 inline"}),"Upgrading…"]}),(0,b.jsx)(x,{metadata:t.metadata}),(0,b.jsx)(y.x,{readiness:t.upgradeReadiness}),(0,b.jsx)(A.K,{variant:"secondary",size:"sm",icon:(0,b.jsx)(D.f,{className:"h-3.5 w-3.5"}),onClick:()=>aa(!0),children:"Edit"}),(0,b.jsx)(A.K,{variant:"danger",size:"sm",icon:(0,b.jsx)(E.f,{className:"h-3.5 w-3.5"}),onClick:()=>void aU(),children:"Delete"})]})]}),t.upgradeReadiness?.status==="not-ready"&&(0,b.jsx)("div",{className:"mt-4",children:(0,b.jsx)(y.a,{readiness:t.upgradeReadiness})}),(0,b.jsxs)("div",{className:"mt-6 grid gap-6 xl:grid-cols-[auto_minmax(0,1fr)]",children:[(0,b.jsxs)("div",{className:"flex flex-wrap justify-center gap-4 sm:justify-start",children:[(0,b.jsx)(g.f,{value:v?.cpuUsagePercent??null,label:"CPU Usage",size:128,testId:"node-gauge-cpu"}),(0,b.jsx)(g.f,{value:v?.memoryPercent??null,label:"Memory",size:128,sublabel:v?`${(0,C.L)(v.memoryUsedBytes)}`:void 0,testId:"node-gauge-memory"}),(p=(v?ar(v.disks):[]).reduce((a,b)=>!a||b.usagePercent>a.usagePercent?b:a,null),(0,b.jsx)(g.f,{value:p?.usagePercent??null,label:"Disk",size:128,thresholds:{warn:80,crit:90},sublabel:p?.mountPoint,testId:"node-gauge-disk"}))]}),(0,b.jsx)(s,{nodeId:t.id,height:170})]})]}),("DEGRADED"===t.status||t.agent?.status==="ERROR")&&(()=>{try{let a=JSON.parse(t.metadata),c="string"==typeof a.deployError?a.deployError:null,d="string"==typeof a.upgradeError?a.upgradeError:null,e=c??d;if(e)return(0,b.jsx)("div",{className:"rounded-panel border border-danger/40 bg-danger/5 p-4 shadow-[inset_3px_0_0_var(--color-danger),0_0_20px_var(--color-glow-danger)]",children:(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)(H.f,{className:"h-5 w-5 text-danger shrink-0 mt-0.5"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-sm font-medium text-danger",children:c?"Deploy Failed":"Agent Upgrade Failed"}),(0,b.jsx)("pre",{className:"mt-1 text-xs text-text-muted whitespace-pre-wrap font-mono",children:e})]})]})})}catch{}return null})(),"PROVISIONING"===t.status&&(0,b.jsx)("div",{className:"rounded-panel border border-info/40 bg-info/5 p-4 shadow-[inset_3px_0_0_var(--color-info)]",children:(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)(I.f,{className:"h-5 w-5 text-info animate-spin"}),(0,b.jsx)("p",{className:"text-xs uppercase tracking-wider text-info",children:"Deploying agent… Status will update automatically."})]})}),t.agent?.status==="UPDATING"&&(0,b.jsx)("div",{className:"rounded-panel border border-info/40 bg-info/5 p-4 shadow-[inset_3px_0_0_var(--color-info)]",children:(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)(I.f,{className:"h-5 w-5 text-info animate-spin"}),(0,b.jsx)("p",{className:"text-xs uppercase tracking-wider text-info",children:"Agent upgrade in progress… Status will update automatically."})]})}),(0,b.jsx)(ad,{nodeId:t.id,nodeStatus:t.status}),(0,b.jsx)(aq,{telemetry:X}),(0,b.jsx)(ai,{node:{id:t.id,name:t.name,hostname:t.hostname,status:t.status,lastHeartbeatAt:t.lastHeartbeatAt}}),(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]",children:[(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)(e.N,{title:"Node Information",children:(0,b.jsxs)("dl",{className:"space-y-2 text-sm",children:[[["OS",t.os],["Architecture",t.arch],["Address",`${t.ipAddress}:${t.port}`],["Tags",(()=>{try{let a=JSON.parse(t.tags);return a.length?a.join(", "):"—"}catch{return"—"}})()]].map(([a,c])=>(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:a}),(0,b.jsx)("dd",{className:"font-medium",children:c})]},a)),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Agent Version"}),(0,b.jsx)("dd",{className:"font-medium flex items-center gap-1.5",children:t.agent?.version??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Role"}),(0,b.jsx)("dd",{className:"font-medium",children:t.role?(0,b.jsxs)("button",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary hover:bg-primary/20 transition-colors cursor-pointer",onClick:()=>ac(!0),title:"Change role",children:[(0,b.jsx)(K.f,{className:"h-3 w-3"}),t.role.name]}):(0,b.jsx)("button",{className:"text-xs text-text-muted hover:text-primary transition-colors cursor-pointer",onClick:()=>ac(!0),children:"+ Assign Role"})})]}),[["Agent Status",t.agent?.status??"—"],["Last Heartbeat",(0,C.C)(t.lastHeartbeatAt)]].map(([a,c])=>(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:a}),(0,b.jsx)("dd",{className:"font-medium",children:c})]},a)),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Cockpit"}),(0,b.jsx)("dd",{className:"font-medium",children:v?.cockpitAvailable?(0,b.jsxs)("a",{href:`https://${t.ipAddress}:9090`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["Available",(0,b.jsx)(J.f,{className:"h-3 w-3"})]}):(0,b.jsx)("span",{className:"text-text-muted",children:"Not Available"})})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"CPU Cores"}),(0,b.jsx)("dd",{className:"font-medium",children:v?.cpuCores??"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Memory Used"}),(0,b.jsx)("dd",{className:"font-medium",children:v?`${(0,C.L)(v.memoryUsedBytes)} / ${(0,C.L)(v.memoryTotalBytes)}`:"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Swap Used"}),(0,b.jsx)("dd",{className:"font-medium",children:v&&v.swapTotalBytes?`${(0,C.L)(v.swapUsedBytes??0)} / ${(0,C.L)(v.swapTotalBytes)}`:"—"})]}),(0,b.jsxs)("div",{className:"flex justify-between",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Last Health Sample"}),(0,b.jsx)("dd",{className:"font-medium",children:v?(0,C.C)(v.timestamp):"—"})]})]})}),(0,b.jsx)(e.N,{title:"Hermes Agent",description:at(aj)?aj.displayName??aj.hostname:"No Hermes Agent installed or found",action:at(aj)?(0,b.jsx)(w.t,{variant:(0,w.k)(aj.status),children:aj.status}):void 0,children:at(aj)?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("dl",{className:"grid gap-2 text-sm sm:grid-cols-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Version"}),(0,b.jsx)("dd",{className:"font-mono text-xs",children:aj.version??"unknown"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Home"}),(0,b.jsx)("dd",{className:"font-mono text-xs break-all",children:aj.hermesHome})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Dashboard"}),(0,b.jsxs)("dd",{className:"mt-1 flex items-center gap-2",children:[(0,b.jsx)(w.t,{variant:(0,w.k)(aj.dashboardStatus),children:aj.dashboardStatus}),(0,b.jsx)("span",{className:"font-mono text-xs",children:(n=""===(m=(l=aj).dashboardHost.trim().toLowerCase().replace(/^\[|\]$/g,""))||"0.0.0.0"===m||"127.0.0.1"===m||"localhost"===m||"::"===m||"::1"===m?l.hostname:l.dashboardHost,`${n}:${l.dashboardPort}`)})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Gateway"}),(0,b.jsx)("dd",{className:"mt-1",children:(0,b.jsx)(w.t,{variant:(0,w.k)(aj.gatewayStatus),children:aj.gatewayStatus})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"API Server"}),(0,b.jsx)("dd",{className:"font-mono text-xs",children:aj.apiServerEnabled?`${aj.apiServerHost}:${aj.apiServerPort??"—"}`:"disabled"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Primary Provider"}),(0,b.jsxs)("dd",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[(0,b.jsx)(w.t,{variant:"unknown"===a0?"warning":"success",children:a0}),aj.configuration?.magnusRouterConfigured&&(0,b.jsx)(w.t,{variant:"success",children:"Magnus routed"})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Default Model"}),(0,b.jsx)("dd",{className:"font-mono text-xs break-all",children:a1})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"OpenAI Runtime"}),(0,b.jsx)("dd",{className:"mt-1",children:(0,b.jsx)(w.t,{variant:aj.configuration?.openaiRuntime==="codex_app_server"?"success":"warning",children:aj.configuration?.openaiRuntime==="codex_app_server"?"Codex app-server":"Hermes default"})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Web Search"}),(0,b.jsxs)("dd",{className:"mt-1 flex items-center gap-2 text-xs",children:[(0,b.jsx)(O.f,{className:"h-3.5 w-3.5 text-text-muted"}),(0,b.jsx)("span",{className:"font-mono break-all",children:a2})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Crawling"}),(0,b.jsxs)("dd",{className:"mt-1 flex items-center gap-2 text-xs",children:[(0,b.jsx)(Q,{className:"h-3.5 w-3.5 text-text-muted"}),(0,b.jsx)("span",{className:"font-mono break-all",children:a3})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Memory"}),(0,b.jsxs)("dd",{className:"mt-1",children:[(0,b.jsx)(w.t,{variant:aj.configuration?.hiveMemConfigured?"success":"warning",children:aj.configuration?.memoryProvider??"not configured"}),(0,b.jsx)(z.f,{configuration:aj.configuration})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Skills"}),(0,b.jsx)("dd",{className:"mt-1",children:(0,b.jsxs)("button",{type:"button",onClick:()=>aP(!0),className:"inline-flex items-center gap-1.5 rounded border border-border px-2 py-1 text-xs text-text hover:border-primary/60 hover:text-primary disabled:cursor-not-allowed disabled:opacity-50",disabled:0===aZ.length,children:[(0,b.jsx)(N.f,{className:"h-3.5 w-3.5"}),function(a){if(0===a.length)return"0 synced";let b=a.filter(a=>a.enabled).length;return`${b} enabled / ${a.length} total`}(aZ)]})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Last Sync"}),(0,b.jsx)("dd",{className:"text-xs",children:(0,C.C)(aj.lastSyncedAt)})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[aj.configuration?.modelBaseUrl&&(0,b.jsxs)("p",{className:"text-xs text-text-muted",children:["Base URL: ",(0,b.jsx)("span",{className:"font-mono",children:aj.configuration.modelBaseUrl})]}),aj.configuration?.configPath&&(0,b.jsxs)("p",{className:"text-xs text-text-muted",children:["Config: ",(0,b.jsx)("span",{className:"font-mono",children:aj.configuration.configPath})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(aj.profiles??[]).slice(0,6).map(a=>(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-text-muted",children:[(0,b.jsx)(L.f,{className:"h-3 w-3"}),a.name]},a.id)),(aj.profiles?.length??0)===0&&(0,b.jsx)("span",{className:"text-xs text-text-muted",children:"No profiles synced"})]}),(0,b.jsx)(A.K,{size:"sm",variant:"secondary",icon:(0,b.jsx)(J.f,{className:"h-3.5 w-3.5"}),onClick:()=>r.push(`/orchestra/web-gateway?installationId=${encodeURIComponent(aj.id)}`),children:"Open Dashboard"})]}):(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("p",{className:"text-sm text-text-muted",children:"No Hermes Agent is installed or currently detected on this node."}),aK&&(0,b.jsx)("p",{className:"text-xs text-success",children:aK}),aM&&(0,b.jsx)("p",{className:"text-xs text-danger",children:aM}),(0,b.jsx)(A.K,{size:"sm",variant:"secondary",icon:aI?(0,b.jsx)(I.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(M.f,{className:"h-3.5 w-3.5"}),disabled:!t||"ONLINE"!==t.status||aI,onClick:()=>void aT(),children:aI?"Starting Deployment...":"Deploy Hermes Agent"}),t?.status!=="ONLINE"&&(0,b.jsx)("p",{className:"text-xs text-text-muted",children:"Bring the Magnus agent online before starting automated Hermes deployment."})]})}),(0,b.jsx)(e.N,{title:"Service Checks",children:v&&as(v.services).length>0?(0,b.jsx)("div",{className:"space-y-2 text-sm",children:as(v.services).slice(0,8).map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded border border-border px-2 py-1.5",children:[(0,b.jsx)("span",{className:"font-medium",children:a.name}),(0,b.jsx)(w.t,{variant:"active"===a.status?"success":"failed"===a.status?"danger":"default",children:a.status})]},a.name))}):(0,b.jsx)("p",{className:"text-sm text-text-muted",children:"No service checks available from this node yet."})})]}),(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)(e.N,{title:"System Update Readiness",description:"Automatic apt policy and reboot state from the latest heartbeat",action:a5?(0,b.jsx)(w.t,{variant:a5.rebootRequired?"danger":"enabled"===a5.automaticUpdates?"success":"warning",children:a5.rebootRequired?"reboot required":a5.automaticUpdates.replace("_"," ")}):void 0,children:a5?(0,b.jsxs)("div",{className:"space-y-4",children:[a5.rebootRequired&&(0,b.jsxs)("div",{className:"flex gap-3 rounded border border-danger/30 bg-danger/10 p-3",children:[(0,b.jsx)(S.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-danger"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-sm font-medium text-danger",children:"Restart needed to finish installed updates"}),(0,b.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:a5.rebootRequiredPackages.length?a5.rebootRequiredPackages.slice(0,5).join(", "):"The operating system has set the reboot-required marker."})]})]}),(0,b.jsxs)("dl",{className:"space-y-2 text-sm",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Platform"}),(0,b.jsx)("dd",{className:"font-mono text-xs",children:a5.platform})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Automatic updates"}),(0,b.jsx)("dd",{children:(0,b.jsx)(w.t,{variant:"enabled"===a5.automaticUpdates?"success":"warning",children:a5.automaticUpdates})})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"unattended-upgrades"}),(0,b.jsx)("dd",{children:a5.unattendedUpgradesInstalled?"installed":"not installed"})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"full apt upgrade policy"}),(0,b.jsx)("dd",{children:a5.fullUpgradePolicyEnabled?"enabled":"not enabled"})]}),a5.timers.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)("dt",{className:"font-mono text-[11px] text-text-muted",children:a.name}),(0,b.jsx)("dd",{className:"font-mono text-[11px]",children:a.state})]},a.name))]}),a5.supported&&"enabled"!==a5.automaticUpdates&&(0,b.jsxs)(A.K,{size:"sm",variant:"primary",disabled:"ONLINE"!==t.status||aE,onClick:()=>void aY(),children:[aE?(0,b.jsx)(I.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(R.f,{className:"h-3.5 w-3.5"}),aE?"Enabling…":"Enable automatic updates"]}),aG&&(0,b.jsx)("p",{className:"text-xs text-danger",children:aG})]}):(0,b.jsx)("p",{className:"text-sm text-text-muted",children:"Update posture will appear after agent v1.6.0 reports its first heartbeat."})}),(0,b.jsx)(e.N,{title:"Wazuh Agent",description:"Endpoint-security posture from the latest node heartbeat",action:a4?(0,b.jsx)(w.t,{variant:"active"===(a=a4.serviceStatus)?"success":"failed"===a?"danger":"inactive"===a?"warning":"default",children:a4.serviceStatus.replace("_"," ")}):void 0,children:a4?(0,b.jsxs)("dl",{className:"space-y-2 text-sm",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Installation"}),(0,b.jsx)("dd",{children:(0,b.jsx)(w.t,{variant:a4.installed?"success":"default",children:a4.installed?"installed":"not installed"})})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Startup"}),(0,b.jsx)("dd",{className:"font-medium",children:a4.enabled})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Version"}),(0,b.jsx)("dd",{className:"font-mono text-xs",children:a4.version??"—"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("dt",{className:"text-text-muted",children:"Managers"}),(0,b.jsx)("dd",{className:"mt-1 font-mono text-xs break-all",children:a4.managerAddresses.length?a4.managerAddresses.join(", "):"—"})]})]}):(0,b.jsx)("p",{className:"text-sm text-text-muted",children:"Wazuh posture will appear after this host reports a current Magnus agent heartbeat."})}),(0,b.jsx)(e.N,{title:"Disk Usage",children:v&&ar(v.disks).length?(0,b.jsx)("div",{className:"space-y-3",children:ar(v.disks).map(a=>(0,b.jsxs)("div",{className:"text-sm",children:[(0,b.jsxs)("div",{className:"flex justify-between text-xs",children:[(0,b.jsx)("span",{className:"text-text-muted",children:a.mountPoint}),(0,b.jsxs)("span",{className:"num",children:[(0,C.L)(a.usedBytes)," / ",(0,C.L)(a.totalBytes)]})]}),(0,b.jsx)(h.f,{value:a.usagePercent,thresholds:{warn:80,crit:90},size:"sm",label:`${a.mountPoint} disk usage`,showValue:!0,className:"mt-1"})]},a.mountPoint))}):(0,b.jsx)("p",{className:"text-sm text-text-muted",children:"No disk data available"})}),(0,b.jsx)(e.N,{title:"Capacity Forecast",description:"Per-volume 30-day growth trend and estimated time to full",children:V.length?(0,b.jsx)("div",{className:"space-y-3",children:V.map(a=>(0,b.jsxs)("div",{className:"rounded border border-border/50 p-3 text-xs",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsx)("span",{className:"font-mono text-text",children:a.mountPoint}),(0,b.jsx)(w.t,{variant:null!==a.daysUntilFull&&a.daysUntilFull<=14?"danger":null!==a.daysUntilFull&&a.daysUntilFull<=30?"warning":"default",children:null===a.daysUntilFull?a.growthRatePerDay>0?"trend uncertain":"stable/shrinking":`${a.daysUntilFull}d to full`})]}),(0,b.jsxs)("div",{className:"mt-2 text-text-muted",children:[a.currentUsagePercent.toFixed(1),"% used · ",(0,C.L)(Math.abs(a.growthRatePerDay)),"/day ",a.growthRatePerDay>=0?"growth":"reclaimed"," · confidence ",(100*a.confidence).toFixed(0),"%"]}),(0,b.jsx)("p",{className:"mt-2 text-text-muted",children:a.recommendation})]},a.mountPoint))}):(0,b.jsx)("p",{className:"text-sm text-text-muted",children:"At least three retained samples are needed for a capacity forecast."})}),(0,b.jsxs)(e.N,{title:"Software Revisions",description:"Major runtime versions and package update status",action:(0,b.jsx)(A.K,{variant:"ghost",size:"sm",onClick:()=>void aV(),children:(0,b.jsx)(G.f,{className:`h-3.5 w-3.5 ${al?"animate-spin":""}`})}),children:[(0,b.jsxs)("div",{className:"space-y-2 text-sm",children:[["node","npm","python3","redis","docker","tailscale","magnus-agent"].map(a=>(0,b.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,b.jsx)("dt",{className:"text-text-muted uppercase text-xs tracking-wide",children:a}),(0,b.jsx)("dd",{className:"font-mono text-right text-xs break-all",children:ag[a]??(al?"Loading…":"—")})]},a)),an&&(0,b.jsx)("p",{className:"text-xs text-danger",children:an})]}),(0,b.jsxs)("div",{className:"mt-4 border-t border-border pt-4 space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-xs uppercase tracking-wide text-text-muted",children:"APT Updates"}),(0,b.jsx)(w.t,{variant:ap&&ap>0?"warning":"success",children:ay?"Checking…":`${ap??"—"} pending`})]}),(0,b.jsxs)("p",{className:"text-xs text-text-muted",children:["Refreshed hourly via apt update",aw?` • Last check: ${(0,C.C)(aw)}`:""]}),aA&&(0,b.jsx)("p",{className:"text-xs text-danger",children:aA}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(A.K,{size:"sm",variant:"secondary",disabled:"ONLINE"!==t.status||ay,onClick:()=>void aW(),children:[(0,b.jsx)(G.f,{className:`h-3.5 w-3.5 ${ay?"animate-spin":""}`}),"Refresh"]}),(0,b.jsxs)(A.K,{size:"sm",variant:"primary",disabled:"ONLINE"!==t.status||aC,onClick:()=>void aX(),children:[aC?(0,b.jsx)(I.f,{className:"h-3.5 w-3.5 animate-spin"}):null,aC?"Dispatching…":"APT Upgrade"]})]})]})]})]})]}),ae.length>0&&(0,b.jsx)(e.N,{title:"Role Applications",children:(0,b.jsx)("div",{className:"space-y-4",children:ae.map(a=>(0,b.jsxs)("div",{className:"rounded-lg border border-border p-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(K.f,{className:"h-4 w-4 text-primary"}),(0,b.jsxs)("span",{className:"text-sm font-medium",children:["apply"===a.action?"Apply":"Remove",": ",a.role?.name??"Unknown"]})]}),(0,b.jsx)(w.t,{variant:"completed"===a.status?"success":"failed"===a.status?"danger":"running"===a.status?"info":"default",children:a.status})]}),a.error&&(0,b.jsx)("div",{className:"mb-2 rounded border border-danger/30 bg-danger/10 px-2 py-1 text-xs text-danger font-mono",children:a.error}),(0,b.jsx)("div",{className:"space-y-1",children:a.steps.map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,b.jsxs)("span",{className:"completed"===a.status?"text-success":"failed"===a.status?"text-danger":"running"===a.status?"text-info":"skipped"===a.status?"text-text-muted/50":"text-text-muted",children:["completed"===a.status&&"✓","failed"===a.status&&"✗","running"===a.status&&"⟳","skipped"===a.status&&"—","pending"===a.status&&"○"]}),(0,b.jsx)("span",{className:"skipped"===a.status?"text-text-muted/50 line-through":"",children:a.name}),a.error&&(0,b.jsx)("span",{className:"text-danger ml-2 truncate max-w-xs",title:a.error,children:a.error})]},a.name))}),(0,b.jsxs)("div",{className:"mt-2 text-[10px] text-text-muted",children:[a.startedAt?`Started: ${(0,C.C)(a.startedAt)}`:"",a.completedAt?` — Completed: ${(0,C.C)(a.completedAt)}`:""]})]},a.id))})}),(0,b.jsx)(B.n,{open:aO,onClose:()=>aP(!1),title:"Hermes Skills",description:`${a_.length} enabled on ${t.name}`,icon:(0,b.jsx)(N.f,{className:"h-5 w-5 text-primary"}),className:"max-w-3xl",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[(0,b.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,b.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Enabled"}),(0,b.jsx)("p",{className:"mt-1 text-lg font-semibold",children:a_.length})]}),(0,b.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,b.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Total"}),(0,b.jsx)("p",{className:"mt-1 text-lg font-semibold",children:aZ.length})]}),(0,b.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,b.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Sources"}),(0,b.jsx)("p",{className:"mt-1 text-sm font-mono",children:Array.from(new Set(aZ.map(a=>a.source))).filter(Boolean).join(", ")||"unknown"})]})]}),(0,b.jsxs)("div",{className:"max-h-[55vh] overflow-auto rounded border border-border",children:[(0,b.jsxs)("table",{className:"w-full text-left text-xs",children:[(0,b.jsx)("thead",{className:"sticky top-0 bg-surface text-[10px] uppercase tracking-wide text-text-muted",children:(0,b.jsxs)("tr",{children:[(0,b.jsx)("th",{className:"px-3 py-2 font-medium",children:"Skill"}),(0,b.jsx)("th",{className:"px-3 py-2 font-medium",children:"Category"}),(0,b.jsx)("th",{className:"px-3 py-2 font-medium",children:"Source"}),(0,b.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"})]})}),(0,b.jsx)("tbody",{className:"divide-y divide-border",children:aZ.slice().sort((a,b)=>Number(b.enabled)-Number(a.enabled)||a.slug.localeCompare(b.slug)).map(a=>(0,b.jsxs)("tr",{className:"bg-bg/20",children:[(0,b.jsx)("td",{className:"px-3 py-2 font-mono",children:a.slug}),(0,b.jsx)("td",{className:"px-3 py-2 text-text-muted",children:a.category??"uncategorized"}),(0,b.jsx)("td",{className:"px-3 py-2 text-text-muted",children:a.source}),(0,b.jsx)("td",{className:"px-3 py-2",children:(0,b.jsx)(w.t,{variant:a.enabled?"success":"default",children:a.enabled?"enabled":"disabled"})})]},`${a.slug}-${a.source}`))})]}),0===aZ.length&&(0,b.jsx)("div",{className:"p-6 text-sm text-text-muted",children:"No synced Hermes skills were reported for this node."})]})]})}),(0,b.jsx)(U.F,{open:_,node:t,onClose:()=>aa(!1),onSaved:()=>void aS()}),(0,b.jsx)(U.E,{open:ab,node:t?{id:t.id,name:t.name,role:t.role}:null,onClose:()=>ac(!1),onSaved:a=>{aR.current=a,t&&u({...t,role:a}),aS()}})]})}],31184)}];
2
2
 
3
3
  //# sourceMappingURL=apps_dashboard_src_app_nodes_%5BnodeId%5D_page_tsx_1q7fqu18oklzc._.js.map
@@ -1,4 +1,4 @@
1
- module.exports=[83679,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(49521),e=a.i(58299),f=a.i(68415),g=a.i(29147),h=a.i(46997),i=a.i(8897),j=a.i(3512),k=a.i(19783),l=a.i(90629),m=a.i(51675),n=a.i(10117),o=a.i(75160),p=a.i(97546),q=a.i(90702),r=a.i(36273),s=a.i(57307),t=a.i(90363),u=a.i(13931),v=a.i(34532),w=a.i(42973);let x=["/boot","/snap","/var/lib/docker/","/var/lib/containers/"],y=new Set(["iso9660","squashfs"]);var z=a.i(38246),A=a.i(7574),B=a.i(8884),C=a.i(36670),D=a.i(33838),E=a.i(39315),F=a.i(64831);let G={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};G.node;let H=(0,F.f)(G);var I=a.i(41476),J=a.i(85264),K=a.i(57547);function L(a){return a?.isGitRepo!==!1&&a?.legacyGitSelfUpdate===!0}function M(){let{activeNode:a,removeNode:d}=(0,i.l)(),[g,j]=(0,c.useState)("checking"),l=(0,c.useRef)(null),[n,p]=(0,c.useState)(null),[q,r]=(0,c.useState)(!1),[s,t]=(0,c.useState)(null),[u,x]=(0,c.useState)(null),[y,z]=(0,c.useState)("idle"),[A,F]=(0,c.useState)(null),[G,M]=(0,c.useState)(null),[N,O]=(0,c.useState)(!1),[P,Q]=(0,c.useState)(null),[R,S]=(0,c.useState)(!1),T=(0,c.useCallback)(async()=>{try{let b=(0,K.L)(a.url),c=await fetch("/api/proxy/health",{method:"GET",headers:b,signal:AbortSignal.timeout(8e3)});j(c.ok?"online":"offline")}catch{j("offline")}},[a.url]),U=(0,c.useCallback)(async()=>{try{let a=await h.f.selfUpdate.version();a.success&&p(a.data??null)}catch{}},[]);(0,c.useEffect)(()=>(j("checking"),p(null),r(!1),x(null),F(null),M(null),T(),U(),l.current=setInterval(()=>{T()},3e4),()=>{l.current&&(clearInterval(l.current),l.current=null)}),[a.id,T,U]);let V=async()=>{z("checking"),M(null),F(null);try{let a=await h.f.selfUpdate.status();a.success&&t(a.data??null);let b=await h.f.selfUpdate.check();b.success&&(x(b.data??null),b.data.error?M(b.data.error):b.data.available||F("Already up to date."))}catch(b){let a="Failed to check for updates";if(b&&"object"==typeof b&&"response"in b)try{let c=(0,B.R)(await (0,B.O)(b));c&&(a=c)}catch{}else b instanceof Error&&(a=b.message);M(a)}finally{z("idle")}},W=async a=>{z("applying"),M(null),F(null);try{let b=await h.f.selfUpdate.apply(a);if(b.success){let a=b.data;if(!a)return;a.updated?F(`Updated from v${a.previousVersion} → v${a.currentVersion}`+(a.restart?.scheduled?`. Restarting via ${a.restart.method}…`:". Restart manually to apply.")):F("Code pulled but no version change detected."),x(null),U();let c=await h.f.selfUpdate.status();c.success&&t(c.data??null)}}catch(a){M(a instanceof Error?a.message:"Update failed")}finally{z("idle")}},X=async()=>{z("restarting"),M(null);try{let a=await h.f.selfUpdate.restart();a.success&&F(`Restart scheduled via ${a.data.method}. Reconnecting shortly…`)}catch(a){M(a instanceof Error?a.message:"Restart failed")}finally{z("idle")}},Y=async()=>{if(confirm(`Delete control node "${a.name}"? You'll be switched to another node.`))try{await d(a.id)}catch{}};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"rounded border border-border bg-surface",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-5 py-3",children:[(0,b.jsx)("div",{className:"flex items-center gap-4 min-w-0",children:(0,b.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,b.jsx)(v.f,{className:"h-4.5 w-4.5 text-primary shrink-0"}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5 rounded border border-border bg-bg px-2.5 py-1 text-xs font-bold min-w-0",children:[(0,b.jsx)(v.f,{className:"h-3.5 w-3.5 shrink-0 text-text-muted"}),(0,b.jsx)("span",{className:"truncate",children:a.name})]}),(0,b.jsx)("button",{onClick:()=>{Q(a.id),S(!1),O(!0)},className:"rounded border border-border bg-bg p-1.5 text-text-muted transition-all hover:bg-surface-hover hover:text-text hover:border-primary/30 hover:shadow-[0_0_20px_var(--color-glow)]",title:"Control Node Settings",children:(0,b.jsx)(I.f,{className:"h-3.5 w-3.5"})}),(()=>{switch(g){case"checking":return(0,b.jsxs)(e.t,{variant:"info",children:[(0,b.jsx)(o.f,{className:"mr-1 h-3 w-3 animate-spin"}),"Checking"]});case"online":return(0,b.jsx)(e.t,{variant:"success",children:"Online"});case"offline":return(0,b.jsx)(e.t,{variant:"danger",children:"Offline"})}})()]}),(0,b.jsxs)("div",{className:"text-xs text-text-muted truncate mt-0.5",children:[a.url,n&&(0,b.jsxs)("span",{className:"ml-2",children:["v",n.controlApiVersion]})]})]})]})}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,b.jsxs)(f.K,{variant:"ghost",size:"sm",title:"Check for updates",onClick:()=>{q?r(!1):(r(!0),(async()=>{try{let a=await h.f.selfUpdate.status();a.success&&(t(a.data??null),L(a.data)&&V())}catch{}})())},children:[(0,b.jsx)(w.f,{className:"h-3.5 w-3.5 text-primary"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:"Update"})]}),(0,b.jsx)(f.K,{variant:"ghost",size:"sm",title:"Delete control node",onClick:()=>void Y(),children:(0,b.jsx)(m.f,{className:"h-3.5 w-3.5 text-danger"})}),(0,b.jsx)(f.K,{variant:"ghost",size:"sm",title:"Refresh status",onClick:()=>{j("checking"),T(),U()},children:(0,b.jsx)(k.f,{className:"h-3.5 w-3.5"})})]})]}),q&&(0,b.jsxs)("div",{className:"border-t border-border px-5 py-3 space-y-3",children:[G&&(0,b.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 p-3 text-xs text-danger",children:G}),A&&(0,b.jsx)("div",{className:"rounded border border-success/30 bg-success/10 p-3 text-xs text-success",children:A}),s&&(0,b.jsxs)("div",{className:"flex flex-wrap gap-x-6 gap-y-1 text-[11px] text-text-muted",children:[(0,b.jsxs)("span",{children:["Control API: ",(0,b.jsxs)("span",{className:"text-text",children:["v",s.controlApiVersion]})]}),(0,b.jsxs)("span",{children:["Agent: ",(0,b.jsxs)("span",{className:"text-text",children:["v",s.agentVersion]})]}),s.gitBranch&&(0,b.jsxs)("span",{className:"flex items-center gap-1",children:[(0,b.jsx)(E.f,{className:"h-3 w-3"}),(0,b.jsx)("span",{className:"text-text",children:s.gitBranch})]}),s.gitCommit&&(0,b.jsxs)("span",{children:["Commit: ",(0,b.jsx)("span",{className:"text-text",children:s.gitCommit})]}),s.lastChecked&&(0,b.jsxs)("span",{children:["Checked: ",new Date(s.lastChecked).toLocaleString()]})]}),s&&!L(s)&&(0,b.jsxs)("div",{className:"rounded border border-primary/30 bg-primary/10 p-3 text-xs text-text-muted",children:[(0,b.jsx)("span",{className:"font-bold text-primary",children:"Upgrade on the server host"}),(0,b.jsxs)("span",{className:"ml-1",children:["with ",(0,b.jsx)("code",{className:"rounded bg-surface px-1 text-text",children:s.upgradeCommand??"magnus upgrade"}),": it backs up the database, migrates, restarts and switches back automatically if the new version is unhealthy."]})]}),u?.available&&(0,b.jsxs)("div",{className:"rounded border border-warning/30 bg-warning/10 p-3 text-xs",children:[(0,b.jsx)("span",{className:"font-bold text-warning uppercase tracking-wider",children:"Update available"}),(0,b.jsxs)("span",{className:"text-text-muted ml-1",children:["— ",u.behindBy," commit",1!==u.behindBy?"s":""," behind (",u.currentCommit," → ",u.remoteCommit,")"]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[L(s)&&(0,b.jsx)(f.K,{variant:"secondary",size:"sm",onClick:()=>void V(),disabled:"idle"!==y,icon:"checking"===y?(0,b.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(k.f,{className:"h-3.5 w-3.5"}),children:"checking"===y?"Checking…":"Check for Updates"}),L(s)&&u?.available&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f.K,{variant:"primary",size:"sm",onClick:()=>void W(!1),disabled:"idle"!==y,icon:"applying"===y?(0,b.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(C.f,{className:"h-3.5 w-3.5"}),children:"applying"===y?"Updating…":"Pull & Build"}),(0,b.jsx)(f.K,{variant:"primary",size:"sm",onClick:()=>void W(!0),disabled:"idle"!==y,icon:"applying"===y?(0,b.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(D.f,{className:"h-3.5 w-3.5"}),children:"applying"===y?"Updating…":"Pull, Build & Restart"})]}),L(s)&&(0,b.jsx)(f.K,{variant:"ghost",size:"sm",onClick:()=>void X(),disabled:"idle"!==y,icon:"restarting"===y?(0,b.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(D.f,{className:"h-3.5 w-3.5"}),children:"restarting"===y?"Restarting…":"Restart Only"}),(0,b.jsx)("div",{className:"ml-auto",children:(0,b.jsx)(f.K,{variant:"ghost",size:"sm",onClick:()=>r(!1),icon:(0,b.jsx)(H,{className:"h-3.5 w-3.5"}),children:"Close"})})]})]})]}),(0,b.jsx)(J.f,{open:N,onClose:()=>{O(!1),Q(null),S(!1),T(),U()},editNodeId:P,createMode:R})]})}var N=a.i(85063);function O({open:d,onClose:e,node:f}){let g=(0,c.useRef)(null),h=(0,c.useRef)(null),i=(0,c.useRef)(null),j=(0,c.useRef)(null),k=(0,c.useRef)(!1),l=(0,c.useRef)(null),[m,n]=(0,c.useState)("connecting"),o=(0,c.useRef)(""),p=(0,c.useRef)(null),q=(0,c.useCallback)(()=>{p.current=null;let a=o.current;a&&j.current&&(o.current="",fetch("/api/terminal/input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:j.current,data:a})}).catch(()=>{}))},[]),r=(0,c.useCallback)(()=>{if(!k.current){k.current=!0,p.current&&(clearTimeout(p.current),p.current=null),l.current?.abort(),l.current=null,j.current&&(fetch("/api/terminal/close",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:j.current})}).catch(()=>{}),j.current=null);try{h.current?.dispose()}catch{}h.current=null,i.current=null}},[]);(0,c.useEffect)(()=>{if(!d||!f||!g.current)return;k.current=!1,n("connecting");let b=!1;(async()=>{let c,{Terminal:d}=await a.A(81888),{FitAddon:e}=await a.A(71789);if(!document.getElementById("xterm-css")){let a=document.createElement("style");a.id="xterm-css",a.textContent=`
1
+ module.exports=[83679,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(49521),e=a.i(58299),f=a.i(68415),g=a.i(29147),h=a.i(46997),i=a.i(8897),j=a.i(3512),k=a.i(19783),l=a.i(90629),m=a.i(51675),n=a.i(10117),o=a.i(75160),p=a.i(21327),q=a.i(68579),r=a.i(36273),s=a.i(57307),t=a.i(90363),u=a.i(13931),v=a.i(34532),w=a.i(42973);let x=["/boot","/snap","/var/lib/docker/","/var/lib/containers/"],y=new Set(["iso9660","squashfs"]);var z=a.i(38246),A=a.i(7574),B=a.i(8884),C=a.i(36670),D=a.i(33838),E=a.i(39315),F=a.i(64831);let G={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};G.node;let H=(0,F.f)(G);var I=a.i(41476),J=a.i(85264),K=a.i(57547);function L(a){return a?.isGitRepo!==!1&&a?.legacyGitSelfUpdate===!0}function M(){let{activeNode:a,removeNode:d}=(0,i.l)(),[g,j]=(0,c.useState)("checking"),l=(0,c.useRef)(null),[n,p]=(0,c.useState)(null),[q,r]=(0,c.useState)(!1),[s,t]=(0,c.useState)(null),[u,x]=(0,c.useState)(null),[y,z]=(0,c.useState)("idle"),[A,F]=(0,c.useState)(null),[G,M]=(0,c.useState)(null),[N,O]=(0,c.useState)(!1),[P,Q]=(0,c.useState)(null),[R,S]=(0,c.useState)(!1),T=(0,c.useCallback)(async()=>{try{let b=(0,K.L)(a.url),c=await fetch("/api/proxy/health",{method:"GET",headers:b,signal:AbortSignal.timeout(8e3)});j(c.ok?"online":"offline")}catch{j("offline")}},[a.url]),U=(0,c.useCallback)(async()=>{try{let a=await h.f.selfUpdate.version();a.success&&p(a.data??null)}catch{}},[]);(0,c.useEffect)(()=>(j("checking"),p(null),r(!1),x(null),F(null),M(null),T(),U(),l.current=setInterval(()=>{T()},3e4),()=>{l.current&&(clearInterval(l.current),l.current=null)}),[a.id,T,U]);let V=async()=>{z("checking"),M(null),F(null);try{let a=await h.f.selfUpdate.status();a.success&&t(a.data??null);let b=await h.f.selfUpdate.check();b.success&&(x(b.data??null),b.data.error?M(b.data.error):b.data.available||F("Already up to date."))}catch(b){let a="Failed to check for updates";if(b&&"object"==typeof b&&"response"in b)try{let c=(0,B.R)(await (0,B.O)(b));c&&(a=c)}catch{}else b instanceof Error&&(a=b.message);M(a)}finally{z("idle")}},W=async a=>{z("applying"),M(null),F(null);try{let b=await h.f.selfUpdate.apply(a);if(b.success){let a=b.data;if(!a)return;a.updated?F(`Updated from v${a.previousVersion} → v${a.currentVersion}`+(a.restart?.scheduled?`. Restarting via ${a.restart.method}…`:". Restart manually to apply.")):F("Code pulled but no version change detected."),x(null),U();let c=await h.f.selfUpdate.status();c.success&&t(c.data??null)}}catch(a){M(a instanceof Error?a.message:"Update failed")}finally{z("idle")}},X=async()=>{z("restarting"),M(null);try{let a=await h.f.selfUpdate.restart();a.success&&F(`Restart scheduled via ${a.data.method}. Reconnecting shortly…`)}catch(a){M(a instanceof Error?a.message:"Restart failed")}finally{z("idle")}},Y=async()=>{if(confirm(`Delete control node "${a.name}"? You'll be switched to another node.`))try{await d(a.id)}catch{}};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"rounded border border-border bg-surface",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-5 py-3",children:[(0,b.jsx)("div",{className:"flex items-center gap-4 min-w-0",children:(0,b.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,b.jsx)(v.f,{className:"h-4.5 w-4.5 text-primary shrink-0"}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5 rounded border border-border bg-bg px-2.5 py-1 text-xs font-bold min-w-0",children:[(0,b.jsx)(v.f,{className:"h-3.5 w-3.5 shrink-0 text-text-muted"}),(0,b.jsx)("span",{className:"truncate",children:a.name})]}),(0,b.jsx)("button",{onClick:()=>{Q(a.id),S(!1),O(!0)},className:"rounded border border-border bg-bg p-1.5 text-text-muted transition-all hover:bg-surface-hover hover:text-text hover:border-primary/30 hover:shadow-[0_0_20px_var(--color-glow)]",title:"Control Node Settings",children:(0,b.jsx)(I.f,{className:"h-3.5 w-3.5"})}),(()=>{switch(g){case"checking":return(0,b.jsxs)(e.t,{variant:"info",children:[(0,b.jsx)(o.f,{className:"mr-1 h-3 w-3 animate-spin"}),"Checking"]});case"online":return(0,b.jsx)(e.t,{variant:"success",children:"Online"});case"offline":return(0,b.jsx)(e.t,{variant:"danger",children:"Offline"})}})()]}),(0,b.jsxs)("div",{className:"text-xs text-text-muted truncate mt-0.5",children:[a.url,n&&(0,b.jsxs)("span",{className:"ml-2",children:["v",n.controlApiVersion]})]})]})]})}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,b.jsxs)(f.K,{variant:"ghost",size:"sm",title:"Check for updates",onClick:()=>{q?r(!1):(r(!0),(async()=>{try{let a=await h.f.selfUpdate.status();a.success&&(t(a.data??null),L(a.data)&&V())}catch{}})())},children:[(0,b.jsx)(w.f,{className:"h-3.5 w-3.5 text-primary"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:"Update"})]}),(0,b.jsx)(f.K,{variant:"ghost",size:"sm",title:"Delete control node",onClick:()=>void Y(),children:(0,b.jsx)(m.f,{className:"h-3.5 w-3.5 text-danger"})}),(0,b.jsx)(f.K,{variant:"ghost",size:"sm",title:"Refresh status",onClick:()=>{j("checking"),T(),U()},children:(0,b.jsx)(k.f,{className:"h-3.5 w-3.5"})})]})]}),q&&(0,b.jsxs)("div",{className:"border-t border-border px-5 py-3 space-y-3",children:[G&&(0,b.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 p-3 text-xs text-danger",children:G}),A&&(0,b.jsx)("div",{className:"rounded border border-success/30 bg-success/10 p-3 text-xs text-success",children:A}),s&&(0,b.jsxs)("div",{className:"flex flex-wrap gap-x-6 gap-y-1 text-[11px] text-text-muted",children:[(0,b.jsxs)("span",{children:["Control API: ",(0,b.jsxs)("span",{className:"text-text",children:["v",s.controlApiVersion]})]}),(0,b.jsxs)("span",{children:["Agent: ",(0,b.jsxs)("span",{className:"text-text",children:["v",s.agentVersion]})]}),s.gitBranch&&(0,b.jsxs)("span",{className:"flex items-center gap-1",children:[(0,b.jsx)(E.f,{className:"h-3 w-3"}),(0,b.jsx)("span",{className:"text-text",children:s.gitBranch})]}),s.gitCommit&&(0,b.jsxs)("span",{children:["Commit: ",(0,b.jsx)("span",{className:"text-text",children:s.gitCommit})]}),s.lastChecked&&(0,b.jsxs)("span",{children:["Checked: ",new Date(s.lastChecked).toLocaleString()]})]}),s&&!L(s)&&(0,b.jsxs)("div",{className:"rounded border border-primary/30 bg-primary/10 p-3 text-xs text-text-muted",children:[(0,b.jsx)("span",{className:"font-bold text-primary",children:"Upgrade on the server host"}),(0,b.jsxs)("span",{className:"ml-1",children:["with ",(0,b.jsx)("code",{className:"rounded bg-surface px-1 text-text",children:s.upgradeCommand??"magnus upgrade"}),": it backs up the database, migrates, restarts and switches back automatically if the new version is unhealthy."]})]}),u?.available&&(0,b.jsxs)("div",{className:"rounded border border-warning/30 bg-warning/10 p-3 text-xs",children:[(0,b.jsx)("span",{className:"font-bold text-warning uppercase tracking-wider",children:"Update available"}),(0,b.jsxs)("span",{className:"text-text-muted ml-1",children:["— ",u.behindBy," commit",1!==u.behindBy?"s":""," behind (",u.currentCommit," → ",u.remoteCommit,")"]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[L(s)&&(0,b.jsx)(f.K,{variant:"secondary",size:"sm",onClick:()=>void V(),disabled:"idle"!==y,icon:"checking"===y?(0,b.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(k.f,{className:"h-3.5 w-3.5"}),children:"checking"===y?"Checking…":"Check for Updates"}),L(s)&&u?.available&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f.K,{variant:"primary",size:"sm",onClick:()=>void W(!1),disabled:"idle"!==y,icon:"applying"===y?(0,b.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(C.f,{className:"h-3.5 w-3.5"}),children:"applying"===y?"Updating…":"Pull & Build"}),(0,b.jsx)(f.K,{variant:"primary",size:"sm",onClick:()=>void W(!0),disabled:"idle"!==y,icon:"applying"===y?(0,b.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(D.f,{className:"h-3.5 w-3.5"}),children:"applying"===y?"Updating…":"Pull, Build & Restart"})]}),L(s)&&(0,b.jsx)(f.K,{variant:"ghost",size:"sm",onClick:()=>void X(),disabled:"idle"!==y,icon:"restarting"===y?(0,b.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(D.f,{className:"h-3.5 w-3.5"}),children:"restarting"===y?"Restarting…":"Restart Only"}),(0,b.jsx)("div",{className:"ml-auto",children:(0,b.jsx)(f.K,{variant:"ghost",size:"sm",onClick:()=>r(!1),icon:(0,b.jsx)(H,{className:"h-3.5 w-3.5"}),children:"Close"})})]})]})]}),(0,b.jsx)(J.f,{open:N,onClose:()=>{O(!1),Q(null),S(!1),T(),U()},editNodeId:P,createMode:R})]})}var N=a.i(85063);function O({open:d,onClose:e,node:f}){let g=(0,c.useRef)(null),h=(0,c.useRef)(null),i=(0,c.useRef)(null),j=(0,c.useRef)(null),k=(0,c.useRef)(!1),l=(0,c.useRef)(null),[m,n]=(0,c.useState)("connecting"),o=(0,c.useRef)(""),p=(0,c.useRef)(null),q=(0,c.useCallback)(()=>{p.current=null;let a=o.current;a&&j.current&&(o.current="",fetch("/api/terminal/input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:j.current,data:a})}).catch(()=>{}))},[]),r=(0,c.useCallback)(()=>{if(!k.current){k.current=!0,p.current&&(clearTimeout(p.current),p.current=null),l.current?.abort(),l.current=null,j.current&&(fetch("/api/terminal/close",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:j.current})}).catch(()=>{}),j.current=null);try{h.current?.dispose()}catch{}h.current=null,i.current=null}},[]);(0,c.useEffect)(()=>{if(!d||!f||!g.current)return;k.current=!1,n("connecting");let b=!1;(async()=>{let c,{Terminal:d}=await a.A(81888),{FitAddon:e}=await a.A(71789);if(!document.getElementById("xterm-css")){let a=document.createElement("style");a.id="xterm-css",a.textContent=`
2
2
  .xterm { position: relative; user-select: none; }
3
3
  .xterm.focus, .xterm:focus { outline: none; }
4
4
  .xterm .xterm-helpers { position: absolute; top: 0; z-index: 5; }
@@ -1,3 +1,3 @@
1
- module.exports=[37618,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(23319),e=a.i(75027),f=a.i(83102),g=a.i(26314),h=a.i(46997),i=a.i(49521),j=a.i(58299),k=a.i(85063),l=a.i(73771),m=a.i(68370),n=a.i(38835),o=a.i(13931),p=a.i(64831);let q={name:"refresh-ccw",size:24,node:[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]};q.node;let r=(0,p.f)(q);var s=a.i(33838);function t(a){return a.displayName??a.hostname}function u({installation:a,frameSrc:d,frameTitle:e,heightClass:g="h-[720px]",emptyMessage:i="Select a Hermes installation with dashboard access."}){let[k,l]=(0,c.useState)(!1),[p,q]=(0,c.useState)(0),[v,w]=(0,c.useState)(null),[x,y]=(0,c.useState)(null),[z,A]=(0,c.useState)(null);(0,c.useEffect)(()=>{l(!1),q(0),y(null),A(null)},[a?.id,d]);let B=!!(a&&d),C=d?`${d}${d.includes("?")?"&":"?"}frame=${p}`:"";async function D(b,c=!1){if(a){w(b),A(null),y(null);try{let d=await h.f.hermes.dashboardAction(a.id,b),e=d.data?.id?` Job ${d.data.id.slice(0,8)} queued.`:"";y(`${"launch"===b?"Launch":b} requested for ${t(a)}.${e}`),c&&window.setTimeout(()=>{q(a=>a+1),l(!0)},2500)}catch(a){A(a instanceof Error?a.message:`Failed to ${b} Hermes Dashboard`)}finally{w(null)}}}return a?(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded border border-border/50 bg-bg/50 p-3",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-text",children:t(a)}),(0,b.jsxs)(j.t,{variant:(0,j.k)(a.dashboardStatus),children:["dashboard ",a.dashboardStatus]}),(0,b.jsxs)("span",{className:"rounded border border-border px-2 py-1 font-mono text-[10px] text-text-muted",children:["127.0.0.1:",a.dashboardPort]})]}),(0,b.jsx)("p",{className:"mt-1 truncate text-[11px] text-text-muted",children:a.hostname})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>void D("launch",!0),disabled:null!==v,className:"inline-flex h-8 items-center justify-center gap-2 rounded border border-primary/60 bg-primary/10 px-3 text-[11px] font-bold uppercase tracking-wider text-primary transition-all hover:bg-primary/20 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,b.jsx)(n.f,{className:"h-3.5 w-3.5"}),"Launch"]}),(0,b.jsxs)("button",{type:"button",onClick:()=>void D("start"),disabled:null!==v,className:"inline-flex h-8 items-center justify-center gap-2 rounded border border-border bg-surface px-3 text-[11px] font-bold uppercase tracking-wider text-text-muted transition-all hover:border-success/50 hover:text-success disabled:cursor-not-allowed disabled:opacity-50",children:[(0,b.jsx)(o.f,{className:"h-3.5 w-3.5"}),"Start"]}),(0,b.jsxs)("button",{type:"button",onClick:()=>void D("restart",!0),disabled:null!==v,className:"inline-flex h-8 items-center justify-center gap-2 rounded border border-border bg-surface px-3 text-[11px] font-bold uppercase tracking-wider text-text-muted transition-all hover:border-accent/50 hover:text-accent disabled:cursor-not-allowed disabled:opacity-50",children:[(0,b.jsx)(s.f,{className:"h-3.5 w-3.5"}),"Restart"]}),(0,b.jsxs)("button",{type:"button",onClick:function(){B&&(q(a=>a+1),l(!0),A(null))},disabled:!B||null!==v,className:"inline-flex h-8 items-center justify-center gap-2 rounded border border-border bg-surface px-3 text-[11px] font-bold uppercase tracking-wider text-text-muted transition-all hover:border-primary/50 hover:text-primary disabled:cursor-not-allowed disabled:opacity-50",children:[(0,b.jsx)(f.f,{className:"h-3.5 w-3.5"}),"Connect Frame"]}),d&&(0,b.jsxs)("a",{href:d,target:"_blank",rel:"noreferrer",className:"inline-flex h-8 items-center justify-center gap-2 rounded border border-border bg-surface px-3 text-[11px] font-bold uppercase tracking-wider text-text-muted transition-all hover:border-accent/50 hover:text-accent",children:[(0,b.jsx)(m.f,{className:"h-3.5 w-3.5"}),"Open"]})]})]}),(x||z||v)&&(0,b.jsx)("div",{className:`rounded border px-3 py-2 text-[11px] ${z?"border-danger/40 bg-danger/10 text-danger":"border-primary/30 bg-primary/10 text-primary"}`,children:z??(v?`${v} requested...`:x)}),k&&C?(0,b.jsx)("div",{className:"overflow-hidden rounded border border-border/50 bg-bg",children:(0,b.jsx)("iframe",{title:e,src:C,className:`${g} w-full bg-bg`,sandbox:"allow-forms allow-same-origin allow-scripts allow-popups allow-downloads"})}):(0,b.jsxs)("div",{className:"flex min-h-72 flex-col items-center justify-center rounded border border-border/50 bg-bg/40 p-8 text-center",children:[(0,b.jsx)(f.f,{className:"mb-3 h-6 w-6 text-primary"}),(0,b.jsx)("p",{className:"text-xs font-bold uppercase tracking-wider text-text",children:"Dashboard frame is idle"}),(0,b.jsx)("p",{className:"mt-2 max-w-xl text-[11px] leading-5 text-text-muted",children:"Launch or start the Hermes Dashboard on the selected agent, then connect the Magnus frame once the remote service is up."}),(0,b.jsxs)("button",{type:"button",onClick:()=>void D("launch",!0),disabled:null!==v,className:"mt-4 inline-flex h-8 items-center justify-center gap-2 rounded border border-primary/60 bg-primary/10 px-3 text-[11px] font-bold uppercase tracking-wider text-primary transition-all hover:bg-primary/20 disabled:cursor-not-allowed disabled:opacity-50",children:[v?(0,b.jsx)(r,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(n.f,{className:"h-3.5 w-3.5"}),"Launch And Connect"]})]})]}):(0,b.jsx)("div",{className:"rounded border border-border/50 bg-bg/40 p-8 text-center text-xs text-text-muted",children:i})}function v(a){return a.displayName??a.hostname}function w(a){return"running"===a.status&&"running"===a.dashboardStatus?0:"running"===a.dashboardStatus?1:"running"===a.status||"detected"===a.status?2:3}a.s(["default",0,function(){var a;let[m,n]=(0,c.useState)([]),[o,p]=(0,c.useState)(""),[q,r]=(0,c.useState)(!0),[s,t]=(0,c.useState)(null);(0,c.useEffect)(()=>{let a=!0;return async function(){r(!0),t(null);try{let b=(await h.f.hermes.installations()).data??[];if(!a)return;n(b);let c=b.find(a=>null===a.id)??b.find(a=>"running"===a.dashboardStatus)??b[0];c&&p(a=>a||c.id)}catch(b){a&&t(b instanceof Error?b.message:"Failed to load Hermes installations")}finally{a&&r(!1)}}(),()=>{a=!1}},[]);let x=(0,c.useMemo)(()=>m.find(a=>a.id===o)??null,[m,o]),y=(0,c.useMemo)(()=>[...m].sort((a,b)=>w(a)-w(b)||v(a).localeCompare(v(b))),[m]),z=o?`/api/hermes/dashboard?installationId=${encodeURIComponent(o)}`:"",A=m.filter(a=>"running"===a.dashboardStatus).length;return(0,b.jsxs)(l.U,{className:"space-y-6",children:[(0,b.jsx)(l.z,{children:(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-lg font-bold uppercase tracking-wider text-primary",children:"Web Gateway"}),(0,b.jsx)("p",{className:"mt-1 text-[11px] uppercase tracking-wider text-text-muted",children:"Redirect the selected Hermes Agent dashboard gateway through the Magnus UI frame."})]}),(0,b.jsxs)("a",{href:"https://hermes-agent.nousresearch.com/docs/user-guide/features/dashboard",target:"_blank",rel:"noreferrer",className:"inline-flex h-8 items-center justify-center gap-2 rounded border border-border bg-surface px-3 text-[11px] font-bold uppercase tracking-wider text-text-muted transition-all hover:border-accent/50 hover:text-accent",children:[(0,b.jsx)(d.f,{className:"h-3.5 w-3.5"}),"Docs"]})]})}),s&&(0,b.jsx)(l.z,{children:(0,b.jsx)(i.N,{children:(0,b.jsxs)("div",{className:"flex items-center gap-3 text-sm text-danger",children:[(0,b.jsx)(g.f,{className:"h-4 w-4"}),s]})})}),(0,b.jsx)(l.z,{children:(0,b.jsxs)("div",{className:"grid gap-3 md:grid-cols-4",children:[(0,b.jsx)(i.N,{title:"Installations",children:(0,b.jsx)("div",{className:"text-2xl font-bold text-text",children:q?"-":m.length})}),(0,b.jsx)(i.N,{title:"Dashboards",children:(0,b.jsx)("div",{className:"text-2xl font-bold text-success",children:A})}),(0,b.jsx)(i.N,{title:"Selected",children:(0,b.jsx)("div",{className:"truncate text-2xl font-bold text-text",children:x?v(x):"-"})}),(0,b.jsx)(i.N,{title:"Port",children:(0,b.jsx)("div",{className:"font-mono text-2xl font-bold text-text",children:x?.dashboardPort??"-"})})]})}),(0,b.jsx)(l.z,{children:(0,b.jsxs)(i.N,{title:"Gateway Target",description:"Select the Hermes installation whose web dashboard should be started and framed.",children:[(0,b.jsxs)("div",{className:"grid gap-3 md:grid-cols-[minmax(0,1fr)_minmax(240px,0.7fr)]",children:[(0,b.jsx)(k.G,{label:"Installation",children:(0,b.jsx)("select",{"aria-label":"Installation",className:k.N,value:o,onChange:a=>p(a.target.value),children:y.map(a=>(0,b.jsxs)("option",{value:a.id,children:[v(a)," (",a.hostname,") · dashboard ",a.dashboardStatus," · ",a.status]},a.id))})}),(0,b.jsx)("div",{className:"flex flex-wrap items-end gap-2 pb-0.5 text-[11px] text-text-muted",children:x&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(j.t,{variant:(0,j.k)(x.dashboardStatus),children:["dashboard ",x.dashboardStatus]}),(0,b.jsxs)(j.t,{variant:(0,j.k)(x.gatewayStatus),children:["gateway ",x.gatewayStatus]}),(0,b.jsxs)("span",{className:"rounded border border-border px-2 py-1 font-mono",children:["127.0.0.1:",x.dashboardPort]})]})})]}),x&&(0,b.jsxs)("div",{className:"mt-3 grid gap-2 text-[11px] text-text-muted md:grid-cols-3",children:[(0,b.jsxs)("div",{className:"rounded border border-border/50 bg-bg/50 p-3",children:[(0,b.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Host"}),(0,b.jsx)("span",{className:"font-mono text-text",children:x.hostname})]}),(0,b.jsxs)("div",{className:"rounded border border-border/50 bg-bg/50 p-3",children:[(0,b.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Home"}),(0,b.jsx)("span",{className:"font-mono text-text",children:x.hermesHome})]}),(0,b.jsxs)("div",{className:"rounded border border-border/50 bg-bg/50 p-3",children:[(0,b.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Synced"}),(0,b.jsx)("span",{className:"text-text",children:(a=x.lastSyncedAt)?new Date(a).toLocaleString():"never"})]})]})]})}),(0,b.jsx)(l.z,{children:(0,b.jsx)(i.N,{title:"Hermes Web Gateway",description:"Launch the remote dashboard process and connect the full Hermes gateway into Magnus when it is ready.",children:(0,b.jsx)(u,{installation:x,frameSrc:z,frameTitle:"Hermes Web Gateway",heightClass:"h-[780px]",emptyMessage:"Select a Hermes installation to open the web gateway."})})}),(0,b.jsx)(l.z,{children:(0,b.jsx)(i.N,{title:"Connection Model",description:"Magnus proxies the selected remote dashboard over SSH and allows same-origin framing for this route.",children:(0,b.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,b.jsxs)("div",{className:"rounded border border-border/50 bg-bg/50 p-3",children:[(0,b.jsx)(e.f,{className:"mb-2 h-4 w-4 text-primary"}),(0,b.jsx)("p",{className:"text-xs font-bold uppercase tracking-wider text-text",children:"Whole gateway"}),(0,b.jsx)("p",{className:"mt-1 text-[11px] leading-5 text-text-muted",children:"The root Hermes dashboard is framed, so native dashboard navigation stays inside Magnus."})]}),(0,b.jsxs)("div",{className:"rounded border border-border/50 bg-bg/50 p-3",children:[(0,b.jsx)(f.f,{className:"mb-2 h-4 w-4 text-primary"}),(0,b.jsx)("p",{className:"text-xs font-bold uppercase tracking-wider text-text",children:"Remote launch"}),(0,b.jsx)("p",{className:"mt-1 text-[11px] leading-5 text-text-muted",children:"The launch action starts the dashboard command on the target Hermes host before connecting the frame."})]}),(0,b.jsxs)("div",{className:"rounded border border-border/50 bg-bg/50 p-3",children:[(0,b.jsx)(g.f,{className:"mb-2 h-4 w-4 text-primary"}),(0,b.jsx)("p",{className:"text-xs font-bold uppercase tracking-wider text-text",children:"Frame headers"}),(0,b.jsx)("p",{className:"mt-1 text-[11px] leading-5 text-text-muted",children:"Only the Hermes dashboard proxy path permits same-origin iframe embedding."})]})]})})})]})}],37618)}];
1
+ module.exports=[37618,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(23319),e=a.i(75027),f=a.i(83102),g=a.i(96389),h=a.i(46997),i=a.i(49521),j=a.i(58299),k=a.i(85063),l=a.i(73771),m=a.i(68370),n=a.i(38835),o=a.i(13931),p=a.i(64831);let q={name:"refresh-ccw",size:24,node:[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]};q.node;let r=(0,p.f)(q);var s=a.i(33838);function t(a){return a.displayName??a.hostname}function u({installation:a,frameSrc:d,frameTitle:e,heightClass:g="h-[720px]",emptyMessage:i="Select a Hermes installation with dashboard access."}){let[k,l]=(0,c.useState)(!1),[p,q]=(0,c.useState)(0),[v,w]=(0,c.useState)(null),[x,y]=(0,c.useState)(null),[z,A]=(0,c.useState)(null);(0,c.useEffect)(()=>{l(!1),q(0),y(null),A(null)},[a?.id,d]);let B=!!(a&&d),C=d?`${d}${d.includes("?")?"&":"?"}frame=${p}`:"";async function D(b,c=!1){if(a){w(b),A(null),y(null);try{let d=await h.f.hermes.dashboardAction(a.id,b),e=d.data?.id?` Job ${d.data.id.slice(0,8)} queued.`:"";y(`${"launch"===b?"Launch":b} requested for ${t(a)}.${e}`),c&&window.setTimeout(()=>{q(a=>a+1),l(!0)},2500)}catch(a){A(a instanceof Error?a.message:`Failed to ${b} Hermes Dashboard`)}finally{w(null)}}}return a?(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded border border-border/50 bg-bg/50 p-3",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-text",children:t(a)}),(0,b.jsxs)(j.t,{variant:(0,j.k)(a.dashboardStatus),children:["dashboard ",a.dashboardStatus]}),(0,b.jsxs)("span",{className:"rounded border border-border px-2 py-1 font-mono text-[10px] text-text-muted",children:["127.0.0.1:",a.dashboardPort]})]}),(0,b.jsx)("p",{className:"mt-1 truncate text-[11px] text-text-muted",children:a.hostname})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>void D("launch",!0),disabled:null!==v,className:"inline-flex h-8 items-center justify-center gap-2 rounded border border-primary/60 bg-primary/10 px-3 text-[11px] font-bold uppercase tracking-wider text-primary transition-all hover:bg-primary/20 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,b.jsx)(n.f,{className:"h-3.5 w-3.5"}),"Launch"]}),(0,b.jsxs)("button",{type:"button",onClick:()=>void D("start"),disabled:null!==v,className:"inline-flex h-8 items-center justify-center gap-2 rounded border border-border bg-surface px-3 text-[11px] font-bold uppercase tracking-wider text-text-muted transition-all hover:border-success/50 hover:text-success disabled:cursor-not-allowed disabled:opacity-50",children:[(0,b.jsx)(o.f,{className:"h-3.5 w-3.5"}),"Start"]}),(0,b.jsxs)("button",{type:"button",onClick:()=>void D("restart",!0),disabled:null!==v,className:"inline-flex h-8 items-center justify-center gap-2 rounded border border-border bg-surface px-3 text-[11px] font-bold uppercase tracking-wider text-text-muted transition-all hover:border-accent/50 hover:text-accent disabled:cursor-not-allowed disabled:opacity-50",children:[(0,b.jsx)(s.f,{className:"h-3.5 w-3.5"}),"Restart"]}),(0,b.jsxs)("button",{type:"button",onClick:function(){B&&(q(a=>a+1),l(!0),A(null))},disabled:!B||null!==v,className:"inline-flex h-8 items-center justify-center gap-2 rounded border border-border bg-surface px-3 text-[11px] font-bold uppercase tracking-wider text-text-muted transition-all hover:border-primary/50 hover:text-primary disabled:cursor-not-allowed disabled:opacity-50",children:[(0,b.jsx)(f.f,{className:"h-3.5 w-3.5"}),"Connect Frame"]}),d&&(0,b.jsxs)("a",{href:d,target:"_blank",rel:"noreferrer",className:"inline-flex h-8 items-center justify-center gap-2 rounded border border-border bg-surface px-3 text-[11px] font-bold uppercase tracking-wider text-text-muted transition-all hover:border-accent/50 hover:text-accent",children:[(0,b.jsx)(m.f,{className:"h-3.5 w-3.5"}),"Open"]})]})]}),(x||z||v)&&(0,b.jsx)("div",{className:`rounded border px-3 py-2 text-[11px] ${z?"border-danger/40 bg-danger/10 text-danger":"border-primary/30 bg-primary/10 text-primary"}`,children:z??(v?`${v} requested...`:x)}),k&&C?(0,b.jsx)("div",{className:"overflow-hidden rounded border border-border/50 bg-bg",children:(0,b.jsx)("iframe",{title:e,src:C,className:`${g} w-full bg-bg`,sandbox:"allow-forms allow-same-origin allow-scripts allow-popups allow-downloads"})}):(0,b.jsxs)("div",{className:"flex min-h-72 flex-col items-center justify-center rounded border border-border/50 bg-bg/40 p-8 text-center",children:[(0,b.jsx)(f.f,{className:"mb-3 h-6 w-6 text-primary"}),(0,b.jsx)("p",{className:"text-xs font-bold uppercase tracking-wider text-text",children:"Dashboard frame is idle"}),(0,b.jsx)("p",{className:"mt-2 max-w-xl text-[11px] leading-5 text-text-muted",children:"Launch or start the Hermes Dashboard on the selected agent, then connect the Magnus frame once the remote service is up."}),(0,b.jsxs)("button",{type:"button",onClick:()=>void D("launch",!0),disabled:null!==v,className:"mt-4 inline-flex h-8 items-center justify-center gap-2 rounded border border-primary/60 bg-primary/10 px-3 text-[11px] font-bold uppercase tracking-wider text-primary transition-all hover:bg-primary/20 disabled:cursor-not-allowed disabled:opacity-50",children:[v?(0,b.jsx)(r,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(n.f,{className:"h-3.5 w-3.5"}),"Launch And Connect"]})]})]}):(0,b.jsx)("div",{className:"rounded border border-border/50 bg-bg/40 p-8 text-center text-xs text-text-muted",children:i})}function v(a){return a.displayName??a.hostname}function w(a){return"running"===a.status&&"running"===a.dashboardStatus?0:"running"===a.dashboardStatus?1:"running"===a.status||"detected"===a.status?2:3}a.s(["default",0,function(){var a;let[m,n]=(0,c.useState)([]),[o,p]=(0,c.useState)(""),[q,r]=(0,c.useState)(!0),[s,t]=(0,c.useState)(null);(0,c.useEffect)(()=>{let a=!0;return async function(){r(!0),t(null);try{let b=(await h.f.hermes.installations()).data??[];if(!a)return;n(b);let c=b.find(a=>null===a.id)??b.find(a=>"running"===a.dashboardStatus)??b[0];c&&p(a=>a||c.id)}catch(b){a&&t(b instanceof Error?b.message:"Failed to load Hermes installations")}finally{a&&r(!1)}}(),()=>{a=!1}},[]);let x=(0,c.useMemo)(()=>m.find(a=>a.id===o)??null,[m,o]),y=(0,c.useMemo)(()=>[...m].sort((a,b)=>w(a)-w(b)||v(a).localeCompare(v(b))),[m]),z=o?`/api/hermes/dashboard?installationId=${encodeURIComponent(o)}`:"",A=m.filter(a=>"running"===a.dashboardStatus).length;return(0,b.jsxs)(l.U,{className:"space-y-6",children:[(0,b.jsx)(l.z,{children:(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-lg font-bold uppercase tracking-wider text-primary",children:"Web Gateway"}),(0,b.jsx)("p",{className:"mt-1 text-[11px] uppercase tracking-wider text-text-muted",children:"Redirect the selected Hermes Agent dashboard gateway through the Magnus UI frame."})]}),(0,b.jsxs)("a",{href:"https://hermes-agent.nousresearch.com/docs/user-guide/features/dashboard",target:"_blank",rel:"noreferrer",className:"inline-flex h-8 items-center justify-center gap-2 rounded border border-border bg-surface px-3 text-[11px] font-bold uppercase tracking-wider text-text-muted transition-all hover:border-accent/50 hover:text-accent",children:[(0,b.jsx)(d.f,{className:"h-3.5 w-3.5"}),"Docs"]})]})}),s&&(0,b.jsx)(l.z,{children:(0,b.jsx)(i.N,{children:(0,b.jsxs)("div",{className:"flex items-center gap-3 text-sm text-danger",children:[(0,b.jsx)(g.f,{className:"h-4 w-4"}),s]})})}),(0,b.jsx)(l.z,{children:(0,b.jsxs)("div",{className:"grid gap-3 md:grid-cols-4",children:[(0,b.jsx)(i.N,{title:"Installations",children:(0,b.jsx)("div",{className:"text-2xl font-bold text-text",children:q?"-":m.length})}),(0,b.jsx)(i.N,{title:"Dashboards",children:(0,b.jsx)("div",{className:"text-2xl font-bold text-success",children:A})}),(0,b.jsx)(i.N,{title:"Selected",children:(0,b.jsx)("div",{className:"truncate text-2xl font-bold text-text",children:x?v(x):"-"})}),(0,b.jsx)(i.N,{title:"Port",children:(0,b.jsx)("div",{className:"font-mono text-2xl font-bold text-text",children:x?.dashboardPort??"-"})})]})}),(0,b.jsx)(l.z,{children:(0,b.jsxs)(i.N,{title:"Gateway Target",description:"Select the Hermes installation whose web dashboard should be started and framed.",children:[(0,b.jsxs)("div",{className:"grid gap-3 md:grid-cols-[minmax(0,1fr)_minmax(240px,0.7fr)]",children:[(0,b.jsx)(k.G,{label:"Installation",children:(0,b.jsx)("select",{"aria-label":"Installation",className:k.N,value:o,onChange:a=>p(a.target.value),children:y.map(a=>(0,b.jsxs)("option",{value:a.id,children:[v(a)," (",a.hostname,") · dashboard ",a.dashboardStatus," · ",a.status]},a.id))})}),(0,b.jsx)("div",{className:"flex flex-wrap items-end gap-2 pb-0.5 text-[11px] text-text-muted",children:x&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(j.t,{variant:(0,j.k)(x.dashboardStatus),children:["dashboard ",x.dashboardStatus]}),(0,b.jsxs)(j.t,{variant:(0,j.k)(x.gatewayStatus),children:["gateway ",x.gatewayStatus]}),(0,b.jsxs)("span",{className:"rounded border border-border px-2 py-1 font-mono",children:["127.0.0.1:",x.dashboardPort]})]})})]}),x&&(0,b.jsxs)("div",{className:"mt-3 grid gap-2 text-[11px] text-text-muted md:grid-cols-3",children:[(0,b.jsxs)("div",{className:"rounded border border-border/50 bg-bg/50 p-3",children:[(0,b.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Host"}),(0,b.jsx)("span",{className:"font-mono text-text",children:x.hostname})]}),(0,b.jsxs)("div",{className:"rounded border border-border/50 bg-bg/50 p-3",children:[(0,b.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Home"}),(0,b.jsx)("span",{className:"font-mono text-text",children:x.hermesHome})]}),(0,b.jsxs)("div",{className:"rounded border border-border/50 bg-bg/50 p-3",children:[(0,b.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Synced"}),(0,b.jsx)("span",{className:"text-text",children:(a=x.lastSyncedAt)?new Date(a).toLocaleString():"never"})]})]})]})}),(0,b.jsx)(l.z,{children:(0,b.jsx)(i.N,{title:"Hermes Web Gateway",description:"Launch the remote dashboard process and connect the full Hermes gateway into Magnus when it is ready.",children:(0,b.jsx)(u,{installation:x,frameSrc:z,frameTitle:"Hermes Web Gateway",heightClass:"h-[780px]",emptyMessage:"Select a Hermes installation to open the web gateway."})})}),(0,b.jsx)(l.z,{children:(0,b.jsx)(i.N,{title:"Connection Model",description:"Magnus proxies the selected remote dashboard over SSH and allows same-origin framing for this route.",children:(0,b.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,b.jsxs)("div",{className:"rounded border border-border/50 bg-bg/50 p-3",children:[(0,b.jsx)(e.f,{className:"mb-2 h-4 w-4 text-primary"}),(0,b.jsx)("p",{className:"text-xs font-bold uppercase tracking-wider text-text",children:"Whole gateway"}),(0,b.jsx)("p",{className:"mt-1 text-[11px] leading-5 text-text-muted",children:"The root Hermes dashboard is framed, so native dashboard navigation stays inside Magnus."})]}),(0,b.jsxs)("div",{className:"rounded border border-border/50 bg-bg/50 p-3",children:[(0,b.jsx)(f.f,{className:"mb-2 h-4 w-4 text-primary"}),(0,b.jsx)("p",{className:"text-xs font-bold uppercase tracking-wider text-text",children:"Remote launch"}),(0,b.jsx)("p",{className:"mt-1 text-[11px] leading-5 text-text-muted",children:"The launch action starts the dashboard command on the target Hermes host before connecting the frame."})]}),(0,b.jsxs)("div",{className:"rounded border border-border/50 bg-bg/50 p-3",children:[(0,b.jsx)(g.f,{className:"mb-2 h-4 w-4 text-primary"}),(0,b.jsx)("p",{className:"text-xs font-bold uppercase tracking-wider text-text",children:"Frame headers"}),(0,b.jsx)("p",{className:"mt-1 text-[11px] leading-5 text-text-muted",children:"Only the Hermes dashboard proxy path permits same-origin iframe embedding."})]})]})})})]})}],37618)}];
2
2
 
3
3
  //# sourceMappingURL=apps_dashboard_src_app_orchestra_web-gateway_page_tsx_1fz12np0wk27t._.js.map