@hivemagnus/magnus-ui 3.3.5 → 3.4.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 (383) hide show
  1. package/.env.example +22 -8
  2. package/README.md +13 -7
  3. package/dist/app/apps/dashboard/.next/BUILD_ID +1 -1
  4. package/dist/app/apps/dashboard/.next/app-path-routes-manifest.json +0 -1
  5. package/dist/app/apps/dashboard/.next/build-manifest.json +55 -67
  6. package/dist/app/apps/dashboard/.next/prerender-manifest.json +3 -3
  7. package/dist/app/apps/dashboard/.next/required-server-files.json +2 -2
  8. package/dist/app/apps/dashboard/.next/routes-manifest.json +20 -8
  9. package/dist/app/apps/dashboard/.next/server/app/_global-error/page/build-manifest.json +2 -2
  10. package/dist/app/apps/dashboard/.next/server/app/_global-error/page.js.nft.json +1 -1
  11. package/dist/app/apps/dashboard/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  12. package/dist/app/apps/dashboard/.next/server/app/_global-error.html +1 -1
  13. package/dist/app/apps/dashboard/.next/server/app/_global-error.rsc +1 -1
  14. package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  15. package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  16. package/dist/app/apps/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  17. package/dist/app/apps/dashboard/.next/server/app/_not-found/page/build-manifest.json +2 -2
  18. package/dist/app/apps/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -1
  19. package/dist/app/apps/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page/build-manifest.json +2 -2
  21. package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page.js.nft.json +1 -1
  22. package/dist/app/apps/dashboard/.next/server/app/anomalies/[anomalyId]/page_client-reference-manifest.js +1 -1
  23. package/dist/app/apps/dashboard/.next/server/app/anomalies/page/build-manifest.json +2 -2
  24. package/dist/app/apps/dashboard/.next/server/app/anomalies/page.js.nft.json +1 -1
  25. package/dist/app/apps/dashboard/.next/server/app/anomalies/page_client-reference-manifest.js +1 -1
  26. package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page/build-manifest.json +2 -2
  27. package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page.js.nft.json +1 -1
  28. package/dist/app/apps/dashboard/.next/server/app/anomalies/remediation/page_client-reference-manifest.js +1 -1
  29. package/dist/app/apps/dashboard/.next/server/app/api/auth/hive/callback/route.js +5 -7
  30. package/dist/app/apps/dashboard/.next/server/app/api/auth/hive/callback/route.js.nft.json +1 -1
  31. package/dist/app/apps/dashboard/.next/server/app/api/auth/hive/configured/route.js +4 -5
  32. package/dist/app/apps/dashboard/.next/server/app/api/auth/hive/configured/route.js.nft.json +1 -1
  33. package/dist/app/apps/dashboard/.next/server/app/api/auth/hive/start/route.js +4 -5
  34. package/dist/app/apps/dashboard/.next/server/app/api/auth/hive/start/route.js.nft.json +1 -1
  35. package/dist/app/apps/dashboard/.next/server/app/api/auth/login/route.js +3 -5
  36. package/dist/app/apps/dashboard/.next/server/app/api/auth/login/route.js.nft.json +1 -1
  37. package/dist/app/apps/dashboard/.next/server/app/api/auth/logout/route.js +5 -7
  38. package/dist/app/apps/dashboard/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
  39. package/dist/app/apps/dashboard/.next/server/app/api/auth/me/route.js +5 -7
  40. package/dist/app/apps/dashboard/.next/server/app/api/auth/me/route.js.nft.json +1 -1
  41. package/dist/app/apps/dashboard/.next/server/app/api/control-nodes/[id]/route.js.nft.json +1 -1
  42. package/dist/app/apps/dashboard/.next/server/app/api/control-nodes/migrate/route.js.nft.json +1 -1
  43. package/dist/app/apps/dashboard/.next/server/app/api/control-nodes/route.js.nft.json +1 -1
  44. package/dist/app/apps/dashboard/.next/server/app/api/federation/route.js +8 -10
  45. package/dist/app/apps/dashboard/.next/server/app/api/federation/route.js.nft.json +1 -1
  46. package/dist/app/apps/dashboard/.next/server/app/api/health/route.js +4 -3
  47. package/dist/app/apps/dashboard/.next/server/app/api/health/route.js.nft.json +1 -1
  48. package/dist/app/apps/dashboard/.next/server/app/api/hermes/dashboard/[[...path]]/route.js +7 -9
  49. package/dist/app/apps/dashboard/.next/server/app/api/hermes/dashboard/[[...path]]/route.js.nft.json +1 -1
  50. package/dist/app/apps/dashboard/.next/server/app/api/hive-router/dashboard/[[...path]]/route.js +6 -8
  51. package/dist/app/apps/dashboard/.next/server/app/api/hive-router/dashboard/[[...path]]/route.js.nft.json +1 -1
  52. package/dist/app/apps/dashboard/.next/server/app/api/proxy/[...path]/route.js +8 -10
  53. package/dist/app/apps/dashboard/.next/server/app/api/proxy/[...path]/route.js.nft.json +1 -1
  54. package/dist/app/apps/dashboard/.next/server/app/api/terminal/close/route.js +3 -5
  55. package/dist/app/apps/dashboard/.next/server/app/api/terminal/close/route.js.nft.json +1 -1
  56. package/dist/app/apps/dashboard/.next/server/app/api/terminal/input/route.js +3 -5
  57. package/dist/app/apps/dashboard/.next/server/app/api/terminal/input/route.js.nft.json +1 -1
  58. package/dist/app/apps/dashboard/.next/server/app/api/terminal/open/route.js +10 -12
  59. package/dist/app/apps/dashboard/.next/server/app/api/terminal/open/route.js.nft.json +1 -1
  60. package/dist/app/apps/dashboard/.next/server/app/api/terminal/resize/route.js +3 -5
  61. package/dist/app/apps/dashboard/.next/server/app/api/terminal/resize/route.js.nft.json +1 -1
  62. package/dist/app/apps/dashboard/.next/server/app/api/terminal/stream/route.js +4 -6
  63. package/dist/app/apps/dashboard/.next/server/app/api/terminal/stream/route.js.nft.json +1 -1
  64. package/dist/app/apps/dashboard/.next/server/app/api-docs/page/build-manifest.json +2 -2
  65. package/dist/app/apps/dashboard/.next/server/app/api-docs/page.js.nft.json +1 -1
  66. package/dist/app/apps/dashboard/.next/server/app/api-docs/page_client-reference-manifest.js +1 -1
  67. package/dist/app/apps/dashboard/.next/server/app/application-operations/page/build-manifest.json +2 -2
  68. package/dist/app/apps/dashboard/.next/server/app/application-operations/page.js.nft.json +1 -1
  69. package/dist/app/apps/dashboard/.next/server/app/application-operations/page_client-reference-manifest.js +1 -1
  70. package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page/build-manifest.json +2 -2
  71. package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page.js.nft.json +1 -1
  72. package/dist/app/apps/dashboard/.next/server/app/ardent/installations/page_client-reference-manifest.js +1 -1
  73. package/dist/app/apps/dashboard/.next/server/app/ardent/page/build-manifest.json +2 -2
  74. package/dist/app/apps/dashboard/.next/server/app/ardent/page.js.nft.json +1 -1
  75. package/dist/app/apps/dashboard/.next/server/app/ardent/page_client-reference-manifest.js +1 -1
  76. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page/build-manifest.json +2 -2
  77. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page.js.nft.json +1 -1
  78. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/[id]/page_client-reference-manifest.js +1 -1
  79. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page/build-manifest.json +2 -2
  80. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page.js.nft.json +1 -1
  81. package/dist/app/apps/dashboard/.next/server/app/ardent/profiles/page_client-reference-manifest.js +1 -1
  82. package/dist/app/apps/dashboard/.next/server/app/audit/page/build-manifest.json +2 -2
  83. package/dist/app/apps/dashboard/.next/server/app/audit/page.js +5 -5
  84. package/dist/app/apps/dashboard/.next/server/app/audit/page.js.nft.json +1 -1
  85. package/dist/app/apps/dashboard/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  86. package/dist/app/apps/dashboard/.next/server/app/codex/installations/page/build-manifest.json +2 -2
  87. package/dist/app/apps/dashboard/.next/server/app/codex/installations/page.js.nft.json +1 -1
  88. package/dist/app/apps/dashboard/.next/server/app/codex/installations/page_client-reference-manifest.js +1 -1
  89. package/dist/app/apps/dashboard/.next/server/app/codex/page/build-manifest.json +2 -2
  90. package/dist/app/apps/dashboard/.next/server/app/codex/page.js.nft.json +1 -1
  91. package/dist/app/apps/dashboard/.next/server/app/codex/page_client-reference-manifest.js +1 -1
  92. package/dist/app/apps/dashboard/.next/server/app/commands/page/build-manifest.json +2 -2
  93. package/dist/app/apps/dashboard/.next/server/app/commands/page.js.nft.json +1 -1
  94. package/dist/app/apps/dashboard/.next/server/app/commands/page_client-reference-manifest.js +1 -1
  95. package/dist/app/apps/dashboard/.next/server/app/cron/page/build-manifest.json +2 -2
  96. package/dist/app/apps/dashboard/.next/server/app/cron/page/server-reference-manifest.json +1 -1
  97. package/dist/app/apps/dashboard/.next/server/app/cron/page.js +3 -3
  98. package/dist/app/apps/dashboard/.next/server/app/cron/page.js.nft.json +1 -1
  99. package/dist/app/apps/dashboard/.next/server/app/cron/page_client-reference-manifest.js +1 -1
  100. package/dist/app/apps/dashboard/.next/server/app/files/page/build-manifest.json +2 -2
  101. package/dist/app/apps/dashboard/.next/server/app/files/page.js.nft.json +1 -1
  102. package/dist/app/apps/dashboard/.next/server/app/files/page_client-reference-manifest.js +1 -1
  103. package/dist/app/apps/dashboard/.next/server/app/fleet-map/page/build-manifest.json +2 -2
  104. package/dist/app/apps/dashboard/.next/server/app/fleet-map/page.js.nft.json +1 -1
  105. package/dist/app/apps/dashboard/.next/server/app/fleet-map/page_client-reference-manifest.js +1 -1
  106. package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page/build-manifest.json +2 -2
  107. package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page.js +4 -4
  108. package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page.js.nft.json +1 -1
  109. package/dist/app/apps/dashboard/.next/server/app/fleet-readiness/page_client-reference-manifest.js +1 -1
  110. package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page/build-manifest.json +2 -2
  111. package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page.js +5 -5
  112. package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page.js.nft.json +1 -1
  113. package/dist/app/apps/dashboard/.next/server/app/fleet-timeline/page_client-reference-manifest.js +1 -1
  114. package/dist/app/apps/dashboard/.next/server/app/governor/operations/page/build-manifest.json +2 -2
  115. package/dist/app/apps/dashboard/.next/server/app/governor/operations/page.js.nft.json +1 -1
  116. package/dist/app/apps/dashboard/.next/server/app/governor/operations/page_client-reference-manifest.js +1 -1
  117. package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page/build-manifest.json +2 -2
  118. package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page.js +4 -4
  119. package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page.js.nft.json +1 -1
  120. package/dist/app/apps/dashboard/.next/server/app/hermes-drift/page_client-reference-manifest.js +1 -1
  121. package/dist/app/apps/dashboard/.next/server/app/hermes-security/page/build-manifest.json +2 -2
  122. package/dist/app/apps/dashboard/.next/server/app/hermes-security/page.js.nft.json +1 -1
  123. package/dist/app/apps/dashboard/.next/server/app/hermes-security/page_client-reference-manifest.js +1 -1
  124. package/dist/app/apps/dashboard/.next/server/app/icon.svg/route.js.nft.json +1 -1
  125. package/dist/app/apps/dashboard/.next/server/app/incidents/page/build-manifest.json +2 -2
  126. package/dist/app/apps/dashboard/.next/server/app/incidents/page.js +3 -3
  127. package/dist/app/apps/dashboard/.next/server/app/incidents/page.js.nft.json +1 -1
  128. package/dist/app/apps/dashboard/.next/server/app/incidents/page_client-reference-manifest.js +1 -1
  129. package/dist/app/apps/dashboard/.next/server/app/library/page/build-manifest.json +2 -2
  130. package/dist/app/apps/dashboard/.next/server/app/library/page.js +5 -5
  131. package/dist/app/apps/dashboard/.next/server/app/library/page.js.nft.json +1 -1
  132. package/dist/app/apps/dashboard/.next/server/app/library/page_client-reference-manifest.js +1 -1
  133. package/dist/app/apps/dashboard/.next/server/app/login/page/build-manifest.json +2 -2
  134. package/dist/app/apps/dashboard/.next/server/app/login/page.js.nft.json +1 -1
  135. package/dist/app/apps/dashboard/.next/server/app/login/page_client-reference-manifest.js +1 -1
  136. package/dist/app/apps/dashboard/.next/server/app/logs/page/build-manifest.json +2 -2
  137. package/dist/app/apps/dashboard/.next/server/app/logs/page.js.nft.json +1 -1
  138. package/dist/app/apps/dashboard/.next/server/app/logs/page_client-reference-manifest.js +1 -1
  139. package/dist/app/apps/dashboard/.next/server/app/mission-control/page/build-manifest.json +2 -2
  140. package/dist/app/apps/dashboard/.next/server/app/mission-control/page.js +6 -6
  141. package/dist/app/apps/dashboard/.next/server/app/mission-control/page.js.nft.json +1 -1
  142. package/dist/app/apps/dashboard/.next/server/app/mission-control/page_client-reference-manifest.js +1 -1
  143. package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page/build-manifest.json +2 -2
  144. package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page/react-loadable-manifest.json +1 -1
  145. package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page.js.nft.json +1 -1
  146. package/dist/app/apps/dashboard/.next/server/app/nodes/[nodeId]/page_client-reference-manifest.js +1 -1
  147. package/dist/app/apps/dashboard/.next/server/app/nodes/page/build-manifest.json +2 -2
  148. package/dist/app/apps/dashboard/.next/server/app/nodes/page.js +5 -5
  149. package/dist/app/apps/dashboard/.next/server/app/nodes/page.js.nft.json +1 -1
  150. package/dist/app/apps/dashboard/.next/server/app/nodes/page_client-reference-manifest.js +1 -1
  151. package/dist/app/apps/dashboard/.next/server/app/notifications/page/build-manifest.json +2 -2
  152. package/dist/app/apps/dashboard/.next/server/app/notifications/page.js.nft.json +1 -1
  153. package/dist/app/apps/dashboard/.next/server/app/notifications/page_client-reference-manifest.js +1 -1
  154. package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page/build-manifest.json +2 -2
  155. package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page.js.nft.json +1 -1
  156. package/dist/app/apps/dashboard/.next/server/app/orchestra/installations/page_client-reference-manifest.js +1 -1
  157. package/dist/app/apps/dashboard/.next/server/app/orchestra/page/build-manifest.json +2 -2
  158. package/dist/app/apps/dashboard/.next/server/app/orchestra/page.js.nft.json +1 -1
  159. package/dist/app/apps/dashboard/.next/server/app/orchestra/page_client-reference-manifest.js +1 -1
  160. package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page/build-manifest.json +2 -2
  161. package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page.js.nft.json +1 -1
  162. package/dist/app/apps/dashboard/.next/server/app/orchestra/profiles/page_client-reference-manifest.js +1 -1
  163. package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page/build-manifest.json +2 -2
  164. package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page.js.nft.json +1 -1
  165. package/dist/app/apps/dashboard/.next/server/app/orchestra/web-gateway/page_client-reference-manifest.js +1 -1
  166. package/dist/app/apps/dashboard/.next/server/app/page/build-manifest.json +2 -2
  167. package/dist/app/apps/dashboard/.next/server/app/page/react-loadable-manifest.json +1 -1
  168. package/dist/app/apps/dashboard/.next/server/app/page.js +3 -3
  169. package/dist/app/apps/dashboard/.next/server/app/page.js.nft.json +1 -1
  170. package/dist/app/apps/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
  171. package/dist/app/apps/dashboard/.next/server/app/retention/page/build-manifest.json +2 -2
  172. package/dist/app/apps/dashboard/.next/server/app/retention/page.js +5 -5
  173. package/dist/app/apps/dashboard/.next/server/app/retention/page.js.nft.json +1 -1
  174. package/dist/app/apps/dashboard/.next/server/app/retention/page_client-reference-manifest.js +1 -1
  175. package/dist/app/apps/dashboard/.next/server/app/roles/page/build-manifest.json +2 -2
  176. package/dist/app/apps/dashboard/.next/server/app/roles/page.js +3 -3
  177. package/dist/app/apps/dashboard/.next/server/app/roles/page.js.nft.json +1 -1
  178. package/dist/app/apps/dashboard/.next/server/app/roles/page_client-reference-manifest.js +1 -1
  179. package/dist/app/apps/dashboard/.next/server/app/rollouts/page/build-manifest.json +2 -2
  180. package/dist/app/apps/dashboard/.next/server/app/rollouts/page.js.nft.json +1 -1
  181. package/dist/app/apps/dashboard/.next/server/app/rollouts/page_client-reference-manifest.js +1 -1
  182. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page/build-manifest.json +2 -2
  183. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page.js.nft.json +1 -1
  184. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/[caseId]/page_client-reference-manifest.js +1 -1
  185. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page/build-manifest.json +2 -2
  186. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page.js.nft.json +1 -1
  187. package/dist/app/apps/dashboard/.next/server/app/security-fusion/cases/page_client-reference-manifest.js +1 -1
  188. package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page/build-manifest.json +2 -2
  189. package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page.js.nft.json +1 -1
  190. package/dist/app/apps/dashboard/.next/server/app/security-fusion/entities/page_client-reference-manifest.js +1 -1
  191. package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page/build-manifest.json +2 -2
  192. package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page.js.nft.json +1 -1
  193. package/dist/app/apps/dashboard/.next/server/app/security-fusion/events/page_client-reference-manifest.js +1 -1
  194. package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page/build-manifest.json +2 -2
  195. package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page.js.nft.json +1 -1
  196. package/dist/app/apps/dashboard/.next/server/app/security-fusion/evidence/page_client-reference-manifest.js +1 -1
  197. package/dist/app/apps/dashboard/.next/server/app/security-fusion/page/build-manifest.json +2 -2
  198. package/dist/app/apps/dashboard/.next/server/app/security-fusion/page.js +6 -6
  199. package/dist/app/apps/dashboard/.next/server/app/security-fusion/page.js.nft.json +1 -1
  200. package/dist/app/apps/dashboard/.next/server/app/security-fusion/page_client-reference-manifest.js +1 -1
  201. package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page/build-manifest.json +2 -2
  202. package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page.js.nft.json +1 -1
  203. package/dist/app/apps/dashboard/.next/server/app/security-fusion/policies/page_client-reference-manifest.js +1 -1
  204. package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page/build-manifest.json +2 -2
  205. package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page.js.nft.json +1 -1
  206. package/dist/app/apps/dashboard/.next/server/app/security-fusion/sources/page_client-reference-manifest.js +1 -1
  207. package/dist/app/apps/dashboard/.next/server/app/skills/page/build-manifest.json +2 -2
  208. package/dist/app/apps/dashboard/.next/server/app/skills/page/server-reference-manifest.json +1 -1
  209. package/dist/app/apps/dashboard/.next/server/app/skills/page.js +3 -3
  210. package/dist/app/apps/dashboard/.next/server/app/skills/page.js.nft.json +1 -1
  211. package/dist/app/apps/dashboard/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  212. package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page/build-manifest.json +2 -2
  213. package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page.js.nft.json +1 -1
  214. package/dist/app/apps/dashboard/.next/server/app/webhooks/[id]/page_client-reference-manifest.js +1 -1
  215. package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page/build-manifest.json +2 -2
  216. package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page.js.nft.json +1 -1
  217. package/dist/app/apps/dashboard/.next/server/app/webhooks/new/page_client-reference-manifest.js +1 -1
  218. package/dist/app/apps/dashboard/.next/server/app/webhooks/page/build-manifest.json +2 -2
  219. package/dist/app/apps/dashboard/.next/server/app/webhooks/page.js.nft.json +1 -1
  220. package/dist/app/apps/dashboard/.next/server/app/webhooks/page_client-reference-manifest.js +1 -1
  221. package/dist/app/apps/dashboard/.next/server/app-paths-manifest.json +0 -1
  222. package/dist/app/apps/dashboard/.next/server/chunks/{[externals]__1gpib58wvc0g_._.js → [externals]__01k4rzg4z7v1k._.js} +1 -1
  223. package/dist/app/apps/dashboard/.next/server/chunks/{[externals]__1jfj7isl6nfj_._.js → [externals]__0cnujgycur6k7._.js} +1 -1
  224. package/dist/app/apps/dashboard/.next/server/chunks/{[externals]__0l87g6k2t5rzj._.js → [externals]__0lqxjl6ur0vak._.js} +1 -1
  225. package/dist/app/apps/dashboard/.next/server/chunks/[root-of-the-server]__0-5-izgwnn1d_._.js +3 -0
  226. package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__1p6m7-_a781eq._.js → [root-of-the-server]__0-zlv2zumipc_._.js} +1 -1
  227. package/dist/app/apps/dashboard/.next/server/chunks/[root-of-the-server]__05vapur0p6d-l._.js +3 -0
  228. package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__1p7rfabpjl1w9._.js → [root-of-the-server]__08382in4_btq7._.js} +1 -1
  229. package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__1nub0ddapknlw._.js → [root-of-the-server]__0cvay2yc_ufro._.js} +1 -1
  230. package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__1-z231__iok1s._.js → [root-of-the-server]__0dap0rt-nsm5t._.js} +1 -1
  231. package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__13up3mg7dbzn6._.js → [root-of-the-server]__0fwm7idn_76uf._.js} +1 -1
  232. package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__1c5n13hsoabkh._.js → [root-of-the-server]__0iiv9pxo2yauj._.js} +1 -1
  233. package/dist/app/apps/dashboard/.next/server/chunks/[root-of-the-server]__0ioimsx71gr0o._.js +3 -0
  234. package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__1lrs0igd_ft_l._.js → [root-of-the-server]__0vzssf5bgd660._.js} +1 -1
  235. package/dist/app/apps/dashboard/.next/server/chunks/[root-of-the-server]__0ywmf3079vsm1._.js +16 -16
  236. package/dist/app/apps/dashboard/.next/server/chunks/[root-of-the-server]__15bjnu5yieigz._.js +2 -2
  237. package/dist/app/apps/dashboard/.next/server/chunks/{[root-of-the-server]__1kg-l8v0fxrj3._.js → [root-of-the-server]__1okorj_k16k5j._.js} +1 -1
  238. package/dist/app/apps/dashboard/.next/server/chunks/_0-w_jq1-cxsud._.js +1 -1
  239. package/dist/app/apps/dashboard/.next/server/chunks/_0_fjgwmia8tfa._.js +1 -1
  240. package/dist/app/apps/dashboard/.next/server/chunks/_0cz-sjd6cade0._.js +1 -1
  241. package/dist/app/apps/dashboard/.next/server/chunks/_0h965a-fek_i1._.js +1 -1
  242. package/dist/app/apps/dashboard/.next/server/chunks/_0j68riv96qwg8._.js +1 -1
  243. package/dist/app/apps/dashboard/.next/server/chunks/_0jaugku4pdkak._.js +1 -1
  244. package/dist/app/apps/dashboard/.next/server/chunks/_0jvoc4-ta3zc0._.js +1 -1
  245. package/dist/app/apps/dashboard/.next/server/chunks/_0oj6_-g5b2lvi._.js +141 -0
  246. package/dist/app/apps/dashboard/.next/server/chunks/_0rpixw8k9f_1q._.js +1 -1
  247. package/dist/app/apps/dashboard/.next/server/chunks/_0rwz3f0jh1ty0._.js +141 -0
  248. package/dist/app/apps/dashboard/.next/server/chunks/_0s788ryrplkp6._.js +1 -1
  249. package/dist/app/apps/dashboard/.next/server/chunks/_0ss4gyka2xwtu._.js +1 -1
  250. package/dist/app/apps/dashboard/.next/server/chunks/_0ti6qpnzqaoee._.js +1 -1
  251. package/dist/app/apps/dashboard/.next/server/chunks/_0z1bwl42i7kyh._.js +1 -1
  252. package/dist/app/apps/dashboard/.next/server/chunks/_1-ntqfqk_4-f0._.js +141 -0
  253. package/dist/app/apps/dashboard/.next/server/chunks/_109zj-srrib-n._.js +1 -1
  254. package/dist/app/apps/dashboard/.next/server/chunks/_120rsoc_nc7_3._.js +141 -0
  255. package/dist/app/apps/dashboard/.next/server/chunks/_1bbph2o31ut9-._.js +1 -1
  256. package/dist/app/apps/dashboard/.next/server/chunks/_1bnwf9dhenncq._.js +1 -1
  257. package/dist/app/apps/dashboard/.next/server/chunks/_1di30nby6-dr0._.js +1 -1
  258. package/dist/app/apps/dashboard/.next/server/chunks/_1e42zgily9-_5._.js +1 -1
  259. package/dist/app/apps/dashboard/.next/server/chunks/_1ilhtkg33m99h._.js +141 -0
  260. package/dist/app/apps/dashboard/.next/server/chunks/_1j9ys57oirxn5._.js +1 -1
  261. package/dist/app/apps/dashboard/.next/server/chunks/_1xodprib7qa_j._.js +1 -1
  262. package/dist/app/apps/dashboard/.next/server/chunks/_1xoy6p0t2si_y._.js +1 -1
  263. package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_src_lib_auth_ts_1hhq1tq6hjj-e._.js +2 -2
  264. package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_src_lib_hive-login_ts_0ab2iq7-rpy13._.js +1 -1
  265. package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_src_lib_security-events_ts_0xwi4rkbujqr-._.js +1 -1
  266. package/dist/app/apps/dashboard/.next/server/chunks/node_modules_undici_1l-nut4zj6fq1._.js +127 -0
  267. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__0degu9u1azz71._.js → [root-of-the-server]__000ndthd0hd5v._.js} +1 -1
  268. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1qgn9450v696_._.js → [root-of-the-server]__02rfo46o0ocq7._.js} +1 -1
  269. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__06giq9g4me8eh._.js → [root-of-the-server]__02wumq04h7-2m._.js} +2 -2
  270. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__04hi33lhtvr4k._.js → [root-of-the-server]__0l7okklk-ix9t._.js} +1 -1
  271. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__0fpn05b9fp43i._.js → [root-of-the-server]__0neu-iblb1_-5._.js} +1 -1
  272. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__036zs-5_yuyxb._.js → [root-of-the-server]__0xtgyuehebh4_._.js} +1 -1
  273. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__06ssj8n_ian_9._.js → [root-of-the-server]__1cfg7h9zgqn-k._.js} +1 -1
  274. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__0__af2nyy0175._.js → [root-of-the-server]__1gwofuehw8lyc._.js} +1 -1
  275. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__01cf6gneqbonz._.js → [root-of-the-server]__1jb0a4bkg6dd1._.js} +1 -1
  276. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__0pmeznk95qzb_._.js → [root-of-the-server]__1jtg9fc0ny1cg._.js} +1 -1
  277. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__08sgyyf_y8ab8._.js → [root-of-the-server]__1koj-a25tcc9z._.js} +2 -2
  278. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1b52j7srra3w_._.js → [root-of-the-server]__1l8__2gqqi590._.js} +1 -1
  279. package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__1n3nkuw3uylha._.js +1 -1
  280. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__11pe-l2-ko65_._.js → [root-of-the-server]__1ria97bl22vsq._.js} +2 -2
  281. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__04py15r6s88mn._.js → [root-of-the-server]__1w1bkuf_-8zxm._.js} +1 -1
  282. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1puyk1oobvatz._.js → [root-of-the-server]__1wsrd6m1h8q7q._.js} +1 -1
  283. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__0o_3rvim51sh4._.js → [root-of-the-server]__1y4za7l5ph9o-._.js} +1 -1
  284. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__0kimthfi8yo91._.js → [root-of-the-server]__1y9rnem301ye0._.js} +1 -1
  285. package/dist/app/apps/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__1duyqypa9ty8o._.js → [root-of-the-server]__202zczfuwkbzi._.js} +1 -1
  286. package/dist/app/apps/dashboard/.next/server/chunks/ssr/_07u8d93e_m_yo._.js +266 -0
  287. package/dist/app/apps/dashboard/.next/server/chunks/ssr/_0caxc2bc6a__r._.js +1 -1
  288. package/dist/app/apps/dashboard/.next/server/chunks/ssr/_0rqtt0ku_0lmg._.js +3 -0
  289. package/dist/app/apps/dashboard/.next/server/chunks/ssr/_1ml_bvfb1fitq._.js +1 -1
  290. package/dist/app/apps/dashboard/.next/server/chunks/ssr/_1oebzzj_en62h._.js +1 -1
  291. package/dist/app/apps/dashboard/.next/server/chunks/ssr/_1xi3detnxu0ar._.js +3 -0
  292. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_runtime-environment_mjs_11tpywm9_soif._.js +1 -1
  293. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_0gs_s688kgg1i._.js +1 -1
  294. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_anomalies_[anomalyId]_page_tsx_1zti_bnloknef._.js +1 -1
  295. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_ardent_installations_page_tsx_0nvqgacugy6nf._.js +1 -1
  296. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_cron_page_tsx_1i3duyygc0_tg._.js +1 -1
  297. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_login_page_tsx_12_rihimtav2a._.js +1 -1
  298. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_app_skills_page_tsx_0n5zp4xad38in._.js +1 -1
  299. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_lib_api-client_ts_0tho-kkk5ez7h._.js +2 -2
  300. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_lib_cn_ts_0038m9h2x02mo._.js +1 -1
  301. package/dist/app/apps/dashboard/.next/server/chunks/ssr/apps_dashboard_src_lib_cn_ts_1p8--q21wpxcq._.js +1 -1
  302. package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_004vsi8ju-_8e._.js +3 -0
  303. package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_11f8_4aw8657-._.js +1 -1
  304. package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_Icon_mjs_0lly-em28afbk._.js +1 -1
  305. package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_arrow-left_mjs_1sl3qew14luds._.js +3 -0
  306. package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_next_dist_0-amwqbrge23p._.js +2 -2
  307. package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_next_dist_0tg97786c_yac._.js +2 -2
  308. package/dist/app/apps/dashboard/.next/server/middleware-build-manifest.js +55 -67
  309. package/dist/app/apps/dashboard/.next/server/middleware.js +1 -1
  310. package/dist/app/apps/dashboard/.next/server/next-font-manifest.js +1 -1
  311. package/dist/app/apps/dashboard/.next/server/next-font-manifest.json +0 -4
  312. package/dist/app/apps/dashboard/.next/server/pages/500.html +1 -1
  313. package/dist/app/apps/dashboard/.next/server/preview-props.json +3 -3
  314. package/dist/app/apps/dashboard/.next/server/server-reference-manifest.js +1 -1
  315. package/dist/app/apps/dashboard/.next/server/server-reference-manifest.json +3 -3
  316. package/dist/app/apps/dashboard/.next/static/chunks/015s19fe5dtkp.css +2 -0
  317. package/dist/app/apps/dashboard/.next/static/chunks/{2unobn729hkga.js → 075c8rohgw3q2.js} +1 -1
  318. package/dist/app/apps/dashboard/.next/static/chunks/0d9skwx5-u4tm.js +1 -0
  319. package/dist/app/apps/dashboard/.next/static/chunks/{3s98rvw78e82w.js → 0i623si9zaa6v.js} +1 -1
  320. package/dist/app/apps/dashboard/.next/static/chunks/{32wfn__n6rg0h.js → 0j2ys9q_o9nxa.js} +1 -1
  321. package/dist/app/apps/dashboard/.next/static/chunks/{0f35_02yk6dr1.js → 0wawsfc2agv69.js} +1 -1
  322. package/dist/app/apps/dashboard/.next/static/chunks/0yb36s9l-f3_w.js +1 -0
  323. package/dist/app/apps/dashboard/.next/static/chunks/1-vn8cqro-f08.js +2 -0
  324. package/dist/app/apps/dashboard/.next/static/chunks/1knlpr3sm-lfu.js +1 -0
  325. package/dist/app/apps/dashboard/.next/static/chunks/1lf63dbqh-s3c.js +1 -0
  326. package/dist/app/apps/dashboard/.next/static/chunks/{41orfzz5ycny6.js → 2ihd8pnbbkuwg.js} +1 -1
  327. package/dist/app/apps/dashboard/.next/static/chunks/{13iwpo-z3amgc.js → 2scvtcvd03itt.js} +1 -1
  328. package/dist/app/apps/dashboard/.next/static/chunks/{35q52lg40ayb-.js → 39_j1bdzreq0m.js} +1 -1
  329. package/dist/app/apps/dashboard/.next/static/chunks/3jd-wtez33fp_.js +1 -0
  330. package/dist/app/apps/dashboard/.next/static/chunks/{3izzmp70ximoz.js → 3kyynbc0yzghy.js} +1 -1
  331. package/dist/app/apps/dashboard/.next/static/chunks/3w-7xko96ljib.js +1 -0
  332. package/dist/app/apps/dashboard/package.json +13 -13
  333. package/dist/app/apps/dashboard/runtime-client-address.mjs +67 -0
  334. package/dist/app/apps/dashboard/runtime-dashboard-credentials.mjs +8 -25
  335. package/dist/app/apps/dashboard/runtime-environment.mjs +13 -7
  336. package/dist/app/apps/dashboard/runtime-session-secret.mjs +7 -28
  337. package/dist/app/apps/dashboard/server-tls.mjs +9 -7
  338. package/dist/app/apps/dashboard/server.js +1 -1
  339. package/npm-shrinkwrap.json +16 -16
  340. package/package.json +13 -13
  341. package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page/app-paths-manifest.json +0 -3
  342. package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page/build-manifest.json +0 -23
  343. package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page/next-font-manifest.json +0 -11
  344. package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page/react-loadable-manifest.json +0 -1
  345. package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page/server-reference-manifest.json +0 -4
  346. package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page.js +0 -20
  347. package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page.js.map +0 -5
  348. package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page.js.nft.json +0 -1
  349. package/dist/app/apps/dashboard/.next/server/app/governor/share/[token]/page_client-reference-manifest.js +0 -3
  350. package/dist/app/apps/dashboard/.next/server/chunks/[externals]__0lm2eonzt5e-n._.js +0 -3
  351. package/dist/app/apps/dashboard/.next/server/chunks/[root-of-the-server]__0t7esohym6wp4._.js +0 -3
  352. package/dist/app/apps/dashboard/.next/server/chunks/[root-of-the-server]__10wci19qwvbv3._.js +0 -3
  353. package/dist/app/apps/dashboard/.next/server/chunks/[root-of-the-server]__1d_bxkf6o9et4._.js +0 -3
  354. package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_runtime-dashboard-credentials_mjs_1jk3404-7k3lf._.js +0 -3
  355. package/dist/app/apps/dashboard/.next/server/chunks/apps_dashboard_src_lib_auth-constants_ts_1mm7vz_0mh-gu._.js +0 -3
  356. package/dist/app/apps/dashboard/.next/server/chunks/node_modules_0_mv4bximoofw._.js +0 -141
  357. package/dist/app/apps/dashboard/.next/server/chunks/node_modules_0u9pfz6tlfjqv._.js +0 -141
  358. package/dist/app/apps/dashboard/.next/server/chunks/node_modules_1ovxb0oub71q-._.js +0 -141
  359. package/dist/app/apps/dashboard/.next/server/chunks/node_modules_undici_0153f0xi5kile._.js +0 -127
  360. package/dist/app/apps/dashboard/.next/server/chunks/ssr/1vk4__next-internal_server_app_governor_share_[token]_page_actions_09ftd5k2rvcoc.js +0 -3
  361. package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__0hqhb23em35gm._.js +0 -3
  362. package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__1jj4lq1rlrw7m._.js +0 -3
  363. package/dist/app/apps/dashboard/.next/server/chunks/ssr/[root-of-the-server]__1mfgpnyml6wjw._.js +0 -3
  364. package/dist/app/apps/dashboard/.next/server/chunks/ssr/_0eccfdt1lz-7r._.js +0 -3
  365. package/dist/app/apps/dashboard/.next/server/chunks/ssr/_0raw_gngl90-7._.js +0 -3
  366. package/dist/app/apps/dashboard/.next/server/chunks/ssr/_0zsjpnu4iitoz._.js +0 -266
  367. package/dist/app/apps/dashboard/.next/server/chunks/ssr/_1tiz-n6occxnl._.js +0 -3
  368. package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_188b8ag_m5vfr._.js +0 -3
  369. package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_0ut3n9th3gffy._.js +0 -3
  370. package/dist/app/apps/dashboard/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0i0wbq05rs_2c.js +0 -3
  371. package/dist/app/apps/dashboard/.next/static/chunks/0_75wyrqh7omi.js +0 -2
  372. package/dist/app/apps/dashboard/.next/static/chunks/0c34_gunccud3.css +0 -2
  373. package/dist/app/apps/dashboard/.next/static/chunks/0f9vroowginda.js +0 -1
  374. package/dist/app/apps/dashboard/.next/static/chunks/14tua164t_7uj.js +0 -1
  375. package/dist/app/apps/dashboard/.next/static/chunks/17jgal4mw939y.js +0 -1
  376. package/dist/app/apps/dashboard/.next/static/chunks/1z8yy1fep3eml.js +0 -1
  377. package/dist/app/apps/dashboard/.next/static/chunks/2_46_b2fwiefm.js +0 -1
  378. package/dist/app/apps/dashboard/.next/static/chunks/2kbroppc88xxd.js +0 -1
  379. package/dist/app/apps/dashboard/.next/static/chunks/2re4mp6xbi3y8.js +0 -1
  380. package/dist/app/apps/dashboard/.next/static/chunks/3lik3lhs9cb-3.js +0 -1
  381. /package/dist/app/apps/dashboard/.next/static/{9zFQB0mnA1c78vQV6OOs2 → 2Aze_keWwLkJvef9JxilT}/_buildManifest.js +0 -0
  382. /package/dist/app/apps/dashboard/.next/static/{9zFQB0mnA1c78vQV6OOs2 → 2Aze_keWwLkJvef9JxilT}/_clientMiddlewareManifest.js +0 -0
  383. /package/dist/app/apps/dashboard/.next/static/{9zFQB0mnA1c78vQV6OOs2 → 2Aze_keWwLkJvef9JxilT}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[50567,e=>{"use strict";var t=e.i(89171);let i=Buffer.from("PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJSb2JvdCBmYXZpY29uIj4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0iYmciIHgxPSIwIiB5MT0iMCIgeDI9IjEiIHkyPSIxIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzExMTgyNyIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMxZjI5MzciLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9ImZhY2UiIHgxPSIwIiB5MT0iMCIgeDI9IjEiIHkyPSIxIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzIyZDNlZSIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMzYjgyZjYiLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgPC9kZWZzPgoKICA8cmVjdCB4PSIyIiB5PSIyIiB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHJ4PSIxNCIgZmlsbD0idXJsKCNiZykiLz4KCiAgPHJlY3QgeD0iMjIiIHk9IjkiIHdpZHRoPSIyMCIgaGVpZ2h0PSI1IiByeD0iMi41IiBmaWxsPSIjOWNhM2FmIi8+CiAgPGNpcmNsZSBjeD0iMzIiIGN5PSI3IiByPSIzIiBmaWxsPSIjMjJkM2VlIi8+CgogIDxyZWN0IHg9IjE0IiB5PSIxNiIgd2lkdGg9IjM2IiBoZWlnaHQ9IjMyIiByeD0iOCIgZmlsbD0idXJsKCNmYWNlKSIvPgoKICA8Y2lyY2xlIGN4PSIyNSIgY3k9IjMxIiByPSI0LjgiIGZpbGw9IiMwZjE3MmEiLz4KICA8Y2lyY2xlIGN4PSIzOSIgY3k9IjMxIiByPSI0LjgiIGZpbGw9IiMwZjE3MmEiLz4KICA8Y2lyY2xlIGN4PSIyNSIgY3k9IjMxIiByPSIyIiBmaWxsPSIjOTNjNWZkIi8+CiAgPGNpcmNsZSBjeD0iMzkiIGN5PSIzMSIgcj0iMiIgZmlsbD0iIzkzYzVmZCIvPgoKICA8cmVjdCB4PSIyNCIgeT0iMzkiIHdpZHRoPSIxNiIgaGVpZ2h0PSIzLjYiIHJ4PSIxLjgiIGZpbGw9IiMwZjE3MmEiLz4KCiAgPHJlY3QgeD0iOSIgeT0iMjQiIHdpZHRoPSI1IiBoZWlnaHQ9IjE0IiByeD0iMi41IiBmaWxsPSIjNmI3MjgwIi8+CiAgPHJlY3QgeD0iNTAiIHk9IjI0IiB3aWR0aD0iNSIgaGVpZ2h0PSIxNCIgcng9IjIuNSIgZmlsbD0iIzZiNzI4MCIvPgo8L3N2Zz4K","base64");e.s(["GET",0,function(){return new t.NextResponse(i,{headers:{"Content-Type":"image/svg+xml","Cache-Control":"public, max-age=0, must-revalidate"}})},"dynamic",0,"force-static"])},18317,e=>{"use strict";var t=e.i(47909),i=e.i(74017),r=e.i(96250),a=e.i(59756),n=e.i(61916),l=e.i(74677),o=e.i(69741),s=e.i(16795),I=e.i(87718),c=e.i(95169),u=e.i(47587),d=e.i(66012),p=e.i(70101),g=e.i(74838),h=e.i(10372),C=e.i(93695),m=e.i(9580);e.i(52474);var v=e.i(220);let P=new t.AppRouteRouteModule({definition:{kind:i.f.APP_ROUTE,page:"/icon.svg/route",pathname:"/icon.svg",filename:"icon.svg--route-entry",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/apps/dashboard/src/app/icon.svg--route-entry.js",nextConfigOutput:"standalone",userland:()=>e.r(50567),...{}}),{workAsyncStorage:x,workUnitAsyncStorage:y,serverHooks:S}=P;async function w(e,t,i){i.requestMeta&&(0,a.R)(e,i.requestMeta),P.isDev&&(0,a.i)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let r="/icon.svg/route";r=r.replace(/\/index$/,"")||"/";let{instrumentation:l}=await P.ensureInstrumentation(e,{deferSpans:!0});return P.traceRequest(e,{tracer:(0,n.v)(),spanName:`${e.method||"GET"} ${r}`,httpTarget:e.url,instrumentation:l},(a,n)=>f(e,t,i,r,!1,a,n))}async function f(e,t,r,x,y,S,w){let f=await P.prepare(e,t,{srcPage:x,multiZoneDraftMode:y});if(!f)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:A,deploymentId:j,params:b,nextConfig:R,parsedUrl:Z,isDraftMode:M,prerenderManifest:N,routerServerContext:E,isOnDemandRevalidate:H,revalidateOnlyGenerated:B,resolvedPathname:T,clientReferenceManifest:D,serverActionsManifest:G,previewProps:k}=f,z=(0,o.f)(x),W=!!N.routes[T]&&(P.isDev||(0,m.f)(T,P.cacheOwner,N.routes[T])),Y=!!(N.dynamicRoutes[z]||W),O=async()=>((null==E?void 0:E.render404)?await E.render404(e,t,Z,!1):t.end("This page could not be found"),null);if(Y&&!M){let e=N.dynamicRoutes[z];if(e&&!1===e.fallback&&!W){if(R.adapterPath)return await O();throw new C.NoFallbackError}}let U=null;!Y||P.isDev||M||(U="/index"===(U=T)?"/":U),G&&D&&(0,l.f)({page:x,clientReferenceManifest:D,serverActionsManifest:G});let K=e.method||"GET",L=(0,n.v)(),J=!!(null==E?void 0:E.isWrappedByNextServer),Q=!!(0,a.w)(e,"minimalMode"),V=(0,a.w)(e,"incrementalCache")||await P.getIncrementalCache(e,R,k,N,Q);null==V||V.resetRequestCache(),globalThis.__incrementalCache=V;let q={params:b,previewProps:k,renderOpts:{experimental:{authInterrupts:!!R.experimental.authInterrupts,useCacheTimeout:R.experimental.useCacheTimeout,durableUseCacheEntries:!!R.experimental.durableUseCacheEntries},cacheComponents:!!R.cacheComponents,validationLevel:R.experimental.instantInsights.validationLevel,isDraftMode:M,incrementalCache:V,hmrRefreshHash:(0,a.w)(e,"hmrRefreshHash"),cacheLifeProfiles:R.cacheLife,staticPageGenerationTimeout:R.staticPageGenerationTimeout,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0},sharedContext:{buildId:A,deploymentId:j}},_=new s.x(e),F=new s.e(t),X=I.k.fromNodeNextRequest(_,(0,I.t)(t)),$=async({previousCacheEntry:i})=>{try{if(!Q&&H&&B&&!i)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=null===U?await P.handle(X,q):await P.prerender(X,q);e.fetchMetrics=q.renderOpts.fetchMetrics;let n=q.renderOpts.pendingWaitUntil;n&&r.waitUntil&&(r.waitUntil(n),n=void 0);let l=q.renderOpts.collectedTags;if(!Y)return await (0,d.f)(_,F,a,n),null;{let e=await a.blob(),t=(0,p.S)(a.headers);l&&(t[h.M]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let i=void 0!==q.renderOpts.collectedRevalidate&&!(q.renderOpts.collectedRevalidate>=h.Q)&&q.renderOpts.collectedRevalidate,r=void 0===q.renderOpts.collectedExpire||q.renderOpts.collectedExpire>=h.Q?!1!==i&&i>0?R.expireTime:void 0:q.renderOpts.collectedExpire;return{value:{kind:v.x.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:i,expire:r}}}}catch(t){throw(null==i?void 0:i.isStale)&&await P.onRequestError(e,t,{routerKind:"App Router",routePath:x,routeType:"route",revalidateReason:(0,u.f)({isStaticGeneration:null!==U,isOnDemandRevalidate:H})},!1,E),t}},ee=async a=>{try{var l,o;let a=await P.handleResponse({req:e,nextConfig:R,cacheKey:U,routeKind:i.f.APP_ROUTE,isFallback:!1,previewProps:k,prerenderManifest:N,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:B,responseGenerator:$,waitUntil:r.waitUntil,isMinimalMode:Q});if(null!==a&&"error"in a)throw a.error;if(!Y)return;if((null==a||null==(l=a.value)?void 0:l.kind)!==v.x.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==a||null==(o=a.value)?void 0:o.kind}`);Q||t.setHeader("x-nextjs-cache",H?"REVALIDATED":a.isMiss?"MISS":a.isStale?"STALE":"HIT"),M&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let n=(0,p.G)(a.value.headers);Q&&Y||n.delete(h.M),!a.cacheControl||t.getHeader("Cache-Control")||n.get("Cache-Control")||n.set("Cache-Control",(0,g.f)(a.cacheControl)),await (0,d.f)(_,F,new Response(a.value.body,{headers:n,status:a.value.status||200}));return}catch(i){if(i instanceof C.NoFallbackError||await P.onRequestError(e,i,{routerKind:"App Router",routePath:z,routeType:"route",revalidateReason:(0,u.f)({isStaticGeneration:null!==U,isOnDemandRevalidate:H})},!1,E),Y)throw i;if(t.headersSent){if(a){let e=i instanceof Error?i:Error("Unknown app route error");a.recordException(e),a.setStatus({code:n.J.ERROR,message:e.message}),a.setAttribute("error.type",e.name)}t.writableEnded||t.destroyed||t.end()}else await (0,d.f)(_,F,new Response(null,{status:500}));return}finally{(()=>{if(!a)return;let e=t.statusCode;a.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(a.setStatus({code:n.J.ERROR}),a.setAttribute("error.type",e.toString()));let i=L.getRootSpanAttributes();if(!i)return;if(i.get("next.span_type")!==c.q.handleRequest)return console.warn(`Unexpected root span type '${i.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=i.get("next.route")||z,l=`${K} ${r}`;a.setAttributes({"next.route":r,"http.route":r,"next.span_name":l}),a.updateName(l),w&&w!==a&&(w.setAttribute("http.route",r),w.updateName(l))})()}};J||void 0===e.url||null==S||S.setAttribute("http.target",e.url),await ee(S)}e.s(["handler",0,w,"patchFetch",0,function(){return(0,r.f)({workAsyncStorage:x,workUnitAsyncStorage:y})},"routeModule",0,P,"serverHooks",0,S,"workAsyncStorage",0,x,"workUnitAsyncStorage",0,y])}];
1
+ module.exports=[50567,e=>{"use strict";var t=e.i(89171);let i=Buffer.from("PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NCA2NCIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJSb2JvdCBmYXZpY29uIj4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0iYmciIHgxPSIwIiB5MT0iMCIgeDI9IjEiIHkyPSIxIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzExMTgyNyIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMxZjI5MzciLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9ImZhY2UiIHgxPSIwIiB5MT0iMCIgeDI9IjEiIHkyPSIxIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzIyZDNlZSIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMzYjgyZjYiLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgPC9kZWZzPgoKICA8cmVjdCB4PSIyIiB5PSIyIiB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHJ4PSIxNCIgZmlsbD0idXJsKCNiZykiLz4KCiAgPHJlY3QgeD0iMjIiIHk9IjkiIHdpZHRoPSIyMCIgaGVpZ2h0PSI1IiByeD0iMi41IiBmaWxsPSIjOWNhM2FmIi8+CiAgPGNpcmNsZSBjeD0iMzIiIGN5PSI3IiByPSIzIiBmaWxsPSIjMjJkM2VlIi8+CgogIDxyZWN0IHg9IjE0IiB5PSIxNiIgd2lkdGg9IjM2IiBoZWlnaHQ9IjMyIiByeD0iOCIgZmlsbD0idXJsKCNmYWNlKSIvPgoKICA8Y2lyY2xlIGN4PSIyNSIgY3k9IjMxIiByPSI0LjgiIGZpbGw9IiMwZjE3MmEiLz4KICA8Y2lyY2xlIGN4PSIzOSIgY3k9IjMxIiByPSI0LjgiIGZpbGw9IiMwZjE3MmEiLz4KICA8Y2lyY2xlIGN4PSIyNSIgY3k9IjMxIiByPSIyIiBmaWxsPSIjOTNjNWZkIi8+CiAgPGNpcmNsZSBjeD0iMzkiIGN5PSIzMSIgcj0iMiIgZmlsbD0iIzkzYzVmZCIvPgoKICA8cmVjdCB4PSIyNCIgeT0iMzkiIHdpZHRoPSIxNiIgaGVpZ2h0PSIzLjYiIHJ4PSIxLjgiIGZpbGw9IiMwZjE3MmEiLz4KCiAgPHJlY3QgeD0iOSIgeT0iMjQiIHdpZHRoPSI1IiBoZWlnaHQ9IjE0IiByeD0iMi41IiBmaWxsPSIjNmI3MjgwIi8+CiAgPHJlY3QgeD0iNTAiIHk9IjI0IiB3aWR0aD0iNSIgaGVpZ2h0PSIxNCIgcng9IjIuNSIgZmlsbD0iIzZiNzI4MCIvPgo8L3N2Zz4K","base64");e.s(["GET",0,function(){return new t.NextResponse(i,{headers:{"Content-Type":"image/svg+xml","Cache-Control":"public, max-age=0, must-revalidate"}})},"dynamic",0,"force-static"])},18317,e=>{"use strict";var t=e.i(47909),i=e.i(74017),r=e.i(96250),a=e.i(59756),n=e.i(61916),l=e.i(74677),o=e.i(69741),s=e.i(16795),I=e.i(87718),c=e.i(95169),u=e.i(47587),d=e.i(66012),p=e.i(70101),g=e.i(26937),h=e.i(10372),C=e.i(93695),m=e.i(9580);e.i(52474);var v=e.i(220);let P=new t.AppRouteRouteModule({definition:{kind:i.f.APP_ROUTE,page:"/icon.svg/route",pathname:"/icon.svg",filename:"icon.svg--route-entry",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/apps/dashboard/src/app/icon.svg--route-entry.js",nextConfigOutput:"standalone",userland:()=>e.r(50567),...{}}),{workAsyncStorage:x,workUnitAsyncStorage:y,serverHooks:S}=P;async function w(e,t,i){i.requestMeta&&(0,a.R)(e,i.requestMeta),P.isDev&&(0,a.i)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let r="/icon.svg/route";r=r.replace(/\/index$/,"")||"/";let{instrumentation:l}=await P.ensureInstrumentation(e,{deferSpans:!0});return P.traceRequest(e,{tracer:(0,n.v)(),spanName:`${e.method||"GET"} ${r}`,httpTarget:e.url,instrumentation:l},(a,n)=>f(e,t,i,r,!1,a,n))}async function f(e,t,r,x,y,S,w){let f=await P.prepare(e,t,{srcPage:x,multiZoneDraftMode:y});if(!f)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:A,deploymentId:j,params:b,nextConfig:R,parsedUrl:Z,isDraftMode:M,prerenderManifest:N,routerServerContext:E,isOnDemandRevalidate:H,revalidateOnlyGenerated:B,resolvedPathname:T,clientReferenceManifest:D,serverActionsManifest:G,previewProps:k}=f,z=(0,o.f)(x),W=!!N.routes[T]&&(P.isDev||(0,m.f)(T,P.cacheOwner,N.routes[T])),Y=!!(N.dynamicRoutes[z]||W),O=async()=>((null==E?void 0:E.render404)?await E.render404(e,t,Z,!1):t.end("This page could not be found"),null);if(Y&&!M){let e=N.dynamicRoutes[z];if(e&&!1===e.fallback&&!W){if(R.adapterPath)return await O();throw new C.NoFallbackError}}let U=null;!Y||P.isDev||M||(U="/index"===(U=T)?"/":U),G&&D&&(0,l.f)({page:x,clientReferenceManifest:D,serverActionsManifest:G});let K=e.method||"GET",L=(0,n.v)(),J=!!(null==E?void 0:E.isWrappedByNextServer),Q=!!(0,a.w)(e,"minimalMode"),V=(0,a.w)(e,"incrementalCache")||await P.getIncrementalCache(e,R,k,N,Q);null==V||V.resetRequestCache(),globalThis.__incrementalCache=V;let q={params:b,previewProps:k,renderOpts:{experimental:{authInterrupts:!!R.experimental.authInterrupts,useCacheTimeout:R.experimental.useCacheTimeout,durableUseCacheEntries:!!R.experimental.durableUseCacheEntries},cacheComponents:!!R.cacheComponents,validationLevel:R.experimental.instantInsights.validationLevel,isDraftMode:M,incrementalCache:V,hmrRefreshHash:(0,a.w)(e,"hmrRefreshHash"),cacheLifeProfiles:R.cacheLife,staticPageGenerationTimeout:R.staticPageGenerationTimeout,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0},sharedContext:{buildId:A,deploymentId:j}},_=new s.x(e),F=new s.e(t),X=I.k.fromNodeNextRequest(_,(0,I.t)(t)),$=async({previousCacheEntry:i})=>{try{if(!Q&&H&&B&&!i)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=null===U?await P.handle(X,q):await P.prerender(X,q);e.fetchMetrics=q.renderOpts.fetchMetrics;let n=q.renderOpts.pendingWaitUntil;n&&r.waitUntil&&(r.waitUntil(n),n=void 0);let l=q.renderOpts.collectedTags;if(!Y)return await (0,d.f)(_,F,a,n),null;{let e=await a.blob(),t=(0,p.S)(a.headers);l&&(t[h.M]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let i=void 0!==q.renderOpts.collectedRevalidate&&!(q.renderOpts.collectedRevalidate>=h.Q)&&q.renderOpts.collectedRevalidate,r=void 0===q.renderOpts.collectedExpire||q.renderOpts.collectedExpire>=h.Q?!1!==i&&i>0?R.expireTime:void 0:q.renderOpts.collectedExpire;return{value:{kind:v.x.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:i,expire:r}}}}catch(t){throw(null==i?void 0:i.isStale)&&await P.onRequestError(e,t,{routerKind:"App Router",routePath:x,routeType:"route",revalidateReason:(0,u.f)({isStaticGeneration:null!==U,isOnDemandRevalidate:H})},!1,E),t}},ee=async a=>{try{var l,o;let a=await P.handleResponse({req:e,nextConfig:R,cacheKey:U,routeKind:i.f.APP_ROUTE,isFallback:!1,previewProps:k,prerenderManifest:N,isRoutePPREnabled:!1,isOnDemandRevalidate:H,revalidateOnlyGenerated:B,responseGenerator:$,waitUntil:r.waitUntil,isMinimalMode:Q});if(null!==a&&"error"in a)throw a.error;if(!Y)return;if((null==a||null==(l=a.value)?void 0:l.kind)!==v.x.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==a||null==(o=a.value)?void 0:o.kind}`);Q||t.setHeader("x-nextjs-cache",H?"REVALIDATED":a.isMiss?"MISS":a.isStale?"STALE":"HIT"),M&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let n=(0,p.G)(a.value.headers);Q&&Y||n.delete(h.M),!a.cacheControl||t.getHeader("Cache-Control")||n.get("Cache-Control")||n.set("Cache-Control",(0,g.f)(a.cacheControl)),await (0,d.f)(_,F,new Response(a.value.body,{headers:n,status:a.value.status||200}));return}catch(i){if(i instanceof C.NoFallbackError||await P.onRequestError(e,i,{routerKind:"App Router",routePath:z,routeType:"route",revalidateReason:(0,u.f)({isStaticGeneration:null!==U,isOnDemandRevalidate:H})},!1,E),Y)throw i;if(t.headersSent){if(a){let e=i instanceof Error?i:Error("Unknown app route error");a.recordException(e),a.setStatus({code:n.J.ERROR,message:e.message}),a.setAttribute("error.type",e.name)}t.writableEnded||t.destroyed||t.end()}else await (0,d.f)(_,F,new Response(null,{status:500}));return}finally{(()=>{if(!a)return;let e=t.statusCode;a.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(a.setStatus({code:n.J.ERROR}),a.setAttribute("error.type",e.toString()));let i=L.getRootSpanAttributes();if(!i)return;if(i.get("next.span_type")!==c.q.handleRequest)return console.warn(`Unexpected root span type '${i.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=i.get("next.route")||z,l=`${K} ${r}`;a.setAttributes({"next.route":r,"http.route":r,"next.span_name":l}),a.updateName(l),w&&w!==a&&(w.setAttribute("http.route",r),w.updateName(l))})()}};J||void 0===e.url||null==S||S.setAttribute("http.target",e.url),await ee(S)}e.s(["handler",0,w,"patchFetch",0,function(){return(0,r.f)({workAsyncStorage:x,workUnitAsyncStorage:y})},"routeModule",0,P,"serverHooks",0,S,"workAsyncStorage",0,x,"workUnitAsyncStorage",0,y])}];
2
2
 
3
3
  //# sourceMappingURL=_1j9ys57oirxn5._.js.map
@@ -1,4 +1,4 @@
1
1
  module.exports=[70055,e=>{"use strict";var t=e.i(89171),r=e.i(27721),a=e.i(54213),n=e.i(93458),s=e.i(30137),o=e.i(27147);class i extends Error{status;data;url;constructor(e,t,r,a){super(e),this.name="OrchestraFetchError",this.status=t,this.url=r,this.data=a}}async function l(){let e=await (0,n.cookies)(),t=e.get("magnus_active_node_id")?.value??"local";if("local"===t)return{id:"local"};if(!(await (0,o.D)()).some(e=>e.id===t))throw Error(`Selected control node '${t}' is unavailable`);return{id:t}}async function u(e){let t=await e.text().catch(()=>"");if(!t)return null;try{return JSON.parse(t)}catch{return t}}async function c(e,t){let r,a=await l(),n=`orchestra/${e.replace(/^\//,"")}`,o=new URL(`https://placeholder.invalid/api/v1/${n}`);!function(e,t){if(t){if(t instanceof URLSearchParams)return t.forEach((t,r)=>e.searchParams.append(r,t));for(let[r,a]of Object.entries(t))for(let t of Array.isArray(a)?a:[a])null!=t&&e.searchParams.append(r,String(t))}}(o,t?.searchParams);let c=new Headers(t?.headers),d=t?.body;null!=d&&("string"==typeof d||d instanceof ArrayBuffer||d instanceof Blob||d instanceof FormData||d instanceof URLSearchParams||d instanceof ReadableStream?r=d:(r=JSON.stringify(d),c.has("Content-Type")||c.set("Content-Type","application/json")));let h=await (0,s.d)(a.id,`${n}${o.search}`,{...t,body:r,headers:c,cache:"no-store"});if(!h.ok){let e=await u(h);throw new i(function(e,t){if(e&&"object"==typeof e){let t=e.error,r=e.message;if("string"==typeof t)return t;if("string"==typeof r)return r;if(t&&"object"==typeof t){let e=t.message;if("string"==typeof e)return e}}return"string"==typeof e&&e.trim()?e:`Orchestra fetch failed with HTTP ${t}`}(e,h.status),h.status,n,e)}return u(h)}var d=e.i(89779),h=e.i(47299),p=e.i(29072),f=e.i(66680),m=e.i(33909);e.i(2157);var y=e.i(12714),w=e.i(50227),g=e.i(72130);let v=new Set(["rejected_endpoint","invalid_session","rejected_origin","blocked_destination","connection_failed","connection_started","connection_closed","queue_pressure","backpressure","legacy_session_secret","host_key_mismatch"]),b=new Map;function E(e,t){return null==e?null:String(e).replace(/[\u0000-\u001f\u007f]/g," ").replace(/\b(authorization|cookie|password|passwd|secret|token|api[-_]?key)\s*[:=]\s*[^\s,;]+/gi,"$1=[REDACTED]").replace(/https?:\/\/[^\s/?#]+[^\s]*/gi,e=>{try{let t=new URL(e);return`${t.protocol}//${t.host}${t.pathname}`}catch{return"[REDACTED_URL]"}}).trim().slice(0,t)}async function x(e,t){await (0,y.mkdir)((0,w.dirname)(e),{recursive:!0,mode:448});try{(await (0,y.stat)(e)).size>=2097152&&await (0,y.rename)(e,`${e}.previous`)}catch(e){if(e?.code!=="ENOENT")throw e}await (0,y.appendFile)(e,t,{mode:384})}async function $(e,t){if(!t.running){for(t.running=!0;t.queue.length>0;){let r=t.queue.shift();(0,g.$)(-1);try{await x(e,r)}catch(e){console.error("[hermes-security] failed to record event",e)}}for(let e of(t.running=!1,t.waiters.splice(0)))e()}}function R(e,t={}){let r,a=function(e){var t;let r;if(!e||"object"!=typeof e||!v.has(e.type))return null;let a={timestamp:new Date("string"==typeof e.timestamp?e.timestamp:Date.now()).toISOString(),type:e.type};for(let t of["correlationId","installationId","nodeId","transport","direction"]){let r=function(e){let t=E(e,128);return t&&/^[A-Za-z0-9._:-]+$/.test(t)?t:null}(e[t]);r&&(a[t]=r)}let n=(t=e.hostname,(r=E(t,253)?.toLowerCase())?r.includes("@")||/[/?#]/.test(r)?"[REDACTED_HOST]":/^[a-z0-9](?:[a-z0-9.:-]*[a-z0-9])?$/.test(r)?r:"[INVALID_HOST]":null);n&&(a.hostname=n);let s=E(e.reason,256);s&&(a.reason=s);let o=function(e){let t=E(e,256);if(!t)return null;let r=t.split(/[?#]/,1)[0].replace(/\/{2,}/g,"/");return(r.startsWith("/")?r:`/${r}`).slice(0,256)}(e.path);for(let t of(o&&(a.path=o),null!=e.origin&&(a.origin=function(e){let t=E(e,512);if(!t)return null;try{let e=new URL(t);if(!["http:","https:"].includes(e.protocol)||e.username||e.password)return"[REDACTED_ORIGIN]";return e.origin.slice(0,256)}catch{return"[INVALID_ORIGIN]"}}(e.origin)),["durationMs","queuedBytes","backpressureDurationMs","peakBufferedBytes","droppedEvents"])){let r=function(e,t=Number.MAX_SAFE_INTEGER){let r=Number(e);return Number.isFinite(r)?Math.min(Math.max(Math.round(r),0),t):void 0}(e[t],t.endsWith("Bytes")?0x40000000:6048e5);void 0!==r&&(a[t]=r)}return a}(e);if(!a)return!1;let n=t.path??function(e=process.env){return e.HERMES_SECURITY_EVENT_PATH??(0,w.join)(process.cwd(),".magnus","hermes-proxy-security.jsonl")}(t.env),s=((r=b.get(n))||(r={queue:[],running:!1,dropped:0,waiters:[]},b.set(n,r)),r);return s.queue.length>=(t.maxPendingEvents??1e3)?(s.dropped+=1,(0,g.v)(),!1):(s.queue.push(`${JSON.stringify(a)}
2
- `),(0,g.$)(1),$(n,s),!0)}var _=e.i(33094);async function S(e,t=!1){let r,a,n=function(){let{username:e,password:t,privateKey:r}=(0,_.b)();return{username:e,password:t,privateKey:r}}();try{r=await (0,m.B)(e),t&&(a=(0,m.s)(e,r))}catch(r){let t=crypto.randomUUID();throw R({type:"blocked_destination",correlationId:t,installationId:e.id,nodeId:e.nodeId,hostname:e.hostname,reason:r instanceof Error?r.message:"destination_denied",transport:"http"}),Error(`Hermes SSH destination denied (correlation ${t})`,{cause:r})}let s=await (0,d._)(e.hostname,"hermes-http");return new Promise((t,o)=>{let i=new p.Client;i.once("close",()=>(0,d.G)(s));let l=!1,u=setTimeout(()=>{l||(l=!0,(0,d.G)(s),i.end(),o(Error(`Timed out connecting to ${e.hostname} over SSH`)))},15e3);i.on("ready",()=>{l||(l=!0,clearTimeout(u),t({conn:i,dashboardTarget:a}))}),i.on("error",e=>{(0,d.G)(s),l||(l=!0,clearTimeout(u),o(e))});try{i.connect({host:r.address,port:e.sshPort||22,username:n.username,...n.privateKey?{privateKey:n.privateKey}:{password:n.password??""},readyTimeout:12e3,hostVerifier:function(e,t={}){if(!Array.isArray(t.expectedFingerprints)||0===t.expectedFingerprints.length)throw Error(`Expected SSH host-key fingerprints are required for ${e}`);let r=new Set(t.expectedFingerprints);return a=>{let n,s=(n=Buffer.isBuffer(a)?a:Buffer.from(a),`SHA256:${(0,f.createHash)("sha256").update(n).digest("base64").replace(/=+$/,"")}`),o=r.has(s);return o||(console.error(`[ssh] host key mismatch for ${e}`),t.onMismatch?.({host:e,observedFingerprint:s})),o}}(`${e.id}:${e.nodeId}`,{expectedFingerprints:r.authorization.hostKeySha256,onMismatch:({observedFingerprint:t})=>{R({type:"host_key_mismatch",correlationId:crypto.randomUUID(),installationId:e.id,nodeId:e.nodeId,hostname:e.hostname,reason:`observed_${t}`,transport:"http"})}})})}catch(e){clearTimeout(u),(0,d.G)(s),o(e)}})}async function T(e){let{conn:t,dashboardTarget:r}=await S(e.installation,!0);try{let a=await function(e,t,r="127.0.0.1"){return new Promise((a,n)=>{e.forwardOut("127.0.0.1",0,r,t,(e,t)=>{e?n(e):(t.setNoDelay??=()=>t,t.setKeepAlive??=()=>t,t.setTimeout??=()=>t,a(t))})})}(t,r.port,r.address);return await new Promise((t,r)=>{let n=(0,h.request)({host:"127.0.0.1",port:e.installation.dashboardPort,path:`${e.upstreamPath}${e.search?`?${e.search}`:""}`,method:e.req.method,headers:function(e,t,r){let a={host:`127.0.0.1:${t}`,connection:"close","accept-encoding":"identity","x-forwarded-host":e.headers.get("host")??"magnus","x-forwarded-proto":e.nextUrl.protocol.replace(":","")};for(let t of["accept","content-type","user-agent","origin","referer"]){let r=e.headers.get(t);r&&(a[t]=r)}return{...a,...r??{}}}(e.req,e.installation.dashboardPort,e.headers),createConnection:()=>a,timeout:3e4},e=>{let r=[];e.on("data",e=>r.push(e)),e.on("end",()=>{t({status:e.statusCode??502,statusText:e.statusMessage??"",headers:e.headers,body:Buffer.concat(r)})})});n.on("timeout",()=>{n.destroy(Error("Hermes dashboard request timed out"))}),n.on("error",r),e.body&&n.write(e.body),n.end()})}finally{t.end()}}var A=e.i(32168);let I="/api/hermes/dashboard",U="magnus_hermes_dashboard_installation_id",P="magnus_hermes_dashboard_session_token",C=null,O=null;async function N(){if(C&&C.expiresAt>Date.now())return C.data;if(O)return O;O=(async()=>{let e=await c("installations"),t=(0,m.Q)(e.data);return C={data:t,expiresAt:Date.now()+5e3},t})();try{return await O}finally{O=null}}async function k(e){let n=e.cookies.get(a.B)?.value;return n&&await (0,r.L)(n)?null:t.NextResponse.json({error:"Unauthorized"},{status:401})}function D(e,t){let r=e.nextUrl.searchParams.get(t);return r&&r.trim()?r.trim():null}async function H(e){let t=D(e,"installationId"),r=D(e,"nodeId"),a=e.cookies.get(U)?.value??null;try{let e=(0,m.b)(await N(),t,r,a);return{target:e.installation?{installation:e.installation}:null,error:e.error}}catch(t){let e=crypto.randomUUID();return console.error(`[hermes-target:${e}] installation inventory failed`,t),{target:null,error:"control_api_unavailable"}}}function M(e,t){if(e.startsWith("api/"))return`${I}/${e}`;let r=e.includes("?")?"&":"?";return`${I}/${e}${r}installationId=${encodeURIComponent(t)}`}function j(e){let t=new Headers;return t.set("content-type",e),t.set("cache-control","no-cache, no-store"),t.set("content-security-policy","frame-ancestors 'self'"),t.set("x-frame-options","SAMEORIGIN"),t}function q(e,t,r){return t&&e.cookies.set(U,t.id,{httpOnly:!0,secure:!0,sameSite:"lax",path:"/"}),r&&e.cookies.set(P,r,{httpOnly:!0,secure:!0,sameSite:"lax",path:"/"}),e}async function L(e,{params:r}){let a,n=await k(e);if(n)return n;if(!(0,A.V)())return t.NextResponse.json({error:"Hermes Agent integration is not enabled. Set MAGNUS_HERMES_ENABLED=true to enable it."},{status:503});let{path:s}=await r,o=s?.join("/")??"",i=o?`/${o}`:"/",{target:l,error:u}=await H(e);if(!l)return t.NextResponse.json({success:!1,error:u??"installation_unavailable"},{status:"installation_required"===u?400:"control_api_unavailable"===u?502:404});let c=((a=new URLSearchParams(e.nextUrl.searchParams)).delete("installationId"),a.delete("nodeId"),a.toString()),d={},h=e.headers.get("accept");h&&(d.accept=h);let p=e.headers.get("content-type");p&&(d["content-type"]=p);let f=e.headers.get("authorization"),m=e.cookies.get(P)?.value??null;f?d.authorization=f:m&&(d.authorization=`Bearer ${m}`);let y={method:e.method,headers:d,cache:"no-store",redirect:"manual"};if("GET"!==e.method&&"HEAD"!==e.method){let t=await e.text().catch(()=>"");t&&(y.body=t)}try{let r=await T({installation:l.installation,req:e,upstreamPath:i,search:c,body:y.body,headers:d}),a=String(r.headers["content-type"]??"application/octet-stream");if(r.status>=300&&r.status<400){let a=r.headers.location;if("string"==typeof a){let n=t.NextResponse.redirect(function(e,t,r){try{let a=new URL(r,`http://127.0.0.1:${t.dashboardPort}`);if("127.0.0.1"!==a.hostname&&"localhost"!==a.hostname)return r;let n=e.nextUrl.clone();return n.pathname=`${I}${a.pathname}`,n.search=a.search,n.toString()}catch{return r}}(e,l.installation,a),r.status);return q(n,l.installation)}}if(a.includes("text/")||a.includes("javascript")||a.includes("json")){var w;let e=r.body.toString("utf-8"),n=a.includes("html")||a.includes("javascript")||a.includes("json")||a.includes("css");return q(new t.NextResponse(n?(w=l.installation.id,e.replaceAll("}/dashboard-plugins/${","}"+I+"/dashboard-plugins/${").replace(/(dashboard-plugins\/[^`"']+)([`"'])/g,(e,t,r)=>t.includes("installationId=")?`${t}${r}`:`${t}?installationId=${encodeURIComponent(w)}${r}`).replace(/\b(href|src|action)=(["'])\/(?!api\/hermes\/dashboard(?:\/|$))([^"']*)/g,(e,t,r,a)=>`${t}=${r}${M(a,w)}`).replace(/(["'`])\/(?!api\/hermes\/dashboard(?:\/|$))((?:api\/|ws(?:\/|$)|assets\/|dashboard-plugins\/|favicon\.ico)[^"'`]*)/g,(e,t,r)=>r.startsWith("api/hermes/dashboard")?`${t}/${r}`:`${t}${M(r,w)}`).replace(/url\((['"]?)\/(assets\/|fonts-terminal\/)([^)'"]+)\1\)/g,(e,t,r,a)=>`url(${t}${M(`${r}${a}`,w)}${t})`)):e,{status:r.status,statusText:r.statusText,headers:j(a)}),l.installation,e.match(/window\.__HERMES_SESSION_TOKEN__=\"([^\"]+)\"/)?.[1]??null)}return q(new t.NextResponse(new Uint8Array(r.body),{status:r.status,statusText:r.statusText,headers:j(a)}),l.installation)}catch(r){let e=crypto.randomUUID();return console.error(`[hermes-http:${e}] dashboard proxy failed`,r),t.NextResponse.json({success:!1,error:"hermes_proxy_unavailable",correlationId:e},{status:502,headers:{"x-correlation-id":e}})}}e.s(["DELETE",0,L,"GET",0,L,"PATCH",0,L,"POST",0,L,"PUT",0,L,"runtime",0,"nodejs"],70055)},22379,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),s=e.i(61916),o=e.i(74677),i=e.i(69741),l=e.i(16795),u=e.i(87718),c=e.i(95169),d=e.i(47587),h=e.i(66012),p=e.i(70101),f=e.i(74838),m=e.i(10372),y=e.i(93695),w=e.i(9580);e.i(52474);var g=e.i(220);let v=new t.AppRouteRouteModule({definition:{kind:r.f.APP_ROUTE,page:"/api/hermes/dashboard/[[...path]]/route",pathname:"/api/hermes/dashboard/[[...path]]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/apps/dashboard/src/app/api/hermes/dashboard/[[...path]]/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(70055),...{}}),{workAsyncStorage:b,workUnitAsyncStorage:E,serverHooks:x}=v;async function $(e,t,r){r.requestMeta&&(0,n.R)(e,r.requestMeta),v.isDev&&(0,n.i)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let a="/api/hermes/dashboard/[[...path]]/route";a=a.replace(/\/index$/,"")||"/";let{instrumentation:o}=await v.ensureInstrumentation(e,{deferSpans:!0});return v.traceRequest(e,{tracer:(0,s.v)(),spanName:`${e.method||"GET"} ${a}`,httpTarget:e.url,instrumentation:o},(n,s)=>R(e,t,r,a,!1,n,s))}async function R(e,t,a,b,E,x,$){let R=await v.prepare(e,t,{srcPage:b,multiZoneDraftMode:E});if(!R)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:_,deploymentId:S,params:T,nextConfig:A,parsedUrl:I,isDraftMode:U,prerenderManifest:P,routerServerContext:C,isOnDemandRevalidate:O,revalidateOnlyGenerated:N,resolvedPathname:k,clientReferenceManifest:D,serverActionsManifest:H,previewProps:M}=R,j=(0,i.f)(b),q=!!P.routes[k]&&(v.isDev||(0,w.f)(k,v.cacheOwner,P.routes[k])),L=!!(P.dynamicRoutes[j]||q),B=async()=>((null==C?void 0:C.render404)?await C.render404(e,t,I,!1):t.end("This page could not be found"),null);if(L&&!U){let e=P.dynamicRoutes[j];if(e&&!1===e.fallback&&!q){if(A.adapterPath)return await B();throw new y.NoFallbackError}}let G=null;!L||v.isDev||U||(G="/index"===(G=k)?"/":G),H&&D&&(0,o.f)({page:b,clientReferenceManifest:D,serverActionsManifest:H});let F=e.method||"GET",z=(0,s.v)(),K=!!(null==C?void 0:C.isWrappedByNextServer),V=!!(0,n.w)(e,"minimalMode"),W=(0,n.w)(e,"incrementalCache")||await v.getIncrementalCache(e,A,M,P,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let J={params:T,previewProps:M,renderOpts:{experimental:{authInterrupts:!!A.experimental.authInterrupts,useCacheTimeout:A.experimental.useCacheTimeout,durableUseCacheEntries:!!A.experimental.durableUseCacheEntries},cacheComponents:!!A.cacheComponents,validationLevel:A.experimental.instantInsights.validationLevel,isDraftMode:U,incrementalCache:W,hmrRefreshHash:(0,n.w)(e,"hmrRefreshHash"),cacheLifeProfiles:A.cacheLife,staticPageGenerationTimeout:A.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0},sharedContext:{buildId:_,deploymentId:S}},Q=new l.x(e),X=new l.e(t),Y=u.k.fromNodeNextRequest(Q,(0,u.t)(t)),Z=async({previousCacheEntry:r})=>{try{if(!V&&O&&N&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=null===G?await v.handle(Y,J):await v.prerender(Y,J);e.fetchMetrics=J.renderOpts.fetchMetrics;let s=J.renderOpts.pendingWaitUntil;s&&a.waitUntil&&(a.waitUntil(s),s=void 0);let o=J.renderOpts.collectedTags;if(!L)return await (0,h.f)(Q,X,n,s),null;{let e=await n.blob(),t=(0,p.S)(n.headers);o&&(t[m.M]=o),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==J.renderOpts.collectedRevalidate&&!(J.renderOpts.collectedRevalidate>=m.Q)&&J.renderOpts.collectedRevalidate,a=void 0===J.renderOpts.collectedExpire||J.renderOpts.collectedExpire>=m.Q?!1!==r&&r>0?A.expireTime:void 0:J.renderOpts.collectedExpire;return{value:{kind:g.x.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await v.onRequestError(e,t,{routerKind:"App Router",routePath:b,routeType:"route",revalidateReason:(0,d.f)({isStaticGeneration:null!==G,isOnDemandRevalidate:O})},!1,C),t}},ee=async n=>{try{var o,i;let n=await v.handleResponse({req:e,nextConfig:A,cacheKey:G,routeKind:r.f.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:P,isRoutePPREnabled:!1,isOnDemandRevalidate:O,revalidateOnlyGenerated:N,responseGenerator:Z,waitUntil:a.waitUntil,isMinimalMode:V});if(null!==n&&"error"in n)throw n.error;if(!L)return;if((null==n||null==(o=n.value)?void 0:o.kind)!==g.x.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==n||null==(i=n.value)?void 0:i.kind}`);V||t.setHeader("x-nextjs-cache",O?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),U&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let s=(0,p.G)(n.value.headers);V&&L||s.delete(m.M),!n.cacheControl||t.getHeader("Cache-Control")||s.get("Cache-Control")||s.set("Cache-Control",(0,f.f)(n.cacheControl)),await (0,h.f)(Q,X,new Response(n.value.body,{headers:s,status:n.value.status||200}));return}catch(r){if(r instanceof y.NoFallbackError||await v.onRequestError(e,r,{routerKind:"App Router",routePath:j,routeType:"route",revalidateReason:(0,d.f)({isStaticGeneration:null!==G,isOnDemandRevalidate:O})},!1,C),L)throw r;if(t.headersSent){if(n){let e=r instanceof Error?r:Error("Unknown app route error");n.recordException(e),n.setStatus({code:s.J.ERROR,message:e.message}),n.setAttribute("error.type",e.name)}t.writableEnded||t.destroyed||t.end()}else await (0,h.f)(Q,X,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:s.J.ERROR}),n.setAttribute("error.type",e.toString()));let r=z.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.q.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route")||j,o=`${F} ${a}`;n.setAttributes({"next.route":a,"http.route":a,"next.span_name":o}),n.updateName(o),$&&$!==n&&($.setAttribute("http.route",a),$.updateName(o))})()}};K||void 0===e.url||null==x||x.setAttribute("http.target",e.url),await ee(x)}e.s(["handler",0,$,"patchFetch",0,function(){return(0,a.f)({workAsyncStorage:b,workUnitAsyncStorage:E})},"routeModule",0,v,"serverHooks",0,x,"workAsyncStorage",0,b,"workUnitAsyncStorage",0,E])}];
2
+ `),(0,g.$)(1),$(n,s),!0)}var _=e.i(33094);async function S(e,t=!1){let r,a,n=function(){let{username:e,password:t,privateKey:r}=(0,_.b)();return{username:e,password:t,privateKey:r}}();try{r=await (0,m.B)(e),t&&(a=(0,m.s)(e,r))}catch(r){let t=crypto.randomUUID();throw R({type:"blocked_destination",correlationId:t,installationId:e.id,nodeId:e.nodeId,hostname:e.hostname,reason:r instanceof Error?r.message:"destination_denied",transport:"http"}),Error(`Hermes SSH destination denied (correlation ${t})`,{cause:r})}let s=await (0,d._)(e.hostname,"hermes-http");return new Promise((t,o)=>{let i=new p.Client;i.once("close",()=>(0,d.G)(s));let l=!1,u=setTimeout(()=>{l||(l=!0,(0,d.G)(s),i.end(),o(Error(`Timed out connecting to ${e.hostname} over SSH`)))},15e3);i.on("ready",()=>{l||(l=!0,clearTimeout(u),t({conn:i,dashboardTarget:a}))}),i.on("error",e=>{(0,d.G)(s),l||(l=!0,clearTimeout(u),o(e))});try{i.connect({host:r.address,port:e.sshPort||22,username:n.username,...n.privateKey?{privateKey:n.privateKey}:{password:n.password??""},readyTimeout:12e3,hostVerifier:function(e,t={}){if(!Array.isArray(t.expectedFingerprints)||0===t.expectedFingerprints.length)throw Error(`Expected SSH host-key fingerprints are required for ${e}`);let r=new Set(t.expectedFingerprints);return a=>{let n,s=(n=Buffer.isBuffer(a)?a:Buffer.from(a),`SHA256:${(0,f.createHash)("sha256").update(n).digest("base64").replace(/=+$/,"")}`),o=r.has(s);return o||(console.error(`[ssh] host key mismatch for ${e}`),t.onMismatch?.({host:e,observedFingerprint:s})),o}}(`${e.id}:${e.nodeId}`,{expectedFingerprints:r.authorization.hostKeySha256,onMismatch:({observedFingerprint:t})=>{R({type:"host_key_mismatch",correlationId:crypto.randomUUID(),installationId:e.id,nodeId:e.nodeId,hostname:e.hostname,reason:`observed_${t}`,transport:"http"})}})})}catch(e){clearTimeout(u),(0,d.G)(s),o(e)}})}async function T(e){let{conn:t,dashboardTarget:r}=await S(e.installation,!0);try{let a=await function(e,t,r="127.0.0.1"){return new Promise((a,n)=>{e.forwardOut("127.0.0.1",0,r,t,(e,t)=>{e?n(e):(t.setNoDelay??=()=>t,t.setKeepAlive??=()=>t,t.setTimeout??=()=>t,a(t))})})}(t,r.port,r.address);return await new Promise((t,r)=>{let n=(0,h.request)({host:"127.0.0.1",port:e.installation.dashboardPort,path:`${e.upstreamPath}${e.search?`?${e.search}`:""}`,method:e.req.method,headers:function(e,t,r){let a={host:`127.0.0.1:${t}`,connection:"close","accept-encoding":"identity","x-forwarded-host":e.headers.get("host")??"magnus","x-forwarded-proto":e.nextUrl.protocol.replace(":","")};for(let t of["accept","content-type","user-agent","origin","referer"]){let r=e.headers.get(t);r&&(a[t]=r)}return{...a,...r??{}}}(e.req,e.installation.dashboardPort,e.headers),createConnection:()=>a,timeout:3e4},e=>{let r=[];e.on("data",e=>r.push(e)),e.on("end",()=>{t({status:e.statusCode??502,statusText:e.statusMessage??"",headers:e.headers,body:Buffer.concat(r)})})});n.on("timeout",()=>{n.destroy(Error("Hermes dashboard request timed out"))}),n.on("error",r),e.body&&n.write(e.body),n.end()})}finally{t.end()}}var A=e.i(32168);let I="/api/hermes/dashboard",U="magnus_hermes_dashboard_installation_id",P="magnus_hermes_dashboard_session_token",C=null,O=null;async function N(){if(C&&C.expiresAt>Date.now())return C.data;if(O)return O;O=(async()=>{let e=await c("installations"),t=(0,m.Q)(e.data);return C={data:t,expiresAt:Date.now()+5e3},t})();try{return await O}finally{O=null}}async function k(e){let n=e.cookies.get(a.B)?.value;return n&&await (0,r.L)(n)?null:t.NextResponse.json({error:"Unauthorized"},{status:401})}function D(e,t){let r=e.nextUrl.searchParams.get(t);return r&&r.trim()?r.trim():null}async function H(e){let t=D(e,"installationId"),r=D(e,"nodeId"),a=e.cookies.get(U)?.value??null;try{let e=(0,m.b)(await N(),t,r,a);return{target:e.installation?{installation:e.installation}:null,error:e.error}}catch(t){let e=crypto.randomUUID();return console.error(`[hermes-target:${e}] installation inventory failed`,t),{target:null,error:"control_api_unavailable"}}}function M(e,t){if(e.startsWith("api/"))return`${I}/${e}`;let r=e.includes("?")?"&":"?";return`${I}/${e}${r}installationId=${encodeURIComponent(t)}`}function j(e){let t=new Headers;return t.set("content-type",e),t.set("cache-control","no-cache, no-store"),t.set("content-security-policy","frame-ancestors 'self'"),t.set("x-frame-options","SAMEORIGIN"),t}function q(e,t,r){return t&&e.cookies.set(U,t.id,{httpOnly:!0,secure:!0,sameSite:"lax",path:"/"}),r&&e.cookies.set(P,r,{httpOnly:!0,secure:!0,sameSite:"lax",path:"/"}),e}async function L(e,{params:r}){let a,n=await k(e);if(n)return n;if(!(0,A.V)())return t.NextResponse.json({error:"Hermes Agent integration is not enabled. Set MAGNUS_HERMES_ENABLED=true to enable it."},{status:503});let{path:s}=await r,o=s?.join("/")??"",i=o?`/${o}`:"/",{target:l,error:u}=await H(e);if(!l)return t.NextResponse.json({success:!1,error:u??"installation_unavailable"},{status:"installation_required"===u?400:"control_api_unavailable"===u?502:404});let c=((a=new URLSearchParams(e.nextUrl.searchParams)).delete("installationId"),a.delete("nodeId"),a.toString()),d={},h=e.headers.get("accept");h&&(d.accept=h);let p=e.headers.get("content-type");p&&(d["content-type"]=p);let f=e.headers.get("authorization"),m=e.cookies.get(P)?.value??null;f?d.authorization=f:m&&(d.authorization=`Bearer ${m}`);let y={method:e.method,headers:d,cache:"no-store",redirect:"manual"};if("GET"!==e.method&&"HEAD"!==e.method){let t=await e.text().catch(()=>"");t&&(y.body=t)}try{let r=await T({installation:l.installation,req:e,upstreamPath:i,search:c,body:y.body,headers:d}),a=String(r.headers["content-type"]??"application/octet-stream");if(r.status>=300&&r.status<400){let a=r.headers.location;if("string"==typeof a){let n=t.NextResponse.redirect(function(e,t,r){try{let a=new URL(r,`http://127.0.0.1:${t.dashboardPort}`);if("127.0.0.1"!==a.hostname&&"localhost"!==a.hostname)return r;let n=e.nextUrl.clone();return n.pathname=`${I}${a.pathname}`,n.search=a.search,n.toString()}catch{return r}}(e,l.installation,a),r.status);return q(n,l.installation)}}if(a.includes("text/")||a.includes("javascript")||a.includes("json")){var w;let e=r.body.toString("utf-8"),n=a.includes("html")||a.includes("javascript")||a.includes("json")||a.includes("css");return q(new t.NextResponse(n?(w=l.installation.id,e.replaceAll("}/dashboard-plugins/${","}"+I+"/dashboard-plugins/${").replace(/(dashboard-plugins\/[^`"']+)([`"'])/g,(e,t,r)=>t.includes("installationId=")?`${t}${r}`:`${t}?installationId=${encodeURIComponent(w)}${r}`).replace(/\b(href|src|action)=(["'])\/(?!api\/hermes\/dashboard(?:\/|$))([^"']*)/g,(e,t,r,a)=>`${t}=${r}${M(a,w)}`).replace(/(["'`])\/(?!api\/hermes\/dashboard(?:\/|$))((?:api\/|ws(?:\/|$)|assets\/|dashboard-plugins\/|favicon\.ico)[^"'`]*)/g,(e,t,r)=>r.startsWith("api/hermes/dashboard")?`${t}/${r}`:`${t}${M(r,w)}`).replace(/url\((['"]?)\/(assets\/|fonts-terminal\/)([^)'"]+)\1\)/g,(e,t,r,a)=>`url(${t}${M(`${r}${a}`,w)}${t})`)):e,{status:r.status,statusText:r.statusText,headers:j(a)}),l.installation,e.match(/window\.__HERMES_SESSION_TOKEN__=\"([^\"]+)\"/)?.[1]??null)}return q(new t.NextResponse(new Uint8Array(r.body),{status:r.status,statusText:r.statusText,headers:j(a)}),l.installation)}catch(r){let e=crypto.randomUUID();return console.error(`[hermes-http:${e}] dashboard proxy failed`,r),t.NextResponse.json({success:!1,error:"hermes_proxy_unavailable",correlationId:e},{status:502,headers:{"x-correlation-id":e}})}}e.s(["DELETE",0,L,"GET",0,L,"PATCH",0,L,"POST",0,L,"PUT",0,L,"runtime",0,"nodejs"],70055)},22379,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),s=e.i(61916),o=e.i(74677),i=e.i(69741),l=e.i(16795),u=e.i(87718),c=e.i(95169),d=e.i(47587),h=e.i(66012),p=e.i(70101),f=e.i(26937),m=e.i(10372),y=e.i(93695),w=e.i(9580);e.i(52474);var g=e.i(220);let v=new t.AppRouteRouteModule({definition:{kind:r.f.APP_ROUTE,page:"/api/hermes/dashboard/[[...path]]/route",pathname:"/api/hermes/dashboard/[[...path]]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/apps/dashboard/src/app/api/hermes/dashboard/[[...path]]/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(70055),...{}}),{workAsyncStorage:b,workUnitAsyncStorage:E,serverHooks:x}=v;async function $(e,t,r){r.requestMeta&&(0,n.R)(e,r.requestMeta),v.isDev&&(0,n.i)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let a="/api/hermes/dashboard/[[...path]]/route";a=a.replace(/\/index$/,"")||"/";let{instrumentation:o}=await v.ensureInstrumentation(e,{deferSpans:!0});return v.traceRequest(e,{tracer:(0,s.v)(),spanName:`${e.method||"GET"} ${a}`,httpTarget:e.url,instrumentation:o},(n,s)=>R(e,t,r,a,!1,n,s))}async function R(e,t,a,b,E,x,$){let R=await v.prepare(e,t,{srcPage:b,multiZoneDraftMode:E});if(!R)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:_,deploymentId:S,params:T,nextConfig:A,parsedUrl:I,isDraftMode:U,prerenderManifest:P,routerServerContext:C,isOnDemandRevalidate:O,revalidateOnlyGenerated:N,resolvedPathname:k,clientReferenceManifest:D,serverActionsManifest:H,previewProps:M}=R,j=(0,i.f)(b),q=!!P.routes[k]&&(v.isDev||(0,w.f)(k,v.cacheOwner,P.routes[k])),L=!!(P.dynamicRoutes[j]||q),B=async()=>((null==C?void 0:C.render404)?await C.render404(e,t,I,!1):t.end("This page could not be found"),null);if(L&&!U){let e=P.dynamicRoutes[j];if(e&&!1===e.fallback&&!q){if(A.adapterPath)return await B();throw new y.NoFallbackError}}let G=null;!L||v.isDev||U||(G="/index"===(G=k)?"/":G),H&&D&&(0,o.f)({page:b,clientReferenceManifest:D,serverActionsManifest:H});let F=e.method||"GET",z=(0,s.v)(),K=!!(null==C?void 0:C.isWrappedByNextServer),V=!!(0,n.w)(e,"minimalMode"),W=(0,n.w)(e,"incrementalCache")||await v.getIncrementalCache(e,A,M,P,V);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let J={params:T,previewProps:M,renderOpts:{experimental:{authInterrupts:!!A.experimental.authInterrupts,useCacheTimeout:A.experimental.useCacheTimeout,durableUseCacheEntries:!!A.experimental.durableUseCacheEntries},cacheComponents:!!A.cacheComponents,validationLevel:A.experimental.instantInsights.validationLevel,isDraftMode:U,incrementalCache:W,hmrRefreshHash:(0,n.w)(e,"hmrRefreshHash"),cacheLifeProfiles:A.cacheLife,staticPageGenerationTimeout:A.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0},sharedContext:{buildId:_,deploymentId:S}},Q=new l.x(e),X=new l.e(t),Y=u.k.fromNodeNextRequest(Q,(0,u.t)(t)),Z=async({previousCacheEntry:r})=>{try{if(!V&&O&&N&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=null===G?await v.handle(Y,J):await v.prerender(Y,J);e.fetchMetrics=J.renderOpts.fetchMetrics;let s=J.renderOpts.pendingWaitUntil;s&&a.waitUntil&&(a.waitUntil(s),s=void 0);let o=J.renderOpts.collectedTags;if(!L)return await (0,h.f)(Q,X,n,s),null;{let e=await n.blob(),t=(0,p.S)(n.headers);o&&(t[m.M]=o),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==J.renderOpts.collectedRevalidate&&!(J.renderOpts.collectedRevalidate>=m.Q)&&J.renderOpts.collectedRevalidate,a=void 0===J.renderOpts.collectedExpire||J.renderOpts.collectedExpire>=m.Q?!1!==r&&r>0?A.expireTime:void 0:J.renderOpts.collectedExpire;return{value:{kind:g.x.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await v.onRequestError(e,t,{routerKind:"App Router",routePath:b,routeType:"route",revalidateReason:(0,d.f)({isStaticGeneration:null!==G,isOnDemandRevalidate:O})},!1,C),t}},ee=async n=>{try{var o,i;let n=await v.handleResponse({req:e,nextConfig:A,cacheKey:G,routeKind:r.f.APP_ROUTE,isFallback:!1,previewProps:M,prerenderManifest:P,isRoutePPREnabled:!1,isOnDemandRevalidate:O,revalidateOnlyGenerated:N,responseGenerator:Z,waitUntil:a.waitUntil,isMinimalMode:V});if(null!==n&&"error"in n)throw n.error;if(!L)return;if((null==n||null==(o=n.value)?void 0:o.kind)!==g.x.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==n||null==(i=n.value)?void 0:i.kind}`);V||t.setHeader("x-nextjs-cache",O?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),U&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let s=(0,p.G)(n.value.headers);V&&L||s.delete(m.M),!n.cacheControl||t.getHeader("Cache-Control")||s.get("Cache-Control")||s.set("Cache-Control",(0,f.f)(n.cacheControl)),await (0,h.f)(Q,X,new Response(n.value.body,{headers:s,status:n.value.status||200}));return}catch(r){if(r instanceof y.NoFallbackError||await v.onRequestError(e,r,{routerKind:"App Router",routePath:j,routeType:"route",revalidateReason:(0,d.f)({isStaticGeneration:null!==G,isOnDemandRevalidate:O})},!1,C),L)throw r;if(t.headersSent){if(n){let e=r instanceof Error?r:Error("Unknown app route error");n.recordException(e),n.setStatus({code:s.J.ERROR,message:e.message}),n.setAttribute("error.type",e.name)}t.writableEnded||t.destroyed||t.end()}else await (0,h.f)(Q,X,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:s.J.ERROR}),n.setAttribute("error.type",e.toString()));let r=z.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.q.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route")||j,o=`${F} ${a}`;n.setAttributes({"next.route":a,"http.route":a,"next.span_name":o}),n.updateName(o),$&&$!==n&&($.setAttribute("http.route",a),$.updateName(o))})()}};K||void 0===e.url||null==x||x.setAttribute("http.target",e.url),await ee(x)}e.s(["handler",0,$,"patchFetch",0,function(){return(0,a.f)({workAsyncStorage:b,workUnitAsyncStorage:E})},"routeModule",0,v,"serverHooks",0,x,"workAsyncStorage",0,b,"workUnitAsyncStorage",0,E])}];
3
3
 
4
4
  //# sourceMappingURL=_1xodprib7qa_j._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[30480,e=>{"use strict";var t=e.i(89171),r=e.i(69464);async function a(){try{let e=await (0,r.m)(),a=t.NextResponse.redirect(e.url);return a.cookies.set("magnus_hive_state",e.state,{secure:!0,httpOnly:!0,sameSite:"lax",path:"/api/auth/hive/callback",maxAge:300}),a}catch{return t.NextResponse.json({error:"Hive login unavailable"},{status:503})}}e.s(["GET",0,a])},57504,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),i=e.i(61916),s=e.i(74677),o=e.i(69741),l=e.i(16795),u=e.i(87718),c=e.i(95169),d=e.i(47587),p=e.i(66012),h=e.i(70101),f=e.i(74838),v=e.i(10372),m=e.i(93695),w=e.i(9580);e.i(52474);var R=e.i(220);let x=new t.AppRouteRouteModule({definition:{kind:r.f.APP_ROUTE,page:"/api/auth/hive/start/route",pathname:"/api/auth/hive/start",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/apps/dashboard/src/app/api/auth/hive/start/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(30480),...{}}),{workAsyncStorage:g,workUnitAsyncStorage:y,serverHooks:E}=x;async function b(e,t,r){r.requestMeta&&(0,n.R)(e,r.requestMeta),x.isDev&&(0,n.i)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let a="/api/auth/hive/start/route";a=a.replace(/\/index$/,"")||"/";let{instrumentation:s}=await x.ensureInstrumentation(e,{deferSpans:!0});return x.traceRequest(e,{tracer:(0,i.v)(),spanName:`${e.method||"GET"} ${a}`,httpTarget:e.url,instrumentation:s},(n,i)=>C(e,t,r,a,!1,n,i))}async function C(e,t,a,g,y,E,b){let C=await x.prepare(e,t,{srcPage:g,multiZoneDraftMode:y});if(!C)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:T,deploymentId:A,params:P,nextConfig:O,parsedUrl:S,isDraftMode:U,prerenderManifest:k,routerServerContext:_,isOnDemandRevalidate:q,revalidateOnlyGenerated:I,resolvedPathname:M,clientReferenceManifest:N,serverActionsManifest:D,previewProps:H}=C,G=(0,o.f)(g),j=!!k.routes[M]&&(x.isDev||(0,w.f)(M,x.cacheOwner,k.routes[M])),L=!!(k.dynamicRoutes[G]||j),$=async()=>((null==_?void 0:_.render404)?await _.render404(e,t,S,!1):t.end("This page could not be found"),null);if(L&&!U){let e=k.dynamicRoutes[G];if(e&&!1===e.fallback&&!j){if(O.adapterPath)return await $();throw new m.NoFallbackError}}let B=null;!L||x.isDev||U||(B="/index"===(B=M)?"/":B),D&&N&&(0,s.f)({page:g,clientReferenceManifest:N,serverActionsManifest:D});let F=e.method||"GET",K=(0,i.v)(),J=!!(null==_?void 0:_.isWrappedByNextServer),Q=!!(0,n.w)(e,"minimalMode"),V=(0,n.w)(e,"incrementalCache")||await x.getIncrementalCache(e,O,H,k,Q);null==V||V.resetRequestCache(),globalThis.__incrementalCache=V;let W={params:P,previewProps:H,renderOpts:{experimental:{authInterrupts:!!O.experimental.authInterrupts,useCacheTimeout:O.experimental.useCacheTimeout,durableUseCacheEntries:!!O.experimental.durableUseCacheEntries},cacheComponents:!!O.cacheComponents,validationLevel:O.experimental.instantInsights.validationLevel,isDraftMode:U,incrementalCache:V,hmrRefreshHash:(0,n.w)(e,"hmrRefreshHash"),cacheLifeProfiles:O.cacheLife,staticPageGenerationTimeout:O.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0},sharedContext:{buildId:T,deploymentId:A}},z=new l.x(e),X=new l.e(t),Y=u.k.fromNodeNextRequest(z,(0,u.t)(t)),Z=async({previousCacheEntry:r})=>{try{if(!Q&&q&&I&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=null===B?await x.handle(Y,W):await x.prerender(Y,W);e.fetchMetrics=W.renderOpts.fetchMetrics;let i=W.renderOpts.pendingWaitUntil;i&&a.waitUntil&&(a.waitUntil(i),i=void 0);let s=W.renderOpts.collectedTags;if(!L)return await (0,p.f)(z,X,n,i),null;{let e=await n.blob(),t=(0,h.S)(n.headers);s&&(t[v.M]=s),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=v.Q)&&W.renderOpts.collectedRevalidate,a=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=v.Q?!1!==r&&r>0?O.expireTime:void 0:W.renderOpts.collectedExpire;return{value:{kind:R.x.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await x.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,d.f)({isStaticGeneration:null!==B,isOnDemandRevalidate:q})},!1,_),t}},ee=async n=>{try{var s,o;let n=await x.handleResponse({req:e,nextConfig:O,cacheKey:B,routeKind:r.f.APP_ROUTE,isFallback:!1,previewProps:H,prerenderManifest:k,isRoutePPREnabled:!1,isOnDemandRevalidate:q,revalidateOnlyGenerated:I,responseGenerator:Z,waitUntil:a.waitUntil,isMinimalMode:Q});if(null!==n&&"error"in n)throw n.error;if(!L)return;if((null==n||null==(s=n.value)?void 0:s.kind)!==R.x.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==n||null==(o=n.value)?void 0:o.kind}`);Q||t.setHeader("x-nextjs-cache",q?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),U&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let i=(0,h.G)(n.value.headers);Q&&L||i.delete(v.M),!n.cacheControl||t.getHeader("Cache-Control")||i.get("Cache-Control")||i.set("Cache-Control",(0,f.f)(n.cacheControl)),await (0,p.f)(z,X,new Response(n.value.body,{headers:i,status:n.value.status||200}));return}catch(r){if(r instanceof m.NoFallbackError||await x.onRequestError(e,r,{routerKind:"App Router",routePath:G,routeType:"route",revalidateReason:(0,d.f)({isStaticGeneration:null!==B,isOnDemandRevalidate:q})},!1,_),L)throw r;if(t.headersSent){if(n){let e=r instanceof Error?r:Error("Unknown app route error");n.recordException(e),n.setStatus({code:i.J.ERROR,message:e.message}),n.setAttribute("error.type",e.name)}t.writableEnded||t.destroyed||t.end()}else await (0,p.f)(z,X,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:i.J.ERROR}),n.setAttribute("error.type",e.toString()));let r=K.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.q.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route")||G,s=`${F} ${a}`;n.setAttributes({"next.route":a,"http.route":a,"next.span_name":s}),n.updateName(s),b&&b!==n&&(b.setAttribute("http.route",a),b.updateName(s))})()}};J||void 0===e.url||null==E||E.setAttribute("http.target",e.url),await ee(E)}e.s(["handler",0,b,"patchFetch",0,function(){return(0,a.f)({workAsyncStorage:g,workUnitAsyncStorage:y})},"routeModule",0,x,"serverHooks",0,E,"workAsyncStorage",0,g,"workUnitAsyncStorage",0,y])}];
1
+ module.exports=[30480,e=>{"use strict";var t=e.i(89171),r=e.i(69464);async function a(){try{let e=await (0,r.m)(),a=t.NextResponse.redirect(e.url);return a.cookies.set("magnus_hive_state",e.state,{secure:!0,httpOnly:!0,sameSite:"lax",path:"/api/auth/hive/callback",maxAge:300}),a}catch{return t.NextResponse.json({error:"Hive login unavailable"},{status:503})}}e.s(["GET",0,a])},57504,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),i=e.i(61916),s=e.i(74677),o=e.i(69741),l=e.i(16795),u=e.i(87718),c=e.i(95169),d=e.i(47587),p=e.i(66012),h=e.i(70101),f=e.i(26937),v=e.i(10372),m=e.i(93695),w=e.i(9580);e.i(52474);var R=e.i(220);let x=new t.AppRouteRouteModule({definition:{kind:r.f.APP_ROUTE,page:"/api/auth/hive/start/route",pathname:"/api/auth/hive/start",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/apps/dashboard/src/app/api/auth/hive/start/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(30480),...{}}),{workAsyncStorage:g,workUnitAsyncStorage:y,serverHooks:E}=x;async function b(e,t,r){r.requestMeta&&(0,n.R)(e,r.requestMeta),x.isDev&&(0,n.i)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let a="/api/auth/hive/start/route";a=a.replace(/\/index$/,"")||"/";let{instrumentation:s}=await x.ensureInstrumentation(e,{deferSpans:!0});return x.traceRequest(e,{tracer:(0,i.v)(),spanName:`${e.method||"GET"} ${a}`,httpTarget:e.url,instrumentation:s},(n,i)=>C(e,t,r,a,!1,n,i))}async function C(e,t,a,g,y,E,b){let C=await x.prepare(e,t,{srcPage:g,multiZoneDraftMode:y});if(!C)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:T,deploymentId:A,params:P,nextConfig:O,parsedUrl:S,isDraftMode:U,prerenderManifest:k,routerServerContext:_,isOnDemandRevalidate:q,revalidateOnlyGenerated:I,resolvedPathname:M,clientReferenceManifest:N,serverActionsManifest:D,previewProps:H}=C,G=(0,o.f)(g),j=!!k.routes[M]&&(x.isDev||(0,w.f)(M,x.cacheOwner,k.routes[M])),L=!!(k.dynamicRoutes[G]||j),$=async()=>((null==_?void 0:_.render404)?await _.render404(e,t,S,!1):t.end("This page could not be found"),null);if(L&&!U){let e=k.dynamicRoutes[G];if(e&&!1===e.fallback&&!j){if(O.adapterPath)return await $();throw new m.NoFallbackError}}let B=null;!L||x.isDev||U||(B="/index"===(B=M)?"/":B),D&&N&&(0,s.f)({page:g,clientReferenceManifest:N,serverActionsManifest:D});let F=e.method||"GET",K=(0,i.v)(),J=!!(null==_?void 0:_.isWrappedByNextServer),Q=!!(0,n.w)(e,"minimalMode"),V=(0,n.w)(e,"incrementalCache")||await x.getIncrementalCache(e,O,H,k,Q);null==V||V.resetRequestCache(),globalThis.__incrementalCache=V;let W={params:P,previewProps:H,renderOpts:{experimental:{authInterrupts:!!O.experimental.authInterrupts,useCacheTimeout:O.experimental.useCacheTimeout,durableUseCacheEntries:!!O.experimental.durableUseCacheEntries},cacheComponents:!!O.cacheComponents,validationLevel:O.experimental.instantInsights.validationLevel,isDraftMode:U,incrementalCache:V,hmrRefreshHash:(0,n.w)(e,"hmrRefreshHash"),cacheLifeProfiles:O.cacheLife,staticPageGenerationTimeout:O.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0},sharedContext:{buildId:T,deploymentId:A}},z=new l.x(e),X=new l.e(t),Y=u.k.fromNodeNextRequest(z,(0,u.t)(t)),Z=async({previousCacheEntry:r})=>{try{if(!Q&&q&&I&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=null===B?await x.handle(Y,W):await x.prerender(Y,W);e.fetchMetrics=W.renderOpts.fetchMetrics;let i=W.renderOpts.pendingWaitUntil;i&&a.waitUntil&&(a.waitUntil(i),i=void 0);let s=W.renderOpts.collectedTags;if(!L)return await (0,p.f)(z,X,n,i),null;{let e=await n.blob(),t=(0,h.S)(n.headers);s&&(t[v.M]=s),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=v.Q)&&W.renderOpts.collectedRevalidate,a=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=v.Q?!1!==r&&r>0?O.expireTime:void 0:W.renderOpts.collectedExpire;return{value:{kind:R.x.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await x.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,d.f)({isStaticGeneration:null!==B,isOnDemandRevalidate:q})},!1,_),t}},ee=async n=>{try{var s,o;let n=await x.handleResponse({req:e,nextConfig:O,cacheKey:B,routeKind:r.f.APP_ROUTE,isFallback:!1,previewProps:H,prerenderManifest:k,isRoutePPREnabled:!1,isOnDemandRevalidate:q,revalidateOnlyGenerated:I,responseGenerator:Z,waitUntil:a.waitUntil,isMinimalMode:Q});if(null!==n&&"error"in n)throw n.error;if(!L)return;if((null==n||null==(s=n.value)?void 0:s.kind)!==R.x.APP_ROUTE)throw Error(`Invariant: app-route received invalid cache entry ${null==n||null==(o=n.value)?void 0:o.kind}`);Q||t.setHeader("x-nextjs-cache",q?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),U&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let i=(0,h.G)(n.value.headers);Q&&L||i.delete(v.M),!n.cacheControl||t.getHeader("Cache-Control")||i.get("Cache-Control")||i.set("Cache-Control",(0,f.f)(n.cacheControl)),await (0,p.f)(z,X,new Response(n.value.body,{headers:i,status:n.value.status||200}));return}catch(r){if(r instanceof m.NoFallbackError||await x.onRequestError(e,r,{routerKind:"App Router",routePath:G,routeType:"route",revalidateReason:(0,d.f)({isStaticGeneration:null!==B,isOnDemandRevalidate:q})},!1,_),L)throw r;if(t.headersSent){if(n){let e=r instanceof Error?r:Error("Unknown app route error");n.recordException(e),n.setStatus({code:i.J.ERROR,message:e.message}),n.setAttribute("error.type",e.name)}t.writableEnded||t.destroyed||t.end()}else await (0,p.f)(z,X,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:i.J.ERROR}),n.setAttribute("error.type",e.toString()));let r=K.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.q.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route")||G,s=`${F} ${a}`;n.setAttributes({"next.route":a,"http.route":a,"next.span_name":s}),n.updateName(s),b&&b!==n&&(b.setAttribute("http.route",a),b.updateName(s))})()}};J||void 0===e.url||null==E||E.setAttribute("http.target",e.url),await ee(E)}e.s(["handler",0,b,"patchFetch",0,function(){return(0,a.f)({workAsyncStorage:g,workUnitAsyncStorage:y})},"routeModule",0,x,"serverHooks",0,E,"workAsyncStorage",0,g,"workUnitAsyncStorage",0,y])}];
2
2
 
3
3
  //# sourceMappingURL=_1xoy6p0t2si_y._.js.map
@@ -1,4 +1,4 @@
1
- module.exports=[27721,90823,94228,e=>{"use strict";let t;var r=e.i(66680),a=e.i(42512);let n="2026-10-01T00:00:00.000Z",i=!1;var s=e.i(33094);let o=()=>new TextEncoder().encode(function(e=process.env,t=Date.now()){if(e.SESSION_SECRET)return e.SESSION_SECRET;if(function(e=process.env,t=Date.now()){let r=!!e.SESSION_SECRET,a=!!e.JWT_SECRET,i="true"===e.ALLOW_LEGACY_SESSION_SECRET,s=t>=Date.parse(n);return{configured:r||a&&i&&!s,source:r?"dedicated":a&&i&&!s?"legacy_jwt_secret":"missing",legacyFallbackActive:!r&&a&&i&&!s,legacyFallbackAllowed:i&&!s,migrationDeadline:n}}(e,t).legacyFallbackActive)return i||(i=!0,console.error(`[SECURITY:HIGH] ALLOW_LEGACY_SESSION_SECRET=true is reusing JWT_SECRET for dashboard sessions; migrate before ${n}`)),e.JWT_SECRET;if(e.JWT_SECRET&&"true"!==e.ALLOW_LEGACY_SESSION_SECRET)throw Error("SESSION_SECRET is required; JWT_SECRET fallback requires ALLOW_LEGACY_SESSION_SECRET=true");if(e.JWT_SECRET)throw Error(`Legacy JWT_SECRET session fallback expired on ${n}`);throw Error("SESSION_SECRET is required")}());async function l(){return t||(t=new a.Redis(process.env.REDIS_URL??"redis://127.0.0.1:6379",{maxRetriesPerRequest:1,connectTimeout:2e3,commandTimeout:2500,enableOfflineQueue:!1})).on("error",()=>void 0),("connecting"===t.status||"connect"===t.status)&&await new Promise((e,r)=>{let a=()=>{t.off("error",n),e()},n=e=>{t.off("ready",a),r(e)};t.once("ready",a),t.once("error",n)}),t}function c(e){return`magnus_session:local:${(0,r.createHmac)("sha256",o()).update(e).digest("hex")}`}function d(){let e=(0,s.a)();return(0,r.createHmac)("sha256",o()).update(JSON.stringify([e.username,e.passwordHash??e.password,process.env.LOCAL_SESSION_GENERATION??""])).digest("hex")}let u=`
1
+ module.exports=[27721,33094,90823,94228,e=>{"use strict";let r;var t=e.i(66680),n=e.i(42512),i=e.i(2157);function a(e,r){let t=e[`${r}_B64`];if(null!=t){if(!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t))throw Error(`${r}_B64 is not valid base64`);return Buffer.from(t,"base64").toString("utf8")}return e[r]}function s(e=process.env){let r=a(e,"DASHBOARD_ADMIN_USERNAME"),t=a(e,"DASHBOARD_ADMIN_PASSWORD");if(r&&t)return{username:r,password:t,source:"dashboard-admin-password",version:2};let n=a(e,"DASHBOARD_ADMIN_PASSWORD_HASH");if(!!r!=!!n)throw Error("DASHBOARD_ADMIN_USERNAME and DASHBOARD_ADMIN_PASSWORD (or _HASH) must be configured together");if(r&&n){if(!n.startsWith("$argon2id$"))throw Error("DASHBOARD_ADMIN_PASSWORD_HASH must be an Argon2id hash");return{username:r,passwordHash:n,source:"dashboard-admin-hash",version:2}}throw Error("Dedicated dashboard administrator credentials are required (DASHBOARD_ADMIN_USERNAME with DASHBOARD_ADMIN_PASSWORD_HASH)")}function o(e=process.env){let r,t=e.DASHBOARD_SSH_USERNAME,n=e.DASHBOARD_SSH_PASSWORD,a=e.DASHBOARD_SSH_PRIVATE_KEY_PATH;if(!t||!n&&!a)throw Error("Dedicated dashboard SSH proxy credentials are required (DASHBOARD_SSH_USERNAME with DASHBOARD_SSH_PRIVATE_KEY_PATH or DASHBOARD_SSH_PASSWORD)");if(a){if(!(0,i.existsSync)(a))throw Error(`Dashboard SSH private key does not exist: ${a}`);r=(0,i.readFileSync)(a,"utf8")}return{username:t,password:n??"",privateKey:r,privateKeyPath:a,source:"dedicated"}}e.s(["t",0,function(e=process.env){let r=s(e),t=function(e){try{return o(e),!0}catch{return!1}}(e),n=null;if(e.DASHBOARD_ADMIN_CREDENTIAL_METADATA_B64)try{n=JSON.parse(Buffer.from(e.DASHBOARD_ADMIN_CREDENTIAL_METADATA_B64,"base64").toString("utf8"))}catch{throw Error("DASHBOARD_ADMIN_CREDENTIAL_METADATA_B64 is invalid")}let i="dashboard-admin-hash"===r.source&&null===n||"dashboard-admin-hash"===r.source&&n?.purpose==="dashboard-admin-login"&&n?.version===2&&n?.secretForm==="argon2id-hash"&&n?.reusableSecret===!1&&n?.fleetPasswordAuthenticationDisabled===!0&&n?.fingerprintsDiffer===!0||"dashboard-admin-password"===r.source;return{migrated:i,sshConfigured:t,loginSource:r.source,credentialVersion:r.version,metadata:n,warning:i?null:"CRITICAL: DASHBOARD_ADMIN_CREDENTIAL_METADATA_B64 does not prove the v2 credential separation"}},"a",0,s,"b",0,o],33094);let d=()=>new TextEncoder().encode(function(e=process.env){if(e.SESSION_SECRET)return e.SESSION_SECRET;throw Error(e.JWT_SECRET?"SESSION_SECRET is required; the JWT_SECRET session fallback was removed after it expired on 2026-10-01":"SESSION_SECRET is required")}());async function l(){return r||(r=new n.Redis(process.env.REDIS_URL??"redis://127.0.0.1:6379",{maxRetriesPerRequest:1,connectTimeout:2e3,commandTimeout:2500,enableOfflineQueue:!1})).on("error",()=>void 0),("connecting"===r.status||"connect"===r.status)&&await new Promise((e,t)=>{let n=()=>{r.off("error",i),e()},i=e=>{r.off("ready",n),t(e)};r.once("ready",n),r.once("error",i)}),r}function c(e){return`magnus_session:local:${(0,t.createHmac)("sha256",d()).update(e).digest("hex")}`}function A(){let e=s();return(0,t.createHmac)("sha256",d()).update(JSON.stringify([e.username,e.passwordHash??e.password,process.env.LOCAL_SESSION_GENERATION??""])).digest("hex")}let u=`
2
2
  local generation = redis.call('GET', KEYS[1]) or ARGV[1]
3
3
  redis.call('SET', KEYS[1], generation, 'EX', ARGV[4])
4
4
  local time = redis.call('TIME')
@@ -10,6 +10,6 @@ redis.call('ZADD', KEYS[2], now + ARGV[4] * 1000000, ARGV[2])
10
10
  redis.call('EXPIRE', KEYS[2], ARGV[4])
11
11
  redis.call('SET', KEYS[3], generation .. ':' .. ARGV[3], 'EX', ARGV[4])
12
12
  return generation
13
- `;async function E(e){let t=(0,r.randomUUID)(),a=c(e);return await (await l()).eval(u,3,`${a}:generation`,`${a}:sessions`,`${a}:session:${t}`,(0,r.randomUUID)(),t,d(),86400,Math.floor(Date.now()/1e3),`${a}:session:`),t}async function S(e){if("hive"===e.provider)return!0;if("string"!=typeof e.username||!e.sessionId||!/^[a-f0-9-]{36}$/.test(e.sessionId))return!1;let t=c(e.username),[r,a]=await (await l()).mget(`${t}:generation`,`${t}:session:${e.sessionId}`);return!!(r&&a===`${r}:${d()}`)}async function f(e,t=!1){if("hive"===e.provider)return;let a=c(e.username);t?await (await l()).set(`${a}:generation`,(0,r.randomUUID)(),"EX",86400):e.sessionId&&await (await l()).del(`${a}:session:${e.sessionId}`)}e.s(["t",0,E,"P",0,f,"x",0,S],90823),e.s([],94228);var w=e.i(63370),g=e.i(16760),m=e.i(83817),p=e.i(65466),R=e.i(32802),h=e.i(92449);async function T(e,t,r){let[a,n,i,s]=e,o="";if(void 0!==n){let e=(0,m.M)(p.p,n);n=e[0],o=(0,w.q)(e[1])}if(void 0!==i&&(i=(0,m.M)(p.p,i)[0]),!n&&!i)throw new p.p("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!(0,m.J)(n,i))throw new p.p("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let l={...n,...i};(0,m.h)(p.p,n);let c=(0,m.e)(n,(0,m.l)(p.p,m.U,s,n,l));c||r?.();let{alg:d}=l;if("string"!=typeof d||!d)throw new p.p('JWS "alg" (Algorithm) Header Parameter missing or invalid');let u=(0,g.l)(d),E="",S=a,f;if(c){let t=e[4];t?(E=t[0]??=(0,w.q)(a),S=t[1]??=(0,R.q)(E)):(E=(0,w.q)(a),f=R.h.encode(`${o}.${E}`))}f??=(0,R.w)((0,R.q)(o),(0,R.q)("."),S);let T=await (0,h.c)(await (0,h.X)(u,t,"sign"),u.subtle,"sign");u.minRsaBits&&(0,h.y)(u.alg,T);let _={signature:(0,w.q)(new Uint8Array(await crypto.subtle.sign(u.signing,T,f))),payload:E};return n&&(_.protected=o),i&&(_.header=i),[_,c]}async function _(e,t,r,a,n){let[i]=await T([e,t,void 0,r],a,n);return`${i.protected}.${i.payload}.${i.signature}`}var A=e.i(24472);let y=A.C;class I extends y{#e;setProtectedHeader(e){return(0,m.x)(this.#e,"setProtectedHeader"),this.#e=e,this}async sign(e,t){return _((0,A.w)(this),this.#e,t?.crit,e,()=>{throw new p.H("JWTs MUST NOT use unencoded payload")})}}var C=e.i(9939),v=e.i(54213);async function $(t,r){let a,n,i;try{let e=(0,s.a)();a=e.username,n=e.password,i=e.passwordHash}catch{return!1}let{timingSafeEqual:o}=await e.A(70729),l=Buffer.from(t),c=Buffer.from(a),d=l.length===c.length&&o(l,c),u=!1;if(i){let{verify:t}=await e.A(777);u=await t(i,r).catch(()=>!1)}else if(null!=n){let e=Buffer.from(r),t=Buffer.from(n);u=e.length===t.length&&o(e,t)}return d&&u}async function O(e,t){let r=t?.provider==="hive"?t.sessionId:await E(e);return new I({username:e,...t,sessionId:r}).setProtectedHeader({alg:"HS256"}).setIssuer(v.W).setAudience(v.m).setIssuedAt().setExpirationTime(`${v.E}s`).sign((0,v._)())}async function H(e,t=!1){let r;try{let{payload:t}=await (0,C.f)(e,(0,v._)(),(0,v.c)());r=t}catch{return null}try{return await S(r)?r:null}catch(e){if(t)throw e;return null}}e.s(["z",0,O,"K",0,$,"L",0,H],27721)}];
13
+ `;async function S(e){let r=(0,t.randomUUID)(),n=c(e);return await (await l()).eval(u,3,`${n}:generation`,`${n}:sessions`,`${n}:session:${r}`,(0,t.randomUUID)(),r,A(),86400,Math.floor(Date.now()/1e3),`${n}:session:`),r}async function f(e){if("hive"===e.provider)return!0;if("string"!=typeof e.username||!e.sessionId||!/^[a-f0-9-]{36}$/.test(e.sessionId))return!1;let r=c(e.username),[t,n]=await (await l()).mget(`${r}:generation`,`${r}:session:${e.sessionId}`);return!!(t&&n===`${t}:${A()}`)}async function E(e,r=!1){if("hive"===e.provider)return;let n=c(e.username);r?await (await l()).set(`${n}:generation`,(0,t.randomUUID)(),"EX",86400):e.sessionId&&await (await l()).del(`${n}:session:${e.sessionId}`)}e.s(["t",0,S,"P",0,E,"x",0,f],90823),e.s([],94228);var D=e.i(63370),h=e.i(16760),_=e.i(83817),R=e.i(65466),w=e.i(32802),H=e.i(92449);async function p(e,r,t){let[n,i,a,s]=e,o="";if(void 0!==i){let e=(0,_.M)(R.p,i);i=e[0],o=(0,D.q)(e[1])}if(void 0!==a&&(a=(0,_.M)(R.p,a)[0]),!i&&!a)throw new R.p("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!(0,_.J)(i,a))throw new R.p("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let d={...i,...a};(0,_.h)(R.p,i);let l=(0,_.e)(i,(0,_.l)(R.p,_.U,s,i,d));l||t?.();let{alg:c}=d;if("string"!=typeof c||!c)throw new R.p('JWS "alg" (Algorithm) Header Parameter missing or invalid');let A=(0,h.l)(c),u="",S=n,f;if(l){let r=e[4];r?(u=r[0]??=(0,D.q)(n),S=r[1]??=(0,w.q)(u)):(u=(0,D.q)(n),f=w.h.encode(`${o}.${u}`))}f??=(0,w.w)((0,w.q)(o),(0,w.q)("."),S);let E=await (0,H.c)(await (0,H.X)(A,r,"sign"),A.subtle,"sign");A.minRsaBits&&(0,H.y)(A.alg,E);let p={signature:(0,D.q)(new Uint8Array(await crypto.subtle.sign(A.signing,E,f))),payload:u};return i&&(p.protected=o),a&&(p.header=a),[p,l]}async function m(e,r,t,n,i){let[a]=await p([e,r,void 0,t],n,i);return`${a.protected}.${a.payload}.${a.signature}`}var g=e.i(24472);let I=g.C;class O extends I{#e;setProtectedHeader(e){return(0,_.x)(this.#e,"setProtectedHeader"),this.#e=e,this}async sign(e,r){return m((0,g.w)(this),this.#e,r?.crit,e,()=>{throw new R.H("JWTs MUST NOT use unencoded payload")})}}var T=e.i(9939),N=e.i(54213);async function v(r,t){let n,i,a;try{let e=s();n=e.username,i=e.password,a=e.passwordHash}catch{return!1}let{timingSafeEqual:o}=await e.A(70729),d=Buffer.from(r),l=Buffer.from(n),c=d.length===l.length&&o(d,l),A=!1;if(a){let{verify:r}=await e.A(777);A=await r(a,t).catch(()=>!1)}else if(null!=i){let e=Buffer.from(t),r=Buffer.from(i);A=e.length===r.length&&o(e,r)}return c&&A}async function B(e,r){let t=r?.provider==="hive"?r.sessionId:await S(e);return new O({username:e,...r,sessionId:t}).setProtectedHeader({alg:"HS256"}).setIssuer(N.W).setAudience(N.m).setIssuedAt().setExpirationTime(`${N.E}s`).sign((0,N._)())}async function y(e,r=!1){let t;try{let{payload:r}=await (0,T.f)(e,(0,N._)(),(0,N.c)());t=r}catch{return null}try{return await f(t)?t:null}catch(e){if(r)throw e;return null}}e.s(["z",0,B,"K",0,v,"L",0,y],27721)}];
14
14
 
15
15
  //# sourceMappingURL=apps_dashboard_src_lib_auth_ts_1hhq1tq6hjj-e._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[69464,e=>{"use strict";let t,r;var i=e.i(66680),n=e.i(65466),o=e.i(92449),a=e.i(16760),s=e.i(83817);async function c(e,t,r){let i=e.get(t)||e.set(t,{}).get(t),{alg:a}=r;if(void 0===i[a]){let e=(0,o.e)(r,t,!0).then(e=>{if("public"!==e.type)throw new n.P("JSON Web Key Set members must be public keys");return i[a]=e,e}).catch(t=>{throw i[a]===e&&delete i[a],t});i[a]=e}return i[a]}function u(e){let t;try{t=structuredClone(e)}catch(e){throw new n.P("JSON Web Key Set malformed",{cause:e})}if(!(0,s.q)(t))throw new n.P("JSON Web Key Set malformed");let r=t.keys.map(e=>{let t=(0,o.C)(e);return Array.isArray(t.key_ops)&&(t.key_ops=[...t.key_ops]),t}),i=new WeakMap;return Object.defineProperty(async(e,o)=>{let{alg:s,kid:u}={...e,...o?.header},l="string"==typeof s?a.K[s]:void 0;if(!l||l.secret)throw new n.u('Unsupported "alg" value for a JSON Web Key Set');let d=t.keys.filter((e,t)=>(function(e,t,r,i){let{kty:n,key_ops:o,ext:a,kid:s,alg:c,use:u,crv:l}=e;return(void 0===a||"boolean"==typeof a)&&(void 0===o||Array.isArray(o)&&o.every((e,t)=>"string"==typeof e&&o.indexOf(e)===t)&&o.includes("verify"))&&t.kty.includes(n)&&(void 0===i||"string"==typeof i&&i===s)&&(void 0===c?"AKP"!==n:r===c)&&(void 0===u||"sig"===u)&&(!t.crv||l===t.crv)})(r[t],l,s,u)),{0:f,length:h}=d;if(!h)throw new n.W;if(1!==h){let e=new n.o;throw e[Symbol.asyncIterator]=async function*(){for(let e of d)try{yield await c(i,e,l)}catch{}},e}return c(i,f,l)},"jwks",{value:()=>structuredClone(t)})}(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(t="jose/v6.2.17");let l=Symbol();async function d(e,t,r,i=fetch){let o=await i(e,{method:"GET",signal:r,redirect:"manual",headers:t}).catch(e=>{throw"TimeoutError"===e.name?new n.B(void 0,{cause:e}):e});if(200!==o.status)throw new n.J("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await o.json()}catch(e){throw new n.J("Failed to parse the JSON Web Key Set HTTP response as JSON",{cause:e})}}let f=Symbol();function h(e,t){return Number.isFinite(e)&&Date.now()<e+t}function p(e,t,r){if(Number.isNaN(e))throw TypeError(`"${r}" option must not be NaN`);if("number"==typeof e&&e<0)throw TypeError(`"${r}" option must not be negative`);return"number"==typeof e?e:t}var w=e.i(9939),y=e.i(42512),v=e.i(54213),g=e.i(32168);async function m(){let e=(r||(r=new y.Redis(process.env.REDIS_URL??"redis://127.0.0.1:6379",{maxRetriesPerRequest:1,enableOfflineQueue:!1,lazyConnect:!0})).on("error",()=>void 0),r);return"wait"===e.status&&await e.connect(),e}let E=()=>(0,i.createHash)("sha256").update("magnus:hive-session:v1\0").update((0,v._)()).digest();function b(e,t){let r=(0,i.randomBytes)(12),n=(0,i.createCipheriv)("aes-256-gcm",E(),r);n.setAAD(Buffer.from(t));let o=Buffer.concat([n.update(JSON.stringify(e)),n.final()]);return Buffer.concat([r,n.getAuthTag(),o]).toString("base64url")}function _(e,t){let r=Buffer.from(e,"base64url"),n=(0,i.createDecipheriv)("aes-256-gcm",E(),r.subarray(0,12));return n.setAAD(Buffer.from(t)),n.setAuthTag(r.subarray(12,28)),JSON.parse(Buffer.concat([n.update(r.subarray(28)),n.final()]).toString("utf8"))}function A(){return(0,g.r)(process.env)}async function I(e,t){let r=await fetch(e,{...t,redirect:"error",signal:AbortSignal.timeout(8e3),cache:"no-store"}),i=r.body?.getReader();if(!i)throw Error(r.ok?"Empty Hive response":"Hive identity request failed");let n=[],o=0;try{for(;;){let e=await i.read();if(e.done)break;if((o+=e.value.byteLength)>65536)throw Error("Hive identity response too large");n.push(e.value)}}finally{await i.cancel()}let a=Buffer.concat(n).toString("utf8");if(!r.ok){if(401===r.status&&"invalid_client"===function(e){try{return JSON.parse(e)?.error}catch{return}}(a))throw new S;throw Error("Hive identity request failed")}return JSON.parse(a)}class S extends Error{constructor(){super("Hive IAM refused the OAuth client credentials (invalid_client). A client registered as confidential must authenticate when it exchanges the authorization code: set HIVE_OAUTH_CLIENT_SECRET to its secret, or register HIVE_OAUTH_CLIENT_ID as a public PKCE client and leave the secret unset."),this.name="HiveClientRejected"}}async function H(){let e=function(){if(!A())throw Error("Hive login is not configured");let e=new URL(process.env.HIVE_OAUTH_DISCOVERY_URL),t=new URL(process.env.DASHBOARD_PUBLIC_ORIGIN);if([e,t].some(e=>"https:"!==e.protocol||e.username||e.password||e.hash))throw Error("Hive login requires HTTPS");return{discovery:e,origin:t,clientId:process.env.HIVE_OAUTH_CLIENT_ID,issuer:process.env.HIVE_OAUTH_ISSUER,audience:process.env.HIVE_OAUTH_API_AUDIENCE,callback:`${t.origin}/api/auth/hive/callback`}}(),t=await I(e.discovery.toString());if(t.issuer!==e.issuer)throw Error("Hive issuer mismatch");for(let r of["authorization_endpoint","token_endpoint","jwks_uri"]){if("string"!=typeof t[r])throw Error("Incomplete Hive discovery");let i=new URL(t[r]);if(i.origin!==e.discovery.origin||i.username||i.password)throw Error("Unexpected Hive endpoint origin")}return{config:e,doc:t}}async function k(){let{config:e,doc:t}=await H(),r=(0,i.randomBytes)(32).toString("base64url"),n=(0,i.randomBytes)(32).toString("base64url");await (await m()).set(`magnus:hive:oauth:${r}`,b({verifier:n,callback:e.callback},r),"EX",300);let o=new URL(t.authorization_endpoint);return o.search=new URLSearchParams({response_type:"code",client_id:e.clientId,redirect_uri:e.callback,scope:process.env.HIVE_OAUTH_SCOPE??"openid profile email",state:r,code_challenge:(0,i.createHash)("sha256").update(n).digest("base64url"),code_challenge_method:"S256"}).toString(),{state:r,url:o.toString()}}async function O(e,r){if(!/^[A-Za-z0-9_-]{43}$/.test(e)||!r||r.length>4096)throw Error("Invalid OAuth callback");let o=await (await m()).getdel(`magnus:hive:oauth:${e}`);if(!o)throw Error("OAuth state expired or already consumed");let a=_(o,e),{config:c,doc:y}=await H();if(a.callback!==c.callback)throw Error("Callback configuration changed");let v=await I(y.token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"authorization_code",code:r,client_id:c.clientId,redirect_uri:c.callback,code_verifier:a.verifier,...process.env.HIVE_OAUTH_CLIENT_SECRET?{client_secret:process.env.HIVE_OAUTH_CLIENT_SECRET}:{}})});if("string"!=typeof v.access_token)throw Error("Missing Hive access token");let{payload:g}=await (0,w.f)(v.access_token,function(e){if(!(e instanceof URL))throw TypeError("url must be an instance of URL");let r=new URL(e.href).href,i=(void 0)??{},o=i.timeoutDuration;if("number"==typeof o&&(!Number.isInteger(o)||o<0))throw TypeError('"timeoutDuration" option must be a non-negative integer');let a="number"==typeof o?o:5e3,c=p(i.cooldownDuration,3e4,"cooldownDuration"),w=p(i.cacheMaxAge,6e5,"cacheMaxAge"),y=new Headers(i.headers);t&&!y.has("User-Agent")&&y.set("User-Agent",t),y.has("accept")||y.set("accept","application/json, application/jwk-set+json");let v=i[l],g=i[f],m,E,b=0,_=0,A;if(g&&"object"==typeof g){let{uat:e,jwks:t}=g;h(e,w)&&(0,s.q)(t)&&(m=e,A=u(t))}let I=async()=>{if(E&&("u">typeof WebSocketPair||"u">typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"u">typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(E=void 0),!E){let e=++b,t=E=d(r,y,AbortSignal.timeout(a),v).then(t=>{let r=u(t);if(e<=_)return;A=r;let i=Date.now();g&&(g.uat=i,g.jwks=t),m=i,_=e}).finally(()=>{E===t&&(E=void 0)})}await E};return Object.defineProperties(async(e,t)=>{A&&h(m,w)||await I();try{return await A(e,t)}catch(r){if(r instanceof n.W&&!h(m,c))return await I(),A(e,t);throw r}},{coolingDown:{get:()=>h(m,c),enumerable:!0},fresh:{get:()=>h(m,w),enumerable:!0},reload:{value:I,enumerable:!0},reloading:{get:()=>!!E,enumerable:!0},jwks:{value:()=>A?.jwks(),enumerable:!0}})}(new URL(y.jwks_uri)),{algorithms:["RS256"],issuer:c.issuer,audience:c.audience});if(!g.sub||!g.exp||"SERVICE_ACCOUNT"===g.actorType)throw Error("Named user identity required");let E=Math.min(3600,g.exp-Math.floor(Date.now()/1e3));if(E<=0)throw Error("Hive session expired");let A=(0,i.randomBytes)(32).toString("base64url");return await (await m()).set(`magnus:hive:session:${A}`,b({accessToken:v.access_token,userId:g.sub,expiresAt:g.exp},A),"EX",E),{username:String(g.preferred_username??g.sub),userId:g.sub,role:function(e){for(let t of Array.isArray(e)?e:[]){if("SUPER_ADMIN"===t||"IAM_ADMIN"===t)return"ADMIN";if("OPERATOR"===t)return"OPERATOR";if("VIEWER"===t)break}return"VIEWER"}(g.roles),provider:"hive",sessionId:A,ttl:E}}async function R(e,t){if("hive"!==e.provider)return null;if(!e.sessionId||!/^[A-Za-z0-9_-]{43}$/.test(e.sessionId))throw Error("Invalid Hive session");let r=new URL(process.env.CONTROL_API_URL);if(new URL(t).origin!==r.origin)throw Error("Hive delegation is limited to the canonical Control API");let i=await (await m()).get(`magnus:hive:session:${e.sessionId}`);if(!i)throw Error("Hive session expired");let n=_(i,e.sessionId);if(n.userId!==e.userId||n.expiresAt<=Date.now()/1e3)throw Error("Hive session identity expired");return n.accessToken}async function T(e){"hive"===e.provider&&e.sessionId&&await (await m()).del(`magnus:hive:session:${e.sessionId}`)}e.s(["V",0,S,"m",0,k,"N",0,O,"o",0,R,"r",0,A,"D",0,T],69464)}];
1
+ module.exports=[69464,e=>{"use strict";let t,r;var i=e.i(66680),n=e.i(65466),o=e.i(92449),a=e.i(16760),s=e.i(83817);async function c(e,t,r){let i=e.get(t)||e.set(t,{}).get(t),{alg:a}=r;if(void 0===i[a]){let e=(0,o.e)(r,t,!0).then(e=>{if("public"!==e.type)throw new n.P("JSON Web Key Set members must be public keys");return i[a]=e,e}).catch(t=>{throw i[a]===e&&delete i[a],t});i[a]=e}return i[a]}function u(e){let t;try{t=structuredClone(e)}catch(e){throw new n.P("JSON Web Key Set malformed",{cause:e})}if(!(0,s.q)(t))throw new n.P("JSON Web Key Set malformed");let r=t.keys.map(e=>{let t=(0,o.C)(e);return Array.isArray(t.key_ops)&&(t.key_ops=[...t.key_ops]),t}),i=new WeakMap;return Object.defineProperty(async(e,o)=>{let{alg:s,kid:u}={...e,...o?.header},l="string"==typeof s?a.K[s]:void 0;if(!l||l.secret)throw new n.u('Unsupported "alg" value for a JSON Web Key Set');let d=t.keys.filter((e,t)=>(function(e,t,r,i){let{kty:n,key_ops:o,ext:a,kid:s,alg:c,use:u,crv:l}=e;return(void 0===a||"boolean"==typeof a)&&(void 0===o||Array.isArray(o)&&o.every((e,t)=>"string"==typeof e&&o.indexOf(e)===t)&&o.includes("verify"))&&t.kty.includes(n)&&(void 0===i||"string"==typeof i&&i===s)&&(void 0===c?"AKP"!==n:r===c)&&(void 0===u||"sig"===u)&&(!t.crv||l===t.crv)})(r[t],l,s,u)),{0:f,length:h}=d;if(!h)throw new n.W;if(1!==h){let e=new n.o;throw e[Symbol.asyncIterator]=async function*(){for(let e of d)try{yield await c(i,e,l)}catch{}},e}return c(i,f,l)},"jwks",{value:()=>structuredClone(t)})}(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(t="jose/v6.2.18");let l=Symbol();async function d(e,t,r,i=fetch){let o=await i(e,{method:"GET",signal:r,redirect:"manual",headers:t}).catch(e=>{throw"TimeoutError"===e.name?new n.B(void 0,{cause:e}):e});if(200!==o.status)throw new n.J("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await o.json()}catch(e){throw r.aborted?new n.B(void 0,{cause:e}):new n.J("Failed to parse the JSON Web Key Set HTTP response as JSON",{cause:e})}}let f=Symbol();function h(e,t){return Number.isFinite(e)&&Date.now()<e+t}function p(e,t,r){if(Number.isNaN(e))throw TypeError(`"${r}" option must not be NaN`);if("number"==typeof e&&e<0)throw TypeError(`"${r}" option must not be negative`);return"number"==typeof e?e:t}var w=e.i(9939),y=e.i(42512),v=e.i(54213),g=e.i(32168);async function m(){let e=(r||(r=new y.Redis(process.env.REDIS_URL??"redis://127.0.0.1:6379",{maxRetriesPerRequest:1,enableOfflineQueue:!1,lazyConnect:!0})).on("error",()=>void 0),r);return"wait"===e.status&&await e.connect(),e}let b=()=>(0,i.createHash)("sha256").update("magnus:hive-session:v1\0").update((0,v._)()).digest();function E(e,t){let r=(0,i.randomBytes)(12),n=(0,i.createCipheriv)("aes-256-gcm",b(),r);n.setAAD(Buffer.from(t));let o=Buffer.concat([n.update(JSON.stringify(e)),n.final()]);return Buffer.concat([r,n.getAuthTag(),o]).toString("base64url")}function _(e,t){let r=Buffer.from(e,"base64url"),n=(0,i.createDecipheriv)("aes-256-gcm",b(),r.subarray(0,12));return n.setAAD(Buffer.from(t)),n.setAuthTag(r.subarray(12,28)),JSON.parse(Buffer.concat([n.update(r.subarray(28)),n.final()]).toString("utf8"))}function A(){return(0,g.r)(process.env)}async function I(e,t){let r=await fetch(e,{...t,redirect:"error",signal:AbortSignal.timeout(8e3),cache:"no-store"}),i=r.body?.getReader();if(!i)throw Error(r.ok?"Empty Hive response":"Hive identity request failed");let n=[],o=0;try{for(;;){let e=await i.read();if(e.done)break;if((o+=e.value.byteLength)>65536)throw Error("Hive identity response too large");n.push(e.value)}}finally{await i.cancel()}let a=Buffer.concat(n).toString("utf8");if(!r.ok){if(401===r.status&&"invalid_client"===function(e){try{return JSON.parse(e)?.error}catch{return}}(a))throw new S;throw Error("Hive identity request failed")}return JSON.parse(a)}class S extends Error{constructor(){super("Hive IAM refused the OAuth client credentials (invalid_client). A client registered as confidential must authenticate when it exchanges the authorization code: set HIVE_OAUTH_CLIENT_SECRET to its secret, or register HIVE_OAUTH_CLIENT_ID as a public PKCE client and leave the secret unset."),this.name="HiveClientRejected"}}async function H(){let e=function(){if(!A())throw Error("Hive login is not configured");let e=new URL(process.env.HIVE_OAUTH_DISCOVERY_URL),t=new URL(process.env.DASHBOARD_PUBLIC_ORIGIN);if([e,t].some(e=>"https:"!==e.protocol||e.username||e.password||e.hash))throw Error("Hive login requires HTTPS");return{discovery:e,origin:t,clientId:process.env.HIVE_OAUTH_CLIENT_ID,issuer:process.env.HIVE_OAUTH_ISSUER,audience:process.env.HIVE_OAUTH_API_AUDIENCE,callback:`${t.origin}/api/auth/hive/callback`}}(),t=await I(e.discovery.toString());if(t.issuer!==e.issuer)throw Error("Hive issuer mismatch");for(let r of["authorization_endpoint","token_endpoint","jwks_uri"]){if("string"!=typeof t[r])throw Error("Incomplete Hive discovery");let i=new URL(t[r]);if(i.origin!==e.discovery.origin||i.username||i.password)throw Error("Unexpected Hive endpoint origin")}return{config:e,doc:t}}async function k(){let{config:e,doc:t}=await H(),r=(0,i.randomBytes)(32).toString("base64url"),n=(0,i.randomBytes)(32).toString("base64url");await (await m()).set(`magnus:hive:oauth:${r}`,E({verifier:n,callback:e.callback},r),"EX",300);let o=new URL(t.authorization_endpoint);return o.search=new URLSearchParams({response_type:"code",client_id:e.clientId,redirect_uri:e.callback,scope:process.env.HIVE_OAUTH_SCOPE??"openid profile email",state:r,code_challenge:(0,i.createHash)("sha256").update(n).digest("base64url"),code_challenge_method:"S256"}).toString(),{state:r,url:o.toString()}}async function O(e,r){if(!/^[A-Za-z0-9_-]{43}$/.test(e)||!r||r.length>4096)throw Error("Invalid OAuth callback");let o=await (await m()).getdel(`magnus:hive:oauth:${e}`);if(!o)throw Error("OAuth state expired or already consumed");let a=_(o,e),{config:c,doc:y}=await H();if(a.callback!==c.callback)throw Error("Callback configuration changed");let v=await I(y.token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"authorization_code",code:r,client_id:c.clientId,redirect_uri:c.callback,code_verifier:a.verifier,...process.env.HIVE_OAUTH_CLIENT_SECRET?{client_secret:process.env.HIVE_OAUTH_CLIENT_SECRET}:{}})});if("string"!=typeof v.access_token)throw Error("Missing Hive access token");let{payload:g}=await (0,w.f)(v.access_token,function(e){if(!(e instanceof URL))throw TypeError("url must be an instance of URL");let r=new URL(e.href).href,i=(void 0)??{},o=i.timeoutDuration;if("number"==typeof o&&(!Number.isInteger(o)||o<0))throw TypeError('"timeoutDuration" option must be a non-negative integer');let a="number"==typeof o?o:5e3,c=p(i.cooldownDuration,3e4,"cooldownDuration"),w=p(i.cacheMaxAge,6e5,"cacheMaxAge"),y=new Headers(i.headers);t&&!y.has("User-Agent")&&y.set("User-Agent",t),y.has("accept")||y.set("accept","application/json, application/jwk-set+json");let v=i[l],g=i[f],m,b,E=0,_=0,A;if(g&&"object"==typeof g){let{uat:e,jwks:t}=g;h(e,w)&&(0,s.q)(t)&&(m=e,A=u(t))}let I=async()=>{if(b&&("u">typeof WebSocketPair||"u">typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"u">typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(b=void 0),!b){let e=++E,t=b=d(r,y,AbortSignal.timeout(a),v).then(t=>{let r=u(t);if(e<=_)return;A=r;let i=Date.now();g&&(g.uat=i,g.jwks=t),m=i,_=e}).finally(()=>{b===t&&(b=void 0)})}await b};return Object.defineProperties(async(e,t)=>{A&&h(m,w)||await I();try{return await A(e,t)}catch(r){if(r instanceof n.W&&!h(m,c))return await I(),A(e,t);throw r}},{coolingDown:{get:()=>h(m,c),enumerable:!0},fresh:{get:()=>h(m,w),enumerable:!0},reload:{value:I,enumerable:!0},reloading:{get:()=>!!b,enumerable:!0},jwks:{value:()=>A?.jwks(),enumerable:!0}})}(new URL(y.jwks_uri)),{algorithms:["RS256"],issuer:c.issuer,audience:c.audience});if(!g.sub||!g.exp||"SERVICE_ACCOUNT"===g.actorType)throw Error("Named user identity required");let b=Math.min(3600,g.exp-Math.floor(Date.now()/1e3));if(b<=0)throw Error("Hive session expired");let A=(0,i.randomBytes)(32).toString("base64url");return await (await m()).set(`magnus:hive:session:${A}`,E({accessToken:v.access_token,userId:g.sub,expiresAt:g.exp},A),"EX",b),{username:String(g.preferred_username??g.sub),userId:g.sub,role:function(e){for(let t of Array.isArray(e)?e:[]){if("SUPER_ADMIN"===t||"IAM_ADMIN"===t)return"ADMIN";if("OPERATOR"===t)return"OPERATOR";if("VIEWER"===t)break}return"VIEWER"}(g.roles),provider:"hive",sessionId:A,ttl:b}}async function R(e,t){if("hive"!==e.provider)return null;if(!e.sessionId||!/^[A-Za-z0-9_-]{43}$/.test(e.sessionId))throw Error("Invalid Hive session");let r=new URL(process.env.CONTROL_API_URL);if(new URL(t).origin!==r.origin)throw Error("Hive delegation is limited to the canonical Control API");let i=await (await m()).get(`magnus:hive:session:${e.sessionId}`);if(!i)throw Error("Hive session expired");let n=_(i,e.sessionId);if(n.userId!==e.userId||n.expiresAt<=Date.now()/1e3)throw Error("Hive session identity expired");return n.accessToken}async function T(e){"hive"===e.provider&&e.sessionId&&await (await m()).del(`magnus:hive:session:${e.sessionId}`)}e.s(["V",0,S,"m",0,k,"N",0,O,"o",0,R,"r",0,A,"D",0,T],69464)}];
2
2
 
3
3
  //# sourceMappingURL=apps_dashboard_src_lib_hive-login_ts_0ab2iq7-rpy13._.js.map
@@ -15,6 +15,6 @@ return count
15
15
  local count = tonumber(redis.call('GET', KEYS[1]) or '0')
16
16
  if count <= 1 then redis.call('DEL', KEYS[1]); return 0 end
17
17
  return redis.call('DECR', KEYS[1])
18
- `;function d(e,t){let a=process.env.AUTH_RATE_LIMIT_LABEL_KEY??process.env.SESSION_SECRET??"magnus-auth-rate-limit-unconfigured";return(0,r.createHmac)("sha256",a).update(`${e}\0${t}`).digest("hex").slice(0,24)}function m(e){if("1"!==e.get("x-magnus-edge-normalized"))return"unverified";let t=e.get("x-real-ip")?.trim();return t&&t.length<=64?t:"unverified"}let E=async(e,r)=>{let a=(t||(t=new o.Redis(process.env.REDIS_URL??"redis://127.0.0.1:6379",{lazyConnect:!0,maxRetriesPerRequest:1,connectTimeout:2e3,commandTimeout:2e3,enableOfflineQueue:!1})).on("error",()=>void 0),t);return"wait"===a.status&&await a.connect(),(function(e,t=e=>new Promise(t=>setTimeout(t,e))){return async function(r,a){let n=process.env.REDIS_PREFIX??"magnus-",i=d("source",r),s=d("username",a.trim().toLowerCase()),o=d("pair",`${r}\0${a.trim().toLowerCase()}`),m=`${n}dashboard-auth:concurrency`,E=`${n}dashboard-auth:source:${i}`,f=`${n}dashboard-auth:username:${s}`,h=`${n}dashboard-auth:pair:${o}`,w=!1;try{if(0>=Number(await e.eval(u,1,m,8,3e4)))return y(!1,1);w=!0;let r=await e.eval(c,3,E,f,h,9e5),a=Array.isArray(r)?r.map(Number):[];if(3!==a.length||a.some(e=>!Number.isFinite(e)))throw Error("invalid Redis limiter response");let[n,i,s]=a,o=s<=1?0:Math.min(4e3,250*2**(s-2));o>0&&await t(o);let l=n<=20&&i<=10&&s<=5;return y(l,900*!l)}catch(t){throw w&&await e.eval(l,1,m).catch(()=>void 0),console.error("[dashboard-auth] durable admission control unavailable"),t}function y(t,r){let a=!w;return{allowed:t,retryAfterSeconds:r,sourceLabel:i,usernameLabel:s,pairLabel:o,async release(){a||(a=!0,await e.eval(l,1,m))},async clearSuccessfulPair(){await e.del(f,h)}}}}})(a)(e,r)};async function f(e,t){await (0,n.mkdir)((0,i.dirname)(e),{recursive:!0,mode:448});let r=await (0,n.open)(e,a.constants.O_WRONLY|a.constants.O_APPEND|a.constants.O_CREAT|a.constants.O_NOFOLLOW,416);try{await r.chmod(416),await r.writeFile(JSON.stringify(t)+"\n"),await r.datasync()}finally{await r.close()}}async function h(e,t,a="",n="local"){let o=function(e,t,a="",n="local"){let i=process.env.AUTH_RATE_LIMIT_LABEL_KEY??process.env.SESSION_SECRET;if(!i||i.length<32)throw Error("Security audit identity key unavailable");let o=m(t).replace(/^::ffff:/,""),c=(0,s.isIP)(o)?o:"unverified",u=a.trim().toLowerCase().slice(0,512),l=(e,t)=>(0,r.createHmac)("sha256",i).update(`${e}\0${t}`).digest("hex").slice(0,24);return{schemaVersion:1,eventId:(0,r.randomUUID)(),occurredAt:new Date().toISOString(),application:"magnus_ui",event:e,method:n,sourceAddress:c,accountLabel:l("account",u),sourceLabel:l("source",c),pairLabel:l("pair",`${n}\0${c}\0${u}`)}}(e,t,a,n),c=process.env.UI_SECURITY_LOG_PATH?.trim()||(0,i.join)(process.cwd(),".magnus","security-events.jsonl");try{await f(c,o)}catch{throw console.error(JSON.stringify({...o,event:"auth.audit_write_failed"})),Error("Security audit persistence unavailable")}}e.s(["W",0,E,"y",0,m],59650),e.s(["f",0,h],62083)}];
18
+ `;function d(e,t){let a=process.env.AUTH_RATE_LIMIT_LABEL_KEY??process.env.SESSION_SECRET??"magnus-auth-rate-limit-unconfigured";return(0,r.createHmac)("sha256",a).update(`${e}\0${t}`).digest("hex").slice(0,24)}function m(e){if("1"!==e.get("x-magnus-edge-normalized"))return"unverified";let t=e.get("x-real-ip")?.trim();return t&&t.length<=64?t:"unverified"}let E=async(e,r)=>{let a=(t||(t=new o.Redis(process.env.REDIS_URL??"redis://127.0.0.1:6379",{lazyConnect:!0,maxRetriesPerRequest:1,connectTimeout:2e3,commandTimeout:2e3,enableOfflineQueue:!1})).on("error",()=>void 0),t);return"wait"===a.status&&await a.connect(),(function(e,t=e=>new Promise(t=>setTimeout(t,e))){return async function(r,a){let n=process.env.REDIS_PREFIX??"magnus-",i=d("source",r),s=d("username",a.trim().toLowerCase()),o=d("pair",`${r}\0${a.trim().toLowerCase()}`),m=`${n}dashboard-auth:concurrency`,E=`${n}dashboard-auth:source:${i}`,f=`${n}dashboard-auth:username:${s}`,h=`${n}dashboard-auth:pair:${o}`,w=!1;try{if(0>=Number(await e.eval(u,1,m,8,3e4)))return y(!1,1,!1);w=!0;let r=await e.eval(c,3,E,f,h,9e5),a=Array.isArray(r)?r.map(Number):[];if(3!==a.length||a.some(e=>!Number.isFinite(e)))throw Error("invalid Redis limiter response");let[n,i,s]=a,o=s<=1?0:Math.min(4e3,250*2**(s-2));o>0&&await t(o);let l=n<=20&&s<=5,d=i>10;return y(l,l&&!d?0:900,d)}catch(t){throw w&&await e.eval(l,1,m).catch(()=>void 0),console.error("[dashboard-auth] durable admission control unavailable"),t}function y(t,r,a){let n=!w;return{allowed:t,usernameLimited:a,retryAfterSeconds:r,sourceLabel:i,usernameLabel:s,pairLabel:o,async release(){n||(n=!0,await e.eval(l,1,m))},async clearSuccessfulPair(){await e.del(f,h)}}}}})(a)(e,r)};async function f(e,t){await (0,n.mkdir)((0,i.dirname)(e),{recursive:!0,mode:448});let r=await (0,n.open)(e,a.constants.O_WRONLY|a.constants.O_APPEND|a.constants.O_CREAT|a.constants.O_NOFOLLOW,416);try{await r.chmod(416),await r.writeFile(JSON.stringify(t)+"\n"),await r.datasync()}finally{await r.close()}}async function h(e,t,a="",n="local"){let o=function(e,t,a="",n="local"){let i=process.env.AUTH_RATE_LIMIT_LABEL_KEY??process.env.SESSION_SECRET;if(!i||i.length<32)throw Error("Security audit identity key unavailable");let o=m(t).replace(/^::ffff:/,""),c=(0,s.isIP)(o)?o:"unverified",u=a.trim().toLowerCase().slice(0,512),l=(e,t)=>(0,r.createHmac)("sha256",i).update(`${e}\0${t}`).digest("hex").slice(0,24);return{schemaVersion:1,eventId:(0,r.randomUUID)(),occurredAt:new Date().toISOString(),application:"magnus_ui",event:e,method:n,sourceAddress:c,accountLabel:l("account",u),sourceLabel:l("source",c),pairLabel:l("pair",`${n}\0${c}\0${u}`)}}(e,t,a,n),c=process.env.UI_SECURITY_LOG_PATH?.trim()||(0,i.join)(process.cwd(),".magnus","security-events.jsonl");try{await f(c,o)}catch{throw console.error(JSON.stringify({...o,event:"auth.audit_write_failed"})),Error("Security audit persistence unavailable")}}e.s(["W",0,E,"y",0,m],59650),e.s(["f",0,h],62083)}];
19
19
 
20
20
  //# sourceMappingURL=apps_dashboard_src_lib_security-events_ts_0xwi4rkbujqr-._.js.map