@ashlr/hub 3.11.5 → 3.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (408) hide show
  1. package/CHANGELOG.md +153 -0
  2. package/README.md +29 -16
  3. package/dist/authority-surface.json +91 -45
  4. package/dist/build-identity.json +2 -2
  5. package/dist/cli/authority.d.ts +145 -33
  6. package/dist/cli/authority.js +1196 -313
  7. package/dist/cli/authority.js.map +1 -1
  8. package/dist/cli/cloud.js +12 -3
  9. package/dist/cli/cloud.js.map +1 -1
  10. package/dist/core/authority/protected-paths.js +11 -0
  11. package/dist/core/authority/protected-paths.js.map +1 -1
  12. package/dist/core/authority/resident.d.ts +101 -0
  13. package/dist/core/authority/resident.js +246 -0
  14. package/dist/core/authority/resident.js.map +1 -0
  15. package/dist/core/authority/trust-roots.js +7 -1
  16. package/dist/core/authority/trust-roots.js.map +1 -1
  17. package/dist/core/authority/types.d.ts +43 -0
  18. package/dist/core/authority/types.js +6 -0
  19. package/dist/core/authority/types.js.map +1 -1
  20. package/dist/core/cloud/budget.js +11 -1
  21. package/dist/core/cloud/budget.js.map +1 -1
  22. package/dist/core/cloud/cloud-api.d.ts +25 -2
  23. package/dist/core/cloud/cloud-api.js +139 -5
  24. package/dist/core/cloud/cloud-api.js.map +1 -1
  25. package/dist/core/cloud/pr-actions.d.ts +93 -0
  26. package/dist/core/cloud/pr-actions.js +436 -0
  27. package/dist/core/cloud/pr-actions.js.map +1 -0
  28. package/dist/core/cloud/pr-preview.d.ts +128 -0
  29. package/dist/core/cloud/pr-preview.js +228 -0
  30. package/dist/core/cloud/pr-preview.js.map +1 -0
  31. package/dist/core/cloud/store.d.ts +2 -0
  32. package/dist/core/cloud/store.js +28 -0
  33. package/dist/core/cloud/store.js.map +1 -1
  34. package/dist/core/cloud/timeline-api.d.ts +24 -0
  35. package/dist/core/cloud/timeline-api.js +46 -0
  36. package/dist/core/cloud/timeline-api.js.map +1 -0
  37. package/dist/core/cloud/timeline-types.d.ts +62 -0
  38. package/dist/core/cloud/timeline-types.js +36 -0
  39. package/dist/core/cloud/timeline-types.js.map +1 -0
  40. package/dist/core/cloud/timeline.d.ts +102 -0
  41. package/dist/core/cloud/timeline.js +919 -0
  42. package/dist/core/cloud/timeline.js.map +1 -0
  43. package/dist/core/cloud/tracker.js +67 -0
  44. package/dist/core/cloud/tracker.js.map +1 -1
  45. package/dist/core/cloud/types.d.ts +38 -0
  46. package/dist/core/cloud/types.js +1 -1
  47. package/dist/core/cloud/types.js.map +1 -1
  48. package/dist/core/daemon/service-install-authority.d.ts +10 -2
  49. package/dist/core/daemon/service-install-authority.js +14 -5
  50. package/dist/core/daemon/service-install-authority.js.map +1 -1
  51. package/dist/core/daemon/service.d.ts +15 -0
  52. package/dist/core/daemon/service.js +26 -0
  53. package/dist/core/daemon/service.js.map +1 -1
  54. package/dist/core/fleet/cloud-intake.d.ts +95 -0
  55. package/dist/core/fleet/cloud-intake.js +557 -0
  56. package/dist/core/fleet/cloud-intake.js.map +1 -0
  57. package/dist/core/fleet/dispatch-router.d.ts +13 -0
  58. package/dist/core/fleet/dispatch-router.js +32 -8
  59. package/dist/core/fleet/dispatch-router.js.map +1 -1
  60. package/dist/core/fleet/fleet-merge-state.d.ts +10 -0
  61. package/dist/core/fleet/fleet-merge-state.js.map +1 -1
  62. package/dist/core/fleet/host-merge.d.ts +5 -0
  63. package/dist/core/fleet/host-merge.js +11 -0
  64. package/dist/core/fleet/host-merge.js.map +1 -1
  65. package/dist/core/fleet/merge-gates.d.ts +8 -0
  66. package/dist/core/fleet/merge-gates.js +25 -5
  67. package/dist/core/fleet/merge-gates.js.map +1 -1
  68. package/dist/core/fleet/standing-merge-pass.js +30 -0
  69. package/dist/core/fleet/standing-merge-pass.js.map +1 -1
  70. package/dist/core/fleet/tick-hooks-live.d.ts +9 -0
  71. package/dist/core/fleet/tick-hooks-live.js +44 -5
  72. package/dist/core/fleet/tick-hooks-live.js.map +1 -1
  73. package/dist/core/fleet/verify-check-run.d.ts +90 -0
  74. package/dist/core/fleet/verify-check-run.js +274 -0
  75. package/dist/core/fleet/verify-check-run.js.map +1 -0
  76. package/dist/core/routing/budget-api.d.ts +11 -0
  77. package/dist/core/routing/budget-api.js +64 -8
  78. package/dist/core/routing/budget-api.js.map +1 -1
  79. package/dist/core/routing/budget-store.d.ts +22 -1
  80. package/dist/core/routing/budget-store.js +22 -8
  81. package/dist/core/routing/budget-store.js.map +1 -1
  82. package/dist/core/universe/builtins/preparation/manifest.json +1 -1
  83. package/dist/core/universe/builtins/preparation/preparation-bridge.mjs +8 -2
  84. package/dist/core/universe/builtins/preparation/preparation-verification-fixtures.mjs +7 -1
  85. package/dist/core/verse/account-health.js +9 -3
  86. package/dist/core/verse/account-health.js.map +1 -1
  87. package/dist/core/verse/activity-api.d.ts +5 -1
  88. package/dist/core/verse/activity-api.js +62 -14
  89. package/dist/core/verse/activity-api.js.map +1 -1
  90. package/dist/core/verse/authority-api.d.ts +9 -1
  91. package/dist/core/verse/authority-api.js +82 -2
  92. package/dist/core/verse/authority-api.js.map +1 -1
  93. package/dist/core/verse/seat-readiness.d.ts +25 -0
  94. package/dist/core/verse/seat-readiness.js +43 -6
  95. package/dist/core/verse/seat-readiness.js.map +1 -1
  96. package/dist/core/verse/verse-api.d.ts +3 -1
  97. package/dist/core/verse/verse-api.js +6 -0
  98. package/dist/core/verse/verse-api.js.map +1 -1
  99. package/dist/core/web/public/next/assets/{ActionMenu-DffwPklw.js → ActionMenu-Dwjk6rUQ.js} +2 -2
  100. package/dist/core/web/public/next/assets/{ActionMenu-DffwPklw.js.map → ActionMenu-Dwjk6rUQ.js.map} +1 -1
  101. package/dist/core/web/public/next/assets/Advanced-cVYTAsfB.js +2 -0
  102. package/dist/core/web/public/next/assets/{Advanced-CxzE6ekM.js.map → Advanced-cVYTAsfB.js.map} +1 -1
  103. package/dist/core/web/public/next/assets/App-IsaWDsdF.js +7 -0
  104. package/dist/core/web/public/next/assets/{App-DFlp-vdv.js.map → App-IsaWDsdF.js.map} +1 -1
  105. package/dist/core/web/public/next/assets/AppsSection-DDqeSrty.js +2 -0
  106. package/dist/core/web/public/next/assets/{AppsSection-Ct2O605-.js.map → AppsSection-DDqeSrty.js.map} +1 -1
  107. package/dist/core/web/public/next/assets/{AreaTrend-o-GLl2Is.js → AreaTrend-C32rUaxm.js} +2 -2
  108. package/dist/core/web/public/next/assets/{AreaTrend-o-GLl2Is.js.map → AreaTrend-C32rUaxm.js.map} +1 -1
  109. package/dist/core/web/public/next/assets/AutonomyOffState-CmSSTHVe.css +1 -0
  110. package/dist/core/web/public/next/assets/AutonomyOffState-CpFYS3tQ.js +3 -0
  111. package/dist/core/web/public/next/assets/AutonomyOffState-CpFYS3tQ.js.map +1 -0
  112. package/dist/core/web/public/next/assets/AutonomySection-Dwn8UtOy.js +2 -0
  113. package/dist/core/web/public/next/assets/{AutonomySection-BTg7yVa1.js.map → AutonomySection-Dwn8UtOy.js.map} +1 -1
  114. package/dist/core/web/public/next/assets/{BranchBar-BjPFtGsj.js → BranchBar-ISZ7xUCj.js} +2 -2
  115. package/dist/core/web/public/next/assets/{BranchBar-BjPFtGsj.js.map → BranchBar-ISZ7xUCj.js.map} +1 -1
  116. package/dist/core/web/public/next/assets/BudgetControl-BARVp-En.js +2 -0
  117. package/dist/core/web/public/next/assets/BudgetControl-BARVp-En.js.map +1 -0
  118. package/dist/core/web/public/next/assets/{Button-OjVJSrFq.js → Button-DtE0rlWD.js} +2 -2
  119. package/dist/core/web/public/next/assets/{Button-OjVJSrFq.js.map → Button-DtE0rlWD.js.map} +1 -1
  120. package/dist/core/web/public/next/assets/{CapacityStrip-Bx4c3dxD.js → CapacityStrip-DKbKA_Aa.js} +2 -2
  121. package/dist/core/web/public/next/assets/{CapacityStrip-Bx4c3dxD.js.map → CapacityStrip-DKbKA_Aa.js.map} +1 -1
  122. package/dist/core/web/public/next/assets/{ChartFrame-B_w2Siqg.js → ChartFrame-DK_BDXCt.js} +2 -2
  123. package/dist/core/web/public/next/assets/{ChartFrame-B_w2Siqg.js.map → ChartFrame-DK_BDXCt.js.map} +1 -1
  124. package/dist/core/web/public/next/assets/ChatSection-C9myY4ei.js +3 -0
  125. package/dist/core/web/public/next/assets/ChatSection-C9myY4ei.js.map +1 -0
  126. package/dist/core/web/public/next/assets/{CloudBudgetForm-5Gf4iAok.js → CloudBudgetForm-CvjK4Oh6.js} +2 -2
  127. package/dist/core/web/public/next/assets/{CloudBudgetForm-5Gf4iAok.js.map → CloudBudgetForm-CvjK4Oh6.js.map} +1 -1
  128. package/dist/core/web/public/next/assets/{CommandPalette-iTpk6I8r.js → CommandPalette-DzPsth0u.js} +2 -2
  129. package/dist/core/web/public/next/assets/{CommandPalette-iTpk6I8r.js.map → CommandPalette-DzPsth0u.js.map} +1 -1
  130. package/dist/core/web/public/next/assets/CommandSection-Brp73iox.js +3 -0
  131. package/dist/core/web/public/next/assets/CommandSection-Brp73iox.js.map +1 -0
  132. package/dist/core/web/public/next/assets/{ConfirmDialog-_S9iE-cJ.js → ConfirmDialog-CLUhzaBj.js} +2 -2
  133. package/dist/core/web/public/next/assets/{ConfirmDialog-_S9iE-cJ.js.map → ConfirmDialog-CLUhzaBj.js.map} +1 -1
  134. package/dist/core/web/public/next/assets/{DeleteChatDialog-KUYUygiA.js → DeleteChatDialog-C_eDhV8b.js} +2 -2
  135. package/dist/core/web/public/next/assets/{DeleteChatDialog-KUYUygiA.js.map → DeleteChatDialog-C_eDhV8b.js.map} +1 -1
  136. package/dist/core/web/public/next/assets/{Dialog-BuIaG6HF.js → Dialog-BRd_B9OE.js} +2 -2
  137. package/dist/core/web/public/next/assets/{Dialog-BuIaG6HF.js.map → Dialog-BRd_B9OE.js.map} +1 -1
  138. package/dist/core/web/public/next/assets/{DiffPane-De4IQt82.js → DiffPane-Cpr9soB2.js} +2 -2
  139. package/dist/core/web/public/next/assets/{DiffPane-De4IQt82.js.map → DiffPane-Cpr9soB2.js.map} +1 -1
  140. package/dist/core/web/public/next/assets/{DiffViewer-B75t6Ile.js → DiffViewer-CNwd0W3Q.js} +2 -2
  141. package/dist/core/web/public/next/assets/{DiffViewer-B75t6Ile.js.map → DiffViewer-CNwd0W3Q.js.map} +1 -1
  142. package/dist/core/web/public/next/assets/DockHost-BcEq2qaS.js +2 -0
  143. package/dist/core/web/public/next/assets/{DockHost-BPqyhtCP.js.map → DockHost-BcEq2qaS.js.map} +1 -1
  144. package/dist/core/web/public/next/assets/{EmptyState-DXkT4vhW.js → EmptyState-DsN1H6MC.js} +2 -2
  145. package/dist/core/web/public/next/assets/{EmptyState-DXkT4vhW.js.map → EmptyState-DsN1H6MC.js.map} +1 -1
  146. package/dist/core/web/public/next/assets/{Epistemic-CfqFe_aP.js → Epistemic-fycQTBRO.js} +2 -2
  147. package/dist/core/web/public/next/assets/{Epistemic-CfqFe_aP.js.map → Epistemic-fycQTBRO.js.map} +1 -1
  148. package/dist/core/web/public/next/assets/EvidenceTimeline-PBDAiSuG.css +1 -0
  149. package/dist/core/web/public/next/assets/EvidenceTimeline-sCCAdnBK.js +2 -0
  150. package/dist/core/web/public/next/assets/EvidenceTimeline-sCCAdnBK.js.map +1 -0
  151. package/dist/core/web/public/next/assets/{FleetSection-B7f-XBiX.js → FleetSection-BG8iGraG.js} +3 -3
  152. package/dist/core/web/public/next/assets/{FleetSection-B7f-XBiX.js.map → FleetSection-BG8iGraG.js.map} +1 -1
  153. package/dist/core/web/public/next/assets/{Funnel-pXYySwXQ.js → Funnel-B88_wpA4.js} +2 -2
  154. package/dist/core/web/public/next/assets/{Funnel-pXYySwXQ.js.map → Funnel-B88_wpA4.js.map} +1 -1
  155. package/dist/core/web/public/next/assets/{GearTray-gj6lT7ba.js → GearTray-CpDt0xwj.js} +2 -2
  156. package/dist/core/web/public/next/assets/{GearTray-gj6lT7ba.js.map → GearTray-CpDt0xwj.js.map} +1 -1
  157. package/dist/core/web/public/next/assets/{GrowthSection-D8e9m9Wy.js → GrowthSection-BvZezOsX.js} +2 -2
  158. package/dist/core/web/public/next/assets/{GrowthSection-D8e9m9Wy.js.map → GrowthSection-BvZezOsX.js.map} +1 -1
  159. package/dist/core/web/public/next/assets/{HandoffDialog-VfKxKhxF.js → HandoffDialog-B1G6gQyk.js} +2 -2
  160. package/dist/core/web/public/next/assets/{HandoffDialog-VfKxKhxF.js.map → HandoffDialog-B1G6gQyk.js.map} +1 -1
  161. package/dist/core/web/public/next/assets/{Input-u1YR_Ogl.js → Input-CI0yBHmn.js} +2 -2
  162. package/dist/core/web/public/next/assets/{Input-u1YR_Ogl.js.map → Input-CI0yBHmn.js.map} +1 -1
  163. package/dist/core/web/public/next/assets/{LeaderCard-BDELBrnx.js → LeaderCard-BxxiEg4e.js} +2 -2
  164. package/dist/core/web/public/next/assets/{LeaderCard-BDELBrnx.js.map → LeaderCard-BxxiEg4e.js.map} +1 -1
  165. package/dist/core/web/public/next/assets/{MatrixHeatmap-NKLF2srR.js → MatrixHeatmap-iPFEU2Tv.js} +2 -2
  166. package/dist/core/web/public/next/assets/{MatrixHeatmap-NKLF2srR.js.map → MatrixHeatmap-iPFEU2Tv.js.map} +1 -1
  167. package/dist/core/web/public/next/assets/McpSection-nuXer4K-.js +2 -0
  168. package/dist/core/web/public/next/assets/{McpSection-D1tDvlRa.js.map → McpSection-nuXer4K-.js.map} +1 -1
  169. package/dist/core/web/public/next/assets/{MessageMarkdown-DlfLEJxu.js → MessageMarkdown-BCe4TsXk.js} +3 -3
  170. package/dist/core/web/public/next/assets/{MessageMarkdown-DlfLEJxu.js.map → MessageMarkdown-BCe4TsXk.js.map} +1 -1
  171. package/dist/core/web/public/next/assets/{MessageMarkdownRenderer-BYZzI115.js → MessageMarkdownRenderer-DL3LU5kL.js} +2 -2
  172. package/dist/core/web/public/next/assets/{MessageMarkdownRenderer-BYZzI115.js.map → MessageMarkdownRenderer-DL3LU5kL.js.map} +1 -1
  173. package/dist/core/web/public/next/assets/{Meter-BSVhU43Q.js → Meter-b69LM0mU.js} +2 -2
  174. package/dist/core/web/public/next/assets/{Meter-BSVhU43Q.js.map → Meter-b69LM0mU.js.map} +1 -1
  175. package/dist/core/web/public/next/assets/{MindSection-lqV2e_Sq.js → MindSection-Dc5v5rH3.js} +2 -2
  176. package/dist/core/web/public/next/assets/{MindSection-lqV2e_Sq.js.map → MindSection-Dc5v5rH3.js.map} +1 -1
  177. package/dist/core/web/public/next/assets/{MutationTokenDialog-CLGP72g6.js → MutationTokenDialog-Bm34BNVV.js} +2 -2
  178. package/dist/core/web/public/next/assets/{MutationTokenDialog-CLGP72g6.js.map → MutationTokenDialog-Bm34BNVV.js.map} +1 -1
  179. package/dist/core/web/public/next/assets/NeedsYouDrawer-N1cWJjpz.js +3 -0
  180. package/dist/core/web/public/next/assets/NeedsYouDrawer-N1cWJjpz.js.map +1 -0
  181. package/dist/core/web/public/next/assets/NeedsYouList-CH6Mq-E_.css +1 -0
  182. package/dist/core/web/public/next/assets/NeedsYouList-D5Kk549g.js +2 -0
  183. package/dist/core/web/public/next/assets/{NeedsYouList-eBOlJr0b.js.map → NeedsYouList-D5Kk549g.js.map} +1 -1
  184. package/dist/core/web/public/next/assets/{NewChatDialog-DoYTH26M.js → NewChatDialog-BqFTWgHU.js} +2 -2
  185. package/dist/core/web/public/next/assets/{NewChatDialog-DoYTH26M.js.map → NewChatDialog-BqFTWgHU.js.map} +1 -1
  186. package/dist/core/web/public/next/assets/OnboardingFlow-DcDsguAM.js +3 -0
  187. package/dist/core/web/public/next/assets/OnboardingFlow-DcDsguAM.js.map +1 -0
  188. package/dist/core/web/public/next/assets/OnboardingGate-BZafM1Vf.js +3 -0
  189. package/dist/core/web/public/next/assets/{OnboardingGate-DrDEVBqw.js.map → OnboardingGate-BZafM1Vf.js.map} +1 -1
  190. package/dist/core/web/public/next/assets/{PreviewPane-ULN673zm.js → PreviewPane-zT3gK9TD.js} +2 -2
  191. package/dist/core/web/public/next/assets/{PreviewPane-ULN673zm.js.map → PreviewPane-zT3gK9TD.js.map} +1 -1
  192. package/dist/core/web/public/next/assets/{ProviderLogo-8WaUjTlN.js → ProviderLogo-AwHn2sKm.js} +2 -2
  193. package/dist/core/web/public/next/assets/{ProviderLogo-8WaUjTlN.js.map → ProviderLogo-AwHn2sKm.js.map} +1 -1
  194. package/dist/core/web/public/next/assets/{RailStatus-Ckw9nvYU.js → RailStatus-xHrovWvI.js} +2 -2
  195. package/dist/core/web/public/next/assets/{RailStatus-Ckw9nvYU.js.map → RailStatus-xHrovWvI.js.map} +1 -1
  196. package/dist/core/web/public/next/assets/{RefreshIndicator-DGubF4vR.js → RefreshIndicator-SEFZlMB2.js} +2 -2
  197. package/dist/core/web/public/next/assets/{RefreshIndicator-DGubF4vR.js.map → RefreshIndicator-SEFZlMB2.js.map} +1 -1
  198. package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-BahEaY4d.js → ResourcePoolConsoleApp-CAxPQ4sZ.js} +3 -3
  199. package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-BahEaY4d.js.map → ResourcePoolConsoleApp-CAxPQ4sZ.js.map} +1 -1
  200. package/dist/core/web/public/next/assets/ResourcesChrome-BnhnEdJe.js +3 -0
  201. package/dist/core/web/public/next/assets/{ResourcesChrome-C2ZrA7la.js.map → ResourcesChrome-BnhnEdJe.js.map} +1 -1
  202. package/dist/core/web/public/next/assets/{ResourcesDrawer-BC93fzwQ.js → ResourcesDrawer-BAFGodny.js} +2 -2
  203. package/dist/core/web/public/next/assets/{ResourcesDrawer-BC93fzwQ.js.map → ResourcesDrawer-BAFGodny.js.map} +1 -1
  204. package/dist/core/web/public/next/assets/{RouteErrorBoundary-BvhHNpE_.js → RouteErrorBoundary-C8WGiixc.js} +2 -2
  205. package/dist/core/web/public/next/assets/{RouteErrorBoundary-BvhHNpE_.js.map → RouteErrorBoundary-C8WGiixc.js.map} +1 -1
  206. package/dist/core/web/public/next/assets/{RunInCloudAction-Dywfnw0C.js → RunInCloudAction-1-IPLYhf.js} +2 -2
  207. package/dist/core/web/public/next/assets/{RunInCloudAction-Dywfnw0C.js.map → RunInCloudAction-1-IPLYhf.js.map} +1 -1
  208. package/dist/core/web/public/next/assets/{SeatSelector-CH7hTgwy.js → SeatSelector-DpwNiX8F.js} +2 -2
  209. package/dist/core/web/public/next/assets/{SeatSelector-CH7hTgwy.js.map → SeatSelector-DpwNiX8F.js.map} +1 -1
  210. package/dist/core/web/public/next/assets/{Segmented-Wynbg0F5.js → Segmented-Wt1ATod9.js} +2 -2
  211. package/dist/core/web/public/next/assets/{Segmented-Wynbg0F5.js.map → Segmented-Wt1ATod9.js.map} +1 -1
  212. package/dist/core/web/public/next/assets/{Select-DMyLCkId.js → Select-By-V9lMc.js} +2 -2
  213. package/dist/core/web/public/next/assets/{Select-DMyLCkId.js.map → Select-By-V9lMc.js.map} +1 -1
  214. package/dist/core/web/public/next/assets/{SessionGate-8RtQFWeZ.js → SessionGate-WROS02tK.js} +2 -2
  215. package/dist/core/web/public/next/assets/{SessionGate-8RtQFWeZ.js.map → SessionGate-WROS02tK.js.map} +1 -1
  216. package/dist/core/web/public/next/assets/{SessionInsightChip-zBJbKv2L.js → SessionInsightChip-DNUcruwp.js} +2 -2
  217. package/dist/core/web/public/next/assets/{SessionInsightChip-zBJbKv2L.js.map → SessionInsightChip-DNUcruwp.js.map} +1 -1
  218. package/dist/core/web/public/next/assets/{SessionSearch-DfJIcxxM.js → SessionSearch-UHtt7a8f.js} +2 -2
  219. package/dist/core/web/public/next/assets/{SessionSearch-DfJIcxxM.js.map → SessionSearch-UHtt7a8f.js.map} +1 -1
  220. package/dist/core/web/public/next/assets/{SettingsSection-Da9RYyH5.js → SettingsSection-Bf74l0Gj.js} +2 -2
  221. package/dist/core/web/public/next/assets/{SettingsSection-Da9RYyH5.js.map → SettingsSection-Bf74l0Gj.js.map} +1 -1
  222. package/dist/core/web/public/next/assets/SetupChecklist-BhZpFLsj.css +1 -0
  223. package/dist/core/web/public/next/assets/SetupChecklist-CzpEcfOl.js +2 -0
  224. package/dist/core/web/public/next/assets/SetupChecklist-CzpEcfOl.js.map +1 -0
  225. package/dist/core/web/public/next/assets/{Sheet-DhXyIDmq.js → Sheet-HkBOBMTT.js} +2 -2
  226. package/dist/core/web/public/next/assets/{Sheet-DhXyIDmq.js.map → Sheet-HkBOBMTT.js.map} +1 -1
  227. package/dist/core/web/public/next/assets/{ShortcutsOverlay-Bi5f-wUw.js → ShortcutsOverlay-DiigiT8H.js} +2 -2
  228. package/dist/core/web/public/next/assets/{ShortcutsOverlay-Bi5f-wUw.js.map → ShortcutsOverlay-DiigiT8H.js.map} +1 -1
  229. package/dist/core/web/public/next/assets/Sidebar-C9YtBYVZ.js +3 -0
  230. package/dist/core/web/public/next/assets/Sidebar-C9YtBYVZ.js.map +1 -0
  231. package/dist/core/web/public/next/assets/{Slider-Bd9YFWEV.js → Slider-DaEDws-b.js} +2 -2
  232. package/dist/core/web/public/next/assets/{Slider-Bd9YFWEV.js.map → Slider-DaEDws-b.js.map} +1 -1
  233. package/dist/core/web/public/next/assets/{StatTile-DScTd3c-.js → StatTile-CTX41O6y.js} +2 -2
  234. package/dist/core/web/public/next/assets/{StatTile-DScTd3c-.js.map → StatTile-CTX41O6y.js.map} +1 -1
  235. package/dist/core/web/public/next/assets/{StatusBadge-DQ1UtQAJ.js → StatusBadge-CXG3iNL4.js} +2 -2
  236. package/dist/core/web/public/next/assets/{StatusBadge-DQ1UtQAJ.js.map → StatusBadge-CXG3iNL4.js.map} +1 -1
  237. package/dist/core/web/public/next/assets/{StepBand-BB3IJxhr.js → StepBand-jJTqYIdX.js} +2 -2
  238. package/dist/core/web/public/next/assets/{StepBand-BB3IJxhr.js.map → StepBand-jJTqYIdX.js.map} +1 -1
  239. package/dist/core/web/public/next/assets/{Surface-DWMtQe3Q.js → Surface-5bNA08tK.js} +2 -2
  240. package/dist/core/web/public/next/assets/{Surface-DWMtQe3Q.js.map → Surface-5bNA08tK.js.map} +1 -1
  241. package/dist/core/web/public/next/assets/{Swimlane-DcENqtdp.js → Swimlane-LrslsGxw.js} +2 -2
  242. package/dist/core/web/public/next/assets/{Swimlane-DcENqtdp.js.map → Swimlane-LrslsGxw.js.map} +1 -1
  243. package/dist/core/web/public/next/assets/{Switch-CenChEYf.js → Switch-BmCzfFnu.js} +2 -2
  244. package/dist/core/web/public/next/assets/{Switch-CenChEYf.js.map → Switch-BmCzfFnu.js.map} +1 -1
  245. package/dist/core/web/public/next/assets/{Tag-D4k5E3u0.js → Tag-WSUIaMVy.js} +2 -2
  246. package/dist/core/web/public/next/assets/{Tag-D4k5E3u0.js.map → Tag-WSUIaMVy.js.map} +1 -1
  247. package/dist/core/web/public/next/assets/{TerminalPane-DCQTukcE.js → TerminalPane-BVFgYX6K.js} +5 -5
  248. package/dist/core/web/public/next/assets/{TerminalPane-DCQTukcE.js.map → TerminalPane-BVFgYX6K.js.map} +1 -1
  249. package/dist/core/web/public/next/assets/{UniverseConsoleApp-DsuWT0pi.js → UniverseConsoleApp-BpphLqoz.js} +2 -2
  250. package/dist/core/web/public/next/assets/{UniverseConsoleApp-DsuWT0pi.js.map → UniverseConsoleApp-BpphLqoz.js.map} +1 -1
  251. package/dist/core/web/public/next/assets/{UniverseView-DyI5ApsA.js → UniverseView-DbpbSMwO.js} +4 -4
  252. package/dist/core/web/public/next/assets/{UniverseView-DyI5ApsA.js.map → UniverseView-DbpbSMwO.js.map} +1 -1
  253. package/dist/core/web/public/next/assets/{UsageSection-Imr28nwK.js → UsageSection-CUlaKtws.js} +3 -3
  254. package/dist/core/web/public/next/assets/{UsageSection-Imr28nwK.js.map → UsageSection-CUlaKtws.js.map} +1 -1
  255. package/dist/core/web/public/next/assets/VerseConsoleApp-DXDv1aOi.js +3 -0
  256. package/dist/core/web/public/next/assets/VerseConsoleApp-DXDv1aOi.js.map +1 -0
  257. package/dist/core/web/public/next/assets/{Workspace-CpxBO98E.js → Workspace-RXy0pqp6.js} +5 -5
  258. package/dist/core/web/public/next/assets/{Workspace-CpxBO98E.js.map → Workspace-RXy0pqp6.js.map} +1 -1
  259. package/dist/core/web/public/next/assets/{actions-DE8NoWV_.js → actions-BZTidCXZ.js} +2 -2
  260. package/dist/core/web/public/next/assets/{actions-DE8NoWV_.js.map → actions-BZTidCXZ.js.map} +1 -1
  261. package/dist/core/web/public/next/assets/{apps-model-CFGCUu9p.js → apps-model-CHO133qt.js} +2 -2
  262. package/dist/core/web/public/next/assets/{apps-model-CFGCUu9p.js.map → apps-model-CHO133qt.js.map} +1 -1
  263. package/dist/core/web/public/next/assets/{authority-model-CmnfJzmM.js → authority-model-8NeAEwAF.js} +2 -2
  264. package/dist/core/web/public/next/assets/{authority-model-CmnfJzmM.js.map → authority-model-8NeAEwAF.js.map} +1 -1
  265. package/dist/core/web/public/next/assets/{budget-queries-DjrPRFwl.js → budget-queries-DFF-3ICg.js} +2 -2
  266. package/dist/core/web/public/next/assets/{budget-queries-DjrPRFwl.js.map → budget-queries-DFF-3ICg.js.map} +1 -1
  267. package/dist/core/web/public/next/assets/{capacity-strip-model-C7cdQnuK.js → capacity-strip-model-5ViUgUlP.js} +2 -2
  268. package/dist/core/web/public/next/assets/{capacity-strip-model-C7cdQnuK.js.map → capacity-strip-model-5ViUgUlP.js.map} +1 -1
  269. package/dist/core/web/public/next/assets/{charts-DUD_jprE.js → charts-CzxWrZn7.js} +2 -2
  270. package/dist/core/web/public/next/assets/{charts-DUD_jprE.js.map → charts-CzxWrZn7.js.map} +1 -1
  271. package/dist/core/web/public/next/assets/cloud-model-CfRydq8N.js +2 -0
  272. package/dist/core/web/public/next/assets/{cloud-model-DoxBMDvx.js.map → cloud-model-CfRydq8N.js.map} +1 -1
  273. package/dist/core/web/public/next/assets/{cloud-queries-CTGvO-k-.js → cloud-queries-DmptbjS8.js} +2 -2
  274. package/dist/core/web/public/next/assets/{cloud-queries-CTGvO-k-.js.map → cloud-queries-DmptbjS8.js.map} +1 -1
  275. package/dist/core/web/public/next/assets/{command-catalog-CmrHNFzh.js → command-catalog-ffCAijVY.js} +2 -2
  276. package/dist/core/web/public/next/assets/{command-catalog-CmrHNFzh.js.map → command-catalog-ffCAijVY.js.map} +1 -1
  277. package/dist/core/web/public/next/assets/{context-model-2Owp2jYF.js → context-model-Bb15chFt.js} +2 -2
  278. package/dist/core/web/public/next/assets/{context-model-2Owp2jYF.js.map → context-model-Bb15chFt.js.map} +1 -1
  279. package/dist/core/web/public/next/assets/{context-model-9xywbXxX.js → context-model-CDeyP0cA.js} +2 -2
  280. package/dist/core/web/public/next/assets/{context-model-9xywbXxX.js.map → context-model-CDeyP0cA.js.map} +1 -1
  281. package/dist/core/web/public/next/assets/{context-queries-wvcRnV-I.js → context-queries-_9bFWb9v.js} +2 -2
  282. package/dist/core/web/public/next/assets/{context-queries-wvcRnV-I.js.map → context-queries-_9bFWb9v.js.map} +1 -1
  283. package/dist/core/web/public/next/assets/{control-queries-DB6Kh7UN.js → control-queries-CXtmZZH6.js} +2 -2
  284. package/dist/core/web/public/next/assets/{control-queries-DB6Kh7UN.js.map → control-queries-CXtmZZH6.js.map} +1 -1
  285. package/dist/core/web/public/next/assets/copy-setup-BIp0iaiZ.js +2 -0
  286. package/dist/core/web/public/next/assets/copy-setup-BIp0iaiZ.js.map +1 -0
  287. package/dist/core/web/public/next/assets/{dock-icons-BBUGl4tE.js → dock-icons-Cc43W7r4.js} +2 -2
  288. package/dist/core/web/public/next/assets/{dock-icons-BBUGl4tE.js.map → dock-icons-Cc43W7r4.js.map} +1 -1
  289. package/dist/core/web/public/next/assets/{fleet-model-BRfRWkZl.js → fleet-model-DOK8ZtEt.js} +2 -2
  290. package/dist/core/web/public/next/assets/{fleet-model-BRfRWkZl.js.map → fleet-model-DOK8ZtEt.js.map} +1 -1
  291. package/dist/core/web/public/next/assets/{fleet-queries-tU6UEXN2.js → fleet-queries-BeEAqD6y.js} +2 -2
  292. package/dist/core/web/public/next/assets/{fleet-queries-tU6UEXN2.js.map → fleet-queries-BeEAqD6y.js.map} +1 -1
  293. package/dist/core/web/public/next/assets/{focus-trap-BGOceFvj.js → focus-trap-ChZ5EFfM.js} +2 -2
  294. package/dist/core/web/public/next/assets/{focus-trap-BGOceFvj.js.map → focus-trap-ChZ5EFfM.js.map} +1 -1
  295. package/dist/core/web/public/next/assets/format-BmH2yWL6.js +2 -0
  296. package/dist/core/web/public/next/assets/format-BmH2yWL6.js.map +1 -0
  297. package/dist/core/web/public/next/assets/{git-model-53iRLInY.js → git-model-BFwAVbxF.js} +2 -2
  298. package/dist/core/web/public/next/assets/{git-model-53iRLInY.js.map → git-model-BFwAVbxF.js.map} +1 -1
  299. package/dist/core/web/public/next/assets/global-y_exIyAP.js +2 -0
  300. package/dist/core/web/public/next/assets/{global-CXHHMz9o.js.map → global-y_exIyAP.js.map} +1 -1
  301. package/dist/core/web/public/next/assets/{guarded-runners-B8zFVBVZ.js → guarded-runners-Cd4POBtI.js} +2 -2
  302. package/dist/core/web/public/next/assets/{guarded-runners-B8zFVBVZ.js.map → guarded-runners-Cd4POBtI.js.map} +1 -1
  303. package/dist/core/web/public/next/assets/{icons-D4s-jlxX.js → icons-CygCEFWs.js} +2 -2
  304. package/dist/core/web/public/next/assets/{icons-D4s-jlxX.js.map → icons-CygCEFWs.js.map} +1 -1
  305. package/dist/core/web/public/next/assets/{index-BG177cPN.js → index-CyK31YRm.js} +3 -3
  306. package/dist/core/web/public/next/assets/{index-BG177cPN.js.map → index-CyK31YRm.js.map} +1 -1
  307. package/dist/core/web/public/next/assets/{live-model-CEf01wrW.js → live-model-D7hilYFk.js} +2 -2
  308. package/dist/core/web/public/next/assets/live-model-D7hilYFk.js.map +1 -0
  309. package/dist/core/web/public/next/assets/{mind.module-D_xk6HIQ.js → mind.module-B15k0Y9q.js} +2 -2
  310. package/dist/core/web/public/next/assets/{mind.module-D_xk6HIQ.js.map → mind.module-B15k0Y9q.js.map} +1 -1
  311. package/dist/core/web/public/next/assets/mutations-CWlxEMEm.js +2 -0
  312. package/dist/core/web/public/next/assets/{mutations-CbTSofVH.js.map → mutations-CWlxEMEm.js.map} +1 -1
  313. package/dist/core/web/public/next/assets/{nav-CmZcbPFJ.js → nav-mimleI0R.js} +2 -2
  314. package/dist/core/web/public/next/assets/{nav-CmZcbPFJ.js.map → nav-mimleI0R.js.map} +1 -1
  315. package/dist/core/web/public/next/assets/{overnight-queries-CR0b_j-V.js → overnight-queries-DJ4mZKSj.js} +2 -2
  316. package/dist/core/web/public/next/assets/{overnight-queries-CR0b_j-V.js.map → overnight-queries-DJ4mZKSj.js.map} +1 -1
  317. package/dist/core/web/public/next/assets/primitives-DMijqcu0.js +1 -0
  318. package/dist/core/web/public/next/assets/{queries-rvRsAGW2.js → queries-Bw1McHTj.js} +2 -2
  319. package/dist/core/web/public/next/assets/{queries-rvRsAGW2.js.map → queries-Bw1McHTj.js.map} +1 -1
  320. package/dist/core/web/public/next/assets/{reasoning-pref-DMPQkujg.js → reasoning-pref-KkhI_5-j.js} +2 -2
  321. package/dist/core/web/public/next/assets/{reasoning-pref-DMPQkujg.js.map → reasoning-pref-KkhI_5-j.js.map} +1 -1
  322. package/dist/core/web/public/next/assets/{reveal-anchor-BKk2wZZZ.js → reveal-anchor-CCCx_kfT.js} +2 -2
  323. package/dist/core/web/public/next/assets/{reveal-anchor-BKk2wZZZ.js.map → reveal-anchor-CCCx_kfT.js.map} +1 -1
  324. package/dist/core/web/public/next/assets/{seat-subscription-CLn2ReSZ.js → seat-subscription-BhUUz7VL.js} +2 -2
  325. package/dist/core/web/public/next/assets/{seat-subscription-CLn2ReSZ.js.map → seat-subscription-BhUUz7VL.js.map} +1 -1
  326. package/dist/core/web/public/next/assets/{sidebar-model-CjQLvdag.js → sidebar-model-Dcd437cf.js} +2 -2
  327. package/dist/core/web/public/next/assets/{sidebar-model-CjQLvdag.js.map → sidebar-model-Dcd437cf.js.map} +1 -1
  328. package/dist/core/web/public/next/assets/{slots-DRxNosZg.js → slots-BL_J5mmV.js} +3 -3
  329. package/dist/core/web/public/next/assets/{slots-DRxNosZg.js.map → slots-BL_J5mmV.js.map} +1 -1
  330. package/dist/core/web/public/next/assets/{surface-data-DshUC_TU.js → surface-data-C3UAQ4QX.js} +2 -2
  331. package/dist/core/web/public/next/assets/{surface-data-DshUC_TU.js.map → surface-data-C3UAQ4QX.js.map} +1 -1
  332. package/dist/core/web/public/next/assets/surface-prefetch-BXKjPsV5.js +2 -0
  333. package/dist/core/web/public/next/assets/{surface-prefetch-DO8r4ttQ.js.map → surface-prefetch-BXKjPsV5.js.map} +1 -1
  334. package/dist/core/web/public/next/assets/{tasks-model-BKPFZAmZ.js → tasks-model-CzHvclVm.js} +2 -2
  335. package/dist/core/web/public/next/assets/{tasks-model-BKPFZAmZ.js.map → tasks-model-CzHvclVm.js.map} +1 -1
  336. package/dist/core/web/public/next/assets/{terminal-icons-DoeQkP3y.js → terminal-icons-BwgQTQP0.js} +2 -2
  337. package/dist/core/web/public/next/assets/{terminal-icons-DoeQkP3y.js.map → terminal-icons-BwgQTQP0.js.map} +1 -1
  338. package/dist/core/web/public/next/assets/types-IYKrYLku.js +2 -0
  339. package/dist/core/web/public/next/assets/types-IYKrYLku.js.map +1 -0
  340. package/dist/core/web/public/next/assets/{usage-queries-MnUeYzwp.js → usage-queries-pXxvy54x.js} +2 -2
  341. package/dist/core/web/public/next/assets/{usage-queries-MnUeYzwp.js.map → usage-queries-pXxvy54x.js.map} +1 -1
  342. package/dist/core/web/public/next/assets/{use-guarded-action-P12MfNwU.js → use-guarded-action-EgVWjM5c.js} +2 -2
  343. package/dist/core/web/public/next/assets/{use-guarded-action-P12MfNwU.js.map → use-guarded-action-EgVWjM5c.js.map} +1 -1
  344. package/dist/core/web/public/next/assets/{use-ticker-DIvAZ4Ey.js → use-ticker-BoqFxRFG.js} +2 -2
  345. package/dist/core/web/public/next/assets/{use-ticker-DIvAZ4Ey.js.map → use-ticker-BoqFxRFG.js.map} +1 -1
  346. package/dist/core/web/public/next/assets/{use-token-gate-DfEja7Wr.js → use-token-gate-DSNIIpI6.js} +2 -2
  347. package/dist/core/web/public/next/assets/{use-token-gate-DfEja7Wr.js.map → use-token-gate-DSNIIpI6.js.map} +1 -1
  348. package/dist/core/web/public/next/assets/{useOnboarding-CkOHadqC.js → useOnboarding-Bk0VnkxQ.js} +2 -2
  349. package/dist/core/web/public/next/assets/{useOnboarding-CkOHadqC.js.map → useOnboarding-Bk0VnkxQ.js.map} +1 -1
  350. package/dist/core/web/public/next/assets/{useSeatsRefresh-BDlbDlIU.js → useSeatsRefresh-q7Id9RcW.js} +2 -2
  351. package/dist/core/web/public/next/assets/{useSeatsRefresh-BDlbDlIU.js.map → useSeatsRefresh-q7Id9RcW.js.map} +1 -1
  352. package/dist/core/web/public/next/assets/{useVerseTranscript-BGtA55k2.js → useVerseTranscript-CqH51rt9.js} +2 -2
  353. package/dist/core/web/public/next/assets/{useVerseTranscript-BGtA55k2.js.map → useVerseTranscript-CqH51rt9.js.map} +1 -1
  354. package/dist/core/web/public/next/assets/{verse-icons-wOet9JZy.js → verse-icons-DsG1dOQx.js} +2 -2
  355. package/dist/core/web/public/next/assets/{verse-icons-wOet9JZy.js.map → verse-icons-DsG1dOQx.js.map} +1 -1
  356. package/dist/core/web/public/next/assets/{verse-model-CSzzdyu2.js → verse-model-JTuvRBVK.js} +2 -2
  357. package/dist/core/web/public/next/assets/{verse-model-CSzzdyu2.js.map → verse-model-JTuvRBVK.js.map} +1 -1
  358. package/dist/core/web/public/next/assets/{warmup-CecO_Nk0.js → warmup-Bv1RumVq.js} +3 -3
  359. package/dist/core/web/public/next/assets/{warmup-CecO_Nk0.js.map → warmup-Bv1RumVq.js.map} +1 -1
  360. package/dist/core/web/public/next/assets/why-seat-model-Cau8qG6O.js +2 -0
  361. package/dist/core/web/public/next/assets/why-seat-model-Cau8qG6O.js.map +1 -0
  362. package/dist/core/web/public/next/assets/{workspace-model-BdIVybKr.js → workspace-model-D-SLfads.js} +2 -2
  363. package/dist/core/web/public/next/assets/{workspace-model-BdIVybKr.js.map → workspace-model-D-SLfads.js.map} +1 -1
  364. package/dist/core/web/public/next/index.html +1 -1
  365. package/dist/release-dependency-inventory.json +1 -1
  366. package/docs/AUTONOMY-GAP.md +1 -1
  367. package/package.json +1 -1
  368. package/dist/core/web/public/next/assets/Advanced-CxzE6ekM.js +0 -2
  369. package/dist/core/web/public/next/assets/App-DFlp-vdv.js +0 -7
  370. package/dist/core/web/public/next/assets/AppsSection-Ct2O605-.js +0 -2
  371. package/dist/core/web/public/next/assets/AutonomyOffState-CXhXpsim.js +0 -2
  372. package/dist/core/web/public/next/assets/AutonomyOffState-CXhXpsim.js.map +0 -1
  373. package/dist/core/web/public/next/assets/AutonomyOffState-DmbE71vI.css +0 -1
  374. package/dist/core/web/public/next/assets/AutonomySection-BTg7yVa1.js +0 -2
  375. package/dist/core/web/public/next/assets/BudgetControl-ng6swoZp.js +0 -2
  376. package/dist/core/web/public/next/assets/BudgetControl-ng6swoZp.js.map +0 -1
  377. package/dist/core/web/public/next/assets/ChatSection-Bisj9R6E.js +0 -3
  378. package/dist/core/web/public/next/assets/ChatSection-Bisj9R6E.js.map +0 -1
  379. package/dist/core/web/public/next/assets/CommandSection-D8ZihzvE.js +0 -2
  380. package/dist/core/web/public/next/assets/CommandSection-D8ZihzvE.js.map +0 -1
  381. package/dist/core/web/public/next/assets/DockHost-BPqyhtCP.js +0 -2
  382. package/dist/core/web/public/next/assets/McpSection-D1tDvlRa.js +0 -2
  383. package/dist/core/web/public/next/assets/NeedsYouDrawer-D992XTOn.js +0 -2
  384. package/dist/core/web/public/next/assets/NeedsYouDrawer-D992XTOn.js.map +0 -1
  385. package/dist/core/web/public/next/assets/NeedsYouList-CruOt4JT.css +0 -1
  386. package/dist/core/web/public/next/assets/NeedsYouList-eBOlJr0b.js +0 -2
  387. package/dist/core/web/public/next/assets/OnboardingFlow-D3yfITK1.js +0 -2
  388. package/dist/core/web/public/next/assets/OnboardingFlow-D3yfITK1.js.map +0 -1
  389. package/dist/core/web/public/next/assets/OnboardingGate-DrDEVBqw.js +0 -3
  390. package/dist/core/web/public/next/assets/ResourcesChrome-C2ZrA7la.js +0 -3
  391. package/dist/core/web/public/next/assets/Sidebar-BuO3sViG.js +0 -3
  392. package/dist/core/web/public/next/assets/Sidebar-BuO3sViG.js.map +0 -1
  393. package/dist/core/web/public/next/assets/VerseConsoleApp-DeuBEvAO.js +0 -3
  394. package/dist/core/web/public/next/assets/VerseConsoleApp-DeuBEvAO.js.map +0 -1
  395. package/dist/core/web/public/next/assets/cloud-model-DoxBMDvx.js +0 -2
  396. package/dist/core/web/public/next/assets/copy-setup-CJQhFl-4.js +0 -2
  397. package/dist/core/web/public/next/assets/copy-setup-CJQhFl-4.js.map +0 -1
  398. package/dist/core/web/public/next/assets/format-DEAaVF6X.js +0 -2
  399. package/dist/core/web/public/next/assets/format-DEAaVF6X.js.map +0 -1
  400. package/dist/core/web/public/next/assets/global-CXHHMz9o.js +0 -2
  401. package/dist/core/web/public/next/assets/live-model-CEf01wrW.js.map +0 -1
  402. package/dist/core/web/public/next/assets/mutations-CbTSofVH.js +0 -2
  403. package/dist/core/web/public/next/assets/primitives-DNI-uJBd.js +0 -1
  404. package/dist/core/web/public/next/assets/surface-prefetch-DO8r4ttQ.js +0 -2
  405. package/dist/core/web/public/next/assets/types-D5XOdyw8.js +0 -2
  406. package/dist/core/web/public/next/assets/types-D5XOdyw8.js.map +0 -1
  407. package/dist/core/web/public/next/assets/why-seat-model-D68ZA7G8.js +0 -2
  408. package/dist/core/web/public/next/assets/why-seat-model-D68ZA7G8.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"AreaTrend-o-GLl2Is.js","names":[],"sources":["../../../../../../src/web-ui/components/charts/AreaTrend.tsx"],"sourcesContent":["/**\n * components/charts/AreaTrend.tsx — change over time for 1–4 series, as lines\n * over a 10% wash (overlaid) or as a stacked composition (`stacked`).\n *\n * Honesty: a `null` y is a GAP — the line and wash break there, and in stacked\n * mode an unknown in any layer breaks the whole stack at that x (the total is\n * unknown), never a silent zero. One y-axis only; a threshold is a labelled\n * reference line, not a second scale.\n *\n * Interaction: crosshair + tooltip on hover; the plot is focusable and the\n * arrow keys (Home/End) walk the same crosshair, announced through a live\n * region. The Table view carries every value without hovering.\n */\nimport { useId, useMemo, useRef, useState, type KeyboardEvent, type PointerEvent } from 'react';\nimport type { Series } from './types.js';\nimport { seriesColor } from './colors.js';\nimport { ChartFrame, type ChartStatus } from './ChartFrame.js';\nimport { ChartLegend, ChartTooltip, clampTooltipLeft } from './ChartParts.js';\nimport { TableView, type TableColumn } from './TableView.js';\nimport {\n MIN_TIME_SPAN_MS,\n allIntegers,\n areaPath,\n axisTicks,\n dodgeLabels,\n ensureSpan,\n isTimeAxis,\n labelCharPx,\n layoutAxisLabels,\n linePath,\n linearScale,\n percentScale,\n splitRuns,\n thinIndexes,\n tickGutter,\n xKeeper,\n type XY,\n} from './chart-math.js';\nimport { formatCompact, formatTimeLabel, timeLabelLadder } from './format.js';\nimport { useChartWidth } from './useChartWidth.js';\nimport { useTextScale } from './useTextScale.js';\nimport plot from './plot.module.css';\n\nexport interface AreaTrendSeries extends Series {\n /** Override the identity colour (defaults to the fixed categorical slot by index). */\n color?: string;\n}\n\nexport interface AreaTrendProps {\n title: string;\n description?: string;\n caveat?: string;\n status?: ChartStatus;\n series: AreaTrendSeries[];\n stacked?: boolean;\n /** Plot height in px, including the x-axis band. */\n height?: number;\n /** Fixed width (tests, print). Omit to fill the container. */\n width?: number;\n formatX?: (x: number) => string;\n formatY?: (y: number) => string;\n /** A labelled horizontal reference (a cap, a target). */\n threshold?: { value: number; label: string };\n /**\n * The y range to draw (widened, never clipped, if a value falls outside).\n * Default: a percent formatter (`formatY(50)` → \"50%\") gets 0–100 — or 0–1\n * for a fraction formatter — so percent cards share one scale; anything\n * else fits its data.\n */\n yDomain?: readonly [number, number];\n /** Accessible summary override. */\n ariaLabel?: string;\n}\n\nconst PAD_T = 12;\nconst PAD_B = 26;\nconst PAD_R = 12;\n/* End-label estimates are for 12 px text and are multiplied by the Display\n size (useTextScale) where they are used. END_LABEL_MAX is a budget of plot\n width, not a text measure, so it stays in px: at a larger size a long name\n falls back to the legend sooner rather than squeezing the plot. */\nconst END_LABEL_CH = 6.6;\nconst END_LABEL_MAX = 120;\n/** Line height of a direct end label at 12 px: two closer than this overlap. */\nconst END_LABEL_GAP_Y = 14;\n\ninterface Row {\n x: number;\n values: (number | null)[];\n total: number | null;\n}\n\nexport function AreaTrend({\n title,\n description,\n caveat,\n status,\n series,\n stacked = false,\n height = 200,\n width: fixedWidth,\n formatX: formatXProp,\n formatY: formatYProp,\n threshold,\n yDomain,\n ariaLabel,\n}: AreaTrendProps) {\n const formatX = formatXProp ?? formatTimeLabel;\n const formatY = formatYProp ?? formatCompact;\n const wrapRef = useRef<HTMLDivElement>(null);\n const width = useChartWidth(wrapRef, fixedWidth);\n const textScale = useTextScale();\n const [active, setActive] = useState<number | null>(null);\n const liveId = useId();\n\n const colors = series.map((s, i) => s.color ?? seriesColor(i));\n\n const rows: Row[] = useMemo(() => {\n // On a time axis a 0 / NaN / pre-2000 x is a null timestamp that leaked\n // through, not a moment — it would start the axis at \"Dec 31\" 1969.\n const all = series.flatMap((s) => s.points.map((p) => p.x));\n const keep = xKeeper(all);\n const xs = Array.from(new Set(all.filter(keep))).sort((a, b) => a - b);\n const lookup = series.map((s) => new Map(s.points.map((p) => [p.x, p.y])));\n return xs.map((x) => {\n const values = lookup.map((m) => (m.has(x) ? m.get(x)! : null));\n const total = values.some((v) => v === null) ? null : values.reduce<number>((a, v) => a + (v ?? 0), 0);\n return { x, values, total };\n });\n }, [series]);\n\n const hasData = rows.some((r) => r.values.some((v) => v !== null));\n const resolvedStatus: ChartStatus = status ?? (hasData ? { kind: 'ready' } : { kind: 'empty' });\n\n // ── scales ─────────────────────────────────────────────────────────────\n const known = stacked\n ? rows.map((r) => r.total).filter((v): v is number => v !== null)\n : rows.flatMap((r) => r.values).filter((v): v is number => v !== null);\n const pctScale = formatYProp ? percentScale(formatYProp) : null;\n const inDomain = (d: readonly [number, number]) => known.every((v) => v >= d[0] && v <= d[1]);\n const baseDomain: readonly [number, number] | null = yDomain ?? (pctScale !== null && inDomain([0, pctScale]) ? [0, pctScale] : null);\n const yAxis = axisTicks(\n Math.min(0, baseDomain?.[0] ?? 0, ...known),\n Math.max(0, baseDomain?.[1] ?? 0, ...known, threshold?.value ?? 0),\n { count: 4, integer: known.length > 0 && allIntegers(known), format: formatYProp },\n );\n const ticksY = yAxis.ticks;\n const yMin = ticksY[0]!;\n const yMax = ticksY[ticksY.length - 1]!;\n const padL = tickGutter(yAxis.labels, 28, 64, textScale);\n const plotH = height - PAD_T - PAD_B;\n const ys = linearScale(yMin, yMax, PAD_T + plotH, PAD_T);\n\n // Direct end labels (series names at each line's last point), dodged so\n // two lines ending on the same value (\"Struggles\" and \"Wins\" both at 3)\n // never print over each other. If they cannot all fit, the legend alone\n // names the series. Decided before the x scale: the gutter they need is\n // what plotW is measured against.\n const endLabelW = !stacked && series.length <= 4\n ? Math.max(0, ...series.map((s) => s.label.length)) * END_LABEL_CH * textScale + 6\n : 0;\n const endPoints = series.flatMap((s, si) => {\n for (let r = rows.length - 1; r >= 0; r--) {\n const v = rows[r]!.values[si];\n if (v !== null && v !== undefined) return [{ key: s.id, y: ys(v) }];\n }\n return [];\n });\n const dodged = endLabelW > 0 && endLabelW <= END_LABEL_MAX && width >= 420\n ? dodgeLabels(endPoints, END_LABEL_GAP_Y * textScale, PAD_T, PAD_T + plotH)\n : null;\n const showEndLabels = dodged !== null && endPoints.length > 0;\n const padR = PAD_R + (showEndLabels ? endLabelW : 0);\n const plotW = Math.max(40, width - padL - padR);\n\n const rawMin = rows.length ? rows[0]!.x : 0;\n const rawMax = rows.length ? rows[rows.length - 1]!.x : 1;\n const timeAxis = isTimeAxis(rows.map((r) => r.x));\n // A burst of readings seconds apart is widened to MIN_TIME_SPAN_MS around\n // itself, not stretched edge to edge (a lone point stays centred as before).\n const [xMin, xMax] = timeAxis && rawMax > rawMin ? ensureSpan(rawMin, rawMax, MIN_TIME_SPAN_MS) : [rawMin, rawMax];\n const xs = linearScale(xMin, xMax, padL, padL + plotW);\n\n // ── geometry ───────────────────────────────────────────────────────────\n // Recomputed per render on purpose: the scales depend on the measured width.\n const layers = (() => {\n if (stacked) {\n const acc = rows.map(() => 0);\n return series.map((_, si) => {\n const top = rows.map((r, ri) => {\n if (r.total === null) return { x: r.x, y: null as number | null, base: null as number | null };\n const base = acc[ri]!;\n acc[ri] = base + (r.values[si] ?? 0);\n return { x: r.x, y: acc[ri]!, base };\n });\n const runs = splitRuns(top.map((p) => ({ x: p.x, y: p.y })));\n return runs.map((run) => {\n const topPx: XY[] = run.map((p) => ({ x: xs(p.x), y: ys(p.y) }));\n const bottomPx: XY[] = run.map((p) => {\n const src = top.find((t) => t.x === p.x)!;\n return { x: xs(p.x), y: ys(src.base ?? 0) };\n });\n return { top: topPx, bottom: bottomPx };\n });\n });\n }\n return series.map((_, si) => {\n const runs = splitRuns(rows.map((r) => ({ x: r.x, y: r.values[si] ?? null })));\n return runs.map((run) => {\n const topPx = run.map((p) => ({ x: xs(p.x), y: ys(p.y) }));\n const bottomPx = run.map((p) => ({ x: xs(p.x), y: ys(Math.max(yMin, 0)) }));\n return { top: topPx, bottom: bottomPx };\n });\n });\n })();\n\n const xTickIdx = thinIndexes(rows.length, Math.max(2, Math.floor(plotW / 84)));\n // Collision-free x labels: the last point outranks the first, and both\n // outrank the interior ticks, which are simply dropped when they collide.\n // On a time axis the labels walk one shared detail ladder (caller's format\n // → shorter date/time; clock time only inside one day) until the ends fit.\n const ladder = timeAxis\n ? timeLabelLadder(rawMin, rawMax, formatXProp, xTickIdx.map((i) => rows[i]!.x))\n : [formatX];\n const xLabels = layoutAxisLabels(\n xTickIdx.map((i, n) => {\n const px = xs(rows[i]!.x);\n const isFirst = n === 0;\n const isLast = n === xTickIdx.length - 1;\n return {\n key: String(i),\n x: px,\n anchor: rows.length === 1 ? 'middle' as const : isFirst && px <= padL + 0.5 ? 'start' as const : isLast && px >= padL + plotW - 0.5 ? 'end' as const : 'middle' as const,\n priority: isLast ? 3 : isFirst ? 2 : 1,\n required: isFirst || isLast,\n variants: ladder.map((f) => f(rows[i]!.x)),\n };\n }),\n { min: padL, max: padL + plotW, charPx: labelCharPx(textScale) },\n );\n\n function indexAt(clientX: number): number | null {\n const el = wrapRef.current;\n if (!el || rows.length === 0) return null;\n const rect = el.getBoundingClientRect();\n const px = clientX - rect.left;\n let best = 0;\n let bestD = Infinity;\n rows.forEach((r, i) => {\n const d = Math.abs(xs(r.x) - px);\n if (d < bestD) { bestD = d; best = i; }\n });\n return best;\n }\n\n function onKey(e: KeyboardEvent<HTMLDivElement>): void {\n if (rows.length === 0) return;\n const cur = active ?? rows.length - 1;\n const next = e.key === 'ArrowLeft' ? cur - 1 : e.key === 'ArrowRight' ? cur + 1 : e.key === 'Home' ? 0 : e.key === 'End' ? rows.length - 1 : null;\n if (next === null) return;\n e.preventDefault();\n setActive(Math.max(0, Math.min(rows.length - 1, next)));\n }\n\n const activeRow = active !== null ? rows[active] : undefined;\n const latest = [...rows].reverse().find((r) => r.values.some((v) => v !== null));\n const summary = ariaLabel ?? (rows.length\n ? `${title}: ${rows.length} points from ${formatX(rawMin)} to ${formatX(rawMax)}.` +\n (latest ? ` Latest ${formatX(latest.x)}: ${series.map((s, i) => `${s.label} ${latest.values[i] === null ? 'no data' : formatY(latest.values[i]!)}`).join(', ')}.` : '')\n : `${title}: no data.`);\n\n const columns: TableColumn<Row>[] = [\n { key: 'x', label: 'When', render: (r) => formatX(r.x) },\n ...series.map((s, i) => ({\n key: s.id,\n label: s.label,\n numeric: true,\n render: (r: Row) => (r.values[i] === null ? '—' : formatY(r.values[i]!)),\n })),\n ...(stacked && series.length > 1\n ? [{ key: '__total', label: 'Total', numeric: true, render: (r: Row) => (r.total === null ? '—' : formatY(r.total)) }]\n : []),\n ];\n\n return (\n <ChartFrame\n title={title}\n description={description}\n caveat={caveat}\n status={resolvedStatus}\n table={<TableView caption={title} columns={columns} rows={rows} rowKey={(r) => String(r.x)} />}\n footer={\n <ChartLegend\n items={series.map((s, i) => ({ label: s.label, color: colors[i], kind: stacked ? 'swatch' : 'line' }))}\n />\n }\n >\n <div\n ref={wrapRef}\n className={`${plot.plotWrap} ${plot.focusable}`}\n tabIndex={0}\n role=\"group\"\n aria-label={`${title}. Use the left and right arrow keys to read values.`}\n aria-describedby={liveId}\n onFocus={() => setActive((a) => a ?? (rows.length ? rows.length - 1 : null))}\n onBlur={() => setActive(null)}\n onKeyDown={onKey}\n >\n <svg\n className={plot.svg}\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label={summary}\n onPointerMove={(e: PointerEvent<SVGSVGElement>) => setActive(indexAt(e.clientX))}\n onPointerLeave={() => setActive(null)}\n >\n {ticksY.map((t, i) => (\n <g key={t}>\n <line className={plot.grid} x1={padL} x2={padL + plotW} y1={ys(t)} y2={ys(t)} />\n <text className={plot.tick} x={padL - 6} y={ys(t)} dy=\"0.32em\" textAnchor=\"end\">{yAxis.labels[i]}</text>\n </g>\n ))}\n <line className={plot.axis} x1={padL} x2={padL + plotW} y1={ys(Math.max(yMin, 0))} y2={ys(Math.max(yMin, 0))} />\n {xLabels.map((l) => (\n <text key={l.key} data-axis-label={l.key} className={plot.tick} x={l.x} y={height - 8} textAnchor={l.anchor}>\n {l.text}\n </text>\n ))}\n\n {layers.map((runs, si) => (\n <g key={series[si]!.id} data-series={series[si]!.id}>\n {runs.map((run, ri) => (\n <path\n key={`a${ri}`}\n d={areaPath(run.top, run.bottom)}\n fill={colors[si]}\n className={stacked ? undefined : plot.wash}\n opacity={stacked ? 0.85 : undefined}\n stroke={stacked ? 'var(--chart-surface)' : undefined}\n strokeWidth={stacked ? 2 : undefined}\n />\n ))}\n {!stacked\n ? runs.map((run, ri) =>\n run.top.length === 1 ? (\n <circle key={`p${ri}`} cx={run.top[0]!.x} cy={run.top[0]!.y} r={3} fill={colors[si]} />\n ) : (\n <path key={`l${ri}`} d={linePath(run.top)} stroke={colors[si]} className={plot.line} />\n ),\n )\n : null}\n {showEndLabels && runs.length ? (() => {\n const last = runs[runs.length - 1]!.top;\n const end = last[last.length - 1]!;\n return (\n <text data-end-label={series[si]!.id} className={plot.label} x={end.x + 6} y={dodged!.get(series[si]!.id) ?? end.y} dy=\"0.32em\">{series[si]!.label}</text>\n );\n })() : null}\n </g>\n ))}\n\n {threshold ? (\n <g>\n <line className={plot.reference} x1={padL} x2={padL + plotW} y1={ys(threshold.value)} y2={ys(threshold.value)} />\n <text className={plot.tick} x={padL + plotW} y={ys(threshold.value) - 4} textAnchor=\"end\">\n {threshold.label} · {formatY(threshold.value)}\n </text>\n </g>\n ) : null}\n\n {activeRow ? (\n <g>\n <line className={plot.crosshair} x1={xs(activeRow.x)} x2={xs(activeRow.x)} y1={PAD_T} y2={PAD_T + plotH} />\n {series.map((s, si) => {\n const v = stacked\n ? (activeRow.total === null ? null : activeRow.values.slice(0, si + 1).reduce<number>((a, b) => a + (b ?? 0), 0))\n : activeRow.values[si];\n return v === null || v === undefined ? null : (\n <circle key={s.id} className={plot.marker} cx={xs(activeRow.x)} cy={ys(v)} r={4} fill={colors[si]} />\n );\n })}\n </g>\n ) : null}\n\n </svg>\n <span id={liveId} className={plot.srOnly} aria-live=\"polite\">\n {activeRow\n ? `${formatX(activeRow.x)}: ${series.map((s, i) => `${s.label} ${activeRow.values[i] === null ? 'no data' : formatY(activeRow.values[i]!)}`).join(', ')}`\n : ''}\n </span>\n {activeRow ? (\n <ChartTooltip\n left={clampTooltipLeft(xs(activeRow.x), width)}\n top={PAD_T}\n title={formatX(activeRow.x)}\n rows={[\n ...series.map((s, i) => ({\n key: s.id,\n label: s.label,\n value: activeRow.values[i] === null ? null : formatY(activeRow.values[i]!),\n color: colors[i],\n })),\n ...(stacked && series.length > 1\n ? [{ key: '__t', label: 'Total', value: activeRow.total === null ? null : formatY(activeRow.total) }]\n : []),\n ]}\n />\n ) : null}\n </div>\n </ChartFrame>\n );\n}\n"],"mappings":"wYA0EM,EAAQ,GACR,GAAQ,GACR,GAAQ,GAKR,GAAe,IACf,EA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rUaxm.js","names":[],"sources":["../../../../../../src/web-ui/components/charts/AreaTrend.tsx"],"sourcesContent":["/**\n * components/charts/AreaTrend.tsx — change over time for 1–4 series, as lines\n * over a 10% wash (overlaid) or as a stacked composition (`stacked`).\n *\n * Honesty: a `null` y is a GAP — the line and wash break there, and in stacked\n * mode an unknown in any layer breaks the whole stack at that x (the total is\n * unknown), never a silent zero. One y-axis only; a threshold is a labelled\n * reference line, not a second scale.\n *\n * Interaction: crosshair + tooltip on hover; the plot is focusable and the\n * arrow keys (Home/End) walk the same crosshair, announced through a live\n * region. The Table view carries every value without hovering.\n */\nimport { useId, useMemo, useRef, useState, type KeyboardEvent, type PointerEvent } from 'react';\nimport type { Series } from './types.js';\nimport { seriesColor } from './colors.js';\nimport { ChartFrame, type ChartStatus } from './ChartFrame.js';\nimport { ChartLegend, ChartTooltip, clampTooltipLeft } from './ChartParts.js';\nimport { TableView, type TableColumn } from './TableView.js';\nimport {\n MIN_TIME_SPAN_MS,\n allIntegers,\n areaPath,\n axisTicks,\n dodgeLabels,\n ensureSpan,\n isTimeAxis,\n labelCharPx,\n layoutAxisLabels,\n linePath,\n linearScale,\n percentScale,\n splitRuns,\n thinIndexes,\n tickGutter,\n xKeeper,\n type XY,\n} from './chart-math.js';\nimport { formatCompact, formatTimeLabel, timeLabelLadder } from './format.js';\nimport { useChartWidth } from './useChartWidth.js';\nimport { useTextScale } from './useTextScale.js';\nimport plot from './plot.module.css';\n\nexport interface AreaTrendSeries extends Series {\n /** Override the identity colour (defaults to the fixed categorical slot by index). */\n color?: string;\n}\n\nexport interface AreaTrendProps {\n title: string;\n description?: string;\n caveat?: string;\n status?: ChartStatus;\n series: AreaTrendSeries[];\n stacked?: boolean;\n /** Plot height in px, including the x-axis band. */\n height?: number;\n /** Fixed width (tests, print). Omit to fill the container. */\n width?: number;\n formatX?: (x: number) => string;\n formatY?: (y: number) => string;\n /** A labelled horizontal reference (a cap, a target). */\n threshold?: { value: number; label: string };\n /**\n * The y range to draw (widened, never clipped, if a value falls outside).\n * Default: a percent formatter (`formatY(50)` → \"50%\") gets 0–100 — or 0–1\n * for a fraction formatter — so percent cards share one scale; anything\n * else fits its data.\n */\n yDomain?: readonly [number, number];\n /** Accessible summary override. */\n ariaLabel?: string;\n}\n\nconst PAD_T = 12;\nconst PAD_B = 26;\nconst PAD_R = 12;\n/* End-label estimates are for 12 px text and are multiplied by the Display\n size (useTextScale) where they are used. END_LABEL_MAX is a budget of plot\n width, not a text measure, so it stays in px: at a larger size a long name\n falls back to the legend sooner rather than squeezing the plot. */\nconst END_LABEL_CH = 6.6;\nconst END_LABEL_MAX = 120;\n/** Line height of a direct end label at 12 px: two closer than this overlap. */\nconst END_LABEL_GAP_Y = 14;\n\ninterface Row {\n x: number;\n values: (number | null)[];\n total: number | null;\n}\n\nexport function AreaTrend({\n title,\n description,\n caveat,\n status,\n series,\n stacked = false,\n height = 200,\n width: fixedWidth,\n formatX: formatXProp,\n formatY: formatYProp,\n threshold,\n yDomain,\n ariaLabel,\n}: AreaTrendProps) {\n const formatX = formatXProp ?? formatTimeLabel;\n const formatY = formatYProp ?? formatCompact;\n const wrapRef = useRef<HTMLDivElement>(null);\n const width = useChartWidth(wrapRef, fixedWidth);\n const textScale = useTextScale();\n const [active, setActive] = useState<number | null>(null);\n const liveId = useId();\n\n const colors = series.map((s, i) => s.color ?? seriesColor(i));\n\n const rows: Row[] = useMemo(() => {\n // On a time axis a 0 / NaN / pre-2000 x is a null timestamp that leaked\n // through, not a moment — it would start the axis at \"Dec 31\" 1969.\n const all = series.flatMap((s) => s.points.map((p) => p.x));\n const keep = xKeeper(all);\n const xs = Array.from(new Set(all.filter(keep))).sort((a, b) => a - b);\n const lookup = series.map((s) => new Map(s.points.map((p) => [p.x, p.y])));\n return xs.map((x) => {\n const values = lookup.map((m) => (m.has(x) ? m.get(x)! : null));\n const total = values.some((v) => v === null) ? null : values.reduce<number>((a, v) => a + (v ?? 0), 0);\n return { x, values, total };\n });\n }, [series]);\n\n const hasData = rows.some((r) => r.values.some((v) => v !== null));\n const resolvedStatus: ChartStatus = status ?? (hasData ? { kind: 'ready' } : { kind: 'empty' });\n\n // ── scales ─────────────────────────────────────────────────────────────\n const known = stacked\n ? rows.map((r) => r.total).filter((v): v is number => v !== null)\n : rows.flatMap((r) => r.values).filter((v): v is number => v !== null);\n const pctScale = formatYProp ? percentScale(formatYProp) : null;\n const inDomain = (d: readonly [number, number]) => known.every((v) => v >= d[0] && v <= d[1]);\n const baseDomain: readonly [number, number] | null = yDomain ?? (pctScale !== null && inDomain([0, pctScale]) ? [0, pctScale] : null);\n const yAxis = axisTicks(\n Math.min(0, baseDomain?.[0] ?? 0, ...known),\n Math.max(0, baseDomain?.[1] ?? 0, ...known, threshold?.value ?? 0),\n { count: 4, integer: known.length > 0 && allIntegers(known), format: formatYProp },\n );\n const ticksY = yAxis.ticks;\n const yMin = ticksY[0]!;\n const yMax = ticksY[ticksY.length - 1]!;\n const padL = tickGutter(yAxis.labels, 28, 64, textScale);\n const plotH = height - PAD_T - PAD_B;\n const ys = linearScale(yMin, yMax, PAD_T + plotH, PAD_T);\n\n // Direct end labels (series names at each line's last point), dodged so\n // two lines ending on the same value (\"Struggles\" and \"Wins\" both at 3)\n // never print over each other. If they cannot all fit, the legend alone\n // names the series. Decided before the x scale: the gutter they need is\n // what plotW is measured against.\n const endLabelW = !stacked && series.length <= 4\n ? Math.max(0, ...series.map((s) => s.label.length)) * END_LABEL_CH * textScale + 6\n : 0;\n const endPoints = series.flatMap((s, si) => {\n for (let r = rows.length - 1; r >= 0; r--) {\n const v = rows[r]!.values[si];\n if (v !== null && v !== undefined) return [{ key: s.id, y: ys(v) }];\n }\n return [];\n });\n const dodged = endLabelW > 0 && endLabelW <= END_LABEL_MAX && width >= 420\n ? dodgeLabels(endPoints, END_LABEL_GAP_Y * textScale, PAD_T, PAD_T + plotH)\n : null;\n const showEndLabels = dodged !== null && endPoints.length > 0;\n const padR = PAD_R + (showEndLabels ? endLabelW : 0);\n const plotW = Math.max(40, width - padL - padR);\n\n const rawMin = rows.length ? rows[0]!.x : 0;\n const rawMax = rows.length ? rows[rows.length - 1]!.x : 1;\n const timeAxis = isTimeAxis(rows.map((r) => r.x));\n // A burst of readings seconds apart is widened to MIN_TIME_SPAN_MS around\n // itself, not stretched edge to edge (a lone point stays centred as before).\n const [xMin, xMax] = timeAxis && rawMax > rawMin ? ensureSpan(rawMin, rawMax, MIN_TIME_SPAN_MS) : [rawMin, rawMax];\n const xs = linearScale(xMin, xMax, padL, padL + plotW);\n\n // ── geometry ───────────────────────────────────────────────────────────\n // Recomputed per render on purpose: the scales depend on the measured width.\n const layers = (() => {\n if (stacked) {\n const acc = rows.map(() => 0);\n return series.map((_, si) => {\n const top = rows.map((r, ri) => {\n if (r.total === null) return { x: r.x, y: null as number | null, base: null as number | null };\n const base = acc[ri]!;\n acc[ri] = base + (r.values[si] ?? 0);\n return { x: r.x, y: acc[ri]!, base };\n });\n const runs = splitRuns(top.map((p) => ({ x: p.x, y: p.y })));\n return runs.map((run) => {\n const topPx: XY[] = run.map((p) => ({ x: xs(p.x), y: ys(p.y) }));\n const bottomPx: XY[] = run.map((p) => {\n const src = top.find((t) => t.x === p.x)!;\n return { x: xs(p.x), y: ys(src.base ?? 0) };\n });\n return { top: topPx, bottom: bottomPx };\n });\n });\n }\n return series.map((_, si) => {\n const runs = splitRuns(rows.map((r) => ({ x: r.x, y: r.values[si] ?? null })));\n return runs.map((run) => {\n const topPx = run.map((p) => ({ x: xs(p.x), y: ys(p.y) }));\n const bottomPx = run.map((p) => ({ x: xs(p.x), y: ys(Math.max(yMin, 0)) }));\n return { top: topPx, bottom: bottomPx };\n });\n });\n })();\n\n const xTickIdx = thinIndexes(rows.length, Math.max(2, Math.floor(plotW / 84)));\n // Collision-free x labels: the last point outranks the first, and both\n // outrank the interior ticks, which are simply dropped when they collide.\n // On a time axis the labels walk one shared detail ladder (caller's format\n // → shorter date/time; clock time only inside one day) until the ends fit.\n const ladder = timeAxis\n ? timeLabelLadder(rawMin, rawMax, formatXProp, xTickIdx.map((i) => rows[i]!.x))\n : [formatX];\n const xLabels = layoutAxisLabels(\n xTickIdx.map((i, n) => {\n const px = xs(rows[i]!.x);\n const isFirst = n === 0;\n const isLast = n === xTickIdx.length - 1;\n return {\n key: String(i),\n x: px,\n anchor: rows.length === 1 ? 'middle' as const : isFirst && px <= padL + 0.5 ? 'start' as const : isLast && px >= padL + plotW - 0.5 ? 'end' as const : 'middle' as const,\n priority: isLast ? 3 : isFirst ? 2 : 1,\n required: isFirst || isLast,\n variants: ladder.map((f) => f(rows[i]!.x)),\n };\n }),\n { min: padL, max: padL + plotW, charPx: labelCharPx(textScale) },\n );\n\n function indexAt(clientX: number): number | null {\n const el = wrapRef.current;\n if (!el || rows.length === 0) return null;\n const rect = el.getBoundingClientRect();\n const px = clientX - rect.left;\n let best = 0;\n let bestD = Infinity;\n rows.forEach((r, i) => {\n const d = Math.abs(xs(r.x) - px);\n if (d < bestD) { bestD = d; best = i; }\n });\n return best;\n }\n\n function onKey(e: KeyboardEvent<HTMLDivElement>): void {\n if (rows.length === 0) return;\n const cur = active ?? rows.length - 1;\n const next = e.key === 'ArrowLeft' ? cur - 1 : e.key === 'ArrowRight' ? cur + 1 : e.key === 'Home' ? 0 : e.key === 'End' ? rows.length - 1 : null;\n if (next === null) return;\n e.preventDefault();\n setActive(Math.max(0, Math.min(rows.length - 1, next)));\n }\n\n const activeRow = active !== null ? rows[active] : undefined;\n const latest = [...rows].reverse().find((r) => r.values.some((v) => v !== null));\n const summary = ariaLabel ?? (rows.length\n ? `${title}: ${rows.length} points from ${formatX(rawMin)} to ${formatX(rawMax)}.` +\n (latest ? ` Latest ${formatX(latest.x)}: ${series.map((s, i) => `${s.label} ${latest.values[i] === null ? 'no data' : formatY(latest.values[i]!)}`).join(', ')}.` : '')\n : `${title}: no data.`);\n\n const columns: TableColumn<Row>[] = [\n { key: 'x', label: 'When', render: (r) => formatX(r.x) },\n ...series.map((s, i) => ({\n key: s.id,\n label: s.label,\n numeric: true,\n render: (r: Row) => (r.values[i] === null ? '—' : formatY(r.values[i]!)),\n })),\n ...(stacked && series.length > 1\n ? [{ key: '__total', label: 'Total', numeric: true, render: (r: Row) => (r.total === null ? '—' : formatY(r.total)) }]\n : []),\n ];\n\n return (\n <ChartFrame\n title={title}\n description={description}\n caveat={caveat}\n status={resolvedStatus}\n table={<TableView caption={title} columns={columns} rows={rows} rowKey={(r) => String(r.x)} />}\n footer={\n <ChartLegend\n items={series.map((s, i) => ({ label: s.label, color: colors[i], kind: stacked ? 'swatch' : 'line' }))}\n />\n }\n >\n <div\n ref={wrapRef}\n className={`${plot.plotWrap} ${plot.focusable}`}\n tabIndex={0}\n role=\"group\"\n aria-label={`${title}. Use the left and right arrow keys to read values.`}\n aria-describedby={liveId}\n onFocus={() => setActive((a) => a ?? (rows.length ? rows.length - 1 : null))}\n onBlur={() => setActive(null)}\n onKeyDown={onKey}\n >\n <svg\n className={plot.svg}\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label={summary}\n onPointerMove={(e: PointerEvent<SVGSVGElement>) => setActive(indexAt(e.clientX))}\n onPointerLeave={() => setActive(null)}\n >\n {ticksY.map((t, i) => (\n <g key={t}>\n <line className={plot.grid} x1={padL} x2={padL + plotW} y1={ys(t)} y2={ys(t)} />\n <text className={plot.tick} x={padL - 6} y={ys(t)} dy=\"0.32em\" textAnchor=\"end\">{yAxis.labels[i]}</text>\n </g>\n ))}\n <line className={plot.axis} x1={padL} x2={padL + plotW} y1={ys(Math.max(yMin, 0))} y2={ys(Math.max(yMin, 0))} />\n {xLabels.map((l) => (\n <text key={l.key} data-axis-label={l.key} className={plot.tick} x={l.x} y={height - 8} textAnchor={l.anchor}>\n {l.text}\n </text>\n ))}\n\n {layers.map((runs, si) => (\n <g key={series[si]!.id} data-series={series[si]!.id}>\n {runs.map((run, ri) => (\n <path\n key={`a${ri}`}\n d={areaPath(run.top, run.bottom)}\n fill={colors[si]}\n className={stacked ? undefined : plot.wash}\n opacity={stacked ? 0.85 : undefined}\n stroke={stacked ? 'var(--chart-surface)' : undefined}\n strokeWidth={stacked ? 2 : undefined}\n />\n ))}\n {!stacked\n ? runs.map((run, ri) =>\n run.top.length === 1 ? (\n <circle key={`p${ri}`} cx={run.top[0]!.x} cy={run.top[0]!.y} r={3} fill={colors[si]} />\n ) : (\n <path key={`l${ri}`} d={linePath(run.top)} stroke={colors[si]} className={plot.line} />\n ),\n )\n : null}\n {showEndLabels && runs.length ? (() => {\n const last = runs[runs.length - 1]!.top;\n const end = last[last.length - 1]!;\n return (\n <text data-end-label={series[si]!.id} className={plot.label} x={end.x + 6} y={dodged!.get(series[si]!.id) ?? end.y} dy=\"0.32em\">{series[si]!.label}</text>\n );\n })() : null}\n </g>\n ))}\n\n {threshold ? (\n <g>\n <line className={plot.reference} x1={padL} x2={padL + plotW} y1={ys(threshold.value)} y2={ys(threshold.value)} />\n <text className={plot.tick} x={padL + plotW} y={ys(threshold.value) - 4} textAnchor=\"end\">\n {threshold.label} · {formatY(threshold.value)}\n </text>\n </g>\n ) : null}\n\n {activeRow ? (\n <g>\n <line className={plot.crosshair} x1={xs(activeRow.x)} x2={xs(activeRow.x)} y1={PAD_T} y2={PAD_T + plotH} />\n {series.map((s, si) => {\n const v = stacked\n ? (activeRow.total === null ? null : activeRow.values.slice(0, si + 1).reduce<number>((a, b) => a + (b ?? 0), 0))\n : activeRow.values[si];\n return v === null || v === undefined ? null : (\n <circle key={s.id} className={plot.marker} cx={xs(activeRow.x)} cy={ys(v)} r={4} fill={colors[si]} />\n );\n })}\n </g>\n ) : null}\n\n </svg>\n <span id={liveId} className={plot.srOnly} aria-live=\"polite\">\n {activeRow\n ? `${formatX(activeRow.x)}: ${series.map((s, i) => `${s.label} ${activeRow.values[i] === null ? 'no data' : formatY(activeRow.values[i]!)}`).join(', ')}`\n : ''}\n </span>\n {activeRow ? (\n <ChartTooltip\n left={clampTooltipLeft(xs(activeRow.x), width)}\n top={PAD_T}\n title={formatX(activeRow.x)}\n rows={[\n ...series.map((s, i) => ({\n key: s.id,\n label: s.label,\n value: activeRow.values[i] === null ? null : formatY(activeRow.values[i]!),\n color: colors[i],\n })),\n ...(stacked && series.length > 1\n ? [{ key: '__t', label: 'Total', value: activeRow.total === null ? null : formatY(activeRow.total) }]\n : []),\n ]}\n />\n ) : null}\n </div>\n </ChartFrame>\n );\n}\n"],"mappings":"wYA0EM,EAAQ,GACR,GAAQ,GACR,GAAQ,GAKR,GAAe,IACf,EAAgB,IAEhB,EAAkB,GAQxB,SAAgB,EAAU,CACxB,QACA,cACA,SACA,SACA,SACA,UAAU,GACV,SAAS,IACT,MAAO,GACP,QAAS,EACT,QAAS,EACT,YACA,WACA,cACiB,CACjB,IAAM,EAAU,GAAe,EACzB,EAAU,GAAe,GACzB,GAAA,EAAU,EAAA,OAAA,CAAuB,IAAI,EACrC,EAAQ,GAAc,EAAS,EAAU,EACzC,EAAY,EAAa,EACzB,CAAC,EAAQ,IAAA,EAAa,EAAA,SAAA,CAAwB,IAAI,EAClD,GAAA,EAAS,EAAA,MAAA,CAAM,EAEf,EAAS,EAAO,KAAK,EAAG,IAAM,EAAE,OAAS,GAAY,CAAC,CAAC,EAEvD,GAAA,EAAc,EAAA,QAAA,KAAc,CAGhC,IAAM,EAAM,EAAO,QAAS,GAAM,EAAE,OAAO,IAAK,GAAM,EAAE,CAAC,CAAC,EACpD,EAAO,GAAQ,CAAG,EAClB,EAAK,MAAM,KAAK,IAAI,IAAI,EAAI,OAAO,CAAI,CAAC,CAAC,CAAC,CAAC,MAAM,EAAG,IAAM,EAAI,CAAC,EAC/D,EAAS,EAAO,IAAK,GAAM,IAAI,IAAI,EAAE,OAAO,IAAK,GAAM,CAAC,EAAE,EAAG,EAAE,CAAC,CAAC,CAAC,CAAC,EACzE,OAAO,EAAG,IAAK,GAAM,CACnB,IAAM,EAAS,EAAO,IAAK,GAAO,EAAE,IAAI,CAAC,EAAI,EAAE,IAAI,CAAC,EAAK,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AE,MACT,MAAO,EAAU,OAAO,KAAO,KAAO,KAAO,EAAQ,EAAU,OAAO,EAAG,EACzE,MAAO,EAAO,EAChB,EAAE,EACF,GAAI,GAAW,EAAO,OAAS,EAC3B,CAAC,CAAE,IAAK,MAAO,MAAO,QAAS,MAAO,EAAU,QAAU,KAAO,KAAO,EAAQ,EAAU,KAAK,CAAE,CAAC,EAClG,CAAC,CACP,CACD,CAAA,EACC,IACD,GACK,CAAA,CAEhB"}
@@ -0,0 +1 @@
1
+ ._state_pnun3_8{align-items:flex-start;gap:var(--space-3);min-width:0;padding:var(--card-pad);border:1px solid var(--border-subtle);border-radius:var(--radius-lg);background:var(--bg-surface);flex-direction:column;display:flex}._head_pnun3_20{align-items:center;gap:var(--space-1) var(--space-2);flex-wrap:wrap;width:100%;display:flex}._titleRow_pnun3_29{align-items:flex-start;gap:var(--space-2);min-width:0;display:flex}._dot_pnun3_36{width:8px;height:8px;margin-top:calc((var(--text-lg-line) - 8px) / 2);border-radius:var(--radius-full);background:var(--status-neutral-solid);flex:none}._dot_pnun3_36[data-tone=danger]{background:var(--status-danger-solid)}._dot_pnun3_36[data-tone=warning]{background:var(--status-warning-solid)}._title_pnun3_29{font-family:var(--font-display);font-size:var(--text-lg-size);line-height:var(--text-lg-line);font-weight:var(--font-weight-semibold);letter-spacing:var(--tracking-display);color:var(--text-primary);margin:0}._since_pnun3_61{font-size:var(--text-xs-size);line-height:var(--text-xs-line);color:var(--text-tertiary);font-variant-numeric:tabular-nums;margin-left:auto}._why_pnun3_69{margin:calc(-1 * var(--space-2)) 0 0;max-width:64ch;font-size:var(--text-sm-size);line-height:var(--text-sm-line);color:var(--text-secondary)}._command_pnun3_78{align-items:center;gap:var(--space-3);width:min(100%,460px);padding:var(--space-1) var(--space-1) var(--space-1) var(--space-3);border:1px solid var(--border-subtle);border-radius:var(--radius-md);background:var(--bg-code);display:flex}._command_pnun3_78[data-state=failed]{border-color:var(--status-danger-solid)}._code_pnun3_92{min-width:0;font-family:var(--font-mono);font-size:var(--text-sm-size);line-height:var(--text-sm-line);color:var(--text-primary);overflow-wrap:anywhere;flex:1}._prompt_pnun3_102{color:var(--text-tertiary);-webkit-user-select:none;user-select:none}._action_pnun3_107{display:flex}._visuallyHidden_pnun3_111{clip:rect(0 0 0 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SetupChecklist-CzpEcfOl.js","assets/global-BlI2BYa1.css","assets/RouteErrorBoundary-DdxhTdZ6.css","assets/VerseConsoleApp-Cxqr-3qc.css","assets/SetupChecklist-BhZpFLsj.css"])))=>i.map(i=>d[i]);
2
+ import{a as e,c as t,n,t as r}from"./index-CyK31YRm.js";import{H as i,J as a,V as o,h as s,m as c}from"./global-y_exIyAP.js";import{L as l}from"./VerseConsoleApp-DXDv1aOi.js";import{n as u}from"./format-BmH2yWL6.js";import{t as d}from"./Button-DtE0rlWD.js";import{n as f,o as p}from"./icons-CygCEFWs.js";import{n as m}from"./nav-mimleI0R.js";import{i as h,n as g,s as _}from"./surface-data-C3UAQ4QX.js";import{t as v}from"./clipboard-DkZdqlxf.js";var y=t(e(),1),b=`/api/verse/authority/setup`,x=`ashlr authority setup`,S=3e4,C=6e4;function w(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function T(e){return!w(e)||e.schema!==`ashlr.authority-setup.v1`||!Array.isArray(e.steps)?null:e.steps.every(e=>w(e)&&typeof e.id==`string`&&typeof e.step==`string`&&typeof e.status==`string`&&Array.isArray(e.needs))?e:null}function E(e){if(e)return e.value?e.value.next===`standing-grant`?`ready`:`setup`:`unknown`}var D=Object.freeze({sudo:`sudo`,"touch-id":`Touch ID`,browser:`Browser`,github:`GitHub`,terminal:`Terminal`});function O(e){return e.length>0?e[0].toUpperCase()+e.slice(1):e}function k(e,t){return e.status===`done`||e.status===`already`?`done`:e.id===t?e.status===`failed`?`failed`:e.status===`blocked`?`blocked`:`next`:e.status===`failed`?`failed`:e.status===`blocked`?`blocked`:`todo`}function A(e){return e.steps.map(t=>({id:t.id,label:O(t.step),mark:k(t,e.next),needs:t.needs.filter(e=>e in D).map(e=>({id:e,label:D[e]})),detail:t.detail,command:t.command??null,link:t.link??null}))}function j(e){let t=e.split(/`([^`\n]+)`/u).map((e,t)=>({text:e,code:t%2==1})).filter(e=>e.text.length>0),n=t[0];return n&&!n.code&&(t[0]={text:n.text[0].toUpperCase()+n.text.slice(1),code:!1}),t}function M(e){if(!e)return null;try{let t=new URL(e);return t.protocol===`https:`&&t.hostname===`github.com`&&!t.username&&!t.password?t.href:null}catch{return null}}function N(e){return{ready:e.steps.filter(e=>e.status===`done`||e.status===`already`).length,total:e.steps.length}}function P(e){return A(e).find(t=>t.id===e.next)??null}function F(e){if(!e)return x;let t=P(e);return t?t.mark===`blocked`?t.command:t.command??`ashlr authority setup`:null}function I(e){return e?e.darkSince===void 0?e.state===`dark`?e.lastActivityAt:null:e.darkSince:null}function L(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function R(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`}):`an unknown day`}function z(e){let t=Date.parse(e);return Number.isFinite(t)?L(t):e}function B(e){let t=I(e),n=e.stateReason?.trim()||void 0;return t!==null&&Number.isFinite(Date.parse(t))?{kind:`dark`,since:z(t),detail:n}:n?{kind:`empty`,message:`Fleet dark. ${u(n)}`}:{kind:`empty`,message:`Fleet dark.`}}function V(e){return e.kind===`dark`?{kind:`empty`,message:`Nothing produced since ${R(e.since)}.`}:e}var H={section:`command`,anchor:null,label:`Open Command`},U={section:`fleet`,anchor:null,label:`Open Fleet`};function W(e){let t=e?.trim();return t?/[.!?…]$/.test(t)?t:`${t}.`:null}var G={paused:`Grant paused`,expired:`Grant expired`,revoked:`Grant revoked`,invalid:`Grant invalid`};function K({authority:e,live:t,quietSince:n=null,readiness:r=`unknown`,setup:i=null}){if(!e&&!t)return null;let a=I(t),o={since:a?`Fleet dark since ${R(a)}`:n?`Nothing produced since ${R(n)}`:null,tone:`neutral`,command:null,go:null,grant:null,setup:null};if(e?.kill||t?.state===`stopped`)return{...o,kind:`stopped`,tone:`danger`,title:`Fleet stopped`,why:`Nothing new starts until you resume it.`,go:H};if(e){let t=e.grant.state;if(t===`none`&&r===`setup`)return{...o,kind:`setup`,title:`Autonomy is off`,why:`Nothing runs or merges on its own until the one-time setup is done.`,command:F(i)??`ashlr authority setup`,setup:i};if(t===`none`)return{...o,kind:`grant`,title:`Autonomy is off`,why:`Approve a standing grant to let the fleet work.`,go:{...H,label:`Approve in Command`},grant:{intent:`grant`,label:`Approve grant`},setup:i};if(t!==`active`){let e=t===`paused`;return{...o,kind:`grant`,tone:`warning`,title:G[t],why:e?`Autonomy is off until you re-approve it.`:`Autonomy is off until you approve a new grant.`,go:{...H,label:e?`Re-approve in Command`:`Approve in Command`},grant:e?{intent:`re-approve`,label:`Re-approve grant`}:{intent:`grant`,label:`Approve grant`}}}if(e.effectiveSwitch===`off`)return{...o,kind:`off`,title:`Autonomy is off`,why:e.switch===`off`?`Switch it to Propose or Autonomous to start the fleet.`:W(e.effectiveReason)??`Something holds the switch at Off.`,go:H}}return t?.state===`dark`?{...o,kind:`dark`,title:`Fleet is dark`,why:W(t.stateReason)??`The daemon runs nothing on its own.`,go:U}:t?.state===`paused`?{...o,kind:`paused`,tone:`warning`,title:`Fleet paused`,why:W(t.stateReason)??`The daemon is parked; your own tools still work.`,go:U}:n&&t?.state!==`running`?{...o,kind:`quiet`,title:`Fleet is quiet`,why:`Autonomy is on, but no runs or proposals were filed.`,go:U}:null}var q={state:`_state_pnun3_8`,head:`_head_pnun3_20`,titleRow:`_titleRow_pnun3_29`,dot:`_dot_pnun3_36`,title:`_title_pnun3_29`,since:`_since_pnun3_61`,why:`_why_pnun3_69`,command:`_command_pnun3_78`,code:`_code_pnun3_92`,prompt:`_prompt_pnun3_102`,action:`_action_pnun3_107`,visuallyHidden:`_visuallyHidden_pnun3_111`},J=n(),Y=(0,y.lazy)(()=>r(()=>import(`./SetupChecklist-CzpEcfOl.js`),__vite__mapDeps([0,1,2,3,4]))),X=1200,Z=6e4,Q=_(`verse-authority-setup`,b,`The setup checklist`,T);function $(e){let t=Q.key,n=(0,y.useSyncExternalStore)((0,y.useCallback)(e=>a(t,e),[t]),()=>i(t),()=>i(t));(0,y.useEffect)(()=>{e&&o(t,()=>Q.fetch(),S)},[e,t]);let r=s(Q);return l(r,C,{enabled:e,refreshOnShow:!1}),e?{readiness:E(n.data),report:n.data?.value??null}:{readiness:`unknown`,report:null}}function ee(e=null){let t=c(g,{freshMs:3e4}),n=c(h,{freshMs:1e4}),r=s(g),i=s(h);l(()=>{r(),i()},Z);let a=$(t.data?.value?.grant.state===`none`);if(t.data&&n.data&&a.readiness!==void 0)return K({authority:t.data.value,live:n.data.value,quietSince:e,readiness:a.readiness,setup:a.report})}function te({command:e}){let[t,n]=(0,y.useState)(`idle`),r=(0,y.useRef)(null);(0,y.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);let i=async()=>{let t=await v(e);n(t?`copied`:`failed`),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>n(`idle`),X)};return(0,J.jsxs)(`div`,{className:q.command,"data-state":t,children:[(0,J.jsxs)(`code`,{className:q.code,children:[(0,J.jsx)(`span`,{className:q.prompt,"aria-hidden":`true`,children:`$ `}),e]}),(0,J.jsx)(d,{variant:`primary`,size:`sm`,icon:t===`copied`?(0,J.jsx)(f,{}):(0,J.jsx)(p,{}),onClick:()=>void i(),"aria-label":`Copy the command: ${e}`,children:t===`copied`?`Copied`:`Copy`}),(0,J.jsx)(`span`,{className:q.visuallyHidden,role:`status`,"aria-live":`polite`,children:t===`copied`?`Copied`:t===`failed`?`Copy failed. Select the command and copy it yourself.`:``})]})}function ne({state:e,here:t,title:n,why:r,onGrant:i}){let a=(0,y.useId)(),o=e?.go&&e.go.section!==t?e.go:null,s=i&&e?.grant?e.grant:null,c=null;e?.command?c=(0,J.jsx)(te,{command:e.command}):s?c=(0,J.jsx)(`div`,{className:q.action,children:(0,J.jsx)(d,{variant:`primary`,size:`sm`,onClick:()=>i?.(s.intent),children:s.label})}):o&&(c=(0,J.jsx)(`div`,{className:q.action,children:(0,J.jsx)(d,{variant:`primary`,size:`sm`,onClick:()=>m(o.section,o.anchor),children:o.label})}));let l=r===void 0?e?n?`${e.title}. ${e.why}`:e.why:null:r;return(0,J.jsxs)(`section`,{className:q.state,"aria-labelledby":a,"data-kind":e?.kind??`none`,"data-testid":`autonomy-off`,children:[(0,J.jsxs)(`header`,{className:q.head,children:[(0,J.jsxs)(`span`,{className:q.titleRow,children:[(0,J.jsx)(`span`,{className:q.dot,"data-tone":e?.tone??`neutral`,"aria-hidden":`true`}),(0,J.jsx)(`h3`,{id:a,className:q.title,children:n??e?.title??``})]}),e?.since?(0,J.jsx)(`span`,{className:q.since,children:e.since}):null]}),l?(0,J.jsx)(`p`,{className:q.why,children:l}):null,e?.setup?(0,J.jsx)(y.Suspense,{fallback:c,children:(0,J.jsx)(Y,{report:e.setup,action:c})}):c]})}export{R as a,V as c,P as d,M as f,K as i,j as l,A as m,ee as n,I as o,N as p,$ as r,B as s,ne as t,F as u};
3
+ //# sourceMappingURL=AutonomyOffState-CpFYS3tQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"mappings":";8cAgBa,EAAuB,6BAGvB,EAAgB,wBAGhB,EAAiB,IACjB,EAAgB,IAE7B,SAAS,EAAS,EAAkD,CAClE,OAAyB,OAAO,GAAU,YAAnC,GAA+C,CAAC,MAAM,QAAQ,CAAK,CAC5E,CAGA,SAAgB,EAAkB,EAA6C,CAG7E,MAFI,CAAC,EAAS,CAAG,GAAK,EAAI,SAAc,4BAA8B,CAAC,MAAM,QAAQ,EAAI,KAAQ,EAAU,KAC/F,EAAI,MAAuB,MAA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AAQ,UAAU,KAAK,KAAK,YAAe,IAAU,EAAM,MAAM,EACtE,WAAM,KACD,EACL,GAEE,IACT,GACE,SAAC,MAAD,CAAK,UAAW,EAAO,OACrB,mBAAC,EAAD,CAAQ,QAAQ,UAAU,KAAK,KAAK,YAAe,EAAY,EAAG,QAAS,EAAG,MAAM,EACjF,WAAG,KACE,EACL,IAKT,IAAM,EAAO,IAAQ,OAAmB,EAAe,EAAQ,GAAG,EAAM,MAAM,IAAI,EAAM,MAAQ,EAAM,IAAtD,KAAf,EACjC,OACE,UAAC,UAAD,CAAS,UAAW,EAAO,MAAO,kBAAiB,EAAS,YAAW,GAAO,MAAQ,OAAQ,cAAY,eAA1G,WACE,UAAC,SAAD,CAAQ,UAAW,EAAO,KAA1B,WACE,UAAC,OAAD,CAAM,UAAW,EAAO,SAAxB,WACE,SAAC,OAAD,CAAM,UAAW,EAAO,IAAK,YAAW,GAAO,MAAQ,UAAW,cAAY,MAAQ,IACtF,SAAC,KAAD,CAAI,GAAI,EAAS,UAAW,EAAO,MAAQ,YAAS,GAAO,OAAS,EAAO,EACvE,CACL,MAAO,OAAQ,SAAC,OAAD,CAAM,UAAW,EAAO,MAAQ,WAAM,KAAY,GAAI,IAChE,IACP,GAAO,SAAC,IAAD,CAAG,UAAW,EAAO,IAAM,UAAQ,GAAI,KAC9C,GAAO,OAEN,SAAC,WAAD,CAAU,SAAU,EAClB,mBAAC,EAAD,CAAgB,OAAQ,EAAM,MAAe,QAAS,EAC9C,GACR,CACG,GAEb","names":[],"ignoreList":[],"sources":["../../../../../../src/web-ui/routes/verse/autonomy/setup-checklist-model.ts","../../../../../../src/web-ui/routes/verse/fleet/dark-since.ts","../../../../../../src/web-ui/routes/verse/autonomy/autonomy-off-model.ts","../../../../../../src/web-ui/routes/verse/autonomy/AutonomyOffState.tsx"],"sourcesContent":["/**\n * routes/verse/autonomy/setup-checklist-model.ts — the live setup checklist,\n * read from GET /api/verse/authority/setup (the server's own\n * `ashlr authority setup --dry-run --json`, AuthoritySetupReportV1).\n *\n * It answers three things for the \"Autonomy is off\" state and onboarding:\n * - how far setup is (every step, done ✓ or not, what each needs from you);\n * - the ONE next step and the exact command that moves it on;\n * - whether the next step is approving the grant — the only time Verse asks\n * the server to draft one (the Touch ID sheet, on click). Before that the\n * draft route answers 409 `no-trust-roots`, so it is never read on load.\n *\n * Framework-free; tested directly.\n */\nimport type { AuthoritySetupNeed, AuthoritySetupReportV1, AuthoritySetupStepV1 } from '../../../../core/authority/types.js';\n\nexport const AUTHORITY_SETUP_PATH = '/api/verse/authority/setup';\n\n/** The one command that walks every step, resuming where the last run stopped. */\nexport const SETUP_COMMAND = 'ashlr authority setup';\n\n/** Reruns of setup happen in a terminal; a minute-old checklist is fine, and the server caches 30 s. */\nexport const SETUP_FRESH_MS = 30_000;\nexport const SETUP_POLL_MS = 60_000;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\n/** Structural guard: the schema tag, and steps shaped enough to render. */\nexport function narrowSetupReport(raw: unknown): AuthoritySetupReportV1 | null {\n if (!isRecord(raw) || raw['schema'] !== 'ashlr.authority-setup.v1' || !Array.isArray(raw['steps'])) return null;\n const ok = (raw['steps'] as unknown[]).every((s) => isRecord(s) && typeof s['id'] === 'string' && typeof s['step'] === 'string' && typeof s['status'] === 'string' && Array.isArray(s['needs']));\n return ok ? (raw as unknown as AuthoritySetupReportV1) : null;\n}\n\n/**\n * Where setup stands, as the \"Autonomy is off\" state needs it:\n * `ready` — everything before the standing grant is in place, so approving\n * it (Touch ID, on Command) is the next step;\n * `setup` — an earlier step is open: the checklist's next action;\n * `unknown` — the checklist did not answer.\n * Undefined while the read is in flight.\n */\nexport type SetupReadiness = 'ready' | 'setup' | 'unknown';\n\nexport function setupReadiness(read: { value: AuthoritySetupReportV1 | null } | undefined): SetupReadiness | undefined {\n if (!read) return undefined;\n if (!read.value) return 'unknown';\n return read.value.next === 'standing-grant' ? 'ready' : 'setup';\n}\n\nexport const NEED_LABEL: Readonly<Record<AuthoritySetupNeed, string>> = Object.freeze({\n sudo: 'sudo',\n 'touch-id': 'Touch ID',\n browser: 'Browser',\n github: 'GitHub',\n terminal: 'Terminal',\n});\n\nexport type SetupRowMark = 'done' | 'next' | 'todo' | 'blocked' | 'failed';\n\nexport interface SetupRow {\n id: string;\n /** \"GitHub App\", \"Custody helper\" — the CLI's step name, sentence-cased. */\n label: string;\n mark: SetupRowMark;\n needs: { id: AuthoritySetupNeed; label: string }[];\n detail: string;\n command: string | null;\n link: string | null;\n}\n\nfunction label(step: string): string {\n return step.length > 0 ? step[0]!.toUpperCase() + step.slice(1) : step;\n}\n\nfunction markOf(step: AuthoritySetupStepV1, next: string | null): SetupRowMark {\n if (step.status === 'done' || step.status === 'already') return 'done';\n if (step.id === next) return step.status === 'failed' ? 'failed' : step.status === 'blocked' ? 'blocked' : 'next';\n if (step.status === 'failed') return 'failed';\n if (step.status === 'blocked') return 'blocked';\n return 'todo';\n}\n\nexport function setupRows(report: AuthoritySetupReportV1): SetupRow[] {\n return report.steps.map((step) => ({\n id: step.id,\n label: label(step.step),\n mark: markOf(step, report.next),\n needs: step.needs.filter((n): n is AuthoritySetupNeed => n in NEED_LABEL).map((n) => ({ id: n, label: NEED_LABEL[n] })),\n detail: step.detail,\n command: step.command ?? null,\n link: step.link ?? null,\n }));\n}\n\n/**\n * A step's detail as the CLI wrote it (\"run `sudo scripts/install-custody.sh`\n * from …\"), split so commands in backticks render as code, first letter\n * capitalised — the CLI prints it after \"step: \", Verse on its own line.\n */\nexport function detailParts(detail: string): { text: string; code: boolean }[] {\n const pieces = detail.split(/`([^`\\n]+)`/u);\n const parts = pieces.map((text, i) => ({ text, code: i % 2 === 1 })).filter((p) => p.text.length > 0);\n const first = parts[0];\n if (first && !first.code) parts[0] = { text: first.text[0]!.toUpperCase() + first.text.slice(1), code: false };\n return parts;\n}\n\n/** A step's page, only when it is a plain https://github.com/ address (the App's install page, the trust-root PR). */\nexport function safeSetupLink(link: string | null): string | null {\n if (!link) return null;\n try {\n const url = new URL(link);\n return url.protocol === 'https:' && url.hostname === 'github.com' && !url.username && !url.password ? url.href : null;\n } catch {\n return null;\n }\n}\n\n/** \"6 of 15 ready\" — steps done or already in place. */\nexport function setupProgress(report: AuthoritySetupReportV1): { ready: number; total: number } {\n return { ready: report.steps.filter((s) => s.status === 'done' || s.status === 'already').length, total: report.steps.length };\n}\n\n/** The next step's row, or null when every step is in place. */\nexport function nextRow(report: AuthoritySetupReportV1): SetupRow | null {\n return setupRows(report).find((row) => row.id === report.next) ?? null;\n}\n\n/**\n * The command to copy for the next step: the step's own (sudo for the\n * helper, the build after the trust-root PR, …), else the setup command\n * (rerun-safe, it resumes where it stopped). A blocked step offers only the\n * command it names itself (e.g. the grant that unblocks the resident step);\n * null when nothing on this Mac moves it (not a compiled release, …).\n */\nexport function nextCommand(report: AuthoritySetupReportV1 | null): string | null {\n if (!report) return SETUP_COMMAND;\n const row = nextRow(report);\n if (!row) return null;\n if (row.mark === 'blocked') return row.command;\n return row.command ?? SETUP_COMMAND;\n}\n","/**\n * routes/verse/fleet/dark-since.ts — the ONE \"Fleet dark since …\" (3.10.1).\n *\n * 3.10.0 said it three ways: Command and Fleet took the live snapshot's\n * `lastActivityAt` (\"Sep 1\"), Growth took fleet history's `darkSince` (\"Aug\n * 18\"), and Command fell back to history whenever the live read was not dark.\n * Those are two different facts:\n *\n * dark since — autonomy is shut (no standing grant, or no daemon) and\n * the fleet last showed any sign of life then. Served once,\n * as `FleetLiveSnapshotV1.darkSince` (core/verse/\n * fleet-live-api.ts `fleetDarkSince`). Only this value may be\n * worded \"Fleet dark since …\".\n * quiet since — fleet history's `darkSince`: the last run started or\n * proposal filed. Worded \"Nothing produced since …\"\n * (`quietSinceStatus`), never \"dark\".\n *\n * Dates are the viewer's LOCAL calendar day everywhere (\"Sep 1\"), so the\n * verdict line and the chart beside it can never name different days.\n *\n * Framework-free; tested directly.\n */\nimport type { FleetLiveSnapshotV1 } from '../../../../core/fleet/fleet-types.js';\nimport type { ChartStatus } from '../../../components/charts/ChartFrame.js';\nimport { asSentence } from '../autonomy/format.js';\n\n/**\n * The fleet's dark-since instant, or null when the fleet is not dark. A\n * pre-3.10.1 server sends no `darkSince`; the same rule is applied to what it\n * does send.\n */\nexport function fleetDarkSince(live: FleetLiveSnapshotV1 | null | undefined): string | null {\n if (!live) return null;\n if (live.darkSince !== undefined) return live.darkSince;\n return live.state === 'dark' ? live.lastActivityAt : null;\n}\n\n/** The viewer's local calendar day for an instant, as `YYYY-MM-DD`. */\nfunction localDay(ms: number): string {\n const d = new Date(ms);\n return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;\n}\n\n/** \"Sep 1\" — the viewer's local day for `iso`. */\nexport function darkSinceLabel(iso: string): string {\n const ms = Date.parse(iso);\n if (!Number.isFinite(ms)) return 'an unknown day';\n return new Date(ms).toLocaleDateString('en-US', { month: 'short', day: 'numeric' });\n}\n\n/**\n * `iso` as the viewer's local `YYYY-MM-DD`, for ChartFrame's dark state:\n * ChartFrame labels the day it is GIVEN (a bare ISO instant would be cut to\n * its UTC day, which an evening west of UTC turns into tomorrow).\n */\nexport function darkSinceDay(iso: string): string {\n const ms = Date.parse(iso);\n return Number.isFinite(ms) ? localDay(ms) : iso;\n}\n\n/**\n * The chart state for a DARK live fleet, from THE dark-since instant: \"Fleet\n * dark since Sep 1\" (the viewer's local day). When the server knows the fleet\n * is dark but not since when (`darkSince: null` — a fresh install, a cleared\n * ledger and journal), it says just \"Fleet dark.\", as Command's line does —\n * never \"since <today>\" from the snapshot's own `generatedAt`.\n */\nexport function fleetDarkStatus(live: FleetLiveSnapshotV1): ChartStatus {\n const since = fleetDarkSince(live);\n const detail = live.stateReason?.trim() || undefined;\n if (since !== null && Number.isFinite(Date.parse(since))) return { kind: 'dark', since: darkSinceDay(since), detail };\n if (!detail) return { kind: 'empty', message: 'Fleet dark.' };\n return { kind: 'empty', message: `Fleet dark. ${asSentence(detail)}` };\n}\n\n/**\n * A chart status built over fleet HISTORY, re-worded: history's `darkSince`\n * is \"quiet since\" (the last run or proposal), so its dark state becomes a\n * plain \"Nothing produced since Aug 18.\" Every other status passes\n * through untouched.\n */\nexport function quietSinceStatus(status: ChartStatus): ChartStatus {\n if (status.kind !== 'dark') return status;\n return { kind: 'empty', message: `Nothing produced since ${darkSinceLabel(status.since)}.` };\n}\n","/**\n * routes/verse/autonomy/autonomy-off-model.ts — the ONE \"autonomy is off\"\n * decision every fleet surface (Command, Fleet, Growth, Mind) renders.\n *\n * Before this, a dormant fleet showed up as a wall of identical empty cards\n * (\"No fleet runs or proposals since Aug 18.\" six times on Growth, five dashes\n * on Command). Each surface now asks this model once and, when it answers,\n * shows a single state that says what is off, why it matters, and the one\n * thing that turns it back on.\n *\n * Precedence (first match wins):\n * stopped — Stop is in force (authority `kill`, or the live view says so);\n * setup — no grant, and the setup checklist (GET /api/verse/authority/\n * setup) says a step before the grant is still open: its next\n * step's command (setup is rerun-safe, it resumes);\n * grant — no grant, and everything before it is in place (or the\n * checklist did not answer), or it is paused, expired, revoked\n * or invalid: approve it (Touch ID, on Command);\n * off — a grant is in force but the switch holds autonomy at Off;\n * dark — the live view is dark for another reason (daemon not running);\n * paused — the daemon is parked;\n * quiet — autonomy is on but nothing was produced lately (fleet\n * history's \"quiet since\"); never worded \"dark\".\n * null — autonomy is on and producing (or nothing has answered yet).\n *\n * Only the live snapshot's `darkSince` may be worded \"Fleet dark since …\"\n * (fleet/dark-since.ts); history's date is \"Nothing produced since …\".\n *\n * Framework-free; tested directly.\n */\nimport type { AuthoritySetupReportV1, AuthorityStatusV1 } from '../../../../core/authority/types.js';\nimport type { FleetLiveSnapshotV1 } from '../../../../core/fleet/fleet-types.js';\nimport type { WorkbenchSectionId } from '../../../../core/verse/workbench-types.js';\nimport { darkSinceLabel, fleetDarkSince } from '../fleet/dark-since.js';\nimport { SETUP_COMMAND, nextCommand, type SetupReadiness } from './setup-checklist-model.js';\n\nexport { SETUP_COMMAND } from './setup-checklist-model.js';\n\nexport type AutonomyOffKind = 'stopped' | 'setup' | 'grant' | 'off' | 'dark' | 'paused' | 'quiet';\n\nexport interface AutonomyOffState {\n kind: AutonomyOffKind;\n /** The dot: neutral for a fleet that was never switched on, warning for a lapse, danger for Stop. */\n tone: 'neutral' | 'warning' | 'danger';\n /** \"Autonomy is off\" — what is off, in three or four words. */\n title: string;\n /** Why it matters, one line. */\n why: string;\n /** \"Fleet dark since Sep 1\" / \"Nothing produced since Aug 18\"; null when no date is known. */\n since: string | null;\n /** The primary action when it is a command to run (copied, never executed). */\n command: string | null;\n /** The primary action when it is a place in the app. */\n go: { section: WorkbenchSectionId; anchor: string | null; label: string } | null;\n /** Command's own action: open the Touch ID sheet with this intent (it holds the sheet). */\n grant: { intent: 'grant' | 're-approve'; label: string } | null;\n /** The live setup checklist while there is no grant; null when it is not known or not relevant. */\n setup: AuthoritySetupReportV1 | null;\n}\n\nexport interface AutonomyOffInputs {\n /** The authority read's value; null = the service did not answer. */\n authority: AuthorityStatusV1 | null;\n /** The live fleet read's value; null = the view did not answer. */\n live: FleetLiveSnapshotV1 | null;\n /** Fleet history's `darkSince` (\"quiet since\"); null = produced within 48 h, or unknown. */\n quietSince?: string | null;\n /** Where setup stands (`setupReadiness`); only consulted when there is no grant. */\n readiness?: SetupReadiness;\n /** The checklist itself, when it answered. */\n setup?: AuthoritySetupReportV1 | null;\n}\n\nconst GO_COMMAND = { section: 'command', anchor: null, label: 'Open Command' } as const;\nconst GO_FLEET = { section: 'fleet', anchor: null, label: 'Open Fleet' } as const;\n\nfunction sentence(text: string | null | undefined): string | null {\n const t = text?.trim();\n if (!t) return null;\n return /[.!?…]$/.test(t) ? t : `${t}.`;\n}\n\nconst GRANT_TITLE = { paused: 'Grant paused', expired: 'Grant expired', revoked: 'Grant revoked', invalid: 'Grant invalid' } as const;\n\nexport function autonomyOffState({ authority, live, quietSince = null, readiness = 'unknown', setup = null }: AutonomyOffInputs): AutonomyOffState | null {\n if (!authority && !live) return null;\n const dark = fleetDarkSince(live);\n const since = dark\n ? `Fleet dark since ${darkSinceLabel(dark)}`\n : quietSince\n ? `Nothing produced since ${darkSinceLabel(quietSince)}`\n : null;\n const base = { since, tone: 'neutral' as const, command: null, go: null, grant: null, setup: null };\n\n if (authority?.kill || live?.state === 'stopped') {\n return { ...base, kind: 'stopped', tone: 'danger', title: 'Fleet stopped', why: 'Nothing new starts until you resume it.', go: GO_COMMAND };\n }\n\n if (authority) {\n const grant = authority.grant.state;\n if (grant === 'none' && readiness === 'setup') {\n return {\n ...base,\n kind: 'setup',\n title: 'Autonomy is off',\n why: 'Nothing runs or merges on its own until the one-time setup is done.',\n command: nextCommand(setup) ?? SETUP_COMMAND,\n setup,\n };\n }\n if (grant === 'none') {\n return {\n ...base,\n kind: 'grant',\n title: 'Autonomy is off',\n why: 'Approve a standing grant to let the fleet work.',\n go: { ...GO_COMMAND, label: 'Approve in Command' },\n grant: { intent: 'grant', label: 'Approve grant' },\n setup,\n };\n }\n if (grant !== 'active') {\n const paused = grant === 'paused';\n return {\n ...base,\n kind: 'grant',\n tone: 'warning',\n title: GRANT_TITLE[grant],\n why: paused ? 'Autonomy is off until you re-approve it.' : 'Autonomy is off until you approve a new grant.',\n go: { ...GO_COMMAND, label: paused ? 'Re-approve in Command' : 'Approve in Command' },\n grant: paused ? { intent: 're-approve', label: 'Re-approve grant' } : { intent: 'grant', label: 'Approve grant' },\n };\n }\n if (authority.effectiveSwitch === 'off') {\n return {\n ...base,\n kind: 'off',\n title: 'Autonomy is off',\n why: authority.switch === 'off' ? 'Switch it to Propose or Autonomous to start the fleet.' : (sentence(authority.effectiveReason) ?? 'Something holds the switch at Off.'),\n go: GO_COMMAND,\n };\n }\n }\n\n if (live?.state === 'dark') {\n return { ...base, kind: 'dark', title: 'Fleet is dark', why: sentence(live.stateReason) ?? 'The daemon runs nothing on its own.', go: GO_FLEET };\n }\n if (live?.state === 'paused') {\n return { ...base, kind: 'paused', tone: 'warning', title: 'Fleet paused', why: sentence(live.stateReason) ?? 'The daemon is parked; your own tools still work.', go: GO_FLEET };\n }\n if (quietSince && live?.state !== 'running') {\n return { ...base, kind: 'quiet', title: 'Fleet is quiet', why: 'Autonomy is on, but no runs or proposals were filed.', go: GO_FLEET };\n }\n return null;\n}\n","/**\n * routes/verse/autonomy/AutonomyOffState.tsx — the one \"autonomy is off\"\n * state Command, Fleet, Growth and Mind show in place of their empty cards.\n *\n * ● Autonomy is off Fleet dark since Sep 1\n * Nothing runs or merges on its own until the one-time setup is done.\n * NEXT GitHub App Browser · GitHub\n * The ashlr-fleet key is in custody, but the App is not installed on …\n * [ $ ashlr authority setup ⧉ Copy ]\n * ▸ 6 of 15 ready ✓✓✓✓✓✓●○○○○○○○×\n *\n * One title, one line of why, ONE primary action: copy the next step's\n * command, approve the grant, or go to the surface that has the control (left\n * out when that surface is the one showing the state — its control is already\n * on screen). The decision is autonomy-off-model.ts; the checklist is\n * GET /api/verse/authority/setup (setup-checklist-model.ts), rendered by the\n * lazily loaded SetupChecklist. The grant draft is never read here: only the\n * Touch ID sheet drafts, when the operator opens it.\n */\nimport { lazy, Suspense, useCallback, useEffect, useId, useRef, useState, useSyncExternalStore, type ReactNode } from 'react';\nimport type { AuthoritySetupReportV1 } from '../../../../core/authority/types.js';\nimport type { WorkbenchSectionId } from '../../../../core/verse/workbench-types.js';\nimport { Button } from '../../../components/primitives/Button.js';\nimport { copyText } from '../../../components/primitives/clipboard.js';\nimport { IconCheck, IconCopy } from '../../../components/primitives/icons.js';\nimport { ensureQuery, getQuerySnapshot, subscribeQuery } from '../../../data/cache.js';\nimport { useQuery, useRefetch } from '../../../data/hooks.js';\nimport { goToSection } from '../command/nav.js';\nimport { authorityQuery, fleetLiveQuery, optionalQuery, type OptionalRead } from '../command/surface-data.js';\nimport { usePollWhileVisible } from '../shell/section-visibility.js';\nimport { autonomyOffState, type AutonomyOffState as OffState } from './autonomy-off-model.js';\nimport {\n AUTHORITY_SETUP_PATH,\n narrowSetupReport,\n SETUP_FRESH_MS,\n SETUP_POLL_MS,\n setupReadiness,\n type SetupReadiness,\n} from './setup-checklist-model.js';\nimport styles from './autonomy-off.module.css';\n\n// Split off the state's own chunk: the checklist renders only while autonomy\n// is off, and never on the chat first-paint path.\nconst SetupChecklist = lazy(() => import('./SetupChecklist.js'));\n\n/** How long \"Copied\" stays on the button (SPEC-310C §4's copy-pill timing). */\nconst COPIED_MS = 1_200;\n\n/** Authority and the live view move slowly while autonomy is off; a minute is plenty for a state. */\nexport const AUTONOMY_OFF_POLL_MS = 60_000;\n\n/** GET /api/verse/authority/setup — the server's own `ashlr authority setup --dry-run --json`. */\nexport const authoritySetupQuery = optionalQuery('verse-authority-setup', AUTHORITY_SETUP_PATH, 'The setup checklist', narrowSetupReport);\n\nexport interface SetupChecklistRead {\n /** Undefined while the first read is in flight; 'unknown' when not enabled or unanswered. */\n readiness: SetupReadiness | undefined;\n report: AuthoritySetupReportV1 | null;\n}\n\n/**\n * The live setup checklist — read ONLY while `enabled` (there is no grant),\n * refreshed every minute while it is on screen, so reruns of setup in a\n * terminal show up without a reload. An active fleet never reads it.\n */\nexport function useSetupChecklist(enabled: boolean): SetupChecklistRead {\n const key = authoritySetupQuery.key;\n const snap = useSyncExternalStore(\n useCallback((listener: () => void) => subscribeQuery(key, listener), [key]),\n () => getQuerySnapshot<OptionalRead<AuthoritySetupReportV1>>(key),\n () => getQuerySnapshot<OptionalRead<AuthoritySetupReportV1>>(key),\n );\n useEffect(() => {\n if (enabled) void ensureQuery(key, () => authoritySetupQuery.fetch(), SETUP_FRESH_MS);\n }, [enabled, key]);\n const refetch = useRefetch(authoritySetupQuery);\n usePollWhileVisible(refetch, SETUP_POLL_MS, { enabled, refreshOnShow: false });\n if (!enabled) return { readiness: 'unknown', report: null };\n return { readiness: setupReadiness(snap.data), report: snap.data?.value ?? null };\n}\n\n/**\n * The state for a surface that does not hold the authority / live reads\n * itself. Undefined until everything it needs has answered (so a loading\n * surface never flashes \"off\"); null when autonomy is on.\n */\nexport function useAutonomyOff(quietSince: string | null = null): OffState | null | undefined {\n const authority = useQuery(authorityQuery, { freshMs: 30_000 });\n const live = useQuery(fleetLiveQuery, { freshMs: 10_000 });\n const refetchAuthority = useRefetch(authorityQuery);\n const refetchLive = useRefetch(fleetLiveQuery);\n usePollWhileVisible(() => {\n refetchAuthority();\n refetchLive();\n }, AUTONOMY_OFF_POLL_MS);\n const noGrant = authority.data?.value?.grant.state === 'none';\n const setup = useSetupChecklist(noGrant);\n if (!authority.data || !live.data || setup.readiness === undefined) return undefined;\n return autonomyOffState({ authority: authority.data.value, live: live.data.value, quietSince, readiness: setup.readiness, setup: setup.report });\n}\n\nexport function CopyCommand({ command }: { command: string }) {\n const [state, setState] = useState<'idle' | 'copied' | 'failed'>('idle');\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n useEffect(() => () => { if (timer.current) clearTimeout(timer.current); }, []);\n const copy = async () => {\n const ok = await copyText(command);\n setState(ok ? 'copied' : 'failed');\n if (timer.current) clearTimeout(timer.current);\n timer.current = setTimeout(() => setState('idle'), COPIED_MS);\n };\n return (\n <div className={styles.command} data-state={state}>\n <code className={styles.code}>\n <span className={styles.prompt} aria-hidden=\"true\">$ </span>\n {command}\n </code>\n <Button\n variant=\"primary\"\n size=\"sm\"\n icon={state === 'copied' ? <IconCheck /> : <IconCopy />}\n onClick={() => void copy()}\n aria-label={`Copy the command: ${command}`}\n >\n {state === 'copied' ? 'Copied' : 'Copy'}\n </Button>\n <span className={styles.visuallyHidden} role=\"status\" aria-live=\"polite\">\n {state === 'copied' ? 'Copied' : state === 'failed' ? 'Copy failed. Select the command and copy it yourself.' : ''}\n </span>\n </div>\n );\n}\n\nexport interface AutonomyOffStateProps {\n /** The autonomy state; null = autonomy is on (a surface's own empty line, no action). */\n state: OffState | null;\n /** The surface showing it: a \"go to\" action pointing here is left out. */\n here: WorkbenchSectionId;\n /** A surface's own headline in place of the state's (\"Growth starts with the first fleet run.\"). */\n title?: string;\n /** A surface's own line in place of the state's why. */\n why?: string | null;\n /**\n * Command only: opens its Touch ID sheet. When given and the state carries\n * a grant action, that button is the primary action instead of \"go to\".\n */\n onGrant?: (intent: 'grant' | 're-approve') => void;\n}\n\nexport function AutonomyOffState({ state, here, title, why, onGrant }: AutonomyOffStateProps) {\n const titleId = useId();\n const go = state?.go && state.go.section !== here ? state.go : null;\n const grant = onGrant && state?.grant ? state.grant : null;\n let action: ReactNode = null;\n if (state?.command) action = <CopyCommand command={state.command} />;\n else if (grant) {\n action = (\n <div className={styles.action}>\n <Button variant=\"primary\" size=\"sm\" onClick={() => onGrant?.(grant.intent)}>\n {grant.label}\n </Button>\n </div>\n );\n } else if (go) {\n action = (\n <div className={styles.action}>\n <Button variant=\"primary\" size=\"sm\" onClick={() => goToSection(go.section, go.anchor)}>\n {go.label}\n </Button>\n </div>\n );\n }\n // A surface headline takes the title's place, so the state's own title\n // becomes the start of the line: \"Autonomy is off. Approve a standing grant…\"\n const line = why !== undefined ? why : !state ? null : title ? `${state.title}. ${state.why}` : state.why;\n return (\n <section className={styles.state} aria-labelledby={titleId} data-kind={state?.kind ?? 'none'} data-testid=\"autonomy-off\">\n <header className={styles.head}>\n <span className={styles.titleRow}>\n <span className={styles.dot} data-tone={state?.tone ?? 'neutral'} aria-hidden=\"true\" />\n <h3 id={titleId} className={styles.title}>{title ?? state?.title ?? ''}</h3>\n </span>\n {state?.since ? <span className={styles.since}>{state.since}</span> : null}\n </header>\n {line ? <p className={styles.why}>{line}</p> : null}\n {state?.setup ? (\n // Until the checklist chunk arrives, the action stands alone (never a blank gap).\n <Suspense fallback={action}>\n <SetupChecklist report={state.setup} action={action} />\n </Suspense>\n ) : action}\n </section>\n );\n}\n"],"file":"AutonomyOffState-CpFYS3tQ.js"}
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./index-CyK31YRm.js";import{n as t}from"./Advanced-cVYTAsfB.js";var n=e();function r(){return(0,n.jsx)(t,{})}export{r as AutonomySection};
2
+ //# sourceMappingURL=AutonomySection-Dwn8UtOy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AutonomySection-BTg7yVa1.js","names":[],"sources":["../../../../../../src/web-ui/routes/verse/sections/AutonomySection.tsx"],"sourcesContent":["/**\n * routes/verse/sections/AutonomySection.tsx — the 3.9 rail entry for the\n * legacy Autonomy cockpit. 3.10 moved the cockpit to Fleet ▸ Advanced\n * (fleet/Advanced.tsx; SPEC-310C §5, unit C7); stored `autonomy` sections\n * migrate to Fleet (workbench-types migrateSectionId).\n *\n * WHY this wrapper still exists: the shell (C1) retires the old rail entry in\n * the same release, and until it lands the current rail still lazy-loads\n * `sections/AutonomySection.tsx` by name — deleting it first would turn the\n * rail item into a MissingSection. Delete this file once C1's rail no longer\n * lists `autonomy` (follow-up noted in the C7 report).\n */\nimport { FleetAdvanced } from '../fleet/Advanced.js';\n\nexport function AutonomySection() {\n return <FleetAdvanced />;\n}\n"],"mappings":"6FAcA,SAAgB,GAAkB,CAChC,OAAO,EAAA,EAAA,IAAA,CAAC,EAAD,CAAgB,CAAA,CACzB"}
1
+ {"version":3,"file":"AutonomySection-Dwn8UtOy.js","names":[],"sources":["../../../../../../src/web-ui/routes/verse/sections/AutonomySection.tsx"],"sourcesContent":["/**\n * routes/verse/sections/AutonomySection.tsx — the 3.9 rail entry for the\n * legacy Autonomy cockpit. 3.10 moved the cockpit to Fleet ▸ Advanced\n * (fleet/Advanced.tsx; SPEC-310C §5, unit C7); stored `autonomy` sections\n * migrate to Fleet (workbench-types migrateSectionId).\n *\n * WHY this wrapper still exists: the shell (C1) retires the old rail entry in\n * the same release, and until it lands the current rail still lazy-loads\n * `sections/AutonomySection.tsx` by name — deleting it first would turn the\n * rail item into a MissingSection. Delete this file once C1's rail no longer\n * lists `autonomy` (follow-up noted in the C7 report).\n */\nimport { FleetAdvanced } from '../fleet/Advanced.js';\n\nexport function AutonomySection() {\n return <FleetAdvanced />;\n}\n"],"mappings":"6FAcA,SAAgB,GAAkB,CAChC,OAAO,EAAA,EAAA,IAAA,CAAC,EAAD,CAAgB,CAAA,CACzB"}
@@ -1,2 +1,2 @@
1
- import{a as e,c as t,n}from"./index-BG177cPN.js";import{t as r}from"./Dialog-BuIaG6HF.js";import{t as i}from"./MutationTokenDialog-CLGP72g6.js";import{H as a,L as o,R as s,kt as c}from"./VerseConsoleApp-DeuBEvAO.js";import{n as l}from"./format-DEAaVF6X.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 ee,s as w,u as T,w as E,x as D}from"./git-model-53iRLInY.js";import{t as O}from"./Button-OjVJSrFq.js";import{i as k}from"./icons-D4s-jlxX.js";import{n as A}from"./use-token-gate-DfEja7Wr.js";var j=t(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=n();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),l=(0,j.useId)(),u=(0,j.useId)(),d=(0,j.useRef)(null),f=(0,j.useRef)(null),p=(0,j.useRef)([]),m=t.map((e,t)=>e.disabledReason===null?t:-1).filter(e=>e>=0),h=(0,j.useCallback)(e=>{o(!1),c(-1),e&&d.current?.focus()},[]),g=e=>{o(!0),c(m.length===0?-1:e===`first`?m[0]:m[m.length-1])};(0,j.useEffect)(()=>{a&&(s>=0?p.current[s]?.focus():f.current?.focus())},[a,s]),(0,j.useEffect)(()=>{if(!a)return;let e=e=>{let t=e.target;f.current?.contains(t)||d.current?.contains(t)||h(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[a,h]);let _=e=>{if(m.length===0)return;let t=m.indexOf(s),n=t===-1?e===1?0:m.length-1:(t+e+m.length)%m.length;c(m[n])},v=e=>{e.key===`ArrowDown`?(e.preventDefault(),g(`first`)):e.key===`ArrowUp`&&(e.preventDefault(),g(`last`))},y=e=>{switch(e.key){case`ArrowDown`:e.preventDefault(),_(1);break;case`ArrowUp`:e.preventDefault(),_(-1);break;case`Home`:e.preventDefault(),m.length&&c(m[0]);break;case`End`:e.preventDefault(),m.length&&c(m[m.length-1]);break;case`Escape`:e.preventDefault(),e.stopPropagation(),h(!0);break;case`Tab`:h(!1)}},b=e=>{e.disabledReason===null&&(h(!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":u,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:u,className:M.visuallyHidden,children:e?.disclosure??``}),(0,N.jsx)(`button`,{ref:d,type:`button`,className:M.menuButton,"data-alone":e?`false`:`true`,"aria-haspopup":`menu`,"aria-expanded":a,"aria-controls":a?l:void 0,"aria-label":r,title:r,disabled:i,onClick:()=>a?h(!1):g(`first`),onKeyDown:v,children:(0,N.jsx)(k,{width:14,height:14,"aria-hidden":`true`})}),a?(0,N.jsx)(`div`,{ref:f,id:l,role:`menu`,"aria-label":r,className:M.menu,tabIndex:-1,onKeyDown:y,children:t.map((e,t)=>(0,N.jsxs)(`button`,{ref:e=>{p.current[t]=e},type:`button`,role:`menuitem`,className:M.menuItem,tabIndex:t===s?0:-1,"aria-disabled":e.disabledReason!==null||void 0,onClick:()=>b(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),b(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)(O,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,N.jsx)(O,{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`,`, `,w(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)(O,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,N.jsx)(O,{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)(O,{variant:`ghost`,onClick:i,children:`Cancel`}),(0,N.jsxs)(O,{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 te(e,t={}){let n=t.fetchStatus??m,r=t.enabled??!0,i=s(),a=e.join(`\0`),c=(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=c.filter(e=>!g.current.has(e));if(t.length===0){f(new Set(c));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)):D(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(c)),h(n),r&&v.current===null&&(v.current=setTimeout(()=>{v.current=null,y.current&&x.current()},J))})},[c,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]),o(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)(()=>c.map(e=>l[e]).filter(e=>e!==void 0),[c,l]),loading:c.some(e=>!d.has(e)),error:p,refresh:b,replace:C}}var ne=6e3;function Y({roots:e,onOpenDiff:t,statusOptions:n}){let{statuses:r,loading:o,replace:s}=te(e,n),{compact:m}=c(),h=A(),[v,y]=(0,j.useState)(!1),[b,S]=(0,j.useState)(null),[C,w]=(0,j.useState)(null),[D,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),ne);return()=>clearTimeout(e)},[k]);let R=ee(r).filter(T),z=e=>r.find(t=>t.root===e)??null,B=(0,j.useCallback)(async(e,t,n,r,i)=>{w(e),O(null),P(null);try{let i=await h.run(t,n);if(i===null)return;s(e,i.status),S(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{w(null)}},[h,s]),W=e=>B(e.root,`Push ${e.branch??`this branch`} to ${e.upstream??`origin`}.`,()=>E(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),S({kind:`merge`,root:e.root,pin:t}))},q=e=>{switch(e.suggested){case`commit`:O(null),S({kind:`commit`,root:e.root});break;case`push`:W(e);break;case`create-pr`:O(null),S({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),S({kind:`pr`,root:e.root,draft:!0});break;case`commit`:O(null),S({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),S({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: ${l(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=>{o?I(e):Y(e)};a(`git.create-pr`,()=>X(`create-pr`)),a(`git.merge-pr`,()=>X(`merge`));let Z=(0,j.useRef)(Y);if(Z.current=Y,(0,j.useEffect)(()=>{F===null||o||(I(null),Z.current(F))},[F,o]),R.length===0&&!k)return null;let Q=v?R:R.slice(0,1),ie=R.length-Q.length,$=b?z(b.root):null;return(0,N.jsxs)(`section`,{className:M.bar,"aria-label":`Branches`,"data-compact":m?`true`:`false`,children:[(0,N.jsx)(`ul`,{id:L,className:M.rows,children:Q.map(e=>(0,N.jsx)(re,{status:e,compact:m,busy:C===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":v,"aria-controls":L,onClick:()=>y(e=>!e),children:v?`Show fewer`:`Show ${ie} 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??``}),$&&b?.kind===`commit`?(0,N.jsx)(V,{open:!0,status:$,busy:C===b.root,error:D,onClose:()=>S(null),onSubmit:e=>void B(b.root,`Commit ${$.dirty} changed files on ${$.branch??`this branch`}.`,()=>f({root:b.root,message:e}),e=>`Committed on ${e.branch??`the branch`}.`,!0)}):null,$&&b?.kind===`pr`?(0,N.jsx)(H,{open:!0,draft:b.draft,status:$,busy:C===b.root,error:D,onClose:()=>S(null),onSubmit:e=>void B(b.root,`Push ${$.branch??`this branch`} and open a pull request into ${e.base}.`,async()=>{let t=await u({root:b.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,b?.kind===`merge`?(0,N.jsx)(U,{open:!0,pin:b.pin,live:$,busy:C===b.root,error:D,onClose:()=>S(null),onSubmit:()=>{let{pin:e}=b;e.headSha!==null&&_(e,z(b.root))===null&&B(b.root,`Squash-merge #${e.number} (head ${e.headSha.slice(0,7)}) into ${e.baseRef}.`,async()=>{let t=await d({root:b.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,{...h.dialog,tokenLabel:`Mutation token`,tokenHelp:`the mutation token ashlr verse printed`})]})}function re({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-BjPFtGsj.js.map
1
+ import{a as e,c as t,n}from"./index-CyK31YRm.js";import{t as r}from"./Dialog-BRd_B9OE.js";import{t as i}from"./MutationTokenDialog-Bm34BNVV.js";import{H as a,L as o,R as s,kt as c}from"./VerseConsoleApp-DXDv1aOi.js";import{n as l}from"./format-BmH2yWL6.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 ee,s as w,u as T,w as E,x as D}from"./git-model-BFwAVbxF.js";import{t as O}from"./Button-DtE0rlWD.js";import{i as k}from"./icons-CygCEFWs.js";import{n as A}from"./use-token-gate-DSNIIpI6.js";var j=t(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=n();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),l=(0,j.useId)(),u=(0,j.useId)(),d=(0,j.useRef)(null),f=(0,j.useRef)(null),p=(0,j.useRef)([]),m=t.map((e,t)=>e.disabledReason===null?t:-1).filter(e=>e>=0),h=(0,j.useCallback)(e=>{o(!1),c(-1),e&&d.current?.focus()},[]),g=e=>{o(!0),c(m.length===0?-1:e===`first`?m[0]:m[m.length-1])};(0,j.useEffect)(()=>{a&&(s>=0?p.current[s]?.focus():f.current?.focus())},[a,s]),(0,j.useEffect)(()=>{if(!a)return;let e=e=>{let t=e.target;f.current?.contains(t)||d.current?.contains(t)||h(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[a,h]);let _=e=>{if(m.length===0)return;let t=m.indexOf(s),n=t===-1?e===1?0:m.length-1:(t+e+m.length)%m.length;c(m[n])},v=e=>{e.key===`ArrowDown`?(e.preventDefault(),g(`first`)):e.key===`ArrowUp`&&(e.preventDefault(),g(`last`))},y=e=>{switch(e.key){case`ArrowDown`:e.preventDefault(),_(1);break;case`ArrowUp`:e.preventDefault(),_(-1);break;case`Home`:e.preventDefault(),m.length&&c(m[0]);break;case`End`:e.preventDefault(),m.length&&c(m[m.length-1]);break;case`Escape`:e.preventDefault(),e.stopPropagation(),h(!0);break;case`Tab`:h(!1)}},b=e=>{e.disabledReason===null&&(h(!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":u,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:u,className:M.visuallyHidden,children:e?.disclosure??``}),(0,N.jsx)(`button`,{ref:d,type:`button`,className:M.menuButton,"data-alone":e?`false`:`true`,"aria-haspopup":`menu`,"aria-expanded":a,"aria-controls":a?l:void 0,"aria-label":r,title:r,disabled:i,onClick:()=>a?h(!1):g(`first`),onKeyDown:v,children:(0,N.jsx)(k,{width:14,height:14,"aria-hidden":`true`})}),a?(0,N.jsx)(`div`,{ref:f,id:l,role:`menu`,"aria-label":r,className:M.menu,tabIndex:-1,onKeyDown:y,children:t.map((e,t)=>(0,N.jsxs)(`button`,{ref:e=>{p.current[t]=e},type:`button`,role:`menuitem`,className:M.menuItem,tabIndex:t===s?0:-1,"aria-disabled":e.disabledReason!==null||void 0,onClick:()=>b(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),b(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)(O,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,N.jsx)(O,{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`,`, `,w(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)(O,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,N.jsx)(O,{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)(O,{variant:`ghost`,onClick:i,children:`Cancel`}),(0,N.jsxs)(O,{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 te(e,t={}){let n=t.fetchStatus??m,r=t.enabled??!0,i=s(),a=e.join(`\0`),c=(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=c.filter(e=>!g.current.has(e));if(t.length===0){f(new Set(c));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)):D(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(c)),h(n),r&&v.current===null&&(v.current=setTimeout(()=>{v.current=null,y.current&&x.current()},J))})},[c,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]),o(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)(()=>c.map(e=>l[e]).filter(e=>e!==void 0),[c,l]),loading:c.some(e=>!d.has(e)),error:p,refresh:b,replace:C}}var ne=6e3;function Y({roots:e,onOpenDiff:t,statusOptions:n}){let{statuses:r,loading:o,replace:s}=te(e,n),{compact:m}=c(),h=A(),[v,y]=(0,j.useState)(!1),[b,S]=(0,j.useState)(null),[C,w]=(0,j.useState)(null),[D,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),ne);return()=>clearTimeout(e)},[k]);let R=ee(r).filter(T),z=e=>r.find(t=>t.root===e)??null,B=(0,j.useCallback)(async(e,t,n,r,i)=>{w(e),O(null),P(null);try{let i=await h.run(t,n);if(i===null)return;s(e,i.status),S(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{w(null)}},[h,s]),W=e=>B(e.root,`Push ${e.branch??`this branch`} to ${e.upstream??`origin`}.`,()=>E(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),S({kind:`merge`,root:e.root,pin:t}))},q=e=>{switch(e.suggested){case`commit`:O(null),S({kind:`commit`,root:e.root});break;case`push`:W(e);break;case`create-pr`:O(null),S({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),S({kind:`pr`,root:e.root,draft:!0});break;case`commit`:O(null),S({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),S({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: ${l(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=>{o?I(e):Y(e)};a(`git.create-pr`,()=>X(`create-pr`)),a(`git.merge-pr`,()=>X(`merge`));let Z=(0,j.useRef)(Y);if(Z.current=Y,(0,j.useEffect)(()=>{F===null||o||(I(null),Z.current(F))},[F,o]),R.length===0&&!k)return null;let Q=v?R:R.slice(0,1),ie=R.length-Q.length,$=b?z(b.root):null;return(0,N.jsxs)(`section`,{className:M.bar,"aria-label":`Branches`,"data-compact":m?`true`:`false`,children:[(0,N.jsx)(`ul`,{id:L,className:M.rows,children:Q.map(e=>(0,N.jsx)(re,{status:e,compact:m,busy:C===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":v,"aria-controls":L,onClick:()=>y(e=>!e),children:v?`Show fewer`:`Show ${ie} 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??``}),$&&b?.kind===`commit`?(0,N.jsx)(V,{open:!0,status:$,busy:C===b.root,error:D,onClose:()=>S(null),onSubmit:e=>void B(b.root,`Commit ${$.dirty} changed files on ${$.branch??`this branch`}.`,()=>f({root:b.root,message:e}),e=>`Committed on ${e.branch??`the branch`}.`,!0)}):null,$&&b?.kind===`pr`?(0,N.jsx)(H,{open:!0,draft:b.draft,status:$,busy:C===b.root,error:D,onClose:()=>S(null),onSubmit:e=>void B(b.root,`Push ${$.branch??`this branch`} and open a pull request into ${e.base}.`,async()=>{let t=await u({root:b.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,b?.kind===`merge`?(0,N.jsx)(U,{open:!0,pin:b.pin,live:$,busy:C===b.root,error:D,onClose:()=>S(null),onSubmit:()=>{let{pin:e}=b;e.headSha!==null&&_(e,z(b.root))===null&&B(b.root,`Squash-merge #${e.number} (head ${e.headSha.slice(0,7)}) into ${e.baseRef}.`,async()=>{let t=await d({root:b.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,{...h.dialog,tokenLabel:`Mutation token`,tokenHelp:`the mutation token ashlr verse printed`})]})}function re({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-ISZ7xUCj.js.map