@hivemagnus/magnus-ui 2.2.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/apps/dashboard/.next/BUILD_ID +1 -1
- package/dist/app/apps/dashboard/.next/build-manifest.json +3 -3
- package/dist/app/apps/dashboard/.next/prerender-manifest.json +3 -3
- package/dist/app/apps/dashboard/.next/required-server-files.json +2 -2
- package/dist/app/apps/dashboard/.next/server/app/_global-error.html +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/api/federation/route.js.nft.json +1 -1
- 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.nft.json +1 -1
- 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/open/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.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/installations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/installations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/codex/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/commands/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/commands/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page/server-reference-manifest.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/cron/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/files/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/files/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-map/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-map/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/operations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/operations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-security/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/hermes-security/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/incidents/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/incidents/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/library/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/library/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/login/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/logs/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/logs/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/mission-control/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/mission-control/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/notifications/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/notifications/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/retention/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/retention/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/roles/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/roles/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/rollouts/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/rollouts/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page/server-reference-manifest.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/page.js.nft.json +1 -1
- package/dist/app/apps/dashboard/.next/server/app/webhooks/page_client-reference-manifest.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/[root-of-the-server]__0ywmf3079vsm1._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/_0h965a-fek_i1._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/node_modules_undici_0153f0xi5kile._.js +22 -22
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__06giq9g4me8eh._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__08sgyyf_y8ab8._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__19dmibalml_q2._.js → [root-of-the-server]__10vc7d7dh2ka_._.js} +2 -2
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__11pe-l2-ko65_._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/_0caxc2bc6a__r._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/_0zol97z2lda9q._.js +3 -0
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/_0zsjpnu4iitoz._.js +16 -16
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/{_0tyfybw4cwmxv._.js → _1lipj7zmf74tu._.js} +2 -2
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/_1oebzzj_en62h._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_0gs_s688kgg1i._.js +1 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_ardent_installations_page_tsx_0nvqgacugy6nf._.js +55 -1
- package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_codex_page_tsx_113aas0vmxegr._.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_fleet-map_fleet-map-client_tsx_0o9ktvw_xeu8a._.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_components_codex_codex-installation-card_tsx_20v0b-0t6my-y._.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/{3n9nsatm9lrk8.js → 0_75wyrqh7omi.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{19_hix1d_w6vr.js → 0bdwaa-gcbm6a.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{1ztuenv_pp670.js → 0mhs36fc5ripg.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/1cvbtmsr4d3ci.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/26fuqy0r81cza.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/2o571f4u8yu32.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/2p-sasidykf0f.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{1e5a3gxtsgzed.js → 2vgtxp4b-8c6n.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/{17z-cy_rf1l5a.js → 2zki4nlgdwpfl.js} +1 -1
- package/dist/app/apps/dashboard/.next/static/chunks/360b5_u5zcl9r.js +55 -0
- package/dist/app/apps/dashboard/.next/static/chunks/369vzlcjad-gn.js +1 -0
- package/dist/app/apps/dashboard/.next/static/chunks/{3-jcbc2evimy5.js → 3ul4dqvza008-.js} +1 -1
- package/dist/app/apps/dashboard/package.json +2 -2
- package/dist/app/apps/dashboard/server.js +1 -1
- package/package.json +2 -2
- package/dist/app/apps/dashboard/.next/static/chunks/10sblx9kmg2o-.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/13mwv5xf7s8jd.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/1ij544xwbs-1c.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/1kmml-dozyyi6.js +0 -1
- package/dist/app/apps/dashboard/.next/static/chunks/3m8d_tlzqof67.js +0 -1
- /package/dist/app/apps/dashboard/.next/static/{CCDUx7h84YYg-fH10xGhY → s5JFh7Z_OmRjn5SA7qS5f}/_buildManifest.js +0 -0
- /package/dist/app/apps/dashboard/.next/static/{CCDUx7h84YYg-fH10xGhY → s5JFh7Z_OmRjn5SA7qS5f}/_clientMiddlewareManifest.js +0 -0
- /package/dist/app/apps/dashboard/.next/static/{CCDUx7h84YYg-fH10xGhY → s5JFh7Z_OmRjn5SA7qS5f}/_ssgManifest.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"previewModeId": "
|
|
3
|
-
"previewModeSigningKey": "
|
|
4
|
-
"previewModeEncryptionKey": "
|
|
2
|
+
"previewModeId": "8e69815967598ff038b636d098906abe",
|
|
3
|
+
"previewModeSigningKey": "0b511f651f312c2c8c707b6fe2f5c4a81ddfd3478ef51a91f506fb4aa249b012",
|
|
4
|
+
"previewModeEncryptionKey": "9d837f482c8a617c27e52c590a79ce08ea5d70377144e6d2ce3ad494d18e9251"
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
self.__RSC_SERVER_MANIFEST="{\n \"node\": {\n \"
|
|
1
|
+
self.__RSC_SERVER_MANIFEST="{\n \"node\": {\n \"404247fb89c255d07f0767c3d59218c0b407995018\": {\n \"workers\": {\n \"app/cron/page\": {\n \"moduleId\": 80202,\n \"async\": false\n }\n },\n \"filename\": \"apps/dashboard/src/app/actions/scan.ts\",\n \"exportedName\": \"scanCron\"\n },\n \"409445774e710341a53728436eb727de46381899a7\": {\n \"workers\": {\n \"app/skills/page\": {\n \"moduleId\": 28111,\n \"async\": false\n }\n },\n \"filename\": \"apps/dashboard/src/app/actions/scan.ts\",\n \"exportedName\": \"scanSkills\"\n }\n },\n \"edge\": {},\n \"encryptionKey\": \"Y8iuEj3tIUzPFFejTDWSMSW47AI6YGTMRpVoNR/oWlc=\"\n}"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"node": {
|
|
3
|
-
"
|
|
3
|
+
"404247fb89c255d07f0767c3d59218c0b407995018": {
|
|
4
4
|
"workers": {
|
|
5
5
|
"app/cron/page": {
|
|
6
6
|
"moduleId": 80202,
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"filename": "apps/dashboard/src/app/actions/scan.ts",
|
|
11
11
|
"exportedName": "scanCron"
|
|
12
12
|
},
|
|
13
|
-
"
|
|
13
|
+
"409445774e710341a53728436eb727de46381899a7": {
|
|
14
14
|
"workers": {
|
|
15
15
|
"app/skills/page": {
|
|
16
16
|
"moduleId": 28111,
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"edge": {},
|
|
25
|
-
"encryptionKey": "
|
|
25
|
+
"encryptionKey": "Y8iuEj3tIUzPFFejTDWSMSW47AI6YGTMRpVoNR/oWlc="
|
|
26
26
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,82983,34479,e=>{"use strict";class t extends Error{name="KyError";get isKyError(){return!0}}class s extends t{name="HTTPError";response;request;options;data;constructor(e,t,s){let r=e.status||0===e.status?e.status:"",o=e.statusText??"",i=`${r} ${o}`.trim(),a=i?`status code ${i}`:"an unknown error";super(`Request failed with ${a}: ${t.method} ${t.url}`),this.response=e,this.request=t,this.options=s}}class r extends t{name="NetworkError";request;constructor(e,t){super(`Request failed due to a network error: ${e.method} ${e.url}`,t),this.request=e}}let o=e=>null!==e&&"object"==typeof e,i=e=>o(e)&&!Array.isArray(e),a=e=>"number"==typeof e&&e>=0,n=Object.prototype.toString,l=e=>e instanceof Error||"[object Error]"===n.call(e),h=e=>e instanceof globalThis.Request||"[object Request]"===n.call(e),u=e=>e instanceof globalThis.Response||"[object Response]"===n.call(e);class c extends Error{static wrap(e){return l(e)?e:new c(e)}name="NonError";value;constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),this.value=e}}class d extends t{name="ForceRetryError";customDelay;code;customRequest;constructor(e){if(null===e)throw TypeError("The `ky.retry()` options must be an object");let t=e?.delay;if(void 0!==t&&!a(t))throw TypeError("The `ky.retry()` `delay` option must be a non-negative number or `Infinity`");if(e?.code!==void 0&&"string"!=typeof e.code)throw TypeError("The `ky.retry()` `code` option must be a string");if(e?.request!==void 0&&!h(e.request))throw TypeError("The `ky.retry()` `request` option must be a `Request`");let s=e?.cause===void 0?void 0:c.wrap(e.cause);super(e?.code===void 0?"Forced retry":`Forced retry: ${e.code}`,s?{cause:s}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}}class p extends Error{name="SchemaValidationError";issues;constructor(e){super("Response schema validation failed"),this.issues=e}}class f extends t{name="TimeoutError";request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.request=e}}let g=(()=>{let e=!1,t=!1,s="function"==typeof globalThis.Request;if("function"==typeof globalThis.ReadableStream&&s)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch{return!1}let r="Bun"in globalThis||"Deno"in globalThis;return(e||r)&&!t})(),m="function"==typeof globalThis.AbortController,y="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,b="function"==typeof globalThis.ReadableStream,w="function"==typeof globalThis.FormData,v=["get","post","put","patch","head","delete","query"],T={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},R=()=>Object.keys(T).filter(e=>"bytes"!==e||"function"==typeof globalThis.Response?.prototype?.bytes),$=Symbol.for("ky.stop");class k{get isRetryMarker(){return!0}options;constructor(e){this.options=e}}let q=e=>e instanceof k||e?.isRetryMarker===!0,S=e=>new k(e),C=["onUploadProgress","onDownloadProgress","timeout","fetch","throwHttpErrors"],A={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,maxResponseSize:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},x={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0};class E extends t{name="ResponseSizeError";request;maxResponseSize;constructor(e,t){super(`Response body exceeded ${t} bytes: ${e.method} ${e.url}`),this.request=e,this.maxResponseSize=t}}let P=new TextEncoder,U=new WeakMap,j=new Set([101,103,204,205,304]),O=(e,t)=>{let s=e?.body;s&&s!==t?.body&&s.cancel().catch(()=>void 0)},M=e=>Math.max(0,Number(e.get("content-length"))||0),L=e=>e.replaceAll(/\r\n|\r|\n/g,"\r\n"),D=e=>e.replaceAll("\n","%0A").replaceAll("\r","%0D").replaceAll('"',"%22"),I=(e,t,s)=>{let r,o=0;return e.pipeThrough(new TransformStream({transform(e,i){if(i.enqueue(e),r){o+=r.byteLength;let e=0===t?0:o/t;e>=1&&(e=1-Number.EPSILON);let i=0===t?0:Math.max(t,o);s?.({percent:e,totalBytes:i,transferredBytes:o},r)}r=e},flush(){let e=r??new Uint8Array;o+=e.byteLength,s?.({percent:1,totalBytes:o,transferredBytes:o},e)}}))},N=(e,t,s=t.body?U.get(t.body):void 0)=>{let r=e.clone.bind(e);if(e.body&&s)for(let t of(U.set(e.body,s),Object.keys(T))){if("function"!=typeof e[t])continue;let r=e[t].bind(e);Object.defineProperty(e,t,{async value(){try{return await r()}catch(e){throw s()??e}},writable:!0,configurable:!0})}return Object.defineProperties(e,{url:{value:t.url},redirected:{value:t.redirected},type:{value:t.type},headers:{value:t.headers},clone:{value(){let t=r();return e.body&&s&&U.set(e.body,s),N(t,e)},writable:!0,configurable:!0}}),e},B=e=>{let{body:t}=e;if(!(!t||e.bodyUsed||t.locked||j.has(e.status)))return t},z=Symbol.for("ky.replaceOption"),J=e=>o(e)&&!0===e[z]?{isReplace:!0,value:e.value}:{isReplace:!1,value:e},F=(...e)=>{for(let t of e)if(void 0!==t&&!i(t))throw TypeError("The `options` argument must be an object");return ei({},...e)},W=(e={},t={})=>{let s=new globalThis.Headers(e);for(let[e,r]of Object.entries(V(t)))void 0===r?s.delete(e):s.set(e,r);return s},H=e=>{if(!i(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t},_=e=>H(e)||Array.isArray(e),K=e=>{if(e instanceof URLSearchParams){let t=new URLSearchParams(e),s=e[ee];return s&&(t[ee]=new Set(s)),t}return Array.isArray(e)?[...e]:H(e)?{...e}:e},G=e=>Array.isArray(e)?e.map(e=>K(e)):K(e),Y=(e,t=new WeakMap)=>{if(!_(e))return e;let s=t.get(e);if(s)return s;if(Array.isArray(e)){let s=[];for(let r of(t.set(e,s),e))s.push(Y(r,t));return s}let r=null===Object.getPrototypeOf(e)?Object.create(null):{};for(let s of(t.set(e,r),Reflect.ownKeys(e)))Object.prototype.propertyIsEnumerable.call(e,s)&&Object.defineProperty(r,s,{value:Y(e[s],t),writable:!0,enumerable:!0,configurable:!0});return r},V=e=>{if(H(e))return e;let t=e instanceof globalThis.Headers,s={};for(let[r,o]of new globalThis.Headers(e).entries())s[r]=t&&"undefined"===o?void 0:o;return s},X=(e,t)=>{let s=new Map;for(let[r,o]of[...Object.entries(V(e)),...Object.entries(V(t))])s.set(r.toLowerCase(),o);return Object.fromEntries(s)};function Q(e,t,s){if(Object.hasOwn(t,s)&&void 0===t[s])return[];let{isReplace:r,value:o}=J(t[s]);if(void 0!==o&&(!Array.isArray(o)||!o.every(e=>"function"==typeof e)))throw TypeError(`\`hooks.${s}\` must be an array of functions`);return r?[...o??[]]:ei(e[s]??[],o??[])}let Z=(e={},t={})=>{if(!i(t))throw TypeError("The `hooks` option must be an object");return{init:Q(e,t,"init"),beforeRequest:Q(e,t,"beforeRequest"),beforeRetry:Q(e,t,"beforeRetry"),beforeError:Q(e,t,"beforeError"),afterResponse:Q(e,t,"afterResponse")}},ee=Symbol("deletedParameters"),et=new Set(["json","context"]),es=(e,t)=>{if(!_(e))return e;if(t.has(e))return t.get(e);t.set(e,e);let s=((e,t)=>{let s;for(let[r,o]of Object.entries(e)){let i=t(o);i!==o&&((s??=Array.isArray(e)?[...e]:{...e})[r]=i)}return s??e})(e,e=>es(J(e).value,t));return t.set(e,s),s},er=(e,t)=>{let s=new URLSearchParams,r=new Set;for(let i of[e,t])if(i instanceof URLSearchParams){let e=i[ee];if(e)for(let t of e)s.delete(t),r.add(t);for(let[e,t]of i.entries())s.append(e,t)}else if(Array.isArray(i))for(let e of i){if(!Array.isArray(e)||2!==e.length)throw TypeError("Array search parameters must be provided in [[key, value], ...] format");let t=String(e[0]),{isReplace:r,value:o}=J(e[1]);r&&s.delete(t),s.append(t,String(o))}else if(o(i))for(let[e,t]of Object.entries(i)){let{isReplace:o,value:i}=J(t);void 0===i?(s.delete(e),r.add(e)):(o&&s.delete(e),s.append(e,String(i)))}else for(let[e,t]of new URLSearchParams(i).entries())s.append(e,t);return r.size>0&&(s[ee]=r),s},eo=(e,...t)=>{let s,r={},a={},n={},l=[];for(let h of t)if(Array.isArray(h))Array.isArray(r)||(r=[]),r=[...r,...h];else if(o(h)){for(let[t,a]of Object.entries(h)){let n=J(a),{isReplace:h}=n;a=n.value;let u=e&&"signal"===t;if(u&&(h||void 0===a)&&(l.length=0),u&&a instanceof globalThis.AbortSignal){l.push(a);continue}if(e&&"headers"===t&&null===a)throw TypeError("The `headers` option must not be `null`. Use `undefined` to clear it.");if(e&&"context"===t){if(void 0!==a&&!i(a))throw TypeError("The `context` option must be an object");r={...r,context:void 0===a?{}:h?{...a}:{...r.context,...a}};continue}if(e&&"searchParams"===t){if(null===a)throw TypeError("The `searchParams` option must not be `null`. Use `undefined` to clear it.");s=void 0===a?void 0:h||void 0===s?G(a):er(s,a);continue}if(e&&"retry"===t&&void 0!==a&&"number"!=typeof a&&!i(a))throw TypeError("`retry` must be a number or an object");e&&"retry"===t&&!h&&(o(a)&&"number"==typeof r[t]?r={...r,[t]:{limit:r[t]}}:"number"==typeof a&&o(r[t])&&(a={limit:a})),e&&"retry"===t&&H(a)&&(h||!_(r[t]))?a=eo(!1,{},a):!h&&_(r[t])&&_(a)&&Array.isArray(r[t])===Array.isArray(a)&&(a=eo(!1,r[t],a)),r={...r,[t]:a}}if(e&&void 0!==h.hooks){let{value:e,isReplace:t}=J(h.hooks);n=t?Z({},e):Z(n,e),r.hooks=n}if(e&&o(h.headers)){let{value:e,isReplace:t}=J(h.headers);a=X(t?{}:a,e),r.headers=a}}if(void 0!==s&&(r.searchParams=s),l.length>0&&(1===l.length?r.signal=l[0]:y?r.signal=AbortSignal.any(l):r.signal=l.at(-1)),e)for(let[e,t]of Object.entries(r))et.has(e)||(r[e]=es(t,new Map));return r},ei=(...e)=>eo(!0,...e),ea=new Set([...v,"options","trace"]),en=e=>ea.has(e.toLowerCase())?e.toLowerCase():e,el={limit:2,methods:["get","put","head","delete","options","trace","query"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:1/0,backoffLimit:1/0,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},eh=(e={})=>{if("number"==typeof e&&(e={limit:e}),!i(e))throw TypeError("`retry` must be a number or an object");let t={...el,...Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))};if(!Number.isInteger(t.limit)||t.limit<0)throw TypeError("`retry.limit` must be a finite, non-negative integer");for(let e of["methods","statusCodes","afterStatusCodes"])if(!Array.isArray(t[e]))throw Error(`retry.${e} must be an array`);for(let[e,s]of[["methods",e=>"string"==typeof e],["statusCodes",e=>Number.isInteger(e)],["afterStatusCodes",e=>Number.isInteger(e)]])if(t[e].some(e=>!s(e)))throw TypeError(`\`retry.${e}\` must only contain ${"methods"===e?"strings":"numbers"}`);for(let e of["maxRetryAfter","backoffLimit"])if(!a(t[e]))throw TypeError(`\`retry.${e}\` must be a non-negative number or \`Infinity\``);for(let e of["delay","shouldRetry"])if(void 0!==t[e]&&"function"!=typeof t[e])throw TypeError(`\`retry.${e}\` must be a function`);if(void 0!==t.jitter&&"boolean"!=typeof t.jitter&&"function"!=typeof t.jitter)throw TypeError("`retry.jitter` must be a boolean or a function");if("boolean"!=typeof t.retryOnTimeout)throw TypeError("`retry.retryOnTimeout` must be a boolean");return t.methods=t.methods.map(e=>en(e)),t.statusCodes=[...t.statusCodes],t.afterStatusCodes=[...t.afterStatusCodes],t};async function eu(e,t,s,r){let o,i=!1;try{return await new Promise((a,n)=>{o=setTimeout(()=>{i=!0,s?.abort(),n(new f(e))},r.timeout);let{fetch:l}=r;l(e,t).then(e=>{i?O(e):a(e)}).catch(n)})}finally{clearTimeout(o)}}async function ec(e,{signal:t}){return new Promise((s,r)=>{function o(){clearTimeout(i),r(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:!0}));let i=setTimeout(()=>{t?.removeEventListener("abort",o),s()},e)})}let ed=new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function ep(e){if(!(e&&l(e)&&"TypeError"===e.name&&"string"==typeof e.message))return!1;let{message:t,stack:s}=e;return"Load failed"===t||t.startsWith("Load failed (")&&t.endsWith(")")?void 0===s||"__sentry_captured__"in e:!!(t.startsWith("error sending request for url")||"Failed to fetch"===t||t.startsWith("Failed to fetch (")&&t.endsWith(")"))||ed.has(t)}let ef=(e,t)=>e instanceof t||e?.isKyError===!0&&e?.name===t.name,eg=/^\d+$/,em=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ey=/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{2}):(\d{2}):(\d{2}) GMT$/,eb=/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{2}):(\d{2}):(\d{2}) GMT$/,ew=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{2}| \d) (\d{2}:\d{2}:\d{2}) (\d{4})$/,ev=({year:e,month:t,day:s,hours:r,minutes:o,seconds:i})=>{let a=em.indexOf(t),n=Number(s),l=Number(r),h=Number(o),u=Number(i);if(-1===a||l>23||h>59||u>60)return;let c=Math.min(u,59),d=new Date(Date.UTC(e,a,n,l,h,c));d.setUTCFullYear(e);let p=d.getTime();if(d.getUTCFullYear()===e&&d.getUTCMonth()===a&&d.getUTCDate()===n&&d.getUTCHours()===l&&d.getUTCMinutes()===h&&d.getUTCSeconds()===c)return 60===u?p+1e3:p},eT=(e,t)=>e[t],eR=Symbol("timedOut"),e$=()=>globalThis.performance?.now()??Date.now(),ek=(e,t)=>Promise.race([e,new Promise(s=>{let r=setTimeout(()=>{s(eR)},t);e.finally(()=>{clearTimeout(r)}).catch(()=>void 0)})]),eq=e=>{(u(e)||h(e))&&O(e)},eS=e=>{e.then(e=>{eq(e)}).catch(()=>void 0)},eC=e=>{let t=(e.split(";",1)[0]??"").trim().toLowerCase();if(!t.endsWith("json"))return!1;let s=t.at(-5);return"/"===s||("."===s||"+"===s||"-"===s)&&t.includes("/")},eA=async(e,t)=>{let s,{body:r}=e;if(!r)try{return await e.text()}catch{return}try{s=r.getReader()}catch{return}let o=e.headers.get("content-type")??"",i=eC(o)?new TextDecoder:(e=>{let t=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec(e),s=t?.[1]??t?.[2];if(s)try{return new TextDecoder(s)}catch{}return new TextDecoder})(o),a=[],n=0,l=(async()=>{try{for(;;){let{done:e,value:t}=await s.read();if(e)break;if((n+=t.byteLength)>0xa00000)return void s.cancel().catch(()=>void 0);a.push(i.decode(t,{stream:!0}))}}catch(e){if(ef(e,E))throw e;return}return a.push(i.decode()),a.join("")})(),h=await ek(l,t);return h===eR&&s.cancel().catch(()=>void 0),h},ex=(e,t)=>{if(!1!==e){if(!a(e))throw TypeError(`The \`${t}\` option must be a non-negative number or \`false\``);if(e>0x7fffffff)throw RangeError(`The \`${t}\` option cannot be greater than 2147483647`)}},eE=({throwHttpErrors:e=!0,timeout:t=1e4,fetch:s=globalThis.fetch.bind(globalThis)})=>({throwHttpErrors:e,timeout:t,fetch:s}),eP=e=>{for(let t of["parseJson","stringifyJson","fetch","onDownloadProgress","onUploadProgress"])if(void 0!==e[t]&&"function"!=typeof e[t])throw TypeError(`The \`${t}\` option must be a function`);let{throwHttpErrors:t}=e;if("boolean"!=typeof t&&"function"!=typeof t)throw TypeError("The `throwHttpErrors` option must be a boolean or a function")},eU=/^[\0-\u0020]+/g,ej=/[\t\n\r]/g,eO=/^[a-z][\d+.a-z-]*:/i,eM=/^https?:(?!\/\/)/i,eL=(e,t)=>{e.searchParams.has(t)&&e.searchParams.delete(t)},eD=async(e,t)=>{let s=o(t)||"function"==typeof t?t["~standard"]:void 0;if(!o(s)||"function"!=typeof s.validate)throw TypeError("The `schema` argument must follow the Standard Schema specification");let r=await s.validate(e);if(r.issues)throw new p(r.issues);return r.value};class eI{static create(e,t){let s=t.hooks?.init??[],r=s.length>0?{...t,headers:X({},t.headers??{}),context:{...t.context},json:Y(t.json),searchParams:G(t.searchParams),retry:Y(t.retry)}:t;for(let e of s)e(r);let o=new eI(e,r),i=(async()=>{let e;try{return e=await o.#e()}catch(e){return await o.#t(e)}finally{let t=o.#s;O(t,e),t&&o.request!==t&&O(o.request,e)}})();for(let e of R()){let t=T[e];i[e]=async s=>{let r;o.request!==o.#s&&o.request.headers.set("accept",o.request.headers.get("accept")||t);let a=await i;if(void 0===a)throw TypeError("The request resolved without a response, so there is no body to read. This happens when a `beforeRetry` hook returns `ky.stop`. Throw from the hook instead of returning `ky.stop`.");if("json"!==e)return o.#r(async()=>a[e](),a);let n=await o.#r(async()=>a.text(),a),l=o.#o(a);try{r=await o.#i(async()=>{let e=""!==n||void 0===s||o.#a.parseJson?await o.#n(n,l,a):void 0;return void 0===s?e:await eD(e,s)})}catch(e){throw o.#l?.aborted&&await o.#t(o.#l.reason,l),e}return r===eR&&await o.#t(new f(l),l),r}}return i}request;#h;#u=0;#c;#a;#d;#s;#p=!1;#l;#f=new WeakSet;#g;#m;#y=new WeakSet;#b=new WeakMap;#w=new WeakSet;constructor(e,t={}){let s;if("string"!=typeof e&&!(e instanceof URL||e instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");let{maxResponseSize:r=1/0,totalTimeout:o=!1}=t;if(Object.hasOwn(t,"prefixUrl"))throw Error("The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl");for(let e of["headers","method","prefix","baseUrl","referrer","referrerPolicy"])if(null===t[e])throw TypeError(`The \`${e}\` option must not be \`null\`. Use \`undefined\` to clear it.`);if(void 0!==t.context&&!i(t.context))throw TypeError("The `context` option must be an object");if(this.#a={...t,headers:W(e.headers,t.headers),hooks:Z({},t.hooks),method:(s=t.method??e.method??"GET",v.includes(s.toLowerCase())?s.toUpperCase():s),referrer:t.referrer??e.referrer,referrerPolicy:t.referrerPolicy??e.referrerPolicy,prefix:String(t.prefix||""),retry:eh(t.retry),...eE(t),totalTimeout:o,maxResponseSize:r,context:t.context??{}},eP(this.#a),ex(this.#a.timeout,"timeout"),ex(o,"totalTimeout"),this.#c=this.#a.retry.limit,1/0!==r&&(!Number.isSafeInteger(r)||r<0))throw TypeError("The `maxResponseSize` option must be a non-negative safe integer or Infinity");this.#d=e instanceof globalThis.Request?e:void 0,e=((e,t,s)=>{if("string"!=typeof e)return e;if(t){let s=t.replace(/\/+$/,""),r=e.replace(/^\/+/,"");e=`${s}/${r}`}if(s){let t=e.replaceAll(eU,"").replaceAll(ej,"");if(eM.test(t))throw TypeError("`input` url protocol must be followed by `//` when using `baseUrl`");if(!eO.test(t))return new URL(e,new Request(s).url)}return e})(e,this.#a.prefix,this.#a.baseUrl),m&&y&&(this.#l=this.#a.signal??this.#d?.signal,this.#h=new globalThis.AbortController,this.#a.signal=this.#v()),g&&(this.#a.duplex="half");let a=void 0!==t.headers&&W({},t.headers).has("content-type");void 0!==this.#a.json&&(this.#a.body=this.#a.stringifyJson?.(this.#a.json)??JSON.stringify(this.#a.json),a||this.#a.headers.set("content-type","application/json")),e instanceof globalThis.Request&&(w&&this.#a.body instanceof globalThis.FormData||this.#a.body instanceof URLSearchParams)&&!a&&this.#a.headers.delete("content-type"),this.request=new globalThis.Request(e,this.#a),this.#p="function"==typeof globalThis.ReadableStream&&this.#a.body instanceof globalThis.ReadableStream;let{searchParams:n}=this.#a;if((e=>{if(void 0===e)return!1;if(null===e)throw TypeError("The `searchParams` option must not be `null`. Use `undefined` to clear it.");return Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0||!!e[ee]?.size:"object"==typeof e?Object.keys(e).length>0:"string"==typeof e?e.trim().length>0:!!e})(n)){let e=new URL(this.request.url),t=n?.[ee];if(t)for(let s of t)eL(e,s);if("string"==typeof n){let t=n.replace(/^\?/,"");""!==t&&(e.search=e.search?`${e.search}&${t}`:`?${t}`)}else if(!i(n)||n instanceof URLSearchParams)for(let[t,s]of new URLSearchParams(n))e.searchParams.append(t,s);else for(let[t,s]of Object.entries(n))void 0===s?eL(e,t):e.searchParams.append(t,s);if(e.href!==this.request.url){let{body:t,cache:s,credentials:r,integrity:o,keepalive:i,mode:a,redirect:n,referrer:l,referrerPolicy:h}=this.request;this.request=new globalThis.Request(e,{...this.#a,cache:s,credentials:r,integrity:o,keepalive:i,mode:a,redirect:n,referrer:l,referrerPolicy:h,body:this.#a.body??(g&&!i&&"no-cors"!==a?t:void 0)})}}this.#m="number"==typeof o?e$()+o:1/0}async #e(){await Promise.resolve();let e=await this.#T();void 0!==e&&(this.#c=eh(this.#a.retry).limit);let t=e??await this.#R();for(;;){let e;if(void 0===t)return;let r=this.#y.has(t);try{t=await this.#$(t)}catch(t){if(!ef(t,d))throw t;e=t}if(void 0===e){let o=t;if(o.ok||"opaque"===o.type||!this.#k(o))break;let i=new s(o,this.#o(o),this.#q());if(i.data=await this.#S(o),this.#C(),this.#A(),r)throw i;e=i}t=await this.#x(e)}if(this.#E(t),this.#a.onDownloadProgress){if(!b)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let e=((e,t)=>{let s=B(e);if(!s)return e;let r=e.headers.get("content-encoding")?.toLowerCase();return N(new Response(I(s,r&&"identity"!==r?0:M(e.headers),t),e),e)})(t,this.#a.onDownloadProgress);return this.#P(e,this.#o(t)),this.#E(e)}return t}#U(e,t){let s=e.delay(this.#u+1);if(!a(s))throw TypeError("`retry.delay` must return a non-negative number or `Infinity`",{cause:t});let r=s;return!0===e.jitter?r=Math.random()*s:"function"==typeof e.jitter&&(!Number.isFinite(r=e.jitter(s))||r<0)&&(r=s),Math.min(e.backoffLimit,r)}async #j(e){let t=eh(this.#a.retry);if(this.#u>=Math.min(t.limit,this.#c))throw e;let o=c.wrap(e);if(ef(o,d))return o.customDelay??this.#U(t,e);if(!t.methods.includes(en(this.request.method)))throw e;let i=!1,{shouldRetry:a}=t;if(void 0!==a){let t=await this.#i(async()=>a({error:o,retryCount:this.#u+1}));if(this.#C(),t===eR)throw new f(this.#O);if(!1===t)throw e;i=!0===t}if(ef(e,f)){if(!i&&!t.retryOnTimeout)throw e;return this.#U(t,e)}if(ef(e,s)){if(!i&&!t.statusCodes.includes(e.response.status))throw e;let s=(e=>{let t=e.get("Retry-After");if(null!==t)return{value:t,allowTimestamp:!1};let s=e.get("RateLimit-Reset");if(null!==s)return{value:s,allowTimestamp:!0};let r=e.get("X-RateLimit-Retry-After");if(null!==r)return{value:r,allowTimestamp:!1};let o=e.get("X-RateLimit-Reset")??e.get("X-Rate-Limit-Reset");if(null!==o)return{value:o,allowTimestamp:!0}})(e.response.headers);if(s&&t.afterStatusCodes.includes(e.response.status)){let r=(({value:e,allowTimestamp:t})=>{if(eg.test(e)){let s=1e3*Number(e);return t&&Number(e)>=1e9&&(s-=Date.now()),Math.max(0,s)}let s=(e=>{let t=ey.exec(e);if(t)return ev({year:Number(eT(t,3)),month:eT(t,2),day:eT(t,1),hours:eT(t,4),minutes:eT(t,5),seconds:eT(t,6)});let s=eb.exec(e);if(s){let e,t=new Date,r=Number(eT(s,3)),o=100*Math.floor(t.getUTCFullYear()/100)+r,i=Date.UTC(t.getUTCFullYear()+50,t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());for(let t of[o-100,o,o+100]){let r=ev({year:t,month:eT(s,2),day:eT(s,1),hours:eT(s,4),minutes:eT(s,5),seconds:eT(s,6)});void 0!==r&&r<=i&&(e=r)}return e}let r=ew.exec(e);if(r){let[e,t,s]=eT(r,4).split(":");return ev({year:Number(eT(r,5)),month:eT(r,2),day:eT(r,3).trim(),hours:e,minutes:t,seconds:s})}})(e);if(void 0!==s)return Math.max(0,s-Date.now())})(s);return void 0===r?this.#U(t,e):Math.min(t.maxRetryAfter,r)}if(!i&&413===e.response.status)throw e;return this.#U(t,e)}if(!i&&!ef(e,r))throw e;return this.#U(t,e)}#E(e){if(!this.#a.parseJson||this.#w.has(e))return e;this.#w.add(e);let t=this.#o(e);e.json=async()=>this.#n(await e.text(),t,e);let s=e.clone.bind(e);return e.clone=()=>this.#E(this.#P(s(),t)),e}async #t(e,t=this.#O){if(!l(e)||this.#f.has(e))throw e;let s=e;for(let e of this.#a.hooks.beforeError){let r=await e({request:t,options:this.#q(),error:s,retryCount:this.#u});l(r)&&(s=r)}throw s}async #S(e){let t=this.#o(e),s=({fromTotalTimeout:e})=>{if(e)throw new f(t);this.#A(t)},r=this.#M(t),o=await eA(e,r.milliseconds);if(o===eR)return void s(r);if(!o)return;if(!eC(e.headers.get("content-type")??""))return o;let i=this.#M(t),a=await ek(Promise.resolve().then(()=>this.#n(o,t,e)),i.milliseconds).catch(()=>void 0);return a===eR?void s(i):a}#M(e){let t=!1===this.#a.timeout?1e4:this.#a.timeout,s=this.#L();if(0===s)throw new f(e);return{milliseconds:Math.min(t,s),fromTotalTimeout:s<=t}}#D(){let e=this.#L();if(0===e)throw new f(this.#O);let t=Math.min(!1===this.#a.timeout?1/0:this.#a.timeout,e);return 1/0===t?void 0:t}async #r(e,t){let s,o,i=this.#o(t);try{s=this.#D()}catch(e){await this.#t(e,i)}let a=e();try{o=void 0===s?await a:await ek(a,s)}catch(e){this.#l?.aborted&&await this.#t(this.#l.reason,i),0!==this.#L()&&(ep(e)&&await this.#t(new r(i,{cause:e}),i),await this.#t(e,i)),o=eR}return this.#l?.aborted&&await this.#t(this.#l.reason,i),(o===eR||0===this.#L())&&(this.#h?.abort(),await this.#t(new f(i),i)),o}async #i(e){let t,s,r,o=this.#l;o?.throwIfAborted();let i=this.#L();if(0===i)return this.#h?.abort(),eR;try{let a=new Promise((e,t)=>{o&&(s=()=>{t(o.reason)},o.addEventListener("abort",s,{once:!0}))});if(r=e(),1/0===i)return await Promise.race([r,a]);let n=new Promise(e=>{t=setTimeout(()=>{e(eR)},i)}),l=await Promise.race([r,n,a]);if(l===eR||0===this.#L())return this.#h?.abort(),l===eR?eS(r):eq(l),eR;return l}catch(e){if(o?.aborted&&(r&&eS(r),o.throwIfAborted()),0===this.#L())return this.#h?.abort(),eR;throw e}finally{clearTimeout(t),s&&o?.removeEventListener("abort",s)}}#n(e,t,s){let{parseJson:r}=this.#a;return r?r(e,{request:t,response:s}):JSON.parse(e)}#v(){return this.#l?AbortSignal.any([this.#l,this.#h.signal]):this.#h.signal}#k(e){let{throwHttpErrors:t}=this.#a;try{return"function"==typeof t?t(e.status):t}catch(t){throw O(e),t}}get #O(){return this.#s??this.request}#A(e=this.#O){if(0===this.#L())throw new f(e)}async #T(){for(let e of this.#a.hooks.beforeRequest){let t=await this.#i(async()=>e({request:this.request,options:this.#q(),retryCount:0}));if(t===eR)throw new f(this.#O);if(h(t))this.#I(this.#N(t));else if(u(t))return this.#y.add(t),t}}async #$(e){let t=this.#o(e);for(let s of(e=this.#B(e),this.#a.hooks.afterResponse)){let r,o=this.#P(e.clone(),t);this.#E(o);try{if((r=await this.#i(async()=>s({request:this.request,options:this.#q(),response:o,retryCount:this.#u})))===eR)throw new f(this.#O);if(q(r))throw new d(r.options)}catch(t){throw O(o),O(e),t}let i=u(r)?this.#P(r,t):e;O(o,i),O(e,i),i!==e&&(e=this.#B(i))}return e}async #R(){try{return await this.#z()}catch(e){return this.#x(e)}}async #x(e){this.#C();let t=Math.min(await this.#j(e),0x7fffffff),s={signal:this.#l},r=this.#L();if(0===r)throw new f(this.#O);if(t>=r)throw await ec(r,s),new f(this.#O);for(let r of(await ec(t,s),this.#A(),this.#h?.signal.aborted&&(this.#h=new globalThis.AbortController,this.#a.signal=this.#v(),this.#I(this.#N(this.request),this.#p)),ef(e,d)&&e.customRequest&&this.#I(this.#N(e.customRequest)),this.#a.hooks.beforeRetry)){let t;try{t=await this.#i(async()=>r({request:this.request,options:this.#q(),error:c.wrap(e),retryCount:this.#u+1}))}catch(t){throw this.#C(),l(t)&&t!==e&&this.#f.add(t),t}if(t===eR)throw new f(this.#O);if(h(t)){this.#I(this.#N(t));break}if(u(t))return this.#y.add(t),this.#u++,t;if(t===$)return;i(t)&&this.#J(t.options)}return this.#A(),this.#u++,this.#R()}async #z(){O(this.#s,this.request);let e=(e=>{let t={};for(let s of Object.keys(e))Object.hasOwn(x,s)||Object.hasOwn(A,s)||Object.defineProperty(t,s,{value:e[s],writable:!0,enumerable:!0,configurable:!0});return t})(this.#a);this.#c=eh(this.#a.retry).limit;let t=this.#c>0?this.#N(this.request.clone()):void 0,s=this.#F(this.request);this.#s=s,t&&(this.request=t,this.#p=!0);try{let t=this.#D(),{fetch:r}=this.#a,o=void 0===t?await r(s,e):await eu(s,e,this.#h,{timeout:t,fetch:r});if(!u(o))throw TypeError("The `fetch` option must resolve with a `Response`");if(0===this.#L())throw this.#h?.abort(),O(o),new f(s);return this.#P(o,s)}catch(e){if(this.#C(),0===this.#L())throw this.#h?.abort(),new f(s);if(ep(e))throw new r(s,{cause:e});throw e}}#C(){this.#l?.throwIfAborted()}#L(){return Math.max(0,this.#m-e$())}#J(e){if(!i(e))throw TypeError("The `options` returned from a `beforeRetry` hook must be an object");for(let t of Object.keys(e))if(!C.includes(t))throw TypeError(`The \`${t}\` option cannot be changed from a \`beforeRetry\` hook`);let t={...this.#a,...e},s={...t,...eE(t)};eP(s),ex(s.timeout,"timeout"),Object.assign(this.#a,s),this.#g=void 0}#q(){if(!this.#g){let{hooks:e,json:t,parseJson:s,stringifyJson:r,searchParams:o,timeout:i,totalTimeout:a,maxResponseSize:n,throwHttpErrors:l,fetch:h,...u}=this.#a;this.#g=Object.freeze(u)}return this.#g}#I(e,t=!1){this.#p&&O(this.request,e),this.#g=void 0,this.request=e,this.#p=t}#N(e){return this.#a.signal&&e instanceof globalThis.Request?new globalThis.Request(e,{signal:this.#a.signal,referrer:e.referrer,referrerPolicy:e.referrerPolicy}):e}#o(e){return this.#b.get(e)??this.#O}#P(e,t){return this.#b.set(e,t),e}#B(e){let t=this.#o(e);return this.#P(((e,t,s)=>{let r,o=B(e);if(!o||1/0===s)return e;let i=0,a=U.get(o);return N(new Response(o.pipeThrough(new TransformStream({transform(e,o){if((i+=e.byteLength)>s)throw r=new E(t,s);o.enqueue(e)}})),e),e,()=>r??a?.())})(e,t,this.#a.maxResponseSize),t)}#F(e){return this.#a.onUploadProgress&&g&&e.body?((e,t,s)=>{if(!e.body||e.bodyUsed||e.body.locked||e.keepalive||"no-cors"===e.mode||!(e instanceof globalThis.Request))return e;let r=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[s,r]of e)t+=44,t+=P.encode(`Content-Disposition: form-data; name="${D(L(s))}"`).byteLength,r instanceof Blob&&(t+=P.encode(`; filename="${D(r.name??"")}"`).byteLength,t+=P.encode(`\r
|
|
2
|
-
Content-Type: ${r.type||"application/octet-stream"}`).byteLength),t+=4,t+="string"==typeof r?P.encode(L(r)).byteLength:r.size,t+=2;return 0===t?0:t+40+6}return e instanceof Blob?e.size:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:"string"==typeof e?P.encode(e).byteLength:e instanceof URLSearchParams?P.encode(e.toString()).byteLength:0})(s??e.body)||M(e.headers);return new Request(e,{duplex:"half",body:I(e.body,r,t),headers:e.headers,referrer:e.referrer,referrerPolicy:e.referrerPolicy})})(e,this.#a.onUploadProgress,this.#a.body):e}}let eN=(e,t)=>{try{return eI.create(e,t())}catch(t){let e=Promise.reject(t);for(let t of R())e[t]=async()=>e;return e}},eB=e=>{let t=(t,s)=>eN(t,()=>F(e,s));for(let s of v)t[s]=(t,r)=>eN(t,()=>F(e,r,{method:s}));return t.create=e=>eB(F(e)),t.extend=t=>("function"==typeof t&&(t=t(F(Y(e)))),eB(F(e,t))),t.stop=$,t.retry=S,t},ez=eB(),eJ="__magnus_trace_id__";var eF=e.i(39430);let eW={cron:"Cron management",users:"User management","system-updates":"Automatic system updates","ardent-management":"Ardent management","docker-group-remediation":"Docker group remediation","credential-renewal":"Credential renewal","execution-supervisor":"The execution supervisor"};function eH(e){let t="string"==typeof e?e:null==e?"":JSON.stringify(e);if(!t.includes("AGENT_NOT_PRIVILEGED")&&!/is disabled: agent is not privileged/.test(t))return null;let s=/"feature"\s*:\s*\\?"([a-z-]+)/.exec(t)?.[1]??/([a-z-]+) is disabled: agent is not privileged/.exec(t)?.[1];return`${!s?"This feature":eW[s]??s} is disabled on this node (its agent runs unprivileged).`}e.s(["f",0,eH],34479);let e_=new class{client;_baseUrl;constructor(){this._baseUrl="",this.client=this.createClient(this._baseUrl)}get baseUrl(){return this._baseUrl}getAuthHeaders(){return(0,eF.L)(this._baseUrl)}reconfigure(e){this._baseUrl=(0,eF.K)(e)??"",this.client=this.createClient(this._baseUrl)}createClient(e){return ez.create({prefix:"/api/proxy",timeout:18e4,hooks:{beforeRequest:[({request:t})=>{e?t.headers.set("x-proxy-target",e):t.headers.delete("x-proxy-target"),t.headers.get("x-trace-id")||t.headers.set("x-trace-id",function(){let e=globalThis,t=Date.now(),s=e[eJ];if(s&&t-s.lastUsedAt<1e4)return s.lastUsedAt=t,s.id;let r="u">typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID().replace(/-/g,"").slice(0,16):Math.random().toString(36).slice(2,10)+Math.random().toString(36).slice(2,10);return e[eJ]={id:r,lastUsedAt:t},r}())}],beforeError:[async({error:e})=>{if(e instanceof s&&403===e.response.status){let t=eH(e.data);t&&(e.name="AgentNotPrivilegedError",e.message=t)}return e}]}})}async get(e,t){let s={};if(t)for(let[e,r]of Object.entries(t))void 0!==r&&(s[e]=String(r));return this.client.get(e,{searchParams:s}).json()}async post(e,t,s){return this.client.post(e,{json:t,headers:s}).json()}async patch(e,t){return this.client.patch(e,{json:t}).json()}async put(e,t){return this.client.put(e,{json:t}).json()}async del(e){return this.client.delete(e).json()}nodes={list:e=>this.get("nodes",e),get:e=>this.get(`nodes/${e}`),register:e=>this.post("nodes/register",e),update:(e,t)=>this.patch(`nodes/${e}`,t),repairAddress:(e,t)=>this.post(`nodes/${e}/repair-address`,t),delete:e=>this.del(`nodes/${e}`),health:e=>this.get(`nodes/${e}/health`),gpu:(e,t="24h")=>this.get(`nodes/${e}/gpu`,{period:t}),forecast:(e,t=30)=>this.get(`health/${e}/forecast`,{days:t}),wazuh:e=>this.get(`nodes/${e}/wazuh`),wazuhSummary:()=>this.get("nodes/wazuh/summary"),systemUpdatesSummary:()=>this.get("nodes/system-updates/summary"),tailscaleSummary:()=>this.get("nodes/tailscale/summary"),enableSystemUpdates:e=>this.post(`nodes/${e}/system-updates/enable`),healthHistory:(e,t)=>this.get(`nodes/${e}/health/history`,{limit:t})};commands={dispatch:(e,t)=>this.post("commands",e,{"x-idempotency-key":t}),get:e=>this.get(`commands/${e}`),result:e=>this.get(`commands/${e}/result`),cancel:(e,t)=>this.post(`commands/${e}/cancel`,{reason:t})};cron={list:e=>this.get("cron",e?{nodeId:e}:void 0),get:e=>this.get(`cron/${e}`),create:e=>this.post("cron",e),update:(e,t)=>this.patch(`cron/${e}`,t),delete:e=>this.del(`cron/${e}`)};files={update:e=>this.post("files/update",e),read:(e,t)=>this.get("files/read",{nodeId:e,filePath:t})};skills={list:()=>this.get("skills"),get:e=>this.get(`skills/${e}`),create:e=>this.post("skills",e),update:(e,t)=>this.patch(`skills/${e}`,t),delete:e=>this.del(`skills/${e}`),push:e=>this.post("skills/push",e),installations:e=>this.get(`skills/installations/${e}`),getFile:(e,t)=>this.get(`skills/${e}/files/${t}`),updateFile:(e,t,s)=>this.client.put(`skills/${e}/files/${t}`,{json:{content:s}}).json(),registry:{list:()=>this.get("skills/registry"),get:e=>this.get(`skills/registry/${e}`),sync:()=>this.post("skills/registry/sync",{}),publish:(e,t)=>this.post(`skills/registry/${e}/publish`,t),versions:e=>this.get(`skills/registry/${e}/versions`),versionDetail:(e,t)=>this.get(`skills/registry/${e}/versions/${t}`),setTag:(e,t)=>this.post(`skills/registry/${e}/tags`,t),delete:e=>this.del(`skills/registry/${e}`)}};logs={query:e=>this.post("logs/query",e),ingest:e=>this.post("logs/ingest",e)};audit={list:e=>this.get("audit",e),days:()=>this.get("audit/days")};hermes={installations:()=>this.get("hermes/installations"),installation:e=>this.get(`hermes/installations/${e}`),detect:e=>this.post("hermes/detect",e),deploy:(e,t)=>this.post("hermes/deploy",e,{"x-idempotency-key":t}),sync:e=>this.post(`hermes/installations/${e}/sync`),configure:e=>this.post(`hermes/installations/${e}/configure`),config:e=>this.get(`hermes/installations/${e}/config`),updateConfig:(e,t)=>this.patch(`hermes/installations/${e}/config`,t),update:e=>this.post(`hermes/installations/${e}/update`),uninstall:e=>this.del(`hermes/installations/${e}`),profiles:e=>e?this.get(`hermes/installations/${e}/profiles`):this.get("hermes/profiles"),createProfile:(e,t)=>this.post(`hermes/installations/${e}/profiles`,t),updateProfile:(e,t)=>this.patch(`hermes/profiles/${e}`,t),deleteProfile:e=>this.del(`hermes/profiles/${e}`),describeProfile:e=>this.post(`hermes/profiles/${e}/describe-auto`),gatewayAction:(e,t)=>this.post(`hermes/profiles/${e}/gateway/${t}`),dashboardAction:(e,t)=>this.post(`hermes/installations/${e}/dashboard/${t}`),enableApiServer:(e,t)=>this.post(`hermes/profiles/${e}/api-server/enable`,t),disableApiServer:e=>this.post(`hermes/profiles/${e}/api-server/disable`),apiServerStatus:e=>this.get(`hermes/profiles/${e}/api-server/status`),rotateApiServerKey:(e,t)=>this.post(`hermes/profiles/${e}/api-server/rotate-key`,t),migrationDryRun:e=>this.post("hermes/migration/openclaw/dry-run",e),migrationApply:(e,t)=>this.post("hermes/migration/openclaw/apply",e,{"x-idempotency-key":t}),jobs:e=>this.get("hermes/jobs",e),job:e=>this.get(`hermes/jobs/${e}`)};ardent={installations:()=>this.get("ardent/installations"),installation:e=>this.get(`ardent/installations/${encodeURIComponent(e)}`),profiles:()=>this.get("ardent/profiles"),resource:(e,t,s,r)=>this.get(`ardent/installations/${encodeURIComponent(e)}/profiles/${encodeURIComponent(t)}/${s}`,r),action:(e,t,s,r,o)=>this.client.post(`ardent/installations/${encodeURIComponent(e)}/profiles/${encodeURIComponent(t)}/action`,{json:{action:s,...o?{target:o}:{},body:r??{}},timeout:"package-install"===s?62e4:s.startsWith("service-")?125e3:55e3}).json()};codex={installations:(e=!1)=>this.get("codex/installations",{refreshLatest:e?"true":void 0}),installation:(e,t=!1)=>this.get(`codex/installations/${e}`,{refreshLatest:t?"true":void 0}),update:e=>this.post(`codex/installations/${e}/update`),logout:e=>this.post(`codex/installations/${e}/logout`),startDeviceAuth:e=>this.post(`codex/installations/${e}/device-auth`),deviceAuth:(e,t)=>this.get(`codex/installations/${e}/device-auth/${t}`),cancelDeviceAuth:(e,t)=>this.post(`codex/installations/${e}/device-auth/${t}/cancel`)};orchestra={overview:()=>this.get("orchestra/overview"),capabilities:()=>this.get("orchestra/capabilities"),skillCatalog:()=>this.get("orchestra/skill-catalog"),auditCatalogSkill:e=>this.get(`orchestra/skill-catalog/${encodeURIComponent(e)}/audit`),installCatalogSkill:e=>this.post("orchestra/skill-catalog/install",e),quarantineCatalogSkill:e=>this.post(`orchestra/skill-catalog/${encodeURIComponent(e)}/quarantine`,{}),previewSkillBundle:e=>this.post("orchestra/skill-bundles/preview",e),applySkillBundle:e=>this.post("orchestra/skill-bundles/apply",e),cancelJob:e=>this.post(`orchestra/jobs/${e}/cancel`),testProvider:e=>this.post("orchestra/providers/test",e),skillAssignments:{list:e=>this.get("orchestra/skill-assignments",e),create:e=>this.post("orchestra/skill-assignments",e),update:(e,t)=>this.patch(`orchestra/skill-assignments/${e}`,t),delete:e=>this.del(`orchestra/skill-assignments/${e}`)},toolsetPolicies:{list:e=>this.get("orchestra/toolset-policies",e),upsert:e=>this.put("orchestra/toolset-policies",e),update:(e,t)=>this.patch(`orchestra/toolset-policies/${e}`,t),delete:e=>this.del(`orchestra/toolset-policies/${e}`)},roles:{list:()=>this.get("orchestra/roles"),get:e=>this.get(`orchestra/roles/${e}`),create:e=>this.post("orchestra/roles",e),update:(e,t)=>this.patch(`orchestra/roles/${e}`,t),delete:e=>this.del(`orchestra/roles/${e}`),apply:(e,t)=>this.post(`orchestra/roles/${e}/apply`,t)},providers:{get:e=>this.get("orchestra/providers",e),upsert:e=>this.put("orchestra/providers",e)},credentialPools:{list:()=>this.get("orchestra/credential-pools"),create:e=>this.post("orchestra/credential-pools",e),update:(e,t)=>this.patch(`orchestra/credential-pools/${e}`,t),delete:e=>this.del(`orchestra/credential-pools/${e}`),attach:(e,t)=>this.post(`orchestra/credential-pools/${e}/attach`,t),detach:e=>this.del(`orchestra/credential-pools/attachments/${e}`)},mcpServers:{list:()=>this.get("orchestra/mcp-servers"),create:e=>this.post("orchestra/mcp-servers",e),update:(e,t)=>this.patch(`orchestra/mcp-servers/${e}`,t),delete:e=>this.del(`orchestra/mcp-servers/${e}`),attach:(e,t)=>this.post(`orchestra/mcp-servers/${e}/attach`,t),detach:e=>this.del(`orchestra/mcp-servers/attachments/${e}`)},messagingBindings:{list:e=>this.get("orchestra/messaging-bindings",e),create:e=>this.post("orchestra/messaging-bindings",e),update:(e,t)=>this.patch(`orchestra/messaging-bindings/${e}`,t),delete:e=>this.del(`orchestra/messaging-bindings/${e}`)},cronJobs:{list:e=>this.get("orchestra/cron-jobs",e),create:e=>this.post("orchestra/cron-jobs",e),update:(e,t)=>this.patch(`orchestra/cron-jobs/${e}`,t),delete:e=>this.del(`orchestra/cron-jobs/${e}`)},plugins:{list:e=>this.get("orchestra/plugins",e),install:e=>this.post("orchestra/plugins",e),remove:e=>this.del(`orchestra/plugins/${e}`)},hooks:{list:e=>this.get("orchestra/hooks",e),create:e=>this.post("orchestra/hooks",e),update:(e,t)=>this.patch(`orchestra/hooks/${e}`,t),delete:e=>this.del(`orchestra/hooks/${e}`)}};quickCommand={exec:(e,t)=>this.post(`quick-command/${e}/exec`,t)};discovery={scan:e=>this.post("discovery/scan",{timeoutMs:e})};stats={overview:()=>this.get("stats/overview")};roles={list:()=>this.get("roles"),get:e=>this.get(`roles/${e}`),create:e=>this.post("roles",e),update:(e,t)=>this.patch(`roles/${e}`,t),delete:e=>this.del(`roles/${e}`),assign:(e,t)=>this.post(`roles/${e}/assign`,t),unassign:(e,t)=>this.post(`roles/${e}/unassign`,t),apply:(e,t)=>this.post(`roles/${e}/apply`,t??{}),applications:{list:e=>this.get("roles/applications/list",e),get:e=>this.get(`roles/applications/${e}`)}};notifications={list:e=>this.get("notifications",e),unreadCount:()=>this.get("notifications/unread-count"),markRead:e=>this.post("notifications/read",{ids:e}),markAllRead:()=>this.post("notifications/read-all")};library={categories:{list:()=>this.get("library/categories"),create:e=>this.post("library/categories",e),update:(e,t)=>this.patch(`library/categories/${e}`,t),delete:e=>this.del(`library/categories/${e}`)},files:{list:e=>this.get("library/files",e),get:e=>this.get(`library/files/${e}`),create:e=>this.post("library/files",e),update:(e,t)=>this.patch(`library/files/${e}`,t),delete:e=>this.del(`library/files/${e}`),move:e=>this.post("library/files/move",e)}};anomalies={list:e=>this.get("anomalies",e),summary:()=>this.get("anomalies/summary"),correlation:e=>this.get(`anomalies/event/${e}/correlation`),nodeSummary:e=>this.get(`anomalies/${e}/summary`),resolve:e=>this.post(`anomalies/${e}/resolve`),resolveNode:(e,t)=>this.post("anomalies/resolve-node",{nodeId:e,metric:t})};remediation={listRules:()=>this.get("remediation/rules"),getRule:e=>this.get(`remediation/rules/${e}`),createRule:e=>this.post("remediation/rules",e),updateRule:(e,t)=>this.patch(`remediation/rules/${e}`,t),deleteRule:e=>this.del(`remediation/rules/${e}`),listExecutions:e=>this.get("remediation/executions",e),trigger:e=>this.post("remediation/trigger",e)};assistant={chat:e=>this.post("assistant/chat",e),conversations:e=>this.get("assistant/conversations",e),messages:(e,t)=>this.get(`assistant/conversations/${e}`,t),forkConversation:(e,t)=>this.post(`assistant/conversations/${e}/fork`,{fromMessageId:t}),shareConversation:(e,t)=>this.post(`assistant/conversations/${e}/share`,{ttlHours:t}),getSharedConversation:e=>this.get(`assistant/shares/${e}`),getScratchpad:e=>this.get(`assistant/conversations/${e}/scratchpad`),clearScratchpad:e=>this.del(`assistant/conversations/${e}/scratchpad`),markConversationRead:e=>this.post(`assistant/conversations/${e}/read`),archiveConversation:e=>this.post(`assistant/conversations/${e}/archive`),deleteConversation:e=>this.del(`assistant/conversations/${e}`),unreadCount:()=>this.get("assistant/unread"),markMessagesRead:e=>this.post("assistant/messages/read",{messageIds:e}),getHeartbeatPrompt:()=>this.get("assistant/heartbeat-prompt"),updateHeartbeatPrompt:e=>this.put("assistant/heartbeat-prompt",{content:e}),resetHeartbeatPrompt:()=>this.del("assistant/heartbeat-prompt"),listModels:()=>this.get("assistant/models"),getModelContext:e=>this.get(`assistant/models/${encodeURIComponent(e)}/context`),getSettings:()=>this.get("assistant/settings"),updateSettings:e=>this.patch("assistant/settings",e),chatStreamUrl:()=>`${this._baseUrl}/assistant/chat/stream`,approveToolCall:e=>this.post(`assistant/messages/${e}/approve`),rejectToolCall:e=>this.post(`assistant/messages/${e}/reject`),confirmCommand:e=>this.post(`assistant/messages/${e}/confirm`),exportConversation:(e,t="markdown")=>this.client.get(`assistant/conversations/${e}/export`,{searchParams:{format:t}}).then(e=>e.text()),getInsights:()=>this.get("assistant/insights"),listPinnedInsights:()=>this.get("assistant/insights/pins"),pinInsight:e=>this.post("assistant/insights/pins",e),unpinInsight:e=>this.del(`assistant/insights/pins/${e}`),getModelProfiles:()=>this.get("assistant/model-profiles"),updateModelProfiles:e=>this.patch("assistant/model-profiles",Object.fromEntries(e.map(e=>[e.taskType,{provider:e.provider,model:e.model,fallbacks:e.fallbacks,temperature:e.temperature,maxTokens:e.maxTokens,maxToolRounds:e.maxToolRounds,thinkingMode:e.thinkingMode}])))};selfUpdate={status:()=>this.get("self-update/status"),version:()=>this.get("self-update/version"),check:()=>this.post("self-update/check"),apply:e=>this.post("self-update/apply",{restart:e}),restart:()=>this.post("self-update/restart")};systemUpdates={get:()=>this.get("system/updates").then(e=>e.data),refresh:()=>this.post("system/updates/check").then(e=>e.data)};agentUpgrades={eligibility:e=>this.get(`agents/upgrade/eligibility${e?`?version=${encodeURIComponent(e)}`:""}`).then(e=>e.data),start:e=>this.post("agents/upgrade",e).then(e=>e.data),check:e=>this.post("agents/upgrade",{...e,dryRun:!0}).then(e=>e.data),run:e=>this.get(`agents/upgrade/runs/${encodeURIComponent(e)}`).then(e=>e.data),stop:e=>this.post(`agents/upgrade/runs/${encodeURIComponent(e)}/stop`).then(e=>e.data),retry:(e,t={})=>this.post(`agents/upgrade/runs/${encodeURIComponent(e)}/retry`,t).then(e=>e.data)};libraryDeploy={deploy:e=>this.post("library/deploy",e)};webhooks={list:()=>this.get("webhooks").then(e=>e.data.endpoints),get:e=>this.get(`webhooks/${e}`).then(e=>e.data.endpoint),create:e=>this.post("webhooks",e).then(e=>e.data.endpoint),update:(e,t)=>this.patch(`webhooks/${e}`,t).then(e=>e.data.endpoint),delete:e=>this.del(`webhooks/${e}`),deliveries:(e,t=1,s=20)=>this.get(`webhooks/${e}/deliveries?page=${t}&pageSize=${s}`).then(e=>e.data),test:e=>this.post(`webhooks/${e}/test`).then(e=>e.data),redeliver:(e,t)=>this.post(`webhooks/${e}/deliveries/${t}/redeliver`).then(e=>e.data)}};e.s(["f",0,e_],82983)}]);
|
|
2
|
+
Content-Type: ${r.type||"application/octet-stream"}`).byteLength),t+=4,t+="string"==typeof r?P.encode(L(r)).byteLength:r.size,t+=2;return 0===t?0:t+40+6}return e instanceof Blob?e.size:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:"string"==typeof e?P.encode(e).byteLength:e instanceof URLSearchParams?P.encode(e.toString()).byteLength:0})(s??e.body)||M(e.headers);return new Request(e,{duplex:"half",body:I(e.body,r,t),headers:e.headers,referrer:e.referrer,referrerPolicy:e.referrerPolicy})})(e,this.#a.onUploadProgress,this.#a.body):e}}let eN=(e,t)=>{try{return eI.create(e,t())}catch(t){let e=Promise.reject(t);for(let t of R())e[t]=async()=>e;return e}},eB=e=>{let t=(t,s)=>eN(t,()=>F(e,s));for(let s of v)t[s]=(t,r)=>eN(t,()=>F(e,r,{method:s}));return t.create=e=>eB(F(e)),t.extend=t=>("function"==typeof t&&(t=t(F(Y(e)))),eB(F(e,t))),t.stop=$,t.retry=S,t},ez=eB(),eJ="__magnus_trace_id__";var eF=e.i(39430);let eW={cron:"Cron management",users:"User management","system-updates":"Automatic system updates","ardent-management":"Ardent management","docker-group-remediation":"Docker group remediation","credential-renewal":"Credential renewal","execution-supervisor":"The execution supervisor"};function eH(e){let t="string"==typeof e?e:null==e?"":JSON.stringify(e);if(!t.includes("AGENT_NOT_PRIVILEGED")&&!/is disabled: agent is not privileged/.test(t))return null;let s=/"feature"\s*:\s*\\?"([a-z-]+)/.exec(t)?.[1]??/([a-z-]+) is disabled: agent is not privileged/.exec(t)?.[1];return`${!s?"This feature":eW[s]??s} is disabled on this node (its agent runs unprivileged).`}e.s(["f",0,eH],34479);let e_=new class{client;_baseUrl;constructor(){this._baseUrl="",this.client=this.createClient(this._baseUrl)}get baseUrl(){return this._baseUrl}getAuthHeaders(){return(0,eF.L)(this._baseUrl)}reconfigure(e){this._baseUrl=(0,eF.K)(e)??"",this.client=this.createClient(this._baseUrl)}createClient(e){return ez.create({prefix:"/api/proxy",timeout:18e4,hooks:{beforeRequest:[({request:t})=>{e?t.headers.set("x-proxy-target",e):t.headers.delete("x-proxy-target"),t.headers.get("x-trace-id")||t.headers.set("x-trace-id",function(){let e=globalThis,t=Date.now(),s=e[eJ];if(s&&t-s.lastUsedAt<1e4)return s.lastUsedAt=t,s.id;let r="u">typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID().replace(/-/g,"").slice(0,16):Math.random().toString(36).slice(2,10)+Math.random().toString(36).slice(2,10);return e[eJ]={id:r,lastUsedAt:t},r}())}],beforeError:[async({error:e})=>{if(e instanceof s&&403===e.response.status){let t=eH(e.data);t&&(e.name="AgentNotPrivilegedError",e.message=t)}return e}]}})}async get(e,t){let s={};if(t)for(let[e,r]of Object.entries(t))void 0!==r&&(s[e]=String(r));return this.client.get(e,{searchParams:s}).json()}async post(e,t,s){return this.client.post(e,{json:t,headers:s}).json()}async patch(e,t){return this.client.patch(e,{json:t}).json()}async put(e,t){return this.client.put(e,{json:t}).json()}async del(e){return this.client.delete(e).json()}nodes={list:e=>this.get("nodes",e),get:e=>this.get(`nodes/${e}`),register:e=>this.post("nodes/register",e),update:(e,t)=>this.patch(`nodes/${e}`,t),repairAddress:(e,t)=>this.post(`nodes/${e}/repair-address`,t),delete:e=>this.del(`nodes/${e}`),health:e=>this.get(`nodes/${e}/health`),gpu:(e,t="24h")=>this.get(`nodes/${e}/gpu`,{period:t}),forecast:(e,t=30)=>this.get(`health/${e}/forecast`,{days:t}),wazuh:e=>this.get(`nodes/${e}/wazuh`),wazuhSummary:()=>this.get("nodes/wazuh/summary"),systemUpdatesSummary:()=>this.get("nodes/system-updates/summary"),tailscaleSummary:()=>this.get("nodes/tailscale/summary"),enableSystemUpdates:e=>this.post(`nodes/${e}/system-updates/enable`),healthHistory:(e,t)=>this.get(`nodes/${e}/health/history`,{limit:t})};commands={dispatch:(e,t)=>this.post("commands",e,{"x-idempotency-key":t}),get:e=>this.get(`commands/${e}`),result:e=>this.get(`commands/${e}/result`),cancel:(e,t)=>this.post(`commands/${e}/cancel`,{reason:t})};cron={list:e=>this.get("cron",e?{nodeId:e}:void 0),get:e=>this.get(`cron/${e}`),create:e=>this.post("cron",e),update:(e,t)=>this.patch(`cron/${e}`,t),delete:e=>this.del(`cron/${e}`)};files={update:e=>this.post("files/update",e),read:(e,t)=>this.get("files/read",{nodeId:e,filePath:t})};skills={list:()=>this.get("skills"),get:e=>this.get(`skills/${e}`),create:e=>this.post("skills",e),update:(e,t)=>this.patch(`skills/${e}`,t),delete:e=>this.del(`skills/${e}`),push:e=>this.post("skills/push",e),installations:e=>this.get(`skills/installations/${e}`),getFile:(e,t)=>this.get(`skills/${e}/files/${t}`),updateFile:(e,t,s)=>this.client.put(`skills/${e}/files/${t}`,{json:{content:s}}).json(),registry:{list:()=>this.get("skills/registry"),get:e=>this.get(`skills/registry/${e}`),sync:()=>this.post("skills/registry/sync",{}),publish:(e,t)=>this.post(`skills/registry/${e}/publish`,t),versions:e=>this.get(`skills/registry/${e}/versions`),versionDetail:(e,t)=>this.get(`skills/registry/${e}/versions/${t}`),setTag:(e,t)=>this.post(`skills/registry/${e}/tags`,t),delete:e=>this.del(`skills/registry/${e}`)}};logs={query:e=>this.post("logs/query",e),ingest:e=>this.post("logs/ingest",e)};audit={list:e=>this.get("audit",e),days:()=>this.get("audit/days")};hermes={installations:()=>this.get("hermes/installations"),installation:e=>this.get(`hermes/installations/${e}`),detect:e=>this.post("hermes/detect",e),deploy:(e,t)=>this.post("hermes/deploy",e,{"x-idempotency-key":t}),sync:e=>this.post(`hermes/installations/${e}/sync`),configure:e=>this.post(`hermes/installations/${e}/configure`),config:e=>this.get(`hermes/installations/${e}/config`),updateConfig:(e,t)=>this.patch(`hermes/installations/${e}/config`,t),update:e=>this.post(`hermes/installations/${e}/update`),uninstall:e=>this.del(`hermes/installations/${e}`),profiles:e=>e?this.get(`hermes/installations/${e}/profiles`):this.get("hermes/profiles"),createProfile:(e,t)=>this.post(`hermes/installations/${e}/profiles`,t),updateProfile:(e,t)=>this.patch(`hermes/profiles/${e}`,t),deleteProfile:e=>this.del(`hermes/profiles/${e}`),describeProfile:e=>this.post(`hermes/profiles/${e}/describe-auto`),gatewayAction:(e,t)=>this.post(`hermes/profiles/${e}/gateway/${t}`),dashboardAction:(e,t)=>this.post(`hermes/installations/${e}/dashboard/${t}`),enableApiServer:(e,t)=>this.post(`hermes/profiles/${e}/api-server/enable`,t),disableApiServer:e=>this.post(`hermes/profiles/${e}/api-server/disable`),apiServerStatus:e=>this.get(`hermes/profiles/${e}/api-server/status`),rotateApiServerKey:(e,t)=>this.post(`hermes/profiles/${e}/api-server/rotate-key`,t),migrationDryRun:e=>this.post("hermes/migration/openclaw/dry-run",e),migrationApply:(e,t)=>this.post("hermes/migration/openclaw/apply",e,{"x-idempotency-key":t}),jobs:e=>this.get("hermes/jobs",e),job:e=>this.get(`hermes/jobs/${e}`)};ardent={installations:()=>this.get("ardent/installations"),installation:e=>this.get(`ardent/installations/${encodeURIComponent(e)}`),profiles:()=>this.get("ardent/profiles"),resource:(e,t,s,r)=>this.get(`ardent/installations/${encodeURIComponent(e)}/profiles/${encodeURIComponent(t)}/${s}`,r),action:(e,t,s,r,o)=>this.client.post(`ardent/installations/${encodeURIComponent(e)}/profiles/${encodeURIComponent(t)}/action`,{json:{action:s,...o?{target:o}:{},body:r??{}},timeout:"package-install"===s?62e4:s.startsWith("service-")?125e3:55e3}).json()};codex={installations:(e=!1)=>this.get("codex/installations",{refreshLatest:e?"true":void 0}),installation:(e,t=!1)=>this.get(`codex/installations/${e}`,{refreshLatest:t?"true":void 0}),update:e=>this.client.post(`codex/installations/${e}/update`,{timeout:92e4,retry:0}).json(),logout:e=>this.post(`codex/installations/${e}/logout`),startDeviceAuth:e=>this.post(`codex/installations/${e}/device-auth`),deviceAuth:(e,t)=>this.get(`codex/installations/${e}/device-auth/${t}`),cancelDeviceAuth:(e,t)=>this.post(`codex/installations/${e}/device-auth/${t}/cancel`)};orchestra={overview:()=>this.get("orchestra/overview"),capabilities:()=>this.get("orchestra/capabilities"),skillCatalog:()=>this.get("orchestra/skill-catalog"),auditCatalogSkill:e=>this.get(`orchestra/skill-catalog/${encodeURIComponent(e)}/audit`),installCatalogSkill:e=>this.post("orchestra/skill-catalog/install",e),quarantineCatalogSkill:e=>this.post(`orchestra/skill-catalog/${encodeURIComponent(e)}/quarantine`,{}),previewSkillBundle:e=>this.post("orchestra/skill-bundles/preview",e),applySkillBundle:e=>this.post("orchestra/skill-bundles/apply",e),cancelJob:e=>this.post(`orchestra/jobs/${e}/cancel`),testProvider:e=>this.post("orchestra/providers/test",e),skillAssignments:{list:e=>this.get("orchestra/skill-assignments",e),create:e=>this.post("orchestra/skill-assignments",e),update:(e,t)=>this.patch(`orchestra/skill-assignments/${e}`,t),delete:e=>this.del(`orchestra/skill-assignments/${e}`)},toolsetPolicies:{list:e=>this.get("orchestra/toolset-policies",e),upsert:e=>this.put("orchestra/toolset-policies",e),update:(e,t)=>this.patch(`orchestra/toolset-policies/${e}`,t),delete:e=>this.del(`orchestra/toolset-policies/${e}`)},roles:{list:()=>this.get("orchestra/roles"),get:e=>this.get(`orchestra/roles/${e}`),create:e=>this.post("orchestra/roles",e),update:(e,t)=>this.patch(`orchestra/roles/${e}`,t),delete:e=>this.del(`orchestra/roles/${e}`),apply:(e,t)=>this.post(`orchestra/roles/${e}/apply`,t)},providers:{get:e=>this.get("orchestra/providers",e),upsert:e=>this.put("orchestra/providers",e)},credentialPools:{list:()=>this.get("orchestra/credential-pools"),create:e=>this.post("orchestra/credential-pools",e),update:(e,t)=>this.patch(`orchestra/credential-pools/${e}`,t),delete:e=>this.del(`orchestra/credential-pools/${e}`),attach:(e,t)=>this.post(`orchestra/credential-pools/${e}/attach`,t),detach:e=>this.del(`orchestra/credential-pools/attachments/${e}`)},mcpServers:{list:()=>this.get("orchestra/mcp-servers"),create:e=>this.post("orchestra/mcp-servers",e),update:(e,t)=>this.patch(`orchestra/mcp-servers/${e}`,t),delete:e=>this.del(`orchestra/mcp-servers/${e}`),attach:(e,t)=>this.post(`orchestra/mcp-servers/${e}/attach`,t),detach:e=>this.del(`orchestra/mcp-servers/attachments/${e}`)},messagingBindings:{list:e=>this.get("orchestra/messaging-bindings",e),create:e=>this.post("orchestra/messaging-bindings",e),update:(e,t)=>this.patch(`orchestra/messaging-bindings/${e}`,t),delete:e=>this.del(`orchestra/messaging-bindings/${e}`)},cronJobs:{list:e=>this.get("orchestra/cron-jobs",e),create:e=>this.post("orchestra/cron-jobs",e),update:(e,t)=>this.patch(`orchestra/cron-jobs/${e}`,t),delete:e=>this.del(`orchestra/cron-jobs/${e}`)},plugins:{list:e=>this.get("orchestra/plugins",e),install:e=>this.post("orchestra/plugins",e),remove:e=>this.del(`orchestra/plugins/${e}`)},hooks:{list:e=>this.get("orchestra/hooks",e),create:e=>this.post("orchestra/hooks",e),update:(e,t)=>this.patch(`orchestra/hooks/${e}`,t),delete:e=>this.del(`orchestra/hooks/${e}`)}};quickCommand={exec:(e,t)=>this.post(`quick-command/${e}/exec`,t)};discovery={scan:e=>this.post("discovery/scan",{timeoutMs:e})};stats={overview:()=>this.get("stats/overview")};roles={list:()=>this.get("roles"),get:e=>this.get(`roles/${e}`),create:e=>this.post("roles",e),update:(e,t)=>this.patch(`roles/${e}`,t),delete:e=>this.del(`roles/${e}`),assign:(e,t)=>this.post(`roles/${e}/assign`,t),unassign:(e,t)=>this.post(`roles/${e}/unassign`,t),apply:(e,t)=>this.post(`roles/${e}/apply`,t??{}),applications:{list:e=>this.get("roles/applications/list",e),get:e=>this.get(`roles/applications/${e}`)}};notifications={list:e=>this.get("notifications",e),unreadCount:()=>this.get("notifications/unread-count"),markRead:e=>this.post("notifications/read",{ids:e}),markAllRead:()=>this.post("notifications/read-all")};library={categories:{list:()=>this.get("library/categories"),create:e=>this.post("library/categories",e),update:(e,t)=>this.patch(`library/categories/${e}`,t),delete:e=>this.del(`library/categories/${e}`)},files:{list:e=>this.get("library/files",e),get:e=>this.get(`library/files/${e}`),create:e=>this.post("library/files",e),update:(e,t)=>this.patch(`library/files/${e}`,t),delete:e=>this.del(`library/files/${e}`),move:e=>this.post("library/files/move",e)}};anomalies={list:e=>this.get("anomalies",e),summary:()=>this.get("anomalies/summary"),correlation:e=>this.get(`anomalies/event/${e}/correlation`),nodeSummary:e=>this.get(`anomalies/${e}/summary`),resolve:e=>this.post(`anomalies/${e}/resolve`),resolveNode:(e,t)=>this.post("anomalies/resolve-node",{nodeId:e,metric:t})};remediation={listRules:()=>this.get("remediation/rules"),getRule:e=>this.get(`remediation/rules/${e}`),createRule:e=>this.post("remediation/rules",e),updateRule:(e,t)=>this.patch(`remediation/rules/${e}`,t),deleteRule:e=>this.del(`remediation/rules/${e}`),listExecutions:e=>this.get("remediation/executions",e),trigger:e=>this.post("remediation/trigger",e)};assistant={chat:e=>this.post("assistant/chat",e),conversations:e=>this.get("assistant/conversations",e),messages:(e,t)=>this.get(`assistant/conversations/${e}`,t),forkConversation:(e,t)=>this.post(`assistant/conversations/${e}/fork`,{fromMessageId:t}),shareConversation:(e,t)=>this.post(`assistant/conversations/${e}/share`,{ttlHours:t}),getSharedConversation:e=>this.get(`assistant/shares/${e}`),getScratchpad:e=>this.get(`assistant/conversations/${e}/scratchpad`),clearScratchpad:e=>this.del(`assistant/conversations/${e}/scratchpad`),markConversationRead:e=>this.post(`assistant/conversations/${e}/read`),archiveConversation:e=>this.post(`assistant/conversations/${e}/archive`),deleteConversation:e=>this.del(`assistant/conversations/${e}`),unreadCount:()=>this.get("assistant/unread"),markMessagesRead:e=>this.post("assistant/messages/read",{messageIds:e}),getHeartbeatPrompt:()=>this.get("assistant/heartbeat-prompt"),updateHeartbeatPrompt:e=>this.put("assistant/heartbeat-prompt",{content:e}),resetHeartbeatPrompt:()=>this.del("assistant/heartbeat-prompt"),listModels:()=>this.get("assistant/models"),getModelContext:e=>this.get(`assistant/models/${encodeURIComponent(e)}/context`),getSettings:()=>this.get("assistant/settings"),updateSettings:e=>this.patch("assistant/settings",e),chatStreamUrl:()=>`${this._baseUrl}/assistant/chat/stream`,approveToolCall:e=>this.post(`assistant/messages/${e}/approve`),rejectToolCall:e=>this.post(`assistant/messages/${e}/reject`),confirmCommand:e=>this.post(`assistant/messages/${e}/confirm`),exportConversation:(e,t="markdown")=>this.client.get(`assistant/conversations/${e}/export`,{searchParams:{format:t}}).then(e=>e.text()),getInsights:()=>this.get("assistant/insights"),listPinnedInsights:()=>this.get("assistant/insights/pins"),pinInsight:e=>this.post("assistant/insights/pins",e),unpinInsight:e=>this.del(`assistant/insights/pins/${e}`),getModelProfiles:()=>this.get("assistant/model-profiles"),updateModelProfiles:e=>this.patch("assistant/model-profiles",Object.fromEntries(e.map(e=>[e.taskType,{provider:e.provider,model:e.model,fallbacks:e.fallbacks,temperature:e.temperature,maxTokens:e.maxTokens,maxToolRounds:e.maxToolRounds,thinkingMode:e.thinkingMode}])))};selfUpdate={status:()=>this.get("self-update/status"),version:()=>this.get("self-update/version"),check:()=>this.post("self-update/check"),apply:e=>this.post("self-update/apply",{restart:e}),restart:()=>this.post("self-update/restart")};systemUpdates={get:()=>this.get("system/updates").then(e=>e.data),refresh:()=>this.post("system/updates/check").then(e=>e.data)};agentUpgrades={eligibility:e=>this.get(`agents/upgrade/eligibility${e?`?version=${encodeURIComponent(e)}`:""}`).then(e=>e.data),start:e=>this.post("agents/upgrade",e).then(e=>e.data),check:e=>this.post("agents/upgrade",{...e,dryRun:!0}).then(e=>e.data),run:e=>this.get(`agents/upgrade/runs/${encodeURIComponent(e)}`).then(e=>e.data),stop:e=>this.post(`agents/upgrade/runs/${encodeURIComponent(e)}/stop`).then(e=>e.data),retry:(e,t={})=>this.post(`agents/upgrade/runs/${encodeURIComponent(e)}/retry`,t).then(e=>e.data)};libraryDeploy={deploy:e=>this.post("library/deploy",e)};webhooks={list:()=>this.get("webhooks").then(e=>e.data.endpoints),get:e=>this.get(`webhooks/${e}`).then(e=>e.data.endpoint),create:e=>this.post("webhooks",e).then(e=>e.data.endpoint),update:(e,t)=>this.patch(`webhooks/${e}`,t).then(e=>e.data.endpoint),delete:e=>this.del(`webhooks/${e}`),deliveries:(e,t=1,s=20)=>this.get(`webhooks/${e}/deliveries?page=${t}&pageSize=${s}`).then(e=>e.data),test:e=>this.post(`webhooks/${e}/test`).then(e=>e.data),redeliver:(e,t)=>this.post(`webhooks/${e}/deliveries/${t}/redeliver`).then(e=>e.data)}};e.s(["f",0,e_],82983)}]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,68288,e=>{"use strict";var t=e.i(43476),a=e.i(71645),r=e.i(4050),s=e.i(82983);let n=0,i=Date.now(),l=[],o=null,c=!1;function d(e,t){let a;(a=Date.now())-i>=6e4&&(n=0,i=a),n>=20||(n++,l.push({nodeId:"__dashboard__",source:"dashboard",level:"error",message:e,metadata:t,timestamp:new Date().toISOString()}))}async function m(){if(0===l.length)return;let e=l.splice(0,l.length);try{await s.f.logs.ingest(e)}catch{}}var u=e.i(52928),x=e.i(53034),h=e.i(37806),p=e.i(47414);function f({children:e,...r}){let s=(0,a.useContext)(h.f);(r={...s,...r}).transition=(0,x.f)(r.transition,s.transition),r.isStatic=(0,p.f)(()=>r.isStatic);let n=(0,a.useMemo)(()=>r,[JSON.stringify(r.transition),r.transformPagePoint,r.reducedMotion,r.skipAnimations,r.isValidProp]);return(0,t.jsx)(h.f.Provider,{value:n,children:e})}var b=e.i(72603);e.s(["Providers",0,function({children:e}){return(0,a.useEffect)(()=>((0,b.P)(),function(){if(c)return()=>{};c=!0;let e=e=>{d(`Uncaught error: ${e.message}`,{url:window.location.pathname,filename:e.filename??"unknown",lineno:e.lineno??0,colno:e.colno??0})},t=e=>{let t=e.reason,a=t instanceof Error?t.message:String(t);d(`Unhandled rejection: ${a}`,{url:window.location.pathname})};return window.addEventListener("error",e),window.addEventListener("unhandledrejection",t),o=setInterval(()=>void m(),1e4),()=>{window.removeEventListener("error",e),window.removeEventListener("unhandledrejection",t),o&&(clearInterval(o),o=null),m(),c=!1}}()),[]),(0,t.jsx)(f,{reducedMotion:"user",children:(0,t.jsx)(u.N,{children:(0,t.jsx)(r.v,{children:e})})})}],68288)},40073,e=>{"use strict";var t=e.i(43476),a=e.i(71645),r=e.i(18566),s=e.i(22016),n=e.i(78571),i=e.i(16327),l=e.i(66794),o=e.i(77071),c=e.i(89664),d=e.i(4050),m=e.i(35673),u=e.i(15e3),x=e.i(39430);function h({status:e}){let a="online"===e?"Online":"offline"===e?"Offline":"Checking…";return(0,t.jsx)("span",{role:"status","aria-label":a,className:`inline-block h-2 w-2 shrink-0 rounded-full ${"online"===e?"bg-success":"offline"===e?"bg-danger":"bg-text-muted/40 animate-pulse"}`,title:a})}function p(){let{nodes:e,activeNode:r,switchNode:s,loading:n}=(0,d.l)(),[p,f]=(0,a.useState)(!1),[b,g]=(0,a.useState)(!1),[v,y]=(0,a.useState)(!1),w=(0,a.useRef)(null),[k,j]=(0,a.useState)({}),N=(0,a.useRef)(null),C=(0,a.useMemo)(()=>e.length>0?e:[u.f],[e]),M=(0,a.useCallback)(async()=>{let e={};await Promise.allSettled(C.map(async t=>{try{let a=(0,x.L)(t.url),r=await fetch("/api/proxy/health",{method:"GET",headers:a,signal:AbortSignal.timeout(6e3)});e[t.id]=r.ok?"online":"offline"}catch{e[t.id]="offline"}})),j(e)},[C]);return((0,a.useEffect)(()=>{M()},[M]),(0,a.useEffect)(()=>{if(p)return M(),N.current=setInterval(()=>void M(),3e4),()=>{N.current&&clearInterval(N.current)}},[p,M]),(0,a.useEffect)(()=>{if(p)return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)};function e(e){w.current&&!w.current.contains(e.target)&&f(!1)}function t(e){"Escape"===e.key&&f(!1)}},[p]),n)?(0,t.jsx)("div",{className:"mx-3 mt-2 mb-1 rounded border border-border bg-bg px-3 py-2 text-xs text-text-muted animate-pulse",children:"Loading…"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"relative mx-3 mt-2 mb-1",ref:w,children:[(0,t.jsx)("div",{className:"mb-1 px-0.5 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Node Controller"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)("button",{onClick:()=>f(!p),"aria-expanded":p,"aria-haspopup":"listbox","aria-label":`Node controller: ${r.name}`,className:"flex flex-1 items-center gap-2 rounded border border-border bg-bg px-2.5 py-1.5 text-left transition-all hover:bg-surface-hover min-w-0",children:[(0,t.jsx)(h,{status:k[r.id]??"unknown"}),(0,t.jsx)("span",{className:"flex-1 truncate text-xs font-medium",children:r.name}),(0,t.jsx)(i.f,{className:`h-3.5 w-3.5 shrink-0 text-text-muted transition-transform ${p?"rotate-180":""}`})]}),(0,t.jsx)("button",{onClick:function(){y(!1),g(!0)},className:"rounded border border-border bg-bg p-1.5 text-text-muted transition-all hover:bg-surface-hover hover:text-text",title:"Control Node Settings",children:(0,t.jsx)(l.f,{className:"h-3.5 w-3.5"})})]}),p&&(0,t.jsxs)("div",{className:"absolute left-3 right-3 z-50 mt-1 rounded border border-border bg-surface shadow-xl",children:[(0,t.jsx)("div",{role:"listbox","aria-label":"Control nodes",className:"max-h-48 overflow-y-auto py-1",children:C.map(e=>(0,t.jsxs)("button",{role:"option","aria-selected":e.id===r.id,onClick:()=>{s(e.id),f(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-all hover:bg-surface-hover",children:[(0,t.jsx)(h,{status:k[e.id]??"unknown"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"font-medium truncate",children:e.name}),(0,t.jsx)("div",{className:"text-text-muted truncate text-[10px]",children:e.url})]}),e.id===r.id&&(0,t.jsx)(c.f,{className:"h-3.5 w-3.5 shrink-0 text-primary"})]},e.id))}),(0,t.jsx)("div",{className:"border-t border-border",children:(0,t.jsxs)("button",{onClick:function(){f(!1),y(!0),g(!0)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-primary transition-all hover:bg-surface-hover",children:[(0,t.jsx)(o.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"font-bold",children:"Add Control Node"})]})})]})]}),(0,t.jsx)(m.f,{open:b,onClose:()=>g(!1),createMode:v})]})}var f=e.i(32181),b=e.i(56420);let g={name:"layout-dashboard",size:24,node:[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]};g.node;let v=(0,b.f)(g);var y=e.i(41220),w=e.i(4139),k=e.i(74544),j=e.i(26091);let N={name:"scroll-text",size:24,node:[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]};N.node;let C=(0,b.f)(N);var M=e.i(82954),S=e.i(71567),E=e.i(82303),$=e.i(63644),_=e.i(12092),A=e.i(99835),L=e.i(64569);let R={name:"map",size:24,node:[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]};R.node;let z=(0,b.f)(R);var P=e.i(56423);let I={name:"compass",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]]};I.node;let T=(0,b.f)(I);var O=e.i(90985);let D={name:"heart-pulse",size:24,node:[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}],["path",{d:"M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"auskq0"}]]};D.node;let U=(0,b.f)(D),F={name:"rotate-ccw-clock",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],aliases:["history"]};F.node;let q=(0,b.f)(F);var G=e.i(9584);let H={name:"git-compare-arrows",size:24,node:[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]};H.node;let K=(0,b.f)(H),V={name:"package-check",size:24,node:[["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m16 17 2 2 4-4",key:"uh5qu3"}],["path",{d:"M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753",key:"kpkbpo"}],["path",{d:"M3.29 7 12 12l8.71-5",key:"19ckod"}],["path",{d:"m7.5 4.27 8.997 5.148",key:"9yrvtv"}]]};V.node;let W=(0,b.f)(V),J={name:"square-activity",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M17 12h-2l-2 5-2-10-2 5H7",key:"15hlnc"}]],aliases:["activity-square"]};J.node;let B=(0,b.f)(J);var X=e.i(84026);let Q={name:"scan-search",size:24,node:[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]};Q.node;let Y=(0,b.f)(Q);var Z=e.i(52330),ee=e.i(58925),et=e.i(83892),ea=e.i(71028);let er=[{id:"fleet",label:"Fleet",tone:"primary",items:[{href:"/mission-control",label:"Mission Control",icon:T},{href:"/",label:"Overview",icon:v,exact:!0},{href:"/nodes",label:"Nodes",icon:y.f},{href:"/application-operations",label:"Applications",icon:U},{href:"/fleet-readiness",label:"Readiness",icon:ea.f},{href:"/fleet-timeline",label:"Timeline",icon:q},{href:"/fleet-map",label:"Fleet Map",icon:z},{href:"/commands",label:"Commands",icon:w.f},{href:"/anomalies",label:"Anomalies",icon:$.f},{href:"/anomalies/remediation",label:"Remediation",icon:L.f},{href:"/governor/operations",label:"Operations",icon:_.f},{href:"/rollouts",label:"Rollouts",icon:W},{href:"/incidents",label:"Incidents",icon:B},{href:"/cron",label:"Cron Jobs",icon:k.f},{href:"/files",label:"Files",icon:j.f},{href:"/logs",label:"Logs",icon:C},{href:"/audit",label:"Audit",icon:M.f},{href:"/webhooks",label:"Webhooks",icon:A.f},{href:"/retention",label:"Retention",icon:G.f},{href:"/api-docs",label:"API Docs",icon:P.f}]},{id:"security",label:"Security",tone:"primary",integration:"securityConsole",items:[{href:"/security-fusion",label:"Fleet summary",icon:Y,exact:!0}]},{id:"hermes",label:"Hermes Agent",tone:"accent",integration:"hermes",items:[{href:"/orchestra",label:"Overview",icon:S.f,exact:!0},{href:"/orchestra/installations",label:"Installations",icon:y.f},{href:"/orchestra/profiles",label:"Profiles",icon:E.f},{href:"/hermes-drift",label:"Drift Cockpit",icon:K},{href:"/hermes-security",label:"Proxy Security",icon:X.f},{href:"/orchestra/web-gateway",label:"Web Gateway",icon:O.f}]},{id:"ardent",label:"Magnus Ardent",tone:"primary",items:[{href:"/ardent",label:"Overview",icon:et.f,exact:!0},{href:"/ardent/installations",label:"Installations",icon:y.f},{href:"/ardent/profiles",label:"Profiles",icon:E.f}]},{id:"codex",label:"Codex Agent",tone:"primary",items:[{href:"/codex",label:"Overview",icon:Z.f,exact:!0},{href:"/codex/installations",label:"Installations",icon:ee.f}]}],es={"/":"Fleet Overview","/mission-control":"Mission Control","/nodes":"Nodes","/application-operations":"Application Operations","/fleet-readiness":"Fleet Readiness","/fleet-timeline":"Fleet Timeline","/fleet-map":"Fleet Map","/commands":"Commands","/anomalies":"Anomalies","/anomalies/remediation":"Auto-Remediation","/governor/operations":"Fleet Operations","/rollouts":"Guided Rollouts","/incidents":"Incident Workspace","/cron":"Cron Jobs","/files":"Files","/logs":"Logs","/audit":"Audit","/webhooks":"Webhooks","/retention":"Retention","/api-docs":"API Docs","/library":"Library","/skills":"Skills","/roles":"Roles","/sync":"Sync","/notifications":"Notification Preferences","/security-fusion":"Security","/orchestra":"Hermes Agent Fleet","/orchestra/installations":"Hermes Installations","/orchestra/profiles":"Hermes Profiles","/orchestra/web-gateway":"Web Gateway","/hermes-drift":"Hermes Drift Cockpit","/hermes-security":"Hermes Proxy Security","/ardent":"Magnus Ardent","/ardent/installations":"Ardent Installations","/ardent/profiles":"Ardent Profiles","/codex":"Codex Agent Fleet","/codex/installations":"Codex Installations"};function en(e,t,a=!1){return"/"===t||a?e===t:e===t||e.startsWith(`${t}/`)}function ei(e){let t=null;for(let a of er)for(let r of a.items)!r.external&&en(e,r.href,r.exact)&&(null===t||r.href.length>t.length)&&(t=r.href);return t}var el=e.i(16141);let eo={security:"from-primary/60 via-accent/20",hermes:"from-accent/50 via-accent/20",ardent:"from-primary/50 via-accent/20",codex:"from-primary/50 via-primary/20"};function ec({group:e,activeHref:a}){let r="accent"===e.tone;return(0,t.jsxs)(t.Fragment,{children:["fleet"!==e.id&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"mx-3 my-1",children:(0,t.jsx)("div",{className:(0,n.f)("h-px bg-gradient-to-r to-transparent",eo[e.id])})}),(0,t.jsx)("div",{className:"px-4 pb-0.5 pt-2",children:(0,t.jsx)("span",{className:(0,n.f)("text-[9px] font-bold uppercase tracking-[0.25em]",r?"text-accent/60":"text-primary/60"),children:e.label})})]}),(0,t.jsx)("nav",{className:(0,n.f)("space-y-0.5 p-3","fleet"!==e.id&&"pt-1"),"aria-label":e.label,children:e.items.map(e=>{let i=e.href===a,l=e.icon;return(0,t.jsxs)(s.default,{href:e.href,prefetch:!1,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0,"aria-current":i?"page":void 0,className:(0,n.f)("group relative flex items-center gap-3 overflow-hidden rounded-chip px-3 py-2 text-xs uppercase tracking-wider transition-colors duration-200","before:pointer-events-none before:absolute before:inset-y-0 before:-left-1/2 before:w-1/2 before:-skew-x-12 before:bg-gradient-to-r before:from-transparent before:to-transparent before:opacity-0 before:transition-[left,opacity] before:duration-500 hover:before:left-full hover:before:opacity-100",r?"before:via-accent/10":"before:via-primary/10",i?(0,n.f)(r?"text-accent":"text-primary",r?"bg-accent/5":"bg-primary/5"):(0,n.f)("text-text-muted",r?"hover:text-accent":"hover:text-primary")),children:[i&&(0,t.jsx)(f.f.span,{layoutId:"sidebar-indicator",className:(0,n.f)("absolute bottom-1 left-0 top-1 w-0.5 rounded-full",r?"bg-accent":"bg-primary"),style:{boxShadow:r?"0 0 8px var(--color-accent), 0 0 16px var(--color-glow-accent)":"0 0 8px var(--color-primary), 0 0 16px var(--color-glow)"},transition:{type:"spring",stiffness:300,damping:30}}),(0,t.jsx)(l,{className:"relative h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"relative truncate",children:e.label})]},e.href)})})]})}function ed(){return(0,t.jsxs)("div",{className:"relative flex h-8 w-8 items-center justify-center animate-flicker",children:[(0,t.jsxs)("svg",{viewBox:"0 0 32 32",className:"h-8 w-8 overflow-visible","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"1",y:"1",width:"30",height:"30",rx:"4",fill:"none",stroke:"var(--color-primary)",strokeOpacity:"0.35"}),(0,t.jsx)("path",{d:"M8 23 V9 L16 18 L24 9 V23",fill:"none",stroke:"var(--color-primary)",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",pathLength:100,style:{"--stroke-length":100,strokeDasharray:100,animation:"draw-stroke 1.4s var(--ease-out-expo) both"},className:"drop-shadow-[0_0_4px_var(--color-primary)]"})]}),(0,t.jsx)("div",{className:"absolute inset-0 rounded shadow-[0_0_12px_var(--color-glow)]"})]})}function em(){let{connected:e}=(0,a.useSyncExternalStore)(el.f.subscribe,el.f.getSnapshot,el.f.getServerSnapshot);return(0,t.jsxs)("span",{className:"flex items-center gap-1.5",title:e?"Live event stream connected":"Live event stream reconnecting",children:[(0,t.jsxs)("span",{className:"relative inline-flex h-1.5 w-1.5",children:[e&&(0,t.jsx)("span",{className:"absolute inset-0 rounded-full bg-success animate-halo"}),(0,t.jsx)("span",{className:(0,n.f)("relative inline-flex h-1.5 w-1.5 rounded-full",e?"bg-success shadow-[0_0_6px_var(--color-success)]":"bg-warning")})]}),(0,t.jsx)("span",{className:e?"text-success/70":"text-warning/70",children:e?"Live":"Offline"})]})}function eu({integrations:e}){let s=ei((0,r.usePathname)()),n=(0,a.useMemo)(()=>(function(e,t=er){return t.filter(t=>{var a;return!t.integration||(a=t.integration,"securityConsole"===a?null!==e.securityConsoleUrl:e.hermes)}).map(t=>"security"===t.id&&e.securityConsoleUrl?{...t,items:[{href:e.securityConsoleUrl,label:"Security console ↗",icon:Y,external:!0},...t.items]}:t)})(e),[e]);return(0,t.jsxs)("aside",{className:"relative flex h-full w-56 flex-col border-r border-border/50 bg-bg",children:[(0,t.jsx)("div",{className:"absolute bottom-0 right-0 top-0 w-px bg-gradient-to-b from-primary/60 via-primary/20 to-transparent"}),(0,t.jsxs)("div",{className:"flex h-14 items-center gap-3 border-b border-border/30 px-4",children:[(0,t.jsx)(ed,{}),(0,t.jsx)("span",{className:"text-sm font-bold uppercase tracking-[0.2em] text-text",children:"Magnus"})]}),(0,t.jsx)(p,{}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:n.map(e=>(0,t.jsx)(ec,{group:e,activeHref:s},e.id))}),(0,t.jsxs)("div",{className:"flex items-center justify-between border-t border-border/30 p-4 text-[10px] uppercase tracking-widest text-primary/40",children:[(0,t.jsxs)("span",{children:["Magnus v","2.2.0"]}),(0,t.jsx)(em,{})]})]})}var ex=e.i(67784),eh=e.i(41120);let ep={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};ep.node;let ef=(0,b.f)(ep);var eb=e.i(66595),eg=e.i(67927);let ev={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};ev.node;let ey=(0,b.f)(ev),ew={name:"check-check",size:24,node:[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]};ew.node;let ek=(0,b.f)(ew);var ej=e.i(53138),eN=e.i(99847),eC=e.i(10818),eM=e.i(94371),eS=e.i(69174),eE=e.i(82983);function e$(){let[e,r]=(0,a.useState)(!1),[i,o]=(0,a.useState)([]),[d,m]=(0,a.useState)(0),[u,x]=(0,a.useState)(!1),h=(0,a.useRef)(null),p=(0,a.useCallback)(async()=>{try{let e=await eE.f.notifications.unreadCount();e.success&&e.data&&m(e.data.count)}catch{}},[]),f=(0,a.useCallback)(async()=>{x(!0);try{let e=await eE.f.notifications.list({pageSize:20});if(e.success&&e.data){let t=e.data;o(t.notifications)}}catch{}finally{x(!1)}},[]);(0,a.useEffect)(()=>{p();let e=setInterval(()=>void p(),15e3);return()=>clearInterval(e)},[p]),(0,a.useEffect)(()=>{e&&f()},[e,f]),(0,a.useEffect)(()=>{if(!e)return;let t=e=>{h.current&&!h.current.contains(e.target)&&r(!1)};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[e]),(0,a.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&r(!1)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]);let b=async e=>{try{await eE.f.notifications.markRead([e]),o(t=>t.map(t=>t.id===e?{...t,isRead:!0}:t)),m(e=>Math.max(0,e-1))}catch{}},g=async()=>{try{await eE.f.notifications.markAllRead(),o(e=>e.map(e=>({...e,isRead:!0}))),m(0),setTimeout(()=>void p(),500)}catch{}};return(0,t.jsxs)("div",{className:"relative",ref:h,children:[(0,t.jsxs)("button",{className:"relative rounded p-2 text-text-muted transition-all hover:bg-surface-hover hover:text-text",title:"Notifications",type:"button","aria-expanded":e,"aria-controls":"notification-panel","aria-label":d>0?`Notifications (${d} unread)`:"Notifications",onClick:()=>r(e=>!e),children:[(0,t.jsx)(ey,{className:"h-4 w-4"}),d>0&&(0,t.jsx)("span",{className:"absolute right-1 top-1 flex h-4 min-w-[1rem] items-center justify-center rounded-full bg-danger px-1 text-[10px] font-bold text-white",children:d>99?"99+":d})]}),e&&(0,t.jsxs)("div",{id:"notification-panel",role:"region","aria-label":"Notifications",className:"absolute right-0 top-full z-50 mt-2 w-96 overflow-hidden rounded border border-border bg-surface shadow-2xl",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[(0,t.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider text-text",children:"Notifications"}),d>0&&(0,t.jsxs)("button",{className:"flex items-center gap-1 rounded px-2 py-1 text-xs text-primary hover:bg-primary/10 transition-all",onClick:()=>void g(),type:"button",children:[(0,t.jsx)(ek,{className:"h-3 w-3"}),"Mark all read"]})]}),(0,t.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[u&&0===i.length&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsx)("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-primary border-t-transparent"})}),!u&&0===i.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-10 text-text-muted",children:[(0,t.jsx)(ey,{className:"mb-2 h-8 w-8 opacity-40"}),(0,t.jsx)("p",{className:"text-xs",children:"No notifications yet"})]}),i.map(e=>(0,t.jsxs)("div",{className:(0,n.f)("group flex items-start gap-3 border-b border-border/50 px-4 py-3 transition-all hover:bg-surface-hover",!e.isRead&&"bg-primary/5"),children:[(0,t.jsx)("div",{className:"mt-0.5 shrink-0",children:function(e){switch(e){case"critical":return(0,t.jsx)(eN.f,{className:"h-4 w-4 text-danger"});case"warning":return(0,t.jsx)(ej.f,{className:"h-4 w-4 text-warning"});default:return(0,t.jsx)(eC.f,{className:"h-4 w-4 text-primary"})}}(e.severity)}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[function(e){switch(e){case"node.offline":return(0,t.jsx)(y.f,{className:"h-3.5 w-3.5 text-danger"});case"node.degraded":case"node.upgrade_not_ready":return(0,t.jsx)(y.f,{className:"h-3.5 w-3.5 text-warning"});case"node.recovered":return(0,t.jsx)(U,{className:"h-3.5 w-3.5 text-success"});case"command.failed":return(0,t.jsx)(w.f,{className:"h-3.5 w-3.5 text-warning"});case"deploy.failed":return(0,t.jsx)(eM.f,{className:"h-3.5 w-3.5 text-danger"});case"upgrade.failed":return(0,t.jsx)(eS.f,{className:"h-3.5 w-3.5 text-danger"});default:return(0,t.jsx)(ey,{className:"h-3.5 w-3.5 text-text-muted"})}}(e.type),(0,t.jsx)("span",{className:(0,n.f)("text-xs font-bold",e.isRead?"text-text-muted":"text-text"),children:e.title})]}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-text-muted line-clamp-2",children:e.message}),(0,t.jsx)("span",{className:"mt-1 block text-[10px] text-text-muted/60",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return"just now";let a=Math.floor(t/60);if(a<60)return`${a}m ago`;let r=Math.floor(a/60);if(r<24)return`${r}h ago`;let s=Math.floor(r/24);return`${s}d ago`}(e.createdAt)})]}),!e.isRead&&(0,t.jsx)("button",{className:"mt-0.5 shrink-0 rounded p-1 text-text-muted opacity-0 transition-all hover:bg-surface-hover hover:text-primary group-hover:opacity-100",title:"Mark as read",type:"button",onClick:()=>void b(e.id),children:(0,t.jsx)(c.f,{className:"h-3.5 w-3.5"})})]},e.id))]}),(0,t.jsx)("div",{className:"border-t border-border px-4 py-2 flex justify-end",children:(0,t.jsxs)(s.default,{href:"/notifications",className:"flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",onClick:()=>r(!1),children:[(0,t.jsx)(l.f,{className:"h-3 w-3"}),"Preferences"]})})]})]})}var e_=e.i(1092);let eA=[{keys:["g","m"],label:"Go to Mission Control",description:"Navigate to unified Mission Control home",action:"navigate",target:"/mission-control",category:"navigation"},{keys:["g","o"],label:"Go to Overview",description:"Navigate to fleet overview",action:"navigate",target:"/",category:"navigation"},{keys:["g","n"],label:"Go to Nodes",description:"Navigate to node list",action:"navigate",target:"/nodes",category:"navigation"},{keys:["g","c"],label:"Go to Commands",description:"Navigate to command console",action:"navigate",target:"/commands",category:"navigation"},{keys:["g","j"],label:"Go to Cron Jobs",description:"Navigate to cron jobs",action:"navigate",target:"/cron",category:"navigation"},{keys:["g","f"],label:"Go to Files",description:"Navigate to file editor",action:"navigate",target:"/files",category:"navigation"},{keys:["g","s"],label:"Go to Skills",description:"Navigate to skill marketplace",action:"navigate",target:"/skills",category:"navigation"},{keys:["g","l"],label:"Go to Logs",description:"Navigate to log explorer",action:"navigate",target:"/logs",category:"navigation"},{keys:["g","a"],label:"Go to Audit",description:"Navigate to audit trail",action:"navigate",target:"/audit",category:"navigation"},{keys:["?"],label:"Show Shortcuts",description:"Show keyboard shortcut reference",action:"command",target:"show-shortcuts",category:"general"}];function eL(){return"u">typeof navigator&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘":"Ctrl"}function eR(){document.body.dispatchEvent(new KeyboardEvent("keydown",{key:"k",ctrlKey:!0,metaKey:!0,bubbles:!0}))}function ez({onMenuToggle:e}){let n=(0,r.usePathname)(),i=(0,r.useRouter)(),{title:l,crumbs:o}=function(e){let t=null;for(let a of Object.keys(es))en(e,a)&&(null===t||a.length>t.length)&&(t=a);let a=t?es[t]:"Magnus",r=ei(e),s=r?er.find(e=>e.items.some(e=>e.href===r))?.label??null:null,n=[];if(s&&n.push({label:s}),n.push({label:a,href:t??void 0}),t&&e!==t)for(let a of e.slice("/"===t?1:t.length+1).split("/").filter(Boolean)){let e=decodeURIComponent(a);n.push({label:e.length>18?`${e.slice(0,8)}…${e.slice(-6)}`:e})}return{title:a,group:s,crumbs:n}}(n),[c,d]=(0,a.useState)(null),[m,u]=(0,a.useState)(!1),[x,h]=(0,a.useState)("Ctrl"),p=(0,a.useRef)(null);async function f(e=!1){let t=await fetch(`/api/auth/logout${e?"?all=true":""}`,{method:"POST"}).catch(()=>null);t?.ok?(i.push("/login"),i.refresh()):window.alert("Session revocation unavailable; retry sign out.")}return(0,a.useEffect)(()=>{h(eL()),fetch("/api/auth/me").then(e=>e.ok?e.json():null).then(e=>{e?.username&&d(e.username)}).catch(()=>{})},[]),(0,a.useEffect)(()=>{if(!m)return;let e=e=>{(e instanceof KeyboardEvent?"Escape"!==e.key:p.current?.contains(e.target))||u(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",e)}},[m]),(0,t.jsxs)("header",{className:"relative z-(--z-shell) flex h-14 items-center justify-between gap-3 bg-bg/80 px-3 backdrop-blur-sm sm:px-6",children:[(0,t.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-primary/60 via-accent/40 to-transparent"}),(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 text-xs uppercase tracking-[0.15em] text-text-muted",children:[e&&(0,t.jsx)("button",{className:"mr-1 rounded p-1.5 text-text-muted hover:text-primary md:hidden",onClick:e,type:"button",title:"Toggle menu",children:(0,t.jsx)(ef,{className:"h-5 w-5"})}),(0,t.jsx)("span",{className:"text-primary/60",children:">_"}),(0,t.jsx)("nav",{"aria-label":"Breadcrumb",className:"hidden min-w-0 items-center gap-1 sm:flex",children:o.map((e,a)=>{let r=a===o.length-1;return(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[a>0&&(0,t.jsx)(eg.f,{className:"h-3 w-3 shrink-0 text-primary/30","aria-hidden":"true"}),e.href&&!r?(0,t.jsx)(s.default,{href:e.href,prefetch:!1,className:"truncate transition-colors hover:text-primary",children:e.label}):(0,t.jsx)("span",{className:r?"truncate text-text":0===a&&o.length>1?"truncate text-text-muted/60":"truncate","aria-current":r?"page":void 0,children:e.label})]},`${e.label}-${a}`)})}),(0,t.jsx)("span",{className:"sr-only sm:hidden",children:l}),(0,t.jsx)("span",{className:"ml-1 hidden h-3.5 w-1.5 shrink-0 bg-primary/80 sm:inline-block",style:{animation:"cursor-blink 1s step-end infinite"}})]}),(0,t.jsx)(e_.J,{className:"hidden max-w-xl flex-1 lg:block"}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1 sm:gap-2",children:[(0,t.jsxs)("button",{type:"button",onClick:eR,className:"hidden items-center gap-2 rounded-chip border border-border bg-surface px-2.5 py-1.5 text-[10px] uppercase tracking-wider text-text-muted transition-colors hover:border-primary/40 hover:text-primary md:flex",title:"Search and jump (command palette)",children:[(0,t.jsx)(eb.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:"Search"}),(0,t.jsxs)("kbd",{className:"rounded-chip border border-border bg-bg px-1 text-[9px] text-primary/70",children:[x,"+K"]})]}),(0,t.jsx)("button",{className:"rounded p-2 text-text-muted transition-all hover:text-primary hover:drop-shadow-[0_0_6px_var(--color-glow)]",title:"Refresh",onClick:()=>window.location.reload(),type:"button",children:(0,t.jsx)(eh.f,{className:"h-4 w-4"})}),(0,t.jsx)(e$,{}),(0,t.jsx)("button",{className:"rounded p-2 text-text-muted transition-all hover:text-danger hover:drop-shadow-[0_0_6px_rgba(255,23,68,0.3)]",title:"Sign Out",onClick:()=>void f(),type:"button",children:(0,t.jsx)(ex.f,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{ref:p,className:"relative ml-1",children:[(0,t.jsx)("button",{type:"button",onClick:()=>u(e=>!e),"aria-haspopup":"menu","aria-expanded":m,title:c?`Signed in as ${c}`:"Account",className:"flex h-8 w-8 items-center justify-center rounded border border-accent/40 text-[10px] font-bold uppercase text-accent shadow-[0_0_8px_var(--color-glow-accent)] transition-colors hover:border-accent hover:bg-accent/10",children:c?.[0]??"U"}),m&&(0,t.jsxs)("div",{role:"menu",className:"panel-corners absolute right-0 top-full z-(--z-modal) mt-2 w-60 rounded-panel border border-accent/30 bg-surface/95 p-1 shadow-[0_0_24px_var(--color-glow-accent)] backdrop-blur-sm [--panel-corner-color:var(--color-accent)]",children:[c&&(0,t.jsxs)("div",{className:"border-b border-border px-3 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:["Signed in as ",(0,t.jsx)("span",{className:"text-accent",children:c})]}),(0,t.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>void f(),className:"flex w-full items-center gap-2 rounded-chip px-3 py-2 text-left text-xs text-text-muted transition-colors hover:bg-surface-hover hover:text-text",children:[(0,t.jsx)(ex.f,{className:"h-3.5 w-3.5"})," Sign out"]}),(0,t.jsxs)("button",{type:"button",role:"menuitem","aria-label":"Sign out all local sessions",onClick:()=>void f(!0),className:"flex w-full items-center gap-2 rounded-chip px-3 py-2 text-left text-xs text-text-muted transition-colors hover:bg-danger/10 hover:text-danger",children:[(0,t.jsx)(ex.f,{className:"h-3.5 w-3.5"})," Sign out all local sessions"]})]})]})]})]})}async function eP(e,t){try{let a=await fetch(e,{signal:t,headers:{accept:"application/json"}});if(!a.ok)return null;return await a.json()}catch{return null}}function eI(e,t){return e.trim()?t.map(t=>({e:t,s:function(e,t){if(!e)return 0;let a=e.toLowerCase(),r=t.toLowerCase(),s=r.indexOf(a);if(-1!==s)return s;let n=0,i=0;for(let e of a){let t=r.indexOf(e,n);if(-1===t)return -1;i+=t-n,n=t+1}return 1e3+i}(e,`${t.label} ${t.sublabel??""}`)})).filter(({s:e})=>e>=0).sort((e,t)=>e.s-t.s).map(({e})=>e):t}async function eT(e,t={}){let{signal:a,limit:r=10}=t;if(e.trim().length<2)return[];let[s,n,i]=await Promise.all([eP("/api/proxy/nodes",a),eP("/api/proxy/orchestra/installations",a),eP("/api/proxy/orchestra/skill-catalog",a)]),l=[];for(let e of s?.data??[])l.push({kind:"node",id:e.id,label:e.name,sublabel:e.status?`Node \xb7 ${e.status}`:"Node",href:`/nodes/${e.id}`});for(let e of n?.data??[])l.push({kind:"installation",id:e.id,label:e.displayName??e.hostname,sublabel:`Hermes \xb7 ${e.status??"unknown"}`,href:"/orchestra/installations"});for(let e of i?.data??[])l.push({kind:"skill",id:e.id,label:e.name,sublabel:e.description??"Skill",href:"/skills"});return eI(e,[{kind:"action",id:"deploy-agent",label:"Deploy agent to host",sublabel:"Action · Operations",href:"/governor/operations"},{kind:"action",id:"open-terminal",label:"Open node terminal",sublabel:"Action · Nodes",href:"/nodes"},{kind:"action",id:"run-fleet-check",label:"Run fleet check",sublabel:"Action · Fleet readiness",href:"/fleet-readiness"},{kind:"action",id:"view-stale-nodes",label:"View stale nodes",sublabel:"Action · Readiness",href:"/fleet-readiness"},{kind:"action",id:"rotate-node-secret",label:"Rotate node secret",sublabel:"Action · Operations",href:"/governor/operations"},{kind:"action",id:"latest-failed-deploy",label:"Open latest failed deploy",sublabel:"Action · Timeline",href:"/fleet-timeline"},...l]).slice(0,r)}var eO=e.i(68877),eD=e.i(20851),eU=e.i(70533);let eF={name:"keyboard",size:24,node:[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]};eF.node;let eq=(0,b.f)(eF);var eG=e.i(63676);let eH={name:"key",size:24,node:[["path",{d:"m2 21 9.6-9.6",key:"9l79m3"}],["path",{d:"m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19",key:"fw8biw"}],["circle",{cx:"15.5",cy:"7.5",r:"5.5",key:"4wxmhb"}]]};eH.node;let eK=(0,b.f)(eH);var eV=e.i(32781),eW=e.i(28623),eJ=e.i(72603);let eB={"/":v,"/mission-control":T,"/nodes":y.f,"/commands":w.f,"/cron":k.f,"/files":j.f,"/skills":eD.f,"/logs":C,"/audit":M.f,"/library":eU.f},eX={node:y.f,installation:S.f,skill:eD.f,action:eO.f};function eQ(){let[e,s]=(0,a.useState)(!1),[n,i]=(0,a.useState)(""),[l,o]=(0,a.useState)(0),[c,d]=(0,a.useState)(!1),[m,u]=(0,a.useState)([]),[x,h]=(0,a.useState)(!1),[p,f]=(0,a.useState)("normal"),b=(0,a.useRef)(null),g=(0,r.useRouter)(),v=(0,a.useRef)([]),y=(0,a.useRef)(void 0),w=(0,a.useRef)(void 0),k=(0,a.useRef)(null),j=(n.trim()?eA.filter(e=>e.label.toLowerCase().includes(n.toLowerCase())||e.description.toLowerCase().includes(n.toLowerCase())):eA).map(e=>({kind:"shortcut",key:`s:${e.keys.join("-")}`,shortcut:e})),N=eI(n,m).map(e=>({kind:"entity",key:`e:${e.kind}:${e.id}`,entity:e})),C=n.trim()?[...N,...j]:j;(0,a.useEffect)(()=>{if(!e)return;let t=n.trim();if(t.length<2){u([]),h(!1);return}w.current&&clearTimeout(w.current),k.current&&k.current.abort();let a=new AbortController;return k.current=a,h(!0),w.current=setTimeout(async()=>{let e=await eT(t,{signal:a.signal,limit:12});a.signal.aborted||(u(e),h(!1))},180),()=>{a.abort(),w.current&&clearTimeout(w.current)}},[n,e]);let M=(0,a.useCallback)(e=>{"navigate"===e.action&&e.target?(g.push(e.target),s(!1),i("")):"show-shortcuts"===e.target&&(d(!0),s(!1),i(""))},[g]),S=(0,a.useCallback)(e=>{"shortcut"===e.kind?M(e.shortcut):(g.push(e.entity.href),s(!1),i(""))},[M,g]);return((0,a.useEffect)(()=>{let t=t=>{let a=t.target,r="INPUT"===a.tagName||"TEXTAREA"===a.tagName||a.isContentEditable;if((t.metaKey||t.ctrlKey)&&"k"===t.key.toLowerCase()){t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),s(e=>!e);return}if("Escape"===t.key){if(e){s(!1),i("");return}return c?void d(!1):void 0}if(!r){if("?"===t.key){t.preventDefault(),d(e=>!e);return}if(1===t.key.length&&!t.metaKey&&!t.ctrlKey&&!t.altKey){for(let e of(clearTimeout(y.current),v.current.push(t.key.toLowerCase()),eA))if(e.keys.length===v.current.length&&e.keys.every((e,t)=>e===v.current[t])){t.preventDefault(),v.current=[],M(e);return}y.current=setTimeout(()=>{v.current=[]},800)}}};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e,c,M]),(0,a.useEffect)(()=>{e&&(o(0),setTimeout(()=>b.current?.focus(),50))},[e]),(0,a.useEffect)(()=>{l>=C.length&&o(Math.max(0,C.length-1))},[C.length,l]),(0,a.useEffect)(()=>{e&&f("low"===document.documentElement.dataset.fx?"low":"normal")},[e]),e||c)?(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsxs)("div",{className:"fixed inset-0 z-(--z-modal) flex items-start justify-center pt-[15vh]","data-testid":"command-palette",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-[2px]",onClick:()=>{s(!1),i("")}}),(0,t.jsxs)("div",{className:"relative z-10 w-full max-w-lg panel-corners rounded-panel border border-primary/30 bg-surface/95 shadow-[0_0_40px_var(--color-glow)]",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 border-b border-border px-4 py-3",children:[(0,t.jsx)(eb.f,{className:"h-5 w-5 text-primary"}),(0,t.jsx)("input",{ref:b,type:"text",placeholder:"Search nodes, agents, runs, users, commands...",className:"flex-1 bg-transparent text-sm text-text placeholder:text-text-muted/70 caret-primary outline-none",value:n,onChange:e=>{i(e.target.value),o(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),o(e=>Math.min(e+1,C.length-1))):"ArrowUp"===e.key?(e.preventDefault(),o(e=>Math.max(e-1,0))):"Enter"===e.key&&C[l]&&(e.preventDefault(),S(C[l]))},"data-testid":"command-palette-input"}),x?(0,t.jsx)(eV.f,{className:"h-4 w-4 animate-spin text-primary"}):(0,t.jsx)("kbd",{className:"rounded-chip border border-border bg-bg px-1.5 py-0.5 text-[10px] text-text-muted",children:"ESC"})]}),(0,t.jsxs)("div",{className:"max-h-96 overflow-y-auto py-2",children:[0===C.length&&!x&&(0,t.jsx)("p",{className:"px-4 py-6 text-center text-xs uppercase tracking-wider text-text-muted",children:"No results found"}),0===C.length&&x&&(0,t.jsx)("p",{className:"px-4 py-6 text-center text-xs uppercase tracking-wider text-text-muted",children:"Searching…"}),C.map((e,a)=>{let r=a===l;if("shortcut"===e.kind){let s=eB[e.shortcut.target??""]??eO.f;return(0,t.jsxs)("button",{className:`flex w-full items-center gap-3 px-4 py-2 text-left text-sm transition-colors ${r?"bg-primary/10 text-primary shadow-[inset_2px_0_0_var(--color-primary)]":"text-text hover:bg-surface-hover"}`,onClick:()=>S(e),onMouseEnter:()=>o(a),"data-testid":"command-palette-item","data-item-kind":"shortcut",children:[(0,t.jsx)(s,{className:"h-4 w-4 shrink-0 opacity-70"}),(0,t.jsx)("span",{className:"flex-1",children:e.shortcut.label}),(0,t.jsx)("span",{className:"text-xs text-text-muted",children:e.shortcut.keys.map(e=>e.toUpperCase()).join(" then ")})]},e.key)}let s=eX[e.entity.kind]??eO.f;return(0,t.jsxs)("button",{className:`flex w-full items-center gap-3 px-4 py-2 text-left text-sm transition-colors ${r?"bg-accent/10 text-accent shadow-[inset_2px_0_0_var(--color-accent)]":"text-text hover:bg-surface-hover"}`,onClick:()=>S(e),onMouseEnter:()=>o(a),"data-testid":"command-palette-item","data-item-kind":"entity","data-entity-kind":e.entity.kind,children:[(0,t.jsx)(s,{className:"h-4 w-4 shrink-0 text-accent/80"}),(0,t.jsxs)("span",{className:"flex-1 truncate",children:[(0,t.jsx)("span",{className:"font-medium",children:e.entity.label}),e.entity.sublabel&&(0,t.jsx)("span",{className:"ml-2 text-xs text-text-muted",children:e.entity.sublabel})]}),(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:e.entity.kind})]},e.key)})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 border-t border-border px-4 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:[(0,t.jsx)("span",{children:"↑↓ navigate"}),(0,t.jsx)("span",{children:"↵ select"}),(0,t.jsx)("span",{children:"esc close"}),(0,t.jsxs)("button",{type:"button",onClick:()=>f((0,eJ.W)()),className:"ml-auto flex items-center gap-1 rounded-chip px-1 text-text-muted transition-colors hover:text-primary",title:"Toggle visual effects (scanlines, glow pulses, animated map)","data-testid":"command-palette-fx-toggle",children:[(0,t.jsx)(eW.f,{className:"h-3 w-3"})," fx: ",p]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(eK,{className:"h-3 w-3"})," ",eL(),"+K"]})]})]})]}),c&&(0,t.jsxs)("div",{className:"fixed inset-0 z-(--z-modal) flex items-center justify-center",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-[2px]",onClick:()=>d(!1)}),(0,t.jsxs)("div",{className:"relative z-10 w-full max-w-md panel-corners rounded-panel border border-primary/30 bg-surface/95 p-6 shadow-[0_0_40px_var(--color-glow)]",children:[(0,t.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(eq,{className:"h-5 w-5 text-primary"}),(0,t.jsx)("h2",{className:"text-sm font-bold uppercase tracking-wider text-primary glow-text-primary",children:"Keyboard Shortcuts"})]}),(0,t.jsx)("button",{onClick:()=>d(!1),className:"text-text-muted hover:text-text",children:(0,t.jsx)(eG.X,{className:"h-5 w-5"})})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 text-[10px] font-medium uppercase tracking-[0.2em] text-text-muted",children:"General"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(eY,{keys:[`${eL()}+K`],label:"Open command palette"}),(0,t.jsx)(eY,{keys:["?"],label:"Show this reference"}),(0,t.jsx)(eY,{keys:["Esc"],label:"Close modal / palette"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 text-[10px] font-medium uppercase tracking-[0.2em] text-text-muted",children:"Fleet Navigation"}),(0,t.jsx)("div",{className:"space-y-1",children:eA.filter(e=>"navigation"===e.category).map(e=>(0,t.jsx)(eY,{keys:e.keys.map(e=>e.toUpperCase()),label:e.label},e.target))})]})]})]})]})]}):null}function eY({keys:e,label:a}){return(0,t.jsxs)("div",{className:"flex items-center justify-between py-1",children:[(0,t.jsx)("span",{className:"text-xs text-text",children:a}),(0,t.jsx)("div",{className:"flex gap-1",children:e.map((a,r)=>(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"rounded-chip border border-border bg-bg px-1.5 py-0.5 text-[11px] text-primary",children:a}),r<e.length-1&&(0,t.jsx)("span",{className:"mx-0.5 text-[10px] text-text-muted/60",children:"then"})]},r))})]})}let eZ={name:"server-cog",size:24,node:[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1v3clb"}],["path",{d:"m13.148 9.228.383-.923",key:"t2zzyc"}],["path",{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1bxfiv"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}]]};eZ.node;let e0=(0,b.f)(eZ);var e1=e.i(63646);let e2="magnus.update-banner.dismissed";function e5(){let[e,r]=(0,a.useState)(null),[n,i]=(0,a.useState)(null);if((0,a.useEffect)(()=>{i(function(){try{return window.localStorage.getItem(e2)}catch{return null}}());let e=!1,t=()=>{eE.f.systemUpdates.get().then(t=>{e||r(t)}).catch(()=>void 0)};t();let a=window.setInterval(t,18e5);return()=>{e=!0,window.clearInterval(a)}},[]),!e)return null;let{server:l,agents:o}=e,c=o.behind.length,d=(0,e1.t)(o);if(!l.updateAvailable&&!l.latestMajor&&0===c)return null;let m=`${e.server.latest??""}|${e.server.latestMajor??""}|${e.agents.behind.length}|${e.agents.expected}`;return n===m?null:(0,t.jsxs)("section",{role:"status","aria-label":"Updates","data-testid":"update-banner",className:"relative mb-4 overflow-hidden rounded border border-warning/40 bg-warning/5 px-4 py-3 text-[11px]",children:[(0,t.jsx)("div",{className:"absolute inset-y-0 left-0 w-0.5 bg-warning"}),(0,t.jsx)("button",{type:"button","aria-label":"Dismiss",className:"absolute right-2 top-2 text-text-muted hover:text-text",onClick:()=>{try{window.localStorage.setItem(e2,m)}catch{}i(m)},children:(0,t.jsx)(eG.X,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)("div",{className:"space-y-2 pr-6",children:[l.updateAvailable&&l.latest&&(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(eS.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning"}),(0,t.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,t.jsxs)("p",{children:[(0,t.jsxs)("span",{className:"font-bold uppercase tracking-wider text-warning",children:["Magnus ",l.latest," is available"]}),(0,t.jsxs)("span",{className:"ml-2 text-text-muted",children:["running ",l.current,l.breaking?" · contains breaking changes":""]})]}),l.releases.filter(e=>e.summary).map(e=>(0,t.jsxs)("p",{className:"text-text-muted",children:[e.version,": ",e.summary," ",e.notesUrl&&(0,t.jsx)("a",{className:"text-primary underline",href:e.notesUrl,target:"_blank",rel:"noreferrer",children:"release notes"})]},e.version)),l.newRequiredEnv.length>0&&(0,t.jsxs)("p",{className:"text-text-muted",children:["New required settings:"," ",l.newRequiredEnv.map(e=>(0,t.jsxs)("code",{className:"mr-1 rounded bg-surface px-1",children:[e.name,"server"!==e.component?` (${e.component})`:""]},e.name)),l.newRequiredEnv.every(e=>e.secret)&&(0,t.jsxs)("span",{children:["(secrets: ",(0,t.jsx)("code",{children:"magnus upgrade --generate-secrets"})," fills them in)"]})]}),l.attention.length>0&&(0,t.jsxs)("p",{className:"text-warning",children:["Needs a maintenance window: ",l.attention.map(e=>`${e.name} (${e.impact}${e.note?`: ${e.note}`:""})`).join("; ")]}),(0,t.jsxs)("p",{className:"text-text-muted",children:["On the server host run ",(0,t.jsx)("code",{className:"rounded bg-surface px-1 text-text",children:l.command})," (backs up the database and reverts on failure)."]})]})]}),l.latestMajor&&(0,t.jsxs)("p",{className:"text-text-muted",children:["Magnus ",l.latestMajor," is a new major version. Major upgrades are never offered automatically; read UPGRADING.md first."]}),c>0&&(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(e0,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning"}),(0,t.jsxs)("p",{children:[(0,t.jsxs)("span",{className:"font-bold uppercase tracking-wider text-warning",children:[c," agent",1===c?"":"s"," behind the server (",o.expected,")"]}),(0,t.jsxs)("span",{className:"ml-2 text-text-muted",children:[o.behind.slice(0,5).map(e=>`${e.name} ${e.version}`).join(", "),c>5?", …":"","."]})," ",o.upgradesEnabled?(0,t.jsx)(s.default,{href:"/nodes?upgrade=agents",className:"text-primary underline",children:d>0?"Review agent upgrades":"Upgrade agents"}):(0,t.jsx)("span",{className:"text-text-muted",children:"Agent upgrades are off on this server (MAGNUS_AGENT_UPGRADES=false)."}),d>0&&(0,t.jsxs)("span",{className:"ml-2 text-text-muted",children:[d," agent",1===d?" requires":"s require"," a manual major-version upgrade; the dialog only upgrades within the same major."]}),o.fixCommand&&0===d&&(0,t.jsxs)("span",{className:"ml-2 text-text-muted",children:["or run ",(0,t.jsx)("code",{className:"rounded bg-surface px-1 text-text",children:o.fixCommand})]})]})]})]})]})}var e3=e.i(52928);e.s(["DashboardShell",0,function({children:e,integrations:s}){let n=(0,r.usePathname)(),i="/login"===n||n.startsWith("/governor/share/"),[l,o]=(0,a.useState)(!1);!function({enabled:e=!0}={}){let[t,r]=(0,a.useState)(!1),{addToast:s}=(0,e3.d)(),n=(0,a.useRef)(s);n.current=s;let i=(0,a.useRef)(null),l=(0,a.useRef)(null),o=(0,a.useCallback)(()=>{if(!e)return;let t=new EventSource("/api/proxy/events/stream");for(let e of(i.current=t,t.onopen=()=>{r(!0),el.f.setConnected(!0)},["deploy:status","node:status","command:status","alert:fired"]))t.addEventListener(e,t=>{try{let a=JSON.parse(t.data),r=function(e){let t=e.type??"",a=e.nodeName??"Unknown";switch(t){case"deploy.started":return{title:`Deploying to ${a}`,severity:"info"};case"deploy.completed":return{title:`Deploy complete: ${a}`,severity:"success"};case"deploy.failed":return{title:`Deploy failed: ${a}`,message:e.message??void 0,severity:"error"};case"upgrade.started":return{title:`Upgrading ${a}`,severity:"info"};case"upgrade.completed":return{title:`Upgrade complete: ${a}`,message:`v${e.version}`,severity:"success"};case"upgrade.failed":return{title:`Upgrade failed: ${a}`,message:e.message??void 0,severity:"error"};case"node.recovered":return{title:`${a} back online`,message:`Recovered from ${e.previousStatus}`,severity:"success"};case"command.completed":return{title:"Command completed",message:`${e.command}`,severity:"success"};case"command.failed":return{title:"Command failed",message:`${e.command} (exit ${e.exitCode})`,severity:"error"};case"health.alert":return{title:`Alert: ${e.metric?.replaceAll("_"," ").toUpperCase()} on ${a}`,message:`${e.value?.toFixed(1)}% (threshold: ${e.threshold}%)`,severity:e.severity??"warning"};default:return null}}(a);r&&n.current(r),el.f.push(r?{...r,channel:e}:{title:String(a.type??e).replaceAll("."," "),message:"string"==typeof a.nodeName?a.nodeName:void 0,severity:"info",channel:e})}catch{}});return t.onerror=()=>{r(!1),el.f.setConnected(!1),t.close(),fetch("/api/auth/me",{cache:"no-store"}).then(e=>{if(i.current===t){if(401===e.status)return void window.location.replace("/login");l.current=setTimeout(o,5e3)}}).catch(()=>{i.current===t&&(l.current=setTimeout(o,5e3))})},t},[e]);(0,a.useEffect)(()=>{let e=o();return()=>{l.current&&clearTimeout(l.current),e?.close(),i.current?.close(),el.f.setConnected(!1),i.current=null}},[o])}({enabled:!i}),(0,a.useEffect)(()=>{o(!1)},[n]);let c=(0,a.useCallback)(()=>o(e=>!e),[]);return i?(0,t.jsx)(t.Fragment,{children:e}):(0,t.jsxs)("div",{className:"flex h-screen overflow-hidden",children:[l&&(0,t.jsx)("div",{className:"fixed inset-0 z-40 bg-black/70 backdrop-blur-[2px] md:hidden",onClick:()=>o(!1)}),(0,t.jsx)("div",{className:`
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,68288,e=>{"use strict";var t=e.i(43476),a=e.i(71645),r=e.i(4050),s=e.i(82983);let n=0,i=Date.now(),l=[],o=null,c=!1;function d(e,t){let a;(a=Date.now())-i>=6e4&&(n=0,i=a),n>=20||(n++,l.push({nodeId:"__dashboard__",source:"dashboard",level:"error",message:e,metadata:t,timestamp:new Date().toISOString()}))}async function m(){if(0===l.length)return;let e=l.splice(0,l.length);try{await s.f.logs.ingest(e)}catch{}}var u=e.i(52928),x=e.i(53034),h=e.i(37806),p=e.i(47414);function f({children:e,...r}){let s=(0,a.useContext)(h.f);(r={...s,...r}).transition=(0,x.f)(r.transition,s.transition),r.isStatic=(0,p.f)(()=>r.isStatic);let n=(0,a.useMemo)(()=>r,[JSON.stringify(r.transition),r.transformPagePoint,r.reducedMotion,r.skipAnimations,r.isValidProp]);return(0,t.jsx)(h.f.Provider,{value:n,children:e})}var b=e.i(72603);e.s(["Providers",0,function({children:e}){return(0,a.useEffect)(()=>((0,b.P)(),function(){if(c)return()=>{};c=!0;let e=e=>{d(`Uncaught error: ${e.message}`,{url:window.location.pathname,filename:e.filename??"unknown",lineno:e.lineno??0,colno:e.colno??0})},t=e=>{let t=e.reason,a=t instanceof Error?t.message:String(t);d(`Unhandled rejection: ${a}`,{url:window.location.pathname})};return window.addEventListener("error",e),window.addEventListener("unhandledrejection",t),o=setInterval(()=>void m(),1e4),()=>{window.removeEventListener("error",e),window.removeEventListener("unhandledrejection",t),o&&(clearInterval(o),o=null),m(),c=!1}}()),[]),(0,t.jsx)(f,{reducedMotion:"user",children:(0,t.jsx)(u.N,{children:(0,t.jsx)(r.v,{children:e})})})}],68288)},40073,e=>{"use strict";var t=e.i(43476),a=e.i(71645),r=e.i(18566),s=e.i(22016),n=e.i(78571),i=e.i(16327),l=e.i(66794),o=e.i(77071),c=e.i(89664),d=e.i(4050),m=e.i(35673),u=e.i(15e3),x=e.i(39430);function h({status:e}){let a="online"===e?"Online":"offline"===e?"Offline":"Checking…";return(0,t.jsx)("span",{role:"status","aria-label":a,className:`inline-block h-2 w-2 shrink-0 rounded-full ${"online"===e?"bg-success":"offline"===e?"bg-danger":"bg-text-muted/40 animate-pulse"}`,title:a})}function p(){let{nodes:e,activeNode:r,switchNode:s,loading:n}=(0,d.l)(),[p,f]=(0,a.useState)(!1),[b,g]=(0,a.useState)(!1),[v,y]=(0,a.useState)(!1),w=(0,a.useRef)(null),[k,j]=(0,a.useState)({}),N=(0,a.useRef)(null),C=(0,a.useMemo)(()=>e.length>0?e:[u.f],[e]),M=(0,a.useCallback)(async()=>{let e={};await Promise.allSettled(C.map(async t=>{try{let a=(0,x.L)(t.url),r=await fetch("/api/proxy/health",{method:"GET",headers:a,signal:AbortSignal.timeout(6e3)});e[t.id]=r.ok?"online":"offline"}catch{e[t.id]="offline"}})),j(e)},[C]);return((0,a.useEffect)(()=>{M()},[M]),(0,a.useEffect)(()=>{if(p)return M(),N.current=setInterval(()=>void M(),3e4),()=>{N.current&&clearInterval(N.current)}},[p,M]),(0,a.useEffect)(()=>{if(p)return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)};function e(e){w.current&&!w.current.contains(e.target)&&f(!1)}function t(e){"Escape"===e.key&&f(!1)}},[p]),n)?(0,t.jsx)("div",{className:"mx-3 mt-2 mb-1 rounded border border-border bg-bg px-3 py-2 text-xs text-text-muted animate-pulse",children:"Loading…"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"relative mx-3 mt-2 mb-1",ref:w,children:[(0,t.jsx)("div",{className:"mb-1 px-0.5 text-[10px] font-semibold uppercase tracking-wider text-text-muted",children:"Node Controller"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)("button",{onClick:()=>f(!p),"aria-expanded":p,"aria-haspopup":"listbox","aria-label":`Node controller: ${r.name}`,className:"flex flex-1 items-center gap-2 rounded border border-border bg-bg px-2.5 py-1.5 text-left transition-all hover:bg-surface-hover min-w-0",children:[(0,t.jsx)(h,{status:k[r.id]??"unknown"}),(0,t.jsx)("span",{className:"flex-1 truncate text-xs font-medium",children:r.name}),(0,t.jsx)(i.f,{className:`h-3.5 w-3.5 shrink-0 text-text-muted transition-transform ${p?"rotate-180":""}`})]}),(0,t.jsx)("button",{onClick:function(){y(!1),g(!0)},className:"rounded border border-border bg-bg p-1.5 text-text-muted transition-all hover:bg-surface-hover hover:text-text",title:"Control Node Settings",children:(0,t.jsx)(l.f,{className:"h-3.5 w-3.5"})})]}),p&&(0,t.jsxs)("div",{className:"absolute left-3 right-3 z-50 mt-1 rounded border border-border bg-surface shadow-xl",children:[(0,t.jsx)("div",{role:"listbox","aria-label":"Control nodes",className:"max-h-48 overflow-y-auto py-1",children:C.map(e=>(0,t.jsxs)("button",{role:"option","aria-selected":e.id===r.id,onClick:()=>{s(e.id),f(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-all hover:bg-surface-hover",children:[(0,t.jsx)(h,{status:k[e.id]??"unknown"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"font-medium truncate",children:e.name}),(0,t.jsx)("div",{className:"text-text-muted truncate text-[10px]",children:e.url})]}),e.id===r.id&&(0,t.jsx)(c.f,{className:"h-3.5 w-3.5 shrink-0 text-primary"})]},e.id))}),(0,t.jsx)("div",{className:"border-t border-border",children:(0,t.jsxs)("button",{onClick:function(){f(!1),y(!0),g(!0)},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-primary transition-all hover:bg-surface-hover",children:[(0,t.jsx)(o.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"font-bold",children:"Add Control Node"})]})})]})]}),(0,t.jsx)(m.f,{open:b,onClose:()=>g(!1),createMode:v})]})}var f=e.i(32181),b=e.i(56420);let g={name:"layout-dashboard",size:24,node:[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]};g.node;let v=(0,b.f)(g);var y=e.i(41220),w=e.i(4139),k=e.i(74544),j=e.i(26091);let N={name:"scroll-text",size:24,node:[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]};N.node;let C=(0,b.f)(N);var M=e.i(82954),S=e.i(71567),E=e.i(82303),$=e.i(63644),_=e.i(12092),A=e.i(99835),L=e.i(64569);let R={name:"map",size:24,node:[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]};R.node;let z=(0,b.f)(R);var P=e.i(56423);let I={name:"compass",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]]};I.node;let T=(0,b.f)(I);var O=e.i(90985);let D={name:"heart-pulse",size:24,node:[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}],["path",{d:"M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"auskq0"}]]};D.node;let U=(0,b.f)(D),F={name:"rotate-ccw-clock",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],aliases:["history"]};F.node;let q=(0,b.f)(F);var G=e.i(9584);let H={name:"git-compare-arrows",size:24,node:[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]};H.node;let K=(0,b.f)(H),V={name:"package-check",size:24,node:[["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m16 17 2 2 4-4",key:"uh5qu3"}],["path",{d:"M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753",key:"kpkbpo"}],["path",{d:"M3.29 7 12 12l8.71-5",key:"19ckod"}],["path",{d:"m7.5 4.27 8.997 5.148",key:"9yrvtv"}]]};V.node;let W=(0,b.f)(V),J={name:"square-activity",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M17 12h-2l-2 5-2-10-2 5H7",key:"15hlnc"}]],aliases:["activity-square"]};J.node;let B=(0,b.f)(J);var X=e.i(84026);let Q={name:"scan-search",size:24,node:[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]};Q.node;let Y=(0,b.f)(Q);var Z=e.i(52330),ee=e.i(58925),et=e.i(83892),ea=e.i(71028);let er=[{id:"fleet",label:"Fleet",tone:"primary",items:[{href:"/mission-control",label:"Mission Control",icon:T},{href:"/",label:"Overview",icon:v,exact:!0},{href:"/nodes",label:"Nodes",icon:y.f},{href:"/application-operations",label:"Applications",icon:U},{href:"/fleet-readiness",label:"Readiness",icon:ea.f},{href:"/fleet-timeline",label:"Timeline",icon:q},{href:"/fleet-map",label:"Fleet Map",icon:z},{href:"/commands",label:"Commands",icon:w.f},{href:"/anomalies",label:"Anomalies",icon:$.f},{href:"/anomalies/remediation",label:"Remediation",icon:L.f},{href:"/governor/operations",label:"Operations",icon:_.f},{href:"/rollouts",label:"Rollouts",icon:W},{href:"/incidents",label:"Incidents",icon:B},{href:"/cron",label:"Cron Jobs",icon:k.f},{href:"/files",label:"Files",icon:j.f},{href:"/logs",label:"Logs",icon:C},{href:"/audit",label:"Audit",icon:M.f},{href:"/webhooks",label:"Webhooks",icon:A.f},{href:"/retention",label:"Retention",icon:G.f},{href:"/api-docs",label:"API Docs",icon:P.f}]},{id:"security",label:"Security",tone:"primary",integration:"securityConsole",items:[{href:"/security-fusion",label:"Fleet summary",icon:Y,exact:!0}]},{id:"hermes",label:"Hermes Agent",tone:"accent",integration:"hermes",items:[{href:"/orchestra",label:"Overview",icon:S.f,exact:!0},{href:"/orchestra/installations",label:"Installations",icon:y.f},{href:"/orchestra/profiles",label:"Profiles",icon:E.f},{href:"/hermes-drift",label:"Drift Cockpit",icon:K},{href:"/hermes-security",label:"Proxy Security",icon:X.f},{href:"/orchestra/web-gateway",label:"Web Gateway",icon:O.f}]},{id:"ardent",label:"Magnus Ardent",tone:"primary",items:[{href:"/ardent",label:"Overview",icon:et.f,exact:!0},{href:"/ardent/installations",label:"Installations",icon:y.f},{href:"/ardent/profiles",label:"Profiles",icon:E.f}]},{id:"codex",label:"Codex Agent",tone:"primary",items:[{href:"/codex",label:"Overview",icon:Z.f,exact:!0},{href:"/codex/installations",label:"Installations",icon:ee.f}]}],es={"/":"Fleet Overview","/mission-control":"Mission Control","/nodes":"Nodes","/application-operations":"Application Operations","/fleet-readiness":"Fleet Readiness","/fleet-timeline":"Fleet Timeline","/fleet-map":"Fleet Map","/commands":"Commands","/anomalies":"Anomalies","/anomalies/remediation":"Auto-Remediation","/governor/operations":"Fleet Operations","/rollouts":"Guided Rollouts","/incidents":"Incident Workspace","/cron":"Cron Jobs","/files":"Files","/logs":"Logs","/audit":"Audit","/webhooks":"Webhooks","/retention":"Retention","/api-docs":"API Docs","/library":"Library","/skills":"Skills","/roles":"Roles","/sync":"Sync","/notifications":"Notification Preferences","/security-fusion":"Security","/orchestra":"Hermes Agent Fleet","/orchestra/installations":"Hermes Installations","/orchestra/profiles":"Hermes Profiles","/orchestra/web-gateway":"Web Gateway","/hermes-drift":"Hermes Drift Cockpit","/hermes-security":"Hermes Proxy Security","/ardent":"Magnus Ardent","/ardent/installations":"Ardent Installations","/ardent/profiles":"Ardent Profiles","/codex":"Codex Agent Fleet","/codex/installations":"Codex Installations"};function en(e,t,a=!1){return"/"===t||a?e===t:e===t||e.startsWith(`${t}/`)}function ei(e){let t=null;for(let a of er)for(let r of a.items)!r.external&&en(e,r.href,r.exact)&&(null===t||r.href.length>t.length)&&(t=r.href);return t}var el=e.i(16141);let eo={security:"from-primary/60 via-accent/20",hermes:"from-accent/50 via-accent/20",ardent:"from-primary/50 via-accent/20",codex:"from-primary/50 via-primary/20"};function ec({group:e,activeHref:a}){let r="accent"===e.tone;return(0,t.jsxs)(t.Fragment,{children:["fleet"!==e.id&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"mx-3 my-1",children:(0,t.jsx)("div",{className:(0,n.f)("h-px bg-gradient-to-r to-transparent",eo[e.id])})}),(0,t.jsx)("div",{className:"px-4 pb-0.5 pt-2",children:(0,t.jsx)("span",{className:(0,n.f)("text-[9px] font-bold uppercase tracking-[0.25em]",r?"text-accent/60":"text-primary/60"),children:e.label})})]}),(0,t.jsx)("nav",{className:(0,n.f)("space-y-0.5 p-3","fleet"!==e.id&&"pt-1"),"aria-label":e.label,children:e.items.map(e=>{let i=e.href===a,l=e.icon;return(0,t.jsxs)(s.default,{href:e.href,prefetch:!1,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0,"aria-current":i?"page":void 0,className:(0,n.f)("group relative flex items-center gap-3 overflow-hidden rounded-chip px-3 py-2 text-xs uppercase tracking-wider transition-colors duration-200","before:pointer-events-none before:absolute before:inset-y-0 before:-left-1/2 before:w-1/2 before:-skew-x-12 before:bg-gradient-to-r before:from-transparent before:to-transparent before:opacity-0 before:transition-[left,opacity] before:duration-500 hover:before:left-full hover:before:opacity-100",r?"before:via-accent/10":"before:via-primary/10",i?(0,n.f)(r?"text-accent":"text-primary",r?"bg-accent/5":"bg-primary/5"):(0,n.f)("text-text-muted",r?"hover:text-accent":"hover:text-primary")),children:[i&&(0,t.jsx)(f.f.span,{layoutId:"sidebar-indicator",className:(0,n.f)("absolute bottom-1 left-0 top-1 w-0.5 rounded-full",r?"bg-accent":"bg-primary"),style:{boxShadow:r?"0 0 8px var(--color-accent), 0 0 16px var(--color-glow-accent)":"0 0 8px var(--color-primary), 0 0 16px var(--color-glow)"},transition:{type:"spring",stiffness:300,damping:30}}),(0,t.jsx)(l,{className:"relative h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"relative truncate",children:e.label})]},e.href)})})]})}function ed(){return(0,t.jsxs)("div",{className:"relative flex h-8 w-8 items-center justify-center animate-flicker",children:[(0,t.jsxs)("svg",{viewBox:"0 0 32 32",className:"h-8 w-8 overflow-visible","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"1",y:"1",width:"30",height:"30",rx:"4",fill:"none",stroke:"var(--color-primary)",strokeOpacity:"0.35"}),(0,t.jsx)("path",{d:"M8 23 V9 L16 18 L24 9 V23",fill:"none",stroke:"var(--color-primary)",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",pathLength:100,style:{"--stroke-length":100,strokeDasharray:100,animation:"draw-stroke 1.4s var(--ease-out-expo) both"},className:"drop-shadow-[0_0_4px_var(--color-primary)]"})]}),(0,t.jsx)("div",{className:"absolute inset-0 rounded shadow-[0_0_12px_var(--color-glow)]"})]})}function em(){let{connected:e}=(0,a.useSyncExternalStore)(el.f.subscribe,el.f.getSnapshot,el.f.getServerSnapshot);return(0,t.jsxs)("span",{className:"flex items-center gap-1.5",title:e?"Live event stream connected":"Live event stream reconnecting",children:[(0,t.jsxs)("span",{className:"relative inline-flex h-1.5 w-1.5",children:[e&&(0,t.jsx)("span",{className:"absolute inset-0 rounded-full bg-success animate-halo"}),(0,t.jsx)("span",{className:(0,n.f)("relative inline-flex h-1.5 w-1.5 rounded-full",e?"bg-success shadow-[0_0_6px_var(--color-success)]":"bg-warning")})]}),(0,t.jsx)("span",{className:e?"text-success/70":"text-warning/70",children:e?"Live":"Offline"})]})}function eu({integrations:e}){let s=ei((0,r.usePathname)()),n=(0,a.useMemo)(()=>(function(e,t=er){return t.filter(t=>{var a;return!t.integration||(a=t.integration,"securityConsole"===a?null!==e.securityConsoleUrl:e.hermes)}).map(t=>"security"===t.id&&e.securityConsoleUrl?{...t,items:[{href:e.securityConsoleUrl,label:"Security console ↗",icon:Y,external:!0},...t.items]}:t)})(e),[e]);return(0,t.jsxs)("aside",{className:"relative flex h-full w-56 flex-col border-r border-border/50 bg-bg",children:[(0,t.jsx)("div",{className:"absolute bottom-0 right-0 top-0 w-px bg-gradient-to-b from-primary/60 via-primary/20 to-transparent"}),(0,t.jsxs)("div",{className:"flex h-14 items-center gap-3 border-b border-border/30 px-4",children:[(0,t.jsx)(ed,{}),(0,t.jsx)("span",{className:"text-sm font-bold uppercase tracking-[0.2em] text-text",children:"Magnus"})]}),(0,t.jsx)(p,{}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:n.map(e=>(0,t.jsx)(ec,{group:e,activeHref:s},e.id))}),(0,t.jsxs)("div",{className:"flex items-center justify-between border-t border-border/30 p-4 text-[10px] uppercase tracking-widest text-primary/40",children:[(0,t.jsxs)("span",{children:["Magnus v","2.2.2"]}),(0,t.jsx)(em,{})]})]})}var ex=e.i(67784),eh=e.i(41120);let ep={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};ep.node;let ef=(0,b.f)(ep);var eb=e.i(66595),eg=e.i(67927);let ev={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};ev.node;let ey=(0,b.f)(ev),ew={name:"check-check",size:24,node:[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]};ew.node;let ek=(0,b.f)(ew);var ej=e.i(53138),eN=e.i(99847),eC=e.i(10818),eM=e.i(94371),eS=e.i(69174),eE=e.i(82983);function e$(){let[e,r]=(0,a.useState)(!1),[i,o]=(0,a.useState)([]),[d,m]=(0,a.useState)(0),[u,x]=(0,a.useState)(!1),h=(0,a.useRef)(null),p=(0,a.useCallback)(async()=>{try{let e=await eE.f.notifications.unreadCount();e.success&&e.data&&m(e.data.count)}catch{}},[]),f=(0,a.useCallback)(async()=>{x(!0);try{let e=await eE.f.notifications.list({pageSize:20});if(e.success&&e.data){let t=e.data;o(t.notifications)}}catch{}finally{x(!1)}},[]);(0,a.useEffect)(()=>{p();let e=setInterval(()=>void p(),15e3);return()=>clearInterval(e)},[p]),(0,a.useEffect)(()=>{e&&f()},[e,f]),(0,a.useEffect)(()=>{if(!e)return;let t=e=>{h.current&&!h.current.contains(e.target)&&r(!1)};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[e]),(0,a.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&r(!1)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]);let b=async e=>{try{await eE.f.notifications.markRead([e]),o(t=>t.map(t=>t.id===e?{...t,isRead:!0}:t)),m(e=>Math.max(0,e-1))}catch{}},g=async()=>{try{await eE.f.notifications.markAllRead(),o(e=>e.map(e=>({...e,isRead:!0}))),m(0),setTimeout(()=>void p(),500)}catch{}};return(0,t.jsxs)("div",{className:"relative",ref:h,children:[(0,t.jsxs)("button",{className:"relative rounded p-2 text-text-muted transition-all hover:bg-surface-hover hover:text-text",title:"Notifications",type:"button","aria-expanded":e,"aria-controls":"notification-panel","aria-label":d>0?`Notifications (${d} unread)`:"Notifications",onClick:()=>r(e=>!e),children:[(0,t.jsx)(ey,{className:"h-4 w-4"}),d>0&&(0,t.jsx)("span",{className:"absolute right-1 top-1 flex h-4 min-w-[1rem] items-center justify-center rounded-full bg-danger px-1 text-[10px] font-bold text-white",children:d>99?"99+":d})]}),e&&(0,t.jsxs)("div",{id:"notification-panel",role:"region","aria-label":"Notifications",className:"absolute right-0 top-full z-50 mt-2 w-96 overflow-hidden rounded border border-border bg-surface shadow-2xl",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[(0,t.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider text-text",children:"Notifications"}),d>0&&(0,t.jsxs)("button",{className:"flex items-center gap-1 rounded px-2 py-1 text-xs text-primary hover:bg-primary/10 transition-all",onClick:()=>void g(),type:"button",children:[(0,t.jsx)(ek,{className:"h-3 w-3"}),"Mark all read"]})]}),(0,t.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[u&&0===i.length&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsx)("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-primary border-t-transparent"})}),!u&&0===i.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-10 text-text-muted",children:[(0,t.jsx)(ey,{className:"mb-2 h-8 w-8 opacity-40"}),(0,t.jsx)("p",{className:"text-xs",children:"No notifications yet"})]}),i.map(e=>(0,t.jsxs)("div",{className:(0,n.f)("group flex items-start gap-3 border-b border-border/50 px-4 py-3 transition-all hover:bg-surface-hover",!e.isRead&&"bg-primary/5"),children:[(0,t.jsx)("div",{className:"mt-0.5 shrink-0",children:function(e){switch(e){case"critical":return(0,t.jsx)(eN.f,{className:"h-4 w-4 text-danger"});case"warning":return(0,t.jsx)(ej.f,{className:"h-4 w-4 text-warning"});default:return(0,t.jsx)(eC.f,{className:"h-4 w-4 text-primary"})}}(e.severity)}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[function(e){switch(e){case"node.offline":return(0,t.jsx)(y.f,{className:"h-3.5 w-3.5 text-danger"});case"node.degraded":case"node.upgrade_not_ready":return(0,t.jsx)(y.f,{className:"h-3.5 w-3.5 text-warning"});case"node.recovered":return(0,t.jsx)(U,{className:"h-3.5 w-3.5 text-success"});case"command.failed":return(0,t.jsx)(w.f,{className:"h-3.5 w-3.5 text-warning"});case"deploy.failed":return(0,t.jsx)(eM.f,{className:"h-3.5 w-3.5 text-danger"});case"upgrade.failed":return(0,t.jsx)(eS.f,{className:"h-3.5 w-3.5 text-danger"});default:return(0,t.jsx)(ey,{className:"h-3.5 w-3.5 text-text-muted"})}}(e.type),(0,t.jsx)("span",{className:(0,n.f)("text-xs font-bold",e.isRead?"text-text-muted":"text-text"),children:e.title})]}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-text-muted line-clamp-2",children:e.message}),(0,t.jsx)("span",{className:"mt-1 block text-[10px] text-text-muted/60",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return"just now";let a=Math.floor(t/60);if(a<60)return`${a}m ago`;let r=Math.floor(a/60);if(r<24)return`${r}h ago`;let s=Math.floor(r/24);return`${s}d ago`}(e.createdAt)})]}),!e.isRead&&(0,t.jsx)("button",{className:"mt-0.5 shrink-0 rounded p-1 text-text-muted opacity-0 transition-all hover:bg-surface-hover hover:text-primary group-hover:opacity-100",title:"Mark as read",type:"button",onClick:()=>void b(e.id),children:(0,t.jsx)(c.f,{className:"h-3.5 w-3.5"})})]},e.id))]}),(0,t.jsx)("div",{className:"border-t border-border px-4 py-2 flex justify-end",children:(0,t.jsxs)(s.default,{href:"/notifications",className:"flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",onClick:()=>r(!1),children:[(0,t.jsx)(l.f,{className:"h-3 w-3"}),"Preferences"]})})]})]})}var e_=e.i(1092);let eA=[{keys:["g","m"],label:"Go to Mission Control",description:"Navigate to unified Mission Control home",action:"navigate",target:"/mission-control",category:"navigation"},{keys:["g","o"],label:"Go to Overview",description:"Navigate to fleet overview",action:"navigate",target:"/",category:"navigation"},{keys:["g","n"],label:"Go to Nodes",description:"Navigate to node list",action:"navigate",target:"/nodes",category:"navigation"},{keys:["g","c"],label:"Go to Commands",description:"Navigate to command console",action:"navigate",target:"/commands",category:"navigation"},{keys:["g","j"],label:"Go to Cron Jobs",description:"Navigate to cron jobs",action:"navigate",target:"/cron",category:"navigation"},{keys:["g","f"],label:"Go to Files",description:"Navigate to file editor",action:"navigate",target:"/files",category:"navigation"},{keys:["g","s"],label:"Go to Skills",description:"Navigate to skill marketplace",action:"navigate",target:"/skills",category:"navigation"},{keys:["g","l"],label:"Go to Logs",description:"Navigate to log explorer",action:"navigate",target:"/logs",category:"navigation"},{keys:["g","a"],label:"Go to Audit",description:"Navigate to audit trail",action:"navigate",target:"/audit",category:"navigation"},{keys:["?"],label:"Show Shortcuts",description:"Show keyboard shortcut reference",action:"command",target:"show-shortcuts",category:"general"}];function eL(){return"u">typeof navigator&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘":"Ctrl"}function eR(){document.body.dispatchEvent(new KeyboardEvent("keydown",{key:"k",ctrlKey:!0,metaKey:!0,bubbles:!0}))}function ez({onMenuToggle:e}){let n=(0,r.usePathname)(),i=(0,r.useRouter)(),{title:l,crumbs:o}=function(e){let t=null;for(let a of Object.keys(es))en(e,a)&&(null===t||a.length>t.length)&&(t=a);let a=t?es[t]:"Magnus",r=ei(e),s=r?er.find(e=>e.items.some(e=>e.href===r))?.label??null:null,n=[];if(s&&n.push({label:s}),n.push({label:a,href:t??void 0}),t&&e!==t)for(let a of e.slice("/"===t?1:t.length+1).split("/").filter(Boolean)){let e=decodeURIComponent(a);n.push({label:e.length>18?`${e.slice(0,8)}…${e.slice(-6)}`:e})}return{title:a,group:s,crumbs:n}}(n),[c,d]=(0,a.useState)(null),[m,u]=(0,a.useState)(!1),[x,h]=(0,a.useState)("Ctrl"),p=(0,a.useRef)(null);async function f(e=!1){let t=await fetch(`/api/auth/logout${e?"?all=true":""}`,{method:"POST"}).catch(()=>null);t?.ok?(i.push("/login"),i.refresh()):window.alert("Session revocation unavailable; retry sign out.")}return(0,a.useEffect)(()=>{h(eL()),fetch("/api/auth/me").then(e=>e.ok?e.json():null).then(e=>{e?.username&&d(e.username)}).catch(()=>{})},[]),(0,a.useEffect)(()=>{if(!m)return;let e=e=>{(e instanceof KeyboardEvent?"Escape"!==e.key:p.current?.contains(e.target))||u(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",e)}},[m]),(0,t.jsxs)("header",{className:"relative z-(--z-shell) flex h-14 items-center justify-between gap-3 bg-bg/80 px-3 backdrop-blur-sm sm:px-6",children:[(0,t.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-primary/60 via-accent/40 to-transparent"}),(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 text-xs uppercase tracking-[0.15em] text-text-muted",children:[e&&(0,t.jsx)("button",{className:"mr-1 rounded p-1.5 text-text-muted hover:text-primary md:hidden",onClick:e,type:"button",title:"Toggle menu",children:(0,t.jsx)(ef,{className:"h-5 w-5"})}),(0,t.jsx)("span",{className:"text-primary/60",children:">_"}),(0,t.jsx)("nav",{"aria-label":"Breadcrumb",className:"hidden min-w-0 items-center gap-1 sm:flex",children:o.map((e,a)=>{let r=a===o.length-1;return(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[a>0&&(0,t.jsx)(eg.f,{className:"h-3 w-3 shrink-0 text-primary/30","aria-hidden":"true"}),e.href&&!r?(0,t.jsx)(s.default,{href:e.href,prefetch:!1,className:"truncate transition-colors hover:text-primary",children:e.label}):(0,t.jsx)("span",{className:r?"truncate text-text":0===a&&o.length>1?"truncate text-text-muted/60":"truncate","aria-current":r?"page":void 0,children:e.label})]},`${e.label}-${a}`)})}),(0,t.jsx)("span",{className:"sr-only sm:hidden",children:l}),(0,t.jsx)("span",{className:"ml-1 hidden h-3.5 w-1.5 shrink-0 bg-primary/80 sm:inline-block",style:{animation:"cursor-blink 1s step-end infinite"}})]}),(0,t.jsx)(e_.J,{className:"hidden max-w-xl flex-1 lg:block"}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1 sm:gap-2",children:[(0,t.jsxs)("button",{type:"button",onClick:eR,className:"hidden items-center gap-2 rounded-chip border border-border bg-surface px-2.5 py-1.5 text-[10px] uppercase tracking-wider text-text-muted transition-colors hover:border-primary/40 hover:text-primary md:flex",title:"Search and jump (command palette)",children:[(0,t.jsx)(eb.f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:"Search"}),(0,t.jsxs)("kbd",{className:"rounded-chip border border-border bg-bg px-1 text-[9px] text-primary/70",children:[x,"+K"]})]}),(0,t.jsx)("button",{className:"rounded p-2 text-text-muted transition-all hover:text-primary hover:drop-shadow-[0_0_6px_var(--color-glow)]",title:"Refresh",onClick:()=>window.location.reload(),type:"button",children:(0,t.jsx)(eh.f,{className:"h-4 w-4"})}),(0,t.jsx)(e$,{}),(0,t.jsx)("button",{className:"rounded p-2 text-text-muted transition-all hover:text-danger hover:drop-shadow-[0_0_6px_rgba(255,23,68,0.3)]",title:"Sign Out",onClick:()=>void f(),type:"button",children:(0,t.jsx)(ex.f,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{ref:p,className:"relative ml-1",children:[(0,t.jsx)("button",{type:"button",onClick:()=>u(e=>!e),"aria-haspopup":"menu","aria-expanded":m,title:c?`Signed in as ${c}`:"Account",className:"flex h-8 w-8 items-center justify-center rounded border border-accent/40 text-[10px] font-bold uppercase text-accent shadow-[0_0_8px_var(--color-glow-accent)] transition-colors hover:border-accent hover:bg-accent/10",children:c?.[0]??"U"}),m&&(0,t.jsxs)("div",{role:"menu",className:"panel-corners absolute right-0 top-full z-(--z-modal) mt-2 w-60 rounded-panel border border-accent/30 bg-surface/95 p-1 shadow-[0_0_24px_var(--color-glow-accent)] backdrop-blur-sm [--panel-corner-color:var(--color-accent)]",children:[c&&(0,t.jsxs)("div",{className:"border-b border-border px-3 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:["Signed in as ",(0,t.jsx)("span",{className:"text-accent",children:c})]}),(0,t.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>void f(),className:"flex w-full items-center gap-2 rounded-chip px-3 py-2 text-left text-xs text-text-muted transition-colors hover:bg-surface-hover hover:text-text",children:[(0,t.jsx)(ex.f,{className:"h-3.5 w-3.5"})," Sign out"]}),(0,t.jsxs)("button",{type:"button",role:"menuitem","aria-label":"Sign out all local sessions",onClick:()=>void f(!0),className:"flex w-full items-center gap-2 rounded-chip px-3 py-2 text-left text-xs text-text-muted transition-colors hover:bg-danger/10 hover:text-danger",children:[(0,t.jsx)(ex.f,{className:"h-3.5 w-3.5"})," Sign out all local sessions"]})]})]})]})]})}async function eP(e,t){try{let a=await fetch(e,{signal:t,headers:{accept:"application/json"}});if(!a.ok)return null;return await a.json()}catch{return null}}function eI(e,t){return e.trim()?t.map(t=>({e:t,s:function(e,t){if(!e)return 0;let a=e.toLowerCase(),r=t.toLowerCase(),s=r.indexOf(a);if(-1!==s)return s;let n=0,i=0;for(let e of a){let t=r.indexOf(e,n);if(-1===t)return -1;i+=t-n,n=t+1}return 1e3+i}(e,`${t.label} ${t.sublabel??""}`)})).filter(({s:e})=>e>=0).sort((e,t)=>e.s-t.s).map(({e})=>e):t}async function eT(e,t={}){let{signal:a,limit:r=10}=t;if(e.trim().length<2)return[];let[s,n,i]=await Promise.all([eP("/api/proxy/nodes",a),eP("/api/proxy/orchestra/installations",a),eP("/api/proxy/orchestra/skill-catalog",a)]),l=[];for(let e of s?.data??[])l.push({kind:"node",id:e.id,label:e.name,sublabel:e.status?`Node \xb7 ${e.status}`:"Node",href:`/nodes/${e.id}`});for(let e of n?.data??[])l.push({kind:"installation",id:e.id,label:e.displayName??e.hostname,sublabel:`Hermes \xb7 ${e.status??"unknown"}`,href:"/orchestra/installations"});for(let e of i?.data??[])l.push({kind:"skill",id:e.id,label:e.name,sublabel:e.description??"Skill",href:"/skills"});return eI(e,[{kind:"action",id:"deploy-agent",label:"Deploy agent to host",sublabel:"Action · Operations",href:"/governor/operations"},{kind:"action",id:"open-terminal",label:"Open node terminal",sublabel:"Action · Nodes",href:"/nodes"},{kind:"action",id:"run-fleet-check",label:"Run fleet check",sublabel:"Action · Fleet readiness",href:"/fleet-readiness"},{kind:"action",id:"view-stale-nodes",label:"View stale nodes",sublabel:"Action · Readiness",href:"/fleet-readiness"},{kind:"action",id:"rotate-node-secret",label:"Rotate node secret",sublabel:"Action · Operations",href:"/governor/operations"},{kind:"action",id:"latest-failed-deploy",label:"Open latest failed deploy",sublabel:"Action · Timeline",href:"/fleet-timeline"},...l]).slice(0,r)}var eO=e.i(68877),eD=e.i(20851),eU=e.i(70533);let eF={name:"keyboard",size:24,node:[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]};eF.node;let eq=(0,b.f)(eF);var eG=e.i(63676);let eH={name:"key",size:24,node:[["path",{d:"m2 21 9.6-9.6",key:"9l79m3"}],["path",{d:"m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19",key:"fw8biw"}],["circle",{cx:"15.5",cy:"7.5",r:"5.5",key:"4wxmhb"}]]};eH.node;let eK=(0,b.f)(eH);var eV=e.i(32781),eW=e.i(28623),eJ=e.i(72603);let eB={"/":v,"/mission-control":T,"/nodes":y.f,"/commands":w.f,"/cron":k.f,"/files":j.f,"/skills":eD.f,"/logs":C,"/audit":M.f,"/library":eU.f},eX={node:y.f,installation:S.f,skill:eD.f,action:eO.f};function eQ(){let[e,s]=(0,a.useState)(!1),[n,i]=(0,a.useState)(""),[l,o]=(0,a.useState)(0),[c,d]=(0,a.useState)(!1),[m,u]=(0,a.useState)([]),[x,h]=(0,a.useState)(!1),[p,f]=(0,a.useState)("normal"),b=(0,a.useRef)(null),g=(0,r.useRouter)(),v=(0,a.useRef)([]),y=(0,a.useRef)(void 0),w=(0,a.useRef)(void 0),k=(0,a.useRef)(null),j=(n.trim()?eA.filter(e=>e.label.toLowerCase().includes(n.toLowerCase())||e.description.toLowerCase().includes(n.toLowerCase())):eA).map(e=>({kind:"shortcut",key:`s:${e.keys.join("-")}`,shortcut:e})),N=eI(n,m).map(e=>({kind:"entity",key:`e:${e.kind}:${e.id}`,entity:e})),C=n.trim()?[...N,...j]:j;(0,a.useEffect)(()=>{if(!e)return;let t=n.trim();if(t.length<2){u([]),h(!1);return}w.current&&clearTimeout(w.current),k.current&&k.current.abort();let a=new AbortController;return k.current=a,h(!0),w.current=setTimeout(async()=>{let e=await eT(t,{signal:a.signal,limit:12});a.signal.aborted||(u(e),h(!1))},180),()=>{a.abort(),w.current&&clearTimeout(w.current)}},[n,e]);let M=(0,a.useCallback)(e=>{"navigate"===e.action&&e.target?(g.push(e.target),s(!1),i("")):"show-shortcuts"===e.target&&(d(!0),s(!1),i(""))},[g]),S=(0,a.useCallback)(e=>{"shortcut"===e.kind?M(e.shortcut):(g.push(e.entity.href),s(!1),i(""))},[M,g]);return((0,a.useEffect)(()=>{let t=t=>{let a=t.target,r="INPUT"===a.tagName||"TEXTAREA"===a.tagName||a.isContentEditable;if((t.metaKey||t.ctrlKey)&&"k"===t.key.toLowerCase()){t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),s(e=>!e);return}if("Escape"===t.key){if(e){s(!1),i("");return}return c?void d(!1):void 0}if(!r){if("?"===t.key){t.preventDefault(),d(e=>!e);return}if(1===t.key.length&&!t.metaKey&&!t.ctrlKey&&!t.altKey){for(let e of(clearTimeout(y.current),v.current.push(t.key.toLowerCase()),eA))if(e.keys.length===v.current.length&&e.keys.every((e,t)=>e===v.current[t])){t.preventDefault(),v.current=[],M(e);return}y.current=setTimeout(()=>{v.current=[]},800)}}};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e,c,M]),(0,a.useEffect)(()=>{e&&(o(0),setTimeout(()=>b.current?.focus(),50))},[e]),(0,a.useEffect)(()=>{l>=C.length&&o(Math.max(0,C.length-1))},[C.length,l]),(0,a.useEffect)(()=>{e&&f("low"===document.documentElement.dataset.fx?"low":"normal")},[e]),e||c)?(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsxs)("div",{className:"fixed inset-0 z-(--z-modal) flex items-start justify-center pt-[15vh]","data-testid":"command-palette",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-[2px]",onClick:()=>{s(!1),i("")}}),(0,t.jsxs)("div",{className:"relative z-10 w-full max-w-lg panel-corners rounded-panel border border-primary/30 bg-surface/95 shadow-[0_0_40px_var(--color-glow)]",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 border-b border-border px-4 py-3",children:[(0,t.jsx)(eb.f,{className:"h-5 w-5 text-primary"}),(0,t.jsx)("input",{ref:b,type:"text",placeholder:"Search nodes, agents, runs, users, commands...",className:"flex-1 bg-transparent text-sm text-text placeholder:text-text-muted/70 caret-primary outline-none",value:n,onChange:e=>{i(e.target.value),o(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),o(e=>Math.min(e+1,C.length-1))):"ArrowUp"===e.key?(e.preventDefault(),o(e=>Math.max(e-1,0))):"Enter"===e.key&&C[l]&&(e.preventDefault(),S(C[l]))},"data-testid":"command-palette-input"}),x?(0,t.jsx)(eV.f,{className:"h-4 w-4 animate-spin text-primary"}):(0,t.jsx)("kbd",{className:"rounded-chip border border-border bg-bg px-1.5 py-0.5 text-[10px] text-text-muted",children:"ESC"})]}),(0,t.jsxs)("div",{className:"max-h-96 overflow-y-auto py-2",children:[0===C.length&&!x&&(0,t.jsx)("p",{className:"px-4 py-6 text-center text-xs uppercase tracking-wider text-text-muted",children:"No results found"}),0===C.length&&x&&(0,t.jsx)("p",{className:"px-4 py-6 text-center text-xs uppercase tracking-wider text-text-muted",children:"Searching…"}),C.map((e,a)=>{let r=a===l;if("shortcut"===e.kind){let s=eB[e.shortcut.target??""]??eO.f;return(0,t.jsxs)("button",{className:`flex w-full items-center gap-3 px-4 py-2 text-left text-sm transition-colors ${r?"bg-primary/10 text-primary shadow-[inset_2px_0_0_var(--color-primary)]":"text-text hover:bg-surface-hover"}`,onClick:()=>S(e),onMouseEnter:()=>o(a),"data-testid":"command-palette-item","data-item-kind":"shortcut",children:[(0,t.jsx)(s,{className:"h-4 w-4 shrink-0 opacity-70"}),(0,t.jsx)("span",{className:"flex-1",children:e.shortcut.label}),(0,t.jsx)("span",{className:"text-xs text-text-muted",children:e.shortcut.keys.map(e=>e.toUpperCase()).join(" then ")})]},e.key)}let s=eX[e.entity.kind]??eO.f;return(0,t.jsxs)("button",{className:`flex w-full items-center gap-3 px-4 py-2 text-left text-sm transition-colors ${r?"bg-accent/10 text-accent shadow-[inset_2px_0_0_var(--color-accent)]":"text-text hover:bg-surface-hover"}`,onClick:()=>S(e),onMouseEnter:()=>o(a),"data-testid":"command-palette-item","data-item-kind":"entity","data-entity-kind":e.entity.kind,children:[(0,t.jsx)(s,{className:"h-4 w-4 shrink-0 text-accent/80"}),(0,t.jsxs)("span",{className:"flex-1 truncate",children:[(0,t.jsx)("span",{className:"font-medium",children:e.entity.label}),e.entity.sublabel&&(0,t.jsx)("span",{className:"ml-2 text-xs text-text-muted",children:e.entity.sublabel})]}),(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:e.entity.kind})]},e.key)})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 border-t border-border px-4 py-2 text-[10px] uppercase tracking-wider text-text-muted",children:[(0,t.jsx)("span",{children:"↑↓ navigate"}),(0,t.jsx)("span",{children:"↵ select"}),(0,t.jsx)("span",{children:"esc close"}),(0,t.jsxs)("button",{type:"button",onClick:()=>f((0,eJ.W)()),className:"ml-auto flex items-center gap-1 rounded-chip px-1 text-text-muted transition-colors hover:text-primary",title:"Toggle visual effects (scanlines, glow pulses, animated map)","data-testid":"command-palette-fx-toggle",children:[(0,t.jsx)(eW.f,{className:"h-3 w-3"})," fx: ",p]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(eK,{className:"h-3 w-3"})," ",eL(),"+K"]})]})]})]}),c&&(0,t.jsxs)("div",{className:"fixed inset-0 z-(--z-modal) flex items-center justify-center",children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-[2px]",onClick:()=>d(!1)}),(0,t.jsxs)("div",{className:"relative z-10 w-full max-w-md panel-corners rounded-panel border border-primary/30 bg-surface/95 p-6 shadow-[0_0_40px_var(--color-glow)]",children:[(0,t.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(eq,{className:"h-5 w-5 text-primary"}),(0,t.jsx)("h2",{className:"text-sm font-bold uppercase tracking-wider text-primary glow-text-primary",children:"Keyboard Shortcuts"})]}),(0,t.jsx)("button",{onClick:()=>d(!1),className:"text-text-muted hover:text-text",children:(0,t.jsx)(eG.X,{className:"h-5 w-5"})})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 text-[10px] font-medium uppercase tracking-[0.2em] text-text-muted",children:"General"}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(eY,{keys:[`${eL()}+K`],label:"Open command palette"}),(0,t.jsx)(eY,{keys:["?"],label:"Show this reference"}),(0,t.jsx)(eY,{keys:["Esc"],label:"Close modal / palette"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 text-[10px] font-medium uppercase tracking-[0.2em] text-text-muted",children:"Fleet Navigation"}),(0,t.jsx)("div",{className:"space-y-1",children:eA.filter(e=>"navigation"===e.category).map(e=>(0,t.jsx)(eY,{keys:e.keys.map(e=>e.toUpperCase()),label:e.label},e.target))})]})]})]})]})]}):null}function eY({keys:e,label:a}){return(0,t.jsxs)("div",{className:"flex items-center justify-between py-1",children:[(0,t.jsx)("span",{className:"text-xs text-text",children:a}),(0,t.jsx)("div",{className:"flex gap-1",children:e.map((a,r)=>(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{className:"rounded-chip border border-border bg-bg px-1.5 py-0.5 text-[11px] text-primary",children:a}),r<e.length-1&&(0,t.jsx)("span",{className:"mx-0.5 text-[10px] text-text-muted/60",children:"then"})]},r))})]})}let eZ={name:"server-cog",size:24,node:[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1v3clb"}],["path",{d:"m13.148 9.228.383-.923",key:"t2zzyc"}],["path",{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1bxfiv"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}]]};eZ.node;let e0=(0,b.f)(eZ);var e1=e.i(63646);let e2="magnus.update-banner.dismissed";function e5(){let[e,r]=(0,a.useState)(null),[n,i]=(0,a.useState)(null);if((0,a.useEffect)(()=>{i(function(){try{return window.localStorage.getItem(e2)}catch{return null}}());let e=!1,t=()=>{eE.f.systemUpdates.get().then(t=>{e||r(t)}).catch(()=>void 0)};t();let a=window.setInterval(t,18e5);return()=>{e=!0,window.clearInterval(a)}},[]),!e)return null;let{server:l,agents:o}=e,c=o.behind.length,d=(0,e1.t)(o);if(!l.updateAvailable&&!l.latestMajor&&0===c)return null;let m=`${e.server.latest??""}|${e.server.latestMajor??""}|${e.agents.behind.length}|${e.agents.expected}`;return n===m?null:(0,t.jsxs)("section",{role:"status","aria-label":"Updates","data-testid":"update-banner",className:"relative mb-4 overflow-hidden rounded border border-warning/40 bg-warning/5 px-4 py-3 text-[11px]",children:[(0,t.jsx)("div",{className:"absolute inset-y-0 left-0 w-0.5 bg-warning"}),(0,t.jsx)("button",{type:"button","aria-label":"Dismiss",className:"absolute right-2 top-2 text-text-muted hover:text-text",onClick:()=>{try{window.localStorage.setItem(e2,m)}catch{}i(m)},children:(0,t.jsx)(eG.X,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)("div",{className:"space-y-2 pr-6",children:[l.updateAvailable&&l.latest&&(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(eS.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning"}),(0,t.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,t.jsxs)("p",{children:[(0,t.jsxs)("span",{className:"font-bold uppercase tracking-wider text-warning",children:["Magnus ",l.latest," is available"]}),(0,t.jsxs)("span",{className:"ml-2 text-text-muted",children:["running ",l.current,l.breaking?" · contains breaking changes":""]})]}),l.releases.filter(e=>e.summary).map(e=>(0,t.jsxs)("p",{className:"text-text-muted",children:[e.version,": ",e.summary," ",e.notesUrl&&(0,t.jsx)("a",{className:"text-primary underline",href:e.notesUrl,target:"_blank",rel:"noreferrer",children:"release notes"})]},e.version)),l.newRequiredEnv.length>0&&(0,t.jsxs)("p",{className:"text-text-muted",children:["New required settings:"," ",l.newRequiredEnv.map(e=>(0,t.jsxs)("code",{className:"mr-1 rounded bg-surface px-1",children:[e.name,"server"!==e.component?` (${e.component})`:""]},e.name)),l.newRequiredEnv.every(e=>e.secret)&&(0,t.jsxs)("span",{children:["(secrets: ",(0,t.jsx)("code",{children:"magnus upgrade --generate-secrets"})," fills them in)"]})]}),l.attention.length>0&&(0,t.jsxs)("p",{className:"text-warning",children:["Needs a maintenance window: ",l.attention.map(e=>`${e.name} (${e.impact}${e.note?`: ${e.note}`:""})`).join("; ")]}),(0,t.jsxs)("p",{className:"text-text-muted",children:["On the server host run ",(0,t.jsx)("code",{className:"rounded bg-surface px-1 text-text",children:l.command})," (backs up the database and reverts on failure)."]})]})]}),l.latestMajor&&(0,t.jsxs)("p",{className:"text-text-muted",children:["Magnus ",l.latestMajor," is a new major version. Major upgrades are never offered automatically; read UPGRADING.md first."]}),c>0&&(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(e0,{className:"mt-0.5 h-4 w-4 shrink-0 text-warning"}),(0,t.jsxs)("p",{children:[(0,t.jsxs)("span",{className:"font-bold uppercase tracking-wider text-warning",children:[c," agent",1===c?"":"s"," behind the server (",o.expected,")"]}),(0,t.jsxs)("span",{className:"ml-2 text-text-muted",children:[o.behind.slice(0,5).map(e=>`${e.name} ${e.version}`).join(", "),c>5?", …":"","."]})," ",o.upgradesEnabled?(0,t.jsx)(s.default,{href:"/nodes?upgrade=agents",className:"text-primary underline",children:d>0?"Review agent upgrades":"Upgrade agents"}):(0,t.jsx)("span",{className:"text-text-muted",children:"Agent upgrades are off on this server (MAGNUS_AGENT_UPGRADES=false)."}),d>0&&(0,t.jsxs)("span",{className:"ml-2 text-text-muted",children:[d," agent",1===d?" requires":"s require"," a manual major-version upgrade; the dialog only upgrades within the same major."]}),o.fixCommand&&0===d&&(0,t.jsxs)("span",{className:"ml-2 text-text-muted",children:["or run ",(0,t.jsx)("code",{className:"rounded bg-surface px-1 text-text",children:o.fixCommand})]})]})]})]})]})}var e3=e.i(52928);e.s(["DashboardShell",0,function({children:e,integrations:s}){let n=(0,r.usePathname)(),i="/login"===n||n.startsWith("/governor/share/"),[l,o]=(0,a.useState)(!1);!function({enabled:e=!0}={}){let[t,r]=(0,a.useState)(!1),{addToast:s}=(0,e3.d)(),n=(0,a.useRef)(s);n.current=s;let i=(0,a.useRef)(null),l=(0,a.useRef)(null),o=(0,a.useCallback)(()=>{if(!e)return;let t=new EventSource("/api/proxy/events/stream");for(let e of(i.current=t,t.onopen=()=>{r(!0),el.f.setConnected(!0)},["deploy:status","node:status","command:status","alert:fired"]))t.addEventListener(e,t=>{try{let a=JSON.parse(t.data),r=function(e){let t=e.type??"",a=e.nodeName??"Unknown";switch(t){case"deploy.started":return{title:`Deploying to ${a}`,severity:"info"};case"deploy.completed":return{title:`Deploy complete: ${a}`,severity:"success"};case"deploy.failed":return{title:`Deploy failed: ${a}`,message:e.message??void 0,severity:"error"};case"upgrade.started":return{title:`Upgrading ${a}`,severity:"info"};case"upgrade.completed":return{title:`Upgrade complete: ${a}`,message:`v${e.version}`,severity:"success"};case"upgrade.failed":return{title:`Upgrade failed: ${a}`,message:e.message??void 0,severity:"error"};case"node.recovered":return{title:`${a} back online`,message:`Recovered from ${e.previousStatus}`,severity:"success"};case"command.completed":return{title:"Command completed",message:`${e.command}`,severity:"success"};case"command.failed":return{title:"Command failed",message:`${e.command} (exit ${e.exitCode})`,severity:"error"};case"health.alert":return{title:`Alert: ${e.metric?.replaceAll("_"," ").toUpperCase()} on ${a}`,message:`${e.value?.toFixed(1)}% (threshold: ${e.threshold}%)`,severity:e.severity??"warning"};default:return null}}(a);r&&n.current(r),el.f.push(r?{...r,channel:e}:{title:String(a.type??e).replaceAll("."," "),message:"string"==typeof a.nodeName?a.nodeName:void 0,severity:"info",channel:e})}catch{}});return t.onerror=()=>{r(!1),el.f.setConnected(!1),t.close(),fetch("/api/auth/me",{cache:"no-store"}).then(e=>{if(i.current===t){if(401===e.status)return void window.location.replace("/login");l.current=setTimeout(o,5e3)}}).catch(()=>{i.current===t&&(l.current=setTimeout(o,5e3))})},t},[e]);(0,a.useEffect)(()=>{let e=o();return()=>{l.current&&clearTimeout(l.current),e?.close(),i.current?.close(),el.f.setConnected(!1),i.current=null}},[o])}({enabled:!i}),(0,a.useEffect)(()=>{o(!1)},[n]);let c=(0,a.useCallback)(()=>o(e=>!e),[]);return i?(0,t.jsx)(t.Fragment,{children:e}):(0,t.jsxs)("div",{className:"flex h-screen overflow-hidden",children:[l&&(0,t.jsx)("div",{className:"fixed inset-0 z-40 bg-black/70 backdrop-blur-[2px] md:hidden",onClick:()=>o(!1)}),(0,t.jsx)("div",{className:`
|
|
2
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
|
${l?"translate-x-0":"-translate-x-full"}
|
|
4
4
|
`,children:(0,t.jsx)(eu,{integrations:s})}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,t.jsx)(ez,{onMenuToggle:c}),(0,t.jsxs)("main",{className:"app-backdrop relative flex-1 overflow-y-auto p-3 md:p-6",children:[(0,t.jsx)(e5,{}),e]})]}),(0,t.jsx)(eQ,{})]})}],40073)},52928,e=>{"use strict";var t=e.i(43476),a=e.i(71645),r=e.i(53138),s=e.i(51757),n=e.i(10818),i=e.i(63676),l=e.i(83967);let o=(0,a.createContext)(null),c=0,d={info:{bar:"bg-primary",border:"border-primary/40",text:"text-primary",glow:"shadow-[0_0_20px_var(--color-glow)]",Icon:n.f},success:{bar:"bg-success",border:"border-success/40",text:"text-success",glow:"shadow-[0_0_20px_var(--color-glow-success)]",Icon:s.f},warning:{bar:"bg-warning",border:"border-warning/40",text:"text-warning",glow:"shadow-[0_0_20px_var(--color-glow-warning)]",Icon:r.f},error:{bar:"bg-danger",border:"border-danger/40",text:"text-danger",glow:"shadow-[0_0_20px_var(--color-glow-danger)]",Icon:l.f}};function m({toasts:e,onRemove:a}){return 0===e.length?null:(0,t.jsx)("div",{role:"status","aria-live":"polite",className:"fixed bottom-4 right-4 z-(--z-toast) flex max-w-sm flex-col gap-2",children:e.map(e=>{let r=d[e.severity],s=r.Icon;return(0,t.jsxs)("div",{className:`relative overflow-hidden rounded-panel border ${r.border} ${r.glow} bg-surface/95 py-3 pl-4 pr-3 text-text backdrop-blur-sm animate-toast-in`,children:[(0,t.jsx)("span",{"aria-hidden":"true",className:`absolute inset-y-0 left-0 w-0.5 ${r.bar}`}),(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)(s,{className:`mt-0.5 h-4 w-4 shrink-0 ${r.text}`,"aria-hidden":"true"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:`text-xs font-bold uppercase leading-tight tracking-wider ${r.text}`,children:e.title}),e.message&&(0,t.jsx)("p",{className:"mt-1 line-clamp-2 text-[11px] text-text-muted",children:e.message})]}),(0,t.jsx)("button",{onClick:()=>a(e.id),"aria-label":"Dismiss notification",className:"ml-2 shrink-0 text-text-muted transition-colors hover:text-text",children:(0,t.jsx)(i.X,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("span",{"aria-hidden":"true",className:`absolute bottom-0 left-0 h-px w-full origin-left opacity-60 ${r.bar}`,style:{animation:`toast-progress ${"error"===e.severity?10:6}s linear forwards`}})]},e.id)})})}e.s(["N",0,function({children:e}){let[r,s]=(0,a.useState)([]),n=(0,a.useCallback)(e=>{s(t=>t.filter(t=>t.id!==e))},[]),i=(0,a.useCallback)(e=>{let t=`toast-${++c}`,a={...e,id:t,createdAt:Date.now()};s(e=>[...e.slice(-9),a]),setTimeout(()=>n(t),"error"===e.severity?1e4:6e3)},[n]);return(0,t.jsxs)(o.Provider,{value:{toasts:r,addToast:i,removeToast:n},children:[e,(0,t.jsx)(m,{toasts:r,onRemove:n})]})},"d",0,function(){let e=(0,a.useContext)(o);if(!e)throw Error("useToast must be used within a ToastProvider");return e}])}]);
|