@ashlr/hub 3.11.0 → 3.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (403) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/dist/authority-surface.json +12 -7
  3. package/dist/build-identity.json +2 -2
  4. package/dist/core/universe/builtins/preparation/manifest.json +1 -1
  5. package/dist/core/universe/builtins/preparation/preparation-bridge.mjs +5 -4
  6. package/dist/core/universe/builtins/preparation/preparation-verification-fixtures.mjs +4 -3
  7. package/dist/core/universe/campaign.js +9 -1
  8. package/dist/core/universe/campaign.js.map +1 -1
  9. package/dist/core/universe/runner.d.ts +3 -0
  10. package/dist/core/universe/runner.js +7 -3
  11. package/dist/core/universe/runner.js.map +1 -1
  12. package/dist/core/verse/compaction-point.d.ts +55 -0
  13. package/dist/core/verse/compaction-point.js +75 -0
  14. package/dist/core/verse/compaction-point.js.map +1 -0
  15. package/dist/core/verse/context-math.d.ts +1 -38
  16. package/dist/core/verse/context-math.js +5 -59
  17. package/dist/core/verse/context-math.js.map +1 -1
  18. package/dist/core/web/public/next/assets/{ActionMenu-CQvNJvHY.js → ActionMenu-_DhtX2gO.js} +2 -2
  19. package/dist/core/web/public/next/assets/{ActionMenu-CQvNJvHY.js.map → ActionMenu-_DhtX2gO.js.map} +1 -1
  20. package/dist/core/web/public/next/assets/Advanced-CAAfaBke.js +2 -0
  21. package/dist/core/web/public/next/assets/{Advanced-DEM93sKI.js.map → Advanced-CAAfaBke.js.map} +1 -1
  22. package/dist/core/web/public/next/assets/App-BAywyjE8.js +7 -0
  23. package/dist/core/web/public/next/assets/{App-CimXmK0L.js.map → App-BAywyjE8.js.map} +1 -1
  24. package/dist/core/web/public/next/assets/AppsSection-CUypKeog.js +2 -0
  25. package/dist/core/web/public/next/assets/{AppsSection-D6U-dSj6.js.map → AppsSection-CUypKeog.js.map} +1 -1
  26. package/dist/core/web/public/next/assets/{AreaTrend-LD9lCPkT.js → AreaTrend-CblDqC8Q.js} +2 -2
  27. package/dist/core/web/public/next/assets/{AreaTrend-LD9lCPkT.js.map → AreaTrend-CblDqC8Q.js.map} +1 -1
  28. package/dist/core/web/public/next/assets/AutonomySection-D3d8lYO3.js +2 -0
  29. package/dist/core/web/public/next/assets/{AutonomySection-3V9pUyxm.js.map → AutonomySection-D3d8lYO3.js.map} +1 -1
  30. package/dist/core/web/public/next/assets/BranchBar-DU0jAV1E.js +2 -0
  31. package/dist/core/web/public/next/assets/{BranchBar-U8UdpfEB.js.map → BranchBar-DU0jAV1E.js.map} +1 -1
  32. package/dist/core/web/public/next/assets/{BudgetControl-DOTlMSmW.js → BudgetControl-Mm1ZL4u6.js} +2 -2
  33. package/dist/core/web/public/next/assets/{BudgetControl-DOTlMSmW.js.map → BudgetControl-Mm1ZL4u6.js.map} +1 -1
  34. package/dist/core/web/public/next/assets/{BurnDown-x4PWH9JF.js → BurnDown-C1fgcFqo.js} +2 -2
  35. package/dist/core/web/public/next/assets/{BurnDown-x4PWH9JF.js.map → BurnDown-C1fgcFqo.js.map} +1 -1
  36. package/dist/core/web/public/next/assets/{Button-DYv_KKxr.js → Button-DqgLUZvd.js} +2 -2
  37. package/dist/core/web/public/next/assets/{Button-DYv_KKxr.js.map → Button-DqgLUZvd.js.map} +1 -1
  38. package/dist/core/web/public/next/assets/CapacityStrip-nWFHvqFB.js +2 -0
  39. package/dist/core/web/public/next/assets/CapacityStrip-nWFHvqFB.js.map +1 -0
  40. package/dist/core/web/public/next/assets/ChatSection-DUZNpiVr.js +3 -0
  41. package/dist/core/web/public/next/assets/ChatSection-DUZNpiVr.js.map +1 -0
  42. package/dist/core/web/public/next/assets/{CloudBudgetForm-DJeJvBEu.js → CloudBudgetForm-2OW38o_C.js} +2 -2
  43. package/dist/core/web/public/next/assets/{CloudBudgetForm-DJeJvBEu.js.map → CloudBudgetForm-2OW38o_C.js.map} +1 -1
  44. package/dist/core/web/public/next/assets/CommandPalette-C5w2o1-r.js +2 -0
  45. package/dist/core/web/public/next/assets/{CommandPalette-FiD4N8XD.js.map → CommandPalette-C5w2o1-r.js.map} +1 -1
  46. package/dist/core/web/public/next/assets/CommandSection-Bx2knNqY.js +2 -0
  47. package/dist/core/web/public/next/assets/{CommandSection-DN8KwH-X.js.map → CommandSection-Bx2knNqY.js.map} +1 -1
  48. package/dist/core/web/public/next/assets/ConfirmDialog-B7ZwCQOX.js +2 -0
  49. package/dist/core/web/public/next/assets/ConfirmDialog-B7ZwCQOX.js.map +1 -0
  50. package/dist/core/web/public/next/assets/ConfirmDialog-Dx15x0Ho.css +1 -0
  51. package/dist/core/web/public/next/assets/Dialog-BpgcEW6b.js +2 -0
  52. package/dist/core/web/public/next/assets/Dialog-BpgcEW6b.js.map +1 -0
  53. package/dist/core/web/public/next/assets/Dialog-tQ8kFulD.css +1 -0
  54. package/dist/core/web/public/next/assets/{DiffPane-DLJ3gGGK.js → DiffPane-DpqRUtCx.js} +2 -2
  55. package/dist/core/web/public/next/assets/{DiffPane-DLJ3gGGK.js.map → DiffPane-DpqRUtCx.js.map} +1 -1
  56. package/dist/core/web/public/next/assets/{DiffViewer-B7NWPjIO.js → DiffViewer-CoV5-nUf.js} +2 -2
  57. package/dist/core/web/public/next/assets/{DiffViewer-B7NWPjIO.js.map → DiffViewer-CoV5-nUf.js.map} +1 -1
  58. package/dist/core/web/public/next/assets/DockHost-C0Pq7Jak.js +2 -0
  59. package/dist/core/web/public/next/assets/{DockHost-DvR-hPhZ.js.map → DockHost-C0Pq7Jak.js.map} +1 -1
  60. package/dist/core/web/public/next/assets/{EmptyState-DhNgDDrF.js → EmptyState-DYW29ncw.js} +2 -2
  61. package/dist/core/web/public/next/assets/{EmptyState-DhNgDDrF.js.map → EmptyState-DYW29ncw.js.map} +1 -1
  62. package/dist/core/web/public/next/assets/{Epistemic-uARPnx9x.js → Epistemic-DVx6oHzp.js} +2 -2
  63. package/dist/core/web/public/next/assets/{Epistemic-uARPnx9x.js.map → Epistemic-DVx6oHzp.js.map} +1 -1
  64. package/dist/core/web/public/next/assets/FleetSection-DSETviPK.js +3 -0
  65. package/dist/core/web/public/next/assets/{FleetSection-D_zRBCub.js.map → FleetSection-DSETviPK.js.map} +1 -1
  66. package/dist/core/web/public/next/assets/{Funnel-CL8uHONq.js → Funnel-DxiGqJrt.js} +2 -2
  67. package/dist/core/web/public/next/assets/{Funnel-CL8uHONq.js.map → Funnel-DxiGqJrt.js.map} +1 -1
  68. package/dist/core/web/public/next/assets/GearTray-C3I89sIt.js +2 -0
  69. package/dist/core/web/public/next/assets/{GearTray-C7k4l_BW.js.map → GearTray-C3I89sIt.js.map} +1 -1
  70. package/dist/core/web/public/next/assets/{GrowthSection-DwdNSGj8.js → GrowthSection-C3m2bPEz.js} +2 -2
  71. package/dist/core/web/public/next/assets/{GrowthSection-DwdNSGj8.js.map → GrowthSection-C3m2bPEz.js.map} +1 -1
  72. package/dist/core/web/public/next/assets/HandoffDialog-Bjb96a0N.js +2 -0
  73. package/dist/core/web/public/next/assets/{HandoffDialog-FPVOqOMN.js.map → HandoffDialog-Bjb96a0N.js.map} +1 -1
  74. package/dist/core/web/public/next/assets/{Input-B9-VLcHS.js → Input-ekTehVaH.js} +2 -2
  75. package/dist/core/web/public/next/assets/{Input-B9-VLcHS.js.map → Input-ekTehVaH.js.map} +1 -1
  76. package/dist/core/web/public/next/assets/LeaderCard-85VBbbaZ.js +2 -0
  77. package/dist/core/web/public/next/assets/{LeaderCard-4R0BhDzT.js.map → LeaderCard-85VBbbaZ.js.map} +1 -1
  78. package/dist/core/web/public/next/assets/{MatrixHeatmap-DiuushcS.js → MatrixHeatmap-Bo8j0QPC.js} +2 -2
  79. package/dist/core/web/public/next/assets/{MatrixHeatmap-DiuushcS.js.map → MatrixHeatmap-Bo8j0QPC.js.map} +1 -1
  80. package/dist/core/web/public/next/assets/McpSection-DvHFaVyp.js +2 -0
  81. package/dist/core/web/public/next/assets/{McpSection-CJ__OJKl.js.map → McpSection-DvHFaVyp.js.map} +1 -1
  82. package/dist/core/web/public/next/assets/{MessageMarkdown-qWKyJvAQ.js → MessageMarkdown-fsY_ltVa.js} +3 -3
  83. package/dist/core/web/public/next/assets/{MessageMarkdown-qWKyJvAQ.js.map → MessageMarkdown-fsY_ltVa.js.map} +1 -1
  84. package/dist/core/web/public/next/assets/{MessageMarkdownRenderer-x05TrsrW.js → MessageMarkdownRenderer-DDdtu82l.js} +2 -2
  85. package/dist/core/web/public/next/assets/{MessageMarkdownRenderer-x05TrsrW.js.map → MessageMarkdownRenderer-DDdtu82l.js.map} +1 -1
  86. package/dist/core/web/public/next/assets/{Meter-D-hncpkO.js → Meter-CeGDXdDM.js} +2 -2
  87. package/dist/core/web/public/next/assets/{Meter-D-hncpkO.js.map → Meter-CeGDXdDM.js.map} +1 -1
  88. package/dist/core/web/public/next/assets/MindSection-CDVhHvXl.js +2 -0
  89. package/dist/core/web/public/next/assets/{MindSection-BjXHkQPS.js.map → MindSection-CDVhHvXl.js.map} +1 -1
  90. package/dist/core/web/public/next/assets/MutationTokenDialog-CrfJ0PdD.css +1 -0
  91. package/dist/core/web/public/next/assets/MutationTokenDialog-DTQzEOHR.js +2 -0
  92. package/dist/core/web/public/next/assets/MutationTokenDialog-DTQzEOHR.js.map +1 -0
  93. package/dist/core/web/public/next/assets/NeedsYouDrawer-6AuN0BF3.js +2 -0
  94. package/dist/core/web/public/next/assets/{NeedsYouDrawer-rSd1ZHAR.js.map → NeedsYouDrawer-6AuN0BF3.js.map} +1 -1
  95. package/dist/core/web/public/next/assets/{NeedsYouList-CG-nB1tr.js → NeedsYouList-ChnRmbSk.js} +2 -2
  96. package/dist/core/web/public/next/assets/{NeedsYouList-CG-nB1tr.js.map → NeedsYouList-ChnRmbSk.js.map} +1 -1
  97. package/dist/core/web/public/next/assets/NewChatDialog-B06E7sqg.js +3 -0
  98. package/dist/core/web/public/next/assets/{NewChatDialog-BeDQ1eW3.js.map → NewChatDialog-B06E7sqg.js.map} +1 -1
  99. package/dist/core/web/public/next/assets/OnboardingFlow-C2M3zov9.js +2 -0
  100. package/dist/core/web/public/next/assets/{OnboardingFlow-CkTZtt-m.js.map → OnboardingFlow-C2M3zov9.js.map} +1 -1
  101. package/dist/core/web/public/next/assets/PreviewPane-Bd6HsX1k.js +2 -0
  102. package/dist/core/web/public/next/assets/{PreviewPane-kzbbSK4u.js.map → PreviewPane-Bd6HsX1k.js.map} +1 -1
  103. package/dist/core/web/public/next/assets/ProviderLogo-Bz7KR5j3.js +2 -0
  104. package/dist/core/web/public/next/assets/ProviderLogo-Bz7KR5j3.js.map +1 -0
  105. package/dist/core/web/public/next/assets/{RailStatus-D-t2gPae.js → RailStatus-CctCuuLy.js} +2 -2
  106. package/dist/core/web/public/next/assets/{RailStatus-D-t2gPae.js.map → RailStatus-CctCuuLy.js.map} +1 -1
  107. package/dist/core/web/public/next/assets/{RefreshIndicator-BLnr9IOM.js → RefreshIndicator-CKY5BGdD.js} +2 -2
  108. package/dist/core/web/public/next/assets/{RefreshIndicator-BLnr9IOM.js.map → RefreshIndicator-CKY5BGdD.js.map} +1 -1
  109. package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-CM_8pJs6.css → ResourcePoolConsoleApp-BX9JLkT4.css} +1 -1
  110. package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-BeG0gBif.js → ResourcePoolConsoleApp-CspIsW_G.js} +5 -5
  111. package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-BeG0gBif.js.map → ResourcePoolConsoleApp-CspIsW_G.js.map} +1 -1
  112. package/dist/core/web/public/next/assets/ResourcesChrome-B7fHZ6zX.js +3 -0
  113. package/dist/core/web/public/next/assets/ResourcesChrome-B7fHZ6zX.js.map +1 -0
  114. package/dist/core/web/public/next/assets/ResourcesChrome-uZEqC2EM.css +1 -0
  115. package/dist/core/web/public/next/assets/ResourcesDrawer-B7-N9n7-.js +2 -0
  116. package/dist/core/web/public/next/assets/ResourcesDrawer-B7-N9n7-.js.map +1 -0
  117. package/dist/core/web/public/next/assets/RouteErrorBoundary-C_B11J0s.js +2 -0
  118. package/dist/core/web/public/next/assets/RouteErrorBoundary-C_B11J0s.js.map +1 -0
  119. package/dist/core/web/public/next/assets/RouteErrorBoundary-DdxhTdZ6.css +1 -0
  120. package/dist/core/web/public/next/assets/{RunInCloudAction-C3LBp7C4.js → RunInCloudAction-_juw4EXd.js} +2 -2
  121. package/dist/core/web/public/next/assets/{RunInCloudAction-C3LBp7C4.js.map → RunInCloudAction-_juw4EXd.js.map} +1 -1
  122. package/dist/core/web/public/next/assets/SeatSelector-D_YXvkPy.js +3 -0
  123. package/dist/core/web/public/next/assets/{SeatSelector-DpvvbjNm.js.map → SeatSelector-D_YXvkPy.js.map} +1 -1
  124. package/dist/core/web/public/next/assets/{Segmented-BL40udoO.js → Segmented-DnKP6rr7.js} +2 -2
  125. package/dist/core/web/public/next/assets/{Segmented-BL40udoO.js.map → Segmented-DnKP6rr7.js.map} +1 -1
  126. package/dist/core/web/public/next/assets/{Select-FWLnAw_j.js → Select-DlbUupTX.js} +2 -2
  127. package/dist/core/web/public/next/assets/{Select-FWLnAw_j.js.map → Select-DlbUupTX.js.map} +1 -1
  128. package/dist/core/web/public/next/assets/SessionGate-DnuTZACL.js +2 -0
  129. package/dist/core/web/public/next/assets/SessionGate-DnuTZACL.js.map +1 -0
  130. package/dist/core/web/public/next/assets/SessionGate-DvMpXNpJ.css +1 -0
  131. package/dist/core/web/public/next/assets/SessionInsightChip-C33-k-Q5.js +2 -0
  132. package/dist/core/web/public/next/assets/{SessionInsightChip-CWye87Ju.js.map → SessionInsightChip-C33-k-Q5.js.map} +1 -1
  133. package/dist/core/web/public/next/assets/{SessionSearch-YvCHFUuN.js → SessionSearch-DhhR9Csg.js} +2 -2
  134. package/dist/core/web/public/next/assets/{SessionSearch-YvCHFUuN.js.map → SessionSearch-DhhR9Csg.js.map} +1 -1
  135. package/dist/core/web/public/next/assets/SettingsSection-C0xQvCz3.js +2 -0
  136. package/dist/core/web/public/next/assets/SettingsSection-C0xQvCz3.js.map +1 -0
  137. package/dist/core/web/public/next/assets/Sheet-BvNYOYv5.js +2 -0
  138. package/dist/core/web/public/next/assets/{Sheet-DZKcQXQg.js.map → Sheet-BvNYOYv5.js.map} +1 -1
  139. package/dist/core/web/public/next/assets/ShortcutsOverlay-1nUBVO-Z.js +2 -0
  140. package/dist/core/web/public/next/assets/{ShortcutsOverlay-BpDimdPq.js.map → ShortcutsOverlay-1nUBVO-Z.js.map} +1 -1
  141. package/dist/core/web/public/next/assets/Sidebar-YrVvvBNM.js +3 -0
  142. package/dist/core/web/public/next/assets/{Sidebar-BoBzBEFX.js.map → Sidebar-YrVvvBNM.js.map} +1 -1
  143. package/dist/core/web/public/next/assets/{Slider-DUMo9HDD.js → Slider-B2c-dbQb.js} +2 -2
  144. package/dist/core/web/public/next/assets/{Slider-DUMo9HDD.js.map → Slider-B2c-dbQb.js.map} +1 -1
  145. package/dist/core/web/public/next/assets/{StatusBadge-BwnBNFQr.js → StatusBadge-Q9YYkijx.js} +2 -2
  146. package/dist/core/web/public/next/assets/{StatusBadge-BwnBNFQr.js.map → StatusBadge-Q9YYkijx.js.map} +1 -1
  147. package/dist/core/web/public/next/assets/{StepBand-PDXMIlRk.js → StepBand-Ci-C0GUG.js} +2 -2
  148. package/dist/core/web/public/next/assets/{StepBand-PDXMIlRk.js.map → StepBand-Ci-C0GUG.js.map} +1 -1
  149. package/dist/core/web/public/next/assets/{Surface-B3TZVoER.js → Surface-DBovMq4P.js} +2 -2
  150. package/dist/core/web/public/next/assets/{Surface-B3TZVoER.js.map → Surface-DBovMq4P.js.map} +1 -1
  151. package/dist/core/web/public/next/assets/{Swimlane-DR4OgON_.js → Swimlane-Cdc4TqDe.js} +2 -2
  152. package/dist/core/web/public/next/assets/{Swimlane-DR4OgON_.js.map → Swimlane-Cdc4TqDe.js.map} +1 -1
  153. package/dist/core/web/public/next/assets/{Switch-CcR5Llk5.js → Switch-CUrvzO2k.js} +2 -2
  154. package/dist/core/web/public/next/assets/{Switch-CcR5Llk5.js.map → Switch-CUrvzO2k.js.map} +1 -1
  155. package/dist/core/web/public/next/assets/{Tag-_-K1h7Hk.js → Tag-Bv8u6APt.js} +2 -2
  156. package/dist/core/web/public/next/assets/{Tag-_-K1h7Hk.js.map → Tag-Bv8u6APt.js.map} +1 -1
  157. package/dist/core/web/public/next/assets/TerminalPane-BE4Xlqi5.js +7 -0
  158. package/dist/core/web/public/next/assets/{TerminalPane-_1aH4ndN.js.map → TerminalPane-BE4Xlqi5.js.map} +1 -1
  159. package/dist/core/web/public/next/assets/UniverseConsoleApp-BGwejf0m.js +2 -0
  160. package/dist/core/web/public/next/assets/{UniverseConsoleApp-BUsq-inZ.js.map → UniverseConsoleApp-BGwejf0m.js.map} +1 -1
  161. package/dist/core/web/public/next/assets/{UniverseConsoleApp-Dh7A-hLD.css → UniverseConsoleApp-DfuT-wFw.css} +1 -1
  162. package/dist/core/web/public/next/assets/{UniverseView-Dogy_dsB.js → UniverseView-CgKa-WXC.js} +4 -4
  163. package/dist/core/web/public/next/assets/{UniverseView-Dogy_dsB.js.map → UniverseView-CgKa-WXC.js.map} +1 -1
  164. package/dist/core/web/public/next/assets/UsageSection-CazsHm1f.js +2 -0
  165. package/dist/core/web/public/next/assets/{UsageSection-DiX_dTyo.js.map → UsageSection-CazsHm1f.js.map} +1 -1
  166. package/dist/core/web/public/next/assets/VerseConsoleApp-CTF3Shs0.js +3 -0
  167. package/dist/core/web/public/next/assets/VerseConsoleApp-CTF3Shs0.js.map +1 -0
  168. package/dist/core/web/public/next/assets/Workspace-CgdyXiEV.js +10 -0
  169. package/dist/core/web/public/next/assets/Workspace-CgdyXiEV.js.map +1 -0
  170. package/dist/core/web/public/next/assets/Workspace-Dwri2jFJ.css +1 -0
  171. package/dist/core/web/public/next/assets/actions-MtxBGS5B.js +2 -0
  172. package/dist/core/web/public/next/assets/{actions-s2lfm_5k.js.map → actions-MtxBGS5B.js.map} +1 -1
  173. package/dist/core/web/public/next/assets/budget-queries-CP7hgR-p.js +2 -0
  174. package/dist/core/web/public/next/assets/{budget-queries-wUshcovN.js.map → budget-queries-CP7hgR-p.js.map} +1 -1
  175. package/dist/core/web/public/next/assets/{capacity-strip-model-Bj_9ztzs.js → capacity-strip-model-fHfu5cph.js} +2 -2
  176. package/dist/core/web/public/next/assets/{capacity-strip-model-Bj_9ztzs.js.map → capacity-strip-model-fHfu5cph.js.map} +1 -1
  177. package/dist/core/web/public/next/assets/{charts-CMSgAUKn.js → charts-Bis9WSiS.js} +2 -2
  178. package/dist/core/web/public/next/assets/{charts-CMSgAUKn.js.map → charts-Bis9WSiS.js.map} +1 -1
  179. package/dist/core/web/public/next/assets/cloud-queries-BsOepFz6.js +2 -0
  180. package/dist/core/web/public/next/assets/{cloud-queries-CnV1yaNG.js.map → cloud-queries-BsOepFz6.js.map} +1 -1
  181. package/dist/core/web/public/next/assets/{cloud.module-CiwatLj3.js → cloud.module-DoFnr8ZH.js} +2 -2
  182. package/dist/core/web/public/next/assets/{cloud.module-CiwatLj3.js.map → cloud.module-DoFnr8ZH.js.map} +1 -1
  183. package/dist/core/web/public/next/assets/{command-bus-DqimKCUY.js → command-bus-CMvbYP5K.js} +2 -2
  184. package/dist/core/web/public/next/assets/{command-bus-DqimKCUY.js.map → command-bus-CMvbYP5K.js.map} +1 -1
  185. package/dist/core/web/public/next/assets/command-catalog-Bb_PxC5w.js +2 -0
  186. package/dist/core/web/public/next/assets/command-catalog-Bb_PxC5w.js.map +1 -0
  187. package/dist/core/web/public/next/assets/compaction-point-VL9oegWS.js +2 -0
  188. package/dist/core/web/public/next/assets/compaction-point-VL9oegWS.js.map +1 -0
  189. package/dist/core/web/public/next/assets/{composer-keys-DBRymxQn.js → composer-keys-su0g1h9o.js} +2 -2
  190. package/dist/core/web/public/next/assets/{composer-keys-DBRymxQn.js.map → composer-keys-su0g1h9o.js.map} +1 -1
  191. package/dist/core/web/public/next/assets/context-model-Ci3Ch9t5.js +2 -0
  192. package/dist/core/web/public/next/assets/{context-model-Dwd49-dp.js.map → context-model-Ci3Ch9t5.js.map} +1 -1
  193. package/dist/core/web/public/next/assets/context-model-CjiJTnf1.js +2 -0
  194. package/dist/core/web/public/next/assets/{context-model-MT17V86_.js.map → context-model-CjiJTnf1.js.map} +1 -1
  195. package/dist/core/web/public/next/assets/context-queries-BDXT6LQ3.js +2 -0
  196. package/dist/core/web/public/next/assets/{context-queries-xVKIeynP.js.map → context-queries-BDXT6LQ3.js.map} +1 -1
  197. package/dist/core/web/public/next/assets/control-queries-Dv-h1Clu.js +2 -0
  198. package/dist/core/web/public/next/assets/{control-queries-DOZR-D8G.js.map → control-queries-Dv-h1Clu.js.map} +1 -1
  199. package/dist/core/web/public/next/assets/{dock-icons-8EtARwUm.js → dock-icons-t--Eugrd.js} +2 -2
  200. package/dist/core/web/public/next/assets/{dock-icons-8EtARwUm.js.map → dock-icons-t--Eugrd.js.map} +1 -1
  201. package/dist/core/web/public/next/assets/{dock-store-BA1cHOYA.js → dock-store-qIu7kSQE.js} +2 -2
  202. package/dist/core/web/public/next/assets/{dock-store-BA1cHOYA.js.map → dock-store-qIu7kSQE.js.map} +1 -1
  203. package/dist/core/web/public/next/assets/{fleet-model-CNe8Wh-s.js → fleet-model-IRbwfhkR.js} +2 -2
  204. package/dist/core/web/public/next/assets/{fleet-model-CNe8Wh-s.js.map → fleet-model-IRbwfhkR.js.map} +1 -1
  205. package/dist/core/web/public/next/assets/fleet-queries-7FVNByX1.js +2 -0
  206. package/dist/core/web/public/next/assets/{fleet-queries-BSdRlUwJ.js.map → fleet-queries-7FVNByX1.js.map} +1 -1
  207. package/dist/core/web/public/next/assets/focus-trap-QqQxQdvH.js +2 -0
  208. package/dist/core/web/public/next/assets/focus-trap-QqQxQdvH.js.map +1 -0
  209. package/dist/core/web/public/next/assets/{format-B8DAVcn2.js → format-CaMmVQCn.js} +2 -2
  210. package/dist/core/web/public/next/assets/{format-B8DAVcn2.js.map → format-CaMmVQCn.js.map} +1 -1
  211. package/dist/core/web/public/next/assets/git-model-B4S_GUNA.js +5 -0
  212. package/dist/core/web/public/next/assets/{git-model-CivuBY_D.js.map → git-model-B4S_GUNA.js.map} +1 -1
  213. package/dist/core/web/public/next/assets/global-BkNl4e6E.js +2 -0
  214. package/dist/core/web/public/next/assets/global-BkNl4e6E.js.map +1 -0
  215. package/dist/core/web/public/next/assets/global-BlI2BYa1.css +1 -0
  216. package/dist/core/web/public/next/assets/guarded-action-DHiL8tY5.js +3 -0
  217. package/dist/core/web/public/next/assets/guarded-action-DHiL8tY5.js.map +1 -0
  218. package/dist/core/web/public/next/assets/guarded-runners-DmGEkM2P.js +2 -0
  219. package/dist/core/web/public/next/assets/guarded-runners-DmGEkM2P.js.map +1 -0
  220. package/dist/core/web/public/next/assets/icon-base-NtFmP2yB.js +2 -0
  221. package/dist/core/web/public/next/assets/icon-base-NtFmP2yB.js.map +1 -0
  222. package/dist/core/web/public/next/assets/icons-C5EFt_Ts.js +2 -0
  223. package/dist/core/web/public/next/assets/icons-C5EFt_Ts.js.map +1 -0
  224. package/dist/core/web/public/next/assets/{index-oAAq8XJa.js → index-DbDw9UAs.js} +3 -3
  225. package/dist/core/web/public/next/assets/{index-oAAq8XJa.js.map → index-DbDw9UAs.js.map} +1 -1
  226. package/dist/core/web/public/next/assets/{live-model-DCw_IFRI.js → live-model-DEwrl7_A.js} +2 -2
  227. package/dist/core/web/public/next/assets/{live-model-DCw_IFRI.js.map → live-model-DEwrl7_A.js.map} +1 -1
  228. package/dist/core/web/public/next/assets/{mind.module-vnuJcwvD.js → mind.module-CLhqMQak.js} +2 -2
  229. package/dist/core/web/public/next/assets/{mind.module-vnuJcwvD.js.map → mind.module-CLhqMQak.js.map} +1 -1
  230. package/dist/core/web/public/next/assets/mutations-Kvzsg-iK.js +2 -0
  231. package/dist/core/web/public/next/assets/{mutations-Dpsql5t7.js.map → mutations-Kvzsg-iK.js.map} +1 -1
  232. package/dist/core/web/public/next/assets/nav-C0IunEYF.js +2 -0
  233. package/dist/core/web/public/next/assets/nav-C0IunEYF.js.map +1 -0
  234. package/dist/core/web/public/next/assets/overnight-queries-C_AfcL7q.js +2 -0
  235. package/dist/core/web/public/next/assets/{overnight-queries-X-44Gsw5.js.map → overnight-queries-C_AfcL7q.js.map} +1 -1
  236. package/dist/core/web/public/next/assets/preloaded-CctOitLu.js +2 -0
  237. package/dist/core/web/public/next/assets/preloaded-CctOitLu.js.map +1 -0
  238. package/dist/core/web/public/next/assets/primitives-CbAGCNKt.js +1 -0
  239. package/dist/core/web/public/next/assets/{queries-BA4rNGD-.js → queries-THD05gHP.js} +2 -2
  240. package/dist/core/web/public/next/assets/{queries-BA4rNGD-.js.map → queries-THD05gHP.js.map} +1 -1
  241. package/dist/core/web/public/next/assets/reasoning-pref-BVPu0SME.js +2 -0
  242. package/dist/core/web/public/next/assets/{reasoning-pref-B9-DJUXP.js.map → reasoning-pref-BVPu0SME.js.map} +1 -1
  243. package/dist/core/web/public/next/assets/reveal-anchor-wCT5b4m3.js +2 -0
  244. package/dist/core/web/public/next/assets/reveal-anchor-wCT5b4m3.js.map +1 -0
  245. package/dist/core/web/public/next/assets/seat-subscription-CR_VylsK.js +2 -0
  246. package/dist/core/web/public/next/assets/{seat-subscription-CH6fW4fJ.js.map → seat-subscription-CR_VylsK.js.map} +1 -1
  247. package/dist/core/web/public/next/assets/{section-visibility-qFqc_d4Z.js → section-visibility-B0xXUQJ0.js} +2 -2
  248. package/dist/core/web/public/next/assets/{section-visibility-qFqc_d4Z.js.map → section-visibility-B0xXUQJ0.js.map} +1 -1
  249. package/dist/core/web/public/next/assets/{sidebar-model-M1GaQU5l.js → sidebar-model-C5wVXGpb.js} +2 -2
  250. package/dist/core/web/public/next/assets/{sidebar-model-M1GaQU5l.js.map → sidebar-model-C5wVXGpb.js.map} +1 -1
  251. package/dist/core/web/public/next/assets/slots-DDd8cEoh.js +3 -0
  252. package/dist/core/web/public/next/assets/{slots-Ds9ZIqUL.js.map → slots-DDd8cEoh.js.map} +1 -1
  253. package/dist/core/web/public/next/assets/surface-data-BFxAlefI.js +2 -0
  254. package/dist/core/web/public/next/assets/{surface-data-J52iIGMD.js.map → surface-data-BFxAlefI.js.map} +1 -1
  255. package/dist/core/web/public/next/assets/surface-prefetch-CHusyO9q.js +2 -0
  256. package/dist/core/web/public/next/assets/{surface-prefetch-CgZ-LEJK.js.map → surface-prefetch-CHusyO9q.js.map} +1 -1
  257. package/dist/core/web/public/next/assets/{tasks-model-ent8f0jZ.js → tasks-model-DvkWveXs.js} +2 -2
  258. package/dist/core/web/public/next/assets/{tasks-model-ent8f0jZ.js.map → tasks-model-DvkWveXs.js.map} +1 -1
  259. package/dist/core/web/public/next/assets/{terminal-icons-DJTK7QpR.js → terminal-icons-Dp6pJgV2.js} +2 -2
  260. package/dist/core/web/public/next/assets/{terminal-icons-DJTK7QpR.js.map → terminal-icons-Dp6pJgV2.js.map} +1 -1
  261. package/dist/core/web/public/next/assets/{usage-queries-Bn8ccqyN.js → usage-queries-CUTmnegA.js} +2 -2
  262. package/dist/core/web/public/next/assets/{usage-queries-Bn8ccqyN.js.map → usage-queries-CUTmnegA.js.map} +1 -1
  263. package/dist/core/web/public/next/assets/use-guarded-action-UCX2u1t1.js +2 -0
  264. package/dist/core/web/public/next/assets/{use-guarded-action-C2HlSzkz.js.map → use-guarded-action-UCX2u1t1.js.map} +1 -1
  265. package/dist/core/web/public/next/assets/{use-ticker-BNc1H4ZC.js → use-ticker-OXAjob3y.js} +2 -2
  266. package/dist/core/web/public/next/assets/{use-ticker-BNc1H4ZC.js.map → use-ticker-OXAjob3y.js.map} +1 -1
  267. package/dist/core/web/public/next/assets/use-token-gate-CDDRAoKH.js +2 -0
  268. package/dist/core/web/public/next/assets/{use-token-gate-B3IJL6bf.js.map → use-token-gate-CDDRAoKH.js.map} +1 -1
  269. package/dist/core/web/public/next/assets/useChartWidth-BW6SwYIK.css +1 -0
  270. package/dist/core/web/public/next/assets/useChartWidth-D9M7kUw7.js +2 -0
  271. package/dist/core/web/public/next/assets/{useChartWidth-lZ9PrQn0.js.map → useChartWidth-D9M7kUw7.js.map} +1 -1
  272. package/dist/core/web/public/next/assets/{useSeatsRefresh-CG4jczeL.js → useSeatsRefresh-B2dCVcj9.js} +2 -2
  273. package/dist/core/web/public/next/assets/{useSeatsRefresh-CG4jczeL.js.map → useSeatsRefresh-B2dCVcj9.js.map} +1 -1
  274. package/dist/core/web/public/next/assets/useVerseTranscript-BL3CljSI.js +2 -0
  275. package/dist/core/web/public/next/assets/useVerseTranscript-BL3CljSI.js.map +1 -0
  276. package/dist/core/web/public/next/assets/verse-icons-DASWdYuE.js +2 -0
  277. package/dist/core/web/public/next/assets/verse-icons-DASWdYuE.js.map +1 -0
  278. package/dist/core/web/public/next/assets/verse-model-BQ0Y2CSr.js +2 -0
  279. package/dist/core/web/public/next/assets/verse-model-BQ0Y2CSr.js.map +1 -0
  280. package/dist/core/web/public/next/assets/verse-store-b_Lek_c5.js +3 -0
  281. package/dist/core/web/public/next/assets/verse-store-b_Lek_c5.js.map +1 -0
  282. package/dist/core/web/public/next/assets/verse-ui-store-D7YXi63q.js +3 -0
  283. package/dist/core/web/public/next/assets/{verse-ui-store-zafyzXKD.js.map → verse-ui-store-D7YXi63q.js.map} +1 -1
  284. package/dist/core/web/public/next/assets/{viewport-BEqGUoTA.js → viewport-BYGH5EgA.js} +2 -2
  285. package/dist/core/web/public/next/assets/{viewport-BEqGUoTA.js.map → viewport-BYGH5EgA.js.map} +1 -1
  286. package/dist/core/web/public/next/assets/warmup-AsqwWCUi.js +3 -0
  287. package/dist/core/web/public/next/assets/{warmup-BR6pxAKs.js.map → warmup-AsqwWCUi.js.map} +1 -1
  288. package/dist/core/web/public/next/assets/{workspace-model-D_tWD5Wt.js → workspace-model-CXorJr0G.js} +2 -2
  289. package/dist/core/web/public/next/assets/{workspace-model-D_tWD5Wt.js.map → workspace-model-CXorJr0G.js.map} +1 -1
  290. package/dist/core/web/public/next/index.html +1 -1
  291. package/dist/release-dependency-inventory.json +1 -1
  292. package/package.json +5 -2
  293. package/dist/cli/activation.d.ts +0 -41
  294. package/dist/cli/activation.js +0 -485
  295. package/dist/cli/activation.js.map +0 -1
  296. package/dist/core/fleet/generated-repair-resolution.d.ts +0 -36
  297. package/dist/core/fleet/generated-repair-resolution.js +0 -245
  298. package/dist/core/fleet/generated-repair-resolution.js.map +0 -1
  299. package/dist/core/local-runtime/llama/port.d.ts +0 -17
  300. package/dist/core/local-runtime/llama/port.js +0 -47
  301. package/dist/core/local-runtime/llama/port.js.map +0 -1
  302. package/dist/core/local-runtime/llama/proxy-host.d.ts +0 -54
  303. package/dist/core/local-runtime/llama/proxy-host.js +0 -159
  304. package/dist/core/local-runtime/llama/proxy-host.js.map +0 -1
  305. package/dist/core/local-runtime/llama/proxy-process.d.ts +0 -148
  306. package/dist/core/local-runtime/llama/proxy-process.js +0 -250
  307. package/dist/core/local-runtime/llama/proxy-process.js.map +0 -1
  308. package/dist/core/local-runtime/llama/proxy-record.d.ts +0 -40
  309. package/dist/core/local-runtime/llama/proxy-record.js +0 -133
  310. package/dist/core/local-runtime/llama/proxy-record.js.map +0 -1
  311. package/dist/core/local-runtime/llama/proxy-supervisor.d.ts +0 -118
  312. package/dist/core/local-runtime/llama/proxy-supervisor.js +0 -511
  313. package/dist/core/local-runtime/llama/proxy-supervisor.js.map +0 -1
  314. package/dist/core/web/public/next/assets/Advanced-DEM93sKI.js +0 -2
  315. package/dist/core/web/public/next/assets/App-CimXmK0L.js +0 -7
  316. package/dist/core/web/public/next/assets/AppsSection-D6U-dSj6.js +0 -2
  317. package/dist/core/web/public/next/assets/AutonomySection-3V9pUyxm.js +0 -2
  318. package/dist/core/web/public/next/assets/BranchBar-U8UdpfEB.js +0 -2
  319. package/dist/core/web/public/next/assets/CapacityStrip-C667yQe8.js +0 -2
  320. package/dist/core/web/public/next/assets/CapacityStrip-C667yQe8.js.map +0 -1
  321. package/dist/core/web/public/next/assets/ChatSection-CCcIPpOq.js +0 -3
  322. package/dist/core/web/public/next/assets/ChatSection-CCcIPpOq.js.map +0 -1
  323. package/dist/core/web/public/next/assets/CommandPalette-FiD4N8XD.js +0 -2
  324. package/dist/core/web/public/next/assets/CommandSection-DN8KwH-X.js +0 -2
  325. package/dist/core/web/public/next/assets/DockHost-DvR-hPhZ.js +0 -2
  326. package/dist/core/web/public/next/assets/FleetSection-D_zRBCub.js +0 -3
  327. package/dist/core/web/public/next/assets/GearTray-C7k4l_BW.js +0 -2
  328. package/dist/core/web/public/next/assets/HandoffDialog-FPVOqOMN.js +0 -2
  329. package/dist/core/web/public/next/assets/LeaderCard-4R0BhDzT.js +0 -2
  330. package/dist/core/web/public/next/assets/McpSection-CJ__OJKl.js +0 -2
  331. package/dist/core/web/public/next/assets/MindSection-BjXHkQPS.js +0 -2
  332. package/dist/core/web/public/next/assets/MutationTokenDialog-Cum_DqQZ.css +0 -1
  333. package/dist/core/web/public/next/assets/MutationTokenDialog-SkRxqV_I.js +0 -2
  334. package/dist/core/web/public/next/assets/MutationTokenDialog-SkRxqV_I.js.map +0 -1
  335. package/dist/core/web/public/next/assets/NeedsYouDrawer-rSd1ZHAR.js +0 -2
  336. package/dist/core/web/public/next/assets/NewChatDialog-BeDQ1eW3.js +0 -3
  337. package/dist/core/web/public/next/assets/OnboardingFlow-CkTZtt-m.js +0 -2
  338. package/dist/core/web/public/next/assets/PreviewPane-kzbbSK4u.js +0 -2
  339. package/dist/core/web/public/next/assets/ResourcesChrome-B3Z3O98t.css +0 -1
  340. package/dist/core/web/public/next/assets/ResourcesChrome-BzV6bkIa.js +0 -3
  341. package/dist/core/web/public/next/assets/ResourcesChrome-BzV6bkIa.js.map +0 -1
  342. package/dist/core/web/public/next/assets/ResourcesDrawer-o4ILHdep.js +0 -2
  343. package/dist/core/web/public/next/assets/ResourcesDrawer-o4ILHdep.js.map +0 -1
  344. package/dist/core/web/public/next/assets/RouteErrorBoundary-6RMd_aZg.css +0 -1
  345. package/dist/core/web/public/next/assets/RouteErrorBoundary-C5SxA2Dg.js +0 -2
  346. package/dist/core/web/public/next/assets/RouteErrorBoundary-C5SxA2Dg.js.map +0 -1
  347. package/dist/core/web/public/next/assets/SeatSelector-DpvvbjNm.js +0 -3
  348. package/dist/core/web/public/next/assets/SessionInsightChip-CWye87Ju.js +0 -2
  349. package/dist/core/web/public/next/assets/SettingsSection-Dr18upeE.js +0 -2
  350. package/dist/core/web/public/next/assets/SettingsSection-Dr18upeE.js.map +0 -1
  351. package/dist/core/web/public/next/assets/Sheet-DZKcQXQg.js +0 -2
  352. package/dist/core/web/public/next/assets/ShortcutsOverlay-BpDimdPq.js +0 -2
  353. package/dist/core/web/public/next/assets/Sidebar-BoBzBEFX.js +0 -3
  354. package/dist/core/web/public/next/assets/TerminalPane-_1aH4ndN.js +0 -7
  355. package/dist/core/web/public/next/assets/UniverseConsoleApp-BUsq-inZ.js +0 -2
  356. package/dist/core/web/public/next/assets/UsageSection-DiX_dTyo.js +0 -2
  357. package/dist/core/web/public/next/assets/VerseConsoleApp-WVeyJnW7.js +0 -3
  358. package/dist/core/web/public/next/assets/VerseConsoleApp-WVeyJnW7.js.map +0 -1
  359. package/dist/core/web/public/next/assets/Workspace-BYW9dm90.css +0 -1
  360. package/dist/core/web/public/next/assets/Workspace-BbxZHwQd.js +0 -10
  361. package/dist/core/web/public/next/assets/Workspace-BbxZHwQd.js.map +0 -1
  362. package/dist/core/web/public/next/assets/actions-s2lfm_5k.js +0 -2
  363. package/dist/core/web/public/next/assets/budget-queries-wUshcovN.js +0 -2
  364. package/dist/core/web/public/next/assets/cloud-queries-CnV1yaNG.js +0 -2
  365. package/dist/core/web/public/next/assets/command-catalog-BdtDH93o.js +0 -2
  366. package/dist/core/web/public/next/assets/command-catalog-BdtDH93o.js.map +0 -1
  367. package/dist/core/web/public/next/assets/context-model-Dwd49-dp.js +0 -2
  368. package/dist/core/web/public/next/assets/context-model-MT17V86_.js +0 -2
  369. package/dist/core/web/public/next/assets/context-queries-xVKIeynP.js +0 -2
  370. package/dist/core/web/public/next/assets/control-queries-DOZR-D8G.js +0 -2
  371. package/dist/core/web/public/next/assets/dock-panes-UKS-mXhr.js +0 -2
  372. package/dist/core/web/public/next/assets/dock-panes-UKS-mXhr.js.map +0 -1
  373. package/dist/core/web/public/next/assets/fleet-queries-BSdRlUwJ.js +0 -2
  374. package/dist/core/web/public/next/assets/git-model-CivuBY_D.js +0 -5
  375. package/dist/core/web/public/next/assets/global-Di2PUgj4.js +0 -2
  376. package/dist/core/web/public/next/assets/global-Di2PUgj4.js.map +0 -1
  377. package/dist/core/web/public/next/assets/global-_tOCFt9y.css +0 -1
  378. package/dist/core/web/public/next/assets/guarded-action-CvOHcqyH.js +0 -2
  379. package/dist/core/web/public/next/assets/guarded-action-CvOHcqyH.js.map +0 -1
  380. package/dist/core/web/public/next/assets/icons-B_yuAgdN.js +0 -2
  381. package/dist/core/web/public/next/assets/icons-B_yuAgdN.js.map +0 -1
  382. package/dist/core/web/public/next/assets/mutations-Dpsql5t7.js +0 -2
  383. package/dist/core/web/public/next/assets/overnight-queries-X-44Gsw5.js +0 -2
  384. package/dist/core/web/public/next/assets/primitives-BDIcUvob.js +0 -1
  385. package/dist/core/web/public/next/assets/reasoning-pref-B9-DJUXP.js +0 -2
  386. package/dist/core/web/public/next/assets/seat-subscription-CH6fW4fJ.js +0 -2
  387. package/dist/core/web/public/next/assets/slots-Ds9ZIqUL.js +0 -3
  388. package/dist/core/web/public/next/assets/surface-data-J52iIGMD.js +0 -2
  389. package/dist/core/web/public/next/assets/surface-prefetch-CgZ-LEJK.js +0 -2
  390. package/dist/core/web/public/next/assets/use-guarded-action-C2HlSzkz.js +0 -2
  391. package/dist/core/web/public/next/assets/use-token-gate-B3IJL6bf.js +0 -2
  392. package/dist/core/web/public/next/assets/useActivity-Bk3XgXjL.js +0 -2
  393. package/dist/core/web/public/next/assets/useActivity-Bk3XgXjL.js.map +0 -1
  394. package/dist/core/web/public/next/assets/useChartWidth-BAtVgn2n.css +0 -1
  395. package/dist/core/web/public/next/assets/useChartWidth-lZ9PrQn0.js +0 -2
  396. package/dist/core/web/public/next/assets/verse-model-D7NZQFAR.js +0 -2
  397. package/dist/core/web/public/next/assets/verse-model-D7NZQFAR.js.map +0 -1
  398. package/dist/core/web/public/next/assets/verse-queries-DvIJcn6Z.js +0 -2
  399. package/dist/core/web/public/next/assets/verse-queries-DvIJcn6Z.js.map +0 -1
  400. package/dist/core/web/public/next/assets/verse-store-DjBWj04q.js +0 -3
  401. package/dist/core/web/public/next/assets/verse-store-DjBWj04q.js.map +0 -1
  402. package/dist/core/web/public/next/assets/verse-ui-store-zafyzXKD.js +0 -3
  403. package/dist/core/web/public/next/assets/warmup-BR6pxAKs.js +0 -3
@@ -1,7 +0,0 @@
1
- import{a as e,i as t,n,s as r,t as i}from"./index-oAAq8XJa.js";import{A as a,O as o,S as s,_ as c,a as l,c as u,f as d,h as f,i as p,it as m,k as h,lt as g,m as _,n as v,o as y,p as b,s as x,t as S}from"./global-Di2PUgj4.js";import{n as C,t as ee}from"./MutationTokenDialog-SkRxqV_I.js";import{n as te,r as ne,t as w}from"./Epistemic-uARPnx9x.js";import{n as T,r as re,t as ie}from"./StatusBadge-BwnBNFQr.js";import{C as ae,_ as oe,a as E,b as se,c as ce,d as le,f as ue,g as de,h as fe,i as D,l as pe,m as me,n as he,o as ge,p as _e,r as ve,s as ye,t as be,u as xe,v as Se,y as Ce}from"./queries-BA4rNGD-.js";import{i as we,n as Te,r as Ee,t as De}from"./mutations-Dpsql5t7.js";import{i as Oe,n as ke,r as Ae,t as je}from"./RouteErrorBoundary-C5SxA2Dg.js";import{r as Me,t as Ne}from"./UniverseView-Dogy_dsB.js";import{t as O}from"./RefreshIndicator-BLnr9IOM.js";import{l as Pe}from"./useChartWidth-lZ9PrQn0.js";import{i as Fe,n as Ie,t as Le}from"./charts-CMSgAUKn.js";import{n as Re,r as ze,s as Be,t as Ve}from"./format-DKrNjdwD.js";import{n as k}from"./BurnDown-x4PWH9JF.js";import{t as He}from"./DiffViewer-B7NWPjIO.js";var A=r(e(),1),Ue=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,We=/^[\\/]{2}/;function Ge(e,t){return t+e.replace(/\\/g,`/`)}var Ke=`popstate`;function qe(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Je(e={}){function t(e,t){let{pathname:n=`/`,search:r=``,hash:i=``}=et(e.location.hash.substring(1));return!n.startsWith(`/`)&&!n.startsWith(`.`)&&(n=`/`+n),Qe(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){let n=e.document.querySelector(`base`),r=``;if(n&&n.getAttribute(`href`)){let t=e.location.href,n=t.indexOf(`#`);r=n===-1?t:t.slice(0,n)}return r+`#`+(typeof t==`string`?t:$e(t))}function r(e,t){Ye(e.pathname.charAt(0)===`/`,`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)}return tt(t,n,r,e)}function j(e,t){if(e===!1||e==null)throw Error(t)}function Ye(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function Xe(){return Math.random().toString(36).substring(2,10)}function Ze(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Qe(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?et(t):t,state:n,key:t&&t.key||r||Xe(),mask:i}}function $e({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function et(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function tt(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=qe(e)?e:Qe(h.location,e,t);n&&n(r,e),l=u()+1;let d=Ze(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=qe(e)?e:Qe(h.location,e,t);n&&n(r,e),l=u();let i=Ze(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return nt(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Ke,d),c=e,()=>{i.removeEventListener(Ke,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function nt(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),j(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:$e(t);return i=i.replace(/ $/,`%20`),!n&&We.test(i)&&(i=r+i),new URL(i,r)}function rt(e,t,n=`/`){return it(e,t,n,!1)}function it(e,t,n,r,i){let a=Ct((typeof t==`string`?et(t):t).pathname||`/`,n);if(a==null)return null;let o=i??at(e),s=null,c=St(a);for(let e=0;s==null&&e<o.length;++e)s=vt(o[e],c,r);return s}function at(e){let t=ot(e);return ct(t),t}function ot(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;j(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=jt([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(j(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ot(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:gt(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=xt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of st(e.path))a(e,t,!0,n)}),t}function st(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=st(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ct(e){e.sort((e,t)=>e.score===t.score?_t(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var lt=/^:[\w-]+$/,ut=3,dt=2,ft=1,pt=10,mt=-2,ht=e=>e===`*`;function gt(e,t){let n=e.split(`/`),r=n.length;return n.some(ht)&&(r+=mt),t&&(r+=dt),n.filter(e=>!ht(e)).reduce((e,t)=>e+(lt.test(t)?ut:t===``?ft:pt),r)}function _t(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function vt(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?bt(u,l,s.matcher,s.compiledParams):yt(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=yt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:jt([a,d.pathname]),pathnameBase:Nt(jt([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=jt([a,d.pathnameBase]))}return o}function yt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=xt(e.path,e.caseSensitive,e.end);return bt(e,t,n,r)}function bt(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=Mt(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=Mt(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function xt(e,t=!1,n=!0){Ye(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function St(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return Ye(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ct(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function wt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?et(e):e,a;return n?(n=At(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?Tt(n.substring(1),`/`):Tt(n,t)):a=t,{pathname:a,search:Pt(r),hash:Ft(i)}}function Tt(e,t){let n=Mt(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Et(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Dt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ot(e){let t=Dt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function kt(e,t,n,r=!1){let i;typeof e==`string`?i=et(e):(i={...e},j(!i.pathname||!i.pathname.includes(`?`),Et(`?`,`pathname`,`search`,i)),j(!i.pathname||!i.pathname.includes(`#`),Et(`#`,`pathname`,`hash`,i)),j(!i.search||!i.search.includes(`#`),Et(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=wt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var At=e=>e.replace(/[\\/]{2,}/g,`/`),jt=e=>At(e.join(`/`));function Mt(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Nt=e=>Mt(e).replace(/^\/*/,`/`),Pt=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ft=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,It=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Lt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Rt(e){return jt(e.map(e=>e.route.path).filter(Boolean))||`/`}var zt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Bt(e,t){let n=e;if(typeof n!=`string`||!Ue.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(zt)try{let e=new URL(window.location.href),r=We.test(n)?new URL(Ge(n,e.protocol)):new URL(n),a=Ct(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{Ye(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Vt=new URL(`http://localhost`);function Ht(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Vt)}catch{return Vt}}function Ut(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Wt(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Gt(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Ut(i,n),s=!Ut(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Wt(e,i)||!Ut(i,a)))throw Error(`External navigation is not allowed`)}var Kt=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Kt);var qt=[`GET`,...Kt];new Set(qt);var Jt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Yt(e){try{return Jt.includes(new URL(e).protocol)}catch{return!1}}var Xt=A.createContext(null);Xt.displayName=`DataRouter`;var Zt=A.createContext(null);Zt.displayName=`DataRouterState`;var Qt=A.createContext(!1);function $t(){return A.useContext(Qt)}var en=A.createContext({isTransitioning:!1});en.displayName=`ViewTransition`;var tn=A.createContext(new Map);tn.displayName=`Fetchers`;var nn=A.createContext(null);nn.displayName=`Await`;var M=A.createContext(null);M.displayName=`Navigation`;var rn=A.createContext(null);rn.displayName=`Location`;var N=A.createContext({outlet:null,matches:[],isDataRoute:!1});N.displayName=`Route`;var an=A.createContext(null);an.displayName=`RouteError`;var on=`REACT_ROUTER_ERROR`,sn=`REDIRECT`,cn=`ROUTE_ERROR_RESPONSE`;function ln(e){if(e.startsWith(`${on}:${sn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function un(e){if(e.startsWith(`${on}:${cn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new It(t.status,t.statusText,t.data)}catch{}}function dn(e,{relative:t}={}){j(fn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=A.useContext(M),{hash:i,pathname:a,search:o}=bn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:jt([n,a])),r.createHref({pathname:s,search:o,hash:i})}function fn(){return A.useContext(rn)!=null}function P(){return j(fn(),`useLocation() may be used only in the context of a <Router> component.`),A.useContext(rn).location}var pn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function mn(e){A.useContext(M).static||A.useLayoutEffect(e)}function hn(){let{isDataRoute:e}=A.useContext(N);return e?Ln():gn()}function gn(){j(fn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=A.useContext(Xt),{basename:t,navigator:n}=A.useContext(M),{matches:r}=A.useContext(N),{pathname:i}=P(),a=JSON.stringify(Ot(r)),o=A.useRef(!1);return mn(()=>{o.current=!0}),A.useCallback((r,s={})=>{if(Ye(o.current,pn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=kt(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:jt([t,c.pathname])),Gt(typeof r==`string`?r:$e(r),n.createHref(c),Ht(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var _n=A.createContext(null);function vn(e){let t=A.useContext(N).outlet;return A.useMemo(()=>t&&A.createElement(_n.Provider,{value:e},t),[t,e])}function yn(){let{matches:e}=A.useContext(N);return e[e.length-1]?.params??{}}function bn(e,{relative:t}={}){let{matches:n}=A.useContext(N),{pathname:r}=P(),i=JSON.stringify(Ot(n));return A.useMemo(()=>kt(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function xn(e,t){return Sn(e,t)}function Sn(e,t,n){j(fn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=A.useContext(M),{matches:i}=A.useContext(N),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;zn(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
-
3
- Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=P(),d;if(t){let e=typeof t==`string`?et(t):t;j(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):rt(e,{pathname:p});Ye(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Ye(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=kn(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:jt([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:jt([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?A.createElement(rn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Cn(){let e=In(),t=Lt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=A.createElement(A.Fragment,null,A.createElement(`p`,null,`💿 Hey developer 👋`),A.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,A.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,A.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),A.createElement(A.Fragment,null,A.createElement(`h2`,null,`Unexpected Application Error!`),A.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?A.createElement(`pre`,{style:i},n):null,o)}var wn=A.createElement(Cn,null),Tn=class extends A.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=un(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:A.createElement(N.Provider,{value:this.props.routeContext},A.createElement(an.Provider,{value:e,children:this.props.component}));return this.context?A.createElement(Dn,{error:e},t):t}};Tn.contextType=Qt;var En=new WeakMap;function Dn({children:e,error:t}){let{basename:n,navigator:r}=A.useContext(M);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=ln(t.digest);if(e){let i=En.get(t);if(i)throw i;let a=Bt(e.location,n),o=a.absoluteURL||a.to;if(Gt(e.location,o,Ht(r),`allow-explicit`),Yt(o))throw Error(`Invalid redirect location`);if(zt&&!En.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw En.set(t,n),n}}return A.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function On({routeContext:e,match:t,children:n}){let r=A.useContext(Xt);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),A.createElement(N.Provider,{value:e},n)}function kn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);j(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Rt(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||wn,o&&(s<0&&c===0?(zn(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?A.createElement(n.route.Component,null):n.route.element?n.route.element:e,A.createElement(On,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?A.createElement(Tn,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function An(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jn(e){let t=A.useContext(Xt);return j(t,An(e)),t}function Mn(e){let t=A.useContext(Zt);return j(t,An(e)),t}function Nn(e){let t=A.useContext(N);return j(t,An(e)),t}function Pn(e){let t=Nn(e),n=t.matches[t.matches.length-1];return j(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Fn(){return Pn(`useRouteId`)}function In(){let e=A.useContext(an),t=Mn(`useRouteError`),n=Pn(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Ln(){let{router:e}=jn(`useNavigate`),t=Pn(`useNavigate`),n=A.useRef(!1);return mn(()=>{n.current=!0}),A.useCallback(async(r,i={})=>{Ye(n.current,pn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Rn={};function zn(e,t,n){!t&&!Rn[e]&&(Rn[e]=!0,Ye(!1,n))}A.memo(Bn);function Bn({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Sn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Vn({to:e,replace:t,state:n,relative:r}){j(fn(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=A.useContext(M);Ye(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=A.useContext(N),{pathname:s}=P(),c=hn(),l=kt(e,Ot(o),s,r===`path`);Gt(typeof e==`string`?e:$e(e),a.createHref(l),Ht(a),`reject`);let u=JSON.stringify(l);return A.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function Hn(e){return vn(e.context)}function F(e){j(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Un({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){j(!fn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=A.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=et(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=A.useMemo(()=>{let e=Ct(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return Ye(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:A.createElement(M.Provider,{value:c},A.createElement(rn.Provider,{children:t,value:h}))}function Wn({children:e,location:t}){return xn(Gn(e),t)}A.Component;function Gn(e,t=[]){let n=[];return A.Children.forEach(e,(e,r)=>{if(!A.isValidElement(e))return;let i=[...t,r];if(e.type===A.Fragment){n.push.apply(n,Gn(e.props.children,i));return}j(e.type===F,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),j(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Gn(e.props.children,i)),n.push(a)}),n}var Kn=`get`,qn=`application/x-www-form-urlencoded`;function Jn(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Yn(e){return Jn(e)&&e.tagName.toLowerCase()===`button`}function Xn(e){return Jn(e)&&e.tagName.toLowerCase()===`form`}function Zn(e){return Jn(e)&&e.tagName.toLowerCase()===`input`}function Qn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function $n(e,t){return e.button===0&&(!t||t===`_self`)&&!Qn(e)}var er=null;function tr(){if(er===null)try{new FormData(document.createElement(`form`),0),er=!1}catch{er=!0}return er}var nr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function rr(e){return e!=null&&!nr.has(e)?(Ye(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${qn}"`),null):e}function ir(e,t){let n,r,i,a,o;if(Xn(e)){let o=e.getAttribute(`action`);r=o?Ct(o,t):null,n=e.getAttribute(`method`)||Kn,i=rr(e.getAttribute(`enctype`))||qn,a=new FormData(e)}else if(Yn(e)||Zn(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Ct(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Kn,i=rr(e.getAttribute(`formenctype`))||rr(o.getAttribute(`enctype`))||qn,a=new FormData(o,e),!tr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Jn(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Kn,r=null,i=qn,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function ar(e,t){if(e===!1||e==null)throw Error(t)}function or(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&Ct(i.pathname,t)===`/`?`${Mt(t)}/_root.${r}`:`${Mt(i.pathname)}.${r}`,i}async function sr(e,t){if(e.id in t)return t[e.id];try{let n=await i(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function cr(e){return e!=null&&typeof e.page==`string`}function lr(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function ur(e,t,n){return hr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await sr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(lr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function dr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function fr(e,t,{includeHydrateFallback:n}={}){return pr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function pr(e){return[...new Set(e)]}function mr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function hr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!cr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(mr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function gr(){let e=A.useContext(Xt);return ar(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function _r(){let e=A.useContext(Zt);return ar(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var vr=A.createContext(void 0);vr.displayName=`FrameworkContext`;function yr(){let e=A.useContext(vr);return ar(e,`You must render this element inside a <HydratedRouter> element`),e}function br(e,t){let n=A.useContext(vr),[r,i]=A.useState(!1),[a,o]=A.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=A.useRef(null);A.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),A.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:xr(s,p),onBlur:xr(c,m),onMouseEnter:xr(l,p),onMouseLeave:xr(u,m),onTouchStart:xr(d,p)}]:[a,f,{}]:[!1,f,{}]}function xr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Sr({page:e,...t}){let n=$t(),{nonce:r}=yr(),{router:i}=gr(),a=A.useMemo(()=>rt(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?A.createElement(wr,{page:e,matches:a,...t}):A.createElement(Tr,{page:e,matches:a,...t})):null}function Cr(e){let{manifest:t,routeModules:n}=yr(),[r,i]=A.useState([]);return A.useEffect(()=>{let r=!1;return ur(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function wr({page:e,matches:t,...n}){let r=P(),{future:i}=yr(),{basename:a}=gr(),o=A.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=or(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return A.createElement(A.Fragment,null,o.map(e=>A.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Tr({page:e,matches:t,...n}){let r=P(),{future:i,manifest:a,routeModules:o}=yr(),{basename:s}=gr(),{loaderData:c,matches:l}=_r(),u=A.useMemo(()=>dr(e,t,l,a,r,`data`),[e,t,l,a,r]),d=A.useMemo(()=>dr(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=A.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=or(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=A.useMemo(()=>fr(d,a),[d,a]),m=Cr(d);return A.createElement(A.Fragment,null,f.map(e=>A.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>A.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>A.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Er(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}A.Component;var Dr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Dr&&(window.__reactRouterVersion=`7.18.4`)}catch{}function Or({basename:e,children:t,useTransitions:n,window:r}){let i=A.useRef();i.current??=Je({window:r,v5Compat:!0});let a=i.current,[o,s]=A.useState({action:a.action,location:a.location}),c=A.useCallback(e=>{n===!1?s(e):A.startTransition(()=>s(e))},[n]);return A.useLayoutEffect(()=>a.listen(c),[a,c]),A.createElement(Un,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var kr=A.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=A.useContext(M),v=typeof l==`string`&&Ue.test(l),y=Bt(l,h);l=y.to;let b=dn(l,{relative:r}),x=P(),S=null;if(o){let e=kt(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:jt([h,e.pathname])),S=g.createHref(e)}let[C,ee,te]=br(n,p),ne=Pr(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function w(t){e&&e(t),t.defaultPrevented||ne(t)}let T=!(y.isExternal||i),re=A.createElement(`a`,{...p,...te,href:(T?S:void 0)||y.absoluteURL||b,onClick:T?w:e,ref:Er(m,ee),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?A.createElement(A.Fragment,null,re,A.createElement(Sr,{page:b})):re});kr.displayName=`Link`;var Ar=A.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=bn(a,{relative:c.relative}),d=P(),f=A.useContext(Zt),{navigator:p,basename:m}=A.useContext(M),h=f!=null&&zr(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=Ct(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,ee;ee=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let te=typeof i==`function`?i(S):i;return A.createElement(kr,{...c,"aria-current":C,className:ee,ref:l,style:te,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Ar.displayName=`NavLink`;var jr=A.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Kn,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=A.useContext(M),g=Lr(),_=Rr(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&Ue.test(s);return A.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?A.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});jr.displayName=`Form`;function Mr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Nr(e){let t=A.useContext(Xt);return j(t,Mr(e)),t}function Pr(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=hn(),d=P(),f=bn(e,{relative:o});return A.useCallback(p=>{if($n(p,t)){p.preventDefault();let t=n===void 0?$e(d)===$e(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?A.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var Fr=0,Ir=()=>`__${String(++Fr)}__`;function Lr(){let{router:e}=Nr(`useSubmit`),{basename:t}=A.useContext(M),n=Fn(),r=e.fetch,i=e.navigate;return A.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=ir(e,t);if(a.navigate===!1){let e=a.fetcherKey||Ir();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Rr(e,{relative:t}={}){let{basename:n}=A.useContext(M),r=A.useContext(N);j(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...bn(e||`.`,{relative:t})},o=P();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:jt([n,a.pathname])),$e(a)}function zr(e,{relative:t}={}){let n=A.useContext(en);j(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Nr(`useViewTransitionState`),i=bn(e,{relative:t});if(!n.isTransitioning)return!1;let a=Ct(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ct(n.nextLocation.pathname,r)||n.nextLocation.pathname;return yt(i.pathname,o)!=null||yt(i.pathname,a)!=null}var Br=[{id:`overview`,label:`Overview`,leaves:[{path:`/overview`,label:`Fleet Dashboard`,description:`Repos, activity, runs, swarms, MCP health, genome, and daemon status at a glance.`,implemented:!0},{path:`/agent-os`,label:`Agent OS`,description:`Authenticated, observation-only decision spine for capability runway and value bets.`,implemented:!0},{path:`/universe`,label:`Universe`,description:`Compare experiments, follow variant lineages, and inspect the retained population.`,implemented:!0}]},{id:`journal`,label:`Journal`,leaves:[{path:`/journal`,label:`Work Journal`,description:`Chronological, filterable, scrubable record of runs, merges, judge verdicts, and daemon ticks — with live streaming into any in-progress run.`,implemented:!0}]},{id:`work`,label:`Work`,leaves:[{path:`/work/runs`,label:`Runs`,description:`Dispatched goal runs and their token burn.`,implemented:!0},{path:`/work/swarms`,label:`Swarms`,description:`Multi-task DAG runs with live burndown.`,implemented:!0}]},{id:`inbox`,label:`Inbox`,leaves:[{path:`/inbox`,label:`Proposals`,description:`Review, filter, and approve/reject proposals — including history (rejected/approved).`,implemented:!0}]},{id:`control`,label:`Control`,leaves:[{path:`/control/daemon`,label:`Daemon`,description:`Autonomous operator state, spend, and direction mode.`,implemented:!0},{path:`/control/fleet`,label:`Fleet`,description:`Queue depth, lease health, and the kill switch.`,implemented:!0},{path:`/control/security`,label:`Security`,description:`Supply-chain / binshield findings from the cached backlog.`,implemented:!0}]},{id:`intelligence`,label:`Intelligence`,leaves:[{path:`/intelligence/pulse`,label:`Pulse`,description:`Activity rollups over the dashboard window.`,implemented:!0},{path:`/intelligence/genome`,label:`Genome`,description:`Cross-repo knowledge search and recall.`,implemented:!0},{path:`/intelligence/production`,label:`Production`,description:`Ships-per-day, judge verdicts, auto-merges.`,implemented:!0}]},{id:`portfolio`,label:`Portfolio`,leaves:[{path:`/portfolio`,label:`Portfolio`,description:`Org-level roll-up across enrolled repos.`,implemented:!0}]},{id:`goals`,label:`Goals`,leaves:[{path:`/goals`,label:`Goals`,description:`Active goals and milestone progress.`,implemented:!0}]}],Vr=Br.flatMap(e=>e.leaves),Hr={sidebar:`_sidebar_vbjva_1`,brand:`_brand_vbjva_11`,brandMark:`_brandMark_vbjva_19`,group:`_group_vbjva_23`,groupLabel:`_groupLabel_vbjva_27`,leaves:`_leaves_vbjva_37`,link:`_link_vbjva_43`,active:`_active_vbjva_60`,soon:`_soon_vbjva_66`},I=n();function Ur(){return(0,I.jsxs)(`nav`,{className:Hr.sidebar,"aria-label":`Primary`,children:[(0,I.jsxs)(`div`,{className:Hr.brand,children:[(0,I.jsx)(`span`,{className:Hr.brandMark,"aria-hidden":`true`,children:`▲`}),(0,I.jsx)(`span`,{className:Hr.brandName,children:`ashlr`})]}),Br.map(e=>(0,I.jsxs)(`div`,{className:Hr.group,children:[(0,I.jsx)(`h2`,{className:Hr.groupLabel,children:e.label}),(0,I.jsx)(`ul`,{className:Hr.leaves,children:e.leaves.map(e=>(0,I.jsx)(`li`,{children:(0,I.jsxs)(Ar,{to:e.path,className:({isActive:e})=>`${Hr.link} ${e?Hr.active:``}`,children:[e.label,e.implemented?null:(0,I.jsx)(`span`,{className:Hr.soon,children:`soon`})]})},e.path))})]},e.id))]})}var Wr=18e4,Gr=72e5,Kr=864e5;function qr(e){let t=e.toLowerCase();return t.includes(`proposal`)||t.includes(`inbox`)?`/inbox`:t.includes(`security`)||t.includes(`audit`)?`/control/security`:t.includes(`evidence`)||t.includes(`fleet`)||t.includes(`queue`)?`/control/fleet`:`/control/daemon`}function Jr(e){let t=[],n=Date.now();for(let r of e.fleet?.nextActions??[])t.push({id:`next-action-${r.id}`,category:`action-required`,severity:r.priority,title:r.label,detail:r.detail,ts:new Date(n).toISOString(),actionHref:qr(r.id),actionLabel:`Inspect`});let r=e.fleet?.autonomousShipReadiness;r&&(r.verdict===`blocked`&&r.topBlocker?t.push({id:`readiness-blocked-${r.topBlocker.id}`,category:`readiness`,severity:r.topBlocker.severity,title:`Autonomous readiness is blocked`,detail:r.topBlocker.detail,ts:r.freshness.generatedAt,actionHref:`/control/fleet`,actionLabel:`Inspect fleet`}):r.verdict===`unknown`&&t.push({id:`readiness-unknown`,category:`readiness`,severity:`medium`,title:`Autonomous readiness is unknown`,detail:`Fresh, authoritative state is required before autonomous operation can be treated as clear.`,ts:r.freshness.generatedAt,actionHref:`/control/fleet`,actionLabel:`Inspect fleet`}));let i=e.control?.security;if(i?.available){if(i.counts.critical>0){let e=i.findings.find(e=>e.severity===`critical`);t.push({id:`security-critical`,category:`security`,severity:`critical`,title:`${i.counts.critical} critical security finding${i.counts.critical===1?``:`s`}`,detail:e?`${e.repo}: ${e.title}`:`See the security backlog for details.`,ts:new Date(n).toISOString(),actionHref:`/control/security`,actionLabel:`Review findings`})}else if(i.counts.high>0){let e=i.findings.find(e=>e.severity===`high`);t.push({id:`security-high`,category:`security`,severity:`high`,title:`${i.counts.high} high-severity security finding${i.counts.high===1?``:`s`}`,detail:e?`${e.repo}: ${e.title}`:`See the security backlog for details.`,ts:new Date(n).toISOString(),actionHref:`/control/security`,actionLabel:`Review findings`})}}for(let r of e.control?.limits??[])r.standing===`over`?t.push({id:`budget-over-${r.backend}-${r.window}`,category:`budget`,severity:`high`,title:`${r.backend} is over its ${r.window} limit`,detail:`${r.used.toLocaleString()} / ${r.max.toLocaleString()} used.`,ts:new Date(n).toISOString(),actionHref:`/control/daemon`,actionLabel:`Review usage`}):r.standing===`warn`&&t.push({id:`budget-warn-${r.backend}-${r.window}`,category:`budget`,severity:`medium`,title:`${r.backend} is approaching its ${r.window} limit`,detail:`${r.used.toLocaleString()} / ${r.max.toLocaleString()} used.`,ts:new Date(n).toISOString(),actionHref:`/control/daemon`,actionLabel:`Review usage`});let a=e.control?.daemon;if(a&&(a.sourceQuality.sourceState!==`healthy`||a.sourceQuality.complete===!1)){let e=a.sourceQuality.reason;t.push({id:`daemon-health-degraded`,category:`daemon-health`,severity:e===`missing`||e===`unavailable`?`high`:`medium`,title:`Daemon state cannot be confirmed`,detail:e?`Source: ${e}.`:`The daemon state source is degraded or incomplete.`,ts:new Date(n).toISOString(),actionHref:`/control/daemon`,actionLabel:`Inspect daemon`,sourceQuality:a.sourceQuality})}if(e.inbox&&e.inbox.pending>0){let r=e.inbox.proposals.reduce((e,t)=>{let n=new Date(t.createdAt).getTime();return e===null||n<e?n:e},null),i=r===null?0:n-r,a=i>Gr?`high`:`medium`;t.push({id:`proposal-backlog`,category:`proposal`,severity:a,title:`${e.inbox.pending} proposal${e.inbox.pending===1?``:`s`} awaiting review`,detail:i>Gr?`Oldest has been waiting ${Math.round(i/36e5)}h.`:`Approve, reject, or leave for autonomous handling per policy.`,ts:r===null?new Date(n).toISOString():new Date(r).toISOString(),actionHref:`/inbox`,actionLabel:`Open inbox`})}for(let r of e.runs??[]){if(r.status===`failed`||r.status===`aborted`){if(n-new Date(r.updatedAt).getTime()>Kr)continue;t.push({id:`run-failed-${r.id}`,category:`run`,severity:r.status===`failed`?`high`:`medium`,title:`Run ${r.status}: ${r.goal}`,detail:r.result??r.terminationReason??`Run ${r.id} ${r.status}.`,ts:r.updatedAt,actionHref:`/work/runs/${r.id}`,actionLabel:`Open run`});continue}if(r.status===`running`){let e=n-new Date(r.updatedAt).getTime();e>Wr&&t.push({id:`run-stalled-${r.id}`,category:`run`,severity:`medium`,title:`No update from a running run in ${Math.round(e/6e4)}m`,detail:r.goal,ts:r.updatedAt,actionHref:`/work/runs/${r.id}`,actionLabel:`Watch live`})}}return t}function Yr(e){let t={critical:0,high:1,medium:2,low:3,info:4};return[...e].sort((e,n)=>{let r=t[e.severity]-t[n.severity];return r===0?new Date(n.ts).getTime()-new Date(e.ts).getTime():r})}var Xr=`ashlr.notifications.mutedCategories.v1`,Zr=`ashlr.notifications.desktopEnabled.v1`;function Qr(){try{let e=localStorage.getItem(Xr);if(!e)return new Set;let t=JSON.parse(e);if(Array.isArray(t))return new Set(t)}catch{}return new Set}function $r(e){try{localStorage.setItem(Xr,JSON.stringify([...e]))}catch{}}function ei(){try{return localStorage.getItem(Zr)===`1`}catch{return!1}}function ti(){return typeof Notification>`u`?`unsupported`:Notification.permission}var ni=Qr(),ri=[],ii=!1,ai=ei(),oi=new Set,si={items:[],panelOpen:!1,mutedCategories:[...ni],desktopEnabled:ai,desktopPermission:ti()},ci=new Set;function li(){for(let e of ci)e()}function ui(){si={items:Yr(ri.filter(e=>!ni.has(e.category))),panelOpen:ii,mutedCategories:[...ni],desktopEnabled:ai,desktopPermission:ti()},li()}function di(e){return ci.add(e),()=>ci.delete(e)}function fi(){return si}function pi(e){let t=new Set(ri.map(e=>e.id));if(ri=e,ai&&ti()===`granted`){for(let n of e)if(!ni.has(n.category)&&(n.severity===`critical`||n.severity===`high`)&&!(t.has(n.id)||oi.has(n.id))){oi.add(n.id);try{new Notification(n.title,{body:n.detail,tag:n.id})}catch{}}}for(let t of e)oi.add(t.id);ui()}function mi(){ii=!0,ui()}function hi(){ii=!1,ui()}function gi(){ii=!ii,ui()}function _i(e){return ni.has(e)}function vi(e,t){t?ni.add(e):ni.delete(e),$r(ni),ui()}async function yi(){if(typeof Notification>`u`)return`unsupported`;let e=Notification.permission;e==="default"&&(e=await Notification.requestPermission()),ai=e===`granted`;try{localStorage.setItem(Zr,ai?`1`:`0`)}catch{}return ui(),e}function bi(){ai=!1;try{localStorage.setItem(Zr,`0`)}catch{}ui()}function xi(){return(0,A.useSyncExternalStore)(di,fi,fi)}var Si={bell:`_bell_c1uhc_1`,badge:`_badge_c1uhc_25`,badgeUrgent:`_badgeUrgent_c1uhc_41`};function Ci(){let{items:e}=xi(),t=e.filter(e=>e.severity===`critical`||e.severity===`high`).length,n=e.length,r=(0,A.useRef)(t),[i,a]=(0,A.useState)(``);return(0,A.useEffect)(()=>{if(t>r.current){let e=t-r.current;a(`${e} new urgent notification${e===1?``:`s`}, ${t} urgent total.`)}r.current=t},[t]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`button`,{type:`button`,className:Si.bell,onClick:gi,"aria-haspopup":`dialog`,"aria-label":n===0?`Notifications, none open`:`Notifications, ${n} open, ${t} urgent`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`🔔`}),n>0?(0,I.jsx)(`span`,{className:`${Si.badge} ${t>0?Si.badgeUrgent:``}`,"aria-hidden":`true`,children:n>99?`99+`:n}):null]}),(0,I.jsx)(`div`,{"aria-live":`polite`,className:`visually-hidden`,children:i})]})}function wi(e){switch(e){case`critical`:return`danger`;case`high`:return`warning`;case`medium`:return`running`;case`low`:return`neutral`;case`info`:return`info`}}var Ti={"action-required":`Action required`,readiness:`Autonomous readiness`,security:`Security`,budget:`Budget & limits`,"daemon-health":`Daemon health`,proposal:`Proposals`,run:`Runs`,"log-source":`Log source`},Ei={item:`_item_1gxz9_1`,top:`_top_1gxz9_15`,category:`_category_1gxz9_21`,time:`_time_1gxz9_26`,title:`_title_1gxz9_32`,detail:`_detail_1gxz9_39`,actions:`_actions_1gxz9_45`,actionLink:`_actionLink_1gxz9_52`,muteBtn:`_muteBtn_1gxz9_58`};function Di(e){let t=Math.max(0,Math.round((Date.now()-new Date(e).getTime())/1e3));if(t<5)return`just now`;if(t<60)return`${t}s ago`;let n=Math.round(t/60);if(n<60)return`${n}m ago`;let r=Math.round(n/60);return r<48?`${r}h ago`:`${Math.round(r/24)}d ago`}function Oi({item:e}){let t=_i(e.category);return(0,I.jsxs)(`article`,{className:Ei.item,"data-focus-key":`notification-${e.id}`,children:[(0,I.jsxs)(`div`,{className:Ei.top,children:[(0,I.jsx)(T,{status:e.severity,tone:wi(e.severity),children:e.severity.toUpperCase()}),(0,I.jsx)(`span`,{className:Ei.category,children:Ti[e.category]}),(0,I.jsx)(`span`,{className:Ei.time,title:new Date(e.ts).toLocaleString(),children:Di(e.ts)})]}),(0,I.jsx)(`h3`,{className:Ei.title,children:e.title}),(0,I.jsx)(`p`,{className:Ei.detail,children:e.sourceQuality?(0,I.jsx)(w,{quality:e.sourceQuality,label:e.title,children:e.detail}):e.detail}),(0,I.jsxs)(`div`,{className:Ei.actions,children:[e.actionHref?(0,I.jsx)(`a`,{className:Ei.actionLink,href:`#${e.actionHref}`,"data-focus-key":`notification-${e.id}-action`,children:e.actionLabel??`Open`}):null,(0,I.jsx)(`button`,{type:`button`,className:Ei.muteBtn,onClick:()=>vi(e.category,!t),"aria-pressed":t,children:t?`Unmute ${Ti[e.category]}`:`Mute ${Ti[e.category]}`})]})]})}function ki(){let e=_(ve),t=_(ye),n=_(Se),r=_(le),i=e.data,a=t.data,o=n.data,s=r.data;(0,A.useEffect)(()=>{pi(Jr({control:i,fleet:a,runs:o,inbox:s}))},[i,a,o,s])}var Ai={drawer:`_drawer_itt3q_1`,titleRow:`_titleRow_itt3q_16`,closeBtn:`_closeBtn_itt3q_23`,header:`_header_itt3q_37`,desktopToggle:`_desktopToggle_itt3q_42`,clear:`_clear_itt3q_57`,list:`_list_itt3q_66`,journalLink:`_journalLink_itt3q_77`};function ji(){ki();let{items:e,panelOpen:t,desktopEnabled:n,desktopPermission:r}=xi(),i=(0,A.useRef)(null);async function a(){n?bi():await yi()}return(0,I.jsxs)(C,{open:t,onClose:hi,titleId:`notification-center-title`,title:(0,I.jsxs)(`span`,{className:Ai.titleRow,children:[(0,I.jsx)(`span`,{children:`Notifications`}),(0,I.jsx)(`button`,{type:`button`,ref:i,className:Ai.closeBtn,onClick:hi,"aria-label":`Close notifications`,children:`×`})]}),widthClassName:Ai.drawer,initialFocusRef:i,children:[(0,I.jsx)(`div`,{className:Ai.header,children:(0,I.jsx)(`button`,{type:`button`,className:Ai.desktopToggle,onClick:()=>void a(),disabled:r===`unsupported`||r===`denied`,children:r===`unsupported`?`Desktop alerts not supported in this browser`:r===`denied`?`Desktop alerts blocked in browser settings`:n?`🔔 Desktop alerts on`:`🔕 Desktop alerts off — enable`})}),e.length===0?(0,I.jsxs)(`div`,{className:Ai.clear,children:[(0,I.jsx)(`strong`,{children:`Nothing needs you right now.`}),(0,I.jsx)(`span`,{children:`The fleet is operating within its observed authority.`})]}):(0,I.jsx)(`ul`,{className:Ai.list,children:e.map(e=>(0,I.jsx)(`li`,{children:(0,I.jsx)(Oi,{item:e})},e.id))}),(0,I.jsx)(`a`,{href:`#/journal`,className:Ai.journalLink,onClick:hi,children:`See full history in the Work Journal →`})]})}var Mi={topbar:`_topbar_nwlse_1`,paletteTrigger:`_paletteTrigger_nwlse_12`,kbd:`_kbd_nwlse_32`,actions:`_actions_nwlse_41`,lockedIndicator:`_lockedIndicator_nwlse_47`,lockBtn:`_lockBtn_nwlse_52`,themeBtn:`_themeBtn_nwlse_60`};function Ni({onOpenPalette:e}){let{theme:t,cycle:n}=c(),r=b();return(0,I.jsxs)(`header`,{className:Mi.topbar,children:[(0,I.jsxs)(`button`,{type:`button`,className:Mi.paletteTrigger,onClick:e,children:[(0,I.jsx)(`span`,{children:`Search or run a command`}),(0,I.jsx)(`kbd`,{className:Mi.kbd,children:`⌘K`})]}),(0,I.jsxs)(`div`,{className:Mi.actions,children:[(0,I.jsx)(Ci,{}),r.hasHold?(0,I.jsx)(`button`,{type:`button`,className:Mi.lockBtn,onClick:r.clear,title:`Lock actions now`,children:`🔓 Unlocked`}):(0,I.jsx)(`span`,{className:Mi.lockedIndicator,title:`Actions require the dispatch token`,children:`🔒 Locked`}),(0,I.jsx)(`button`,{type:`button`,className:Mi.themeBtn,onClick:n,"aria-label":`Theme: ${t}`,children:t===`system`?`🖥️`:t===`light`?`☀️`:`🌙`})]}),(0,I.jsx)(ji,{})]})}var Pi=r(t(),1),Fi=Vr.map(e=>({id:`nav:${e.path}`,title:e.label,subtitle:e.description,group:`Navigate`,run:t=>t(e.path)})),Ii=[{id:`action:pause-fleet`,title:`Pause fleet`,subtitle:`Engage the fleet kill switch`,group:`Actions`,keywords:[`stop`,`kill`,`halt`],requiresConfirm:{title:`Pause the fleet?`,body:`This engages the global kill switch. Autonomous dispatch halts fleet-wide until explicitly resumed.`,confirmLabel:`Yes, pause`},requiresMutationToken:!0,run:async()=>{await Te()}},{id:`action:resume-fleet`,title:`Resume fleet`,subtitle:`Clear the fleet kill switch`,group:`Actions`,keywords:[`start`,`unpause`],requiresConfirm:{title:`Resume the fleet?`,body:`This clears the global kill switch. Autonomous dispatch will resume across the fleet.`,confirmLabel:`Yes, resume`},requiresMutationToken:!0,run:async()=>{await we()}},{id:`action:open-notifications`,title:`Open notification centre`,subtitle:`What needs you right now, ranked by severity`,group:`Actions`,keywords:[`alerts`,`attention`,`bell`,`needs you`],run:()=>{mi()}},{id:`action:toggle-theme`,title:`Toggle theme`,subtitle:`Cycle system → light → dark`,group:`Actions`,keywords:[`dark mode`,`light mode`,`appearance`,`dark`,`light`],run:()=>{s()}},{id:`action:open-journal-today`,title:`Open journal — today`,subtitle:`Work journal filtered to today`,group:`Actions`,keywords:[`journal`,`today`,`log`,`history`],run:e=>{e(`/journal`,{state:{windowToday:!0}})}}],Li=[...Fi,...Ii];function Ri(){g(Se.key,Se.fetch),g(pe.key,pe.fetch);let e=xe({status:`all`,limit:500});g(e.key,e.fetch)}var zi=5,Bi=2;function Vi(e,t){return e.toLowerCase().includes(t)}function Hi(e){let t=e.trim().toLowerCase();if(t.length<Bi)return[];let n=[],r=m(Se.key).data??[];for(let e of r){if(n.length>=zi)break;(Vi(e.id,t)||Vi(e.goal,t))&&n.push({id:`jump:run:${e.id}`,title:e.goal,subtitle:`Run ${e.id} · ${e.status}`,group:`Jump to`,run:t=>t(`/work/runs/${e.id}`)})}let i=m(pe.key).data??[],a=0;for(let e of i){if(a>=zi)break;(Vi(e.id,t)||Vi(e.objective,t))&&(a++,n.push({id:`jump:goal:${e.id}`,title:e.objective,subtitle:`Goal ${e.id} · ${e.status}`,group:`Jump to`,run:e=>e(`/goals`)}))}let o=xe({status:`all`,limit:500}).key,s=m(o).data?.proposals??[],c=0;for(let e of s){if(c>=zi)break;(Vi(e.id,t)||Vi(e.title,t))&&(c++,n.push({id:`jump:proposal:${e.id}`,title:e.title,subtitle:`Proposal ${e.id} · ${e.status}`,group:`Jump to`,run:t=>t(`/inbox/${encodeURIComponent(e.id)}`)}))}return n}var Ui=/^\/inbox\/([^/]+)$/;function Wi(e){let t=Ui.exec(e);if(!t)return[];let n=decodeURIComponent(t[1]),r=m(`proposal-detail-${n}`).data;return!r||r.status!==`pending`?[]:[{id:`action:approve-proposal:${n}`,title:`Approve "${r.title}"`,subtitle:`Writes the diff to disk and dispatches it`,group:`Actions`,keywords:[`approve`,`ship`,`proposal`],requiresConfirm:{title:`Approve this proposal?`,body:`"${r.title}" will be applied. This writes the diff to disk and dispatches it.`,confirmLabel:`Approve`},requiresMutationToken:!0,run:async()=>{await De(n)}},{id:`action:reject-proposal:${n}`,title:`Reject "${r.title}"`,subtitle:`Cannot be undone`,group:`Actions`,keywords:[`reject`,`decline`,`proposal`],requiresConfirm:{title:`Reject this proposal?`,body:`"${r.title}" will be rejected. This cannot be undone.`,confirmLabel:`Reject`,destructive:!0},requiresMutationToken:!0,run:async()=>{await Ee(n)}}]}function Gi(e,t=[]){let n=e.trim().toLowerCase(),r=[...t,...Li];return[...n?r.filter(e=>{let t=[e.title,e.subtitle??``,...e.keywords??[]].join(` `).toLowerCase();return n.split(/\s+/).every(e=>t.includes(e))}):r,...Hi(e)]}var Ki={backdrop:`_backdrop_1odjm_1`,panel:`_panel_1odjm_12`,input:`_input_1odjm_24`,list:`_list_1odjm_37`,item:`_item_1odjm_42`,active:`_active_1odjm_51`,itemTitle:`_itemTitle_1odjm_55`,itemSubtitle:`_itemSubtitle_1odjm_61`,itemGroup:`_itemGroup_1odjm_67`,empty:`_empty_1odjm_75`};function qi(e){(0,A.useEffect)(()=>{function t(t){(t.metaKey||t.ctrlKey)&&t.key.toLowerCase()===`k`&&(t.preventDefault(),e(!0))}return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e])}function Ji({open:e,onClose:t}){let[n,r]=(0,A.useState)(``),[i,a]=(0,A.useState)(0),[o,s]=(0,A.useState)(null),[c,l]=(0,A.useState)(!1),[u,d]=(0,A.useState)(!1),f=(0,A.useRef)(null),p=(0,A.useId)(),m=hn(),g=P(),_=Ae(),v=(0,A.useMemo)(()=>e?Wi(g.pathname):[],[e,g.pathname]),y=(0,A.useMemo)(()=>Gi(n,v),[n,v]);(0,A.useEffect)(()=>{if(!e)return;let t=document.activeElement;r(``),a(0),Ri();let n=requestAnimationFrame(()=>f.current?.focus());return()=>{cancelAnimationFrame(n),t?.focus()}},[e]),(0,A.useEffect)(()=>{a(0)},[n]),(0,A.useEffect)(()=>{a(e=>Math.min(e,Math.max(y.length-1,0)))},[y.length]);async function b(e){try{await e.run((e,t)=>m(e,t))}catch(e){_.show(e instanceof Error?e.message:`Command failed.`,`danger`)}finally{s(null)}}function x(e){if(t(),e.requiresConfirm){s(e),l(!0);return}if(e.requiresMutationToken&&!h()){s(e),d(!0);return}b(e)}function S(){l(!1),o&&(o.requiresMutationToken&&!h()?d(!0):b(o))}function C(){l(!1),s(null)}function te(e){if(e.key===`Escape`){t();return}if(e.key===`Tab`){e.preventDefault();return}if(e.key===`ArrowDown`)e.preventDefault(),a(e=>Math.min(e+1,y.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),a(e=>Math.max(e-1,0));else if(e.key===`Enter`){e.preventDefault();let t=y[i];t&&x(t)}}return(0,I.jsxs)(I.Fragment,{children:[e?(0,Pi.createPortal)((0,I.jsx)(`div`,{className:Ki.backdrop,onMouseDown:e=>e.target===e.currentTarget&&t(),children:(0,I.jsxs)(`div`,{className:Ki.panel,role:`dialog`,"aria-modal":`true`,"aria-label":`Command palette`,children:[(0,I.jsx)(`input`,{ref:f,className:Ki.input,value:n,onChange:e=>r(e.target.value),onKeyDown:te,placeholder:`Navigate or run a command…`,role:`combobox`,"aria-expanded":`true`,"aria-controls":p,"aria-activedescendant":y[i]?`cmd-${y[i].id}`:void 0,autoComplete:`off`}),(0,I.jsx)(`ul`,{id:p,role:`listbox`,className:Ki.list,children:y.length===0?(0,I.jsx)(`li`,{className:Ki.empty,children:`No matching commands.`}):y.map((e,t)=>(0,I.jsxs)(`li`,{id:`cmd-${e.id}`,role:`option`,"aria-selected":t===i,className:`${Ki.item} ${t===i?Ki.active:``}`,onMouseEnter:()=>a(t),onMouseDown:t=>{t.preventDefault(),x(e)},children:[(0,I.jsx)(`span`,{className:Ki.itemTitle,children:e.title}),e.subtitle?(0,I.jsx)(`span`,{className:Ki.itemSubtitle,children:e.subtitle}):null,(0,I.jsx)(`span`,{className:Ki.itemGroup,children:e.group})]},e.id))})]})}),document.body):null,o?.requiresConfirm?(0,I.jsx)(Oe,{open:c,onClose:C,title:o.requiresConfirm.title,body:o.requiresConfirm.body,confirmLabel:o.requiresConfirm.confirmLabel,destructive:o.requiresConfirm.destructive,onConfirm:S}):null,(0,I.jsx)(ee,{open:u,onClose:()=>{d(!1),s(null)},onUnlocked:()=>{let e=o;d(!1),s(null),e&&b(e)},reason:o?`"${o.title}" requires the dispatch token.`:void 0})]})}var Yi={shell:`_shell_2db09_1`,body:`_body_2db09_9`,main:`_main_2db09_17`};function Xi(){let e=(0,A.useRef)(null),t=P(),[n,r]=(0,A.useState)(!1);return Me(t.pathname,e),qi(r),(0,I.jsxs)(`div`,{className:Yi.shell,children:[(0,I.jsx)(Ur,{}),(0,I.jsxs)(`div`,{className:Yi.body,children:[(0,I.jsx)(Ni,{onOpenPalette:()=>r(!0)}),(0,I.jsx)(`main`,{ref:e,className:Yi.main,id:`main-content`,tabIndex:-1,children:(0,I.jsx)(je,{resetKey:t.pathname,children:(0,I.jsx)(Hn,{})})})]}),(0,I.jsx)(Ji,{open:n,onClose:()=>r(!1)})]})}var Zi={wrap:`_wrap_152mr_1`,title:`_title_152mr_6`,description:`_description_152mr_13`,note:`_note_152mr_19`};function Qi({title:e,description:t}){return(0,I.jsxs)(`div`,{className:Zi.wrap,children:[(0,I.jsx)(`h1`,{className:Zi.title,children:e}),(0,I.jsx)(`p`,{className:Zi.description,children:t}),(0,I.jsx)(`p`,{className:Zi.note,children:`Not built yet — this route, its nav entry, and its ⌘K command all already work.`})]})}var $i={grid:`_grid_1exd8_1`,stat:`_stat_1exd8_7`,statLabel:`_statLabel_1exd8_17`,statValue:`_statValue_1exd8_24`,statCaption:`_statCaption_1exd8_30`};function ea(){return(0,I.jsx)(p,{count:6})}function ta({label:e,value:t,caption:n}){return(0,I.jsxs)(`div`,{className:$i.stat,children:[(0,I.jsx)(`span`,{className:$i.statLabel,children:e}),(0,I.jsx)(`span`,{className:$i.statValue,children:t}),n?(0,I.jsx)(`span`,{className:$i.statCaption,children:n}):null]})}function na({snapshot:e}){let t=e.mcp.filter(e=>e.ok).length;return(0,I.jsxs)(`div`,{className:$i.grid,children:[(0,I.jsx)(ta,{label:`Repos`,value:String(e.repos.total),caption:`${e.repos.dirty} dirty · ${e.repos.stale} stale`}),(0,I.jsx)(ta,{label:`Tools`,value:`${e.tools.installed}/${e.tools.total}`,caption:`installed`}),(0,I.jsx)(ta,{label:`Activity`,value:String(e.activity.sessions),caption:`${e.activity.tokens.toLocaleString()} tok · $${e.activity.estCostUsd.toFixed(2)}`}),(0,I.jsx)(ta,{label:`MCP`,value:`${t}/${e.mcp.length}`,caption:`reachable`}),(0,I.jsx)(ta,{label:`Genome`,value:String(e.genome.entries),caption:`${e.genome.projects} projects`}),(0,I.jsx)(ta,{label:`Inbox`,value:String(e.inbox.pending),caption:`pending`})]})}var L={panel:`_panel_1gx0q_3`,panelHeader:`_panelHeader_1gx0q_10`,panelTitle:`_panelTitle_1gx0q_25`,panelBody:`_panelBody_1gx0q_33`,emptyState:`_emptyState_1gx0q_37`},ra={table:`_table_78j3m_1`,statusCol:`_statusCol_78j3m_27`,tokensCol:`_tokensCol_78j3m_31`,goalLink:`_goalLink_78j3m_35`,tokens:`_tokens_78j3m_31`};function ia(){return(0,I.jsxs)(`details`,{className:L.panel,open:!0,"data-state-key":`fleet-dashboard-runs`,children:[(0,I.jsx)(`summary`,{className:L.panelHeader,children:(0,I.jsx)(`span`,{className:L.panelTitle,children:`Recent runs`})}),(0,I.jsxs)(`div`,{className:L.panelBody,children:[(0,I.jsx)(y,{}),(0,I.jsx)(y,{}),(0,I.jsx)(y,{})]})]})}function aa({runs:e}){return(0,I.jsxs)(`details`,{className:L.panel,open:!0,"data-state-key":`fleet-dashboard-runs`,children:[(0,I.jsxs)(`summary`,{className:L.panelHeader,children:[(0,I.jsx)(`span`,{className:L.panelTitle,children:`Recent runs`}),(0,I.jsx)(`span`,{className:`text-tertiary text-xs`,children:e.length})]}),(0,I.jsx)(`div`,{className:L.panelBody,children:e.length===0?(0,I.jsx)(`p`,{className:L.emptyState,children:`No runs yet.`}):(0,I.jsxs)(`table`,{className:ra.table,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,children:`Goal`}),(0,I.jsx)(`th`,{scope:`col`,className:ra.statusCol,children:`Status`}),(0,I.jsx)(`th`,{scope:`col`,className:ra.tokensCol,children:`Tokens`})]})}),(0,I.jsx)(`tbody`,{children:e.map(e=>(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`td`,{children:(0,I.jsx)(`a`,{href:`#/work/runs/${e.id}`,"data-focus-key":`run-${e.id}`,className:ra.goalLink,title:e.goal,children:e.goal})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(T,{status:e.status})}),(0,I.jsx)(`td`,{className:ra.tokens,children:e.tokens.toLocaleString()})]},e.id))})]})})]})}var oa={list:`_list_1fq6m_1`,item:`_item_1fq6m_7`,itemHeader:`_itemHeader_1fq6m_13`,goal:`_goal_1fq6m_21`,burndown:`_burndown_1fq6m_42`,burndownTrack:`_burndownTrack_1fq6m_48`,burndownFill:`_burndownFill_1fq6m_56`,burndownLabel:`_burndownLabel_1fq6m_63`};function sa({swarms:e}){return(0,I.jsxs)(`details`,{className:L.panel,open:!0,"data-state-key":`fleet-dashboard-swarms`,children:[(0,I.jsxs)(`summary`,{className:L.panelHeader,children:[(0,I.jsx)(`span`,{className:L.panelTitle,children:`Swarms`}),(0,I.jsx)(`span`,{className:`text-tertiary text-xs`,children:e.length})]}),(0,I.jsx)(`div`,{className:L.panelBody,children:e.length===0?(0,I.jsx)(`p`,{className:L.emptyState,children:`No active swarms.`}):(0,I.jsx)(`ul`,{className:oa.list,children:e.map((e,t)=>{let n=e.tasksTotal>0?Math.round(e.tasksDone/e.tasksTotal*100):0;return(0,I.jsxs)(`li`,{className:oa.item,children:[(0,I.jsxs)(`a`,{href:`#/work/swarms/${e.id}`,"data-focus-key":`swarm-${e.id}`,className:oa.itemHeader,title:e.goal,children:[e.phase?(0,I.jsx)(ie,{index:t}):null,(0,I.jsx)(`span`,{className:oa.goal,children:e.goal}),(0,I.jsx)(T,{status:e.status})]}),(0,I.jsxs)(`div`,{className:oa.burndown,children:[(0,I.jsx)(`div`,{className:oa.burndownTrack,children:(0,I.jsx)(`div`,{className:oa.burndownFill,style:{width:`${n}%`}})}),(0,I.jsxs)(`span`,{className:oa.burndownLabel,children:[e.tasksDone,`/`,e.tasksTotal,e.phase?` · ${e.phase}`:``]})]})]},e.id)})})})]})}var ca={grid:`_grid_qy4m7_1`};function la(){return(0,I.jsxs)(`details`,{className:L.panel,open:!0,"data-state-key":`fleet-dashboard-daemon`,children:[(0,I.jsx)(`summary`,{className:L.panelHeader,children:(0,I.jsx)(`span`,{className:L.panelTitle,children:`Daemon`})}),(0,I.jsx)(`div`,{className:L.panelBody,children:(0,I.jsx)(l,{width:`40%`})})]})}function ua({daemon:e}){return(0,I.jsxs)(`details`,{className:L.panel,open:!0,"data-state-key":`fleet-dashboard-daemon`,children:[(0,I.jsxs)(`summary`,{className:L.panelHeader,children:[(0,I.jsx)(`span`,{className:L.panelTitle,children:`Daemon`}),(0,I.jsx)(w,{quality:e.sourceQuality,label:`daemon state`,children:(0,I.jsx)(T,{status:e.running?`running`:`pending`,children:e.running?`running`:`stopped`})})]}),(0,I.jsx)(`div`,{className:L.panelBody,children:(0,I.jsxs)(`dl`,{className:ca.grid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Runtime state`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(w,{quality:e.sourceQuality,label:`runtime state`,children:e.runtimeState})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`PID`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(w,{quality:e.sourceQuality,label:`pid`,children:e.pid??`—`})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Today's spend`}),(0,I.jsx)(`dd`,{children:(0,I.jsxs)(w,{quality:e.sourceQuality,label:`spend`,children:[`$`,e.todaySpentUsd.toFixed(2)]})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Direction mode`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(w,{quality:e.sourceQuality,label:`direction mode`,children:e.activeDirectionMode??`none`})})]})]})})]})}var da={view:`_view_1nttk_1`,header:`_header_1nttk_8`,title:`_title_1nttk_14`,freshness:`_freshness_1nttk_20`,freshnessLabel:`_freshnessLabel_1nttk_26`,panels:`_panels_1nttk_32`,error:`_error_1nttk_39`};function fa(){let e=_(E),t=_(ve);return(0,I.jsxs)(`div`,{className:da.view,children:[(0,I.jsxs)(`header`,{className:da.header,children:[(0,I.jsx)(`h1`,{className:da.title,children:`Fleet Dashboard`}),(0,I.jsxs)(`div`,{className:da.freshness,"aria-live":`polite`,children:[e.status===`refreshing`?(0,I.jsx)(O,{}):null,e.updatedAt?(0,I.jsxs)(`span`,{className:da.freshnessLabel,children:[`Updated `,ma(e.updatedAt)]}):null]})]}),e.status===`loading`?(0,I.jsx)(ea,{}):e.status===`error`?(0,I.jsx)(pa,{message:e.error?.message??`Failed to load snapshot.`}):e.data?(0,I.jsx)(na,{snapshot:e.data}):null,(0,I.jsxs)(`div`,{className:da.panels,children:[e.status===`loading`?(0,I.jsx)(ia,{}):e.data?(0,I.jsx)(aa,{runs:e.data.runs}):null,e.data?(0,I.jsx)(sa,{swarms:e.data.swarms}):null,t.status===`loading`?(0,I.jsx)(la,{}):t.status===`error`?(0,I.jsx)(pa,{message:t.error?.message??`Failed to load control snapshot.`}):t.data?(0,I.jsx)(ua,{daemon:t.data.daemon}):null]})]})}function pa({message:e}){return(0,I.jsx)(`div`,{className:da.error,role:`alert`,children:e})}function ma(e){let t=Math.max(0,Math.round((Date.now()-e)/1e3));return t<5?`just now`:t<60?`${t}s ago`:`${Math.round(t/60)}m ago`}var ha={status:`connecting`,chunks:[],outputChunks:[],starts:[],stall:null,runDone:null,version:0};function ga(e){let t=e;try{return JSON.parse(t.data)}catch{return null}}function _a(e,t){let[n,r]=(0,A.useState)(ha);return(0,A.useEffect)(()=>{if(!t){r(ha);return}if(r(ha),typeof EventSource>`u`){r(e=>({...e,status:`unavailable`}));return}let n=`/api/run/${encodeURIComponent(e)}/events?client=${encodeURIComponent(o())}`,i=new EventSource(n,{withCredentials:!0});return i.onopen=()=>{r(e=>e.status===`unavailable`?e:{...e,status:`open`})},i.onerror=()=>{r(e=>e.status===`open`?e:{...e,status:`unavailable`})},i.addEventListener(`step-started`,e=>{let t=ga(e);t&&r(e=>({...e,starts:[...e.starts,t],version:e.version+1}))}),i.addEventListener(`step-output-chunk`,e=>{let t=ga(e);t&&r(e=>({...e,chunks:[...e.chunks,t],version:e.version+1}))}),i.addEventListener(`step-done`,()=>{r(e=>({...e,stall:null,version:e.version+1}))}),i.addEventListener(`output-chunk`,e=>{let t=ga(e);t&&r(e=>({...e,outputChunks:[...e.outputChunks,t],version:e.version+1}))}),i.addEventListener(`stall`,e=>{let t=ga(e);t&&r(e=>({...e,stall:{ageMs:t.ageMs,at:Date.now()},version:e.version+1}))}),i.addEventListener(`run-done`,e=>{let t=ga(e);r(e=>({...e,runDone:t??{status:`done`,result:null,terminationReason:null},stall:null,version:e.version+1}))}),()=>{i.close()}},[e,t]),n}var va=2e3,ya=va*4;function ba(e){return e?`${e.status}:${e.steps.length}:${e.updatedAt}`:null}function xa(e){let t=(0,A.useMemo)(()=>oe(e),[e]),n=_(t),r=f(t),[i,a]=(0,A.useState)(null),[o,s]=(0,A.useState)(null),[,c]=(0,A.useState)(0),l=n.data?n.data.status!==`running`:!1,u=n.error instanceof x&&n.error.status===404,d=_a(e,!l&&!u),p=d.status===`open`?`sse`:`polling`,m=ba(n.data);(0,A.useEffect)(()=>{m!==null&&a(Date.now())},[m]),(0,A.useEffect)(()=>{if(l||u||p===`sse`)return;let e=setInterval(()=>{r(),s(Date.now()),c(e=>e+1)},va);return()=>clearInterval(e)},[r,l,u,p]),(0,A.useEffect)(()=>{p===`sse`&&d.version!==0&&(r(),s(Date.now()))},[d.version,p,r]);let h=va*6,g=p===`sse`&&d.stall!==null&&Date.now()-d.stall.at<h,v;return v=u?`not-found`:n.status===`error`&&n.data===void 0?`error`:n.status===`loading`?`connecting`:n.data?n.data.status===`running`?p===`sse`?g?`stalled`:`live`:i!==null&&Date.now()-i>ya?`stalled`:`live`:`done`:`connecting`,{phase:v,run:n.data,error:n.error,lastChangedAt:i,lastPolledAt:o,pollNow:()=>{r(),s(Date.now())},transport:p,chunks:d.chunks,outputChunks:d.outputChunks,stallAgeMs:g?d.stall.ageMs:null}}var R={panel:`_panel_z6jlr_1`,header:`_header_z6jlr_12`,headerTop:`_headerTop_z6jlr_18`,title:`_title_z6jlr_25`,statRow:`_statRow_z6jlr_35`,banner:`_banner_z6jlr_53`,bannerWarning:`_bannerWarning_z6jlr_64`,bannerDanger:`_bannerDanger_z6jlr_69`,bannerDot:`_bannerDot_z6jlr_74`,livePulse:`_livePulse_z6jlr_1`,transcriptWrap:`_transcriptWrap_z6jlr_102`,transcript:`_transcript_z6jlr_102`,followButton:`_followButton_z6jlr_122`,empty:`_empty_z6jlr_151`,step:`_step_z6jlr_158`,stepKind:`_stepKind_z6jlr_171`,stepTime:`_stepTime_z6jlr_191`,stepTask:`_stepTask_z6jlr_195`,stepSummary:`_stepSummary_z6jlr_202`,stepUsage:`_stepUsage_z6jlr_207`},Sa={plan:`Plan`,model:`Model`,tool:`Tool`,synthesize:`Synthesize`};function Ca(e,t){let n=new Date(e).getTime(),r=t?new Date(t).getTime():Date.now(),i=Math.max(0,Math.round((r-n)/1e3));return i<60?`${i}s`:`${Math.floor(i/60)}m ${i%60}s`}function wa(e){try{return new Date(e).toLocaleTimeString(void 0,{hour12:!1})}catch{return e}}function Ta({phase:e,lastChangedAt:t,stallAgeMs:n,transport:r,error:i}){if(e===`connecting`)return(0,I.jsxs)(`div`,{className:R.banner,role:`status`,children:[(0,I.jsx)(`span`,{className:R.bannerDot,"data-tone":`connecting`,"aria-hidden":`true`}),`Connecting to run…`]});if(e===`not-found`)return(0,I.jsxs)(`div`,{className:`${R.banner} ${R.bannerDanger}`,role:`alert`,children:[(0,I.jsx)(`span`,{className:R.bannerDot,"data-tone":`danger`,"aria-hidden":`true`}),`Run not found. It may have been pruned from disk since this link was opened.`]});if(e===`error`)return(0,I.jsxs)(`div`,{className:`${R.banner} ${R.bannerDanger}`,role:`alert`,children:[(0,I.jsx)(`span`,{className:R.bannerDot,"data-tone":`danger`,"aria-hidden":`true`}),`Stream disconnected`,i?`: ${i.message}`:``,`. Retrying every `,va/1e3,`s…`]});if(e===`stalled`){let e=n===null?t===null?null:Math.round((Date.now()-t)/1e3):Math.round(n/1e3);return(0,I.jsxs)(`div`,{className:`${R.banner} ${R.bannerWarning}`,role:`status`,"aria-live":`polite`,children:[(0,I.jsx)(`span`,{className:R.bannerDot,"data-tone":`warning`,"aria-hidden":`true`}),`No change observed`,e===null?``:` in ${e}s`,` — this run may be stalled, or is simply quiet between steps. Still `,r===`sse`?`watching`:`polling`,`.`]})}return e===`live`?(0,I.jsxs)(`div`,{className:R.banner,role:`status`,children:[(0,I.jsx)(`span`,{className:R.bannerDot,"data-tone":`live`,"aria-hidden":`true`}),r===`sse`?`Live · streaming (server tail ~500ms)`:`Live · polling every ${va/1e3}s (server refresh floor ~1.5s — this cannot be faster than that)`]}):(0,I.jsxs)(`div`,{className:R.banner,role:`status`,children:[(0,I.jsx)(`span`,{className:R.bannerDot,"data-tone":`done`,"aria-hidden":`true`}),`Run finished — no longer `,r===`sse`?`streaming`:`polling`,`.`]})}function Ea(){return(0,I.jsxs)(`div`,{className:R.panel,children:[(0,I.jsx)(l,{width:`40%`}),(0,I.jsx)(l,{width:`90%`}),(0,I.jsx)(l,{width:`70%`})]})}function Da({runId:e}){let{phase:t,run:n,error:r,lastChangedAt:i,transport:a,stallAgeMs:o,outputChunks:s}=xa(e),c=(0,A.useRef)(null),l=(0,A.useRef)(!0),[u,d]=(0,A.useState)(!0),f=(0,A.useRef)(null),p=(0,A.useRef)(!0),[m,h]=(0,A.useState)(!0);(0,A.useEffect)(()=>{let e=c.current;e&&l.current&&(e.scrollTop=e.scrollHeight)},[n?.steps.length]),(0,A.useEffect)(()=>{let e=f.current;e&&p.current&&(e.scrollTop=e.scrollHeight)},[s.length]);function g(){let e=c.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<48;l.current=t,d(t)}function _(){let e=f.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<48;p.current=t,h(t)}function v(){l.current=!0,d(!0);let e=c.current;e&&(e.scrollTop=e.scrollHeight)}function y(){p.current=!0,h(!0);let e=f.current;e&&(e.scrollTop=e.scrollHeight)}return!n&&t===`connecting`?(0,I.jsx)(Ea,{}):(0,I.jsxs)(`div`,{className:R.panel,children:[(0,I.jsxs)(`header`,{className:R.header,children:[(0,I.jsxs)(`div`,{className:R.headerTop,children:[(0,I.jsx)(`h3`,{className:R.title,children:n?.goal??`Run ${e}`}),n?(0,I.jsx)(T,{status:n.status}):null]}),n?(0,I.jsxs)(`dl`,{className:R.statRow,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Elapsed`}),(0,I.jsx)(`dd`,{children:Ca(n.createdAt,n.status===`running`?void 0:n.updatedAt)})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Tokens`}),(0,I.jsxs)(`dd`,{children:[n.usage.tokensIn.toLocaleString(),` in / `,n.usage.tokensOut.toLocaleString(),` out`]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Cost`}),(0,I.jsxs)(`dd`,{children:[`$`,n.usage.estCostUsd.toFixed(3)]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Steps`}),(0,I.jsx)(`dd`,{children:n.steps.length})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Tasks`}),(0,I.jsxs)(`dd`,{children:[n.tasks.filter(e=>e.status===`done`).length,`/`,n.tasks.length]})]})]}):null]}),(0,I.jsx)(Ta,{phase:t,lastChangedAt:i,stallAgeMs:o,transport:a,error:r}),s.length>0?(0,I.jsxs)(`div`,{className:R.transcriptWrap,children:[(0,I.jsx)(`div`,{ref:f,className:R.transcript,onScroll:_,tabIndex:0,role:`log`,"aria-label":`Live engine output`,"aria-live":m?`polite`:`off`,children:s.map((e,t)=>(0,I.jsxs)(`div`,{className:R.step,"data-focus-key":`run-output-chunk-${t}`,children:[(0,I.jsx)(`span`,{className:R.stepKind,"data-kind":e.kind,children:e.kind}),(0,I.jsx)(`span`,{className:R.stepTime,title:e.ts,children:wa(e.ts)}),(0,I.jsx)(`span`,{className:R.stepTask,children:e.taskId??``}),(0,I.jsx)(`span`,{className:R.stepSummary,children:e.text})]},`${e.ts}-${t}`))}),m?null:(0,I.jsx)(`button`,{type:`button`,className:R.followButton,onClick:y,children:`↓ Follow`})]}):null,(0,I.jsxs)(`div`,{className:R.transcriptWrap,children:[(0,I.jsx)(`div`,{ref:c,className:R.transcript,onScroll:g,tabIndex:0,role:`log`,"aria-label":`Run step transcript`,"aria-live":u?`polite`:`off`,children:!n||n.steps.length===0?(0,I.jsx)(`p`,{className:R.empty,children:`No steps recorded yet.`}):n.steps.map((e,t)=>(0,I.jsxs)(`div`,{className:R.step,"data-focus-key":`run-stream-step-${t}`,children:[(0,I.jsx)(`span`,{className:R.stepKind,"data-kind":e.kind,children:Sa[e.kind]??e.kind}),(0,I.jsx)(`span`,{className:R.stepTime,title:e.ts,children:wa(e.ts)}),(0,I.jsx)(`span`,{className:R.stepTask,children:e.taskId}),(0,I.jsx)(`span`,{className:R.stepSummary,children:e.summary}),e.usage?(0,I.jsxs)(`span`,{className:R.stepUsage,children:[(e.usage.tokensIn+e.usage.tokensOut).toLocaleString(),` tok`]}):null]},`${e.ts}-${t}`))}),u?null:(0,I.jsx)(`button`,{type:`button`,className:R.followButton,onClick:v,children:`↓ Follow`})]})]})}var Oa={strip:`_strip_21e8x_1`,label:`_label_21e8x_11`,list:`_list_21e8x_20`,watchBtn:`_watchBtn_21e8x_29`,pulse:`_pulse_21e8x_46`,dialogWidth:`_dialogWidth_21e8x_70`};function ka(){let e=_(E),[t,n]=(0,A.useState)(null),r=(e.data?.runs??[]).filter(e=>e.status===`running`);return r.length===0?null:(0,I.jsxs)(`div`,{className:Oa.strip,children:[(0,I.jsx)(`span`,{className:Oa.label,children:`Live now`}),(0,I.jsx)(`ul`,{className:Oa.list,"aria-live":`polite`,"aria-label":`Currently running`,children:r.map(e=>(0,I.jsx)(`li`,{children:(0,I.jsxs)(`button`,{type:`button`,className:Oa.watchBtn,onClick:()=>n(e.id),children:[(0,I.jsx)(`span`,{className:Oa.pulse,"aria-hidden":`true`}),e.goal]})},e.id))}),(0,I.jsx)(C,{open:t!==null,onClose:()=>n(null),titleId:`live-now-title`,title:`Watching live`,widthClassName:Oa.dialogWidth,children:t?(0,I.jsx)(Da,{runId:t}):null})]})}function Aa(e){switch(e){case`merge`:return`merged`;case`dispatch`:return`running`;case`tick`:return`info`;default:return`pending`}}function ja(e){let t=[];for(let[n,r]of(e.logs?.entries??[]).entries())t.push({id:`log-${r.ts}-${n}`,ts:r.ts,source:`daemon-tick`,title:r.kind===`merge`?`Daemon merge`:r.kind===`dispatch`?`Daemon dispatch`:`Daemon tick`,detail:r.msg+(r.dryRun?` (dry run)`:``),statusLabel:Aa(r.kind),sourceQuality:e.logs?.sourceQuality});for(let[n,r]of(e.fleetActivity?.recentTicks??[]).entries())t.push({id:`fleet-tick-${r.ts}-${n}`,ts:r.ts,source:`daemon-tick`,title:`Fleet tick`,detail:[r.reason,r.directionReason].filter(Boolean).join(` — `)||`${r.merged} merged, $${r.spentUsd.toFixed(2)} spent`,statusLabel:r.dryRun?`pending`:`info`,sourceQuality:e.fleetActivity?.recentTicksSourceQuality});for(let[n,r]of(e.fleetActivity?.recentMerges??[]).entries())t.push({id:`merge-${r.ts}-${n}`,ts:r.ts,source:`merge`,title:`Merged in ${r.repo??`unknown repo`}`,detail:`${r.engine??`unknown engine`}${r.proposalId?` · proposal ${r.proposalId}`:``}`,repo:r.repo??void 0,statusLabel:`merged`,sourceQuality:e.fleetActivity?.recentMergesSourceQuality,drillIn:r.proposalId?{proposalId:r.proposalId}:void 0});for(let[n,r]of(e.fleetActivity?.recentActions??[]).entries())t.push({id:`action-${r.ts}-${n}`,ts:r.ts,source:`agent-action`,title:r.proseDigest??r.summary??r.action,detail:r.summary,repo:r.repo,statusLabel:r.outcome,sourceQuality:e.fleetActivity?.recentActionsSource,drillIn:r.proposalId?{proposalId:r.proposalId}:r.runId?{runId:r.runId}:void 0});for(let n of e.runs??[])t.push({id:`run-${n.id}`,ts:n.updatedAt,source:`run`,title:n.goal,detail:n.result??n.terminationReason??`${n.steps.length} step(s), ${n.tasks.length} task(s)`,statusLabel:n.status,drillIn:{runId:n.id}});for(let n of e.inbox?.proposals??[])t.push({id:`proposal-pending-${n.id}`,ts:n.createdAt,source:`proposal`,title:n.title,detail:`${n.kind} · ${n.origin}`,repo:n.repo,statusLabel:`pending`,drillIn:{proposalId:n.id}});return t.sort((e,t)=>new Date(t.ts).getTime()-new Date(e.ts).getTime()),t}function Ma(e=new Date){let t=new Date(e.getFullYear(),e.getMonth(),e.getDate());return e.getTime()-t.getTime()}function Na(e,t){let n=Date.now(),r=t.query.trim().toLowerCase();return e.filter(e=>!(!t.sources.has(e.source)||t.windowMs!==null&&n-new Date(e.ts).getTime()>t.windowMs||r&&!`${e.title} ${e.detail} ${e.repo??``} ${e.statusLabel}`.toLowerCase().includes(r)))}function Pa(e,t){let n=Date.now(),r=36e5,i=[];for(let e=t-1;e>=0;e--)i.push({bucketStartMs:n-e*r,count:0});for(let a of e){let e=n-new Date(a.ts).getTime();if(e<0||e>t*r)continue;let o=t-1-Math.floor(e/r);o>=0&&o<i.length&&(i[o].count+=1)}return i}var Fa={bar:`_bar_1kce8_1`,search:`_search_1kce8_12`,sources:`_sources_1kce8_28`,sourceOption:`_sourceOption_1kce8_34`,windowSelect:`_windowSelect_1kce8_43`},Ia=[{value:`run`,label:`Runs`},{value:`merge`,label:`Merges`},{value:`proposal`,label:`Proposals`},{value:`agent-action`,label:`Agent actions`},{value:`daemon-tick`,label:`Daemon ticks`}],La=[{value:`1h`,label:`Last hour`,ms:36e5},{value:`today`,label:`Today`,ms:null,dynamic:!0},{value:`24h`,label:`Last 24h`,ms:864e5},{value:`7d`,label:`Last 7 days`,ms:6048e5},{value:`all`,label:`All available`,ms:null}];function Ra({sources:e,onSourcesChange:t,query:n,onQueryChange:r,windowValue:i,onWindowChange:a}){function o(n){let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)}return(0,I.jsxs)(`div`,{className:Fa.bar,children:[(0,I.jsx)(`input`,{type:`search`,className:Fa.search,placeholder:`Search title, detail, repo…`,value:n,onChange:e=>r(e.target.value),"aria-label":`Search the work journal`}),(0,I.jsx)(`div`,{className:Fa.sources,role:`group`,"aria-label":`Filter by source`,children:Ia.map(t=>(0,I.jsxs)(`label`,{className:Fa.sourceOption,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:e.has(t.value),onChange:()=>o(t.value)}),t.label]},t.value))}),(0,I.jsx)(`select`,{className:Fa.windowSelect,value:i,onChange:e=>{let t=La.find(t=>t.value===e.target.value);a(e.target.value,t?.dynamic?Ma():t?.ms??null)},"aria-label":`Time window`,children:La.map(e=>(0,I.jsx)(`option`,{value:e.value,children:e.label},e.value))})]})}var za=new Set(Ia.map(e=>e.value)),Ba={strip:`_strip_h22ae_1`,bar:`_bar_h22ae_12`,fill:`_fill_h22ae_33`};function Va({entries:e,hours:t,onScrubTo:n}){let r=Pa(e,t),i=Math.max(1,...r.map(e=>e.count));return(0,I.jsx)(`div`,{className:Ba.strip,role:`group`,"aria-label":`Activity density over the last ${t} hours`,children:r.map(e=>{let t=Math.round(e.count/i*100),r=new Date(e.bucketStartMs).toLocaleTimeString(void 0,{hour:`numeric`});return(0,I.jsx)(`button`,{type:`button`,className:Ba.bar,onClick:()=>n(e.bucketStartMs),disabled:e.count===0,title:`${r}: ${e.count} entr${e.count===1?`y`:`ies`}`,"aria-label":`${r}: ${e.count} entries`,children:(0,I.jsx)(`span`,{className:Ba.fill,style:{height:`${Math.max(t,e.count>0?8:0)}%`}})},e.bucketStartMs)})})}var Ha={detailBody:`_detailBody_bgyq9_1`,grid:`_grid_bgyq9_10`,rationale:`_rationale_bgyq9_27`,diffDetails:`_diffDetails_bgyq9_34`,diff:`_diff_bgyq9_34`,error:`_error_bgyq9_56`};function Ua({proposalId:e}){let t=_(fe(e));if(t.status===`loading`)return(0,I.jsx)(l,{width:`80%`});if(t.status===`error`)return(0,I.jsxs)(`p`,{className:Ha.error,children:[`Could not load proposal `,e,`: `,t.error?.message??`not found on disk (it may have been pruned).`]});let n=t.data;return n?(0,I.jsxs)(`div`,{className:Ha.detailBody,children:[(0,I.jsxs)(`dl`,{className:Ha.grid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Status`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(T,{status:n.status})})]}),n.riskClass?(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Risk`}),(0,I.jsx)(`dd`,{children:n.riskClass})]}):null,n.taste?(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Judge verdict`}),(0,I.jsxs)(`dd`,{children:[n.taste.verdict,` · alignment `,n.taste.alignment,`/10 · ambition `,n.taste.ambition,`/10 · design`,` `,n.taste.design,`/10`]})]}):null,n.decisionReason?(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Decision`}),(0,I.jsx)(`dd`,{children:n.decisionReason})]}):null,n.learningSource?(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Learning source`}),(0,I.jsx)(`dd`,{children:n.learningSource})]}):null]}),n.taste?.rationale?(0,I.jsx)(`p`,{className:Ha.rationale,children:n.taste.rationale}):null,n.diff?(0,I.jsxs)(`details`,{className:Ha.diffDetails,children:[(0,I.jsxs)(`summary`,{children:[`Diff (`,n.diff.split(`
4
- `).length,` lines)`]}),(0,I.jsx)(`pre`,{className:Ha.diff,children:n.diff})]}):(0,I.jsx)(`p`,{className:Ha.error,children:`No diff recorded for this proposal.`})]}):null}function Wa({drillIn:e}){return e.runId?(0,I.jsx)(Da,{runId:e.runId}):e.proposalId?(0,I.jsx)(Ua,{proposalId:e.proposalId}):null}var Ga={row:`_row_194dy_1`,summary:`_summary_194dy_9`,sourceTag:`_sourceTag_194dy_31`,when:`_when_194dy_53`,repo:`_repo_194dy_61`,title:`_title_194dy_70`,expandHint:`_expandHint_194dy_80`,body:`_body_194dy_86`,detailText:`_detailText_194dy_90`},Ka={"daemon-tick":`Daemon`,merge:`Merge`,"agent-action":`Agent`,run:`Run`,proposal:`Proposal`};function qa(e){let t=new Date(e);return`${t.toLocaleDateString(void 0,{month:`short`,day:`numeric`})} ${t.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`})}`}function Ja({entry:e}){let t=!!e.drillIn,[n,r]=(0,A.useState)(!1);return(0,I.jsxs)(`details`,{className:Ga.row,"data-state-key":`journal-${e.id}`,onToggle:e=>r(e.currentTarget.open),children:[(0,I.jsxs)(`summary`,{className:Ga.summary,"data-focus-key":`journal-${e.id}`,children:[(0,I.jsx)(`span`,{className:Ga.sourceTag,"data-source":e.source,children:Ka[e.source]}),(0,I.jsx)(`span`,{className:Ga.when,title:e.ts,children:qa(e.ts)}),(0,I.jsx)(T,{status:e.statusLabel}),e.repo?(0,I.jsx)(`span`,{className:Ga.repo,children:e.repo}):null,(0,I.jsx)(`span`,{className:Ga.title,children:e.title}),(0,I.jsx)(te,{quality:e.sourceQuality}),t?(0,I.jsx)(`span`,{className:Ga.expandHint,"aria-hidden":`true`,children:`why? ▾`}):null]}),(0,I.jsxs)(`div`,{className:Ga.body,children:[(0,I.jsx)(`p`,{className:Ga.detailText,children:e.detail}),n&&e.drillIn?(0,I.jsx)(Wa,{drillIn:e.drillIn}):null]})]})}var Ya={view:`_view_1omi1_1`,header:`_header_1omi1_9`,title:`_title_1omi1_16`,windowNote:`_windowNote_1omi1_23`,freshness:`_freshness_1omi1_30`,freshnessLabel:`_freshnessLabel_1omi1_37`,errorBanner:`_errorBanner_1omi1_42`,panel:`_panel_1omi1_50`,list:`_list_1omi1_57`,empty:`_empty_1omi1_63`},Xa=8e3;function Za(e){let t=Math.max(0,Math.round((Date.now()-e)/1e3));return t<5?`just now`:t<60?`${t}s ago`:`${Math.round(t/60)}m ago`}function Qa(){let e=P().state?.windowToday===!0,t=_(he),n=_(ge),r=_(Se),i=_(le),a=f(he);(0,A.useEffect)(()=>{let e=setInterval(a,Xa);return()=>clearInterval(e)},[a]);let[o,s]=(0,A.useState)(new Set(za)),[c,l]=(0,A.useState)(``),[u,d]=(0,A.useState)(e?`today`:`24h`),[p,m]=(0,A.useState)(e?Ma():864e5),h=(0,A.useMemo)(()=>ja({logs:t.data,fleetActivity:n.data,runs:r.data,inbox:i.data}),[t.data,n.data,r.data,i.data]),g=(0,A.useMemo)(()=>Na(h,{sources:o,query:c,windowMs:p}),[h,o,c,p]),v=(0,A.useRef)(new Map);function b(e){let t=g.find(t=>new Date(t.ts).getTime()<=e+36e5);t&&v.current.get(t.id)?.scrollIntoView({behavior:`smooth`,block:`center`})}let x=t.status===`loading`&&n.status===`loading`&&r.status===`loading`&&i.status===`loading`,S=[t,n,r,i].some(e=>e.status===`refreshing`),C=Math.max(t.updatedAt??0,n.updatedAt??0,r.updatedAt??0,i.updatedAt??0),ee=[t.status===`error`?`daemon log: ${t.error?.message}`:null,n.status===`error`?`fleet activity: ${n.error?.message}`:null,r.status===`error`?`runs: ${r.error?.message}`:null,i.status===`error`?`inbox: ${i.error?.message}`:null].filter(e=>e!==null);return(0,I.jsxs)(`div`,{className:Ya.view,children:[(0,I.jsxs)(`header`,{className:Ya.header,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h1`,{className:Ya.title,children:`Work Journal`}),(0,I.jsx)(`p`,{className:Ya.windowNote,children:`Merges the daemon log (last 200 lines), fleet activity (last ~20 merges/ticks/agent actions), recent runs (last 200), and the pending-proposal inbox. The read API does not expose the full on-disk history beyond this window.`})]}),(0,I.jsxs)(`div`,{className:Ya.freshness,"aria-live":`polite`,children:[S?(0,I.jsx)(O,{}):null,C>0?(0,I.jsxs)(`span`,{className:Ya.freshnessLabel,children:[`Updated `,Za(C)]}):null]})]}),ee.length>0?(0,I.jsxs)(`div`,{className:Ya.errorBanner,role:`alert`,children:[`Some sources failed to load: `,ee.join(`; `)]}):null,(0,I.jsx)(ka,{}),x?(0,I.jsxs)(`div`,{className:Ya.panel,children:[(0,I.jsx)(y,{}),(0,I.jsx)(y,{}),(0,I.jsx)(y,{}),(0,I.jsx)(y,{})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Va,{entries:h,hours:24,onScrubTo:b}),(0,I.jsx)(Ra,{sources:o,onSourcesChange:s,query:c,onQueryChange:l,windowValue:u,onWindowChange:(e,t)=>{d(e),m(t)}}),(0,I.jsx)(`div`,{className:Ya.panel,children:g.length===0?(0,I.jsx)(`p`,{className:Ya.empty,children:`Nothing matches the current filters in this window.`}):(0,I.jsx)(`ul`,{className:Ya.list,children:g.map(e=>(0,I.jsx)(`li`,{ref:t=>{t?v.current.set(e.id,t):v.current.delete(e.id)},children:(0,I.jsx)(Ja,{entry:e})},e.id))})})]})]})}var $a={view:`_view_7836g_1`,header:`_header_7836g_7`,title:`_title_7836g_15`,freshness:`_freshness_7836g_21`,freshnessLabel:`_freshnessLabel_7836g_27`,filterRow:`_filterRow_7836g_32`,windowGroup:`_windowGroup_7836g_38`,windowButton:`_windowButton_7836g_45`,windowButtonActive:`_windowButtonActive_7836g_64`,kpiGrid:`_kpiGrid_7836g_70`,chartsGrid:`_chartsGrid_7836g_76`,error:`_error_7836g_82`},eo=[`1d`,`7d`,`30d`],to={ok:`success`,warn:`warning`,over:`danger`};function no(e){let t=e.replace(/\/+$/,``).split(`/`);return t[t.length-1]||e}function ro(){let[e,t]=(0,A.useState)(`7d`),n=_(de(e));return(0,I.jsxs)(`div`,{className:$a.view,children:[(0,I.jsxs)(`header`,{className:$a.header,children:[(0,I.jsx)(`h1`,{className:$a.title,children:`Pulse`}),(0,I.jsxs)(`div`,{className:$a.freshness,"aria-live":`polite`,children:[n.status===`refreshing`?(0,I.jsx)(O,{}):null,n.updatedAt?(0,I.jsxs)(`span`,{className:$a.freshnessLabel,children:[`Updated `,ao(n.updatedAt)]}):null]})]}),(0,I.jsxs)(`div`,{className:$a.filterRow,role:`group`,"aria-label":`Time window`,children:[(0,I.jsx)(`div`,{className:$a.windowGroup,children:eo.map(n=>(0,I.jsx)(`button`,{type:`button`,className:`${$a.windowButton} ${n===e?$a.windowButtonActive:``}`,"aria-pressed":n===e,onClick:()=>t(n),children:n},n))}),n.data?(0,I.jsx)(T,{status:n.data.budget.level,tone:to[n.data.budget.level],children:n.data.budget.message}):null]}),n.status===`loading`?(0,I.jsx)(p,{count:4}):n.status===`error`?(0,I.jsx)(`div`,{className:$a.error,role:`alert`,children:n.error?.message??`Failed to load pulse data.`}):n.data?(0,I.jsx)(io,{rollup:n.data}):null]})}function io({rollup:e}){let t=[{id:`cost`,label:`Est. cost (USD)`,points:e.byDay.map(e=>({x:Date.parse(`${e.day}T00:00:00Z`),y:e.estCostUsd}))}],n=[...e.byProject].sort((e,t)=>t.estCostUsd-e.estCostUsd).slice(0,8),r=n.map(e=>({label:no(e.project),value:e.estCostUsd})),i=[...e.byModel].sort((e,t)=>t.estCostUsd-e.estCostUsd).slice(0,8),a=i.map(e=>({label:e.model,value:e.estCostUsd}));return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:$a.kpiGrid,children:[(0,I.jsx)(k,{label:`Est. cost`,value:Be(e.totals.estCostUsd),caption:e.window}),(0,I.jsx)(k,{label:`Tokens`,value:Ve(e.totals.tokensIn+e.totals.tokensOut),caption:`${Ve(e.totals.tokensIn)} in / ${Ve(e.totals.tokensOut)} out`}),(0,I.jsx)(k,{label:`Sessions`,value:String(e.totals.sessions)}),(0,I.jsx)(k,{label:`Commits`,value:String(e.totals.commits)})]}),(0,I.jsxs)(`div`,{className:$a.chartsGrid,children:[(0,I.jsx)(Fe,{title:`Cost over time`,description:`since ${new Date(e.since).toLocaleDateString()}`,empty:e.byDay.length===0,emptyMessage:`No activity recorded in this window.`,table:(0,I.jsx)(Pe,{caption:`Daily cost`,rowKey:e=>e.day,rows:e.byDay,columns:[{key:`day`,label:`Day`,render:e=>e.day},{key:`cost`,label:`Cost`,numeric:!0,render:e=>Be(e.estCostUsd)},{key:`sessions`,label:`Sessions`,numeric:!0,render:e=>String(e.sessions)}]}),children:(0,I.jsx)(Ie,{series:t,area:!0,ariaLabel:`Estimated cost over time`,formatX:e=>new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`}),formatY:e=>Be(e)})}),(0,I.jsx)(Fe,{title:`Top projects by cost`,empty:r.length===0,emptyMessage:`No project activity in this window.`,table:(0,I.jsx)(Pe,{caption:`Cost by project`,rowKey:e=>e.project,rows:n,columns:[{key:`project`,label:`Project`,render:e=>no(e.project)},{key:`sessions`,label:`Sessions`,numeric:!0,render:e=>String(e.sessions)},{key:`commits`,label:`Commits`,numeric:!0,render:e=>String(e.commits)},{key:`cost`,label:`Cost`,numeric:!0,render:e=>Be(e.estCostUsd)}]}),children:(0,I.jsx)(Le,{data:r,orientation:`horizontal`,ariaLabel:`Top projects by estimated cost`,formatValue:e=>Be(e)})}),(0,I.jsx)(Fe,{title:`Cost by model`,empty:a.length===0,emptyMessage:`No model activity in this window.`,table:(0,I.jsx)(Pe,{caption:`Cost by model`,rowKey:e=>e.model,rows:i,columns:[{key:`model`,label:`Model`,render:e=>e.model},{key:`calls`,label:`Calls`,numeric:!0,render:e=>String(e.calls)},{key:`tokens`,label:`Tokens`,numeric:!0,render:e=>Ve(e.tokensIn+e.tokensOut)},{key:`cost`,label:`Cost`,numeric:!0,render:e=>Be(e.estCostUsd)}]}),children:(0,I.jsx)(Le,{data:a,ariaLabel:`Cost by model`,formatValue:e=>Be(e)})})]})]})}function ao(e){let t=Math.max(0,Math.round((Date.now()-e)/1e3));return t<5?`just now`:t<60?`${t}s ago`:`${Math.round(t/60)}m ago`}var z={view:`_view_44i9i_1`,header:`_header_44i9i_7`,title:`_title_44i9i_15`,searchRow:`_searchRow_44i9i_21`,searchInput:`_searchInput_44i9i_27`,resultCount:`_resultCount_44i9i_43`,results:`_results_44i9i_48`,row:`_row_44i9i_57`,rowHeader:`_rowHeader_44i9i_64`,rowTitle:`_rowTitle_44i9i_72`,rowMeta:`_rowMeta_44i9i_78`,badge:`_badge_44i9i_87`,snippet:`_snippet_44i9i_97`,tags:`_tags_44i9i_107`,tag:`_tag_44i9i_107`,skeletons:`_skeletons_44i9i_123`,empty:`_empty_44i9i_129`,error:`_error_44i9i_136`},oo=50,so=300;function co(e,t){let[n,r]=(0,A.useState)(e);return(0,A.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function lo(e,t=220){let n=e.trim();return n.length>t?`${n.slice(0,t-1)}…`:n}function uo(e){let t=Date.parse(e);if(Number.isNaN(t))return e;let n=Math.floor((Date.now()-t)/864e5);return n<=0?`today`:n===1?`yesterday`:n<30?`${n}d ago`:`${Math.floor(n/30)}mo ago`}function fo(){let[e,t]=(0,A.useState)(``),n=co(e,so),r=_(ce(n)),i=n.trim().length>0,a=r.data,{rows:o,totalCount:s}=(0,A.useMemo)(()=>{if(!a)return{rows:[],totalCount:0};if(i)return{rows:a,totalCount:a.length};let e=a;return{rows:[...e].sort((e,t)=>Date.parse(t.ts)-Date.parse(e.ts)).slice(0,oo),totalCount:e.length}},[a,i]),c=(0,A.useMemo)(()=>{if(!a||i)return[];let e=a,t=new Map;for(let n of e){let e=n.project??`(unscoped)`;t.set(e,(t.get(e)??0)+1)}return[...t.entries()].sort((e,t)=>t[1]-e[1]).slice(0,8).map(([e,t])=>({label:e,value:t}))},[a,i]);return(0,I.jsxs)(`div`,{className:z.view,children:[(0,I.jsxs)(`header`,{className:z.header,children:[(0,I.jsx)(`h1`,{className:z.title,children:`Genome`}),(0,I.jsx)(`div`,{"aria-live":`polite`,children:r.status===`refreshing`?(0,I.jsx)(O,{}):null})]}),(0,I.jsxs)(`div`,{className:z.searchRow,children:[(0,I.jsx)(`input`,{type:`search`,className:z.searchInput,placeholder:`Search the genome (title, tags, body text)…`,value:e,onChange:e=>t(e.target.value),"aria-label":`Search cross-repo knowledge`}),a?(0,I.jsx)(`span`,{className:z.resultCount,children:i?`${s} match${s===1?``:`es`}`:`showing ${o.length} of ${s}`}):null]}),!i&&c.length>0?(0,I.jsx)(Fe,{title:`Top projects by genome entries`,description:`browse mode — all loaded entries`,children:(0,I.jsx)(Le,{data:c,orientation:`horizontal`,ariaLabel:`Top projects by genome entry count`,formatValue:e=>Ve(e)})}):null,r.status===`loading`?(0,I.jsxs)(`div`,{className:z.skeletons,"aria-hidden":`true`,children:[(0,I.jsx)(y,{}),(0,I.jsx)(y,{}),(0,I.jsx)(y,{}),(0,I.jsx)(y,{})]}):r.status===`error`?(0,I.jsx)(`div`,{className:z.error,role:`alert`,children:r.error?.message??`Failed to load genome data.`}):o.length===0?(0,I.jsx)(`p`,{className:z.empty,children:i?`No genome entries match "${n}".`:`No genome entries recorded yet.`}):(0,I.jsx)(`ul`,{className:z.results,children:o.map(e=>{let t=ue(e)?e:null,n=t?t.entry:e;return(0,I.jsxs)(`li`,{className:z.row,children:[(0,I.jsxs)(`div`,{className:z.rowHeader,children:[(0,I.jsx)(`span`,{className:z.rowTitle,children:n.title}),(0,I.jsxs)(`span`,{className:z.rowMeta,children:[t?(0,I.jsxs)(`span`,{className:z.badge,children:[t.method,` · `,t.score.toFixed(2)]}):null,(0,I.jsx)(`span`,{children:uo(n.ts)})]})]}),(0,I.jsxs)(`div`,{className:z.rowMeta,children:[(0,I.jsx)(`span`,{className:z.badge,children:n.project??`unscoped`}),(0,I.jsx)(`span`,{className:z.badge,children:n.source})]}),(0,I.jsx)(`p`,{className:z.snippet,children:lo(n.text)}),n.tags.length>0?(0,I.jsx)(`div`,{className:z.tags,children:n.tags.map(e=>(0,I.jsx)(`span`,{className:z.tag,children:e},e))}):null]},n.id)})})]})}var B={view:`_view_1frm3_1`,header:`_header_1frm3_7`,title:`_title_1frm3_15`,filterRow:`_filterRow_1frm3_21`,windowGroup:`_windowGroup_1frm3_27`,windowButton:`_windowButton_1frm3_34`,windowButtonActive:`_windowButtonActive_1frm3_53`,kpiGrid:`_kpiGrid_1frm3_59`,chartsGrid:`_chartsGrid_1frm3_65`,section:`_section_1frm3_71`,sectionTitle:`_sectionTitle_1frm3_77`,goalsList:`_goalsList_1frm3_83`,goalRow:`_goalRow_1frm3_92`,goalObjective:`_goalObjective_1frm3_102`,meterTrack:`_meterTrack_1frm3_107`,meterFill:`_meterFill_1frm3_115`,goalMeta:`_goalMeta_1frm3_121`,error:`_error_1frm3_126`,notAvailable:`_notAvailable_1frm3_135`},po=[`7d`,`30d`,`all`];function mo(e){return`${e.engine}:${e.model}`}function ho(){let[e,t]=(0,A.useState)(`30d`),n=_(E),r=_(_e(e)),i=n.data?.production;return(0,I.jsxs)(`div`,{className:B.view,children:[(0,I.jsxs)(`header`,{className:B.header,children:[(0,I.jsx)(`h1`,{className:B.title,children:`Production`}),(0,I.jsx)(`div`,{"aria-live":`polite`,children:n.status===`refreshing`||r.status===`refreshing`?(0,I.jsx)(O,{}):null})]}),n.status===`loading`?(0,I.jsx)(p,{count:4}):n.status===`error`?(0,I.jsx)(`div`,{className:B.error,role:`alert`,children:n.error?.message??`Failed to load production summary.`}):i?(0,I.jsx)(go,{production:i}):(0,I.jsx)(`p`,{className:B.notAvailable,children:`Production summary not available on this server (older producer, or not yet populated).`}),(0,I.jsx)(`div`,{className:B.filterRow,role:`group`,"aria-label":`Model stats window`,children:(0,I.jsx)(`div`,{className:B.windowGroup,children:po.map(n=>(0,I.jsx)(`button`,{type:`button`,className:`${B.windowButton} ${n===e?B.windowButtonActive:``}`,"aria-pressed":n===e,onClick:()=>t(n),children:n},n))})}),r.status===`loading`?(0,I.jsx)(p,{count:3}):r.status===`error`?(0,I.jsx)(`div`,{className:B.error,role:`alert`,children:r.error?.message??`Failed to load per-model stats.`}):r.data?(0,I.jsx)(_o,{result:r.data}):null]})}function go({production:e}){let t=e.judgeVerdicts24h,n=e.judgeFailures24h??{total:0,parse:0,network:0},r=[{label:`ship`,value:t.ship},{label:`review`,value:t.review},{label:`noise`,value:t.noise},{label:`harmful`,value:t.harmful}],i=e.shipsPerDayTrend.map(e=>({label:Re(e.date),value:e.count})),a=e.shipsPerDayTrend.reduce((e,t)=>e+t.count,0),o=ne(e.proposalSourceQuality),s=ne(e.judgeTraceSourceQuality);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:B.kpiGrid,children:[(0,I.jsx)(k,{label:`Proposals (24h)`,value:(0,I.jsx)(w,{quality:e.proposalSourceQuality,label:`proposals`,children:String(e.proposals24h.total)}),caption:(0,I.jsx)(w,{quality:e.proposalSourceQuality,label:`pending proposals`,children:`${e.proposals24h.pending} pending`})}),(0,I.jsx)(k,{label:`Auto-merges today`,value:(0,I.jsx)(w,{quality:e.proposalSourceQuality,label:`auto-merges`,children:String(e.autoMergesToday.count)})}),(0,I.jsx)(k,{label:`Judged (24h)`,value:(0,I.jsx)(w,{quality:e.judgeTraceSourceQuality,label:`judge verdicts`,children:String(t.total)})}),(0,I.jsx)(k,{label:`Judge failures (24h)`,value:(0,I.jsx)(w,{quality:e.judgeFailureSourceQuality,label:`judge failures`,children:String(n.total)}),caption:(0,I.jsx)(w,{quality:e.judgeFailureSourceQuality,children:`${n.parse} parse · ${n.network} network`})}),(0,I.jsx)(k,{label:`Active goals`,value:(0,I.jsx)(w,{quality:e.activeGoalsSourceQuality,label:`active goals`,children:String(e.activeGoals.length)})})]}),(0,I.jsxs)(`div`,{className:B.chartsGrid,children:[(0,I.jsxs)(Fe,{title:`Ships per day`,description:`last 7 days`,empty:o&&i.length===0,emptyMessage:`No ship history recorded yet.`,table:o?(0,I.jsx)(Pe,{caption:`Ships per day`,rowKey:e=>e.label,rows:i,columns:[{key:`day`,label:`Day`,render:e=>e.label},{key:`count`,label:`Ships`,numeric:!0,render:e=>String(e.value??0)}]}):void 0,children:[o?a===0?(0,I.jsx)(`p`,{className:B.notAvailable,children:`0 ships in the last 7 days — this is the real number, not a loading state.`}):null:(0,I.jsx)(w,{quality:e.proposalSourceQuality,label:`ship history`,children:`ship history`}),o?(0,I.jsx)(Le,{data:i,ariaLabel:`Ships per day, last 7 days`,formatValue:e=>String(e)}):null]}),(0,I.jsx)(Fe,{title:`Judge verdict breakdown`,description:`last 24h`,empty:s&&t.total===0,emptyMessage:`No judge verdicts recorded in the last 24h.`,children:s?(0,I.jsx)(Le,{data:r,ariaLabel:`Judge verdict breakdown, last 24h`,formatValue:e=>String(e)}):(0,I.jsx)(w,{quality:e.judgeTraceSourceQuality,label:`judge verdicts`,children:`judge verdicts`})})]}),ne(e.activeGoalsSourceQuality)?e.activeGoals.length>0?(0,I.jsxs)(`div`,{className:B.section,children:[(0,I.jsx)(`h2`,{className:B.sectionTitle,children:`Active goals`}),(0,I.jsx)(`ul`,{className:B.goalsList,children:e.activeGoals.map(e=>{let t=e.totalMilestones>0?e.doneMilestones/e.totalMilestones:0;return(0,I.jsxs)(`li`,{className:B.goalRow,children:[(0,I.jsx)(`span`,{className:B.goalObjective,children:e.objective}),(0,I.jsx)(`div`,{className:B.meterTrack,children:(0,I.jsx)(`div`,{className:B.meterFill,style:{width:`${Math.round(t*100)}%`}})}),(0,I.jsxs)(`span`,{className:B.goalMeta,children:[e.doneMilestones,` / `,e.totalMilestones,` milestones`]})]},e.goalId)})})]}):null:(0,I.jsxs)(`div`,{className:B.section,children:[(0,I.jsx)(`h2`,{className:B.sectionTitle,children:`Active goals`}),(0,I.jsx)(w,{quality:e.activeGoalsSourceQuality,label:`active goals`,children:`active goals`})]})]})}function _o({result:e}){let t=[...e.models].sort((e,t)=>t.dispatches-e.dispatches).slice(0,12),n=t.map(e=>({label:mo(e),value:e.judged>0?e.shipRate:null}));return(0,I.jsx)(`div`,{className:B.chartsGrid,children:(0,I.jsx)(Fe,{title:`Ship rate by model`,description:`judged proposals in the selected window`,empty:t.length===0,emptyMessage:`No dispatch history for this window.`,table:(0,I.jsx)(Pe,{caption:`Per-model economics`,rowKey:mo,rows:t,columns:[{key:`model`,label:`Model`,render:e=>mo(e)},{key:`dispatches`,label:`Dispatches`,numeric:!0,render:e=>String(e.dispatches)},{key:`shipRate`,label:`Ship rate`,numeric:!0,render:e=>e.judged>0?ze(e.shipRate):`—`},{key:`merged`,label:`Merged`,numeric:!0,render:e=>String(e.merged)},{key:`costPerMerged`,label:`Cost / merge`,numeric:!0,render:e=>e.costPerMergedUsd===null?`—`:Be(e.costPerMergedUsd)},{key:`bestOfN`,label:`Best-of-N win rate`,numeric:!0,render:t=>t.bestOfNAvailable?(0,I.jsx)(w,{quality:e.bestOfNSource,label:`best-of-N win rate`,children:ze(t.bestOfN.winRate)}):`—`}]}),children:(0,I.jsx)(Le,{data:n,ariaLabel:`Ship rate by model`,formatValue:e=>ze(e)})})})}var V={view:`_view_ruego_1`,header:`_header_ruego_7`,title:`_title_ruego_15`,freshness:`_freshness_ruego_21`,freshnessLabel:`_freshnessLabel_ruego_27`,kpiGrid:`_kpiGrid_ruego_32`,chartsGrid:`_chartsGrid_ruego_38`,section:`_section_ruego_44`,sectionTitle:`_sectionTitle_ruego_50`,list:`_list_ruego_56`,row:`_row_ruego_65`,rowTitle:`_rowTitle_ruego_75`,meterTrack:`_meterTrack_ruego_84`,meterFill:`_meterFill_ruego_92`,rowMeta:`_rowMeta_ruego_98`,effectiveness:`_effectiveness_ruego_103`,effectivenessHeadline:`_effectivenessHeadline_ruego_110`,error:`_error_ruego_116`,notAvailable:`_notAvailable_ruego_125`};function vo(e){let t=Math.max(0,Math.round((Date.now()-e)/1e3));return t<5?`just now`:t<60?`${t}s ago`:`${Math.round(t/60)}m ago`}function yo(){let e=_(me),t=_(E);return(0,I.jsxs)(`div`,{className:V.view,children:[(0,I.jsxs)(`header`,{className:V.header,children:[(0,I.jsx)(`h1`,{className:V.title,children:`Portfolio`}),(0,I.jsxs)(`div`,{className:V.freshness,"aria-live":`polite`,children:[e.status===`refreshing`||t.status===`refreshing`?(0,I.jsx)(O,{}):null,e.updatedAt?(0,I.jsxs)(`span`,{className:V.freshnessLabel,children:[`Updated `,vo(e.updatedAt)]}):null]})]}),e.status===`loading`?(0,I.jsx)(p,{count:6}):e.status===`error`?(0,I.jsx)(`div`,{className:V.error,role:`alert`,children:e.error?.message??`Failed to load portfolio.`}):e.data===null?(0,I.jsx)(`p`,{className:V.notAvailable,children:`No portfolio roll-up available — either this server has no enrolled repos, or it predates the portfolio feature.`}):e.data?(0,I.jsx)(bo,{portfolio:e.data}):null]})}function bo({portfolio:e}){let{health:t,goalsInFlight:n,backlogTop:r,cost:i,effectiveness:a,today:o}=e,s=t.worstRepos.map(e=>({label:e.repo.split(`/`).filter(Boolean).pop()??e.repo,value:e.score}));return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:V.kpiGrid,children:[(0,I.jsx)(k,{label:`Portfolio health`,value:`${t.averageScore.toFixed(0)} (${t.averageGrade})`,caption:`${t.reposScored} repos scored`,delta:o.healthScoreDelta===null?null:{value:o.healthScoreDelta,goodWhenPositive:!0}}),(0,I.jsx)(k,{label:`Goals in flight`,value:String(n.length)}),(0,I.jsx)(k,{label:`Backlog top items`,value:String(r.length),delta:o.pendingProposalsDelta===null?null:{value:o.pendingProposalsDelta,versus:`pending proposals`}}),(0,I.jsx)(k,{label:`Spend`,value:Be(i.spentUsd),caption:`${i.window} window`,delta:o.spendUsdDelta===null?null:{value:o.spendUsdDelta,goodWhenPositive:!1}}),(0,I.jsx)(k,{label:`Local savings`,value:Be(i.localSavingsUsd)}),(0,I.jsx)(k,{label:`Projected monthly`,value:Be(i.projectedMonthlyUsd)})]}),a?(0,I.jsxs)(`div`,{className:V.effectiveness,children:[(0,I.jsx)(`p`,{className:V.effectivenessHeadline,children:a.headline}),(0,I.jsxs)(`span`,{className:V.rowMeta,children:[`Success rate `,ze(a.successRate),a.effectivenessDeltaPct===null?``:` (${a.effectivenessDeltaPct>=0?`+`:``}${a.effectivenessDeltaPct.toFixed(1)}pp)`]})]}):null,(0,I.jsxs)(`div`,{className:V.chartsGrid,children:[(0,I.jsx)(Fe,{title:`Worst-scoring repos`,empty:s.length===0,emptyMessage:`No enrolled repos scored yet.`,table:(0,I.jsx)(Pe,{caption:`Worst-scoring repos`,rowKey:e=>e.repo,rows:t.worstRepos,columns:[{key:`repo`,label:`Repo`,render:e=>e.repo},{key:`score`,label:`Score`,numeric:!0,render:e=>e.score.toFixed(0)},{key:`grade`,label:`Grade`,render:e=>e.grade}]}),children:(0,I.jsx)(Le,{data:s,orientation:`horizontal`,ariaLabel:`Worst-scoring repos by health score`,formatValue:e=>e.toFixed(0)})}),(0,I.jsxs)(`div`,{className:V.section,children:[(0,I.jsx)(`h2`,{className:V.sectionTitle,children:`In-flight goals`}),n.length===0?(0,I.jsx)(`p`,{className:V.notAvailable,children:`No goals currently in flight.`}):(0,I.jsx)(`ul`,{className:V.list,children:n.map(e=>(0,I.jsxs)(`li`,{className:V.row,children:[(0,I.jsxs)(`span`,{className:V.rowTitle,children:[e.objective,(0,I.jsxs)(`span`,{className:V.rowMeta,children:[Math.round(e.fractionDone*100),`%`]})]}),(0,I.jsx)(`div`,{className:V.meterTrack,children:(0,I.jsx)(`div`,{className:V.meterFill,style:{width:`${Math.round(e.fractionDone*100)}%`}})}),(0,I.jsx)(`span`,{className:V.rowMeta,children:e.nextActionable?`Next: ${e.nextActionable}`:`Nothing actionable queued`})]},e.goalId))})]})]}),(0,I.jsxs)(`div`,{className:V.section,children:[(0,I.jsx)(`h2`,{className:V.sectionTitle,children:`Top backlog`}),r.length===0?(0,I.jsx)(`p`,{className:V.notAvailable,children:`Backlog is empty.`}):(0,I.jsx)(Pe,{caption:`Top backlog items`,rowKey:e=>e.title,rows:r,columns:[{key:`title`,label:`Item`,render:e=>e.title},{key:`repo`,label:`Repo`,render:e=>e.repo??`—`},{key:`score`,label:`Score`,numeric:!0,render:e=>e.score.toFixed(1)}]})]})]})}var H={view:`_view_1eb19_1`,header:`_header_1eb19_8`,title:`_title_1eb19_16`,freshness:`_freshness_1eb19_22`,count:`_count_1eb19_28`,filters:`_filters_1eb19_34`,field:`_field_1eb19_45`,fieldLabel:`_fieldLabel_1eb19_51`,input:`_input_1eb19_56`,select:`_select_1eb19_57`,clear:`_clear_1eb19_74`,tableWrap:`_tableWrap_1eb19_87`,table:`_table_1eb19_87`,statusCol:`_statusCol_1eb19_101`,engineCol:`_engineCol_1eb19_104`,providerCol:`_providerCol_1eb19_107`,tokensCol:`_tokensCol_1eb19_110`,costCol:`_costCol_1eb19_113`,stepsCol:`_stepsCol_1eb19_116`,createdCol:`_createdCol_1eb19_119`,row:`_row_1eb19_143`,sortHeader:`_sortHeader_1eb19_151`,goalLink:`_goalLink_1eb19_168`,numeric:`_numeric_1eb19_180`,date:`_date_1eb19_186`,empty:`_empty_1eb19_192`,error:`_error_1eb19_199`};function xo(e){return e.usage.tokensIn+e.usage.tokensOut}function So(e,t){if(!t)return!0;let n=t.toLowerCase();return e.id.toLowerCase().includes(n)||e.goal.toLowerCase().includes(n)}function Co(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function wo(){let e=(0,A.useRef)(null);Me(`/work/runs`,e);let t=hn(),n=_(Se),[r,i]=(0,A.useState)(0),a=(0,A.useRef)(new Map),[o,s]=(0,A.useState)(``),[c,l]=(0,A.useState)(`all`),[u,d]=(0,A.useState)(`all`),[f,p]=(0,A.useState)(`all`),[m,h]=(0,A.useState)(``),[g,v]=(0,A.useState)(`createdAt`),[b,x]=(0,A.useState)(`desc`),S=(0,A.useMemo)(()=>n.data??[],[n.data]),{statuses:C,engines:ee,providers:te}=(0,A.useMemo)(()=>{let e=new Set,t=new Set,n=new Set;for(let r of S)e.add(r.status),t.add(r.engine),n.add(r.provider);return{statuses:Array.from(e).sort(),engines:Array.from(t).sort(),providers:Array.from(n).sort()}},[S]),ne=m?new Date(m).getTime():null,w=(0,A.useMemo)(()=>{let e=S.filter(e=>{if(c!==`all`&&e.status!==c||u!==`all`&&e.engine!==u||f!==`all`&&e.provider!==f)return!1;if(ne!==null){let t=new Date(e.createdAt).getTime();if(Number.isNaN(t)||t<ne)return!1}return!!So(e,o.trim())});return e=[...e].sort((e,t)=>{let n=0;switch(g){case`createdAt`:n=e.createdAt.localeCompare(t.createdAt);break;case`updatedAt`:n=e.updatedAt.localeCompare(t.updatedAt);break;case`tokens`:n=xo(e)-xo(t);break;case`estCostUsd`:n=e.usage.estCostUsd-t.usage.estCostUsd;break;case`steps`:n=e.steps.length-t.steps.length;break;case`status`:n=e.status.localeCompare(t.status)}return b===`asc`?n:-n}),e},[S,c,u,f,ne,o,g,b]);(0,A.useEffect)(()=>{i(e=>Math.min(e,Math.max(w.length-1,0)))},[w.length]);function re(e){if(w.length!==0){if(e.key===`ArrowDown`){e.preventDefault();let t=Math.min(r+1,w.length-1);i(t),a.current.get(w[t].id)?.focus()}else if(e.key===`ArrowUp`){e.preventDefault();let t=Math.max(r-1,0);i(t),a.current.get(w[t].id)?.focus()}else if(e.key===`Enter`){let e=w[r];e&&t(`/work/runs/${e.id}`)}}}function ie(e){e===g?x(e=>e===`asc`?`desc`:`asc`):(v(e),x(`desc`))}function ae(e){return e===g?b===`asc`?` ↑`:` ↓`:``}return(0,I.jsxs)(`div`,{ref:e,className:H.view,children:[(0,I.jsxs)(`header`,{className:H.header,children:[(0,I.jsx)(`h1`,{className:H.title,children:`Runs`}),(0,I.jsxs)(`div`,{className:H.freshness,"aria-live":`polite`,children:[n.status===`refreshing`?(0,I.jsx)(O,{}):null,(0,I.jsxs)(`span`,{className:H.count,children:[w.length,` of `,S.length,` runs (server caps at 200 most recent)`]})]})]}),(0,I.jsxs)(`form`,{className:H.filters,role:`search`,"aria-label":`Filter runs`,onSubmit:e=>e.preventDefault(),children:[(0,I.jsxs)(`label`,{className:H.field,children:[(0,I.jsx)(`span`,{className:H.fieldLabel,children:`Search`}),(0,I.jsx)(`input`,{type:`text`,className:H.input,placeholder:`goal or run id (e.g. repo/project name)`,value:o,onChange:e=>s(e.target.value)})]}),(0,I.jsxs)(`label`,{className:H.field,children:[(0,I.jsx)(`span`,{className:H.fieldLabel,children:`Status`}),(0,I.jsxs)(`select`,{className:H.select,value:c,onChange:e=>l(e.target.value),children:[(0,I.jsx)(`option`,{value:`all`,children:`All`}),C.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})]}),(0,I.jsxs)(`label`,{className:H.field,children:[(0,I.jsx)(`span`,{className:H.fieldLabel,children:`Engine`}),(0,I.jsxs)(`select`,{className:H.select,value:u,onChange:e=>d(e.target.value),children:[(0,I.jsx)(`option`,{value:`all`,children:`All`}),ee.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})]}),(0,I.jsxs)(`label`,{className:H.field,children:[(0,I.jsx)(`span`,{className:H.fieldLabel,children:`Provider`}),(0,I.jsxs)(`select`,{className:H.select,value:f,onChange:e=>p(e.target.value),children:[(0,I.jsx)(`option`,{value:`all`,children:`All`}),te.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})]}),(0,I.jsxs)(`label`,{className:H.field,children:[(0,I.jsx)(`span`,{className:H.fieldLabel,children:`Since`}),(0,I.jsx)(`input`,{type:`date`,className:H.input,value:m,onChange:e=>h(e.target.value)})]}),(c!==`all`||u!==`all`||f!==`all`||m||o)&&(0,I.jsx)(`button`,{type:`button`,className:H.clear,onClick:()=>{s(``),l(`all`),d(`all`),p(`all`),h(``)},children:`Clear filters`})]}),n.status===`loading`?(0,I.jsxs)(`div`,{className:H.tableWrap,children:[(0,I.jsx)(y,{}),(0,I.jsx)(y,{}),(0,I.jsx)(y,{})]}):n.status===`error`?(0,I.jsx)(`div`,{className:H.error,role:`alert`,children:n.error?.message??`Failed to load runs.`}):w.length===0?(0,I.jsx)(`p`,{className:H.empty,children:`No runs match the current filters.`}):(0,I.jsx)(`div`,{className:H.tableWrap,children:(0,I.jsxs)(`table`,{className:H.table,onKeyDown:re,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,children:`Goal`}),(0,I.jsx)(`th`,{scope:`col`,className:H.statusCol,children:(0,I.jsxs)(`button`,{type:`button`,className:H.sortHeader,onClick:()=>ie(`status`),children:[`Status`,ae(`status`)]})}),(0,I.jsx)(`th`,{scope:`col`,className:H.engineCol,children:`Engine`}),(0,I.jsx)(`th`,{scope:`col`,className:H.providerCol,children:`Provider`}),(0,I.jsx)(`th`,{scope:`col`,className:H.tokensCol,children:(0,I.jsxs)(`button`,{type:`button`,className:H.sortHeader,onClick:()=>ie(`tokens`),children:[`Tokens in/out`,ae(`tokens`)]})}),(0,I.jsx)(`th`,{scope:`col`,className:H.costCol,children:(0,I.jsxs)(`button`,{type:`button`,className:H.sortHeader,onClick:()=>ie(`estCostUsd`),children:[`Est cost`,ae(`estCostUsd`)]})}),(0,I.jsx)(`th`,{scope:`col`,className:H.stepsCol,children:(0,I.jsxs)(`button`,{type:`button`,className:H.sortHeader,onClick:()=>ie(`steps`),children:[`Steps`,ae(`steps`)]})}),(0,I.jsx)(`th`,{scope:`col`,className:H.createdCol,children:(0,I.jsxs)(`button`,{type:`button`,className:H.sortHeader,onClick:()=>ie(`createdAt`),children:[`Created`,ae(`createdAt`)]})})]})}),(0,I.jsx)(`tbody`,{children:w.map((e,t)=>(0,I.jsxs)(`tr`,{ref:t=>{t?a.current.set(e.id,t):a.current.delete(e.id)},tabIndex:t===r?0:-1,onFocus:()=>i(t),"aria-current":t===r?`true`:void 0,className:H.row,children:[(0,I.jsx)(`td`,{children:(0,I.jsx)(kr,{to:`/work/runs/${e.id}`,"data-focus-key":`run-${e.id}`,className:H.goalLink,title:e.goal,tabIndex:-1,children:e.goal})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(T,{status:e.status})}),(0,I.jsx)(`td`,{children:e.engine}),(0,I.jsx)(`td`,{children:e.provider}),(0,I.jsxs)(`td`,{className:H.numeric,children:[e.usage.tokensIn.toLocaleString(),` / `,e.usage.tokensOut.toLocaleString()]}),(0,I.jsxs)(`td`,{className:H.numeric,children:[`$`,e.usage.estCostUsd.toFixed(4)]}),(0,I.jsx)(`td`,{className:H.numeric,children:e.steps.length}),(0,I.jsx)(`td`,{className:H.date,children:Co(e.createdAt)})]},e.id))})]})})]})}var U={view:`_view_16nop_1`,header:`_header_16nop_8`,eyebrow:`_eyebrow_16nop_16`,title:`_title_16nop_22`,freshness:`_freshness_16nop_29`,metaGrid:`_metaGrid_16nop_35`,numeric:`_numeric_16nop_55`,section:`_section_16nop_59`,sectionTitle:`_sectionTitle_16nop_65`,resultText:`_resultText_16nop_70`,taskList:`_taskList_16nop_79`,taskItem:`_taskItem_16nop_85`,taskHeader:`_taskHeader_16nop_98`,taskId:`_taskId_16nop_105`,taskGoal:`_taskGoal_16nop_111`,taskDeps:`_taskDeps_16nop_116`,depLink:`_depLink_16nop_122`,depMissing:`_depMissing_16nop_127`,taskError:`_taskError_16nop_132`,taskUsage:`_taskUsage_16nop_141`,stepList:`_stepList_16nop_148`,stepItem:`_stepItem_16nop_155`,stepTs:`_stepTs_16nop_164`,stepKind:`_stepKind_16nop_170`,stepTask:`_stepTask_16nop_176`,stepSummary:`_stepSummary_16nop_180`,empty:`_empty_16nop_185`,error:`_error_16nop_190`};function To(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function Eo(e){return`task-${encodeURIComponent(e)}`}function Do(){let{id:e}=yn(),t=(0,A.useRef)(null);Me(`/work/runs/${e??``}`,t);let n=_(oe(e??``));if(!e)return(0,I.jsx)(`div`,{className:U.view,children:(0,I.jsx)(`p`,{className:U.error,role:`alert`,children:`No run id in URL.`})});if(n.status===`loading`)return(0,I.jsxs)(`div`,{ref:t,className:U.view,children:[(0,I.jsx)(l,{width:`60%`}),(0,I.jsx)(l,{width:`30%`}),(0,I.jsx)(l,{width:`80%`})]});if(n.status===`error`||!n.data)return(0,I.jsx)(`div`,{ref:t,className:U.view,children:(0,I.jsx)(`p`,{className:U.error,role:`alert`,children:n.error?.message??`Run ${e} not found.`})});let r=n.data,i=new Map(r.tasks.map(e=>[e.id,e]));return(0,I.jsxs)(`div`,{ref:t,className:U.view,children:[(0,I.jsxs)(`header`,{className:U.header,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`p`,{className:U.eyebrow,children:[`Run `,r.id]}),(0,I.jsx)(`h1`,{className:U.title,children:r.goal})]}),(0,I.jsxs)(`div`,{className:U.freshness,"aria-live":`polite`,children:[n.status===`refreshing`?(0,I.jsx)(O,{}):null,(0,I.jsx)(T,{status:r.status})]})]}),(0,I.jsxs)(`dl`,{className:U.metaGrid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Engine`}),(0,I.jsx)(`dd`,{children:r.engine})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Provider`}),(0,I.jsx)(`dd`,{children:r.provider})]}),r.engineModel?(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Model`}),(0,I.jsx)(`dd`,{children:r.engineModel})]}):null,(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Tokens in / out`}),(0,I.jsxs)(`dd`,{className:U.numeric,children:[r.usage.tokensIn.toLocaleString(),` / `,r.usage.tokensOut.toLocaleString()]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Est cost`}),(0,I.jsxs)(`dd`,{className:U.numeric,children:[`$`,r.usage.estCostUsd.toFixed(4)]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Steps`}),(0,I.jsx)(`dd`,{className:U.numeric,children:r.usage.steps})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Budget (tokens / steps)`}),(0,I.jsxs)(`dd`,{className:U.numeric,children:[r.budget.maxTokens.toLocaleString(),` / `,r.budget.maxSteps]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Created`}),(0,I.jsx)(`dd`,{children:To(r.createdAt)})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Updated`}),(0,I.jsx)(`dd`,{children:To(r.updatedAt)})]}),r.terminationReason?(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Termination reason`}),(0,I.jsx)(`dd`,{children:r.terminationReason})]}):null]}),r.result?(0,I.jsxs)(`section`,{className:U.section,children:[(0,I.jsx)(`h2`,{className:U.sectionTitle,children:`Result`}),(0,I.jsx)(`p`,{className:U.resultText,children:r.result})]}):null,(0,I.jsxs)(`section`,{className:U.section,children:[(0,I.jsxs)(`h2`,{className:U.sectionTitle,children:[`Tasks (`,r.tasks.length,`)`]}),r.tasks.length===0?(0,I.jsx)(`p`,{className:U.empty,children:`No tasks recorded.`}):(0,I.jsx)(`ul`,{className:U.taskList,children:r.tasks.map(e=>(0,I.jsxs)(`li`,{id:Eo(e.id),className:U.taskItem,tabIndex:-1,children:[(0,I.jsxs)(`div`,{className:U.taskHeader,children:[(0,I.jsx)(`span`,{className:U.taskId,children:e.id}),(0,I.jsx)(T,{status:e.status})]}),(0,I.jsx)(`p`,{className:U.taskGoal,children:e.goal}),e.deps.length>0?(0,I.jsxs)(`p`,{className:U.taskDeps,children:[`depends on:`,` `,e.deps.map((e,t)=>(0,I.jsxs)(`span`,{children:[t>0?`, `:``,i.has(e)?(0,I.jsx)(`a`,{href:`#${Eo(e)}`,className:U.depLink,children:e}):(0,I.jsxs)(`span`,{className:U.depMissing,children:[e,` (unresolved)`]})]},e))]}):null,e.error?(0,I.jsx)(`p`,{className:U.taskError,role:`alert`,children:e.error}):null,e.usage?(0,I.jsxs)(`p`,{className:U.taskUsage,children:[e.usage.tokensIn.toLocaleString(),` / `,e.usage.tokensOut.toLocaleString(),` tokens · $`,e.usage.estCostUsd.toFixed(4)]}):null]},e.id))})]}),(0,I.jsxs)(`section`,{className:U.section,children:[(0,I.jsxs)(`h2`,{className:U.sectionTitle,children:[`Step log (`,r.steps.length,`)`]}),r.steps.length===0?(0,I.jsx)(`p`,{className:U.empty,children:`No steps recorded.`}):(0,I.jsx)(`ol`,{className:U.stepList,children:r.steps.map((e,t)=>(0,I.jsxs)(`li`,{className:U.stepItem,children:[(0,I.jsx)(`span`,{className:U.stepTs,children:To(e.ts)}),(0,I.jsx)(`span`,{className:U.stepKind,children:e.kind}),(0,I.jsx)(`span`,{className:U.stepTask,children:e.taskId?(0,I.jsx)(`a`,{href:`#${Eo(e.taskId)}`,className:U.depLink,children:e.taskId}):null}),(0,I.jsx)(`span`,{className:U.stepSummary,children:e.summary})]},`${e.ts}-${t}`))})]})]})}var W={view:`_view_1kj6a_1`,header:`_header_1kj6a_8`,title:`_title_1kj6a_16`,freshness:`_freshness_1kj6a_22`,count:`_count_1kj6a_28`,filters:`_filters_1kj6a_34`,field:`_field_1kj6a_45`,fieldLabel:`_fieldLabel_1kj6a_51`,input:`_input_1kj6a_56`,select:`_select_1kj6a_57`,listWrap:`_listWrap_1kj6a_73`,listHeader:`_listHeader_1kj6a_80`,sortHeader:`_sortHeader_1kj6a_90`,list:`_list_1kj6a_73`,item:`_item_1kj6a_112`,goalLink:`_goalLink_1kj6a_124`,goalText:`_goalText_1kj6a_140`,burndown:`_burndown_1kj6a_150`,burndownTrack:`_burndownTrack_1kj6a_156`,burndownFill:`_burndownFill_1kj6a_164`,burndownLabel:`_burndownLabel_1kj6a_170`,numeric:`_numeric_1kj6a_177`,date:`_date_1kj6a_184`,empty:`_empty_1kj6a_191`,error:`_error_1kj6a_198`};function Oo(e){return e.tasks.filter(e=>e.status===`done`).length}function ko(e){return Math.max(e.plan?.tasks.length??0,e.tasks.length)}function Ao(e){return e.usage??{tokensIn:0,tokensOut:0,estCostUsd:0}}function jo(e){let t=Ao(e);return t.tokensIn+t.tokensOut}function Mo(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function No(){let e=(0,A.useRef)(null);Me(`/work/swarms`,e);let t=_(se),n=(0,A.useMemo)(()=>t.data??[],[t.data]),[r,i]=(0,A.useState)(``),[a,o]=(0,A.useState)(`all`),[s,c]=(0,A.useState)(`createdAt`),[l,u]=(0,A.useState)(`desc`),d=(0,A.useMemo)(()=>Array.from(new Set(n.map(e=>e.status))).sort(),[n]),f=(0,A.useMemo)(()=>{let e=n.filter(e=>{if(a!==`all`&&e.status!==a)return!1;if(!r.trim())return!0;let t=r.trim().toLowerCase();return e.id.toLowerCase().includes(t)||e.goal.toLowerCase().includes(t)});return e=[...e].sort((e,t)=>{let n=0;switch(s){case`createdAt`:n=e.createdAt.localeCompare(t.createdAt);break;case`updatedAt`:n=e.updatedAt.localeCompare(t.updatedAt);break;case`progress`:n=(ko(e)>0?Oo(e)/ko(e):0)-(ko(t)>0?Oo(t)/ko(t):0);break;case`tokens`:n=jo(e)-jo(t);break;case`estCostUsd`:n=Ao(e).estCostUsd-Ao(t).estCostUsd}return l===`asc`?n:-n}),e},[n,a,r,s,l]);function p(e){e===s?u(e=>e===`asc`?`desc`:`asc`):(c(e),u(`desc`))}function m(e){return e===s?l===`asc`?` ↑`:` ↓`:``}return(0,I.jsxs)(`div`,{ref:e,className:W.view,children:[(0,I.jsxs)(`header`,{className:W.header,children:[(0,I.jsx)(`h1`,{className:W.title,children:`Swarms`}),(0,I.jsxs)(`div`,{className:W.freshness,"aria-live":`polite`,children:[t.status===`refreshing`?(0,I.jsx)(O,{}):null,(0,I.jsxs)(`span`,{className:W.count,children:[f.length,` of `,n.length,` swarms`]})]})]}),(0,I.jsxs)(`form`,{className:W.filters,role:`search`,"aria-label":`Filter swarms`,onSubmit:e=>e.preventDefault(),children:[(0,I.jsxs)(`label`,{className:W.field,children:[(0,I.jsx)(`span`,{className:W.fieldLabel,children:`Search`}),(0,I.jsx)(`input`,{type:`text`,className:W.input,placeholder:`goal or swarm id`,value:r,onChange:e=>i(e.target.value)})]}),(0,I.jsxs)(`label`,{className:W.field,children:[(0,I.jsx)(`span`,{className:W.fieldLabel,children:`Status`}),(0,I.jsxs)(`select`,{className:W.select,value:a,onChange:e=>o(e.target.value),children:[(0,I.jsx)(`option`,{value:`all`,children:`All`}),d.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})]})]}),t.status===`loading`?(0,I.jsxs)(`div`,{className:W.listWrap,children:[(0,I.jsx)(y,{}),(0,I.jsx)(y,{}),(0,I.jsx)(y,{})]}):t.status===`error`?(0,I.jsx)(`div`,{className:W.error,role:`alert`,children:t.error?.message??`Failed to load swarms.`}):f.length===0?(0,I.jsx)(`p`,{className:W.empty,children:`No swarms match the current filters.`}):(0,I.jsxs)(`div`,{className:W.listWrap,children:[(0,I.jsxs)(`div`,{className:W.listHeader,children:[(0,I.jsx)(`span`,{children:`Goal`}),(0,I.jsxs)(`button`,{type:`button`,className:W.sortHeader,onClick:()=>p(`progress`),children:[`Progress`,m(`progress`)]}),(0,I.jsxs)(`button`,{type:`button`,className:W.sortHeader,onClick:()=>p(`tokens`),children:[`Tokens`,m(`tokens`)]}),(0,I.jsxs)(`button`,{type:`button`,className:W.sortHeader,onClick:()=>p(`estCostUsd`),children:[`Cost`,m(`estCostUsd`)]}),(0,I.jsxs)(`button`,{type:`button`,className:W.sortHeader,onClick:()=>p(`createdAt`),children:[`Created`,m(`createdAt`)]})]}),(0,I.jsx)(`ul`,{className:W.list,children:f.map(e=>{let t=Oo(e),n=ko(e),r=n>0?Math.round(t/n*100):0,i=Ao(e);return(0,I.jsxs)(`li`,{className:W.item,children:[(0,I.jsxs)(kr,{to:`/work/swarms/${e.id}`,"data-focus-key":`swarm-${e.id}`,className:W.goalLink,title:e.goal,children:[(0,I.jsx)(`span`,{className:W.goalText,children:e.goal}),(0,I.jsx)(T,{status:e.status})]}),(0,I.jsxs)(`div`,{className:W.burndown,children:[(0,I.jsx)(`div`,{className:W.burndownTrack,children:(0,I.jsx)(`div`,{className:W.burndownFill,style:{width:`${r}%`}})}),(0,I.jsxs)(`span`,{className:W.burndownLabel,children:[t,`/`,n]})]}),(0,I.jsxs)(`span`,{className:W.numeric,children:[i.tokensIn.toLocaleString(),`/`,i.tokensOut.toLocaleString()]}),(0,I.jsxs)(`span`,{className:W.numeric,children:[`$`,i.estCostUsd.toFixed(4)]}),(0,I.jsx)(`span`,{className:W.date,children:Mo(e.createdAt)})]},e.id)})})]})]})}var Po={svg:`_svg_2w2xr_1`,phaseLabel:`_phaseLabel_2w2xr_7`,edge:`_edge_2w2xr_14`,arrowHead:`_arrowHead_2w2xr_19`,nodeLink:`_nodeLink_2w2xr_23`,nodeRect:`_nodeRect_2w2xr_26`,nodeId:`_nodeId_2w2xr_31`,nodeGoal:`_nodeGoal_2w2xr_37`,neutral:`_neutral_2w2xr_45`,statusDot:`_statusDot_2w2xr_49`,info:`_info_2w2xr_53`,running:`_running_2w2xr_61`,success:`_success_2w2xr_69`,warning:`_warning_2w2xr_77`,danger:`_danger_2w2xr_85`,unknown:`_unknown_2w2xr_93`,empty:`_empty_2w2xr_105`},Fo={scaffold:0,build:1,integrate:2,verify:3,review:4};function Io(e,t){let n=new Map;for(let t of e?.tasks??[])n.set(t.id,{id:t.id,phase:t.phase,goal:t.goal,deps:t.deps,status:`pending`});for(let e of t){let t=n.get(e.id);n.set(e.id,{id:e.id,phase:e.phase||t?.phase||`build`,goal:t?.goal??``,deps:t?.deps??[],status:e.status})}return Array.from(n.values())}function Lo(e,t){return e.length>t?`${e.slice(0,t-1)}…`:e}var Ro=140,zo=48,Bo=20;function Vo({tasks:e,taskAnchorPrefix:t=`dag-task`}){if(e.length===0)return(0,I.jsx)(`p`,{className:Po.empty,children:`No tasks in this swarm.`});let n=new Map;for(let t of e){let e=t.phase||`build`,r=n.get(e)??[];r.push(t),n.set(e,r)}let r=Array.from(n.keys()).sort((e,t)=>(Fo[e]??99)-(Fo[t]??99)),i=new Map,a=Bo;for(let e of r)i.set(e,a),a+=200;let o=a+Bo,s=new Map;for(let e of r){let t=Bo;for(let r of n.get(e)){let n=i.get(e);s.set(r.id,{x:n,y:t,cx:n+Ro/2,cy:t+zo/2}),t+=68}}let c=Math.max(...Array.from(s.values()).map(e=>e.y+zo))+40,l=[];for(let t of e){let e=s.get(t.id);if(e)for(let n of t.deps){let r=s.get(n);if(!r)continue;let i=r.x+Ro,a=r.cy,o=e.x,c=e.cy,u=(i+o)/2;l.push({key:`${n}->${t.id}`,d:`M ${i} ${a} C ${u} ${a}, ${u} ${c}, ${o} ${c}`})}}return(0,I.jsxs)(`svg`,{width:o,height:c,viewBox:`0 0 ${o} ${c}`,className:Po.svg,role:`img`,"aria-label":`Swarm task dependency graph`,children:[(0,I.jsx)(`defs`,{children:(0,I.jsx)(`marker`,{id:`dag-arrow`,markerWidth:`8`,markerHeight:`8`,refX:`6`,refY:`3`,orient:`auto`,children:(0,I.jsx)(`path`,{d:`M0,0 L0,6 L8,3 z`,className:Po.arrowHead})})}),r.map(e=>(0,I.jsx)(`text`,{x:i.get(e)+Ro/2,y:14,textAnchor:`middle`,className:Po.phaseLabel,children:e},e)),l.map(e=>(0,I.jsx)(`path`,{d:e.d,className:Po.edge,fill:`none`,markerEnd:`url(#dag-arrow)`},e.key)),e.map(e=>{let n=s.get(e.id);if(!n)return null;let r=re(e.status);return(0,I.jsx)(`g`,{transform:`translate(${n.x},${n.y})`,children:(0,I.jsxs)(`a`,{href:`#${t}-${encodeURIComponent(e.id)}`,className:Po.nodeLink,children:[(0,I.jsx)(`title`,{children:`${e.id} — ${e.goal} (${e.status})`}),(0,I.jsx)(`rect`,{width:Ro,height:zo,rx:6,ry:6,className:`${Po.nodeRect} ${Po[r]}`}),(0,I.jsx)(`circle`,{cx:10,cy:zo/2,r:4,className:`${Po.statusDot} ${Po[r]}`}),(0,I.jsx)(`text`,{x:20,y:17,className:Po.nodeId,children:Lo(e.id,18)}),(0,I.jsx)(`text`,{x:20,y:33,className:Po.nodeGoal,children:Lo(e.goal,20)})]})},e.id)})]})}var G={view:`_view_19up6_1`,header:`_header_19up6_8`,eyebrow:`_eyebrow_19up6_16`,title:`_title_19up6_22`,freshness:`_freshness_19up6_29`,burndownRow:`_burndownRow_19up6_35`,burndownTrack:`_burndownTrack_19up6_41`,burndownFill:`_burndownFill_19up6_49`,burndownLabel:`_burndownLabel_19up6_55`,metaGrid:`_metaGrid_19up6_62`,numeric:`_numeric_19up6_80`,mono:`_mono_19up6_84`,section:`_section_19up6_90`,sectionTitle:`_sectionTitle_19up6_96`,resultText:`_resultText_19up6_101`,escalationList:`_escalationList_19up6_110`,escalationItem:`_escalationItem_19up6_115`,escalationJson:`_escalationJson_19up6_120`,dagWrap:`_dagWrap_19up6_130`,taskList:`_taskList_19up6_138`,taskItem:`_taskItem_19up6_144`,taskHeader:`_taskHeader_19up6_157`,taskId:`_taskId_19up6_163`,taskPhase:`_taskPhase_19up6_169`,taskGoal:`_taskGoal_19up6_176`,taskDeps:`_taskDeps_19up6_181`,error:`_error_19up6_188`},Ho=`dag-task`;function Uo(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function Wo(){let{id:e}=yn(),t=(0,A.useRef)(null);Me(`/work/swarms/${e??``}`,t);let n=_(Ce(e??``));if(!e)return(0,I.jsx)(`div`,{className:G.view,children:(0,I.jsx)(`p`,{className:G.error,role:`alert`,children:`No swarm id in URL.`})});if(n.status===`loading`)return(0,I.jsxs)(`div`,{ref:t,className:G.view,children:[(0,I.jsx)(l,{width:`60%`}),(0,I.jsx)(l,{width:`30%`}),(0,I.jsx)(l,{width:`80%`})]});if(n.status===`error`||!n.data)return(0,I.jsx)(`div`,{ref:t,className:G.view,children:(0,I.jsx)(`p`,{className:G.error,role:`alert`,children:n.error?.message??`Swarm ${e} not found.`})});let r=n.data,i=r.tasks.filter(e=>e.status===`done`).length,a=Math.max(r.plan?.tasks.length??0,r.tasks.length),o=a>0?Math.round(i/a*100):0,s=Io(r.plan,r.tasks),c=r.usage??{tokensIn:0,tokensOut:0,estCostUsd:0};return(0,I.jsxs)(`div`,{ref:t,className:G.view,children:[(0,I.jsxs)(`header`,{className:G.header,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`p`,{className:G.eyebrow,children:[`Swarm `,r.id]}),(0,I.jsx)(`h1`,{className:G.title,children:r.goal})]}),(0,I.jsxs)(`div`,{className:G.freshness,"aria-live":`polite`,children:[n.status===`refreshing`?(0,I.jsx)(O,{}):null,(0,I.jsx)(T,{status:r.status})]})]}),(0,I.jsxs)(`div`,{className:G.burndownRow,children:[(0,I.jsx)(`div`,{className:G.burndownTrack,children:(0,I.jsx)(`div`,{className:G.burndownFill,style:{width:`${o}%`}})}),(0,I.jsxs)(`span`,{className:G.burndownLabel,children:[i,`/`,a,` tasks done (`,o,`%)`]})]}),(0,I.jsxs)(`dl`,{className:G.metaGrid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Tokens in / out`}),(0,I.jsxs)(`dd`,{className:G.numeric,children:[c.tokensIn.toLocaleString(),` / `,c.tokensOut.toLocaleString()]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Est cost`}),(0,I.jsxs)(`dd`,{className:G.numeric,children:[`$`,c.estCostUsd.toFixed(4)]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Parallelism`}),(0,I.jsx)(`dd`,{className:G.numeric,children:r.parallel})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Created`}),(0,I.jsx)(`dd`,{children:Uo(r.createdAt)})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Updated`}),(0,I.jsx)(`dd`,{children:Uo(r.updatedAt)})]}),r.project?(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Project`}),(0,I.jsx)(`dd`,{className:G.mono,children:r.project})]}):null]}),r.escalations&&r.escalations.length>0?(0,I.jsxs)(`section`,{className:G.section,children:[(0,I.jsxs)(`h2`,{className:G.sectionTitle,children:[`Escalations (`,r.escalations.length,`)`]}),(0,I.jsx)(`ul`,{className:G.escalationList,children:r.escalations.map((e,t)=>(0,I.jsx)(`li`,{className:G.escalationItem,children:(0,I.jsx)(`pre`,{className:G.escalationJson,children:JSON.stringify(e,null,2)})},t))})]}):null,r.result?(0,I.jsxs)(`section`,{className:G.section,children:[(0,I.jsx)(`h2`,{className:G.sectionTitle,children:`Result`}),(0,I.jsx)(`p`,{className:G.resultText,children:r.result})]}):null,(0,I.jsxs)(`section`,{className:G.section,children:[(0,I.jsx)(`h2`,{className:G.sectionTitle,children:`Task graph`}),(0,I.jsx)(`div`,{className:G.dagWrap,children:(0,I.jsx)(Vo,{tasks:s,taskAnchorPrefix:Ho})})]}),(0,I.jsxs)(`section`,{className:G.section,children:[(0,I.jsxs)(`h2`,{className:G.sectionTitle,children:[`Tasks (`,s.length,`)`]}),(0,I.jsx)(`ul`,{className:G.taskList,children:s.map(e=>(0,I.jsxs)(`li`,{id:`${Ho}-${e.id}`,"data-focus-key":`swarm-task-${e.id}`,className:G.taskItem,tabIndex:-1,children:[(0,I.jsxs)(`div`,{className:G.taskHeader,children:[(0,I.jsx)(`span`,{className:G.taskId,children:e.id}),(0,I.jsx)(`span`,{className:G.taskPhase,children:e.phase}),(0,I.jsx)(T,{status:e.status})]}),(0,I.jsx)(`p`,{className:G.taskGoal,children:e.goal}),e.deps.length>0?(0,I.jsxs)(`p`,{className:G.taskDeps,children:[`depends on: `,e.deps.join(`, `)]}):null]},e.id))})]})]})}var K={view:`_view_1bwoy_1`,header:`_header_1bwoy_8`,title:`_title_1bwoy_16`,freshness:`_freshness_1bwoy_22`,callout:`_callout_1bwoy_28`,calloutTitle:`_calloutTitle_1bwoy_39`,calloutBody:`_calloutBody_1bwoy_44`,calloutCommand:`_calloutCommand_1bwoy_48`,metaGrid:`_metaGrid_1bwoy_59`,section:`_section_1bwoy_77`,sectionTitle:`_sectionTitle_1bwoy_83`,serviceError:`_serviceError_1bwoy_88`,tickTableWrap:`_tickTableWrap_1bwoy_96`,tickTable:`_tickTable_1bwoy_96`,date:`_date_1bwoy_124`,numeric:`_numeric_1bwoy_130`,dryRun:`_dryRun_1bwoy_135`,empty:`_empty_1bwoy_140`,error:`_error_1bwoy_145`},Go={missing:`No daemon state file has been written yet — the daemon may never have run on this machine.`,malformed:`The daemon state file exists but failed to parse.`,unreadable:`The daemon state file could not be read. This is also the exact signal produced when a state-recovery marker is present (a prior repair left a quarantine in progress) — the API does not distinguish the two cases, so treat this as "inspect before trusting displayed daemon state."`,inconsistent:`The daemon state file and the live lock/activity check disagree — the daemon may be mid-restart.`,unavailable:`The daemon state read path itself failed (I/O error or similar).`};function Ko(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function qo({quality:e}){let t=e.reason,n=Go[t]??`Daemon state could not be verified.`;return(0,I.jsxs)(`section`,{className:K.callout,role:`alert`,children:[(0,I.jsxs)(`p`,{className:K.calloutTitle,children:[`Daemon state is unknown (`,t,`)`]}),(0,I.jsx)(`p`,{className:K.calloutBody,children:n}),(0,I.jsx)(`p`,{className:K.calloutBody,children:`Real remedy — preview or execute a state recovery from a terminal on this machine:`}),(0,I.jsx)(`pre`,{className:K.calloutCommand,children:`ashlr daemon recover-state --dry-run --expected-sha256 <sha256> [--json]
5
- ashlr daemon recover-state --execute --plan-id <uuid> --plan-sha256 <sha256> --authorize <plan-sha256> [--json]`}),(0,I.jsx)(`p`,{className:K.calloutBody,children:`If a quarantine already exists and needs resolving instead:`}),(0,I.jsx)(`pre`,{className:K.calloutCommand,children:`ashlr daemon resolve-state --dry-run --quarantine-plan-id <uuid> --quarantine-receipt-sha256 <sha256> [--json]
6
- ashlr daemon resolve-state --execute --plan-id <uuid> --plan-sha256 <sha256> --authorize <plan-sha256> --confirm <plan-sha256> [--json]`})]})}function Jo(){let e=(0,A.useRef)(null);Me(`/control/daemon`,e);let t=_(ve),n=_(D),r=t.data?.daemon,i=n.data;return(0,I.jsxs)(`div`,{ref:e,className:K.view,children:[(0,I.jsxs)(`header`,{className:K.header,children:[(0,I.jsx)(`h1`,{className:K.title,children:`Daemon`}),(0,I.jsxs)(`div`,{className:K.freshness,"aria-live":`polite`,children:[t.status===`refreshing`||n.status===`refreshing`?(0,I.jsx)(O,{}):null,r?(0,I.jsx)(w,{quality:r.sourceQuality,label:`daemon state`,children:(0,I.jsx)(T,{status:r.running?`running`:`pending`,children:r.running?`running`:`stopped`})}):null]})]}),t.status===`loading`?(0,I.jsx)(l,{width:`60%`}):t.status===`error`||!r?(0,I.jsx)(`p`,{className:K.error,role:`alert`,children:t.error?.message??`Failed to load control snapshot.`}):(0,I.jsxs)(I.Fragment,{children:[ne(r.sourceQuality)?null:(0,I.jsx)(qo,{quality:r.sourceQuality}),(0,I.jsxs)(`dl`,{className:K.metaGrid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Runtime state`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(w,{quality:r.sourceQuality,label:`runtime state`,children:r.runtimeState})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`PID`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(w,{quality:r.sourceQuality,label:`pid`,children:r.pid??`—`})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Last tick`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(w,{quality:r.sourceQuality,label:`last tick`,children:Ko(r.lastTickAt)})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Today's spend`}),(0,I.jsx)(`dd`,{children:(0,I.jsxs)(w,{quality:r.sourceQuality,label:`spend`,children:[`$`,r.todaySpentUsd.toFixed(2)]})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Direction mode`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(w,{quality:r.sourceQuality,label:`direction mode`,children:r.activeDirectionMode??`none`})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Direction reason`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(w,{quality:r.sourceQuality,label:`direction reason`,children:r.activeDirectionReason??`—`})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Autonomy control loop`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(w,{quality:r.sourceQuality,label:`autonomy control loop`,children:r.autonomyControlLoop?`enabled`:`disabled`})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Autonomy control mode`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(w,{quality:r.sourceQuality,label:`autonomy control mode`,children:r.autonomyControlMode})})]})]}),(0,I.jsxs)(`section`,{className:K.section,children:[(0,I.jsx)(`h2`,{className:K.sectionTitle,children:`OS service`}),(0,I.jsxs)(`dl`,{className:K.metaGrid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Registration state`}),(0,I.jsx)(`dd`,{children:r.service.registrationState})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Installed`}),(0,I.jsx)(`dd`,{children:r.service.installed?`yes`:`no`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Running`}),(0,I.jsx)(`dd`,{children:r.service.running?`yes`:`no`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Runtime state`}),(0,I.jsx)(`dd`,{children:r.service.runtimeState??`unknown`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Platform`}),(0,I.jsx)(`dd`,{children:r.service.platformSpec})]})]}),r.service.errorLog?(0,I.jsx)(`p`,{className:K.serviceError,role:`alert`,children:r.service.errorLog}):null]})]}),(0,I.jsxs)(`section`,{className:K.section,children:[(0,I.jsx)(`h2`,{className:K.sectionTitle,children:`Recent ticks`}),n.status===`loading`?(0,I.jsx)(l,{width:`80%`}):!i||!i.ticks||i.ticks.length===0?(0,I.jsx)(`p`,{className:K.empty,children:`No tick history available.`}):(0,I.jsx)(`div`,{className:K.tickTableWrap,children:(0,I.jsxs)(`table`,{className:K.tickTable,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,children:`Time`}),(0,I.jsx)(`th`,{scope:`col`,children:`Reason`}),(0,I.jsx)(`th`,{scope:`col`,children:`Items`}),(0,I.jsx)(`th`,{scope:`col`,children:`Proposals`}),(0,I.jsx)(`th`,{scope:`col`,children:`Spend`})]})}),(0,I.jsx)(`tbody`,{children:[...i.ticks].reverse().slice(0,20).map((e,t)=>(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`td`,{className:K.date,children:Ko(e.ts)}),(0,I.jsxs)(`td`,{children:[e.reason,e.dryRun?(0,I.jsx)(`span`,{className:K.dryRun,children:` (dry-run)`}):null]}),(0,I.jsx)(`td`,{className:K.numeric,children:e.itemsConsidered}),(0,I.jsx)(`td`,{className:K.numeric,children:e.proposalsCreated}),(0,I.jsxs)(`td`,{className:K.numeric,children:[`$`,e.spentUsd.toFixed(4)]})]},`${e.ts}-${t}`))})]})})]})]})}var q={view:`_view_ssrhq_1`,header:`_header_ssrhq_8`,title:`_title_ssrhq_14`,freshness:`_freshness_ssrhq_20`,section:`_section_ssrhq_26`,sectionTitle:`_sectionTitle_ssrhq_32`,killSwitchRow:`_killSwitchRow_ssrhq_37`,pauseButton:`_pauseButton_ssrhq_47`,resumeButton:`_resumeButton_ssrhq_65`,mutationError:`_mutationError_ssrhq_83`,metaGrid:`_metaGrid_ssrhq_91`,numeric:`_numeric_ssrhq_109`,lockWarning:`_lockWarning_ssrhq_113`,tableWrap:`_tableWrap_ssrhq_117`,table:`_table_ssrhq_117`,mono:`_mono_ssrhq_144`,empty:`_empty_ssrhq_149`,error:`_error_ssrhq_154`,confirmBody:`_confirmBody_ssrhq_162`,confirmActions:`_confirmActions_ssrhq_168`,cancelButton:`_cancelButton_ssrhq_174`,confirmButton:`_confirmButton_ssrhq_186`};function Yo(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function Xo(){let e=(0,A.useRef)(null);Me(`/control/fleet`,e);let t=_(ye),n=_(ge),r=b(),[i,a]=(0,A.useState)(null),[o,s]=(0,A.useState)(!1),[c,u]=(0,A.useState)(!1),[d,f]=(0,A.useState)(!1),[p,m]=(0,A.useState)(null);async function h(e){f(!0),m(null);try{e===`pause`?await Te():await we()}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(!1),a(null)}}function g(e){m(null),a(e),s(!0)}function v(){s(!1),r.hasHold?i&&h(i):u(!0)}(0,A.useEffect)(()=>{c||i&&(r.hasHold?h(i):a(null))},[c]);let y=t.data,x=y?.killSwitch,S=x?{sourceState:x.sourceState,complete:x.sourceState===`healthy`,reason:x.reason}:void 0,te=y?.killed===!0;return(0,I.jsxs)(`div`,{ref:e,className:q.view,children:[(0,I.jsxs)(`header`,{className:q.header,children:[(0,I.jsx)(`h1`,{className:q.title,children:`Fleet`}),(0,I.jsx)(`div`,{className:q.freshness,"aria-live":`polite`,children:t.status===`refreshing`||n.status===`refreshing`?(0,I.jsx)(O,{}):null})]}),t.status===`loading`?(0,I.jsx)(l,{width:`60%`}):t.status===`error`||!y?(0,I.jsx)(`p`,{className:q.error,role:`alert`,children:t.error?.message??`Failed to load fleet status.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`section`,{className:q.section,children:[(0,I.jsx)(`h2`,{className:q.sectionTitle,children:`Kill switch`}),(0,I.jsx)(`div`,{className:q.killSwitchRow,children:(0,I.jsx)(w,{quality:S,label:`kill switch`,renderControl:()=>(0,I.jsx)(`button`,{type:`button`,className:te?q.resumeButton:q.pauseButton,onClick:()=>g(te?`resume`:`pause`),disabled:d,children:d?`Working…`:te?`Resume fleet`:`Pause fleet`}),children:(0,I.jsx)(T,{status:te?`paused`:`running`,children:te?`engaged — fleet paused`:`clear — fleet active`})})}),p?(0,I.jsx)(`p`,{className:q.mutationError,role:`alert`,children:p}):null]}),(0,I.jsxs)(`section`,{className:q.section,children:[(0,I.jsx)(`h2`,{className:q.sectionTitle,children:`Queue depth`}),(0,I.jsxs)(`dl`,{className:q.metaGrid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Backlog items`}),(0,I.jsx)(`dd`,{className:q.numeric,children:y.queue.backlogItems})]}),y.queue.eligibleBacklogItems===void 0?null:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Eligible`}),(0,I.jsx)(`dd`,{className:q.numeric,children:y.queue.eligibleBacklogItems})]}),y.queue.cooldownItems===void 0?null:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Cooldown`}),(0,I.jsx)(`dd`,{className:q.numeric,children:y.queue.cooldownItems})]}),y.queue.pendingItems===void 0?null:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Pending`}),(0,I.jsx)(`dd`,{className:q.numeric,children:y.queue.pendingItems})]}),y.queue.nextEligibleAt===void 0?null:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Next eligible`}),(0,I.jsx)(`dd`,{children:Yo(y.queue.nextEligibleAt)})]})]})]}),(0,I.jsxs)(`section`,{className:q.section,children:[(0,I.jsx)(`h2`,{className:q.sectionTitle,children:`Lease health`}),y.queue.shared?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`dl`,{className:q.metaGrid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Active claims`}),(0,I.jsx)(`dd`,{className:q.numeric,children:y.queue.shared.activeClaims})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Owned by this machine`}),(0,I.jsx)(`dd`,{className:q.numeric,children:y.queue.shared.ownedClaims})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Reclaimable (expired)`}),(0,I.jsx)(`dd`,{className:q.numeric,children:y.queue.shared.reclaimableClaims})]}),y.queue.shared.executingClaims===void 0?null:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Executing`}),(0,I.jsx)(`dd`,{className:q.numeric,children:y.queue.shared.executingClaims})]}),y.queue.shared.ambiguousClaims===void 0?null:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Ambiguous (needs reconciliation)`}),(0,I.jsx)(`dd`,{className:q.numeric,children:y.queue.shared.ambiguousClaims})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Next lease expiry`}),(0,I.jsx)(`dd`,{children:Yo(y.queue.shared.nextLeaseExpiryAt)})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Advisory lock`}),(0,I.jsxs)(`dd`,{children:[y.queue.shared.lock.present?y.queue.shared.lock.stale?`present, stale`:`present, healthy`:`absent`,y.queue.shared.lock.recoveryRequired?(0,I.jsx)(`span`,{className:q.lockWarning,children:` — recovery required`}):null]})]})]}),y.queue.shared.claimsByMachine.length>0?(0,I.jsx)(`div`,{className:q.tableWrap,children:(0,I.jsxs)(`table`,{className:q.table,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,children:`Machine`}),(0,I.jsx)(`th`,{scope:`col`,children:`Active`}),(0,I.jsx)(`th`,{scope:`col`,children:`Expired`}),(0,I.jsx)(`th`,{scope:`col`,children:`Executing`})]})}),(0,I.jsx)(`tbody`,{children:y.queue.shared.claimsByMachine.map(e=>(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`td`,{className:q.mono,children:e.machineId}),(0,I.jsx)(`td`,{className:q.numeric,children:e.active}),(0,I.jsx)(`td`,{className:q.numeric,children:e.expired}),(0,I.jsx)(`td`,{className:q.numeric,children:e.executing??`—`})]},e.machineId))})]})}):null]}):(0,I.jsx)(`p`,{className:q.empty,children:`Shared fleet queue is not in use on this deployment.`})]})]}),(0,I.jsxs)(`section`,{className:q.section,children:[(0,I.jsx)(`h2`,{className:q.sectionTitle,children:`Recent activity`}),n.status===`loading`?(0,I.jsx)(l,{width:`70%`}):n.status===`error`||!n.data?(0,I.jsx)(`p`,{className:q.error,role:`alert`,children:n.error?.message??`Failed to load fleet activity.`}):(0,I.jsxs)(`dl`,{className:q.metaGrid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Cooldown items`}),(0,I.jsx)(`dd`,{className:q.numeric,children:n.data.cooldownCount})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Engines ready`}),(0,I.jsxs)(`dd`,{className:q.numeric,children:[n.data.engineReadiness.filter(e=>e.installed&&e.authed===!0).length,` /`,` `,n.data.engineReadiness.length]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Recent auto-merges`}),(0,I.jsx)(`dd`,{className:q.numeric,children:y?.merges.recent??`—`})]})]})]}),(0,I.jsxs)(C,{open:o,onClose:()=>{s(!1),a(null)},titleId:`fleet-kill-switch-confirm`,title:i===`resume`?`Resume the fleet?`:`Pause the fleet?`,children:[(0,I.jsx)(`p`,{className:q.confirmBody,children:i===`resume`?`This clears the global kill switch. Autonomous dispatch will resume across the fleet.`:`This engages the global kill switch. Autonomous dispatch halts fleet-wide until explicitly resumed.`}),(0,I.jsxs)(`div`,{className:q.confirmActions,children:[(0,I.jsx)(`button`,{type:`button`,className:q.cancelButton,onClick:()=>{s(!1),a(null)},children:`Cancel`}),(0,I.jsx)(`button`,{type:`button`,className:q.confirmButton,onClick:v,children:i===`resume`?`Yes, resume`:`Yes, pause`})]})]}),(0,I.jsx)(ee,{open:c,onClose:()=>u(!1),reason:i===`resume`?`Resuming the fleet requires the dispatch token.`:`Pausing the fleet requires the dispatch token.`})]})}var J={view:`_view_1fet3_1`,header:`_header_1fet3_8`,title:`_title_1fet3_14`,freshness:`_freshness_1fet3_20`,unavailable:`_unavailable_1fet3_26`,counts:`_counts_1fet3_35`,countTile:`_countTile_1fet3_41`,countValue:`_countValue_1fet3_51`,countLabel:`_countLabel_1fet3_57`,critical:`_critical_1fet3_64`,high:`_high_1fet3_65`,medium:`_medium_1fet3_68`,low:`_low_1fet3_71`,filters:`_filters_1fet3_75`,field:`_field_1fet3_86`,fieldLabel:`_fieldLabel_1fet3_92`,input:`_input_1fet3_97`,select:`_select_1fet3_98`,tableWrap:`_tableWrap_1fet3_114`,table:`_table_1fet3_114`,mono:`_mono_1fet3_141`,empty:`_empty_1fet3_146`,error:`_error_1fet3_153`},Zo={critical:`danger`,high:`danger`,medium:`warning`,low:`neutral`},Qo={critical:0,high:1,medium:2,low:3};function $o(){let e=(0,A.useRef)(null);Me(`/control/security`,e);let t=_(ve),n=t.data?.security,[r,i]=(0,A.useState)(``),[a,o]=(0,A.useState)(`all`),[s,c]=(0,A.useState)(`all`),u=(0,A.useMemo)(()=>Array.from(new Set((n?.findings??[]).map(e=>e.repo))).sort(),[n]),d=(0,A.useMemo)(()=>(n?.findings??[]).filter(e=>a===`all`||e.severity===a).filter(e=>s===`all`||e.repo===s).filter(e=>{if(!r.trim())return!0;let t=r.trim().toLowerCase();return e.title.toLowerCase().includes(t)||e.repo.toLowerCase().includes(t)}).sort((e,t)=>(Qo[e.severity]??9)-(Qo[t.severity]??9)),[n,a,s,r]);return(0,I.jsxs)(`div`,{ref:e,className:J.view,children:[(0,I.jsxs)(`header`,{className:J.header,children:[(0,I.jsx)(`h1`,{className:J.title,children:`Security`}),(0,I.jsx)(`div`,{className:J.freshness,"aria-live":`polite`,children:t.status===`refreshing`?(0,I.jsx)(O,{}):null})]}),t.status===`loading`?(0,I.jsx)(l,{width:`60%`}):t.status===`error`||!n?(0,I.jsx)(`p`,{className:J.error,role:`alert`,children:t.error?.message??`Failed to load control snapshot.`}):n.available?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:J.counts,children:[(0,I.jsxs)(`div`,{className:`${J.countTile} ${J.critical}`,children:[(0,I.jsx)(`span`,{className:J.countValue,children:n.counts.critical}),(0,I.jsx)(`span`,{className:J.countLabel,children:`Critical`})]}),(0,I.jsxs)(`div`,{className:`${J.countTile} ${J.high}`,children:[(0,I.jsx)(`span`,{className:J.countValue,children:n.counts.high}),(0,I.jsx)(`span`,{className:J.countLabel,children:`High`})]}),(0,I.jsxs)(`div`,{className:`${J.countTile} ${J.medium}`,children:[(0,I.jsx)(`span`,{className:J.countValue,children:n.counts.medium}),(0,I.jsx)(`span`,{className:J.countLabel,children:`Medium`})]}),(0,I.jsxs)(`div`,{className:`${J.countTile} ${J.low}`,children:[(0,I.jsx)(`span`,{className:J.countValue,children:n.counts.low}),(0,I.jsx)(`span`,{className:J.countLabel,children:`Low`})]})]}),(0,I.jsxs)(`form`,{className:J.filters,role:`search`,"aria-label":`Filter findings`,onSubmit:e=>e.preventDefault(),children:[(0,I.jsxs)(`label`,{className:J.field,children:[(0,I.jsx)(`span`,{className:J.fieldLabel,children:`Search`}),(0,I.jsx)(`input`,{type:`text`,className:J.input,placeholder:`title or repo`,value:r,onChange:e=>i(e.target.value)})]}),(0,I.jsxs)(`label`,{className:J.field,children:[(0,I.jsx)(`span`,{className:J.fieldLabel,children:`Severity`}),(0,I.jsxs)(`select`,{className:J.select,value:a,onChange:e=>o(e.target.value),children:[(0,I.jsx)(`option`,{value:`all`,children:`All`}),(0,I.jsx)(`option`,{value:`critical`,children:`Critical`}),(0,I.jsx)(`option`,{value:`high`,children:`High`}),(0,I.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,I.jsx)(`option`,{value:`low`,children:`Low`})]})]}),(0,I.jsxs)(`label`,{className:J.field,children:[(0,I.jsx)(`span`,{className:J.fieldLabel,children:`Repo`}),(0,I.jsxs)(`select`,{className:J.select,value:s,onChange:e=>c(e.target.value),children:[(0,I.jsx)(`option`,{value:`all`,children:`All`}),u.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})]})]}),d.length===0?(0,I.jsx)(`p`,{className:J.empty,children:`No findings match the current filters.`}):(0,I.jsx)(`div`,{className:J.tableWrap,children:(0,I.jsxs)(`table`,{className:J.table,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,children:`Severity`}),(0,I.jsx)(`th`,{scope:`col`,children:`Repo`}),(0,I.jsx)(`th`,{scope:`col`,children:`Finding`})]})}),(0,I.jsx)(`tbody`,{children:d.map((e,t)=>(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`td`,{children:(0,I.jsx)(T,{status:e.severity,tone:Zo[e.severity]??`neutral`})}),(0,I.jsx)(`td`,{className:J.mono,children:e.repo}),(0,I.jsx)(`td`,{children:e.title})]},`${e.repo}-${e.title}-${t}`))})]})})]}):(0,I.jsx)(`p`,{className:J.unavailable,children:`No cached security data available — the backlog is absent, empty, or has no security-source findings. This is not the same as "clean": it means binshield hasn't produced cached findings for this fleet yet.`})]})}var Y={view:`_view_1yeql_1`,header:`_header_1yeql_8`,title:`_title_1yeql_14`,freshness:`_freshness_1yeql_20`,count:`_count_1yeql_26`,missionCard:`_missionCard_1yeql_31`,sectionTitle:`_sectionTitle_1yeql_41`,missionState:`_missionState_1yeql_49`,sourceGrid:`_sourceGrid_1yeql_54`,list:`_list_1yeql_68`,goalCard:`_goalCard_1yeql_74`,goalHeader:`_goalHeader_1yeql_88`,goalObjective:`_goalObjective_1yeql_95`,progressRow:`_progressRow_1yeql_100`,progressTrack:`_progressTrack_1yeql_106`,progressFill:`_progressFill_1yeql_114`,progressLabel:`_progressLabel_1yeql_120`,nextActionable:`_nextActionable_1yeql_127`,mono:`_mono_1yeql_132`,milestoneList:`_milestoneList_1yeql_136`,milestoneItem:`_milestoneItem_1yeql_142`,milestoneTitle:`_milestoneTitle_1yeql_149`,noMilestones:`_noMilestones_1yeql_153`,empty:`_empty_1yeql_158`,error:`_error_1yeql_165`};function es(){let e=(0,A.useRef)(null);Me(`/goals`,e);let t=_(pe),n=_(ae),r=t.data??[],i=n.data;return(0,I.jsxs)(`div`,{ref:e,className:Y.view,children:[(0,I.jsxs)(`header`,{className:Y.header,children:[(0,I.jsx)(`h1`,{className:Y.title,children:`Goals`}),(0,I.jsxs)(`div`,{className:Y.freshness,"aria-live":`polite`,children:[t.status===`refreshing`||n.status===`refreshing`?(0,I.jsx)(O,{}):null,(0,I.jsxs)(`span`,{className:Y.count,children:[r.length,` goals`]})]})]}),n.status===`loading`?(0,I.jsx)(l,{width:`50%`}):n.status===`success`&&i?(0,I.jsxs)(`section`,{className:Y.missionCard,children:[(0,I.jsx)(`h2`,{className:Y.sectionTitle,children:`Mission state`}),(0,I.jsx)(`p`,{className:Y.missionState,children:i.state}),(0,I.jsxs)(`dl`,{className:Y.sourceGrid,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Briefing`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(w,{quality:i.sources.briefing??void 0,label:`briefing source`,children:`available`})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Goals source`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(w,{quality:i.sources.goals??void 0,label:`goals source`,children:`available`})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Enrollment`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(w,{quality:i.sources.enrollment??void 0,label:`enrollment source`,children:`available`})})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{children:`Proposals`}),(0,I.jsx)(`dd`,{children:(0,I.jsx)(w,{quality:i.sources.proposals??void 0,label:`proposals source`,children:`available`})})]})]})]}):null,t.status===`loading`?(0,I.jsxs)(`div`,{className:Y.list,children:[(0,I.jsx)(l,{width:`90%`}),(0,I.jsx)(l,{width:`70%`})]}):t.status===`error`?(0,I.jsx)(`p`,{className:Y.error,role:`alert`,children:t.error?.message??`Failed to load goals.`}):r.length===0?(0,I.jsx)(`p`,{className:Y.empty,children:`No active goals.`}):(0,I.jsx)(`ul`,{className:Y.list,children:r.map(e=>{let t=Math.round((e.progress.fractionDone??0)*100);return(0,I.jsxs)(`li`,{className:Y.goalCard,"data-focus-key":`goal-${e.id}`,tabIndex:0,children:[(0,I.jsxs)(`div`,{className:Y.goalHeader,children:[(0,I.jsx)(`h3`,{className:Y.goalObjective,children:e.objective}),(0,I.jsx)(T,{status:e.status})]}),(0,I.jsxs)(`div`,{className:Y.progressRow,children:[(0,I.jsx)(`div`,{className:Y.progressTrack,children:(0,I.jsx)(`div`,{className:Y.progressFill,style:{width:`${t}%`}})}),(0,I.jsxs)(`span`,{className:Y.progressLabel,children:[t,`%`]})]}),e.progress.nextActionableId?(0,I.jsxs)(`p`,{className:Y.nextActionable,children:[`Next actionable milestone id: `,(0,I.jsx)(`span`,{className:Y.mono,children:e.progress.nextActionableId})]}):null,e.milestones.length>0?(0,I.jsx)(`ol`,{className:Y.milestoneList,children:[...e.milestones].sort((e,t)=>e.order-t.order).map(e=>(0,I.jsxs)(`li`,{className:Y.milestoneItem,children:[(0,I.jsx)(T,{status:e.status}),(0,I.jsx)(`span`,{className:Y.milestoneTitle,children:e.title})]},e.title))}):(0,I.jsx)(`p`,{className:Y.noMilestones,children:`No milestones yet.`})]},e.id)})})]})}var X={list:`_list_1nh33_1`,filters:`_filters_1nh33_8`,filterField:`_filterField_1nh33_14`,filterLabel:`_filterLabel_1nh33_21`,summary:`_summary_1nh33_36`,batchBar:`_batchBar_1nh33_44`,batchApprove:`_batchApprove_1nh33_61`,batchReject:`_batchReject_1nh33_66`,skeletons:`_skeletons_1nh33_71`,error:`_error_1nh33_77`,empty:`_empty_1nh33_85`,table:`_table_1nh33_94`,checkboxCol:`_checkboxCol_1nh33_121`,repoCol:`_repoCol_1nh33_125`,kindCol:`_kindCol_1nh33_129`,ageCol:`_ageCol_1nh33_133`,statusCol:`_statusCol_1nh33_137`,whyCol:`_whyCol_1nh33_141`,row:`_row_1nh33_145`,rowActive:`_rowActive_1nh33_155`,titleLink:`_titleLink_1nh33_159`,repoCell:`_repoCell_1nh33_172`,age:`_age_1nh33_133`,why:`_why_1nh33_141`},ts=[{value:`pending`,label:`Pending`},{value:`rejected`,label:`Rejected`},{value:`approved`,label:`Approved`},{value:`applied`,label:`Applied`},{value:`failed`,label:`Failed`},{value:`awaiting-host-merge`,label:`Awaiting host merge`},{value:`all`,label:`All statuses`}];function ns(e){let t=Date.parse(e);if(Number.isNaN(t))return`—`;let n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<60)return`${n}s`;let r=Math.round(n/60);if(r<60)return`${r}m`;let i=Math.round(r/60);return i<24?`${i}h`:`${Math.round(i/24)}d`}function rs({selectedId:e,onDispatchDisabled:t}){let[n,r]=(0,A.useState)(`pending`),[i,a]=(0,A.useState)(``),[o,s]=(0,A.useState)(``),[c,l]=(0,A.useState)(``),[d,f]=(0,A.useState)(new Set),[p,m]=(0,A.useState)(0),[g,v]=(0,A.useState)(null),[b,x]=(0,A.useState)(!1),[S,C]=(0,A.useState)(!1),[te,ne]=(0,A.useState)(!1),[w,re]=(0,A.useState)(null),ie=(0,A.useRef)(null),ae=(0,A.useRef)(new Map),oe=hn(),E=_(xe({status:n,since:i||void 0,limit:500})),se=(0,A.useMemo)(()=>{let e=E.data?.proposals??[],t=o.trim().toLowerCase(),n=c.trim().toLowerCase();return e.filter(e=>!(t&&!e.title.toLowerCase().includes(t)&&!(e.summary??``).toLowerCase().includes(t)||n&&!(e.repo??``).toLowerCase().includes(n)))},[E.data,o,c]);(0,A.useEffect)(()=>{m(e=>Math.min(e,Math.max(se.length-1,0)))},[se.length]);function ce(e,t){t===`pending`&&f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function le(e){if(se.length!==0){if(e.key===`ArrowDown`){e.preventDefault();let t=Math.min(p+1,se.length-1);m(t),ae.current.get(se[t].id)?.focus()}else if(e.key===`ArrowUp`){e.preventDefault();let t=Math.max(p-1,0);m(t),ae.current.get(se[t].id)?.focus()}else if(e.key===`Enter`){let e=se[p];e&&oe(`/inbox/${encodeURIComponent(e.id)}`)}else if(e.key===` `){let t=se[p];t&&(e.preventDefault(),ce(t.id,t.status))}else e.key===`/`&&(e.preventDefault(),ie.current?.focus())}}function ue(e){d.size!==0&&(re(null),v(e),h()?C(!0):x(!0))}function de(){x(!1),h()?C(!0):v(null)}async function fe(){if(!g)return;ne(!0),re(null);let e=Array.from(d),n=[];for(let r of e)try{g===`approve`?await De(r):await Ee(r)}catch(e){if(e instanceof u){ne(!1),C(!1),v(null),t();return}n.push(r)}ne(!1),n.length>0?(re(`${n.length} of ${e.length} failed (already decided, or a transient error). Selection kept for retry.`),f(new Set(n))):(C(!1),v(null),f(new Set))}let D=d.size;return(0,I.jsxs)(`div`,{className:X.list,children:[(0,I.jsxs)(`div`,{className:X.filters,children:[(0,I.jsxs)(`label`,{className:X.filterField,children:[(0,I.jsx)(`span`,{className:X.filterLabel,children:`Status`}),(0,I.jsx)(`select`,{value:n,onChange:e=>r(e.target.value),children:ts.map(e=>(0,I.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),(0,I.jsxs)(`label`,{className:X.filterField,children:[(0,I.jsx)(`span`,{className:X.filterLabel,children:`Since`}),(0,I.jsx)(`input`,{type:`date`,value:i,onChange:e=>a(e.target.value)})]}),(0,I.jsxs)(`label`,{className:X.filterField,children:[(0,I.jsx)(`span`,{className:X.filterLabel,children:`Repo`}),(0,I.jsx)(`input`,{type:`text`,placeholder:`filter by repo`,value:c,onChange:e=>l(e.target.value)})]}),(0,I.jsxs)(`label`,{className:X.filterField,children:[(0,I.jsx)(`span`,{className:X.filterLabel,children:`Search`}),(0,I.jsx)(`input`,{ref:ie,type:`search`,placeholder:`title or summary — press / to focus`,value:o,onChange:e=>s(e.target.value)})]})]}),(0,I.jsxs)(`div`,{className:X.summary,"aria-live":`polite`,children:[E.status===`refreshing`?(0,I.jsx)(O,{}):null,E.data?(0,I.jsxs)(`span`,{children:[se.length,` shown of `,E.data.total,` total`,E.data.truncated?` · narrow filters to see more`:``]}):null]}),D>0?(0,I.jsxs)(`div`,{className:X.batchBar,children:[(0,I.jsxs)(`span`,{children:[D,` selected`]}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>f(new Set),children:`Clear`}),(0,I.jsxs)(`button`,{type:`button`,className:X.batchReject,onClick:()=>ue(`reject`),children:[`Reject `,D]}),(0,I.jsxs)(`button`,{type:`button`,className:X.batchApprove,onClick:()=>ue(`approve`),children:[`Approve `,D]})]}):null,E.status===`loading`?(0,I.jsxs)(`div`,{className:X.skeletons,children:[(0,I.jsx)(y,{}),(0,I.jsx)(y,{}),(0,I.jsx)(y,{}),(0,I.jsx)(y,{})]}):E.status===`error`?(0,I.jsx)(`div`,{className:X.error,role:`alert`,children:E.error?.message??`Failed to load proposals.`}):se.length===0?(0,I.jsxs)(`p`,{className:X.empty,children:[`No `,n===`all`?``:n+` `,`proposals match`,o||c?` this filter`:``,`.`]}):(0,I.jsxs)(`table`,{className:X.table,role:`grid`,"aria-label":`Proposals`,onKeyDown:le,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,className:X.checkboxCol}),(0,I.jsx)(`th`,{scope:`col`,children:`Title`}),(0,I.jsx)(`th`,{scope:`col`,className:X.repoCol,children:`Repo`}),(0,I.jsx)(`th`,{scope:`col`,className:X.kindCol,children:`Kind`}),(0,I.jsx)(`th`,{scope:`col`,className:X.ageCol,children:`Age`}),(0,I.jsx)(`th`,{scope:`col`,className:X.statusCol,children:`Status`}),(0,I.jsx)(`th`,{scope:`col`,className:X.whyCol,children:`Why`})]})}),(0,I.jsx)(`tbody`,{children:se.map((t,n)=>(0,I.jsxs)(`tr`,{ref:e=>{e?ae.current.set(t.id,e):ae.current.delete(t.id)},"data-focus-key":`proposal-${t.id}`,tabIndex:n===p?0:-1,className:`${X.row} ${t.id===e?X.rowActive:``}`,onFocus:()=>m(n),"aria-selected":t.id===e,children:[(0,I.jsx)(`td`,{className:X.checkboxCol,children:(0,I.jsx)(`input`,{type:`checkbox`,checked:d.has(t.id),disabled:t.status!==`pending`,title:t.status===`pending`?void 0:`Only pending proposals can be approved/rejected`,onChange:()=>ce(t.id,t.status),onClick:e=>e.stopPropagation()})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(kr,{to:`/inbox/${encodeURIComponent(t.id)}`,className:X.titleLink,title:t.title,children:t.title})}),(0,I.jsx)(`td`,{className:X.repoCell,title:t.repo??void 0,children:t.repo?t.repo.split(`/`).pop():`—`}),(0,I.jsx)(`td`,{children:t.kind}),(0,I.jsx)(`td`,{className:X.age,children:ns(t.createdAt)}),(0,I.jsx)(`td`,{children:(0,I.jsx)(T,{status:t.status})}),(0,I.jsx)(`td`,{className:X.why,title:t.decisionReason??void 0,children:t.decisionReason??`—`})]},t.id))})]}),(0,I.jsx)(ee,{open:b,onClose:de,reason:`${g===`approve`?`Approving`:`Rejecting`} ${D} proposals requires the dispatch token.`}),(0,I.jsx)(Oe,{open:S,onClose:()=>{C(!1),v(null),re(null)},title:g===`approve`?`Approve ${D} proposals?`:`Reject ${D} proposals?`,body:g===`approve`?(0,I.jsxs)(I.Fragment,{children:[`This applies all `,D,` selected proposals to their repos now, one at a time. This cannot be undone from this dialog.`]}):(0,I.jsxs)(I.Fragment,{children:[`This rejects all `,D,` selected proposals. They stay visible in history as rejected.`]}),confirmLabel:g===`approve`?`Approve ${D}`:`Reject ${D}`,destructive:g===`reject`,busy:te,error:w,onConfirm:()=>void fe()})]})}var Z={panel:`_panel_1n6q8_1`,error:`_error_1n6q8_8`,header:`_header_1n6q8_16`,titleRow:`_titleRow_1n6q8_22`,title:`_title_1n6q8_22`,metaRow:`_metaRow_1n6q8_35`,metaItem:`_metaItem_1n6q8_44`,riskBadge:`_riskBadge_1n6q8_48`,risk_low:`_risk_low_1n6q8_54`,risk_medium:`_risk_medium_1n6q8_55`,risk_high:`_risk_high_1n6q8_56`,summary:`_summary_1n6q8_58`,evidence:`_evidence_1n6q8_64`,evidenceRow:`_evidenceRow_1n6q8_74`,evidenceLabel:`_evidenceLabel_1n6q8_81`,muted:`_muted_1n6q8_89`,rationaleNote:`_rationaleNote_1n6q8_94`,failedChecks:`_failedChecks_1n6q8_101`,diffSection:`_diffSection_1n6q8_107`,actions:`_actions_1n6q8_111`,actionConsequence:`_actionConsequence_1n6q8_124`,actionError:`_actionError_1n6q8_133`,rejectButton:`_rejectButton_1n6q8_144`,approveButton:`_approveButton_1n6q8_165`,decided:`_decided_1n6q8_176`},is={"judge-ship-would-merge":{label:`Ship (would merge)`,tone:`success`},"judge-ship-review-required":{label:`Ship (review required)`,tone:`success`},"judge-review":{label:`Review`,tone:`warning`},"judge-noise":{label:`Noise`,tone:`neutral`},"judge-harmful":{label:`Harmful`,tone:`danger`},"judge-verdict-unrecognized":{label:`Unrecognized verdict`,tone:`unknown`},"judge-parse-failure":{label:`Judge parse failure — not a review`,tone:`unknown`},"judge-network-failure":{label:`Judge network failure — not a review`,tone:`unknown`}};function as(e){let t=e.filter(e=>e.action===`judged`&&e.judgeReasonCode);return t.length===0?null:t.reduce((e,t)=>Date.parse(t.ts)>Date.parse(e.ts)?t:e)}function os(e){if(!e)return`—`;let t=Date.parse(e);if(Number.isNaN(t))return`—`;let n=Math.max(0,Math.round((Date.now()-t)/1e3));if(n<60)return`${n}s ago`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}function ss(e,t){let n=t&&t.length>0?t:`the target repository`;return e===`pr`?`Approving pushes a branch to ${n}'s remote and opens a real pull request. Other people can see it immediately, and it cannot be undone from here.`:e===`patch`?`Approving writes this diff to ${n} on disk now. Nothing is pushed, but the working tree changes.`:`Approving applies this ${e} proposal to ${n} now.`}function cs({id:e,onDispatchDisabled:t}){let n=_(fe(e)),[r,i]=(0,A.useState)(null),[a,o]=(0,A.useState)(!1),[s,c]=(0,A.useState)(!1),[d,f]=(0,A.useState)(!1),[p,m]=(0,A.useState)(null);function g(e){m(null),i(e),h()?c(!0):o(!0)}function v(){o(!1),h()?c(!0):i(null)}async function y(){if(r){f(!0),m(null);try{r===`approve`?await De(e):await Ee(e),c(!1),i(null)}catch(e){e instanceof u?(c(!1),i(null),t()):m(e instanceof Error?e.message:`Action failed. Try again.`)}finally{f(!1)}}}if(n.status===`loading`)return(0,I.jsxs)(`div`,{className:Z.panel,children:[(0,I.jsx)(l,{width:`60%`}),(0,I.jsx)(l,{width:`30%`}),(0,I.jsx)(l,{width:`90%`})]});if(n.status===`error`||!n.data)return(0,I.jsx)(`div`,{className:Z.error,role:`alert`,children:n.error?.message??`Failed to load this proposal.`});let b=n.data,x=b.decisionEvidence,S=as(x.decisions),C=S?.judgeReasonCode?is[S.judgeReasonCode]:null,te=b.status===`pending`;return(0,I.jsxs)(`div`,{className:Z.panel,children:[(0,I.jsxs)(`header`,{className:Z.header,children:[(0,I.jsxs)(`div`,{className:Z.titleRow,children:[(0,I.jsx)(`h2`,{className:Z.title,children:b.title}),n.status===`refreshing`?(0,I.jsx)(O,{}):null]}),(0,I.jsxs)(`div`,{className:Z.metaRow,children:[(0,I.jsx)(T,{status:b.status}),(0,I.jsx)(`span`,{className:Z.metaItem,children:b.kind}),(0,I.jsx)(`span`,{className:Z.metaItem,title:b.repo??void 0,children:b.repo??`no repo`}),(0,I.jsxs)(`span`,{className:Z.metaItem,children:[`created `,os(b.createdAt)]}),b.decidedAt?(0,I.jsxs)(`span`,{className:Z.metaItem,children:[`decided `,os(b.decidedAt)]}):null,b.riskClass?(0,I.jsxs)(`span`,{className:`${Z.riskBadge} ${Z[`risk_${b.riskClass}`]}`,children:[b.riskClass,` risk`]}):null]}),b.summary?(0,I.jsx)(`p`,{className:Z.summary,children:b.summary}):null]}),(0,I.jsxs)(`section`,{className:Z.evidence,"aria-label":`Evidence`,children:[(0,I.jsxs)(`div`,{className:Z.evidenceRow,children:[(0,I.jsx)(`span`,{className:Z.evidenceLabel,children:`Judge verdict`}),(0,I.jsx)(w,{quality:x.sourceQuality,label:`judge verdict`,children:C?(0,I.jsx)(T,{status:S.judgeReasonCode,tone:C.tone,children:C.label}):(0,I.jsx)(`span`,{className:Z.muted,children:`not yet judged`})})]}),S?.judgeRationaleState?(0,I.jsxs)(`p`,{className:Z.rationaleNote,children:[`Model rationale:`,` `,S.judgeRationaleState===`not-persisted`?`not persisted`:`legacy (redacted)`]}):null,b.decisionReason?(0,I.jsxs)(`div`,{className:Z.evidenceRow,children:[(0,I.jsx)(`span`,{className:Z.evidenceLabel,children:`Decision reason`}),(0,I.jsx)(`span`,{children:b.decisionReason})]}):null,b.verifyResult?(0,I.jsxs)(`div`,{className:Z.evidenceRow,children:[(0,I.jsx)(`span`,{className:Z.evidenceLabel,children:`Verification`}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(T,{status:b.verifyResult.passed?`success`:`failed`,children:b.verifyResult.passed?`passed`:`failed`}),b.verifyResult.ran&&b.verifyResult.ran.length>0?(0,I.jsxs)(`span`,{className:Z.muted,children:[` · ran `,b.verifyResult.ran.map(e=>e.kind).join(`, `)]}):null,b.verifyResult.failed&&b.verifyResult.failed.length>0?(0,I.jsxs)(`p`,{className:Z.failedChecks,children:[`Failed: `,b.verifyResult.failed.join(`, `)]}):null]})]}):null,b.evidenceOutcome?(0,I.jsxs)(`div`,{className:Z.evidenceRow,children:[(0,I.jsx)(`span`,{className:Z.evidenceLabel,children:`Gates`}),(0,I.jsxs)(`span`,{className:Z.muted,children:[b.evidenceOutcome.gateCount??0,` gate`,b.evidenceOutcome.gateCount===1?``:`s`,b.evidenceOutcome.policyAction?` · policy: ${b.evidenceOutcome.policyAction}`:``,b.evidenceOutcome.trustBasis?` · trust: ${b.evidenceOutcome.trustBasis}`:``]})]}):null,b.result?(0,I.jsxs)(`div`,{className:Z.evidenceRow,children:[(0,I.jsx)(`span`,{className:Z.evidenceLabel,children:`Result`}),(0,I.jsx)(`span`,{children:b.result})]}):null]}),(0,I.jsx)(`section`,{className:Z.diffSection,"aria-label":`Diff`,children:(0,I.jsx)(He,{diff:b.diff,proposalKind:b.kind})}),te?(0,I.jsxs)(`footer`,{className:Z.actions,children:[p&&!s?(0,I.jsx)(`p`,{className:Z.actionError,role:`alert`,children:p}):null,(0,I.jsx)(`p`,{className:Z.actionConsequence,children:ss(b.kind,b.repo)}),(0,I.jsx)(`button`,{type:`button`,className:Z.rejectButton,onClick:()=>g(`reject`),children:`Reject`}),(0,I.jsx)(`button`,{type:`button`,className:Z.approveButton,onClick:()=>g(`approve`),children:`Approve`})]}):(0,I.jsxs)(`footer`,{className:Z.decided,children:[`This proposal is already `,(0,I.jsx)(`strong`,{children:b.status}),` — no further action available.`]}),(0,I.jsx)(ee,{open:a,onClose:v,reason:r===`approve`?`Approving a proposal mutates the fleet and requires the dispatch token.`:`Rejecting a proposal requires the dispatch token.`}),(0,I.jsx)(Oe,{open:s,onClose:()=>{c(!1),i(null),m(null)},title:r===`approve`?`Approve this proposal?`:`Reject this proposal?`,body:r===`approve`?(0,I.jsxs)(I.Fragment,{children:[`This applies `,(0,I.jsx)(`strong`,{children:b.title}),` to `,(0,I.jsx)(`code`,{children:b.repo}),` now.`,` `,ss(b.kind,b.repo),` Review the diff above before confirming.`]}):(0,I.jsxs)(I.Fragment,{children:[`This rejects `,(0,I.jsx)(`strong`,{children:b.title}),` and discards it. It stays visible in history (status: rejected) but will never be applied. Nothing is written to `,(0,I.jsx)(`code`,{children:b.repo}),`.`]}),confirmLabel:r===`approve`?b.kind===`pr`?`Approve and open the pull request`:`Approve and apply`:`Reject`,destructive:r===`approve`,busy:d,error:p,onConfirm:()=>void y()})]})}var ls={view:`_view_19z5m_1`,header:`_header_19z5m_8`,title:`_title_19z5m_14`,subtitle:`_subtitle_19z5m_20`,dispatchBanner:`_dispatchBanner_19z5m_25`,layout:`_layout_19z5m_39`,listPane:`_listPane_19z5m_57`,detailPane:`_detailPane_19z5m_61`,emptyDetail:`_emptyDetail_19z5m_69`,hint:`_hint_19z5m_81`};function us(){let{id:e}=yn(),[t,n]=(0,A.useState)(!1);return(0,I.jsxs)(`div`,{className:ls.view,children:[(0,I.jsxs)(`header`,{className:ls.header,children:[(0,I.jsx)(`h1`,{className:ls.title,children:`Inbox`}),(0,I.jsx)(`p`,{className:ls.subtitle,children:`Review proposals, inspect diffs and judge evidence, approve or reject.`})]}),t?(0,I.jsxs)(`div`,{className:ls.dispatchBanner,role:`alert`,children:[`This server was started without `,(0,I.jsx)(`code`,{children:`--allow-dispatch`}),`, so approve/reject are read-only right now. Restart `,(0,I.jsx)(`code`,{children:`ashlr serve --allow-dispatch`}),` to enable them. Browsing and diff review still work.`]}):null,(0,I.jsxs)(`div`,{className:ls.layout,children:[(0,I.jsx)(`div`,{className:ls.listPane,children:(0,I.jsx)(rs,{selectedId:e??null,onDispatchDisabled:()=>n(!0)})}),(0,I.jsx)(`div`,{className:ls.detailPane,children:e?(0,I.jsx)(cs,{id:e,onDispatchDisabled:()=>n(!0)}):(0,I.jsxs)(`div`,{className:ls.emptyDetail,children:[(0,I.jsx)(`p`,{children:`Select a proposal to review its diff and evidence.`}),(0,I.jsx)(`p`,{className:ls.hint,children:`↑/↓ to move · Enter to open · Space to select · / to search`})]})})]})]})}var Q={cockpit:`_cockpit_1km3b_1`,decisionSpine:`_decisionSpine_1km3b_9`,mission:`_mission_1km3b_18`,titleLine:`_titleLine_1km3b_25`,revision:`_revision_1km3b_39`,northStar:`_northStar_1km3b_44`,bottleneck:`_bottleneck_1km3b_52`,nextActionLabel:`_nextActionLabel_1km3b_60`,fieldLabel:`_fieldLabel_1km3b_61`,nextAction:`_nextAction_1km3b_60`,exception:`_exception_1km3b_79`,attention:`_attention_1km3b_84`,clear:`_clear_1km3b_89`,spectrum:`_spectrum_1km3b_106`,bets:`_bets_1km3b_107`,sectionHeading:`_sectionHeading_1km3b_113`,capabilityList:`_capabilityList_1km3b_133`,betList:`_betList_1km3b_134`,capabilityLane:`_capabilityLane_1km3b_141`,bet:`_bet_1km3b_107`,laneIdentity:`_laneIdentity_1km3b_155`,laneName:`_laneName_1km3b_162`,headroomTrack:`_headroomTrack_1km3b_167`,headroomFill:`_headroomFill_1km3b_174`,ample:`_ample_1km3b_181`,usable:`_usable_1km3b_182`,tight:`_tight_1km3b_183`,none:`_none_1km3b_184`,unknown:`_unknown_1km3b_185`,allocation:`_allocation_1km3b_187`,reset:`_reset_1km3b_188`,betAllocation:`_betAllocation_1km3b_189`,assurance:`_assurance_1km3b_190`,betDecision:`_betDecision_1km3b_216`,betEvidence:`_betEvidence_1km3b_217`,betThesis:`_betThesis_1km3b_227`,empty:`_empty_1km3b_251`,omitted:`_omitted_1km3b_252`,authorityNote:`_authorityNote_1km3b_253`};function ds(e){return e===`complete`?`success`:e===`pending`?`running`:e===`incomplete`?`warning`:`unknown`}function fs(e){return e===`ready`?`success`:e===`tight`?`warning`:e===`unavailable`?`danger`:`unknown`}function ps(e){return e===`continue`?`running`:e===`observing`?`info`:`warning`}function ms(e){return e===`effective`?`success`:e===`refuted`?`danger`:e===`pending`?`running`:`unknown`}function hs({capability:e}){return(0,I.jsxs)(`li`,{className:Q.capabilityLane,children:[(0,I.jsxs)(`div`,{className:Q.laneIdentity,children:[(0,I.jsx)(`span`,{className:Q.laneName,children:e.label}),(0,I.jsx)(T,{status:e.state,tone:fs(e.state)})]}),(0,I.jsx)(`div`,{className:Q.headroomTrack,role:`img`,"aria-label":`${e.label} headroom: ${e.headroom}`,children:(0,I.jsx)(`span`,{className:`${Q.headroomFill} ${Q[e.headroom]}`})}),(0,I.jsx)(`span`,{className:Q.allocation,children:e.allocationLabel}),(0,I.jsx)(`span`,{className:Q.reset,"data-urgency":e.resetUrgency,children:e.resetLabel})]})}function gs({bet:e}){return(0,I.jsxs)(`li`,{className:Q.bet,children:[(0,I.jsxs)(`div`,{className:Q.betDecision,children:[(0,I.jsx)(T,{status:e.decision,tone:ps(e.decision)}),(0,I.jsx)(`span`,{className:Q.assurance,children:e.assurance})]}),(0,I.jsxs)(`div`,{className:Q.betThesis,children:[(0,I.jsx)(`h3`,{children:e.title}),(0,I.jsx)(`p`,{children:e.valueCase})]}),(0,I.jsx)(`span`,{className:Q.betAllocation,children:e.allocationLabel}),(0,I.jsxs)(`div`,{className:Q.betEvidence,children:[(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`span`,{className:Q.fieldLabel,children:`Outcome`}),(0,I.jsx)(T,{status:e.outcome.state,tone:ms(e.outcome.state),children:e.outcome.label})]}),(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`span`,{className:Q.fieldLabel,children:`Evidence`}),(0,I.jsx)(T,{status:e.evidence.state,tone:ds(e.evidence.state),children:e.evidence.label})]})]})]})}function _s({snapshot:e}){let t=e.activeValueBets.slice(0,3),n=Math.max(0,e.activeValueBets.length-t.length),r=e.nextAction;return(0,I.jsxs)(`section`,{className:Q.cockpit,"aria-labelledby":`agent-os-title`,children:[(0,I.jsxs)(`header`,{className:Q.decisionSpine,children:[(0,I.jsxs)(`div`,{className:Q.mission,children:[(0,I.jsxs)(`div`,{className:Q.titleLine,children:[(0,I.jsx)(`h2`,{id:`agent-os-title`,children:`Agent OS`}),(0,I.jsx)(T,{status:e.sourceState,tone:e.sourceState===`healthy`?`success`:e.sourceState===`degraded`?`warning`:`unknown`}),(0,I.jsx)(`span`,{className:Q.revision,children:e.livingEndState.revisionLabel})]}),(0,I.jsx)(`p`,{className:Q.northStar,children:e.livingEndState.northStar}),(0,I.jsxs)(`p`,{className:Q.bottleneck,children:[(0,I.jsx)(`span`,{children:`Current bottleneck`}),e.livingEndState.currentBottleneck]})]}),(0,I.jsxs)(`aside`,{className:`${Q.nextAction} ${r?Q[r.kind]:Q.clear}`,"aria-label":`Exception-first next action`,children:[(0,I.jsx)(`span`,{className:Q.nextActionLabel,children:`Next action`}),(0,I.jsx)(`strong`,{children:r?.title??`No verified next action available`}),(0,I.jsx)(`p`,{children:r?.reason??`No exception or clearance evidence was provided.`}),r?(0,I.jsxs)(T,{status:r.evidenceState,tone:ds(r.evidenceState),children:[r.evidenceState,` evidence`]}):null]})]}),(0,I.jsxs)(`section`,{className:Q.spectrum,"aria-labelledby":`capability-spectrum-title`,children:[(0,I.jsxs)(`div`,{className:Q.sectionHeading,children:[(0,I.jsx)(`h3`,{id:`capability-spectrum-title`,children:`Capability spectrum`}),(0,I.jsx)(`p`,{children:`Usable model runway, ordered by reset urgency`})]}),e.capabilitySpectrum.length>0?(0,I.jsx)(`ul`,{className:Q.capabilityList,children:e.capabilitySpectrum.map(e=>(0,I.jsx)(hs,{capability:e},e.lane))}):(0,I.jsx)(`p`,{className:Q.empty,children:`Capability evidence is not available.`})]}),(0,I.jsxs)(`section`,{className:Q.bets,"aria-labelledby":`active-value-bets-title`,children:[(0,I.jsxs)(`div`,{className:Q.sectionHeading,children:[(0,I.jsx)(`h3`,{id:`active-value-bets-title`,children:`Active value bets`}),(0,I.jsxs)(`p`,{children:[t.length,` of 3 portfolio slots visible`]})]}),t.length>0?(0,I.jsx)(`ol`,{className:Q.betList,children:t.map(e=>(0,I.jsx)(gs,{bet:e},e.key))}):(0,I.jsx)(`p`,{className:Q.empty,children:`No active value bet is verified.`}),n>0?(0,I.jsxs)(`p`,{className:Q.omitted,children:[n,` lower-ranked `,n===1?`bet is`:`bets are`,` held outside this view.`]}):null]}),(0,I.jsx)(`p`,{className:Q.authorityNote,children:`Observation only. This view cannot dispatch, merge, release, deploy, or change policy.`})]})}var $={view:`_view_k4f4y_1`,header:`_header_k4f4y_8`,eyebrow:`_eyebrow_k4f4y_15`,title:`_title_k4f4y_24`,subtitle:`_subtitle_k4f4y_31`,freshness:`_freshness_k4f4y_37`,loading:`_loading_k4f4y_44`,unavailable:`_unavailable_k4f4y_45`,unavailableHeading:`_unavailableHeading_k4f4y_75`,boundary:`_boundary_k4f4y_82`};function vs(e){return e.authority===`observation-only`&&e.sameUserTamperResistant===!1&&e.rollbackProtected===!1&&e.historicalAuthority===!1&&e.executionAuthority===!1&&e.proposalAuthority===!1&&e.mergeAuthority===!1&&e.deployAuthority===!1&&e.publicationAuthority===!1&&e.externalMutationAuthority===!1}function ys(e){return e.reason?e.reason:e.sourceState===`missing`?`No authenticated Agent OS snapshot has been recorded.`:e.authentication===`authenticated`?e.sameUserTamperResistant===!1?vs(e)?e.complete?e.snapshot?`The Agent OS snapshot is degraded.`:`No verified Agent OS snapshot is available.`:`The snapshot chain is incomplete.`:`The response crossed the observation-only authority boundary.`:`The response made an unsupported same-user tamper-resistance claim.`:`Snapshot authentication is unavailable or invalid.`}function bs(e){return e.sourceState===`healthy`&&e.complete&&e.authentication===`authenticated`&&vs(e)&&e.snapshot!==null?`success`:e.sourceState===`degraded`||e.authentication===`invalid`||!vs(e)?`warning`:`unknown`}function xs(){let e=(0,A.useRef)(null);Me(`/agent-os`,e);let t=_(be),n=t.data,r=n?.sourceState===`healthy`&&n.complete&&n.authentication===`authenticated`&&vs(n)&&n.snapshot!==null;return(0,I.jsxs)(`div`,{ref:e,className:$.view,children:[(0,I.jsxs)(`header`,{className:$.header,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:$.eyebrow,children:`Overview`}),(0,I.jsx)(`h1`,{className:$.title,children:`Agent-native engineering OS`}),(0,I.jsx)(`p`,{className:$.subtitle,children:`Authenticated fleet intelligence. Observation only.`})]}),(0,I.jsxs)(`div`,{className:$.freshness,"aria-live":`polite`,children:[t.status===`refreshing`?(0,I.jsx)(O,{}):null,n?(0,I.jsx)(T,{status:n.sourceState,tone:bs(n),children:n.sourceState}):null]})]}),t.status===`loading`?(0,I.jsxs)(`section`,{className:$.loading,"aria-label":`Loading Agent OS snapshot`,children:[(0,I.jsx)(l,{width:`65%`}),(0,I.jsx)(l,{width:`90%`}),(0,I.jsx)(l,{width:`75%`})]}):t.status===`error`?(0,I.jsxs)(`section`,{className:$.unavailable,role:`alert`,children:[(0,I.jsx)(`h2`,{children:`Agent OS snapshot unavailable`}),(0,I.jsx)(`p`,{children:t.error?.message??`The read-only Agent OS endpoint could not be reached.`}),(0,I.jsx)(`p`,{className:$.boundary,children:`No capability, value, or next-action values are inferred when the source cannot be read.`})]}):n&&r&&n.snapshot?(0,I.jsx)(_s,{snapshot:n.snapshot}):n?(0,I.jsxs)(`section`,{className:$.unavailable,role:`status`,children:[(0,I.jsxs)(`div`,{className:$.unavailableHeading,children:[(0,I.jsx)(`h2`,{children:n.sourceState===`missing`?`No Agent OS snapshot yet`:`Agent OS snapshot degraded`}),(0,I.jsx)(T,{status:n.authentication,tone:n.authentication===`authenticated`?`success`:`warning`})]}),(0,I.jsx)(`p`,{children:ys(n)}),(0,I.jsx)(`p`,{className:$.boundary,children:`The cockpit remains hidden until a complete authenticated observation-only snapshot is available.`})]}):(0,I.jsxs)(`section`,{className:$.unavailable,role:`status`,children:[(0,I.jsx)(`h2`,{children:`Agent OS snapshot unavailable`}),(0,I.jsx)(`p`,{children:`No response was provided by the read-only Agent OS endpoint.`})]})]})}function Ss(){return(0,I.jsx)(Wn,{children:(0,I.jsxs)(F,{element:(0,I.jsx)(Xi,{}),children:[(0,I.jsx)(F,{index:!0,element:(0,I.jsx)(Vn,{to:`/overview`,replace:!0})}),Vr.map(e=>e.implemented?null:(0,I.jsx)(F,{path:e.path,element:(0,I.jsx)(Qi,{title:e.label,description:e.description})},e.path)),(0,I.jsx)(F,{path:`/overview`,element:(0,I.jsx)(fa,{})}),(0,I.jsx)(F,{path:`/agent-os`,element:(0,I.jsx)(xs,{})}),(0,I.jsx)(F,{path:`/universe`,element:(0,I.jsx)(Ne,{})}),(0,I.jsx)(F,{path:`/journal`,element:(0,I.jsx)(Qa,{})}),(0,I.jsx)(F,{path:`/intelligence/pulse`,element:(0,I.jsx)(ro,{})}),(0,I.jsx)(F,{path:`/intelligence/genome`,element:(0,I.jsx)(fo,{})}),(0,I.jsx)(F,{path:`/intelligence/production`,element:(0,I.jsx)(ho,{})}),(0,I.jsx)(F,{path:`/portfolio`,element:(0,I.jsx)(yo,{})}),(0,I.jsx)(F,{path:`/work/runs`,element:(0,I.jsx)(wo,{})}),(0,I.jsx)(F,{path:`/work/runs/:id`,element:(0,I.jsx)(Do,{})}),(0,I.jsx)(F,{path:`/work/swarms`,element:(0,I.jsx)(No,{})}),(0,I.jsx)(F,{path:`/work/swarms/:id`,element:(0,I.jsx)(Wo,{})}),(0,I.jsx)(F,{path:`/control/daemon`,element:(0,I.jsx)(Jo,{})}),(0,I.jsx)(F,{path:`/control/fleet`,element:(0,I.jsx)(Xo,{})}),(0,I.jsx)(F,{path:`/control/security`,element:(0,I.jsx)($o,{})}),(0,I.jsx)(F,{path:`/goals`,element:(0,I.jsx)(es,{})}),(0,I.jsx)(F,{path:`/inbox`,element:(0,I.jsx)(us,{})}),(0,I.jsx)(F,{path:`/inbox/:id`,element:(0,I.jsx)(us,{})}),(0,I.jsx)(F,{path:`*`,element:(0,I.jsx)(Vn,{to:`/overview`,replace:!0})})]})})}function Cs(e){(0,A.useEffect)(()=>{if(e!==`checking`)return;let t=!1;return g(E.key,E.fetch).then(()=>{if(t)return;let e=m(E.key);a(e.status===`success`)}),()=>{t=!0}},[e])}function ws(){let e=d();return Cs(e),(0,I.jsx)(ke,{children:e===`checking`?(0,I.jsx)(`div`,{"aria-live":`polite`,className:`visually-hidden`,children:`Checking for an existing session…`}):e===`unauthenticated`?(0,I.jsx)(S,{}):(0,I.jsxs)(Or,{children:[(0,I.jsx)(v,{}),(0,I.jsx)(Ss,{})]})})}export{ws as App};
7
- //# sourceMappingURL=App-CimXmK0L.js.map
@@ -1,2 +0,0 @@
1
- import{a as e,n as t,s as n}from"./index-oAAq8XJa.js";import{D as r,P as i,a,at as o,ct as s,h as c,l,m as u,s as d,u as f}from"./global-Di2PUgj4.js";import{n as p,t as m}from"./MutationTokenDialog-SkRxqV_I.js";import{s as h,v as g}from"./workbench-types-DzN-5trg.js";import{s as _}from"./dock-store-BA1cHOYA.js";import{C as v}from"./verse-ui-store-zafyzXKD.js";import{r as y,x as b}from"./verse-queries-DvIJcn6Z.js";import{r as x}from"./section-visibility-qFqc_d4Z.js";import{_ as S,a as C,o as w,r as T,s as E,v as ee,y as te}from"./icons-B_yuAgdN.js";import{m as ne}from"./VerseConsoleApp-WVeyJnW7.js";import{a as D,i as re,n as O,o as k}from"./CapacityStrip-C667yQe8.js";import{a as ie,i as ae,r as A}from"./useSeatsRefresh-CG4jczeL.js";import{f as oe,t as j}from"./capacity-strip-model-Bj_9ztzs.js";import{t as M}from"./Button-DYv_KKxr.js";import{n as se,t as N}from"./use-token-gate-B3IJL6bf.js";import{o as ce}from"./slots-Ds9ZIqUL.js";import{t as P}from"./Switch-CcR5Llk5.js";import{t as le}from"./BudgetControl-DOTlMSmW.js";import{t as F}from"./Select-FWLnAw_j.js";import{t as I}from"./Input-B9-VLcHS.js";import{t as ue}from"./Sheet-DZKcQXQg.js";import{a as de,c as L,d as R,f as fe,i as pe,l as z,m as B,n as V,o as me,p as he,r as H,s as U,t as ge,u as _e}from"./apps-model-CDFvmsQV.js";var W=n(e(),1),G=t();function ve({tone:e,label:t}){return(0,G.jsxs)(`span`,{className:k.health,"data-tone":e,children:[(0,G.jsx)(`span`,{className:k.healthDot,"aria-hidden":`true`}),t]})}function K({id:e,name:t,monogram:n,engine:r,description:i,version:a,health:o,detail:s,aside:c,children:l}){return(0,G.jsxs)(`li`,{className:k.row,"data-app":e,children:[(0,G.jsx)(D,{monogram:n,engine:r}),(0,G.jsxs)(`div`,{className:k.rowMain,children:[(0,G.jsxs)(`div`,{className:k.rowHead,children:[(0,G.jsx)(`span`,{id:`${e}-name`,className:k.rowName,children:t}),a?(0,G.jsx)(`span`,{className:k.rowVersion,children:a}):null,(0,G.jsx)(ve,{tone:o.tone,label:o.label})]}),(0,G.jsx)(`p`,{className:k.rowDesc,children:i}),s?(0,G.jsx)(`p`,{className:k.rowDetail,children:s}):null,l]}),c?(0,G.jsx)(`div`,{className:k.rowAside,children:c}):null]})}function q({id:e,title:t,caveat:n,action:r,children:i,headingRef:a}){let o=`apps-group-${e}`;return(0,G.jsxs)(`section`,{className:k.group,"aria-labelledby":o,"data-group":e,children:[(0,G.jsxs)(`div`,{className:k.groupHead,children:[(0,G.jsx)(`h3`,{id:o,ref:a,tabIndex:-1,className:k.groupTitle,children:t}),r]}),n?(0,G.jsx)(`p`,{className:k.caveat,children:n}):null,(0,G.jsx)(`div`,{className:k.card,children:i})]})}var ye=1200;async function be(e){try{if(typeof navigator<`u`&&navigator.clipboard&&typeof navigator.clipboard.writeText==`function`)return await navigator.clipboard.writeText(e),!0}catch{}if(typeof document>`u`)return!1;let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=!1;try{n=typeof document.execCommand==`function`&&document.execCommand(`copy`)}catch{n=!1}return t.remove(),n}function J({text:e,label:t,what:n}){let[r,i]=(0,W.useState)(`idle`),a=(0,W.useRef)(null);(0,W.useEffect)(()=>()=>{a.current&&clearTimeout(a.current)},[]);let o=async()=>{let t=await be(e);i(t?`copied`:`failed`),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>i(`idle`),ye)};return(0,G.jsxs)(`span`,{className:k.pillWrap,children:[(0,G.jsxs)(`button`,{type:`button`,className:k.pill,"data-state":r,onClick:()=>void o(),"aria-label":`Copy ${n}: ${e}`,title:`Copy: ${e}`,children:[(0,G.jsx)(`code`,{className:k.pillText,children:t??e}),(0,G.jsx)(`span`,{className:k.pillIcon,"aria-hidden":`true`,children:r===`copied`?(0,G.jsx)(T,{size:14}):(0,G.jsx)(E,{size:14})})]}),(0,G.jsx)(`span`,{className:k.visuallyHidden,role:`status`,"aria-live":`polite`,children:r===`copied`?`Copied`:r===`failed`?`Copy failed — select the command and copy it yourself`:``})]})}var Y=oe;function xe(e){return e.slotLanded??ce(`terminal-pane`)?e.terminalAvailable===!0?e.activeSessionId===null?{available:!1,reason:`Open a chat first — its terminal hosts the agent.`}:{available:!0,reason:null}:{available:!1,reason:e.terminalReason??`The Verse terminal needs the desktop app.`}:{available:!1,reason:`This build has no Verse terminal yet.`}}function Se(e,t){t.via===`native`&&t.model===null?_({newTab:!0,appId:e}):_({newTab:!0,appId:e,via:`ollama`,...t.model===null?{}:{model:t.model}}),v(`chat`)}var Ce=`No accounts connected yet. Sign in to Claude Code, Codex or Grok in a terminal, or start Ollama for local models — they show up here within a minute.`;function we({seats:e,health:t,budget:n,loading:r,reconnecting:i,onReconnect:a,now:o}){let[s,c]=(0,W.useState)(null),[l,u]=(0,W.useState)(!1),[d,f]=(0,W.useState)(null),[h,g]=(0,W.useState)(null),_=se(),v=(0,W.useId)(),y=(0,W.useId)(),b=(0,W.useRef)(null),x=t!==null,S=async e=>{f(e.seatId),g(null);try{await _.run(`Check ${e.label} again (status commands only — nothing is spent)`,()=>ie())&&g({tone:`neutral`,text:`Checked ${e.label} again.`})}catch(e){g({tone:`danger`,text:N(e)})}finally{f(null)}};return(0,G.jsxs)(q,{id:`accounts`,title:`Accounts`,caveat:`Which accounts you can use now, which are spent and when they reset, and how much autonomy leaves for you.`,children:[r?(0,G.jsx)(`p`,{className:k.loadingLine,"aria-busy":`true`,children:`Reading accounts…`}):(0,G.jsx)(O,{seats:e,health:t,budget:n,labelledBy:`apps-group-accounts`,emptyText:Ce,accounts:{healthRead:x,checkingSeatId:d,...o===void 0?{}:{now:o}},renderActions:e=>ge(e,j(e,{healthRead:x,...o===void 0?{}:{now:o}})).map(t=>(0,G.jsx)(M,{size:`sm`,variant:t.primary&&t.kind!==`edit-budget`?`primary`:`ghost`,busy:t.kind===`reconnect`&&i===e.seatId||t.kind===`check-again`&&d===e.seatId,"aria-label":`${t.label}: ${e.label}`,onClick:()=>{t.kind===`reconnect`?a(e):t.kind===`check-again`?S(e):t.kind===`fix`?c(e):u(!0)},children:t.label},t.kind))}),(0,G.jsx)(`p`,{className:h?k.accountsNote:k.visuallyHidden,"data-tone":h?.tone,role:`status`,"aria-live":`polite`,children:h?.text??``}),s!==null&&s.connection?.fixCommand?(0,G.jsx)(p,{open:!0,onClose:()=>c(null),titleId:v,title:`Fix ${s.label}`,description:s.connection.word,initialFocusRef:b,children:(0,G.jsxs)(`div`,{className:k.dialogBody,children:[s.connection.reasons.map(e=>(0,G.jsx)(`p`,{children:e},e)),(0,G.jsxs)(`div`,{className:k.commandBlock,children:[(0,G.jsx)(`span`,{className:k.commandLabel,children:`Run this in a terminal`}),(0,G.jsx)(J,{text:Y(s.connection.fixCommand),what:`the fix for ${s.label}`})]}),(0,G.jsx)(`p`,{children:`Verse shows the command and never runs it for you: it changes which CLI this seat is pinned to.`}),(0,G.jsx)(`div`,{className:k.dialogActions,children:(0,G.jsx)(M,{ref:b,variant:`subtle`,onClick:()=>c(null),children:`Done`})})]})}):null,(0,G.jsx)(ue,{open:l,onClose:()=>u(!1),titleId:y,title:`Budget`,description:`How much of each seat autonomy may use, and how much is kept for you.`,width:560,children:l?(0,G.jsx)(le,{}):null}),(0,G.jsx)(m,{open:_.dialog.open,reason:_.dialog.reason,tokenLabel:`Mutation token`,tokenHelp:`the mutation token ashlr verse printed`,onClose:_.dialog.onClose,onUnlocked:_.dialog.onUnlocked})]})}var X=`verse-apps`,Te=`verse-terminal-status`;async function Ee(e,t){try{return{available:!0,data:await l(e,t)}}catch(e){if(e instanceof d&&e.status===401||e instanceof DOMException&&e.name===`AbortError`)throw e;return e instanceof d&&e.status===404?{available:!1,reason:`This server is older than Apps & Accounts, so desktop, terminal and local rows are not available.`}:{available:!1,reason:e instanceof d?`The apps check answered HTTP ${e.status}.`:`The apps check could not be reached.`}}}var Z={key:X,fetch:e=>Ee(h,e)},De={key:Te,fetch:e=>Ee(g,e)};async function Q(e,t){let n=r();if(!n)throw new y;let a=await f(e,t,n);return i(),a}async function Oe(){let e=await Q(`${h}/refresh`,{});return await s(X,A(()=>Promise.resolve({available:!0,data:e}),()=>Z.fetch()),!0),e}async function ke(e,t){let n=await Q(`${h}/${encodeURIComponent(e)}/toggle`,{enabled:t,confirm:!0});return s(X,()=>Z.fetch(),!0),n}function Ae(e,t){return Q(`${h}/${encodeURIComponent(e)}/launch`,{root:t.root,...t.via?{via:t.via}:{},...t.model?{model:t.model}:{}})}function je({row:e,enable:t,busy:n,error:r,onCancel:i,onConfirm:a}){let o=(0,W.useId)(),s=(0,W.useRef)(null);if(e===null||e.toggle===null)return null;let c=t?e.toggle.command:e.toggle.restoreCommand,l=t?e.toggle.restoreCommand:e.toggle.command,u=t?`Turn on “${e.description}”?`:`Restore ${e.name}?`;return(0,G.jsx)(p,{open:!0,onClose:i,titleId:o,title:u,initialFocusRef:s,description:t?`This changes ${e.name}’s own settings until you restore it.`:`This puts ${e.name} back on its own defaults.`,children:(0,G.jsxs)(`div`,{className:k.dialogBody,children:[e.detail?(0,G.jsx)(`p`,{children:e.detail}):null,t&&e.id===`claude-desktop`?(0,G.jsx)(`p`,{children:`Recommended: leave this off. Claude Desktop would run local models instead of its own, and Verse’s local seats already use Ollama.`}):null,(0,G.jsxs)(`div`,{className:k.commandBlock,children:[(0,G.jsx)(`span`,{className:k.commandLabel,children:`Runs`}),(0,G.jsx)(J,{text:Y(c),what:`the command this runs`})]}),(0,G.jsxs)(`div`,{className:k.commandBlock,children:[(0,G.jsx)(`span`,{className:k.commandLabel,children:t?`Undo later with`:`Turn back on with`}),(0,G.jsx)(J,{text:Y(l),what:t?`the restore command`:`the command that turns it on`})]}),(0,G.jsx)(`p`,{children:`It opens in a Terminal window so you can answer its prompts. Verse does not answer them for you, and nothing changes until you do.`}),r?(0,G.jsx)(`p`,{className:k.error,role:`alert`,children:r}):null,(0,G.jsxs)(`div`,{className:k.dialogActions,children:[(0,G.jsx)(M,{ref:s,variant:`subtle`,onClick:i,children:`Cancel`}),(0,G.jsx)(M,{variant:t?`danger`:`primary`,busy:n,onClick:a,children:t?`Open in Terminal`:`Restore in Terminal`})]})]})})}function Me({row:e,projects:t,models:n,inVerse:r,busy:i,error:a,onCancel:o,onLaunch:s}){let c=(0,W.useId)(),l=(0,W.useRef)(null),[u,d]=(0,W.useState)(`native`),[f,m]=(0,W.useState)(``),[h,g]=(0,W.useState)(t[0]?.path??``);(0,W.useEffect)(()=>{d(`native`),m(``),g(t[0]?.path??``)},[e?.id]);let _={via:u,model:u===`ollama`&&f!==``?f:null},v=(0,W.useMemo)(()=>e?H(e,_):null,[e,_.via,_.model]);if(e===null)return null;let y=H(e,{via:`native`,model:null}),b=e.ollamaLaunch,x=`${c}-via`,S=h!==``;return(0,G.jsx)(p,{open:!0,onClose:o,titleId:c,title:`Launch ${e.name}`,description:`Nothing starts until you choose where.`,initialFocusRef:l,children:(0,G.jsxs)(`div`,{className:k.dialogBody,children:[(0,G.jsxs)(`fieldset`,{className:k.fieldset,children:[(0,G.jsx)(`legend`,{className:k.legend,children:`Run`}),y?(0,G.jsxs)(`label`,{className:k.radio,children:[(0,G.jsx)(`input`,{ref:l,type:`radio`,name:x,checked:u===`native`,onChange:()=>d(`native`)}),(0,G.jsx)(`code`,{className:k.inlineCode,children:Y(y)}),(0,G.jsx)(`span`,{className:k.hint,children:`its own command`})]}):null,b?(0,G.jsxs)(`label`,{className:k.radio,children:[(0,G.jsx)(`input`,{type:`radio`,name:x,checked:u===`ollama`,onChange:()=>d(`ollama`)}),(0,G.jsx)(`code`,{className:k.inlineCode,children:Y(b)}),(0,G.jsx)(`span`,{className:k.hint,children:`through Ollama`})]}):null]}),u===`ollama`?n.length>0?(0,G.jsxs)(F,{label:`Local model`,value:f,onChange:e=>m(e.target.value),children:[(0,G.jsx)(`option`,{value:``,children:`Ollama’s default`}),n.map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))]}):(0,G.jsx)(`p`,{className:k.hint,children:`No local models are known to Verse, so Ollama will ask which to use.`}):null,(0,G.jsxs)(F,{label:`Folder (Terminal.app)`,value:h,onChange:e=>g(e.target.value),hint:t.length===0?`No chat folders or enrolled projects yet.`:`A Verse tab opens in the chat you have open.`,disabled:t.length===0,children:[t.length===0?(0,G.jsx)(`option`,{value:``,children:`—`}):null,t.map(e=>(0,G.jsx)(`option`,{value:e.path,children:e.name},e.path))]}),v?(0,G.jsxs)(`div`,{className:k.commandBlock,children:[(0,G.jsx)(`span`,{className:k.commandLabel,children:`Command`}),(0,G.jsx)(J,{text:Y(v),what:`the ${e.name} launch command`})]}):null,u===`ollama`&&r.available?(0,G.jsx)(`p`,{className:k.hint,children:`In a Verse tab this runs exactly the command above — Verse builds it from what is installed, never from this page.`}):null,!r.available&&r.reason?(0,G.jsxs)(`p`,{className:k.hint,children:[`Verse terminal: `,r.reason]}):null,a?(0,G.jsx)(`p`,{className:k.error,role:`alert`,children:a}):null,(0,G.jsxs)(`div`,{className:k.dialogActions,children:[(0,G.jsx)(M,{variant:`ghost`,onClick:o,children:`Cancel`}),(0,G.jsx)(M,{variant:r.available?`subtle`:`primary`,busy:i,disabled:!S||v===null,onClick:()=>v&&s({choice:_,target:`terminal-app`,root:h,command:v}),children:`Open in Terminal.app`}),r.available?(0,G.jsx)(M,{variant:`primary`,disabled:v===null,onClick:()=>v&&s({choice:_,target:`verse`,root:null,command:v}),children:`Open in Verse terminal`}):null]})]})})}var $={section:`_section_mum7s_11`,body:`_body_mum7s_19`,panel:`_panel_mum7s_29`,panelHead:`_panelHead_mum7s_35`,panelTitle:`_panelTitle_mum7s_43`,panelNote:`_panelNote_mum7s_51`,muted:`_muted_mum7s_52`,alert:`_alert_mum7s_61`,alertTitle:`_alertTitle_mum7s_72`,seatList:`_seatList_mum7s_78`,rowList:`_rowList_mum7s_79`,seatRow:`_seatRow_mum7s_85`,healthRow:`_healthRow_mum7s_86`,seatHead:`_seatHead_mum7s_94`,seatLabel:`_seatLabel_mum7s_101`,engineTag:`_engineTag_mum7s_106`,code:`_code_mum7s_107`,count:`_count_mum7s_118`,disclosure:`_disclosure_mum7s_124`,commandLine:`_commandLine_mum7s_134`,envList:`_envList_mum7s_143`,envItem:`_envItem_mum7s_152`,warnList:`_warnList_mum7s_161`,digest:`_digest_mum7s_171`,actions:`_actions_mum7s_178`};function Ne({server:e,heading:t}){let n=e.env===null?[]:Object.keys(e.env);return(0,G.jsxs)(`div`,{className:$.disclosure,children:[t===void 0?null:(0,G.jsx)(`p`,{className:$.alertTitle,children:t}),(0,G.jsxs)(`p`,{className:$.commandLine,children:[e.command,e.args.length>0?` ${e.args.join(` `)}`:``]}),n.length===0?(0,G.jsx)(`p`,{className:$.muted,children:`No environment variables are passed to this server.`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`p`,{className:$.muted,children:[n.length,` environment variable`,n.length===1?``:`s`,` passed to this server. Values are never displayed.`]}),(0,G.jsx)(`ul`,{className:$.envList,children:n.map(e=>(0,G.jsxs)(`li`,{className:$.envItem,children:[e,`=<set>`]},e))})]}),(0,G.jsxs)(`p`,{className:$.code,children:[`configured in `,e.sourceRef]})]})}var Pe=`verse-mcp-snapshot`,Fe=`verse-mcp-cli-health`;function Ie(e,t){return t instanceof d?t.status===404?`This server does not expose ${e}, so this panel has no source.`:`${e} answered HTTP ${t.status}.`:`${e} could not be reached.`}function Le(e){return async t=>{try{return{raw:await l(e,t),available:!0,reason:null}}catch(t){if(t instanceof d&&t.status===401||t instanceof DOMException&&t.name===`AbortError`)throw t;return{raw:null,available:!1,reason:Ie(e,t)}}}}var Re={key:Pe,fetch:Le(`/api/verse/mcp`)},ze={key:Fe,fetch:Le(`/api/verse/mcp/cli-health`)},Be=class extends Error{constructor(){super(`Unlock actions with the mutation token before changing MCP configuration.`),this.name=`McpLockedError`}};async function Ve(e,t){let n=r();if(!n)throw new Be;let a=await f(e,t,n);return i(),a}function He(e,t){return Ve(`/api/verse/mcp/proposal`,{target:e,server:t})}async function Ue(e,t,n){let r=await Ve(`/api/verse/mcp/apply`,{target:e,server:t,digest:n,confirm:!0});return o(Pe),r}function We({row:e}){let[t,n]=(0,W.useState)(!1),r=(0,W.useId)(),i=e.servers.length>0;return(0,G.jsxs)(K,{id:`mcp-${e.seatId}`,name:e.label,monogram:e.monogram,engine:e.engine,description:e.sentence,health:{tone:i?`success`:`off`,label:e.loads},aside:i?(0,G.jsx)(M,{variant:`ghost`,size:`sm`,"aria-expanded":t,"aria-controls":r,icon:t?(0,G.jsx)(C,{size:14}):(0,G.jsx)(w,{size:14}),onClick:()=>n(e=>!e),children:t?`Hide servers`:`Show servers`}):null,children:[(0,G.jsx)(`span`,{className:k.reasonCode,children:e.reason}),i&&t?(0,G.jsx)(`div`,{id:r,className:k.servers,children:e.servers.map(e=>(0,G.jsx)(Ne,{server:e,heading:e.name},e.name))}):null]})}function Ge(e){if(typeof e!=`object`||!e)return null;let t=e,n=R(t.server),r=t.target;return!n||typeof t.digest!=`string`||!r?null:{server:n,targetRef:typeof r.ref==`string`?r.ref:``,targetLabel:typeof r.label==`string`?r.label:``,action:t.action===`replace`?`replace`:`add`,replaces:R(t.replaces),warnings:Array.isArray(t.warnings)?t.warnings.filter(e=>typeof e==`string`):[],note:typeof t.note==`string`?t.note:``,digest:t.digest}}function Ke(e){return e instanceof d?e.detail??`The server refused (HTTP ${e.status}).`:e instanceof Error&&e.name===`VerseMutationLockedError`?`Unlock actions with the mutation token first.`:`The request could not be completed.`}function qe({open:e,snapshot:t,run:n,onClose:r,onAdded:i}){let a=(0,W.useId)(),o=U(t),[s,c]=(0,W.useState)(`hub`),[l,u]=(0,W.useState)(``),[d,f]=(0,W.useState)(``),[p,m]=(0,W.useState)(``),[h,g]=(0,W.useState)(``),[_,v]=(0,W.useState)(null),[y,b]=(0,W.useState)(!1),[x,S]=(0,W.useState)(null),C=()=>{S(null),v(null),b(!1)},w=async e=>{e.preventDefault(),v(null);let t=L(h);if(!t.ok){v(t.error);return}let r={name:l.trim(),command:d.trim(),args:z(p),...Object.keys(t.env).length>0?{env:t.env}:{}};b(!0);try{let e=await n(`Review an MCP server before adding it`,()=>He(s,r));if(e===null)return;let t=Ge(e);t?S({input:r,target:s,value:t}):v(`The server answered with something that is not a proposal.`)}catch(e){v(Ke(e))}finally{b(!1)}},T=async()=>{if(x){b(!0),v(null);try{if(await n(`Add an MCP server`,()=>Ue(x.target,x.input,x.value.digest))===null)return;i(`${x.value.action===`replace`?`Replaced`:`Added`} ${x.value.server.name} in ${x.value.targetRef}.`),u(``),f(``),m(``),g(``),C(),r()}catch(e){v(Ke(e))}finally{b(!1)}}},E=o.find(e=>e.id===s);return(0,G.jsx)(ue,{open:e,onClose:()=>{C(),r()},titleId:a,title:x?`Review before adding`:`Add an MCP server`,description:`An MCP server is a program that runs with the agent’s permissions. Nothing is written until you confirm what you read.`,width:520,children:x===null?(0,G.jsxs)(`form`,{className:k.dialogBody,onSubmit:e=>void w(e),children:[(0,G.jsx)(F,{label:`Add to`,value:s,onChange:e=>c(e.target.value),hint:E?.disabledReason??(s===`hub`?`The hub’s own registry.`:`A Verse chat on a Claude seat still loads none; Claude Code in a terminal does.`),children:o.map(e=>(0,G.jsx)(`option`,{value:e.id,disabled:e.disabledReason!==null,children:e.label},e.id))}),(0,G.jsx)(I,{label:`Name`,value:l,onChange:e=>u(e.target.value),required:!0,placeholder:`filesystem`,autoComplete:`off`}),(0,G.jsx)(I,{label:`Command`,value:d,onChange:e=>f(e.target.value),required:!0,placeholder:`/opt/homebrew/bin/npx`,autoComplete:`off`,hint:`An absolute path is safest; a bare name is looked up on PATH when the server starts.`}),(0,G.jsx)(I,{label:`Arguments`,value:p,onChange:e=>m(e.target.value),placeholder:`-y @modelcontextprotocol/server-filesystem "~/code"`,autoComplete:`off`}),(0,G.jsxs)(`label`,{className:k.fieldLabel,children:[`Environment `,(0,G.jsx)(`span`,{className:k.hint,children:`One KEY=value per line. Values are sent once and never shown again.`}),(0,G.jsx)(`textarea`,{className:k.textarea,value:h,onChange:e=>g(e.target.value),spellCheck:!1,autoComplete:`off`})]}),_?(0,G.jsx)(`p`,{className:k.error,role:`alert`,children:_}):null,(0,G.jsxs)(`div`,{className:k.dialogActions,children:[(0,G.jsx)(M,{type:`button`,variant:`ghost`,onClick:r,children:`Cancel`}),(0,G.jsx)(M,{type:`submit`,variant:`primary`,busy:y,disabled:l.trim()===``||d.trim()===``||E?.disabledReason!=null,children:`Review`})]})]}):(0,G.jsxs)(`div`,{className:k.dialogBody,children:[(0,G.jsxs)(`p`,{children:[x.value.action===`replace`?`Replaces`:`Adds`,` `,(0,G.jsx)(`strong`,{children:x.value.server.name}),` in`,` `,(0,G.jsx)(`code`,{className:k.inlineCode,children:x.value.targetRef}),x.value.targetLabel?` (${x.value.targetLabel})`:``,`.`]}),(0,G.jsx)(Ne,{server:x.value.server,heading:`This will run`}),x.value.replaces?(0,G.jsx)(Ne,{server:x.value.replaces,heading:`Replacing`}):null,x.value.warnings.length>0?(0,G.jsx)(`ul`,{className:k.warnings,children:x.value.warnings.map(e=>(0,G.jsx)(`li`,{children:e},e))}):null,x.value.note?(0,G.jsx)(`p`,{className:k.hint,children:x.value.note}):null,_?(0,G.jsx)(`p`,{className:k.error,role:`alert`,children:_}):null,(0,G.jsxs)(`div`,{className:k.dialogActions,children:[(0,G.jsx)(M,{variant:`ghost`,onClick:()=>S(null),children:`Back`}),(0,G.jsx)(M,{variant:`primary`,busy:y,onClick:()=>void T(),children:x.value.action===`replace`?`Replace server`:`Add server`})]})]})})}function Je({snapshot:e,cliHealth:t,unavailable:n,loading:r,run:i,onAdded:a,headingRef:o}){let[s,c]=(0,W.useState)(!1),l=e?me(e):[];return(0,G.jsxs)(q,{id:`mcp-servers`,title:`MCP servers`,headingRef:o,action:(0,G.jsx)(M,{variant:`subtle`,size:`sm`,icon:(0,G.jsx)(ee,{size:14}),onClick:()=>c(!0),"aria-haspopup":`dialog`,children:`Add server`}),caveat:(0,G.jsxs)(G.Fragment,{children:[`Claude and local seats load no MCP servers: Verse starts them with`,` `,(0,G.jsx)(`code`,{children:`--strict-mcp-config`}),` and an empty `,(0,G.jsx)(`code`,{children:`--mcp-config`}),`. Codex and Grok seats load their own account’s config — and an `,(0,G.jsx)(`code`,{children:`ashlr__`}),` write through one is refused on a folder that is not enrolled.`]}),children:[e!==null&&e.notes.length>0?(0,G.jsxs)(`div`,{className:k.loadingLine,role:`note`,children:[(0,G.jsx)(`strong`,{children:`Configured, but unused.`}),` `,e.notes.join(` `),` `,e.machine.note]}):null,t!==null&&t.driftDetected?(0,G.jsxs)(`div`,{className:k.loadingLine,role:`alert`,children:[(0,G.jsx)(`strong`,{children:`CLI version drift.`}),` `,t.notes.join(` `),` `,t.accounts.filter(e=>e.versionState===`drift`).map(e=>`${e.label}: ${e.version??`unread`}, pinned ${e.pinnedVersion??`—`}.`).join(` `)]}):null,e===null?(0,G.jsx)(`p`,{className:k.loadingLine,"aria-busy":r||void 0,children:r?`Reading each seat’s configuration…`:n??`No per-seat reading is available.`}):(0,G.jsx)(`ul`,{className:k.rows,children:l.map(e=>(0,G.jsx)(We,{row:e},e.seatId))}),e?.scope?(0,G.jsxs)(`p`,{className:k.scopeLine,children:[`Scope: `,B(_e,e.scope.reason,`Locus did not report a usable scope.`),e.scope.tenantRef?` (${e.scope.tenantRef})`:``]}):null,(0,G.jsx)(qe,{open:s,snapshot:e,run:i,onClose:()=>c(!1),onAdded:a})]})}function Ye(e){return{tone:V(e.health.state),label:e.health.label}}function Xe({group:e,onToggle:t,onRestore:n}){return(0,G.jsx)(q,{id:e.id,title:e.title,caveat:e.caveat,children:(0,G.jsx)(`ul`,{className:k.rows,children:e.apps.map(e=>{let r=e.actions.find(e=>e.kind===`restore`)??null;return(0,G.jsx)(K,{id:`app-${e.id}`,name:e.name,monogram:e.monogram,engine:e.engine,description:e.description,health:Ye(e),detail:e.toggle===null?e.detail:null,aside:e.toggle===null?null:(0,G.jsxs)(G.Fragment,{children:[r?(0,G.jsx)(M,{variant:`ghost`,size:`sm`,onClick:()=>n(e),disabled:r.disabledReason!==null,title:Y(r.command??[]),children:r.label}):null,(0,G.jsx)(P,{checked:e.toggle.enabled,onChange:n=>t(e,n),"aria-label":`${e.description}: ${e.toggle.enabled?`on`:`off`}`,"aria-describedby":`app-${e.id}-name`})]})},e.id)})})})}function Ze({group:e,quickLaunchReason:t,onQuickLaunch:n,onLaunchOptions:r}){return(0,G.jsx)(q,{id:e.id,title:e.title,caveat:e.caveat,children:(0,G.jsx)(`ul`,{className:k.rows,children:e.apps.map(e=>{let i=e.actions.find(e=>e.kind===`launch`)??null,a=i?.disabledReason??t;return(0,G.jsx)(K,{id:`app-${e.id}`,name:e.name,monogram:e.monogram,engine:e.engine,description:e.description,version:e.version,health:Ye(e),detail:e.detail,aside:(0,G.jsxs)(G.Fragment,{children:[e.copy&&e.installed?(0,G.jsx)(J,{text:e.copy.text,label:e.copy.label,what:`the ${e.name} command`}):null,e.ollamaLaunch?(0,G.jsx)(J,{text:Y(e.ollamaLaunch),what:`the Ollama launch command for ${e.name}`}):null,i?i.disabledReason===null?(0,G.jsxs)(`span`,{className:k.split,children:[(0,G.jsx)(M,{variant:`subtle`,size:`sm`,icon:(0,G.jsx)(S,{size:14}),disabled:a!==null,title:a??void 0,onClick:()=>n(e),"aria-label":`Launch ${e.name}`,children:`Launch`}),(0,G.jsx)(M,{variant:`subtle`,size:`sm`,iconOnly:!0,icon:(0,G.jsx)(C,{size:14}),"aria-label":`Launch options for ${e.name}`,title:`Launch options for ${e.name}`,"aria-haspopup":`dialog`,onClick:()=>r(e)})]}):(0,G.jsx)(`span`,{className:k.disabledNote,children:i.disabledReason}):null]})},e.id)})})})}function Qe({group:e}){return(0,G.jsx)(q,{id:e.id,title:e.title,caveat:e.caveat,children:(0,G.jsx)(`ul`,{className:k.rows,children:e.apps.map(e=>(0,G.jsx)(K,{id:`app-${e.id}`,name:e.name,monogram:e.monogram,engine:e.engine,description:e.description,version:e.version,health:Ye(e),detail:e.detail},e.id))})})}var $e=6e4;function et(e,t){let n=Date.parse(e);if(!Number.isFinite(n))return`not checked`;let r=Math.max(0,Math.round((t-n)/6e4));return r<1?`checked just now`:r<120?`checked ${r} min ago`:`checked ${Math.round(r/60)} h ago`}function tt({focusGroup:e}={}){let t=u(Z),n=c(Z);x(n,$e);let r=u(De),i=u(Re),o=u(ze),s=c(Re),l=u(b),d=re(),f=ne(),p=se(),[h,g]=(0,W.useState)(null),[_,v]=(0,W.useState)(!1),[y,S]=(0,W.useState)(null),[C,w]=(0,W.useState)(null),[T,E]=(0,W.useState)(!1),[ee,D]=(0,W.useState)(null),[O,A]=(0,W.useState)(null),[oe,j]=(0,W.useState)(!1),[ce,P]=(0,W.useState)(null),[le,F]=(0,W.useState)(()=>Date.now());x(()=>F(Date.now()),3e4);let I=(0,W.useRef)(null);(0,W.useEffect)(()=>{if(e!==`mcp-servers`)return;let t=I.current;t&&(typeof t.scrollIntoView==`function`&&t.scrollIntoView({block:`start`}),t.focus({preventScroll:!0}))},[e]);let ue=l.data,L=pe(ue),R=de(d.seats),z=xe({terminalAvailable:r.data?.available?r.data.data.available:!r.data&&null,terminalReason:r.data?.available?r.data.data.reason:null,activeSessionId:f.activeSessionId}),B=t.data?.available?t.data.data:null,V=e=>B?.groups.find(t=>t.id===e)??null,me=i.data?.available?he(i.data.raw):null,H=o.data?.available?fe(o.data.raw):null,U=(0,W.useCallback)((e,t=`neutral`)=>g({text:e,tone:t}),[]),ge=async()=>{v(!0);try{await p.run(`Check every app and seat again`,async()=>(await Promise.all([Oe(),ie().catch(()=>null)]),s(),!0))&&(F(Date.now()),U(`Checked again.`))}catch(e){U(N(e),`danger`)}finally{v(!1)}},_e=async e=>{S(e.seatId);try{await p.run(`Open the sign-in for ${e.label} in Terminal`,async()=>(await ae(e.seatId),!0))&&U(`Opened the sign-in for ${e.label} in Terminal. Finish it there; this page picks it up.`)}catch(e){U(N(e),`danger`)}finally{S(null)}},ve=async()=>{if(C){E(!0),D(null);try{let e=await p.run(`${C.enable?`Switch on`:`Restore`} ${C.row.name}`,()=>ke(C.row.id,C.enable));e&&(U(`Opened “${e.command.join(` `)}” in Terminal. Answer its prompts there.`),w(null))}catch(e){D(N(e))}finally{E(!1)}}},K=async(e,t)=>{if(t.target===`verse`){Se(e.id,t.choice),A(null);return}if(t.root!==null){j(!0),P(null);try{await p.run(`Launch ${e.name} in Terminal`,()=>Ae(e.id,{root:t.root,via:t.choice.via,model:t.choice.model}))&&(U(`Opened ${e.name} in Terminal.`),A(null))}catch(e){let t=N(e);O?P(t):U(t,`danger`)}finally{j(!1)}}},q=z.available||L.length>0?null:`Open a chat or enrol a project first.`,ye=e=>{let t={via:`native`,model:null},n=e.actions.find(e=>e.kind===`launch`)?.command??null;n&&K(e,{choice:t,target:z.available?`verse`:`terminal-app`,root:L[0]?.path??null,command:n})},be=t.data===void 0&&(t.status===`loading`||t.status===`idle`);return(0,G.jsxs)(`section`,{className:k.section,"aria-label":`Apps & Accounts`,children:[(0,G.jsx)(`div`,{className:k.scroll,children:(0,G.jsxs)(`div`,{className:k.page,children:[(0,G.jsxs)(`header`,{className:k.header,children:[(0,G.jsxs)(`div`,{className:k.headerText,children:[(0,G.jsx)(`h2`,{className:k.title,children:`Apps & Accounts`}),(0,G.jsx)(`p`,{className:k.lede,children:`Everything Verse can run with on this Mac, and whether it is ready.`})]}),(0,G.jsxs)(`div`,{className:k.headerMeta,children:[B?(0,G.jsxs)(`span`,{children:[et(B.checkedAt,le),B.pathSource===`fallback`?` · PATH from known folders (your login shell did not answer)`:``]}):null,(0,G.jsx)(M,{variant:`ghost`,size:`sm`,icon:(0,G.jsx)(te,{size:14}),busy:_,onClick:()=>void ge(),children:`Check again`})]})]}),(0,G.jsx)(`p`,{className:h?k.banner:k.visuallyHidden,"data-tone":h?.tone,role:`status`,"aria-live":`polite`,children:h?.text??``}),(0,G.jsx)(we,{seats:d.seats,health:d.health,budget:d.budget,loading:d.loading,reconnecting:y,onReconnect:e=>void _e(e)}),t.data&&!t.data.available?(0,G.jsx)(`p`,{className:k.banner,children:t.data.reason}):be?(0,G.jsxs)(`div`,{"aria-busy":`true`,"aria-label":`Checking apps`,children:[(0,G.jsx)(a,{width:`30%`}),(0,G.jsx)(a,{width:`80%`}),(0,G.jsx)(a,{width:`70%`})]}):(0,G.jsxs)(G.Fragment,{children:[V(`desktop`)?(0,G.jsx)(Xe,{group:V(`desktop`),onToggle:(e,t)=>{D(null),w({row:e,enable:t})},onRestore:e=>{D(null),w({row:e,enable:!1})}}):null,V(`terminal-agents`)?(0,G.jsx)(Ze,{group:V(`terminal-agents`),quickLaunchReason:q,onQuickLaunch:ye,onLaunchOptions:e=>{P(null),A(e)}}):null,V(`local-models`)?(0,G.jsx)(Qe,{group:V(`local-models`)}):null]}),(0,G.jsx)(Je,{snapshot:me,cliHealth:H,unavailable:i.data&&!i.data.available?i.data.reason:null,loading:i.data===void 0,run:p.run,onAdded:e=>{U(e),s()},headingRef:I})]})}),(0,G.jsx)(je,{row:C?.row??null,enable:C?.enable??!1,busy:T,error:ee,onCancel:()=>w(null),onConfirm:()=>void ve()}),(0,G.jsx)(Me,{row:O,projects:L,models:R,inVerse:z,busy:oe,error:ce,onCancel:()=>A(null),onLaunch:e=>{O&&K(O,e)}}),(0,G.jsx)(m,{open:p.dialog.open,reason:p.dialog.reason,tokenLabel:`Mutation token`,tokenHelp:`the mutation token ashlr verse printed`,onClose:p.dialog.onClose,onUnlocked:p.dialog.onUnlocked})]})}export{$e as APPS_POLL_MS,tt as AppsSection};
2
- //# sourceMappingURL=AppsSection-D6U-dSj6.js.map
@@ -1,2 +0,0 @@
1
- import{n as e}from"./index-oAAq8XJa.js";import{n as t}from"./Advanced-DEM93sKI.js";var n=e();function r(){return(0,n.jsx)(t,{})}export{r as AutonomySection};
2
- //# sourceMappingURL=AutonomySection-3V9pUyxm.js.map
@@ -1,2 +0,0 @@
1
- import{a as e,n as t,s as n}from"./index-oAAq8XJa.js";import{n as r,t as i}from"./MutationTokenDialog-SkRxqV_I.js";import{n as a}from"./viewport-BEqGUoTA.js";import{a as o}from"./command-bus-DqimKCUY.js";import{i as s,r as c}from"./section-visibility-qFqc_d4Z.js";import{a as l}from"./icons-B_yuAgdN.js";import{C as u,S as d,_ as f,a as p,b as m,c as h,d as g,f as _,g as v,h as y,i as b,m as x,o as S,p as C,r as w,s as T,u as E,w as D,x as O}from"./git-model-CivuBY_D.js";import{t as k}from"./Button-DYv_KKxr.js";import{n as A}from"./use-token-gate-B3IJL6bf.js";var j=n(e(),1),M={bar:`_bar_1j44k_8`,rows:`_rows_1j44k_15`,row:`_row_1j44k_15`,ident:`_ident_1j44k_39`,glyph:`_glyph_1j44k_47`,repo:`_repo_1j44k_48`,branch:`_branch_1j44k_57`,drift:`_drift_1j44k_66`,stat:`_stat_1j44k_72`,add:`_add_1j44k_90`,del:`_del_1j44k_91`,checking:`_checking_1j44k_93`,conflicts:`_conflicts_1j44k_94`,spacer:`_spacer_1j44k_101`,split:`_split_1j44k_105`,primary:`_primary_1j44k_113`,menuButton:`_menuButton_1j44k_114`,visuallyHidden:`_visuallyHidden_1j44k_148`,primaryLabel:`_primaryLabel_1j44k_162`,spinner:`_spinner_1j44k_163`,"branch-spin":`_branch-spin_1j44k_1`,menu:`_menu_1j44k_114`,"menu-in":`_menu-in_1j44k_1`,menuItem:`_menuItem_1j44k_204`,menuLabel:`_menuLabel_1j44k_224`,menuReason:`_menuReason_1j44k_225`,more:`_more_1j44k_233`,notice:`_notice_1j44k_248`},N=t();function P({primary:e,items:t,onSelect:n,menuLabel:r,disabled:i=!1}){let[a,o]=(0,j.useState)(!1),[s,c]=(0,j.useState)(-1),u=(0,j.useId)(),d=(0,j.useId)(),f=(0,j.useRef)(null),p=(0,j.useRef)(null),m=(0,j.useRef)([]),h=t.map((e,t)=>e.disabledReason===null?t:-1).filter(e=>e>=0),g=(0,j.useCallback)(e=>{o(!1),c(-1),e&&f.current?.focus()},[]),_=e=>{o(!0),c(h.length===0?-1:e===`first`?h[0]:h[h.length-1])};(0,j.useEffect)(()=>{a&&(s>=0?m.current[s]?.focus():p.current?.focus())},[a,s]),(0,j.useEffect)(()=>{if(!a)return;let e=e=>{let t=e.target;p.current?.contains(t)||f.current?.contains(t)||g(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[a,g]);let v=e=>{if(h.length===0)return;let t=h.indexOf(s),n=t===-1?e===1?0:h.length-1:(t+e+h.length)%h.length;c(h[n])},y=e=>{e.key===`ArrowDown`?(e.preventDefault(),_(`first`)):e.key===`ArrowUp`&&(e.preventDefault(),_(`last`))},b=e=>{switch(e.key){case`ArrowDown`:e.preventDefault(),v(1);break;case`ArrowUp`:e.preventDefault(),v(-1);break;case`Home`:e.preventDefault(),h.length&&c(h[0]);break;case`End`:e.preventDefault(),h.length&&c(h[h.length-1]);break;case`Escape`:e.preventDefault(),e.stopPropagation(),g(!0);break;case`Tab`:g(!1)}},x=e=>{e.disabledReason===null&&(g(!0),n(e.id))};return(0,N.jsxs)(`div`,{className:M.split,"data-open":a?`true`:`false`,children:[e?(0,N.jsxs)(`button`,{type:`button`,className:M.primary,"data-tone":e.tone??`primary`,onClick:e.onClick,disabled:i||e.busy,"aria-busy":e.busy||void 0,"aria-describedby":d,title:e.disclosure,children:[e.busy?(0,N.jsx)(`span`,{className:M.spinner,"aria-hidden":`true`}):null,(0,N.jsx)(`span`,{className:M.primaryLabel,children:e.label})]}):null,(0,N.jsx)(`span`,{id:d,className:M.visuallyHidden,children:e?.disclosure??``}),(0,N.jsx)(`button`,{ref:f,type:`button`,className:M.menuButton,"data-alone":e?`false`:`true`,"aria-haspopup":`menu`,"aria-expanded":a,"aria-controls":a?u:void 0,"aria-label":r,title:r,disabled:i,onClick:()=>a?g(!1):_(`first`),onKeyDown:y,children:(0,N.jsx)(l,{width:14,height:14,"aria-hidden":`true`})}),a?(0,N.jsx)(`div`,{ref:p,id:u,role:`menu`,"aria-label":r,className:M.menu,tabIndex:-1,onKeyDown:b,children:t.map((e,t)=>(0,N.jsxs)(`button`,{ref:e=>{m.current[t]=e},type:`button`,role:`menuitem`,className:M.menuItem,tabIndex:t===s?0:-1,"aria-disabled":e.disabledReason!==null||void 0,onClick:()=>x(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),x(e))},children:[(0,N.jsx)(`span`,{className:M.menuLabel,children:e.label}),e.disabledReason?(0,N.jsx)(`span`,{className:M.menuReason,children:e.disabledReason}):null]},e.id))}):null]})}var F={form:`_form_1pzii_5`,facts:`_facts_1pzii_11`,fact:`_fact_1pzii_11`,factWord:`_factWord_1pzii_34`,ref:`_ref_1pzii_45`,label:`_label_1pzii_55`,optional:`_optional_1pzii_62`,input:`_input_1pzii_68`,textarea:`_textarea_1pzii_69`,mono:`_mono_1pzii_85`,row:`_row_1pzii_87`,field:`_field_1pzii_93`,check:`_check_1pzii_100`,hint:`_hint_1pzii_111`,error:`_error_1pzii_126`,actions:`_actions_1pzii_137`};function I(e){e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.requestSubmit())}function L({children:e}){return(0,N.jsx)(`ul`,{className:F.facts,children:e})}function R({tone:e=`neutral`,children:t}){return(0,N.jsxs)(`li`,{className:F.fact,"data-tone":e,children:[e===`warning`?(0,N.jsx)(`span`,{className:F.factWord,children:`Note`}):null,(0,N.jsx)(`span`,{children:t})]})}function z({error:e}){return e?(0,N.jsx)(`p`,{role:`alert`,className:F.error,children:e}):null}function B({name:e}){return(0,N.jsx)(`code`,{className:F.ref,children:e??`HEAD`})}function V({open:e,status:t,onClose:n,onSubmit:i,error:a,busy:o}){let s=(0,j.useId)(),c=(0,j.useId)(),[l,u]=(0,j.useState)(``),d=(0,j.useRef)(null);return(0,j.useEffect)(()=>{e&&u(``)},[e]),(0,N.jsx)(r,{open:e,onClose:n,titleId:s,title:`Commit changes`,initialFocusRef:d,children:(0,N.jsxs)(`form`,{className:F.form,onSubmit:e=>{e.preventDefault(),l.trim()&&!o&&i(l.trim())},onKeyDown:I,children:[(0,N.jsx)(L,{children:(0,N.jsxs)(R,{children:[h(t.dirty),` changed `,t.dirty===1?`file`:`files`,` in `,(0,N.jsx)(`strong`,{children:t.name}),` on `,(0,N.jsx)(B,{name:t.branch}),`, untracked files included.`]})}),(0,N.jsx)(`label`,{className:F.label,htmlFor:c,children:`Message`}),(0,N.jsx)(`textarea`,{id:c,ref:d,className:F.textarea,rows:4,value:l,onChange:e=>u(e.target.value),placeholder:`What changed, and why`,maxLength:1e4,required:!0}),(0,N.jsxs)(`p`,{className:F.hint,children:[`Git hooks in this repository run as usual. `,(0,N.jsx)(`kbd`,{children:`⌘`}),(0,N.jsx)(`kbd`,{children:`Enter`}),` commits.`]}),(0,N.jsx)(z,{error:a}),(0,N.jsxs)(`div`,{className:F.actions,children:[(0,N.jsx)(k,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,N.jsx)(k,{type:`submit`,variant:`primary`,busy:o,disabled:!l.trim(),children:`Commit`})]})]})})}function H({open:e,status:t,onClose:n,onSubmit:i,error:a,busy:o,draft:s}){let c=(0,j.useId)(),l=(0,j.useId)(),u=(0,j.useId)(),d=(0,j.useId)(),[f,p]=(0,j.useState)(``),[m,g]=(0,j.useState)(``),[_,v]=(0,j.useState)(``),[y,x]=(0,j.useState)(s),S=(0,j.useRef)(null);(0,j.useEffect)(()=>{e&&(p(b(t)),g(``),v(t.base??``),x(s))},[e]);let C=t.upstream===null||t.ahead>0;return(0,N.jsx)(r,{open:e,onClose:n,titleId:c,title:y?`Create draft pull request`:`Create pull request`,initialFocusRef:S,children:(0,N.jsxs)(`form`,{className:F.form,onSubmit:e=>{e.preventDefault(),f.trim()&&_.trim()&&!o&&i({title:f.trim(),body:m,base:_.trim(),draft:y})},onKeyDown:I,children:[(0,N.jsxs)(L,{children:[C?(0,N.jsxs)(R,{children:[`Pushes `,(0,N.jsx)(B,{name:t.branch}),` to `,t.upstream??`origin`,` first`,t.upstream&&t.ahead>0?` (${h(t.ahead)} ${t.ahead===1?`commit`:`commits`})`:``,`.`]}):null,(0,N.jsxs)(R,{children:[`Then opens a PR from `,(0,N.jsx)(B,{name:t.branch}),` into `,(0,N.jsx)(B,{name:_.trim()||null}),`:`,` `,h(t.diffstat.files),` `,t.diffstat.files===1?`file`:`files`,`, `,T(t.diffstat.additions,t.diffstat.deletions),`.`]}),t.dirty>0?(0,N.jsxs)(R,{tone:`warning`,children:[h(t.dirty),` uncommitted `,t.dirty===1?`change is`:`changes are`,` not in the PR. Commit first to include `,t.dirty===1?`it`:`them`,`.`]}):null]}),(0,N.jsx)(`label`,{className:F.label,htmlFor:l,children:`Title`}),(0,N.jsx)(`input`,{id:l,ref:S,className:F.input,value:f,onChange:e=>p(e.target.value),maxLength:256,required:!0}),(0,N.jsxs)(`label`,{className:F.label,htmlFor:u,children:[`Description `,(0,N.jsx)(`span`,{className:F.optional,children:`optional`})]}),(0,N.jsx)(`textarea`,{id:u,className:F.textarea,rows:4,value:m,onChange:e=>g(e.target.value),maxLength:6e4}),(0,N.jsxs)(`div`,{className:F.row,children:[(0,N.jsxs)(`div`,{className:F.field,children:[(0,N.jsx)(`label`,{className:F.label,htmlFor:d,children:`Base branch`}),(0,N.jsx)(`input`,{id:d,className:`${F.input} ${F.mono}`,value:_,onChange:e=>v(e.target.value),spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,required:!0})]}),(0,N.jsxs)(`label`,{className:F.check,children:[(0,N.jsx)(`input`,{type:`checkbox`,checked:y,onChange:e=>x(e.target.checked)}),`Draft`]})]}),(0,N.jsx)(z,{error:a}),(0,N.jsxs)(`div`,{className:F.actions,children:[(0,N.jsx)(k,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,N.jsx)(k,{type:`submit`,variant:`primary`,busy:o,disabled:!f.trim()||!_.trim(),children:y?`Create draft PR`:`Create PR`})]})]})})}function U({open:e,pin:t,live:n,onClose:i,onSubmit:a,error:o,busy:s}){let c=(0,j.useId)(),l=(0,j.useRef)(null),u=C(t),d=_(t,n)??(u.verified?null:`This head has not passed every check GitHub needs to merge it.`);return(0,N.jsx)(r,{open:e,onClose:i,titleId:c,title:`Merge #${t.number}?`,description:t.title,initialFocusRef:l,children:(0,N.jsxs)(`form`,{className:F.form,onSubmit:e=>{e.preventDefault(),!s&&d===null&&a()},onKeyDown:I,children:[(0,N.jsxs)(L,{children:[(0,N.jsxs)(R,{children:[`Squash-merges `,(0,N.jsx)(B,{name:t.headRef||null}),` into `,(0,N.jsx)(B,{name:t.baseRef||null}),` on GitHub.`]}),(0,N.jsxs)(R,{tone:u.verified?`neutral`:`warning`,children:[`Head `,(0,N.jsx)(`code`,{className:F.ref,children:u.sha}),`, `,u.detail]}),(0,N.jsx)(R,{children:`Only this head merges: GitHub re-checks it first, so if a commit landed after it, nothing merges. Admin overrides are never used.`}),d===null?null:(0,N.jsx)(R,{tone:`warning`,children:d})]}),(0,N.jsx)(z,{error:o}),(0,N.jsxs)(`div`,{className:F.actions,children:[(0,N.jsx)(k,{variant:`ghost`,onClick:i,children:`Cancel`}),(0,N.jsxs)(k,{ref:l,type:`submit`,variant:`primary`,busy:s,disabled:d!==null,children:[`Merge #`,t.number]})]})]})})}var W={chip:`_chip_1sdua_5`,glyph:`_glyph_1sdua_26`,state:`_state_1sdua_30`,checks:`_checks_1sdua_33`,number:`_number_1sdua_37`,title:`_title_1sdua_43`,pulse:`_pulse_1sdua_65`,"pr-pulse":`_pr-pulse_1sdua_1`};function G({pr:e,counts:t=null,showTitle:n=!0}){let r=y(e,t);return(0,N.jsxs)(`a`,{className:W.chip,"data-tone":r.tone,href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`${r.label}. Opens on GitHub.`,title:`${r.label}. Opens on GitHub.`,children:[(0,N.jsx)(K,{tone:r.tone,state:e.state}),(0,N.jsx)(`span`,{className:W.number,children:r.number}),n&&e.title?(0,N.jsx)(`span`,{className:W.title,children:e.title}):null,(0,N.jsxs)(`span`,{className:W.state,children:[r.state,e.state===`merged`?` ✓`:``]}),r.checks?(0,N.jsx)(`span`,{className:W.checks,children:r.checks}):null]})}function K({tone:e,state:t}){let n={width:12,height:12,viewBox:`0 0 16 16`,"aria-hidden":!0,className:W.glyph};return t===`merged`?(0,N.jsxs)(`svg`,{...n,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,children:[(0,N.jsx)(`circle`,{cx:`4`,cy:`3.5`,r:`1.8`}),(0,N.jsx)(`circle`,{cx:`4`,cy:`12.5`,r:`1.8`}),(0,N.jsx)(`circle`,{cx:`12`,cy:`8`,r:`1.8`}),(0,N.jsx)(`path`,{d:`M4 5.3v5.4M5.2 4.6c1.4 2.2 3.2 3.4 5 3.4`})]}):t===`closed`?(0,N.jsxs)(`svg`,{...n,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,children:[(0,N.jsx)(`circle`,{cx:`4`,cy:`3.5`,r:`1.8`}),(0,N.jsx)(`circle`,{cx:`4`,cy:`12.5`,r:`1.8`}),(0,N.jsx)(`path`,{d:`M4 5.3v5.4M10 3l4 4M14 3l-4 4`})]}):e===`running`?(0,N.jsx)(`span`,{className:W.pulse,"aria-hidden":`true`}):e===`danger`?(0,N.jsxs)(`svg`,{...n,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,children:[(0,N.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`}),(0,N.jsx)(`path`,{d:`M5.8 5.8l4.4 4.4M10.2 5.8l-4.4 4.4`})]}):e===`success`?(0,N.jsxs)(`svg`,{...n,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,N.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`}),(0,N.jsx)(`path`,{d:`M5.2 8.2l2 2 3.6-4`})]}):(0,N.jsxs)(`svg`,{...n,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeDasharray:t===`draft`?`2 2`:void 0,children:[(0,N.jsx)(`circle`,{cx:`4`,cy:`3.5`,r:`1.8`}),(0,N.jsx)(`circle`,{cx:`4`,cy:`12.5`,r:`1.8`}),(0,N.jsx)(`circle`,{cx:`12`,cy:`12.5`,r:`1.8`}),(0,N.jsx)(`path`,{d:`M4 5.3v5.4M12 10.7V6.5c0-1.4-.8-2.2-2.2-2.2H7.5`})]})}var q=1e4,J=2500;function ee(e,t={}){let n=t.fetchStatus??m,r=t.enabled??!0,i=s(),a=e.join(`\0`),o=(0,j.useMemo)(()=>a===``?[]:a.split(`\0`),[a]),[l,u]=(0,j.useState)({}),[d,f]=(0,j.useState)(new Set),[p,h]=(0,j.useState)(null),g=(0,j.useRef)(new Set),_=(0,j.useRef)(null),v=(0,j.useRef)(null),y=(0,j.useRef)(!0),b=(0,j.useCallback)(()=>{_.current?.abort();let e=new AbortController;_.current=e;let t=o.filter(e=>!g.current.has(e));if(t.length===0){f(new Set(o));return}Promise.all(t.map(async t=>{try{return{root:t,status:await n(t,e.signal),err:null}}catch(e){return{root:t,status:null,err:e}}})).then(t=>{if(!y.current||e.signal.aborted)return;let n=null,r=!1,i={},a=[];for(let e of t)e.status?(i[e.root]=e.status,e.status.prLookup===`pending`&&(r=!0)):O(e.err)?(g.current.add(e.root),a.push(e.root)):(console.warn(`[verse] git status failed`,e.err),n=`Could not read git status.`);u(e=>{let t={...e,...i};for(let e of a)delete t[e];return t}),f(new Set(o)),h(n),r&&v.current===null&&(v.current=setTimeout(()=>{v.current=null,y.current&&x.current()},J))})},[o,n]),x=(0,j.useRef)(b);x.current=b,(0,j.useEffect)(()=>{g.current=new Set,u({}),f(new Set),h(null)},[a]);let S=(0,j.useRef)(i);S.current=i,(0,j.useEffect)(()=>{r&&S.current&&b()},[b,r]),c(b,q,{enabled:r}),(0,j.useEffect)(()=>(y.current=!0,()=>{y.current=!1,_.current?.abort(),v.current!==null&&clearTimeout(v.current)}),[]);let C=(0,j.useCallback)((e,t)=>{u(n=>({...n,[e]:{...t,root:e}}))},[]);return{statuses:(0,j.useMemo)(()=>o.map(e=>l[e]).filter(e=>e!==void 0),[o,l]),loading:o.some(e=>!d.has(e)),error:p,refresh:b,replace:C}}var te=6e3;function Y({roots:e,onOpenDiff:t,statusOptions:n}){let{statuses:r,loading:s,replace:c}=ee(e,n),{compact:l}=a(),m=A(),[h,v]=(0,j.useState)(!1),[y,b]=(0,j.useState)(null),[S,C]=(0,j.useState)(null),[T,O]=(0,j.useState)(null),[k,P]=(0,j.useState)(null),[F,I]=(0,j.useState)(null),L=(0,j.useId)();(0,j.useEffect)(()=>{if(k?.tone!==`ok`)return;let e=setTimeout(()=>P(null),te);return()=>clearTimeout(e)},[k]);let R=w(r).filter(E),z=e=>r.find(t=>t.root===e)??null,B=(0,j.useCallback)(async(e,t,n,r,i)=>{C(e),O(null),P(null);try{let i=await m.run(t,n);if(i===null)return;c(e,i.status),b(null),P({text:r(i.status),tone:`ok`})}catch(e){console.warn(`[verse] git action failed`,e);let t=p(e);i?O(t):P({text:t,tone:`error`})}finally{C(null)}},[m,c]),W=e=>B(e.root,`Push ${e.branch??`this branch`} to ${e.upstream??`origin`}.`,()=>D(e.root),e=>`Pushed ${e.branch??`the branch`} to ${e.upstream??`origin`}.`,!1),G=e=>t(e),K=e=>{let t=x(e);t&&(O(null),b({kind:`merge`,root:e.root,pin:t}))},q=e=>{switch(e.suggested){case`commit`:O(null),b({kind:`commit`,root:e.root});break;case`push`:W(e);break;case`create-pr`:O(null),b({kind:`pr`,root:e.root,draft:!1});break;case`merge`:K(e);break;case`view-pr`:e.pr&&window.open(e.pr.url,`_blank`,`noopener,noreferrer`)}},J=(e,t)=>{switch(t){case`draft-pr`:O(null),b({kind:`pr`,root:e.root,draft:!0});break;case`commit`:O(null),b({kind:`commit`,root:e.root});break;case`push`:W(e);break;case`open-github`:e.pr&&window.open(e.pr.url,`_blank`,`noopener,noreferrer`);break;case`copy-branch`:e.branch&&navigator.clipboard?.writeText(e.branch).then(()=>P({text:`Copied ${e.branch}.`,tone:`ok`}),()=>P({text:`Could not copy the branch name.`,tone:`error`}));break;case`review`:G({root:e.root,scope:e.dirty>0&&e.diffstat.files===0?`working`:`branch`})}},Y=e=>{if(O(null),e===`create-pr`){let e=R.find(e=>e.suggested===`create-pr`)??R.find(e=>g(e).find(e=>e.id===`draft-pr`)?.disabledReason===null);if(e){P(null),b({kind:`pr`,root:e.root,draft:!1});return}let t=R.length>0?g(R[0]).find(e=>e.id===`draft-pr`)?.disabledReason:null;P({text:t?`Can't open a pull request: ${t}.`:`No branch in this chat has changes to open a pull request from.`,tone:`error`});return}let t=R.find(e=>e.suggested===`merge`&&e.pr!==null);if(t){P(null),K(t);return}let n=R.find(e=>e.pr!==null&&(e.pr.state===`open`||e.pr.state===`draft`));P({text:n?.pr?`#${n.pr.number} isn't ready to merge yet — its checks haven't passed or it isn't mergeable.`:`No pull request in this chat is ready to merge.`,tone:`error`})},X=e=>{s?I(e):Y(e)};o(`git.create-pr`,()=>X(`create-pr`)),o(`git.merge-pr`,()=>X(`merge`));let Z=(0,j.useRef)(Y);if(Z.current=Y,(0,j.useEffect)(()=>{F===null||s||(I(null),Z.current(F))},[F,s]),R.length===0&&!k)return null;let Q=h?R:R.slice(0,1),re=R.length-Q.length,$=y?z(y.root):null;return(0,N.jsxs)(`section`,{className:M.bar,"aria-label":`Branches`,"data-compact":l?`true`:`false`,children:[(0,N.jsx)(`ul`,{id:L,className:M.rows,children:Q.map(e=>(0,N.jsx)(ne,{status:e,compact:l,busy:S===e.root,onPrimary:()=>q(e),onMenu:t=>J(e,t),onOpenDiff:()=>G({root:e.root,scope:`branch`})},e.gitRoot??e.root))}),R.length>1?(0,N.jsx)(`button`,{type:`button`,className:M.more,"aria-expanded":h,"aria-controls":L,onClick:()=>v(e=>!e),children:h?`Show fewer`:`Show ${re} more`}):null,(0,N.jsx)(`p`,{className:M.notice,role:k?.tone===`error`?`alert`:`status`,"aria-live":k?.tone===`error`?`assertive`:`polite`,"data-tone":k?.tone??`ok`,children:k?.text??``}),$&&y?.kind===`commit`?(0,N.jsx)(V,{open:!0,status:$,busy:S===y.root,error:T,onClose:()=>b(null),onSubmit:e=>void B(y.root,`Commit ${$.dirty} changed files on ${$.branch??`this branch`}.`,()=>f({root:y.root,message:e}),e=>`Committed on ${e.branch??`the branch`}.`,!0)}):null,$&&y?.kind===`pr`?(0,N.jsx)(H,{open:!0,draft:y.draft,status:$,busy:S===y.root,error:T,onClose:()=>b(null),onSubmit:e=>void B(y.root,`Push ${$.branch??`this branch`} and open a pull request into ${e.base}.`,async()=>{let t=await u({root:y.root,title:e.title,base:e.base,...e.body.trim()?{body:e.body}:{},...e.draft?{draft:!0}:{}});return{status:{...t.status,pr:t.pr??t.status.pr}}},e=>e.pr?`Opened #${e.pr.number}.`:`Opened the pull request.`,!0)}):null,y?.kind===`merge`?(0,N.jsx)(U,{open:!0,pin:y.pin,live:$,busy:S===y.root,error:T,onClose:()=>b(null),onSubmit:()=>{let{pin:e}=y;e.headSha!==null&&_(e,z(y.root))===null&&B(y.root,`Squash-merge #${e.number} (head ${e.headSha.slice(0,7)}) into ${e.baseRef}.`,async()=>{let t=await d({root:y.root,number:e.number,headSha:e.headSha});return{status:{...t.status,pr:t.pr??t.status.pr}}},()=>`Merged #${e.number} into ${e.baseRef}.`,!0)}}):null,(0,N.jsx)(i,{...m.dialog,tokenLabel:`Mutation token`,tokenHelp:`the mutation token ashlr verse printed`})]})}function ne({status:e,compact:t,busy:n,onPrimary:r,onMenu:i,onOpenDiff:a}){let o=v(e),s=g(e),c=e.diffstat.files>0,l=e.pr===null&&e.prLookup===`pending`&&e.branch!==null&&e.suggested===`none`;return(0,N.jsxs)(`li`,{className:M.row,"aria-label":`${e.name}, ${e.branch?`branch ${e.branch}`:`detached HEAD`}`,children:[(0,N.jsxs)(`span`,{className:M.ident,children:[(0,N.jsx)(X,{}),(0,N.jsx)(`span`,{className:M.repo,title:e.gitRoot??e.root,children:e.name}),(0,N.jsx)(`span`,{className:M.branch,title:e.branch??void 0,children:e.branch??`detached HEAD`}),e.behind>0?(0,N.jsxs)(`span`,{className:M.drift,children:[e.behind,` behind`]}):null]}),c?(0,N.jsxs)(`button`,{type:`button`,className:M.stat,onClick:a,"aria-label":`${S(e.diffstat.files,e.diffstat.additions,e.diffstat.deletions)}. Open the branch diff.`,title:`Open the branch diff`,children:[(0,N.jsxs)(`span`,{className:M.add,children:[`+`,h(e.diffstat.additions)]}),(0,N.jsxs)(`span`,{className:M.del,children:[`−`,h(e.diffstat.deletions)]})]}):null,e.pr?(0,N.jsx)(G,{pr:e.pr,counts:e.prCheckCounts??null,showTitle:!t}):null,l?(0,N.jsx)(`span`,{className:M.checking,children:`Checking GitHub…`}):null,(e.conflicts??0)>0?(0,N.jsxs)(`span`,{className:M.conflicts,children:[e.conflicts,` conflicted`]}):null,(0,N.jsx)(`span`,{className:M.spacer}),(0,N.jsx)(P,{primary:o?{label:o.label,disclosure:o.disclosure,onClick:r,busy:n,tone:o.action===`view-pr`?`subtle`:`primary`}:null,items:s,onSelect:i,menuLabel:`More git actions for ${e.name}`,disabled:n})]})}function X(){return(0,N.jsxs)(`svg`,{className:M.glyph,width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,N.jsx)(`circle`,{cx:`4.5`,cy:`3.5`,r:`1.7`}),(0,N.jsx)(`circle`,{cx:`4.5`,cy:`12.5`,r:`1.7`}),(0,N.jsx)(`circle`,{cx:`11.5`,cy:`5`,r:`1.7`}),(0,N.jsx)(`path`,{d:`M4.5 5.2v5.6M11.5 6.7c0 3-3.5 2.7-6.3 4.6`})]})}export{Y as BranchBar};
2
- //# sourceMappingURL=BranchBar-U8UdpfEB.js.map