@hivemagnus/magnus-ui 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) 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/{1_dc7qj6cn34y.js → 05cz-n3dflda8.js} +1 -1
  131. package/dist/app/apps/dashboard/.next/static/chunks/0a3qf_gj8th4c.js +1 -0
  132. package/dist/app/apps/dashboard/.next/static/chunks/{0lt-ikcy1lvod.js → 16_8wa1m1ffmd.js} +1 -1
  133. package/dist/app/apps/dashboard/.next/static/chunks/{1u_ran46erfqh.js → 17p8kp_-gsxp0.js} +1 -1
  134. package/dist/app/apps/dashboard/.next/static/chunks/{260f1oy-xd4cg.js → 2b5d1hl5rnwmi.js} +1 -1
  135. package/dist/app/apps/dashboard/.next/static/chunks/{3vb0dg3il6-rb.js → 2yfl6coqli4y3.js} +2 -2
  136. package/dist/app/apps/dashboard/.next/static/chunks/{26rmh4jb1a3nq.js → 39c6t_gt5j746.js} +1 -1
  137. package/dist/app/apps/dashboard/.next/static/chunks/3kbm-1q4uj4zs.js +15 -0
  138. package/dist/app/apps/dashboard/.next/static/chunks/{2ksz5ltjd7lss.js → 422r_9lx6bvwu.js} +1 -1
  139. package/dist/app/apps/dashboard/.next/static/chunks/{1v4hz3-8oktml.js → 43f5keprbd6za.js} +1 -1
  140. package/dist/app/apps/dashboard/package.json +2 -2
  141. package/dist/app/apps/dashboard/server.js +1 -1
  142. package/package.json +2 -2
  143. package/dist/app/apps/dashboard/.next/static/chunks/0qfvdc54-_wls.js +0 -15
  144. package/dist/app/apps/dashboard/.next/static/chunks/3q0oq5yy3hszn.js +0 -1
  145. /package/dist/app/apps/dashboard/.next/static/{RJzcgsvLiZvGVu7o2g_Hd → yoKjJcLs0SBAslui78EBu}/_buildManifest.js +0 -0
  146. /package/dist/app/apps/dashboard/.next/static/{RJzcgsvLiZvGVu7o2g_Hd → yoKjJcLs0SBAslui78EBu}/_clientMiddlewareManifest.js +0 -0
  147. /package/dist/app/apps/dashboard/.next/static/{RJzcgsvLiZvGVu7o2g_Hd → yoKjJcLs0SBAslui78EBu}/_ssgManifest.js +0 -0
@@ -0,0 +1,15 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,86421,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(93999),r=e.i(46670),n=e.i(68759),i=e.i(71417),l=e.i(82983),d=e.i(4050),c=e.i(77071),o=e.i(41120),u=e.i(15281),m=e.i(59659),x=e.i(66627),p=e.i(32781),h=e.i(99847),f=e.i(53138),g=e.i(84026),j=e.i(4139),b=e.i(86207),y=e.i(57665),v=e.i(41220),N=e.i(69174);let w=["/boot","/snap","/var/lib/docker/","/var/lib/containers/"],k=new Set(["iso9660","squashfs"]);var C=e.i(22016),S=e.i(14098),R=e.i(64971),z=e.i(62368),E=e.i(95925),$=e.i(69846),U=e.i(56420);let A={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};A.node;let I=(0,U.f)(A);var P=e.i(66794),O=e.i(35673),_=e.i(39430);function T(e){return e?.isGitRepo!==!1&&e?.legacyGitSelfUpdate===!0}function F(){let{activeNode:e,removeNode:a}=(0,d.l)(),[i,c]=(0,s.useState)("checking"),u=(0,s.useRef)(null),[x,h]=(0,s.useState)(null),[f,g]=(0,s.useState)(!1),[j,b]=(0,s.useState)(null),[y,w]=(0,s.useState)(null),[k,C]=(0,s.useState)("idle"),[S,U]=(0,s.useState)(null),[A,F]=(0,s.useState)(null),[K,B]=(0,s.useState)(!1),[D,q]=(0,s.useState)(null),[L,V]=(0,s.useState)(!1),M=(0,s.useCallback)(async()=>{try{let t=(0,_.L)(e.url),s=await fetch("/api/proxy/health",{method:"GET",headers:t,signal:AbortSignal.timeout(8e3)});c(s.ok?"online":"offline")}catch{c("offline")}},[e.url]),G=(0,s.useCallback)(async()=>{try{let e=await l.f.selfUpdate.version();e.success&&h(e.data??null)}catch{}},[]);(0,s.useEffect)(()=>(c("checking"),h(null),g(!1),w(null),U(null),F(null),M(),G(),u.current=setInterval(()=>{M()},3e4),()=>{u.current&&(clearInterval(u.current),u.current=null)}),[e.id,M,G]);let H=async()=>{C("checking"),F(null),U(null);try{let e=await l.f.selfUpdate.status();e.success&&b(e.data??null);let t=await l.f.selfUpdate.check();t.success&&(w(t.data??null),t.data.error?F(t.data.error):t.data.available||U("Already up to date."))}catch(t){let e="Failed to check for updates";if(t&&"object"==typeof t&&"response"in t)try{let s=(0,R.R)(await (0,R.O)(t));s&&(e=s)}catch{}else t instanceof Error&&(e=t.message);F(e)}finally{C("idle")}},J=async e=>{C("applying"),F(null),U(null);try{let t=await l.f.selfUpdate.apply(e);if(t.success){let e=t.data;if(!e)return;e.updated?U(`Updated from v${e.previousVersion} → v${e.currentVersion}`+(e.restart?.scheduled?`. Restarting via ${e.restart.method}…`:". Restart manually to apply.")):U("Code pulled but no version change detected."),w(null),G();let s=await l.f.selfUpdate.status();s.success&&b(s.data??null)}}catch(e){F(e instanceof Error?e.message:"Update failed")}finally{C("idle")}},W=async()=>{C("restarting"),F(null);try{let e=await l.f.selfUpdate.restart();e.success&&U(`Restart scheduled via ${e.data.method}. Reconnecting shortly…`)}catch(e){F(e instanceof Error?e.message:"Restart failed")}finally{C("idle")}},Y=async()=>{if(confirm(`Delete control node "${e.name}"? You'll be switched to another node.`))try{await a(e.id)}catch{}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"rounded border border-border bg-surface",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-5 py-3",children:[(0,t.jsx)("div",{className:"flex items-center gap-4 min-w-0",children:(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)(v.f,{className:"h-4.5 w-4.5 text-primary shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 rounded border border-border bg-bg px-2.5 py-1 text-xs font-bold min-w-0",children:[(0,t.jsx)(v.f,{className:"h-3.5 w-3.5 shrink-0 text-text-muted"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]}),(0,t.jsx)("button",{onClick:()=>{q(e.id),V(!1),B(!0)},className:"rounded border border-border bg-bg p-1.5 text-text-muted transition-all hover:bg-surface-hover hover:text-text hover:border-primary/30 hover:shadow-[0_0_20px_var(--color-glow)]",title:"Control Node Settings",children:(0,t.jsx)(P.f,{className:"h-3.5 w-3.5"})}),(()=>{switch(i){case"checking":return(0,t.jsxs)(r.t,{variant:"info",children:[(0,t.jsx)(p.f,{className:"mr-1 h-3 w-3 animate-spin"}),"Checking"]});case"online":return(0,t.jsx)(r.t,{variant:"success",children:"Online"});case"offline":return(0,t.jsx)(r.t,{variant:"danger",children:"Offline"})}})()]}),(0,t.jsxs)("div",{className:"text-xs text-text-muted truncate mt-0.5",children:[e.url,x&&(0,t.jsxs)("span",{className:"ml-2",children:["v",x.controlApiVersion]})]})]})]})}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,t.jsxs)(n.K,{variant:"ghost",size:"sm",title:"Check for updates",onClick:()=>{f?g(!1):(g(!0),(async()=>{try{let e=await l.f.selfUpdate.status();e.success&&(b(e.data??null),T(e.data)&&H())}catch{}})())},children:[(0,t.jsx)(N.f,{className:"h-3.5 w-3.5 text-primary"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Update"})]}),(0,t.jsx)(n.K,{variant:"ghost",size:"sm",title:"Delete control node",onClick:()=>void Y(),children:(0,t.jsx)(m.f,{className:"h-3.5 w-3.5 text-danger"})}),(0,t.jsx)(n.K,{variant:"ghost",size:"sm",title:"Refresh status",onClick:()=>{c("checking"),M(),G()},children:(0,t.jsx)(o.f,{className:"h-3.5 w-3.5"})})]})]}),f&&(0,t.jsxs)("div",{className:"border-t border-border px-5 py-3 space-y-3",children:[A&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 p-3 text-xs text-danger",children:A}),S&&(0,t.jsx)("div",{className:"rounded border border-success/30 bg-success/10 p-3 text-xs text-success",children:S}),j&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-x-6 gap-y-1 text-[11px] text-text-muted",children:[(0,t.jsxs)("span",{children:["Control API: ",(0,t.jsxs)("span",{className:"text-text",children:["v",j.controlApiVersion]})]}),(0,t.jsxs)("span",{children:["Agent: ",(0,t.jsxs)("span",{className:"text-text",children:["v",j.agentVersion]})]}),j.gitBranch&&(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)($.f,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"text-text",children:j.gitBranch})]}),j.gitCommit&&(0,t.jsxs)("span",{children:["Commit: ",(0,t.jsx)("span",{className:"text-text",children:j.gitCommit})]}),j.lastChecked&&(0,t.jsxs)("span",{children:["Checked: ",new Date(j.lastChecked).toLocaleString()]})]}),j&&!T(j)&&(0,t.jsxs)("div",{className:"rounded border border-primary/30 bg-primary/10 p-3 text-xs text-text-muted",children:[(0,t.jsx)("span",{className:"font-bold text-primary",children:"Upgrade on the server host"}),(0,t.jsxs)("span",{className:"ml-1",children:["with ",(0,t.jsx)("code",{className:"rounded bg-surface px-1 text-text",children:j.upgradeCommand??"magnus upgrade"}),": it backs up the database, migrates, restarts and switches back automatically if the new version is unhealthy."]})]}),y?.available&&(0,t.jsxs)("div",{className:"rounded border border-warning/30 bg-warning/10 p-3 text-xs",children:[(0,t.jsx)("span",{className:"font-bold text-warning uppercase tracking-wider",children:"Update available"}),(0,t.jsxs)("span",{className:"text-text-muted ml-1",children:["— ",y.behindBy," commit",1!==y.behindBy?"s":""," behind (",y.currentCommit," → ",y.remoteCommit,")"]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[T(j)&&(0,t.jsx)(n.K,{variant:"secondary",size:"sm",onClick:()=>void H(),disabled:"idle"!==k,icon:"checking"===k?(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(o.f,{className:"h-3.5 w-3.5"}),children:"checking"===k?"Checking…":"Check for Updates"}),T(j)&&y?.available&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.K,{variant:"primary",size:"sm",onClick:()=>void J(!1),disabled:"idle"!==k,icon:"applying"===k?(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(z.f,{className:"h-3.5 w-3.5"}),children:"applying"===k?"Updating…":"Pull & Build"}),(0,t.jsx)(n.K,{variant:"primary",size:"sm",onClick:()=>void J(!0),disabled:"idle"!==k,icon:"applying"===k?(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(E.f,{className:"h-3.5 w-3.5"}),children:"applying"===k?"Updating…":"Pull, Build & Restart"})]}),T(j)&&(0,t.jsx)(n.K,{variant:"ghost",size:"sm",onClick:()=>void W(),disabled:"idle"!==k,icon:"restarting"===k?(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(E.f,{className:"h-3.5 w-3.5"}),children:"restarting"===k?"Restarting…":"Restart Only"}),(0,t.jsx)("div",{className:"ml-auto",children:(0,t.jsx)(n.K,{variant:"ghost",size:"sm",onClick:()=>g(!1),icon:(0,t.jsx)(I,{className:"h-3.5 w-3.5"}),children:"Close"})})]})]})]}),(0,t.jsx)(O.f,{open:K,onClose:()=>{B(!1),q(null),V(!1),M(),G()},editNodeId:D,createMode:L})]})}var K=e.i(32568);function B({open:a,onClose:r,node:n}){let i=(0,s.useRef)(null),l=(0,s.useRef)(null),d=(0,s.useRef)(null),c=(0,s.useRef)(null),o=(0,s.useRef)(!1),u=(0,s.useRef)(null),[m,x]=(0,s.useState)("connecting"),p=(0,s.useRef)(""),h=(0,s.useRef)(null),f=(0,s.useCallback)(()=>{h.current=null;let e=p.current;e&&c.current&&(p.current="",fetch("/api/terminal/input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:c.current,data:e})}).catch(()=>{}))},[]),g=(0,s.useCallback)(()=>{if(!o.current){o.current=!0,h.current&&(clearTimeout(h.current),h.current=null),u.current?.abort(),u.current=null,c.current&&(fetch("/api/terminal/close",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:c.current})}).catch(()=>{}),c.current=null);try{l.current?.dispose()}catch{}l.current=null,d.current=null}},[]);(0,s.useEffect)(()=>{if(!a||!n||!i.current)return;o.current=!1,x("connecting");let t=!1;(async()=>{let s,{Terminal:a}=await e.A(37138),{FitAddon:r}=await e.A(59439);if(!document.getElementById("xterm-css")){let e=document.createElement("style");e.id="xterm-css",e.textContent=`
2
+ .xterm { position: relative; user-select: none; }
3
+ .xterm.focus, .xterm:focus { outline: none; }
4
+ .xterm .xterm-helpers { position: absolute; top: 0; z-index: 5; }
5
+ .xterm .xterm-helper-textarea { padding: 0; border: 0; margin: 0; position: absolute; opacity: 0; left: -9999em; top: 0; width: 0; height: 0; z-index: -5; white-space: nowrap; overflow: hidden; resize: none; }
6
+ .xterm .composition-view { display: none; position: absolute; white-space: nowrap; z-index: 1; }
7
+ .xterm .xterm-viewport { background-color: transparent !important; overflow-y: scroll; cursor: default; position: absolute; right: 0; left: 0; top: 0; bottom: 0; scrollbar-width: thin; scrollbar-color: #5a5a7a transparent; }
8
+ .xterm .xterm-screen { position: relative; }
9
+ .xterm .xterm-screen canvas { position: absolute; left: 0; top: 0; }
10
+ .xterm .xterm-decoration-container .xterm-decoration { z-index: 6; position: absolute; }
11
+ .xterm .xterm-decoration-top-layer { z-index: 7; position: relative; }
12
+ `,document.head.appendChild(e)}if(t||o.current)return;let m=new a({cursorBlink:!0,scrollback:1e3,fontFamily:'"JetBrains Mono", "Fira Code", "Cascadia Code", monospace',fontSize:13,theme:{background:"#06060d",foreground:"#e0e0ec",cursor:"#00e5ff",cursorAccent:"#06060d",selectionBackground:"#00e5ff33",black:"#06060d",red:"#ff1744",green:"#00ff41",yellow:"#ffb300",blue:"#00b0ff",magenta:"#ff006e",cyan:"#00e5ff",white:"#e0e0ec",brightBlack:"#5a5a7a",brightRed:"#ff5252",brightGreen:"#69f0ae",brightYellow:"#ffd740",brightBlue:"#40c4ff",brightMagenta:"#ff4081",brightCyan:"#18ffff",brightWhite:"#ffffff"}}),g=new r;if(m.loadAddon(g),l.current=m,d.current=g,i.current&&(m.open(i.current),requestAnimationFrame(()=>{o.current||g.fit()})),t||o.current)return;let j=g.proposeDimensions(),b=j?.cols??120,y=j?.rows??30,v=n.hostname||n.ipAddress;m.write(`\x1b[38;2;138;138;171mConnecting to ${v} as ${v===n.hostname?n.hostname:n.ipAddress}...\x1b[0m\r
13
+ `);try{let e=await fetch("/api/terminal/open",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({host:v,cols:b,rows:y})});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??`HTTP ${e.status}`)}c.current=s=(await e.json()).sessionId}catch(s){if(t||o.current)return;let e=s instanceof Error?s.message:"Unknown error";m.write(`\r
14
+ \x1b[31mFailed to open session: ${e}\x1b[0m\r
15
+ `),x("error");return}if(t||o.current)return;x("connected");let N=new AbortController;u.current=N,(async()=>{try{let e=await fetch(`/api/terminal/stream?sessionId=${encodeURIComponent(s)}`,{signal:N.signal});if(!e.ok||!e.body){t||o.current||(m.write("\r\n\x1b[31mFailed to connect output stream\x1b[0m\r\n"),x("error"));return}let a=e.body.getReader();for(;;){let{done:e,value:s}=await a.read();if(e||t||o.current)break;s&&m.write(s)}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return}t||o.current||(x("closed"),m.write("\r\n\x1b[38;2;138;138;171m── Session ended ──\x1b[0m\r\n"))})(),m.onData(e=>{!o.current&&c.current&&(p.current+=e,h.current||(h.current=setTimeout(f,16)))}),m.onResize(({cols:e,rows:t})=>{!o.current&&c.current&&fetch("/api/terminal/resize",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:c.current,cols:e,rows:t})}).catch(()=>{})})})();let s=()=>{d.current&&!o.current&&d.current.fit()};return window.addEventListener("resize",s),()=>{t=!0,window.removeEventListener("resize",s),g()}},[a,n,g,f]);let b=(0,s.useCallback)(()=>{g(),r()},[g,r]);return n?(0,t.jsx)(K.n,{open:a,onClose:b,title:`Terminal: ${n.name}`,description:"Interactive SSH session",icon:(0,t.jsx)(j.f,{className:"h-5 w-5 text-primary"}),className:"max-w-5xl",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("div",{className:"absolute top-0 right-0 z-10 flex items-center gap-1.5 px-2 py-1",children:[(0,t.jsx)("div",{className:`h-1.5 w-1.5 rounded-full ${"connected"===m?"bg-success":"connecting"===m?"bg-warning animate-pulse":"error"===m?"bg-danger":"bg-text-muted"}`}),(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-text-muted",children:m})]}),(0,t.jsx)("div",{ref:i,className:"h-[65vh] w-full rounded border border-border/50 bg-[#06060d] p-1 overflow-hidden"})]})}):null}var D=e.i(63376),q=e.i(67683),L=e.i(73404),V=e.i(51196),M=e.i(75723),G=e.i(2067),H=e.i(65369),J=e.i(51757);let W={name:"octagon-x",size:24,node:[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-octagon"]};W.node;let Y=(0,U.f)(W);var Q=e.i(83967);async function X(e){let t=await (0,R.O)(e),s=(0,R.R)(t),a=t?.error?.code;return s?"string"!=typeof a||s.includes(a)?s:`${s} (${a})`:e instanceof Error?e.message:String(e)}function Z(e){return e?.response?.status===404}function ee(e){return e.detail?e.code&&!e.detail.includes(e.code)?`${e.code}: ${e.detail}`:e.detail:e.code??null}let et={pending:{label:"Queued",variant:"default"},requested:{label:"Installing",variant:"info"},confirmed:{label:"Upgraded",variant:"success"},reverted:{label:"Reverted",variant:"danger"},failed:{label:"Failed",variant:"danger"},refused:{label:"Refused",variant:"warning"},skipped:{label:"Skipped",variant:"default"}};function es({open:e,onClose:a,onFinished:i}){let d,c,[o,u]=(0,s.useState)(null),[m,x]=(0,s.useState)(new Set),[h,f]=(0,s.useState)(null),[g,j]=(0,s.useState)(null),[b,y]=(0,s.useState)(!1),v=async e=>j(await X(e)),w=(0,s.useCallback)(async()=>{j(null);try{let e=await l.f.agentUpgrades.eligibility();u(e),x(new Set(e.nodes.filter(e=>e.eligible).map(e=>e.nodeId))),f(e.latestRun??null)}catch(e){j(await X(e))}},[]);(0,s.useEffect)(()=>{e&&(f(null),w())},[e,w]),(0,s.useEffect)(()=>{if(!h||"running"!==h.status)return;let e=window.setInterval(()=>{l.f.agentUpgrades.run(h.id).then(e=>{f(e),"running"!==e.status&&i?.()}).catch(async t=>{window.clearInterval(e),j(Z(t)?`Upgrade run ${h.id} is no longer known to the server`:await X(t)),Z(t)&&f(null)})},5e3);return()=>window.clearInterval(e)},[h,i]);let k=(0,s.useMemo)(()=>o?.nodes.filter(e=>e.eligible).length??0,[o]),C=o&&(!h||"running"!==h.status),S=async e=>{y(!0),j(null);try{f(await e())}catch(e){await v(e)}finally{y(!1)}};return(0,t.jsx)(K.n,{open:e,onClose:a,title:"Upgrade agents",icon:(0,t.jsx)(N.f,{className:"h-4 w-4"}),description:o?(d=o.version===o.serverVersion?" (the agent version bundled with this server)":"",c=o.release&&!o.release.verified?`; not verified on the registry: ${o.release.reason??"unknown"}`:"",`Target: magnus-agent ${o.version}${d}${o.prerelease?", a prerelease":""}${c}`):void 0,className:"max-w-2xl",children:(0,t.jsxs)("div",{className:"space-y-4 text-[11px]",children:[g&&(0,t.jsx)("div",{className:"rounded border border-danger/40 bg-danger/10 px-3 py-2 text-danger","data-testid":"agent-upgrade-error",children:g}),o&&!o.upgradesEnabled&&(0,t.jsxs)("div",{className:"rounded border border-warning/40 bg-warning/10 px-3 py-2 text-warning",children:["Agent upgrades are off: ",o.disabledReason]}),!o&&!g&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,t.jsx)(p.f,{className:"h-4 w-4 animate-spin"})," Checking agents…"]}),h&&(0,t.jsxs)("div",{className:"space-y-2","data-testid":"agent-upgrade-run",children:[(0,t.jsxs)("p",{className:"flex items-center gap-2",children:["running"===h.status&&(0,t.jsx)(p.f,{className:"h-4 w-4 animate-spin text-primary"}),"succeeded"===h.status&&(0,t.jsx)(J.f,{className:"h-4 w-4 text-success"}),("failed"===h.status||"interrupted"===h.status)&&(0,t.jsx)(Q.f,{className:"h-4 w-4 text-danger"}),"stopped"===h.status&&(0,t.jsx)(Y,{className:"h-4 w-4 text-warning"}),(0,t.jsx)("span",{className:"font-bold uppercase tracking-wider",children:"running"===h.status?`Upgrading to ${h.version}${h.stopRequestedBy?" (stopping after the nodes in progress)":""}`:`Last run: ${h.status}`})]}),"running"!==h.status&&h.message&&(0,t.jsx)("p",{className:"text-text-muted","data-testid":"agent-upgrade-run-message",children:h.message}),(0,t.jsxs)("ul",{className:"max-h-80 divide-y divide-border/40 overflow-y-auto rounded border border-border",children:[h.nodes.map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsxs)("span",{className:"w-40 truncate font-medium text-text",children:[e.name,e.nodeId===(h.canaryNodeId??h.nodes[0]?.nodeId)?" (canary)":""]}),(0,t.jsxs)("span",{className:"num w-28 text-text-muted",children:[e.from," → ",h.version]}),(0,t.jsxs)(r.t,{variant:et[e.state]?.variant??"default",children:["requested"===e.state&&(0,t.jsx)(p.f,{className:"mr-1 inline h-3 w-3 animate-spin"}),"reverted"===e.state&&(0,t.jsx)(E.f,{className:"mr-1 inline h-3 w-3"}),et[e.state]?.label??e.state]}),ee(e)&&(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-text-muted",title:ee(e)??void 0,children:ee(e)})]},e.nodeId)),(h.excluded??[]).map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-3 px-3 py-2 opacity-60",title:e.reason,children:[(0,t.jsx)("span",{className:"w-40 truncate font-medium text-text",children:e.name}),(0,t.jsx)(r.t,{variant:"default",children:"Not included"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-text-muted",children:e.reason})]},`excluded-${e.nodeId}`))]})]}),C&&(0,t.jsxs)("ul",{className:"max-h-80 divide-y divide-border/40 overflow-y-auto rounded border border-border","data-testid":"agent-upgrade-candidates",children:[o.nodes.map(e=>(0,t.jsxs)("li",{className:`flex items-center gap-3 px-3 py-2 ${e.eligible&&o.upgradesEnabled?"":"opacity-50"}`,title:e.reason??void 0,children:[(0,t.jsx)("input",{type:"checkbox","aria-label":`Upgrade ${e.name}`,checked:m.has(e.nodeId),disabled:!e.eligible||!o.upgradesEnabled,onChange:()=>{let t;return t=e.nodeId,x(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})}}),(0,t.jsx)("span",{className:"w-40 truncate font-medium text-text",children:e.name}),(0,t.jsx)("span",{className:"num w-20 text-text-muted",children:e.version}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-text-muted",children:e.eligible?`→ ${o.version}`:e.reason})]},e.nodeId)),0===o.nodes.length&&(0,t.jsx)("li",{className:"px-3 py-2 text-text-muted",children:"No nodes registered."})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-text-muted",children:"The first agent is a canary. Each agent switches back by itself if the new version does not report a heartbeat in time. A revert or failure stops the run; an agent that refuses before changing anything is skipped over."}),(0,t.jsxs)("div",{className:"flex shrink-0 gap-2",children:[(0,t.jsx)(n.K,{variant:"secondary",size:"sm",onClick:a,children:"Close"}),h?.status==="running"&&(0,t.jsx)(n.K,{variant:"danger",size:"sm",onClick:()=>void(h&&S(()=>l.f.agentUpgrades.stop(h.id))),"data-testid":"agent-upgrade-stop",disabled:b||!!h.stopRequestedBy,icon:(0,t.jsx)(Y,{className:"h-3.5 w-3.5"}),children:"Stop"}),!!(h&&"running"!==h.status&&h.nodes.some(e=>["failed","refused","skipped","requested"].includes(e.state)))&&o?.upgradesEnabled&&(0,t.jsx)(n.K,{variant:"secondary",size:"sm",onClick:()=>void(h&&S(()=>l.f.agentUpgrades.retry(h.id))),"data-testid":"agent-upgrade-retry",disabled:b,icon:(0,t.jsx)(E.f,{className:"h-3.5 w-3.5"}),children:"Retry the rest"}),C&&(0,t.jsxs)(n.K,{variant:"primary",size:"sm",onClick:()=>void S(()=>l.f.agentUpgrades.start({nodeIds:[...m],version:o?.version,...o?.prerelease?{allowPrerelease:!0}:{}})),"data-testid":"agent-upgrade-start",disabled:b||0===m.size||!o?.upgradesEnabled,icon:b?(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(N.f,{className:"h-3.5 w-3.5"}),children:["Upgrade ",m.size||k," agent",1===(m.size||k)?"":"s"]})]})]})]})})}function ea(e){try{let t=JSON.parse(e);if("string"==typeof t.deployError)return{label:"Deploy failed",message:t.deployError};if("string"==typeof t.upgradeError)return{label:"Upgrade failed",message:t.upgradeError};return null}catch{return null}}e.s(["default",0,function({initialNodes:e,initialTailscaleSummary:R}){let z,E,{activeNode:$}=(0,d.l)(),[U,A]=(0,s.useState)(e),[I,P]=(0,s.useState)((!!e.length||void 0===e)&&!1),[O,_]=(0,s.useState)(null),[T,K]=(0,s.useState)(!1),[J,W]=(0,s.useState)(!1);(0,s.useEffect)(()=>{"agents"===new URLSearchParams(window.location.search).get("upgrade")&&W(!0)},[]);let[Y,Q]=(0,s.useState)(null),[X,Z]=(0,s.useState)(null),[ee,et]=(0,s.useState)(!1),[er,en]=(0,s.useState)([]),[ei,el]=(0,s.useState)(null),[ed,ec]=(0,s.useState)({}),[eo,eu]=(0,s.useState)(null),[em,ex]=(0,s.useState)(R),ep=(0,s.useRef)(null),eh=(0,s.useRef)({}),[ef,eg]=(0,s.useState)(e.length>0),ej=(0,s.useCallback)(async(e=!1)=>{try{e||P(!0),_(null);let[t,s,a]=await Promise.all([l.f.nodes.list(),l.f.nodes.systemUpdatesSummary().catch(()=>null),l.f.nodes.tailscaleSummary().catch(()=>null)]),r=t.data.map(e=>{if(e.role)return delete eh.current[e.id],e;let t=eh.current[e.id];return void 0!==t?{...e,role:t}:e});A(r),eu(s?.data??null),ex(a?.data??null);let n=await Promise.all(r.map(async e=>{try{let t=await l.f.nodes.health(e.id);return[e.id,t.data]}catch{return[e.id,null]}}));ec(Object.fromEntries(n.filter(e=>null!==e[1])))}catch(a){let t=a instanceof Error?a.message:String(a),s="Failed to fetch"===t||t.includes("TypeError")||t.includes("NetworkError")||t.includes("ECONNREFUSED")||t.includes("timeout");e||_(s?`Control node unreachable (${$.name})`:t)}finally{e||P(!1)}},[$.name]);(0,s.useEffect)(()=>{if(ef){eg(!1),(async()=>{e.length>0&&ec(Object.fromEntries((await Promise.all(e.map(async e=>{try{let t=await l.f.nodes.health(e.id);return[e.id,t.data]}catch{return[e.id,null]}}))).filter(e=>null!==e[1])));try{let e=await l.f.nodes.systemUpdatesSummary();eu(e.data)}catch{eu(null)}try{let e=await l.f.nodes.tailscaleSummary();ex(e.data??null)}catch{ex(null)}})();return}A([]),_(null),en([]),ec({}),eu(null),ex(null),eh.current={},ej()},[$.id]),(0,s.useEffect)(()=>{let e=U.some(e=>"PROVISIONING"===e.status||e.agent?.status==="UPDATING");return e&&!ep.current?ep.current=setInterval(()=>{ej(!0)},4e3):!e&&ep.current&&(clearInterval(ep.current),ep.current=null),()=>{ep.current&&(clearInterval(ep.current),ep.current=null)}},[U,ej]);let eb=async e=>{if(confirm(`Delete node "${e.name}"? This will permanently remove it and all associated data.`))try{await l.f.nodes.delete(e.id),ej()}catch{}},ey=async()=>{et(!0),en([]);try{let e=await l.f.discovery.scan(5e3);e.success&&Array.isArray(e.data)&&en(e.data)}catch{}finally{et(!1)}};return(0,t.jsxs)(D.U,{className:"space-y-6",children:[(0,t.jsx)(D.z,{children:(0,t.jsx)(L.f,{title:"Nodes",eyebrow:"Fleet",description:"Manage your Magnus fleet nodes",status:U.length>0?(0,t.jsxs)("span",{className:"flex items-center gap-3 text-[10px] uppercase tracking-wider text-text-muted",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(M.f,{status:"ONLINE",size:"xs"}),(0,t.jsx)("span",{className:"num",children:U.filter(e=>"ONLINE"===e.status).length})," online"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(M.f,{status:"OFFLINE",size:"xs",pulse:!1}),(0,t.jsx)("span",{className:"num",children:U.filter(e=>"OFFLINE"===e.status).length})," offline"]})]}):void 0,actions:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.K,{variant:"secondary",size:"sm",icon:(0,t.jsx)(o.f,{className:"h-3.5 w-3.5"}),onClick:()=>void ej(),children:"Refresh"}),(0,t.jsx)(n.K,{variant:"secondary",size:"sm",icon:(0,t.jsx)(N.f,{className:"h-3.5 w-3.5"}),onClick:()=>W(!0),"data-testid":"open-agent-upgrade",children:"Upgrade Agents"}),(0,t.jsx)(n.K,{variant:"secondary",size:"sm",icon:(0,t.jsx)(c.f,{className:"h-3.5 w-3.5"}),onClick:()=>K(!0),children:"Register Node"})]})})}),(0,t.jsx)(D.z,{children:(0,t.jsx)(F,{})}),em&&(0,t.jsx)(D.z,{children:(0,t.jsx)(q.f,{summary:em,showAction:!1})}),eo&&(0,t.jsx)(D.z,{children:(0,t.jsx)("section",{className:"panel-corners overflow-hidden rounded-panel border border-border bg-surface","aria-label":"System update readiness",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 divide-x divide-y divide-border/60 sm:grid-cols-4 sm:divide-y-0",children:[(0,t.jsxs)("div",{className:"col-span-2 flex items-center gap-3 px-4 py-3 sm:col-span-1",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-panel border border-primary/30 bg-primary/10 text-primary shadow-[0_0_10px_var(--color-glow)]",children:(0,t.jsx)(b.f,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Auto-update coverage"}),(0,t.jsxs)("p",{className:"num mt-0.5 text-sm font-semibold",children:[eo.enabled," / ",eo.reporting," enabled"]}),(0,t.jsx)(V.f,{className:"mt-1.5",value:eo.reporting>0?eo.enabled/eo.reporting*100:null,tone:eo.enabled===eo.reporting?"success":"warning",label:"Auto-update coverage"})]})]}),(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Action needed"}),(0,t.jsx)("p",{className:`num mt-1 text-lg font-bold ${eo.actionNeeded?"text-warning glow-text-warning":"text-success"}`,children:eo.actionNeeded})]}),(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Reboot debt"}),(0,t.jsxs)("p",{className:`num mt-1 flex items-center gap-1.5 text-lg font-bold ${eo.rebootRequired?"text-danger glow-text-danger":"text-success"}`,children:[eo.rebootRequired?(0,t.jsx)(y.f,{className:"h-4 w-4"}):null,eo.rebootRequired]})]}),(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsx)("p",{className:"text-[10px] font-bold uppercase tracking-[0.16em] text-text-muted",children:"Reporting"}),(0,t.jsxs)("p",{className:"num mt-1 text-lg font-bold",children:[eo.reporting," / ",eo.total]})]})]})})}),(0,t.jsx)(D.z,{children:(0,t.jsx)(a.N,{children:O?O.startsWith("Control node unreachable")?(0,t.jsx)(G.f,{tone:"warning",icon:(0,t.jsx)(x.f,{className:"h-5 w-5"}),title:O,description:"Cannot connect to this Control Node. Verify it is running and reachable.",action:(0,t.jsx)(n.K,{variant:"secondary",size:"sm",onClick:()=>void ej(),children:"Retry"})}):(0,t.jsx)(G.f,{tone:"danger",icon:(0,t.jsx)(h.f,{className:"h-5 w-5"}),title:"Error loading nodes",description:O,action:(0,t.jsx)(n.K,{variant:"secondary",size:"sm",onClick:()=>void ej(),children:"Retry"})}):I?(0,t.jsx)(H.F,{rows:6,cols:9,className:"border-0"}):0===U.length?(0,t.jsx)(G.f,{tone:"primary",icon:(0,t.jsx)(v.f,{className:"h-5 w-5"}),title:"No nodes registered",description:"Register your first Magnus node to get started.",action:(0,t.jsx)(n.K,{size:"sm",icon:(0,t.jsx)(c.f,{className:"h-3.5 w-3.5"}),onClick:()=>K(!0),children:"Register Node"})}):(0,t.jsx)("div",{className:"max-h-[70vh] overflow-auto",children:(0,t.jsxs)("table",{className:"w-full text-[11px]",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"sticky top-0 z-10 border-b border-primary/30 bg-surface/95 text-left text-[10px] font-bold uppercase tracking-[0.15em] text-text-muted shadow-[0_1px_0_var(--color-primary),0_4px_12px_-6px_var(--color-glow)] backdrop-blur-sm",children:[(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Name"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Host"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Address"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Status"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Agent"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Role"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"CPU"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Memory"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Persistent Disk"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Updates"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Tailscale key"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Last Heartbeat"}),(0,t.jsx)("th",{className:"pb-3",children:"Actions"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/50",children:U.map(e=>{var s;let a=ed[e.id],l=(function(e){if(Array.isArray(e))return e;if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}})(a?.disks).filter(e=>"/"===e.mountPoint||"/home"===e.mountPoint||e.mountPoint.startsWith("/home/")||e.mountPoint.startsWith("/mnt/")||e.mountPoint.startsWith("/srv/")).filter(e=>!w.some(t=>e.mountPoint===t||e.mountPoint.startsWith(t))).filter(e=>!k.has((e.filesystemType??"").toLowerCase())).sort((e,t)=>t.usagePercent-e.usagePercent)[0]??null,d=l?(s=l.usagePercent)>=95?"critical":s>=80?"warning":"normal":null,c=eo?.nodes.find(t=>t.id===e.id)?.systemUpdates??null,o=em?.nodes.find(t=>t.id===e.id)?.tailscale??null;return(0,t.jsxs)("tr",{className:"group/row relative transition-colors hover:bg-primary/[0.03] [&>td:first-child]:shadow-[inset_2px_0_0_transparent] hover:[&>td:first-child]:shadow-[inset_2px_0_0_var(--color-primary)]",children:[(0,t.jsx)("td",{className:"py-3 pl-2 pr-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(M.f,{status:e.status,size:"xs"}),"ONLINE"===e.status&&(0,t.jsx)("button",{onClick:()=>el(e),title:`Open terminal on ${e.name}`,className:"flex h-6 w-6 items-center justify-center rounded border border-border/50 text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:(0,t.jsx)(j.f,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(C.default,{href:`/nodes/${e.id}`,className:"font-medium text-primary hover:text-primary-hover transition-colors",children:e.name})]})}),(0,t.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:e.hostname}),(0,t.jsxs)("td",{className:"py-3 pr-4 text-text-muted",children:[e.ipAddress,":",e.port]}),(0,t.jsx)("td",{className:"py-3 pr-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(r.t,{variant:(0,r.k)(e.status),children:e.status}),("DEGRADED"===e.status||e.agent?.status==="ERROR")&&ea(e.metadata)&&(0,t.jsx)("span",{title:`${ea(e.metadata).label}: ${ea(e.metadata).message}`,children:(0,t.jsx)(h.f,{className:"h-3.5 w-3.5 text-danger cursor-help"})}),"PROVISIONING"===e.status&&(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 text-info animate-spin"})]})}),(0,t.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[e.agent?`v${e.agent.version}`:"—",e.agent?.status==="UPDATING"&&(0,t.jsx)(p.f,{className:"h-3 w-3 text-info animate-spin"})]})}),(0,t.jsx)("td",{className:"py-3 pr-4",children:e.role?(0,t.jsxs)("button",{className:"inline-flex items-center gap-1 rounded border border-primary/30 bg-primary/5 px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider text-primary hover:bg-primary/10 hover:border-primary/50 transition-all cursor-pointer",onClick:()=>Z(e),title:"Change role",children:[(0,t.jsx)(g.f,{className:"h-3 w-3"}),e.role.name]}):(0,t.jsx)("button",{className:"text-[10px] text-text-muted hover:text-primary transition-colors cursor-pointer uppercase tracking-wider",onClick:()=>Z(e),children:"+ Assign"})}),(0,t.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:a?(0,t.jsx)(V.f,{value:a.cpuUsagePercent,label:`${e.name} CPU`,valueLabel:`${a.cpuUsagePercent.toFixed(1)}%`,showValue:!0,className:"w-28"}):"—"}),(0,t.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:a?(0,t.jsxs)("div",{className:"w-36",children:[(0,t.jsx)(V.f,{value:a.memoryPercent,label:`${e.name} memory`,showValue:!0}),(0,t.jsxs)("span",{className:"num mt-0.5 block text-[10px] text-text-muted/80",children:[(a.memoryUsedBytes/0x40000000).toFixed(1)," / ",(a.memoryTotalBytes/0x40000000).toFixed(1)," GB"]})]}):"—"}),(0,t.jsx)("td",{className:"py-3 pr-4",children:l?(0,t.jsxs)("span",{className:"flex w-36 flex-col gap-0.5",title:`${l.mountPoint} filesystem is ${l.usagePercent}% used${"normal"===d?"":" — disk usage anomaly"}`,children:[(0,t.jsx)(V.f,{value:l.usagePercent,tone:"critical"===d?"danger":"warning"===d?"warning":"success",label:`${e.name} ${l.mountPoint} disk`,valueLabel:`${l.usagePercent.toFixed(0)}%`,glow:"normal"!==d,showValue:!0}),(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-text-muted",children:["normal"!==d&&(0,t.jsx)(f.f,{"aria-label":`${d} disk usage anomaly`,className:"critical"===d?"h-3 w-3 text-danger":"h-3 w-3 text-warning"}),l.mountPoint]})]}):(0,t.jsx)("span",{className:"text-text-muted",children:"—"})}),(0,t.jsx)("td",{className:"py-3 pr-4",children:c?c.rebootRequired?(0,t.jsx)(r.t,{variant:"danger",children:"reboot required"}):"enabled"===c.automaticUpdates?(0,t.jsx)(r.t,{variant:"success",children:"automatic"}):"unsupported"===c.automaticUpdates?(0,t.jsx)(r.t,{variant:"default",children:"unsupported"}):(0,t.jsx)(r.t,{variant:"warning",children:"enable updates"}):(0,t.jsx)(r.t,{variant:"default",children:"awaiting agent"})}),(0,t.jsx)("td",{className:"py-3 pr-4",title:o?.keyExpiry?`Expires ${o.keyExpiry}`:void 0,children:o?o.expiryEnabled?o.expired?(0,t.jsx)(r.t,{variant:"danger",children:"expired"}):null===o.daysRemaining?(0,t.jsx)(r.t,{variant:"default",children:"unknown"}):o.requiresRenewal?(0,t.jsxs)(r.t,{variant:"warning",children:[o.daysRemaining,"d"]}):(0,t.jsxs)(r.t,{variant:"success",children:[o.daysRemaining,"d"]}):(0,t.jsx)(r.t,{variant:"success",children:"no expiry"}):(0,t.jsx)(r.t,{variant:"default",children:"awaiting agent"})}),(0,t.jsx)("td",{className:"num py-3 pr-4 text-text-muted",children:(0,i.C)(e.lastHeartbeatAt)}),(0,t.jsx)("td",{className:"py-3",children:(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsx)(C.default,{href:`/nodes/${e.id}`,children:(0,t.jsx)(n.K,{variant:"ghost",size:"sm",children:"View"})}),(0,t.jsx)(n.K,{variant:"ghost",size:"sm",onClick:()=>Q(e),children:(0,t.jsx)(u.f,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(n.K,{variant:"ghost",size:"sm",onClick:()=>void eb(e),children:(0,t.jsx)(m.f,{className:"h-3.5 w-3.5 text-danger"})})]})})]},e.id)})})]})})})}),(0,t.jsx)(D.z,{children:(0,t.jsxs)(a.N,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(x.f,{className:"h-4 w-4 text-primary"}),(0,t.jsx)("h2",{className:"text-xs font-bold uppercase tracking-wider",children:"Network Discovery"}),(0,t.jsx)("span",{className:"text-[11px] text-text-muted",children:"— Unadopted agents found on the local network"})]}),(0,t.jsx)(n.K,{variant:"secondary",size:"sm",icon:ee?(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(x.f,{className:"h-3.5 w-3.5"}),onClick:()=>void ey(),disabled:ee,children:ee?"Scanning…":"Scan Network"})]}),0===er.length?ee?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 py-6",children:[(0,t.jsxs)("div",{className:"relative h-16 w-16 overflow-hidden rounded-full border border-primary/30 shadow-[0_0_16px_var(--color-glow)]",children:[(0,t.jsx)("div",{className:"absolute inset-0 animate-sweep rounded-full bg-[conic-gradient(from_0deg,transparent_0deg,transparent_280deg,var(--color-primary)_360deg)] opacity-60"}),(0,t.jsx)("div",{className:"absolute inset-[30%] rounded-full border border-primary/20"})]}),(0,t.jsx)("p",{className:"text-[11px] uppercase tracking-wider text-primary",children:"Broadcasting discovery probe…"})]}):(0,t.jsx)(G.f,{compact:!0,icon:(0,t.jsx)(x.f,{className:"h-4 w-4"}),title:"No scan results yet",description:'Click "Scan Network" to discover unadopted agents on your network.'}):(z=er.filter(e=>!e.registered),E=er.filter(e=>e.registered),0===z.length?(0,t.jsxs)("div",{className:"py-6 text-center text-[11px] text-text-muted",children:["All ",E.length," discovered agent",1!==E.length?"s":""," already registered. No new nodes to adopt."]}):(0,t.jsxs)("div",{className:"overflow-x-auto",children:[(0,t.jsxs)("table",{className:"w-full text-[11px]",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-primary/20 text-left text-[10px] font-bold uppercase tracking-[0.15em] text-text-muted",children:[(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Hostname"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"IP Address"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Port"}),(0,t.jsx)("th",{className:"pb-3 pr-4",children:"Agent Version"}),(0,t.jsx)("th",{className:"pb-3",children:"Registration"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/50",children:z.map(e=>(0,t.jsxs)("tr",{className:"hover:bg-surface-hover transition-colors",children:[(0,t.jsx)("td",{className:"py-3 pr-4 font-medium",children:e.fqdn||e.hostname}),(0,t.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:e.ip}),(0,t.jsx)("td",{className:"py-3 pr-4 text-text-muted",children:e.port}),(0,t.jsxs)("td",{className:"py-3 pr-4 text-text-muted",children:["v",e.version]}),(0,t.jsx)("td",{className:"py-3 text-text-muted",children:"Use the reviewed key-only agent deploy runbook, then register the authenticated heartbeat."})]},`${e.ip}:${e.port}`))})]}),E.length>0&&(0,t.jsxs)("p",{className:"mt-3 text-xs text-text-muted",children:[E.length," already-registered agent",1!==E.length?"s":""," ","hidden from this list."]})]}))]})}),(0,t.jsx)(es,{open:J,onClose:()=>W(!1),onFinished:()=>void ej()}),(0,t.jsx)(S.M,{open:T,onClose:()=>K(!1),onRegistered:()=>void ej()}),(0,t.jsx)(S.F,{open:!!Y,node:Y,onClose:()=>Q(null),onSaved:()=>void ej()}),(0,t.jsx)(S.E,{open:!!X,node:X,onClose:()=>Z(null),onSaved:e=>{X&&(eh.current[X.id]=e,A(t=>t.map(t=>t.id===X.id?{...t,role:e}:t))),ej()}}),(0,t.jsx)(B,{open:!!ei,onClose:()=>el(null),node:ei})]})}],86421)}]);
@@ -1 +1 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,11513,e=>{var t=e.i(43476),a=e.i(71645),s=e.i(93999),r=e.i(68759),i=e.i(46670),l=e.i(32568),n=e.i(82983),o=e.i(56420);let c={name:"folder-plus",size:24,node:[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};c.node;let d=(0,o.f)(c),x={name:"file-up",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:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]};x.node;let m=(0,o.f)(x);var p=e.i(32781);let h={name:"palette",size:24,node:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]};h.node;let u=(0,o.f)(h),g=["#6366f1","#8b5cf6","#ec4899","#ef4444","#f59e0b","#22c55e","#3b82f6","#06b6d4"];function f({open:e,mode:s,category:i,onClose:o,onSaved:c}){let[x,m]=(0,a.useState)(""),[h,y]=(0,a.useState)(""),[v,j]=(0,a.useState)("#6366f1"),[b,N]=(0,a.useState)(!1),[w,k]=(0,a.useState)("");(0,a.useEffect)(()=>{"edit"===s&&i?(m(i.name),y(i.description),j(i.color)):(m(""),y(""),j("#6366f1")),k("")},[s,i,e]);let C=async()=>{if(x.trim()){N(!0),k("");try{"create"===s?await n.f.library.categories.create({name:x.trim(),description:h.trim(),color:v}):i&&await n.f.library.categories.update(i.id,{name:x.trim(),description:h.trim(),color:v}),c(),o()}catch(e){k(e instanceof Error?e.message:"Failed to save category")}finally{N(!1)}}};return(0,t.jsx)(l.n,{open:e,onClose:o,title:"create"===s?"Create Category":"Edit Category",description:"create"===s?"Add a new organizational category":`Editing "${i?.name??""}"`,icon:(0,t.jsx)(d,{className:"h-5 w-5 text-primary"}),children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(l.G,{label:"Name",required:!0,children:(0,t.jsx)("input",{type:"text",value:x,onChange:e=>m(e.target.value),placeholder:"e.g. Personality, Templates, Config…",className:l.W,autoFocus:!0})}),(0,t.jsx)(l.G,{label:"Description",children:(0,t.jsx)("textarea",{value:h,onChange:e=>y(e.target.value),placeholder:"What kind of files belong here?",rows:2,className:l.M})}),(0,t.jsx)(l.G,{label:"Color",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[g.map(e=>(0,t.jsx)("button",{onClick:()=>j(e),className:`h-7 w-7 rounded-full border-2 transition-all ${v===e?"border-white scale-110":"border-transparent"}`,style:{backgroundColor:e}},e)),(0,t.jsxs)("div",{className:"ml-2 flex items-center gap-1.5",children:[(0,t.jsx)(u,{className:"h-3.5 w-3.5 text-text-muted"}),(0,t.jsx)("input",{type:"text",value:v,onChange:e=>j(e.target.value),className:`${l.W} !w-24`})]})]})}),w&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:w}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)(r.K,{variant:"secondary",size:"sm",onClick:o,children:"Cancel"}),(0,t.jsx)(r.K,{size:"sm",onClick:()=>void C(),disabled:b||!x.trim(),icon:b?(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:b?"Saving…":"create"===s?"Create Category":"Save Changes"})]})]})})}function y({open:e,mode:s,file:i,categories:o,onClose:c,onSaved:d}){let[x,h]=(0,a.useState)(""),[u,g]=(0,a.useState)(""),[f,v]=(0,a.useState)("text/markdown"),[j,b]=(0,a.useState)(""),[N,w]=(0,a.useState)(""),[k,C]=(0,a.useState)(""),[S,z]=(0,a.useState)(!1),[D,T]=(0,a.useState)("");(0,a.useEffect)(()=>{"edit"===s&&i?(h(i.name),g(i.fileName),v(i.mimeType),b(i.content),w(i.categoryId??""),C(i.tags.join(", "))):(h(""),g(""),v("text/markdown"),b(""),w(""),C("")),T("")},[s,i,e]);let M=async()=>{if(x.trim()&&u.trim()){z(!0),T("");try{let e=k.split(",").map(e=>e.trim()).filter(Boolean);"create"===s?await n.f.library.files.create({name:x.trim(),fileName:u.trim(),mimeType:f,content:j,categoryId:N||null,tags:e}):i&&await n.f.library.files.update(i.id,{name:x.trim(),fileName:u.trim(),mimeType:f,content:j,categoryId:N||null,tags:e}),d(),c()}catch(e){T(e instanceof Error?e.message:"Failed to save file")}finally{z(!1)}}};return(0,t.jsx)(l.n,{open:e,onClose:c,title:"create"===s?"Upload File":"Edit File",description:"create"===s?"Add a new file to the library":`Editing "${i?.name??""}"`,icon:(0,t.jsx)(m,{className:"h-5 w-5 text-primary"}),className:"max-w-2xl",children:(0,t.jsxs)("div",{className:"space-y-4",children:["create"===s&&(0,t.jsxs)(l.G,{label:"Upload File",children:[(0,t.jsx)("input",{type:"file",onChange:e=>{let t=e.target.files?.[0];if(!t)return;g(t.name),x||h(t.name.replace(/\.[^/.]+$/,"")),v(t.type||"application/octet-stream");let a=new FileReader;t.type.startsWith("text/")||t.name.endsWith(".md")||t.name.endsWith(".json")||t.name.endsWith(".yaml")||t.name.endsWith(".yml")||t.name.endsWith(".txt")?(a.onload=()=>b(a.result),a.readAsText(t)):(a.onload=()=>{b(a.result.split(",")[1]??"")},a.readAsDataURL(t))},accept:".md,.txt,.json,.yaml,.yml,.pdf,.png,.jpg,.jpeg,.gif,.svg,.webp",className:"block w-full text-xs text-text-muted file:mr-4 file:rounded file:border-0 file:bg-primary/10 file:px-4 file:py-2 file:text-xs file:font-bold file:text-primary hover:file:bg-primary/20 file:cursor-pointer"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Or fill in the fields manually below"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsx)(l.G,{label:"Display Name",required:!0,children:(0,t.jsx)("input",{type:"text",value:x,onChange:e=>h(e.target.value),placeholder:"SOUL",className:l.W})}),(0,t.jsx)(l.G,{label:"File Name",required:!0,children:(0,t.jsx)("input",{type:"text",value:u,onChange:e=>g(e.target.value),placeholder:"SOUL.md",className:l.W})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsx)(l.G,{label:"Category",children:(0,t.jsxs)("select",{value:N,onChange:e=>w(e.target.value),className:l.N,children:[(0,t.jsx)("option",{value:"",children:"Uncategorized"}),o.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,t.jsx)(l.G,{label:"MIME Type",children:(0,t.jsxs)("select",{value:f,onChange:e=>v(e.target.value),className:l.N,children:[(0,t.jsx)("option",{value:"text/markdown",children:"Markdown (.md)"}),(0,t.jsx)("option",{value:"text/plain",children:"Plain Text (.txt)"}),(0,t.jsx)("option",{value:"application/json",children:"JSON (.json)"}),(0,t.jsx)("option",{value:"application/pdf",children:"PDF (.pdf)"}),(0,t.jsx)("option",{value:"image/png",children:"PNG Image"}),(0,t.jsx)("option",{value:"image/jpeg",children:"JPEG Image"}),(0,t.jsx)("option",{value:"image/svg+xml",children:"SVG Image"})]})})]}),(0,t.jsxs)(l.G,{label:"Tags",children:[(0,t.jsx)("input",{type:"text",value:k,onChange:e=>C(e.target.value),placeholder:"personality, config, template",className:l.W}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated"})]}),(f.startsWith("text/")||"application/json"===f)&&(0,t.jsx)(l.G,{label:"Content",children:(0,t.jsx)("textarea",{value:j,onChange:e=>b(e.target.value),placeholder:"File content…",rows:8,className:`${l.M} text-xs`})}),D&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:D}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)(r.K,{variant:"secondary",size:"sm",onClick:c,children:"Cancel"}),(0,t.jsx)(r.K,{size:"sm",onClick:()=>void M(),disabled:S||!x.trim()||!u.trim(),icon:S?(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:S?"Saving…":"create"===s?"Upload File":"Save Changes"})]})]})})}function v({open:e,file:a,onClose:s}){if(!a)return null;let r="text/markdown"===a.mimeType||a.fileName.endsWith(".md"),i=a.mimeType.startsWith("text/")||"application/json"===a.mimeType,n=a.mimeType.startsWith("image/"),o="application/pdf"===a.mimeType;return(0,t.jsx)(l.n,{open:e,onClose:s,title:a.name,description:a.fileName,className:"max-w-4xl max-h-[80vh]",children:(0,t.jsxs)("div",{className:"overflow-auto max-h-[60vh]",children:[r&&(0,t.jsx)("div",{className:"prose prose-invert prose-sm max-w-none rounded border border-border bg-bg p-4 text-xs whitespace-pre-wrap leading-relaxed",children:a.content}),i&&!r&&(0,t.jsx)("pre",{className:"rounded border border-border bg-bg p-4 text-xs overflow-auto",children:a.content}),n&&(0,t.jsx)("div",{className:"flex items-center justify-center p-4",children:(0,t.jsx)("img",{src:a.content.startsWith("data:")?a.content:`data:${a.mimeType};base64,${a.content}`,alt:a.name,className:"max-w-full rounded"})}),o&&(0,t.jsx)("div",{className:"flex items-center justify-center p-8 text-text-muted",children:(0,t.jsx)("p",{className:"text-xs",children:"PDF preview not available. Use the download button instead."})}),!i&&!n&&!o&&(0,t.jsx)("div",{className:"flex items-center justify-center p-8 text-text-muted",children:(0,t.jsx)("p",{className:"text-xs",children:"Preview not available for this file type."})})]})})}var j=e.i(94371),b=e.i(51757),N=e.i(83967);function w({open:e,onClose:s,file:i}){let[o,c]=(0,a.useState)([]),[d,x]=(0,a.useState)([]),[m,h]=(0,a.useState)(!1),[u,g]=(0,a.useState)(null),[f,y]=(0,a.useState)(!1),v=(0,a.useCallback)(async()=>{y(!0);try{let e=await n.f.nodes.list({status:"ONLINE"});e.success&&Array.isArray(e.data)&&c(e.data.map(e=>({id:e.id,name:e.name,status:e.status})))}catch{}finally{y(!1)}},[]);(0,a.useEffect)(()=>{e&&(v(),x([]),g(null))},[e,v]);let k=async()=>{if(i&&0!==d.length){h(!0),g(null);try{let e=await n.f.libraryDeploy.deploy({fileId:i.id,nodeIds:d,overwrite:!0});e.success&&Array.isArray(e.data)&&g(e.data)}catch(e){g([{nodeId:"error",nodeName:"Deploy Error",status:"failed",error:e instanceof Error?e.message:"Unknown error"}])}finally{h(!1)}}},C=i?.mimeType==="application/x-magnus-skill"?"Skill":i?.mimeType==="application/x-magnus-cronjob"?"Cron Job":"Item";return(0,t.jsx)(l.n,{open:e,onClose:s,title:`Deploy ${C}`,description:i?.name??"",icon:(0,t.jsx)(j.f,{className:"h-5 w-5 text-primary"}),className:"max-w-lg",children:(0,t.jsxs)("div",{className:"space-y-4",children:[!u&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("label",{className:"text-[11px] font-bold uppercase tracking-wider text-text-muted",children:"Target Nodes"}),(0,t.jsx)("button",{onClick:()=>{x(o.map(e=>e.id))},className:"text-[10px] text-primary hover:text-primary/80 uppercase tracking-wider transition-all",children:"Select All"})]}),f?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs text-text-muted py-4 justify-center",children:[(0,t.jsx)(p.f,{className:"h-4 w-4 animate-spin"}),"Loading nodes..."]}):0===o.length?(0,t.jsx)("p",{className:"text-xs text-text-muted py-4 text-center",children:"No online nodes available"}):(0,t.jsx)("div",{className:"space-y-1 max-h-48 overflow-y-auto",children:o.map(e=>(0,t.jsxs)("label",{className:"flex items-center gap-3 rounded border border-border/50 px-3 py-2 hover:border-primary/30 hover:shadow-[0_0_20px_var(--color-glow)] transition-all cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:d.includes(e.id),onChange:()=>{var t;return t=e.id,void x(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"rounded border-border"}),(0,t.jsx)("span",{className:"text-xs",children:e.name})]},e.id))}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)(r.K,{variant:"secondary",size:"sm",onClick:s,children:"Cancel"}),(0,t.jsx)(r.K,{size:"sm",onClick:()=>void k(),disabled:m||0===d.length,children:m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Deploying..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Deploy to ",d.length," node",1!==d.length?"s":""]})})]})]}),u&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"space-y-2",children:u.map((e,a)=>(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded border border-border/50 px-3 py-2 text-xs",children:["success"===e.status?(0,t.jsx)(b.f,{className:"h-4 w-4 text-success shrink-0"}):(0,t.jsx)(N.f,{className:"h-4 w-4 text-danger shrink-0"}),(0,t.jsx)("span",{className:"font-bold",children:e.nodeName}),e.error&&(0,t.jsx)("span",{className:"text-[10px] text-danger/70 truncate",children:e.error})]},a))}),(0,t.jsx)("div",{className:"flex justify-end pt-2",children:(0,t.jsx)(r.K,{variant:"secondary",size:"sm",onClick:s,children:"Close"})})]})]})})}var k=e.i(4050),C=e.i(71417),S=e.i(78571),z=e.i(63376),D=e.i(70533),T=e.i(66595),M=e.i(41120),_=e.i(15281),E=e.i(59659),A=e.i(72382),I=e.i(62368);let F={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};F.node;let P=(0,o.f)(F);var L=e.i(89664);let U={name:"grip-vertical",size:24,node:[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]};U.node;let $=(0,o.f)(U);var W=e.i(26091),O=e.i(15170),G=e.i(5015),R=e.i(29600),B=e.i(69644);let K={name:"funnel",size:24,node:[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],aliases:["filter"]};K.node;let V=(0,o.f)(K),q={name:"layout-grid",size:24,node:[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]};q.node;let H=(0,o.f)(q),J={name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]};J.node;let Y=(0,o.f)(J);var Z=e.i(63676),Q=e.i(79258),X=e.i(74544);function ee(e){return"application/x-magnus-skill"===e?(0,t.jsx)(Q.f,{className:"h-4 w-4"}):"application/x-magnus-cronjob"===e?(0,t.jsx)(X.f,{className:"h-4 w-4"}):e.startsWith("image/")?(0,t.jsx)(O.f,{className:"h-4 w-4"}):"application/json"===e?(0,t.jsx)(G.f,{className:"h-4 w-4"}):"text/markdown"===e||"text/plain"===e?(0,t.jsx)(W.f,{className:"h-4 w-4"}):(0,t.jsx)(R.f,{className:"h-4 w-4"})}function et(e){return"application/x-magnus-skill"===e||"application/x-magnus-cronjob"===e}function ea(e){return({"text/markdown":"Markdown","text/plain":"Text","application/json":"JSON","application/pdf":"PDF","image/png":"PNG","image/jpeg":"JPEG","image/svg+xml":"SVG","image/gif":"GIF","image/webp":"WebP","application/x-magnus-skill":"Skill","application/x-magnus-cronjob":"Cron Job"})[e]??e.split("/")[1]?.toUpperCase()??"File"}e.s(["default",0,function({initialCategories:e,initialFiles:l,initialTotalFiles:o}){let{activeNode:c}=(0,k.l)(),[x,p]=(0,a.useState)(e),[h,u]=(0,a.useState)(l),[g,b]=(0,a.useState)(o),[N,F]=(0,a.useState)(!1),[U,W]=(0,a.useState)(l.length>0||e.length>0),[O,G]=(0,a.useState)(""),[R,K]=(0,a.useState)(null),[q,J]=(0,a.useState)(""),[Q,X]=(0,a.useState)("grid"),[es,er]=(0,a.useState)(!1),[ei,el]=(0,a.useState)("create"),[en,eo]=(0,a.useState)(null),[ec,ed]=(0,a.useState)(!1),[ex,em]=(0,a.useState)("create"),[ep,eh]=(0,a.useState)(null),[eu,eg]=(0,a.useState)(null),[ef,ey]=(0,a.useState)(null),[ev,ej]=(0,a.useState)(null),[eb,eN]=(0,a.useState)(null),[ew,ek]=(0,a.useState)(null),eC=(0,a.useCallback)(async()=>{try{let e=await n.f.library.categories.list();p(e.data)}catch{}},[]),eS=(0,a.useCallback)(async()=>{try{let e={};O&&(e.query=O),R&&(e.categoryId=R),q&&(e.mimeType=q),e.pageSize=100;let t=await n.f.library.files.list(e);u(t.data),b(t.pagination?.total??t.data.length)}catch{}},[O,R,q]),ez=(0,a.useCallback)(async()=>{F(!0),await Promise.all([eC(),eS()]),F(!1)},[eC,eS]);(0,a.useEffect)(()=>{U?W(!1):ez()},[ez,c.id]),(0,a.useEffect)(()=>{let e=setTimeout(()=>{eS()},300);return()=>clearTimeout(e)},[O,R,q,eS]);let eD=async e=>{if(confirm(`Delete category "${e.name}"? Files in this category will become uncategorized.`))try{await n.f.library.categories.delete(e.id),R===e.id&&K(null),ez()}catch{}},eT=()=>{em("create"),eh(null),ed(!0)},eM=async e=>{try{let t=(await n.f.library.files.get(e.id)).data;em("edit"),eh(t),ed(!0)}catch{}},e_=async e=>{if(confirm(`Delete "${e.name}" (${e.fileName})?`))try{await n.f.library.files.delete(e.id),ez()}catch{}},eE=async e=>{try{let t=await n.f.library.files.get(e.id);eg(t.data)}catch{}},eA=async e=>{try{let t=(await n.f.library.files.get(e.id)).data;await navigator.clipboard.writeText(t.content??""),ey(e.id),setTimeout(()=>ey(null),2e3)}catch{}},eI=async e=>{try{let t,a=(await n.f.library.files.get(e.id)).data,s=a.content??"";if(a.mimeType.startsWith("text/")||"application/json"===a.mimeType)t=new Blob([s],{type:a.mimeType});else{let e=atob(s),r=new Uint8Array(e.length);for(let t=0;t<e.length;t++)r[t]=e.charCodeAt(t);t=new Blob([r],{type:a.mimeType})}let r=URL.createObjectURL(t),i=document.createElement("a");i.href=r,i.download=a.fileName,i.click(),URL.revokeObjectURL(r)}catch{}},eF=e=>{eN(e)},eP=(e,t)=>{e.preventDefault(),ek(t)},eL=()=>{ek(null)},eU=async(e,t)=>{if(e.preventDefault(),ek(null),eb)try{await n.f.library.files.move({fileIds:[eb],categoryId:t}),ez()}catch{}finally{eN(null)}},[e$,eW]=(0,a.useState)(!1),eO=async e=>{e.preventDefault(),eW(!1);let t=e.dataTransfer.files;if(0!==t.length){for(let e=0;e<t.length;e++){let a=t[e];if(!a)continue;let s=a.name.replace(/\.[^/.]+$/,""),r=a.type||"application/octet-stream",i=await new Promise(e=>{let t=new FileReader;a.type.startsWith("text/")||a.name.endsWith(".md")||a.name.endsWith(".json")||a.name.endsWith(".yaml")||a.name.endsWith(".yml")||a.name.endsWith(".txt")?(t.onload=()=>e(t.result),t.readAsText(a)):(t.onload=()=>{e(t.result.split(",")[1]??"")},t.readAsDataURL(a))});try{await n.f.library.files.create({name:s,fileName:a.name,mimeType:r,content:i,categoryId:"uncategorized"===R?null:R})}catch{}}ez()}};return(0,t.jsxs)(z.U,{className:"space-y-6",children:[(0,t.jsx)(z.z,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-lg font-bold uppercase tracking-wider",children:"Library"}),(0,t.jsx)("p",{className:"mt-1 text-[11px] text-text-muted uppercase tracking-wider",children:"Browse, manage, and share Markdown, PDF, and image files"})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(r.K,{variant:"secondary",size:"sm",icon:(0,t.jsx)(M.f,{className:"h-3.5 w-3.5"}),onClick:()=>void ez(),children:"Refresh"}),(0,t.jsx)(r.K,{variant:"secondary",size:"sm",icon:(0,t.jsx)(d,{className:"h-3.5 w-3.5"}),onClick:()=>{el("create"),eo(null),er(!0)},children:"Category"}),(0,t.jsx)(r.K,{size:"sm",icon:(0,t.jsx)(m,{className:"h-3.5 w-3.5"}),onClick:eT,children:"Upload"})]})]})}),(0,t.jsx)(z.z,{children:(0,t.jsxs)("div",{className:"flex gap-6",children:[(0,t.jsxs)("div",{className:"w-56 shrink-0 space-y-2",children:[(0,t.jsx)("h3",{className:"text-[11px] font-bold uppercase tracking-wider text-text-muted mb-3",children:"Categories"}),(0,t.jsxs)("button",{onClick:()=>K(null),onDragOver:e=>eP(e,null),onDragLeave:eL,onDrop:e=>void eU(e,null),className:(0,S.f)("flex w-full items-center gap-2 rounded px-3 py-2 text-xs transition-all",null===R?"bg-primary/10 text-primary border border-primary/50":"border border-transparent text-text-muted hover:bg-surface-hover hover:text-text"),children:[(0,t.jsx)(D.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:"All Files"}),(0,t.jsx)("span",{className:"text-xs opacity-70",children:g})]}),(0,t.jsxs)("button",{onClick:()=>K("uncategorized"),onDragOver:e=>eP(e,"uncategorized"),onDragLeave:eL,onDrop:e=>void eU(e,null),className:(0,S.f)("flex w-full items-center gap-2 rounded px-3 py-2 text-xs transition-all","uncategorized"===ew&&"ring-2 ring-primary","uncategorized"===R?"bg-primary/10 text-primary border border-primary/50":"border border-transparent text-text-muted hover:bg-surface-hover hover:text-text"),children:[(0,t.jsx)(B.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:"Uncategorized"})]}),x.map(e=>(0,t.jsxs)("div",{onDragOver:t=>eP(t,e.id),onDragLeave:eL,onDrop:t=>void eU(t,e.id),className:(0,S.f)("group flex items-center gap-2 rounded px-3 py-2 text-xs transition-all cursor-pointer",ew===e.id&&"ring-2 ring-primary",R===e.id?"bg-primary/10 text-primary border border-primary/50":"border border-transparent text-text-muted hover:bg-surface-hover hover:text-text"),onClick:()=>K(e.id),children:[(0,t.jsx)("div",{className:"h-3 w-3 rounded-full shrink-0",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"flex-1 text-left truncate",children:e.name}),(0,t.jsx)("span",{className:"text-xs opacity-70",children:e.fileCount??0}),(0,t.jsxs)("div",{className:"hidden group-hover:flex gap-0.5",children:[(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),el("edit"),eo(e),er(!0)},className:"rounded p-0.5 hover:bg-white/10",children:(0,t.jsx)(_.f,{className:"h-3 w-3"})}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eD(e)},className:"rounded p-0.5 hover:bg-white/10",children:(0,t.jsx)(E.f,{className:"h-3 w-3"})})]})]},e.id))]}),(0,t.jsxs)("div",{className:"flex-1 space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"relative flex-1",children:[(0,t.jsx)(T.f,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-muted"}),(0,t.jsx)("input",{type:"text",value:O,onChange:e=>G(e.target.value),placeholder:"Search files by name…",className:"w-full rounded border border-border bg-bg py-2 pl-10 pr-4 text-xs text-text placeholder:text-text-muted focus:border-primary focus:outline-none focus:shadow-[0_0_8px_var(--color-glow)] transition-all"}),O&&(0,t.jsx)("button",{onClick:()=>G(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-text-muted hover:text-text",children:(0,t.jsx)(Z.X,{className:"h-3.5 w-3.5"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(V,{className:"h-4 w-4 text-text-muted"}),(0,t.jsxs)("select",{value:q,onChange:e=>J(e.target.value),className:"rounded border border-border bg-bg px-3 py-2 text-xs text-text focus:border-primary focus:outline-none focus:shadow-[0_0_8px_var(--color-glow)] transition-all",children:[(0,t.jsx)("option",{value:"",children:"All Types"}),(0,t.jsx)("option",{value:"text/markdown",children:"Markdown"}),(0,t.jsx)("option",{value:"text/plain",children:"Text"}),(0,t.jsx)("option",{value:"application/json",children:"JSON"}),(0,t.jsx)("option",{value:"application/pdf",children:"PDF"}),(0,t.jsx)("option",{value:"image/",children:"Images"})]})]}),(0,t.jsxs)("div",{className:"flex rounded border border-border",children:[(0,t.jsx)("button",{onClick:()=>X("grid"),className:(0,S.f)("rounded-l p-2 transition-all","grid"===Q?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-hover"),children:(0,t.jsx)(H,{className:"h-4 w-4"})}),(0,t.jsx)("button",{onClick:()=>X("list"),className:(0,S.f)("rounded-r p-2 transition-all","list"===Q?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-hover"),children:(0,t.jsx)(Y,{className:"h-4 w-4"})})]})]}),(0,t.jsx)("div",{onDragOver:e=>{e.preventDefault(),e.dataTransfer.types.includes("Files")&&eW(!0)},onDragLeave:e=>{e.preventDefault(),eW(!1)},onDrop:e=>void eO(e),className:(0,S.f)("min-h-[400px] rounded border-2 border-dashed transition-all",e$?"border-primary bg-primary/5":"border-transparent"),children:N?(0,t.jsx)("div",{className:"py-16 text-center text-[11px] text-text-muted",children:"Loading library…"}):0===h.length?(0,t.jsx)(s.N,{children:(0,t.jsxs)("div",{className:"py-16 text-center",children:[(0,t.jsx)(D.f,{className:"mx-auto h-12 w-12 text-text-muted/30 mb-4"}),(0,t.jsx)("p",{className:"text-[11px] text-text-muted mb-2",children:O||q||R?"No files match your filters":"Your library is empty"}),(0,t.jsx)("p",{className:"text-xs text-text-muted mb-4",children:"Upload files or drag & drop them here"}),(0,t.jsx)(r.K,{size:"sm",icon:(0,t.jsx)(m,{className:"h-3.5 w-3.5"}),onClick:eT,children:"Upload File"})]})}):"grid"===Q?(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:h.map(e=>(0,t.jsxs)("div",{draggable:!0,onDragStart:()=>eF(e.id),onClick:()=>void eM(e),className:"group rounded border border-border bg-surface p-4 transition-all hover:border-primary/30 hover:shadow-[0_0_20px_var(--color-glow)] cursor-pointer",children:[(0,t.jsx)("div",{className:"flex items-start justify-between mb-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)($,{className:"h-4 w-4 text-text-muted/40 opacity-0 group-hover:opacity-100 transition-opacity"}),(0,t.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded bg-primary/10 text-primary",children:ee(e.mimeType)}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h4",{className:"text-xs font-bold truncate",children:e.name}),(0,t.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.fileName})]})]})}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(i.t,{children:ea(e.mimeType)}),(0,t.jsx)("span",{className:"text-xs text-text-muted",children:(0,C.L)(e.sizeBytes)}),e.category&&(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs",style:{backgroundColor:`${e.category.color}20`,color:e.category.color},children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full",style:{backgroundColor:e.category.color}}),e.category.name]})]}),e.tags.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mb-3",children:e.tags.map(e=>(0,t.jsx)("span",{className:"rounded-full bg-surface-hover px-2 py-0.5 text-xs text-text-muted",children:e},e))}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs text-text-muted",children:[(0,t.jsx)("span",{children:(0,C.C)(e.updatedAt)}),(0,t.jsxs)("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eE(e)},className:"rounded p-1 hover:bg-surface-hover",title:"Preview",children:(0,t.jsx)(A.f,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eA(e)},className:"rounded p-1 hover:bg-surface-hover",title:"Copy to clipboard",children:ef===e.id?(0,t.jsx)(L.f,{className:"h-3.5 w-3.5 text-success"}):(0,t.jsx)(P,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eI(e)},className:"rounded p-1 hover:bg-surface-hover",title:"Download",children:(0,t.jsx)(I.f,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eM(e)},className:"rounded p-1 hover:bg-surface-hover",title:"Edit",children:(0,t.jsx)(_.f,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),e_(e)},className:"rounded p-1 hover:bg-surface-hover text-danger",title:"Delete",children:(0,t.jsx)(E.f,{className:"h-3.5 w-3.5"})}),et(e.mimeType)&&(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),ej(e)},className:"rounded p-1 hover:bg-surface-hover text-primary",title:"Deploy to nodes",children:(0,t.jsx)(j.f,{className:"h-3.5 w-3.5"})})]})]})]},e.id))}):(0,t.jsx)("div",{className:"rounded border border-border bg-surface divide-y divide-border",children:h.map(e=>(0,t.jsxs)("div",{draggable:!0,onDragStart:()=>eF(e.id),onClick:()=>void eM(e),className:"group flex items-center gap-4 px-4 py-3 transition-colors hover:bg-surface-hover cursor-pointer",children:[(0,t.jsx)($,{className:"h-4 w-4 text-text-muted/40 opacity-0 group-hover:opacity-100 transition-opacity shrink-0"}),(0,t.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded bg-primary/10 text-primary shrink-0",children:ee(e.mimeType)}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-bold truncate",children:e.name}),(0,t.jsx)("span",{className:"text-xs text-text-muted",children:e.fileName})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,t.jsx)(i.t,{children:ea(e.mimeType)}),(0,t.jsx)("span",{className:"text-xs text-text-muted",children:(0,C.L)(e.sizeBytes)}),e.category&&(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs",style:{backgroundColor:`${e.category.color}20`,color:e.category.color},children:e.category.name}),e.tags.map(e=>(0,t.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e]},e))]})]}),(0,t.jsx)("span",{className:"text-xs text-text-muted shrink-0",children:(0,C.C)(e.updatedAt)}),(0,t.jsxs)("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eE(e)},className:"rounded p-1.5 hover:bg-border",title:"Preview",children:(0,t.jsx)(A.f,{className:"h-3.5 w-3.5 text-text-muted"})}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eA(e)},className:"rounded p-1.5 hover:bg-border",title:"Copy",children:ef===e.id?(0,t.jsx)(L.f,{className:"h-3.5 w-3.5 text-success"}):(0,t.jsx)(P,{className:"h-3.5 w-3.5 text-text-muted"})}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eI(e)},className:"rounded p-1.5 hover:bg-border",title:"Download",children:(0,t.jsx)(I.f,{className:"h-3.5 w-3.5 text-text-muted"})}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eM(e)},className:"rounded p-1.5 hover:bg-border",title:"Edit",children:(0,t.jsx)(_.f,{className:"h-3.5 w-3.5 text-text-muted"})}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),e_(e)},className:"rounded p-1.5 hover:bg-border text-danger",title:"Delete",children:(0,t.jsx)(E.f,{className:"h-3.5 w-3.5"})}),et(e.mimeType)&&(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),ej(e)},className:"rounded p-1.5 hover:bg-border text-primary",title:"Deploy to nodes",children:(0,t.jsx)(j.f,{className:"h-3.5 w-3.5"})})]})]},e.id))})})]})]})}),(0,t.jsx)(f,{open:es,mode:ei,category:en,onClose:()=>er(!1),onSaved:()=>void ez()}),(0,t.jsx)(y,{open:ec,mode:ex,file:ep,categories:x,onClose:()=>ed(!1),onSaved:()=>void ez()}),(0,t.jsx)(v,{open:!!eu,file:eu,onClose:()=>eg(null)}),(0,t.jsx)(w,{open:!!ev,onClose:()=>ej(null),file:ev})]})}],11513)},46670,e=>{var t=e.i(43476),a=e.i(78571);let s={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:i="default",className:l,dot:n=!1,pulse:o=!1}){return(0,t.jsxs)("span",{className:(0,a.f)("inline-flex items-center gap-1.5 rounded-chip border px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",s[i],l),children:[n&&(0,t.jsxs)("span",{"aria-hidden":"true",className:"relative inline-flex h-1.5 w-1.5",children:[o&&(0,t.jsx)("span",{className:(0,a.f)("absolute inset-0 rounded-full animate-halo",r[i])}),(0,t.jsx)("span",{className:(0,a.f)("relative inline-flex h-1.5 w-1.5 rounded-full",r[i])})]}),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 t=e.i(43476),a=e.i(56420);let s={name:"arrow-down-right",size:24,node:[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]};s.node;let r=(0,a.f)(s);var i=e.i(75775),l=e.i(78571),n=e.i(3062),o=e.i(35084);let c={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:a=100,tone:s,thresholds:r=o.q,label:i,size:n="xs",showValue:m=!1,valueLabel:p,glow:h,className:u,testId:g}){let f="number"==typeof e&&Number.isFinite(e),y=f?Math.max(0,Math.min(100,e/(a||1)*100)):0,v=s??(f?(0,o.Z)(y,r):"muted"),j=h||!s&&f&&y>=r.warn,b=p??(f?`${y.toFixed(+(y<10&&y>0))}%`:"—");return(0,t.jsxs)("div",{className:(0,l.f)("flex min-w-0 items-center gap-2",u),"data-testid":g,children:[(0,t.jsx)("div",{role:"meter","aria-label":i,"aria-valuemin":0,"aria-valuemax":a,"aria-valuenow":f?e:void 0,"aria-valuetext":b,className:(0,l.f)("relative flex-1 overflow-hidden rounded-full bg-border/70",d[n]),children:(0,t.jsx)("div",{style:{"--meter":`${y}%`},className:(0,l.f)("h-full w-(--meter) rounded-full transition-[width] duration-700 ease-out-expo starting:w-0",o.H[v],j&&c[v])})}),m&&(0,t.jsx)("span",{className:(0,l.f)("num w-11 shrink-0 text-right text-[11px]",f?o.T[v]:"text-text-muted"),children:b})]})}e.s(["f",0,x],51196);var m=e.i(71645);function p({values:e,tone:a="primary",width:s=160,height:r=32,area:i=!0,max:n,percent:c=!1,threshold:d,live:x=!0,emptyLabel:h="not enough data",className:u,testId:g,label:f,stretch:y=!1}){let v=`spark${(0,m.useId)().replace(/:/g,"")}`;if(e.length<2)return(0,t.jsx)("div",{className:(0,l.f)("flex h-8 items-center text-xs italic text-text-muted",u),"data-testid":g,children:h});let j=o.v[a],b=n??(c?Math.max(100,...e):Math.max(...e,d??0)||1),N=r-4,w=s/(e.length-1),k=e=>2+N-Math.max(0,e)/b*N,C=e.map((e,t)=>[t*w,k(e)]),S=C.map(([e,t])=>`${e.toFixed(1)},${t.toFixed(1)}`).join(" "),z=C[C.length-1];return(0,t.jsxs)("svg",{width:y?"100%":s,height:r,viewBox:`0 0 ${s} ${r}`,preserveAspectRatio:y?"none":void 0,className:(0,l.f)("block overflow-visible",u),"data-testid":g,role:f?"img":void 0,"aria-label":f,"aria-hidden":!f||void 0,children:[i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:v,x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:j,stopOpacity:.35}),(0,t.jsx)("stop",{offset:"100%",stopColor:j,stopOpacity:0})]})}),(0,t.jsx)("polygon",{points:`0,${r} ${S} ${s},${r}`,fill:`url(#${v})`})]}),void 0!==d&&(0,t.jsx)("line",{x1:0,x2:s,y1:k(d),y2:k(d),stroke:"var(--color-warning)",strokeOpacity:.5,strokeDasharray:"3 3",strokeWidth:1}),(0,t.jsx)("polyline",{fill:"none",stroke:j,strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round",points:S}),x&&!y&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("circle",{cx:z[0],cy:z[1],r:2.5,fill:j,className:"origin-center animate-halo [transform-box:fill-box]"}),(0,t.jsx)("circle",{cx:z[0],cy:z[1],r:2,fill:j})]})]})}e.s(["f",0,p],55427),e.s(["N",0,function({title:e,description:a,children:s,className:r,action:i,tone:l,corners:o=!1,...c}){return(0,t.jsx)(n.f,{...c,tone:l,corners:o,title:e,description:a,action:i,className:r,children:s})},"n",0,function({label:e,value:a,icon:s,trend:c,spark:d,meter:m,delta:h,tone:u="primary",className:g,testId:f}){let y=!h||h.value>=0===(h.positiveIsGood??!0);return(0,t.jsxs)(n.f,{tone:u,className:(0,l.f)("overflow-hidden",g),testId:f,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:e}),s&&(0,t.jsx)("span",{className:"text-primary/60",children:s})]}),(0,t.jsxs)("div",{className:"mt-2 flex items-end justify-between gap-2",children:[(0,t.jsx)("div",{className:(0,l.f)("num text-2xl font-bold","primary"===u?"text-primary neon-text":o.T[u]),children:a}),h&&0!==h.value&&(0,t.jsxs)("span",{className:(0,l.f)("num mb-1 inline-flex items-center gap-0.5 text-[11px]",y?"text-success":"text-danger"),children:[h.value>0?(0,t.jsx)(i.f,{className:"h-3 w-3"}):(0,t.jsx)(r,{className:"h-3 w-3"}),Math.abs(h.value).toFixed(+!Number.isInteger(h.value)),h.unit]})]}),c&&(0,t.jsx)("div",{className:(0,l.f)("mt-1 text-[11px]",c.positive?"text-success":"text-danger"),children:c.value}),void 0!==m&&(0,t.jsx)(x,{value:m,className:"mt-3",label:e}),d&&d.length>1&&(0,t.jsx)("div",{className:"-mx-5 -mb-5 mt-3 opacity-80",children:(0,t.jsx)(p,{values:d,tone:u,width:240,height:28,stretch:!0,live:!1})})]})}],93999)},3062,e=>{var t=e.i(43476),a=e.i(78571),s=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)]"},i={primary:"[--glow-hover-color:var(--color-glow)]",accent:"[--glow-hover-color:var(--color-glow-accent)]",success:"[--glow-hover-color:var(--color-glow-success)]",warning:"[--glow-hover-color:var(--color-glow-warning)]",danger:"[--glow-hover-color:var(--color-glow-danger)]",info:"[--glow-hover-color:var(--color-glow)]",muted:"[--glow-hover-color:var(--color-glow)]"},l={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"},n={none:"",sm:"p-3",md:"p-5",lg:"p-6"};e.s(["f",0,function({tone:e="primary",corners:o=!0,interactive:c=!0,hero:d=!1,title:x,description:m,icon:p,action:h,as:u="div",padding:g="md",testId:f,className:y,children:v,...j}){return(0,t.jsxs)(u,{...j,"data-testid":f??j["data-testid"],className:(0,a.f)("relative rounded-panel border border-border bg-surface transition-colors duration-300",n[g],o&&"panel-corners",o&&r[e],c&&"glow-hover",c&&i[e],c&&l[e],d&&"grid-bg overflow-hidden bg-surface/80",y),children:[(x||h||p)&&(0,t.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[p&&(0,t.jsx)("span",{className:(0,a.f)("mt-0.5 shrink-0",s.T[e]),children:p}),(0,t.jsxs)("div",{className:"min-w-0",children:[x&&(0,t.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider",children:x}),m&&(0,t.jsx)("p",{className:"mt-0.5 text-[11px] text-text-muted",children:m})]})]}),h]}),v]})}])},63376,e=>{var t=e.i(43476);e.s(["z",0,function({children:e,className:a}){return(0,t.jsx)("div",{className:`animate-page-in${a?` ${a}`:""}`,children:e})},"U",0,function({children:e,className:a}){return(0,t.jsx)("div",{className:a,children:e})}])},71417,e=>{e.s(["L",0,function(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,t)).toFixed(1))} ${["B","KB","MB","GB","TB"][t]}`},"C",0,function(e){return e?("string"==typeof e?new Date(e):e).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}])},75775,e=>{var t=e.i(56420);let a={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],75775)},72382,e=>{var t=e.i(56420);let a={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"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],72382)},29600,e=>{var t=e.i(56420);let a={name:"file",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"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],29600)},69644,e=>{var t=e.i(56420);let a={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],69644)},15170,5015,e=>{var t=e.i(56420);let a={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],15170);let r={name:"file-braces",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 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],aliases:["file-json"]};r.node;let i=(0,t.f)(r);e.s(["f",0,i],5015)},79258,e=>{var t=e.i(56420);let a={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"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],79258)}])})();
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,11513,e=>{var t=e.i(43476),a=e.i(71645),s=e.i(93999),r=e.i(68759),i=e.i(46670),l=e.i(32568),n=e.i(82983),o=e.i(56420);let c={name:"folder-plus",size:24,node:[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};c.node;let d=(0,o.f)(c),x={name:"file-up",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:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]};x.node;let m=(0,o.f)(x);var p=e.i(32781);let h={name:"palette",size:24,node:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]};h.node;let u=(0,o.f)(h),g=["#6366f1","#8b5cf6","#ec4899","#ef4444","#f59e0b","#22c55e","#3b82f6","#06b6d4"];function f({open:e,mode:s,category:i,onClose:o,onSaved:c}){let[x,m]=(0,a.useState)(""),[h,y]=(0,a.useState)(""),[v,j]=(0,a.useState)("#6366f1"),[b,N]=(0,a.useState)(!1),[w,k]=(0,a.useState)("");(0,a.useEffect)(()=>{"edit"===s&&i?(m(i.name),y(i.description),j(i.color)):(m(""),y(""),j("#6366f1")),k("")},[s,i,e]);let C=async()=>{if(x.trim()){N(!0),k("");try{"create"===s?await n.f.library.categories.create({name:x.trim(),description:h.trim(),color:v}):i&&await n.f.library.categories.update(i.id,{name:x.trim(),description:h.trim(),color:v}),c(),o()}catch(e){k(e instanceof Error?e.message:"Failed to save category")}finally{N(!1)}}};return(0,t.jsx)(l.n,{open:e,onClose:o,title:"create"===s?"Create Category":"Edit Category",description:"create"===s?"Add a new organizational category":`Editing "${i?.name??""}"`,icon:(0,t.jsx)(d,{className:"h-5 w-5 text-primary"}),children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(l.G,{label:"Name",required:!0,children:(0,t.jsx)("input",{type:"text",value:x,onChange:e=>m(e.target.value),placeholder:"e.g. Personality, Templates, Config…",className:l.W,autoFocus:!0})}),(0,t.jsx)(l.G,{label:"Description",children:(0,t.jsx)("textarea",{value:h,onChange:e=>y(e.target.value),placeholder:"What kind of files belong here?",rows:2,className:l.M})}),(0,t.jsx)(l.G,{label:"Color",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[g.map(e=>(0,t.jsx)("button",{onClick:()=>j(e),className:`h-7 w-7 rounded-full border-2 transition-all ${v===e?"border-white scale-110":"border-transparent"}`,style:{backgroundColor:e}},e)),(0,t.jsxs)("div",{className:"ml-2 flex items-center gap-1.5",children:[(0,t.jsx)(u,{className:"h-3.5 w-3.5 text-text-muted"}),(0,t.jsx)("input",{type:"text",value:v,onChange:e=>j(e.target.value),className:`${l.W} !w-24`})]})]})}),w&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:w}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)(r.K,{variant:"secondary",size:"sm",onClick:o,children:"Cancel"}),(0,t.jsx)(r.K,{size:"sm",onClick:()=>void C(),disabled:b||!x.trim(),icon:b?(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:b?"Saving…":"create"===s?"Create Category":"Save Changes"})]})]})})}function y({open:e,mode:s,file:i,categories:o,onClose:c,onSaved:d}){let[x,h]=(0,a.useState)(""),[u,g]=(0,a.useState)(""),[f,v]=(0,a.useState)("text/markdown"),[j,b]=(0,a.useState)(""),[N,w]=(0,a.useState)(""),[k,C]=(0,a.useState)(""),[S,z]=(0,a.useState)(!1),[D,T]=(0,a.useState)("");(0,a.useEffect)(()=>{"edit"===s&&i?(h(i.name),g(i.fileName),v(i.mimeType),b(i.content),w(i.categoryId??""),C(i.tags.join(", "))):(h(""),g(""),v("text/markdown"),b(""),w(""),C("")),T("")},[s,i,e]);let M=async()=>{if(x.trim()&&u.trim()){z(!0),T("");try{let e=k.split(",").map(e=>e.trim()).filter(Boolean);"create"===s?await n.f.library.files.create({name:x.trim(),fileName:u.trim(),mimeType:f,content:j,categoryId:N||null,tags:e}):i&&await n.f.library.files.update(i.id,{name:x.trim(),fileName:u.trim(),mimeType:f,content:j,categoryId:N||null,tags:e}),d(),c()}catch(e){T(e instanceof Error?e.message:"Failed to save file")}finally{z(!1)}}};return(0,t.jsx)(l.n,{open:e,onClose:c,title:"create"===s?"Upload File":"Edit File",description:"create"===s?"Add a new file to the library":`Editing "${i?.name??""}"`,icon:(0,t.jsx)(m,{className:"h-5 w-5 text-primary"}),className:"max-w-2xl",children:(0,t.jsxs)("div",{className:"space-y-4",children:["create"===s&&(0,t.jsxs)(l.G,{label:"Upload File",children:[(0,t.jsx)("input",{type:"file",onChange:e=>{let t=e.target.files?.[0];if(!t)return;g(t.name),x||h(t.name.replace(/\.[^/.]+$/,"")),v(t.type||"application/octet-stream");let a=new FileReader;t.type.startsWith("text/")||t.name.endsWith(".md")||t.name.endsWith(".json")||t.name.endsWith(".yaml")||t.name.endsWith(".yml")||t.name.endsWith(".txt")?(a.onload=()=>b(a.result),a.readAsText(t)):(a.onload=()=>{b(a.result.split(",")[1]??"")},a.readAsDataURL(t))},accept:".md,.txt,.json,.yaml,.yml,.pdf,.png,.jpg,.jpeg,.gif,.svg,.webp",className:"block w-full text-xs text-text-muted file:mr-4 file:rounded file:border-0 file:bg-primary/10 file:px-4 file:py-2 file:text-xs file:font-bold file:text-primary hover:file:bg-primary/20 file:cursor-pointer"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Or fill in the fields manually below"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsx)(l.G,{label:"Display Name",required:!0,children:(0,t.jsx)("input",{type:"text",value:x,onChange:e=>h(e.target.value),placeholder:"SOUL",className:l.W})}),(0,t.jsx)(l.G,{label:"File Name",required:!0,children:(0,t.jsx)("input",{type:"text",value:u,onChange:e=>g(e.target.value),placeholder:"SOUL.md",className:l.W})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsx)(l.G,{label:"Category",children:(0,t.jsxs)("select",{value:N,onChange:e=>w(e.target.value),className:l.N,children:[(0,t.jsx)("option",{value:"",children:"Uncategorized"}),o.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,t.jsx)(l.G,{label:"MIME Type",children:(0,t.jsxs)("select",{value:f,onChange:e=>v(e.target.value),className:l.N,children:[(0,t.jsx)("option",{value:"text/markdown",children:"Markdown (.md)"}),(0,t.jsx)("option",{value:"text/plain",children:"Plain Text (.txt)"}),(0,t.jsx)("option",{value:"application/json",children:"JSON (.json)"}),(0,t.jsx)("option",{value:"application/pdf",children:"PDF (.pdf)"}),(0,t.jsx)("option",{value:"image/png",children:"PNG Image"}),(0,t.jsx)("option",{value:"image/jpeg",children:"JPEG Image"}),(0,t.jsx)("option",{value:"image/svg+xml",children:"SVG Image"})]})})]}),(0,t.jsxs)(l.G,{label:"Tags",children:[(0,t.jsx)("input",{type:"text",value:k,onChange:e=>C(e.target.value),placeholder:"personality, config, template",className:l.W}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated"})]}),(f.startsWith("text/")||"application/json"===f)&&(0,t.jsx)(l.G,{label:"Content",children:(0,t.jsx)("textarea",{value:j,onChange:e=>b(e.target.value),placeholder:"File content…",rows:8,className:`${l.M} text-xs`})}),D&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:D}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)(r.K,{variant:"secondary",size:"sm",onClick:c,children:"Cancel"}),(0,t.jsx)(r.K,{size:"sm",onClick:()=>void M(),disabled:S||!x.trim()||!u.trim(),icon:S?(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:S?"Saving…":"create"===s?"Upload File":"Save Changes"})]})]})})}function v({open:e,file:a,onClose:s}){if(!a)return null;let r="text/markdown"===a.mimeType||a.fileName.endsWith(".md"),i=a.mimeType.startsWith("text/")||"application/json"===a.mimeType,n=a.mimeType.startsWith("image/"),o="application/pdf"===a.mimeType;return(0,t.jsx)(l.n,{open:e,onClose:s,title:a.name,description:a.fileName,className:"max-w-4xl max-h-[80vh]",children:(0,t.jsxs)("div",{className:"overflow-auto max-h-[60vh]",children:[r&&(0,t.jsx)("div",{className:"prose prose-invert prose-sm max-w-none rounded border border-border bg-bg p-4 text-xs whitespace-pre-wrap leading-relaxed",children:a.content}),i&&!r&&(0,t.jsx)("pre",{className:"rounded border border-border bg-bg p-4 text-xs overflow-auto",children:a.content}),n&&(0,t.jsx)("div",{className:"flex items-center justify-center p-4",children:(0,t.jsx)("img",{src:a.content.startsWith("data:")?a.content:`data:${a.mimeType};base64,${a.content}`,alt:a.name,className:"max-w-full rounded"})}),o&&(0,t.jsx)("div",{className:"flex items-center justify-center p-8 text-text-muted",children:(0,t.jsx)("p",{className:"text-xs",children:"PDF preview not available. Use the download button instead."})}),!i&&!n&&!o&&(0,t.jsx)("div",{className:"flex items-center justify-center p-8 text-text-muted",children:(0,t.jsx)("p",{className:"text-xs",children:"Preview not available for this file type."})})]})})}var j=e.i(94371),b=e.i(51757),N=e.i(83967);function w({open:e,onClose:s,file:i}){let[o,c]=(0,a.useState)([]),[d,x]=(0,a.useState)([]),[m,h]=(0,a.useState)(!1),[u,g]=(0,a.useState)(null),[f,y]=(0,a.useState)(!1),v=(0,a.useCallback)(async()=>{y(!0);try{let e=await n.f.nodes.list({status:"ONLINE"});e.success&&Array.isArray(e.data)&&c(e.data.map(e=>({id:e.id,name:e.name,status:e.status})))}catch{}finally{y(!1)}},[]);(0,a.useEffect)(()=>{e&&(v(),x([]),g(null))},[e,v]);let k=async()=>{if(i&&0!==d.length){h(!0),g(null);try{let e=await n.f.libraryDeploy.deploy({fileId:i.id,nodeIds:d,overwrite:!0});e.success&&Array.isArray(e.data)&&g(e.data)}catch(e){g([{nodeId:"error",nodeName:"Deploy Error",status:"failed",error:e instanceof Error?e.message:"Unknown error"}])}finally{h(!1)}}},C=i?.mimeType==="application/x-magnus-skill"?"Skill":i?.mimeType==="application/x-magnus-cronjob"?"Cron Job":"Item";return(0,t.jsx)(l.n,{open:e,onClose:s,title:`Deploy ${C}`,description:i?.name??"",icon:(0,t.jsx)(j.f,{className:"h-5 w-5 text-primary"}),className:"max-w-lg",children:(0,t.jsxs)("div",{className:"space-y-4",children:[!u&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("label",{className:"text-[11px] font-bold uppercase tracking-wider text-text-muted",children:"Target Nodes"}),(0,t.jsx)("button",{onClick:()=>{x(o.map(e=>e.id))},className:"text-[10px] text-primary hover:text-primary/80 uppercase tracking-wider transition-all",children:"Select All"})]}),f?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs text-text-muted py-4 justify-center",children:[(0,t.jsx)(p.f,{className:"h-4 w-4 animate-spin"}),"Loading nodes..."]}):0===o.length?(0,t.jsx)("p",{className:"text-xs text-text-muted py-4 text-center",children:"No online nodes available"}):(0,t.jsx)("div",{className:"space-y-1 max-h-48 overflow-y-auto",children:o.map(e=>(0,t.jsxs)("label",{className:"flex items-center gap-3 rounded border border-border/50 px-3 py-2 hover:border-primary/30 hover:shadow-[0_0_20px_var(--color-glow)] transition-all cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:d.includes(e.id),onChange:()=>{var t;return t=e.id,void x(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"rounded border-border"}),(0,t.jsx)("span",{className:"text-xs",children:e.name})]},e.id))}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)(r.K,{variant:"secondary",size:"sm",onClick:s,children:"Cancel"}),(0,t.jsx)(r.K,{size:"sm",onClick:()=>void k(),disabled:m||0===d.length,children:m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.f,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),"Deploying..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.f,{className:"h-3.5 w-3.5 mr-1.5"}),"Deploy to ",d.length," node",1!==d.length?"s":""]})})]})]}),u&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"space-y-2",children:u.map((e,a)=>(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded border border-border/50 px-3 py-2 text-xs",children:["success"===e.status?(0,t.jsx)(b.f,{className:"h-4 w-4 text-success shrink-0"}):(0,t.jsx)(N.f,{className:"h-4 w-4 text-danger shrink-0"}),(0,t.jsx)("span",{className:"font-bold",children:e.nodeName}),e.error&&(0,t.jsx)("span",{className:"text-[10px] text-danger/70 truncate",children:e.error})]},a))}),(0,t.jsx)("div",{className:"flex justify-end pt-2",children:(0,t.jsx)(r.K,{variant:"secondary",size:"sm",onClick:s,children:"Close"})})]})]})})}var k=e.i(4050),C=e.i(71417),S=e.i(78571),z=e.i(63376),D=e.i(70533),T=e.i(66595),M=e.i(41120),_=e.i(15281),E=e.i(59659),A=e.i(72382),I=e.i(62368);let F={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};F.node;let P=(0,o.f)(F);var L=e.i(89664);let U={name:"grip-vertical",size:24,node:[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]};U.node;let $=(0,o.f)(U);var W=e.i(26091),O=e.i(15170),G=e.i(5015),R=e.i(29600),B=e.i(69644);let K={name:"funnel",size:24,node:[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],aliases:["filter"]};K.node;let V=(0,o.f)(K),q={name:"layout-grid",size:24,node:[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]};q.node;let H=(0,o.f)(q),J={name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]};J.node;let Y=(0,o.f)(J);var Z=e.i(63676),Q=e.i(63230),X=e.i(74544);function ee(e){return"application/x-magnus-skill"===e?(0,t.jsx)(Q.f,{className:"h-4 w-4"}):"application/x-magnus-cronjob"===e?(0,t.jsx)(X.f,{className:"h-4 w-4"}):e.startsWith("image/")?(0,t.jsx)(O.f,{className:"h-4 w-4"}):"application/json"===e?(0,t.jsx)(G.f,{className:"h-4 w-4"}):"text/markdown"===e||"text/plain"===e?(0,t.jsx)(W.f,{className:"h-4 w-4"}):(0,t.jsx)(R.f,{className:"h-4 w-4"})}function et(e){return"application/x-magnus-skill"===e||"application/x-magnus-cronjob"===e}function ea(e){return({"text/markdown":"Markdown","text/plain":"Text","application/json":"JSON","application/pdf":"PDF","image/png":"PNG","image/jpeg":"JPEG","image/svg+xml":"SVG","image/gif":"GIF","image/webp":"WebP","application/x-magnus-skill":"Skill","application/x-magnus-cronjob":"Cron Job"})[e]??e.split("/")[1]?.toUpperCase()??"File"}e.s(["default",0,function({initialCategories:e,initialFiles:l,initialTotalFiles:o}){let{activeNode:c}=(0,k.l)(),[x,p]=(0,a.useState)(e),[h,u]=(0,a.useState)(l),[g,b]=(0,a.useState)(o),[N,F]=(0,a.useState)(!1),[U,W]=(0,a.useState)(l.length>0||e.length>0),[O,G]=(0,a.useState)(""),[R,K]=(0,a.useState)(null),[q,J]=(0,a.useState)(""),[Q,X]=(0,a.useState)("grid"),[es,er]=(0,a.useState)(!1),[ei,el]=(0,a.useState)("create"),[en,eo]=(0,a.useState)(null),[ec,ed]=(0,a.useState)(!1),[ex,em]=(0,a.useState)("create"),[ep,eh]=(0,a.useState)(null),[eu,eg]=(0,a.useState)(null),[ef,ey]=(0,a.useState)(null),[ev,ej]=(0,a.useState)(null),[eb,eN]=(0,a.useState)(null),[ew,ek]=(0,a.useState)(null),eC=(0,a.useCallback)(async()=>{try{let e=await n.f.library.categories.list();p(e.data)}catch{}},[]),eS=(0,a.useCallback)(async()=>{try{let e={};O&&(e.query=O),R&&(e.categoryId=R),q&&(e.mimeType=q),e.pageSize=100;let t=await n.f.library.files.list(e);u(t.data),b(t.pagination?.total??t.data.length)}catch{}},[O,R,q]),ez=(0,a.useCallback)(async()=>{F(!0),await Promise.all([eC(),eS()]),F(!1)},[eC,eS]);(0,a.useEffect)(()=>{U?W(!1):ez()},[ez,c.id]),(0,a.useEffect)(()=>{let e=setTimeout(()=>{eS()},300);return()=>clearTimeout(e)},[O,R,q,eS]);let eD=async e=>{if(confirm(`Delete category "${e.name}"? Files in this category will become uncategorized.`))try{await n.f.library.categories.delete(e.id),R===e.id&&K(null),ez()}catch{}},eT=()=>{em("create"),eh(null),ed(!0)},eM=async e=>{try{let t=(await n.f.library.files.get(e.id)).data;em("edit"),eh(t),ed(!0)}catch{}},e_=async e=>{if(confirm(`Delete "${e.name}" (${e.fileName})?`))try{await n.f.library.files.delete(e.id),ez()}catch{}},eE=async e=>{try{let t=await n.f.library.files.get(e.id);eg(t.data)}catch{}},eA=async e=>{try{let t=(await n.f.library.files.get(e.id)).data;await navigator.clipboard.writeText(t.content??""),ey(e.id),setTimeout(()=>ey(null),2e3)}catch{}},eI=async e=>{try{let t,a=(await n.f.library.files.get(e.id)).data,s=a.content??"";if(a.mimeType.startsWith("text/")||"application/json"===a.mimeType)t=new Blob([s],{type:a.mimeType});else{let e=atob(s),r=new Uint8Array(e.length);for(let t=0;t<e.length;t++)r[t]=e.charCodeAt(t);t=new Blob([r],{type:a.mimeType})}let r=URL.createObjectURL(t),i=document.createElement("a");i.href=r,i.download=a.fileName,i.click(),URL.revokeObjectURL(r)}catch{}},eF=e=>{eN(e)},eP=(e,t)=>{e.preventDefault(),ek(t)},eL=()=>{ek(null)},eU=async(e,t)=>{if(e.preventDefault(),ek(null),eb)try{await n.f.library.files.move({fileIds:[eb],categoryId:t}),ez()}catch{}finally{eN(null)}},[e$,eW]=(0,a.useState)(!1),eO=async e=>{e.preventDefault(),eW(!1);let t=e.dataTransfer.files;if(0!==t.length){for(let e=0;e<t.length;e++){let a=t[e];if(!a)continue;let s=a.name.replace(/\.[^/.]+$/,""),r=a.type||"application/octet-stream",i=await new Promise(e=>{let t=new FileReader;a.type.startsWith("text/")||a.name.endsWith(".md")||a.name.endsWith(".json")||a.name.endsWith(".yaml")||a.name.endsWith(".yml")||a.name.endsWith(".txt")?(t.onload=()=>e(t.result),t.readAsText(a)):(t.onload=()=>{e(t.result.split(",")[1]??"")},t.readAsDataURL(a))});try{await n.f.library.files.create({name:s,fileName:a.name,mimeType:r,content:i,categoryId:"uncategorized"===R?null:R})}catch{}}ez()}};return(0,t.jsxs)(z.U,{className:"space-y-6",children:[(0,t.jsx)(z.z,{children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-lg font-bold uppercase tracking-wider",children:"Library"}),(0,t.jsx)("p",{className:"mt-1 text-[11px] text-text-muted uppercase tracking-wider",children:"Browse, manage, and share Markdown, PDF, and image files"})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(r.K,{variant:"secondary",size:"sm",icon:(0,t.jsx)(M.f,{className:"h-3.5 w-3.5"}),onClick:()=>void ez(),children:"Refresh"}),(0,t.jsx)(r.K,{variant:"secondary",size:"sm",icon:(0,t.jsx)(d,{className:"h-3.5 w-3.5"}),onClick:()=>{el("create"),eo(null),er(!0)},children:"Category"}),(0,t.jsx)(r.K,{size:"sm",icon:(0,t.jsx)(m,{className:"h-3.5 w-3.5"}),onClick:eT,children:"Upload"})]})]})}),(0,t.jsx)(z.z,{children:(0,t.jsxs)("div",{className:"flex gap-6",children:[(0,t.jsxs)("div",{className:"w-56 shrink-0 space-y-2",children:[(0,t.jsx)("h3",{className:"text-[11px] font-bold uppercase tracking-wider text-text-muted mb-3",children:"Categories"}),(0,t.jsxs)("button",{onClick:()=>K(null),onDragOver:e=>eP(e,null),onDragLeave:eL,onDrop:e=>void eU(e,null),className:(0,S.f)("flex w-full items-center gap-2 rounded px-3 py-2 text-xs transition-all",null===R?"bg-primary/10 text-primary border border-primary/50":"border border-transparent text-text-muted hover:bg-surface-hover hover:text-text"),children:[(0,t.jsx)(D.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:"All Files"}),(0,t.jsx)("span",{className:"text-xs opacity-70",children:g})]}),(0,t.jsxs)("button",{onClick:()=>K("uncategorized"),onDragOver:e=>eP(e,"uncategorized"),onDragLeave:eL,onDrop:e=>void eU(e,null),className:(0,S.f)("flex w-full items-center gap-2 rounded px-3 py-2 text-xs transition-all","uncategorized"===ew&&"ring-2 ring-primary","uncategorized"===R?"bg-primary/10 text-primary border border-primary/50":"border border-transparent text-text-muted hover:bg-surface-hover hover:text-text"),children:[(0,t.jsx)(B.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:"Uncategorized"})]}),x.map(e=>(0,t.jsxs)("div",{onDragOver:t=>eP(t,e.id),onDragLeave:eL,onDrop:t=>void eU(t,e.id),className:(0,S.f)("group flex items-center gap-2 rounded px-3 py-2 text-xs transition-all cursor-pointer",ew===e.id&&"ring-2 ring-primary",R===e.id?"bg-primary/10 text-primary border border-primary/50":"border border-transparent text-text-muted hover:bg-surface-hover hover:text-text"),onClick:()=>K(e.id),children:[(0,t.jsx)("div",{className:"h-3 w-3 rounded-full shrink-0",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"flex-1 text-left truncate",children:e.name}),(0,t.jsx)("span",{className:"text-xs opacity-70",children:e.fileCount??0}),(0,t.jsxs)("div",{className:"hidden group-hover:flex gap-0.5",children:[(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),el("edit"),eo(e),er(!0)},className:"rounded p-0.5 hover:bg-white/10",children:(0,t.jsx)(_.f,{className:"h-3 w-3"})}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eD(e)},className:"rounded p-0.5 hover:bg-white/10",children:(0,t.jsx)(E.f,{className:"h-3 w-3"})})]})]},e.id))]}),(0,t.jsxs)("div",{className:"flex-1 space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"relative flex-1",children:[(0,t.jsx)(T.f,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-muted"}),(0,t.jsx)("input",{type:"text",value:O,onChange:e=>G(e.target.value),placeholder:"Search files by name…",className:"w-full rounded border border-border bg-bg py-2 pl-10 pr-4 text-xs text-text placeholder:text-text-muted focus:border-primary focus:outline-none focus:shadow-[0_0_8px_var(--color-glow)] transition-all"}),O&&(0,t.jsx)("button",{onClick:()=>G(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-text-muted hover:text-text",children:(0,t.jsx)(Z.X,{className:"h-3.5 w-3.5"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(V,{className:"h-4 w-4 text-text-muted"}),(0,t.jsxs)("select",{value:q,onChange:e=>J(e.target.value),className:"rounded border border-border bg-bg px-3 py-2 text-xs text-text focus:border-primary focus:outline-none focus:shadow-[0_0_8px_var(--color-glow)] transition-all",children:[(0,t.jsx)("option",{value:"",children:"All Types"}),(0,t.jsx)("option",{value:"text/markdown",children:"Markdown"}),(0,t.jsx)("option",{value:"text/plain",children:"Text"}),(0,t.jsx)("option",{value:"application/json",children:"JSON"}),(0,t.jsx)("option",{value:"application/pdf",children:"PDF"}),(0,t.jsx)("option",{value:"image/",children:"Images"})]})]}),(0,t.jsxs)("div",{className:"flex rounded border border-border",children:[(0,t.jsx)("button",{onClick:()=>X("grid"),className:(0,S.f)("rounded-l p-2 transition-all","grid"===Q?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-hover"),children:(0,t.jsx)(H,{className:"h-4 w-4"})}),(0,t.jsx)("button",{onClick:()=>X("list"),className:(0,S.f)("rounded-r p-2 transition-all","list"===Q?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-hover"),children:(0,t.jsx)(Y,{className:"h-4 w-4"})})]})]}),(0,t.jsx)("div",{onDragOver:e=>{e.preventDefault(),e.dataTransfer.types.includes("Files")&&eW(!0)},onDragLeave:e=>{e.preventDefault(),eW(!1)},onDrop:e=>void eO(e),className:(0,S.f)("min-h-[400px] rounded border-2 border-dashed transition-all",e$?"border-primary bg-primary/5":"border-transparent"),children:N?(0,t.jsx)("div",{className:"py-16 text-center text-[11px] text-text-muted",children:"Loading library…"}):0===h.length?(0,t.jsx)(s.N,{children:(0,t.jsxs)("div",{className:"py-16 text-center",children:[(0,t.jsx)(D.f,{className:"mx-auto h-12 w-12 text-text-muted/30 mb-4"}),(0,t.jsx)("p",{className:"text-[11px] text-text-muted mb-2",children:O||q||R?"No files match your filters":"Your library is empty"}),(0,t.jsx)("p",{className:"text-xs text-text-muted mb-4",children:"Upload files or drag & drop them here"}),(0,t.jsx)(r.K,{size:"sm",icon:(0,t.jsx)(m,{className:"h-3.5 w-3.5"}),onClick:eT,children:"Upload File"})]})}):"grid"===Q?(0,t.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:h.map(e=>(0,t.jsxs)("div",{draggable:!0,onDragStart:()=>eF(e.id),onClick:()=>void eM(e),className:"group rounded border border-border bg-surface p-4 transition-all hover:border-primary/30 hover:shadow-[0_0_20px_var(--color-glow)] cursor-pointer",children:[(0,t.jsx)("div",{className:"flex items-start justify-between mb-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)($,{className:"h-4 w-4 text-text-muted/40 opacity-0 group-hover:opacity-100 transition-opacity"}),(0,t.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded bg-primary/10 text-primary",children:ee(e.mimeType)}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h4",{className:"text-xs font-bold truncate",children:e.name}),(0,t.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.fileName})]})]})}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(i.t,{children:ea(e.mimeType)}),(0,t.jsx)("span",{className:"text-xs text-text-muted",children:(0,C.L)(e.sizeBytes)}),e.category&&(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs",style:{backgroundColor:`${e.category.color}20`,color:e.category.color},children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full",style:{backgroundColor:e.category.color}}),e.category.name]})]}),e.tags.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mb-3",children:e.tags.map(e=>(0,t.jsx)("span",{className:"rounded-full bg-surface-hover px-2 py-0.5 text-xs text-text-muted",children:e},e))}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs text-text-muted",children:[(0,t.jsx)("span",{children:(0,C.C)(e.updatedAt)}),(0,t.jsxs)("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eE(e)},className:"rounded p-1 hover:bg-surface-hover",title:"Preview",children:(0,t.jsx)(A.f,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eA(e)},className:"rounded p-1 hover:bg-surface-hover",title:"Copy to clipboard",children:ef===e.id?(0,t.jsx)(L.f,{className:"h-3.5 w-3.5 text-success"}):(0,t.jsx)(P,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eI(e)},className:"rounded p-1 hover:bg-surface-hover",title:"Download",children:(0,t.jsx)(I.f,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eM(e)},className:"rounded p-1 hover:bg-surface-hover",title:"Edit",children:(0,t.jsx)(_.f,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),e_(e)},className:"rounded p-1 hover:bg-surface-hover text-danger",title:"Delete",children:(0,t.jsx)(E.f,{className:"h-3.5 w-3.5"})}),et(e.mimeType)&&(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),ej(e)},className:"rounded p-1 hover:bg-surface-hover text-primary",title:"Deploy to nodes",children:(0,t.jsx)(j.f,{className:"h-3.5 w-3.5"})})]})]})]},e.id))}):(0,t.jsx)("div",{className:"rounded border border-border bg-surface divide-y divide-border",children:h.map(e=>(0,t.jsxs)("div",{draggable:!0,onDragStart:()=>eF(e.id),onClick:()=>void eM(e),className:"group flex items-center gap-4 px-4 py-3 transition-colors hover:bg-surface-hover cursor-pointer",children:[(0,t.jsx)($,{className:"h-4 w-4 text-text-muted/40 opacity-0 group-hover:opacity-100 transition-opacity shrink-0"}),(0,t.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded bg-primary/10 text-primary shrink-0",children:ee(e.mimeType)}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-bold truncate",children:e.name}),(0,t.jsx)("span",{className:"text-xs text-text-muted",children:e.fileName})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,t.jsx)(i.t,{children:ea(e.mimeType)}),(0,t.jsx)("span",{className:"text-xs text-text-muted",children:(0,C.L)(e.sizeBytes)}),e.category&&(0,t.jsx)("span",{className:"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs",style:{backgroundColor:`${e.category.color}20`,color:e.category.color},children:e.category.name}),e.tags.map(e=>(0,t.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e]},e))]})]}),(0,t.jsx)("span",{className:"text-xs text-text-muted shrink-0",children:(0,C.C)(e.updatedAt)}),(0,t.jsxs)("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eE(e)},className:"rounded p-1.5 hover:bg-border",title:"Preview",children:(0,t.jsx)(A.f,{className:"h-3.5 w-3.5 text-text-muted"})}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eA(e)},className:"rounded p-1.5 hover:bg-border",title:"Copy",children:ef===e.id?(0,t.jsx)(L.f,{className:"h-3.5 w-3.5 text-success"}):(0,t.jsx)(P,{className:"h-3.5 w-3.5 text-text-muted"})}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eI(e)},className:"rounded p-1.5 hover:bg-border",title:"Download",children:(0,t.jsx)(I.f,{className:"h-3.5 w-3.5 text-text-muted"})}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eM(e)},className:"rounded p-1.5 hover:bg-border",title:"Edit",children:(0,t.jsx)(_.f,{className:"h-3.5 w-3.5 text-text-muted"})}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),e_(e)},className:"rounded p-1.5 hover:bg-border text-danger",title:"Delete",children:(0,t.jsx)(E.f,{className:"h-3.5 w-3.5"})}),et(e.mimeType)&&(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),ej(e)},className:"rounded p-1.5 hover:bg-border text-primary",title:"Deploy to nodes",children:(0,t.jsx)(j.f,{className:"h-3.5 w-3.5"})})]})]},e.id))})})]})]})}),(0,t.jsx)(f,{open:es,mode:ei,category:en,onClose:()=>er(!1),onSaved:()=>void ez()}),(0,t.jsx)(y,{open:ec,mode:ex,file:ep,categories:x,onClose:()=>ed(!1),onSaved:()=>void ez()}),(0,t.jsx)(v,{open:!!eu,file:eu,onClose:()=>eg(null)}),(0,t.jsx)(w,{open:!!ev,onClose:()=>ej(null),file:ev})]})}],11513)},46670,e=>{var t=e.i(43476),a=e.i(78571);let s={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:i="default",className:l,dot:n=!1,pulse:o=!1}){return(0,t.jsxs)("span",{className:(0,a.f)("inline-flex items-center gap-1.5 rounded-chip border px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",s[i],l),children:[n&&(0,t.jsxs)("span",{"aria-hidden":"true",className:"relative inline-flex h-1.5 w-1.5",children:[o&&(0,t.jsx)("span",{className:(0,a.f)("absolute inset-0 rounded-full animate-halo",r[i])}),(0,t.jsx)("span",{className:(0,a.f)("relative inline-flex h-1.5 w-1.5 rounded-full",r[i])})]}),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 t=e.i(43476),a=e.i(56420);let s={name:"arrow-down-right",size:24,node:[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]};s.node;let r=(0,a.f)(s);var i=e.i(75775),l=e.i(78571),n=e.i(3062),o=e.i(35084);let c={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:a=100,tone:s,thresholds:r=o.q,label:i,size:n="xs",showValue:m=!1,valueLabel:p,glow:h,className:u,testId:g}){let f="number"==typeof e&&Number.isFinite(e),y=f?Math.max(0,Math.min(100,e/(a||1)*100)):0,v=s??(f?(0,o.Z)(y,r):"muted"),j=h||!s&&f&&y>=r.warn,b=p??(f?`${y.toFixed(+(y<10&&y>0))}%`:"—");return(0,t.jsxs)("div",{className:(0,l.f)("flex min-w-0 items-center gap-2",u),"data-testid":g,children:[(0,t.jsx)("div",{role:"meter","aria-label":i,"aria-valuemin":0,"aria-valuemax":a,"aria-valuenow":f?e:void 0,"aria-valuetext":b,className:(0,l.f)("relative flex-1 overflow-hidden rounded-full bg-border/70",d[n]),children:(0,t.jsx)("div",{style:{"--meter":`${y}%`},className:(0,l.f)("h-full w-(--meter) rounded-full transition-[width] duration-700 ease-out-expo starting:w-0",o.H[v],j&&c[v])})}),m&&(0,t.jsx)("span",{className:(0,l.f)("num w-11 shrink-0 text-right text-[11px]",f?o.T[v]:"text-text-muted"),children:b})]})}e.s(["f",0,x],51196);var m=e.i(71645);function p({values:e,tone:a="primary",width:s=160,height:r=32,area:i=!0,max:n,percent:c=!1,threshold:d,live:x=!0,emptyLabel:h="not enough data",className:u,testId:g,label:f,stretch:y=!1}){let v=`spark${(0,m.useId)().replace(/:/g,"")}`;if(e.length<2)return(0,t.jsx)("div",{className:(0,l.f)("flex h-8 items-center text-xs italic text-text-muted",u),"data-testid":g,children:h});let j=o.v[a],b=n??(c?Math.max(100,...e):Math.max(...e,d??0)||1),N=r-4,w=s/(e.length-1),k=e=>2+N-Math.max(0,e)/b*N,C=e.map((e,t)=>[t*w,k(e)]),S=C.map(([e,t])=>`${e.toFixed(1)},${t.toFixed(1)}`).join(" "),z=C[C.length-1];return(0,t.jsxs)("svg",{width:y?"100%":s,height:r,viewBox:`0 0 ${s} ${r}`,preserveAspectRatio:y?"none":void 0,className:(0,l.f)("block overflow-visible",u),"data-testid":g,role:f?"img":void 0,"aria-label":f,"aria-hidden":!f||void 0,children:[i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:v,x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:j,stopOpacity:.35}),(0,t.jsx)("stop",{offset:"100%",stopColor:j,stopOpacity:0})]})}),(0,t.jsx)("polygon",{points:`0,${r} ${S} ${s},${r}`,fill:`url(#${v})`})]}),void 0!==d&&(0,t.jsx)("line",{x1:0,x2:s,y1:k(d),y2:k(d),stroke:"var(--color-warning)",strokeOpacity:.5,strokeDasharray:"3 3",strokeWidth:1}),(0,t.jsx)("polyline",{fill:"none",stroke:j,strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round",points:S}),x&&!y&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("circle",{cx:z[0],cy:z[1],r:2.5,fill:j,className:"origin-center animate-halo [transform-box:fill-box]"}),(0,t.jsx)("circle",{cx:z[0],cy:z[1],r:2,fill:j})]})]})}e.s(["f",0,p],55427),e.s(["N",0,function({title:e,description:a,children:s,className:r,action:i,tone:l,corners:o=!1,...c}){return(0,t.jsx)(n.f,{...c,tone:l,corners:o,title:e,description:a,action:i,className:r,children:s})},"n",0,function({label:e,value:a,icon:s,trend:c,spark:d,meter:m,delta:h,tone:u="primary",className:g,testId:f}){let y=!h||h.value>=0===(h.positiveIsGood??!0);return(0,t.jsxs)(n.f,{tone:u,className:(0,l.f)("overflow-hidden",g),testId:f,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:e}),s&&(0,t.jsx)("span",{className:"text-primary/60",children:s})]}),(0,t.jsxs)("div",{className:"mt-2 flex items-end justify-between gap-2",children:[(0,t.jsx)("div",{className:(0,l.f)("num text-2xl font-bold","primary"===u?"text-primary neon-text":o.T[u]),children:a}),h&&0!==h.value&&(0,t.jsxs)("span",{className:(0,l.f)("num mb-1 inline-flex items-center gap-0.5 text-[11px]",y?"text-success":"text-danger"),children:[h.value>0?(0,t.jsx)(i.f,{className:"h-3 w-3"}):(0,t.jsx)(r,{className:"h-3 w-3"}),Math.abs(h.value).toFixed(+!Number.isInteger(h.value)),h.unit]})]}),c&&(0,t.jsx)("div",{className:(0,l.f)("mt-1 text-[11px]",c.positive?"text-success":"text-danger"),children:c.value}),void 0!==m&&(0,t.jsx)(x,{value:m,className:"mt-3",label:e}),d&&d.length>1&&(0,t.jsx)("div",{className:"-mx-5 -mb-5 mt-3 opacity-80",children:(0,t.jsx)(p,{values:d,tone:u,width:240,height:28,stretch:!0,live:!1})})]})}],93999)},3062,e=>{var t=e.i(43476),a=e.i(78571),s=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)]"},i={primary:"[--glow-hover-color:var(--color-glow)]",accent:"[--glow-hover-color:var(--color-glow-accent)]",success:"[--glow-hover-color:var(--color-glow-success)]",warning:"[--glow-hover-color:var(--color-glow-warning)]",danger:"[--glow-hover-color:var(--color-glow-danger)]",info:"[--glow-hover-color:var(--color-glow)]",muted:"[--glow-hover-color:var(--color-glow)]"},l={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"},n={none:"",sm:"p-3",md:"p-5",lg:"p-6"};e.s(["f",0,function({tone:e="primary",corners:o=!0,interactive:c=!0,hero:d=!1,title:x,description:m,icon:p,action:h,as:u="div",padding:g="md",testId:f,className:y,children:v,...j}){return(0,t.jsxs)(u,{...j,"data-testid":f??j["data-testid"],className:(0,a.f)("relative rounded-panel border border-border bg-surface transition-colors duration-300",n[g],o&&"panel-corners",o&&r[e],c&&"glow-hover",c&&i[e],c&&l[e],d&&"grid-bg overflow-hidden bg-surface/80",y),children:[(x||h||p)&&(0,t.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[p&&(0,t.jsx)("span",{className:(0,a.f)("mt-0.5 shrink-0",s.T[e]),children:p}),(0,t.jsxs)("div",{className:"min-w-0",children:[x&&(0,t.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider",children:x}),m&&(0,t.jsx)("p",{className:"mt-0.5 text-[11px] text-text-muted",children:m})]})]}),h]}),v]})}])},63376,e=>{var t=e.i(43476);e.s(["z",0,function({children:e,className:a}){return(0,t.jsx)("div",{className:`animate-page-in${a?` ${a}`:""}`,children:e})},"U",0,function({children:e,className:a}){return(0,t.jsx)("div",{className:a,children:e})}])},71417,e=>{e.s(["L",0,function(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,t)).toFixed(1))} ${["B","KB","MB","GB","TB"][t]}`},"C",0,function(e){return e?("string"==typeof e?new Date(e):e).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}])},75775,e=>{var t=e.i(56420);let a={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],75775)},72382,e=>{var t=e.i(56420);let a={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"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],72382)},29600,e=>{var t=e.i(56420);let a={name:"file",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"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],29600)},69644,e=>{var t=e.i(56420);let a={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],69644)},15170,5015,e=>{var t=e.i(56420);let a={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],15170);let r={name:"file-braces",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 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],aliases:["file-json"]};r.node;let i=(0,t.f)(r);e.s(["f",0,i],5015)},63230,e=>{var t=e.i(56420);let a={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"}]]};a.node;let s=(0,t.f)(a);e.s(["f",0,s],63230)}])})();
@@ -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)("40d8c35b7c4109f4a5412c36751e8e6e4fbd6556d9",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(63230),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)},63230,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],63230)},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,6 +1,6 @@
1
1
  {
2
2
  "name": "@hivemagnus/magnus-ui",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Magnus UI: web console for the Magnus fleet control plane, shipped as a prebuilt Next.js server with the magnus-ui CLI",
5
5
  "keywords": [
6
6
  "magnus",
@@ -64,7 +64,7 @@
64
64
  "ws": "^8.22.0"
65
65
  },
66
66
  "devDependencies": {
67
- "@hivemagnus/magnus-contracts": "1.1.2",
67
+ "@hivemagnus/magnus-contracts": "1.1.4",
68
68
  "@playwright/test": "^1.64.1",
69
69
  "@tailwindcss/postcss": "^4.0.0",
70
70
  "@types/node": "^24.19.2",