@hivemagnus/magnus-ui 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/dist/app/apps/dashboard/.next/BUILD_ID +1 -1
  2. package/dist/app/apps/dashboard/.next/build-manifest.json +3 -3
  3. package/dist/app/apps/dashboard/.next/prerender-manifest.json +3 -3
  4. package/dist/app/apps/dashboard/.next/required-server-files.json +2 -2
  5. package/dist/app/apps/dashboard/.next/server/app/_global-error.html +1 -1
  6. package/dist/app/apps/dashboard/.next/server/app/_global-error.rsc +1 -1
  7. package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  8. package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  10. package/dist/app/apps/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -1
  11. package/dist/app/apps/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page.js.nft.json +1 -1
  13. package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page_client-reference-manifest.js +1 -1
  14. package/dist/app/apps/dashboard/.next/server/app/anomalies/page.js.nft.json +1 -1
  15. package/dist/app/apps/dashboard/.next/server/app/anomalies/page_client-reference-manifest.js +1 -1
  16. package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page.js.nft.json +1 -1
  17. package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page_client-reference-manifest.js +1 -1
  18. package/dist/app/apps/dashboard/.next/server/app/api-docs/page.js.nft.json +1 -1
  19. package/dist/app/apps/dashboard/.next/server/app/api-docs/page_client-reference-manifest.js +1 -1
  20. package/dist/app/apps/dashboard/.next/server/app/application-operations/page.js.nft.json +1 -1
  21. package/dist/app/apps/dashboard/.next/server/app/application-operations/page_client-reference-manifest.js +1 -1
  22. package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page.js.nft.json +1 -1
  23. package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page_client-reference-manifest.js +1 -1
  24. package/dist/app/apps/dashboard/.next/server/app/ardent/page.js.nft.json +1 -1
  25. package/dist/app/apps/dashboard/.next/server/app/ardent/page_client-reference-manifest.js +1 -1
  26. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page.js.nft.json +1 -1
  27. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page_client-reference-manifest.js +1 -1
  28. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page.js.nft.json +1 -1
  29. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page_client-reference-manifest.js +1 -1
  30. package/dist/app/apps/dashboard/.next/server/app/audit/page.js.nft.json +1 -1
  31. package/dist/app/apps/dashboard/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  32. package/dist/app/apps/dashboard/.next/server/app/codex/installations/page.js.nft.json +1 -1
  33. package/dist/app/apps/dashboard/.next/server/app/codex/installations/page_client-reference-manifest.js +1 -1
  34. package/dist/app/apps/dashboard/.next/server/app/codex/page.js.nft.json +1 -1
  35. package/dist/app/apps/dashboard/.next/server/app/codex/page_client-reference-manifest.js +1 -1
  36. package/dist/app/apps/dashboard/.next/server/app/commands/page.js.nft.json +1 -1
  37. package/dist/app/apps/dashboard/.next/server/app/commands/page_client-reference-manifest.js +1 -1
  38. package/dist/app/apps/dashboard/.next/server/app/cron/page/server-reference-manifest.json +1 -1
  39. package/dist/app/apps/dashboard/.next/server/app/cron/page.js.nft.json +1 -1
  40. package/dist/app/apps/dashboard/.next/server/app/cron/page_client-reference-manifest.js +1 -1
  41. package/dist/app/apps/dashboard/.next/server/app/files/page.js.nft.json +1 -1
  42. package/dist/app/apps/dashboard/.next/server/app/files/page_client-reference-manifest.js +1 -1
  43. package/dist/app/apps/dashboard/.next/server/app/fleet-map/page.js.nft.json +1 -1
  44. package/dist/app/apps/dashboard/.next/server/app/fleet-map/page_client-reference-manifest.js +1 -1
  45. package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page.js.nft.json +1 -1
  46. package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page_client-reference-manifest.js +1 -1
  47. package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page.js.nft.json +1 -1
  48. package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page_client-reference-manifest.js +1 -1
  49. package/dist/app/apps/dashboard/.next/server/app/governor/operations/page.js.nft.json +1 -1
  50. package/dist/app/apps/dashboard/.next/server/app/governor/operations/page_client-reference-manifest.js +1 -1
  51. package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page.js.nft.json +1 -1
  52. package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page_client-reference-manifest.js +1 -1
  53. package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page.js.nft.json +1 -1
  54. package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page_client-reference-manifest.js +1 -1
  55. package/dist/app/apps/dashboard/.next/server/app/hermes-security/page.js.nft.json +1 -1
  56. package/dist/app/apps/dashboard/.next/server/app/hermes-security/page_client-reference-manifest.js +1 -1
  57. package/dist/app/apps/dashboard/.next/server/app/incidents/page.js.nft.json +1 -1
  58. package/dist/app/apps/dashboard/.next/server/app/incidents/page_client-reference-manifest.js +1 -1
  59. package/dist/app/apps/dashboard/.next/server/app/library/page.js.nft.json +1 -1
  60. package/dist/app/apps/dashboard/.next/server/app/library/page_client-reference-manifest.js +1 -1
  61. package/dist/app/apps/dashboard/.next/server/app/login/page.js.nft.json +1 -1
  62. package/dist/app/apps/dashboard/.next/server/app/login/page_client-reference-manifest.js +1 -1
  63. package/dist/app/apps/dashboard/.next/server/app/logs/page.js.nft.json +1 -1
  64. package/dist/app/apps/dashboard/.next/server/app/logs/page_client-reference-manifest.js +1 -1
  65. package/dist/app/apps/dashboard/.next/server/app/mission-control/page.js.nft.json +1 -1
  66. package/dist/app/apps/dashboard/.next/server/app/mission-control/page_client-reference-manifest.js +1 -1
  67. package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page.js.nft.json +1 -1
  68. package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page_client-reference-manifest.js +1 -1
  69. package/dist/app/apps/dashboard/.next/server/app/nodes/page.js.nft.json +1 -1
  70. package/dist/app/apps/dashboard/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
  71. package/dist/app/apps/dashboard/.next/server/app/notifications/page.js.nft.json +1 -1
  72. package/dist/app/apps/dashboard/.next/server/app/notifications/page_client-reference-manifest.js +1 -1
  73. package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page.js.nft.json +1 -1
  74. package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page_client-reference-manifest.js +1 -1
  75. package/dist/app/apps/dashboard/.next/server/app/orchestra/page.js.nft.json +1 -1
  76. package/dist/app/apps/dashboard/.next/server/app/orchestra/page_client-reference-manifest.js +1 -1
  77. package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page.js.nft.json +1 -1
  78. package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page_client-reference-manifest.js +1 -1
  79. package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page.js.nft.json +1 -1
  80. package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page_client-reference-manifest.js +1 -1
  81. package/dist/app/apps/dashboard/.next/server/app/page.js.nft.json +1 -1
  82. package/dist/app/apps/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
  83. package/dist/app/apps/dashboard/.next/server/app/retention/page.js.nft.json +1 -1
  84. package/dist/app/apps/dashboard/.next/server/app/retention/page_client-reference-manifest.js +1 -1
  85. package/dist/app/apps/dashboard/.next/server/app/roles/page.js.nft.json +1 -1
  86. package/dist/app/apps/dashboard/.next/server/app/roles/page_client-reference-manifest.js +1 -1
  87. package/dist/app/apps/dashboard/.next/server/app/rollouts/page.js.nft.json +1 -1
  88. package/dist/app/apps/dashboard/.next/server/app/rollouts/page_client-reference-manifest.js +1 -1
  89. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page.js.nft.json +1 -1
  90. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page_client-reference-manifest.js +1 -1
  91. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page.js.nft.json +1 -1
  92. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page_client-reference-manifest.js +1 -1
  93. package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page.js.nft.json +1 -1
  94. package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page_client-reference-manifest.js +1 -1
  95. package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page.js.nft.json +1 -1
  96. package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page_client-reference-manifest.js +1 -1
  97. package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page.js.nft.json +1 -1
  98. package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page_client-reference-manifest.js +1 -1
  99. package/dist/app/apps/dashboard/.next/server/app/security-fusion/page.js.nft.json +1 -1
  100. package/dist/app/apps/dashboard/.next/server/app/security-fusion/page_client-reference-manifest.js +1 -1
  101. package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page.js.nft.json +1 -1
  102. package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page_client-reference-manifest.js +1 -1
  103. package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page.js.nft.json +1 -1
  104. package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page_client-reference-manifest.js +1 -1
  105. package/dist/app/apps/dashboard/.next/server/app/skills/page/server-reference-manifest.json +1 -1
  106. package/dist/app/apps/dashboard/.next/server/app/skills/page.js.nft.json +1 -1
  107. package/dist/app/apps/dashboard/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  108. package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page.js.nft.json +1 -1
  109. package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page_client-reference-manifest.js +1 -1
  110. package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page.js.nft.json +1 -1
  111. package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page_client-reference-manifest.js +1 -1
  112. package/dist/app/apps/dashboard/.next/server/app/webhooks/page.js.nft.json +1 -1
  113. package/dist/app/apps/dashboard/.next/server/app/webhooks/page_client-reference-manifest.js +1 -1
  114. package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__08sgyyf_y8ab8._.js +1 -1
  115. package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__11pe-l2-ko65_._.js +1 -1
  116. package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__1xjrbdi2jn6ud._.js +1 -1
  117. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_0gs_s688kgg1i._.js +1 -1
  118. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_cron_page_tsx_1i3duyygc0_tg._.js +1 -1
  119. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_nodes_[nodeId]_page_tsx_1q7fqu18oklzc._.js +1 -1
  120. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_nodes_nodes-client_tsx_0pt4iarhpqbgn._.js +1 -1
  121. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_skills_page_tsx_0n5zp4xad38in._.js +1 -1
  122. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_lib_api-client_ts_0tho-kkk5ez7h._.js +1 -1
  123. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{node_modules_@xterm_1wjdgthvv3w9h._.js → node_modules_@xterm_0b-c6-qudh_kd._.js} +1 -1
  124. package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_refresh-ccw-dot_mjs_0v31ayeyeyyf8._.js +1 -1
  125. package/dist/app/apps/dashboard/.next/server/middleware-build-manifest.js +3 -3
  126. package/dist/app/apps/dashboard/.next/server/pages/500.html +1 -1
  127. package/dist/app/apps/dashboard/.next/server/preview-props.json +3 -3
  128. package/dist/app/apps/dashboard/.next/server/server-reference-manifest.js +1 -1
  129. package/dist/app/apps/dashboard/.next/server/server-reference-manifest.json +3 -3
  130. package/dist/app/apps/dashboard/.next/static/chunks/0a3qf_gj8th4c.js +1 -0
  131. package/dist/app/apps/dashboard/.next/static/chunks/{3vb0dg3il6-rb.js → 2yfl6coqli4y3.js} +2 -2
  132. package/dist/app/apps/dashboard/.next/static/chunks/{1v4hz3-8oktml.js → 2ysc_m5pnuadd.js} +1 -1
  133. package/dist/app/apps/dashboard/.next/static/chunks/3kbm-1q4uj4zs.js +15 -0
  134. package/dist/app/apps/dashboard/.next/static/chunks/{0lt-ikcy1lvod.js → 3kwz1ugids2ek.js} +1 -1
  135. package/dist/app/apps/dashboard/.next/static/chunks/{26rmh4jb1a3nq.js → 3ov5prjb4ltwe.js} +1 -1
  136. package/dist/app/apps/dashboard/.next/static/chunks/{1u_ran46erfqh.js → 3r533x_m9xzjf.js} +1 -1
  137. package/dist/app/apps/dashboard/.next/static/chunks/{260f1oy-xd4cg.js → 42j8jklku-x6g.js} +1 -1
  138. package/dist/app/apps/dashboard/package.json +2 -2
  139. package/dist/app/apps/dashboard/server.js +1 -1
  140. package/package.json +2 -2
  141. package/dist/app/apps/dashboard/.next/static/chunks/0qfvdc54-_wls.js +0 -15
  142. package/dist/app/apps/dashboard/.next/static/chunks/3q0oq5yy3hszn.js +0 -1
  143. /package/dist/app/apps/dashboard/.next/static/{RJzcgsvLiZvGVu7o2g_Hd → zDewzwaaY08Lyq4IF1Bft}/_buildManifest.js +0 -0
  144. /package/dist/app/apps/dashboard/.next/static/{RJzcgsvLiZvGVu7o2g_Hd → zDewzwaaY08Lyq4IF1Bft}/_clientMiddlewareManifest.js +0 -0
  145. /package/dist/app/apps/dashboard/.next/static/{RJzcgsvLiZvGVu7o2g_Hd → zDewzwaaY08Lyq4IF1Bft}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,5525,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(18566),n=e.i(93999),r=e.i(3062),i=e.i(54149),l=e.i(51196),d=e.i(75723),c=e.i(2067),o=e.i(65369),m=e.i(56420);let x={name:"chart-line",size:24,node:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],aliases:["line-chart"]};x.node;let u=(0,m.f)(x);var p=e.i(82983),h=e.i(78571),g=e.i(21176);let f=["1h","6h","24h"];function j({nodeId:e,height:a=180}){let[n,r]=(0,s.useState)("1h"),[i,l]=(0,s.useState)(null),[d,o]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let t=!1;o(!1);let s=async()=>{try{let[s,a]=await Promise.all([p.f.get(`nodes/${e}/health/timeseries?metric=cpu&period=${n}`),p.f.get(`nodes/${e}/health/timeseries?metric=memory&period=${n}`)]);if(t)return;let r=s.data??{timestamps:[],values:[]},i=a.data??{timestamps:[],values:[]},d=new Map;r.timestamps.forEach((e,t)=>{let s=Date.parse(e);d.set(s,{t:s,cpu:r.values[t]??null,mem:null})}),i.timestamps.forEach((e,t)=>{let s=Date.parse(e),a=d.get(s)??{t:s,cpu:null,mem:null};a.mem=i.values[t]??null,d.set(s,a)}),l([...d.values()].sort((e,t)=>e.t-t.t))}catch{t||(l([]),o(!0))}};s();let a=setInterval(()=>void s(),6e4);return()=>{t=!0,clearInterval(a)}},[e,n]),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col","data-testid":"node-metrics-chart",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-text-muted",children:"CPU / memory history"}),(0,t.jsx)("div",{role:"group","aria-label":"History period",className:"flex rounded-chip border border-border bg-bg p-0.5",children:f.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>r(e),"aria-pressed":n===e,className:(0,h.f)("rounded-chip px-2 py-0.5 text-[10px] uppercase tracking-wider transition-colors",n===e?"bg-primary/15 text-primary shadow-[0_0_8px_var(--color-glow)]":"text-text-muted hover:text-text"),children:e},e))})]}),null===i?(0,t.jsx)("div",{className:"skeleton w-full",style:{height:a}}):i.length<2?(0,t.jsx)(c.f,{compact:!0,icon:(0,t.jsx)(u,{className:"h-4 w-4"}),title:d?"History unavailable":"Not enough samples yet",description:d?"The health timeseries endpoint did not answer.":`No health snapshots in the last ${n}.`,tone:d?"warning":"muted",className:"flex-1"}):(0,t.jsx)(g.f,{data:i,xKey:"t",percent:!0,height:a,formatX:e=>new Date(Number(e)).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),series:[{key:"cpu",label:"CPU",tone:"primary"},{key:"mem",label:"Memory",tone:"accent"}]})]})}var N=e.i(95925);let v={name:"shield-off",size:24,node:[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]};v.node;let y=(0,m.f)(v);var b=e.i(46670);function w({metadata:e}){let s=function(e){let t=e;if("string"==typeof e)try{t=JSON.parse(e)}catch{return}return t?.agentSelfUpgrade}(e);return s?s.upgrade?.state==="reverted"?(0,t.jsx)("span",{title:s.upgrade.reason??void 0,children:(0,t.jsxs)(b.t,{variant:"danger",children:[(0,t.jsx)(N.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade to ",s.upgrade.to," reverted"]})}):s.upgrade?.state==="failed"?(0,t.jsx)("span",{title:s.upgrade.reason??void 0,children:(0,t.jsxs)(b.t,{variant:"danger",children:[(0,t.jsx)(N.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade to ",s.upgrade.to," failed"]})}):s.enabled?null:(0,t.jsx)("span",{title:s.reason??void 0,"data-testid":"agent-self-upgrade-off",children:(0,t.jsxs)(b.t,{variant:"default",children:[(0,t.jsx)(y,{className:"mr-1 inline h-3 w-3"}),"Self-upgrade off"]})}):null}var k=e.i(57108),S=e.i(68759),$=e.i(32568),C=e.i(71417),A=e.i(15281),P=e.i(59659),U=e.i(9347),I=e.i(25398),_=e.i(99847),E=e.i(32781),M=e.i(82022),D=e.i(84026),F=e.i(71567),R=e.i(94371),O=e.i(20851),L=e.i(66595);let z={name:"mouse-pointer-click",size:24,node:[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]};z.node;let T=(0,m.f)(z);var H=e.i(86207),B=e.i(57665),q=e.i(41220),K=e.i(14098),G=e.i(4139),J=e.i(41120),V=e.i(82954),W=e.i(79432),Q=e.i(62368),Z=e.i(53138),X=e.i(51757),Y=e.i(83967),ee=e.i(74544);let et=[{id:"apt-update",label:"apt update",command:"sudo",args:["apt","update"],icon:(0,t.jsx)(Q.f,{className:"h-3.5 w-3.5"}),variant:"secondary",timeoutSeconds:120},{id:"apt-upgrade",label:"apt upgrade",command:"sudo",args:["apt","upgrade","-y"],icon:(0,t.jsx)(J.f,{className:"h-3.5 w-3.5"}),variant:"secondary",confirm:"This will upgrade all packages on the node. Continue?",timeoutSeconds:300},{id:"magnus-status",label:"magnus status",command:"systemctl",args:["status","magnus-agent","--no-pager"],icon:(0,t.jsx)(W.f,{className:"h-3.5 w-3.5"}),variant:"primary",timeoutSeconds:15},{id:"magnus-update",label:"magnus update",command:"sudo",args:["systemctl","restart","magnus-agent"],icon:(0,t.jsx)(V.f,{className:"h-3.5 w-3.5"}),variant:"secondary",confirm:"This will restart the Magnus agent. Continue?",timeoutSeconds:30},{id:"dmesg",label:"dmesg",command:"sudo",args:["dmesg","--time-format=reltime","-T"],icon:(0,t.jsx)(Z.f,{className:"h-3.5 w-3.5"}),variant:"secondary",timeoutSeconds:15},{id:"reboot",label:"Reboot",command:"sudo",args:["reboot"],icon:(0,t.jsx)(B.f,{className:"h-3.5 w-3.5"}),variant:"danger",confirm:"Are you sure you want to REBOOT this node? It will go offline temporarily.",timeoutSeconds:10}];function es({nodeId:e,nodeStatus:a}){let[n,r]=(0,s.useState)(!1),[i,l]=(0,s.useState)(!1),[d,c]=(0,s.useState)(null),[o,m]=(0,s.useState)(null),[x,u]=(0,s.useState)(null),h="ONLINE"!==a,g=async t=>{if(!t.confirm||confirm(t.confirm)){c(t),m(null),u(null),l(!0),r(!0);try{let s=await p.f.quickCommand.exec(e,{command:t.command,args:t.args,timeoutSeconds:t.timeoutSeconds});m(s.data)}catch(e){u(e instanceof Error?e.message:"Command execution failed")}finally{l(!1)}}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"rounded border border-border bg-surface p-3",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-text-muted mr-2",children:[(0,t.jsx)(G.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"font-bold uppercase tracking-wider",children:"Quick Commands"})]}),et.map(e=>(0,t.jsx)(S.K,{variant:e.variant,size:"sm",icon:e.icon,disabled:h,onClick:()=>void g(e),children:e.label},e.id)),h&&(0,t.jsx)("span",{className:"ml-2 text-xs text-text-muted",children:"Node must be ONLINE to run commands"})]})}),(0,t.jsx)($.n,{open:n,onClose:()=>r(!1),title:d?.label??"Command",description:d?`${d.command} ${(d.args??[]).join(" ")}`:void 0,icon:(0,t.jsx)(G.f,{className:"h-5 w-5 text-primary"}),className:"max-w-3xl",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(E.f,{className:"h-4 w-4 animate-spin text-primary"}),(0,t.jsx)("span",{className:"text-xs text-primary",children:"Executing…"})]}):x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Y.f,{className:"h-4 w-4 text-danger"}),(0,t.jsx)("span",{className:"text-xs text-danger",children:"Error"})]}):o?(0,t.jsxs)(t.Fragment,{children:[0===o.exitCode?(0,t.jsx)(X.f,{className:"h-4 w-4 text-success"}):(0,t.jsx)(Y.f,{className:"h-4 w-4 text-danger"}),(0,t.jsxs)("span",{className:`text-xs ${0===o.exitCode?"text-success":"text-danger"}`,children:["Exit code: ",o.exitCode]}),(0,t.jsxs)("span",{className:"text-xs text-text-muted flex items-center gap-1 ml-auto",children:[(0,t.jsx)(ee.f,{className:"h-3 w-3"}),(o.durationMs/1e3).toFixed(2),"s"]})]}):null}),x&&(0,t.jsx)("div",{className:"rounded bg-danger/10 border border-danger/30 p-3",children:(0,t.jsx)("p",{className:"text-xs text-danger",children:x})}),o&&(0,t.jsxs)("div",{className:"space-y-3",children:[o.stdout&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[11px] font-bold uppercase tracking-wider text-text-muted mb-1",children:"stdout"}),(0,t.jsx)("pre",{className:"max-h-80 overflow-auto rounded bg-bg border border-border p-3 text-xs text-success whitespace-pre-wrap",children:o.stdout})]}),o.stderr&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[11px] font-bold uppercase tracking-wider text-text-muted mb-1",children:"stderr"}),(0,t.jsx)("pre",{className:"max-h-40 overflow-auto rounded bg-bg border border-danger/20 p-3 text-xs text-danger whitespace-pre-wrap",children:o.stderr})]}),!o.stdout&&!o.stderr&&(0,t.jsx)("p",{className:"text-xs text-text-muted italic",children:"No output captured"}),o.truncated&&(0,t.jsx)("p",{className:"text-xs text-warning",children:"⚠ Output was truncated (exceeded 1MB)"})]}),i&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)(E.f,{className:"h-8 w-8 animate-spin text-primary mx-auto mb-2"}),(0,t.jsx)("p",{className:"text-xs text-text-muted",children:"Executing command on remote node…"})]})}),(0,t.jsx)("div",{className:"flex justify-end pt-2",children:(0,t.jsx)(S.K,{variant:"ghost",size:"sm",onClick:()=>r(!1),children:"Close"})})]})})]})}var ea=e.i(55427),en=e.i(28623);let er={workhorse:{name:"Workhorse",emoji:"🐴",description:"Steady, reliable, never complains.",accent:"success"},"drama-queen":{name:"Drama Queen",emoji:"🎭",description:"High variance, loves spiking CPU for attention.",accent:"warning"},"zen-master":{name:"Zen Master",emoji:"🧘",description:"Low usage, mind always clear, never stressed.",accent:"info"},sprinter:{name:"Sprinter",emoji:"⚡",description:"Bursts of intense activity followed by calm recovery.",accent:"info"},groundhog:{name:"Groundhog",emoji:"🌀",description:"Keeps rebooting — might see its own shadow again.",accent:"warning"},ghost:{name:"Ghost",emoji:"👻",description:"Often unreachable. Is it even there?",accent:"danger"},marathoner:{name:"Marathoner",emoji:"🏃",description:"Long uptime, steady pace, built to last.",accent:"success"},rookie:{name:"Rookie",emoji:"🌱",description:"Not enough history yet — still finding its rhythm.",accent:"default"}};function ei(e){return 0===e.length?0:e.reduce((e,t)=>e+t,0)/e.length}function el({node:e}){let[a,r]=(0,s.useState)([]),[i,l]=(0,s.useState)(!0),[d,c]=(0,s.useState)(null),[o,m]=(0,s.useState)(0);(0,s.useEffect)(()=>{let t=!1;return(async()=>{l(!0),c(null);try{let s=await p.f.get(`nodes/${e.id}/health/history?limit=100`);if(t)return;let a=s.data,n=[];Array.isArray(a)?n=a:a?.items&&(n=a.items),r([...n].reverse())}catch(e){t||(r([]),c(e instanceof Error?e.message:"Failed to load history"))}finally{t||l(!1)}})(),()=>{t=!0}},[e.id,o]);let x=(0,s.useMemo)(()=>{let t,s,n,r,i,l,d,c,o;return t=a.map(e=>e.cpuUsagePercent).filter(e=>Number.isFinite(e)),s=a.map(e=>e.memoryPercent).filter(e=>Number.isFinite(e)),n=ei(t),r=function(e){if(e.length<2)return 0;let t=ei(e);return Math.sqrt(e.reduce((e,s)=>e+(s-t)*(s-t),0)/(e.length-1))}(t),i=ei(s),l=t.filter(e=>e>80).length,d="rookie",c=er[d="OFFLINE"===e.status||e.lastHeartbeatAt&&Date.now()-new Date(e.lastHeartbeatAt).getTime()>6e5?"ghost":a.length<3?"rookie":r>25||l/Math.max(1,t.length)>.25?l/Math.max(1,t.length)>.4?"drama-queen":"sprinter":n<15&&r<10?"zen-master":n>40&&n<75&&r<15?"workhorse":n<40&&r<15&&a.length>20?"marathoner":"workhorse"]??er.rookie??{name:"Rookie",emoji:"🌱",description:"",accent:"default"},o=function(e,t,s){var a;let n,r=Math.floor(Date.now()/6048e5);for(let t=0;t<e.id.length;t++)r=31*r+e.id.charCodeAt(t)|0;let i={workhorse:[`Steady as they come — averaging ${s.cpuAvg.toFixed(0)}% CPU without a single complaint this week.`,`The dependable one. ${e.hostname} just keeps grinding through the workload.`,`Quietly productive at ~${s.cpuAvg.toFixed(0)}% CPU. Gets the job done and asks for nothing.`],"drama-queen":[`Lives for the spotlight — ${s.spikes} CPU spikes this week and counting.`,`${e.hostname} likes to keep things interesting with a \xb1${s.cpuSD.toFixed(0)}% swing.`,"A connoisseur of chaos. Never a dull moment with this one."],"zen-master":[`Practices minimalism. Barely breaks a sweat at ${s.cpuAvg.toFixed(0)}% CPU.`,`${e.hostname} is in its happy place — calm, cool, collected.`,"Achieving enlightenment one idle cycle at a time."],sprinter:[`Bursts of energy, then recovery. ${s.spikes} sprints logged this week.`,`${e.hostname} runs hot, then cools down. Classic sprinter cadence.`,"Lives in intervals — full throttle, then full zen."],groundhog:["Déjà vu all over again. Might want to check the uptime.",`${e.hostname} keeps hitting the reset button.`],ghost:["Hasn't been seen in a while. Anyone home?",`${e.hostname} is currently out of contact. Check the heartbeat.`],marathoner:[`In it for the long haul — ${s.samples} data points of pure consistency.`,`${e.hostname} doesn't sprint. It endures.`],rookie:["Still new around here — gathering experience.",`${e.hostname} is just getting started. Check back soon.`]};return n=Math.abs(r)%(a=i[t.name.toLowerCase().replace(" ","-")]??i.rookie??["…"]).length,a[n]}(e,c,{cpuAvg:n,cpuSD:r,memAvg:i,samples:t.length,spikes:l}),{archetype:c,archetypeKey:d,bio:o,stats:{cpuAvg:n,cpuStdDev:r,memAvg:i,samples:t.length,spikes:l}}},[e,a]),u=a.map(e=>e.cpuUsagePercent).slice(-40),h=a.map(e=>e.memoryPercent).slice(-40);return(0,t.jsx)(n.N,{title:"Personality",action:(0,t.jsx)("button",{onClick:()=>m(e=>e+1),className:"text-text-muted hover:text-text transition p-1",title:"Refresh personality","data-testid":"node-personality-refresh",children:(0,t.jsx)(J.f,{className:"h-3.5 w-3.5"})}),children:(0,t.jsxs)("div",{className:"flex flex-col gap-4","data-testid":"node-personality-card","data-archetype":x.archetypeKey,children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"flex h-12 w-12 items-center justify-center rounded-full border border-accent/40 bg-bg text-2xl shadow-[0_0_16px_var(--color-glow-accent)]","aria-hidden":"true",children:x.archetype.emoji}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{"data-testid":"node-archetype-badge",children:(0,t.jsx)(b.t,{variant:x.archetype.accent,children:x.archetype.name})}),i&&(0,t.jsx)("span",{className:"text-xs text-text-muted italic",children:"analyzing…"})]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:x.archetype.description})]})]}),(0,t.jsx)(en.f,{className:"h-4 w-4 text-accent mt-1"})]}),(0,t.jsxs)("blockquote",{className:"border-l-2 border-accent/40 pl-3 text-sm italic text-text","data-testid":"node-personality-bio",children:["“",x.bio,"”"]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 pt-2 border-t border-border/30",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-xs uppercase tracking-wider text-text-muted",children:"CPU trend"}),(0,t.jsxs)("span",{className:"text-xs tabular-nums text-text-muted",children:["avg ",x.stats.cpuAvg.toFixed(0),"%"]})]}),(0,t.jsx)(ea.f,{values:u,tone:"primary",percent:!0,stretch:!0,threshold:80,testId:"node-personality-cpu-sparkline",label:`CPU trend, average ${x.stats.cpuAvg.toFixed(0)}%`})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-xs uppercase tracking-wider text-text-muted",children:"Memory trend"}),(0,t.jsxs)("span",{className:"text-xs tabular-nums text-text-muted",children:["avg ",x.stats.memAvg.toFixed(0),"%"]})]}),(0,t.jsx)(ea.f,{values:h,tone:"accent",percent:!0,stretch:!0,threshold:80,testId:"node-personality-mem-sparkline",label:`Memory trend, average ${x.stats.memAvg.toFixed(0)}%`})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 text-[11px] text-text-muted",children:[(0,t.jsxs)("span",{children:[x.stats.samples," samples"]}),(0,t.jsxs)("span",{children:["σ ",x.stats.cpuStdDev.toFixed(1),"%"]}),(0,t.jsxs)("span",{children:[x.stats.spikes," spikes"]}),d&&(0,t.jsxs)("span",{className:"text-warning",children:["· ",d]})]})]})})}let ed={name:"fan",size:24,node:[["path",{d:"M10.827 16.379a6.082 6.082 0 0 1-8.618-7.002l5.412 1.45a6.082 6.082 0 0 1 7.002-8.618l-1.45 5.412a6.082 6.082 0 0 1 8.618 7.002l-5.412-1.45a6.082 6.082 0 0 1-7.002 8.618l1.45-5.412Z",key:"484a7f"}],["path",{d:"M12 12v.01",key:"u5ubse"}]]};ed.node;let ec=(0,m.f)(ed);var eo=e.i(71028);let em={name:"thermometer",size:24,node:[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]};em.node;let ex=(0,m.f)(em);function eu(e,t){let s=e.map(e=>({timestamp:new Date(e.sampledAt).getTime(),value:t(e)})).filter(e=>null!==e.value);if(0===s.length)return"";let a=s[0].timestamp,n=Math.max(1,s.at(-1).timestamp-a);return s.map(({timestamp:e,value:t})=>{let s=104-.88*Math.max(0,Math.min(100,t));return`${((e-a)/n*600).toFixed(1)},${s.toFixed(1)}`}).join(" ")}function ep(e,t="%"){return null===e?"not reported":`${e.toFixed(1)}${t}`}function eh({telemetry:e}){let s=e?.latest??null,a=s?.devices??[],r=eu(e?.history??[],e=>e.maxUtilizationPercent),i=eu(e?.history??[],e=>e.maxFanPercent);return(0,t.jsx)(n.N,{title:"GPU telemetry",description:"30-second load and cooling history",action:s?(0,t.jsxs)(b.t,{variant:"default",children:["sampled ",(0,C.C)(s.sampledAt)]}):void 0,children:s&&0!==a.length?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:a.map(e=>(0,t.jsxs)("div",{className:"rounded-panel border border-border/70 bg-surface-raised/60 p-3 transition-colors hover:border-primary/30",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"truncate text-xs font-medium text-text",children:e.name}),(0,t.jsxs)("p",{className:"mt-0.5 text-[10px] uppercase tracking-wide text-text-muted",children:[e.vendor," · gpu ",e.index]})]}),100===e.fanPercent&&(0,t.jsx)(b.t,{variant:"danger",children:"fan saturated"})]}),(0,t.jsxs)("dl",{className:"mt-3 grid grid-cols-3 gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,t.jsx)(eo.f,{className:"h-3 w-3"}),"Load"]}),(0,t.jsx)("dd",{className:"mt-1 num text-sm text-primary",children:ep(e.utilizationPercent)})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,t.jsx)(ec,{className:"h-3 w-3"}),"Fan"]}),(0,t.jsx)("dd",{className:`mt-1 num text-sm ${100===e.fanPercent?"text-danger glow-text-danger":"text-warning"}`,children:ep(e.fanPercent)})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"flex items-center gap-1 text-[10px] uppercase text-text-muted",children:[(0,t.jsx)(ex,{className:"h-3 w-3"}),"Temp"]}),(0,t.jsx)("dd",{className:"mt-1 num text-sm text-text",children:ep(e.temperatureCelsius,"°C")})]})]}),(0,t.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,t.jsx)(l.f,{value:e.utilizationPercent,tone:"primary",label:`${e.name} load`}),(0,t.jsx)(l.f,{value:e.fanPercent,thresholds:{warn:80,crit:100},label:`${e.name} fan`})]})]},`${e.vendor}-${e.uuid??e.index}`))}),(0,t.jsxs)("div",{className:"panel-corners rounded-panel border border-border/70 bg-bg/60 p-3",children:[(0,t.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-[10px] font-medium uppercase tracking-[0.16em] text-text-muted",children:"Host maximum · last 24 hours"}),(0,t.jsxs)("div",{className:"flex items-center gap-3 text-[10px] text-text-muted",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"h-0.5 w-3 bg-primary shadow-[0_0_4px_var(--color-primary)]"}),"load"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"h-0.5 w-3 bg-warning"}),"fan"]})]})]}),(0,t.jsxs)("svg",{viewBox:"0 0 600 112",className:"h-28 w-full",role:"img","aria-label":"GPU load and fan percentage over the last 24 hours",children:[(0,t.jsx)("line",{x1:"0",y1:"16",x2:"600",y2:"16",stroke:"var(--color-danger)",strokeOpacity:"0.45",strokeDasharray:"5 5"}),(0,t.jsx)("line",{x1:"0",y1:"60",x2:"600",y2:"60",stroke:"currentColor",strokeOpacity:"0.12"}),(0,t.jsx)("line",{x1:"0",y1:"104",x2:"600",y2:"104",stroke:"currentColor",strokeOpacity:"0.2"}),(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:"gpu-load-fill",x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"var(--color-primary)",stopOpacity:"0.35"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"var(--color-primary)",stopOpacity:"0"})]})}),r&&(0,t.jsx)("polygon",{points:`0,104 ${r} 600,104`,fill:"url(#gpu-load-fill)"}),r&&(0,t.jsx)("polyline",{points:r,fill:"none",stroke:"var(--color-primary)",strokeWidth:"2",vectorEffect:"non-scaling-stroke"}),i&&(0,t.jsx)("polyline",{points:i,fill:"none",stroke:"var(--color-warning)",strokeWidth:"2",vectorEffect:"non-scaling-stroke"})]}),(0,t.jsxs)("div",{className:"mt-1 flex justify-between num text-[9px] text-text-muted",children:[(0,t.jsx)("span",{children:"24h ago"}),(0,t.jsx)("span",{children:"100% saturation line"}),(0,t.jsx)("span",{children:"now"})]})]})]}):(0,t.jsx)("div",{className:"rounded-panel border border-dashed border-border px-4 py-6 text-center text-xs text-text-muted",children:s?.status==="error"?"The GPU probe did not complete. Magnus will retry on the next heartbeat.":"No supported NVIDIA or AMD GPU was detected in the latest sample."})})}function eg(e){if("string"==typeof e)try{return JSON.parse(e)}catch{return[]}return e??[]}function ef(e){if(!e)return[];if("string"==typeof e)try{return JSON.parse(e)}catch{return[]}return e}function ej(e){return!!(e&&"not_installed"!==e.status)}function eN(e){let t=e.status.toLowerCase();return t.includes("enabled")&&!t.includes("not enabled")&&!t.includes("disabled")}function ev(e,t){let s=e.filter(eN).find(e=>{let s=`${e.slug} ${e.pluginType} ${e.metadata?.description??""}`.toLowerCase();return"search"===t?/\b(search|web)\b/.test(s):/\b(crawl|browser|firecrawl|browserbase|browser-use)\b/.test(s)});return s?`${s.slug}${s.version?` ${s.version}`:""}`:"none enabled"}e.s(["default",0,function(){var e,m;let x,u,h,g=(0,a.useParams)(),f=(0,a.useRouter)(),[N,v]=(0,s.useState)(null),[y,z]=(0,s.useState)(null),[G,J]=(0,s.useState)([]),[V,W]=(0,s.useState)(null),[Q,Z]=(0,s.useState)(!0),[X,Y]=(0,s.useState)(!1),[ee,et]=(0,s.useState)(!1),[ea,en]=(0,s.useState)([]),[er,ei]=(0,s.useState)({}),[ed,ec]=(0,s.useState)(null),[eo,em]=(0,s.useState)(!1),[ex,eu]=(0,s.useState)(null),[ep,eN]=(0,s.useState)(null),[ey,eb]=(0,s.useState)(null),[ew,ek]=(0,s.useState)(!1),[eS,e$]=(0,s.useState)(null),[eC,eA]=(0,s.useState)(!1),[eP,eU]=(0,s.useState)(!1),[eI,e_]=(0,s.useState)(null),[eE,eM]=(0,s.useState)(!1),[eD,eF]=(0,s.useState)(null),[eR,eO]=(0,s.useState)(null),[eL,ez]=(0,s.useState)(!1),eT=(0,s.useRef)(null),eH=(0,s.useRef)(void 0),eB=(0,s.useCallback)(async(e=!1)=>{try{e||Z(!0);let[t,s,a,n,r]=await Promise.all([p.f.nodes.get(g.nodeId),p.f.nodes.health(g.nodeId).catch(()=>null),p.f.nodes.forecast(g.nodeId).catch(()=>null),p.f.hermes.installations().catch(()=>null),p.f.nodes.gpu(g.nodeId).catch(()=>null)]),i=t.data;i.role||void 0===eH.current?i.role&&(eH.current=i.role):i.role=eH.current,v(i),s&&z(s.data),J(a?.data?.forecasts??[]),W(r?.data??null);let l=n?.data??[];ec(l.find(e=>e.nodeId===i.id)??l.find(e=>e.hostname===i.hostname||e.hostname===i.ipAddress)??null);try{let e=await p.f.roles.applications.list({nodeId:g.nodeId});en(e.data??[])}catch{}}catch{}finally{e||Z(!1)}},[g.nodeId]);(0,s.useEffect)(()=>{eB()},[eB]);let eq=async()=>{if(N&&confirm(`Deploy Hermes Agent to "${N.name}"?`)){eM(!0),eF(null),eO(null);try{let e,t=await p.f.hermes.deploy({nodeId:N.id,hermesHome:"~/.hermes",hermesBin:"hermes",installMethod:"official-script",dashboardPort:9119,enableDashboard:!0,enableDashboardTui:!0,startGateway:!0},(e="u">typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2),`hermes-node-deploy-${Date.now()}-${e}`));eF(`Hermes Agent deployment started. Job ${t.data?.id.slice(0,10)}...`),eB(!0)}catch(e){eO(e instanceof Error?e.message:"Hermes Agent deployment failed")}finally{eM(!1)}}};(0,s.useEffect)(()=>{let e=N?.status==="PROVISIONING"||N?.agent?.status==="UPDATING"||!!(eD&&!ej(ed));return e&&!eT.current?eT.current=setInterval(()=>{eB(!0)},4e3):!e&&eT.current&&(clearInterval(eT.current),eT.current=null),()=>{eT.current&&(clearInterval(eT.current),eT.current=null)}},[N?.status,N?.agent?.status,N?.agent?.version,eB,eD,ed]);let eK=async()=>{if(N&&confirm(`Delete node "${N.name}"? This will permanently remove it and all associated data.`))try{await p.f.nodes.delete(N.id),f.push("/nodes")}catch{}},eG=(0,s.useCallback)(async()=>{if(N?.status==="ONLINE"){em(!0),eu(null);try{let e='version_or_na() { local cmd="$1"; shift; if command -v "$cmd" >/dev/null 2>&1; then ("$@" 2>/dev/null || "$cmd" --version 2>/dev/null || "$cmd" -v 2>/dev/null || echo "unknown") | head -n 1; else echo "not installed"; fi; }; echo "node=$(version_or_na node node --version)"; echo "npm=$(version_or_na npm npm --version)"; echo "python3=$(version_or_na python3 python3 --version)"; echo "redis=$(version_or_na redis-cli redis-cli --version)"; echo "docker=$(version_or_na docker docker --version)"; echo "tailscale=$(version_or_na tailscale tailscale version)"; agent_manifest=/opt/magnus-agent/node_modules/@hivemagnus/magnus-agent/package.json; [ -f "$agent_manifest" ] || agent_manifest=/opt/magnus-agent/package.json; if [ -f "$agent_manifest" ]; then echo "magnus-agent=$(node -e \'process.stdout.write(require(process.argv[1]).version)\' "$agent_manifest" 2>/dev/null || echo unknown)"; else echo "magnus-agent=not installed"; fi'.replace(/'/g,"'\\''"),t=((await p.f.quickCommand.exec(N.id,{command:`bash -lc '${e}'`,args:[],timeoutSeconds:60})).data.stdout??"").trim(),s=Object.fromEntries(t.split("\n").map(e=>e.trim()).filter(e=>e.includes("=")).map(e=>{let[t,...s]=e.split("=");return[t,s.join("=").trim()||"unknown"]}));ei(s)}catch(e){eu(e instanceof Error?e.message:"Failed to load software revisions")}finally{em(!1)}}},[N?.id,N?.status]),eJ=(0,s.useCallback)(async()=>{if(N?.status==="ONLINE"){ek(!0),e$(null);try{let e="set -euo pipefail; (sudo apt-get update -qq || apt-get update -qq) >/dev/null 2>&1; apt list --upgradable 2>/dev/null | sed '1d' | sed '/^Listing/d' | wc -l".replace(/'/g,"'\\''"),t=((await p.f.quickCommand.exec(N.id,{command:`bash -lc '${e}'`,args:[],timeoutSeconds:180})).data.stdout??"").trim(),s=Number.parseInt(t.split("\n").at(-1)??"",10);eN(Number.isFinite(s)?s:null),eb(new Date().toISOString())}catch(e){e$(e instanceof Error?e.message:"Failed to refresh apt updates")}finally{ek(!1)}}},[N?.id,N?.status]),eV=async()=>{if(N&&confirm(`Run apt upgrade on "${N.name}"?`)){eA(!0);try{let e=`apt-upgrade-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,t=(await p.f.commands.dispatch({nodeIds:[N.id],command:"sudo",args:["apt","upgrade","-y"],timeoutSeconds:1800,idempotencyKey:e},e)).data,s=t.commands?.[0]?.id;alert(s?`APT Upgrade dispatched (command ${s.slice(0,12)}…). Check Commands for progress.`:"APT Upgrade dispatched. Check Commands for progress."),await eJ()}catch(e){alert(`APT Upgrade failed to dispatch: ${e instanceof Error?e.message:String(e)}`)}finally{eA(!1)}}},eW=async()=>{if(N&&confirm(`Enable unattended apt update and apt upgrade on "${N.name}"? Magnus will install unattended-upgrades and enable the apt timers.`)){eU(!0),e_(null);try{await p.f.nodes.enableSystemUpdates(N.id),await eB(!0)}catch(e){e_(e instanceof Error?e.message:"Failed to enable automatic updates")}finally{eU(!1)}}};if((0,s.useEffect)(()=>{eG(),eJ()},[eG,eJ]),(0,s.useEffect)(()=>{if(!N||"ONLINE"!==N.status)return;let e=setInterval(()=>{eJ()},36e5);return()=>clearInterval(e)},[N,eJ]),Q)return(0,t.jsxs)("div",{className:"space-y-6","aria-busy":"true",children:[(0,t.jsx)("div",{className:"skeleton h-56 w-full rounded-panel opacity-70"}),(0,t.jsx)(o.g,{}),(0,t.jsx)("span",{className:"sr-only",children:"Loading node details…"})]});if(!N)return(0,t.jsx)(c.f,{tone:"accent",icon:(0,t.jsx)(q.f,{className:"h-5 w-5"}),title:"Node not found",description:"It may have been decommissioned or belong to another control node.",action:(0,t.jsx)(S.K,{variant:"secondary",size:"sm",onClick:()=>f.push("/nodes"),children:"Back to nodes"}),className:"mt-12"});let eQ=ej(ed)?Array.isArray(ed.rawStatus?.skills)?ed.rawStatus.skills:[]:[],eZ=ej(ed)?Array.isArray(ed.rawStatus?.plugins)?ed.rawStatus.plugins:[]:[],eX=eQ.filter(e=>e.enabled),eY=ed?.configuration?.modelProvider??"unknown",e0=ed?.configuration?.modelName??"unknown",e1=ev(eZ,"search"),e2=ev(eZ,"crawl"),e3=function(e){if(!e)return null;try{let t="string"==typeof e?JSON.parse(e):e;if("boolean"!=typeof t.installed||!["active","inactive","failed","not_installed","unknown"].includes(t.serviceStatus)||!["enabled","disabled","static","unknown"].includes(t.enabled)||null!==t.version&&"string"!=typeof t.version||!Array.isArray(t.managerAddresses))return null;return t}catch{return null}}(y?.wazuh),e5=function(e){if(!e)return null;try{let t="string"==typeof e?JSON.parse(e):e;if("boolean"!=typeof t.supported||"string"!=typeof t.platform||!["enabled","disabled","partial","unsupported","unknown"].includes(t.automaticUpdates??"")||"boolean"!=typeof t.rebootRequired||!Array.isArray(t.timers)||!Array.isArray(t.rebootRequiredPackages))return null;return{...t,fullUpgradePolicyEnabled:!0===t.fullUpgradePolicyEnabled}}catch{return null}}(y?.systemUpdates);return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(r.f,{hero:!0,padding:"lg",tone:"ONLINE"===N.status?"primary":"OFFLINE"===N.status?"danger":"warning",testId:"node-cockpit",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,t.jsx)(S.K,{variant:"ghost",size:"sm",onClick:()=>f.push("/nodes"),"aria-label":"Back to nodes",children:(0,t.jsx)(U.f,{className:"h-4 w-4"})}),(0,t.jsx)(d.f,{status:N.status}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold text-primary glow-text-primary",children:N.name}),(0,t.jsxs)("p",{className:"num mt-1 truncate text-xs text-text-muted",children:[N.hostname,":",N.port,N.agent&&(0,t.jsxs)("span",{className:"ml-3 text-primary/70",children:["agent v",N.agent.version]}),y?.source&&(0,t.jsxs)("span",{className:"ml-3 uppercase tracking-wider",children:["source: ",y.source]})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(b.t,{variant:(0,b.k)(N.status),children:N.status}),N.agent?.status==="UPDATING"&&(0,t.jsxs)(b.t,{variant:"info",children:[(0,t.jsx)(E.f,{className:"h-3 w-3 animate-spin mr-1 inline"}),"Upgrading…"]}),(0,t.jsx)(w,{metadata:N.metadata}),(0,t.jsx)(S.K,{variant:"secondary",size:"sm",icon:(0,t.jsx)(A.f,{className:"h-3.5 w-3.5"}),onClick:()=>Y(!0),children:"Edit"}),(0,t.jsx)(S.K,{variant:"danger",size:"sm",icon:(0,t.jsx)(P.f,{className:"h-3.5 w-3.5"}),onClick:()=>void eK(),children:"Delete"})]})]}),(0,t.jsxs)("div",{className:"mt-6 grid gap-6 xl:grid-cols-[auto_minmax(0,1fr)]",children:[(0,t.jsxs)("div",{className:"flex flex-wrap justify-center gap-4 sm:justify-start",children:[(0,t.jsx)(i.f,{value:y?.cpuUsagePercent??null,label:"CPU Usage",size:128,testId:"node-gauge-cpu"}),(0,t.jsx)(i.f,{value:y?.memoryPercent??null,label:"Memory",size:128,sublabel:y?`${(0,C.L)(y.memoryUsedBytes)}`:void 0,testId:"node-gauge-memory"}),(h=(y?eg(y.disks):[]).reduce((e,t)=>!e||t.usagePercent>e.usagePercent?t:e,null),(0,t.jsx)(i.f,{value:h?.usagePercent??null,label:"Disk",size:128,thresholds:{warn:80,crit:90},sublabel:h?.mountPoint,testId:"node-gauge-disk"}))]}),(0,t.jsx)(j,{nodeId:N.id,height:170})]})]}),("DEGRADED"===N.status||N.agent?.status==="ERROR")&&(()=>{try{let e=JSON.parse(N.metadata),s="string"==typeof e.deployError?e.deployError:null,a="string"==typeof e.upgradeError?e.upgradeError:null,n=s??a;if(n)return(0,t.jsx)("div",{className:"rounded-panel border border-danger/40 bg-danger/5 p-4 shadow-[inset_3px_0_0_var(--color-danger),0_0_20px_var(--color-glow-danger)]",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(_.f,{className:"h-5 w-5 text-danger shrink-0 mt-0.5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-danger",children:s?"Deploy Failed":"Agent Upgrade Failed"}),(0,t.jsx)("pre",{className:"mt-1 text-xs text-text-muted whitespace-pre-wrap font-mono",children:n})]})]})})}catch{}return null})(),"PROVISIONING"===N.status&&(0,t.jsx)("div",{className:"rounded-panel border border-info/40 bg-info/5 p-4 shadow-[inset_3px_0_0_var(--color-info)]",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(E.f,{className:"h-5 w-5 text-info animate-spin"}),(0,t.jsx)("p",{className:"text-xs uppercase tracking-wider text-info",children:"Deploying agent… Status will update automatically."})]})}),N.agent?.status==="UPDATING"&&(0,t.jsx)("div",{className:"rounded-panel border border-info/40 bg-info/5 p-4 shadow-[inset_3px_0_0_var(--color-info)]",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(E.f,{className:"h-5 w-5 text-info animate-spin"}),(0,t.jsx)("p",{className:"text-xs uppercase tracking-wider text-info",children:"Agent upgrade in progress… Status will update automatically."})]})}),(0,t.jsx)(es,{nodeId:N.id,nodeStatus:N.status}),(0,t.jsx)(eh,{telemetry:V}),(0,t.jsx)(el,{node:{id:N.id,name:N.name,hostname:N.hostname,status:N.status,lastHeartbeatAt:N.lastHeartbeatAt}}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(n.N,{title:"Node Information",children:(0,t.jsxs)("dl",{className:"space-y-2 text-sm",children:[[["OS",N.os],["Architecture",N.arch],["Address",`${N.ipAddress}:${N.port}`],["Tags",(()=>{try{let e=JSON.parse(N.tags);return e.length?e.join(", "):"—"}catch{return"—"}})()]].map(([e,s])=>(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:e}),(0,t.jsx)("dd",{className:"font-medium",children:s})]},e)),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Agent Version"}),(0,t.jsx)("dd",{className:"font-medium flex items-center gap-1.5",children:N.agent?.version??"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Role"}),(0,t.jsx)("dd",{className:"font-medium",children:N.role?(0,t.jsxs)("button",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary hover:bg-primary/20 transition-colors cursor-pointer",onClick:()=>et(!0),title:"Change role",children:[(0,t.jsx)(D.f,{className:"h-3 w-3"}),N.role.name]}):(0,t.jsx)("button",{className:"text-xs text-text-muted hover:text-primary transition-colors cursor-pointer",onClick:()=>et(!0),children:"+ Assign Role"})})]}),[["Agent Status",N.agent?.status??"—"],["Last Heartbeat",(0,C.C)(N.lastHeartbeatAt)]].map(([e,s])=>(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:e}),(0,t.jsx)("dd",{className:"font-medium",children:s})]},e)),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Cockpit"}),(0,t.jsx)("dd",{className:"font-medium",children:y?.cockpitAvailable?(0,t.jsxs)("a",{href:`https://${N.ipAddress}:9090`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline flex items-center gap-1",children:["Available",(0,t.jsx)(M.f,{className:"h-3 w-3"})]}):(0,t.jsx)("span",{className:"text-text-muted",children:"Not Available"})})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"CPU Cores"}),(0,t.jsx)("dd",{className:"font-medium",children:y?.cpuCores??"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Memory Used"}),(0,t.jsx)("dd",{className:"font-medium",children:y?`${(0,C.L)(y.memoryUsedBytes)} / ${(0,C.L)(y.memoryTotalBytes)}`:"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Swap Used"}),(0,t.jsx)("dd",{className:"font-medium",children:y&&y.swapTotalBytes?`${(0,C.L)(y.swapUsedBytes??0)} / ${(0,C.L)(y.swapTotalBytes)}`:"—"})]}),(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Last Health Sample"}),(0,t.jsx)("dd",{className:"font-medium",children:y?(0,C.C)(y.timestamp):"—"})]})]})}),(0,t.jsx)(n.N,{title:"Hermes Agent",description:ej(ed)?ed.displayName??ed.hostname:"No Hermes Agent installed or found",action:ej(ed)?(0,t.jsx)(b.t,{variant:(0,b.k)(ed.status),children:ed.status}):void 0,children:ej(ed)?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("dl",{className:"grid gap-2 text-sm sm:grid-cols-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Version"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:ed.version??"unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Home"}),(0,t.jsx)("dd",{className:"font-mono text-xs break-all",children:ed.hermesHome})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Dashboard"}),(0,t.jsxs)("dd",{className:"mt-1 flex items-center gap-2",children:[(0,t.jsx)(b.t,{variant:(0,b.k)(ed.dashboardStatus),children:ed.dashboardStatus}),(0,t.jsx)("span",{className:"font-mono text-xs",children:(u=""===(x=(m=ed).dashboardHost.trim().toLowerCase().replace(/^\[|\]$/g,""))||"0.0.0.0"===x||"127.0.0.1"===x||"localhost"===x||"::"===x||"::1"===x?m.hostname:m.dashboardHost,`${u}:${m.dashboardPort}`)})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Gateway"}),(0,t.jsx)("dd",{className:"mt-1",children:(0,t.jsx)(b.t,{variant:(0,b.k)(ed.gatewayStatus),children:ed.gatewayStatus})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"API Server"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:ed.apiServerEnabled?`${ed.apiServerHost}:${ed.apiServerPort??"—"}`:"disabled"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Primary Provider"}),(0,t.jsxs)("dd",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)(b.t,{variant:"unknown"===eY?"warning":"success",children:eY}),ed.configuration?.magnusRouterConfigured&&(0,t.jsx)(b.t,{variant:"success",children:"Magnus routed"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Default Model"}),(0,t.jsx)("dd",{className:"font-mono text-xs break-all",children:e0})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"OpenAI Runtime"}),(0,t.jsx)("dd",{className:"mt-1",children:(0,t.jsx)(b.t,{variant:ed.configuration?.openaiRuntime==="codex_app_server"?"success":"warning",children:ed.configuration?.openaiRuntime==="codex_app_server"?"Codex app-server":"Hermes default"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Web Search"}),(0,t.jsxs)("dd",{className:"mt-1 flex items-center gap-2 text-xs",children:[(0,t.jsx)(L.f,{className:"h-3.5 w-3.5 text-text-muted"}),(0,t.jsx)("span",{className:"font-mono break-all",children:e1})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Crawling"}),(0,t.jsxs)("dd",{className:"mt-1 flex items-center gap-2 text-xs",children:[(0,t.jsx)(T,{className:"h-3.5 w-3.5 text-text-muted"}),(0,t.jsx)("span",{className:"font-mono break-all",children:e2})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Memory"}),(0,t.jsxs)("dd",{className:"mt-1",children:[(0,t.jsx)(b.t,{variant:ed.configuration?.hiveMemConfigured?"success":"warning",children:ed.configuration?.memoryProvider??"not configured"}),(0,t.jsx)(k.f,{configuration:ed.configuration})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Skills"}),(0,t.jsx)("dd",{className:"mt-1",children:(0,t.jsxs)("button",{type:"button",onClick:()=>ez(!0),className:"inline-flex items-center gap-1.5 rounded border border-border px-2 py-1 text-xs text-text hover:border-primary/60 hover:text-primary disabled:cursor-not-allowed disabled:opacity-50",disabled:0===eQ.length,children:[(0,t.jsx)(O.f,{className:"h-3.5 w-3.5"}),function(e){if(0===e.length)return"0 synced";let t=e.filter(e=>e.enabled).length;return`${t} enabled / ${e.length} total`}(eQ)]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Last Sync"}),(0,t.jsx)("dd",{className:"text-xs",children:(0,C.C)(ed.lastSyncedAt)})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[ed.configuration?.modelBaseUrl&&(0,t.jsxs)("p",{className:"text-xs text-text-muted",children:["Base URL: ",(0,t.jsx)("span",{className:"font-mono",children:ed.configuration.modelBaseUrl})]}),ed.configuration?.configPath&&(0,t.jsxs)("p",{className:"text-xs text-text-muted",children:["Config: ",(0,t.jsx)("span",{className:"font-mono",children:ed.configuration.configPath})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(ed.profiles??[]).slice(0,6).map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[10px] text-text-muted",children:[(0,t.jsx)(F.f,{className:"h-3 w-3"}),e.name]},e.id)),(ed.profiles?.length??0)===0&&(0,t.jsx)("span",{className:"text-xs text-text-muted",children:"No profiles synced"})]}),(0,t.jsx)(S.K,{size:"sm",variant:"secondary",icon:(0,t.jsx)(M.f,{className:"h-3.5 w-3.5"}),onClick:()=>f.push(`/orchestra/web-gateway?installationId=${encodeURIComponent(ed.id)}`),children:"Open Dashboard"})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"No Hermes Agent is installed or currently detected on this node."}),eD&&(0,t.jsx)("p",{className:"text-xs text-success",children:eD}),eR&&(0,t.jsx)("p",{className:"text-xs text-danger",children:eR}),(0,t.jsx)(S.K,{size:"sm",variant:"secondary",icon:eE?(0,t.jsx)(E.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(R.f,{className:"h-3.5 w-3.5"}),disabled:!N||"ONLINE"!==N.status||eE,onClick:()=>void eq(),children:eE?"Starting Deployment...":"Deploy Hermes Agent"}),N?.status!=="ONLINE"&&(0,t.jsx)("p",{className:"text-xs text-text-muted",children:"Bring the Magnus agent online before starting automated Hermes deployment."})]})}),(0,t.jsx)(n.N,{title:"Service Checks",children:y&&ef(y.services).length>0?(0,t.jsx)("div",{className:"space-y-2 text-sm",children:ef(y.services).slice(0,8).map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between rounded border border-border px-2 py-1.5",children:[(0,t.jsx)("span",{className:"font-medium",children:e.name}),(0,t.jsx)(b.t,{variant:"active"===e.status?"success":"failed"===e.status?"danger":"default",children:e.status})]},e.name))}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"No service checks available from this node yet."})})]}),(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(n.N,{title:"System Update Readiness",description:"Automatic apt policy and reboot state from the latest heartbeat",action:e5?(0,t.jsx)(b.t,{variant:e5.rebootRequired?"danger":"enabled"===e5.automaticUpdates?"success":"warning",children:e5.rebootRequired?"reboot required":e5.automaticUpdates.replace("_"," ")}):void 0,children:e5?(0,t.jsxs)("div",{className:"space-y-4",children:[e5.rebootRequired&&(0,t.jsxs)("div",{className:"flex gap-3 rounded border border-danger/30 bg-danger/10 p-3",children:[(0,t.jsx)(B.f,{className:"mt-0.5 h-4 w-4 shrink-0 text-danger"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-danger",children:"Restart needed to finish installed updates"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:e5.rebootRequiredPackages.length?e5.rebootRequiredPackages.slice(0,5).join(", "):"The operating system has set the reboot-required marker."})]})]}),(0,t.jsxs)("dl",{className:"space-y-2 text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Platform"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:e5.platform})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Automatic updates"}),(0,t.jsx)("dd",{children:(0,t.jsx)(b.t,{variant:"enabled"===e5.automaticUpdates?"success":"warning",children:e5.automaticUpdates})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"unattended-upgrades"}),(0,t.jsx)("dd",{children:e5.unattendedUpgradesInstalled?"installed":"not installed"})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"full apt upgrade policy"}),(0,t.jsx)("dd",{children:e5.fullUpgradePolicyEnabled?"enabled":"not enabled"})]}),e5.timers.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"font-mono text-[11px] text-text-muted",children:e.name}),(0,t.jsx)("dd",{className:"font-mono text-[11px]",children:e.state})]},e.name))]}),e5.supported&&"enabled"!==e5.automaticUpdates&&(0,t.jsxs)(S.K,{size:"sm",variant:"primary",disabled:"ONLINE"!==N.status||eP,onClick:()=>void eW(),children:[eP?(0,t.jsx)(E.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(H.f,{className:"h-3.5 w-3.5"}),eP?"Enabling…":"Enable automatic updates"]}),eI&&(0,t.jsx)("p",{className:"text-xs text-danger",children:eI})]}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"Update posture will appear after agent v1.6.0 reports its first heartbeat."})}),(0,t.jsx)(n.N,{title:"Wazuh Agent",description:"Endpoint-security posture from the latest node heartbeat",action:e3?(0,t.jsx)(b.t,{variant:"active"===(e=e3.serviceStatus)?"success":"failed"===e?"danger":"inactive"===e?"warning":"default",children:e3.serviceStatus.replace("_"," ")}):void 0,children:e3?(0,t.jsxs)("dl",{className:"space-y-2 text-sm",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Installation"}),(0,t.jsx)("dd",{children:(0,t.jsx)(b.t,{variant:e3.installed?"success":"default",children:e3.installed?"installed":"not installed"})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Startup"}),(0,t.jsx)("dd",{className:"font-medium",children:e3.enabled})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Version"}),(0,t.jsx)("dd",{className:"font-mono text-xs",children:e3.version??"—"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("dt",{className:"text-text-muted",children:"Managers"}),(0,t.jsx)("dd",{className:"mt-1 font-mono text-xs break-all",children:e3.managerAddresses.length?e3.managerAddresses.join(", "):"—"})]})]}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"Wazuh posture will appear after this host reports a current Magnus agent heartbeat."})}),(0,t.jsx)(n.N,{title:"Disk Usage",children:y&&eg(y.disks).length?(0,t.jsx)("div",{className:"space-y-3",children:eg(y.disks).map(e=>(0,t.jsxs)("div",{className:"text-sm",children:[(0,t.jsxs)("div",{className:"flex justify-between text-xs",children:[(0,t.jsx)("span",{className:"text-text-muted",children:e.mountPoint}),(0,t.jsxs)("span",{className:"num",children:[(0,C.L)(e.usedBytes)," / ",(0,C.L)(e.totalBytes)]})]}),(0,t.jsx)(l.f,{value:e.usagePercent,thresholds:{warn:80,crit:90},size:"sm",label:`${e.mountPoint} disk usage`,showValue:!0,className:"mt-1"})]},e.mountPoint))}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"No disk data available"})}),(0,t.jsx)(n.N,{title:"Capacity Forecast",description:"Per-volume 30-day growth trend and estimated time to full",children:G.length?(0,t.jsx)("div",{className:"space-y-3",children:G.map(e=>(0,t.jsxs)("div",{className:"rounded border border-border/50 p-3 text-xs",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{className:"font-mono text-text",children:e.mountPoint}),(0,t.jsx)(b.t,{variant:null!==e.daysUntilFull&&e.daysUntilFull<=14?"danger":null!==e.daysUntilFull&&e.daysUntilFull<=30?"warning":"default",children:null===e.daysUntilFull?e.growthRatePerDay>0?"trend uncertain":"stable/shrinking":`${e.daysUntilFull}d to full`})]}),(0,t.jsxs)("div",{className:"mt-2 text-text-muted",children:[e.currentUsagePercent.toFixed(1),"% used · ",(0,C.L)(Math.abs(e.growthRatePerDay)),"/day ",e.growthRatePerDay>=0?"growth":"reclaimed"," · confidence ",(100*e.confidence).toFixed(0),"%"]}),(0,t.jsx)("p",{className:"mt-2 text-text-muted",children:e.recommendation})]},e.mountPoint))}):(0,t.jsx)("p",{className:"text-sm text-text-muted",children:"At least three retained samples are needed for a capacity forecast."})}),(0,t.jsxs)(n.N,{title:"Software Revisions",description:"Major runtime versions and package update status",action:(0,t.jsx)(S.K,{variant:"ghost",size:"sm",onClick:()=>void eG(),children:(0,t.jsx)(I.f,{className:`h-3.5 w-3.5 ${eo?"animate-spin":""}`})}),children:[(0,t.jsxs)("div",{className:"space-y-2 text-sm",children:[["node","npm","python3","redis","docker","tailscale","magnus-agent"].map(e=>(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsx)("dt",{className:"text-text-muted uppercase text-xs tracking-wide",children:e}),(0,t.jsx)("dd",{className:"font-mono text-right text-xs break-all",children:er[e]??(eo?"Loading…":"—")})]},e)),ex&&(0,t.jsx)("p",{className:"text-xs text-danger",children:ex})]}),(0,t.jsxs)("div",{className:"mt-4 border-t border-border pt-4 space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-xs uppercase tracking-wide text-text-muted",children:"APT Updates"}),(0,t.jsx)(b.t,{variant:ep&&ep>0?"warning":"success",children:ew?"Checking…":`${ep??"—"} pending`})]}),(0,t.jsxs)("p",{className:"text-xs text-text-muted",children:["Refreshed hourly via apt update",ey?` • Last check: ${(0,C.C)(ey)}`:""]}),eS&&(0,t.jsx)("p",{className:"text-xs text-danger",children:eS}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)(S.K,{size:"sm",variant:"secondary",disabled:"ONLINE"!==N.status||ew,onClick:()=>void eJ(),children:[(0,t.jsx)(I.f,{className:`h-3.5 w-3.5 ${ew?"animate-spin":""}`}),"Refresh"]}),(0,t.jsxs)(S.K,{size:"sm",variant:"primary",disabled:"ONLINE"!==N.status||eC,onClick:()=>void eV(),children:[eC?(0,t.jsx)(E.f,{className:"h-3.5 w-3.5 animate-spin"}):null,eC?"Dispatching…":"APT Upgrade"]})]})]})]})]})]}),ea.length>0&&(0,t.jsx)(n.N,{title:"Role Applications",children:(0,t.jsx)("div",{className:"space-y-4",children:ea.map(e=>(0,t.jsxs)("div",{className:"rounded-lg border border-border p-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(D.f,{className:"h-4 w-4 text-primary"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["apply"===e.action?"Apply":"Remove",": ",e.role?.name??"Unknown"]})]}),(0,t.jsx)(b.t,{variant:"completed"===e.status?"success":"failed"===e.status?"danger":"running"===e.status?"info":"default",children:e.status})]}),e.error&&(0,t.jsx)("div",{className:"mb-2 rounded border border-danger/30 bg-danger/10 px-2 py-1 text-xs text-danger font-mono",children:e.error}),(0,t.jsx)("div",{className:"space-y-1",children:e.steps.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsxs)("span",{className:"completed"===e.status?"text-success":"failed"===e.status?"text-danger":"running"===e.status?"text-info":"skipped"===e.status?"text-text-muted/50":"text-text-muted",children:["completed"===e.status&&"✓","failed"===e.status&&"✗","running"===e.status&&"⟳","skipped"===e.status&&"—","pending"===e.status&&"○"]}),(0,t.jsx)("span",{className:"skipped"===e.status?"text-text-muted/50 line-through":"",children:e.name}),e.error&&(0,t.jsx)("span",{className:"text-danger ml-2 truncate max-w-xs",title:e.error,children:e.error})]},e.name))}),(0,t.jsxs)("div",{className:"mt-2 text-[10px] text-text-muted",children:[e.startedAt?`Started: ${(0,C.C)(e.startedAt)}`:"",e.completedAt?` — Completed: ${(0,C.C)(e.completedAt)}`:""]})]},e.id))})}),(0,t.jsx)($.n,{open:eL,onClose:()=>ez(!1),title:"Hermes Skills",description:`${eX.length} enabled on ${N.name}`,icon:(0,t.jsx)(O.f,{className:"h-5 w-5 text-primary"}),className:"max-w-3xl",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[(0,t.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Enabled"}),(0,t.jsx)("p",{className:"mt-1 text-lg font-semibold",children:eX.length})]}),(0,t.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Total"}),(0,t.jsx)("p",{className:"mt-1 text-lg font-semibold",children:eQ.length})]}),(0,t.jsxs)("div",{className:"rounded border border-border bg-bg/50 p-3",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wide text-text-muted",children:"Sources"}),(0,t.jsx)("p",{className:"mt-1 text-sm font-mono",children:Array.from(new Set(eQ.map(e=>e.source))).filter(Boolean).join(", ")||"unknown"})]})]}),(0,t.jsxs)("div",{className:"max-h-[55vh] overflow-auto rounded border border-border",children:[(0,t.jsxs)("table",{className:"w-full text-left text-xs",children:[(0,t.jsx)("thead",{className:"sticky top-0 bg-surface text-[10px] uppercase tracking-wide text-text-muted",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Skill"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Category"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Source"}),(0,t.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border",children:eQ.slice().sort((e,t)=>Number(t.enabled)-Number(e.enabled)||e.slug.localeCompare(t.slug)).map(e=>(0,t.jsxs)("tr",{className:"bg-bg/20",children:[(0,t.jsx)("td",{className:"px-3 py-2 font-mono",children:e.slug}),(0,t.jsx)("td",{className:"px-3 py-2 text-text-muted",children:e.category??"uncategorized"}),(0,t.jsx)("td",{className:"px-3 py-2 text-text-muted",children:e.source}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(b.t,{variant:e.enabled?"success":"default",children:e.enabled?"enabled":"disabled"})})]},`${e.slug}-${e.source}`))})]}),0===eQ.length&&(0,t.jsx)("div",{className:"p-6 text-sm text-text-muted",children:"No synced Hermes skills were reported for this node."})]})]})}),(0,t.jsx)(K.F,{open:X,node:N,onClose:()=>Y(!1),onSaved:()=>void eB()}),(0,t.jsx)(K.E,{open:ee,node:N?{id:N.id,name:N.name,role:N.role}:null,onClose:()=>et(!1),onSaved:e=>{eH.current=e,N&&v({...N,role:e}),eB()}})]})}],5525)}]);
@@ -1,2 +1,2 @@
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,j=new WeakMap,U=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?j.get(t.body):void 0)=>{let r=e.clone.bind(e);if(e.body&&s)for(let t of(j.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&&j.set(e.body,s),N(t,e)},writable:!0,configurable:!0}}),e},B=e=>{let{body:t}=e;if(!(!t||e.bodyUsed||t.locked||U.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")},ej=/^[\0-\u0020]+/g,eU=/[\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(ej,"").replaceAll(eU,"");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}#j(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 #U(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.#j(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.#j(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.#j(t,e):Math.min(t.maxRetryAfter,r)}if(!i&&413===e.response.status)throw e;return this.#j(t,e)}if(!i&&!ef(e,r))throw e;return this.#j(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.#U(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=j.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:"profile-import-hermes"===s?1e5: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),run:e=>this.get(`agents/upgrade/runs/${encodeURIComponent(e)}`).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
+ (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:"profile-import-hermes"===s?1e5: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),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 +1 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,59180,e=>{var s=e.i(43476),t=e.i(71645),a=e.i(68759),r=e.i(46670),n=e.i(93999),i=e.i(32568),l=e.i(82983),c=e.i(4050),o=e.i(95187);let d=(0,o.createServerReference)("40dcbbb38217eb7c462ea33610f362b3fcee5bf7b8",o.callServer,void 0,o.findSourceMapURL,"scanSkills");var x=e.i(78571),m=e.i(63376),p=e.i(88187),h=e.i(41120),u=e.i(66595),f=e.i(79258),g=e.i(41220),v=e.i(56420);let j={name:"tag",size:24,node:[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]};j.node;let b=(0,v.f)(j);var N=e.i(89360),w=e.i(16327),y=e.i(67927),k=e.i(72382),S=e.i(25981),_=e.i(32781),I=e.i(53138),C=e.i(51757),z=e.i(83967);e.s(["default",0,function(){let{activeNode:e}=(0,c.l)(),[o,v]=(0,t.useState)([]),[j,E]=(0,t.useState)(!1),[M,L]=(0,t.useState)(null),[A,D]=(0,t.useState)(!1),[$,P]=(0,t.useState)(""),[T,R]=(0,t.useState)(new Set),[F,O]=(0,t.useState)(null),[U,G]=(0,t.useState)(null),[H,K]=(0,t.useState)(""),[V,q]=(0,t.useState)(!1),W=(0,t.useCallback)(async()=>{E(!0),v([]),L(null);let s=Date.now();try{let s=await d(e.id);if(s.success&&Array.isArray(s.data)){let e=s.data.map(e=>({...e,status:"error"===e.status?"error":"done",skills:e.skills.map(e=>({...e,files:e.files.map(e=>"string"==typeof e?{name:e,content:""}:e)}))}));v(e);let t=new Set(e.filter(e=>e.skills.length>0).map(e=>e.nodeId));R(t.size>0?t:new Set(e.map(e=>e.nodeId)))}else L(s.error?.message??"Scan returned unsuccessful response")}catch(s){let e=s instanceof Error?s.message:"Scan request failed";L(e)}finally{let e=Date.now()-s;e<1500&&await new Promise(s=>setTimeout(s,1500-e)),E(!1),D(!0)}},[e]);(0,t.useEffect)(()=>{e&&W()},[e,W]);let B=o.reduce((e,s)=>e+("done"===s.status?s.skills.length:0),0),J=o.filter(e=>"done"===e.status).length,Q=o.filter(e=>"error"===e.status).length,Y=e=>{if(!$)return!0;let s=$.toLowerCase();return e.name.toLowerCase().includes(s)||e.description.toLowerCase().includes(s)||e.tags.some(e=>e.toLowerCase().includes(s))},Z=async()=>{if(U&&H){q(!0);try{let e={name:U.skill.name,version:H,description:U.skill.description,author:U.skill.author,entryPoint:U.skill.entryPoint,dependencies:U.skill.dependencies,tags:U.skill.tags},s={};for(let e of U.skill.files)s[e.name]=e.content;let t=JSON.stringify({manifest:e,files:s},null,2);await l.f.library.files.create({name:`${U.skill.name} v${H}`,fileName:`${U.skill.name}-${H}.json`,mimeType:"application/x-magnus-skill",content:t,tags:["skill",...U.skill.tags]}),G(null),K("")}catch{}finally{q(!1)}}};return(0,s.jsxs)(m.U,{className:"space-y-6",children:[(0,s.jsx)(m.z,{children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-lg font-bold uppercase tracking-wider",children:"Skills"}),(0,s.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:"Discover and manage Hermes Agent skills across your fleet"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[A&&!j&&(0,s.jsxs)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider mr-2",children:[o.length," node",1!==o.length?"s":""," · ",B," skill",1!==B?"s":"",Q>0&&` \xb7 ${Q} error${1!==Q?"s":""}`]}),(0,s.jsxs)(a.K,{variant:"secondary",size:"sm",onClick:()=>void W(),disabled:j,children:[(0,s.jsx)(h.f,{className:(0,x.f)("h-3.5 w-3.5 mr-1.5",j&&"animate-spin")}),j?"Scanning...":"Rescan"]})]})]})}),j&&(0,s.jsx)(m.z,{children:(0,s.jsx)(p.f,{title:"Scanning Nodes for Skills",description:"Probing all online nodes...",nodes:o.map(e=>({nodeId:e.nodeId,nodeName:e.nodeName,status:e.status,error:e.error})),scanning:!0})}),!j&&A&&B>0&&(0,s.jsx)(m.z,{children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(u.f,{className:"absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-text-muted"}),(0,s.jsx)("input",{type:"text",placeholder:"Search skills by name, description, or tag...",value:$,onChange:e=>P(e.target.value),className:(0,x.f)(i.W,"pl-9")})]})}),!j&&A&&M&&(0,s.jsx)(m.z,{children:(0,s.jsx)(n.N,{children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,s.jsx)(I.f,{className:"h-10 w-10 text-danger/60 mb-3"}),(0,s.jsx)("p",{className:"text-xs font-bold text-danger mb-1",children:"Scan Failed"}),(0,s.jsx)("p",{className:"text-[11px] text-text-muted max-w-md",children:M}),(0,s.jsxs)(a.K,{variant:"secondary",size:"sm",className:"mt-4",onClick:()=>void W(),children:[(0,s.jsx)(h.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Retry Scan"]})]})})}),!j&&A&&!M&&(0,s.jsxs)(s.Fragment,{children:[0===o.length?(0,s.jsx)(m.z,{children:(0,s.jsx)(n.N,{children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,s.jsx)(g.f,{className:"h-10 w-10 text-text-muted/40 mb-3"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"No online nodes found to scan. Ensure at least one node agent is running and connected."})]})})}):o.map(e=>{let t=T.has(e.nodeId),i=e.skills.filter(Y);return(0,s.jsx)(m.z,{children:(0,s.jsxs)(n.N,{className:"overflow-hidden",children:[(0,s.jsxs)("button",{onClick:()=>{var s;return s=e.nodeId,void R(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t})},className:"w-full flex items-center gap-4 p-4 text-left hover:bg-surface-hover transition-all",children:[(0,s.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded border border-primary/30 bg-primary/5 shrink-0",children:(0,s.jsx)(g.f,{className:"h-4 w-4 text-primary"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider",children:e.nodeName}),"done"===e.status&&(0,s.jsxs)(r.t,{variant:e.skills.length>0?"success":"default",children:[e.skills.length," skill",1!==e.skills.length?"s":""]}),"error"===e.status&&(0,s.jsx)(r.t,{variant:"danger",children:"Error"})]}),"error"===e.status&&e.error&&(0,s.jsx)("p",{className:"text-[11px] text-danger mt-0.5 truncate",children:e.error}),"done"===e.status&&0===e.skills.length&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted mt-0.5",children:"No skills installed on this node"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:["done"===e.status?(0,s.jsx)(C.f,{className:"h-4 w-4 text-success"}):(0,s.jsx)(z.f,{className:"h-4 w-4 text-danger"}),t?(0,s.jsx)(w.f,{className:"h-4 w-4 text-text-muted"}):(0,s.jsx)(y.f,{className:"h-4 w-4 text-text-muted"})]})]}),t&&"done"===e.status&&(0,s.jsx)("div",{className:"border-t border-border/50 bg-bg/50",children:0===i.length?(0,s.jsx)("div",{className:"flex items-center justify-center py-8 text-center",children:(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:0===e.skills.length?"No skills installed on this node. Deploy skills from the Library.":"No skills match your search on this node."})}):(0,s.jsx)("div",{className:"divide-y divide-border/30",children:i.map(t=>(0,s.jsxs)("div",{className:"p-4 space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(f.f,{className:"h-4 w-4 text-primary"}),(0,s.jsx)("span",{className:"text-xs font-bold",children:t.name}),(0,s.jsx)(r.t,{variant:"info",children:t.version})]}),(0,s.jsxs)(a.K,{size:"sm",variant:"secondary",onClick:()=>{G({skill:t,nodeId:e.nodeId,nodeName:e.nodeName}),K(t.version)},children:[(0,s.jsx)(S.f,{className:"h-3 w-3 mr-1"}),"Publish"]})]}),t.description&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:t.description}),t.tags.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:t.tags.map(e=>(0,s.jsxs)(r.t,{variant:"default",children:[(0,s.jsx)(b,{className:"h-2.5 w-2.5 mr-1"}),e]},e))}),(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,s.jsxs)("div",{className:"rounded border border-border bg-surface p-2",children:[(0,s.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-wider text-text-muted mb-0.5",children:"Author"}),(0,s.jsx)("p",{className:"text-[11px]",children:t.author||"—"})]}),(0,s.jsxs)("div",{className:"rounded border border-border bg-surface p-2",children:[(0,s.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-wider text-text-muted mb-0.5",children:"Entry Point"}),(0,s.jsx)("p",{className:"text-[11px]",children:t.entryPoint||"—"})]}),(0,s.jsxs)("div",{className:"rounded border border-border bg-surface p-2",children:[(0,s.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-wider text-text-muted mb-0.5",children:"Dependencies"}),(0,s.jsx)("p",{className:"text-[11px]",children:t.dependencies.length>0?t.dependencies.join(", "):"—"})]})]}),t.files.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-[10px] font-bold uppercase tracking-wider text-text-muted mb-1.5",children:["Files (",t.files.length,")"]}),(0,s.jsx)("div",{className:"space-y-1",children:t.files.map(e=>(0,s.jsxs)("button",{onClick:()=>O(e),className:"flex items-center gap-2 rounded border border-border/50 px-3 py-1.5 text-xs hover:border-primary/30 hover:shadow-[0_0_20px_var(--color-glow)] transition-all w-full text-left",children:[(0,s.jsx)(N.f,{className:"h-3 w-3 text-primary"}),(0,s.jsx)("span",{children:e.name}),(0,s.jsx)(k.f,{className:"h-3 w-3 text-text-muted ml-auto"})]},e.name))})]})]},t.name))})})]})},e.nodeId)}),o.length>0&&(0,s.jsx)(m.z,{children:(0,s.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-text-muted uppercase tracking-wider",children:[(0,s.jsxs)("span",{children:[J," node",1!==J?"s":""," scanned ·"," ",B," skill",1!==B?"s":""," discovered"]}),Q>0&&(0,s.jsxs)("span",{className:"text-danger",children:[Q," node",1!==Q?"s":""," unreachable"]})]})})]}),(0,s.jsx)(i.n,{open:!!F,onClose:()=>O(null),title:F?.name??"File",icon:(0,s.jsx)(N.f,{className:"h-5 w-5 text-primary"}),className:"max-w-3xl",children:(0,s.jsx)("pre",{className:"rounded border border-border bg-bg p-4 text-xs overflow-auto max-h-96 whitespace-pre-wrap",children:F?.content||"(empty)"})}),(0,s.jsx)(i.n,{open:!!U,onClose:()=>G(null),title:"Publish to Library",description:U?.skill.name??"",icon:(0,s.jsx)(S.f,{className:"h-5 w-5 text-primary"}),children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-[11px] font-bold uppercase tracking-wider mb-1.5",children:["Version ",(0,s.jsx)("span",{className:"text-accent",children:"*"})]}),(0,s.jsx)("input",{type:"text",value:H,onChange:e=>K(e.target.value),placeholder:"1.0.0",className:i.W})]}),U&&(0,s.jsxs)("div",{className:"rounded border border-border bg-bg p-3 text-xs space-y-1",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-text-muted",children:"Source:"})," ",U.nodeName]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-text-muted",children:"Files:"})," ",U.skill.files.length," files"]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-text-muted",children:"Tags:"})," ",["skill",...U.skill.tags].join(", ")]})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,s.jsx)(a.K,{variant:"secondary",size:"sm",onClick:()=>G(null),children:"Cancel"}),(0,s.jsx)(a.K,{size:"sm",onClick:()=>void Z(),disabled:V||!H,children:V?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(_.f,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Publishing..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(S.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Publish"]})})]})]})})]})}],59180)},46670,e=>{var s=e.i(43476),t=e.i(78571);let a={default:"border-border text-text-muted",success:"border-success/40 text-success bg-success/5 shadow-[0_0_6px_rgba(0,255,65,0.15)]",warning:"border-warning/40 text-warning bg-warning/5 shadow-[0_0_6px_rgba(255,179,0,0.15)]",danger:"border-danger/40 text-danger bg-danger/5 shadow-[0_0_6px_rgba(255,23,68,0.15)]",info:"border-info/40 text-info bg-info/5 shadow-[0_0_6px_rgba(0,176,255,0.15)]"},r={default:"bg-text-muted",success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info"};e.s(["t",0,function({children:e,variant:n="default",className:i,dot:l=!1,pulse:c=!1}){return(0,s.jsxs)("span",{className:(0,t.f)("inline-flex items-center gap-1.5 rounded-chip border px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",a[n],i),children:[l&&(0,s.jsxs)("span",{"aria-hidden":"true",className:"relative inline-flex h-1.5 w-1.5",children:[c&&(0,s.jsx)("span",{className:(0,t.f)("absolute inset-0 rounded-full animate-halo",r[n])}),(0,s.jsx)("span",{className:(0,t.f)("relative inline-flex h-1.5 w-1.5 rounded-full",r[n])})]}),e]})},"k",0,function(e){switch(e.toUpperCase()){case"ONLINE":case"COMPLETED":case"ACTIVE":case"RUNNING":case"INSTALLED":case"HEALTHY":return"success";case"DEGRADED":case"PAUSED":case"QUEUED":case"PENDING":case"INSTALLING":return"warning";case"OFFLINE":case"FAILED":case"ERROR":case"TIMEOUT":case"CANCELLED":case"DECOMMISSIONED":case"CRITICAL":return"danger";case"PROVISIONING":case"UPDATING":return"info";default:return"default"}}])},93999,51196,55427,e=>{var s=e.i(43476),t=e.i(56420);let a={name:"arrow-down-right",size:24,node:[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]};a.node;let r=(0,t.f)(a);var n=e.i(75775),i=e.i(78571),l=e.i(3062),c=e.i(35084);let o={warning:"shadow-[0_0_6px_var(--color-warning)]",danger:"shadow-[0_0_8px_var(--color-danger)]",accent:"shadow-[0_0_6px_var(--color-accent)]",primary:"shadow-[0_0_6px_var(--color-primary)]"},d={xs:"h-1",sm:"h-1.5",md:"h-2"};function x({value:e,max:t=100,tone:a,thresholds:r=c.q,label:n,size:l="xs",showValue:m=!1,valueLabel:p,glow:h,className:u,testId:f}){let g="number"==typeof e&&Number.isFinite(e),v=g?Math.max(0,Math.min(100,e/(t||1)*100)):0,j=a??(g?(0,c.Z)(v,r):"muted"),b=h||!a&&g&&v>=r.warn,N=p??(g?`${v.toFixed(+(v<10&&v>0))}%`:"—");return(0,s.jsxs)("div",{className:(0,i.f)("flex min-w-0 items-center gap-2",u),"data-testid":f,children:[(0,s.jsx)("div",{role:"meter","aria-label":n,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":g?e:void 0,"aria-valuetext":N,className:(0,i.f)("relative flex-1 overflow-hidden rounded-full bg-border/70",d[l]),children:(0,s.jsx)("div",{style:{"--meter":`${v}%`},className:(0,i.f)("h-full w-(--meter) rounded-full transition-[width] duration-700 ease-out-expo starting:w-0",c.H[j],b&&o[j])})}),m&&(0,s.jsx)("span",{className:(0,i.f)("num w-11 shrink-0 text-right text-[11px]",g?c.T[j]:"text-text-muted"),children:N})]})}e.s(["f",0,x],51196);var m=e.i(71645);function p({values:e,tone:t="primary",width:a=160,height:r=32,area:n=!0,max:l,percent:o=!1,threshold:d,live:x=!0,emptyLabel:h="not enough data",className:u,testId:f,label:g,stretch:v=!1}){let j=`spark${(0,m.useId)().replace(/:/g,"")}`;if(e.length<2)return(0,s.jsx)("div",{className:(0,i.f)("flex h-8 items-center text-xs italic text-text-muted",u),"data-testid":f,children:h});let b=c.v[t],N=l??(o?Math.max(100,...e):Math.max(...e,d??0)||1),w=r-4,y=a/(e.length-1),k=e=>2+w-Math.max(0,e)/N*w,S=e.map((e,s)=>[s*y,k(e)]),_=S.map(([e,s])=>`${e.toFixed(1)},${s.toFixed(1)}`).join(" "),I=S[S.length-1];return(0,s.jsxs)("svg",{width:v?"100%":a,height:r,viewBox:`0 0 ${a} ${r}`,preserveAspectRatio:v?"none":void 0,className:(0,i.f)("block overflow-visible",u),"data-testid":f,role:g?"img":void 0,"aria-label":g,"aria-hidden":!g||void 0,children:[n&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("defs",{children:(0,s.jsxs)("linearGradient",{id:j,x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:b,stopOpacity:.35}),(0,s.jsx)("stop",{offset:"100%",stopColor:b,stopOpacity:0})]})}),(0,s.jsx)("polygon",{points:`0,${r} ${_} ${a},${r}`,fill:`url(#${j})`})]}),void 0!==d&&(0,s.jsx)("line",{x1:0,x2:a,y1:k(d),y2:k(d),stroke:"var(--color-warning)",strokeOpacity:.5,strokeDasharray:"3 3",strokeWidth:1}),(0,s.jsx)("polyline",{fill:"none",stroke:b,strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round",points:_}),x&&!v&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("circle",{cx:I[0],cy:I[1],r:2.5,fill:b,className:"origin-center animate-halo [transform-box:fill-box]"}),(0,s.jsx)("circle",{cx:I[0],cy:I[1],r:2,fill:b})]})]})}e.s(["f",0,p],55427),e.s(["N",0,function({title:e,description:t,children:a,className:r,action:n,tone:i,corners:c=!1,...o}){return(0,s.jsx)(l.f,{...o,tone:i,corners:c,title:e,description:t,action:n,className:r,children:a})},"n",0,function({label:e,value:t,icon:a,trend:o,spark:d,meter:m,delta:h,tone:u="primary",className:f,testId:g}){let v=!h||h.value>=0===(h.positiveIsGood??!0);return(0,s.jsxs)(l.f,{tone:u,className:(0,i.f)("overflow-hidden",f),testId:g,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:e}),a&&(0,s.jsx)("span",{className:"text-primary/60",children:a})]}),(0,s.jsxs)("div",{className:"mt-2 flex items-end justify-between gap-2",children:[(0,s.jsx)("div",{className:(0,i.f)("num text-2xl font-bold","primary"===u?"text-primary neon-text":c.T[u]),children:t}),h&&0!==h.value&&(0,s.jsxs)("span",{className:(0,i.f)("num mb-1 inline-flex items-center gap-0.5 text-[11px]",v?"text-success":"text-danger"),children:[h.value>0?(0,s.jsx)(n.f,{className:"h-3 w-3"}):(0,s.jsx)(r,{className:"h-3 w-3"}),Math.abs(h.value).toFixed(+!Number.isInteger(h.value)),h.unit]})]}),o&&(0,s.jsx)("div",{className:(0,i.f)("mt-1 text-[11px]",o.positive?"text-success":"text-danger"),children:o.value}),void 0!==m&&(0,s.jsx)(x,{value:m,className:"mt-3",label:e}),d&&d.length>1&&(0,s.jsx)("div",{className:"-mx-5 -mb-5 mt-3 opacity-80",children:(0,s.jsx)(p,{values:d,tone:u,width:240,height:28,stretch:!0,live:!1})})]})}],93999)},3062,e=>{var s=e.i(43476),t=e.i(78571),a=e.i(35084);let r={primary:"[--panel-corner-color:color-mix(in_srgb,var(--color-primary)_60%,transparent)]",accent:"[--panel-corner-color:color-mix(in_srgb,var(--color-accent)_70%,transparent)]",success:"[--panel-corner-color:color-mix(in_srgb,var(--color-success)_60%,transparent)]",warning:"[--panel-corner-color:color-mix(in_srgb,var(--color-warning)_70%,transparent)]",danger:"[--panel-corner-color:color-mix(in_srgb,var(--color-danger)_70%,transparent)]",info:"[--panel-corner-color:color-mix(in_srgb,var(--color-info)_60%,transparent)]",muted:"[--panel-corner-color:var(--color-border-strong)]"},n={primary:"[--glow-hover-color:var(--color-glow)]",accent:"[--glow-hover-color:var(--color-glow-accent)]",success:"[--glow-hover-color:var(--color-glow-success)]",warning:"[--glow-hover-color:var(--color-glow-warning)]",danger:"[--glow-hover-color:var(--color-glow-danger)]",info:"[--glow-hover-color:var(--color-glow)]",muted:"[--glow-hover-color:var(--color-glow)]"},i={primary:"hover:border-primary/30",accent:"hover:border-accent/40",success:"hover:border-success/30",warning:"hover:border-warning/40",danger:"hover:border-danger/40",info:"hover:border-info/30",muted:"hover:border-border-strong"},l={none:"",sm:"p-3",md:"p-5",lg:"p-6"};e.s(["f",0,function({tone:e="primary",corners:c=!0,interactive:o=!0,hero:d=!1,title:x,description:m,icon:p,action:h,as:u="div",padding:f="md",testId:g,className:v,children:j,...b}){return(0,s.jsxs)(u,{...b,"data-testid":g??b["data-testid"],className:(0,t.f)("relative rounded-panel border border-border bg-surface transition-colors duration-300",l[f],c&&"panel-corners",c&&r[e],o&&"glow-hover",o&&n[e],o&&i[e],d&&"grid-bg overflow-hidden bg-surface/80",v),children:[(x||h||p)&&(0,s.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[p&&(0,s.jsx)("span",{className:(0,t.f)("mt-0.5 shrink-0",a.T[e]),children:p}),(0,s.jsxs)("div",{className:"min-w-0",children:[x&&(0,s.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider",children:x}),m&&(0,s.jsx)("p",{className:"mt-0.5 text-[11px] text-text-muted",children:m})]})]}),h]}),j]})}])},63376,e=>{var s=e.i(43476);e.s(["z",0,function({children:e,className:t}){return(0,s.jsx)("div",{className:`animate-page-in${t?` ${t}`:""}`,children:e})},"U",0,function({children:e,className:t}){return(0,s.jsx)("div",{className:t,children:e})}])},88187,25981,e=>{var s=e.i(43476),t=e.i(32181),a=e.i(32781),r=e.i(51757),n=e.i(83967),i=e.i(15331);e.s(["f",0,function({title:e,description:l,nodes:c,scanning:o}){return(0,s.jsxs)(t.f.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.4,ease:[.16,1,.3,1]},className:"rounded border border-primary/30 bg-surface p-6 relative overflow-hidden",children:[o&&(0,s.jsx)(t.f.div,{className:"absolute inset-0 pointer-events-none",initial:{opacity:0},animate:{opacity:1},children:(0,s.jsx)(t.f.div,{className:"absolute left-0 right-0 h-px bg-gradient-to-r from-transparent via-primary/60 to-transparent",animate:{top:["0%","100%"]},transition:{duration:2,repeat:1/0,ease:"linear"}})}),(0,s.jsx)("div",{className:"absolute inset-0 rounded pointer-events-none",style:{boxShadow:o?"0 0 20px var(--color-glow), inset 0 0 20px rgba(0,229,255,0.03)":"none",transition:"box-shadow 0.5s ease"}}),(0,s.jsxs)("div",{className:"relative z-10",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[o?(0,s.jsx)(t.f.div,{animate:{rotate:360},transition:{duration:2,repeat:1/0,ease:"linear"},children:(0,s.jsx)(i.f,{className:"h-5 w-5 text-primary"})}):(0,s.jsx)(r.f,{className:"h-5 w-5 text-success"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-sm font-bold uppercase tracking-wider",children:o?e:"Scan Complete"}),l&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:l})]})]}),c.length>0&&(0,s.jsx)("div",{className:"space-y-2",children:c.map((e,i)=>(0,s.jsxs)(t.f.div,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:{delay:.05*i,duration:.3},className:"flex items-center gap-3 text-xs",children:["scanning"===e.status&&(0,s.jsx)(a.f,{className:"h-3.5 w-3.5 text-primary animate-spin"}),"done"===e.status&&(0,s.jsx)(r.f,{className:"h-3.5 w-3.5 text-success"}),"error"===e.status&&(0,s.jsx)(n.f,{className:"h-3.5 w-3.5 text-danger"}),(0,s.jsx)("span",{className:"text-text",children:e.nodeName}),"error"===e.status&&e.error&&(0,s.jsx)("span",{className:"text-[10px] text-danger/70 truncate max-w-[200px]",children:e.error})]},e.nodeId))}),0===c.length&&o&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:"Discovering nodes..."})]})]})}],88187);var l=e.i(56420);let c={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};c.node;let o=(0,l.f)(c);e.s(["f",0,o],25981)},75775,e=>{var s=e.i(56420);let t={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],75775)},72382,e=>{var s=e.i(56420);let t={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],72382)},89360,e=>{var s=e.i(56420);let t={name:"file-code",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],89360)},79258,e=>{var s=e.i(56420);let t={name:"package",size:24,node:[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],79258)},95187,(e,s,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var a={callServer:function(){return n.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var r in a)Object.defineProperty(t,r,{enumerable:!0,get:a[r]});let n=e.r(32120),i=e.r(92245),l=e.r(35326)}])})();
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,59180,e=>{var s=e.i(43476),t=e.i(71645),a=e.i(68759),r=e.i(46670),n=e.i(93999),i=e.i(32568),l=e.i(82983),c=e.i(4050),o=e.i(95187);let d=(0,o.createServerReference)("4055367b45e2d3f8c87846899f8397a271cacb8be0",o.callServer,void 0,o.findSourceMapURL,"scanSkills");var x=e.i(78571),m=e.i(63376),p=e.i(88187),h=e.i(41120),u=e.i(66595),f=e.i(79258),g=e.i(41220),v=e.i(56420);let j={name:"tag",size:24,node:[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]};j.node;let N=(0,v.f)(j);var b=e.i(89360),w=e.i(16327),y=e.i(67927),k=e.i(72382),S=e.i(25981),_=e.i(32781),I=e.i(53138),C=e.i(51757),z=e.i(83967);e.s(["default",0,function(){let{activeNode:e}=(0,c.l)(),[o,v]=(0,t.useState)([]),[j,E]=(0,t.useState)(!1),[M,L]=(0,t.useState)(null),[A,D]=(0,t.useState)(!1),[$,P]=(0,t.useState)(""),[T,R]=(0,t.useState)(new Set),[F,O]=(0,t.useState)(null),[U,G]=(0,t.useState)(null),[H,K]=(0,t.useState)(""),[V,q]=(0,t.useState)(!1),W=(0,t.useCallback)(async()=>{E(!0),v([]),L(null);let s=Date.now();try{let s=await d(e.id);if(s.success&&Array.isArray(s.data)){let e=s.data.map(e=>({...e,status:"error"===e.status?"error":"done",skills:e.skills.map(e=>({...e,files:e.files.map(e=>"string"==typeof e?{name:e,content:""}:e)}))}));v(e);let t=new Set(e.filter(e=>e.skills.length>0).map(e=>e.nodeId));R(t.size>0?t:new Set(e.map(e=>e.nodeId)))}else L(s.error?.message??"Scan returned unsuccessful response")}catch(s){let e=s instanceof Error?s.message:"Scan request failed";L(e)}finally{let e=Date.now()-s;e<1500&&await new Promise(s=>setTimeout(s,1500-e)),E(!1),D(!0)}},[e]);(0,t.useEffect)(()=>{e&&W()},[e,W]);let B=o.reduce((e,s)=>e+("done"===s.status?s.skills.length:0),0),J=o.filter(e=>"done"===e.status).length,Q=o.filter(e=>"error"===e.status).length,Y=e=>{if(!$)return!0;let s=$.toLowerCase();return e.name.toLowerCase().includes(s)||e.description.toLowerCase().includes(s)||e.tags.some(e=>e.toLowerCase().includes(s))},Z=async()=>{if(U&&H){q(!0);try{let e={name:U.skill.name,version:H,description:U.skill.description,author:U.skill.author,entryPoint:U.skill.entryPoint,dependencies:U.skill.dependencies,tags:U.skill.tags},s={};for(let e of U.skill.files)s[e.name]=e.content;let t=JSON.stringify({manifest:e,files:s},null,2);await l.f.library.files.create({name:`${U.skill.name} v${H}`,fileName:`${U.skill.name}-${H}.json`,mimeType:"application/x-magnus-skill",content:t,tags:["skill",...U.skill.tags]}),G(null),K("")}catch{}finally{q(!1)}}};return(0,s.jsxs)(m.U,{className:"space-y-6",children:[(0,s.jsx)(m.z,{children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-lg font-bold uppercase tracking-wider",children:"Skills"}),(0,s.jsx)("p",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:"Discover and manage Hermes Agent skills across your fleet"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[A&&!j&&(0,s.jsxs)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider mr-2",children:[o.length," node",1!==o.length?"s":""," · ",B," skill",1!==B?"s":"",Q>0&&` \xb7 ${Q} error${1!==Q?"s":""}`]}),(0,s.jsxs)(a.K,{variant:"secondary",size:"sm",onClick:()=>void W(),disabled:j,children:[(0,s.jsx)(h.f,{className:(0,x.f)("h-3.5 w-3.5 mr-1.5",j&&"animate-spin")}),j?"Scanning...":"Rescan"]})]})]})}),j&&(0,s.jsx)(m.z,{children:(0,s.jsx)(p.f,{title:"Scanning Nodes for Skills",description:"Probing all online nodes...",nodes:o.map(e=>({nodeId:e.nodeId,nodeName:e.nodeName,status:e.status,error:e.error})),scanning:!0})}),!j&&A&&B>0&&(0,s.jsx)(m.z,{children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(u.f,{className:"absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-text-muted"}),(0,s.jsx)("input",{type:"text",placeholder:"Search skills by name, description, or tag...",value:$,onChange:e=>P(e.target.value),className:(0,x.f)(i.W,"pl-9")})]})}),!j&&A&&M&&(0,s.jsx)(m.z,{children:(0,s.jsx)(n.N,{children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,s.jsx)(I.f,{className:"h-10 w-10 text-danger/60 mb-3"}),(0,s.jsx)("p",{className:"text-xs font-bold text-danger mb-1",children:"Scan Failed"}),(0,s.jsx)("p",{className:"text-[11px] text-text-muted max-w-md",children:M}),(0,s.jsxs)(a.K,{variant:"secondary",size:"sm",className:"mt-4",onClick:()=>void W(),children:[(0,s.jsx)(h.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Retry Scan"]})]})})}),!j&&A&&!M&&(0,s.jsxs)(s.Fragment,{children:[0===o.length?(0,s.jsx)(m.z,{children:(0,s.jsx)(n.N,{children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,s.jsx)(g.f,{className:"h-10 w-10 text-text-muted/40 mb-3"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"No online nodes found to scan. Ensure at least one node agent is running and connected."})]})})}):o.map(e=>{let t=T.has(e.nodeId),i=e.skills.filter(Y);return(0,s.jsx)(m.z,{children:(0,s.jsxs)(n.N,{className:"overflow-hidden",children:[(0,s.jsxs)("button",{onClick:()=>{var s;return s=e.nodeId,void R(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t})},className:"w-full flex items-center gap-4 p-4 text-left hover:bg-surface-hover transition-all",children:[(0,s.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded border border-primary/30 bg-primary/5 shrink-0",children:(0,s.jsx)(g.f,{className:"h-4 w-4 text-primary"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider",children:e.nodeName}),"done"===e.status&&(0,s.jsxs)(r.t,{variant:e.skills.length>0?"success":"default",children:[e.skills.length," skill",1!==e.skills.length?"s":""]}),"error"===e.status&&(0,s.jsx)(r.t,{variant:"danger",children:"Error"})]}),"error"===e.status&&e.error&&(0,s.jsx)("p",{className:"text-[11px] text-danger mt-0.5 truncate",children:e.error}),"done"===e.status&&0===e.skills.length&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted mt-0.5",children:"No skills installed on this node"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:["done"===e.status?(0,s.jsx)(C.f,{className:"h-4 w-4 text-success"}):(0,s.jsx)(z.f,{className:"h-4 w-4 text-danger"}),t?(0,s.jsx)(w.f,{className:"h-4 w-4 text-text-muted"}):(0,s.jsx)(y.f,{className:"h-4 w-4 text-text-muted"})]})]}),t&&"done"===e.status&&(0,s.jsx)("div",{className:"border-t border-border/50 bg-bg/50",children:0===i.length?(0,s.jsx)("div",{className:"flex items-center justify-center py-8 text-center",children:(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:0===e.skills.length?"No skills installed on this node. Deploy skills from the Library.":"No skills match your search on this node."})}):(0,s.jsx)("div",{className:"divide-y divide-border/30",children:i.map(t=>(0,s.jsxs)("div",{className:"p-4 space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(f.f,{className:"h-4 w-4 text-primary"}),(0,s.jsx)("span",{className:"text-xs font-bold",children:t.name}),(0,s.jsx)(r.t,{variant:"info",children:t.version})]}),(0,s.jsxs)(a.K,{size:"sm",variant:"secondary",onClick:()=>{G({skill:t,nodeId:e.nodeId,nodeName:e.nodeName}),K(t.version)},children:[(0,s.jsx)(S.f,{className:"h-3 w-3 mr-1"}),"Publish"]})]}),t.description&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:t.description}),t.tags.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:t.tags.map(e=>(0,s.jsxs)(r.t,{variant:"default",children:[(0,s.jsx)(N,{className:"h-2.5 w-2.5 mr-1"}),e]},e))}),(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,s.jsxs)("div",{className:"rounded border border-border bg-surface p-2",children:[(0,s.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-wider text-text-muted mb-0.5",children:"Author"}),(0,s.jsx)("p",{className:"text-[11px]",children:t.author||"—"})]}),(0,s.jsxs)("div",{className:"rounded border border-border bg-surface p-2",children:[(0,s.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-wider text-text-muted mb-0.5",children:"Entry Point"}),(0,s.jsx)("p",{className:"text-[11px]",children:t.entryPoint||"—"})]}),(0,s.jsxs)("div",{className:"rounded border border-border bg-surface p-2",children:[(0,s.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-wider text-text-muted mb-0.5",children:"Dependencies"}),(0,s.jsx)("p",{className:"text-[11px]",children:t.dependencies.length>0?t.dependencies.join(", "):"—"})]})]}),t.files.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-[10px] font-bold uppercase tracking-wider text-text-muted mb-1.5",children:["Files (",t.files.length,")"]}),(0,s.jsx)("div",{className:"space-y-1",children:t.files.map(e=>(0,s.jsxs)("button",{onClick:()=>O(e),className:"flex items-center gap-2 rounded border border-border/50 px-3 py-1.5 text-xs hover:border-primary/30 hover:shadow-[0_0_20px_var(--color-glow)] transition-all w-full text-left",children:[(0,s.jsx)(b.f,{className:"h-3 w-3 text-primary"}),(0,s.jsx)("span",{children:e.name}),(0,s.jsx)(k.f,{className:"h-3 w-3 text-text-muted ml-auto"})]},e.name))})]})]},t.name))})})]})},e.nodeId)}),o.length>0&&(0,s.jsx)(m.z,{children:(0,s.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-text-muted uppercase tracking-wider",children:[(0,s.jsxs)("span",{children:[J," node",1!==J?"s":""," scanned ·"," ",B," skill",1!==B?"s":""," discovered"]}),Q>0&&(0,s.jsxs)("span",{className:"text-danger",children:[Q," node",1!==Q?"s":""," unreachable"]})]})})]}),(0,s.jsx)(i.n,{open:!!F,onClose:()=>O(null),title:F?.name??"File",icon:(0,s.jsx)(b.f,{className:"h-5 w-5 text-primary"}),className:"max-w-3xl",children:(0,s.jsx)("pre",{className:"rounded border border-border bg-bg p-4 text-xs overflow-auto max-h-96 whitespace-pre-wrap",children:F?.content||"(empty)"})}),(0,s.jsx)(i.n,{open:!!U,onClose:()=>G(null),title:"Publish to Library",description:U?.skill.name??"",icon:(0,s.jsx)(S.f,{className:"h-5 w-5 text-primary"}),children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-[11px] font-bold uppercase tracking-wider mb-1.5",children:["Version ",(0,s.jsx)("span",{className:"text-accent",children:"*"})]}),(0,s.jsx)("input",{type:"text",value:H,onChange:e=>K(e.target.value),placeholder:"1.0.0",className:i.W})]}),U&&(0,s.jsxs)("div",{className:"rounded border border-border bg-bg p-3 text-xs space-y-1",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-text-muted",children:"Source:"})," ",U.nodeName]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-text-muted",children:"Files:"})," ",U.skill.files.length," files"]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-text-muted",children:"Tags:"})," ",["skill",...U.skill.tags].join(", ")]})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,s.jsx)(a.K,{variant:"secondary",size:"sm",onClick:()=>G(null),children:"Cancel"}),(0,s.jsx)(a.K,{size:"sm",onClick:()=>void Z(),disabled:V||!H,children:V?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(_.f,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Publishing..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(S.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Publish"]})})]})]})})]})}],59180)},46670,e=>{var s=e.i(43476),t=e.i(78571);let a={default:"border-border text-text-muted",success:"border-success/40 text-success bg-success/5 shadow-[0_0_6px_rgba(0,255,65,0.15)]",warning:"border-warning/40 text-warning bg-warning/5 shadow-[0_0_6px_rgba(255,179,0,0.15)]",danger:"border-danger/40 text-danger bg-danger/5 shadow-[0_0_6px_rgba(255,23,68,0.15)]",info:"border-info/40 text-info bg-info/5 shadow-[0_0_6px_rgba(0,176,255,0.15)]"},r={default:"bg-text-muted",success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info"};e.s(["t",0,function({children:e,variant:n="default",className:i,dot:l=!1,pulse:c=!1}){return(0,s.jsxs)("span",{className:(0,t.f)("inline-flex items-center gap-1.5 rounded-chip border px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",a[n],i),children:[l&&(0,s.jsxs)("span",{"aria-hidden":"true",className:"relative inline-flex h-1.5 w-1.5",children:[c&&(0,s.jsx)("span",{className:(0,t.f)("absolute inset-0 rounded-full animate-halo",r[n])}),(0,s.jsx)("span",{className:(0,t.f)("relative inline-flex h-1.5 w-1.5 rounded-full",r[n])})]}),e]})},"k",0,function(e){switch(e.toUpperCase()){case"ONLINE":case"COMPLETED":case"ACTIVE":case"RUNNING":case"INSTALLED":case"HEALTHY":return"success";case"DEGRADED":case"PAUSED":case"QUEUED":case"PENDING":case"INSTALLING":return"warning";case"OFFLINE":case"FAILED":case"ERROR":case"TIMEOUT":case"CANCELLED":case"DECOMMISSIONED":case"CRITICAL":return"danger";case"PROVISIONING":case"UPDATING":return"info";default:return"default"}}])},93999,51196,55427,e=>{var s=e.i(43476),t=e.i(56420);let a={name:"arrow-down-right",size:24,node:[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]};a.node;let r=(0,t.f)(a);var n=e.i(75775),i=e.i(78571),l=e.i(3062),c=e.i(35084);let o={warning:"shadow-[0_0_6px_var(--color-warning)]",danger:"shadow-[0_0_8px_var(--color-danger)]",accent:"shadow-[0_0_6px_var(--color-accent)]",primary:"shadow-[0_0_6px_var(--color-primary)]"},d={xs:"h-1",sm:"h-1.5",md:"h-2"};function x({value:e,max:t=100,tone:a,thresholds:r=c.q,label:n,size:l="xs",showValue:m=!1,valueLabel:p,glow:h,className:u,testId:f}){let g="number"==typeof e&&Number.isFinite(e),v=g?Math.max(0,Math.min(100,e/(t||1)*100)):0,j=a??(g?(0,c.Z)(v,r):"muted"),N=h||!a&&g&&v>=r.warn,b=p??(g?`${v.toFixed(+(v<10&&v>0))}%`:"—");return(0,s.jsxs)("div",{className:(0,i.f)("flex min-w-0 items-center gap-2",u),"data-testid":f,children:[(0,s.jsx)("div",{role:"meter","aria-label":n,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":g?e:void 0,"aria-valuetext":b,className:(0,i.f)("relative flex-1 overflow-hidden rounded-full bg-border/70",d[l]),children:(0,s.jsx)("div",{style:{"--meter":`${v}%`},className:(0,i.f)("h-full w-(--meter) rounded-full transition-[width] duration-700 ease-out-expo starting:w-0",c.H[j],N&&o[j])})}),m&&(0,s.jsx)("span",{className:(0,i.f)("num w-11 shrink-0 text-right text-[11px]",g?c.T[j]:"text-text-muted"),children:b})]})}e.s(["f",0,x],51196);var m=e.i(71645);function p({values:e,tone:t="primary",width:a=160,height:r=32,area:n=!0,max:l,percent:o=!1,threshold:d,live:x=!0,emptyLabel:h="not enough data",className:u,testId:f,label:g,stretch:v=!1}){let j=`spark${(0,m.useId)().replace(/:/g,"")}`;if(e.length<2)return(0,s.jsx)("div",{className:(0,i.f)("flex h-8 items-center text-xs italic text-text-muted",u),"data-testid":f,children:h});let N=c.v[t],b=l??(o?Math.max(100,...e):Math.max(...e,d??0)||1),w=r-4,y=a/(e.length-1),k=e=>2+w-Math.max(0,e)/b*w,S=e.map((e,s)=>[s*y,k(e)]),_=S.map(([e,s])=>`${e.toFixed(1)},${s.toFixed(1)}`).join(" "),I=S[S.length-1];return(0,s.jsxs)("svg",{width:v?"100%":a,height:r,viewBox:`0 0 ${a} ${r}`,preserveAspectRatio:v?"none":void 0,className:(0,i.f)("block overflow-visible",u),"data-testid":f,role:g?"img":void 0,"aria-label":g,"aria-hidden":!g||void 0,children:[n&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("defs",{children:(0,s.jsxs)("linearGradient",{id:j,x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:N,stopOpacity:.35}),(0,s.jsx)("stop",{offset:"100%",stopColor:N,stopOpacity:0})]})}),(0,s.jsx)("polygon",{points:`0,${r} ${_} ${a},${r}`,fill:`url(#${j})`})]}),void 0!==d&&(0,s.jsx)("line",{x1:0,x2:a,y1:k(d),y2:k(d),stroke:"var(--color-warning)",strokeOpacity:.5,strokeDasharray:"3 3",strokeWidth:1}),(0,s.jsx)("polyline",{fill:"none",stroke:N,strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round",points:_}),x&&!v&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("circle",{cx:I[0],cy:I[1],r:2.5,fill:N,className:"origin-center animate-halo [transform-box:fill-box]"}),(0,s.jsx)("circle",{cx:I[0],cy:I[1],r:2,fill:N})]})]})}e.s(["f",0,p],55427),e.s(["N",0,function({title:e,description:t,children:a,className:r,action:n,tone:i,corners:c=!1,...o}){return(0,s.jsx)(l.f,{...o,tone:i,corners:c,title:e,description:t,action:n,className:r,children:a})},"n",0,function({label:e,value:t,icon:a,trend:o,spark:d,meter:m,delta:h,tone:u="primary",className:f,testId:g}){let v=!h||h.value>=0===(h.positiveIsGood??!0);return(0,s.jsxs)(l.f,{tone:u,className:(0,i.f)("overflow-hidden",f),testId:g,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:e}),a&&(0,s.jsx)("span",{className:"text-primary/60",children:a})]}),(0,s.jsxs)("div",{className:"mt-2 flex items-end justify-between gap-2",children:[(0,s.jsx)("div",{className:(0,i.f)("num text-2xl font-bold","primary"===u?"text-primary neon-text":c.T[u]),children:t}),h&&0!==h.value&&(0,s.jsxs)("span",{className:(0,i.f)("num mb-1 inline-flex items-center gap-0.5 text-[11px]",v?"text-success":"text-danger"),children:[h.value>0?(0,s.jsx)(n.f,{className:"h-3 w-3"}):(0,s.jsx)(r,{className:"h-3 w-3"}),Math.abs(h.value).toFixed(+!Number.isInteger(h.value)),h.unit]})]}),o&&(0,s.jsx)("div",{className:(0,i.f)("mt-1 text-[11px]",o.positive?"text-success":"text-danger"),children:o.value}),void 0!==m&&(0,s.jsx)(x,{value:m,className:"mt-3",label:e}),d&&d.length>1&&(0,s.jsx)("div",{className:"-mx-5 -mb-5 mt-3 opacity-80",children:(0,s.jsx)(p,{values:d,tone:u,width:240,height:28,stretch:!0,live:!1})})]})}],93999)},3062,e=>{var s=e.i(43476),t=e.i(78571),a=e.i(35084);let r={primary:"[--panel-corner-color:color-mix(in_srgb,var(--color-primary)_60%,transparent)]",accent:"[--panel-corner-color:color-mix(in_srgb,var(--color-accent)_70%,transparent)]",success:"[--panel-corner-color:color-mix(in_srgb,var(--color-success)_60%,transparent)]",warning:"[--panel-corner-color:color-mix(in_srgb,var(--color-warning)_70%,transparent)]",danger:"[--panel-corner-color:color-mix(in_srgb,var(--color-danger)_70%,transparent)]",info:"[--panel-corner-color:color-mix(in_srgb,var(--color-info)_60%,transparent)]",muted:"[--panel-corner-color:var(--color-border-strong)]"},n={primary:"[--glow-hover-color:var(--color-glow)]",accent:"[--glow-hover-color:var(--color-glow-accent)]",success:"[--glow-hover-color:var(--color-glow-success)]",warning:"[--glow-hover-color:var(--color-glow-warning)]",danger:"[--glow-hover-color:var(--color-glow-danger)]",info:"[--glow-hover-color:var(--color-glow)]",muted:"[--glow-hover-color:var(--color-glow)]"},i={primary:"hover:border-primary/30",accent:"hover:border-accent/40",success:"hover:border-success/30",warning:"hover:border-warning/40",danger:"hover:border-danger/40",info:"hover:border-info/30",muted:"hover:border-border-strong"},l={none:"",sm:"p-3",md:"p-5",lg:"p-6"};e.s(["f",0,function({tone:e="primary",corners:c=!0,interactive:o=!0,hero:d=!1,title:x,description:m,icon:p,action:h,as:u="div",padding:f="md",testId:g,className:v,children:j,...N}){return(0,s.jsxs)(u,{...N,"data-testid":g??N["data-testid"],className:(0,t.f)("relative rounded-panel border border-border bg-surface transition-colors duration-300",l[f],c&&"panel-corners",c&&r[e],o&&"glow-hover",o&&n[e],o&&i[e],d&&"grid-bg overflow-hidden bg-surface/80",v),children:[(x||h||p)&&(0,s.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[p&&(0,s.jsx)("span",{className:(0,t.f)("mt-0.5 shrink-0",a.T[e]),children:p}),(0,s.jsxs)("div",{className:"min-w-0",children:[x&&(0,s.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider",children:x}),m&&(0,s.jsx)("p",{className:"mt-0.5 text-[11px] text-text-muted",children:m})]})]}),h]}),j]})}])},63376,e=>{var s=e.i(43476);e.s(["z",0,function({children:e,className:t}){return(0,s.jsx)("div",{className:`animate-page-in${t?` ${t}`:""}`,children:e})},"U",0,function({children:e,className:t}){return(0,s.jsx)("div",{className:t,children:e})}])},88187,25981,e=>{var s=e.i(43476),t=e.i(32181),a=e.i(32781),r=e.i(51757),n=e.i(83967),i=e.i(15331);e.s(["f",0,function({title:e,description:l,nodes:c,scanning:o}){return(0,s.jsxs)(t.f.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.4,ease:[.16,1,.3,1]},className:"rounded border border-primary/30 bg-surface p-6 relative overflow-hidden",children:[o&&(0,s.jsx)(t.f.div,{className:"absolute inset-0 pointer-events-none",initial:{opacity:0},animate:{opacity:1},children:(0,s.jsx)(t.f.div,{className:"absolute left-0 right-0 h-px bg-gradient-to-r from-transparent via-primary/60 to-transparent",animate:{top:["0%","100%"]},transition:{duration:2,repeat:1/0,ease:"linear"}})}),(0,s.jsx)("div",{className:"absolute inset-0 rounded pointer-events-none",style:{boxShadow:o?"0 0 20px var(--color-glow), inset 0 0 20px rgba(0,229,255,0.03)":"none",transition:"box-shadow 0.5s ease"}}),(0,s.jsxs)("div",{className:"relative z-10",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[o?(0,s.jsx)(t.f.div,{animate:{rotate:360},transition:{duration:2,repeat:1/0,ease:"linear"},children:(0,s.jsx)(i.f,{className:"h-5 w-5 text-primary"})}):(0,s.jsx)(r.f,{className:"h-5 w-5 text-success"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-sm font-bold uppercase tracking-wider",children:o?e:"Scan Complete"}),l&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:l})]})]}),c.length>0&&(0,s.jsx)("div",{className:"space-y-2",children:c.map((e,i)=>(0,s.jsxs)(t.f.div,{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:{delay:.05*i,duration:.3},className:"flex items-center gap-3 text-xs",children:["scanning"===e.status&&(0,s.jsx)(a.f,{className:"h-3.5 w-3.5 text-primary animate-spin"}),"done"===e.status&&(0,s.jsx)(r.f,{className:"h-3.5 w-3.5 text-success"}),"error"===e.status&&(0,s.jsx)(n.f,{className:"h-3.5 w-3.5 text-danger"}),(0,s.jsx)("span",{className:"text-text",children:e.nodeName}),"error"===e.status&&e.error&&(0,s.jsx)("span",{className:"text-[10px] text-danger/70 truncate max-w-[200px]",children:e.error})]},e.nodeId))}),0===c.length&&o&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:"Discovering nodes..."})]})]})}],88187);var l=e.i(56420);let c={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};c.node;let o=(0,l.f)(c);e.s(["f",0,o],25981)},75775,e=>{var s=e.i(56420);let t={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],75775)},72382,e=>{var s=e.i(56420);let t={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],72382)},89360,e=>{var s=e.i(56420);let t={name:"file-code",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],89360)},79258,e=>{var s=e.i(56420);let t={name:"package",size:24,node:[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],79258)},95187,(e,s,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var a={callServer:function(){return n.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var r in a)Object.defineProperty(t,r,{enumerable:!0,get:a[r]});let n=e.r(32120),i=e.r(92245),l=e.r(35326)}])})();