@hivemagnus/magnus-ui 3.5.1 → 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/{1xdzfjeq_fj4f.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/{3qr1h6_w6vi_4.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/chunks/015s19fe5dtkp.css +0 -2
- package/dist/app/apps/dashboard/.next/static/chunks/07tx3h4lr-lxl.js +0 -6
- package/dist/app/apps/dashboard/.next/static/chunks/0u9-brifz45bj.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/19-20lxkk1axv.js +0 -1
- 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/3dao7nu2cr6a9.js +0 -4
- 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/pcEuomTy_lxr51c8J4RQm/_buildManifest.js +0 -20
- /package/dist/app/apps/dashboard/.next/static/{pcEuomTy_lxr51c8J4RQm → rWpgppq64sqgeZO3-MlD1}/_clientMiddlewareManifest.js +0 -0
- /package/dist/app/apps/dashboard/.next/static/{pcEuomTy_lxr51c8J4RQm → rWpgppq64sqgeZO3-MlD1}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[33666,a=>{"use strict";var b=a.i(87924),c=a.i(68579),d=a.i(58299),e=a.i(47515);a.s(["x",0,function({readiness:a}){return a?.status!=="not-ready"?null:(0,b.jsx)("span",{title:(0,e.K)(a),"data-testid":"upgrade-readiness-badge",children:(0,b.jsxs)(d.t,{variant:"warning",children:[(0,b.jsx)(c.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade blocked (",a.problems.length,")"]})})},"a",0,function({readiness:a}){return a?.status!=="not-ready"?null:(0,b.jsxs)("div",{className:"rounded border border-warning/40 bg-warning/10 px-3 py-2 text-[11px]","data-testid":"upgrade-readiness-panel",children:[(0,b.jsxs)("p",{className:"flex items-center gap-2 font-bold uppercase tracking-wider text-warning",children:[(0,b.jsx)(c.f,{className:"h-3.5 w-3.5"})," This node could not take an agent upgrade now"]}),(0,b.jsx)("ul",{className:"mt-2 space-y-2",children:a.problems.map(a=>(0,b.jsxs)("li",{children:[(0,b.jsxs)("p",{className:"font-medium text-text",children:[(0,b.jsx)("span",{className:"num",children:a.code}),": ",a.detail]}),(0,b.jsx)("p",{className:"text-text-muted",children:a.remedy})]},`${a.code}-${a.detail}`))})]})}])},90363,7574,a=>{"use strict";var b=a.i(64831);let c={name:"refresh-ccw-dot",size:24,node:[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],90363);var e=a.i(87924),f=a.i(72131),g=a.i(68415),h=a.i(85063),i=a.i(46997),j=a.i(34532),k=a.i(75160);a.s(["E",0,function({open:a,node:b,onClose:c,onSaved:d}){let[l,m]=(0,f.useState)([]),[n,o]=(0,f.useState)(""),[p,q]=(0,f.useState)(!0),[r,s]=(0,f.useState)(!1),[t,u]=(0,f.useState)(""),[v,w]=(0,f.useState)(!1);(0,f.useEffect)(()=>{a&&(u(""),o(b?.role?.id??""),q(!0),w(!0),(async()=>{try{let a=await i.f.roles.list();m(a.data??[])}catch{u("Failed to load roles")}finally{w(!1)}})())},[a,b?.role?.id]);let x=async()=>{if(b){s(!0),u("");try{let a=b.role?.id;a&&a!==n&&await i.f.roles.unassign(a,{nodeIds:[b.id]}),n&&await i.f.roles.assign(n,{nodeIds:[b.id],defer:!p});let e=n?l.find(a=>a.id===n)??null:null;d(e),c()}catch(a){u(a instanceof Error?a.message:"Failed to assign role")}finally{s(!1)}}},y=async()=>{if(b?.role){s(!0),u("");try{await i.f.roles.unassign(b.role.id,{nodeIds:[b.id]}),d(null),c()}catch(a){u(a instanceof Error?a.message:"Failed to unassign role")}finally{s(!1)}}},z=()=>{u(""),s(!1),c()};return(0,e.jsx)(h.n,{open:a,onClose:z,title:b?.role?"Change Role":"Assign Role",description:b?`Node: ${b.name}`:"",icon:(0,e.jsx)(j.f,{className:"h-5 w-5 text-primary"}),children:(0,e.jsxs)("div",{className:"space-y-4",children:[v?(0,e.jsxs)("div",{className:"flex items-center gap-2 py-4 text-xs text-text-muted",children:[(0,e.jsx)(k.f,{className:"h-4 w-4 animate-spin"}),"Loading roles…"]}):0===l.length?(0,e.jsx)("p",{className:"text-xs text-text-muted py-4",children:"No roles found. Create a role first on the Roles page."}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(h.G,{label:"Role",children:(0,e.jsxs)("select",{value:n,onChange:a=>o(a.target.value),className:h.N,children:[(0,e.jsx)("option",{value:"",children:"— No role —"}),l.map(a=>(0,e.jsx)("option",{value:a.id,children:a.name},a.id))]})}),n&&(0,e.jsxs)("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[(0,e.jsx)("input",{type:"checkbox",checked:p,onChange:a=>q(a.target.checked),className:"rounded border-border"}),"Apply role immediately"]})]}),t&&(0,e.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:t}),(0,e.jsxs)("div",{className:"flex justify-between pt-2",children:[(0,e.jsx)("div",{children:b?.role&&(0,e.jsx)(g.K,{variant:"secondary",size:"sm",onClick:()=>void y(),disabled:r,children:"Unassign Role"})}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(g.K,{variant:"secondary",size:"sm",onClick:z,children:"Cancel"}),(0,e.jsx)(g.K,{size:"sm",onClick:()=>void x(),disabled:r||!n||0===l.length,icon:r?(0,e.jsx)(k.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:r?"Saving…":b?.role?"Change Role":"Assign Role"})]})]})]})})},"F",0,function({open:a,node:b,onClose:c,onSaved:d}){let[l,m]=(0,f.useState)(""),[n,o]=(0,f.useState)(""),[p,q]=(0,f.useState)(""),[r,s]=(0,f.useState)(!1),[t,u]=(0,f.useState)("");(0,f.useEffect)(()=>{if(b){m(b.name);try{let a=JSON.parse(b.tags);o(a.join(", "))}catch{o("")}q(b.status),u("")}},[b]);let v=async()=>{if(b&&l.trim()){s(!0),u("");try{let a=n.split(",").map(a=>a.trim()).filter(Boolean);await i.f.nodes.update(b.id,{name:l.trim(),tags:a,status:p.toUpperCase()}),d(),c()}catch(a){u(a instanceof Error?a.message:"Failed to update node")}finally{s(!1)}}},w=()=>{u(""),s(!1),c()};return(0,e.jsx)(h.n,{open:a,onClose:w,title:"Edit Node",description:b?`${b.hostname}`:"",icon:(0,e.jsx)(j.f,{className:"h-5 w-5 text-primary"}),children:(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)(h.G,{label:"Name",required:!0,children:(0,e.jsx)("input",{type:"text",value:l,onChange:a=>m(a.target.value),className:h.W})}),(0,e.jsx)(h.G,{label:"Status",children:(0,e.jsxs)("select",{value:p,onChange:a=>q(a.target.value),className:h.N,children:[(0,e.jsx)("option",{value:"ONLINE",children:"ONLINE"}),(0,e.jsx)("option",{value:"OFFLINE",children:"OFFLINE"}),(0,e.jsx)("option",{value:"DEGRADED",children:"DEGRADED"}),(0,e.jsx)("option",{value:"PROVISIONING",children:"PROVISIONING"}),(0,e.jsx)("option",{value:"MAINTENANCE",children:"MAINTENANCE"})]})}),(0,e.jsxs)(h.G,{label:"Tags",children:[(0,e.jsx)("input",{type:"text",value:n,onChange:a=>o(a.target.value),placeholder:"web, production, us-east",className:h.W}),(0,e.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated list of tags"})]}),t&&(0,e.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:t}),(0,e.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,e.jsx)(g.K,{variant:"secondary",size:"sm",onClick:w,children:"Cancel"}),(0,e.jsx)(g.K,{size:"sm",onClick:()=>void v(),disabled:r||!l.trim(),icon:r?(0,e.jsx)(k.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:r?"Saving…":"Save Changes"})]})]})})},"M",0,function({open:a,onClose:b,onRegistered:c}){let[d,l]=(0,f.useState)(""),[m,n]=(0,f.useState)(""),[o,p]=(0,f.useState)("4100"),[q,r]=(0,f.useState)("linux"),[s,t]=(0,f.useState)("x86_64"),[u,v]=(0,f.useState)(""),[w,x]=(0,f.useState)(!1),[y,z]=(0,f.useState)(""),A=async()=>{if(d.trim()&&m.trim()){x(!0),z("");try{let a=u.split(",").map(a=>a.trim()).filter(Boolean);await i.f.nodes.register({name:d.trim(),hostname:m.trim(),ipAddress:m.trim(),port:Number(o)||4100,os:q,arch:s,tags:a,agentVersion:"3.
|
|
1
|
+
module.exports=[33666,a=>{"use strict";var b=a.i(87924),c=a.i(68579),d=a.i(58299),e=a.i(47515);a.s(["x",0,function({readiness:a}){return a?.status!=="not-ready"?null:(0,b.jsx)("span",{title:(0,e.K)(a),"data-testid":"upgrade-readiness-badge",children:(0,b.jsxs)(d.t,{variant:"warning",children:[(0,b.jsx)(c.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade blocked (",a.problems.length,")"]})})},"a",0,function({readiness:a}){return a?.status!=="not-ready"?null:(0,b.jsxs)("div",{className:"rounded border border-warning/40 bg-warning/10 px-3 py-2 text-[11px]","data-testid":"upgrade-readiness-panel",children:[(0,b.jsxs)("p",{className:"flex items-center gap-2 font-bold uppercase tracking-wider text-warning",children:[(0,b.jsx)(c.f,{className:"h-3.5 w-3.5"})," This node could not take an agent upgrade now"]}),(0,b.jsx)("ul",{className:"mt-2 space-y-2",children:a.problems.map(a=>(0,b.jsxs)("li",{children:[(0,b.jsxs)("p",{className:"font-medium text-text",children:[(0,b.jsx)("span",{className:"num",children:a.code}),": ",a.detail]}),(0,b.jsx)("p",{className:"text-text-muted",children:a.remedy})]},`${a.code}-${a.detail}`))})]})}])},90363,7574,a=>{"use strict";var b=a.i(64831);let c={name:"refresh-ccw-dot",size:24,node:[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],90363);var e=a.i(87924),f=a.i(72131),g=a.i(68415),h=a.i(85063),i=a.i(46997),j=a.i(34532),k=a.i(75160);a.s(["E",0,function({open:a,node:b,onClose:c,onSaved:d}){let[l,m]=(0,f.useState)([]),[n,o]=(0,f.useState)(""),[p,q]=(0,f.useState)(!0),[r,s]=(0,f.useState)(!1),[t,u]=(0,f.useState)(""),[v,w]=(0,f.useState)(!1);(0,f.useEffect)(()=>{a&&(u(""),o(b?.role?.id??""),q(!0),w(!0),(async()=>{try{let a=await i.f.roles.list();m(a.data??[])}catch{u("Failed to load roles")}finally{w(!1)}})())},[a,b?.role?.id]);let x=async()=>{if(b){s(!0),u("");try{let a=b.role?.id;a&&a!==n&&await i.f.roles.unassign(a,{nodeIds:[b.id]}),n&&await i.f.roles.assign(n,{nodeIds:[b.id],defer:!p});let e=n?l.find(a=>a.id===n)??null:null;d(e),c()}catch(a){u(a instanceof Error?a.message:"Failed to assign role")}finally{s(!1)}}},y=async()=>{if(b?.role){s(!0),u("");try{await i.f.roles.unassign(b.role.id,{nodeIds:[b.id]}),d(null),c()}catch(a){u(a instanceof Error?a.message:"Failed to unassign role")}finally{s(!1)}}},z=()=>{u(""),s(!1),c()};return(0,e.jsx)(h.n,{open:a,onClose:z,title:b?.role?"Change Role":"Assign Role",description:b?`Node: ${b.name}`:"",icon:(0,e.jsx)(j.f,{className:"h-5 w-5 text-primary"}),children:(0,e.jsxs)("div",{className:"space-y-4",children:[v?(0,e.jsxs)("div",{className:"flex items-center gap-2 py-4 text-xs text-text-muted",children:[(0,e.jsx)(k.f,{className:"h-4 w-4 animate-spin"}),"Loading roles…"]}):0===l.length?(0,e.jsx)("p",{className:"text-xs text-text-muted py-4",children:"No roles found. Create a role first on the Roles page."}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(h.G,{label:"Role",children:(0,e.jsxs)("select",{value:n,onChange:a=>o(a.target.value),className:h.N,children:[(0,e.jsx)("option",{value:"",children:"— No role —"}),l.map(a=>(0,e.jsx)("option",{value:a.id,children:a.name},a.id))]})}),n&&(0,e.jsxs)("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[(0,e.jsx)("input",{type:"checkbox",checked:p,onChange:a=>q(a.target.checked),className:"rounded border-border"}),"Apply role immediately"]})]}),t&&(0,e.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:t}),(0,e.jsxs)("div",{className:"flex justify-between pt-2",children:[(0,e.jsx)("div",{children:b?.role&&(0,e.jsx)(g.K,{variant:"secondary",size:"sm",onClick:()=>void y(),disabled:r,children:"Unassign Role"})}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(g.K,{variant:"secondary",size:"sm",onClick:z,children:"Cancel"}),(0,e.jsx)(g.K,{size:"sm",onClick:()=>void x(),disabled:r||!n||0===l.length,icon:r?(0,e.jsx)(k.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:r?"Saving…":b?.role?"Change Role":"Assign Role"})]})]})]})})},"F",0,function({open:a,node:b,onClose:c,onSaved:d}){let[l,m]=(0,f.useState)(""),[n,o]=(0,f.useState)(""),[p,q]=(0,f.useState)(""),[r,s]=(0,f.useState)(!1),[t,u]=(0,f.useState)("");(0,f.useEffect)(()=>{if(b){m(b.name);try{let a=JSON.parse(b.tags);o(a.join(", "))}catch{o("")}q(b.status),u("")}},[b]);let v=async()=>{if(b&&l.trim()){s(!0),u("");try{let a=n.split(",").map(a=>a.trim()).filter(Boolean);await i.f.nodes.update(b.id,{name:l.trim(),tags:a,status:p.toUpperCase()}),d(),c()}catch(a){u(a instanceof Error?a.message:"Failed to update node")}finally{s(!1)}}},w=()=>{u(""),s(!1),c()};return(0,e.jsx)(h.n,{open:a,onClose:w,title:"Edit Node",description:b?`${b.hostname}`:"",icon:(0,e.jsx)(j.f,{className:"h-5 w-5 text-primary"}),children:(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)(h.G,{label:"Name",required:!0,children:(0,e.jsx)("input",{type:"text",value:l,onChange:a=>m(a.target.value),className:h.W})}),(0,e.jsx)(h.G,{label:"Status",children:(0,e.jsxs)("select",{value:p,onChange:a=>q(a.target.value),className:h.N,children:[(0,e.jsx)("option",{value:"ONLINE",children:"ONLINE"}),(0,e.jsx)("option",{value:"OFFLINE",children:"OFFLINE"}),(0,e.jsx)("option",{value:"DEGRADED",children:"DEGRADED"}),(0,e.jsx)("option",{value:"PROVISIONING",children:"PROVISIONING"}),(0,e.jsx)("option",{value:"MAINTENANCE",children:"MAINTENANCE"})]})}),(0,e.jsxs)(h.G,{label:"Tags",children:[(0,e.jsx)("input",{type:"text",value:n,onChange:a=>o(a.target.value),placeholder:"web, production, us-east",className:h.W}),(0,e.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated list of tags"})]}),t&&(0,e.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:t}),(0,e.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,e.jsx)(g.K,{variant:"secondary",size:"sm",onClick:w,children:"Cancel"}),(0,e.jsx)(g.K,{size:"sm",onClick:()=>void v(),disabled:r||!l.trim(),icon:r?(0,e.jsx)(k.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:r?"Saving…":"Save Changes"})]})]})})},"M",0,function({open:a,onClose:b,onRegistered:c}){let[d,l]=(0,f.useState)(""),[m,n]=(0,f.useState)(""),[o,p]=(0,f.useState)("4100"),[q,r]=(0,f.useState)("linux"),[s,t]=(0,f.useState)("x86_64"),[u,v]=(0,f.useState)(""),[w,x]=(0,f.useState)(!1),[y,z]=(0,f.useState)(""),A=async()=>{if(d.trim()&&m.trim()){x(!0),z("");try{let a=u.split(",").map(a=>a.trim()).filter(Boolean);await i.f.nodes.register({name:d.trim(),hostname:m.trim(),ipAddress:m.trim(),port:Number(o)||4100,os:q,arch:s,tags:a,agentVersion:"3.7.0"}),c(),B()}catch(a){z(a instanceof Error?a.message:"Failed to register node")}finally{x(!1)}}},B=()=>{l(""),n(""),p("4100"),r("linux"),t("x86_64"),v(""),z(""),x(!1),b()};return(0,e.jsx)(h.n,{open:a,onClose:B,title:"Register Node",description:"Manually register a node already running the agent",icon:(0,e.jsx)(j.f,{className:"h-5 w-5 text-primary"}),children:(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)(h.G,{label:"Node Name",required:!0,children:(0,e.jsx)("input",{type:"text",value:d,onChange:a=>l(a.target.value),placeholder:"web-server-01",className:h.W,autoFocus:!0})}),(0,e.jsx)(h.G,{label:"FQDN / Hostname",required:!0,children:(0,e.jsx)("input",{type:"text",value:m,onChange:a=>n(a.target.value),placeholder:"node-1.example.com",className:h.W})}),(0,e.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,e.jsx)(h.G,{label:"Port",children:(0,e.jsx)("input",{type:"number",value:o,onChange:a=>p(a.target.value),className:h.W})}),(0,e.jsx)(h.G,{label:"OS",children:(0,e.jsxs)("select",{value:q,onChange:a=>r(a.target.value),className:h.N,children:[(0,e.jsx)("option",{value:"linux",children:"Linux"}),(0,e.jsx)("option",{value:"darwin",children:"macOS"}),(0,e.jsx)("option",{value:"windows",children:"Windows"})]})}),(0,e.jsx)(h.G,{label:"Architecture",children:(0,e.jsxs)("select",{value:s,onChange:a=>t(a.target.value),className:h.N,children:[(0,e.jsx)("option",{value:"x86_64",children:"x86_64"}),(0,e.jsx)("option",{value:"aarch64",children:"aarch64"}),(0,e.jsx)("option",{value:"arm",children:"arm"})]})})]}),(0,e.jsxs)(h.G,{label:"Tags",children:[(0,e.jsx)("input",{type:"text",value:u,onChange:a=>v(a.target.value),placeholder:"web, production, us-east",className:h.W}),(0,e.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated"})]}),y&&(0,e.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:y}),(0,e.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,e.jsx)(g.K,{variant:"secondary",size:"sm",onClick:B,children:"Cancel"}),(0,e.jsx)(g.K,{size:"sm",onClick:()=>void A(),disabled:w||!d.trim()||!m.trim(),icon:w?(0,e.jsx)(k.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:w?"Registering…":"Register Node"})]})]})})}],7574)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=_0caxc2bc6a__r._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[33666,a=>{"use strict";var b=a.i(87924),c=a.i(68579),d=a.i(58299),e=a.i(47515);a.s(["x",0,function({readiness:a}){return a?.status!=="not-ready"?null:(0,b.jsx)("span",{title:(0,e.K)(a),"data-testid":"upgrade-readiness-badge",children:(0,b.jsxs)(d.t,{variant:"warning",children:[(0,b.jsx)(c.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade blocked (",a.problems.length,")"]})})},"a",0,function({readiness:a}){return a?.status!=="not-ready"?null:(0,b.jsxs)("div",{className:"rounded border border-warning/40 bg-warning/10 px-3 py-2 text-[11px]","data-testid":"upgrade-readiness-panel",children:[(0,b.jsxs)("p",{className:"flex items-center gap-2 font-bold uppercase tracking-wider text-warning",children:[(0,b.jsx)(c.f,{className:"h-3.5 w-3.5"})," This node could not take an agent upgrade now"]}),(0,b.jsx)("ul",{className:"mt-2 space-y-2",children:a.problems.map(a=>(0,b.jsxs)("li",{children:[(0,b.jsxs)("p",{className:"font-medium text-text",children:[(0,b.jsx)("span",{className:"num",children:a.code}),": ",a.detail]}),(0,b.jsx)("p",{className:"text-text-muted",children:a.remedy})]},`${a.code}-${a.detail}`))})]})}])},90363,7574,a=>{"use strict";var b=a.i(64831);let c={name:"refresh-ccw-dot",size:24,node:[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],90363);var e=a.i(87924),f=a.i(72131),g=a.i(68415),h=a.i(85063),i=a.i(46997),j=a.i(34532),k=a.i(75160);a.s(["E",0,function({open:a,node:b,onClose:c,onSaved:d}){let[l,m]=(0,f.useState)([]),[n,o]=(0,f.useState)(""),[p,q]=(0,f.useState)(!0),[r,s]=(0,f.useState)(!1),[t,u]=(0,f.useState)(""),[v,w]=(0,f.useState)(!1);(0,f.useEffect)(()=>{a&&(u(""),o(b?.role?.id??""),q(!0),w(!0),(async()=>{try{let a=await i.f.roles.list();m(a.data??[])}catch{u("Failed to load roles")}finally{w(!1)}})())},[a,b?.role?.id]);let x=async()=>{if(b){s(!0),u("");try{let a=b.role?.id;a&&a!==n&&await i.f.roles.unassign(a,{nodeIds:[b.id]}),n&&await i.f.roles.assign(n,{nodeIds:[b.id],defer:!p});let e=n?l.find(a=>a.id===n)??null:null;d(e),c()}catch(a){u(a instanceof Error?a.message:"Failed to assign role")}finally{s(!1)}}},y=async()=>{if(b?.role){s(!0),u("");try{await i.f.roles.unassign(b.role.id,{nodeIds:[b.id]}),d(null),c()}catch(a){u(a instanceof Error?a.message:"Failed to unassign role")}finally{s(!1)}}},z=()=>{u(""),s(!1),c()};return(0,e.jsx)(h.n,{open:a,onClose:z,title:b?.role?"Change Role":"Assign Role",description:b?`Node: ${b.name}`:"",icon:(0,e.jsx)(j.f,{className:"h-5 w-5 text-primary"}),children:(0,e.jsxs)("div",{className:"space-y-4",children:[v?(0,e.jsxs)("div",{className:"flex items-center gap-2 py-4 text-xs text-text-muted",children:[(0,e.jsx)(k.f,{className:"h-4 w-4 animate-spin"}),"Loading roles…"]}):0===l.length?(0,e.jsx)("p",{className:"text-xs text-text-muted py-4",children:"No roles found. Create a role first on the Roles page."}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(h.G,{label:"Role",children:(0,e.jsxs)("select",{value:n,onChange:a=>o(a.target.value),className:h.N,children:[(0,e.jsx)("option",{value:"",children:"— No role —"}),l.map(a=>(0,e.jsx)("option",{value:a.id,children:a.name},a.id))]})}),n&&(0,e.jsxs)("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[(0,e.jsx)("input",{type:"checkbox",checked:p,onChange:a=>q(a.target.checked),className:"rounded border-border"}),"Apply role immediately"]})]}),t&&(0,e.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:t}),(0,e.jsxs)("div",{className:"flex justify-between pt-2",children:[(0,e.jsx)("div",{children:b?.role&&(0,e.jsx)(g.K,{variant:"secondary",size:"sm",onClick:()=>void y(),disabled:r,children:"Unassign Role"})}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(g.K,{variant:"secondary",size:"sm",onClick:z,children:"Cancel"}),(0,e.jsx)(g.K,{size:"sm",onClick:()=>void x(),disabled:r||!n||0===l.length,icon:r?(0,e.jsx)(k.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:r?"Saving…":b?.role?"Change Role":"Assign Role"})]})]})]})})},"F",0,function({open:a,node:b,onClose:c,onSaved:d}){let[l,m]=(0,f.useState)(""),[n,o]=(0,f.useState)(""),[p,q]=(0,f.useState)(""),[r,s]=(0,f.useState)(!1),[t,u]=(0,f.useState)("");(0,f.useEffect)(()=>{if(b){m(b.name);try{let a=JSON.parse(b.tags);o(a.join(", "))}catch{o("")}q(b.status),u("")}},[b]);let v=async()=>{if(b&&l.trim()){s(!0),u("");try{let a=n.split(",").map(a=>a.trim()).filter(Boolean);await i.f.nodes.update(b.id,{name:l.trim(),tags:a,status:p.toUpperCase()}),d(),c()}catch(a){u(a instanceof Error?a.message:"Failed to update node")}finally{s(!1)}}},w=()=>{u(""),s(!1),c()};return(0,e.jsx)(h.n,{open:a,onClose:w,title:"Edit Node",description:b?`${b.hostname}`:"",icon:(0,e.jsx)(j.f,{className:"h-5 w-5 text-primary"}),children:(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)(h.G,{label:"Name",required:!0,children:(0,e.jsx)("input",{type:"text",value:l,onChange:a=>m(a.target.value),className:h.W})}),(0,e.jsx)(h.G,{label:"Status",children:(0,e.jsxs)("select",{value:p,onChange:a=>q(a.target.value),className:h.N,children:[(0,e.jsx)("option",{value:"ONLINE",children:"ONLINE"}),(0,e.jsx)("option",{value:"OFFLINE",children:"OFFLINE"}),(0,e.jsx)("option",{value:"DEGRADED",children:"DEGRADED"}),(0,e.jsx)("option",{value:"PROVISIONING",children:"PROVISIONING"}),(0,e.jsx)("option",{value:"MAINTENANCE",children:"MAINTENANCE"})]})}),(0,e.jsxs)(h.G,{label:"Tags",children:[(0,e.jsx)("input",{type:"text",value:n,onChange:a=>o(a.target.value),placeholder:"web, production, us-east",className:h.W}),(0,e.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated list of tags"})]}),t&&(0,e.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:t}),(0,e.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,e.jsx)(g.K,{variant:"secondary",size:"sm",onClick:w,children:"Cancel"}),(0,e.jsx)(g.K,{size:"sm",onClick:()=>void v(),disabled:r||!l.trim(),icon:r?(0,e.jsx)(k.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:r?"Saving…":"Save Changes"})]})]})})},"M",0,function({open:a,onClose:b,onRegistered:c}){let[d,l]=(0,f.useState)(""),[m,n]=(0,f.useState)(""),[o,p]=(0,f.useState)("4100"),[q,r]=(0,f.useState)("linux"),[s,t]=(0,f.useState)("x86_64"),[u,v]=(0,f.useState)(""),[w,x]=(0,f.useState)(!1),[y,z]=(0,f.useState)(""),A=async()=>{if(d.trim()&&m.trim()){x(!0),z("");try{let a=u.split(",").map(a=>a.trim()).filter(Boolean);await i.f.nodes.register({name:d.trim(),hostname:m.trim(),ipAddress:m.trim(),port:Number(o)||4100,os:q,arch:s,tags:a,agentVersion:"3.
|
|
1
|
+
module.exports=[33666,a=>{"use strict";var b=a.i(87924),c=a.i(68579),d=a.i(58299),e=a.i(47515);a.s(["x",0,function({readiness:a}){return a?.status!=="not-ready"?null:(0,b.jsx)("span",{title:(0,e.K)(a),"data-testid":"upgrade-readiness-badge",children:(0,b.jsxs)(d.t,{variant:"warning",children:[(0,b.jsx)(c.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade blocked (",a.problems.length,")"]})})},"a",0,function({readiness:a}){return a?.status!=="not-ready"?null:(0,b.jsxs)("div",{className:"rounded border border-warning/40 bg-warning/10 px-3 py-2 text-[11px]","data-testid":"upgrade-readiness-panel",children:[(0,b.jsxs)("p",{className:"flex items-center gap-2 font-bold uppercase tracking-wider text-warning",children:[(0,b.jsx)(c.f,{className:"h-3.5 w-3.5"})," This node could not take an agent upgrade now"]}),(0,b.jsx)("ul",{className:"mt-2 space-y-2",children:a.problems.map(a=>(0,b.jsxs)("li",{children:[(0,b.jsxs)("p",{className:"font-medium text-text",children:[(0,b.jsx)("span",{className:"num",children:a.code}),": ",a.detail]}),(0,b.jsx)("p",{className:"text-text-muted",children:a.remedy})]},`${a.code}-${a.detail}`))})]})}])},90363,7574,a=>{"use strict";var b=a.i(64831);let c={name:"refresh-ccw-dot",size:24,node:[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],90363);var e=a.i(87924),f=a.i(72131),g=a.i(68415),h=a.i(85063),i=a.i(46997),j=a.i(34532),k=a.i(75160);a.s(["E",0,function({open:a,node:b,onClose:c,onSaved:d}){let[l,m]=(0,f.useState)([]),[n,o]=(0,f.useState)(""),[p,q]=(0,f.useState)(!0),[r,s]=(0,f.useState)(!1),[t,u]=(0,f.useState)(""),[v,w]=(0,f.useState)(!1);(0,f.useEffect)(()=>{a&&(u(""),o(b?.role?.id??""),q(!0),w(!0),(async()=>{try{let a=await i.f.roles.list();m(a.data??[])}catch{u("Failed to load roles")}finally{w(!1)}})())},[a,b?.role?.id]);let x=async()=>{if(b){s(!0),u("");try{let a=b.role?.id;a&&a!==n&&await i.f.roles.unassign(a,{nodeIds:[b.id]}),n&&await i.f.roles.assign(n,{nodeIds:[b.id],defer:!p});let e=n?l.find(a=>a.id===n)??null:null;d(e),c()}catch(a){u(a instanceof Error?a.message:"Failed to assign role")}finally{s(!1)}}},y=async()=>{if(b?.role){s(!0),u("");try{await i.f.roles.unassign(b.role.id,{nodeIds:[b.id]}),d(null),c()}catch(a){u(a instanceof Error?a.message:"Failed to unassign role")}finally{s(!1)}}},z=()=>{u(""),s(!1),c()};return(0,e.jsx)(h.n,{open:a,onClose:z,title:b?.role?"Change Role":"Assign Role",description:b?`Node: ${b.name}`:"",icon:(0,e.jsx)(j.f,{className:"h-5 w-5 text-primary"}),children:(0,e.jsxs)("div",{className:"space-y-4",children:[v?(0,e.jsxs)("div",{className:"flex items-center gap-2 py-4 text-xs text-text-muted",children:[(0,e.jsx)(k.f,{className:"h-4 w-4 animate-spin"}),"Loading roles…"]}):0===l.length?(0,e.jsx)("p",{className:"text-xs text-text-muted py-4",children:"No roles found. Create a role first on the Roles page."}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(h.G,{label:"Role",children:(0,e.jsxs)("select",{value:n,onChange:a=>o(a.target.value),className:h.N,children:[(0,e.jsx)("option",{value:"",children:"— No role —"}),l.map(a=>(0,e.jsx)("option",{value:a.id,children:a.name},a.id))]})}),n&&(0,e.jsxs)("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[(0,e.jsx)("input",{type:"checkbox",checked:p,onChange:a=>q(a.target.checked),className:"rounded border-border"}),"Apply role immediately"]})]}),t&&(0,e.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:t}),(0,e.jsxs)("div",{className:"flex justify-between pt-2",children:[(0,e.jsx)("div",{children:b?.role&&(0,e.jsx)(g.K,{variant:"secondary",size:"sm",onClick:()=>void y(),disabled:r,children:"Unassign Role"})}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(g.K,{variant:"secondary",size:"sm",onClick:z,children:"Cancel"}),(0,e.jsx)(g.K,{size:"sm",onClick:()=>void x(),disabled:r||!n||0===l.length,icon:r?(0,e.jsx)(k.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:r?"Saving…":b?.role?"Change Role":"Assign Role"})]})]})]})})},"F",0,function({open:a,node:b,onClose:c,onSaved:d}){let[l,m]=(0,f.useState)(""),[n,o]=(0,f.useState)(""),[p,q]=(0,f.useState)(""),[r,s]=(0,f.useState)(!1),[t,u]=(0,f.useState)("");(0,f.useEffect)(()=>{if(b){m(b.name);try{let a=JSON.parse(b.tags);o(a.join(", "))}catch{o("")}q(b.status),u("")}},[b]);let v=async()=>{if(b&&l.trim()){s(!0),u("");try{let a=n.split(",").map(a=>a.trim()).filter(Boolean);await i.f.nodes.update(b.id,{name:l.trim(),tags:a,status:p.toUpperCase()}),d(),c()}catch(a){u(a instanceof Error?a.message:"Failed to update node")}finally{s(!1)}}},w=()=>{u(""),s(!1),c()};return(0,e.jsx)(h.n,{open:a,onClose:w,title:"Edit Node",description:b?`${b.hostname}`:"",icon:(0,e.jsx)(j.f,{className:"h-5 w-5 text-primary"}),children:(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)(h.G,{label:"Name",required:!0,children:(0,e.jsx)("input",{type:"text",value:l,onChange:a=>m(a.target.value),className:h.W})}),(0,e.jsx)(h.G,{label:"Status",children:(0,e.jsxs)("select",{value:p,onChange:a=>q(a.target.value),className:h.N,children:[(0,e.jsx)("option",{value:"ONLINE",children:"ONLINE"}),(0,e.jsx)("option",{value:"OFFLINE",children:"OFFLINE"}),(0,e.jsx)("option",{value:"DEGRADED",children:"DEGRADED"}),(0,e.jsx)("option",{value:"PROVISIONING",children:"PROVISIONING"}),(0,e.jsx)("option",{value:"MAINTENANCE",children:"MAINTENANCE"})]})}),(0,e.jsxs)(h.G,{label:"Tags",children:[(0,e.jsx)("input",{type:"text",value:n,onChange:a=>o(a.target.value),placeholder:"web, production, us-east",className:h.W}),(0,e.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated list of tags"})]}),t&&(0,e.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:t}),(0,e.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,e.jsx)(g.K,{variant:"secondary",size:"sm",onClick:w,children:"Cancel"}),(0,e.jsx)(g.K,{size:"sm",onClick:()=>void v(),disabled:r||!l.trim(),icon:r?(0,e.jsx)(k.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:r?"Saving…":"Save Changes"})]})]})})},"M",0,function({open:a,onClose:b,onRegistered:c}){let[d,l]=(0,f.useState)(""),[m,n]=(0,f.useState)(""),[o,p]=(0,f.useState)("4100"),[q,r]=(0,f.useState)("linux"),[s,t]=(0,f.useState)("x86_64"),[u,v]=(0,f.useState)(""),[w,x]=(0,f.useState)(!1),[y,z]=(0,f.useState)(""),A=async()=>{if(d.trim()&&m.trim()){x(!0),z("");try{let a=u.split(",").map(a=>a.trim()).filter(Boolean);await i.f.nodes.register({name:d.trim(),hostname:m.trim(),ipAddress:m.trim(),port:Number(o)||4100,os:q,arch:s,tags:a,agentVersion:"3.7.0"}),c(),B()}catch(a){z(a instanceof Error?a.message:"Failed to register node")}finally{x(!1)}}},B=()=>{l(""),n(""),p("4100"),r("linux"),t("x86_64"),v(""),z(""),x(!1),b()};return(0,e.jsx)(h.n,{open:a,onClose:B,title:"Register Node",description:"Manually register a node already running the agent",icon:(0,e.jsx)(j.f,{className:"h-5 w-5 text-primary"}),children:(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)(h.G,{label:"Node Name",required:!0,children:(0,e.jsx)("input",{type:"text",value:d,onChange:a=>l(a.target.value),placeholder:"web-server-01",className:h.W,autoFocus:!0})}),(0,e.jsx)(h.G,{label:"FQDN / Hostname",required:!0,children:(0,e.jsx)("input",{type:"text",value:m,onChange:a=>n(a.target.value),placeholder:"node-1.example.com",className:h.W})}),(0,e.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,e.jsx)(h.G,{label:"Port",children:(0,e.jsx)("input",{type:"number",value:o,onChange:a=>p(a.target.value),className:h.W})}),(0,e.jsx)(h.G,{label:"OS",children:(0,e.jsxs)("select",{value:q,onChange:a=>r(a.target.value),className:h.N,children:[(0,e.jsx)("option",{value:"linux",children:"Linux"}),(0,e.jsx)("option",{value:"darwin",children:"macOS"}),(0,e.jsx)("option",{value:"windows",children:"Windows"})]})}),(0,e.jsx)(h.G,{label:"Architecture",children:(0,e.jsxs)("select",{value:s,onChange:a=>t(a.target.value),className:h.N,children:[(0,e.jsx)("option",{value:"x86_64",children:"x86_64"}),(0,e.jsx)("option",{value:"aarch64",children:"aarch64"}),(0,e.jsx)("option",{value:"arm",children:"arm"})]})})]}),(0,e.jsxs)(h.G,{label:"Tags",children:[(0,e.jsx)("input",{type:"text",value:u,onChange:a=>v(a.target.value),placeholder:"web, production, us-east",className:h.W}),(0,e.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated"})]}),y&&(0,e.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:y}),(0,e.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,e.jsx)(g.K,{variant:"secondary",size:"sm",onClick:B,children:"Cancel"}),(0,e.jsx)(g.K,{size:"sm",onClick:()=>void A(),disabled:w||!d.trim()||!m.trim(),icon:w?(0,e.jsx)(k.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:w?"Registering…":"Register Node"})]})]})})}],7574)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=_1oebzzj_en62h._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[79952,a=>{"use strict";let b=(a={})=>({type:"string",...a}),c=(a={})=>({type:"url",...a}),d=(a={})=>({type:"path",...a}),e=(a={})=>({type:"integer",...a}),f=Object.freeze({CONTROL_API_URL:c({default:"https://localhost:4000",purpose:"Default Magnus Control API target."}),CONTROL_API_CA_PATH:d({optional:!0,purpose:"Private CA bundle used for verified Control API TLS."}),CONTROL_API_MAX_RESPONSE_BYTES:e({default:1048576,minimum:1024,purpose:"Maximum accepted Control API response size in bytes."}),DASHBOARD_PROXY_BODY_LIMIT_BYTES:e({default:1048576,minimum:1,purpose:"Maximum forwarded request body size in bytes, enforced while streaming."}),API_SECRET:b({required:!0,sensitive:!0,purpose:"Server-side secret injected into Control API proxy requests."}),CONTROL_NODE_CREDENTIAL_KEY:b({required:!0,sensitive:!0,minimumLength:32,purpose:"Dedicated key for encrypted control-node credentials at rest."}),SESSION_SECRET:b({required:!0,sensitive:!0,purpose:"Dedicated dashboard session signing secret."}),SESSION_ISSUER:b({default:"magnus-dashboard",purpose:"Required issuer claim for dashboard session tokens."}),SESSION_AUDIENCE:b({default:"magnus-dashboard-session",purpose:"Required audience claim for dashboard session tokens."}),HERMES_SSH_AUTHORIZATIONS_FILE:d({default:".magnus/hermes-ssh-authorizations.json",requirement:"Required (default path shown)",purpose:"Reviewed installation, node, address, and SSH host-key bindings."}),DASHBOARD_PUBLIC_ORIGIN:c({required:!0,purpose:"Canonical browser origin allowed to open the Hermes WebSocket bridge."}),HERMES_WEBSOCKET_ALLOWED_ORIGINS:b({optional:!0,purpose:"Comma-separated additional allowed Hermes WebSocket origins."}),DASHBOARD_ADMIN_USERNAME:b({optional:!0,requirement:"Required with DASHBOARD_ADMIN_PASSWORD_HASH; deployment may serialize it",purpose:"Dedicated dashboard administrator identity."}),DASHBOARD_ADMIN_USERNAME_B64:b({optional:!0,sensitive:!0,purpose:"Serializer-managed base64 form of the dashboard administrator identity."}),DASHBOARD_ADMIN_PASSWORD_HASH:b({optional:!0,requirement:"Required with DASHBOARD_ADMIN_USERNAME unless DASHBOARD_ADMIN_PASSWORD is set; Argon2id only",sensitive:!0,purpose:"Non-reusable Argon2id dashboard administrator password verifier."}),DASHBOARD_ADMIN_PASSWORD:b({optional:!0,sensitive:!0,requirement:"Optional; takes precedence over DASHBOARD_ADMIN_PASSWORD_HASH when set with DASHBOARD_ADMIN_USERNAME",purpose:"Plaintext dashboard administrator password. Prefer the Argon2id hash; a set value silently wins over it."}),DASHBOARD_ADMIN_PASSWORD_B64:b({optional:!0,sensitive:!0,purpose:"Serializer-managed base64 form of DASHBOARD_ADMIN_PASSWORD (same precedence)."}),LOCAL_SESSION_GENERATION:b({optional:!0,sensitive:!0,purpose:"Any value; changing it signs out every local console session (as changing the administrator credential does)."}),DASHBOARD_ADMIN_PASSWORD_HASH_B64:b({optional:!0,sensitive:!0,purpose:"Serializer-managed base64 form of the Argon2id verifier."}),DASHBOARD_ADMIN_CREDENTIAL_METADATA_B64:b({optional:!0,sensitive:!0,purpose:"Versioned non-secret credential purpose, rotation, fleet-password, and fingerprint-separation evidence."}),DASHBOARD_TRUSTED_PROXIES:b({optional:!0,purpose:"Comma-separated reverse-proxy addresses or CIDR ranges whose X-Forwarded-For names the client for login throttling and audit. Unset: the socket peer."}),REDIS_URL:c({default:"redis://127.0.0.1:6379",sensitive:!0,purpose:"Durable dashboard authentication throttling and concurrency store."}),REDIS_PREFIX:b({default:"magnus-",purpose:"Namespace prefix for durable Redis authentication limiter keys."}),AUTH_RATE_LIMIT_LABEL_KEY:b({optional:!0,sensitive:!0,purpose:"Optional dedicated HMAC key for de-identifying authentication limiter labels."}),DASHBOARD_SSH_USERNAME:b({optional:!0,requirement:"Required for the terminal and Hermes proxy",purpose:"Dedicated, unprivileged dashboard proxy account on managed nodes."}),DASHBOARD_SSH_PASSWORD:b({optional:!0,sensitive:!0,purpose:"Optional dedicated dashboard SSH password; restricted keys are preferred."}),SSH_HOST_KEY_PINNING:b({default:"enforce",purpose:"Terminal SSH host-key pinning: enforce refuses a host whose key differs from the pinned one; warn only logs the mismatch and connects anyway (never use warn in production). Any other value means enforce."}),SSH_HOST_KEYS_FILE:d({default:"terminal-audit/known-hosts.json",purpose:"Pinned terminal SSH host keys (trust on first use), relative to the working directory."}),TERMINAL_AUDIT_DIR:d({default:"terminal-audit",purpose:"Directory of the terminal host-key trust audit log, relative to the working directory."}),DASHBOARD_DEPENDENCY_TIMEOUT_MS:e({default:8e3,minimum:1,purpose:"Timeout of console requests to the Control API and
|
|
1
|
+
module.exports=[79952,a=>{"use strict";let b=(a={})=>({type:"string",...a}),c=(a={})=>({type:"url",...a}),d=(a={})=>({type:"path",...a}),e=(a={})=>({type:"integer",...a}),f=Object.freeze({CONTROL_API_URL:c({default:"https://localhost:4000",purpose:"Default Magnus Control API target."}),CONTROL_API_CA_PATH:d({optional:!0,purpose:"Private CA bundle used for verified Control API TLS."}),CONTROL_API_MAX_RESPONSE_BYTES:e({default:1048576,minimum:1024,purpose:"Maximum accepted Control API response size in bytes."}),DASHBOARD_PROXY_BODY_LIMIT_BYTES:e({default:1048576,minimum:1,purpose:"Maximum forwarded request body size in bytes, enforced while streaming."}),API_SECRET:b({required:!0,sensitive:!0,purpose:"Server-side secret injected into Control API proxy requests."}),CONTROL_NODE_CREDENTIAL_KEY:b({required:!0,sensitive:!0,minimumLength:32,purpose:"Dedicated key for encrypted control-node credentials at rest."}),SESSION_SECRET:b({required:!0,sensitive:!0,purpose:"Dedicated dashboard session signing secret."}),SESSION_ISSUER:b({default:"magnus-dashboard",purpose:"Required issuer claim for dashboard session tokens."}),SESSION_AUDIENCE:b({default:"magnus-dashboard-session",purpose:"Required audience claim for dashboard session tokens."}),HERMES_SSH_AUTHORIZATIONS_FILE:d({default:".magnus/hermes-ssh-authorizations.json",requirement:"Required (default path shown)",purpose:"Reviewed installation, node, address, and SSH host-key bindings."}),DASHBOARD_PUBLIC_ORIGIN:c({required:!0,purpose:"Canonical browser origin allowed to open the Hermes WebSocket bridge."}),HERMES_WEBSOCKET_ALLOWED_ORIGINS:b({optional:!0,purpose:"Comma-separated additional allowed Hermes WebSocket origins."}),DASHBOARD_ADMIN_USERNAME:b({optional:!0,requirement:"Required with DASHBOARD_ADMIN_PASSWORD_HASH; deployment may serialize it",purpose:"Dedicated dashboard administrator identity."}),DASHBOARD_ADMIN_USERNAME_B64:b({optional:!0,sensitive:!0,purpose:"Serializer-managed base64 form of the dashboard administrator identity."}),DASHBOARD_ADMIN_PASSWORD_HASH:b({optional:!0,requirement:"Required with DASHBOARD_ADMIN_USERNAME unless DASHBOARD_ADMIN_PASSWORD is set; Argon2id only",sensitive:!0,purpose:"Non-reusable Argon2id dashboard administrator password verifier."}),DASHBOARD_ADMIN_PASSWORD:b({optional:!0,sensitive:!0,requirement:"Optional; takes precedence over DASHBOARD_ADMIN_PASSWORD_HASH when set with DASHBOARD_ADMIN_USERNAME",purpose:"Plaintext dashboard administrator password. Prefer the Argon2id hash; a set value silently wins over it."}),DASHBOARD_ADMIN_PASSWORD_B64:b({optional:!0,sensitive:!0,purpose:"Serializer-managed base64 form of DASHBOARD_ADMIN_PASSWORD (same precedence)."}),LOCAL_SESSION_GENERATION:b({optional:!0,sensitive:!0,purpose:"Any value; changing it signs out every local console session (as changing the administrator credential does)."}),DASHBOARD_ADMIN_PASSWORD_HASH_B64:b({optional:!0,sensitive:!0,purpose:"Serializer-managed base64 form of the Argon2id verifier."}),DASHBOARD_ADMIN_CREDENTIAL_METADATA_B64:b({optional:!0,sensitive:!0,purpose:"Versioned non-secret credential purpose, rotation, fleet-password, and fingerprint-separation evidence."}),DASHBOARD_TRUSTED_PROXIES:b({optional:!0,purpose:"Comma-separated reverse-proxy addresses or CIDR ranges whose X-Forwarded-For names the client for login throttling and audit. Unset: the socket peer."}),REDIS_URL:c({default:"redis://127.0.0.1:6379",sensitive:!0,purpose:"Durable dashboard authentication throttling and concurrency store."}),REDIS_PREFIX:b({default:"magnus-",purpose:"Namespace prefix for durable Redis authentication limiter keys."}),AUTH_RATE_LIMIT_LABEL_KEY:b({optional:!0,sensitive:!0,purpose:"Optional dedicated HMAC key for de-identifying authentication limiter labels."}),DASHBOARD_SSH_USERNAME:b({optional:!0,requirement:"Required for the terminal and Hermes proxy",purpose:"Dedicated, unprivileged dashboard proxy account on managed nodes."}),DASHBOARD_SSH_PASSWORD:b({optional:!0,sensitive:!0,purpose:"Optional dedicated dashboard SSH password; restricted keys are preferred."}),SSH_HOST_KEY_PINNING:b({default:"enforce",purpose:"Terminal SSH host-key pinning: enforce refuses a host whose key differs from the pinned one; warn only logs the mismatch and connects anyway (never use warn in production). Any other value means enforce."}),SSH_HOST_KEYS_FILE:d({default:"terminal-audit/known-hosts.json",purpose:"Pinned terminal SSH host keys (trust on first use), relative to the working directory."}),TERMINAL_AUDIT_DIR:d({default:"terminal-audit",purpose:"Directory of the terminal host-key trust audit log, relative to the working directory."}),DASHBOARD_DEPENDENCY_TIMEOUT_MS:e({default:8e3,minimum:1,purpose:"Timeout of console requests to the Control API and the Emberpath admin plane, in milliseconds."}),MAGNUS_CONTROL_NODES_CONFIG_DIR:d({optional:!0,purpose:"Test-only override of the control-node registry directory; honoured only with NODE_ENV=test (otherwise .magnus/ in the working directory)."}),DASHBOARD_SSH_PRIVATE_KEY_PATH:d({optional:!0,requirement:"Required for the terminal and Hermes proxy (or DASHBOARD_SSH_PASSWORD)",purpose:"Restricted dashboard-proxy private key with no deployment privileges."}),NEXT_PUBLIC_API_URL:c({default:"https://localhost:4000",public:!0,purpose:"Legacy build-time Control API URL; must never contain a secret."}),HIVE_OAUTH_DISCOVERY_URL:c({optional:!0,purpose:"Hive OAuth discovery URL for optional named dashboard login; HTTPS required."}),HIVE_OAUTH_CLIENT_ID:b({optional:!0,purpose:"Registered Magnus dashboard OAuth client ID."}),HIVE_OAUTH_CLIENT_SECRET:b({optional:!0,sensitive:!0,purpose:"OAuth client secret, kept server-side. Required when the client is registered as confidential; leave unset for a public PKCE client."}),HIVE_OAUTH_ISSUER:c({optional:!0,purpose:"Exact trusted Hive access-token issuer."}),HIVE_OAUTH_API_AUDIENCE:b({optional:!0,purpose:"Exact access-token audience accepted by the Control API."}),HIVE_OAUTH_SCOPE:b({default:"openid profile email",purpose:"Registered named-user OAuth scopes."}),HIVE_ROUTER_ADMIN_URL:c({optional:!0,purpose:"Deprecated: admin plane of an Emberpath (formerly Hive Router) release that still bundles an admin UI; enables the embedded router dashboard proxy."}),HIVE_ROUTER_CA_PATH:d({optional:!0,purpose:"Optional private CA bundle for hostname-verified TLS to HIVE_ROUTER_ADMIN_URL."}),MAGNUS_SECURITY_CONSOLE_URL:c({optional:!0,purpose:"Optional external security console; enables the Security pages and nav entry."}),MAGNUS_HERMES_ENABLED:b({default:"false",enum:["true","false"],purpose:"Enables the optional Hermes Agent pages, dashboard proxy and WebSocket bridge."}),PORT:e({default:3e3,minimum:1,purpose:"Listen port for magnus-ui start."}),HOST:b({default:"0.0.0.0",purpose:"Listen address for magnus-ui start."}),TLS_CERT_PATH:d({optional:!0,requirement:"Required unless MAGNUS_UI_ALLOW_HTTP=true",purpose:"PEM certificate served by magnus-ui start."}),TLS_KEY_PATH:d({optional:!0,requirement:"Required unless MAGNUS_UI_ALLOW_HTTP=true",purpose:"PEM private key for TLS_CERT_PATH."}),MAGNUS_UI_DATA_DIR:d({optional:!0,purpose:"Working directory for runtime state (.magnus/, terminal-audit/); magnus-ui start defaults it to the current directory."}),UI_SECURITY_LOG_PATH:d({default:".magnus/security-events.jsonl",purpose:"Append-only authentication audit log; login fails closed when it cannot be written."}),MAGNUS_UI_ALLOW_HTTP:b({default:"false",enum:["true","false"],purpose:"Serve plain HTTP when no TLS certificate is configured (local development or behind a TLS proxy only)."})});function g(a,b){throw Error(`${a} ${b}`)}a.s(["f",0,function(a,b=process.env){let c=f[a];c||g(a,"is not declared in the dashboard environment schema");let d=b[a]?.trim()||c.default;if(null==d||""===d){c.required&&g(a,"is required");return}if(c.enum&&!c.enum.includes(String(d))&&g(a,`must be one of: ${c.enum.join(", ")}`),"integer"===c.type){let b=Number(d);return(!Number.isSafeInteger(b)||b<(c.minimum??Number.MIN_SAFE_INTEGER))&&g(a,`must be an integer of at least ${c.minimum}`),b}if("url"===c.type)try{return new URL(String(d)).toString().replace(/\/$/,"")}catch{g(a,"must be an absolute URL")}return"path"===c.type&&String(d).includes("\0")&&g(a,"must not contain NUL bytes"),"string"===c.type&&c.minimumLength&&String(d).length<c.minimumLength&&g(a,`must contain at least ${c.minimumLength} characters`),String(d)}])}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=apps_dashboard_runtime-environment_mjs_11tpywm9_soif._.js.map
|
package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_0gs_s688kgg1i._.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[3319,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(8897);a.i(46997),Date.now();var e=a.i(26926),f=a.i(62190),g=a.i(65802),h=a.i(74290);function i({children:a,...d}){let e=(0,c.useContext)(g.f);(d={...e,...d}).transition=(0,f.f)(d.transition,e.transition),d.isStatic=(0,h.f)(()=>d.isStatic);let j=(0,c.useMemo)(()=>d,[JSON.stringify(d.transition),d.transformPagePoint,d.reducedMotion,d.skipAnimations,d.isValidProp]);return(0,b.jsx)(g.f.Provider,{value:j,children:a})}var j=a.i(73140);a.s(["Providers",0,function({children:a}){return(0,c.useEffect)(()=>((0,j.P)(),()=>{}),[]),(0,b.jsx)(i,{reducedMotion:"user",children:(0,b.jsx)(e.N,{children:(0,b.jsx)(d.v,{children:a})})})}],3319)},12737,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(38246),f=a.i(8387),g=a.i(89027),h=a.i(41476),i=a.i(3512),j=a.i(52562),k=a.i(8897),l=a.i(85264),m=a.i(5334),n=a.i(57547);function o({status:a}){let c="online"===a?"Online":"offline"===a?"Offline":"Checking…";return(0,b.jsx)("span",{role:"status","aria-label":c,className:`inline-block h-2 w-2 shrink-0 rounded-full ${"online"===a?"bg-success":"offline"===a?"bg-danger":"bg-text-muted/40 animate-pulse"}`,title:c})}function p(){let{nodes:a,activeNode:d,switchNode:e,loading:f}=(0,k.l)(),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(!1),v=(0,c.useRef)(null),[w,x]=(0,c.useState)({}),y=(0,c.useRef)(null),z=(0,c.useMemo)(()=>a.length>0?a:[m.f],[a]),A=(0,c.useCallback)(async()=>{let a={};await Promise.allSettled(z.map(async b=>{try{let c=(0,n.L)(b.url),d=await fetch("/api/proxy/health",{method:"GET",headers:c,signal:AbortSignal.timeout(6e3)});a[b.id]=d.ok?"online":"offline"}catch{a[b.id]="offline"}})),x(a)},[z]);return((0,c.useEffect)(()=>{A()},[A]),(0,c.useEffect)(()=>{if(p)return A(),y.current=setInterval(()=>void A(),3e4),()=>{y.current&&clearInterval(y.current)}},[p,A]),(0,c.useEffect)(()=>{if(p)return document.addEventListener("mousedown",a),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",b)};function a(a){v.current&&!v.current.contains(a.target)&&q(!1)}function b(a){"Escape"===a.key&&q(!1)}},[p]),f)?(0,b.jsx)("div",{className:"mx-3 mt-2 mb-1 rounded border border-border bg-bg px-3 py-2 text-xs text-text-muted animate-pulse",children:"Loading…"}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"relative mx-3 mt-2 mb-1",ref:v,children:[(0,b.jsx)("div",{className:"mb-1 px-0.5 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Node Controller"}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)("button",{onClick:()=>q(!p),"aria-expanded":p,"aria-haspopup":"listbox","aria-label":`Node controller: ${d.name}`,className:"flex flex-1 items-center gap-2 rounded border border-border bg-bg px-2.5 py-1.5 text-left transition-all hover:bg-surface-hover min-w-0",children:[(0,b.jsx)(o,{status:w[d.id]??"unknown"}),(0,b.jsx)("span",{className:"flex-1 truncate text-xs font-medium",children:d.name}),(0,b.jsx)(g.f,{className:`h-3.5 w-3.5 shrink-0 text-text-muted transition-transform ${p?"rotate-180":""}`})]}),(0,b.jsx)("button",{onClick:function(){u(!1),s(!0)},className:"rounded border border-border bg-bg p-1.5 text-text-muted transition-all hover:bg-surface-hover hover:text-text",title:"Control Node Settings",children:(0,b.jsx)(h.f,{className:"h-3.5 w-3.5"})})]}),p&&(0,b.jsxs)("div",{className:"absolute left-3 right-3 z-50 mt-1 rounded border border-border bg-surface shadow-xl",children:[(0,b.jsx)("div",{role:"listbox","aria-label":"Control nodes",className:"max-h-48 overflow-y-auto py-1",children:z.map(a=>(0,b.jsxs)("button",{role:"option","aria-selected":a.id===d.id,onClick:()=>{e(a.id),q(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-all hover:bg-surface-hover",children:[(0,b.jsx)(o,{status:w[a.id]??"unknown"}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:"font-medium truncate",children:a.name}),(0,b.jsx)("div",{className:"text-text-muted truncate text-[10px]",children:a.url})]}),a.id===d.id&&(0,b.jsx)(j.f,{className:"h-3.5 w-3.5 shrink-0 text-primary"})]},a.id))}),(0,b.jsx)("div",{className:"border-t border-border",children:(0,b.jsxs)("button",{onClick:function(){q(!1),u(!0),s(!0)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-primary transition-all hover:bg-surface-hover",children:[(0,b.jsx)(i.f,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{className:"font-bold",children:"Add Control Node"})]})})]})]}),(0,b.jsx)(l.f,{open:r,onClose:()=>s(!1),createMode:t})]})}var q=a.i(31289),r=a.i(64831);let s={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"}]]};s.node;let t=(0,r.f)(s);var u=a.i(34532),v=a.i(57307),w=a.i(8311),x=a.i(83138);let y={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"}]]};y.node;let z=(0,r.f)(y);var A=a.i(14258),B=a.i(82260),C=a.i(85888),D=a.i(35173),E=a.i(11715),F=a.i(87529),G=a.i(92378);let H={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"}]]};H.node;let I=(0,r.f)(H);var J=a.i(18688);let K={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"}]]};K.node;let L=(0,r.f)(K);var M=a.i(75027);let N={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"}]]};N.node;let O=(0,r.f)(N),P={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"]};P.node;let Q=(0,r.f)(P);var R=a.i(27061);let S={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"}]]};S.node;let T=(0,r.f)(S),U={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"}]]};U.node;let V=(0,r.f)(U),W={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"]};W.node;let X=(0,r.f)(W);var Y=a.i(36273);let Z={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"}]]};Z.node;let $=(0,r.f)(Z);var _=a.i(17770),aa=a.i(26766),ab=a.i(69942),ac=a.i(6024);let ad=[{id:"fleet",label:"Fleet",tone:"primary",items:[{href:"/mission-control",label:"Mission Control",icon:L},{href:"/",label:"Overview",icon:t,exact:!0},{href:"/nodes",label:"Nodes",icon:u.f},{href:"/application-operations",label:"Applications",icon:O},{href:"/fleet-readiness",label:"Readiness",icon:ac.f},{href:"/fleet-timeline",label:"Timeline",icon:Q},{href:"/fleet-map",label:"Fleet Map",icon:I},{href:"/commands",label:"Commands",icon:v.f},{href:"/anomalies",label:"Anomalies",icon:D.f},{href:"/anomalies/remediation",label:"Remediation",icon:G.f},{href:"/governor/operations",label:"Operations",icon:E.f},{href:"/rollouts",label:"Rollouts",icon:V},{href:"/incidents",label:"Incidents",icon:X},{href:"/cron",label:"Cron Jobs",icon:w.f},{href:"/files",label:"Files",icon:x.f},{href:"/logs",label:"Logs",icon:z},{href:"/audit",label:"Audit",icon:A.f},{href:"/webhooks",label:"Webhooks",icon:F.f},{href:"/retention",label:"Retention",icon:R.f},{href:"/api-docs",label:"API Docs",icon:J.f}]},{id:"security",label:"Security",tone:"primary",integration:"securityConsole",items:[{href:"/security-fusion",label:"Fleet summary",icon:$,exact:!0}]},{id:"hermes",label:"Hermes Agent",tone:"accent",integration:"hermes",items:[{href:"/orchestra",label:"Overview",icon:B.f,exact:!0},{href:"/orchestra/installations",label:"Installations",icon:u.f},{href:"/orchestra/profiles",label:"Profiles",icon:C.f},{href:"/hermes-drift",label:"Drift Cockpit",icon:T},{href:"/hermes-security",label:"Proxy Security",icon:Y.f},{href:"/orchestra/web-gateway",label:"Web Gateway",icon:M.f}]},{id:"ardent",label:"Magnus Ardent",tone:"primary",items:[{href:"/ardent",label:"Overview",icon:ab.f,exact:!0},{href:"/ardent/installations",label:"Installations",icon:u.f},{href:"/ardent/profiles",label:"Profiles",icon:C.f}]},{id:"codex",label:"Codex Agent",tone:"primary",items:[{href:"/codex",label:"Overview",icon:_.f,exact:!0},{href:"/codex/installations",label:"Installations",icon:aa.f}]}],ae={"/":"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 af(a,b,c=!1){return"/"===b||c?a===b:a===b||a.startsWith(`${b}/`)}function ag(a){let b=null;for(let c of ad)for(let d of c.items)!d.external&&af(a,d.href,d.exact)&&(null===b||d.href.length>b.length)&&(b=d.href);return b}var ah=a.i(33643);let ai={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 aj({group:a,activeHref:c}){let d="accent"===a.tone;return(0,b.jsxs)(b.Fragment,{children:["fleet"!==a.id&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"mx-3 my-1",children:(0,b.jsx)("div",{className:(0,f.f)("h-px bg-gradient-to-r to-transparent",ai[a.id])})}),(0,b.jsx)("div",{className:"px-4 pb-0.5 pt-2",children:(0,b.jsx)("span",{className:(0,f.f)("text-[9px] font-bold uppercase tracking-[0.25em]",d?"text-accent/60":"text-primary/60"),children:a.label})})]}),(0,b.jsx)("nav",{className:(0,f.f)("space-y-0.5 p-3","fleet"!==a.id&&"pt-1"),"aria-label":a.label,children:a.items.map(a=>{let g=a.href===c,h=a.icon;return(0,b.jsxs)(e.default,{href:a.href,prefetch:!1,target:a.external?"_blank":void 0,rel:a.external?"noopener noreferrer":void 0,"aria-current":g?"page":void 0,className:(0,f.f)("group relative flex items-center gap-3 overflow-hidden rounded-chip px-3 py-2 text-xs uppercase tracking-wider transition-colors duration-200","before:pointer-events-none before:absolute before:inset-y-0 before:-left-1/2 before:w-1/2 before:-skew-x-12 before:bg-gradient-to-r before:from-transparent before:to-transparent before:opacity-0 before:transition-[left,opacity] before:duration-500 hover:before:left-full hover:before:opacity-100",d?"before:via-accent/10":"before:via-primary/10",g?(0,f.f)(d?"text-accent":"text-primary",d?"bg-accent/5":"bg-primary/5"):(0,f.f)("text-text-muted",d?"hover:text-accent":"hover:text-primary")),children:[g&&(0,b.jsx)(q.f.span,{layoutId:"sidebar-indicator",className:(0,f.f)("absolute bottom-1 left-0 top-1 w-0.5 rounded-full",d?"bg-accent":"bg-primary"),style:{boxShadow:d?"0 0 8px var(--color-accent), 0 0 16px var(--color-glow-accent)":"0 0 8px var(--color-primary), 0 0 16px var(--color-glow)"},transition:{type:"spring",stiffness:300,damping:30}}),(0,b.jsx)(h,{className:"relative h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"relative truncate",children:a.label})]},a.href)})})]})}function ak(){return(0,b.jsxs)("div",{className:"relative flex h-8 w-8 items-center justify-center animate-flicker",children:[(0,b.jsxs)("svg",{viewBox:"0 0 32 32",className:"h-8 w-8 overflow-visible","aria-hidden":"true",children:[(0,b.jsx)("rect",{x:"1",y:"1",width:"30",height:"30",rx:"4",fill:"none",stroke:"var(--color-primary)",strokeOpacity:"0.35"}),(0,b.jsx)("path",{d:"M8 23 V9 L16 18 L24 9 V23",fill:"none",stroke:"var(--color-primary)",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",pathLength:100,style:{"--stroke-length":100,strokeDasharray:100,animation:"draw-stroke 1.4s var(--ease-out-expo) both"},className:"drop-shadow-[0_0_4px_var(--color-primary)]"})]}),(0,b.jsx)("div",{className:"absolute inset-0 rounded shadow-[0_0_12px_var(--color-glow)]"})]})}function al(){let{connected:a}=(0,c.useSyncExternalStore)(ah.f.subscribe,ah.f.getSnapshot,ah.f.getServerSnapshot);return(0,b.jsxs)("span",{className:"flex items-center gap-1.5",title:a?"Live event stream connected":"Live event stream reconnecting",children:[(0,b.jsxs)("span",{className:"relative inline-flex h-1.5 w-1.5",children:[a&&(0,b.jsx)("span",{className:"absolute inset-0 rounded-full bg-success animate-halo"}),(0,b.jsx)("span",{className:(0,f.f)("relative inline-flex h-1.5 w-1.5 rounded-full",a?"bg-success shadow-[0_0_6px_var(--color-success)]":"bg-warning")})]}),(0,b.jsx)("span",{className:a?"text-success/70":"text-warning/70",children:a?"Live":"Offline"})]})}function am({integrations:a}){let e=ag((0,d.usePathname)()),f=(0,c.useMemo)(()=>(function(a,b=ad){return b.filter(b=>{var c;return!b.integration||(c=b.integration,"securityConsole"===c?null!==a.securityConsoleUrl:a.hermes)}).map(b=>"security"===b.id&&a.securityConsoleUrl?{...b,items:[{href:a.securityConsoleUrl,label:"Security console ↗",icon:$,external:!0},...b.items]}:b)})(a),[a]);return(0,b.jsxs)("aside",{className:"relative flex h-full w-56 flex-col border-r border-border/50 bg-bg",children:[(0,b.jsx)("div",{className:"absolute bottom-0 right-0 top-0 w-px bg-gradient-to-b from-primary/60 via-primary/20 to-transparent"}),(0,b.jsxs)("div",{className:"flex h-14 items-center gap-3 border-b border-border/30 px-4",children:[(0,b.jsx)(ak,{}),(0,b.jsx)("span",{className:"text-sm font-bold uppercase tracking-[0.2em] text-text",children:"Magnus"})]}),(0,b.jsx)(p,{}),(0,b.jsx)("div",{className:"flex-1 overflow-y-auto",children:f.map(a=>(0,b.jsx)(aj,{group:a,activeHref:e},a.id))}),(0,b.jsxs)("div",{className:"flex items-center justify-between border-t border-border/30 p-4 text-[10px] uppercase tracking-widest text-primary/40",children:[(0,b.jsxs)("span",{children:["Magnus v","3.5.1"]}),(0,b.jsx)(al,{})]})]})}var an=a.i(57230),ao=a.i(19783);let ap={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};ap.node;let aq=(0,r.f)(ap);var ar=a.i(33540),as=a.i(41146);let at={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"}]]};at.node;let au=(0,r.f)(at),av={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"}]]};av.node;let aw=(0,r.f)(av);var ax=a.i(68579),ay=a.i(21327),az=a.i(52357),aA=a.i(99101),aB=a.i(42973),aC=a.i(46997);function aD(){let[a,d]=(0,c.useState)(!1),[g,i]=(0,c.useState)([]),[k,l]=(0,c.useState)(0),[m,n]=(0,c.useState)(!1),o=(0,c.useRef)(null),p=(0,c.useCallback)(async()=>{try{let a=await aC.f.notifications.unreadCount();a.success&&a.data&&l(a.data.count)}catch{}},[]),q=(0,c.useCallback)(async()=>{n(!0);try{let a=await aC.f.notifications.list({pageSize:20});if(a.success&&a.data){let b=a.data;i(b.notifications)}}catch{}finally{n(!1)}},[]);(0,c.useEffect)(()=>{p();let a=setInterval(()=>void p(),15e3);return()=>clearInterval(a)},[p]),(0,c.useEffect)(()=>{a&&q()},[a,q]),(0,c.useEffect)(()=>{if(!a)return;let b=a=>{o.current&&!o.current.contains(a.target)&&d(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[a]),(0,c.useEffect)(()=>{if(!a)return;let b=a=>{"Escape"===a.key&&d(!1)};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[a]);let r=async a=>{try{await aC.f.notifications.markRead([a]),i(b=>b.map(b=>b.id===a?{...b,isRead:!0}:b)),l(a=>Math.max(0,a-1))}catch{}},s=async()=>{try{await aC.f.notifications.markAllRead(),i(a=>a.map(a=>({...a,isRead:!0}))),l(0),setTimeout(()=>void p(),500)}catch{}};return(0,b.jsxs)("div",{className:"relative",ref:o,children:[(0,b.jsxs)("button",{className:"relative rounded p-2 text-text-muted transition-all hover:bg-surface-hover hover:text-text",title:"Notifications",type:"button","aria-expanded":a,"aria-controls":"notification-panel","aria-label":k>0?`Notifications (${k} unread)`:"Notifications",onClick:()=>d(a=>!a),children:[(0,b.jsx)(au,{className:"h-4 w-4"}),k>0&&(0,b.jsx)("span",{className:"absolute right-1 top-1 flex h-4 min-w-[1rem] items-center justify-center rounded-full bg-danger px-1 text-[10px] font-bold text-white",children:k>99?"99+":k})]}),a&&(0,b.jsxs)("div",{id:"notification-panel",role:"region","aria-label":"Notifications",className:"absolute right-0 top-full z-50 mt-2 w-96 overflow-hidden rounded border border-border bg-surface shadow-2xl",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[(0,b.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider text-text",children:"Notifications"}),k>0&&(0,b.jsxs)("button",{className:"flex items-center gap-1 rounded px-2 py-1 text-xs text-primary hover:bg-primary/10 transition-all",onClick:()=>void s(),type:"button",children:[(0,b.jsx)(aw,{className:"h-3 w-3"}),"Mark all read"]})]}),(0,b.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[m&&0===g.length&&(0,b.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,b.jsx)("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-primary border-t-transparent"})}),!m&&0===g.length&&(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-10 text-text-muted",children:[(0,b.jsx)(au,{className:"mb-2 h-8 w-8 opacity-40"}),(0,b.jsx)("p",{className:"text-xs",children:"No notifications yet"})]}),g.map(a=>(0,b.jsxs)("div",{className:(0,f.f)("group flex items-start gap-3 border-b border-border/50 px-4 py-3 transition-all hover:bg-surface-hover",!a.isRead&&"bg-primary/5"),children:[(0,b.jsx)("div",{className:"mt-0.5 shrink-0",children:function(a){switch(a){case"critical":return(0,b.jsx)(ay.f,{className:"h-4 w-4 text-danger"});case"warning":return(0,b.jsx)(ax.f,{className:"h-4 w-4 text-warning"});default:return(0,b.jsx)(az.f,{className:"h-4 w-4 text-primary"})}}(a.severity)}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[function(a){switch(a){case"node.offline":return(0,b.jsx)(u.f,{className:"h-3.5 w-3.5 text-danger"});case"node.degraded":case"node.upgrade_not_ready":return(0,b.jsx)(u.f,{className:"h-3.5 w-3.5 text-warning"});case"node.recovered":return(0,b.jsx)(O,{className:"h-3.5 w-3.5 text-success"});case"command.failed":return(0,b.jsx)(v.f,{className:"h-3.5 w-3.5 text-warning"});case"deploy.failed":return(0,b.jsx)(aA.f,{className:"h-3.5 w-3.5 text-danger"});case"upgrade.failed":return(0,b.jsx)(aB.f,{className:"h-3.5 w-3.5 text-danger"});default:return(0,b.jsx)(au,{className:"h-3.5 w-3.5 text-text-muted"})}}(a.type),(0,b.jsx)("span",{className:(0,f.f)("text-xs font-bold",a.isRead?"text-text-muted":"text-text"),children:a.title})]}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-text-muted line-clamp-2",children:a.message}),(0,b.jsx)("span",{className:"mt-1 block text-[10px] text-text-muted/60",children:function(a){let b=Math.floor((Date.now()-new Date(a).getTime())/1e3);if(b<60)return"just now";let c=Math.floor(b/60);if(c<60)return`${c}m ago`;let d=Math.floor(c/60);if(d<24)return`${d}h ago`;let e=Math.floor(d/24);return`${e}d ago`}(a.createdAt)})]}),!a.isRead&&(0,b.jsx)("button",{className:"mt-0.5 shrink-0 rounded p-1 text-text-muted opacity-0 transition-all hover:bg-surface-hover hover:text-primary group-hover:opacity-100",title:"Mark as read",type:"button",onClick:()=>void r(a.id),children:(0,b.jsx)(j.f,{className:"h-3.5 w-3.5"})})]},a.id))]}),(0,b.jsx)("div",{className:"border-t border-border px-4 py-2 flex justify-end",children:(0,b.jsxs)(e.default,{href:"/notifications",className:"flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",onClick:()=>d(!1),children:[(0,b.jsx)(h.f,{className:"h-3 w-3"}),"Preferences"]})})]})]})}var aE=a.i(62260);let aF=[{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 aG(){return"u">typeof navigator&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘":"Ctrl"}function aH(){document.body.dispatchEvent(new KeyboardEvent("keydown",{key:"k",ctrlKey:!0,metaKey:!0,bubbles:!0}))}function aI({onMenuToggle:a}){let f=(0,d.usePathname)(),g=(0,d.useRouter)(),{title:h,crumbs:i}=function(a){let b=null;for(let c of Object.keys(ae))af(a,c)&&(null===b||c.length>b.length)&&(b=c);let c=b?ae[b]:"Magnus",d=ag(a),e=d?ad.find(a=>a.items.some(a=>a.href===d))?.label??null:null,f=[];if(e&&f.push({label:e}),f.push({label:c,href:b??void 0}),b&&a!==b)for(let c of a.slice("/"===b?1:b.length+1).split("/").filter(Boolean)){let a=decodeURIComponent(c);f.push({label:a.length>18?`${a.slice(0,8)}…${a.slice(-6)}`:a})}return{title:c,group:e,crumbs:f}}(f),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)("Ctrl"),p=(0,c.useRef)(null);async function q(a=!1){let b=await fetch(`/api/auth/logout${a?"?all=true":""}`,{method:"POST"}).catch(()=>null);b?.ok?(g.push("/login"),g.refresh()):window.alert("Session revocation unavailable; retry sign out.")}return(0,c.useEffect)(()=>{o(aG()),fetch("/api/auth/me").then(a=>a.ok?a.json():null).then(a=>{a?.username&&k(a.username)}).catch(()=>{})},[]),(0,c.useEffect)(()=>{if(!l)return;let a=a=>{(a instanceof KeyboardEvent?"Escape"!==a.key:p.current?.contains(a.target))||m(!1)};return document.addEventListener("mousedown",a),document.addEventListener("keydown",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",a)}},[l]),(0,b.jsxs)("header",{className:"relative z-(--z-shell) flex h-14 items-center justify-between gap-3 bg-bg/80 px-3 backdrop-blur-sm sm:px-6",children:[(0,b.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-primary/60 via-accent/40 to-transparent"}),(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-2 text-xs uppercase tracking-[0.15em] text-text-muted",children:[a&&(0,b.jsx)("button",{className:"mr-1 rounded p-1.5 text-text-muted hover:text-primary md:hidden",onClick:a,type:"button",title:"Toggle menu",children:(0,b.jsx)(aq,{className:"h-5 w-5"})}),(0,b.jsx)("span",{className:"text-primary/60",children:">_"}),(0,b.jsx)("nav",{"aria-label":"Breadcrumb",className:"hidden min-w-0 items-center gap-1 sm:flex",children:i.map((a,c)=>{let d=c===i.length-1;return(0,b.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[c>0&&(0,b.jsx)(as.f,{className:"h-3 w-3 shrink-0 text-primary/30","aria-hidden":"true"}),a.href&&!d?(0,b.jsx)(e.default,{href:a.href,prefetch:!1,className:"truncate transition-colors hover:text-primary",children:a.label}):(0,b.jsx)("span",{className:d?"truncate text-text":0===c&&i.length>1?"truncate text-text-muted/60":"truncate","aria-current":d?"page":void 0,children:a.label})]},`${a.label}-${c}`)})}),(0,b.jsx)("span",{className:"sr-only sm:hidden",children:h}),(0,b.jsx)("span",{className:"ml-1 hidden h-3.5 w-1.5 shrink-0 bg-primary/80 sm:inline-block",style:{animation:"cursor-blink 1s step-end infinite"}})]}),(0,b.jsx)(aE.J,{className:"hidden max-w-xl flex-1 lg:block"}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-1 sm:gap-2",children:[(0,b.jsxs)("button",{type:"button",onClick:aH,className:"hidden items-center gap-2 rounded-chip border border-border bg-surface px-2.5 py-1.5 text-[10px] uppercase tracking-wider text-text-muted transition-colors hover:border-primary/40 hover:text-primary md:flex",title:"Search and jump (command palette)",children:[(0,b.jsx)(ar.f,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:"Search"}),(0,b.jsxs)("kbd",{className:"rounded-chip border border-border bg-bg px-1 text-[9px] text-primary/70",children:[n,"+K"]})]}),(0,b.jsx)("button",{className:"rounded p-2 text-text-muted transition-all hover:text-primary hover:drop-shadow-[0_0_6px_var(--color-glow)]",title:"Refresh",onClick:()=>window.location.reload(),type:"button",children:(0,b.jsx)(ao.f,{className:"h-4 w-4"})}),(0,b.jsx)(aD,{}),(0,b.jsx)("button",{className:"rounded p-2 text-text-muted transition-all hover:text-danger hover:drop-shadow-[0_0_6px_rgba(255,23,68,0.3)]",title:"Sign Out",onClick:()=>void q(),type:"button",children:(0,b.jsx)(an.f,{className:"h-4 w-4"})}),(0,b.jsxs)("div",{ref:p,className:"relative ml-1",children:[(0,b.jsx)("button",{type:"button",onClick:()=>m(a=>!a),"aria-haspopup":"menu","aria-expanded":l,title:j?`Signed in as ${j}`:"Account",className:"flex h-8 w-8 items-center justify-center rounded border border-accent/40 text-[10px] font-bold uppercase text-accent shadow-[0_0_8px_var(--color-glow-accent)] transition-colors hover:border-accent hover:bg-accent/10",children:j?.[0]??"U"}),l&&(0,b.jsxs)("div",{role:"menu",className:"panel-corners absolute right-0 top-full z-(--z-modal) mt-2 w-60 rounded-panel border border-accent/30 bg-surface/95 p-1 shadow-[0_0_24px_var(--color-glow-accent)] backdrop-blur-sm [--panel-corner-color:var(--color-accent)]",children:[j&&(0,b.jsxs)("div",{className:"border-b border-border px-3 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:["Signed in as ",(0,b.jsx)("span",{className:"text-accent",children:j})]}),(0,b.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>void q(),className:"flex w-full items-center gap-2 rounded-chip px-3 py-2 text-left text-xs text-text-muted transition-colors hover:bg-surface-hover hover:text-text",children:[(0,b.jsx)(an.f,{className:"h-3.5 w-3.5"})," Sign out"]}),(0,b.jsxs)("button",{type:"button",role:"menuitem","aria-label":"Sign out all local sessions",onClick:()=>void q(!0),className:"flex w-full items-center gap-2 rounded-chip px-3 py-2 text-left text-xs text-text-muted transition-colors hover:bg-danger/10 hover:text-danger",children:[(0,b.jsx)(an.f,{className:"h-3.5 w-3.5"})," Sign out all local sessions"]})]})]})]})]})}async function aJ(a,b){try{let c=await fetch(a,{signal:b,headers:{accept:"application/json"}});if(!c.ok)return null;return await c.json()}catch{return null}}function aK(a,b){return a.trim()?b.map(b=>({e:b,s:function(a,b){if(!a)return 0;let c=a.toLowerCase(),d=b.toLowerCase(),e=d.indexOf(c);if(-1!==e)return e;let f=0,g=0;for(let a of c){let b=d.indexOf(a,f);if(-1===b)return -1;g+=b-f,f=b+1}return 1e3+g}(a,`${b.label} ${b.sublabel??""}`)})).filter(({s:a})=>a>=0).sort((a,b)=>a.s-b.s).map(({e:a})=>a):b}async function aL(a,b={}){let{signal:c,limit:d=10}=b;if(a.trim().length<2)return[];let[e,f,g]=await Promise.all([aJ("/api/proxy/nodes",c),aJ("/api/proxy/orchestra/installations",c),aJ("/api/proxy/orchestra/skill-catalog",c)]),h=[];for(let a of e?.data??[])h.push({kind:"node",id:a.id,label:a.name,sublabel:a.status?`Node \xb7 ${a.status}`:"Node",href:`/nodes/${a.id}`});for(let a of f?.data??[])h.push({kind:"installation",id:a.id,label:a.displayName??a.hostname,sublabel:`Hermes \xb7 ${a.status??"unknown"}`,href:"/orchestra/installations"});for(let a of g?.data??[])h.push({kind:"skill",id:a.id,label:a.name,sublabel:a.description??"Skill",href:"/skills"});return aK(a,[{kind:"action",id:"deploy-agent",label:"Deploy agent to host",sublabel:"Action · Operations",href:"/governor/operations"},{kind:"action",id:"open-terminal",label:"Open node terminal",sublabel:"Action · Nodes",href:"/nodes"},{kind:"action",id:"run-fleet-check",label:"Run fleet check",sublabel:"Action · Fleet readiness",href:"/fleet-readiness"},{kind:"action",id:"view-stale-nodes",label:"View stale nodes",sublabel:"Action · Readiness",href:"/fleet-readiness"},{kind:"action",id:"rotate-node-secret",label:"Rotate node secret",sublabel:"Action · Operations",href:"/governor/operations"},{kind:"action",id:"latest-failed-deploy",label:"Open latest failed deploy",sublabel:"Action · Timeline",href:"/fleet-timeline"},...h]).slice(0,d)}var aM=a.i(18783),aN=a.i(50354),aO=a.i(74849);let aP={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"}]]};aP.node;let aQ=(0,r.f)(aP);var aR=a.i(74215);let aS={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"}]]};aS.node;let aT=(0,r.f)(aS);var aU=a.i(75160),aV=a.i(86708),aW=a.i(73140);let aX={"/":t,"/mission-control":L,"/nodes":u.f,"/commands":v.f,"/cron":w.f,"/files":x.f,"/skills":aN.f,"/logs":z,"/audit":A.f,"/library":aO.f},aY={node:u.f,installation:B.f,skill:aN.f,action:aM.f};function aZ(){let[a,e]=(0,c.useState)(!1),[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(0),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)("normal"),r=(0,c.useRef)(null),s=(0,d.useRouter)(),t=(0,c.useRef)([]),u=(0,c.useRef)(void 0),v=(0,c.useRef)(void 0),w=(0,c.useRef)(null),x=(f.trim()?aF.filter(a=>a.label.toLowerCase().includes(f.toLowerCase())||a.description.toLowerCase().includes(f.toLowerCase())):aF).map(a=>({kind:"shortcut",key:`s:${a.keys.join("-")}`,shortcut:a})),y=aK(f,l).map(a=>({kind:"entity",key:`e:${a.kind}:${a.id}`,entity:a})),z=f.trim()?[...y,...x]:x;(0,c.useEffect)(()=>{if(!a)return;let b=f.trim();if(b.length<2){m([]),o(!1);return}v.current&&clearTimeout(v.current),w.current&&w.current.abort();let c=new AbortController;return w.current=c,o(!0),v.current=setTimeout(async()=>{let a=await aL(b,{signal:c.signal,limit:12});c.signal.aborted||(m(a),o(!1))},180),()=>{c.abort(),v.current&&clearTimeout(v.current)}},[f,a]);let A=(0,c.useCallback)(a=>{"navigate"===a.action&&a.target?(s.push(a.target),e(!1),g("")):"show-shortcuts"===a.target&&(k(!0),e(!1),g(""))},[s]),B=(0,c.useCallback)(a=>{"shortcut"===a.kind?A(a.shortcut):(s.push(a.entity.href),e(!1),g(""))},[A,s]);return((0,c.useEffect)(()=>{let b=b=>{let c=b.target,d="INPUT"===c.tagName||"TEXTAREA"===c.tagName||c.isContentEditable;if((b.metaKey||b.ctrlKey)&&"k"===b.key.toLowerCase()){b.preventDefault(),b.stopPropagation(),b.stopImmediatePropagation(),e(a=>!a);return}if("Escape"===b.key){if(a){e(!1),g("");return}return j?void k(!1):void 0}if(!d){if("?"===b.key){b.preventDefault(),k(a=>!a);return}if(1===b.key.length&&!b.metaKey&&!b.ctrlKey&&!b.altKey){for(let a of(clearTimeout(u.current),t.current.push(b.key.toLowerCase()),aF))if(a.keys.length===t.current.length&&a.keys.every((a,b)=>a===t.current[b])){b.preventDefault(),t.current=[],A(a);return}u.current=setTimeout(()=>{t.current=[]},800)}}};return window.addEventListener("keydown",b,!0),()=>window.removeEventListener("keydown",b,!0)},[a,j,A]),(0,c.useEffect)(()=>{a&&(i(0),setTimeout(()=>r.current?.focus(),50))},[a]),(0,c.useEffect)(()=>{h>=z.length&&i(Math.max(0,z.length-1))},[z.length,h]),(0,c.useEffect)(()=>{a&&q("low"===document.documentElement.dataset.fx?"low":"normal")},[a]),a||j)?(0,b.jsxs)(b.Fragment,{children:[a&&(0,b.jsxs)("div",{className:"fixed inset-0 z-(--z-modal) flex items-start justify-center pt-[15vh]","data-testid":"command-palette",children:[(0,b.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-[2px]",onClick:()=>{e(!1),g("")}}),(0,b.jsxs)("div",{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,b.jsxs)("div",{className:"flex items-center gap-3 border-b border-border px-4 py-3",children:[(0,b.jsx)(ar.f,{className:"h-5 w-5 text-primary"}),(0,b.jsx)("input",{ref:r,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:f,onChange:a=>{g(a.target.value),i(0)},onKeyDown:a=>{"ArrowDown"===a.key?(a.preventDefault(),i(a=>Math.min(a+1,z.length-1))):"ArrowUp"===a.key?(a.preventDefault(),i(a=>Math.max(a-1,0))):"Enter"===a.key&&z[h]&&(a.preventDefault(),B(z[h]))},"data-testid":"command-palette-input"}),n?(0,b.jsx)(aU.f,{className:"h-4 w-4 animate-spin text-primary"}):(0,b.jsx)("kbd",{className:"rounded-chip border border-border bg-bg px-1.5 py-0.5 text-[10px] text-text-muted",children:"ESC"})]}),(0,b.jsxs)("div",{className:"max-h-96 overflow-y-auto py-2",children:[0===z.length&&!n&&(0,b.jsx)("p",{className:"px-4 py-6 text-center text-xs uppercase tracking-wider text-text-muted",children:"No results found"}),0===z.length&&n&&(0,b.jsx)("p",{className:"px-4 py-6 text-center text-xs uppercase tracking-wider text-text-muted",children:"Searching…"}),z.map((a,c)=>{let d=c===h;if("shortcut"===a.kind){let e=aX[a.shortcut.target??""]??aM.f;return(0,b.jsxs)("button",{className:`flex w-full items-center gap-3 px-4 py-2 text-left text-sm transition-colors ${d?"bg-primary/10 text-primary shadow-[inset_2px_0_0_var(--color-primary)]":"text-text hover:bg-surface-hover"}`,onClick:()=>B(a),onMouseEnter:()=>i(c),"data-testid":"command-palette-item","data-item-kind":"shortcut",children:[(0,b.jsx)(e,{className:"h-4 w-4 shrink-0 opacity-70"}),(0,b.jsx)("span",{className:"flex-1",children:a.shortcut.label}),(0,b.jsx)("span",{className:"text-xs text-text-muted",children:a.shortcut.keys.map(a=>a.toUpperCase()).join(" then ")})]},a.key)}let e=aY[a.entity.kind]??aM.f;return(0,b.jsxs)("button",{className:`flex w-full items-center gap-3 px-4 py-2 text-left text-sm transition-colors ${d?"bg-accent/10 text-accent shadow-[inset_2px_0_0_var(--color-accent)]":"text-text hover:bg-surface-hover"}`,onClick:()=>B(a),onMouseEnter:()=>i(c),"data-testid":"command-palette-item","data-item-kind":"entity","data-entity-kind":a.entity.kind,children:[(0,b.jsx)(e,{className:"h-4 w-4 shrink-0 text-accent/80"}),(0,b.jsxs)("span",{className:"flex-1 truncate",children:[(0,b.jsx)("span",{className:"font-medium",children:a.entity.label}),a.entity.sublabel&&(0,b.jsx)("span",{className:"ml-2 text-xs text-text-muted",children:a.entity.sublabel})]}),(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:a.entity.kind})]},a.key)})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4 border-t border-border px-4 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:[(0,b.jsx)("span",{children:"↑↓ navigate"}),(0,b.jsx)("span",{children:"↵ select"}),(0,b.jsx)("span",{children:"esc close"}),(0,b.jsxs)("button",{type:"button",onClick:()=>q((0,aW.W)()),className:"ml-auto flex items-center gap-1 rounded-chip px-1 text-text-muted transition-colors hover:text-primary",title:"Toggle visual effects (scanlines, glow pulses, animated map)","data-testid":"command-palette-fx-toggle",children:[(0,b.jsx)(aV.f,{className:"h-3 w-3"})," fx: ",p]}),(0,b.jsxs)("span",{className:"flex items-center gap-1",children:[(0,b.jsx)(aT,{className:"h-3 w-3"})," ",aG(),"+K"]})]})]})]}),j&&(0,b.jsxs)("div",{className:"fixed inset-0 z-(--z-modal) flex items-center justify-center",children:[(0,b.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-[2px]",onClick:()=>k(!1)}),(0,b.jsxs)("div",{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,b.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(aQ,{className:"h-5 w-5 text-primary"}),(0,b.jsx)("h2",{id:"keyboard-shortcuts-title",className:"text-sm font-bold uppercase tracking-wider text-primary glow-text-primary",children:"Keyboard Shortcuts"})]}),(0,b.jsx)("button",{onClick:()=>k(!1),className:"text-text-muted hover:text-text",children:(0,b.jsx)(aR.X,{className:"h-5 w-5"})})]}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"mb-2 text-[10px] font-medium uppercase tracking-[0.2em] text-text-muted",children:"General"}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(a$,{keys:[`${aG()}+K`],label:"Open command palette"}),(0,b.jsx)(a$,{keys:["?"],label:"Show this reference"}),(0,b.jsx)(a$,{keys:["Esc"],label:"Close modal / palette"})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"mb-2 text-[10px] font-medium uppercase tracking-[0.2em] text-text-muted",children:"Fleet Navigation"}),(0,b.jsx)("div",{className:"space-y-1",children:aF.filter(a=>"navigation"===a.category).map(a=>(0,b.jsx)(a$,{keys:a.keys.map(a=>a.toUpperCase()),label:a.label},a.target))})]})]})]})]})]}):null}function a$({keys:a,label:c}){return(0,b.jsxs)("div",{className:"flex items-center justify-between py-1",children:[(0,b.jsx)("span",{className:"text-xs text-text",children:c}),(0,b.jsx)("div",{className:"flex gap-1",children:a.map((c,d)=>(0,b.jsxs)("span",{children:[(0,b.jsx)("kbd",{className:"rounded-chip border border-border bg-bg px-1.5 py-0.5 text-[11px] text-primary",children:c}),d<a.length-1&&(0,b.jsx)("span",{className:"mx-0.5 text-[10px] text-text-muted/60",children:"then"})]},d))})]})}let a_={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"}]]};a_.node;let a0=(0,r.f)(a_);var a1=a.i(47515);let a2="magnus.update-banner.dismissed";function a3(){let[a,d]=(0,c.useState)(null),[f,g]=(0,c.useState)(null);if((0,c.useEffect)(()=>{g(function(){try{return window.localStorage.getItem(a2)}catch{return null}}());let a=!1,b=()=>{aC.f.systemUpdates.get().then(b=>{a||d(b)}).catch(()=>void 0)};b();let c=window.setInterval(b,18e5);return()=>{a=!0,window.clearInterval(c)}},[]),!a)return null;let{server:h,agents:i}=a,j=i.behind.length,k=(0,a1.t)(i);if(!h.updateAvailable&&!h.latestMajor&&0===j)return null;let l=`${a.server.latest??""}|${a.server.latestMajor??""}|${a.agents.behind.length}|${a.agents.expected}`;return f===l?null:(0,b.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,b.jsx)("div",{className:"absolute inset-y-0 left-0 w-0.5 bg-warning"}),(0,b.jsx)("button",{type:"button","aria-label":"Dismiss",className:"absolute right-2 top-2 text-text-muted hover:text-text",onClick:()=>{try{window.localStorage.setItem(a2,l)}catch{}g(l)},children:(0,b.jsx)(aR.X,{className:"h-3.5 w-3.5"})}),(0,b.jsxs)("div",{className:"space-y-2 pr-6",children:[h.updateAvailable&&h.latest&&(0,b.jsxs)("div",{className:"flex items-start gap-2",children:[(0,b.jsx)(aB.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning"}),(0,b.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,b.jsxs)("p",{children:[(0,b.jsxs)("span",{className:"font-bold uppercase tracking-wider text-warning",children:["Magnus ",h.latest," is available"]}),(0,b.jsxs)("span",{className:"ml-2 text-text-muted",children:["running ",h.current,h.breaking?" · contains breaking changes":""]})]}),h.releases.filter(a=>a.summary).map(a=>(0,b.jsxs)("p",{className:"text-text-muted",children:[a.version,": ",a.summary," ",a.notesUrl&&(0,b.jsx)("a",{className:"text-primary underline",href:a.notesUrl,target:"_blank",rel:"noreferrer",children:"release notes"})]},a.version)),h.newRequiredEnv.length>0&&(0,b.jsxs)("p",{className:"text-text-muted",children:["New required settings:"," ",h.newRequiredEnv.map(a=>(0,b.jsxs)("code",{className:"mr-1 rounded bg-surface px-1",children:[a.name,"server"!==a.component?` (${a.component})`:""]},a.name)),h.newRequiredEnv.every(a=>a.secret)&&(0,b.jsxs)("span",{children:["(secrets: ",(0,b.jsx)("code",{children:"magnus upgrade --generate-secrets"})," fills them in)"]})]}),h.attention.length>0&&(0,b.jsxs)("p",{className:"text-warning",children:["Needs a maintenance window: ",h.attention.map(a=>`${a.name} (${a.impact}${a.note?`: ${a.note}`:""})`).join("; ")]}),(0,b.jsxs)("p",{className:"text-text-muted",children:["On the server host run ",(0,b.jsx)("code",{className:"rounded bg-surface px-1 text-text",children:h.command})," (backs up the database and reverts on failure)."]})]})]}),h.latestMajor&&(0,b.jsxs)("p",{className:"text-text-muted",children:["Magnus ",h.latestMajor," is a new major version. Major upgrades are never offered automatically; read UPGRADING.md first."]}),j>0&&(0,b.jsxs)("div",{className:"flex items-start gap-2",children:[(0,b.jsx)(a0,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning"}),(0,b.jsxs)("p",{children:[(0,b.jsxs)("span",{className:"font-bold uppercase tracking-wider text-warning",children:[j," agent",1===j?"":"s"," behind the server (",i.expected,")"]}),(0,b.jsxs)("span",{className:"ml-2 text-text-muted",children:[i.behind.slice(0,5).map(a=>`${a.name} ${a.version}`).join(", "),j>5?", …":"","."]})," ",i.upgradesEnabled?(0,b.jsx)(e.default,{href:"/nodes?upgrade=agents",className:"text-primary underline",children:k>0?"Review agent upgrades":"Upgrade agents"}):(0,b.jsx)("span",{className:"text-text-muted",children:"Agent upgrades are off on this server (MAGNUS_AGENT_UPGRADES=false)."}),k>0&&(0,b.jsxs)("span",{className:"ml-2 text-text-muted",children:[k," agent",1===k?" requires":"s require"," a manual major-version upgrade; the dialog only upgrades within the same major."]}),i.fixCommand&&0===k&&(0,b.jsxs)("span",{className:"ml-2 text-text-muted",children:["or run ",(0,b.jsx)("code",{className:"rounded bg-surface px-1 text-text",children:i.fixCommand})]})]})]})]})]})}var a4=a.i(26926);a.s(["DashboardShell",0,function({children:a,integrations:e}){let f=(0,d.usePathname)(),g="/login"===f,[h,i]=(0,c.useState)(!1);!function({enabled:a=!0}={}){let[b,d]=(0,c.useState)(!1),{addToast:e}=(0,a4.d)(),f=(0,c.useRef)(e);f.current=e;let g=(0,c.useRef)(null),h=(0,c.useRef)(null),i=(0,c.useCallback)(()=>{if(!a)return;let b=new EventSource("/api/proxy/events/stream");for(let a of(g.current=b,b.onopen=()=>{d(!0),ah.f.setConnected(!0)},["deploy:status","node:status","command:status","alert:fired"]))b.addEventListener(a,b=>{try{let c=JSON.parse(b.data),d=function(a){let b=a.type??"",c=a.nodeName??"Unknown";switch(b){case"deploy.started":return{title:`Deploying to ${c}`,severity:"info"};case"deploy.completed":return{title:`Deploy complete: ${c}`,severity:"success"};case"deploy.failed":return{title:`Deploy failed: ${c}`,message:a.message??void 0,severity:"error"};case"upgrade.started":return{title:`Upgrading ${c}`,severity:"info"};case"upgrade.completed":return{title:`Upgrade complete: ${c}`,message:`v${a.version}`,severity:"success"};case"upgrade.failed":return{title:`Upgrade failed: ${c}`,message:a.message??void 0,severity:"error"};case"node.recovered":return{title:`${c} back online`,message:`Recovered from ${a.previousStatus}`,severity:"success"};case"command.completed":return{title:"Command completed",message:`${a.command}`,severity:"success"};case"command.failed":return{title:"Command failed",message:`${a.command} (exit ${a.exitCode})`,severity:"error"};case"health.alert":return{title:`Alert: ${a.metric?.replaceAll("_"," ").toUpperCase()} on ${c}`,message:`${a.value?.toFixed(1)}% (threshold: ${a.threshold}%)`,severity:a.severity??"warning"};default:return null}}(c);d&&f.current(d),ah.f.push(d?{...d,channel:a}:{title:String(c.type??a).replaceAll("."," "),message:"string"==typeof c.nodeName?c.nodeName:void 0,severity:"info",channel:a})}catch{}});return b.onerror=()=>{d(!1),ah.f.setConnected(!1),b.close(),fetch("/api/auth/me",{cache:"no-store"}).then(a=>{if(g.current===b){if(401===a.status)return void window.location.replace("/login");h.current=setTimeout(i,5e3)}}).catch(()=>{g.current===b&&(h.current=setTimeout(i,5e3))})},b},[a]);(0,c.useEffect)(()=>{let a=i();return()=>{h.current&&clearTimeout(h.current),a?.close(),g.current?.close(),ah.f.setConnected(!1),g.current=null}},[i])}({enabled:!g}),(0,c.useEffect)(()=>{i(!1)},[f]);let j=(0,c.useCallback)(()=>i(a=>!a),[]);return g?(0,b.jsx)(b.Fragment,{children:a}):(0,b.jsxs)("div",{className:"flex h-screen overflow-hidden",children:[h&&(0,b.jsx)("div",{className:"fixed inset-0 z-40 bg-black/70 backdrop-blur-[2px] md:hidden",onClick:()=>i(!1)}),(0,b.jsx)("div",{className:`
|
|
1
|
+
module.exports=[3319,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(8897);a.i(46997),Date.now();var e=a.i(26926),f=a.i(62190),g=a.i(65802),h=a.i(74290);function i({children:a,...d}){let e=(0,c.useContext)(g.f);(d={...e,...d}).transition=(0,f.f)(d.transition,e.transition),d.isStatic=(0,h.f)(()=>d.isStatic);let j=(0,c.useMemo)(()=>d,[JSON.stringify(d.transition),d.transformPagePoint,d.reducedMotion,d.skipAnimations,d.isValidProp]);return(0,b.jsx)(g.f.Provider,{value:j,children:a})}var j=a.i(73140);a.s(["Providers",0,function({children:a}){return(0,c.useEffect)(()=>((0,j.P)(),()=>{}),[]),(0,b.jsx)(i,{reducedMotion:"user",children:(0,b.jsx)(e.N,{children:(0,b.jsx)(d.v,{children:a})})})}],3319)},12737,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(38246),f=a.i(8387),g=a.i(89027),h=a.i(41476),i=a.i(3512),j=a.i(52562),k=a.i(8897),l=a.i(85264),m=a.i(5334),n=a.i(57547);function o({status:a}){let c="online"===a?"Online":"offline"===a?"Offline":"Checking…";return(0,b.jsx)("span",{role:"status","aria-label":c,className:`inline-block h-2 w-2 shrink-0 rounded-full ${"online"===a?"bg-success":"offline"===a?"bg-danger":"bg-text-muted/40 animate-pulse"}`,title:c})}function p(){let{nodes:a,activeNode:d,switchNode:e,loading:f}=(0,k.l)(),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(!1),v=(0,c.useRef)(null),[w,x]=(0,c.useState)({}),y=(0,c.useRef)(null),z=(0,c.useMemo)(()=>a.length>0?a:[m.f],[a]),A=(0,c.useCallback)(async()=>{let a={};await Promise.allSettled(z.map(async b=>{try{let c=(0,n.L)(b.url),d=await fetch("/api/proxy/health",{method:"GET",headers:c,signal:AbortSignal.timeout(6e3)});a[b.id]=d.ok?"online":"offline"}catch{a[b.id]="offline"}})),x(a)},[z]);return((0,c.useEffect)(()=>{A()},[A]),(0,c.useEffect)(()=>{if(p)return A(),y.current=setInterval(()=>void A(),3e4),()=>{y.current&&clearInterval(y.current)}},[p,A]),(0,c.useEffect)(()=>{if(p)return document.addEventListener("mousedown",a),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",b)};function a(a){v.current&&!v.current.contains(a.target)&&q(!1)}function b(a){"Escape"===a.key&&q(!1)}},[p]),f)?(0,b.jsx)("div",{className:"mx-3 mt-2 mb-1 rounded border border-border bg-bg px-3 py-2 text-xs text-text-muted animate-pulse",children:"Loading…"}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"relative mx-3 mt-2 mb-1",ref:v,children:[(0,b.jsx)("div",{className:"mb-1 px-0.5 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Node Controller"}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)("button",{onClick:()=>q(!p),"aria-expanded":p,"aria-haspopup":"listbox","aria-label":`Node controller: ${d.name}`,className:"flex flex-1 items-center gap-2 rounded border border-border bg-bg px-2.5 py-1.5 text-left transition-all hover:bg-surface-hover min-w-0",children:[(0,b.jsx)(o,{status:w[d.id]??"unknown"}),(0,b.jsx)("span",{className:"flex-1 truncate text-xs font-medium",children:d.name}),(0,b.jsx)(g.f,{className:`h-3.5 w-3.5 shrink-0 text-text-muted transition-transform ${p?"rotate-180":""}`})]}),(0,b.jsx)("button",{onClick:function(){u(!1),s(!0)},className:"rounded border border-border bg-bg p-1.5 text-text-muted transition-all hover:bg-surface-hover hover:text-text",title:"Control Node Settings",children:(0,b.jsx)(h.f,{className:"h-3.5 w-3.5"})})]}),p&&(0,b.jsxs)("div",{className:"absolute left-3 right-3 z-50 mt-1 rounded border border-border bg-surface shadow-xl",children:[(0,b.jsx)("div",{role:"listbox","aria-label":"Control nodes",className:"max-h-48 overflow-y-auto py-1",children:z.map(a=>(0,b.jsxs)("button",{role:"option","aria-selected":a.id===d.id,onClick:()=>{e(a.id),q(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-all hover:bg-surface-hover",children:[(0,b.jsx)(o,{status:w[a.id]??"unknown"}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:"font-medium truncate",children:a.name}),(0,b.jsx)("div",{className:"text-text-muted truncate text-[10px]",children:a.url})]}),a.id===d.id&&(0,b.jsx)(j.f,{className:"h-3.5 w-3.5 shrink-0 text-primary"})]},a.id))}),(0,b.jsx)("div",{className:"border-t border-border",children:(0,b.jsxs)("button",{onClick:function(){q(!1),u(!0),s(!0)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-primary transition-all hover:bg-surface-hover",children:[(0,b.jsx)(i.f,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{className:"font-bold",children:"Add Control Node"})]})})]})]}),(0,b.jsx)(l.f,{open:r,onClose:()=>s(!1),createMode:t})]})}var q=a.i(31289),r=a.i(64831);let s={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"}]]};s.node;let t=(0,r.f)(s);var u=a.i(34532),v=a.i(57307),w=a.i(8311),x=a.i(83138);let y={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"}]]};y.node;let z=(0,r.f)(y);var A=a.i(14258),B=a.i(82260),C=a.i(85888),D=a.i(35173),E=a.i(11715),F=a.i(87529),G=a.i(92378);let H={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"}]]};H.node;let I=(0,r.f)(H);var J=a.i(18688);let K={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"}]]};K.node;let L=(0,r.f)(K);var M=a.i(75027);let N={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"}]]};N.node;let O=(0,r.f)(N),P={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"]};P.node;let Q=(0,r.f)(P);var R=a.i(27061);let S={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"}]]};S.node;let T=(0,r.f)(S),U={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"}]]};U.node;let V=(0,r.f)(U),W={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"]};W.node;let X=(0,r.f)(W);var Y=a.i(36273);let Z={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"}]]};Z.node;let $=(0,r.f)(Z);var _=a.i(17770),aa=a.i(26766),ab=a.i(69942),ac=a.i(6024);let ad=[{id:"fleet",label:"Fleet",tone:"primary",items:[{href:"/mission-control",label:"Mission Control",icon:L},{href:"/",label:"Overview",icon:t,exact:!0},{href:"/nodes",label:"Nodes",icon:u.f},{href:"/application-operations",label:"Applications",icon:O},{href:"/fleet-readiness",label:"Readiness",icon:ac.f},{href:"/fleet-timeline",label:"Timeline",icon:Q},{href:"/fleet-map",label:"Fleet Map",icon:I},{href:"/commands",label:"Commands",icon:v.f},{href:"/anomalies",label:"Anomalies",icon:D.f},{href:"/anomalies/remediation",label:"Remediation",icon:G.f},{href:"/governor/operations",label:"Operations",icon:E.f},{href:"/rollouts",label:"Rollouts",icon:V},{href:"/incidents",label:"Incidents",icon:X},{href:"/cron",label:"Cron Jobs",icon:w.f},{href:"/files",label:"Files",icon:x.f},{href:"/logs",label:"Logs",icon:z},{href:"/audit",label:"Audit",icon:A.f},{href:"/webhooks",label:"Webhooks",icon:F.f},{href:"/retention",label:"Retention",icon:R.f},{href:"/api-docs",label:"API Docs",icon:J.f}]},{id:"security",label:"Security",tone:"primary",integration:"securityConsole",items:[{href:"/security-fusion",label:"Fleet summary",icon:$,exact:!0}]},{id:"hermes",label:"Hermes Agent",tone:"accent",integration:"hermes",items:[{href:"/orchestra",label:"Overview",icon:B.f,exact:!0},{href:"/orchestra/installations",label:"Installations",icon:u.f},{href:"/orchestra/profiles",label:"Profiles",icon:C.f},{href:"/hermes-drift",label:"Drift Cockpit",icon:T},{href:"/hermes-security",label:"Proxy Security",icon:Y.f},{href:"/orchestra/web-gateway",label:"Web Gateway",icon:M.f}]},{id:"ardent",label:"Magnus Ardent",tone:"primary",items:[{href:"/ardent",label:"Overview",icon:ab.f,exact:!0},{href:"/ardent/installations",label:"Installations",icon:u.f},{href:"/ardent/profiles",label:"Profiles",icon:C.f}]},{id:"codex",label:"Codex Agent",tone:"primary",items:[{href:"/codex",label:"Overview",icon:_.f,exact:!0},{href:"/codex/installations",label:"Installations",icon:aa.f}]}],ae={"/":"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 af(a,b,c=!1){return"/"===b||c?a===b:a===b||a.startsWith(`${b}/`)}function ag(a){let b=null;for(let c of ad)for(let d of c.items)!d.external&&af(a,d.href,d.exact)&&(null===b||d.href.length>b.length)&&(b=d.href);return b}var ah=a.i(33643);let ai={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 aj({group:a,activeHref:c}){let d="accent"===a.tone;return(0,b.jsxs)(b.Fragment,{children:["fleet"!==a.id&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"mx-3 my-1",children:(0,b.jsx)("div",{className:(0,f.f)("h-px bg-gradient-to-r to-transparent",ai[a.id])})}),(0,b.jsx)("div",{className:"px-4 pb-0.5 pt-2",children:(0,b.jsx)("span",{className:(0,f.f)("text-[9px] font-bold uppercase tracking-[0.25em]",d?"text-accent/60":"text-primary/60"),children:a.label})})]}),(0,b.jsx)("nav",{className:(0,f.f)("space-y-0.5 p-3","fleet"!==a.id&&"pt-1"),"aria-label":a.label,children:a.items.map(a=>{let g=a.href===c,h=a.icon;return(0,b.jsxs)(e.default,{href:a.href,prefetch:!1,target:a.external?"_blank":void 0,rel:a.external?"noopener noreferrer":void 0,"aria-current":g?"page":void 0,className:(0,f.f)("group relative flex items-center gap-3 overflow-hidden rounded-chip px-3 py-2 text-xs uppercase tracking-wider transition-colors duration-200","before:pointer-events-none before:absolute before:inset-y-0 before:-left-1/2 before:w-1/2 before:-skew-x-12 before:bg-gradient-to-r before:from-transparent before:to-transparent before:opacity-0 before:transition-[left,opacity] before:duration-500 hover:before:left-full hover:before:opacity-100",d?"before:via-accent/10":"before:via-primary/10",g?(0,f.f)(d?"text-accent":"text-primary",d?"bg-accent/5":"bg-primary/5"):(0,f.f)("text-text-muted",d?"hover:text-accent":"hover:text-primary")),children:[g&&(0,b.jsx)(q.f.span,{layoutId:"sidebar-indicator",className:(0,f.f)("absolute bottom-1 left-0 top-1 w-0.5 rounded-full",d?"bg-accent":"bg-primary"),style:{boxShadow:d?"0 0 8px var(--color-accent), 0 0 16px var(--color-glow-accent)":"0 0 8px var(--color-primary), 0 0 16px var(--color-glow)"},transition:{type:"spring",stiffness:300,damping:30}}),(0,b.jsx)(h,{className:"relative h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"relative truncate",children:a.label})]},a.href)})})]})}function ak(){return(0,b.jsxs)("div",{className:"relative flex h-8 w-8 items-center justify-center animate-flicker",children:[(0,b.jsxs)("svg",{viewBox:"0 0 32 32",className:"h-8 w-8 overflow-visible","aria-hidden":"true",children:[(0,b.jsx)("rect",{x:"1",y:"1",width:"30",height:"30",rx:"4",fill:"none",stroke:"var(--color-primary)",strokeOpacity:"0.35"}),(0,b.jsx)("path",{d:"M8 23 V9 L16 18 L24 9 V23",fill:"none",stroke:"var(--color-primary)",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",pathLength:100,style:{"--stroke-length":100,strokeDasharray:100,animation:"draw-stroke 1.4s var(--ease-out-expo) both"},className:"drop-shadow-[0_0_4px_var(--color-primary)]"})]}),(0,b.jsx)("div",{className:"absolute inset-0 rounded shadow-[0_0_12px_var(--color-glow)]"})]})}function al(){let{connected:a}=(0,c.useSyncExternalStore)(ah.f.subscribe,ah.f.getSnapshot,ah.f.getServerSnapshot);return(0,b.jsxs)("span",{className:"flex items-center gap-1.5",title:a?"Live event stream connected":"Live event stream reconnecting",children:[(0,b.jsxs)("span",{className:"relative inline-flex h-1.5 w-1.5",children:[a&&(0,b.jsx)("span",{className:"absolute inset-0 rounded-full bg-success animate-halo"}),(0,b.jsx)("span",{className:(0,f.f)("relative inline-flex h-1.5 w-1.5 rounded-full",a?"bg-success shadow-[0_0_6px_var(--color-success)]":"bg-warning")})]}),(0,b.jsx)("span",{className:a?"text-success/70":"text-warning/70",children:a?"Live":"Offline"})]})}function am({integrations:a}){let e=ag((0,d.usePathname)()),f=(0,c.useMemo)(()=>(function(a,b=ad){return b.filter(b=>{var c;return!b.integration||(c=b.integration,"securityConsole"===c?null!==a.securityConsoleUrl:a.hermes)}).map(b=>"security"===b.id&&a.securityConsoleUrl?{...b,items:[{href:a.securityConsoleUrl,label:"Security console ↗",icon:$,external:!0},...b.items]}:b)})(a),[a]);return(0,b.jsxs)("aside",{className:"relative flex h-full w-56 flex-col border-r border-border/50 bg-bg",children:[(0,b.jsx)("div",{className:"absolute bottom-0 right-0 top-0 w-px bg-gradient-to-b from-primary/60 via-primary/20 to-transparent"}),(0,b.jsxs)("div",{className:"flex h-14 items-center gap-3 border-b border-border/30 px-4",children:[(0,b.jsx)(ak,{}),(0,b.jsx)("span",{className:"text-sm font-bold uppercase tracking-[0.2em] text-text",children:"Magnus"})]}),(0,b.jsx)(p,{}),(0,b.jsx)("div",{className:"flex-1 overflow-y-auto",children:f.map(a=>(0,b.jsx)(aj,{group:a,activeHref:e},a.id))}),(0,b.jsxs)("div",{className:"flex items-center justify-between border-t border-border/30 p-4 text-[10px] uppercase tracking-widest text-primary/70",children:[(0,b.jsxs)("span",{children:["Magnus v","3.7.0"]}),(0,b.jsx)(al,{})]})]})}var an=a.i(57230),ao=a.i(19783);let ap={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};ap.node;let aq=(0,r.f)(ap);var ar=a.i(33540),as=a.i(41146);let at={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"}]]};at.node;let au=(0,r.f)(at),av={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"}]]};av.node;let aw=(0,r.f)(av);var ax=a.i(68579),ay=a.i(21327),az=a.i(52357),aA=a.i(99101),aB=a.i(42973),aC=a.i(46997);function aD(){let[a,d]=(0,c.useState)(!1),[g,i]=(0,c.useState)([]),[k,l]=(0,c.useState)(0),[m,n]=(0,c.useState)(!1),o=(0,c.useRef)(null),p=(0,c.useCallback)(async()=>{try{let a=await aC.f.notifications.unreadCount();a.success&&a.data&&l(a.data.count)}catch{}},[]),q=(0,c.useCallback)(async()=>{n(!0);try{let a=await aC.f.notifications.list({pageSize:20});if(a.success&&a.data){let b=a.data;i(b.notifications)}}catch{}finally{n(!1)}},[]);(0,c.useEffect)(()=>{p();let a=setInterval(()=>void p(),15e3);return()=>clearInterval(a)},[p]),(0,c.useEffect)(()=>{a&&q()},[a,q]),(0,c.useEffect)(()=>{if(!a)return;let b=a=>{o.current&&!o.current.contains(a.target)&&d(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[a]),(0,c.useEffect)(()=>{if(!a)return;let b=a=>{"Escape"===a.key&&d(!1)};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[a]);let r=async a=>{try{await aC.f.notifications.markRead([a]),i(b=>b.map(b=>b.id===a?{...b,isRead:!0}:b)),l(a=>Math.max(0,a-1))}catch{}},s=async()=>{try{await aC.f.notifications.markAllRead(),i(a=>a.map(a=>({...a,isRead:!0}))),l(0),setTimeout(()=>void p(),500)}catch{}};return(0,b.jsxs)("div",{className:"relative",ref:o,children:[(0,b.jsxs)("button",{className:"relative rounded p-2 text-text-muted transition-all hover:bg-surface-hover hover:text-text",title:"Notifications",type:"button","aria-expanded":a,"aria-controls":"notification-panel","aria-label":k>0?`Notifications (${k} unread)`:"Notifications",onClick:()=>d(a=>!a),children:[(0,b.jsx)(au,{className:"h-4 w-4"}),k>0&&(0,b.jsx)("span",{className:"absolute right-1 top-1 flex h-4 min-w-[1rem] items-center justify-center rounded-full bg-danger px-1 text-[10px] font-bold text-white",children:k>99?"99+":k})]}),a&&(0,b.jsxs)("div",{id:"notification-panel",role:"region","aria-label":"Notifications",className:"absolute right-0 top-full z-50 mt-2 w-96 overflow-hidden rounded border border-border bg-surface shadow-2xl",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[(0,b.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider text-text",children:"Notifications"}),k>0&&(0,b.jsxs)("button",{className:"flex items-center gap-1 rounded px-2 py-1 text-xs text-primary hover:bg-primary/10 transition-all",onClick:()=>void s(),type:"button",children:[(0,b.jsx)(aw,{className:"h-3 w-3"}),"Mark all read"]})]}),(0,b.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[m&&0===g.length&&(0,b.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,b.jsx)("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-primary border-t-transparent"})}),!m&&0===g.length&&(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-10 text-text-muted",children:[(0,b.jsx)(au,{className:"mb-2 h-8 w-8 opacity-40"}),(0,b.jsx)("p",{className:"text-xs",children:"No notifications yet"})]}),g.map(a=>(0,b.jsxs)("div",{className:(0,f.f)("group flex items-start gap-3 border-b border-border/50 px-4 py-3 transition-all hover:bg-surface-hover",!a.isRead&&"bg-primary/5"),children:[(0,b.jsx)("div",{className:"mt-0.5 shrink-0",children:function(a){switch(a){case"critical":return(0,b.jsx)(ay.f,{className:"h-4 w-4 text-danger"});case"warning":return(0,b.jsx)(ax.f,{className:"h-4 w-4 text-warning"});default:return(0,b.jsx)(az.f,{className:"h-4 w-4 text-primary"})}}(a.severity)}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[function(a){switch(a){case"node.offline":return(0,b.jsx)(u.f,{className:"h-3.5 w-3.5 text-danger"});case"node.degraded":case"node.upgrade_not_ready":return(0,b.jsx)(u.f,{className:"h-3.5 w-3.5 text-warning"});case"node.recovered":return(0,b.jsx)(O,{className:"h-3.5 w-3.5 text-success"});case"command.failed":return(0,b.jsx)(v.f,{className:"h-3.5 w-3.5 text-warning"});case"deploy.failed":return(0,b.jsx)(aA.f,{className:"h-3.5 w-3.5 text-danger"});case"upgrade.failed":return(0,b.jsx)(aB.f,{className:"h-3.5 w-3.5 text-danger"});default:return(0,b.jsx)(au,{className:"h-3.5 w-3.5 text-text-muted"})}}(a.type),(0,b.jsx)("span",{className:(0,f.f)("text-xs font-bold",a.isRead?"text-text-muted":"text-text"),children:a.title})]}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-text-muted line-clamp-2",children:a.message}),(0,b.jsx)("span",{className:"mt-1 block text-[10px] text-text-muted",children:function(a){let b=Math.floor((Date.now()-new Date(a).getTime())/1e3);if(b<60)return"just now";let c=Math.floor(b/60);if(c<60)return`${c}m ago`;let d=Math.floor(c/60);if(d<24)return`${d}h ago`;let e=Math.floor(d/24);return`${e}d ago`}(a.createdAt)})]}),!a.isRead&&(0,b.jsx)("button",{className:"mt-0.5 shrink-0 rounded p-1 text-text-muted opacity-0 transition-all hover:bg-surface-hover hover:text-primary group-hover:opacity-100",title:"Mark as read",type:"button",onClick:()=>void r(a.id),children:(0,b.jsx)(j.f,{className:"h-3.5 w-3.5"})})]},a.id))]}),(0,b.jsx)("div",{className:"border-t border-border px-4 py-2 flex justify-end",children:(0,b.jsxs)(e.default,{href:"/notifications",className:"flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",onClick:()=>d(!1),children:[(0,b.jsx)(h.f,{className:"h-3 w-3"}),"Preferences"]})})]})]})}var aE=a.i(62260);let aF=[{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 aG(){return"u">typeof navigator&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘":"Ctrl"}function aH(){document.body.dispatchEvent(new KeyboardEvent("keydown",{key:"k",ctrlKey:!0,metaKey:!0,bubbles:!0}))}function aI({onMenuToggle:a}){let f=(0,d.usePathname)(),g=(0,d.useRouter)(),{title:h,crumbs:i}=function(a){let b=null;for(let c of Object.keys(ae))af(a,c)&&(null===b||c.length>b.length)&&(b=c);let c=b?ae[b]:"Magnus",d=ag(a),e=d?ad.find(a=>a.items.some(a=>a.href===d))?.label??null:null,f=[];if(e&&f.push({label:e}),f.push({label:c,href:b??void 0}),b&&a!==b)for(let c of a.slice("/"===b?1:b.length+1).split("/").filter(Boolean)){let a=decodeURIComponent(c);f.push({label:a.length>18?`${a.slice(0,8)}…${a.slice(-6)}`:a})}return{title:c,group:e,crumbs:f}}(f),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)("Ctrl"),p=(0,c.useRef)(null);async function q(a=!1){let b=await fetch(`/api/auth/logout${a?"?all=true":""}`,{method:"POST"}).catch(()=>null);b?.ok?(g.push("/login"),g.refresh()):window.alert("Session revocation unavailable; retry sign out.")}return(0,c.useEffect)(()=>{o(aG()),fetch("/api/auth/me").then(a=>a.ok?a.json():null).then(a=>{a?.username&&k(a.username)}).catch(()=>{})},[]),(0,c.useEffect)(()=>{if(!l)return;let a=a=>{(a instanceof KeyboardEvent?"Escape"!==a.key:p.current?.contains(a.target))||m(!1)};return document.addEventListener("mousedown",a),document.addEventListener("keydown",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",a)}},[l]),(0,b.jsxs)("header",{className:"relative z-(--z-shell) flex h-14 items-center justify-between gap-3 bg-bg/80 px-3 backdrop-blur-sm sm:px-6",children:[(0,b.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-primary/60 via-accent/40 to-transparent"}),(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-2 text-xs uppercase tracking-[0.15em] text-text-muted",children:[a&&(0,b.jsx)("button",{className:"mr-1 rounded p-1.5 text-text-muted hover:text-primary md:hidden",onClick:a,type:"button",title:"Toggle menu",children:(0,b.jsx)(aq,{className:"h-5 w-5"})}),(0,b.jsx)("span",{className:"text-primary/60",children:">_"}),(0,b.jsx)("nav",{"aria-label":"Breadcrumb",className:"hidden min-w-0 items-center gap-1 sm:flex",children:i.map((a,c)=>{let d=c===i.length-1;return(0,b.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[c>0&&(0,b.jsx)(as.f,{className:"h-3 w-3 shrink-0 text-primary/30","aria-hidden":"true"}),a.href&&!d?(0,b.jsx)(e.default,{href:a.href,prefetch:!1,className:"truncate transition-colors hover:text-primary",children:a.label}):(0,b.jsx)("span",{className:d?"truncate text-text":0===c&&i.length>1?"truncate text-text-muted":"truncate","aria-current":d?"page":void 0,children:a.label})]},`${a.label}-${c}`)})}),(0,b.jsx)("span",{className:"sr-only sm:hidden",children:h}),(0,b.jsx)("span",{className:"ml-1 hidden h-3.5 w-1.5 shrink-0 bg-primary/80 sm:inline-block",style:{animation:"cursor-blink 1s step-end infinite"}})]}),(0,b.jsx)(aE.J,{className:"hidden max-w-xl flex-1 lg:block"}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-1 sm:gap-2",children:[(0,b.jsxs)("button",{type:"button",onClick:aH,className:"hidden items-center gap-2 rounded-chip border border-border bg-surface px-2.5 py-1.5 text-[10px] uppercase tracking-wider text-text-muted transition-colors hover:border-primary/40 hover:text-primary md:flex",title:"Search and jump (command palette)",children:[(0,b.jsx)(ar.f,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:"Search"}),(0,b.jsxs)("kbd",{className:"rounded-chip border border-border bg-bg px-1 text-[9px] text-primary/70",children:[n,"+K"]})]}),(0,b.jsx)("button",{className:"rounded p-2 text-text-muted transition-all hover:text-primary hover:drop-shadow-[0_0_6px_var(--color-glow)]",title:"Refresh",onClick:()=>window.location.reload(),type:"button",children:(0,b.jsx)(ao.f,{className:"h-4 w-4"})}),(0,b.jsx)(aD,{}),(0,b.jsx)("button",{className:"rounded p-2 text-text-muted transition-all hover:text-danger hover:drop-shadow-[0_0_6px_rgba(255,23,68,0.3)]",title:"Sign Out",onClick:()=>void q(),type:"button",children:(0,b.jsx)(an.f,{className:"h-4 w-4"})}),(0,b.jsxs)("div",{ref:p,className:"relative ml-1",children:[(0,b.jsx)("button",{type:"button",onClick:()=>m(a=>!a),"aria-haspopup":"menu","aria-expanded":l,title:j?`Signed in as ${j}`:"Account",className:"flex h-8 w-8 items-center justify-center rounded border border-accent/40 text-[10px] font-bold uppercase text-accent shadow-[0_0_8px_var(--color-glow-accent)] transition-colors hover:border-accent hover:bg-accent/10",children:j?.[0]??"U"}),l&&(0,b.jsxs)("div",{role:"menu",className:"panel-corners absolute right-0 top-full z-(--z-modal) mt-2 w-60 rounded-panel border border-accent/30 bg-surface/95 p-1 shadow-[0_0_24px_var(--color-glow-accent)] backdrop-blur-sm [--panel-corner-color:var(--color-accent)]",children:[j&&(0,b.jsxs)("div",{className:"border-b border-border px-3 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:["Signed in as ",(0,b.jsx)("span",{className:"text-accent",children:j})]}),(0,b.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>void q(),className:"flex w-full items-center gap-2 rounded-chip px-3 py-2 text-left text-xs text-text-muted transition-colors hover:bg-surface-hover hover:text-text",children:[(0,b.jsx)(an.f,{className:"h-3.5 w-3.5"})," Sign out"]}),(0,b.jsxs)("button",{type:"button",role:"menuitem","aria-label":"Sign out all local sessions",onClick:()=>void q(!0),className:"flex w-full items-center gap-2 rounded-chip px-3 py-2 text-left text-xs text-text-muted transition-colors hover:bg-danger/10 hover:text-danger",children:[(0,b.jsx)(an.f,{className:"h-3.5 w-3.5"})," Sign out all local sessions"]})]})]})]})]})}async function aJ(a,b){try{let c=await fetch(a,{signal:b,headers:{accept:"application/json"}});if(!c.ok)return null;return await c.json()}catch{return null}}function aK(a,b){return a.trim()?b.map(b=>({e:b,s:function(a,b){if(!a)return 0;let c=a.toLowerCase(),d=b.toLowerCase(),e=d.indexOf(c);if(-1!==e)return e;let f=0,g=0;for(let a of c){let b=d.indexOf(a,f);if(-1===b)return -1;g+=b-f,f=b+1}return 1e3+g}(a,`${b.label} ${b.sublabel??""}`)})).filter(({s:a})=>a>=0).sort((a,b)=>a.s-b.s).map(({e:a})=>a):b}async function aL(a,b={}){let{signal:c,limit:d=10}=b;if(a.trim().length<2)return[];let[e,f,g]=await Promise.all([aJ("/api/proxy/nodes",c),aJ("/api/proxy/orchestra/installations",c),aJ("/api/proxy/orchestra/skill-catalog",c)]),h=[];for(let a of e?.data??[])h.push({kind:"node",id:a.id,label:a.name,sublabel:a.status?`Node \xb7 ${a.status}`:"Node",href:`/nodes/${a.id}`});for(let a of f?.data??[])h.push({kind:"installation",id:a.id,label:a.displayName??a.hostname,sublabel:`Hermes \xb7 ${a.status??"unknown"}`,href:"/orchestra/installations"});for(let a of g?.data??[])h.push({kind:"skill",id:a.id,label:a.name,sublabel:a.description??"Skill",href:"/skills"});return aK(a,[{kind:"action",id:"deploy-agent",label:"Deploy agent to host",sublabel:"Action · Operations",href:"/governor/operations"},{kind:"action",id:"open-terminal",label:"Open node terminal",sublabel:"Action · Nodes",href:"/nodes"},{kind:"action",id:"run-fleet-check",label:"Run fleet check",sublabel:"Action · Fleet readiness",href:"/fleet-readiness"},{kind:"action",id:"view-stale-nodes",label:"View stale nodes",sublabel:"Action · Readiness",href:"/fleet-readiness"},{kind:"action",id:"rotate-node-secret",label:"Rotate node secret",sublabel:"Action · Operations",href:"/governor/operations"},{kind:"action",id:"latest-failed-deploy",label:"Open latest failed deploy",sublabel:"Action · Timeline",href:"/fleet-timeline"},...h]).slice(0,d)}var aM=a.i(18783),aN=a.i(50354),aO=a.i(74849);let aP={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"}]]};aP.node;let aQ=(0,r.f)(aP);var aR=a.i(74215);let aS={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"}]]};aS.node;let aT=(0,r.f)(aS);var aU=a.i(75160),aV=a.i(86708),aW=a.i(73140);let aX={"/":t,"/mission-control":L,"/nodes":u.f,"/commands":v.f,"/cron":w.f,"/files":x.f,"/skills":aN.f,"/logs":z,"/audit":A.f,"/library":aO.f},aY={node:u.f,installation:B.f,skill:aN.f,action:aM.f};function aZ(){let[a,e]=(0,c.useState)(!1),[f,g]=(0,c.useState)(""),[h,i]=(0,c.useState)(0),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)("normal"),r=(0,c.useRef)(null),s=(0,d.useRouter)(),t=(0,c.useRef)([]),u=(0,c.useRef)(void 0),v=(0,c.useRef)(void 0),w=(0,c.useRef)(null),x=(f.trim()?aF.filter(a=>a.label.toLowerCase().includes(f.toLowerCase())||a.description.toLowerCase().includes(f.toLowerCase())):aF).map(a=>({kind:"shortcut",key:`s:${a.keys.join("-")}`,shortcut:a})),y=aK(f,l).map(a=>({kind:"entity",key:`e:${a.kind}:${a.id}`,entity:a})),z=f.trim()?[...y,...x]:x;(0,c.useEffect)(()=>{if(!a)return;let b=f.trim();if(b.length<2){m([]),o(!1);return}v.current&&clearTimeout(v.current),w.current&&w.current.abort();let c=new AbortController;return w.current=c,o(!0),v.current=setTimeout(async()=>{let a=await aL(b,{signal:c.signal,limit:12});c.signal.aborted||(m(a),o(!1))},180),()=>{c.abort(),v.current&&clearTimeout(v.current)}},[f,a]);let A=(0,c.useCallback)(a=>{"navigate"===a.action&&a.target?(s.push(a.target),e(!1),g("")):"show-shortcuts"===a.target&&(k(!0),e(!1),g(""))},[s]),B=(0,c.useCallback)(a=>{"shortcut"===a.kind?A(a.shortcut):(s.push(a.entity.href),e(!1),g(""))},[A,s]);return((0,c.useEffect)(()=>{let b=b=>{let c=b.target,d="INPUT"===c.tagName||"TEXTAREA"===c.tagName||c.isContentEditable;if((b.metaKey||b.ctrlKey)&&"k"===b.key.toLowerCase()){b.preventDefault(),b.stopPropagation(),b.stopImmediatePropagation(),e(a=>!a);return}if("Escape"===b.key){if(a){e(!1),g("");return}return j?void k(!1):void 0}if(!d){if("?"===b.key){b.preventDefault(),k(a=>!a);return}if(1===b.key.length&&!b.metaKey&&!b.ctrlKey&&!b.altKey){for(let a of(clearTimeout(u.current),t.current.push(b.key.toLowerCase()),aF))if(a.keys.length===t.current.length&&a.keys.every((a,b)=>a===t.current[b])){b.preventDefault(),t.current=[],A(a);return}u.current=setTimeout(()=>{t.current=[]},800)}}};return window.addEventListener("keydown",b,!0),()=>window.removeEventListener("keydown",b,!0)},[a,j,A]),(0,c.useEffect)(()=>{a&&(i(0),setTimeout(()=>r.current?.focus(),50))},[a]),(0,c.useEffect)(()=>{h>=z.length&&i(Math.max(0,z.length-1))},[z.length,h]),(0,c.useEffect)(()=>{a&&q("low"===document.documentElement.dataset.fx?"low":"normal")},[a]),a||j)?(0,b.jsxs)(b.Fragment,{children:[a&&(0,b.jsxs)("div",{className:"fixed inset-0 z-(--z-modal) flex items-start justify-center pt-[15vh]","data-testid":"command-palette",children:[(0,b.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-[2px]",onClick:()=>{e(!1),g("")}}),(0,b.jsxs)("div",{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,b.jsxs)("div",{className:"flex items-center gap-3 border-b border-border px-4 py-3",children:[(0,b.jsx)(ar.f,{className:"h-5 w-5 text-primary"}),(0,b.jsx)("input",{ref:r,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:f,onChange:a=>{g(a.target.value),i(0)},onKeyDown:a=>{"ArrowDown"===a.key?(a.preventDefault(),i(a=>Math.min(a+1,z.length-1))):"ArrowUp"===a.key?(a.preventDefault(),i(a=>Math.max(a-1,0))):"Enter"===a.key&&z[h]&&(a.preventDefault(),B(z[h]))},"data-testid":"command-palette-input"}),n?(0,b.jsx)(aU.f,{className:"h-4 w-4 animate-spin text-primary"}):(0,b.jsx)("kbd",{className:"rounded-chip border border-border bg-bg px-1.5 py-0.5 text-[10px] text-text-muted",children:"ESC"})]}),(0,b.jsxs)("div",{className:"max-h-96 overflow-y-auto py-2",children:[0===z.length&&!n&&(0,b.jsx)("p",{className:"px-4 py-6 text-center text-xs uppercase tracking-wider text-text-muted",children:"No results found"}),0===z.length&&n&&(0,b.jsx)("p",{className:"px-4 py-6 text-center text-xs uppercase tracking-wider text-text-muted",children:"Searching…"}),z.map((a,c)=>{let d=c===h;if("shortcut"===a.kind){let e=aX[a.shortcut.target??""]??aM.f;return(0,b.jsxs)("button",{className:`flex w-full items-center gap-3 px-4 py-2 text-left text-sm transition-colors ${d?"bg-primary/10 text-primary shadow-[inset_2px_0_0_var(--color-primary)]":"text-text hover:bg-surface-hover"}`,onClick:()=>B(a),onMouseEnter:()=>i(c),"data-testid":"command-palette-item","data-item-kind":"shortcut",children:[(0,b.jsx)(e,{className:"h-4 w-4 shrink-0 opacity-70"}),(0,b.jsx)("span",{className:"flex-1",children:a.shortcut.label}),(0,b.jsx)("span",{className:"text-xs text-text-muted",children:a.shortcut.keys.map(a=>a.toUpperCase()).join(" then ")})]},a.key)}let e=aY[a.entity.kind]??aM.f;return(0,b.jsxs)("button",{className:`flex w-full items-center gap-3 px-4 py-2 text-left text-sm transition-colors ${d?"bg-accent/10 text-accent shadow-[inset_2px_0_0_var(--color-accent)]":"text-text hover:bg-surface-hover"}`,onClick:()=>B(a),onMouseEnter:()=>i(c),"data-testid":"command-palette-item","data-item-kind":"entity","data-entity-kind":a.entity.kind,children:[(0,b.jsx)(e,{className:"h-4 w-4 shrink-0 text-accent/80"}),(0,b.jsxs)("span",{className:"flex-1 truncate",children:[(0,b.jsx)("span",{className:"font-medium",children:a.entity.label}),a.entity.sublabel&&(0,b.jsx)("span",{className:"ml-2 text-xs text-text-muted",children:a.entity.sublabel})]}),(0,b.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:a.entity.kind})]},a.key)})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4 border-t border-border px-4 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:[(0,b.jsx)("span",{children:"↑↓ navigate"}),(0,b.jsx)("span",{children:"↵ select"}),(0,b.jsx)("span",{children:"esc close"}),(0,b.jsxs)("button",{type:"button",onClick:()=>q((0,aW.W)()),className:"ml-auto flex items-center gap-1 rounded-chip px-1 text-text-muted transition-colors hover:text-primary",title:"Toggle visual effects (scanlines, glow pulses, animated map)","data-testid":"command-palette-fx-toggle",children:[(0,b.jsx)(aV.f,{className:"h-3 w-3"})," fx: ",p]}),(0,b.jsxs)("span",{className:"flex items-center gap-1",children:[(0,b.jsx)(aT,{className:"h-3 w-3"})," ",aG(),"+K"]})]})]})]}),j&&(0,b.jsxs)("div",{className:"fixed inset-0 z-(--z-modal) flex items-center justify-center",children:[(0,b.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-[2px]",onClick:()=>k(!1)}),(0,b.jsxs)("div",{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,b.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(aQ,{className:"h-5 w-5 text-primary"}),(0,b.jsx)("h2",{id:"keyboard-shortcuts-title",className:"text-sm font-bold uppercase tracking-wider text-primary glow-text-primary",children:"Keyboard Shortcuts"})]}),(0,b.jsx)("button",{onClick:()=>k(!1),className:"text-text-muted hover:text-text",children:(0,b.jsx)(aR.X,{className:"h-5 w-5"})})]}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"mb-2 text-[10px] font-medium uppercase tracking-[0.2em] text-text-muted",children:"General"}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(a$,{keys:[`${aG()}+K`],label:"Open command palette"}),(0,b.jsx)(a$,{keys:["?"],label:"Show this reference"}),(0,b.jsx)(a$,{keys:["Esc"],label:"Close modal / palette"})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"mb-2 text-[10px] font-medium uppercase tracking-[0.2em] text-text-muted",children:"Fleet Navigation"}),(0,b.jsx)("div",{className:"space-y-1",children:aF.filter(a=>"navigation"===a.category).map(a=>(0,b.jsx)(a$,{keys:a.keys.map(a=>a.toUpperCase()),label:a.label},a.target))})]})]})]})]})]}):null}function a$({keys:a,label:c}){return(0,b.jsxs)("div",{className:"flex items-center justify-between py-1",children:[(0,b.jsx)("span",{className:"text-xs text-text",children:c}),(0,b.jsx)("div",{className:"flex gap-1",children:a.map((c,d)=>(0,b.jsxs)("span",{children:[(0,b.jsx)("kbd",{className:"rounded-chip border border-border bg-bg px-1.5 py-0.5 text-[11px] text-primary",children:c}),d<a.length-1&&(0,b.jsx)("span",{className:"mx-0.5 text-[10px] text-text-muted",children:"then"})]},d))})]})}let a_={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"}]]};a_.node;let a0=(0,r.f)(a_);var a1=a.i(47515);let a2="magnus.update-banner.dismissed";function a3(){let[a,d]=(0,c.useState)(null),[f,g]=(0,c.useState)(null);if((0,c.useEffect)(()=>{g(function(){try{return window.localStorage.getItem(a2)}catch{return null}}());let a=!1,b=()=>{aC.f.systemUpdates.get().then(b=>{a||d(b)}).catch(()=>void 0)};b();let c=window.setInterval(b,18e5);return()=>{a=!0,window.clearInterval(c)}},[]),!a)return null;let{server:h,agents:i}=a,j=i.behind.length,k=(0,a1.t)(i);if(!h.updateAvailable&&!h.latestMajor&&0===j)return null;let l=`${a.server.latest??""}|${a.server.latestMajor??""}|${a.agents.behind.length}|${a.agents.expected}`;return f===l?null:(0,b.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,b.jsx)("div",{className:"absolute inset-y-0 left-0 w-0.5 bg-warning"}),(0,b.jsx)("button",{type:"button","aria-label":"Dismiss",className:"absolute right-2 top-2 text-text-muted hover:text-text",onClick:()=>{try{window.localStorage.setItem(a2,l)}catch{}g(l)},children:(0,b.jsx)(aR.X,{className:"h-3.5 w-3.5"})}),(0,b.jsxs)("div",{className:"space-y-2 pr-6",children:[h.updateAvailable&&h.latest&&(0,b.jsxs)("div",{className:"flex items-start gap-2",children:[(0,b.jsx)(aB.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning"}),(0,b.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,b.jsxs)("p",{children:[(0,b.jsxs)("span",{className:"font-bold uppercase tracking-wider text-warning",children:["Magnus ",h.latest," is available"]}),(0,b.jsxs)("span",{className:"ml-2 text-text-muted",children:["running ",h.current,h.breaking?" · contains breaking changes":""]})]}),h.releases.filter(a=>a.summary).map(a=>(0,b.jsxs)("p",{className:"text-text-muted",children:[a.version,": ",a.summary," ",a.notesUrl&&(0,b.jsx)("a",{className:"text-primary underline",href:a.notesUrl,target:"_blank",rel:"noreferrer",children:"release notes"})]},a.version)),h.newRequiredEnv.length>0&&(0,b.jsxs)("p",{className:"text-text-muted",children:["New required settings:"," ",h.newRequiredEnv.map(a=>(0,b.jsxs)("code",{className:"mr-1 rounded bg-surface px-1",children:[a.name,"server"!==a.component?` (${a.component})`:""]},a.name)),h.newRequiredEnv.every(a=>a.secret)&&(0,b.jsxs)("span",{children:["(secrets: ",(0,b.jsx)("code",{children:"magnus upgrade --generate-secrets"})," fills them in)"]})]}),h.attention.length>0&&(0,b.jsxs)("p",{className:"text-warning",children:["Needs a maintenance window: ",h.attention.map(a=>`${a.name} (${a.impact}${a.note?`: ${a.note}`:""})`).join("; ")]}),(0,b.jsxs)("p",{className:"text-text-muted",children:["On the server host run ",(0,b.jsx)("code",{className:"rounded bg-surface px-1 text-text",children:h.command})," (backs up the database and reverts on failure)."]})]})]}),h.latestMajor&&(0,b.jsxs)("p",{className:"text-text-muted",children:["Magnus ",h.latestMajor," is a new major version. Major upgrades are never offered automatically; read UPGRADING.md first."]}),j>0&&(0,b.jsxs)("div",{className:"flex items-start gap-2",children:[(0,b.jsx)(a0,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning"}),(0,b.jsxs)("p",{children:[(0,b.jsxs)("span",{className:"font-bold uppercase tracking-wider text-warning",children:[j," agent",1===j?"":"s"," behind the server (",i.expected,")"]}),(0,b.jsxs)("span",{className:"ml-2 text-text-muted",children:[i.behind.slice(0,5).map(a=>`${a.name} ${a.version}`).join(", "),j>5?", …":"","."]})," ",i.upgradesEnabled?(0,b.jsx)(e.default,{href:"/nodes?upgrade=agents",className:"text-primary underline",children:k>0?"Review agent upgrades":"Upgrade agents"}):(0,b.jsx)("span",{className:"text-text-muted",children:"Agent upgrades are off on this server (MAGNUS_AGENT_UPGRADES=false)."}),k>0&&(0,b.jsxs)("span",{className:"ml-2 text-text-muted",children:[k," agent",1===k?" requires":"s require"," a manual major-version upgrade; the dialog only upgrades within the same major."]}),i.fixCommand&&0===k&&(0,b.jsxs)("span",{className:"ml-2 text-text-muted",children:["or run ",(0,b.jsx)("code",{className:"rounded bg-surface px-1 text-text",children:i.fixCommand})]})]})]})]})]})}var a4=a.i(26926);a.s(["DashboardShell",0,function({children:a,integrations:e}){let f=(0,d.usePathname)(),g="/login"===f,[h,i]=(0,c.useState)(!1);!function({enabled:a=!0}={}){let[b,d]=(0,c.useState)(!1),{addToast:e}=(0,a4.d)(),f=(0,c.useRef)(e);f.current=e;let g=(0,c.useRef)(null),h=(0,c.useRef)(null),i=(0,c.useCallback)(()=>{if(!a)return;let b=new EventSource("/api/proxy/events/stream");for(let a of(g.current=b,b.onopen=()=>{d(!0),ah.f.setConnected(!0)},["deploy:status","node:status","command:status","alert:fired"]))b.addEventListener(a,b=>{try{let c=JSON.parse(b.data),d=function(a){let b=a.type??"",c=a.nodeName??"Unknown";switch(b){case"deploy.started":return{title:`Deploying to ${c}`,severity:"info"};case"deploy.completed":return{title:`Deploy complete: ${c}`,severity:"success"};case"deploy.failed":return{title:`Deploy failed: ${c}`,message:a.message??void 0,severity:"error"};case"upgrade.started":return{title:`Upgrading ${c}`,severity:"info"};case"upgrade.completed":return{title:`Upgrade complete: ${c}`,message:`v${a.version}`,severity:"success"};case"upgrade.failed":return{title:`Upgrade failed: ${c}`,message:a.message??void 0,severity:"error"};case"node.recovered":return{title:`${c} back online`,message:`Recovered from ${a.previousStatus}`,severity:"success"};case"command.completed":return{title:"Command completed",message:`${a.command}`,severity:"success"};case"command.failed":return{title:"Command failed",message:`${a.command} (exit ${a.exitCode})`,severity:"error"};case"health.alert":return{title:`Alert: ${a.metric?.replaceAll("_"," ").toUpperCase()} on ${c}`,message:`${a.value?.toFixed(1)}% (threshold: ${a.threshold}%)`,severity:a.severity??"warning"};default:return null}}(c);d&&f.current(d),ah.f.push(d?{...d,channel:a}:{title:String(c.type??a).replaceAll("."," "),message:"string"==typeof c.nodeName?c.nodeName:void 0,severity:"info",channel:a})}catch{}});return b.onerror=()=>{d(!1),ah.f.setConnected(!1),b.close(),fetch("/api/auth/me",{cache:"no-store"}).then(a=>{if(g.current===b){if(401===a.status)return void window.location.replace("/login");h.current=setTimeout(i,5e3)}}).catch(()=>{g.current===b&&(h.current=setTimeout(i,5e3))})},b},[a]);(0,c.useEffect)(()=>{let a=i();return()=>{h.current&&clearTimeout(h.current),a?.close(),g.current?.close(),ah.f.setConnected(!1),g.current=null}},[i])}({enabled:!g}),(0,c.useEffect)(()=>{i(!1)},[f]);let j=(0,c.useCallback)(()=>i(a=>!a),[]);return g?(0,b.jsx)(b.Fragment,{children:a}):(0,b.jsxs)("div",{className:"flex h-screen overflow-hidden",children:[h&&(0,b.jsx)("div",{className:"fixed inset-0 z-40 bg-black/70 backdrop-blur-[2px] md:hidden",onClick:()=>i(!1)}),(0,b.jsx)("div",{className:`
|
|
2
2
|
fixed inset-y-0 left-0 z-50 transform transition-transform duration-200 ease-in-out md:relative md:h-full md:translate-x-0
|
|
3
3
|
${h?"translate-x-0":"-translate-x-full"}
|
|
4
4
|
`,children:(0,b.jsx)(am,{integrations:e})}),(0,b.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,b.jsx)(aI,{onMenuToggle:j}),(0,b.jsxs)("main",{className:"app-backdrop relative flex-1 overflow-y-auto p-3 md:p-6",children:[(0,b.jsx)(a3,{}),a]})]}),(0,b.jsx)(aZ,{})]})}],12737)},26926,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(68579),e=a.i(13412),f=a.i(52357),g=a.i(74215),h=a.i(11134);let i=(0,c.createContext)(null),j=0,k={info:{bar:"bg-primary",border:"border-primary/40",text:"text-primary",glow:"shadow-[0_0_20px_var(--color-glow)]",Icon:f.f},success:{bar:"bg-success",border:"border-success/40",text:"text-success",glow:"shadow-[0_0_20px_var(--color-glow-success)]",Icon:e.f},warning:{bar:"bg-warning",border:"border-warning/40",text:"text-warning",glow:"shadow-[0_0_20px_var(--color-glow-warning)]",Icon:d.f},error:{bar:"bg-danger",border:"border-danger/40",text:"text-danger",glow:"shadow-[0_0_20px_var(--color-glow-danger)]",Icon:h.f}};function l({toasts:a,onRemove:c}){return 0===a.length?null:(0,b.jsx)("div",{role:"status","aria-live":"polite",className:"fixed bottom-4 right-4 z-(--z-toast) flex max-w-sm flex-col gap-2",children:a.map(a=>{let d=k[a.severity],e=d.Icon;return(0,b.jsxs)("div",{className:`relative overflow-hidden rounded-panel border ${d.border} ${d.glow} bg-surface/95 py-3 pl-4 pr-3 text-text backdrop-blur-sm animate-toast-in`,children:[(0,b.jsx)("span",{"aria-hidden":"true",className:`absolute inset-y-0 left-0 w-0.5 ${d.bar}`}),(0,b.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,b.jsx)(e,{className:`mt-0.5 h-4 w-4 shrink-0 ${d.text}`,"aria-hidden":"true"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("p",{className:`text-xs font-bold uppercase leading-tight tracking-wider ${d.text}`,children:a.title}),a.message&&(0,b.jsx)("p",{className:"mt-1 line-clamp-2 text-[11px] text-text-muted",children:a.message})]}),(0,b.jsx)("button",{onClick:()=>c(a.id),"aria-label":"Dismiss notification",className:"ml-2 shrink-0 text-text-muted transition-colors hover:text-text",children:(0,b.jsx)(g.X,{className:"h-3.5 w-3.5"})})]}),(0,b.jsx)("span",{"aria-hidden":"true",className:`absolute bottom-0 left-0 h-px w-full origin-left opacity-60 ${d.bar}`,style:{animation:`toast-progress ${"error"===a.severity?10:6}s linear forwards`}})]},a.id)})})}a.s(["N",0,function({children:a}){let[d,e]=(0,c.useState)([]),f=(0,c.useCallback)(a=>{e(b=>b.filter(b=>b.id!==a))},[]),g=(0,c.useCallback)(a=>{let b=`toast-${++j}`,c={...a,id:b,createdAt:Date.now()};e(a=>[...a.slice(-9),c]),setTimeout(()=>f(b),"error"===a.severity?1e4:6e3)},[f]);return(0,b.jsxs)(i.Provider,{value:{toasts:d,addToast:g,removeToast:f},children:[a,(0,b.jsx)(l,{toasts:d,onRemove:f})]})},"d",0,function(){let a=(0,c.useContext)(i);if(!a)throw Error("useToast must be used within a ToastProvider");return a}])}];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[12456,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(38246),e=a.i(73771),f=a.i(49521),g=a.i(46997),h=a.i(19107),i=a.i(89027),j=a.i(90629),k=a.i(3512),l=a.i(19783),m=a.i(79675),n=a.i(33540),o=a.i(51675),p=a.i(74215),q=a.i(92378);let r=["*","cpu","memory","disk","swap"],s=["warning","critical"],t={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"},u={name:"",description:"",metric:"*",severityThreshold:"critical",agentDefinitionId:"diagnostics.v1",input:"",cooldownMinutes:60,maxConcurrentRuns:1,nodeFilter:"",enabled:!0};a.s(["default",0,function(){let[a,v]=(0,c.useState)([]),[w,x]=(0,c.useState)([]),[y,z]=(0,c.useState)(!0),[A,B]=(0,c.useState)(""),[C,D]=(0,c.useState)(!1),[E,F]=(0,c.useState)(null),[G,H]=(0,c.useState)(u),[I,J]=(0,c.useState)(!1),[K,L]=(0,c.useState)(null),[M,N]=(0,c.useState)(null),[O,P]=(0,c.useState)(null),[Q,R]=(0,c.useState)(null),[S,T]=(0,c.useState)("rules"),U=(0,c.useCallback)(async()=>{z(!0);try{let[a,b]=await Promise.allSettled([g.f.remediation.listRules(),g.f.remediation.listExecutions({pageSize:50})]);"fulfilled"===a.status&&v(a.value.data??[]),"fulfilled"===b.status&&x(b.value.data?.executions??[])}catch{}finally{z(!1)}},[]);(0,c.useEffect)(()=>{U()},[U]);let V=async()=>{J(!0);try{E?await g.f.remediation.updateRule(E,{...G,nodeFilter:G.nodeFilter||null}):await g.f.remediation.createRule({...G,nodeFilter:G.nodeFilter||void 0}),D(!1),F(null),H(u),await U()}catch{}finally{J(!1)}},W=async a=>{L(a),P(null);try{if(!(await g.f.remediation.deleteRule(a)).success)throw Error("The control API did not confirm deletion.");v(b=>b.filter(b=>b.id!==a)),N(null),R(b=>b===a?null:b)}catch(a){P(a instanceof Error?a.message:"Unable to delete this remediation rule.")}finally{L(null)}},X=async a=>{await g.f.remediation.updateRule(a.id,{enabled:!a.enabled}),await U()},Y=a.filter(a=>!A||a.name.toLowerCase().includes(A.toLowerCase())||a.description.toLowerCase().includes(A.toLowerCase()));return(0,b.jsxs)(e.U,{children:[(0,b.jsx)(e.z,{children:(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)(d.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,b.jsx)(h.f,{className:"h-3.5 w-3.5"}),"Back to anomalies"]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(q.f,{className:"h-5 w-5 text-primary"}),(0,b.jsx)("h1",{className:"text-2xl font-bold uppercase tracking-wider text-text",children:"Auto-Remediation"})]}),(0,b.jsx)("p",{className:"mt-1 text-xs uppercase tracking-wider text-text-muted",children:"Rules that record remediation decisions when anomalies are detected"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("button",{onClick:()=>void U(),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,b.jsx)(l.f,{className:`h-3.5 w-3.5 ${y?"animate-spin":""}`}),"Refresh"]}),"rules"===S&&(0,b.jsxs)("button",{onClick:()=>{D(!0),F(null),H(u)},className:"inline-flex items-center gap-2 rounded bg-primary px-3 py-2 text-xs font-semibold uppercase tracking-wider text-white hover:bg-primary/80",children:[(0,b.jsx)(k.f,{className:"h-3.5 w-3.5"}),"New Rule"]})]})]})}),(0,b.jsx)(e.z,{children:(0,b.jsxs)("div",{className:"flex gap-1 border-b border-border/50",children:[(0,b.jsxs)("button",{onClick:()=>T("rules"),className:`px-4 py-2 text-xs font-semibold uppercase tracking-wider transition-colors ${"rules"===S?"border-b-2 border-primary text-primary":"text-text-muted hover:text-text"}`,children:["Rules (",a.length,")"]}),(0,b.jsxs)("button",{onClick:()=>T("executions"),className:`px-4 py-2 text-xs font-semibold uppercase tracking-wider transition-colors ${"executions"===S?"border-b-2 border-primary text-primary":"text-text-muted hover:text-text"}`,children:["Executions (",w.length,")"]})]})}),C&&(0,b.jsx)(e.z,{children:(0,b.jsxs)(f.N,{className:"p-4",children:[(0,b.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,b.jsx)("h2",{className:"text-xs font-bold uppercase tracking-wider text-text-muted",children:E?"Edit Rule":"Create New Rule"}),(0,b.jsx)("button",{onClick:()=>{D(!1),F(null)},className:"text-text-muted hover:text-text",children:(0,b.jsx)(p.X,{className:"h-4 w-4"})})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Name *"}),(0,b.jsx)("input",{value:G.name,onChange:a=>H({...G,name:a.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,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Versioned runbook *"}),(0,b.jsxs)("select",{value:G.agentDefinitionId,onChange:a=>H({...G,agentDefinitionId:a.target.value}),className:"w-full rounded border border-border/50 bg-surface px-3 py-2 text-sm text-text",children:[(0,b.jsx)("option",{value:"diagnostics.v1",children:"diagnostics.v1 — uptime"}),(0,b.jsx)("option",{value:"restart-service.v1",children:"restart-service.v1 — approved application restart"})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Metric"}),(0,b.jsx)("select",{value:G.metric,onChange:a=>H({...G,metric:a.target.value}),className:"w-full rounded border border-border/50 bg-surface px-3 py-2 text-sm text-text",children:r.map(a=>(0,b.jsx)("option",{value:a,children:"*"===a?"All Metrics":a},a))})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Severity Threshold"}),(0,b.jsx)("select",{value:G.severityThreshold,onChange:a=>H({...G,severityThreshold:a.target.value}),className:"w-full rounded border border-border/50 bg-surface px-3 py-2 text-sm text-text",children:s.map(a=>(0,b.jsx)("option",{value:a,children:a},a))})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Cooldown (minutes)"}),(0,b.jsx)("input",{type:"number",min:1,max:10080,value:G.cooldownMinutes,onChange:a=>H({...G,cooldownMinutes:Number(a.target.value)}),className:"w-full rounded border border-border/50 bg-surface px-3 py-2 text-sm text-text"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Max Concurrent Runs"}),(0,b.jsx)("input",{type:"number",min:1,max:10,value:G.maxConcurrentRuns,onChange:a=>H({...G,maxConcurrentRuns:Number(a.target.value)}),className:"w-full rounded border border-border/50 bg-surface px-3 py-2 text-sm text-text"})]}),(0,b.jsxs)("div",{className:"sm:col-span-2",children:[(0,b.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Description"}),(0,b.jsx)("input",{value:G.description,onChange:a=>H({...G,description:a.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,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Node Filter"}),(0,b.jsx)("input",{value:G.nodeFilter,onChange:a=>H({...G,nodeFilter:a.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,b.jsxs)("div",{className:"sm:col-span-2 lg:col-span-3",children:[(0,b.jsxs)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:["Runbook configuration (JSON) ",(0,b.jsxs)("span",{className:"normal-case font-normal",children:["(supports ","{{metric}}",", ","{{value}}",", ","{{nodeId}}",", ","{{nodeName}}",", ","{{zScore}}",", ","{{severity}}",")"]})]}),(0,b.jsx)("textarea",{value:G.input,onChange:a=>H({...G,input:a.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,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{type:"checkbox",checked:G.enabled,onChange:a=>H({...G,enabled:a.target.checked}),id:"rule-enabled",className:"rounded border-border"}),(0,b.jsx)("label",{htmlFor:"rule-enabled",className:"text-xs uppercase tracking-wider text-text-muted",children:"Enabled"})]})]}),(0,b.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,b.jsxs)("button",{onClick:()=>void V(),disabled:I||!G.name||!G.agentDefinitionId,className:"inline-flex items-center gap-2 rounded bg-primary px-4 py-2 text-xs font-semibold uppercase tracking-wider text-white hover:bg-primary/80 disabled:opacity-50",children:[(0,b.jsx)(m.f,{className:"h-3.5 w-3.5"}),I?"Saving…":E?"Update":"Create"]}),(0,b.jsx)("button",{onClick:()=>{D(!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"===S&&(0,b.jsx)(e.z,{children:(0,b.jsxs)(f.N,{className:"p-4",children:[(0,b.jsx)("div",{className:"mb-4 flex items-center gap-3",children:(0,b.jsxs)("div",{className:"relative flex-1",children:[(0,b.jsx)(n.f,{className:"absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-text-muted"}),(0,b.jsx)("input",{value:A,onChange:a=>B(a.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,b.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,b.jsx)("span",{children:O}),(0,b.jsx)("button",{onClick:()=>P(null),className:"font-semibold uppercase tracking-wider hover:text-danger",children:"Dismiss"})]}),0===Y.length?(0,b.jsx)("p",{className:"py-8 text-center text-sm text-text-muted",children:0===a.length?"No remediation rules defined. Create one to get started.":"No rules match your search."}):(0,b.jsxs)("table",{className:"w-full",children:[(0,b.jsx)("thead",{children:(0,b.jsxs)("tr",{className:"border-b border-border/50 text-left",children:[(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Rule"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Metric"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Threshold"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Cooldown"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Runs"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Status"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Actions"})]})}),(0,b.jsx)("tbody",{className:"divide-y divide-border/30",children:Y.map(a=>(0,b.jsxs)(c.Fragment,{children:[(0,b.jsxs)("tr",{className:"cursor-pointer hover:bg-surface-hover/50 transition-colors",onClick:()=>R(Q===a.id?null:a.id),children:[(0,b.jsx)("td",{className:"py-3 pr-3",children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.f,{className:`h-3.5 w-3.5 text-text-muted transition-transform ${Q===a.id?"rotate-180":""}`}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-sm font-semibold text-text",children:a.name}),a.description&&(0,b.jsx)("p",{className:"text-xs text-text-muted",children:a.description})]})]})}),(0,b.jsx)("td",{className:"py-3 pr-3",children:(0,b.jsx)("span",{className:"rounded bg-surface px-2 py-0.5 text-xs font-mono text-text-muted",children:"*"===a.metric?"all":a.metric})}),(0,b.jsx)("td",{className:"py-3 pr-3",children:(0,b.jsx)("span",{className:`rounded px-2 py-0.5 text-xs ${"critical"===a.severityThreshold?"bg-danger/20 text-danger":"bg-warning/20 text-warning"}`,children:a.severityThreshold})}),(0,b.jsxs)("td",{className:"py-3 pr-3 text-xs text-text-muted",children:[a.cooldownMinutes,"m"]}),(0,b.jsx)("td",{className:"py-3 pr-3 text-xs text-text-muted",children:a._count?.executions??0}),(0,b.jsx)("td",{className:"py-3 pr-3",children:(0,b.jsx)("button",{onClick:b=>{b.stopPropagation(),X(a)},className:`rounded px-2 py-0.5 text-xs font-semibold ${a.enabled?"bg-success/20 text-success":"bg-text-muted/20 text-text-muted"}`,children:a.enabled?"active":"disabled"})}),(0,b.jsx)("td",{className:"py-3",children:(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsx)("button",{onClick:b=>{b.stopPropagation(),H({name:a.name,description:a.description,metric:a.metric,severityThreshold:a.severityThreshold,agentDefinitionId:a.agentDefinitionId,input:a.input,cooldownMinutes:a.cooldownMinutes,maxConcurrentRuns:a.maxConcurrentRuns,nodeFilter:a.nodeFilter??"",enabled:a.enabled}),F(a.id),D(!0)},title:"Edit",className:"rounded p-1.5 text-text-muted hover:bg-surface hover:text-primary",children:(0,b.jsx)(j.f,{className:"h-3.5 w-3.5"})}),M===a.id?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("button",{onClick:b=>{b.stopPropagation(),W(a.id)},disabled:K===a.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:K===a.id?"Deleting…":"Delete"}),(0,b.jsx)("button",{onClick:a=>{a.stopPropagation(),N(null)},title:"Cancel delete",className:"rounded p-1.5 text-text-muted hover:bg-surface hover:text-text",children:(0,b.jsx)(p.X,{className:"h-3.5 w-3.5"})})]}):(0,b.jsx)("button",{onClick:b=>{b.stopPropagation(),P(null),N(a.id)},title:"Delete",className:"rounded p-1.5 text-text-muted hover:bg-surface hover:text-danger",children:(0,b.jsx)(o.f,{className:"h-3.5 w-3.5"})})]})})]},a.id),Q===a.id&&(0,b.jsx)("tr",{children:(0,b.jsx)("td",{colSpan:7,className:"border-b border-border/30 bg-surface/30 px-6 py-4",children:(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-xs lg:grid-cols-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-text-muted uppercase tracking-wider",children:"Versioned runbook"}),(0,b.jsx)("p",{className:"mt-1 font-mono text-text",children:a.agentDefinitionId})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-text-muted uppercase tracking-wider",children:"Max Concurrent"}),(0,b.jsx)("p",{className:"mt-1 text-text",children:a.maxConcurrentRuns})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-text-muted uppercase tracking-wider",children:"Node Filter"}),(0,b.jsx)("p",{className:"mt-1 text-text font-mono",children:a.nodeFilter??"none"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-text-muted uppercase tracking-wider",children:"Created"}),(0,b.jsx)("p",{className:"mt-1 text-text",children:new Date(a.createdAt).toLocaleString()})]}),a.input&&(0,b.jsxs)("div",{className:"col-span-2 lg:col-span-4",children:[(0,b.jsx)("p",{className:"text-text-muted uppercase tracking-wider",children:"Runbook configuration (JSON)"}),(0,b.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:a.input})]})]})})})]},a.id))})]})]})}),"executions"===S&&(0,b.jsx)(e.z,{children:(0,b.jsx)(f.N,{className:"p-4",children:0===w.length?(0,b.jsx)("p",{className:"py-8 text-center text-sm text-text-muted",children:"No remediation executions yet."}):(0,b.jsxs)("table",{className:"w-full",children:[(0,b.jsx)("thead",{children:(0,b.jsxs)("tr",{className:"border-b border-border/50 text-left",children:[(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Rule"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Node"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Status"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Legacy Run"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Triggered"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Input"})]})}),(0,b.jsx)("tbody",{className:"divide-y divide-border/30",children:w.map(a=>(0,b.jsxs)("tr",{className:"hover:bg-surface-hover/50",children:[(0,b.jsx)("td",{className:"py-3 pr-3 text-sm text-text",children:a.rule?.name??a.ruleId}),(0,b.jsx)("td",{className:"py-3 pr-3 text-xs font-mono text-text-muted",children:a.nodeId}),(0,b.jsx)("td",{className:"py-3 pr-3",children:(0,b.jsx)("span",{className:`rounded px-2 py-0.5 text-xs font-semibold ${t[a.status]??""}`,children:a.status})}),(0,b.jsx)("td",{className:"py-3 pr-3",children:a.orchestraRunId?(0,b.jsxs)("span",{className:"text-xs font-mono text-text-muted",children:[a.orchestraRunId.slice(0,12),"…"]}):(0,b.jsx)("span",{className:"text-xs text-text-muted",children:"—"})}),(0,b.jsx)("td",{className:"py-3 pr-3 text-xs text-text-muted",children:new Date(a.triggeredAt).toLocaleString()}),(0,b.jsxs)("td",{className:"py-3 text-xs text-text-muted max-w-xs",children:[(0,b.jsxs)("details",{children:[(0,b.jsx)("summary",{children:"Review plan and outcome"}),(0,b.jsx)("pre",{className:"whitespace-pre-wrap",children:a.input}),(0,b.jsx)("pre",{className:"whitespace-pre-wrap",children:a.output})]}),"pending_approval"===a.status&&(0,b.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(a.id)}/approve`,{method:"POST"}).then(async a=>{if(!a.ok)throw Error(`Approval failed: HTTP ${a.status}`);window.location.reload()}).catch(a=>P(String(a)))},children:"Approve displayed plan"})]})]},a.id))})]})})})]})}])}];
|
|
1
|
+
module.exports=[12456,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(38246),e=a.i(73771),f=a.i(49521),g=a.i(46997),h=a.i(19107),i=a.i(89027),j=a.i(90629),k=a.i(3512),l=a.i(19783),m=a.i(79675),n=a.i(33540),o=a.i(51675),p=a.i(74215),q=a.i(92378);let r=["*","cpu","memory","disk","swap"],s=["warning","critical"],t={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"},u={name:"",description:"",metric:"*",severityThreshold:"critical",agentDefinitionId:"diagnostics.v1",input:"",cooldownMinutes:60,maxConcurrentRuns:1,nodeFilter:"",enabled:!0};a.s(["default",0,function(){let[a,v]=(0,c.useState)([]),[w,x]=(0,c.useState)([]),[y,z]=(0,c.useState)(!0),[A,B]=(0,c.useState)(""),[C,D]=(0,c.useState)(!1),[E,F]=(0,c.useState)(null),[G,H]=(0,c.useState)(u),[I,J]=(0,c.useState)(!1),[K,L]=(0,c.useState)(null),[M,N]=(0,c.useState)(null),[O,P]=(0,c.useState)(null),[Q,R]=(0,c.useState)(null),[S,T]=(0,c.useState)("rules"),U=(0,c.useCallback)(async()=>{z(!0);try{let[a,b]=await Promise.allSettled([g.f.remediation.listRules(),g.f.remediation.listExecutions({pageSize:50})]);"fulfilled"===a.status&&v(a.value.data??[]),"fulfilled"===b.status&&x(b.value.data?.executions??[])}catch{}finally{z(!1)}},[]);(0,c.useEffect)(()=>{U()},[U]);let V=async()=>{J(!0);try{E?await g.f.remediation.updateRule(E,{...G,nodeFilter:G.nodeFilter||null}):await g.f.remediation.createRule({...G,nodeFilter:G.nodeFilter||void 0}),D(!1),F(null),H(u),await U()}catch{}finally{J(!1)}},W=async a=>{L(a),P(null);try{if(!(await g.f.remediation.deleteRule(a)).success)throw Error("The control API did not confirm deletion.");v(b=>b.filter(b=>b.id!==a)),N(null),R(b=>b===a?null:b)}catch(a){P(a instanceof Error?a.message:"Unable to delete this remediation rule.")}finally{L(null)}},X=async a=>{await g.f.remediation.updateRule(a.id,{enabled:!a.enabled}),await U()},Y=a.filter(a=>!A||a.name.toLowerCase().includes(A.toLowerCase())||a.description.toLowerCase().includes(A.toLowerCase()));return(0,b.jsxs)(e.U,{children:[(0,b.jsx)(e.z,{children:(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)(d.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,b.jsx)(h.f,{className:"h-3.5 w-3.5"}),"Back to anomalies"]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(q.f,{className:"h-5 w-5 text-primary"}),(0,b.jsx)("h1",{className:"text-2xl font-bold uppercase tracking-wider text-text",children:"Auto-Remediation"})]}),(0,b.jsx)("p",{className:"mt-1 text-xs uppercase tracking-wider text-text-muted",children:"Rules that record remediation decisions when anomalies are detected"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("button",{onClick:()=>void U(),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,b.jsx)(l.f,{className:`h-3.5 w-3.5 ${y?"animate-spin":""}`}),"Refresh"]}),"rules"===S&&(0,b.jsxs)("button",{onClick:()=>{D(!0),F(null),H(u)},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,b.jsx)(k.f,{className:"h-3.5 w-3.5"}),"New Rule"]})]})]})}),(0,b.jsx)(e.z,{children:(0,b.jsxs)("div",{className:"flex gap-1 border-b border-border/50",children:[(0,b.jsxs)("button",{onClick:()=>T("rules"),className:`px-4 py-2 text-xs font-semibold uppercase tracking-wider transition-colors ${"rules"===S?"border-b-2 border-primary text-primary":"text-text-muted hover:text-text"}`,children:["Rules (",a.length,")"]}),(0,b.jsxs)("button",{onClick:()=>T("executions"),className:`px-4 py-2 text-xs font-semibold uppercase tracking-wider transition-colors ${"executions"===S?"border-b-2 border-primary text-primary":"text-text-muted hover:text-text"}`,children:["Executions (",w.length,")"]})]})}),C&&(0,b.jsx)(e.z,{children:(0,b.jsxs)(f.N,{className:"p-4",children:[(0,b.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,b.jsx)("h2",{className:"text-xs font-bold uppercase tracking-wider text-text-muted",children:E?"Edit Rule":"Create New Rule"}),(0,b.jsx)("button",{onClick:()=>{D(!1),F(null)},className:"text-text-muted hover:text-text",children:(0,b.jsx)(p.X,{className:"h-4 w-4"})})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Name *"}),(0,b.jsx)("input",{value:G.name,onChange:a=>H({...G,name:a.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,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Versioned runbook *"}),(0,b.jsxs)("select",{value:G.agentDefinitionId,onChange:a=>H({...G,agentDefinitionId:a.target.value}),className:"w-full rounded border border-border/50 bg-surface px-3 py-2 text-sm text-text",children:[(0,b.jsx)("option",{value:"diagnostics.v1",children:"diagnostics.v1 — uptime"}),(0,b.jsx)("option",{value:"restart-service.v1",children:"restart-service.v1 — approved application restart"})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Metric"}),(0,b.jsx)("select",{value:G.metric,onChange:a=>H({...G,metric:a.target.value}),className:"w-full rounded border border-border/50 bg-surface px-3 py-2 text-sm text-text",children:r.map(a=>(0,b.jsx)("option",{value:a,children:"*"===a?"All Metrics":a},a))})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Severity Threshold"}),(0,b.jsx)("select",{value:G.severityThreshold,onChange:a=>H({...G,severityThreshold:a.target.value}),className:"w-full rounded border border-border/50 bg-surface px-3 py-2 text-sm text-text",children:s.map(a=>(0,b.jsx)("option",{value:a,children:a},a))})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Cooldown (minutes)"}),(0,b.jsx)("input",{type:"number",min:1,max:10080,value:G.cooldownMinutes,onChange:a=>H({...G,cooldownMinutes:Number(a.target.value)}),className:"w-full rounded border border-border/50 bg-surface px-3 py-2 text-sm text-text"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Max Concurrent Runs"}),(0,b.jsx)("input",{type:"number",min:1,max:10,value:G.maxConcurrentRuns,onChange:a=>H({...G,maxConcurrentRuns:Number(a.target.value)}),className:"w-full rounded border border-border/50 bg-surface px-3 py-2 text-sm text-text"})]}),(0,b.jsxs)("div",{className:"sm:col-span-2",children:[(0,b.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Description"}),(0,b.jsx)("input",{value:G.description,onChange:a=>H({...G,description:a.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,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:"Node Filter"}),(0,b.jsx)("input",{value:G.nodeFilter,onChange:a=>H({...G,nodeFilter:a.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,b.jsxs)("div",{className:"sm:col-span-2 lg:col-span-3",children:[(0,b.jsxs)("label",{className:"block text-xs uppercase tracking-wider text-text-muted mb-1",children:["Runbook configuration (JSON) ",(0,b.jsxs)("span",{className:"normal-case font-normal",children:["(supports ","{{metric}}",", ","{{value}}",", ","{{nodeId}}",", ","{{nodeName}}",", ","{{zScore}}",", ","{{severity}}",")"]})]}),(0,b.jsx)("textarea",{value:G.input,onChange:a=>H({...G,input:a.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,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{type:"checkbox",checked:G.enabled,onChange:a=>H({...G,enabled:a.target.checked}),id:"rule-enabled",className:"rounded border-border"}),(0,b.jsx)("label",{htmlFor:"rule-enabled",className:"text-xs uppercase tracking-wider text-text-muted",children:"Enabled"})]})]}),(0,b.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,b.jsxs)("button",{onClick:()=>void V(),disabled:I||!G.name||!G.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,b.jsx)(m.f,{className:"h-3.5 w-3.5"}),I?"Saving…":E?"Update":"Create"]}),(0,b.jsx)("button",{onClick:()=>{D(!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"===S&&(0,b.jsx)(e.z,{children:(0,b.jsxs)(f.N,{className:"p-4",children:[(0,b.jsx)("div",{className:"mb-4 flex items-center gap-3",children:(0,b.jsxs)("div",{className:"relative flex-1",children:[(0,b.jsx)(n.f,{className:"absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-text-muted"}),(0,b.jsx)("input",{value:A,onChange:a=>B(a.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,b.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,b.jsx)("span",{children:O}),(0,b.jsx)("button",{onClick:()=>P(null),className:"font-semibold uppercase tracking-wider hover:text-danger",children:"Dismiss"})]}),0===Y.length?(0,b.jsx)("p",{className:"py-8 text-center text-sm text-text-muted",children:0===a.length?"No remediation rules defined. Create one to get started.":"No rules match your search."}):(0,b.jsxs)("table",{className:"w-full",children:[(0,b.jsx)("thead",{children:(0,b.jsxs)("tr",{className:"border-b border-border/50 text-left",children:[(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Rule"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Metric"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Threshold"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Cooldown"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Runs"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Status"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Actions"})]})}),(0,b.jsx)("tbody",{className:"divide-y divide-border/30",children:Y.map(a=>(0,b.jsxs)(c.Fragment,{children:[(0,b.jsxs)("tr",{className:"cursor-pointer hover:bg-surface-hover/50 transition-colors",onClick:()=>R(Q===a.id?null:a.id),children:[(0,b.jsx)("td",{className:"py-3 pr-3",children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.f,{className:`h-3.5 w-3.5 text-text-muted transition-transform ${Q===a.id?"rotate-180":""}`}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-sm font-semibold text-text",children:a.name}),a.description&&(0,b.jsx)("p",{className:"text-xs text-text-muted",children:a.description})]})]})}),(0,b.jsx)("td",{className:"py-3 pr-3",children:(0,b.jsx)("span",{className:"rounded bg-surface px-2 py-0.5 text-xs font-mono text-text-muted",children:"*"===a.metric?"all":a.metric})}),(0,b.jsx)("td",{className:"py-3 pr-3",children:(0,b.jsx)("span",{className:`rounded px-2 py-0.5 text-xs ${"critical"===a.severityThreshold?"bg-danger/20 text-danger":"bg-warning/20 text-warning"}`,children:a.severityThreshold})}),(0,b.jsxs)("td",{className:"py-3 pr-3 text-xs text-text-muted",children:[a.cooldownMinutes,"m"]}),(0,b.jsx)("td",{className:"py-3 pr-3 text-xs text-text-muted",children:a._count?.executions??0}),(0,b.jsx)("td",{className:"py-3 pr-3",children:(0,b.jsx)("button",{onClick:b=>{b.stopPropagation(),X(a)},className:`rounded px-2 py-0.5 text-xs font-semibold ${a.enabled?"bg-success/20 text-success":"bg-text-muted/20 text-text-muted"}`,children:a.enabled?"active":"disabled"})}),(0,b.jsx)("td",{className:"py-3",children:(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsx)("button",{onClick:b=>{b.stopPropagation(),H({name:a.name,description:a.description,metric:a.metric,severityThreshold:a.severityThreshold,agentDefinitionId:a.agentDefinitionId,input:a.input,cooldownMinutes:a.cooldownMinutes,maxConcurrentRuns:a.maxConcurrentRuns,nodeFilter:a.nodeFilter??"",enabled:a.enabled}),F(a.id),D(!0)},title:"Edit",className:"rounded p-1.5 text-text-muted hover:bg-surface hover:text-primary",children:(0,b.jsx)(j.f,{className:"h-3.5 w-3.5"})}),M===a.id?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("button",{onClick:b=>{b.stopPropagation(),W(a.id)},disabled:K===a.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:K===a.id?"Deleting…":"Delete"}),(0,b.jsx)("button",{onClick:a=>{a.stopPropagation(),N(null)},title:"Cancel delete",className:"rounded p-1.5 text-text-muted hover:bg-surface hover:text-text",children:(0,b.jsx)(p.X,{className:"h-3.5 w-3.5"})})]}):(0,b.jsx)("button",{onClick:b=>{b.stopPropagation(),P(null),N(a.id)},title:"Delete",className:"rounded p-1.5 text-text-muted hover:bg-surface hover:text-danger",children:(0,b.jsx)(o.f,{className:"h-3.5 w-3.5"})})]})})]},a.id),Q===a.id&&(0,b.jsx)("tr",{children:(0,b.jsx)("td",{colSpan:7,className:"border-b border-border/30 bg-surface/30 px-6 py-4",children:(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-xs lg:grid-cols-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-text-muted uppercase tracking-wider",children:"Versioned runbook"}),(0,b.jsx)("p",{className:"mt-1 font-mono text-text",children:a.agentDefinitionId})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-text-muted uppercase tracking-wider",children:"Max Concurrent"}),(0,b.jsx)("p",{className:"mt-1 text-text",children:a.maxConcurrentRuns})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-text-muted uppercase tracking-wider",children:"Node Filter"}),(0,b.jsx)("p",{className:"mt-1 text-text font-mono",children:a.nodeFilter??"none"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-text-muted uppercase tracking-wider",children:"Created"}),(0,b.jsx)("p",{className:"mt-1 text-text",children:new Date(a.createdAt).toLocaleString()})]}),a.input&&(0,b.jsxs)("div",{className:"col-span-2 lg:col-span-4",children:[(0,b.jsx)("p",{className:"text-text-muted uppercase tracking-wider",children:"Runbook configuration (JSON)"}),(0,b.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:a.input})]})]})})})]},a.id))})]})]})}),"executions"===S&&(0,b.jsx)(e.z,{children:(0,b.jsx)(f.N,{className:"p-4",children:0===w.length?(0,b.jsx)("p",{className:"py-8 text-center text-sm text-text-muted",children:"No remediation executions yet."}):(0,b.jsxs)("table",{className:"w-full",children:[(0,b.jsx)("thead",{children:(0,b.jsxs)("tr",{className:"border-b border-border/50 text-left",children:[(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Rule"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Node"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Status"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Legacy Run"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Triggered"}),(0,b.jsx)("th",{className:"pb-2 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Input"})]})}),(0,b.jsx)("tbody",{className:"divide-y divide-border/30",children:w.map(a=>(0,b.jsxs)("tr",{className:"hover:bg-surface-hover/50",children:[(0,b.jsx)("td",{className:"py-3 pr-3 text-sm text-text",children:a.rule?.name??a.ruleId}),(0,b.jsx)("td",{className:"py-3 pr-3 text-xs font-mono text-text-muted",children:a.nodeId}),(0,b.jsx)("td",{className:"py-3 pr-3",children:(0,b.jsx)("span",{className:`rounded px-2 py-0.5 text-xs font-semibold ${t[a.status]??""}`,children:a.status})}),(0,b.jsx)("td",{className:"py-3 pr-3",children:a.orchestraRunId?(0,b.jsxs)("span",{className:"text-xs font-mono text-text-muted",children:[a.orchestraRunId.slice(0,12),"…"]}):(0,b.jsx)("span",{className:"text-xs text-text-muted",children:"—"})}),(0,b.jsx)("td",{className:"py-3 pr-3 text-xs text-text-muted",children:new Date(a.triggeredAt).toLocaleString()}),(0,b.jsxs)("td",{className:"py-3 text-xs text-text-muted max-w-xs",children:[(0,b.jsxs)("details",{children:[(0,b.jsx)("summary",{children:"Review plan and outcome"}),(0,b.jsx)("pre",{className:"whitespace-pre-wrap",children:a.input}),(0,b.jsx)("pre",{className:"whitespace-pre-wrap",children:a.output})]}),"pending_approval"===a.status&&(0,b.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(a.id)}/approve`,{method:"POST"}).then(async a=>{if(!a.ok)throw Error(`Approval failed: HTTP ${a.status}`);window.location.reload()}).catch(a=>P(String(a)))},children:"Approve displayed plan"})]})]},a.id))})]})})})]})}])}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=apps_dashboard_src_app_anomalies_remediation_page_tsx_179m33swiclif._.js.map
|