@hivemagnus/magnus-ui 3.5.1 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/.env.example +5 -4
  2. package/README.md +52 -4
  3. package/bin/magnus-ui.mjs +118 -2
  4. package/dist/app/apps/dashboard/.next/BUILD_ID +1 -1
  5. package/dist/app/apps/dashboard/.next/build-manifest.json +3 -3
  6. package/dist/app/apps/dashboard/.next/prerender-manifest.json +3 -3
  7. package/dist/app/apps/dashboard/.next/required-server-files.json +2 -16
  8. package/dist/app/apps/dashboard/.next/routes-manifest.json +9 -20
  9. package/dist/app/apps/dashboard/.next/server/app/_global-error.html +1 -1
  10. package/dist/app/apps/dashboard/.next/server/app/_global-error.rsc +1 -1
  11. package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  12. package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/dist/app/apps/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -1
  15. package/dist/app/apps/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  16. package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page.js.nft.json +1 -1
  17. package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page_client-reference-manifest.js +1 -1
  18. package/dist/app/apps/dashboard/.next/server/app/anomalies/page.js.nft.json +1 -1
  19. package/dist/app/apps/dashboard/.next/server/app/anomalies/page_client-reference-manifest.js +1 -1
  20. package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page.js.nft.json +1 -1
  21. package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page_client-reference-manifest.js +1 -1
  22. package/dist/app/apps/dashboard/.next/server/app/api/auth/hive/callback/route.js.nft.json +1 -1
  23. package/dist/app/apps/dashboard/.next/server/app/api/auth/hive/configured/route.js.nft.json +1 -1
  24. package/dist/app/apps/dashboard/.next/server/app/api/auth/hive/start/route.js.nft.json +1 -1
  25. package/dist/app/apps/dashboard/.next/server/app/api/auth/login/route.js.nft.json +1 -1
  26. package/dist/app/apps/dashboard/.next/server/app/api/auth/logout/route.js +6 -5
  27. package/dist/app/apps/dashboard/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  28. package/dist/app/apps/dashboard/.next/server/app/api/auth/me/route.js.nft.json +1 -1
  29. package/dist/app/apps/dashboard/.next/server/app/api/control-nodes/[id]/route.js +2 -2
  30. package/dist/app/apps/dashboard/.next/server/app/api/control-nodes/[id]/route.js.nft.json +1 -1
  31. package/dist/app/apps/dashboard/.next/server/app/api/control-nodes/route.js +2 -2
  32. package/dist/app/apps/dashboard/.next/server/app/api/control-nodes/route.js.nft.json +1 -1
  33. package/dist/app/apps/dashboard/.next/server/app/api/federation/route.js +3 -3
  34. package/dist/app/apps/dashboard/.next/server/app/api/federation/route.js.nft.json +1 -1
  35. package/dist/app/apps/dashboard/.next/server/app/api/health/route.js.nft.json +1 -1
  36. package/dist/app/apps/dashboard/.next/server/app/api/hermes/dashboard/[[...path]]/route.js +8 -6
  37. package/dist/app/apps/dashboard/.next/server/app/api/hermes/dashboard/[[...path]]/route.js.nft.json +1 -1
  38. package/dist/app/apps/dashboard/.next/server/app/api/hive-router/dashboard/[[...path]]/route.js +7 -5
  39. package/dist/app/apps/dashboard/.next/server/app/api/hive-router/dashboard/[[...path]]/route.js.nft.json +1 -1
  40. package/dist/app/apps/dashboard/.next/server/app/api/proxy/[...path]/route.js +5 -5
  41. package/dist/app/apps/dashboard/.next/server/app/api/proxy/[...path]/route.js.nft.json +1 -1
  42. package/dist/app/apps/dashboard/.next/server/app/api/terminal/close/route.js.nft.json +1 -1
  43. package/dist/app/apps/dashboard/.next/server/app/api/terminal/input/route.js.nft.json +1 -1
  44. package/dist/app/apps/dashboard/.next/server/app/api/terminal/open/route.js +4 -4
  45. package/dist/app/apps/dashboard/.next/server/app/api/terminal/open/route.js.nft.json +1 -1
  46. package/dist/app/apps/dashboard/.next/server/app/api/terminal/resize/route.js.nft.json +1 -1
  47. package/dist/app/apps/dashboard/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
  48. package/dist/app/apps/dashboard/.next/server/app/api-docs/page.js.nft.json +1 -1
  49. package/dist/app/apps/dashboard/.next/server/app/api-docs/page_client-reference-manifest.js +1 -1
  50. package/dist/app/apps/dashboard/.next/server/app/application-operations/page.js.nft.json +1 -1
  51. package/dist/app/apps/dashboard/.next/server/app/application-operations/page_client-reference-manifest.js +1 -1
  52. package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page.js.nft.json +1 -1
  53. package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page_client-reference-manifest.js +1 -1
  54. package/dist/app/apps/dashboard/.next/server/app/ardent/page.js.nft.json +1 -1
  55. package/dist/app/apps/dashboard/.next/server/app/ardent/page_client-reference-manifest.js +1 -1
  56. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page.js.nft.json +1 -1
  57. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page_client-reference-manifest.js +1 -1
  58. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page.js.nft.json +1 -1
  59. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page_client-reference-manifest.js +1 -1
  60. package/dist/app/apps/dashboard/.next/server/app/audit/page.js +1 -1
  61. package/dist/app/apps/dashboard/.next/server/app/audit/page.js.nft.json +1 -1
  62. package/dist/app/apps/dashboard/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  63. package/dist/app/apps/dashboard/.next/server/app/codex/installations/page.js.nft.json +1 -1
  64. package/dist/app/apps/dashboard/.next/server/app/codex/installations/page_client-reference-manifest.js +1 -1
  65. package/dist/app/apps/dashboard/.next/server/app/codex/page.js.nft.json +1 -1
  66. package/dist/app/apps/dashboard/.next/server/app/codex/page_client-reference-manifest.js +1 -1
  67. package/dist/app/apps/dashboard/.next/server/app/commands/page.js.nft.json +1 -1
  68. package/dist/app/apps/dashboard/.next/server/app/commands/page_client-reference-manifest.js +1 -1
  69. package/dist/app/apps/dashboard/.next/server/app/cron/page/server-reference-manifest.json +1 -1
  70. package/dist/app/apps/dashboard/.next/server/app/cron/page.js +1 -1
  71. package/dist/app/apps/dashboard/.next/server/app/cron/page.js.nft.json +1 -1
  72. package/dist/app/apps/dashboard/.next/server/app/cron/page_client-reference-manifest.js +1 -1
  73. package/dist/app/apps/dashboard/.next/server/app/files/page.js.nft.json +1 -1
  74. package/dist/app/apps/dashboard/.next/server/app/files/page_client-reference-manifest.js +1 -1
  75. package/dist/app/apps/dashboard/.next/server/app/fleet-map/page.js.nft.json +1 -1
  76. package/dist/app/apps/dashboard/.next/server/app/fleet-map/page_client-reference-manifest.js +1 -1
  77. package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page.js +1 -1
  78. package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page.js.nft.json +1 -1
  79. package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page_client-reference-manifest.js +1 -1
  80. package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page.js +1 -1
  81. package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page.js.nft.json +1 -1
  82. package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page_client-reference-manifest.js +1 -1
  83. package/dist/app/apps/dashboard/.next/server/app/governor/operations/page.js.nft.json +1 -1
  84. package/dist/app/apps/dashboard/.next/server/app/governor/operations/page_client-reference-manifest.js +1 -1
  85. package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page.js +1 -1
  86. package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page.js.nft.json +1 -1
  87. package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page_client-reference-manifest.js +1 -1
  88. package/dist/app/apps/dashboard/.next/server/app/hermes-security/page.js.nft.json +1 -1
  89. package/dist/app/apps/dashboard/.next/server/app/hermes-security/page_client-reference-manifest.js +1 -1
  90. package/dist/app/apps/dashboard/.next/server/app/incidents/page.js +1 -1
  91. package/dist/app/apps/dashboard/.next/server/app/incidents/page.js.nft.json +1 -1
  92. package/dist/app/apps/dashboard/.next/server/app/incidents/page_client-reference-manifest.js +1 -1
  93. package/dist/app/apps/dashboard/.next/server/app/library/page.js +1 -1
  94. package/dist/app/apps/dashboard/.next/server/app/library/page.js.nft.json +1 -1
  95. package/dist/app/apps/dashboard/.next/server/app/library/page_client-reference-manifest.js +1 -1
  96. package/dist/app/apps/dashboard/.next/server/app/login/page.js.nft.json +1 -1
  97. package/dist/app/apps/dashboard/.next/server/app/login/page_client-reference-manifest.js +1 -1
  98. package/dist/app/apps/dashboard/.next/server/app/logs/page.js.nft.json +1 -1
  99. package/dist/app/apps/dashboard/.next/server/app/logs/page_client-reference-manifest.js +1 -1
  100. package/dist/app/apps/dashboard/.next/server/app/mission-control/page.js +1 -1
  101. package/dist/app/apps/dashboard/.next/server/app/mission-control/page.js.nft.json +1 -1
  102. package/dist/app/apps/dashboard/.next/server/app/mission-control/page_client-reference-manifest.js +1 -1
  103. package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page.js.nft.json +1 -1
  104. package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page_client-reference-manifest.js +1 -1
  105. package/dist/app/apps/dashboard/.next/server/app/nodes/page.js +1 -1
  106. package/dist/app/apps/dashboard/.next/server/app/nodes/page.js.nft.json +1 -1
  107. package/dist/app/apps/dashboard/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
  108. package/dist/app/apps/dashboard/.next/server/app/notifications/page.js.nft.json +1 -1
  109. package/dist/app/apps/dashboard/.next/server/app/notifications/page_client-reference-manifest.js +1 -1
  110. package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page.js.nft.json +1 -1
  111. package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page_client-reference-manifest.js +1 -1
  112. package/dist/app/apps/dashboard/.next/server/app/orchestra/page.js.nft.json +1 -1
  113. package/dist/app/apps/dashboard/.next/server/app/orchestra/page_client-reference-manifest.js +1 -1
  114. package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page.js.nft.json +1 -1
  115. package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page_client-reference-manifest.js +1 -1
  116. package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page.js.nft.json +1 -1
  117. package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page_client-reference-manifest.js +1 -1
  118. package/dist/app/apps/dashboard/.next/server/app/page.js +1 -1
  119. package/dist/app/apps/dashboard/.next/server/app/page.js.nft.json +1 -1
  120. package/dist/app/apps/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
  121. package/dist/app/apps/dashboard/.next/server/app/retention/page.js +1 -1
  122. package/dist/app/apps/dashboard/.next/server/app/retention/page.js.nft.json +1 -1
  123. package/dist/app/apps/dashboard/.next/server/app/retention/page_client-reference-manifest.js +1 -1
  124. package/dist/app/apps/dashboard/.next/server/app/roles/page.js +1 -1
  125. package/dist/app/apps/dashboard/.next/server/app/roles/page.js.nft.json +1 -1
  126. package/dist/app/apps/dashboard/.next/server/app/roles/page_client-reference-manifest.js +1 -1
  127. package/dist/app/apps/dashboard/.next/server/app/rollouts/page.js.nft.json +1 -1
  128. package/dist/app/apps/dashboard/.next/server/app/rollouts/page_client-reference-manifest.js +1 -1
  129. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page.js.nft.json +1 -1
  130. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page_client-reference-manifest.js +1 -1
  131. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page.js.nft.json +1 -1
  132. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page_client-reference-manifest.js +1 -1
  133. package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page.js.nft.json +1 -1
  134. package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page_client-reference-manifest.js +1 -1
  135. package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page.js.nft.json +1 -1
  136. package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page_client-reference-manifest.js +1 -1
  137. package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page.js.nft.json +1 -1
  138. package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page_client-reference-manifest.js +1 -1
  139. package/dist/app/apps/dashboard/.next/server/app/security-fusion/page.js +1 -1
  140. package/dist/app/apps/dashboard/.next/server/app/security-fusion/page.js.nft.json +1 -1
  141. package/dist/app/apps/dashboard/.next/server/app/security-fusion/page_client-reference-manifest.js +1 -1
  142. package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page.js.nft.json +1 -1
  143. package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page_client-reference-manifest.js +1 -1
  144. package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page.js.nft.json +1 -1
  145. package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page_client-reference-manifest.js +1 -1
  146. package/dist/app/apps/dashboard/.next/server/app/skills/page/server-reference-manifest.json +1 -1
  147. package/dist/app/apps/dashboard/.next/server/app/skills/page.js +1 -1
  148. package/dist/app/apps/dashboard/.next/server/app/skills/page.js.nft.json +1 -1
  149. package/dist/app/apps/dashboard/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  150. package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page.js.nft.json +1 -1
  151. package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page_client-reference-manifest.js +1 -1
  152. package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page.js.nft.json +1 -1
  153. package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page_client-reference-manifest.js +1 -1
  154. package/dist/app/apps/dashboard/.next/server/app/webhooks/page.js.nft.json +1 -1
  155. package/dist/app/apps/dashboard/.next/server/app/webhooks/page_client-reference-manifest.js +1 -1
  156. package/dist/app/apps/dashboard/.next/server/chunks/{[externals]__0lufsyh_0gqup._.js → [externals]__1k43kg5-icx7b._.js} +1 -1
  157. package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__0vzssf5bgd660._.js → [root-of-the-server]__0ndj_rhwp_6vf._.js} +1 -1
  158. package/dist/app/apps/dashboard/.next/server/chunks/[root-of-the-server]__0ywmf3079vsm1._.js +1 -1
  159. package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__05vapur0p6d-l._.js → [root-of-the-server]__15_4jl4ba_7y3._.js} +1 -1
  160. package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__0iiv9pxo2yauj._.js → [root-of-the-server]__1cxla67mqwfdr._.js} +1 -1
  161. package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__0fwm7idn_76uf._.js → [root-of-the-server]__1rrn6p9afghbt._.js} +1 -1
  162. package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__0ioimsx71gr0o._.js → [root-of-the-server]__1wj2nw17pv5g8._.js} +1 -1
  163. package/dist/app/apps/dashboard/.next/server/chunks/_0jvoc4-ta3zc0._.js +1 -1
  164. package/dist/app/apps/dashboard/.next/server/chunks/_0oj6_-g5b2lvi._.js +1 -1
  165. package/dist/app/apps/dashboard/.next/server/chunks/_0rwz3f0jh1ty0._.js +1 -1
  166. package/dist/app/apps/dashboard/.next/server/chunks/_0s788ryrplkp6._.js +1 -1
  167. package/dist/app/apps/dashboard/.next/server/chunks/_1-ntqfqk_4-f0._.js +1 -1
  168. package/dist/app/apps/dashboard/.next/server/chunks/_120rsoc_nc7_3._.js +1 -1
  169. package/dist/app/apps/dashboard/.next/server/chunks/_1ilhtkg33m99h._.js +1 -1
  170. package/dist/app/apps/dashboard/.next/server/chunks/_1xodprib7qa_j._.js +2 -2
  171. package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_runtime-embed-isolation_mjs_1ovehd-pl97ex._.js +3 -0
  172. package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_src_lib_auth_ts_1hhq1tq6hjj-e._.js +2 -2
  173. package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_src_lib_control-nodes-store_ts_01hjyte7nc7l2._.js +3 -2
  174. package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_src_lib_embedded-frame_ts_1dw1tog69m3ap._.js +3 -0
  175. package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_src_lib_hive-login_ts_0ab2iq7-rpy13._.js +1 -1
  176. package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__02wumq04h7-2m._.js +1 -1
  177. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1koj-a25tcc9z._.js → [root-of-the-server]__0az7ayfxt936j._.js} +2 -2
  178. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__02rfo46o0ocq7._.js → [root-of-the-server]__0cbjirfjkahyz._.js} +1 -1
  179. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__0l7okklk-ix9t._.js → [root-of-the-server]__0mtl30w3r3d8n._.js} +1 -1
  180. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1w1bkuf_-8zxm._.js → [root-of-the-server]__0n1mehgazoyys._.js} +1 -1
  181. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1y4za7l5ph9o-._.js → [root-of-the-server]__0piptu4qrcax4._.js} +1 -1
  182. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__0neu-iblb1_-5._.js → [root-of-the-server]__0qoxqg_z229qc._.js} +1 -1
  183. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1jb0a4bkg6dd1._.js → [root-of-the-server]__0yvtveej1dtd6._.js} +1 -1
  184. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__000ndthd0hd5v._.js → [root-of-the-server]__0zftzxoekcfyw._.js} +1 -1
  185. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__202zczfuwkbzi._.js → [root-of-the-server]__15i5sz08w-tg0._.js} +1 -1
  186. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1ria97bl22vsq._.js → [root-of-the-server]__18k_-53xs-qpk._.js} +2 -2
  187. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1jtg9fc0ny1cg._.js → [root-of-the-server]__1cesdboqyg7rq._.js} +1 -1
  188. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1wsrd6m1h8q7q._.js → [root-of-the-server]__1p0rsbsf87odz._.js} +1 -1
  189. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1l8__2gqqi590._.js → [root-of-the-server]__1un9oi8-bokqt._.js} +1 -1
  190. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1gwofuehw8lyc._.js → [root-of-the-server]__206hwh476sy80._.js} +1 -1
  191. package/dist/app/apps/dashboard/.next/server/chunks/ssr/_07u8d93e_m_yo._.js +3 -2
  192. package/dist/app/apps/dashboard/.next/server/chunks/ssr/_0caxc2bc6a__r._.js +1 -1
  193. package/dist/app/apps/dashboard/.next/server/chunks/ssr/_1oebzzj_en62h._.js +1 -1
  194. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_runtime-environment_mjs_11tpywm9_soif._.js +1 -1
  195. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_0gs_s688kgg1i._.js +1 -1
  196. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_anomalies_remediation_page_tsx_179m33swiclif._.js +1 -1
  197. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_ardent_installations_page_tsx_0nvqgacugy6nf._.js +1 -1
  198. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_audit_audit-client_tsx_0iyab_tlw5yus._.js +1 -1
  199. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_cron_page_tsx_1i3duyygc0_tg._.js +1 -1
  200. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_files_page_tsx_1kls9-qinldks._.js +1 -1
  201. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_governor_operations_page_tsx_1tvdkgil8mlgk._.js +1 -1
  202. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_login_page_tsx_12_rihimtav2a._.js +1 -1
  203. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_logs_page_tsx_0473-hcpj1mqr._.js +1 -1
  204. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_mission-control_page_tsx_0crgxncex_u3w._.js +1 -1
  205. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_nodes_[nodeId]_page_tsx_1q7fqu18oklzc._.js +1 -1
  206. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_nodes_nodes-client_tsx_0pt4iarhpqbgn._.js +1 -1
  207. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_orchestra_web-gateway_page_tsx_1fz12np0wk27t._.js +1 -1
  208. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_security-fusion_page_tsx_0d314q7yh6fx8._.js +1 -1
  209. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_skills_page_tsx_0n5zp4xad38in._.js +1 -1
  210. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_webhooks_webhook-form_tsx_02z3be5wx7-cb._.js +1 -1
  211. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_components_ui_card_tsx_1pngl2ib-xo5t._.js +1 -1
  212. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_components_ui_node-selector_tsx_1ci6ldznpaofq._.js +1 -1
  213. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_lib_api-client_ts_0tho-kkk5ez7h._.js +1 -1
  214. package/dist/app/apps/dashboard/.next/server/middleware-build-manifest.js +3 -3
  215. package/dist/app/apps/dashboard/.next/server/pages/500.html +1 -1
  216. package/dist/app/apps/dashboard/.next/server/preview-props.json +3 -3
  217. package/dist/app/apps/dashboard/.next/server/server-reference-manifest.js +1 -1
  218. package/dist/app/apps/dashboard/.next/server/server-reference-manifest.json +3 -3
  219. package/dist/app/apps/dashboard/.next/static/chunks/{369vzlcjad-gn.js → 017x1uhn9l7nw.js} +1 -1
  220. package/dist/app/apps/dashboard/.next/static/chunks/{1-vn8cqro-f08.js → 06_2psos--paq.js} +1 -1
  221. package/dist/app/apps/dashboard/.next/static/chunks/0i8g96dmx-fbo.css +2 -0
  222. package/dist/app/apps/dashboard/.next/static/chunks/0nalo72r7vipw.js +1 -0
  223. package/dist/app/apps/dashboard/.next/static/chunks/0pswbe-19xxl5.js +1 -0
  224. package/dist/app/apps/dashboard/.next/static/chunks/{3ntnj6ts2r3e2.js → 0s2skhp7086pc.js} +1 -1
  225. package/dist/app/apps/dashboard/.next/static/chunks/{0nekvgtqt8goj.js → 0zsp_alwy1f3v.js} +1 -1
  226. package/dist/app/apps/dashboard/.next/static/chunks/1fpi73pmpn8v5.js +1 -0
  227. package/dist/app/apps/dashboard/.next/static/chunks/1gko0bkguj_g0.js +1 -0
  228. package/dist/app/apps/dashboard/.next/static/chunks/{0lxf5l-ugq-09.js → 1t6g3-pjlavb5.js} +1 -1
  229. package/dist/app/apps/dashboard/.next/static/chunks/{1xdzfjeq_fj4f.js → 1ygangs-zn4yl.js} +1 -1
  230. package/dist/app/apps/dashboard/.next/static/chunks/2_eadjwf4989d.js +1 -0
  231. package/dist/app/apps/dashboard/.next/static/chunks/2fzv4_us4q1w_.js +1 -0
  232. package/dist/app/apps/dashboard/.next/static/chunks/{1cvbtmsr4d3ci.js → 2isl5q2zhjwiw.js} +1 -1
  233. package/dist/app/apps/dashboard/.next/static/chunks/2jaw-lni6k_dt.js +1 -0
  234. package/dist/app/apps/dashboard/.next/static/chunks/2sh8fn_vg-vs5.js +1 -0
  235. package/dist/app/apps/dashboard/.next/static/chunks/{1kx48jg-4j5iv.js → 2u4_fj_v8i521.js} +2 -2
  236. package/dist/app/apps/dashboard/.next/static/chunks/{3qr1h6_w6vi_4.js → 2zj24fir1fm27.js} +1 -1
  237. package/dist/app/apps/dashboard/.next/static/chunks/{3w-7xko96ljib.js → 2zjjqqg5z63sl.js} +1 -1
  238. package/dist/app/apps/dashboard/.next/static/chunks/337js55ro9g08.js +1 -0
  239. package/dist/app/apps/dashboard/.next/static/chunks/{37kstof-v-jwi.js → 33xay7yclh_jd.js} +1 -1
  240. package/dist/app/apps/dashboard/.next/static/chunks/34yff9n0mbd1h.js +1 -0
  241. package/dist/app/apps/dashboard/.next/static/chunks/{05p7s0xtb3koa.js → 3eo_31lzj51v9.js} +1 -1
  242. package/dist/app/apps/dashboard/.next/static/chunks/{12ju76tjcqh_z.js → 3f73kvi1pwabq.js} +4 -4
  243. package/dist/app/apps/dashboard/.next/static/chunks/{23o8zfgrdxuhk.js → 3kh386y5gla53.js} +1 -1
  244. package/dist/app/apps/dashboard/.next/static/chunks/3mwn69j8d-q9v.js +4 -0
  245. package/dist/app/apps/dashboard/.next/static/chunks/3p_wvl3sieoi4.js +1 -0
  246. package/dist/app/apps/dashboard/.next/static/chunks/{0yb36s9l-f3_w.js → 3qrrim22gq-vp.js} +1 -1
  247. package/dist/app/apps/dashboard/.next/static/chunks/3ui3xvxcdyc0r.js +1 -0
  248. package/dist/app/apps/dashboard/.next/static/chunks/3ya4-24grz_0f.js +1 -0
  249. package/dist/app/apps/dashboard/.next/static/chunks/{37pb0l96d03rk.js → 42j6wpibe0zrn.js} +1 -1
  250. package/dist/app/apps/dashboard/.next/static/chunks/4369o9c3gezxt.js +6 -0
  251. package/dist/app/apps/dashboard/.next/static/rWpgppq64sqgeZO3-MlD1/_buildManifest.js +11 -0
  252. package/dist/app/apps/dashboard/package.json +3 -2
  253. package/dist/app/apps/dashboard/runtime-control-node-credentials.mjs +638 -0
  254. package/dist/app/apps/dashboard/runtime-embed-isolation.mjs +450 -0
  255. package/dist/app/apps/dashboard/runtime-environment.mjs +1 -1
  256. package/dist/app/apps/dashboard/runtime-integrations.mjs +4 -4
  257. package/dist/app/apps/dashboard/server-tls.mjs +96 -47
  258. package/dist/app/apps/dashboard/server.js +1 -1
  259. package/npm-shrinkwrap.json +4 -3
  260. package/package.json +3 -2
  261. package/dist/app/apps/dashboard/.next/static/chunks/015s19fe5dtkp.css +0 -2
  262. package/dist/app/apps/dashboard/.next/static/chunks/07tx3h4lr-lxl.js +0 -6
  263. package/dist/app/apps/dashboard/.next/static/chunks/0u9-brifz45bj.js +0 -1
  264. package/dist/app/apps/dashboard/.next/static/chunks/19-20lxkk1axv.js +0 -1
  265. package/dist/app/apps/dashboard/.next/static/chunks/1j5vpju4k1wlj.js +0 -1
  266. package/dist/app/apps/dashboard/.next/static/chunks/1kjl44-64ume7.js +0 -1
  267. package/dist/app/apps/dashboard/.next/static/chunks/28zpgt1trm_m4.js +0 -1
  268. package/dist/app/apps/dashboard/.next/static/chunks/2lk4ailve7631.js +0 -1
  269. package/dist/app/apps/dashboard/.next/static/chunks/2lulmsr2vjuw5.js +0 -1
  270. package/dist/app/apps/dashboard/.next/static/chunks/30npcziw-f8ld.js +0 -1
  271. package/dist/app/apps/dashboard/.next/static/chunks/31hx4x8k9707e.js +0 -1
  272. package/dist/app/apps/dashboard/.next/static/chunks/34mzv0h7jkx20.js +0 -1
  273. package/dist/app/apps/dashboard/.next/static/chunks/3cw8xs2dab1g-.js +0 -1
  274. package/dist/app/apps/dashboard/.next/static/chunks/3dao7nu2cr6a9.js +0 -4
  275. package/dist/app/apps/dashboard/.next/static/chunks/3gjll_bse9v1f.js +0 -1
  276. package/dist/app/apps/dashboard/.next/static/chunks/3qq-otw-t-6b0.js +0 -1
  277. package/dist/app/apps/dashboard/.next/static/pcEuomTy_lxr51c8J4RQm/_buildManifest.js +0 -20
  278. /package/dist/app/apps/dashboard/.next/static/{pcEuomTy_lxr51c8J4RQm → rWpgppq64sqgeZO3-MlD1}/_clientMiddlewareManifest.js +0 -0
  279. /package/dist/app/apps/dashboard/.next/static/{pcEuomTy_lxr51c8J4RQm → rWpgppq64sqgeZO3-MlD1}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67683,e=>{"use strict";var a=e.i(43476),s=e.i(22016),r=e.i(64155),t=e.i(83902);e.s(["f",0,function({summary:e,showAction:n=!0}){let i=e.nodes.filter(e=>e.tailscale?.requiresRenewal).sort((e,a)=>e.tailscale?.expired!==a.tailscale?.expired?e.tailscale?.expired?-1:1:(e.tailscale?.daysRemaining??Number.MAX_SAFE_INTEGER)-(a.tailscale?.daysRemaining??Number.MAX_SAFE_INTEGER));if(0===i.length)return null;let l=i.some(e=>e.tailscale?.expired),o=l?t.f:r.f,c=l?{panel:"border-danger/40 bg-danger/5",rail:"bg-danger",icon:"bg-danger/10 text-danger",text:"text-danger",chip:"border-danger/30 text-danger",action:"border-danger/40 text-danger hover:bg-danger/10"}:{panel:"border-warning/40 bg-warning/5",rail:"bg-warning",icon:"bg-warning/10 text-warning",text:"text-warning",chip:"border-warning/30 text-warning",action:"border-warning/40 text-warning hover:bg-warning/10"};return(0,a.jsxs)("section",{id:"tailscale-renewal",role:"alert","aria-label":"Tailscale renewal alert",className:`relative overflow-hidden rounded border px-4 py-3 ${c.panel}`,children:[(0,a.jsx)("div",{className:`absolute inset-y-0 left-0 w-0.5 ${c.rail}`}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[(0,a.jsx)("div",{className:`mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded ${c.icon}`,children:(0,a.jsx)(o,{className:"h-4 w-4"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:`text-xs font-bold uppercase tracking-[0.14em] ${c.text}`,children:l?"Tailscale access expired":"Tailscale renewal due"}),(0,a.jsxs)("p",{className:"mt-1 text-[11px] text-text-muted",children:[i.length," node ",1===i.length?"key needs":"keys need"," renewal within ",e.warningDays," days. Renew before tailnet access is interrupted."]}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:i.map(e=>(0,a.jsxs)("span",{title:e.tailscale?.keyExpiry?`Expires ${e.tailscale.keyExpiry}`:void 0,className:`inline-flex items-center gap-1 rounded border bg-background/40 px-2 py-0.5 font-mono text-[10px] ${c.chip}`,children:[(0,a.jsx)("span",{className:"font-semibold",children:e.name}),(0,a.jsx)("span",{"aria-hidden":"true",children:"·"}),(0,a.jsx)("span",{children:e.tailscale?.expired?"expired":`${e.tailscale?.daysRemaining??"?"}d`})]},e.id))})]})]}),n&&(0,a.jsx)(s.default,{href:"/nodes#tailscale-renewal",className:`shrink-0 self-start rounded border px-3 py-1.5 text-[10px] font-bold uppercase tracking-wider transition-colors sm:self-center ${c.action}`,children:"Review nodes"})]})]})}])},53721,e=>{"use strict";var a=e.i(43476),s=e.i(64155),r=e.i(46670),t=e.i(63646);e.s(["x",0,function({readiness:e}){return e?.status!=="not-ready"?null:(0,a.jsx)("span",{title:(0,t.K)(e),"data-testid":"upgrade-readiness-badge",children:(0,a.jsxs)(r.t,{variant:"warning",children:[(0,a.jsx)(s.f,{className:"mr-1 inline h-3 w-3"}),"Upgrade blocked (",e.problems.length,")"]})})},"a",0,function({readiness:e}){return e?.status!=="not-ready"?null:(0,a.jsxs)("div",{className:"rounded border border-warning/40 bg-warning/10 px-3 py-2 text-[11px]","data-testid":"upgrade-readiness-panel",children:[(0,a.jsxs)("p",{className:"flex items-center gap-2 font-bold uppercase tracking-wider text-warning",children:[(0,a.jsx)(s.f,{className:"h-3.5 w-3.5"})," This node could not take an agent upgrade now"]}),(0,a.jsx)("ul",{className:"mt-2 space-y-2",children:e.problems.map(e=>(0,a.jsxs)("li",{children:[(0,a.jsxs)("p",{className:"font-medium text-text",children:[(0,a.jsx)("span",{className:"num",children:e.code}),": ",e.detail]}),(0,a.jsx)("p",{className:"text-text-muted",children:e.remedy})]},`${e.code}-${e.detail}`))})]})}])},46670,e=>{"use strict";var a=e.i(43476),s=e.i(78571);let r={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)]"},t={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:o=!1}){return(0,a.jsxs)("span",{className:(0,s.f)("inline-flex items-center gap-1.5 rounded-chip border px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",r[n],i),children:[l&&(0,a.jsxs)("span",{"aria-hidden":"true",className:"relative inline-flex h-1.5 w-1.5",children:[o&&(0,a.jsx)("span",{className:(0,s.f)("absolute inset-0 rounded-full animate-halo",t[n])}),(0,a.jsx)("span",{className:(0,s.f)("relative inline-flex h-1.5 w-1.5 rounded-full",t[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=>{"use strict";var a=e.i(43476),s=e.i(56420);let r={name:"arrow-down-right",size:24,node:[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]};r.node;let t=(0,s.f)(r);var n=e.i(75775),i=e.i(78571),l=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:s=100,tone:r,thresholds:t=o.q,label:n,size:l="xs",showValue:m=!1,valueLabel:u,glow:h,className:p,testId:g}){let f="number"==typeof e&&Number.isFinite(e),v=f?Math.max(0,Math.min(100,e/(s||1)*100)):0,b=r??(f?(0,o.Z)(v,t):"muted"),j=h||!r&&f&&v>=t.warn,N=u??(f?`${v.toFixed(+(v<10&&v>0))}%`:"—");return(0,a.jsxs)("div",{className:(0,i.f)("flex min-w-0 items-center gap-2",p),"data-testid":g,children:[(0,a.jsx)("div",{...f?{role:"meter","aria-label":n,"aria-valuemin":0,"aria-valuemax":s,"aria-valuenow":e,"aria-valuetext":N}:{role:"img","aria-label":n?`${n}: no data`:"No data"},className:(0,i.f)("relative flex-1 overflow-hidden rounded-full bg-border/70",d[l]),children:(0,a.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",o.H[b],j&&c[b])})}),m&&(0,a.jsx)("span",{className:(0,i.f)("num w-11 shrink-0 text-right text-[11px]",f?o.T[b]:"text-text-muted"),children:N})]})}e.s(["f",0,x],51196);var m=e.i(71645);function u({values:e,tone:s="primary",width:r=160,height:t=32,area:n=!0,max:l,percent:c=!1,threshold:d,live:x=!0,emptyLabel:h="not enough data",className:p,testId:g,label:f,stretch:v=!1}){let b=`spark${(0,m.useId)().replace(/:/g,"")}`;if(e.length<2)return(0,a.jsx)("div",{className:(0,i.f)("flex h-8 items-center text-xs italic text-text-muted",p),"data-testid":g,children:h});let j=o.v[s],N=l??(c?Math.max(100,...e):Math.max(...e,d??0)||1),w=t-4,y=r/(e.length-1),k=e=>2+w-Math.max(0,e)/N*w,_=e.map((e,a)=>[a*y,k(e)]),E=_.map(([e,a])=>`${e.toFixed(1)},${a.toFixed(1)}`).join(" "),C=_[_.length-1];return(0,a.jsxs)("svg",{width:v?"100%":r,height:t,viewBox:`0 0 ${r} ${t}`,preserveAspectRatio:v?"none":void 0,className:(0,i.f)("block overflow-visible",p),"data-testid":g,role:f?"img":void 0,"aria-label":f,"aria-hidden":!f||void 0,children:[n&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:b,x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:j,stopOpacity:.35}),(0,a.jsx)("stop",{offset:"100%",stopColor:j,stopOpacity:0})]})}),(0,a.jsx)("polygon",{points:`0,${t} ${E} ${r},${t}`,fill:`url(#${b})`})]}),void 0!==d&&(0,a.jsx)("line",{x1:0,x2:r,y1:k(d),y2:k(d),stroke:"var(--color-warning)",strokeOpacity:.5,strokeDasharray:"3 3",strokeWidth:1}),(0,a.jsx)("polyline",{fill:"none",stroke:j,strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round",points:E}),x&&!v&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("circle",{cx:C[0],cy:C[1],r:2.5,fill:j,className:"origin-center animate-halo [transform-box:fill-box]"}),(0,a.jsx)("circle",{cx:C[0],cy:C[1],r:2,fill:j})]})]})}e.s(["f",0,u],55427),e.s(["N",0,function({title:e,description:s,children:r,className:t,action:n,tone:i,corners:o=!1,...c}){return(0,a.jsx)(l.f,{...c,tone:i,corners:o,title:e,description:s,action:n,className:t,children:r})},"n",0,function({label:e,value:s,icon:r,trend:c,spark:d,meter:m,delta:h,tone:p="primary",className:g,testId:f}){let v=!h||h.value>=0===(h.positiveIsGood??!0);return(0,a.jsxs)(l.f,{tone:p,className:(0,i.f)("overflow-hidden",g),testId:f,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:e}),r&&(0,a.jsx)("span",{className:"text-primary/60",children:r})]}),(0,a.jsxs)("div",{className:"mt-2 flex items-end justify-between gap-2",children:[(0,a.jsx)("div",{className:(0,i.f)("num text-2xl font-bold","primary"===p?"text-primary neon-text":o.T[p]),children:s}),h&&0!==h.value&&(0,a.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,a.jsx)(n.f,{className:"h-3 w-3"}):(0,a.jsx)(t,{className:"h-3 w-3"}),Math.abs(h.value).toFixed(+!Number.isInteger(h.value)),h.unit]})]}),c&&(0,a.jsx)("div",{className:(0,i.f)("mt-1 text-[11px]",c.positive?"text-success":"text-danger"),children:c.value}),void 0!==m&&(0,a.jsx)(x,{value:m,className:"mt-3",label:e}),d&&d.length>1&&(0,a.jsx)("div",{className:"-mx-5 -mb-5 mt-3 opacity-80",children:(0,a.jsx)(u,{values:d,tone:p,width:240,height:28,stretch:!0,live:!1})})]})}],93999)},3062,e=>{"use strict";var a=e.i(43476),s=e.i(78571),r=e.i(35084);let t={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:o=!0,interactive:c=!0,hero:d=!1,title:x,description:m,icon:u,action:h,as:p="div",padding:g="md",testId:f,className:v,children:b,...j}){return(0,a.jsxs)(p,{...j,"data-testid":f??j["data-testid"],className:(0,s.f)("relative rounded-panel border border-border bg-surface transition-colors duration-300",l[g],o&&"panel-corners",o&&t[e],c&&"glow-hover",c&&n[e],c&&i[e],d&&"grid-bg overflow-hidden bg-surface/80",v),children:[(x||h||u)&&(0,a.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[u&&(0,a.jsx)("span",{className:(0,s.f)("mt-0.5 shrink-0",r.T[e]),children:u}),(0,a.jsxs)("div",{className:"min-w-0",children:[x&&(0,a.jsx)("h3",{className:"text-xs font-bold uppercase tracking-wider",children:x}),m&&(0,a.jsx)("p",{className:"mt-0.5 text-[11px] text-text-muted",children:m})]})]}),h]}),b]})}])},73404,e=>{"use strict";var a=e.i(43476),s=e.i(78571),r=e.i(35084);e.s(["f",0,function({title:e,eyebrow:t,description:n,icon:i,actions:l,status:o,tone:c="primary",className:d,testId:x}){return(0,a.jsxs)("div",{"data-testid":x,className:(0,s.f)("flex flex-wrap items-end justify-between gap-4",d),children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[i&&(0,a.jsx)("span",{"aria-hidden":"true",className:(0,s.f)("mt-0.5 flex h-10 w-10 shrink-0 items-center justify-center rounded-panel border bg-surface","accent"===c?"border-accent/40 shadow-[0_0_14px_var(--color-glow-accent)]":"border-primary/40 shadow-[0_0_14px_var(--color-glow)]",r.T[c]),children:i}),(0,a.jsxs)("div",{className:"min-w-0",children:[t&&(0,a.jsxs)("p",{className:(0,s.f)("mb-1 text-[10px] font-medium uppercase tracking-[0.3em]",r.T[c],"opacity-80"),children:[(0,a.jsx)("span",{"aria-hidden":"true",children:"// "}),t]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsx)("h1",{className:(0,s.f)("text-xl font-bold uppercase tracking-wider",r.T[c],r.z[c]),children:e}),o]}),n&&(0,a.jsx)("p",{className:"mt-1 max-w-3xl text-xs text-text-muted",children:n})]})]}),l&&(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:l})]})}])},63376,e=>{"use strict";var a=e.i(43476);e.s(["z",0,function({children:e,className:s}){return(0,a.jsx)("div",{className:`animate-page-in${s?` ${s}`:""}`,children:e})},"U",0,function({children:e,className:s}){return(0,a.jsx)("div",{className:s,children:e})}])},65369,e=>{"use strict";var a=e.i(43476),s=e.i(78571);function r({className:e}){return(0,a.jsx)("div",{"aria-hidden":"true",className:(0,s.f)("skeleton h-3 w-full",e)})}e.s(["l",0,r,"g",0,function({count:e=4,className:t}){return(0,a.jsx)("div",{role:"status","aria-label":"Loading",className:(0,s.f)("grid gap-4 sm:grid-cols-2 lg:grid-cols-4",t),children:Array.from({length:e},(e,s)=>(0,a.jsxs)("div",{className:"panel-corners rounded-panel border border-border bg-surface p-5",children:[(0,a.jsx)(r,{className:"h-2 w-1/2"}),(0,a.jsx)(r,{className:"mt-4 h-7 w-2/3"}),(0,a.jsx)(r,{className:"mt-3 h-1 w-full opacity-60"})]},s))})},"F",0,function({rows:e=5,cols:t=4,className:n}){return(0,a.jsxs)("div",{role:"status","aria-label":"Loading",className:(0,s.f)("overflow-hidden rounded-panel border border-border",n),children:[(0,a.jsx)("div",{className:"flex gap-4 border-b border-border bg-surface px-4 py-3",children:Array.from({length:t},(e,s)=>(0,a.jsx)(r,{className:"h-2 flex-1 opacity-60"},s))}),Array.from({length:e},(e,n)=>(0,a.jsx)("div",{className:"flex gap-4 border-b border-border/50 px-4 py-3 last:border-0",children:Array.from({length:t},(e,t)=>(0,a.jsx)(r,{className:(0,s.f)("h-3 flex-1",(n+t)%3==0&&"max-w-[60%]")},t))},n))]})},"Q",0,function({lines:e=3,className:t}){let n=["w-full","w-11/12","w-4/5","w-2/3","w-3/4"];return(0,a.jsx)("div",{role:"status","aria-label":"Loading",className:(0,s.f)("space-y-2",t),children:Array.from({length:e},(e,s)=>(0,a.jsx)(r,{className:n[s%n.length]},s))})}])},75723,e=>{"use strict";var a=e.i(43476),s=e.i(78571),r=e.i(46670);let t={success:"bg-success shadow-[0_0_6px_var(--color-success)]",warning:"bg-warning shadow-[0_0_6px_var(--color-warning)]",danger:"bg-danger shadow-[0_0_6px_var(--color-danger)]",info:"bg-info shadow-[0_0_6px_var(--color-info)]",default:"bg-text-muted"},n={success:"bg-success",warning:"bg-warning",danger:"bg-danger",info:"bg-info",default:"bg-text-muted"},i=new Set(["ONLINE","RUNNING","ACTIVE","HEALTHY","CRITICAL","UPDATING","PROVISIONING"]);e.s(["f",0,function({status:e,pulse:l,size:o="sm",className:c,label:d}){let x=(0,r.k)(e),m=l??i.has(e.toUpperCase()),u="xs"===o?"h-1.5 w-1.5":"h-2 w-2";return(0,a.jsxs)("span",{className:(0,s.f)("relative inline-flex shrink-0",u,c),role:d?"img":void 0,"aria-label":d,"aria-hidden":!d||void 0,children:[m&&(0,a.jsx)("span",{className:(0,s.f)("absolute inset-0 rounded-full animate-halo",n[x])}),(0,a.jsx)("span",{className:(0,s.f)("relative inline-flex rounded-full",u,t[x])})]})}])},71417,e=>{"use strict";e.s(["L",0,function(e){if(0===e)return"0 B";let a=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,a)).toFixed(1))} ${["B","KB","MB","GB","TB"][a]}`},"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"}):"—"}])},59439,e=>{e.v(a=>Promise.all(["static/chunks/1ixu-i6j99dj0.js"].map(a=>e.l(a))).then(()=>a(93309)))},37138,e=>{e.v(a=>Promise.all(["static/chunks/3h4dmpbixi6eo.js"].map(a=>e.l(a))).then(()=>a(99894)))},75775,e=>{"use strict";var a=e.i(56420);let s={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};s.node;let r=(0,a.f)(s);e.s(["f",0,r],75775)},57665,e=>{"use strict";var a=e.i(56420);let s={name:"power",size:24,node:[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]};s.node;let r=(0,a.f)(s);e.s(["f",0,r],57665)},86207,14098,e=>{"use strict";var a=e.i(56420);let s={name:"refresh-ccw-dot",size:24,node:[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]};s.node;let r=(0,a.f)(s);e.s(["f",0,r],86207);var t=e.i(43476),n=e.i(71645),i=e.i(68759),l=e.i(32568),o=e.i(82983),c=e.i(41220),d=e.i(32781);e.s(["E",0,function({open:e,node:a,onClose:s,onSaved:r}){let[x,m]=(0,n.useState)([]),[u,h]=(0,n.useState)(""),[p,g]=(0,n.useState)(!0),[f,v]=(0,n.useState)(!1),[b,j]=(0,n.useState)(""),[N,w]=(0,n.useState)(!1);(0,n.useEffect)(()=>{e&&(j(""),h(a?.role?.id??""),g(!0),w(!0),(async()=>{try{let e=await o.f.roles.list();m(e.data??[])}catch{j("Failed to load roles")}finally{w(!1)}})())},[e,a?.role?.id]);let y=async()=>{if(a){v(!0),j("");try{let e=a.role?.id;e&&e!==u&&await o.f.roles.unassign(e,{nodeIds:[a.id]}),u&&await o.f.roles.assign(u,{nodeIds:[a.id],defer:!p});let t=u?x.find(e=>e.id===u)??null:null;r(t),s()}catch(e){j(e instanceof Error?e.message:"Failed to assign role")}finally{v(!1)}}},k=async()=>{if(a?.role){v(!0),j("");try{await o.f.roles.unassign(a.role.id,{nodeIds:[a.id]}),r(null),s()}catch(e){j(e instanceof Error?e.message:"Failed to unassign role")}finally{v(!1)}}},_=()=>{j(""),v(!1),s()};return(0,t.jsx)(l.n,{open:e,onClose:_,title:a?.role?"Change Role":"Assign Role",description:a?`Node: ${a.name}`:"",icon:(0,t.jsx)(c.f,{className:"h-5 w-5 text-primary"}),children:(0,t.jsxs)("div",{className:"space-y-4",children:[N?(0,t.jsxs)("div",{className:"flex items-center gap-2 py-4 text-xs text-text-muted",children:[(0,t.jsx)(d.f,{className:"h-4 w-4 animate-spin"}),"Loading roles…"]}):0===x.length?(0,t.jsx)("p",{className:"text-xs text-text-muted py-4",children:"No roles found. Create a role first on the Roles page."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.G,{label:"Role",children:(0,t.jsxs)("select",{value:u,onChange:e=>h(e.target.value),className:l.N,children:[(0,t.jsx)("option",{value:"",children:"— No role —"}),x.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})}),u&&(0,t.jsxs)("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:p,onChange:e=>g(e.target.checked),className:"rounded border-border"}),"Apply role immediately"]})]}),b&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:b}),(0,t.jsxs)("div",{className:"flex justify-between pt-2",children:[(0,t.jsx)("div",{children:a?.role&&(0,t.jsx)(i.K,{variant:"secondary",size:"sm",onClick:()=>void k(),disabled:f,children:"Unassign Role"})}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(i.K,{variant:"secondary",size:"sm",onClick:_,children:"Cancel"}),(0,t.jsx)(i.K,{size:"sm",onClick:()=>void y(),disabled:f||!u||0===x.length,icon:f?(0,t.jsx)(d.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:f?"Saving…":a?.role?"Change Role":"Assign Role"})]})]})]})})},"F",0,function({open:e,node:a,onClose:s,onSaved:r}){let[x,m]=(0,n.useState)(""),[u,h]=(0,n.useState)(""),[p,g]=(0,n.useState)(""),[f,v]=(0,n.useState)(!1),[b,j]=(0,n.useState)("");(0,n.useEffect)(()=>{if(a){m(a.name);try{let e=JSON.parse(a.tags);h(e.join(", "))}catch{h("")}g(a.status),j("")}},[a]);let N=async()=>{if(a&&x.trim()){v(!0),j("");try{let e=u.split(",").map(e=>e.trim()).filter(Boolean);await o.f.nodes.update(a.id,{name:x.trim(),tags:e,status:p.toUpperCase()}),r(),s()}catch(e){j(e instanceof Error?e.message:"Failed to update node")}finally{v(!1)}}},w=()=>{j(""),v(!1),s()};return(0,t.jsx)(l.n,{open:e,onClose:w,title:"Edit Node",description:a?`${a.hostname}`:"",icon:(0,t.jsx)(c.f,{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),className:l.W})}),(0,t.jsx)(l.G,{label:"Status",children:(0,t.jsxs)("select",{value:p,onChange:e=>g(e.target.value),className:l.N,children:[(0,t.jsx)("option",{value:"ONLINE",children:"ONLINE"}),(0,t.jsx)("option",{value:"OFFLINE",children:"OFFLINE"}),(0,t.jsx)("option",{value:"DEGRADED",children:"DEGRADED"}),(0,t.jsx)("option",{value:"PROVISIONING",children:"PROVISIONING"}),(0,t.jsx)("option",{value:"MAINTENANCE",children:"MAINTENANCE"})]})}),(0,t.jsxs)(l.G,{label:"Tags",children:[(0,t.jsx)("input",{type:"text",value:u,onChange:e=>h(e.target.value),placeholder:"web, production, us-east",className:l.W}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated list of tags"})]}),b&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:b}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)(i.K,{variant:"secondary",size:"sm",onClick:w,children:"Cancel"}),(0,t.jsx)(i.K,{size:"sm",onClick:()=>void N(),disabled:f||!x.trim(),icon:f?(0,t.jsx)(d.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:f?"Saving…":"Save Changes"})]})]})})},"M",0,function({open:e,onClose:a,onRegistered:s}){let[r,x]=(0,n.useState)(""),[m,u]=(0,n.useState)(""),[h,p]=(0,n.useState)("4100"),[g,f]=(0,n.useState)("linux"),[v,b]=(0,n.useState)("x86_64"),[j,N]=(0,n.useState)(""),[w,y]=(0,n.useState)(!1),[k,_]=(0,n.useState)(""),E=async()=>{if(r.trim()&&m.trim()){y(!0),_("");try{let e=j.split(",").map(e=>e.trim()).filter(Boolean);await o.f.nodes.register({name:r.trim(),hostname:m.trim(),ipAddress:m.trim(),port:Number(h)||4100,os:g,arch:v,tags:e,agentVersion:"3.7.0"}),s(),C()}catch(e){_(e instanceof Error?e.message:"Failed to register node")}finally{y(!1)}}},C=()=>{x(""),u(""),p("4100"),f("linux"),b("x86_64"),N(""),_(""),y(!1),a()};return(0,t.jsx)(l.n,{open:e,onClose:C,title:"Register Node",description:"Manually register a node already running the agent",icon:(0,t.jsx)(c.f,{className:"h-5 w-5 text-primary"}),children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(l.G,{label:"Node Name",required:!0,children:(0,t.jsx)("input",{type:"text",value:r,onChange:e=>x(e.target.value),placeholder:"web-server-01",className:l.W,autoFocus:!0})}),(0,t.jsx)(l.G,{label:"FQDN / Hostname",required:!0,children:(0,t.jsx)("input",{type:"text",value:m,onChange:e=>u(e.target.value),placeholder:"node-1.example.com",className:l.W})}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,t.jsx)(l.G,{label:"Port",children:(0,t.jsx)("input",{type:"number",value:h,onChange:e=>p(e.target.value),className:l.W})}),(0,t.jsx)(l.G,{label:"OS",children:(0,t.jsxs)("select",{value:g,onChange:e=>f(e.target.value),className:l.N,children:[(0,t.jsx)("option",{value:"linux",children:"Linux"}),(0,t.jsx)("option",{value:"darwin",children:"macOS"}),(0,t.jsx)("option",{value:"windows",children:"Windows"})]})}),(0,t.jsx)(l.G,{label:"Architecture",children:(0,t.jsxs)("select",{value:v,onChange:e=>b(e.target.value),className:l.N,children:[(0,t.jsx)("option",{value:"x86_64",children:"x86_64"}),(0,t.jsx)("option",{value:"aarch64",children:"aarch64"}),(0,t.jsx)("option",{value:"arm",children:"arm"})]})})]}),(0,t.jsxs)(l.G,{label:"Tags",children:[(0,t.jsx)("input",{type:"text",value:j,onChange:e=>N(e.target.value),placeholder:"web, production, us-east",className:l.W}),(0,t.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Comma-separated"})]}),k&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:k}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-2",children:[(0,t.jsx)(i.K,{variant:"secondary",size:"sm",onClick:C,children:"Cancel"}),(0,t.jsx)(i.K,{size:"sm",onClick:()=>void E(),disabled:w||!r.trim()||!m.trim(),icon:w?(0,t.jsx)(d.f,{className:"h-3.5 w-3.5 animate-spin"}):void 0,children:w?"Registering…":"Register Node"})]})]})})}],14098)},83902,e=>{"use strict";var a=e.i(56420);let s={name:"shield-exclamation-point",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],aliases:["shield-alert"]};s.node;let r=(0,a.f)(s);e.s(["f",0,r],83902)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,10362,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(71567),r=e.i(41220),n=e.i(82303),i=e.i(82983),l=e.i(93999),o=e.i(46670),c=e.i(63376),d=e.i(96146);function x(e){return"not_installed"!==e.status}e.s(["default",0,function(){let[e,m]=(0,s.useState)([]),[u,h]=(0,s.useState)([]),[f,p]=(0,s.useState)(!0),[g,v]=(0,s.useState)("");(0,s.useEffect)(()=>{let e=!0;return async function(){p(!0),v("");try{let[t,s]=await Promise.all([i.f.hermes.installations(),i.f.hermes.profiles()]);if(!e)return;m((t.data??[]).filter(x)),h(s.data??[])}catch(t){e&&v(t instanceof Error?t.message:"Failed to load Hermes profiles")}finally{e&&p(!1)}}(),()=>{e=!1}},[]);let b=(0,s.useMemo)(()=>{let e=new Map;for(let t of u)e.set(t.installationId,[...e.get(t.installationId)??[],t]);return e},[u]),j=e.reduce((e,t)=>e+(b.get(t.id)?.length??t.profiles?.length??0),0);return(0,t.jsxs)(c.U,{className:"space-y-6",children:[(0,t.jsx)(c.z,{children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-lg font-bold uppercase tracking-wider text-primary",children:"Hermes Profiles"}),(0,t.jsx)("p",{className:"mt-1 text-[11px] uppercase tracking-wider text-text-muted",children:f?"Loading profiles...":`${j} profile${1===j?"":"s"} from ${e.length} detected installation${1===e.length?"":"s"}`})]}),(0,t.jsx)(n.f,{className:"h-6 w-6 text-primary"})]})}),g&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 p-4 text-xs text-danger",children:g}),(0,t.jsx)(c.z,{children:(0,t.jsxs)("div",{className:"grid gap-4 xl:grid-cols-2",children:[e.map(e=>{let s=b.get(e.id)??e.profiles??[];return(0,t.jsx)(l.N,{title:e.displayName??e.hostname,description:`${e.hostname} \xb7 ${e.hermesHome}`,action:(0,t.jsx)(d.F,{installation:e}),children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 text-[11px] text-text-muted",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Status"}),(0,t.jsx)(o.t,{variant:(0,o.k)(e.status),children:e.status})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Version"}),(0,t.jsx)("span",{className:"font-mono text-text",children:e.version??"unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Config"}),(0,t.jsx)("span",{className:"font-mono text-text",children:e.configuration?.configPath??`${e.hermesHome}/config.yaml`})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Model Router"}),(0,t.jsx)(o.t,{variant:e.configuration?.magnusRouterConfigured?"success":"warning",children:e.configuration?.magnusRouterConfigured?"Hive primary":"not configured"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[s.map(e=>(0,t.jsxs)("div",{className:"rounded border border-border/50 bg-bg/50 p-3",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm font-medium text-text",children:[(0,t.jsx)(a.f,{className:"h-3.5 w-3.5 text-primary"}),e.name]}),(0,t.jsx)("p",{className:"mt-1 font-mono text-[10px] text-text-muted",children:e.profileHome||"profile home unknown"})]}),e.isDefault&&(0,t.jsx)(o.t,{variant:"info",children:"default"})]}),(0,t.jsxs)("div",{className:"mt-3 grid grid-cols-2 gap-3 text-[11px] text-text-muted",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Gateway"}),(0,t.jsx)(o.t,{variant:(0,o.k)(e.gatewayStatus),children:e.gatewayStatus})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Provider"}),(0,t.jsx)("span",{className:"text-text",children:e.providerSummary??"unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Model"}),(0,t.jsx)("span",{className:"text-text",children:e.modelSummary??"unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"API Server"}),(0,t.jsx)(o.t,{variant:e.apiServerEnabled?"success":"default",children:e.apiServerEnabled?`enabled:${e.apiServerPort??"?"}`:"disabled"})]})]})]},e.id)),0===s.length&&(0,t.jsx)("div",{className:"rounded border border-border/50 bg-bg/50 p-4 text-xs text-text-muted",children:"No profiles were reported by this running Hermes Agent."})]})]})},e.id)}),!f&&0===e.length&&(0,t.jsxs)("div",{className:"rounded border border-border bg-surface p-8 text-center text-xs text-text-muted xl:col-span-2",children:[(0,t.jsx)(r.f,{className:"mx-auto mb-2 h-5 w-5 text-primary"}),"No detected Hermes Agent installations are available yet."]})]})})]})}])},96146,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(62368),r=e.i(32781),n=e.i(41120),i=e.i(25398),l=e.i(56522),o=e.i(66794),c=e.i(82983),d=e.i(68759),x=e.i(32568);function m(e){return`${e.type} ${e.status}`}function u(e,t){if(!e.data)throw Error(e.error?.message??t);return e.data}function h({label:e,busyLabel:a,icon:n,disabled:i,onRun:l}){let[o,c]=(0,s.useState)(!1),[x,u]=(0,s.useState)(""),[f,p]=(0,s.useState)("");async function g(){c(!0),p(""),u("");try{let e=await l();u(m(e))}catch(t){p(t instanceof Error?t.message:`${e} failed`)}finally{c(!1)}}return(0,t.jsxs)("div",{className:"flex flex-col items-start gap-1",children:[(0,t.jsx)(d.K,{size:"sm",variant:"secondary",disabled:o||i,onClick:()=>void g(),icon:o?(0,t.jsx)(r.f,{className:"h-3.5 w-3.5 animate-spin"}):n,children:o?a:e}),x&&(0,t.jsx)("span",{className:"text-[10px] text-success",children:x}),f&&(0,t.jsx)("span",{className:"max-w-56 text-[10px] leading-4 text-danger",children:f})]})}e.s(["B",0,function({installation:e,profiles:s}){var a;let r=(a=s??e.profiles,a?.length?a.find(e=>e.isDefault)??a[0]??null:null);return(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(h,{label:"Hermes Update",busyLabel:"Updating",icon:(0,t.jsx)(n.f,{className:"h-3.5 w-3.5"}),onRun:()=>c.f.hermes.update(e.id).then(e=>u(e,"Hermes update failed"))}),(0,t.jsx)(h,{label:"Gateway Restart",busyLabel:"Restarting",icon:(0,t.jsx)(i.f,{className:"h-3.5 w-3.5"}),disabled:!r,onRun:()=>r?c.f.hermes.gatewayAction(r.id,"restart").then(e=>u(e,"Gateway restart failed")):Promise.reject(Error("No Hermes profile is available for gateway restart"))})]})},"F",0,function({installation:e}){let[a,n]=(0,s.useState)(!1),[i,h]=(0,s.useState)(!1),[f,p]=(0,s.useState)(!1),[g,v]=(0,s.useState)(null),[b,j]=(0,s.useState)(""),[w,N]=(0,s.useState)(""),[y,k]=(0,s.useState)(""),[_,S]=(0,s.useState)(""),E=(0,s.useMemo)(()=>b!==w,[b,w]);async function $(){p(!0),k(""),S("");try{let t=await c.f.hermes.updateConfig(e.id,{configYaml:b});N(b),S(m(u(t,"Failed to save Hermes config")))}catch(e){k(e instanceof Error?e.message:"Failed to save Hermes config")}finally{p(!1)}}return(0,s.useEffect)(()=>{if(!a)return;let t=!0;return async function(){h(!0),k(""),S("");try{let s=await c.f.hermes.config(e.id);if(!t)return;let a=u(s,"Failed to load Hermes config");v(a),j(a.configYaml),N(a.configYaml)}catch(e){t&&k(e instanceof Error?e.message:"Failed to load Hermes config")}finally{t&&h(!1)}}(),()=>{t=!1}},[e.id,a]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.K,{size:"sm",variant:"secondary",onClick:()=>n(!0),icon:(0,t.jsx)(o.f,{className:"h-3.5 w-3.5"}),children:"Config"}),(0,t.jsx)(x.n,{open:a,onClose:()=>n(!1),title:`${e.displayName??e.hostname} Config`,description:"Running Hermes Agent config.yaml from the remote installation.",icon:(0,t.jsx)(o.f,{className:"h-5 w-5 text-primary"}),className:"max-h-[92vh] max-w-[calc(100vw-1.5rem)] overflow-hidden bg-[#06060d] p-4 sm:max-w-5xl sm:p-6",children:(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 text-[11px] text-text-muted",children:[(0,t.jsx)("span",{className:"font-mono",children:g?.path??e.configuration?.configPath??`${e.hermesHome}/config.yaml`}),(0,t.jsx)("span",{children:g?.exists===!1?"new config file":`last synced ${g?.lastSyncedAt?new Date(g.lastSyncedAt).toLocaleString():"unknown"}`})]}),y&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 p-3 text-xs text-danger",children:y}),_&&(0,t.jsx)("div",{className:"rounded border border-success/30 bg-success/10 p-3 text-xs text-success",children:_}),i?(0,t.jsxs)("div",{className:"flex h-72 items-center justify-center rounded border border-border bg-bg text-xs text-text-muted",children:[(0,t.jsx)(r.f,{className:"mr-2 h-4 w-4 animate-spin"})," Loading config..."]}):(0,t.jsx)("textarea",{value:b,onChange:e=>j(e.target.value),spellCheck:!1,placeholder:"# config.yaml is empty on this Hermes Agent",className:"h-[54vh] min-h-72 w-full resize-none rounded border border-border bg-bg p-3 font-mono text-[11px] leading-5 text-text outline-none placeholder:text-text-muted/60 focus:border-primary sm:h-[58vh]","aria-label":"Hermes config YAML"}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(d.K,{size:"sm",variant:"primary",disabled:i||f||!E,onClick:()=>void $(),icon:f?(0,t.jsx)(r.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(l.f,{className:"h-3.5 w-3.5"}),children:f?"Saving":"Save Config"})})]})})]})},"C",0,function({installation:e}){return(0,t.jsx)(h,{label:"Install",busyLabel:"Installing",icon:(0,t.jsx)(a.f,{className:"h-3.5 w-3.5"}),onRun:()=>c.f.hermes.configure(e.id).then(e=>u(e,"Router install failed"))})}])},46670,e=>{"use strict";var t=e.i(43476),s=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:o=!1}){return(0,t.jsxs)("span",{className:(0,s.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,t.jsxs)("span",{"aria-hidden":"true",className:"relative inline-flex h-1.5 w-1.5",children:[o&&(0,t.jsx)("span",{className:(0,s.f)("absolute inset-0 rounded-full animate-halo",r[n])}),(0,t.jsx)("span",{className:(0,s.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=>{"use strict";var t=e.i(43476),s=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,s.f)(a);var n=e.i(75775),i=e.i(78571),l=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:s=100,tone:a,thresholds:r=o.q,label:n,size:l="xs",showValue:m=!1,valueLabel:u,glow:h,className:f,testId:p}){let g="number"==typeof e&&Number.isFinite(e),v=g?Math.max(0,Math.min(100,e/(s||1)*100)):0,b=a??(g?(0,o.Z)(v,r):"muted"),j=h||!a&&g&&v>=r.warn,w=u??(g?`${v.toFixed(+(v<10&&v>0))}%`:"—");return(0,t.jsxs)("div",{className:(0,i.f)("flex min-w-0 items-center gap-2",f),"data-testid":p,children:[(0,t.jsx)("div",{role:"meter","aria-label":n,"aria-valuemin":0,"aria-valuemax":s,"aria-valuenow":g?e:void 0,"aria-valuetext":w,className:(0,i.f)("relative flex-1 overflow-hidden rounded-full bg-border/70",d[l]),children:(0,t.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",o.H[b],j&&c[b])})}),m&&(0,t.jsx)("span",{className:(0,i.f)("num w-11 shrink-0 text-right text-[11px]",g?o.T[b]:"text-text-muted"),children:w})]})}e.s(["f",0,x],51196);var m=e.i(71645);function u({values:e,tone:s="primary",width:a=160,height:r=32,area:n=!0,max:l,percent:c=!1,threshold:d,live:x=!0,emptyLabel:h="not enough data",className:f,testId:p,label:g,stretch:v=!1}){let b=`spark${(0,m.useId)().replace(/:/g,"")}`;if(e.length<2)return(0,t.jsx)("div",{className:(0,i.f)("flex h-8 items-center text-xs italic text-text-muted",f),"data-testid":p,children:h});let j=o.v[s],w=l??(c?Math.max(100,...e):Math.max(...e,d??0)||1),N=r-4,y=a/(e.length-1),k=e=>2+N-Math.max(0,e)/w*N,_=e.map((e,t)=>[t*y,k(e)]),S=_.map(([e,t])=>`${e.toFixed(1)},${t.toFixed(1)}`).join(" "),E=_[_.length-1];return(0,t.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",f),"data-testid":p,role:g?"img":void 0,"aria-label":g,"aria-hidden":!g||void 0,children:[n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:b,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} ${a},${r}`,fill:`url(#${b})`})]}),void 0!==d&&(0,t.jsx)("line",{x1:0,x2:a,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&&!v&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("circle",{cx:E[0],cy:E[1],r:2.5,fill:j,className:"origin-center animate-halo [transform-box:fill-box]"}),(0,t.jsx)("circle",{cx:E[0],cy:E[1],r:2,fill:j})]})]})}e.s(["f",0,u],55427),e.s(["N",0,function({title:e,description:s,children:a,className:r,action:n,tone:i,corners:o=!1,...c}){return(0,t.jsx)(l.f,{...c,tone:i,corners:o,title:e,description:s,action:n,className:r,children:a})},"n",0,function({label:e,value:s,icon:a,trend:c,spark:d,meter:m,delta:h,tone:f="primary",className:p,testId:g}){let v=!h||h.value>=0===(h.positiveIsGood??!0);return(0,t.jsxs)(l.f,{tone:f,className:(0,i.f)("overflow-hidden",p),testId:g,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:e}),a&&(0,t.jsx)("span",{className:"text-primary/60",children:a})]}),(0,t.jsxs)("div",{className:"mt-2 flex items-end justify-between gap-2",children:[(0,t.jsx)("div",{className:(0,i.f)("num text-2xl font-bold","primary"===f?"text-primary neon-text":o.T[f]),children:s}),h&&0!==h.value&&(0,t.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,t.jsx)(n.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,i.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)(u,{values:d,tone:f,width:240,height:28,stretch:!0,live:!1})})]})}],93999)},3062,e=>{"use strict";var t=e.i(43476),s=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:o=!0,interactive:c=!0,hero:d=!1,title:x,description:m,icon:u,action:h,as:f="div",padding:p="md",testId:g,className:v,children:b,...j}){return(0,t.jsxs)(f,{...j,"data-testid":g??j["data-testid"],className:(0,s.f)("relative rounded-panel border border-border bg-surface transition-colors duration-300",l[p],o&&"panel-corners",o&&r[e],c&&"glow-hover",c&&n[e],c&&i[e],d&&"grid-bg overflow-hidden bg-surface/80",v),children:[(x||h||u)&&(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:[u&&(0,t.jsx)("span",{className:(0,s.f)("mt-0.5 shrink-0",a.T[e]),children:u}),(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]}),b]})}])},63376,e=>{"use strict";var t=e.i(43476);e.s(["z",0,function({children:e,className:s}){return(0,t.jsx)("div",{className:`animate-page-in${s?` ${s}`:""}`,children:e})},"U",0,function({children:e,className:s}){return(0,t.jsx)("div",{className:s,children:e})}])},75775,e=>{"use strict";var t=e.i(56420);let s={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],75775)},25398,e=>{"use strict";var t=e.i(56420);let s={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],25398)},56522,e=>{"use strict";var t=e.i(56420);let s={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],56522)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,10362,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(71567),r=e.i(41220),n=e.i(82303),i=e.i(82983),l=e.i(93999),o=e.i(46670),c=e.i(63376),d=e.i(96146);function x(e){return"not_installed"!==e.status}e.s(["default",0,function(){let[e,m]=(0,s.useState)([]),[u,h]=(0,s.useState)([]),[f,p]=(0,s.useState)(!0),[g,v]=(0,s.useState)("");(0,s.useEffect)(()=>{let e=!0;return async function(){p(!0),v("");try{let[t,s]=await Promise.all([i.f.hermes.installations(),i.f.hermes.profiles()]);if(!e)return;m((t.data??[]).filter(x)),h(s.data??[])}catch(t){e&&v(t instanceof Error?t.message:"Failed to load Hermes profiles")}finally{e&&p(!1)}}(),()=>{e=!1}},[]);let b=(0,s.useMemo)(()=>{let e=new Map;for(let t of u)e.set(t.installationId,[...e.get(t.installationId)??[],t]);return e},[u]),j=e.reduce((e,t)=>e+(b.get(t.id)?.length??t.profiles?.length??0),0);return(0,t.jsxs)(c.U,{className:"space-y-6",children:[(0,t.jsx)(c.z,{children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-lg font-bold uppercase tracking-wider text-primary",children:"Hermes Profiles"}),(0,t.jsx)("p",{className:"mt-1 text-[11px] uppercase tracking-wider text-text-muted",children:f?"Loading profiles...":`${j} profile${1===j?"":"s"} from ${e.length} detected installation${1===e.length?"":"s"}`})]}),(0,t.jsx)(n.f,{className:"h-6 w-6 text-primary"})]})}),g&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 p-4 text-xs text-danger",children:g}),(0,t.jsx)(c.z,{children:(0,t.jsxs)("div",{className:"grid gap-4 xl:grid-cols-2",children:[e.map(e=>{let s=b.get(e.id)??e.profiles??[];return(0,t.jsx)(l.N,{title:e.displayName??e.hostname,description:`${e.hostname} \xb7 ${e.hermesHome}`,action:(0,t.jsx)(d.F,{installation:e}),children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 text-[11px] text-text-muted",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Status"}),(0,t.jsx)(o.t,{variant:(0,o.k)(e.status),children:e.status})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Version"}),(0,t.jsx)("span",{className:"font-mono text-text",children:e.version??"unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Config"}),(0,t.jsx)("span",{className:"font-mono text-text",children:e.configuration?.configPath??`${e.hermesHome}/config.yaml`})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Model Router"}),(0,t.jsx)(o.t,{variant:e.configuration?.magnusRouterConfigured?"success":"warning",children:e.configuration?.magnusRouterConfigured?"Hive primary":"not configured"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[s.map(e=>(0,t.jsxs)("div",{className:"rounded border border-border/50 bg-bg/50 p-3",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm font-medium text-text",children:[(0,t.jsx)(a.f,{className:"h-3.5 w-3.5 text-primary"}),e.name]}),(0,t.jsx)("p",{className:"mt-1 font-mono text-[10px] text-text-muted",children:e.profileHome||"profile home unknown"})]}),e.isDefault&&(0,t.jsx)(o.t,{variant:"info",children:"default"})]}),(0,t.jsxs)("div",{className:"mt-3 grid grid-cols-2 gap-3 text-[11px] text-text-muted",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Gateway"}),(0,t.jsx)(o.t,{variant:(0,o.k)(e.gatewayStatus),children:e.gatewayStatus})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Provider"}),(0,t.jsx)("span",{className:"text-text",children:e.providerSummary??"unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"Model"}),(0,t.jsx)("span",{className:"text-text",children:e.modelSummary??"unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"block uppercase tracking-wider text-text-muted/70",children:"API Server"}),(0,t.jsx)(o.t,{variant:e.apiServerEnabled?"success":"default",children:e.apiServerEnabled?`enabled:${e.apiServerPort??"?"}`:"disabled"})]})]})]},e.id)),0===s.length&&(0,t.jsx)("div",{className:"rounded border border-border/50 bg-bg/50 p-4 text-xs text-text-muted",children:"No profiles were reported by this running Hermes Agent."})]})]})},e.id)}),!f&&0===e.length&&(0,t.jsxs)("div",{className:"rounded border border-border bg-surface p-8 text-center text-xs text-text-muted xl:col-span-2",children:[(0,t.jsx)(r.f,{className:"mx-auto mb-2 h-5 w-5 text-primary"}),"No detected Hermes Agent installations are available yet."]})]})})]})}])},96146,e=>{"use strict";var t=e.i(43476),s=e.i(71645),a=e.i(62368),r=e.i(32781),n=e.i(41120),i=e.i(25398),l=e.i(56522),o=e.i(66794),c=e.i(82983),d=e.i(68759),x=e.i(32568);function m(e){return`${e.type} ${e.status}`}function u(e,t){if(!e.data)throw Error(e.error?.message??t);return e.data}function h({label:e,busyLabel:a,icon:n,disabled:i,onRun:l}){let[o,c]=(0,s.useState)(!1),[x,u]=(0,s.useState)(""),[f,p]=(0,s.useState)("");async function g(){c(!0),p(""),u("");try{let e=await l();u(m(e))}catch(t){p(t instanceof Error?t.message:`${e} failed`)}finally{c(!1)}}return(0,t.jsxs)("div",{className:"flex flex-col items-start gap-1",children:[(0,t.jsx)(d.K,{size:"sm",variant:"secondary",disabled:o||i,onClick:()=>void g(),icon:o?(0,t.jsx)(r.f,{className:"h-3.5 w-3.5 animate-spin"}):n,children:o?a:e}),x&&(0,t.jsx)("span",{className:"text-[10px] text-success",children:x}),f&&(0,t.jsx)("span",{className:"max-w-56 text-[10px] leading-4 text-danger",children:f})]})}e.s(["B",0,function({installation:e,profiles:s}){var a;let r=(a=s??e.profiles,a?.length?a.find(e=>e.isDefault)??a[0]??null:null);return(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(h,{label:"Hermes Update",busyLabel:"Updating",icon:(0,t.jsx)(n.f,{className:"h-3.5 w-3.5"}),onRun:()=>c.f.hermes.update(e.id).then(e=>u(e,"Hermes update failed"))}),(0,t.jsx)(h,{label:"Gateway Restart",busyLabel:"Restarting",icon:(0,t.jsx)(i.f,{className:"h-3.5 w-3.5"}),disabled:!r,onRun:()=>r?c.f.hermes.gatewayAction(r.id,"restart").then(e=>u(e,"Gateway restart failed")):Promise.reject(Error("No Hermes profile is available for gateway restart"))})]})},"F",0,function({installation:e}){let[a,n]=(0,s.useState)(!1),[i,h]=(0,s.useState)(!1),[f,p]=(0,s.useState)(!1),[g,v]=(0,s.useState)(null),[b,j]=(0,s.useState)(""),[w,N]=(0,s.useState)(""),[y,k]=(0,s.useState)(""),[_,S]=(0,s.useState)(""),E=(0,s.useMemo)(()=>b!==w,[b,w]);async function $(){p(!0),k(""),S("");try{let t=await c.f.hermes.updateConfig(e.id,{configYaml:b});N(b),S(m(u(t,"Failed to save Hermes config")))}catch(e){k(e instanceof Error?e.message:"Failed to save Hermes config")}finally{p(!1)}}return(0,s.useEffect)(()=>{if(!a)return;let t=!0;return async function(){h(!0),k(""),S("");try{let s=await c.f.hermes.config(e.id);if(!t)return;let a=u(s,"Failed to load Hermes config");v(a),j(a.configYaml),N(a.configYaml)}catch(e){t&&k(e instanceof Error?e.message:"Failed to load Hermes config")}finally{t&&h(!1)}}(),()=>{t=!1}},[e.id,a]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.K,{size:"sm",variant:"secondary",onClick:()=>n(!0),icon:(0,t.jsx)(o.f,{className:"h-3.5 w-3.5"}),children:"Config"}),(0,t.jsx)(x.n,{open:a,onClose:()=>n(!1),title:`${e.displayName??e.hostname} Config`,description:"Running Hermes Agent config.yaml from the remote installation.",icon:(0,t.jsx)(o.f,{className:"h-5 w-5 text-primary"}),className:"max-h-[92vh] max-w-[calc(100vw-1.5rem)] overflow-hidden bg-[#06060d] p-4 sm:max-w-5xl sm:p-6",children:(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 text-[11px] text-text-muted",children:[(0,t.jsx)("span",{className:"font-mono",children:g?.path??e.configuration?.configPath??`${e.hermesHome}/config.yaml`}),(0,t.jsx)("span",{children:g?.exists===!1?"new config file":`last synced ${g?.lastSyncedAt?new Date(g.lastSyncedAt).toLocaleString():"unknown"}`})]}),y&&(0,t.jsx)("div",{className:"rounded border border-danger/30 bg-danger/10 p-3 text-xs text-danger",children:y}),_&&(0,t.jsx)("div",{className:"rounded border border-success/30 bg-success/10 p-3 text-xs text-success",children:_}),i?(0,t.jsxs)("div",{className:"flex h-72 items-center justify-center rounded border border-border bg-bg text-xs text-text-muted",children:[(0,t.jsx)(r.f,{className:"mr-2 h-4 w-4 animate-spin"})," Loading config..."]}):(0,t.jsx)("textarea",{value:b,onChange:e=>j(e.target.value),spellCheck:!1,placeholder:"# config.yaml is empty on this Hermes Agent",className:"h-[54vh] min-h-72 w-full resize-none rounded border border-border bg-bg p-3 font-mono text-[11px] leading-5 text-text outline-none placeholder:text-text-muted/60 focus:border-primary sm:h-[58vh]","aria-label":"Hermes config YAML"}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(d.K,{size:"sm",variant:"primary",disabled:i||f||!E,onClick:()=>void $(),icon:f?(0,t.jsx)(r.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(l.f,{className:"h-3.5 w-3.5"}),children:f?"Saving":"Save Config"})})]})})]})},"C",0,function({installation:e}){return(0,t.jsx)(h,{label:"Install",busyLabel:"Installing",icon:(0,t.jsx)(a.f,{className:"h-3.5 w-3.5"}),onRun:()=>c.f.hermes.configure(e.id).then(e=>u(e,"Router install failed"))})}])},46670,e=>{"use strict";var t=e.i(43476),s=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:o=!1}){return(0,t.jsxs)("span",{className:(0,s.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,t.jsxs)("span",{"aria-hidden":"true",className:"relative inline-flex h-1.5 w-1.5",children:[o&&(0,t.jsx)("span",{className:(0,s.f)("absolute inset-0 rounded-full animate-halo",r[n])}),(0,t.jsx)("span",{className:(0,s.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=>{"use strict";var t=e.i(43476),s=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,s.f)(a);var n=e.i(75775),i=e.i(78571),l=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:s=100,tone:a,thresholds:r=o.q,label:n,size:l="xs",showValue:m=!1,valueLabel:u,glow:h,className:f,testId:p}){let g="number"==typeof e&&Number.isFinite(e),v=g?Math.max(0,Math.min(100,e/(s||1)*100)):0,b=a??(g?(0,o.Z)(v,r):"muted"),j=h||!a&&g&&v>=r.warn,w=u??(g?`${v.toFixed(+(v<10&&v>0))}%`:"—");return(0,t.jsxs)("div",{className:(0,i.f)("flex min-w-0 items-center gap-2",f),"data-testid":p,children:[(0,t.jsx)("div",{...g?{role:"meter","aria-label":n,"aria-valuemin":0,"aria-valuemax":s,"aria-valuenow":e,"aria-valuetext":w}:{role:"img","aria-label":n?`${n}: no data`:"No data"},className:(0,i.f)("relative flex-1 overflow-hidden rounded-full bg-border/70",d[l]),children:(0,t.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",o.H[b],j&&c[b])})}),m&&(0,t.jsx)("span",{className:(0,i.f)("num w-11 shrink-0 text-right text-[11px]",g?o.T[b]:"text-text-muted"),children:w})]})}e.s(["f",0,x],51196);var m=e.i(71645);function u({values:e,tone:s="primary",width:a=160,height:r=32,area:n=!0,max:l,percent:c=!1,threshold:d,live:x=!0,emptyLabel:h="not enough data",className:f,testId:p,label:g,stretch:v=!1}){let b=`spark${(0,m.useId)().replace(/:/g,"")}`;if(e.length<2)return(0,t.jsx)("div",{className:(0,i.f)("flex h-8 items-center text-xs italic text-text-muted",f),"data-testid":p,children:h});let j=o.v[s],w=l??(c?Math.max(100,...e):Math.max(...e,d??0)||1),N=r-4,y=a/(e.length-1),k=e=>2+N-Math.max(0,e)/w*N,_=e.map((e,t)=>[t*y,k(e)]),S=_.map(([e,t])=>`${e.toFixed(1)},${t.toFixed(1)}`).join(" "),E=_[_.length-1];return(0,t.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",f),"data-testid":p,role:g?"img":void 0,"aria-label":g,"aria-hidden":!g||void 0,children:[n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("linearGradient",{id:b,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} ${a},${r}`,fill:`url(#${b})`})]}),void 0!==d&&(0,t.jsx)("line",{x1:0,x2:a,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&&!v&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("circle",{cx:E[0],cy:E[1],r:2.5,fill:j,className:"origin-center animate-halo [transform-box:fill-box]"}),(0,t.jsx)("circle",{cx:E[0],cy:E[1],r:2,fill:j})]})]})}e.s(["f",0,u],55427),e.s(["N",0,function({title:e,description:s,children:a,className:r,action:n,tone:i,corners:o=!1,...c}){return(0,t.jsx)(l.f,{...c,tone:i,corners:o,title:e,description:s,action:n,className:r,children:a})},"n",0,function({label:e,value:s,icon:a,trend:c,spark:d,meter:m,delta:h,tone:f="primary",className:p,testId:g}){let v=!h||h.value>=0===(h.positiveIsGood??!0);return(0,t.jsxs)(l.f,{tone:f,className:(0,i.f)("overflow-hidden",p),testId:g,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-[0.15em] text-text-muted",children:e}),a&&(0,t.jsx)("span",{className:"text-primary/60",children:a})]}),(0,t.jsxs)("div",{className:"mt-2 flex items-end justify-between gap-2",children:[(0,t.jsx)("div",{className:(0,i.f)("num text-2xl font-bold","primary"===f?"text-primary neon-text":o.T[f]),children:s}),h&&0!==h.value&&(0,t.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,t.jsx)(n.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,i.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)(u,{values:d,tone:f,width:240,height:28,stretch:!0,live:!1})})]})}],93999)},3062,e=>{"use strict";var t=e.i(43476),s=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:o=!0,interactive:c=!0,hero:d=!1,title:x,description:m,icon:u,action:h,as:f="div",padding:p="md",testId:g,className:v,children:b,...j}){return(0,t.jsxs)(f,{...j,"data-testid":g??j["data-testid"],className:(0,s.f)("relative rounded-panel border border-border bg-surface transition-colors duration-300",l[p],o&&"panel-corners",o&&r[e],c&&"glow-hover",c&&n[e],c&&i[e],d&&"grid-bg overflow-hidden bg-surface/80",v),children:[(x||h||u)&&(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:[u&&(0,t.jsx)("span",{className:(0,s.f)("mt-0.5 shrink-0",a.T[e]),children:u}),(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]}),b]})}])},63376,e=>{"use strict";var t=e.i(43476);e.s(["z",0,function({children:e,className:s}){return(0,t.jsx)("div",{className:`animate-page-in${s?` ${s}`:""}`,children:e})},"U",0,function({children:e,className:s}){return(0,t.jsx)("div",{className:s,children:e})}])},75775,e=>{"use strict";var t=e.i(56420);let s={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],75775)},25398,e=>{"use strict";var t=e.i(56420);let s={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],25398)},56522,e=>{"use strict";var t=e.i(56420);let s={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};s.node;let a=(0,t.f)(s);e.s(["f",0,a],56522)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,7809,e=>{"use strict";var s=e.i(43476),t=e.i(71645),a=e.i(82983),r=e.i(93999),l=e.i(46670),i=e.i(68759),n=e.i(32568),c=e.i(63376),o=e.i(78571),d=e.i(12092),x=e.i(41120),m=e.i(77071),u=e.i(59659),h=e.i(28523),p=e.i(21357),f=e.i(74544),v=e.i(41220),g=e.i(32781),j=e.i(4139),b=e.i(64155);let N="[AI]",w=[{label:"Every 15 minutes",value:"*/15 * * * *"},{label:"Every 30 minutes",value:"*/30 * * * *"},{label:"Every hour",value:"0 * * * *"},{label:"Every 6 hours",value:"0 */6 * * *"},{label:"Daily at midnight",value:"0 0 * * *"},{label:"Custom…",value:"__custom__"}];function y({open:e,onClose:r,onCreated:l,nodes:c,skills:d}){let[x,u]=(0,t.useState)(""),[h,p]=(0,t.useState)(""),[f,v]=(0,t.useState)(""),[j,k]=(0,t.useState)(w[2].value),[_,C]=(0,t.useState)(""),[S,E]=(0,t.useState)(!1),[I,A]=(0,t.useState)(null),$="__custom__"===j?_:j;async function D(e){if(e.preventDefault(),A(null),!x.trim()||!h||!f||!$.trim())return void A("All fields are required.");let s=d.find(e=>e.name===f),t=s?.entryPoint??"run.sh",i=`~/.magnus/skills/${f}/${t}`;E(!0);try{await a.f.cron.create({name:`${N} ${x.trim()}`,description:`Scheduled analysis job: run ${f} skill`,nodeId:h,schedule:$.trim(),command:i,args:[],timeoutSeconds:300}),l(),r(),L()}catch(e){A(e instanceof Error?e.message:"Failed to create cron job.")}finally{E(!1)}}function L(){u(""),p(""),v(""),k(w[2].value),C(""),A(null)}return(0,s.jsx)(n.n,{open:e,title:"New Scheduled Skill Job",onClose:()=>{r(),L()},children:(0,s.jsxs)("form",{onSubmit:D,className:"space-y-4",children:[I&&(0,s.jsxs)("div",{className:"flex items-center gap-2 rounded border border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:[(0,s.jsx)(b.f,{className:"h-3.5 w-3.5 shrink-0"}),I]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"mb-1.5 block text-xs font-medium text-text-muted",children:"Job Name"}),(0,s.jsx)("input",{className:n.W,type:"text",placeholder:"e.g. Log Analyzer — Prod",value:x,onChange:e=>u(e.target.value),required:!0}),(0,s.jsxs)("p",{className:"mt-1 text-[10px] text-text-muted",children:["Will be prefixed with ",(0,s.jsx)("code",{className:"text-primary/80",children:N})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"mb-1.5 block text-xs font-medium text-text-muted",children:"Target Node"}),(0,s.jsxs)("select",{className:n.W,value:h,onChange:e=>p(e.target.value),required:!0,children:[(0,s.jsx)("option",{value:"",children:"Select a node…"}),c.map(e=>(0,s.jsxs)("option",{value:e.id,children:[e.name," (",e.hostname,") — ",e.status]},e.id))]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"mb-1.5 block text-xs font-medium text-text-muted",children:"Skill"}),(0,s.jsxs)("select",{className:n.W,value:f,onChange:e=>v(e.target.value),required:!0,children:[(0,s.jsx)("option",{value:"",children:"Select a skill…"}),d.map(e=>(0,s.jsxs)("option",{value:e.name,children:[e.name," — ",e.description]},e.name))]}),f&&(0,s.jsxs)("p",{className:"mt-1 text-[10px] font-mono text-text-muted",children:["Command: ",(0,s.jsxs)("span",{className:"text-primary/80",children:["~/.magnus/skills/",f,"/",d.find(e=>e.name===f)?.entryPoint??"run.sh"]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"mb-1.5 block text-xs font-medium text-text-muted",children:"Schedule"}),(0,s.jsx)("select",{className:n.W,value:j,onChange:e=>k(e.target.value),children:w.map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))}),"__custom__"===j&&(0,s.jsx)("input",{className:(0,o.f)(n.W,"mt-2 font-mono"),type:"text",placeholder:"Cron expression, e.g. 0 */4 * * *",value:_,onChange:e=>C(e.target.value),required:!0})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[(0,s.jsx)(i.K,{type:"button",variant:"ghost",size:"sm",onClick:()=>{r(),L()},children:"Cancel"}),(0,s.jsxs)(i.K,{type:"submit",variant:"primary",size:"sm",disabled:S,children:[S?(0,s.jsx)(g.f,{className:"h-4 w-4 mr-2 animate-spin"}):(0,s.jsx)(m.f,{className:"h-4 w-4 mr-2"}),"Create Job"]})]})]})})}function k(){let[e,n]=(0,t.useState)([]),[c,d]=(0,t.useState)([]),[b,k]=(0,t.useState)([]),[_,C]=(0,t.useState)(!0),[S,E]=(0,t.useState)(!1),[I,A]=(0,t.useState)(null),[$,D]=(0,t.useState)(null),L=(0,t.useCallback)(async()=>{C(!0);try{let[e,s,t]=await Promise.allSettled([a.f.cron.list(),a.f.nodes.list(),a.f.skills.list()]);if("fulfilled"===e.status){let s=e.value.data??[];n(s.filter(e=>e.name.startsWith(N)))}"fulfilled"===s.status&&d(s.value.data??[]),"fulfilled"===t.status&&k(t.value.data??[])}finally{C(!1)}},[]);async function T(e){A(e);try{await a.f.cron.delete(e),n(s=>s.filter(s=>s.id!==e))}finally{A(null)}}async function z(e){let s="active"===e.status?"paused":"active";D(e.id);try{await a.f.cron.update(e.id,{status:s}),n(t=>t.map(t=>t.id===e.id?{...t,status:s}:t))}finally{D(null)}}return(0,t.useEffect)(()=>{L()},[L]),(0,s.jsxs)(r.N,{className:"p-5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-sm font-semibold uppercase tracking-wider text-text",children:"Skill Cron Jobs"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-0.5",children:"Deterministic cron jobs that run node skills and record results in Magnus command history."})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(i.K,{variant:"ghost",size:"sm",onClick:L,disabled:_,"aria-label":"Refresh operations",title:"Refresh",children:(0,s.jsx)(x.f,{className:(0,o.f)("h-4 w-4",_&&"animate-spin")})}),(0,s.jsxs)(i.K,{variant:"primary",size:"sm",onClick:()=>E(!0),children:[(0,s.jsx)(m.f,{className:"h-4 w-4 mr-2"}),"Add Job"]})]})]}),_?(0,s.jsxs)("div",{className:"flex items-center gap-2 text-text-muted py-6",children:[(0,s.jsx)(g.f,{className:"h-4 w-4 animate-spin"}),(0,s.jsx)("span",{className:"text-sm",children:"Loading…"})]}):0===e.length?(0,s.jsxs)("div",{className:"rounded border border-dashed border-border py-8 text-center",children:[(0,s.jsx)(j.f,{className:"h-8 w-8 mx-auto mb-3 text-text-muted/40"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No scheduled skill jobs yet."}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Click “Add Job” to create a skill-based analysis cron job."})]}):(0,s.jsx)("div",{className:"space-y-2 mt-3",children:e.map(e=>{var t,a;let r;return(0,s.jsxs)("div",{className:(0,o.f)("flex items-start gap-3 rounded border border-border px-3 py-2.5 transition-colors","paused"===e.status&&"opacity-60"),children:[(0,s.jsx)("div",{className:"mt-1 shrink-0",children:"active"===e.status?(0,s.jsx)("span",{className:"block h-2 w-2 rounded-full bg-success"}):"error"===e.status?(0,s.jsx)("span",{className:"block h-2 w-2 rounded-full bg-danger"}):(0,s.jsx)("span",{className:"block h-2 w-2 rounded-full bg-text-muted/40"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text",children:e.name.replace(/^\[AI\]\s*/,"")}),(0,s.jsx)(l.t,{variant:"default",className:"text-[10px]",children:e.status})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 mt-1 flex-wrap",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-text-muted",children:[(0,s.jsx)(f.f,{className:"h-3 w-3"}),(t=e.schedule,(r=w.find(e=>e.value===t))&&"__custom__"!==r.value?r.label:t)]}),(0,s.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-text-muted",children:[(0,s.jsx)(v.f,{className:"h-3 w-3"}),(a=e.nodeId,c.find(e=>e.id===a)?.name??a)]}),e.lastRunAt&&(0,s.jsxs)("span",{className:"text-[11px] text-text-muted/70",children:["Last run: ",new Date(e.lastRunAt).toLocaleString()]})]}),(0,s.jsx)("p",{className:"mt-0.5 text-[10px] font-mono text-text-muted truncate",children:e.command})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,s.jsx)(i.K,{variant:"ghost",size:"sm",onClick:()=>z(e),disabled:$===e.id||"error"===e.status,title:"active"===e.status?"Pause":"Resume",className:"h-7 w-7 p-0",children:$===e.id?(0,s.jsx)(g.f,{className:"h-3.5 w-3.5 animate-spin"}):"active"===e.status?(0,s.jsx)(h.f,{className:"h-3.5 w-3.5"}):(0,s.jsx)(p.f,{className:"h-3.5 w-3.5"})}),(0,s.jsx)(i.K,{variant:"ghost",size:"sm",onClick:()=>T(e.id),disabled:I===e.id,title:"Delete",className:"h-7 w-7 p-0 text-danger/70 hover:text-danger",children:I===e.id?(0,s.jsx)(g.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,s.jsx)(u.f,{className:"h-3.5 w-3.5"})})]})]},e.id)})}),(0,s.jsx)(y,{open:S,onClose:()=>E(!1),onCreated:L,nodes:c,skills:b})]})}e.s(["default",0,function(){return(0,s.jsxs)(c.U,{children:[(0,s.jsx)(c.z,{children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded border border-primary/30 bg-primary/10",children:(0,s.jsx)(d.f,{className:"h-5 w-5 text-primary"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-lg font-bold uppercase tracking-widest text-text",children:"Operations"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Configure scheduled skill analysis jobs"})]})]})}),(0,s.jsx)(c.z,{children:(0,s.jsx)(k,{})})]})}])},46670,e=>{"use strict";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:l="default",className:i,dot:n=!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[l],i),children:[n&&(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[l])}),(0,s.jsx)("span",{className:(0,t.f)("relative inline-flex h-1.5 w-1.5 rounded-full",r[l])})]}),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=>{"use strict";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 l=e.i(75775),i=e.i(78571),n=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:l,size:n="xs",showValue:m=!1,valueLabel:u,glow:h,className:p,testId:f}){let v="number"==typeof e&&Number.isFinite(e),g=v?Math.max(0,Math.min(100,e/(t||1)*100)):0,j=a??(v?(0,c.Z)(g,r):"muted"),b=h||!a&&v&&g>=r.warn,N=u??(v?`${g.toFixed(+(g<10&&g>0))}%`:"—");return(0,s.jsxs)("div",{className:(0,i.f)("flex min-w-0 items-center gap-2",p),"data-testid":f,children:[(0,s.jsx)("div",{...v?{role:"meter","aria-label":l,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":e,"aria-valuetext":N}:{role:"img","aria-label":l?`${l}: no data`:"No data"},className:(0,i.f)("relative flex-1 overflow-hidden rounded-full bg-border/70",d[n]),children:(0,s.jsx)("div",{style:{"--meter":`${g}%`},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]",v?c.T[j]:"text-text-muted"),children:N})]})}e.s(["f",0,x],51196);var m=e.i(71645);function u({values:e,tone:t="primary",width:a=160,height:r=32,area:l=!0,max:n,percent:o=!1,threshold:d,live:x=!0,emptyLabel:h="not enough data",className:p,testId:f,label:v,stretch:g=!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",p),"data-testid":f,children:h});let b=c.v[t],N=n??(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,_=e.map((e,s)=>[s*y,k(e)]),C=_.map(([e,s])=>`${e.toFixed(1)},${s.toFixed(1)}`).join(" "),S=_[_.length-1];return(0,s.jsxs)("svg",{width:g?"100%":a,height:r,viewBox:`0 0 ${a} ${r}`,preserveAspectRatio:g?"none":void 0,className:(0,i.f)("block overflow-visible",p),"data-testid":f,role:v?"img":void 0,"aria-label":v,"aria-hidden":!v||void 0,children:[l&&(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} ${C} ${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:C}),x&&!g&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("circle",{cx:S[0],cy:S[1],r:2.5,fill:b,className:"origin-center animate-halo [transform-box:fill-box]"}),(0,s.jsx)("circle",{cx:S[0],cy:S[1],r:2,fill:b})]})]})}e.s(["f",0,u],55427),e.s(["N",0,function({title:e,description:t,children:a,className:r,action:l,tone:i,corners:c=!1,...o}){return(0,s.jsx)(n.f,{...o,tone:i,corners:c,title:e,description:t,action:l,className:r,children:a})},"n",0,function({label:e,value:t,icon:a,trend:o,spark:d,meter:m,delta:h,tone:p="primary",className:f,testId:v}){let g=!h||h.value>=0===(h.positiveIsGood??!0);return(0,s.jsxs)(n.f,{tone:p,className:(0,i.f)("overflow-hidden",f),testId:v,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"===p?"text-primary neon-text":c.T[p]),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]",g?"text-success":"text-danger"),children:[h.value>0?(0,s.jsx)(l.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)(u,{values:d,tone:p,width:240,height:28,stretch:!0,live:!1})})]})}],93999)},3062,e=>{"use strict";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)]"},l={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"},n={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:u,action:h,as:p="div",padding:f="md",testId:v,className:g,children:j,...b}){return(0,s.jsxs)(p,{...b,"data-testid":v??b["data-testid"],className:(0,t.f)("relative rounded-panel border border-border bg-surface transition-colors duration-300",n[f],c&&"panel-corners",c&&r[e],o&&"glow-hover",o&&l[e],o&&i[e],d&&"grid-bg overflow-hidden bg-surface/80",g),children:[(x||h||u)&&(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:[u&&(0,s.jsx)("span",{className:(0,t.f)("mt-0.5 shrink-0",a.T[e]),children:u}),(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=>{"use strict";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})}])},75775,e=>{"use strict";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)},28523,e=>{"use strict";var s=e.i(56420);let t={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],28523)},21357,e=>{"use strict";var s=e.i(56420);let t={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};t.node;let a=(0,s.f)(t);e.s(["f",0,a],21357)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,11513,e=>{"use strict";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=>{"use strict";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=>{"use strict";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=>{"use strict";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=>{"use strict";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=>{"use strict";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=>{"use strict";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=>{"use strict";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=>{"use strict";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=>{"use strict";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=>{"use strict";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=>{"use strict";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
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,11513,e=>{"use strict";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=>{"use strict";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=>{"use strict";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",{...f?{role:"meter","aria-label":i,"aria-valuemin":0,"aria-valuemax":a,"aria-valuenow":e,"aria-valuetext":b}:{role:"img","aria-label":i?`${i}: no data`:"No data"},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=>{"use strict";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=>{"use strict";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=>{"use strict";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=>{"use strict";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=>{"use strict";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=>{"use strict";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=>{"use strict";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=>{"use strict";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=>{"use strict";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)}]);