@hivemagnus/magnus-ui 3.6.0 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +5 -4
- package/README.md +52 -4
- package/bin/magnus-ui.mjs +118 -2
- package/dist/app/apps/dashboard/.next/BUILD_ID +1 -1
- package/dist/app/apps/dashboard/.next/build-manifest.json +3 -3
- package/dist/app/apps/dashboard/.next/prerender-manifest.json +3 -3
- package/dist/app/apps/dashboard/.next/required-server-files.json +2 -16
- package/dist/app/apps/dashboard/.next/routes-manifest.json +9 -20
- package/dist/app/apps/dashboard/.next/server/app/_global-error.html +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/auth/hive/callback/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/auth/hive/configured/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/auth/hive/start/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/auth/login/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/auth/logout/route.js +6 -5
- package/dist/app/apps/dashboard/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/auth/me/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/control-nodes/[id]/route.js +2 -2
- package/dist/app/apps/dashboard/.next/server/app/api/control-nodes/[id]/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/control-nodes/route.js +2 -2
- package/dist/app/apps/dashboard/.next/server/app/api/control-nodes/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/federation/route.js +3 -3
- package/dist/app/apps/dashboard/.next/server/app/api/federation/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/health/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/hermes/dashboard/[[...path]]/route.js +8 -6
- package/dist/app/apps/dashboard/.next/server/app/api/hermes/dashboard/[[...path]]/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/hive-router/dashboard/[[...path]]/route.js +7 -5
- package/dist/app/apps/dashboard/.next/server/app/api/hive-router/dashboard/[[...path]]/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/proxy/[...path]/route.js +5 -5
- package/dist/app/apps/dashboard/.next/server/app/api/proxy/[...path]/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/terminal/close/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/terminal/input/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/terminal/open/route.js +4 -4
- package/dist/app/apps/dashboard/.next/server/app/api/terminal/open/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/terminal/resize/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api-docs/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api-docs/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/application-operations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/application-operations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/audit/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/audit/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/installations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/installations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/commands/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/commands/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page/server-reference-manifest.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/files/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/files/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-map/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-map/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/operations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/operations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-security/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-security/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/incidents/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/incidents/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/incidents/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/library/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/library/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/library/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/login/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/logs/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/logs/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/mission-control/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/mission-control/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/mission-control/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/notifications/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/notifications/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/retention/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/retention/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/retention/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/roles/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/roles/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/roles/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/rollouts/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/rollouts/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page/server-reference-manifest.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/{[externals]__0lufsyh_0gqup._.js → [externals]__1k43kg5-icx7b._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__0vzssf5bgd660._.js → [root-of-the-server]__0ndj_rhwp_6vf._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/[root-of-the-server]__0ywmf3079vsm1._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__05vapur0p6d-l._.js → [root-of-the-server]__15_4jl4ba_7y3._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__0iiv9pxo2yauj._.js → [root-of-the-server]__1cxla67mqwfdr._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__0fwm7idn_76uf._.js → [root-of-the-server]__1rrn6p9afghbt._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__0ioimsx71gr0o._.js → [root-of-the-server]__1wj2nw17pv5g8._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/_0jvoc4-ta3zc0._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/_0oj6_-g5b2lvi._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/_0rwz3f0jh1ty0._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/_0s788ryrplkp6._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/_1-ntqfqk_4-f0._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/_120rsoc_nc7_3._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/_1ilhtkg33m99h._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/_1xodprib7qa_j._.js +2 -2
- package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_runtime-embed-isolation_mjs_1ovehd-pl97ex._.js +3 -0
- package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_src_lib_auth_ts_1hhq1tq6hjj-e._.js +2 -2
- package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_src_lib_control-nodes-store_ts_01hjyte7nc7l2._.js +3 -2
- package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_src_lib_embedded-frame_ts_1dw1tog69m3ap._.js +3 -0
- package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_src_lib_hive-login_ts_0ab2iq7-rpy13._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__02wumq04h7-2m._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1koj-a25tcc9z._.js → [root-of-the-server]__0az7ayfxt936j._.js} +2 -2
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__02rfo46o0ocq7._.js → [root-of-the-server]__0cbjirfjkahyz._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__0l7okklk-ix9t._.js → [root-of-the-server]__0mtl30w3r3d8n._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1w1bkuf_-8zxm._.js → [root-of-the-server]__0n1mehgazoyys._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1y4za7l5ph9o-._.js → [root-of-the-server]__0piptu4qrcax4._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__0neu-iblb1_-5._.js → [root-of-the-server]__0qoxqg_z229qc._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1jb0a4bkg6dd1._.js → [root-of-the-server]__0yvtveej1dtd6._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__000ndthd0hd5v._.js → [root-of-the-server]__0zftzxoekcfyw._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__202zczfuwkbzi._.js → [root-of-the-server]__15i5sz08w-tg0._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1ria97bl22vsq._.js → [root-of-the-server]__18k_-53xs-qpk._.js} +2 -2
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1jtg9fc0ny1cg._.js → [root-of-the-server]__1cesdboqyg7rq._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1wsrd6m1h8q7q._.js → [root-of-the-server]__1p0rsbsf87odz._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1l8__2gqqi590._.js → [root-of-the-server]__1un9oi8-bokqt._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1gwofuehw8lyc._.js → [root-of-the-server]__206hwh476sy80._.js} +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/_07u8d93e_m_yo._.js +3 -2
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/_0caxc2bc6a__r._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/_1oebzzj_en62h._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_runtime-environment_mjs_11tpywm9_soif._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_0gs_s688kgg1i._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_anomalies_remediation_page_tsx_179m33swiclif._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_ardent_installations_page_tsx_0nvqgacugy6nf._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_audit_audit-client_tsx_0iyab_tlw5yus._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_cron_page_tsx_1i3duyygc0_tg._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_files_page_tsx_1kls9-qinldks._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_governor_operations_page_tsx_1tvdkgil8mlgk._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_login_page_tsx_12_rihimtav2a._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_logs_page_tsx_0473-hcpj1mqr._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_mission-control_page_tsx_0crgxncex_u3w._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_nodes_[nodeId]_page_tsx_1q7fqu18oklzc._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_nodes_nodes-client_tsx_0pt4iarhpqbgn._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_orchestra_web-gateway_page_tsx_1fz12np0wk27t._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_security-fusion_page_tsx_0d314q7yh6fx8._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_skills_page_tsx_0n5zp4xad38in._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_webhooks_webhook-form_tsx_02z3be5wx7-cb._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_components_ui_card_tsx_1pngl2ib-xo5t._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_components_ui_node-selector_tsx_1ci6ldznpaofq._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_lib_api-client_ts_0tho-kkk5ez7h._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/middleware-build-manifest.js +3 -3
- package/dist/app/apps/dashboard/.next/server/pages/500.html +1 -1
- package/dist/app/apps/dashboard/.next/server/preview-props.json +3 -3
- package/dist/app/apps/dashboard/.next/server/server-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/server-reference-manifest.json +3 -3
- package/dist/app/apps/dashboard/.next/static/chunks/{369vzlcjad-gn.js → 017x1uhn9l7nw.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{1-vn8cqro-f08.js → 06_2psos--paq.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/0i8g96dmx-fbo.css +2 -0
- package/dist/app/apps/dashboard/.next/static/chunks/0nalo72r7vipw.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/0pswbe-19xxl5.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{3ntnj6ts2r3e2.js → 0s2skhp7086pc.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{0nekvgtqt8goj.js → 0zsp_alwy1f3v.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/1fpi73pmpn8v5.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/1gko0bkguj_g0.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{0lxf5l-ugq-09.js → 1t6g3-pjlavb5.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{1bn40ef0zair9.js → 1ygangs-zn4yl.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/2_eadjwf4989d.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/2fzv4_us4q1w_.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{1cvbtmsr4d3ci.js → 2isl5q2zhjwiw.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/2jaw-lni6k_dt.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/2sh8fn_vg-vs5.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{1kx48jg-4j5iv.js → 2u4_fj_v8i521.js} +2 -2
- package/dist/app/apps/dashboard/.next/static/chunks/{0d6kculhmue59.js → 2zj24fir1fm27.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{3w-7xko96ljib.js → 2zjjqqg5z63sl.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/337js55ro9g08.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{37kstof-v-jwi.js → 33xay7yclh_jd.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/34yff9n0mbd1h.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{05p7s0xtb3koa.js → 3eo_31lzj51v9.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{12ju76tjcqh_z.js → 3f73kvi1pwabq.js} +4 -4
- package/dist/app/apps/dashboard/.next/static/chunks/{23o8zfgrdxuhk.js → 3kh386y5gla53.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/3mwn69j8d-q9v.js +4 -0
- package/dist/app/apps/dashboard/.next/static/chunks/3p_wvl3sieoi4.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{0yb36s9l-f3_w.js → 3qrrim22gq-vp.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/3ui3xvxcdyc0r.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/3ya4-24grz_0f.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{37pb0l96d03rk.js → 42j6wpibe0zrn.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/4369o9c3gezxt.js +6 -0
- package/dist/app/apps/dashboard/.next/static/rWpgppq64sqgeZO3-MlD1/_buildManifest.js +11 -0
- package/dist/app/apps/dashboard/package.json +3 -2
- package/dist/app/apps/dashboard/runtime-control-node-credentials.mjs +638 -0
- package/dist/app/apps/dashboard/runtime-embed-isolation.mjs +450 -0
- package/dist/app/apps/dashboard/runtime-environment.mjs +1 -1
- package/dist/app/apps/dashboard/runtime-integrations.mjs +4 -4
- package/dist/app/apps/dashboard/server-tls.mjs +96 -47
- package/dist/app/apps/dashboard/server.js +1 -1
- package/npm-shrinkwrap.json +4 -3
- package/package.json +3 -2
- package/dist/app/apps/dashboard/.next/static/IOi-LmbFghqZcllGm0tny/_buildManifest.js +0 -20
- package/dist/app/apps/dashboard/.next/static/chunks/015s19fe5dtkp.css +0 -2
- package/dist/app/apps/dashboard/.next/static/chunks/06xzeulnw897e.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/07tx3h4lr-lxl.js +0 -6
- package/dist/app/apps/dashboard/.next/static/chunks/0j0dzrd0ev-gx.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/1-pj3rx01kcq0.js +0 -4
- package/dist/app/apps/dashboard/.next/static/chunks/1j5vpju4k1wlj.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/1kjl44-64ume7.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/28zpgt1trm_m4.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/2lk4ailve7631.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/2lulmsr2vjuw5.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/30npcziw-f8ld.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/31hx4x8k9707e.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/34mzv0h7jkx20.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/3cw8xs2dab1g-.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/3gjll_bse9v1f.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/3qq-otw-t-6b0.js +0 -1
- /package/dist/app/apps/dashboard/.next/static/{IOi-LmbFghqZcllGm0tny → rWpgppq64sqgeZO3-MlD1}/_clientMiddlewareManifest.js +0 -0
- /package/dist/app/apps/dashboard/.next/static/{IOi-LmbFghqZcllGm0tny → rWpgppq64sqgeZO3-MlD1}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,5525,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(18566),n=e.i(93999),r=e.i(3062),i=e.i(54149),l=e.i(51196),d=e.i(75723),c=e.i(2067),o=e.i(65369),m=e.i(56420);let x={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"]};x.node;let u=(0,m.f)(x);var p=e.i(82983),h=e.i(78571),g=e.i(21176);let f=["1h","6h","24h"];function j({nodeId:e,height:a=180}){let[n,r]=(0,s.useState)("1h"),[i,l]=(0,s.useState)(null),[d,o]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let t=!1;o(!1);let s=async()=>{try{let[s,a]=await Promise.all([p.f.get(`nodes/${e}/health/timeseries?metric=cpu&period=${n}`),p.f.get(`nodes/${e}/health/timeseries?metric=memory&period=${n}`)]);if(t)return;let r=s.data??{timestamps:[],values:[]},i=a.data??{timestamps:[],values:[]},d=new Map;r.timestamps.forEach((e,t)=>{let s=Date.parse(e);d.set(s,{t:s,cpu:r.values[t]??null,mem:null})}),i.timestamps.forEach((e,t)=>{let s=Date.parse(e),a=d.get(s)??{t:s,cpu:null,mem:null};a.mem=i.values[t]??null,d.set(s,a)}),l([...d.values()].sort((e,t)=>e.t-t.t))}catch{t||(l([]),o(!0))}};s();let a=setInterval(()=>void s(),6e4);return()=>{t=!0,clearInterval(a)}},[e,n]),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col","data-testid":"node-metrics-chart",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-text-muted",children:"CPU / memory history"}),(0,t.jsx)("div",{role:"group","aria-label":"History period",className:"flex rounded-chip border border-border bg-bg p-0.5",children:f.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>r(e),"aria-pressed":n===e,className:(0,h.f)("rounded-chip px-2 py-0.5 text-[10px] uppercase tracking-wider transition-colors",n===e?"bg-primary/15 text-primary shadow-[0_0_8px_var(--color-glow)]":"text-text-muted hover:text-text"),children:e},e))})]}),null===i?(0,t.jsx)("div",{className:"skeleton w-full",style:{height:a}}):i.length<2?(0,t.jsx)(c.f,{compact:!0,icon:(0,t.jsx)(u,{className:"h-4 w-4"}),title:d?"History unavailable":"Not enough samples yet",description:d?"The health timeseries endpoint did not answer.":`No health snapshots in the last ${n}.`,tone:d?"warning":"muted",className:"flex-1"}):(0,t.jsx)(g.f,{data:i,xKey:"t",percent:!0,height:a,formatX:e=>new Date(Number(e)).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 N=e.i(95925);let v={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"}]]};v.node;let y=(0,m.f)(v);var b=e.i(46670);function w({metadata:e}){let s=function(e){let t=e;if("string"==typeof e)try{t=JSON.parse(e)}catch{return}return t?.agentSelfUpgrade}(e);return s?s.upgrade?.state==="reverted"?(0,t.jsx)("span",{title:s.upgrade.reason??void 0,children:(0,t.jsxs)(b.t,{variant:"danger",children:[(0,t.jsx)(N.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade to ",s.upgrade.to," reverted"]})}):s.upgrade?.state==="failed"?(0,t.jsx)("span",{title:s.upgrade.reason??void 0,children:(0,t.jsxs)(b.t,{variant:"danger",children:[(0,t.jsx)(N.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade to ",s.upgrade.to," failed"]})}):s.enabled?null:(0,t.jsx)("span",{title:s.reason??void 0,"data-testid":"agent-self-upgrade-off",children:(0,t.jsxs)(b.t,{variant:"default",children:[(0,t.jsx)(y,{className:"mr-1 inline h-3 w-3"}),"Self-upgrade off"]})}):null}var k=e.i(53721),S=e.i(57108),$=e.i(68759),C=e.i(32568),A=e.i(71417),P=e.i(15281),U=e.i(59659),I=e.i(9347),_=e.i(25398),E=e.i(92026),M=e.i(32781),R=e.i(82022),D=e.i(84026),F=e.i(71567),O=e.i(94371),L=e.i(20851),z=e.i(66595);let T={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"}]]};T.node;let H=(0,m.f)(T);var B=e.i(86207),q=e.i(57665),K=e.i(41220),G=e.i(14098),J=e.i(4139),V=e.i(41120),W=e.i(82954),Q=e.i(79432),Z=e.i(62368),X=e.i(64155),Y=e.i(51757),ee=e.i(83967),et=e.i(74544);let es=[{id:"apt-update",label:"apt update",command:"sudo",args:["apt","update"],icon:(0,t.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,t.jsx)(V.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,t.jsx)(Q.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,t.jsx)(W.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,t.jsx)(X.f,{className:"h-3.5 w-3.5"}),variant:"secondary",timeoutSeconds:15},{id:"reboot",label:"Reboot",command:"sudo",args:["reboot"],icon:(0,t.jsx)(q.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 ea({nodeId:e,nodeStatus:a}){let[n,r]=(0,s.useState)(!1),[i,l]=(0,s.useState)(!1),[d,c]=(0,s.useState)(null),[o,m]=(0,s.useState)(null),[x,u]=(0,s.useState)(null),h="ONLINE"!==a,g=async t=>{if(!t.confirm||confirm(t.confirm)){c(t),m(null),u(null),l(!0),r(!0);try{let s=await p.f.quickCommand.exec(e,{command:t.command,args:t.args,timeoutSeconds:t.timeoutSeconds});m(s.data)}catch(e){u(e instanceof Error?e.message:"Command execution failed")}finally{l(!1)}}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"rounded border border-border bg-surface p-3",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-text-muted mr-2",children:[(0,t.jsx)(J.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"font-bold uppercase tracking-wider",children:"Quick Commands"})]}),es.map(e=>(0,t.jsx)($.K,{variant:e.variant,size:"sm",icon:e.icon,disabled:h,onClick:()=>void g(e),children:e.label},e.id)),h&&(0,t.jsx)("span",{className:"ml-2 text-xs text-text-muted",children:"Node must be ONLINE to run commands"})]})}),(0,t.jsx)(C.n,{open:n,onClose:()=>r(!1),title:d?.label??"Command",description:d?`${d.command} ${(d.args??[]).join(" ")}`:void 0,icon:(0,t.jsx)(J.f,{className:"h-5 w-5 text-primary"}),className:"max-w-3xl",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.f,{className:"h-4 w-4 animate-spin text-primary"}),(0,t.jsx)("span",{className:"text-xs text-primary",children:"Executing…"})]}):x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ee.f,{className:"h-4 w-4 text-danger"}),(0,t.jsx)("span",{className:"text-xs text-danger",children:"Error"})]}):o?(0,t.jsxs)(t.Fragment,{children:[0===o.exitCode?(0,t.jsx)(Y.f,{className:"h-4 w-4 text-success"}):(0,t.jsx)(ee.f,{className:"h-4 w-4 text-danger"}),(0,t.jsxs)("span",{className:`text-xs ${0===o.exitCode?"text-success":"text-danger"}`,children:["Exit code: ",o.exitCode]}),(0,t.jsxs)("span",{className:"text-xs text-text-muted flex items-center gap-1 ml-auto",children:[(0,t.jsx)(et.f,{className:"h-3 w-3"}),(o.durationMs/1e3).toFixed(2),"s"]})]}):null}),x&&(0,t.jsx)("div",{className:"rounded bg-danger/10 border border-danger/30 p-3",children:(0,t.jsx)("p",{className:"text-xs text-danger",children:x})}),o&&(0,t.jsxs)("div",{className:"space-y-3",children:[o.stdout&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[11px] font-bold uppercase tracking-wider text-text-muted mb-1",children:"stdout"}),(0,t.jsx)("pre",{className:"max-h-80 overflow-auto rounded bg-bg border border-border p-3 text-xs text-success whitespace-pre-wrap",children:o.stdout})]}),o.stderr&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[11px] font-bold uppercase tracking-wider text-text-muted mb-1",children:"stderr"}),(0,t.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:o.stderr})]}),!o.stdout&&!o.stderr&&(0,t.jsx)("p",{className:"text-xs text-text-muted italic",children:"No output captured"}),o.truncated&&(0,t.jsx)("p",{className:"text-xs text-warning",children:"⚠ Output was truncated (exceeded 1MB)"})]}),i&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)(M.f,{className:"h-8 w-8 animate-spin text-primary mx-auto mb-2"}),(0,t.jsx)("p",{className:"text-xs text-text-muted",children:"Executing command on remote node…"})]})}),(0,t.jsx)("div",{className:"flex justify-end pt-2",children:(0,t.jsx)($.K,{variant:"ghost",size:"sm",onClick:()=>r(!1),children:"Close"})})]})})]})}var en=e.i(55427),er=e.i(28623);let ei={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 el(e){return 0===e.length?0:e.reduce((e,t)=>e+t,0)/e.length}function ed({node:e}){let[a,r]=(0,s.useState)([]),[i,l]=(0,s.useState)(!0),[d,c]=(0,s.useState)(null),[o,m]=(0,s.useState)(0);(0,s.useEffect)(()=>{let t=!1;return(async()=>{l(!0),c(null);try{let s=await p.f.get(`nodes/${e.id}/health/history?limit=100`);if(t)return;let a=s.data,n=[];Array.isArray(a)?n=a:a?.items&&(n=a.items),r([...n].reverse())}catch(e){t||(r([]),c(e instanceof Error?e.message:"Failed to load history"))}finally{t||l(!1)}})(),()=>{t=!0}},[e.id,o]);let x=(0,s.useMemo)(()=>{let t,s,n,r,i,l,d,c,o;return t=a.map(e=>e.cpuUsagePercent).filter(e=>Number.isFinite(e)),s=a.map(e=>e.memoryPercent).filter(e=>Number.isFinite(e)),n=el(t),r=function(e){if(e.length<2)return 0;let t=el(e);return Math.sqrt(e.reduce((e,s)=>e+(s-t)*(s-t),0)/(e.length-1))}(t),i=el(s),l=t.filter(e=>e>80).length,d="rookie",c=ei[d="OFFLINE"===e.status||e.lastHeartbeatAt&&Date.now()-new Date(e.lastHeartbeatAt).getTime()>6e5?"ghost":a.length<3?"rookie":r>25||l/Math.max(1,t.length)>.25?l/Math.max(1,t.length)>.4?"drama-queen":"sprinter":n<15&&r<10?"zen-master":n>40&&n<75&&r<15?"workhorse":n<40&&r<15&&a.length>20?"marathoner":"workhorse"]??ei.rookie??{name:"Rookie",emoji:"🌱",description:"",accent:"default"},o=function(e,t,s){var a;let n,r=Math.floor(Date.now()/6048e5);for(let t=0;t<e.id.length;t++)r=31*r+e.id.charCodeAt(t)|0;let i={workhorse:[`Steady as they come — averaging ${s.cpuAvg.toFixed(0)}% CPU without a single complaint this week.`,`The dependable one. ${e.hostname} just keeps grinding through the workload.`,`Quietly productive at ~${s.cpuAvg.toFixed(0)}% CPU. Gets the job done and asks for nothing.`],"drama-queen":[`Lives for the spotlight — ${s.spikes} CPU spikes this week and counting.`,`${e.hostname} likes to keep things interesting with a \xb1${s.cpuSD.toFixed(0)}% swing.`,"A connoisseur of chaos. Never a dull moment with this one."],"zen-master":[`Practices minimalism. Barely breaks a sweat at ${s.cpuAvg.toFixed(0)}% CPU.`,`${e.hostname} is in its happy place — calm, cool, collected.`,"Achieving enlightenment one idle cycle at a time."],sprinter:[`Bursts of energy, then recovery. ${s.spikes} sprints logged this week.`,`${e.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.",`${e.hostname} keeps hitting the reset button.`],ghost:["Hasn't been seen in a while. Anyone home?",`${e.hostname} is currently out of contact. Check the heartbeat.`],marathoner:[`In it for the long haul — ${s.samples} data points of pure consistency.`,`${e.hostname} doesn't sprint. It endures.`],rookie:["Still new around here — gathering experience.",`${e.hostname} is just getting started. Check back soon.`]};return n=Math.abs(r)%(a=i[t.name.toLowerCase().replace(" ","-")]??i.rookie??["…"]).length,a[n]}(e,c,{cpuAvg:n,cpuSD:r,memAvg:i,samples:t.length,spikes:l}),{archetype:c,archetypeKey:d,bio:o,stats:{cpuAvg:n,cpuStdDev:r,memAvg:i,samples:t.length,spikes:l}}},[e,a]),u=a.map(e=>e.cpuUsagePercent).slice(-40),h=a.map(e=>e.memoryPercent).slice(-40);return(0,t.jsx)(n.N,{title:"Personality",action:(0,t.jsx)("button",{onClick:()=>m(e=>e+1),className:"text-text-muted hover:text-text transition p-1",title:"Refresh personality","data-testid":"node-personality-refresh",children:(0,t.jsx)(V.f,{className:"h-3.5 w-3.5"})}),children:(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"node-personality-card","data-archetype":x.archetypeKey,children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.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:x.archetype.emoji}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{"data-testid":"node-archetype-badge",children:(0,t.jsx)(b.t,{variant:x.archetype.accent,children:x.archetype.name})}),i&&(0,t.jsx)("span",{className:"text-xs text-text-muted italic",children:"analyzing…"})]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:x.archetype.description})]})]}),(0,t.jsx)(er.f,{className:"h-4 w-4 text-accent mt-1"})]}),(0,t.jsxs)("blockquote",{className:"border-l-2 border-accent/40 pl-3 text-sm italic text-text","data-testid":"node-personality-bio",children:["“",x.bio,"”"]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 pt-2 border-t border-border/30",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-xs uppercase tracking-wider text-text-muted",children:"CPU trend"}),(0,t.jsxs)("span",{className:"text-xs tabular-nums text-text-muted",children:["avg ",x.stats.cpuAvg.toFixed(0),"%"]})]}),(0,t.jsx)(en.f,{values:u,tone:"primary",percent:!0,stretch:!0,threshold:80,testId:"node-personality-cpu-sparkline",label:`CPU trend, average ${x.stats.cpuAvg.toFixed(0)}%`})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-xs uppercase tracking-wider text-text-muted",children:"Memory trend"}),(0,t.jsxs)("span",{className:"text-xs tabular-nums text-text-muted",children:["avg ",x.stats.memAvg.toFixed(0),"%"]})]}),(0,t.jsx)(en.f,{values:h,tone:"accent",percent:!0,stretch:!0,threshold:80,testId:"node-personality-mem-sparkline",label:`Memory trend, average ${x.stats.memAvg.toFixed(0)}%`})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 text-[11px] text-text-muted",children:[(0,t.jsxs)("span",{children:[x.stats.samples," samples"]}),(0,t.jsxs)("span",{children:["σ ",x.stats.cpuStdDev.toFixed(1),"%"]}),(0,t.jsxs)("span",{children:[x.stats.spikes," spikes"]}),d&&(0,t.jsxs)("span",{className:"text-warning",children:["· ",d]})]})]})})}let ec={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"}]]};ec.node;let eo=(0,m.f)(ec);var em=e.i(71028);let ex={name:"thermometer",size:24,node:[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]};ex.node;let eu=(0,m.f)(ex);function ep(e,t){let s=e.map(e=>({timestamp:new Date(e.sampledAt).getTime(),value:t(e)})).filter(e=>null!==e.value);if(0===s.length)return"";let a=s[0].timestamp,n=Math.max(1,s.at(-1).timestamp-a);return s.map(({timestamp:e,value:t})=>{let s=104-.88*Math.max(0,Math.min(100,t));return`${((e-a)/n*600).toFixed(1)},${s.toFixed(1)}`}).join(" ")}function eh(e,t="%"){return null===e?"not reported":`${e.toFixed(1)}${t}`}function eg({telemetry:e}){let s=e?.latest??null,a=s?.devices??[],r=ep(e?.history??[],e=>e.maxUtilizationPercent),i=ep(e?.history??[],e=>e.maxFanPercent);return(0,t.jsx)(n.N,{title:"GPU telemetry",description:"30-second load and cooling history",action:s?(0,t.jsxs)(b.t,{variant:"default",children:["sampled ",(0,A.C)(s.sampledAt)]}):void 0,children:s&&0!==a.length?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:a.map(e=>(0,t.jsxs)("div",{className:"rounded-panel border border-border/70 bg-surface-raised/60 p-3 transition-colors hover:border-primary/30",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"truncate text-xs font-medium text-text",children:e.name}),(0,t.jsxs)("p",{className:"mt-0.5 text-[10px] uppercase tracking-wide text-text-muted",children:[e.vendor," · gpu ",e.index]})]}),100===e.fanPercent&&(0,t.jsx)(b.t,{variant:"danger",children:"fan saturated"})]}),(0,t.jsxs)("dl",{className:"mt-3 grid grid-cols-3 gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,t.jsx)(em.f,{className:"h-3 w-3"}),"Load"]}),(0,t.jsx)("dd",{className:"mt-1 num text-sm text-primary",children:eh(e.utilizationPercent)})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,t.jsx)(eo,{className:"h-3 w-3"}),"Fan"]}),(0,t.jsx)("dd",{className:`mt-1 num text-sm ${100===e.fanPercent?"text-danger glow-text-danger":"text-warning"}`,children:eh(e.fanPercent)})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,t.jsx)(eu,{className:"h-3 w-3"}),"Temp"]}),(0,t.jsx)("dd",{className:"mt-1 num text-sm text-text",children:eh(e.temperatureCelsius,"°C")})]})]}),(0,t.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,t.jsx)(l.f,{value:e.utilizationPercent,tone:"primary",label:`${e.name} load`}),(0,t.jsx)(l.f,{value:e.fanPercent,thresholds:{warn:80,crit:100},label:`${e.name} fan`})]})]},`${e.vendor}-${e.uuid??e.index}`))}),(0,t.jsxs)("div",{className:"panel-corners rounded-panel border border-border/70 bg-bg/60 p-3",children:[(0,t.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-[10px] font-medium uppercase tracking-[0.16em] text-text-muted",children:"Host maximum · last 24 hours"}),(0,t.jsxs)("div",{className:"flex items-center gap-3 text-[10px] text-text-muted",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"h-0.5 w-3 bg-primary shadow-[0_0_4px_var(--color-primary)]"}),"load"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"h-0.5 w-3 bg-warning"}),"fan"]})]})]}),(0,t.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,t.jsx)("line",{x1:"0",y1:"16",x2:"600",y2:"16",stroke:"var(--color-danger)",strokeOpacity:"0.45",strokeDasharray:"5 5"}),(0,t.jsx)("line",{x1:"0",y1:"60",x2:"600",y2:"60",stroke:"currentColor",strokeOpacity:"0.12"}),(0,t.jsx)("line",{x1:"0",y1:"104",x2:"600",y2:"104",stroke:"currentColor",strokeOpacity:"0.2"}),(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:"gpu-load-fill",x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"var(--color-primary)",stopOpacity:"0.35"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"var(--color-primary)",stopOpacity:"0"})]})}),r&&(0,t.jsx)("polygon",{points:`0,104 ${r} 600,104`,fill:"url(#gpu-load-fill)"}),r&&(0,t.jsx)("polyline",{points:r,fill:"none",stroke:"var(--color-primary)",strokeWidth:"2",vectorEffect:"non-scaling-stroke"}),i&&(0,t.jsx)("polyline",{points:i,fill:"none",stroke:"var(--color-warning)",strokeWidth:"2",vectorEffect:"non-scaling-stroke"})]}),(0,t.jsxs)("div",{className:"mt-1 flex justify-between num text-[9px] text-text-muted",children:[(0,t.jsx)("span",{children:"24h ago"}),(0,t.jsx)("span",{children:"100% saturation line"}),(0,t.jsx)("span",{children:"now"})]})]})]}):(0,t.jsx)("div",{className:"rounded-panel border border-dashed border-border px-4 py-6 text-center text-xs text-text-muted",children:s?.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 ef(e){if("string"==typeof e)try{return JSON.parse(e)}catch{return[]}return e??[]}function ej(e){if(!e)return[];if("string"==typeof e)try{return JSON.parse(e)}catch{return[]}return e}function eN(e){return!!(e&&"not_installed"!==e.status)}function ev(e){let t=e.status.toLowerCase();return t.includes("enabled")&&!t.includes("not enabled")&&!t.includes("disabled")}function ey(e,t){let s=e.filter(ev).find(e=>{let s=`${e.slug} ${e.pluginType} ${e.metadata?.description??""}`.toLowerCase();return"search"===t?/\b(search|web)\b/.test(s):/\b(crawl|browser|firecrawl|browserbase|browser-use)\b/.test(s)});return s?`${s.slug}${s.version?` ${s.version}`:""}`:"none enabled"}e.s(["default",0,function(){var e,m;let x,u,h,g=(0,a.useParams)(),f=(0,a.useRouter)(),[N,v]=(0,s.useState)(null),[y,T]=(0,s.useState)(null),[J,V]=(0,s.useState)([]),[W,Q]=(0,s.useState)(null),[Z,X]=(0,s.useState)(!0),[Y,ee]=(0,s.useState)(!1),[et,es]=(0,s.useState)(!1),[en,er]=(0,s.useState)([]),[ei,el]=(0,s.useState)({}),[ec,eo]=(0,s.useState)(null),[em,ex]=(0,s.useState)(!1),[eu,ep]=(0,s.useState)(null),[eh,ev]=(0,s.useState)(null),[eb,ew]=(0,s.useState)(null),[ek,eS]=(0,s.useState)(!1),[e$,eC]=(0,s.useState)(null),[eA,eP]=(0,s.useState)(!1),[eU,eI]=(0,s.useState)(!1),[e_,eE]=(0,s.useState)(null),[eM,eR]=(0,s.useState)(!1),[eD,eF]=(0,s.useState)(null),[eO,eL]=(0,s.useState)(null),[ez,eT]=(0,s.useState)(!1),eH=(0,s.useRef)(null),eB=(0,s.useRef)(void 0),eq=(0,s.useCallback)(async(e=!1)=>{try{e||X(!0);let[t,s,a,n,r]=await Promise.all([p.f.nodes.get(g.nodeId),p.f.nodes.health(g.nodeId).catch(()=>null),p.f.nodes.forecast(g.nodeId).catch(()=>null),p.f.hermes.installations().catch(()=>null),p.f.nodes.gpu(g.nodeId).catch(()=>null)]),i=t.data;i.role||void 0===eB.current?i.role&&(eB.current=i.role):i.role=eB.current,v(i),s&&T(s.data),V(a?.data?.forecasts??[]),Q(r?.data??null);let l=n?.data??[];eo(l.find(e=>e.nodeId===i.id)??l.find(e=>e.hostname===i.hostname||e.hostname===i.ipAddress)??null);try{let e=await p.f.roles.applications.list({nodeId:g.nodeId});er(e.data??[])}catch{}}catch{}finally{e||X(!1)}},[g.nodeId]);(0,s.useEffect)(()=>{eq()},[eq]);let eK=async()=>{if(N&&confirm(`Deploy Hermes Agent to "${N.name}"?`)){eR(!0),eF(null),eL(null);try{let e,t=await p.f.hermes.deploy({nodeId:N.id,hermesHome:"~/.hermes",hermesBin:"hermes",installMethod:"official-script",dashboardPort:9119,enableDashboard:!0,enableDashboardTui:!0,startGateway:!0},(e="u">typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2),`hermes-node-deploy-${Date.now()}-${e}`));eF(`Hermes Agent deployment started. Job ${t.data?.id.slice(0,10)}...`),eq(!0)}catch(e){eL(e instanceof Error?e.message:"Hermes Agent deployment failed")}finally{eR(!1)}}};(0,s.useEffect)(()=>{let e=N?.status==="PROVISIONING"||N?.agent?.status==="UPDATING"||!!(eD&&!eN(ec));return e&&!eH.current?eH.current=setInterval(()=>{eq(!0)},4e3):!e&&eH.current&&(clearInterval(eH.current),eH.current=null),()=>{eH.current&&(clearInterval(eH.current),eH.current=null)}},[N?.status,N?.agent?.status,N?.agent?.version,eq,eD,ec]);let eG=async()=>{if(N&&confirm(`Delete node "${N.name}"? This will permanently remove it and all associated data.`))try{await p.f.nodes.delete(N.id),f.push("/nodes")}catch{}},eJ=(0,s.useCallback)(async()=>{if(N?.status==="ONLINE"){ex(!0),ep(null);try{let e='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,"'\\''"),t=((await p.f.quickCommand.exec(N.id,{command:`bash -lc '${e}'`,args:[],timeoutSeconds:60})).data.stdout??"").trim(),s=Object.fromEntries(t.split("\n").map(e=>e.trim()).filter(e=>e.includes("=")).map(e=>{let[t,...s]=e.split("=");return[t,s.join("=").trim()||"unknown"]}));el(s)}catch(e){ep(e instanceof Error?e.message:"Failed to load software revisions")}finally{ex(!1)}}},[N?.id,N?.status]),eV=(0,s.useCallback)(async()=>{if(N?.status==="ONLINE"){eS(!0),eC(null);try{let e="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,"'\\''"),t=((await p.f.quickCommand.exec(N.id,{command:`bash -lc '${e}'`,args:[],timeoutSeconds:180})).data.stdout??"").trim(),s=Number.parseInt(t.split("\n").at(-1)??"",10);ev(Number.isFinite(s)?s:null),ew(new Date().toISOString())}catch(e){eC(e instanceof Error?e.message:"Failed to refresh apt updates")}finally{eS(!1)}}},[N?.id,N?.status]),eW=async()=>{if(N&&confirm(`Run apt upgrade on "${N.name}"?`)){eP(!0);try{let e=`apt-upgrade-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,t=(await p.f.commands.dispatch({nodeIds:[N.id],command:"sudo",args:["apt","upgrade","-y"],timeoutSeconds:1800,idempotencyKey:e},e)).data,s=t.commands?.[0]?.id;alert(s?`APT Upgrade dispatched (command ${s.slice(0,12)}…). Check Commands for progress.`:"APT Upgrade dispatched. Check Commands for progress."),await eV()}catch(e){alert(`APT Upgrade failed to dispatch: ${e instanceof Error?e.message:String(e)}`)}finally{eP(!1)}}},eQ=async()=>{if(N&&confirm(`Enable unattended apt update and apt upgrade on "${N.name}"? Magnus will install unattended-upgrades and enable the apt timers.`)){eI(!0),eE(null);try{await p.f.nodes.enableSystemUpdates(N.id),await eq(!0)}catch(e){eE(e instanceof Error?e.message:"Failed to enable automatic updates")}finally{eI(!1)}}};if((0,s.useEffect)(()=>{eJ(),eV()},[eJ,eV]),(0,s.useEffect)(()=>{if(!N||"ONLINE"!==N.status)return;let e=setInterval(()=>{eV()},36e5);return()=>clearInterval(e)},[N,eV]),Z)return(0,t.jsxs)("div",{className:"space-y-6","aria-busy":"true",children:[(0,t.jsx)("div",{className:"skeleton h-56 w-full rounded-panel opacity-70"}),(0,t.jsx)(o.g,{}),(0,t.jsx)("span",{className:"sr-only",children:"Loading node details…"})]});if(!N)return(0,t.jsx)(c.f,{tone:"accent",icon:(0,t.jsx)(K.f,{className:"h-5 w-5"}),title:"Node not found",description:"It may have been decommissioned or belong to another control node.",action:(0,t.jsx)($.K,{variant:"secondary",size:"sm",onClick:()=>f.push("/nodes"),children:"Back to nodes"}),className:"mt-12"});let eZ=eN(ec)?Array.isArray(ec.rawStatus?.skills)?ec.rawStatus.skills:[]:[],eX=eN(ec)?Array.isArray(ec.rawStatus?.plugins)?ec.rawStatus.plugins:[]:[],eY=eZ.filter(e=>e.enabled),e0=ec?.configuration?.modelProvider??"unknown",e1=ec?.configuration?.modelName??"unknown",e2=ey(eX,"search"),e3=ey(eX,"crawl"),e5=function(e){if(!e)return null;try{let t="string"==typeof e?JSON.parse(e):e;if("boolean"!=typeof t.installed||!["active","inactive","failed","not_installed","unknown"].includes(t.serviceStatus)||!["enabled","disabled","static","unknown"].includes(t.enabled)||null!==t.version&&"string"!=typeof t.version||!Array.isArray(t.managerAddresses))return null;return t}catch{return null}}(y?.wazuh),e4=function(e){if(!e)return null;try{let t="string"==typeof e?JSON.parse(e):e;if("boolean"!=typeof t.supported||"string"!=typeof t.platform||!["enabled","disabled","partial","unsupported","unknown"].includes(t.automaticUpdates??"")||"boolean"!=typeof t.rebootRequired||!Array.isArray(t.timers)||!Array.isArray(t.rebootRequiredPackages))return null;return{...t,fullUpgradePolicyEnabled:!0===t.fullUpgradePolicyEnabled}}catch{return null}}(y?.systemUpdates);return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(r.f,{hero:!0,padding:"lg",tone:"ONLINE"===N.status?"primary":"OFFLINE"===N.status?"danger":"warning",testId:"node-cockpit",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,t.jsx)($.K,{variant:"ghost",size:"sm",onClick:()=>f.push("/nodes"),"aria-label":"Back to nodes",children:(0,t.jsx)(I.f,{className:"h-4 w-4"})}),(0,t.jsx)(d.f,{status:N.status}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold text-primary glow-text-primary",children:N.name}),(0,t.jsxs)("p",{className:"num mt-1 truncate text-xs text-text-muted",children:[N.hostname,":",N.port,N.agent&&(0,t.jsxs)("span",{className:"ml-3 text-primary/70",children:["agent v",N.agent.version]}),y?.source&&(0,t.jsxs)("span",{className:"ml-3 uppercase tracking-wider",children:["source: ",y.source]})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(b.t,{variant:(0,b.k)(N.status),children:N.status}),N.agent?.status==="UPDATING"&&(0,t.jsxs)(b.t,{variant:"info",children:[(0,t.jsx)(M.f,{className:"h-3 w-3 animate-spin mr-1 inline"}),"Upgrading…"]}),(0,t.jsx)(w,{metadata:N.metadata}),(0,t.jsx)(k.x,{readiness:N.upgradeReadiness}),(0,t.jsx)($.K,{variant:"secondary",size:"sm",icon:(0,t.jsx)(P.f,{className:"h-3.5 w-3.5"}),onClick:()=>ee(!0),children:"Edit"}),(0,t.jsx)($.K,{variant:"danger",size:"sm",icon:(0,t.jsx)(U.f,{className:"h-3.5 w-3.5"}),onClick:()=>void eG(),children:"Delete"})]})]}),N.upgradeReadiness?.status==="not-ready"&&(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(k.a,{readiness:N.upgradeReadiness})}),(0,t.jsxs)("div",{className:"mt-6 grid gap-6 xl:grid-cols-[auto_minmax(0,1fr)]",children:[(0,t.jsxs)("div",{className:"flex flex-wrap justify-center gap-4 sm:justify-start",children:[(0,t.jsx)(i.f,{value:y?.cpuUsagePercent??null,label:"CPU Usage",size:128,testId:"node-gauge-cpu"}),(0,t.jsx)(i.f,{value:y?.memoryPercent??null,label:"Memory",size:128,sublabel:y?`${(0,A.L)(y.memoryUsedBytes)}`:void 0,testId:"node-gauge-memory"}),(h=(y?ef(y.disks):[]).reduce((e,t)=>!e||t.usagePercent>e.usagePercent?t:e,null),(0,t.jsx)(i.f,{value:h?.usagePercent??null,label:"Disk",size:128,thresholds:{warn:80,crit:90},sublabel:h?.mountPoint,testId:"node-gauge-disk"}))]}),(0,t.jsx)(j,{nodeId:N.id,height:170})]})]}),("DEGRADED"===N.status||N.agent?.status==="ERROR")&&(()=>{try{let e=JSON.parse(N.metadata),s="string"==typeof e.deployError?e.deployError:null,a="string"==typeof e.upgradeError?e.upgradeError:null,n=s??a;if(n)return(0,t.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,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(E.f,{className:"h-5 w-5 text-danger shrink-0 mt-0.5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-danger",children:s?"Deploy Failed":"Agent Upgrade Failed"}),(0,t.jsx)("pre",{className:"mt-1 text-xs text-text-muted whitespace-pre-wrap font-mono",children:n})]})]})})}catch{}return null})(),"PROVISIONING"===N.status&&(0,t.jsx)("div",{className:"rounded-panel border border-info/40 bg-info/5 p-4 shadow-[inset_3px_0_0_var(--color-info)]",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(M.f,{className:"h-5 w-5 text-info animate-spin"}),(0,t.jsx)("p",{className:"text-xs uppercase tracking-wider text-info",children:"Deploying agent… Status will update automatically."})]})}),N.agent?.status==="UPDATING"&&(0,t.jsx)("div",{className:"rounded-panel border border-info/40 bg-info/5 p-4 shadow-[inset_3px_0_0_var(--color-info)]",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(M.f,{className:"h-5 w-5 text-info animate-spin"}),(0,t.jsx)("p",{className:"text-xs uppercase tracking-wider text-info",children:"Agent upgrade in progress… Status will update automatically."})]})}),(0,t.jsx)(ea,{nodeId:N.id,nodeStatus:N.status}),(0,t.jsx)(eg,{telemetry:W}),(0,t.jsx)(ed,{node:{id:N.id,name:N.name,hostname:N.hostname,status:N.status,lastHeartbeatAt:N.lastHeartbeatAt}}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(n.N,{title:"Node Information",children:(0,t.jsxs)("dl",{className:"space-y-2 text-sm",children:[[["OS",N.os],["Architecture",N.arch],["Address",`${N.ipAddress}:${N.port}`],["Tags",(()=>{try{let e=JSON.parse(N.tags);return e.length?e.join(", "):"—"}catch{return"—"}})()]].map(([e,s])=>(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:e}),(0,t.jsx)("dd",{className:"font-medium",children:s})]},e)),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Agent Version"}),(0,t.jsx)("dd",{className:"font-medium flex items-center gap-1.5",children:N.agent?.version??"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Role"}),(0,t.jsx)("dd",{className:"font-medium",children:N.role?(0,t.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:()=>es(!0),title:"Change role",children:[(0,t.jsx)(D.f,{className:"h-3 w-3"}),N.role.name]}):(0,t.jsx)("button",{className:"text-xs text-text-muted hover:text-primary transition-colors cursor-pointer",onClick:()=>es(!0),children:"+ Assign Role"})})]}),[["Agent Status",N.agent?.status??"—"],["Last Heartbeat",(0,A.C)(N.lastHeartbeatAt)]].map(([e,s])=>(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:e}),(0,t.jsx)("dd",{className:"font-medium",children:s})]},e)),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Cockpit"}),(0,t.jsx)("dd",{className:"font-medium",children:y?.cockpitAvailable?(0,t.jsxs)("a",{href:`https://${N.ipAddress}:9090`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["Available",(0,t.jsx)(R.f,{className:"h-3 w-3"})]}):(0,t.jsx)("span",{className:"text-text-muted",children:"Not Available"})})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"CPU Cores"}),(0,t.jsx)("dd",{className:"font-medium",children:y?.cpuCores??"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Memory Used"}),(0,t.jsx)("dd",{className:"font-medium",children:y?`${(0,A.L)(y.memoryUsedBytes)} / ${(0,A.L)(y.memoryTotalBytes)}`:"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Swap Used"}),(0,t.jsx)("dd",{className:"font-medium",children:y&&y.swapTotalBytes?`${(0,A.L)(y.swapUsedBytes??0)} / ${(0,A.L)(y.swapTotalBytes)}`:"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Last Health Sample"}),(0,t.jsx)("dd",{className:"font-medium",children:y?(0,A.C)(y.timestamp):"—"})]})]})}),(0,t.jsx)(n.N,{title:"Hermes Agent",description:eN(ec)?ec.displayName??ec.hostname:"No Hermes Agent installed or found",action:eN(ec)?(0,t.jsx)(b.t,{variant:(0,b.k)(ec.status),children:ec.status}):void 0,children:eN(ec)?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("dl",{className:"grid gap-2 text-sm sm:grid-cols-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Version"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:ec.version??"unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Home"}),(0,t.jsx)("dd",{className:"font-mono text-xs break-all",children:ec.hermesHome})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Dashboard"}),(0,t.jsxs)("dd",{className:"mt-1 flex items-center gap-2",children:[(0,t.jsx)(b.t,{variant:(0,b.k)(ec.dashboardStatus),children:ec.dashboardStatus}),(0,t.jsx)("span",{className:"font-mono text-xs",children:(u=""===(x=(m=ec).dashboardHost.trim().toLowerCase().replace(/^\[|\]$/g,""))||"0.0.0.0"===x||"127.0.0.1"===x||"localhost"===x||"::"===x||"::1"===x?m.hostname:m.dashboardHost,`${u}:${m.dashboardPort}`)})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Gateway"}),(0,t.jsx)("dd",{className:"mt-1",children:(0,t.jsx)(b.t,{variant:(0,b.k)(ec.gatewayStatus),children:ec.gatewayStatus})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"API Server"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:ec.apiServerEnabled?`${ec.apiServerHost}:${ec.apiServerPort??"—"}`:"disabled"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Primary Provider"}),(0,t.jsxs)("dd",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)(b.t,{variant:"unknown"===e0?"warning":"success",children:e0}),ec.configuration?.magnusRouterConfigured&&(0,t.jsx)(b.t,{variant:"success",children:"Magnus routed"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Default Model"}),(0,t.jsx)("dd",{className:"font-mono text-xs break-all",children:e1})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"OpenAI Runtime"}),(0,t.jsx)("dd",{className:"mt-1",children:(0,t.jsx)(b.t,{variant:ec.configuration?.openaiRuntime==="codex_app_server"?"success":"warning",children:ec.configuration?.openaiRuntime==="codex_app_server"?"Codex app-server":"Hermes default"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Web Search"}),(0,t.jsxs)("dd",{className:"mt-1 flex items-center gap-2 text-xs",children:[(0,t.jsx)(z.f,{className:"h-3.5 w-3.5 text-text-muted"}),(0,t.jsx)("span",{className:"font-mono break-all",children:e2})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Crawling"}),(0,t.jsxs)("dd",{className:"mt-1 flex items-center gap-2 text-xs",children:[(0,t.jsx)(H,{className:"h-3.5 w-3.5 text-text-muted"}),(0,t.jsx)("span",{className:"font-mono break-all",children:e3})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Memory"}),(0,t.jsxs)("dd",{className:"mt-1",children:[(0,t.jsx)(b.t,{variant:ec.configuration?.hiveMemConfigured?"success":"warning",children:ec.configuration?.memoryProvider??"not configured"}),(0,t.jsx)(S.f,{configuration:ec.configuration})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Skills"}),(0,t.jsx)("dd",{className:"mt-1",children:(0,t.jsxs)("button",{type:"button",onClick:()=>eT(!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===eZ.length,children:[(0,t.jsx)(L.f,{className:"h-3.5 w-3.5"}),function(e){if(0===e.length)return"0 synced";let t=e.filter(e=>e.enabled).length;return`${t} enabled / ${e.length} total`}(eZ)]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Last Sync"}),(0,t.jsx)("dd",{className:"text-xs",children:(0,A.C)(ec.lastSyncedAt)})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[ec.configuration?.modelBaseUrl&&(0,t.jsxs)("p",{className:"text-xs text-text-muted",children:["Base URL: ",(0,t.jsx)("span",{className:"font-mono",children:ec.configuration.modelBaseUrl})]}),ec.configuration?.configPath&&(0,t.jsxs)("p",{className:"text-xs text-text-muted",children:["Config: ",(0,t.jsx)("span",{className:"font-mono",children:ec.configuration.configPath})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(ec.profiles??[]).slice(0,6).map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-text-muted",children:[(0,t.jsx)(F.f,{className:"h-3 w-3"}),e.name]},e.id)),(ec.profiles?.length??0)===0&&(0,t.jsx)("span",{className:"text-xs text-text-muted",children:"No profiles synced"})]}),(0,t.jsx)($.K,{size:"sm",variant:"secondary",icon:(0,t.jsx)(R.f,{className:"h-3.5 w-3.5"}),onClick:()=>f.push(`/orchestra/web-gateway?installationId=${encodeURIComponent(ec.id)}`),children:"Open Dashboard"})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"No Hermes Agent is installed or currently detected on this node."}),eD&&(0,t.jsx)("p",{className:"text-xs text-success",children:eD}),eO&&(0,t.jsx)("p",{className:"text-xs text-danger",children:eO}),(0,t.jsx)($.K,{size:"sm",variant:"secondary",icon:eM?(0,t.jsx)(M.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(O.f,{className:"h-3.5 w-3.5"}),disabled:!N||"ONLINE"!==N.status||eM,onClick:()=>void eK(),children:eM?"Starting Deployment...":"Deploy Hermes Agent"}),N?.status!=="ONLINE"&&(0,t.jsx)("p",{className:"text-xs text-text-muted",children:"Bring the Magnus agent online before starting automated Hermes deployment."})]})}),(0,t.jsx)(n.N,{title:"Service Checks",children:y&&ej(y.services).length>0?(0,t.jsx)("div",{className:"space-y-2 text-sm",children:ej(y.services).slice(0,8).map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between rounded border border-border px-2 py-1.5",children:[(0,t.jsx)("span",{className:"font-medium",children:e.name}),(0,t.jsx)(b.t,{variant:"active"===e.status?"success":"failed"===e.status?"danger":"default",children:e.status})]},e.name))}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"No service checks available from this node yet."})})]}),(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(n.N,{title:"System Update Readiness",description:"Automatic apt policy and reboot state from the latest heartbeat",action:e4?(0,t.jsx)(b.t,{variant:e4.rebootRequired?"danger":"enabled"===e4.automaticUpdates?"success":"warning",children:e4.rebootRequired?"reboot required":e4.automaticUpdates.replace("_"," ")}):void 0,children:e4?(0,t.jsxs)("div",{className:"space-y-4",children:[e4.rebootRequired&&(0,t.jsxs)("div",{className:"flex gap-3 rounded border border-danger/30 bg-danger/10 p-3",children:[(0,t.jsx)(q.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-danger"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-danger",children:"Restart needed to finish installed updates"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:e4.rebootRequiredPackages.length?e4.rebootRequiredPackages.slice(0,5).join(", "):"The operating system has set the reboot-required marker."})]})]}),(0,t.jsxs)("dl",{className:"space-y-2 text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Platform"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:e4.platform})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Automatic updates"}),(0,t.jsx)("dd",{children:(0,t.jsx)(b.t,{variant:"enabled"===e4.automaticUpdates?"success":"warning",children:e4.automaticUpdates})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"unattended-upgrades"}),(0,t.jsx)("dd",{children:e4.unattendedUpgradesInstalled?"installed":"not installed"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"full apt upgrade policy"}),(0,t.jsx)("dd",{children:e4.fullUpgradePolicyEnabled?"enabled":"not enabled"})]}),e4.timers.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"font-mono text-[11px] text-text-muted",children:e.name}),(0,t.jsx)("dd",{className:"font-mono text-[11px]",children:e.state})]},e.name))]}),e4.supported&&"enabled"!==e4.automaticUpdates&&(0,t.jsxs)($.K,{size:"sm",variant:"primary",disabled:"ONLINE"!==N.status||eU,onClick:()=>void eQ(),children:[eU?(0,t.jsx)(M.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(B.f,{className:"h-3.5 w-3.5"}),eU?"Enabling…":"Enable automatic updates"]}),e_&&(0,t.jsx)("p",{className:"text-xs text-danger",children:e_})]}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"Update posture will appear after agent v1.6.0 reports its first heartbeat."})}),(0,t.jsx)(n.N,{title:"Wazuh Agent",description:"Endpoint-security posture from the latest node heartbeat",action:e5?(0,t.jsx)(b.t,{variant:"active"===(e=e5.serviceStatus)?"success":"failed"===e?"danger":"inactive"===e?"warning":"default",children:e5.serviceStatus.replace("_"," ")}):void 0,children:e5?(0,t.jsxs)("dl",{className:"space-y-2 text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Installation"}),(0,t.jsx)("dd",{children:(0,t.jsx)(b.t,{variant:e5.installed?"success":"default",children:e5.installed?"installed":"not installed"})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Startup"}),(0,t.jsx)("dd",{className:"font-medium",children:e5.enabled})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Version"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:e5.version??"—"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Managers"}),(0,t.jsx)("dd",{className:"mt-1 font-mono text-xs break-all",children:e5.managerAddresses.length?e5.managerAddresses.join(", "):"—"})]})]}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"Wazuh posture will appear after this host reports a current Magnus agent heartbeat."})}),(0,t.jsx)(n.N,{title:"Disk Usage",children:y&&ef(y.disks).length?(0,t.jsx)("div",{className:"space-y-3",children:ef(y.disks).map(e=>(0,t.jsxs)("div",{className:"text-sm",children:[(0,t.jsxs)("div",{className:"flex justify-between text-xs",children:[(0,t.jsx)("span",{className:"text-text-muted",children:e.mountPoint}),(0,t.jsxs)("span",{className:"num",children:[(0,A.L)(e.usedBytes)," / ",(0,A.L)(e.totalBytes)]})]}),(0,t.jsx)(l.f,{value:e.usagePercent,thresholds:{warn:80,crit:90},size:"sm",label:`${e.mountPoint} disk usage`,showValue:!0,className:"mt-1"})]},e.mountPoint))}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"No disk data available"})}),(0,t.jsx)(n.N,{title:"Capacity Forecast",description:"Per-volume 30-day growth trend and estimated time to full",children:J.length?(0,t.jsx)("div",{className:"space-y-3",children:J.map(e=>(0,t.jsxs)("div",{className:"rounded border border-border/50 p-3 text-xs",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{className:"font-mono text-text",children:e.mountPoint}),(0,t.jsx)(b.t,{variant:null!==e.daysUntilFull&&e.daysUntilFull<=14?"danger":null!==e.daysUntilFull&&e.daysUntilFull<=30?"warning":"default",children:null===e.daysUntilFull?e.growthRatePerDay>0?"trend uncertain":"stable/shrinking":`${e.daysUntilFull}d to full`})]}),(0,t.jsxs)("div",{className:"mt-2 text-text-muted",children:[e.currentUsagePercent.toFixed(1),"% used · ",(0,A.L)(Math.abs(e.growthRatePerDay)),"/day ",e.growthRatePerDay>=0?"growth":"reclaimed"," · confidence ",(100*e.confidence).toFixed(0),"%"]}),(0,t.jsx)("p",{className:"mt-2 text-text-muted",children:e.recommendation})]},e.mountPoint))}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"At least three retained samples are needed for a capacity forecast."})}),(0,t.jsxs)(n.N,{title:"Software Revisions",description:"Major runtime versions and package update status",action:(0,t.jsx)($.K,{variant:"ghost",size:"sm",onClick:()=>void eJ(),children:(0,t.jsx)(_.f,{className:`h-3.5 w-3.5 ${em?"animate-spin":""}`})}),children:[(0,t.jsxs)("div",{className:"space-y-2 text-sm",children:[["node","npm","python3","redis","docker","tailscale","magnus-agent"].map(e=>(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsx)("dt",{className:"text-text-muted uppercase text-xs tracking-wide",children:e}),(0,t.jsx)("dd",{className:"font-mono text-right text-xs break-all",children:ei[e]??(em?"Loading…":"—")})]},e)),eu&&(0,t.jsx)("p",{className:"text-xs text-danger",children:eu})]}),(0,t.jsxs)("div",{className:"mt-4 border-t border-border pt-4 space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-xs uppercase tracking-wide text-text-muted",children:"APT Updates"}),(0,t.jsx)(b.t,{variant:eh&&eh>0?"warning":"success",children:ek?"Checking…":`${eh??"—"} pending`})]}),(0,t.jsxs)("p",{className:"text-xs text-text-muted",children:["Refreshed hourly via apt update",eb?` • Last check: ${(0,A.C)(eb)}`:""]}),e$&&(0,t.jsx)("p",{className:"text-xs text-danger",children:e$}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)($.K,{size:"sm",variant:"secondary",disabled:"ONLINE"!==N.status||ek,onClick:()=>void eV(),children:[(0,t.jsx)(_.f,{className:`h-3.5 w-3.5 ${ek?"animate-spin":""}`}),"Refresh"]}),(0,t.jsxs)($.K,{size:"sm",variant:"primary",disabled:"ONLINE"!==N.status||eA,onClick:()=>void eW(),children:[eA?(0,t.jsx)(M.f,{className:"h-3.5 w-3.5 animate-spin"}):null,eA?"Dispatching…":"APT Upgrade"]})]})]})]})]})]}),en.length>0&&(0,t.jsx)(n.N,{title:"Role Applications",children:(0,t.jsx)("div",{className:"space-y-4",children:en.map(e=>(0,t.jsxs)("div",{className:"rounded-lg border border-border p-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(D.f,{className:"h-4 w-4 text-primary"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["apply"===e.action?"Apply":"Remove",": ",e.role?.name??"Unknown"]})]}),(0,t.jsx)(b.t,{variant:"completed"===e.status?"success":"failed"===e.status?"danger":"running"===e.status?"info":"default",children:e.status})]}),e.error&&(0,t.jsx)("div",{className:"mb-2 rounded border border-danger/30 bg-danger/10 px-2 py-1 text-xs text-danger font-mono",children:e.error}),(0,t.jsx)("div",{className:"space-y-1",children:e.steps.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsxs)("span",{className:"completed"===e.status?"text-success":"failed"===e.status?"text-danger":"running"===e.status?"text-info":"skipped"===e.status?"text-text-muted/50":"text-text-muted",children:["completed"===e.status&&"✓","failed"===e.status&&"✗","running"===e.status&&"⟳","skipped"===e.status&&"—","pending"===e.status&&"○"]}),(0,t.jsx)("span",{className:"skipped"===e.status?"text-text-muted/50 line-through":"",children:e.name}),e.error&&(0,t.jsx)("span",{className:"text-danger ml-2 truncate max-w-xs",title:e.error,children:e.error})]},e.name))}),(0,t.jsxs)("div",{className:"mt-2 text-[10px] text-text-muted",children:[e.startedAt?`Started: ${(0,A.C)(e.startedAt)}`:"",e.completedAt?` — Completed: ${(0,A.C)(e.completedAt)}`:""]})]},e.id))})}),(0,t.jsx)(C.n,{open:ez,onClose:()=>eT(!1),title:"Hermes Skills",description:`${eY.length} enabled on ${N.name}`,icon:(0,t.jsx)(L.f,{className:"h-5 w-5 text-primary"}),className:"max-w-3xl",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[(0,t.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Enabled"}),(0,t.jsx)("p",{className:"mt-1 text-lg font-semibold",children:eY.length})]}),(0,t.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Total"}),(0,t.jsx)("p",{className:"mt-1 text-lg font-semibold",children:eZ.length})]}),(0,t.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Sources"}),(0,t.jsx)("p",{className:"mt-1 text-sm font-mono",children:Array.from(new Set(eZ.map(e=>e.source))).filter(Boolean).join(", ")||"unknown"})]})]}),(0,t.jsxs)("div",{className:"max-h-[55vh] overflow-auto rounded border border-border",children:[(0,t.jsxs)("table",{className:"w-full text-left text-xs",children:[(0,t.jsx)("thead",{className:"sticky top-0 bg-surface text-[10px] uppercase tracking-wide text-text-muted",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Skill"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Category"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Source"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border",children:eZ.slice().sort((e,t)=>Number(t.enabled)-Number(e.enabled)||e.slug.localeCompare(t.slug)).map(e=>(0,t.jsxs)("tr",{className:"bg-bg/20",children:[(0,t.jsx)("td",{className:"px-3 py-2 font-mono",children:e.slug}),(0,t.jsx)("td",{className:"px-3 py-2 text-text-muted",children:e.category??"uncategorized"}),(0,t.jsx)("td",{className:"px-3 py-2 text-text-muted",children:e.source}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(b.t,{variant:e.enabled?"success":"default",children:e.enabled?"enabled":"disabled"})})]},`${e.slug}-${e.source}`))})]}),0===eZ.length&&(0,t.jsx)("div",{className:"p-6 text-sm text-text-muted",children:"No synced Hermes skills were reported for this node."})]})]})}),(0,t.jsx)(G.F,{open:Y,node:N,onClose:()=>ee(!1),onSaved:()=>void eq()}),(0,t.jsx)(G.E,{open:et,node:N?{id:N.id,name:N.name,role:N.role}:null,onClose:()=>es(!1),onSaved:e=>{eB.current=e,N&&v({...N,role:e}),eq()}})]})}],5525)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,5525,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(18566),n=e.i(93999),r=e.i(3062),i=e.i(54149),l=e.i(51196),d=e.i(75723),c=e.i(2067),o=e.i(65369),m=e.i(56420);let x={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"]};x.node;let u=(0,m.f)(x);var p=e.i(82983),h=e.i(78571),g=e.i(21176);let f=["1h","6h","24h"];function j({nodeId:e,height:a=180}){let[n,r]=(0,s.useState)("1h"),[i,l]=(0,s.useState)(null),[d,o]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let t=!1;o(!1);let s=async()=>{try{let[s,a]=await Promise.all([p.f.get(`nodes/${e}/health/timeseries?metric=cpu&period=${n}`),p.f.get(`nodes/${e}/health/timeseries?metric=memory&period=${n}`)]);if(t)return;let r=s.data??{timestamps:[],values:[]},i=a.data??{timestamps:[],values:[]},d=new Map;r.timestamps.forEach((e,t)=>{let s=Date.parse(e);d.set(s,{t:s,cpu:r.values[t]??null,mem:null})}),i.timestamps.forEach((e,t)=>{let s=Date.parse(e),a=d.get(s)??{t:s,cpu:null,mem:null};a.mem=i.values[t]??null,d.set(s,a)}),l([...d.values()].sort((e,t)=>e.t-t.t))}catch{t||(l([]),o(!0))}};s();let a=setInterval(()=>void s(),6e4);return()=>{t=!0,clearInterval(a)}},[e,n]),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col","data-testid":"node-metrics-chart",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-text-muted",children:"CPU / memory history"}),(0,t.jsx)("div",{role:"group","aria-label":"History period",className:"flex rounded-chip border border-border bg-bg p-0.5",children:f.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>r(e),"aria-pressed":n===e,className:(0,h.f)("rounded-chip px-2 py-0.5 text-[10px] uppercase tracking-wider transition-colors",n===e?"bg-primary/15 text-primary shadow-[0_0_8px_var(--color-glow)]":"text-text-muted hover:text-text"),children:e},e))})]}),null===i?(0,t.jsx)("div",{className:"skeleton w-full",style:{height:a}}):i.length<2?(0,t.jsx)(c.f,{compact:!0,icon:(0,t.jsx)(u,{className:"h-4 w-4"}),title:d?"History unavailable":"Not enough samples yet",description:d?"The health timeseries endpoint did not answer.":`No health snapshots in the last ${n}.`,tone:d?"warning":"muted",className:"flex-1"}):(0,t.jsx)(g.f,{data:i,xKey:"t",percent:!0,height:a,formatX:e=>new Date(Number(e)).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 N=e.i(95925);let v={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"}]]};v.node;let y=(0,m.f)(v);var b=e.i(46670);function w({metadata:e}){let s=function(e){let t=e;if("string"==typeof e)try{t=JSON.parse(e)}catch{return}return t?.agentSelfUpgrade}(e);return s?s.upgrade?.state==="reverted"?(0,t.jsx)("span",{title:s.upgrade.reason??void 0,children:(0,t.jsxs)(b.t,{variant:"danger",children:[(0,t.jsx)(N.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade to ",s.upgrade.to," reverted"]})}):s.upgrade?.state==="failed"?(0,t.jsx)("span",{title:s.upgrade.reason??void 0,children:(0,t.jsxs)(b.t,{variant:"danger",children:[(0,t.jsx)(N.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade to ",s.upgrade.to," failed"]})}):s.enabled?null:(0,t.jsx)("span",{title:s.reason??void 0,"data-testid":"agent-self-upgrade-off",children:(0,t.jsxs)(b.t,{variant:"default",children:[(0,t.jsx)(y,{className:"mr-1 inline h-3 w-3"}),"Self-upgrade off"]})}):null}var k=e.i(53721),S=e.i(57108),$=e.i(68759),C=e.i(32568),A=e.i(71417),P=e.i(15281),U=e.i(59659),I=e.i(9347),_=e.i(25398),E=e.i(92026),R=e.i(32781),M=e.i(82022),D=e.i(84026),F=e.i(71567),O=e.i(94371),L=e.i(20851),z=e.i(66595);let T={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"}]]};T.node;let H=(0,m.f)(T);var B=e.i(86207),q=e.i(57665),K=e.i(41220),G=e.i(14098),J=e.i(4139),V=e.i(41120),W=e.i(82954),Q=e.i(79432),Z=e.i(62368),X=e.i(64155),Y=e.i(51757),ee=e.i(83967),et=e.i(74544);let es=[{id:"apt-update",label:"apt update",command:"sudo",args:["apt","update"],icon:(0,t.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,t.jsx)(V.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,t.jsx)(Q.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,t.jsx)(W.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,t.jsx)(X.f,{className:"h-3.5 w-3.5"}),variant:"secondary",timeoutSeconds:15},{id:"reboot",label:"Reboot",command:"sudo",args:["reboot"],icon:(0,t.jsx)(q.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 ea({nodeId:e,nodeStatus:a}){let[n,r]=(0,s.useState)(!1),[i,l]=(0,s.useState)(!1),[d,c]=(0,s.useState)(null),[o,m]=(0,s.useState)(null),[x,u]=(0,s.useState)(null),h="ONLINE"!==a,g=async t=>{if(!t.confirm||confirm(t.confirm)){c(t),m(null),u(null),l(!0),r(!0);try{let s=await p.f.quickCommand.exec(e,{command:t.command,args:t.args,timeoutSeconds:t.timeoutSeconds});m(s.data)}catch(e){u(e instanceof Error?e.message:"Command execution failed")}finally{l(!1)}}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"rounded border border-border bg-surface p-3",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-text-muted mr-2",children:[(0,t.jsx)(J.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"font-bold uppercase tracking-wider",children:"Quick Commands"})]}),es.map(e=>(0,t.jsx)($.K,{variant:e.variant,size:"sm",icon:e.icon,disabled:h,onClick:()=>void g(e),children:e.label},e.id)),h&&(0,t.jsx)("span",{className:"ml-2 text-xs text-text-muted",children:"Node must be ONLINE to run commands"})]})}),(0,t.jsx)(C.n,{open:n,onClose:()=>r(!1),title:d?.label??"Command",description:d?`${d.command} ${(d.args??[]).join(" ")}`:void 0,icon:(0,t.jsx)(J.f,{className:"h-5 w-5 text-primary"}),className:"max-w-3xl",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R.f,{className:"h-4 w-4 animate-spin text-primary"}),(0,t.jsx)("span",{className:"text-xs text-primary",children:"Executing…"})]}):x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ee.f,{className:"h-4 w-4 text-danger"}),(0,t.jsx)("span",{className:"text-xs text-danger",children:"Error"})]}):o?(0,t.jsxs)(t.Fragment,{children:[0===o.exitCode?(0,t.jsx)(Y.f,{className:"h-4 w-4 text-success"}):(0,t.jsx)(ee.f,{className:"h-4 w-4 text-danger"}),(0,t.jsxs)("span",{className:`text-xs ${0===o.exitCode?"text-success":"text-danger"}`,children:["Exit code: ",o.exitCode]}),(0,t.jsxs)("span",{className:"text-xs text-text-muted flex items-center gap-1 ml-auto",children:[(0,t.jsx)(et.f,{className:"h-3 w-3"}),(o.durationMs/1e3).toFixed(2),"s"]})]}):null}),x&&(0,t.jsx)("div",{className:"rounded bg-danger/10 border border-danger/30 p-3",children:(0,t.jsx)("p",{className:"text-xs text-danger",children:x})}),o&&(0,t.jsxs)("div",{className:"space-y-3",children:[o.stdout&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[11px] font-bold uppercase tracking-wider text-text-muted mb-1",children:"stdout"}),(0,t.jsx)("pre",{className:"max-h-80 overflow-auto rounded bg-bg border border-border p-3 text-xs text-success whitespace-pre-wrap",children:o.stdout})]}),o.stderr&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[11px] font-bold uppercase tracking-wider text-text-muted mb-1",children:"stderr"}),(0,t.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:o.stderr})]}),!o.stdout&&!o.stderr&&(0,t.jsx)("p",{className:"text-xs text-text-muted italic",children:"No output captured"}),o.truncated&&(0,t.jsx)("p",{className:"text-xs text-warning",children:"⚠ Output was truncated (exceeded 1MB)"})]}),i&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)(R.f,{className:"h-8 w-8 animate-spin text-primary mx-auto mb-2"}),(0,t.jsx)("p",{className:"text-xs text-text-muted",children:"Executing command on remote node…"})]})}),(0,t.jsx)("div",{className:"flex justify-end pt-2",children:(0,t.jsx)($.K,{variant:"ghost",size:"sm",onClick:()=>r(!1),children:"Close"})})]})})]})}var en=e.i(55427),er=e.i(28623);let ei={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 el(e){return 0===e.length?0:e.reduce((e,t)=>e+t,0)/e.length}function ed({node:e}){let[a,r]=(0,s.useState)([]),[i,l]=(0,s.useState)(!0),[d,c]=(0,s.useState)(null),[o,m]=(0,s.useState)(0);(0,s.useEffect)(()=>{let t=!1;return(async()=>{l(!0),c(null);try{let s=await p.f.get(`nodes/${e.id}/health/history?limit=100`);if(t)return;let a=s.data,n=[];Array.isArray(a)?n=a:a?.items&&(n=a.items),r([...n].reverse())}catch(e){t||(r([]),c(e instanceof Error?e.message:"Failed to load history"))}finally{t||l(!1)}})(),()=>{t=!0}},[e.id,o]);let x=(0,s.useMemo)(()=>{let t,s,n,r,i,l,d,c,o;return t=a.map(e=>e.cpuUsagePercent).filter(e=>Number.isFinite(e)),s=a.map(e=>e.memoryPercent).filter(e=>Number.isFinite(e)),n=el(t),r=function(e){if(e.length<2)return 0;let t=el(e);return Math.sqrt(e.reduce((e,s)=>e+(s-t)*(s-t),0)/(e.length-1))}(t),i=el(s),l=t.filter(e=>e>80).length,d="rookie",c=ei[d="OFFLINE"===e.status||e.lastHeartbeatAt&&Date.now()-new Date(e.lastHeartbeatAt).getTime()>6e5?"ghost":a.length<3?"rookie":r>25||l/Math.max(1,t.length)>.25?l/Math.max(1,t.length)>.4?"drama-queen":"sprinter":n<15&&r<10?"zen-master":n>40&&n<75&&r<15?"workhorse":n<40&&r<15&&a.length>20?"marathoner":"workhorse"]??ei.rookie??{name:"Rookie",emoji:"🌱",description:"",accent:"default"},o=function(e,t,s){var a;let n,r=Math.floor(Date.now()/6048e5);for(let t=0;t<e.id.length;t++)r=31*r+e.id.charCodeAt(t)|0;let i={workhorse:[`Steady as they come — averaging ${s.cpuAvg.toFixed(0)}% CPU without a single complaint this week.`,`The dependable one. ${e.hostname} just keeps grinding through the workload.`,`Quietly productive at ~${s.cpuAvg.toFixed(0)}% CPU. Gets the job done and asks for nothing.`],"drama-queen":[`Lives for the spotlight — ${s.spikes} CPU spikes this week and counting.`,`${e.hostname} likes to keep things interesting with a \xb1${s.cpuSD.toFixed(0)}% swing.`,"A connoisseur of chaos. Never a dull moment with this one."],"zen-master":[`Practices minimalism. Barely breaks a sweat at ${s.cpuAvg.toFixed(0)}% CPU.`,`${e.hostname} is in its happy place — calm, cool, collected.`,"Achieving enlightenment one idle cycle at a time."],sprinter:[`Bursts of energy, then recovery. ${s.spikes} sprints logged this week.`,`${e.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.",`${e.hostname} keeps hitting the reset button.`],ghost:["Hasn't been seen in a while. Anyone home?",`${e.hostname} is currently out of contact. Check the heartbeat.`],marathoner:[`In it for the long haul — ${s.samples} data points of pure consistency.`,`${e.hostname} doesn't sprint. It endures.`],rookie:["Still new around here — gathering experience.",`${e.hostname} is just getting started. Check back soon.`]};return n=Math.abs(r)%(a=i[t.name.toLowerCase().replace(" ","-")]??i.rookie??["…"]).length,a[n]}(e,c,{cpuAvg:n,cpuSD:r,memAvg:i,samples:t.length,spikes:l}),{archetype:c,archetypeKey:d,bio:o,stats:{cpuAvg:n,cpuStdDev:r,memAvg:i,samples:t.length,spikes:l}}},[e,a]),u=a.map(e=>e.cpuUsagePercent).slice(-40),h=a.map(e=>e.memoryPercent).slice(-40);return(0,t.jsx)(n.N,{title:"Personality",action:(0,t.jsx)("button",{onClick:()=>m(e=>e+1),className:"text-text-muted hover:text-text transition p-1",title:"Refresh personality","data-testid":"node-personality-refresh",children:(0,t.jsx)(V.f,{className:"h-3.5 w-3.5"})}),children:(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"node-personality-card","data-archetype":x.archetypeKey,children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.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:x.archetype.emoji}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{"data-testid":"node-archetype-badge",children:(0,t.jsx)(b.t,{variant:x.archetype.accent,children:x.archetype.name})}),i&&(0,t.jsx)("span",{className:"text-xs text-text-muted italic",children:"analyzing…"})]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:x.archetype.description})]})]}),(0,t.jsx)(er.f,{className:"h-4 w-4 text-accent mt-1"})]}),(0,t.jsxs)("blockquote",{className:"border-l-2 border-accent/40 pl-3 text-sm italic text-text","data-testid":"node-personality-bio",children:["“",x.bio,"”"]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 pt-2 border-t border-border/30",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-xs uppercase tracking-wider text-text-muted",children:"CPU trend"}),(0,t.jsxs)("span",{className:"text-xs tabular-nums text-text-muted",children:["avg ",x.stats.cpuAvg.toFixed(0),"%"]})]}),(0,t.jsx)(en.f,{values:u,tone:"primary",percent:!0,stretch:!0,threshold:80,testId:"node-personality-cpu-sparkline",label:`CPU trend, average ${x.stats.cpuAvg.toFixed(0)}%`})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-xs uppercase tracking-wider text-text-muted",children:"Memory trend"}),(0,t.jsxs)("span",{className:"text-xs tabular-nums text-text-muted",children:["avg ",x.stats.memAvg.toFixed(0),"%"]})]}),(0,t.jsx)(en.f,{values:h,tone:"accent",percent:!0,stretch:!0,threshold:80,testId:"node-personality-mem-sparkline",label:`Memory trend, average ${x.stats.memAvg.toFixed(0)}%`})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 text-[11px] text-text-muted",children:[(0,t.jsxs)("span",{children:[x.stats.samples," samples"]}),(0,t.jsxs)("span",{children:["σ ",x.stats.cpuStdDev.toFixed(1),"%"]}),(0,t.jsxs)("span",{children:[x.stats.spikes," spikes"]}),d&&(0,t.jsxs)("span",{className:"text-warning",children:["· ",d]})]})]})})}let ec={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"}]]};ec.node;let eo=(0,m.f)(ec);var em=e.i(71028);let ex={name:"thermometer",size:24,node:[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]};ex.node;let eu=(0,m.f)(ex);function ep(e,t){let s=e.map(e=>({timestamp:new Date(e.sampledAt).getTime(),value:t(e)})).filter(e=>null!==e.value);if(0===s.length)return"";let a=s[0].timestamp,n=Math.max(1,s.at(-1).timestamp-a);return s.map(({timestamp:e,value:t})=>{let s=104-.88*Math.max(0,Math.min(100,t));return`${((e-a)/n*600).toFixed(1)},${s.toFixed(1)}`}).join(" ")}function eh(e,t="%"){return null===e?"not reported":`${e.toFixed(1)}${t}`}function eg({telemetry:e}){let s=e?.latest??null,a=s?.devices??[],r=ep(e?.history??[],e=>e.maxUtilizationPercent),i=ep(e?.history??[],e=>e.maxFanPercent);return(0,t.jsx)(n.N,{title:"GPU telemetry",description:"30-second load and cooling history",action:s?(0,t.jsxs)(b.t,{variant:"default",children:["sampled ",(0,A.C)(s.sampledAt)]}):void 0,children:s&&0!==a.length?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:a.map(e=>(0,t.jsxs)("div",{className:"rounded-panel border border-border/70 bg-surface-raised/60 p-3 transition-colors hover:border-primary/30",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"truncate text-xs font-medium text-text",children:e.name}),(0,t.jsxs)("p",{className:"mt-0.5 text-[10px] uppercase tracking-wide text-text-muted",children:[e.vendor," · gpu ",e.index]})]}),100===e.fanPercent&&(0,t.jsx)(b.t,{variant:"danger",children:"fan saturated"})]}),(0,t.jsxs)("dl",{className:"mt-3 grid grid-cols-3 gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,t.jsx)(em.f,{className:"h-3 w-3"}),"Load"]}),(0,t.jsx)("dd",{className:"mt-1 num text-sm text-primary",children:eh(e.utilizationPercent)})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,t.jsx)(eo,{className:"h-3 w-3"}),"Fan"]}),(0,t.jsx)("dd",{className:`mt-1 num text-sm ${100===e.fanPercent?"text-danger glow-text-danger":"text-warning"}`,children:eh(e.fanPercent)})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,t.jsx)(eu,{className:"h-3 w-3"}),"Temp"]}),(0,t.jsx)("dd",{className:"mt-1 num text-sm text-text",children:eh(e.temperatureCelsius,"°C")})]})]}),(0,t.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,t.jsx)(l.f,{value:e.utilizationPercent,tone:"primary",label:`${e.name} load`}),(0,t.jsx)(l.f,{value:e.fanPercent,thresholds:{warn:80,crit:100},label:`${e.name} fan`})]})]},`${e.vendor}-${e.uuid??e.index}`))}),(0,t.jsxs)("div",{className:"panel-corners rounded-panel border border-border/70 bg-bg/60 p-3",children:[(0,t.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-[10px] font-medium uppercase tracking-[0.16em] text-text-muted",children:"Host maximum · last 24 hours"}),(0,t.jsxs)("div",{className:"flex items-center gap-3 text-[10px] text-text-muted",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"h-0.5 w-3 bg-primary shadow-[0_0_4px_var(--color-primary)]"}),"load"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"h-0.5 w-3 bg-warning"}),"fan"]})]})]}),(0,t.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,t.jsx)("line",{x1:"0",y1:"16",x2:"600",y2:"16",stroke:"var(--color-danger)",strokeOpacity:"0.45",strokeDasharray:"5 5"}),(0,t.jsx)("line",{x1:"0",y1:"60",x2:"600",y2:"60",stroke:"currentColor",strokeOpacity:"0.12"}),(0,t.jsx)("line",{x1:"0",y1:"104",x2:"600",y2:"104",stroke:"currentColor",strokeOpacity:"0.2"}),(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:"gpu-load-fill",x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"var(--color-primary)",stopOpacity:"0.35"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"var(--color-primary)",stopOpacity:"0"})]})}),r&&(0,t.jsx)("polygon",{points:`0,104 ${r} 600,104`,fill:"url(#gpu-load-fill)"}),r&&(0,t.jsx)("polyline",{points:r,fill:"none",stroke:"var(--color-primary)",strokeWidth:"2",vectorEffect:"non-scaling-stroke"}),i&&(0,t.jsx)("polyline",{points:i,fill:"none",stroke:"var(--color-warning)",strokeWidth:"2",vectorEffect:"non-scaling-stroke"})]}),(0,t.jsxs)("div",{className:"mt-1 flex justify-between num text-[9px] text-text-muted",children:[(0,t.jsx)("span",{children:"24h ago"}),(0,t.jsx)("span",{children:"100% saturation line"}),(0,t.jsx)("span",{children:"now"})]})]})]}):(0,t.jsx)("div",{className:"rounded-panel border border-dashed border-border px-4 py-6 text-center text-xs text-text-muted",children:s?.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 ef(e){if("string"==typeof e)try{return JSON.parse(e)}catch{return[]}return e??[]}function ej(e){if(!e)return[];if("string"==typeof e)try{return JSON.parse(e)}catch{return[]}return e}function eN(e){return!!(e&&"not_installed"!==e.status)}function ev(e){let t=e.status.toLowerCase();return t.includes("enabled")&&!t.includes("not enabled")&&!t.includes("disabled")}function ey(e,t){let s=e.filter(ev).find(e=>{let s=`${e.slug} ${e.pluginType} ${e.metadata?.description??""}`.toLowerCase();return"search"===t?/\b(search|web)\b/.test(s):/\b(crawl|browser|firecrawl|browserbase|browser-use)\b/.test(s)});return s?`${s.slug}${s.version?` ${s.version}`:""}`:"none enabled"}e.s(["default",0,function(){var e,m;let x,u,h,g=(0,a.useParams)(),f=(0,a.useRouter)(),[N,v]=(0,s.useState)(null),[y,T]=(0,s.useState)(null),[J,V]=(0,s.useState)([]),[W,Q]=(0,s.useState)(null),[Z,X]=(0,s.useState)(!0),[Y,ee]=(0,s.useState)(!1),[et,es]=(0,s.useState)(!1),[en,er]=(0,s.useState)([]),[ei,el]=(0,s.useState)({}),[ec,eo]=(0,s.useState)(null),[em,ex]=(0,s.useState)(!1),[eu,ep]=(0,s.useState)(null),[eh,ev]=(0,s.useState)(null),[eb,ew]=(0,s.useState)(null),[ek,eS]=(0,s.useState)(!1),[e$,eC]=(0,s.useState)(null),[eA,eP]=(0,s.useState)(!1),[eU,eI]=(0,s.useState)(!1),[e_,eE]=(0,s.useState)(null),[eR,eM]=(0,s.useState)(!1),[eD,eF]=(0,s.useState)(null),[eO,eL]=(0,s.useState)(null),[ez,eT]=(0,s.useState)(!1),eH=(0,s.useRef)(null),eB=(0,s.useRef)(void 0),eq=(0,s.useCallback)(async(e=!1)=>{try{e||X(!0);let[t,s,a,n,r]=await Promise.all([p.f.nodes.get(g.nodeId),p.f.nodes.health(g.nodeId).catch(()=>null),p.f.nodes.forecast(g.nodeId).catch(()=>null),p.f.hermes.installations().catch(()=>null),p.f.nodes.gpu(g.nodeId).catch(()=>null)]),i=t.data;i.role||void 0===eB.current?i.role&&(eB.current=i.role):i.role=eB.current,v(i),s&&T(s.data),V(a?.data?.forecasts??[]),Q(r?.data??null);let l=n?.data??[];eo(l.find(e=>e.nodeId===i.id)??l.find(e=>e.hostname===i.hostname||e.hostname===i.ipAddress)??null);try{let e=await p.f.roles.applications.list({nodeId:g.nodeId});er(e.data??[])}catch{}}catch{}finally{e||X(!1)}},[g.nodeId]);(0,s.useEffect)(()=>{eq()},[eq]);let eK=async()=>{if(N&&confirm(`Deploy Hermes Agent to "${N.name}"?`)){eM(!0),eF(null),eL(null);try{let e,t=await p.f.hermes.deploy({nodeId:N.id,hermesHome:"~/.hermes",hermesBin:"hermes",installMethod:"official-script",dashboardPort:9119,enableDashboard:!0,enableDashboardTui:!0,startGateway:!0},(e="u">typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2),`hermes-node-deploy-${Date.now()}-${e}`));eF(`Hermes Agent deployment started. Job ${t.data?.id.slice(0,10)}...`),eq(!0)}catch(e){eL(e instanceof Error?e.message:"Hermes Agent deployment failed")}finally{eM(!1)}}};(0,s.useEffect)(()=>{let e=N?.status==="PROVISIONING"||N?.agent?.status==="UPDATING"||!!(eD&&!eN(ec));return e&&!eH.current?eH.current=setInterval(()=>{eq(!0)},4e3):!e&&eH.current&&(clearInterval(eH.current),eH.current=null),()=>{eH.current&&(clearInterval(eH.current),eH.current=null)}},[N?.status,N?.agent?.status,N?.agent?.version,eq,eD,ec]);let eG=async()=>{if(N&&confirm(`Delete node "${N.name}"? This will permanently remove it and all associated data.`))try{await p.f.nodes.delete(N.id),f.push("/nodes")}catch{}},eJ=(0,s.useCallback)(async()=>{if(N?.status==="ONLINE"){ex(!0),ep(null);try{let e='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,"'\\''"),t=((await p.f.quickCommand.exec(N.id,{command:`bash -lc '${e}'`,args:[],timeoutSeconds:60})).data.stdout??"").trim(),s=Object.fromEntries(t.split("\n").map(e=>e.trim()).filter(e=>e.includes("=")).map(e=>{let[t,...s]=e.split("=");return[t,s.join("=").trim()||"unknown"]}));el(s)}catch(e){ep(e instanceof Error?e.message:"Failed to load software revisions")}finally{ex(!1)}}},[N?.id,N?.status]),eV=(0,s.useCallback)(async()=>{if(N?.status==="ONLINE"){eS(!0),eC(null);try{let e="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,"'\\''"),t=((await p.f.quickCommand.exec(N.id,{command:`bash -lc '${e}'`,args:[],timeoutSeconds:180})).data.stdout??"").trim(),s=Number.parseInt(t.split("\n").at(-1)??"",10);ev(Number.isFinite(s)?s:null),ew(new Date().toISOString())}catch(e){eC(e instanceof Error?e.message:"Failed to refresh apt updates")}finally{eS(!1)}}},[N?.id,N?.status]),eW=async()=>{if(N&&confirm(`Run apt upgrade on "${N.name}"?`)){eP(!0);try{let e=`apt-upgrade-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,t=(await p.f.commands.dispatch({nodeIds:[N.id],command:"sudo",args:["apt","upgrade","-y"],timeoutSeconds:1800,idempotencyKey:e},e)).data,s=t.commands?.[0]?.id;alert(s?`APT Upgrade dispatched (command ${s.slice(0,12)}…). Check Commands for progress.`:"APT Upgrade dispatched. Check Commands for progress."),await eV()}catch(e){alert(`APT Upgrade failed to dispatch: ${e instanceof Error?e.message:String(e)}`)}finally{eP(!1)}}},eQ=async()=>{if(N&&confirm(`Enable unattended apt update and apt upgrade on "${N.name}"? Magnus will install unattended-upgrades and enable the apt timers.`)){eI(!0),eE(null);try{await p.f.nodes.enableSystemUpdates(N.id),await eq(!0)}catch(e){eE(e instanceof Error?e.message:"Failed to enable automatic updates")}finally{eI(!1)}}};if((0,s.useEffect)(()=>{eJ(),eV()},[eJ,eV]),(0,s.useEffect)(()=>{if(!N||"ONLINE"!==N.status)return;let e=setInterval(()=>{eV()},36e5);return()=>clearInterval(e)},[N,eV]),Z)return(0,t.jsxs)("div",{className:"space-y-6","aria-busy":"true",children:[(0,t.jsx)("div",{className:"skeleton h-56 w-full rounded-panel opacity-70"}),(0,t.jsx)(o.g,{}),(0,t.jsx)("span",{className:"sr-only",children:"Loading node details…"})]});if(!N)return(0,t.jsx)(c.f,{tone:"accent",icon:(0,t.jsx)(K.f,{className:"h-5 w-5"}),title:"Node not found",description:"It may have been decommissioned or belong to another control node.",action:(0,t.jsx)($.K,{variant:"secondary",size:"sm",onClick:()=>f.push("/nodes"),children:"Back to nodes"}),className:"mt-12"});let eZ=eN(ec)?Array.isArray(ec.rawStatus?.skills)?ec.rawStatus.skills:[]:[],eX=eN(ec)?Array.isArray(ec.rawStatus?.plugins)?ec.rawStatus.plugins:[]:[],eY=eZ.filter(e=>e.enabled),e0=ec?.configuration?.modelProvider??"unknown",e1=ec?.configuration?.modelName??"unknown",e2=ey(eX,"search"),e3=ey(eX,"crawl"),e5=function(e){if(!e)return null;try{let t="string"==typeof e?JSON.parse(e):e;if("boolean"!=typeof t.installed||!["active","inactive","failed","not_installed","unknown"].includes(t.serviceStatus)||!["enabled","disabled","static","unknown"].includes(t.enabled)||null!==t.version&&"string"!=typeof t.version||!Array.isArray(t.managerAddresses))return null;return t}catch{return null}}(y?.wazuh),e4=function(e){if(!e)return null;try{let t="string"==typeof e?JSON.parse(e):e;if("boolean"!=typeof t.supported||"string"!=typeof t.platform||!["enabled","disabled","partial","unsupported","unknown"].includes(t.automaticUpdates??"")||"boolean"!=typeof t.rebootRequired||!Array.isArray(t.timers)||!Array.isArray(t.rebootRequiredPackages))return null;return{...t,fullUpgradePolicyEnabled:!0===t.fullUpgradePolicyEnabled}}catch{return null}}(y?.systemUpdates);return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(r.f,{hero:!0,padding:"lg",tone:"ONLINE"===N.status?"primary":"OFFLINE"===N.status?"danger":"warning",testId:"node-cockpit",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,t.jsx)($.K,{variant:"ghost",size:"sm",onClick:()=>f.push("/nodes"),"aria-label":"Back to nodes",children:(0,t.jsx)(I.f,{className:"h-4 w-4"})}),(0,t.jsx)(d.f,{status:N.status}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold text-primary glow-text-primary",children:N.name}),(0,t.jsxs)("p",{className:"num mt-1 truncate text-xs text-text-muted",children:[N.hostname,":",N.port,N.agent&&(0,t.jsxs)("span",{className:"ml-3 text-primary/70",children:["agent v",N.agent.version]}),y?.source&&(0,t.jsxs)("span",{className:"ml-3 uppercase tracking-wider",children:["source: ",y.source]})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(b.t,{variant:(0,b.k)(N.status),children:N.status}),N.agent?.status==="UPDATING"&&(0,t.jsxs)(b.t,{variant:"info",children:[(0,t.jsx)(R.f,{className:"h-3 w-3 animate-spin mr-1 inline"}),"Upgrading…"]}),(0,t.jsx)(w,{metadata:N.metadata}),(0,t.jsx)(k.x,{readiness:N.upgradeReadiness}),(0,t.jsx)($.K,{variant:"secondary",size:"sm",icon:(0,t.jsx)(P.f,{className:"h-3.5 w-3.5"}),onClick:()=>ee(!0),children:"Edit"}),(0,t.jsx)($.K,{variant:"danger",size:"sm",icon:(0,t.jsx)(U.f,{className:"h-3.5 w-3.5"}),onClick:()=>void eG(),children:"Delete"})]})]}),N.upgradeReadiness?.status==="not-ready"&&(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(k.a,{readiness:N.upgradeReadiness})}),(0,t.jsxs)("div",{className:"mt-6 grid gap-6 xl:grid-cols-[auto_minmax(0,1fr)]",children:[(0,t.jsxs)("div",{className:"flex flex-wrap justify-center gap-4 sm:justify-start",children:[(0,t.jsx)(i.f,{value:y?.cpuUsagePercent??null,label:"CPU Usage",size:128,testId:"node-gauge-cpu"}),(0,t.jsx)(i.f,{value:y?.memoryPercent??null,label:"Memory",size:128,sublabel:y?`${(0,A.L)(y.memoryUsedBytes)}`:void 0,testId:"node-gauge-memory"}),(h=(y?ef(y.disks):[]).reduce((e,t)=>!e||t.usagePercent>e.usagePercent?t:e,null),(0,t.jsx)(i.f,{value:h?.usagePercent??null,label:"Disk",size:128,thresholds:{warn:80,crit:90},sublabel:h?.mountPoint,testId:"node-gauge-disk"}))]}),(0,t.jsx)(j,{nodeId:N.id,height:170})]})]}),("DEGRADED"===N.status||N.agent?.status==="ERROR")&&(()=>{try{let e=JSON.parse(N.metadata),s="string"==typeof e.deployError?e.deployError:null,a="string"==typeof e.upgradeError?e.upgradeError:null,n=s??a;if(n)return(0,t.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,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(E.f,{className:"h-5 w-5 text-danger shrink-0 mt-0.5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-danger",children:s?"Deploy Failed":"Agent Upgrade Failed"}),(0,t.jsx)("pre",{className:"mt-1 text-xs text-text-muted whitespace-pre-wrap font-mono",children:n})]})]})})}catch{}return null})(),"PROVISIONING"===N.status&&(0,t.jsx)("div",{className:"rounded-panel border border-info/40 bg-info/5 p-4 shadow-[inset_3px_0_0_var(--color-info)]",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(R.f,{className:"h-5 w-5 text-info animate-spin"}),(0,t.jsx)("p",{className:"text-xs uppercase tracking-wider text-info",children:"Deploying agent… Status will update automatically."})]})}),N.agent?.status==="UPDATING"&&(0,t.jsx)("div",{className:"rounded-panel border border-info/40 bg-info/5 p-4 shadow-[inset_3px_0_0_var(--color-info)]",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(R.f,{className:"h-5 w-5 text-info animate-spin"}),(0,t.jsx)("p",{className:"text-xs uppercase tracking-wider text-info",children:"Agent upgrade in progress… Status will update automatically."})]})}),(0,t.jsx)(ea,{nodeId:N.id,nodeStatus:N.status}),(0,t.jsx)(eg,{telemetry:W}),(0,t.jsx)(ed,{node:{id:N.id,name:N.name,hostname:N.hostname,status:N.status,lastHeartbeatAt:N.lastHeartbeatAt}}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(n.N,{title:"Node Information",children:(0,t.jsxs)("dl",{className:"space-y-2 text-sm",children:[[["OS",N.os],["Architecture",N.arch],["Address",`${N.ipAddress}:${N.port}`],["Tags",(()=>{try{let e=JSON.parse(N.tags);return e.length?e.join(", "):"—"}catch{return"—"}})()]].map(([e,s])=>(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:e}),(0,t.jsx)("dd",{className:"font-medium",children:s})]},e)),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Agent Version"}),(0,t.jsx)("dd",{className:"font-medium flex items-center gap-1.5",children:N.agent?.version??"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Role"}),(0,t.jsx)("dd",{className:"font-medium",children:N.role?(0,t.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:()=>es(!0),title:"Change role",children:[(0,t.jsx)(D.f,{className:"h-3 w-3"}),N.role.name]}):(0,t.jsx)("button",{className:"text-xs text-text-muted hover:text-primary transition-colors cursor-pointer",onClick:()=>es(!0),children:"+ Assign Role"})})]}),[["Agent Status",N.agent?.status??"—"],["Last Heartbeat",(0,A.C)(N.lastHeartbeatAt)]].map(([e,s])=>(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:e}),(0,t.jsx)("dd",{className:"font-medium",children:s})]},e)),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Cockpit"}),(0,t.jsx)("dd",{className:"font-medium",children:y?.cockpitAvailable?(0,t.jsxs)("a",{href:`https://${N.ipAddress}:9090`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["Available",(0,t.jsx)(M.f,{className:"h-3 w-3"})]}):(0,t.jsx)("span",{className:"text-text-muted",children:"Not Available"})})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"CPU Cores"}),(0,t.jsx)("dd",{className:"font-medium",children:y?.cpuCores??"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Memory Used"}),(0,t.jsx)("dd",{className:"font-medium",children:y?`${(0,A.L)(y.memoryUsedBytes)} / ${(0,A.L)(y.memoryTotalBytes)}`:"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Swap Used"}),(0,t.jsx)("dd",{className:"font-medium",children:y&&y.swapTotalBytes?`${(0,A.L)(y.swapUsedBytes??0)} / ${(0,A.L)(y.swapTotalBytes)}`:"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Last Health Sample"}),(0,t.jsx)("dd",{className:"font-medium",children:y?(0,A.C)(y.timestamp):"—"})]})]})}),(0,t.jsx)(n.N,{title:"Hermes Agent",description:eN(ec)?ec.displayName??ec.hostname:"No Hermes Agent installed or found",action:eN(ec)?(0,t.jsx)(b.t,{variant:(0,b.k)(ec.status),children:ec.status}):void 0,children:eN(ec)?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("dl",{className:"grid gap-2 text-sm sm:grid-cols-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Version"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:ec.version??"unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Home"}),(0,t.jsx)("dd",{className:"font-mono text-xs break-all",children:ec.hermesHome})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Dashboard"}),(0,t.jsxs)("dd",{className:"mt-1 flex items-center gap-2",children:[(0,t.jsx)(b.t,{variant:(0,b.k)(ec.dashboardStatus),children:ec.dashboardStatus}),(0,t.jsx)("span",{className:"font-mono text-xs",children:(u=""===(x=(m=ec).dashboardHost.trim().toLowerCase().replace(/^\[|\]$/g,""))||"0.0.0.0"===x||"127.0.0.1"===x||"localhost"===x||"::"===x||"::1"===x?m.hostname:m.dashboardHost,`${u}:${m.dashboardPort}`)})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Gateway"}),(0,t.jsx)("dd",{className:"mt-1",children:(0,t.jsx)(b.t,{variant:(0,b.k)(ec.gatewayStatus),children:ec.gatewayStatus})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"API Server"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:ec.apiServerEnabled?`${ec.apiServerHost}:${ec.apiServerPort??"—"}`:"disabled"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Primary Provider"}),(0,t.jsxs)("dd",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)(b.t,{variant:"unknown"===e0?"warning":"success",children:e0}),ec.configuration?.magnusRouterConfigured&&(0,t.jsx)(b.t,{variant:"success",children:"Magnus routed"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Default Model"}),(0,t.jsx)("dd",{className:"font-mono text-xs break-all",children:e1})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"OpenAI Runtime"}),(0,t.jsx)("dd",{className:"mt-1",children:(0,t.jsx)(b.t,{variant:ec.configuration?.openaiRuntime==="codex_app_server"?"success":"warning",children:ec.configuration?.openaiRuntime==="codex_app_server"?"Codex app-server":"Hermes default"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Web Search"}),(0,t.jsxs)("dd",{className:"mt-1 flex items-center gap-2 text-xs",children:[(0,t.jsx)(z.f,{className:"h-3.5 w-3.5 text-text-muted"}),(0,t.jsx)("span",{className:"font-mono break-all",children:e2})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Crawling"}),(0,t.jsxs)("dd",{className:"mt-1 flex items-center gap-2 text-xs",children:[(0,t.jsx)(H,{className:"h-3.5 w-3.5 text-text-muted"}),(0,t.jsx)("span",{className:"font-mono break-all",children:e3})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Memory"}),(0,t.jsxs)("dd",{className:"mt-1",children:[(0,t.jsx)(b.t,{variant:ec.configuration?.hiveMemConfigured?"success":"warning",children:ec.configuration?.memoryProvider??"not configured"}),(0,t.jsx)(S.f,{configuration:ec.configuration})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Skills"}),(0,t.jsx)("dd",{className:"mt-1",children:(0,t.jsxs)("button",{type:"button",onClick:()=>eT(!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===eZ.length,children:[(0,t.jsx)(L.f,{className:"h-3.5 w-3.5"}),function(e){if(0===e.length)return"0 synced";let t=e.filter(e=>e.enabled).length;return`${t} enabled / ${e.length} total`}(eZ)]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Last Sync"}),(0,t.jsx)("dd",{className:"text-xs",children:(0,A.C)(ec.lastSyncedAt)})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[ec.configuration?.modelBaseUrl&&(0,t.jsxs)("p",{className:"text-xs text-text-muted",children:["Base URL: ",(0,t.jsx)("span",{className:"font-mono",children:ec.configuration.modelBaseUrl})]}),ec.configuration?.configPath&&(0,t.jsxs)("p",{className:"text-xs text-text-muted",children:["Config: ",(0,t.jsx)("span",{className:"font-mono",children:ec.configuration.configPath})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(ec.profiles??[]).slice(0,6).map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-text-muted",children:[(0,t.jsx)(F.f,{className:"h-3 w-3"}),e.name]},e.id)),(ec.profiles?.length??0)===0&&(0,t.jsx)("span",{className:"text-xs text-text-muted",children:"No profiles synced"})]}),(0,t.jsx)($.K,{size:"sm",variant:"secondary",icon:(0,t.jsx)(M.f,{className:"h-3.5 w-3.5"}),onClick:()=>f.push(`/orchestra/web-gateway?installationId=${encodeURIComponent(ec.id)}`),children:"Open Dashboard"})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"No Hermes Agent is installed or currently detected on this node."}),eD&&(0,t.jsx)("p",{className:"text-xs text-success",children:eD}),eO&&(0,t.jsx)("p",{className:"text-xs text-danger",children:eO}),(0,t.jsx)($.K,{size:"sm",variant:"secondary",icon:eR?(0,t.jsx)(R.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(O.f,{className:"h-3.5 w-3.5"}),disabled:!N||"ONLINE"!==N.status||eR,onClick:()=>void eK(),children:eR?"Starting Deployment...":"Deploy Hermes Agent"}),N?.status!=="ONLINE"&&(0,t.jsx)("p",{className:"text-xs text-text-muted",children:"Bring the Magnus agent online before starting automated Hermes deployment."})]})}),(0,t.jsx)(n.N,{title:"Service Checks",children:y&&ej(y.services).length>0?(0,t.jsx)("div",{className:"space-y-2 text-sm",children:ej(y.services).slice(0,8).map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between rounded border border-border px-2 py-1.5",children:[(0,t.jsx)("span",{className:"font-medium",children:e.name}),(0,t.jsx)(b.t,{variant:"active"===e.status?"success":"failed"===e.status?"danger":"default",children:e.status})]},e.name))}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"No service checks available from this node yet."})})]}),(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(n.N,{title:"System Update Readiness",description:"Automatic apt policy and reboot state from the latest heartbeat",action:e4?(0,t.jsx)(b.t,{variant:e4.rebootRequired?"danger":"enabled"===e4.automaticUpdates?"success":"warning",children:e4.rebootRequired?"reboot required":e4.automaticUpdates.replace("_"," ")}):void 0,children:e4?(0,t.jsxs)("div",{className:"space-y-4",children:[e4.rebootRequired&&(0,t.jsxs)("div",{className:"flex gap-3 rounded border border-danger/30 bg-danger/10 p-3",children:[(0,t.jsx)(q.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-danger"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-danger",children:"Restart needed to finish installed updates"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:e4.rebootRequiredPackages.length?e4.rebootRequiredPackages.slice(0,5).join(", "):"The operating system has set the reboot-required marker."})]})]}),(0,t.jsxs)("dl",{className:"space-y-2 text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Platform"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:e4.platform})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Automatic updates"}),(0,t.jsx)("dd",{children:(0,t.jsx)(b.t,{variant:"enabled"===e4.automaticUpdates?"success":"warning",children:e4.automaticUpdates})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"unattended-upgrades"}),(0,t.jsx)("dd",{children:e4.unattendedUpgradesInstalled?"installed":"not installed"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"full apt upgrade policy"}),(0,t.jsx)("dd",{children:e4.fullUpgradePolicyEnabled?"enabled":"not enabled"})]}),e4.timers.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"font-mono text-[11px] text-text-muted",children:e.name}),(0,t.jsx)("dd",{className:"font-mono text-[11px]",children:e.state})]},e.name))]}),e4.supported&&"enabled"!==e4.automaticUpdates&&(0,t.jsxs)($.K,{size:"sm",variant:"primary",disabled:"ONLINE"!==N.status||eU,onClick:()=>void eQ(),children:[eU?(0,t.jsx)(R.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(B.f,{className:"h-3.5 w-3.5"}),eU?"Enabling…":"Enable automatic updates"]}),e_&&(0,t.jsx)("p",{className:"text-xs text-danger",children:e_})]}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"Update posture will appear after agent v1.6.0 reports its first heartbeat."})}),(0,t.jsx)(n.N,{title:"Wazuh Agent",description:"Endpoint-security posture from the latest node heartbeat",action:e5?(0,t.jsx)(b.t,{variant:"active"===(e=e5.serviceStatus)?"success":"failed"===e?"danger":"inactive"===e?"warning":"default",children:e5.serviceStatus.replace("_"," ")}):void 0,children:e5?(0,t.jsxs)("dl",{className:"space-y-2 text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Installation"}),(0,t.jsx)("dd",{children:(0,t.jsx)(b.t,{variant:e5.installed?"success":"default",children:e5.installed?"installed":"not installed"})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Startup"}),(0,t.jsx)("dd",{className:"font-medium",children:e5.enabled})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Version"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:e5.version??"—"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Managers"}),(0,t.jsx)("dd",{className:"mt-1 font-mono text-xs break-all",children:e5.managerAddresses.length?e5.managerAddresses.join(", "):"—"})]})]}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"Wazuh posture will appear after this host reports a current Magnus agent heartbeat."})}),(0,t.jsx)(n.N,{title:"Disk Usage",children:y&&ef(y.disks).length?(0,t.jsx)("div",{className:"space-y-3",children:ef(y.disks).map(e=>(0,t.jsxs)("div",{className:"text-sm",children:[(0,t.jsxs)("div",{className:"flex justify-between text-xs",children:[(0,t.jsx)("span",{className:"text-text-muted",children:e.mountPoint}),(0,t.jsxs)("span",{className:"num",children:[(0,A.L)(e.usedBytes)," / ",(0,A.L)(e.totalBytes)]})]}),(0,t.jsx)(l.f,{value:e.usagePercent,thresholds:{warn:80,crit:90},size:"sm",label:`${e.mountPoint} disk usage`,showValue:!0,className:"mt-1"})]},e.mountPoint))}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"No disk data available"})}),(0,t.jsx)(n.N,{title:"Capacity Forecast",description:"Per-volume 30-day growth trend and estimated time to full",children:J.length?(0,t.jsx)("div",{className:"space-y-3",children:J.map(e=>(0,t.jsxs)("div",{className:"rounded border border-border/50 p-3 text-xs",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{className:"font-mono text-text",children:e.mountPoint}),(0,t.jsx)(b.t,{variant:null!==e.daysUntilFull&&e.daysUntilFull<=14?"danger":null!==e.daysUntilFull&&e.daysUntilFull<=30?"warning":"default",children:null===e.daysUntilFull?e.growthRatePerDay>0?"trend uncertain":"stable/shrinking":`${e.daysUntilFull}d to full`})]}),(0,t.jsxs)("div",{className:"mt-2 text-text-muted",children:[e.currentUsagePercent.toFixed(1),"% used · ",(0,A.L)(Math.abs(e.growthRatePerDay)),"/day ",e.growthRatePerDay>=0?"growth":"reclaimed"," · confidence ",(100*e.confidence).toFixed(0),"%"]}),(0,t.jsx)("p",{className:"mt-2 text-text-muted",children:e.recommendation})]},e.mountPoint))}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"At least three retained samples are needed for a capacity forecast."})}),(0,t.jsxs)(n.N,{title:"Software Revisions",description:"Major runtime versions and package update status",action:(0,t.jsx)($.K,{variant:"ghost",size:"sm",onClick:()=>void eJ(),"aria-label":"Refresh software revisions",title:"Refresh",children:(0,t.jsx)(_.f,{className:`h-3.5 w-3.5 ${em?"animate-spin":""}`})}),children:[(0,t.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,t.jsx)("dl",{className:"space-y-2",children:["node","npm","python3","redis","docker","tailscale","magnus-agent"].map(e=>(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsx)("dt",{className:"text-text-muted uppercase text-xs tracking-wide",children:e}),(0,t.jsx)("dd",{className:"font-mono text-right text-xs break-all",children:ei[e]??(em?"Loading…":"—")})]},e))}),eu&&(0,t.jsx)("p",{className:"text-xs text-danger",children:eu})]}),(0,t.jsxs)("div",{className:"mt-4 border-t border-border pt-4 space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-xs uppercase tracking-wide text-text-muted",children:"APT Updates"}),(0,t.jsx)(b.t,{variant:eh&&eh>0?"warning":"success",children:ek?"Checking…":`${eh??"—"} pending`})]}),(0,t.jsxs)("p",{className:"text-xs text-text-muted",children:["Refreshed hourly via apt update",eb?` • Last check: ${(0,A.C)(eb)}`:""]}),e$&&(0,t.jsx)("p",{className:"text-xs text-danger",children:e$}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)($.K,{size:"sm",variant:"secondary",disabled:"ONLINE"!==N.status||ek,onClick:()=>void eV(),children:[(0,t.jsx)(_.f,{className:`h-3.5 w-3.5 ${ek?"animate-spin":""}`}),"Refresh"]}),(0,t.jsxs)($.K,{size:"sm",variant:"primary",disabled:"ONLINE"!==N.status||eA,onClick:()=>void eW(),children:[eA?(0,t.jsx)(R.f,{className:"h-3.5 w-3.5 animate-spin"}):null,eA?"Dispatching…":"APT Upgrade"]})]})]})]})]})]}),en.length>0&&(0,t.jsx)(n.N,{title:"Role Applications",children:(0,t.jsx)("div",{className:"space-y-4",children:en.map(e=>(0,t.jsxs)("div",{className:"rounded-lg border border-border p-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(D.f,{className:"h-4 w-4 text-primary"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["apply"===e.action?"Apply":"Remove",": ",e.role?.name??"Unknown"]})]}),(0,t.jsx)(b.t,{variant:"completed"===e.status?"success":"failed"===e.status?"danger":"running"===e.status?"info":"default",children:e.status})]}),e.error&&(0,t.jsx)("div",{className:"mb-2 rounded border border-danger/30 bg-danger/10 px-2 py-1 text-xs text-danger font-mono",children:e.error}),(0,t.jsx)("div",{className:"space-y-1",children:e.steps.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsxs)("span",{className:"completed"===e.status?"text-success":"failed"===e.status?"text-danger":"running"===e.status?"text-info":(e.status,"text-text-muted"),children:["completed"===e.status&&"✓","failed"===e.status&&"✗","running"===e.status&&"⟳","skipped"===e.status&&"—","pending"===e.status&&"○"]}),(0,t.jsx)("span",{className:"skipped"===e.status?"text-text-muted line-through":"",children:e.name}),e.error&&(0,t.jsx)("span",{className:"text-danger ml-2 truncate max-w-xs",title:e.error,children:e.error})]},e.name))}),(0,t.jsxs)("div",{className:"mt-2 text-[10px] text-text-muted",children:[e.startedAt?`Started: ${(0,A.C)(e.startedAt)}`:"",e.completedAt?` — Completed: ${(0,A.C)(e.completedAt)}`:""]})]},e.id))})}),(0,t.jsx)(C.n,{open:ez,onClose:()=>eT(!1),title:"Hermes Skills",description:`${eY.length} enabled on ${N.name}`,icon:(0,t.jsx)(L.f,{className:"h-5 w-5 text-primary"}),className:"max-w-3xl",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[(0,t.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Enabled"}),(0,t.jsx)("p",{className:"mt-1 text-lg font-semibold",children:eY.length})]}),(0,t.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Total"}),(0,t.jsx)("p",{className:"mt-1 text-lg font-semibold",children:eZ.length})]}),(0,t.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Sources"}),(0,t.jsx)("p",{className:"mt-1 text-sm font-mono",children:Array.from(new Set(eZ.map(e=>e.source))).filter(Boolean).join(", ")||"unknown"})]})]}),(0,t.jsxs)("div",{className:"max-h-[55vh] overflow-auto rounded border border-border",children:[(0,t.jsxs)("table",{className:"w-full text-left text-xs",children:[(0,t.jsx)("thead",{className:"sticky top-0 bg-surface text-[10px] uppercase tracking-wide text-text-muted",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Skill"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Category"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Source"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border",children:eZ.slice().sort((e,t)=>Number(t.enabled)-Number(e.enabled)||e.slug.localeCompare(t.slug)).map(e=>(0,t.jsxs)("tr",{className:"bg-bg/20",children:[(0,t.jsx)("td",{className:"px-3 py-2 font-mono",children:e.slug}),(0,t.jsx)("td",{className:"px-3 py-2 text-text-muted",children:e.category??"uncategorized"}),(0,t.jsx)("td",{className:"px-3 py-2 text-text-muted",children:e.source}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(b.t,{variant:e.enabled?"success":"default",children:e.enabled?"enabled":"disabled"})})]},`${e.slug}-${e.source}`))})]}),0===eZ.length&&(0,t.jsx)("div",{className:"p-6 text-sm text-text-muted",children:"No synced Hermes skills were reported for this node."})]})]})}),(0,t.jsx)(G.F,{open:Y,node:N,onClose:()=>ee(!1),onSaved:()=>void eq()}),(0,t.jsx)(G.E,{open:et,node:N?{id:N.id,name:N.name,role:N.role}:null,onClose:()=>es(!1),onSaved:e=>{eB.current=e,N&&v({...N,role:e}),eq()}})]})}],5525)}]);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,68288,e=>{"use strict";var t=e.i(43476),a=e.i(71645),r=e.i(4050),s=e.i(82983);let n=0,i=Date.now(),l=[],o=null,c=!1;function d(e,t){let a;(a=Date.now())-i>=6e4&&(n=0,i=a),n>=20||(n++,l.push({nodeId:"__dashboard__",source:"dashboard",level:"error",message:e,metadata:t,timestamp:new Date().toISOString()}))}async function m(){if(0===l.length)return;let e=l.splice(0,l.length);try{await s.f.logs.ingest(e)}catch{}}var u=e.i(52928),x=e.i(53034),h=e.i(37806),p=e.i(47414);function f({children:e,...r}){let s=(0,a.useContext)(h.f);(r={...s,...r}).transition=(0,x.f)(r.transition,s.transition),r.isStatic=(0,p.f)(()=>r.isStatic);let n=(0,a.useMemo)(()=>r,[JSON.stringify(r.transition),r.transformPagePoint,r.reducedMotion,r.skipAnimations,r.isValidProp]);return(0,t.jsx)(h.f.Provider,{value:n,children:e})}var b=e.i(72603);e.s(["Providers",0,function({children:e}){return(0,a.useEffect)(()=>((0,b.P)(),function(){if(c)return()=>{};c=!0;let e=e=>{d(`Uncaught error: ${e.message}`,{url:window.location.pathname,filename:e.filename??"unknown",lineno:e.lineno??0,colno:e.colno??0})},t=e=>{let t=e.reason,a=t instanceof Error?t.message:String(t);d(`Unhandled rejection: ${a}`,{url:window.location.pathname})};return window.addEventListener("error",e),window.addEventListener("unhandledrejection",t),o=setInterval(()=>void m(),1e4),()=>{window.removeEventListener("error",e),window.removeEventListener("unhandledrejection",t),o&&(clearInterval(o),o=null),m(),c=!1}}()),[]),(0,t.jsx)(f,{reducedMotion:"user",children:(0,t.jsx)(u.N,{children:(0,t.jsx)(r.v,{children:e})})})}],68288)},40073,e=>{"use strict";var t=e.i(43476),a=e.i(71645),r=e.i(18566),s=e.i(22016),n=e.i(78571),i=e.i(16327),l=e.i(66794),o=e.i(77071),c=e.i(89664),d=e.i(4050),m=e.i(35673),u=e.i(15e3),x=e.i(39430);function h({status:e}){let a="online"===e?"Online":"offline"===e?"Offline":"Checking…";return(0,t.jsx)("span",{role:"status","aria-label":a,className:`inline-block h-2 w-2 shrink-0 rounded-full ${"online"===e?"bg-success":"offline"===e?"bg-danger":"bg-text-muted/40 animate-pulse"}`,title:a})}function p(){let{nodes:e,activeNode:r,switchNode:s,loading:n}=(0,d.l)(),[p,f]=(0,a.useState)(!1),[b,g]=(0,a.useState)(!1),[v,y]=(0,a.useState)(!1),w=(0,a.useRef)(null),[k,j]=(0,a.useState)({}),N=(0,a.useRef)(null),C=(0,a.useMemo)(()=>e.length>0?e:[u.f],[e]),M=(0,a.useCallback)(async()=>{let e={};await Promise.allSettled(C.map(async t=>{try{let a=(0,x.L)(t.url),r=await fetch("/api/proxy/health",{method:"GET",headers:a,signal:AbortSignal.timeout(6e3)});e[t.id]=r.ok?"online":"offline"}catch{e[t.id]="offline"}})),j(e)},[C]);return((0,a.useEffect)(()=>{M()},[M]),(0,a.useEffect)(()=>{if(p)return M(),N.current=setInterval(()=>void M(),3e4),()=>{N.current&&clearInterval(N.current)}},[p,M]),(0,a.useEffect)(()=>{if(p)return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)};function e(e){w.current&&!w.current.contains(e.target)&&f(!1)}function t(e){"Escape"===e.key&&f(!1)}},[p]),n)?(0,t.jsx)("div",{className:"mx-3 mt-2 mb-1 rounded border border-border bg-bg px-3 py-2 text-xs text-text-muted animate-pulse",children:"Loading…"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"relative mx-3 mt-2 mb-1",ref:w,children:[(0,t.jsx)("div",{className:"mb-1 px-0.5 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Node Controller"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)("button",{onClick:()=>f(!p),"aria-expanded":p,"aria-haspopup":"listbox","aria-label":`Node controller: ${r.name}`,className:"flex flex-1 items-center gap-2 rounded border border-border bg-bg px-2.5 py-1.5 text-left transition-all hover:bg-surface-hover min-w-0",children:[(0,t.jsx)(h,{status:k[r.id]??"unknown"}),(0,t.jsx)("span",{className:"flex-1 truncate text-xs font-medium",children:r.name}),(0,t.jsx)(i.f,{className:`h-3.5 w-3.5 shrink-0 text-text-muted transition-transform ${p?"rotate-180":""}`})]}),(0,t.jsx)("button",{onClick:function(){y(!1),g(!0)},className:"rounded border border-border bg-bg p-1.5 text-text-muted transition-all hover:bg-surface-hover hover:text-text",title:"Control Node Settings",children:(0,t.jsx)(l.f,{className:"h-3.5 w-3.5"})})]}),p&&(0,t.jsxs)("div",{className:"absolute left-3 right-3 z-50 mt-1 rounded border border-border bg-surface shadow-xl",children:[(0,t.jsx)("div",{role:"listbox","aria-label":"Control nodes",className:"max-h-48 overflow-y-auto py-1",children:C.map(e=>(0,t.jsxs)("button",{role:"option","aria-selected":e.id===r.id,onClick:()=>{s(e.id),f(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-all hover:bg-surface-hover",children:[(0,t.jsx)(h,{status:k[e.id]??"unknown"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"font-medium truncate",children:e.name}),(0,t.jsx)("div",{className:"text-text-muted truncate text-[10px]",children:e.url})]}),e.id===r.id&&(0,t.jsx)(c.f,{className:"h-3.5 w-3.5 shrink-0 text-primary"})]},e.id))}),(0,t.jsx)("div",{className:"border-t border-border",children:(0,t.jsxs)("button",{onClick:function(){f(!1),y(!0),g(!0)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-primary transition-all hover:bg-surface-hover",children:[(0,t.jsx)(o.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"font-bold",children:"Add Control Node"})]})})]})]}),(0,t.jsx)(m.f,{open:b,onClose:()=>g(!1),createMode:v})]})}var f=e.i(32181),b=e.i(56420);let g={name:"layout-dashboard",size:24,node:[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]};g.node;let v=(0,b.f)(g);var y=e.i(41220),w=e.i(4139),k=e.i(74544),j=e.i(26091);let N={name:"scroll-text",size:24,node:[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]};N.node;let C=(0,b.f)(N);var M=e.i(82954),S=e.i(71567),E=e.i(82303),$=e.i(63644),_=e.i(12092),A=e.i(99835),L=e.i(64569);let R={name:"map",size:24,node:[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]};R.node;let z=(0,b.f)(R);var P=e.i(56423);let I={name:"compass",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]]};I.node;let T=(0,b.f)(I);var O=e.i(90985);let D={name:"heart-pulse",size:24,node:[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}],["path",{d:"M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"auskq0"}]]};D.node;let U=(0,b.f)(D),F={name:"rotate-ccw-clock",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],aliases:["history"]};F.node;let q=(0,b.f)(F);var G=e.i(9584);let H={name:"git-compare-arrows",size:24,node:[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]};H.node;let K=(0,b.f)(H),V={name:"package-check",size:24,node:[["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m16 17 2 2 4-4",key:"uh5qu3"}],["path",{d:"M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753",key:"kpkbpo"}],["path",{d:"M3.29 7 12 12l8.71-5",key:"19ckod"}],["path",{d:"m7.5 4.27 8.997 5.148",key:"9yrvtv"}]]};V.node;let W=(0,b.f)(V),J={name:"square-activity",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M17 12h-2l-2 5-2-10-2 5H7",key:"15hlnc"}]],aliases:["activity-square"]};J.node;let B=(0,b.f)(J);var X=e.i(84026);let Q={name:"scan-search",size:24,node:[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]};Q.node;let Y=(0,b.f)(Q);var Z=e.i(52330),ee=e.i(58925),et=e.i(83892),ea=e.i(71028);let er=[{id:"fleet",label:"Fleet",tone:"primary",items:[{href:"/mission-control",label:"Mission Control",icon:T},{href:"/",label:"Overview",icon:v,exact:!0},{href:"/nodes",label:"Nodes",icon:y.f},{href:"/application-operations",label:"Applications",icon:U},{href:"/fleet-readiness",label:"Readiness",icon:ea.f},{href:"/fleet-timeline",label:"Timeline",icon:q},{href:"/fleet-map",label:"Fleet Map",icon:z},{href:"/commands",label:"Commands",icon:w.f},{href:"/anomalies",label:"Anomalies",icon:$.f},{href:"/anomalies/remediation",label:"Remediation",icon:L.f},{href:"/governor/operations",label:"Operations",icon:_.f},{href:"/rollouts",label:"Rollouts",icon:W},{href:"/incidents",label:"Incidents",icon:B},{href:"/cron",label:"Cron Jobs",icon:k.f},{href:"/files",label:"Files",icon:j.f},{href:"/logs",label:"Logs",icon:C},{href:"/audit",label:"Audit",icon:M.f},{href:"/webhooks",label:"Webhooks",icon:A.f},{href:"/retention",label:"Retention",icon:G.f},{href:"/api-docs",label:"API Docs",icon:P.f}]},{id:"security",label:"Security",tone:"primary",integration:"securityConsole",items:[{href:"/security-fusion",label:"Fleet summary",icon:Y,exact:!0}]},{id:"hermes",label:"Hermes Agent",tone:"accent",integration:"hermes",items:[{href:"/orchestra",label:"Overview",icon:S.f,exact:!0},{href:"/orchestra/installations",label:"Installations",icon:y.f},{href:"/orchestra/profiles",label:"Profiles",icon:E.f},{href:"/hermes-drift",label:"Drift Cockpit",icon:K},{href:"/hermes-security",label:"Proxy Security",icon:X.f},{href:"/orchestra/web-gateway",label:"Web Gateway",icon:O.f}]},{id:"ardent",label:"Magnus Ardent",tone:"primary",items:[{href:"/ardent",label:"Overview",icon:et.f,exact:!0},{href:"/ardent/installations",label:"Installations",icon:y.f},{href:"/ardent/profiles",label:"Profiles",icon:E.f}]},{id:"codex",label:"Codex Agent",tone:"primary",items:[{href:"/codex",label:"Overview",icon:Z.f,exact:!0},{href:"/codex/installations",label:"Installations",icon:ee.f}]}],es={"/":"Fleet Overview","/mission-control":"Mission Control","/nodes":"Nodes","/application-operations":"Application Operations","/fleet-readiness":"Fleet Readiness","/fleet-timeline":"Fleet Timeline","/fleet-map":"Fleet Map","/commands":"Commands","/anomalies":"Anomalies","/anomalies/remediation":"Auto-Remediation","/governor/operations":"Fleet Operations","/rollouts":"Guided Rollouts","/incidents":"Incident Workspace","/cron":"Cron Jobs","/files":"Files","/logs":"Logs","/audit":"Audit","/webhooks":"Webhooks","/retention":"Retention","/api-docs":"API Docs","/library":"Library","/skills":"Skills","/roles":"Roles","/sync":"Sync","/notifications":"Notification Preferences","/security-fusion":"Security","/orchestra":"Hermes Agent Fleet","/orchestra/installations":"Hermes Installations","/orchestra/profiles":"Hermes Profiles","/orchestra/web-gateway":"Web Gateway","/hermes-drift":"Hermes Drift Cockpit","/hermes-security":"Hermes Proxy Security","/ardent":"Magnus Ardent","/ardent/installations":"Ardent Installations","/ardent/profiles":"Ardent Profiles","/codex":"Codex Agent Fleet","/codex/installations":"Codex Installations"};function en(e,t,a=!1){return"/"===t||a?e===t:e===t||e.startsWith(`${t}/`)}function ei(e){let t=null;for(let a of er)for(let r of a.items)!r.external&&en(e,r.href,r.exact)&&(null===t||r.href.length>t.length)&&(t=r.href);return t}var el=e.i(16141);let eo={security:"from-primary/60 via-accent/20",hermes:"from-accent/50 via-accent/20",ardent:"from-primary/50 via-accent/20",codex:"from-primary/50 via-primary/20"};function ec({group:e,activeHref:a}){let r="accent"===e.tone;return(0,t.jsxs)(t.Fragment,{children:["fleet"!==e.id&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"mx-3 my-1",children:(0,t.jsx)("div",{className:(0,n.f)("h-px bg-gradient-to-r to-transparent",eo[e.id])})}),(0,t.jsx)("div",{className:"px-4 pb-0.5 pt-2",children:(0,t.jsx)("span",{className:(0,n.f)("text-[9px] font-bold uppercase tracking-[0.25em]",r?"text-accent/60":"text-primary/60"),children:e.label})})]}),(0,t.jsx)("nav",{className:(0,n.f)("space-y-0.5 p-3","fleet"!==e.id&&"pt-1"),"aria-label":e.label,children:e.items.map(e=>{let i=e.href===a,l=e.icon;return(0,t.jsxs)(s.default,{href:e.href,prefetch:!1,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0,"aria-current":i?"page":void 0,className:(0,n.f)("group relative flex items-center gap-3 overflow-hidden rounded-chip px-3 py-2 text-xs uppercase tracking-wider transition-colors duration-200","before:pointer-events-none before:absolute before:inset-y-0 before:-left-1/2 before:w-1/2 before:-skew-x-12 before:bg-gradient-to-r before:from-transparent before:to-transparent before:opacity-0 before:transition-[left,opacity] before:duration-500 hover:before:left-full hover:before:opacity-100",r?"before:via-accent/10":"before:via-primary/10",i?(0,n.f)(r?"text-accent":"text-primary",r?"bg-accent/5":"bg-primary/5"):(0,n.f)("text-text-muted",r?"hover:text-accent":"hover:text-primary")),children:[i&&(0,t.jsx)(f.f.span,{layoutId:"sidebar-indicator",className:(0,n.f)("absolute bottom-1 left-0 top-1 w-0.5 rounded-full",r?"bg-accent":"bg-primary"),style:{boxShadow:r?"0 0 8px var(--color-accent), 0 0 16px var(--color-glow-accent)":"0 0 8px var(--color-primary), 0 0 16px var(--color-glow)"},transition:{type:"spring",stiffness:300,damping:30}}),(0,t.jsx)(l,{className:"relative h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"relative truncate",children:e.label})]},e.href)})})]})}function ed(){return(0,t.jsxs)("div",{className:"relative flex h-8 w-8 items-center justify-center animate-flicker",children:[(0,t.jsxs)("svg",{viewBox:"0 0 32 32",className:"h-8 w-8 overflow-visible","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"1",y:"1",width:"30",height:"30",rx:"4",fill:"none",stroke:"var(--color-primary)",strokeOpacity:"0.35"}),(0,t.jsx)("path",{d:"M8 23 V9 L16 18 L24 9 V23",fill:"none",stroke:"var(--color-primary)",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",pathLength:100,style:{"--stroke-length":100,strokeDasharray:100,animation:"draw-stroke 1.4s var(--ease-out-expo) both"},className:"drop-shadow-[0_0_4px_var(--color-primary)]"})]}),(0,t.jsx)("div",{className:"absolute inset-0 rounded shadow-[0_0_12px_var(--color-glow)]"})]})}function em(){let{connected:e}=(0,a.useSyncExternalStore)(el.f.subscribe,el.f.getSnapshot,el.f.getServerSnapshot);return(0,t.jsxs)("span",{className:"flex items-center gap-1.5",title:e?"Live event stream connected":"Live event stream reconnecting",children:[(0,t.jsxs)("span",{className:"relative inline-flex h-1.5 w-1.5",children:[e&&(0,t.jsx)("span",{className:"absolute inset-0 rounded-full bg-success animate-halo"}),(0,t.jsx)("span",{className:(0,n.f)("relative inline-flex h-1.5 w-1.5 rounded-full",e?"bg-success shadow-[0_0_6px_var(--color-success)]":"bg-warning")})]}),(0,t.jsx)("span",{className:e?"text-success/70":"text-warning/70",children:e?"Live":"Offline"})]})}function eu({integrations:e}){let s=ei((0,r.usePathname)()),n=(0,a.useMemo)(()=>(function(e,t=er){return t.filter(t=>{var a;return!t.integration||(a=t.integration,"securityConsole"===a?null!==e.securityConsoleUrl:e.hermes)}).map(t=>"security"===t.id&&e.securityConsoleUrl?{...t,items:[{href:e.securityConsoleUrl,label:"Security console ↗",icon:Y,external:!0},...t.items]}:t)})(e),[e]);return(0,t.jsxs)("aside",{className:"relative flex h-full w-56 flex-col border-r border-border/50 bg-bg",children:[(0,t.jsx)("div",{className:"absolute bottom-0 right-0 top-0 w-px bg-gradient-to-b from-primary/60 via-primary/20 to-transparent"}),(0,t.jsxs)("div",{className:"flex h-14 items-center gap-3 border-b border-border/30 px-4",children:[(0,t.jsx)(ed,{}),(0,t.jsx)("span",{className:"text-sm font-bold uppercase tracking-[0.2em] text-text",children:"Magnus"})]}),(0,t.jsx)(p,{}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:n.map(e=>(0,t.jsx)(ec,{group:e,activeHref:s},e.id))}),(0,t.jsxs)("div",{className:"flex items-center justify-between border-t border-border/30 p-4 text-[10px] uppercase tracking-widest text-primary/70",children:[(0,t.jsxs)("span",{children:["Magnus v","3.7.0"]}),(0,t.jsx)(em,{})]})]})}var ex=e.i(67784),eh=e.i(41120);let ep={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};ep.node;let ef=(0,b.f)(ep);var eb=e.i(66595),eg=e.i(67927);let ev={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};ev.node;let ey=(0,b.f)(ev),ew={name:"check-check",size:24,node:[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]};ew.node;let ek=(0,b.f)(ew);var ej=e.i(64155),eN=e.i(92026),eC=e.i(10818),eM=e.i(94371),eS=e.i(69174),eE=e.i(82983);function e$(){let[e,r]=(0,a.useState)(!1),[i,o]=(0,a.useState)([]),[d,m]=(0,a.useState)(0),[u,x]=(0,a.useState)(!1),h=(0,a.useRef)(null),p=(0,a.useCallback)(async()=>{try{let e=await eE.f.notifications.unreadCount();e.success&&e.data&&m(e.data.count)}catch{}},[]),f=(0,a.useCallback)(async()=>{x(!0);try{let e=await eE.f.notifications.list({pageSize:20});if(e.success&&e.data){let t=e.data;o(t.notifications)}}catch{}finally{x(!1)}},[]);(0,a.useEffect)(()=>{p();let e=setInterval(()=>void p(),15e3);return()=>clearInterval(e)},[p]),(0,a.useEffect)(()=>{e&&f()},[e,f]),(0,a.useEffect)(()=>{if(!e)return;let t=e=>{h.current&&!h.current.contains(e.target)&&r(!1)};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[e]),(0,a.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&r(!1)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]);let b=async e=>{try{await eE.f.notifications.markRead([e]),o(t=>t.map(t=>t.id===e?{...t,isRead:!0}:t)),m(e=>Math.max(0,e-1))}catch{}},g=async()=>{try{await eE.f.notifications.markAllRead(),o(e=>e.map(e=>({...e,isRead:!0}))),m(0),setTimeout(()=>void p(),500)}catch{}};return(0,t.jsxs)("div",{className:"relative",ref:h,children:[(0,t.jsxs)("button",{className:"relative rounded p-2 text-text-muted transition-all hover:bg-surface-hover hover:text-text",title:"Notifications",type:"button","aria-expanded":e,"aria-controls":"notification-panel","aria-label":d>0?`Notifications (${d} unread)`:"Notifications",onClick:()=>r(e=>!e),children:[(0,t.jsx)(ey,{className:"h-4 w-4"}),d>0&&(0,t.jsx)("span",{className:"absolute right-1 top-1 flex h-4 min-w-[1rem] items-center justify-center rounded-full bg-danger px-1 text-[10px] font-bold text-white",children:d>99?"99+":d})]}),e&&(0,t.jsxs)("div",{id:"notification-panel",role:"region","aria-label":"Notifications",className:"absolute right-0 top-full z-50 mt-2 w-96 overflow-hidden rounded border border-border bg-surface shadow-2xl",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[(0,t.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider text-text",children:"Notifications"}),d>0&&(0,t.jsxs)("button",{className:"flex items-center gap-1 rounded px-2 py-1 text-xs text-primary hover:bg-primary/10 transition-all",onClick:()=>void g(),type:"button",children:[(0,t.jsx)(ek,{className:"h-3 w-3"}),"Mark all read"]})]}),(0,t.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[u&&0===i.length&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsx)("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-primary border-t-transparent"})}),!u&&0===i.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-10 text-text-muted",children:[(0,t.jsx)(ey,{className:"mb-2 h-8 w-8 opacity-40"}),(0,t.jsx)("p",{className:"text-xs",children:"No notifications yet"})]}),i.map(e=>(0,t.jsxs)("div",{className:(0,n.f)("group flex items-start gap-3 border-b border-border/50 px-4 py-3 transition-all hover:bg-surface-hover",!e.isRead&&"bg-primary/5"),children:[(0,t.jsx)("div",{className:"mt-0.5 shrink-0",children:function(e){switch(e){case"critical":return(0,t.jsx)(eN.f,{className:"h-4 w-4 text-danger"});case"warning":return(0,t.jsx)(ej.f,{className:"h-4 w-4 text-warning"});default:return(0,t.jsx)(eC.f,{className:"h-4 w-4 text-primary"})}}(e.severity)}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[function(e){switch(e){case"node.offline":return(0,t.jsx)(y.f,{className:"h-3.5 w-3.5 text-danger"});case"node.degraded":case"node.upgrade_not_ready":return(0,t.jsx)(y.f,{className:"h-3.5 w-3.5 text-warning"});case"node.recovered":return(0,t.jsx)(U,{className:"h-3.5 w-3.5 text-success"});case"command.failed":return(0,t.jsx)(w.f,{className:"h-3.5 w-3.5 text-warning"});case"deploy.failed":return(0,t.jsx)(eM.f,{className:"h-3.5 w-3.5 text-danger"});case"upgrade.failed":return(0,t.jsx)(eS.f,{className:"h-3.5 w-3.5 text-danger"});default:return(0,t.jsx)(ey,{className:"h-3.5 w-3.5 text-text-muted"})}}(e.type),(0,t.jsx)("span",{className:(0,n.f)("text-xs font-bold",e.isRead?"text-text-muted":"text-text"),children:e.title})]}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-text-muted line-clamp-2",children:e.message}),(0,t.jsx)("span",{className:"mt-1 block text-[10px] text-text-muted",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return"just now";let a=Math.floor(t/60);if(a<60)return`${a}m ago`;let r=Math.floor(a/60);if(r<24)return`${r}h ago`;let s=Math.floor(r/24);return`${s}d ago`}(e.createdAt)})]}),!e.isRead&&(0,t.jsx)("button",{className:"mt-0.5 shrink-0 rounded p-1 text-text-muted opacity-0 transition-all hover:bg-surface-hover hover:text-primary group-hover:opacity-100",title:"Mark as read",type:"button",onClick:()=>void b(e.id),children:(0,t.jsx)(c.f,{className:"h-3.5 w-3.5"})})]},e.id))]}),(0,t.jsx)("div",{className:"border-t border-border px-4 py-2 flex justify-end",children:(0,t.jsxs)(s.default,{href:"/notifications",className:"flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",onClick:()=>r(!1),children:[(0,t.jsx)(l.f,{className:"h-3 w-3"}),"Preferences"]})})]})]})}var e_=e.i(1092);let eA=[{keys:["g","m"],label:"Go to Mission Control",description:"Navigate to unified Mission Control home",action:"navigate",target:"/mission-control",category:"navigation"},{keys:["g","o"],label:"Go to Overview",description:"Navigate to fleet overview",action:"navigate",target:"/",category:"navigation"},{keys:["g","n"],label:"Go to Nodes",description:"Navigate to node list",action:"navigate",target:"/nodes",category:"navigation"},{keys:["g","c"],label:"Go to Commands",description:"Navigate to command console",action:"navigate",target:"/commands",category:"navigation"},{keys:["g","j"],label:"Go to Cron Jobs",description:"Navigate to cron jobs",action:"navigate",target:"/cron",category:"navigation"},{keys:["g","f"],label:"Go to Files",description:"Navigate to file editor",action:"navigate",target:"/files",category:"navigation"},{keys:["g","s"],label:"Go to Skills",description:"Navigate to skill marketplace",action:"navigate",target:"/skills",category:"navigation"},{keys:["g","l"],label:"Go to Logs",description:"Navigate to log explorer",action:"navigate",target:"/logs",category:"navigation"},{keys:["g","a"],label:"Go to Audit",description:"Navigate to audit trail",action:"navigate",target:"/audit",category:"navigation"},{keys:["?"],label:"Show Shortcuts",description:"Show keyboard shortcut reference",action:"command",target:"show-shortcuts",category:"general"}];function eL(){return"u">typeof navigator&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘":"Ctrl"}function eR(){document.body.dispatchEvent(new KeyboardEvent("keydown",{key:"k",ctrlKey:!0,metaKey:!0,bubbles:!0}))}function ez({onMenuToggle:e}){let n=(0,r.usePathname)(),i=(0,r.useRouter)(),{title:l,crumbs:o}=function(e){let t=null;for(let a of Object.keys(es))en(e,a)&&(null===t||a.length>t.length)&&(t=a);let a=t?es[t]:"Magnus",r=ei(e),s=r?er.find(e=>e.items.some(e=>e.href===r))?.label??null:null,n=[];if(s&&n.push({label:s}),n.push({label:a,href:t??void 0}),t&&e!==t)for(let a of e.slice("/"===t?1:t.length+1).split("/").filter(Boolean)){let e=decodeURIComponent(a);n.push({label:e.length>18?`${e.slice(0,8)}…${e.slice(-6)}`:e})}return{title:a,group:s,crumbs:n}}(n),[c,d]=(0,a.useState)(null),[m,u]=(0,a.useState)(!1),[x,h]=(0,a.useState)("Ctrl"),p=(0,a.useRef)(null);async function f(e=!1){let t=await fetch(`/api/auth/logout${e?"?all=true":""}`,{method:"POST"}).catch(()=>null);t?.ok?(i.push("/login"),i.refresh()):window.alert("Session revocation unavailable; retry sign out.")}return(0,a.useEffect)(()=>{h(eL()),fetch("/api/auth/me").then(e=>e.ok?e.json():null).then(e=>{e?.username&&d(e.username)}).catch(()=>{})},[]),(0,a.useEffect)(()=>{if(!m)return;let e=e=>{(e instanceof KeyboardEvent?"Escape"!==e.key:p.current?.contains(e.target))||u(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",e)}},[m]),(0,t.jsxs)("header",{className:"relative z-(--z-shell) flex h-14 items-center justify-between gap-3 bg-bg/80 px-3 backdrop-blur-sm sm:px-6",children:[(0,t.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-primary/60 via-accent/40 to-transparent"}),(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 text-xs uppercase tracking-[0.15em] text-text-muted",children:[e&&(0,t.jsx)("button",{className:"mr-1 rounded p-1.5 text-text-muted hover:text-primary md:hidden",onClick:e,type:"button",title:"Toggle menu",children:(0,t.jsx)(ef,{className:"h-5 w-5"})}),(0,t.jsx)("span",{className:"text-primary/60",children:">_"}),(0,t.jsx)("nav",{"aria-label":"Breadcrumb",className:"hidden min-w-0 items-center gap-1 sm:flex",children:o.map((e,a)=>{let r=a===o.length-1;return(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[a>0&&(0,t.jsx)(eg.f,{className:"h-3 w-3 shrink-0 text-primary/30","aria-hidden":"true"}),e.href&&!r?(0,t.jsx)(s.default,{href:e.href,prefetch:!1,className:"truncate transition-colors hover:text-primary",children:e.label}):(0,t.jsx)("span",{className:r?"truncate text-text":0===a&&o.length>1?"truncate text-text-muted":"truncate","aria-current":r?"page":void 0,children:e.label})]},`${e.label}-${a}`)})}),(0,t.jsx)("span",{className:"sr-only sm:hidden",children:l}),(0,t.jsx)("span",{className:"ml-1 hidden h-3.5 w-1.5 shrink-0 bg-primary/80 sm:inline-block",style:{animation:"cursor-blink 1s step-end infinite"}})]}),(0,t.jsx)(e_.J,{className:"hidden max-w-xl flex-1 lg:block"}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1 sm:gap-2",children:[(0,t.jsxs)("button",{type:"button",onClick:eR,className:"hidden items-center gap-2 rounded-chip border border-border bg-surface px-2.5 py-1.5 text-[10px] uppercase tracking-wider text-text-muted transition-colors hover:border-primary/40 hover:text-primary md:flex",title:"Search and jump (command palette)",children:[(0,t.jsx)(eb.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:"Search"}),(0,t.jsxs)("kbd",{className:"rounded-chip border border-border bg-bg px-1 text-[9px] text-primary/70",children:[x,"+K"]})]}),(0,t.jsx)("button",{className:"rounded p-2 text-text-muted transition-all hover:text-primary hover:drop-shadow-[0_0_6px_var(--color-glow)]",title:"Refresh",onClick:()=>window.location.reload(),type:"button",children:(0,t.jsx)(eh.f,{className:"h-4 w-4"})}),(0,t.jsx)(e$,{}),(0,t.jsx)("button",{className:"rounded p-2 text-text-muted transition-all hover:text-danger hover:drop-shadow-[0_0_6px_rgba(255,23,68,0.3)]",title:"Sign Out",onClick:()=>void f(),type:"button",children:(0,t.jsx)(ex.f,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{ref:p,className:"relative ml-1",children:[(0,t.jsx)("button",{type:"button",onClick:()=>u(e=>!e),"aria-haspopup":"menu","aria-expanded":m,title:c?`Signed in as ${c}`:"Account",className:"flex h-8 w-8 items-center justify-center rounded border border-accent/40 text-[10px] font-bold uppercase text-accent shadow-[0_0_8px_var(--color-glow-accent)] transition-colors hover:border-accent hover:bg-accent/10",children:c?.[0]??"U"}),m&&(0,t.jsxs)("div",{role:"menu",className:"panel-corners absolute right-0 top-full z-(--z-modal) mt-2 w-60 rounded-panel border border-accent/30 bg-surface/95 p-1 shadow-[0_0_24px_var(--color-glow-accent)] backdrop-blur-sm [--panel-corner-color:var(--color-accent)]",children:[c&&(0,t.jsxs)("div",{className:"border-b border-border px-3 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:["Signed in as ",(0,t.jsx)("span",{className:"text-accent",children:c})]}),(0,t.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>void f(),className:"flex w-full items-center gap-2 rounded-chip px-3 py-2 text-left text-xs text-text-muted transition-colors hover:bg-surface-hover hover:text-text",children:[(0,t.jsx)(ex.f,{className:"h-3.5 w-3.5"})," Sign out"]}),(0,t.jsxs)("button",{type:"button",role:"menuitem","aria-label":"Sign out all local sessions",onClick:()=>void f(!0),className:"flex w-full items-center gap-2 rounded-chip px-3 py-2 text-left text-xs text-text-muted transition-colors hover:bg-danger/10 hover:text-danger",children:[(0,t.jsx)(ex.f,{className:"h-3.5 w-3.5"})," Sign out all local sessions"]})]})]})]})]})}async function eP(e,t){try{let a=await fetch(e,{signal:t,headers:{accept:"application/json"}});if(!a.ok)return null;return await a.json()}catch{return null}}function eI(e,t){return e.trim()?t.map(t=>({e:t,s:function(e,t){if(!e)return 0;let a=e.toLowerCase(),r=t.toLowerCase(),s=r.indexOf(a);if(-1!==s)return s;let n=0,i=0;for(let e of a){let t=r.indexOf(e,n);if(-1===t)return -1;i+=t-n,n=t+1}return 1e3+i}(e,`${t.label} ${t.sublabel??""}`)})).filter(({s:e})=>e>=0).sort((e,t)=>e.s-t.s).map(({e})=>e):t}async function eT(e,t={}){let{signal:a,limit:r=10}=t;if(e.trim().length<2)return[];let[s,n,i]=await Promise.all([eP("/api/proxy/nodes",a),eP("/api/proxy/orchestra/installations",a),eP("/api/proxy/orchestra/skill-catalog",a)]),l=[];for(let e of s?.data??[])l.push({kind:"node",id:e.id,label:e.name,sublabel:e.status?`Node \xb7 ${e.status}`:"Node",href:`/nodes/${e.id}`});for(let e of n?.data??[])l.push({kind:"installation",id:e.id,label:e.displayName??e.hostname,sublabel:`Hermes \xb7 ${e.status??"unknown"}`,href:"/orchestra/installations"});for(let e of i?.data??[])l.push({kind:"skill",id:e.id,label:e.name,sublabel:e.description??"Skill",href:"/skills"});return eI(e,[{kind:"action",id:"deploy-agent",label:"Deploy agent to host",sublabel:"Action · Operations",href:"/governor/operations"},{kind:"action",id:"open-terminal",label:"Open node terminal",sublabel:"Action · Nodes",href:"/nodes"},{kind:"action",id:"run-fleet-check",label:"Run fleet check",sublabel:"Action · Fleet readiness",href:"/fleet-readiness"},{kind:"action",id:"view-stale-nodes",label:"View stale nodes",sublabel:"Action · Readiness",href:"/fleet-readiness"},{kind:"action",id:"rotate-node-secret",label:"Rotate node secret",sublabel:"Action · Operations",href:"/governor/operations"},{kind:"action",id:"latest-failed-deploy",label:"Open latest failed deploy",sublabel:"Action · Timeline",href:"/fleet-timeline"},...l]).slice(0,r)}var eO=e.i(68877),eD=e.i(20851),eU=e.i(70533);let eF={name:"keyboard",size:24,node:[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]};eF.node;let eq=(0,b.f)(eF);var eG=e.i(63676);let eH={name:"key",size:24,node:[["path",{d:"m2 21 9.6-9.6",key:"9l79m3"}],["path",{d:"m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19",key:"fw8biw"}],["circle",{cx:"15.5",cy:"7.5",r:"5.5",key:"4wxmhb"}]]};eH.node;let eK=(0,b.f)(eH);var eV=e.i(32781),eW=e.i(28623),eJ=e.i(72603);let eB={"/":v,"/mission-control":T,"/nodes":y.f,"/commands":w.f,"/cron":k.f,"/files":j.f,"/skills":eD.f,"/logs":C,"/audit":M.f,"/library":eU.f},eX={node:y.f,installation:S.f,skill:eD.f,action:eO.f};function eQ(){let[e,s]=(0,a.useState)(!1),[n,i]=(0,a.useState)(""),[l,o]=(0,a.useState)(0),[c,d]=(0,a.useState)(!1),[m,u]=(0,a.useState)([]),[x,h]=(0,a.useState)(!1),[p,f]=(0,a.useState)("normal"),b=(0,a.useRef)(null),g=(0,r.useRouter)(),v=(0,a.useRef)([]),y=(0,a.useRef)(void 0),w=(0,a.useRef)(void 0),k=(0,a.useRef)(null),j=(n.trim()?eA.filter(e=>e.label.toLowerCase().includes(n.toLowerCase())||e.description.toLowerCase().includes(n.toLowerCase())):eA).map(e=>({kind:"shortcut",key:`s:${e.keys.join("-")}`,shortcut:e})),N=eI(n,m).map(e=>({kind:"entity",key:`e:${e.kind}:${e.id}`,entity:e})),C=n.trim()?[...N,...j]:j;(0,a.useEffect)(()=>{if(!e)return;let t=n.trim();if(t.length<2){u([]),h(!1);return}w.current&&clearTimeout(w.current),k.current&&k.current.abort();let a=new AbortController;return k.current=a,h(!0),w.current=setTimeout(async()=>{let e=await eT(t,{signal:a.signal,limit:12});a.signal.aborted||(u(e),h(!1))},180),()=>{a.abort(),w.current&&clearTimeout(w.current)}},[n,e]);let M=(0,a.useCallback)(e=>{"navigate"===e.action&&e.target?(g.push(e.target),s(!1),i("")):"show-shortcuts"===e.target&&(d(!0),s(!1),i(""))},[g]),S=(0,a.useCallback)(e=>{"shortcut"===e.kind?M(e.shortcut):(g.push(e.entity.href),s(!1),i(""))},[M,g]);return((0,a.useEffect)(()=>{let t=t=>{let a=t.target,r="INPUT"===a.tagName||"TEXTAREA"===a.tagName||a.isContentEditable;if((t.metaKey||t.ctrlKey)&&"k"===t.key.toLowerCase()){t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),s(e=>!e);return}if("Escape"===t.key){if(e){s(!1),i("");return}return c?void d(!1):void 0}if(!r){if("?"===t.key){t.preventDefault(),d(e=>!e);return}if(1===t.key.length&&!t.metaKey&&!t.ctrlKey&&!t.altKey){for(let e of(clearTimeout(y.current),v.current.push(t.key.toLowerCase()),eA))if(e.keys.length===v.current.length&&e.keys.every((e,t)=>e===v.current[t])){t.preventDefault(),v.current=[],M(e);return}y.current=setTimeout(()=>{v.current=[]},800)}}};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e,c,M]),(0,a.useEffect)(()=>{e&&(o(0),setTimeout(()=>b.current?.focus(),50))},[e]),(0,a.useEffect)(()=>{l>=C.length&&o(Math.max(0,C.length-1))},[C.length,l]),(0,a.useEffect)(()=>{e&&f("low"===document.documentElement.dataset.fx?"low":"normal")},[e]),e||c)?(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsxs)("div",{className:"fixed inset-0 z-(--z-modal) flex items-start justify-center pt-[15vh]","data-testid":"command-palette",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-[2px]",onClick:()=>{s(!1),i("")}}),(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Command palette",className:"relative z-10 w-full max-w-lg panel-corners rounded-panel border border-primary/30 bg-surface/95 shadow-[0_0_40px_var(--color-glow)]",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 border-b border-border px-4 py-3",children:[(0,t.jsx)(eb.f,{className:"h-5 w-5 text-primary"}),(0,t.jsx)("input",{ref:b,type:"text","aria-label":"Search the console",placeholder:"Search nodes, agents, runs, users, commands...",className:"flex-1 bg-transparent text-sm text-text placeholder:text-text-muted/70 caret-primary outline-none",value:n,onChange:e=>{i(e.target.value),o(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),o(e=>Math.min(e+1,C.length-1))):"ArrowUp"===e.key?(e.preventDefault(),o(e=>Math.max(e-1,0))):"Enter"===e.key&&C[l]&&(e.preventDefault(),S(C[l]))},"data-testid":"command-palette-input"}),x?(0,t.jsx)(eV.f,{className:"h-4 w-4 animate-spin text-primary"}):(0,t.jsx)("kbd",{className:"rounded-chip border border-border bg-bg px-1.5 py-0.5 text-[10px] text-text-muted",children:"ESC"})]}),(0,t.jsxs)("div",{className:"max-h-96 overflow-y-auto py-2",children:[0===C.length&&!x&&(0,t.jsx)("p",{className:"px-4 py-6 text-center text-xs uppercase tracking-wider text-text-muted",children:"No results found"}),0===C.length&&x&&(0,t.jsx)("p",{className:"px-4 py-6 text-center text-xs uppercase tracking-wider text-text-muted",children:"Searching…"}),C.map((e,a)=>{let r=a===l;if("shortcut"===e.kind){let s=eB[e.shortcut.target??""]??eO.f;return(0,t.jsxs)("button",{className:`flex w-full items-center gap-3 px-4 py-2 text-left text-sm transition-colors ${r?"bg-primary/10 text-primary shadow-[inset_2px_0_0_var(--color-primary)]":"text-text hover:bg-surface-hover"}`,onClick:()=>S(e),onMouseEnter:()=>o(a),"data-testid":"command-palette-item","data-item-kind":"shortcut",children:[(0,t.jsx)(s,{className:"h-4 w-4 shrink-0 opacity-70"}),(0,t.jsx)("span",{className:"flex-1",children:e.shortcut.label}),(0,t.jsx)("span",{className:"text-xs text-text-muted",children:e.shortcut.keys.map(e=>e.toUpperCase()).join(" then ")})]},e.key)}let s=eX[e.entity.kind]??eO.f;return(0,t.jsxs)("button",{className:`flex w-full items-center gap-3 px-4 py-2 text-left text-sm transition-colors ${r?"bg-accent/10 text-accent shadow-[inset_2px_0_0_var(--color-accent)]":"text-text hover:bg-surface-hover"}`,onClick:()=>S(e),onMouseEnter:()=>o(a),"data-testid":"command-palette-item","data-item-kind":"entity","data-entity-kind":e.entity.kind,children:[(0,t.jsx)(s,{className:"h-4 w-4 shrink-0 text-accent/80"}),(0,t.jsxs)("span",{className:"flex-1 truncate",children:[(0,t.jsx)("span",{className:"font-medium",children:e.entity.label}),e.entity.sublabel&&(0,t.jsx)("span",{className:"ml-2 text-xs text-text-muted",children:e.entity.sublabel})]}),(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:e.entity.kind})]},e.key)})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 border-t border-border px-4 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:[(0,t.jsx)("span",{children:"↑↓ navigate"}),(0,t.jsx)("span",{children:"↵ select"}),(0,t.jsx)("span",{children:"esc close"}),(0,t.jsxs)("button",{type:"button",onClick:()=>f((0,eJ.W)()),className:"ml-auto flex items-center gap-1 rounded-chip px-1 text-text-muted transition-colors hover:text-primary",title:"Toggle visual effects (scanlines, glow pulses, animated map)","data-testid":"command-palette-fx-toggle",children:[(0,t.jsx)(eW.f,{className:"h-3 w-3"})," fx: ",p]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(eK,{className:"h-3 w-3"})," ",eL(),"+K"]})]})]})]}),c&&(0,t.jsxs)("div",{className:"fixed inset-0 z-(--z-modal) flex items-center justify-center",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-[2px]",onClick:()=>d(!1)}),(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"keyboard-shortcuts-title",className:"relative z-10 w-full max-w-md panel-corners rounded-panel border border-primary/30 bg-surface/95 p-6 shadow-[0_0_40px_var(--color-glow)]",children:[(0,t.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(eq,{className:"h-5 w-5 text-primary"}),(0,t.jsx)("h2",{id:"keyboard-shortcuts-title",className:"text-sm font-bold uppercase tracking-wider text-primary glow-text-primary",children:"Keyboard Shortcuts"})]}),(0,t.jsx)("button",{onClick:()=>d(!1),className:"text-text-muted hover:text-text",children:(0,t.jsx)(eG.X,{className:"h-5 w-5"})})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 text-[10px] font-medium uppercase tracking-[0.2em] text-text-muted",children:"General"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(eY,{keys:[`${eL()}+K`],label:"Open command palette"}),(0,t.jsx)(eY,{keys:["?"],label:"Show this reference"}),(0,t.jsx)(eY,{keys:["Esc"],label:"Close modal / palette"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 text-[10px] font-medium uppercase tracking-[0.2em] text-text-muted",children:"Fleet Navigation"}),(0,t.jsx)("div",{className:"space-y-1",children:eA.filter(e=>"navigation"===e.category).map(e=>(0,t.jsx)(eY,{keys:e.keys.map(e=>e.toUpperCase()),label:e.label},e.target))})]})]})]})]})]}):null}function eY({keys:e,label:a}){return(0,t.jsxs)("div",{className:"flex items-center justify-between py-1",children:[(0,t.jsx)("span",{className:"text-xs text-text",children:a}),(0,t.jsx)("div",{className:"flex gap-1",children:e.map((a,r)=>(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"rounded-chip border border-border bg-bg px-1.5 py-0.5 text-[11px] text-primary",children:a}),r<e.length-1&&(0,t.jsx)("span",{className:"mx-0.5 text-[10px] text-text-muted",children:"then"})]},r))})]})}let eZ={name:"server-cog",size:24,node:[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1v3clb"}],["path",{d:"m13.148 9.228.383-.923",key:"t2zzyc"}],["path",{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1bxfiv"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}]]};eZ.node;let e0=(0,b.f)(eZ);var e1=e.i(63646);let e2="magnus.update-banner.dismissed";function e5(){let[e,r]=(0,a.useState)(null),[n,i]=(0,a.useState)(null);if((0,a.useEffect)(()=>{i(function(){try{return window.localStorage.getItem(e2)}catch{return null}}());let e=!1,t=()=>{eE.f.systemUpdates.get().then(t=>{e||r(t)}).catch(()=>void 0)};t();let a=window.setInterval(t,18e5);return()=>{e=!0,window.clearInterval(a)}},[]),!e)return null;let{server:l,agents:o}=e,c=o.behind.length,d=(0,e1.t)(o);if(!l.updateAvailable&&!l.latestMajor&&0===c)return null;let m=`${e.server.latest??""}|${e.server.latestMajor??""}|${e.agents.behind.length}|${e.agents.expected}`;return n===m?null:(0,t.jsxs)("section",{role:"status","aria-label":"Updates","data-testid":"update-banner",className:"relative mb-4 overflow-hidden rounded border border-warning/40 bg-warning/5 px-4 py-3 text-[11px]",children:[(0,t.jsx)("div",{className:"absolute inset-y-0 left-0 w-0.5 bg-warning"}),(0,t.jsx)("button",{type:"button","aria-label":"Dismiss",className:"absolute right-2 top-2 text-text-muted hover:text-text",onClick:()=>{try{window.localStorage.setItem(e2,m)}catch{}i(m)},children:(0,t.jsx)(eG.X,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)("div",{className:"space-y-2 pr-6",children:[l.updateAvailable&&l.latest&&(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(eS.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning"}),(0,t.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,t.jsxs)("p",{children:[(0,t.jsxs)("span",{className:"font-bold uppercase tracking-wider text-warning",children:["Magnus ",l.latest," is available"]}),(0,t.jsxs)("span",{className:"ml-2 text-text-muted",children:["running ",l.current,l.breaking?" · contains breaking changes":""]})]}),l.releases.filter(e=>e.summary).map(e=>(0,t.jsxs)("p",{className:"text-text-muted",children:[e.version,": ",e.summary," ",e.notesUrl&&(0,t.jsx)("a",{className:"text-primary underline",href:e.notesUrl,target:"_blank",rel:"noreferrer",children:"release notes"})]},e.version)),l.newRequiredEnv.length>0&&(0,t.jsxs)("p",{className:"text-text-muted",children:["New required settings:"," ",l.newRequiredEnv.map(e=>(0,t.jsxs)("code",{className:"mr-1 rounded bg-surface px-1",children:[e.name,"server"!==e.component?` (${e.component})`:""]},e.name)),l.newRequiredEnv.every(e=>e.secret)&&(0,t.jsxs)("span",{children:["(secrets: ",(0,t.jsx)("code",{children:"magnus upgrade --generate-secrets"})," fills them in)"]})]}),l.attention.length>0&&(0,t.jsxs)("p",{className:"text-warning",children:["Needs a maintenance window: ",l.attention.map(e=>`${e.name} (${e.impact}${e.note?`: ${e.note}`:""})`).join("; ")]}),(0,t.jsxs)("p",{className:"text-text-muted",children:["On the server host run ",(0,t.jsx)("code",{className:"rounded bg-surface px-1 text-text",children:l.command})," (backs up the database and reverts on failure)."]})]})]}),l.latestMajor&&(0,t.jsxs)("p",{className:"text-text-muted",children:["Magnus ",l.latestMajor," is a new major version. Major upgrades are never offered automatically; read UPGRADING.md first."]}),c>0&&(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(e0,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning"}),(0,t.jsxs)("p",{children:[(0,t.jsxs)("span",{className:"font-bold uppercase tracking-wider text-warning",children:[c," agent",1===c?"":"s"," behind the server (",o.expected,")"]}),(0,t.jsxs)("span",{className:"ml-2 text-text-muted",children:[o.behind.slice(0,5).map(e=>`${e.name} ${e.version}`).join(", "),c>5?", …":"","."]})," ",o.upgradesEnabled?(0,t.jsx)(s.default,{href:"/nodes?upgrade=agents",className:"text-primary underline",children:d>0?"Review agent upgrades":"Upgrade agents"}):(0,t.jsx)("span",{className:"text-text-muted",children:"Agent upgrades are off on this server (MAGNUS_AGENT_UPGRADES=false)."}),d>0&&(0,t.jsxs)("span",{className:"ml-2 text-text-muted",children:[d," agent",1===d?" requires":"s require"," a manual major-version upgrade; the dialog only upgrades within the same major."]}),o.fixCommand&&0===d&&(0,t.jsxs)("span",{className:"ml-2 text-text-muted",children:["or run ",(0,t.jsx)("code",{className:"rounded bg-surface px-1 text-text",children:o.fixCommand})]})]})]})]})]})}var e3=e.i(52928);e.s(["DashboardShell",0,function({children:e,integrations:s}){let n=(0,r.usePathname)(),i="/login"===n,[l,o]=(0,a.useState)(!1);!function({enabled:e=!0}={}){let[t,r]=(0,a.useState)(!1),{addToast:s}=(0,e3.d)(),n=(0,a.useRef)(s);n.current=s;let i=(0,a.useRef)(null),l=(0,a.useRef)(null),o=(0,a.useCallback)(()=>{if(!e)return;let t=new EventSource("/api/proxy/events/stream");for(let e of(i.current=t,t.onopen=()=>{r(!0),el.f.setConnected(!0)},["deploy:status","node:status","command:status","alert:fired"]))t.addEventListener(e,t=>{try{let a=JSON.parse(t.data),r=function(e){let t=e.type??"",a=e.nodeName??"Unknown";switch(t){case"deploy.started":return{title:`Deploying to ${a}`,severity:"info"};case"deploy.completed":return{title:`Deploy complete: ${a}`,severity:"success"};case"deploy.failed":return{title:`Deploy failed: ${a}`,message:e.message??void 0,severity:"error"};case"upgrade.started":return{title:`Upgrading ${a}`,severity:"info"};case"upgrade.completed":return{title:`Upgrade complete: ${a}`,message:`v${e.version}`,severity:"success"};case"upgrade.failed":return{title:`Upgrade failed: ${a}`,message:e.message??void 0,severity:"error"};case"node.recovered":return{title:`${a} back online`,message:`Recovered from ${e.previousStatus}`,severity:"success"};case"command.completed":return{title:"Command completed",message:`${e.command}`,severity:"success"};case"command.failed":return{title:"Command failed",message:`${e.command} (exit ${e.exitCode})`,severity:"error"};case"health.alert":return{title:`Alert: ${e.metric?.replaceAll("_"," ").toUpperCase()} on ${a}`,message:`${e.value?.toFixed(1)}% (threshold: ${e.threshold}%)`,severity:e.severity??"warning"};default:return null}}(a);r&&n.current(r),el.f.push(r?{...r,channel:e}:{title:String(a.type??e).replaceAll("."," "),message:"string"==typeof a.nodeName?a.nodeName:void 0,severity:"info",channel:e})}catch{}});return t.onerror=()=>{r(!1),el.f.setConnected(!1),t.close(),fetch("/api/auth/me",{cache:"no-store"}).then(e=>{if(i.current===t){if(401===e.status)return void window.location.replace("/login");l.current=setTimeout(o,5e3)}}).catch(()=>{i.current===t&&(l.current=setTimeout(o,5e3))})},t},[e]);(0,a.useEffect)(()=>{let e=o();return()=>{l.current&&clearTimeout(l.current),e?.close(),i.current?.close(),el.f.setConnected(!1),i.current=null}},[o])}({enabled:!i}),(0,a.useEffect)(()=>{o(!1)},[n]);let c=(0,a.useCallback)(()=>o(e=>!e),[]);return i?(0,t.jsx)(t.Fragment,{children:e}):(0,t.jsxs)("div",{className:"flex h-screen overflow-hidden",children:[l&&(0,t.jsx)("div",{className:"fixed inset-0 z-40 bg-black/70 backdrop-blur-[2px] md:hidden",onClick:()=>o(!1)}),(0,t.jsx)("div",{className:`
|
|
2
|
+
fixed inset-y-0 left-0 z-50 transform transition-transform duration-200 ease-in-out md:relative md:h-full md:translate-x-0
|
|
3
|
+
${l?"translate-x-0":"-translate-x-full"}
|
|
4
|
+
`,children:(0,t.jsx)(eu,{integrations:s})}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,t.jsx)(ez,{onMenuToggle:c}),(0,t.jsxs)("main",{className:"app-backdrop relative flex-1 overflow-y-auto p-3 md:p-6",children:[(0,t.jsx)(e5,{}),e]})]}),(0,t.jsx)(eQ,{})]})}],40073)},52928,e=>{"use strict";var t=e.i(43476),a=e.i(71645),r=e.i(64155),s=e.i(51757),n=e.i(10818),i=e.i(63676),l=e.i(83967);let o=(0,a.createContext)(null),c=0,d={info:{bar:"bg-primary",border:"border-primary/40",text:"text-primary",glow:"shadow-[0_0_20px_var(--color-glow)]",Icon:n.f},success:{bar:"bg-success",border:"border-success/40",text:"text-success",glow:"shadow-[0_0_20px_var(--color-glow-success)]",Icon:s.f},warning:{bar:"bg-warning",border:"border-warning/40",text:"text-warning",glow:"shadow-[0_0_20px_var(--color-glow-warning)]",Icon:r.f},error:{bar:"bg-danger",border:"border-danger/40",text:"text-danger",glow:"shadow-[0_0_20px_var(--color-glow-danger)]",Icon:l.f}};function m({toasts:e,onRemove:a}){return 0===e.length?null:(0,t.jsx)("div",{role:"status","aria-live":"polite",className:"fixed bottom-4 right-4 z-(--z-toast) flex max-w-sm flex-col gap-2",children:e.map(e=>{let r=d[e.severity],s=r.Icon;return(0,t.jsxs)("div",{className:`relative overflow-hidden rounded-panel border ${r.border} ${r.glow} bg-surface/95 py-3 pl-4 pr-3 text-text backdrop-blur-sm animate-toast-in`,children:[(0,t.jsx)("span",{"aria-hidden":"true",className:`absolute inset-y-0 left-0 w-0.5 ${r.bar}`}),(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)(s,{className:`mt-0.5 h-4 w-4 shrink-0 ${r.text}`,"aria-hidden":"true"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:`text-xs font-bold uppercase leading-tight tracking-wider ${r.text}`,children:e.title}),e.message&&(0,t.jsx)("p",{className:"mt-1 line-clamp-2 text-[11px] text-text-muted",children:e.message})]}),(0,t.jsx)("button",{onClick:()=>a(e.id),"aria-label":"Dismiss notification",className:"ml-2 shrink-0 text-text-muted transition-colors hover:text-text",children:(0,t.jsx)(i.X,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("span",{"aria-hidden":"true",className:`absolute bottom-0 left-0 h-px w-full origin-left opacity-60 ${r.bar}`,style:{animation:`toast-progress ${"error"===e.severity?10:6}s linear forwards`}})]},e.id)})})}e.s(["N",0,function({children:e}){let[r,s]=(0,a.useState)([]),n=(0,a.useCallback)(e=>{s(t=>t.filter(t=>t.id!==e))},[]),i=(0,a.useCallback)(e=>{let t=`toast-${++c}`,a={...e,id:t,createdAt:Date.now()};s(e=>[...e.slice(-9),a]),setTimeout(()=>n(t),"error"===e.severity?1e4:6e3)},[n]);return(0,t.jsxs)(o.Provider,{value:{toasts:r,addToast:i,removeToast:n},children:[e,(0,t.jsx)(m,{toasts:r,onRemove:n})]})},"d",0,function(){let e=(0,a.useContext)(o);if(!e)throw Error("useToast must be used within a ToastProvider");return e}])}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,52717,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(22016),a=e.i(63376),i=e.i(93999),n=e.i(82983),l=e.i(9347),d=e.i(16327),o=e.i(15281),c=e.i(77071),x=e.i(41120),m=e.i(56522),p=e.i(66595),u=e.i(59659),h=e.i(63676),b=e.i(64569);let g=["*","cpu","memory","disk","swap"],f=["warning","critical"],v={triggered:"bg-primary/20 text-primary",running:"bg-warning/20 text-warning",completed:"bg-success/20 text-success",failed:"bg-danger/20 text-danger",skipped:"bg-text-muted/20 text-text-muted"},j={name:"",description:"",metric:"*",severityThreshold:"critical",agentDefinitionId:"diagnostics.v1",input:"",cooldownMinutes:60,maxConcurrentRuns:1,nodeFilter:"",enabled:!0};e.s(["default",0,function(){let[e,N]=(0,r.useState)([]),[w,y]=(0,r.useState)([]),[k,C]=(0,r.useState)(!0),[R,S]=(0,r.useState)(""),[_,M]=(0,r.useState)(!1),[$,F]=(0,r.useState)(null),[I,T]=(0,r.useState)(j),[D,z]=(0,r.useState)(!1),[A,P]=(0,r.useState)(null),[E,L]=(0,r.useState)(null),[O,U]=(0,r.useState)(null),[H,B]=(0,r.useState)(null),[V,G]=(0,r.useState)("rules"),J=(0,r.useCallback)(async()=>{C(!0);try{let[e,t]=await Promise.allSettled([n.f.remediation.listRules(),n.f.remediation.listExecutions({pageSize:50})]);"fulfilled"===e.status&&N(e.value.data??[]),"fulfilled"===t.status&&y(t.value.data?.executions??[])}catch{}finally{C(!1)}},[]);(0,r.useEffect)(()=>{J()},[J]);let K=async()=>{z(!0);try{$?await n.f.remediation.updateRule($,{...I,nodeFilter:I.nodeFilter||null}):await n.f.remediation.createRule({...I,nodeFilter:I.nodeFilter||void 0}),M(!1),F(null),T(j),await J()}catch{}finally{z(!1)}},W=async e=>{P(e),U(null);try{if(!(await n.f.remediation.deleteRule(e)).success)throw Error("The control API did not confirm deletion.");N(t=>t.filter(t=>t.id!==e)),L(null),B(t=>t===e?null:t)}catch(e){U(e instanceof Error?e.message:"Unable to delete this remediation rule.")}finally{P(null)}},X=async e=>{await n.f.remediation.updateRule(e.id,{enabled:!e.enabled}),await J()},q=e.filter(e=>!R||e.name.toLowerCase().includes(R.toLowerCase())||e.description.toLowerCase().includes(R.toLowerCase()));return(0,t.jsxs)(a.U,{children:[(0,t.jsx)(a.z,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)(s.default,{href:"/anomalies",className:"mb-2 inline-flex items-center gap-1 text-xs uppercase tracking-wider text-text-muted hover:text-primary",children:[(0,t.jsx)(l.f,{className:"h-3.5 w-3.5"}),"Back to anomalies"]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(b.f,{className:"h-5 w-5 text-primary"}),(0,t.jsx)("h1",{className:"text-2xl font-bold uppercase tracking-wider text-text",children:"Auto-Remediation"})]}),(0,t.jsx)("p",{className:"mt-1 text-xs uppercase tracking-wider text-text-muted",children:"Rules that record remediation decisions when anomalies are detected"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("button",{onClick:()=>void J(),className:"inline-flex items-center gap-2 rounded border border-border px-3 py-2 text-xs font-semibold uppercase tracking-wider text-text-muted hover:border-primary/40 hover:text-primary",children:[(0,t.jsx)(x.f,{className:`h-3.5 w-3.5 ${k?"animate-spin":""}`}),"Refresh"]}),"rules"===V&&(0,t.jsxs)("button",{onClick:()=>{M(!0),F(null),T(j)},className:"inline-flex items-center gap-2 rounded bg-primary px-3 py-2 text-xs font-semibold uppercase tracking-wider text-bg hover:bg-primary/80",children:[(0,t.jsx)(c.f,{className:"h-3.5 w-3.5"}),"New Rule"]})]})]})}),(0,t.jsx)(a.z,{children:(0,t.jsxs)("div",{className:"flex gap-1 border-b border-border/50",children:[(0,t.jsxs)("button",{onClick:()=>G("rules"),className:`px-4 py-2 text-xs font-semibold uppercase tracking-wider transition-colors ${"rules"===V?"border-b-2 border-primary text-primary":"text-text-muted hover:text-text"}`,children:["Rules (",e.length,")"]}),(0,t.jsxs)("button",{onClick:()=>G("executions"),className:`px-4 py-2 text-xs font-semibold uppercase tracking-wider transition-colors ${"executions"===V?"border-b-2 border-primary text-primary":"text-text-muted hover:text-text"}`,children:["Executions (",w.length,")"]})]})}),_&&(0,t.jsx)(a.z,{children:(0,t.jsxs)(i.N,{className:"p-4",children:[(0,t.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"text-xs font-bold uppercase tracking-wider text-text-muted",children:$?"Edit Rule":"Create New Rule"}),(0,t.jsx)("button",{onClick:()=>{M(!1),F(null)},className:"text-text-muted hover:text-text",children:(0,t.jsx)(h.X,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Name *"}),(0,t.jsx)("input",{value:I.name,onChange:e=>T({...I,name:e.target.value}),className:"w-full rounded border border-border/50 bg-surface px-3 py-2 text-sm text-text",placeholder:"disk-cleanup-rule"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Versioned runbook *"}),(0,t.jsxs)("select",{value:I.agentDefinitionId,onChange:e=>T({...I,agentDefinitionId:e.target.value}),className:"w-full rounded border border-border/50 bg-surface px-3 py-2 text-sm text-text",children:[(0,t.jsx)("option",{value:"diagnostics.v1",children:"diagnostics.v1 — uptime"}),(0,t.jsx)("option",{value:"restart-service.v1",children:"restart-service.v1 — approved application restart"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Metric"}),(0,t.jsx)("select",{value:I.metric,onChange:e=>T({...I,metric:e.target.value}),className:"w-full rounded border border-border/50 bg-surface px-3 py-2 text-sm text-text",children:g.map(e=>(0,t.jsx)("option",{value:e,children:"*"===e?"All Metrics":e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Severity Threshold"}),(0,t.jsx)("select",{value:I.severityThreshold,onChange:e=>T({...I,severityThreshold:e.target.value}),className:"w-full rounded border border-border/50 bg-surface px-3 py-2 text-sm text-text",children:f.map(e=>(0,t.jsx)("option",{value:e,children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Cooldown (minutes)"}),(0,t.jsx)("input",{type:"number",min:1,max:10080,value:I.cooldownMinutes,onChange:e=>T({...I,cooldownMinutes:Number(e.target.value)}),className:"w-full rounded border border-border/50 bg-surface px-3 py-2 text-sm text-text"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Max Concurrent Runs"}),(0,t.jsx)("input",{type:"number",min:1,max:10,value:I.maxConcurrentRuns,onChange:e=>T({...I,maxConcurrentRuns:Number(e.target.value)}),className:"w-full rounded border border-border/50 bg-surface px-3 py-2 text-sm text-text"})]}),(0,t.jsxs)("div",{className:"sm:col-span-2",children:[(0,t.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Description"}),(0,t.jsx)("input",{value:I.description,onChange:e=>T({...I,description:e.target.value}),className:"w-full rounded border border-border/50 bg-surface px-3 py-2 text-sm text-text",placeholder:"Preview a bounded diagnostic when a metric needs investigation"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Node Filter"}),(0,t.jsx)("input",{value:I.nodeFilter,onChange:e=>T({...I,nodeFilter:e.target.value}),className:"w-full rounded border border-border/50 bg-surface px-3 py-2 text-sm text-text",placeholder:"Optional: node ID or name"})]}),(0,t.jsxs)("div",{className:"sm:col-span-2 lg:col-span-3",children:[(0,t.jsxs)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:["Runbook configuration (JSON) ",(0,t.jsxs)("span",{className:"normal-case font-normal",children:["(supports ","{{metric}}",", ","{{value}}",", ","{{nodeId}}",", ","{{nodeName}}",", ","{{zScore}}",", ","{{severity}}",")"]})]}),(0,t.jsx)("textarea",{value:I.input,onChange:e=>T({...I,input:e.target.value}),rows:3,className:"w-full rounded border border-border/50 bg-surface px-3 py-2 text-sm text-text font-mono",placeholder:'{"applicationId":"configured-application-id"}'})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{type:"checkbox",checked:I.enabled,onChange:e=>T({...I,enabled:e.target.checked}),id:"rule-enabled",className:"rounded border-border"}),(0,t.jsx)("label",{htmlFor:"rule-enabled",className:"text-xs uppercase tracking-wider text-text-muted",children:"Enabled"})]})]}),(0,t.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,t.jsxs)("button",{onClick:()=>void K(),disabled:D||!I.name||!I.agentDefinitionId,className:"inline-flex items-center gap-2 rounded bg-primary px-4 py-2 text-xs font-semibold uppercase tracking-wider text-bg hover:bg-primary/80 disabled:opacity-50",children:[(0,t.jsx)(m.f,{className:"h-3.5 w-3.5"}),D?"Saving…":$?"Update":"Create"]}),(0,t.jsx)("button",{onClick:()=>{M(!1),F(null)},className:"rounded border border-border px-4 py-2 text-xs font-semibold uppercase tracking-wider text-text-muted hover:text-text",children:"Cancel"})]})]})}),"rules"===V&&(0,t.jsx)(a.z,{children:(0,t.jsxs)(i.N,{className:"p-4",children:[(0,t.jsx)("div",{className:"mb-4 flex items-center gap-3",children:(0,t.jsxs)("div",{className:"relative flex-1",children:[(0,t.jsx)(p.f,{className:"absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-text-muted"}),(0,t.jsx)("input",{value:R,onChange:e=>S(e.target.value),placeholder:"Search rules",className:"w-full rounded border border-border/50 bg-surface pl-9 pr-3 py-2 text-sm text-text"})]})}),O&&(0,t.jsxs)("div",{role:"alert",className:"mb-4 flex items-center justify-between gap-3 rounded border border-danger/40 bg-danger/10 px-3 py-2 text-xs text-danger",children:[(0,t.jsx)("span",{children:O}),(0,t.jsx)("button",{onClick:()=>U(null),className:"font-semibold uppercase tracking-wider hover:text-danger",children:"Dismiss"})]}),0===q.length?(0,t.jsx)("p",{className:"py-8 text-center text-sm text-text-muted",children:0===e.length?"No remediation rules defined. Create one to get started.":"No rules match your search."}):(0,t.jsxs)("table",{className:"w-full",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-border/50 text-left",children:[(0,t.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Rule"}),(0,t.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Metric"}),(0,t.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Threshold"}),(0,t.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Cooldown"}),(0,t.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Runs"}),(0,t.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Status"}),(0,t.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Actions"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/30",children:q.map(e=>(0,t.jsxs)(r.Fragment,{children:[(0,t.jsxs)("tr",{className:"cursor-pointer hover:bg-surface-hover/50 transition-colors",onClick:()=>B(H===e.id?null:e.id),children:[(0,t.jsx)("td",{className:"py-3 pr-3",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.f,{className:`h-3.5 w-3.5 text-text-muted transition-transform ${H===e.id?"rotate-180":""}`}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-text",children:e.name}),e.description&&(0,t.jsx)("p",{className:"text-xs text-text-muted",children:e.description})]})]})}),(0,t.jsx)("td",{className:"py-3 pr-3",children:(0,t.jsx)("span",{className:"rounded bg-surface px-2 py-0.5 text-xs font-mono text-text-muted",children:"*"===e.metric?"all":e.metric})}),(0,t.jsx)("td",{className:"py-3 pr-3",children:(0,t.jsx)("span",{className:`rounded px-2 py-0.5 text-xs ${"critical"===e.severityThreshold?"bg-danger/20 text-danger":"bg-warning/20 text-warning"}`,children:e.severityThreshold})}),(0,t.jsxs)("td",{className:"py-3 pr-3 text-xs text-text-muted",children:[e.cooldownMinutes,"m"]}),(0,t.jsx)("td",{className:"py-3 pr-3 text-xs text-text-muted",children:e._count?.executions??0}),(0,t.jsx)("td",{className:"py-3 pr-3",children:(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),X(e)},className:`rounded px-2 py-0.5 text-xs font-semibold ${e.enabled?"bg-success/20 text-success":"bg-text-muted/20 text-text-muted"}`,children:e.enabled?"active":"disabled"})}),(0,t.jsx)("td",{className:"py-3",children:(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),T({name:e.name,description:e.description,metric:e.metric,severityThreshold:e.severityThreshold,agentDefinitionId:e.agentDefinitionId,input:e.input,cooldownMinutes:e.cooldownMinutes,maxConcurrentRuns:e.maxConcurrentRuns,nodeFilter:e.nodeFilter??"",enabled:e.enabled}),F(e.id),M(!0)},title:"Edit",className:"rounded p-1.5 text-text-muted hover:bg-surface hover:text-primary",children:(0,t.jsx)(o.f,{className:"h-3.5 w-3.5"})}),E===e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),W(e.id)},disabled:A===e.id,title:"Confirm delete",className:"rounded bg-danger/20 px-2 py-1 text-[10px] font-semibold uppercase tracking-wider text-danger hover:bg-danger/30 disabled:opacity-50",children:A===e.id?"Deleting…":"Delete"}),(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),L(null)},title:"Cancel delete",className:"rounded p-1.5 text-text-muted hover:bg-surface hover:text-text",children:(0,t.jsx)(h.X,{className:"h-3.5 w-3.5"})})]}):(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),U(null),L(e.id)},title:"Delete",className:"rounded p-1.5 text-text-muted hover:bg-surface hover:text-danger",children:(0,t.jsx)(u.f,{className:"h-3.5 w-3.5"})})]})})]},e.id),H===e.id&&(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:7,className:"border-b border-border/30 bg-surface/30 px-6 py-4",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-xs lg:grid-cols-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-text-muted uppercase tracking-wider",children:"Versioned runbook"}),(0,t.jsx)("p",{className:"mt-1 font-mono text-text",children:e.agentDefinitionId})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-text-muted uppercase tracking-wider",children:"Max Concurrent"}),(0,t.jsx)("p",{className:"mt-1 text-text",children:e.maxConcurrentRuns})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-text-muted uppercase tracking-wider",children:"Node Filter"}),(0,t.jsx)("p",{className:"mt-1 text-text font-mono",children:e.nodeFilter??"none"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-text-muted uppercase tracking-wider",children:"Created"}),(0,t.jsx)("p",{className:"mt-1 text-text",children:new Date(e.createdAt).toLocaleString()})]}),e.input&&(0,t.jsxs)("div",{className:"col-span-2 lg:col-span-4",children:[(0,t.jsx)("p",{className:"text-text-muted uppercase tracking-wider",children:"Runbook configuration (JSON)"}),(0,t.jsx)("pre",{className:"mt-1 rounded border border-border/50 bg-bg/40 p-2 font-mono text-text text-[11px] whitespace-pre-wrap",children:e.input})]})]})})})]},e.id))})]})]})}),"executions"===V&&(0,t.jsx)(a.z,{children:(0,t.jsx)(i.N,{className:"p-4",children:0===w.length?(0,t.jsx)("p",{className:"py-8 text-center text-sm text-text-muted",children:"No remediation executions yet."}):(0,t.jsxs)("table",{className:"w-full",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-border/50 text-left",children:[(0,t.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Rule"}),(0,t.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Node"}),(0,t.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Status"}),(0,t.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Legacy Run"}),(0,t.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Triggered"}),(0,t.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Input"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/30",children:w.map(e=>(0,t.jsxs)("tr",{className:"hover:bg-surface-hover/50",children:[(0,t.jsx)("td",{className:"py-3 pr-3 text-sm text-text",children:e.rule?.name??e.ruleId}),(0,t.jsx)("td",{className:"py-3 pr-3 text-xs font-mono text-text-muted",children:e.nodeId}),(0,t.jsx)("td",{className:"py-3 pr-3",children:(0,t.jsx)("span",{className:`rounded px-2 py-0.5 text-xs font-semibold ${v[e.status]??""}`,children:e.status})}),(0,t.jsx)("td",{className:"py-3 pr-3",children:e.orchestraRunId?(0,t.jsxs)("span",{className:"text-xs font-mono text-text-muted",children:[e.orchestraRunId.slice(0,12),"…"]}):(0,t.jsx)("span",{className:"text-xs text-text-muted",children:"—"})}),(0,t.jsx)("td",{className:"py-3 pr-3 text-xs text-text-muted",children:new Date(e.triggeredAt).toLocaleString()}),(0,t.jsxs)("td",{className:"py-3 text-xs text-text-muted max-w-xs",children:[(0,t.jsxs)("details",{children:[(0,t.jsx)("summary",{children:"Review plan and outcome"}),(0,t.jsx)("pre",{className:"whitespace-pre-wrap",children:e.input}),(0,t.jsx)("pre",{className:"whitespace-pre-wrap",children:e.output})]}),"pending_approval"===e.status&&(0,t.jsx)("button",{className:"mt-2 rounded border border-primary p-2",onClick:()=>{window.confirm("Approve this displayed runbook plan?")&&fetch(`/api/proxy/remediation/executions/${encodeURIComponent(e.id)}/approve`,{method:"POST"}).then(async e=>{if(!e.ok)throw Error(`Approval failed: HTTP ${e.status}`);window.location.reload()}).catch(e=>U(String(e)))},children:"Approve displayed plan"})]})]},e.id))})]})})})]})}])},93999,51196,55427,e=>{"use strict";var t=e.i(43476),r=e.i(56420);let s={name:"arrow-down-right",size:24,node:[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]};s.node;let a=(0,r.f)(s);var i=e.i(75775),n=e.i(78571),l=e.i(3062),d=e.i(35084);let o={warning:"shadow-[0_0_6px_var(--color-warning)]",danger:"shadow-[0_0_8px_var(--color-danger)]",accent:"shadow-[0_0_6px_var(--color-accent)]",primary:"shadow-[0_0_6px_var(--color-primary)]"},c={xs:"h-1",sm:"h-1.5",md:"h-2"};function x({value:e,max:r=100,tone:s,thresholds:a=d.q,label:i,size:l="xs",showValue:m=!1,valueLabel:p,glow:u,className:h,testId:b}){let g="number"==typeof e&&Number.isFinite(e),f=g?Math.max(0,Math.min(100,e/(r||1)*100)):0,v=s??(g?(0,d.Z)(f,a):"muted"),j=u||!s&&g&&f>=a.warn,N=p??(g?`${f.toFixed(+(f<10&&f>0))}%`:"—");return(0,t.jsxs)("div",{className:(0,n.f)("flex min-w-0 items-center gap-2",h),"data-testid":b,children:[(0,t.jsx)("div",{...g?{role:"meter","aria-label":i,"aria-valuemin":0,"aria-valuemax":r,"aria-valuenow":e,"aria-valuetext":N}:{role:"img","aria-label":i?`${i}: no data`:"No data"},className:(0,n.f)("relative flex-1 overflow-hidden rounded-full bg-border/70",c[l]),children:(0,t.jsx)("div",{style:{"--meter":`${f}%`},className:(0,n.f)("h-full w-(--meter) rounded-full transition-[width] duration-700 ease-out-expo starting:w-0",d.H[v],j&&o[v])})}),m&&(0,t.jsx)("span",{className:(0,n.f)("num w-11 shrink-0 text-right text-[11px]",g?d.T[v]:"text-text-muted"),children:N})]})}e.s(["f",0,x],51196);var m=e.i(71645);function p({values:e,tone:r="primary",width:s=160,height:a=32,area:i=!0,max:l,percent:o=!1,threshold:c,live:x=!0,emptyLabel:u="not enough data",className:h,testId:b,label:g,stretch:f=!1}){let v=`spark${(0,m.useId)().replace(/:/g,"")}`;if(e.length<2)return(0,t.jsx)("div",{className:(0,n.f)("flex h-8 items-center text-xs italic text-text-muted",h),"data-testid":b,children:u});let j=d.v[r],N=l??(o?Math.max(100,...e):Math.max(...e,c??0)||1),w=a-4,y=s/(e.length-1),k=e=>2+w-Math.max(0,e)/N*w,C=e.map((e,t)=>[t*y,k(e)]),R=C.map(([e,t])=>`${e.toFixed(1)},${t.toFixed(1)}`).join(" "),S=C[C.length-1];return(0,t.jsxs)("svg",{width:f?"100%":s,height:a,viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:f?"none":void 0,className:(0,n.f)("block overflow-visible",h),"data-testid":b,role:g?"img":void 0,"aria-label":g,"aria-hidden":!g||void 0,children:[i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:v,x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:j,stopOpacity:.35}),(0,t.jsx)("stop",{offset:"100%",stopColor:j,stopOpacity:0})]})}),(0,t.jsx)("polygon",{points:`0,${a} ${R} ${s},${a}`,fill:`url(#${v})`})]}),void 0!==c&&(0,t.jsx)("line",{x1:0,x2:s,y1:k(c),y2:k(c),stroke:"var(--color-warning)",strokeOpacity:.5,strokeDasharray:"3 3",strokeWidth:1}),(0,t.jsx)("polyline",{fill:"none",stroke:j,strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round",points:R}),x&&!f&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("circle",{cx:S[0],cy:S[1],r:2.5,fill:j,className:"origin-center animate-halo [transform-box:fill-box]"}),(0,t.jsx)("circle",{cx:S[0],cy:S[1],r:2,fill:j})]})]})}e.s(["f",0,p],55427),e.s(["N",0,function({title:e,description:r,children:s,className:a,action:i,tone:n,corners:d=!1,...o}){return(0,t.jsx)(l.f,{...o,tone:n,corners:d,title:e,description:r,action:i,className:a,children:s})},"n",0,function({label:e,value:r,icon:s,trend:o,spark:c,meter:m,delta:u,tone:h="primary",className:b,testId:g}){let f=!u||u.value>=0===(u.positiveIsGood??!0);return(0,t.jsxs)(l.f,{tone:h,className:(0,n.f)("overflow-hidden",b),testId:g,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:e}),s&&(0,t.jsx)("span",{className:"text-primary/60",children:s})]}),(0,t.jsxs)("div",{className:"mt-2 flex items-end justify-between gap-2",children:[(0,t.jsx)("div",{className:(0,n.f)("num text-2xl font-bold","primary"===h?"text-primary neon-text":d.T[h]),children:r}),u&&0!==u.value&&(0,t.jsxs)("span",{className:(0,n.f)("num mb-1 inline-flex items-center gap-0.5 text-[11px]",f?"text-success":"text-danger"),children:[u.value>0?(0,t.jsx)(i.f,{className:"h-3 w-3"}):(0,t.jsx)(a,{className:"h-3 w-3"}),Math.abs(u.value).toFixed(+!Number.isInteger(u.value)),u.unit]})]}),o&&(0,t.jsx)("div",{className:(0,n.f)("mt-1 text-[11px]",o.positive?"text-success":"text-danger"),children:o.value}),void 0!==m&&(0,t.jsx)(x,{value:m,className:"mt-3",label:e}),c&&c.length>1&&(0,t.jsx)("div",{className:"-mx-5 -mb-5 mt-3 opacity-80",children:(0,t.jsx)(p,{values:c,tone:h,width:240,height:28,stretch:!0,live:!1})})]})}],93999)},3062,e=>{"use strict";var t=e.i(43476),r=e.i(78571),s=e.i(35084);let a={primary:"[--panel-corner-color:color-mix(in_srgb,var(--color-primary)_60%,transparent)]",accent:"[--panel-corner-color:color-mix(in_srgb,var(--color-accent)_70%,transparent)]",success:"[--panel-corner-color:color-mix(in_srgb,var(--color-success)_60%,transparent)]",warning:"[--panel-corner-color:color-mix(in_srgb,var(--color-warning)_70%,transparent)]",danger:"[--panel-corner-color:color-mix(in_srgb,var(--color-danger)_70%,transparent)]",info:"[--panel-corner-color:color-mix(in_srgb,var(--color-info)_60%,transparent)]",muted:"[--panel-corner-color:var(--color-border-strong)]"},i={primary:"[--glow-hover-color:var(--color-glow)]",accent:"[--glow-hover-color:var(--color-glow-accent)]",success:"[--glow-hover-color:var(--color-glow-success)]",warning:"[--glow-hover-color:var(--color-glow-warning)]",danger:"[--glow-hover-color:var(--color-glow-danger)]",info:"[--glow-hover-color:var(--color-glow)]",muted:"[--glow-hover-color:var(--color-glow)]"},n={primary:"hover:border-primary/30",accent:"hover:border-accent/40",success:"hover:border-success/30",warning:"hover:border-warning/40",danger:"hover:border-danger/40",info:"hover:border-info/30",muted:"hover:border-border-strong"},l={none:"",sm:"p-3",md:"p-5",lg:"p-6"};e.s(["f",0,function({tone:e="primary",corners:d=!0,interactive:o=!0,hero:c=!1,title:x,description:m,icon:p,action:u,as:h="div",padding:b="md",testId:g,className:f,children:v,...j}){return(0,t.jsxs)(h,{...j,"data-testid":g??j["data-testid"],className:(0,r.f)("relative rounded-panel border border-border bg-surface transition-colors duration-300",l[b],d&&"panel-corners",d&&a[e],o&&"glow-hover",o&&i[e],o&&n[e],c&&"grid-bg overflow-hidden bg-surface/80",f),children:[(x||u||p)&&(0,t.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[p&&(0,t.jsx)("span",{className:(0,r.f)("mt-0.5 shrink-0",s.T[e]),children:p}),(0,t.jsxs)("div",{className:"min-w-0",children:[x&&(0,t.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider",children:x}),m&&(0,t.jsx)("p",{className:"mt-0.5 text-[11px] text-text-muted",children:m})]})]}),u]}),v]})}])},63376,e=>{"use strict";var t=e.i(43476);e.s(["z",0,function({children:e,className:r}){return(0,t.jsx)("div",{className:`animate-page-in${r?` ${r}`:""}`,children:e})},"U",0,function({children:e,className:r}){return(0,t.jsx)("div",{className:r,children:e})}])},9347,e=>{"use strict";var t=e.i(56420);let r={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],9347)},75775,e=>{"use strict";var t=e.i(56420);let r={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],75775)},56522,e=>{"use strict";var t=e.i(56420);let r={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],56522)}]);
|