@ashlr/hub 3.11.3 → 3.11.5

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 (556) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +44 -18
  3. package/dist/authority-surface.json +72 -57
  4. package/dist/build-identity.json +2 -2
  5. package/dist/cli/authority.d.ts +39 -0
  6. package/dist/cli/authority.js +222 -55
  7. package/dist/cli/authority.js.map +1 -1
  8. package/dist/cli/help.js +1 -1
  9. package/dist/cli/help.js.map +1 -1
  10. package/dist/cli/verse.d.ts +3 -0
  11. package/dist/cli/verse.js +10 -0
  12. package/dist/cli/verse.js.map +1 -1
  13. package/dist/core/authority/types.d.ts +2 -2
  14. package/dist/core/cloud/cloud-api.js +1 -1
  15. package/dist/core/cloud/cloud-api.js.map +1 -1
  16. package/dist/core/cloud/delivery-contract.d.ts +1 -1
  17. package/dist/core/cloud/delivery-contract.js +25 -15
  18. package/dist/core/cloud/delivery-contract.js.map +1 -1
  19. package/dist/core/cloud/store.js +6 -0
  20. package/dist/core/cloud/store.js.map +1 -1
  21. package/dist/core/cloud/tracker.d.ts +2 -0
  22. package/dist/core/cloud/tracker.js +140 -37
  23. package/dist/core/cloud/tracker.js.map +1 -1
  24. package/dist/core/cloud/types.d.ts +9 -1
  25. package/dist/core/cloud/types.js.map +1 -1
  26. package/dist/core/comms/dispatch.d.ts +5 -0
  27. package/dist/core/comms/dispatch.js +12 -1
  28. package/dist/core/comms/dispatch.js.map +1 -1
  29. package/dist/core/comms/requests.d.ts +27 -1
  30. package/dist/core/comms/requests.js +50 -1
  31. package/dist/core/comms/requests.js.map +1 -1
  32. package/dist/core/daemon/loop.d.ts +14 -0
  33. package/dist/core/daemon/loop.js +35 -0
  34. package/dist/core/daemon/loop.js.map +1 -1
  35. package/dist/core/fabric/claude-usage.js +23 -1
  36. package/dist/core/fabric/claude-usage.js.map +1 -1
  37. package/dist/core/fleet/dispatch-router.d.ts +7 -0
  38. package/dist/core/fleet/dispatch-router.js +4 -1
  39. package/dist/core/fleet/dispatch-router.js.map +1 -1
  40. package/dist/core/fleet/tick-hooks-live.d.ts +5 -1
  41. package/dist/core/fleet/tick-hooks-live.js +10 -1
  42. package/dist/core/fleet/tick-hooks-live.js.map +1 -1
  43. package/dist/core/local-runtime/llama/config.d.ts +14 -0
  44. package/dist/core/local-runtime/llama/config.js +20 -2
  45. package/dist/core/local-runtime/llama/config.js.map +1 -1
  46. package/dist/core/local-runtime/llama/process.d.ts +19 -0
  47. package/dist/core/local-runtime/llama/process.js +67 -17
  48. package/dist/core/local-runtime/llama/process.js.map +1 -1
  49. package/dist/core/local-runtime/llama/supervisor.js +14 -3
  50. package/dist/core/local-runtime/llama/supervisor.js.map +1 -1
  51. package/dist/core/observability/rollup.d.ts +12 -0
  52. package/dist/core/observability/rollup.js +37 -2
  53. package/dist/core/observability/rollup.js.map +1 -1
  54. package/dist/core/observability/usage-source.js +49 -1
  55. package/dist/core/observability/usage-source.js.map +1 -1
  56. package/dist/core/resources/connection-monitor.js +47 -4
  57. package/dist/core/resources/connection-monitor.js.map +1 -1
  58. package/dist/core/resources/engineering-mission-store.d.ts +1 -1
  59. package/dist/core/routing/headroom.js +7 -2
  60. package/dist/core/routing/headroom.js.map +1 -1
  61. package/dist/core/routing/router.d.ts +48 -0
  62. package/dist/core/routing/router.js +129 -13
  63. package/dist/core/routing/router.js.map +1 -1
  64. package/dist/core/run/best-of-n.d.ts +7 -0
  65. package/dist/core/run/best-of-n.js +3 -0
  66. package/dist/core/run/best-of-n.js.map +1 -1
  67. package/dist/core/run/harness-dispatch.d.ts +147 -0
  68. package/dist/core/run/harness-dispatch.js +234 -0
  69. package/dist/core/run/harness-dispatch.js.map +1 -0
  70. package/dist/core/run/orchestrator.js +3 -0
  71. package/dist/core/run/orchestrator.js.map +1 -1
  72. package/dist/core/run/provider-client.d.ts +8 -0
  73. package/dist/core/run/provider-client.js +4 -0
  74. package/dist/core/run/provider-client.js.map +1 -1
  75. package/dist/core/run/sandboxed-engine.d.ts +8 -0
  76. package/dist/core/run/sandboxed-engine.js +60 -7
  77. package/dist/core/run/sandboxed-engine.js.map +1 -1
  78. package/dist/core/types.d.ts +14 -0
  79. package/dist/core/types.js.map +1 -1
  80. package/dist/core/universe/builtins/preparation/manifest.json +1 -1
  81. package/dist/core/universe/builtins/preparation/preparation-bridge.mjs +181 -5
  82. package/dist/core/universe/builtins/preparation/preparation-verification-fixtures.mjs +180 -4
  83. package/dist/core/universe/firm-demo.d.ts +1 -1
  84. package/dist/core/universe/firm-graph.d.ts +2 -2
  85. package/dist/core/util/scrub.js +16 -3
  86. package/dist/core/util/scrub.js.map +1 -1
  87. package/dist/core/verse/accounts.d.ts +9 -1
  88. package/dist/core/verse/accounts.js +52 -11
  89. package/dist/core/verse/accounts.js.map +1 -1
  90. package/dist/core/verse/apps-api.d.ts +12 -0
  91. package/dist/core/verse/apps-api.js +22 -4
  92. package/dist/core/verse/apps-api.js.map +1 -1
  93. package/dist/core/verse/apps.js +22 -12
  94. package/dist/core/verse/apps.js.map +1 -1
  95. package/dist/core/verse/local-models.js +3 -7
  96. package/dist/core/verse/local-models.js.map +1 -1
  97. package/dist/core/verse/model-display-name.d.ts +34 -0
  98. package/dist/core/verse/model-display-name.js +125 -0
  99. package/dist/core/verse/model-display-name.js.map +1 -0
  100. package/dist/core/verse/seats.d.ts +11 -2
  101. package/dist/core/verse/seats.js +42 -18
  102. package/dist/core/verse/seats.js.map +1 -1
  103. package/dist/core/verse/transient-events.d.ts +21 -0
  104. package/dist/core/verse/transient-events.js +12 -0
  105. package/dist/core/verse/transient-events.js.map +1 -0
  106. package/dist/core/verse/types.d.ts +6 -13
  107. package/dist/core/verse/types.js +5 -36
  108. package/dist/core/verse/types.js.map +1 -1
  109. package/dist/core/web/public/next/assets/ActionMenu-DffwPklw.js +2 -0
  110. package/dist/core/web/public/next/assets/{ActionMenu-FxXeRbPx.js.map → ActionMenu-DffwPklw.js.map} +1 -1
  111. package/dist/core/web/public/next/assets/Advanced-CxzE6ekM.js +2 -0
  112. package/dist/core/web/public/next/assets/Advanced-CxzE6ekM.js.map +1 -0
  113. package/dist/core/web/public/next/assets/App-DFlp-vdv.js +7 -0
  114. package/dist/core/web/public/next/assets/App-DFlp-vdv.js.map +1 -0
  115. package/dist/core/web/public/next/assets/AppsSection-Ct2O605-.js +2 -0
  116. package/dist/core/web/public/next/assets/AppsSection-Ct2O605-.js.map +1 -0
  117. package/dist/core/web/public/next/assets/AreaTrend-o-GLl2Is.js +2 -0
  118. package/dist/core/web/public/next/assets/{AreaTrend-CDxrQU4b.js.map → AreaTrend-o-GLl2Is.js.map} +1 -1
  119. package/dist/core/web/public/next/assets/AutonomyOffState-CXhXpsim.js +2 -0
  120. package/dist/core/web/public/next/assets/AutonomyOffState-CXhXpsim.js.map +1 -0
  121. package/dist/core/web/public/next/assets/AutonomyOffState-DmbE71vI.css +1 -0
  122. package/dist/core/web/public/next/assets/AutonomySection-BTg7yVa1.js +2 -0
  123. package/dist/core/web/public/next/assets/{AutonomySection-DuQkHGD_.js.map → AutonomySection-BTg7yVa1.js.map} +1 -1
  124. package/dist/core/web/public/next/assets/BranchBar-BjPFtGsj.js +2 -0
  125. package/dist/core/web/public/next/assets/{BranchBar-CLsvOcyK.js.map → BranchBar-BjPFtGsj.js.map} +1 -1
  126. package/dist/core/web/public/next/assets/BudgetControl-ng6swoZp.js +2 -0
  127. package/dist/core/web/public/next/assets/{BudgetControl-TL3FeZ1D.js.map → BudgetControl-ng6swoZp.js.map} +1 -1
  128. package/dist/core/web/public/next/assets/{Button-HHXgoXGr.js → Button-OjVJSrFq.js} +2 -2
  129. package/dist/core/web/public/next/assets/{Button-HHXgoXGr.js.map → Button-OjVJSrFq.js.map} +1 -1
  130. package/dist/core/web/public/next/assets/CapacityStrip-Bx4c3dxD.js +2 -0
  131. package/dist/core/web/public/next/assets/{CapacityStrip-qReu0RaF.js.map → CapacityStrip-Bx4c3dxD.js.map} +1 -1
  132. package/dist/core/web/public/next/assets/{useChartWidth-BW6SwYIK.css → ChartFrame-BVuBe6RP.css} +1 -1
  133. package/dist/core/web/public/next/assets/ChartFrame-B_w2Siqg.js +2 -0
  134. package/dist/core/web/public/next/assets/ChartFrame-B_w2Siqg.js.map +1 -0
  135. package/dist/core/web/public/next/assets/ChatSection-Bisj9R6E.js +3 -0
  136. package/dist/core/web/public/next/assets/ChatSection-Bisj9R6E.js.map +1 -0
  137. package/dist/core/web/public/next/assets/CloudBudgetForm-5Gf4iAok.js +2 -0
  138. package/dist/core/web/public/next/assets/CloudBudgetForm-5Gf4iAok.js.map +1 -0
  139. package/dist/core/web/public/next/assets/CommandPalette-iTpk6I8r.js +2 -0
  140. package/dist/core/web/public/next/assets/CommandPalette-iTpk6I8r.js.map +1 -0
  141. package/dist/core/web/public/next/assets/CommandSection-CvAVd1w4.css +1 -0
  142. package/dist/core/web/public/next/assets/CommandSection-D8ZihzvE.js +2 -0
  143. package/dist/core/web/public/next/assets/CommandSection-D8ZihzvE.js.map +1 -0
  144. package/dist/core/web/public/next/assets/ConfirmDialog-_S9iE-cJ.js +2 -0
  145. package/dist/core/web/public/next/assets/{ConfirmDialog-DLrLKM0c.js.map → ConfirmDialog-_S9iE-cJ.js.map} +1 -1
  146. package/dist/core/web/public/next/assets/DeleteChatDialog-KUYUygiA.js +2 -0
  147. package/dist/core/web/public/next/assets/DeleteChatDialog-KUYUygiA.js.map +1 -0
  148. package/dist/core/web/public/next/assets/Dialog-BuIaG6HF.js +2 -0
  149. package/dist/core/web/public/next/assets/{Dialog-BS9Dxi3G.js.map → Dialog-BuIaG6HF.js.map} +1 -1
  150. package/dist/core/web/public/next/assets/DiffPane-De4IQt82.js +2 -0
  151. package/dist/core/web/public/next/assets/{DiffPane-TOmUf3b2.js.map → DiffPane-De4IQt82.js.map} +1 -1
  152. package/dist/core/web/public/next/assets/DiffViewer-B75t6Ile.js +2 -0
  153. package/dist/core/web/public/next/assets/{DiffViewer-BpH56302.js.map → DiffViewer-B75t6Ile.js.map} +1 -1
  154. package/dist/core/web/public/next/assets/DockHost-BPqyhtCP.js +2 -0
  155. package/dist/core/web/public/next/assets/DockHost-BPqyhtCP.js.map +1 -0
  156. package/dist/core/web/public/next/assets/{EmptyState-BqR5YAmf.js → EmptyState-DXkT4vhW.js} +2 -2
  157. package/dist/core/web/public/next/assets/{EmptyState-BqR5YAmf.js.map → EmptyState-DXkT4vhW.js.map} +1 -1
  158. package/dist/core/web/public/next/assets/{Epistemic-dhvDTwAZ.js → Epistemic-CfqFe_aP.js} +2 -2
  159. package/dist/core/web/public/next/assets/{Epistemic-dhvDTwAZ.js.map → Epistemic-CfqFe_aP.js.map} +1 -1
  160. package/dist/core/web/public/next/assets/FleetSection-B7f-XBiX.js +3 -0
  161. package/dist/core/web/public/next/assets/FleetSection-B7f-XBiX.js.map +1 -0
  162. package/dist/core/web/public/next/assets/Funnel-pXYySwXQ.js +2 -0
  163. package/dist/core/web/public/next/assets/{Funnel-D2u7Wlzc.js.map → Funnel-pXYySwXQ.js.map} +1 -1
  164. package/dist/core/web/public/next/assets/GearTray-gj6lT7ba.js +2 -0
  165. package/dist/core/web/public/next/assets/{GearTray-Cb2npoxM.js.map → GearTray-gj6lT7ba.js.map} +1 -1
  166. package/dist/core/web/public/next/assets/GrowthSection-D8e9m9Wy.js +2 -0
  167. package/dist/core/web/public/next/assets/{GrowthSection-C5aDPs8B.js.map → GrowthSection-D8e9m9Wy.js.map} +1 -1
  168. package/dist/core/web/public/next/assets/HandoffDialog-VfKxKhxF.js +2 -0
  169. package/dist/core/web/public/next/assets/{HandoffDialog-BF3AYg-X.js.map → HandoffDialog-VfKxKhxF.js.map} +1 -1
  170. package/dist/core/web/public/next/assets/Input-u1YR_Ogl.js +2 -0
  171. package/dist/core/web/public/next/assets/{Input-B5dmGLZx.js.map → Input-u1YR_Ogl.js.map} +1 -1
  172. package/dist/core/web/public/next/assets/LeaderCard-BDELBrnx.js +2 -0
  173. package/dist/core/web/public/next/assets/LeaderCard-BDELBrnx.js.map +1 -0
  174. package/dist/core/web/public/next/assets/MatrixHeatmap-NKLF2srR.js +2 -0
  175. package/dist/core/web/public/next/assets/{MatrixHeatmap-BgEUs2Eu.js.map → MatrixHeatmap-NKLF2srR.js.map} +1 -1
  176. package/dist/core/web/public/next/assets/McpSection-D1tDvlRa.js +2 -0
  177. package/dist/core/web/public/next/assets/{McpSection-DZkiOuoq.js.map → McpSection-D1tDvlRa.js.map} +1 -1
  178. package/dist/core/web/public/next/assets/MessageMarkdown-DlfLEJxu.js +3 -0
  179. package/dist/core/web/public/next/assets/{MessageMarkdown-BauY8ZTY.js.map → MessageMarkdown-DlfLEJxu.js.map} +1 -1
  180. package/dist/core/web/public/next/assets/{MessageMarkdownRenderer-DLBNLfsn.js → MessageMarkdownRenderer-BYZzI115.js} +4 -4
  181. package/dist/core/web/public/next/assets/{MessageMarkdownRenderer-DLBNLfsn.js.map → MessageMarkdownRenderer-BYZzI115.js.map} +1 -1
  182. package/dist/core/web/public/next/assets/{Meter-DNeocJnD.js → Meter-BSVhU43Q.js} +2 -2
  183. package/dist/core/web/public/next/assets/{Meter-DNeocJnD.js.map → Meter-BSVhU43Q.js.map} +1 -1
  184. package/dist/core/web/public/next/assets/MindSection-lqV2e_Sq.js +2 -0
  185. package/dist/core/web/public/next/assets/MindSection-lqV2e_Sq.js.map +1 -0
  186. package/dist/core/web/public/next/assets/MutationTokenDialog-CLGP72g6.js +2 -0
  187. package/dist/core/web/public/next/assets/{MutationTokenDialog-mxrw0Yvy.js.map → MutationTokenDialog-CLGP72g6.js.map} +1 -1
  188. package/dist/core/web/public/next/assets/NeedsYouDrawer-D992XTOn.js +2 -0
  189. package/dist/core/web/public/next/assets/{NeedsYouDrawer-CO-Balfp.js.map → NeedsYouDrawer-D992XTOn.js.map} +1 -1
  190. package/dist/core/web/public/next/assets/NeedsYouList-eBOlJr0b.js +2 -0
  191. package/dist/core/web/public/next/assets/{NeedsYouList-CzDZbzRD.js.map → NeedsYouList-eBOlJr0b.js.map} +1 -1
  192. package/dist/core/web/public/next/assets/NewChatDialog-DoYTH26M.js +3 -0
  193. package/dist/core/web/public/next/assets/NewChatDialog-DoYTH26M.js.map +1 -0
  194. package/dist/core/web/public/next/assets/OnboardingFlow-D3yfITK1.js +2 -0
  195. package/dist/core/web/public/next/assets/OnboardingFlow-D3yfITK1.js.map +1 -0
  196. package/dist/core/web/public/next/assets/OnboardingFlow-HUNQGQuU.css +1 -0
  197. package/dist/core/web/public/next/assets/OnboardingGate-DrDEVBqw.js +3 -0
  198. package/dist/core/web/public/next/assets/OnboardingGate-DrDEVBqw.js.map +1 -0
  199. package/dist/core/web/public/next/assets/PreviewPane-ULN673zm.js +2 -0
  200. package/dist/core/web/public/next/assets/{PreviewPane-BS-CleCd.js.map → PreviewPane-ULN673zm.js.map} +1 -1
  201. package/dist/core/web/public/next/assets/{ProviderLogo-C5mBg8i0.js → ProviderLogo-8WaUjTlN.js} +2 -2
  202. package/dist/core/web/public/next/assets/{ProviderLogo-C5mBg8i0.js.map → ProviderLogo-8WaUjTlN.js.map} +1 -1
  203. package/dist/core/web/public/next/assets/RailStatus-Ckw9nvYU.js +2 -0
  204. package/dist/core/web/public/next/assets/{RailStatus-cPRyOmrk.js.map → RailStatus-Ckw9nvYU.js.map} +1 -1
  205. package/dist/core/web/public/next/assets/{RefreshIndicator-CMwSCiz5.js → RefreshIndicator-DGubF4vR.js} +2 -2
  206. package/dist/core/web/public/next/assets/{RefreshIndicator-CMwSCiz5.js.map → RefreshIndicator-DGubF4vR.js.map} +1 -1
  207. package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-BFi1opsC.js → ResourcePoolConsoleApp-BahEaY4d.js} +4 -4
  208. package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-BFi1opsC.js.map → ResourcePoolConsoleApp-BahEaY4d.js.map} +1 -1
  209. package/dist/core/web/public/next/assets/ResourcesChrome-C2ZrA7la.js +3 -0
  210. package/dist/core/web/public/next/assets/ResourcesChrome-C2ZrA7la.js.map +1 -0
  211. package/dist/core/web/public/next/assets/ResourcesDrawer-BC93fzwQ.js +2 -0
  212. package/dist/core/web/public/next/assets/ResourcesDrawer-BC93fzwQ.js.map +1 -0
  213. package/dist/core/web/public/next/assets/ResourcesDrawer-BCFJ2Uq8.css +1 -0
  214. package/dist/core/web/public/next/assets/RouteErrorBoundary-BvhHNpE_.js +2 -0
  215. package/dist/core/web/public/next/assets/{RouteErrorBoundary-DYtwc2ja.js.map → RouteErrorBoundary-BvhHNpE_.js.map} +1 -1
  216. package/dist/core/web/public/next/assets/RunInCloudAction-Dywfnw0C.js +2 -0
  217. package/dist/core/web/public/next/assets/{RunInCloudAction-BEGEEM8O.js.map → RunInCloudAction-Dywfnw0C.js.map} +1 -1
  218. package/dist/core/web/public/next/assets/SeatSelector-CH7hTgwy.js +3 -0
  219. package/dist/core/web/public/next/assets/{SeatSelector-CYHRR7Wp.js.map → SeatSelector-CH7hTgwy.js.map} +1 -1
  220. package/dist/core/web/public/next/assets/Segmented-Wynbg0F5.js +2 -0
  221. package/dist/core/web/public/next/assets/{Segmented-BE53BenI.js.map → Segmented-Wynbg0F5.js.map} +1 -1
  222. package/dist/core/web/public/next/assets/Select-DMyLCkId.js +2 -0
  223. package/dist/core/web/public/next/assets/{Select-BwSGkHCS.js.map → Select-DMyLCkId.js.map} +1 -1
  224. package/dist/core/web/public/next/assets/SessionGate-8RtQFWeZ.js +2 -0
  225. package/dist/core/web/public/next/assets/{SessionGate-e0dFJm9d.js.map → SessionGate-8RtQFWeZ.js.map} +1 -1
  226. package/dist/core/web/public/next/assets/SessionInsightChip-zBJbKv2L.js +2 -0
  227. package/dist/core/web/public/next/assets/{SessionInsightChip-CxlSyueJ.js.map → SessionInsightChip-zBJbKv2L.js.map} +1 -1
  228. package/dist/core/web/public/next/assets/SessionSearch-DfJIcxxM.js +2 -0
  229. package/dist/core/web/public/next/assets/{SessionSearch-_yp7S2TP.js.map → SessionSearch-DfJIcxxM.js.map} +1 -1
  230. package/dist/core/web/public/next/assets/SettingsSection-Da9RYyH5.js +2 -0
  231. package/dist/core/web/public/next/assets/SettingsSection-Da9RYyH5.js.map +1 -0
  232. package/dist/core/web/public/next/assets/Sheet-DhXyIDmq.js +2 -0
  233. package/dist/core/web/public/next/assets/{Sheet-DVP2Mgy6.js.map → Sheet-DhXyIDmq.js.map} +1 -1
  234. package/dist/core/web/public/next/assets/ShortcutsOverlay-Bi5f-wUw.js +2 -0
  235. package/dist/core/web/public/next/assets/{ShortcutsOverlay-BcIcoClX.js.map → ShortcutsOverlay-Bi5f-wUw.js.map} +1 -1
  236. package/dist/core/web/public/next/assets/Sidebar-BuO3sViG.js +3 -0
  237. package/dist/core/web/public/next/assets/Sidebar-BuO3sViG.js.map +1 -0
  238. package/dist/core/web/public/next/assets/Slider-Bd9YFWEV.js +2 -0
  239. package/dist/core/web/public/next/assets/{Slider-BypUWjpH.js.map → Slider-Bd9YFWEV.js.map} +1 -1
  240. package/dist/core/web/public/next/assets/StatTile-DScTd3c-.js +2 -0
  241. package/dist/core/web/public/next/assets/StatTile-DScTd3c-.js.map +1 -0
  242. package/dist/core/web/public/next/assets/{StatusBadge-HCZp416_.js → StatusBadge-DQ1UtQAJ.js} +2 -2
  243. package/dist/core/web/public/next/assets/{StatusBadge-HCZp416_.js.map → StatusBadge-DQ1UtQAJ.js.map} +1 -1
  244. package/dist/core/web/public/next/assets/StepBand-BB3IJxhr.js +2 -0
  245. package/dist/core/web/public/next/assets/{StepBand-Duz1PUes.js.map → StepBand-BB3IJxhr.js.map} +1 -1
  246. package/dist/core/web/public/next/assets/Surface-DWMtQe3Q.js +2 -0
  247. package/dist/core/web/public/next/assets/Surface-DWMtQe3Q.js.map +1 -0
  248. package/dist/core/web/public/next/assets/Surface-e1z6GdZt.css +1 -0
  249. package/dist/core/web/public/next/assets/Swimlane-DcENqtdp.js +2 -0
  250. package/dist/core/web/public/next/assets/{Swimlane-DGcIcnNA.js.map → Swimlane-DcENqtdp.js.map} +1 -1
  251. package/dist/core/web/public/next/assets/{Switch-iveI-8NY.js → Switch-CenChEYf.js} +2 -2
  252. package/dist/core/web/public/next/assets/{Switch-iveI-8NY.js.map → Switch-CenChEYf.js.map} +1 -1
  253. package/dist/core/web/public/next/assets/{Tag-DH15CUJp.js → Tag-D4k5E3u0.js} +2 -2
  254. package/dist/core/web/public/next/assets/{Tag-DH15CUJp.js.map → Tag-D4k5E3u0.js.map} +1 -1
  255. package/dist/core/web/public/next/assets/TerminalPane-DCQTukcE.js +7 -0
  256. package/dist/core/web/public/next/assets/TerminalPane-DCQTukcE.js.map +1 -0
  257. package/dist/core/web/public/next/assets/UniverseConsoleApp-DsuWT0pi.js +2 -0
  258. package/dist/core/web/public/next/assets/{UniverseConsoleApp-C8yQ0AaR.js.map → UniverseConsoleApp-DsuWT0pi.js.map} +1 -1
  259. package/dist/core/web/public/next/assets/{UniverseView-_nPURPqe.js → UniverseView-DyI5ApsA.js} +3 -3
  260. package/dist/core/web/public/next/assets/{UniverseView-_nPURPqe.js.map → UniverseView-DyI5ApsA.js.map} +1 -1
  261. package/dist/core/web/public/next/assets/UsageSection-Imr28nwK.js +3 -0
  262. package/dist/core/web/public/next/assets/UsageSection-Imr28nwK.js.map +1 -0
  263. package/dist/core/web/public/next/assets/VerseConsoleApp-DeuBEvAO.js +3 -0
  264. package/dist/core/web/public/next/assets/VerseConsoleApp-DeuBEvAO.js.map +1 -0
  265. package/dist/core/web/public/next/assets/Workspace-CpxBO98E.js +10 -0
  266. package/dist/core/web/public/next/assets/Workspace-CpxBO98E.js.map +1 -0
  267. package/dist/core/web/public/next/assets/actions-BmIf9avl.css +1 -0
  268. package/dist/core/web/public/next/assets/actions-DE8NoWV_.js +2 -0
  269. package/dist/core/web/public/next/assets/actions-DE8NoWV_.js.map +1 -0
  270. package/dist/core/web/public/next/assets/apps-model-CFGCUu9p.js +2 -0
  271. package/dist/core/web/public/next/assets/apps-model-CFGCUu9p.js.map +1 -0
  272. package/dist/core/web/public/next/assets/authority-model-CmnfJzmM.js +2 -0
  273. package/dist/core/web/public/next/assets/authority-model-CmnfJzmM.js.map +1 -0
  274. package/dist/core/web/public/next/assets/binding-left-DZpq5sLf.js +2 -0
  275. package/dist/core/web/public/next/assets/binding-left-DZpq5sLf.js.map +1 -0
  276. package/dist/core/web/public/next/assets/{budget-queries-V3wcJVK_.js → budget-queries-DjrPRFwl.js} +2 -2
  277. package/dist/core/web/public/next/assets/{budget-queries-V3wcJVK_.js.map → budget-queries-DjrPRFwl.js.map} +1 -1
  278. package/dist/core/web/public/next/assets/capacity-strip-model-C7cdQnuK.js +2 -0
  279. package/dist/core/web/public/next/assets/capacity-strip-model-C7cdQnuK.js.map +1 -0
  280. package/dist/core/web/public/next/assets/charts-DUD_jprE.js +2 -0
  281. package/dist/core/web/public/next/assets/charts-DUD_jprE.js.map +1 -0
  282. package/dist/core/web/public/next/assets/charts-DhKTrQLw.css +1 -0
  283. package/dist/core/web/public/next/assets/clipboard-DkZdqlxf.js +2 -0
  284. package/dist/core/web/public/next/assets/clipboard-DkZdqlxf.js.map +1 -0
  285. package/dist/core/web/public/next/assets/cloud-D-HXms6q.css +1 -0
  286. package/dist/core/web/public/next/assets/cloud-model-DoxBMDvx.js +2 -0
  287. package/dist/core/web/public/next/assets/cloud-model-DoxBMDvx.js.map +1 -0
  288. package/dist/core/web/public/next/assets/cloud-queries-CTGvO-k-.js +2 -0
  289. package/dist/core/web/public/next/assets/cloud-queries-CTGvO-k-.js.map +1 -0
  290. package/dist/core/web/public/next/assets/cloud.module-DOP-N4Ch.js +2 -0
  291. package/dist/core/web/public/next/assets/cloud.module-DOP-N4Ch.js.map +1 -0
  292. package/dist/core/web/public/next/assets/command-catalog-CmrHNFzh.js +2 -0
  293. package/dist/core/web/public/next/assets/command-catalog-CmrHNFzh.js.map +1 -0
  294. package/dist/core/web/public/next/assets/context-model-2Owp2jYF.js +3 -0
  295. package/dist/core/web/public/next/assets/context-model-2Owp2jYF.js.map +1 -0
  296. package/dist/core/web/public/next/assets/context-model-9xywbXxX.js +2 -0
  297. package/dist/core/web/public/next/assets/context-model-9xywbXxX.js.map +1 -0
  298. package/dist/core/web/public/next/assets/{context-queries-CrPcHWTz.js → context-queries-wvcRnV-I.js} +2 -2
  299. package/dist/core/web/public/next/assets/{context-queries-CrPcHWTz.js.map → context-queries-wvcRnV-I.js.map} +1 -1
  300. package/dist/core/web/public/next/assets/{control-queries-CmgBgKV7.js → control-queries-DB6Kh7UN.js} +2 -2
  301. package/dist/core/web/public/next/assets/{control-queries-CmgBgKV7.js.map → control-queries-DB6Kh7UN.js.map} +1 -1
  302. package/dist/core/web/public/next/assets/copy-setup-CJQhFl-4.js +2 -0
  303. package/dist/core/web/public/next/assets/copy-setup-CJQhFl-4.js.map +1 -0
  304. package/dist/core/web/public/next/assets/dock-icons-BBUGl4tE.js +2 -0
  305. package/dist/core/web/public/next/assets/{dock-icons-CUh8dOxJ.js.map → dock-icons-BBUGl4tE.js.map} +1 -1
  306. package/dist/core/web/public/next/assets/fleet-model-BRfRWkZl.js +2 -0
  307. package/dist/core/web/public/next/assets/fleet-model-BRfRWkZl.js.map +1 -0
  308. package/dist/core/web/public/next/assets/fleet-queries-tU6UEXN2.js +2 -0
  309. package/dist/core/web/public/next/assets/fleet-queries-tU6UEXN2.js.map +1 -0
  310. package/dist/core/web/public/next/assets/{focus-trap-HtcoXeEq.js → focus-trap-BGOceFvj.js} +2 -2
  311. package/dist/core/web/public/next/assets/{focus-trap-HtcoXeEq.js.map → focus-trap-BGOceFvj.js.map} +1 -1
  312. package/dist/core/web/public/next/assets/format-DEAaVF6X.js +2 -0
  313. package/dist/core/web/public/next/assets/format-DEAaVF6X.js.map +1 -0
  314. package/dist/core/web/public/next/assets/{git-model-bk_RXh3y.js → git-model-53iRLInY.js} +2 -2
  315. package/dist/core/web/public/next/assets/{git-model-bk_RXh3y.js.map → git-model-53iRLInY.js.map} +1 -1
  316. package/dist/core/web/public/next/assets/global-CXHHMz9o.js +2 -0
  317. package/dist/core/web/public/next/assets/{global-oEl9Qj8u.js.map → global-CXHHMz9o.js.map} +1 -1
  318. package/dist/core/web/public/next/assets/{guarded-runners-LHLXmXIk.js → guarded-runners-B8zFVBVZ.js} +2 -2
  319. package/dist/core/web/public/next/assets/{guarded-runners-LHLXmXIk.js.map → guarded-runners-B8zFVBVZ.js.map} +1 -1
  320. package/dist/core/web/public/next/assets/icons-D4s-jlxX.js +2 -0
  321. package/dist/core/web/public/next/assets/icons-D4s-jlxX.js.map +1 -0
  322. package/dist/core/web/public/next/assets/{index-BVxOlseC.js → index-BG177cPN.js} +3 -3
  323. package/dist/core/web/public/next/assets/{index-BVxOlseC.js.map → index-BG177cPN.js.map} +1 -1
  324. package/dist/core/web/public/next/assets/live-model-CEf01wrW.js +2 -0
  325. package/dist/core/web/public/next/assets/live-model-CEf01wrW.js.map +1 -0
  326. package/dist/core/web/public/next/assets/local-model-C9xNi9fN.js +2 -0
  327. package/dist/core/web/public/next/assets/local-model-C9xNi9fN.js.map +1 -0
  328. package/dist/core/web/public/next/assets/mind.module-D_xk6HIQ.js +2 -0
  329. package/dist/core/web/public/next/assets/{mind.module-gTGAuJt1.js.map → mind.module-D_xk6HIQ.js.map} +1 -1
  330. package/dist/core/web/public/next/assets/mutations-CbTSofVH.js +2 -0
  331. package/dist/core/web/public/next/assets/{mutations-C5S7okTW.js.map → mutations-CbTSofVH.js.map} +1 -1
  332. package/dist/core/web/public/next/assets/nav-CmZcbPFJ.js +2 -0
  333. package/dist/core/web/public/next/assets/{nav-NVtnuG7A.js.map → nav-CmZcbPFJ.js.map} +1 -1
  334. package/dist/core/web/public/next/assets/{overnight-queries-DGm3qL1b.js → overnight-queries-CR0b_j-V.js} +2 -2
  335. package/dist/core/web/public/next/assets/{overnight-queries-DGm3qL1b.js.map → overnight-queries-CR0b_j-V.js.map} +1 -1
  336. package/dist/core/web/public/next/assets/primitives-DNI-uJBd.js +1 -0
  337. package/dist/core/web/public/next/assets/{queries-CYisSAAB.js → queries-rvRsAGW2.js} +2 -2
  338. package/dist/core/web/public/next/assets/{queries-CYisSAAB.js.map → queries-rvRsAGW2.js.map} +1 -1
  339. package/dist/core/web/public/next/assets/reasoning-pref-DMPQkujg.js +2 -0
  340. package/dist/core/web/public/next/assets/{reasoning-pref-BUcFF_5G.js.map → reasoning-pref-DMPQkujg.js.map} +1 -1
  341. package/dist/core/web/public/next/assets/{reveal-anchor-D-tV8xau.js → reveal-anchor-BKk2wZZZ.js} +2 -2
  342. package/dist/core/web/public/next/assets/{reveal-anchor-D-tV8xau.js.map → reveal-anchor-BKk2wZZZ.js.map} +1 -1
  343. package/dist/core/web/public/next/assets/seat-subscription-CLn2ReSZ.js +2 -0
  344. package/dist/core/web/public/next/assets/{seat-subscription-B-f9ViU2.js.map → seat-subscription-CLn2ReSZ.js.map} +1 -1
  345. package/dist/core/web/public/next/assets/{sidebar-model-DQ-FyBHW.js → sidebar-model-CjQLvdag.js} +2 -2
  346. package/dist/core/web/public/next/assets/{sidebar-model-DQ-FyBHW.js.map → sidebar-model-CjQLvdag.js.map} +1 -1
  347. package/dist/core/web/public/next/assets/slots-DRxNosZg.js +3 -0
  348. package/dist/core/web/public/next/assets/{slots-BhP8b8tf.js.map → slots-DRxNosZg.js.map} +1 -1
  349. package/dist/core/web/public/next/assets/surface-data-DshUC_TU.js +2 -0
  350. package/dist/core/web/public/next/assets/surface-data-DshUC_TU.js.map +1 -0
  351. package/dist/core/web/public/next/assets/surface-prefetch-DO8r4ttQ.js +2 -0
  352. package/dist/core/web/public/next/assets/surface-prefetch-DO8r4ttQ.js.map +1 -0
  353. package/dist/core/web/public/next/assets/{tasks-model-BKDNqmmt.js → tasks-model-BKPFZAmZ.js} +2 -2
  354. package/dist/core/web/public/next/assets/{tasks-model-BKDNqmmt.js.map → tasks-model-BKPFZAmZ.js.map} +1 -1
  355. package/dist/core/web/public/next/assets/{terminal-icons-D2xe-aM1.js → terminal-icons-DoeQkP3y.js} +2 -2
  356. package/dist/core/web/public/next/assets/{terminal-icons-D2xe-aM1.js.map → terminal-icons-DoeQkP3y.js.map} +1 -1
  357. package/dist/core/web/public/next/assets/transient-events-nTLhMBND.js +2 -0
  358. package/dist/core/web/public/next/assets/transient-events-nTLhMBND.js.map +1 -0
  359. package/dist/core/web/public/next/assets/types-D5XOdyw8.js.map +1 -1
  360. package/dist/core/web/public/next/assets/{usage-queries-BZuAANlI.js → usage-queries-MnUeYzwp.js} +2 -2
  361. package/dist/core/web/public/next/assets/{usage-queries-BZuAANlI.js.map → usage-queries-MnUeYzwp.js.map} +1 -1
  362. package/dist/core/web/public/next/assets/{use-guarded-action-Cf4MeNBa.js → use-guarded-action-P12MfNwU.js} +2 -2
  363. package/dist/core/web/public/next/assets/{use-guarded-action-Cf4MeNBa.js.map → use-guarded-action-P12MfNwU.js.map} +1 -1
  364. package/dist/core/web/public/next/assets/{use-ticker-D9yi49my.js → use-ticker-DIvAZ4Ey.js} +2 -2
  365. package/dist/core/web/public/next/assets/{use-ticker-D9yi49my.js.map → use-ticker-DIvAZ4Ey.js.map} +1 -1
  366. package/dist/core/web/public/next/assets/{use-token-gate-DqrSXdX6.js → use-token-gate-DfEja7Wr.js} +2 -2
  367. package/dist/core/web/public/next/assets/{use-token-gate-DqrSXdX6.js.map → use-token-gate-DfEja7Wr.js.map} +1 -1
  368. package/dist/core/web/public/next/assets/useOnboarding-CkOHadqC.js +2 -0
  369. package/dist/core/web/public/next/assets/useOnboarding-CkOHadqC.js.map +1 -0
  370. package/dist/core/web/public/next/assets/useSeatsRefresh-BDlbDlIU.js +2 -0
  371. package/dist/core/web/public/next/assets/useSeatsRefresh-BDlbDlIU.js.map +1 -0
  372. package/dist/core/web/public/next/assets/useVerseTranscript-BGtA55k2.js +2 -0
  373. package/dist/core/web/public/next/assets/{useVerseTranscript-CDYrrWOO.js.map → useVerseTranscript-BGtA55k2.js.map} +1 -1
  374. package/dist/core/web/public/next/assets/verse-icons-wOet9JZy.js +2 -0
  375. package/dist/core/web/public/next/assets/verse-icons-wOet9JZy.js.map +1 -0
  376. package/dist/core/web/public/next/assets/verse-model-CSzzdyu2.js +2 -0
  377. package/dist/core/web/public/next/assets/verse-model-CSzzdyu2.js.map +1 -0
  378. package/dist/core/web/public/next/assets/verse-store-DNVRuiJL.js +2 -0
  379. package/dist/core/web/public/next/assets/verse-store-DNVRuiJL.js.map +1 -0
  380. package/dist/core/web/public/next/assets/warmup-CecO_Nk0.js +3 -0
  381. package/dist/core/web/public/next/assets/{warmup-HG5vYbsN.js.map → warmup-CecO_Nk0.js.map} +1 -1
  382. package/dist/core/web/public/next/assets/why-seat-model-D68ZA7G8.js +2 -0
  383. package/dist/core/web/public/next/assets/why-seat-model-D68ZA7G8.js.map +1 -0
  384. package/dist/core/web/public/next/assets/{workspace-model-CbhdPhei.js → workspace-model-BdIVybKr.js} +2 -2
  385. package/dist/core/web/public/next/assets/{workspace-model-CbhdPhei.js.map → workspace-model-BdIVybKr.js.map} +1 -1
  386. package/dist/core/web/public/next/index.html +1 -1
  387. package/dist/release-dependency-inventory.json +1 -1
  388. package/docs/README.md +2 -1
  389. package/package.json +1 -1
  390. package/dist/core/web/public/next/assets/ActionMenu-FxXeRbPx.js +0 -2
  391. package/dist/core/web/public/next/assets/Advanced-D_eS4472.js +0 -2
  392. package/dist/core/web/public/next/assets/Advanced-D_eS4472.js.map +0 -1
  393. package/dist/core/web/public/next/assets/App-Cj4zKbG3.js +0 -7
  394. package/dist/core/web/public/next/assets/App-Cj4zKbG3.js.map +0 -1
  395. package/dist/core/web/public/next/assets/AppsSection-Ddu_RCQE.js +0 -2
  396. package/dist/core/web/public/next/assets/AppsSection-Ddu_RCQE.js.map +0 -1
  397. package/dist/core/web/public/next/assets/AreaTrend-CDxrQU4b.js +0 -2
  398. package/dist/core/web/public/next/assets/AutonomySection-DuQkHGD_.js +0 -2
  399. package/dist/core/web/public/next/assets/BranchBar-CLsvOcyK.js +0 -2
  400. package/dist/core/web/public/next/assets/BudgetControl-TL3FeZ1D.js +0 -2
  401. package/dist/core/web/public/next/assets/BurnDown-sFXkUGdB.js +0 -2
  402. package/dist/core/web/public/next/assets/BurnDown-sFXkUGdB.js.map +0 -1
  403. package/dist/core/web/public/next/assets/CapacityStrip-qReu0RaF.js +0 -2
  404. package/dist/core/web/public/next/assets/ChatSection-DZuZfTaC.js +0 -3
  405. package/dist/core/web/public/next/assets/ChatSection-DZuZfTaC.js.map +0 -1
  406. package/dist/core/web/public/next/assets/CloudBudgetForm-DJbiT1wi.js +0 -2
  407. package/dist/core/web/public/next/assets/CloudBudgetForm-DJbiT1wi.js.map +0 -1
  408. package/dist/core/web/public/next/assets/CommandPalette-zYLFZRnj.js +0 -2
  409. package/dist/core/web/public/next/assets/CommandPalette-zYLFZRnj.js.map +0 -1
  410. package/dist/core/web/public/next/assets/CommandSection-rIeMK5Ch.js +0 -2
  411. package/dist/core/web/public/next/assets/CommandSection-rIeMK5Ch.js.map +0 -1
  412. package/dist/core/web/public/next/assets/ConfirmDialog-DLrLKM0c.js +0 -2
  413. package/dist/core/web/public/next/assets/Dialog-BS9Dxi3G.js +0 -2
  414. package/dist/core/web/public/next/assets/DiffPane-TOmUf3b2.js +0 -2
  415. package/dist/core/web/public/next/assets/DiffViewer-BpH56302.js +0 -2
  416. package/dist/core/web/public/next/assets/DockHost-DzkzR-HD.js +0 -2
  417. package/dist/core/web/public/next/assets/DockHost-DzkzR-HD.js.map +0 -1
  418. package/dist/core/web/public/next/assets/FleetSection-ViAb549H.js +0 -3
  419. package/dist/core/web/public/next/assets/FleetSection-ViAb549H.js.map +0 -1
  420. package/dist/core/web/public/next/assets/Funnel-D2u7Wlzc.js +0 -2
  421. package/dist/core/web/public/next/assets/GearTray-Cb2npoxM.js +0 -2
  422. package/dist/core/web/public/next/assets/GrowthSection-C5aDPs8B.js +0 -2
  423. package/dist/core/web/public/next/assets/HandoffDialog-BF3AYg-X.js +0 -2
  424. package/dist/core/web/public/next/assets/Input-B5dmGLZx.js +0 -2
  425. package/dist/core/web/public/next/assets/LeaderCard-DZrmjDbI.js +0 -2
  426. package/dist/core/web/public/next/assets/LeaderCard-DZrmjDbI.js.map +0 -1
  427. package/dist/core/web/public/next/assets/MatrixHeatmap-BgEUs2Eu.js +0 -2
  428. package/dist/core/web/public/next/assets/McpSection-DZkiOuoq.js +0 -2
  429. package/dist/core/web/public/next/assets/MessageMarkdown-BauY8ZTY.js +0 -3
  430. package/dist/core/web/public/next/assets/MindSection-BvJXFjyX.js +0 -2
  431. package/dist/core/web/public/next/assets/MindSection-BvJXFjyX.js.map +0 -1
  432. package/dist/core/web/public/next/assets/MutationTokenDialog-mxrw0Yvy.js +0 -2
  433. package/dist/core/web/public/next/assets/NeedsYouDrawer-CO-Balfp.js +0 -2
  434. package/dist/core/web/public/next/assets/NeedsYouList-CzDZbzRD.js +0 -2
  435. package/dist/core/web/public/next/assets/NewChatDialog-B8eJjlFf.js +0 -3
  436. package/dist/core/web/public/next/assets/NewChatDialog-B8eJjlFf.js.map +0 -1
  437. package/dist/core/web/public/next/assets/OnboardingFlow-Cij6KWat.js +0 -2
  438. package/dist/core/web/public/next/assets/OnboardingFlow-Cij6KWat.js.map +0 -1
  439. package/dist/core/web/public/next/assets/OnboardingFlow-DSpPj8UE.css +0 -1
  440. package/dist/core/web/public/next/assets/PreviewPane-BS-CleCd.js +0 -2
  441. package/dist/core/web/public/next/assets/RailStatus-cPRyOmrk.js +0 -2
  442. package/dist/core/web/public/next/assets/ResourcesChrome-BJCauW_t.js +0 -3
  443. package/dist/core/web/public/next/assets/ResourcesChrome-BJCauW_t.js.map +0 -1
  444. package/dist/core/web/public/next/assets/ResourcesDrawer-BDecg6nO.js +0 -2
  445. package/dist/core/web/public/next/assets/ResourcesDrawer-BDecg6nO.js.map +0 -1
  446. package/dist/core/web/public/next/assets/ResourcesDrawer-CSKIO_wZ.css +0 -1
  447. package/dist/core/web/public/next/assets/RouteErrorBoundary-DYtwc2ja.js +0 -2
  448. package/dist/core/web/public/next/assets/RunInCloudAction-BEGEEM8O.js +0 -2
  449. package/dist/core/web/public/next/assets/SeatSelector-CYHRR7Wp.js +0 -3
  450. package/dist/core/web/public/next/assets/Segmented-BE53BenI.js +0 -2
  451. package/dist/core/web/public/next/assets/Select-BwSGkHCS.js +0 -2
  452. package/dist/core/web/public/next/assets/SessionGate-e0dFJm9d.js +0 -2
  453. package/dist/core/web/public/next/assets/SessionInsightChip-CxlSyueJ.js +0 -2
  454. package/dist/core/web/public/next/assets/SessionSearch-_yp7S2TP.js +0 -2
  455. package/dist/core/web/public/next/assets/SettingsSection-wGnpWeGW.js +0 -2
  456. package/dist/core/web/public/next/assets/SettingsSection-wGnpWeGW.js.map +0 -1
  457. package/dist/core/web/public/next/assets/Sheet-DVP2Mgy6.js +0 -2
  458. package/dist/core/web/public/next/assets/ShortcutsOverlay-BcIcoClX.js +0 -2
  459. package/dist/core/web/public/next/assets/Sidebar-DjQOqPbm.js +0 -3
  460. package/dist/core/web/public/next/assets/Sidebar-DjQOqPbm.js.map +0 -1
  461. package/dist/core/web/public/next/assets/Slider-BypUWjpH.js +0 -2
  462. package/dist/core/web/public/next/assets/StepBand-Duz1PUes.js +0 -2
  463. package/dist/core/web/public/next/assets/Surface-B75lVfzm.js +0 -2
  464. package/dist/core/web/public/next/assets/Surface-B75lVfzm.js.map +0 -1
  465. package/dist/core/web/public/next/assets/Surface-DMca0gAe.css +0 -1
  466. package/dist/core/web/public/next/assets/Swimlane-DGcIcnNA.js +0 -2
  467. package/dist/core/web/public/next/assets/TerminalPane-MQT-veKZ.js +0 -7
  468. package/dist/core/web/public/next/assets/TerminalPane-MQT-veKZ.js.map +0 -1
  469. package/dist/core/web/public/next/assets/UniverseConsoleApp-C8yQ0AaR.js +0 -2
  470. package/dist/core/web/public/next/assets/UsageSection-CqxRGJ40.js +0 -2
  471. package/dist/core/web/public/next/assets/UsageSection-CqxRGJ40.js.map +0 -1
  472. package/dist/core/web/public/next/assets/VerseConsoleApp-DTjDpGCd.js +0 -3
  473. package/dist/core/web/public/next/assets/VerseConsoleApp-DTjDpGCd.js.map +0 -1
  474. package/dist/core/web/public/next/assets/Workspace-DfcFGzME.js +0 -10
  475. package/dist/core/web/public/next/assets/Workspace-DfcFGzME.js.map +0 -1
  476. package/dist/core/web/public/next/assets/actions-Ddfg2iLl.css +0 -1
  477. package/dist/core/web/public/next/assets/actions-tWevL9HV.js +0 -2
  478. package/dist/core/web/public/next/assets/actions-tWevL9HV.js.map +0 -1
  479. package/dist/core/web/public/next/assets/apps-model-CDFvmsQV.js +0 -2
  480. package/dist/core/web/public/next/assets/apps-model-CDFvmsQV.js.map +0 -1
  481. package/dist/core/web/public/next/assets/capacity-strip-model-BDbmQ3e3.js +0 -2
  482. package/dist/core/web/public/next/assets/capacity-strip-model-BDbmQ3e3.js.map +0 -1
  483. package/dist/core/web/public/next/assets/charts-CfAjuKMv.js +0 -2
  484. package/dist/core/web/public/next/assets/charts-CfAjuKMv.js.map +0 -1
  485. package/dist/core/web/public/next/assets/charts-uSX6xVYN.css +0 -1
  486. package/dist/core/web/public/next/assets/cloud-C1KPNRHC.css +0 -1
  487. package/dist/core/web/public/next/assets/cloud-queries-Br_r0UAz.js +0 -2
  488. package/dist/core/web/public/next/assets/cloud-queries-Br_r0UAz.js.map +0 -1
  489. package/dist/core/web/public/next/assets/cloud.module-ascz58c3.js +0 -2
  490. package/dist/core/web/public/next/assets/cloud.module-ascz58c3.js.map +0 -1
  491. package/dist/core/web/public/next/assets/command-bus-xYZoK9nQ.js +0 -2
  492. package/dist/core/web/public/next/assets/command-bus-xYZoK9nQ.js.map +0 -1
  493. package/dist/core/web/public/next/assets/command-catalog-Bb_PxC5w.js +0 -2
  494. package/dist/core/web/public/next/assets/command-catalog-Bb_PxC5w.js.map +0 -1
  495. package/dist/core/web/public/next/assets/composer-keys-su0g1h9o.js +0 -2
  496. package/dist/core/web/public/next/assets/composer-keys-su0g1h9o.js.map +0 -1
  497. package/dist/core/web/public/next/assets/context-model-BC-HOmPo.js +0 -2
  498. package/dist/core/web/public/next/assets/context-model-BC-HOmPo.js.map +0 -1
  499. package/dist/core/web/public/next/assets/context-model-CIBmSugV.js +0 -2
  500. package/dist/core/web/public/next/assets/context-model-CIBmSugV.js.map +0 -1
  501. package/dist/core/web/public/next/assets/dark-since-DOMvtB_G.js +0 -2
  502. package/dist/core/web/public/next/assets/dark-since-DOMvtB_G.js.map +0 -1
  503. package/dist/core/web/public/next/assets/dock-icons-CUh8dOxJ.js +0 -2
  504. package/dist/core/web/public/next/assets/dock-store-B2vlxqPu.js +0 -2
  505. package/dist/core/web/public/next/assets/dock-store-B2vlxqPu.js.map +0 -1
  506. package/dist/core/web/public/next/assets/fleet-model-7i-FbzKI.js +0 -2
  507. package/dist/core/web/public/next/assets/fleet-model-7i-FbzKI.js.map +0 -1
  508. package/dist/core/web/public/next/assets/fleet-queries-DzGoqq8X.js +0 -2
  509. package/dist/core/web/public/next/assets/fleet-queries-DzGoqq8X.js.map +0 -1
  510. package/dist/core/web/public/next/assets/format-BkWdOQDL.js +0 -2
  511. package/dist/core/web/public/next/assets/format-BkWdOQDL.js.map +0 -1
  512. package/dist/core/web/public/next/assets/global-oEl9Qj8u.js +0 -2
  513. package/dist/core/web/public/next/assets/guarded-action-OzqcPjmh.js +0 -3
  514. package/dist/core/web/public/next/assets/guarded-action-OzqcPjmh.js.map +0 -1
  515. package/dist/core/web/public/next/assets/icon-base-DvM1eI5V.js +0 -2
  516. package/dist/core/web/public/next/assets/icon-base-DvM1eI5V.js.map +0 -1
  517. package/dist/core/web/public/next/assets/icons-DEQa2rTx.js +0 -2
  518. package/dist/core/web/public/next/assets/icons-DEQa2rTx.js.map +0 -1
  519. package/dist/core/web/public/next/assets/live-model-bmsJgnYD.js +0 -2
  520. package/dist/core/web/public/next/assets/live-model-bmsJgnYD.js.map +0 -1
  521. package/dist/core/web/public/next/assets/local-model-DFyjKX0b.js +0 -2
  522. package/dist/core/web/public/next/assets/local-model-DFyjKX0b.js.map +0 -1
  523. package/dist/core/web/public/next/assets/mind.module-gTGAuJt1.js +0 -2
  524. package/dist/core/web/public/next/assets/mutations-C5S7okTW.js +0 -2
  525. package/dist/core/web/public/next/assets/nav-NVtnuG7A.js +0 -2
  526. package/dist/core/web/public/next/assets/preloaded-Cwf9rsnZ.js +0 -2
  527. package/dist/core/web/public/next/assets/preloaded-Cwf9rsnZ.js.map +0 -1
  528. package/dist/core/web/public/next/assets/primitives-DyCKYSBG.js +0 -1
  529. package/dist/core/web/public/next/assets/reasoning-pref-BUcFF_5G.js +0 -2
  530. package/dist/core/web/public/next/assets/seat-subscription-B-f9ViU2.js +0 -2
  531. package/dist/core/web/public/next/assets/section-visibility-Yctxu-if.js +0 -2
  532. package/dist/core/web/public/next/assets/section-visibility-Yctxu-if.js.map +0 -1
  533. package/dist/core/web/public/next/assets/slots-BhP8b8tf.js +0 -3
  534. package/dist/core/web/public/next/assets/surface-data-DTI7LjvH.js +0 -2
  535. package/dist/core/web/public/next/assets/surface-data-DTI7LjvH.js.map +0 -1
  536. package/dist/core/web/public/next/assets/surface-prefetch-CdUEBFrl.js +0 -2
  537. package/dist/core/web/public/next/assets/surface-prefetch-CdUEBFrl.js.map +0 -1
  538. package/dist/core/web/public/next/assets/useChartWidth-owwodNVz.js +0 -2
  539. package/dist/core/web/public/next/assets/useChartWidth-owwodNVz.js.map +0 -1
  540. package/dist/core/web/public/next/assets/useSeatsRefresh-DgFy-Ph4.js +0 -2
  541. package/dist/core/web/public/next/assets/useSeatsRefresh-DgFy-Ph4.js.map +0 -1
  542. package/dist/core/web/public/next/assets/useVerseTranscript-CDYrrWOO.js +0 -2
  543. package/dist/core/web/public/next/assets/verse-icons-F9VwX07_.js +0 -2
  544. package/dist/core/web/public/next/assets/verse-icons-F9VwX07_.js.map +0 -1
  545. package/dist/core/web/public/next/assets/verse-model-DyCwZF-M.js +0 -2
  546. package/dist/core/web/public/next/assets/verse-model-DyCwZF-M.js.map +0 -1
  547. package/dist/core/web/public/next/assets/verse-store-b_Lek_c5.js +0 -3
  548. package/dist/core/web/public/next/assets/verse-store-b_Lek_c5.js.map +0 -1
  549. package/dist/core/web/public/next/assets/verse-ui-store-62DxpVHS.js +0 -3
  550. package/dist/core/web/public/next/assets/verse-ui-store-62DxpVHS.js.map +0 -1
  551. package/dist/core/web/public/next/assets/viewport-nTubFCwf.js +0 -2
  552. package/dist/core/web/public/next/assets/viewport-nTubFCwf.js.map +0 -1
  553. package/dist/core/web/public/next/assets/warmup-HG5vYbsN.js +0 -3
  554. package/dist/core/web/public/next/assets/workbench-types-DzN-5trg.js +0 -2
  555. package/dist/core/web/public/next/assets/workbench-types-DzN-5trg.js.map +0 -1
  556. /package/dist/core/web/public/next/assets/{BurnDown-BuLMsJMx.css → StatTile-BuLMsJMx.css} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-model-9xywbXxX.js","names":[],"sources":["../../../../../../src/web-ui/routes/verse/usage/context-model.ts"],"sourcesContent":["/**\n * routes/verse/usage/context-model.ts — the ONE projection of context facts\n * for every surface that shows a seat: the seat picker's rows, the new-chat\n * dialog's context block, the resources panel's \"This chat\" efficiency block,\n * and the Usage section's per-seat efficiency table.\n *\n * WHY ONE MODULE. Before V3.9 every surface read `seat.contextWindow` (the\n * DEFAULT model's window) or the session's creation-time window, and three of\n * them rendered \"200k\" for a 1M Claude model. The arithmetic now lives in\n * core/verse/context-math.ts, shared with the server; this module is only the\n * wording and the aggregation, so the picker, the dialog and the panel cannot\n * describe one model's budget three different ways.\n *\n * HONESTY RULES this module enforces (docs/VERSE-CONTEXT.md):\n *\n * 1. UNKNOWN IS NOT A NUMBER. A model whose budget is unknown reads \"window\n * unknown\", never a default dressed as a fact. A Verse fallback window is\n * marked \"est.\", and its source says so in words.\n * 2. AN UPPER BOUND IS NOT A MEASUREMENT. Codex's turn total sums every model\n * call; until its rollout is read, occupancy is \"≤ N\", and any statistic\n * built on such a reading carries the same flag.\n * 3. NO CACHE REPORTED IS NOT A 0% HIT RATE. A provider that reported no\n * cache activity at all (Ollama; codex on its very first call) gets \"none\n * reported\", not a 0% that reads \"caching is broken\".\n * 4. NOTHING HERE SPENDS. Every figure is derived from what the server\n * already returned (seats, sessions, the open chat's event log).\n *\n * Pure: no React, no I/O.\n */\nimport {\n CACHE_IDLE_TTL_MS,\n budgetFor,\n cacheHitRatio,\n fitVerdict,\n hasExpansiveMode,\n sessionOverheadTokens,\n} from '../../../../core/verse/context-math.js';\nimport type {\n VerseContextBudget,\n VerseContextFit,\n VerseContextMode,\n VerseEngine,\n VerseEvent,\n VerseFitVerdict,\n VerseModelOption,\n VerseSeat,\n VerseSession,\n VerseUsage,\n VerseWindowSource,\n} from '../../../../core/verse/types.js';\nimport { CODEX_EXPANSIVE_METERING_NOTE, formatContextWindow, modelOptionFor, seatUnavailableReason, sessionContextBudget, WINDOW_SOURCE_TEXT } from '../verse-model.js';\nimport { formatTokens } from '../verse-readouts.js';\nimport { formatWholePercent } from '../autonomy/format.js';\n\n// ---------------------------------------------------------------------------\n// Models and modes\n// ---------------------------------------------------------------------------\n\n/**\n * A seat's option for a model id, matching through the alias table (a chat\n * remembered on `claude-opus-5.5` is the catalog's `claude-opus-5-5`). The\n * lookup itself is verse-model's `modelOptionFor`, the one the context meter\n * uses, so the picker and the meter can never resolve one id two ways.\n */\nexport function seatModelOption(seat: VerseSeat | null | undefined, modelId: string): VerseModelOption | null {\n return seat ? modelOptionFor([seat], { seatId: seat.id, model: modelId }) : null;\n}\n\n/** `mode` when this model has a budget for it, else `standard` — never a mode the CLI cannot be told. */\nexport function resolveContextMode(option: VerseModelOption | null | undefined, mode: VerseContextMode): VerseContextMode {\n return mode !== 'standard' && budgetFor(option, mode) !== null ? mode : 'standard';\n}\n\n/** The budget a model runs with in a mode (resolved), or null when even its standard window is unknown. */\nexport function effectiveBudget(option: VerseModelOption | null | undefined, mode: VerseContextMode): VerseContextBudget | null {\n return budgetFor(option, resolveContextMode(option, mode));\n}\n\n/** Why this model cannot be chosen on this seat, or null when it can. The seat's own outage wins. */\nexport function modelUnavailableReason(seat: VerseSeat, option: VerseModelOption): string | null {\n const seatReason = seatUnavailableReason(seat);\n if (seatReason !== null) return seatReason;\n const reason = option.unavailableReason;\n return typeof reason === 'string' && reason.trim().length > 0 ? reason.trim() : null;\n}\n\nexport const CONTEXT_MODE_LABEL: Record<VerseContextMode, string> = {\n standard: 'Standard',\n expansive: 'Expansive',\n};\n\n/** How each seat's CLI is named when its pinned version is shown. */\nexport const ENGINE_CLI_NAME: Record<VerseEngine, string> = {\n claude: 'Claude Code',\n codex: 'Codex CLI',\n grok: 'Grok CLI',\n local: 'Claude Code',\n};\n\n/** \"Claude Code 2.1.257\" — the binary this seat is pinned to; null when unknown (local seats, old servers). */\nexport function seatCliLine(seat: VerseSeat): string | null {\n const version = typeof seat.cliVersion === 'string' ? seat.cliVersion.trim() : '';\n return version.length > 0 ? `${ENGINE_CLI_NAME[seat.engine]} ${version}` : null;\n}\n\n/** The seat's own plain-language context facts (binary skew, catalog not yet fetched, …). */\nexport function seatContextNotes(seat: VerseSeat): string[] {\n return (seat.notes ?? []).filter((n): n is string => typeof n === 'string' && n.trim().length > 0);\n}\n\n// ---------------------------------------------------------------------------\n// Window provenance\n// ---------------------------------------------------------------------------\n\n// Window provenance wording is verse-model's `WINDOW_SOURCE_TEXT` — the\n// meter's tooltip, the picker and the resources panel all read that one table.\n\nexport function isEstimatedWindow(source: VerseWindowSource | null | undefined): boolean {\n return source === 'fallback';\n}\n\n// ---------------------------------------------------------------------------\n// Picker and dialog wording\n// ---------------------------------------------------------------------------\n\n/**\n * The compact per-model phrase a picker row carries: \"1M ctx · compacts ≈367k\".\n * Uses the budget for `mode` when the model has one, and names the mode only\n * when it is not the default, so an ordinary row stays short.\n */\nexport function modelContextPhrase(option: VerseModelOption, mode: VerseContextMode = 'standard'): string {\n const resolved = resolveContextMode(option, mode);\n const budget = budgetFor(option, resolved);\n if (!budget) return 'window unknown';\n const window = `${formatContextWindow(budget.contextWindow)} ctx${isEstimatedWindow(option.windowSource) ? ' (est.)' : ''}`;\n const compacts = budget.autoCompactAt === null ? '' : ` · compacts ≈${formatTokens(budget.autoCompactAt)}`;\n return `${window}${compacts}${resolved === 'expansive' ? ' (expansive)' : ''}`;\n}\n\n/**\n * The full sentence for a tooltip or the dialog: the window, where each mode\n * compacts, and how the window is known.\n */\nexport function modelContextSentence(option: VerseModelOption): string {\n const standard = budgetFor(option, 'standard');\n const expansive = hasExpansiveMode(option) ? budgetFor(option, 'expansive') : null;\n const parts: string[] = [];\n if (!standard) {\n parts.push('Context window unknown for this model.');\n } else {\n const where = standard.autoCompactAt === null\n ? ''\n : `; compacts at about ${formatTokens(standard.autoCompactAt)}${expansive ? ' in Standard' : ''}`;\n parts.push(`${formatContextWindow(standard.contextWindow)}-token window${where}.`);\n }\n if (expansive) {\n parts.push(`Expansive runs to about ${formatTokens(expansive.autoCompactAt ?? expansive.contextWindow)} before compacting.`);\n }\n if (option.windowSource) parts.push(`Window ${WINDOW_SOURCE_TEXT[option.windowSource]}.`);\n return parts.join(' ');\n}\n\n/**\n * The metering caveat an Expansive cost sentence must carry for this engine,\n * or null when there is none. The wording is verse-model's\n * CODEX_EXPANSIVE_METERING_NOTE — ONE sentence for the new-chat dialog, the\n * handoff dialog, the in-chat mode menu and the \"Expansive could help\" chip.\n * The ratio those surfaces quote (≈3.2× for a 785k vs 245k codex turn) counts\n * re-sent TOKENS only; GPT-5.6-class requests above 272k reportedly also\n * count about 2× against plan limits (docs/VERSE-CONTEXT.md §2.3, a single\n * secondary source), so the note is worded as reported, never as a measured\n * multiplier. Standard never crosses 272k; Expansive does by design.\n */\nexport function expansiveMeteringNote(engine: VerseEngine | null | undefined): string | null {\n return engine === 'codex' ? CODEX_EXPANSIVE_METERING_NOTE : null;\n}\n\n/**\n * \"A turn at 967k re-sends 2.6× the tokens of one at 367k.\" — the only ratio\n * any Expansive cost sentence quotes, and it is arithmetic on the model's own\n * budgets. Null when either compaction point is unknown. It comes BEFORE the\n * codex metering note, whose \"twice that\" refers to it.\n */\nexport function expansiveRatioSentence(option: VerseModelOption | null | undefined): string | null {\n const standard = budgetFor(option, 'standard');\n const expansive = budgetFor(option, 'expansive');\n const stdCap = standard ? standard.autoCompactAt ?? standard.contextWindow : null;\n const expCap = expansive ? expansive.autoCompactAt ?? expansive.contextWindow : null;\n if (stdCap === null || expCap === null || stdCap <= 0) return null;\n return `A turn at ${formatTokens(expCap)} re-sends ${(expCap / stdCap).toFixed(1)}× the tokens of one at ${formatTokens(stdCap)}.`;\n}\n\n/**\n * What each mode costs, in plain words, for the mode selector. Numbers come\n * from the model's own budgets; the only ratio quoted is arithmetic (every\n * turn re-sends everything held, so a turn at X re-sends X/Y of one at Y) —\n * a token ratio, not a usage multiplier, which is why codex also carries the\n * shared metering caveat.\n */\nexport function contextModeDescription(engine: VerseEngine, option: VerseModelOption, mode: VerseContextMode): string {\n const standard = budgetFor(option, 'standard');\n const expansive = budgetFor(option, 'expansive');\n const stdCap = standard ? standard.autoCompactAt ?? standard.contextWindow : null;\n const expCap = expansive ? expansive.autoCompactAt ?? expansive.contextWindow : null;\n if (mode === 'standard' || expCap === null) {\n if (stdCap === null) return 'The CLI compacts at its own default point for this model.';\n return engine === 'claude'\n ? `Compacts at about ${formatTokens(stdCap)}. Every turn re-sends the whole context, so holding it under this point keeps each turn cheaper and recall sharper.`\n : `Compacts at about ${formatTokens(stdCap)} — the CLI's own default budget for this model.`;\n }\n const ratio = expansiveRatioSentence(option);\n const metering = expansiveMeteringNote(engine);\n return `Runs to about ${formatTokens(expCap)} before compacting — for tightly coupled, cross-cutting work that needs everything in view at once. Each turn re-sends everything held, so a long expansive chat uses noticeably more of your plan per turn.${ratio ? ` ${ratio}` : ''}${metering ? ` ${metering}` : ''}`;\n}\n\n/** Why a model offers no mode choice, for the one line where the selector would be. */\nexport function noModeReason(engine: VerseEngine, option: VerseModelOption): string {\n if (!budgetFor(option, 'standard')) return 'This model’s window is unknown, so Verse cannot offer a larger budget for it.';\n if (engine === 'grok' || engine === 'local') return 'One budget: this CLI compacts at its own fixed point, and Verse cannot raise it per chat.';\n return 'One budget: this model has no larger window to expand into.';\n}\n\n// ---------------------------------------------------------------------------\n// Context fit\n// ---------------------------------------------------------------------------\n\n/** Short form for a picker row, where it sits beside the capacity words. */\nexport const FIT_SHORT: Record<VerseFitVerdict, string> = {\n fits: 'code fits',\n tight: 'code fits, tight',\n expansive: 'code needs expansive',\n split: 'code too big — split',\n};\n\n/** Badge text for the chosen model. */\nexport const FIT_LABEL: Record<VerseFitVerdict, string> = {\n fits: 'Fits',\n tight: 'Tight fit',\n expansive: 'Needs expansive',\n split: 'Split the work',\n};\n\n/** A fit reading that is a FLOOR (a root hit its file or time cap). */\nexport function fitIsFloor(fit: VerseContextFit): boolean {\n return fit.roots.some((r) => r.truncated);\n}\n\n/**\n * The verdict for a model IN THE MODE THE CHAT WOULD RUN IN, or null when its\n * budget is unknown (never guessed).\n *\n * `engine` is the seat's engine: the fixed prompt added to the code is that\n * CLI's estimate (context-math `sessionOverheadTokens` — ≈15k local, ≈25k\n * claude), not one flat figure. With a flat 30k a 64k local seat (compacts\n * ≈32.5k) called anything over ~2.5k tokens of code \"too big — split\". Null\n * falls back to the largest estimate.\n *\n * In Standard this is context-math's `fitVerdict` as is — including\n * \"expansive\", the suggestion that only the bigger budget holds the code. In\n * Expansive the bigger budget IS the budget, so the same thresholds are\n * applied to it: the code fits, fits tightly, or no single context on this\n * model holds it. Without this, a chat already set to Expansive would still be\n * told its code \"fits tightly under ≈367k\" — true of a budget it is not using.\n */\nexport function modelFit(\n tokens: number | null | undefined,\n option: VerseModelOption | null | undefined,\n mode: VerseContextMode,\n engine: VerseEngine | null,\n): VerseFitVerdict | null {\n if (typeof tokens !== 'number' || !Number.isFinite(tokens) || tokens < 0) return null;\n const overhead = sessionOverheadTokens(engine);\n if (resolveContextMode(option, mode) === 'expansive' && option) {\n const expansive = budgetFor(option, 'expansive')!;\n return fitVerdict(tokens, { ...option, contextWindow: expansive.contextWindow, autoCompactAt: expansive.autoCompactAt, expansive: null }, overhead);\n }\n return fitVerdict(tokens, option, overhead);\n}\n\n/**\n * The sentence under the fit badge, for the verdict `modelFit` gave in the\n * chat's mode. In Standard a tight fit also names the Expansive budget when\n * one exists, and \"needs expansive\" says what to do — suggestions only;\n * nothing here switches the mode.\n */\nexport function fitExplanation(input: {\n verdict: VerseFitVerdict;\n tokens: number;\n option: VerseModelOption;\n mode: VerseContextMode;\n floor?: boolean;\n}): string {\n const amount = `${input.floor ? 'at least ' : ''}~${formatTokens(input.tokens)} tokens of tracked code`;\n const inExpansive = resolveContextMode(input.option, input.mode) === 'expansive';\n const standard = budgetFor(input.option, 'standard');\n const expansive = budgetFor(input.option, 'expansive');\n const stdCap = standard ? formatTokens(standard.autoCompactAt ?? standard.contextWindow) : null;\n const expCap = expansive ? formatTokens(expansive.autoCompactAt ?? expansive.contextWindow) : null;\n const cap = inExpansive ? expCap : stdCap;\n const budget = inExpansive ? 'Expansive budget' : 'budget';\n switch (input.verdict) {\n case 'fits':\n return `All ${amount} fits well inside this model's ${budget}${cap ? ` (compacts ≈${cap})` : ''}, with room left for the conversation.`;\n case 'tight': {\n const roomier = !inExpansive && expCap !== null && hasExpansiveMode(input.option)\n ? ` Expansive (≈${expCap}) would hold it with room to spare.`\n : '';\n return `${capitalize(amount)} fits under the ≈${cap ?? '?'} compaction point${inExpansive ? ' of the Expansive budget' : ''}, with little room for the conversation — expect it to compact if the agent reads widely.${roomier}`;\n }\n case 'expansive':\n return `${capitalize(amount)} is more than the Standard budget (≈${stdCap ?? '?'}) holds; only Expansive (≈${expCap ?? '?'}) takes it all. Switch to Expansive, or narrow the folders to the part you are changing.`;\n case 'split':\n return `${capitalize(amount)} is more than any single context on this model holds${expCap ? `, even Expansive (≈${expCap})` : ''}. Split the work: fan it out across several chats, each scoped to one folder or subsystem, or narrow this chat to the part you are changing.`;\n }\n}\n\n/**\n * How the working-set figure is made — shown once, beside the badge. Names the\n * fixed-prompt figure the verdict added, and calls it an estimate: no CLI\n * reports its base prompt before a turn has run.\n */\nexport function fitMethodNote(engine: VerseEngine | null): string {\n const cli = engine ? ` for ${ENGINE_CLI_NAME[engine]}` : '';\n return `Estimated from the size of tracked text files (bytes ÷ 4), plus an estimated ~${formatTokens(sessionOverheadTokens(engine))} of fixed prompt${cli} that every chat starts with. An upper bound — agents rarely read everything.`;\n}\n\nfunction capitalize(text: string): string {\n return text.length === 0 ? text : text.charAt(0).toUpperCase() + text.slice(1);\n}\n\n// ---------------------------------------------------------------------------\n// One session's context\n// ---------------------------------------------------------------------------\n\nexport interface SessionContextView {\n tokens: number;\n /** False when `tokens` is an upper bound (codex before its rollout is read). */\n exact: boolean;\n window: number | null;\n autoCompactAt: number | null;\n /** How the window is known; null when nothing says (no window, or a stored one without provenance). */\n source: VerseWindowSource | null;\n mode: VerseContextMode;\n /** The session's model has a real expansive budget on its seat. */\n hasModes: boolean;\n}\n\n/**\n * The window a session is measured against, by the precedence every surface\n * shares — runtime → the seat's CURRENT catalog budget for the model and mode\n * → what the record stored → the seat default. The precedence itself lives in\n * verse-model's `sessionContextBudget` (the context meter reads it too); this\n * only adds whether the model offers a second mode, for the panels here.\n */\nexport function sessionContext(session: VerseSession, seats: readonly VerseSeat[]): SessionContextView {\n const budget = sessionContextBudget(seats, session);\n return {\n tokens: Math.floor(budget.contextTokens),\n exact: budget.exact,\n window: budget.contextWindow,\n autoCompactAt: budget.autoCompactAt,\n source: budget.source,\n mode: budget.mode,\n hasModes: hasExpansiveMode(budget.option),\n };\n}\n\n/**\n * Cache-hit ratio, except when the provider reported no cache activity at all\n * — then null (\"none reported\"), because 0% would claim caching failed when\n * the truth is that nothing was said about it.\n */\nexport function reportedCacheHitRatio(usage: Pick<VerseUsage, 'inputTokens' | 'cacheReadTokens' | 'cacheCreationTokens'>): number | null {\n if (usage.cacheReadTokens <= 0 && usage.cacheCreationTokens <= 0) return null;\n return cacheHitRatio(usage);\n}\n\n/** A 0–1 ratio as a whole percent; a real sliver reads \"<1%\", never \"0%\". */\nexport function formatRatio(ratio: number | null): string {\n if (ratio === null || !Number.isFinite(ratio)) return '—';\n return formatWholePercent(ratio);\n}\n\nexport interface TurnContextStats {\n /** Turns with at least one context reading. */\n turns: number;\n /** Mean of each turn's context (its largest trustworthy reading); null with no turns. */\n average: number | null;\n /** Largest per-turn context seen. */\n peak: number | null;\n /** False when any counted turn had only an upper-bound reading. */\n exact: boolean;\n /** Compactions recorded in the log. */\n compactions: number;\n /** Cache-hit ratio of the most recent turn (see `reportedCacheHitRatio`). */\n lastTurnCacheHit: number | null;\n}\n\n/**\n * Context per turn from the open chat's event log.\n *\n * A turn's context is its LARGEST trustworthy reading: within one turn the\n * prompt only grows, except across a compaction, and the peak is what the\n * turn actually paid for. Exact readings (`context` events, usage frames not\n * flagged as upper bounds) win; a turn whose only reading is codex's turn\n * total contributes that total and flags the statistic as an upper bound —\n * that figure can be many times the real prompt, so it is never mixed in\n * where an exact one exists.\n */\nexport function turnContextStats(events: readonly VerseEvent[]): TurnContextStats {\n const perTurn = new Map<string, { exact: number | null; bound: number | null }>();\n let compactions = 0;\n let lastUsage: VerseUsage | null = null;\n const note = (turnId: string, tokens: number, exact: boolean): void => {\n if (!Number.isFinite(tokens) || tokens < 0) return;\n const entry = perTurn.get(turnId) ?? { exact: null, bound: null };\n if (exact) entry.exact = Math.max(entry.exact ?? 0, tokens);\n else entry.bound = Math.max(entry.bound ?? 0, tokens);\n perTurn.set(turnId, entry);\n };\n for (const event of events) {\n switch (event.type) {\n case 'usage':\n lastUsage = event.usage;\n note(event.turnId, event.usage.contextTokens, event.usage.contextTokensExact !== false);\n break;\n case 'context':\n if (event.turnId !== null) note(event.turnId, event.contextTokens, event.exact);\n break;\n case 'compaction':\n compactions += 1;\n break;\n default:\n break;\n }\n }\n let sum = 0;\n let peak: number | null = null;\n let exact = true;\n let turns = 0;\n for (const entry of perTurn.values()) {\n const value = entry.exact ?? entry.bound;\n if (value === null) continue;\n if (entry.exact === null) exact = false;\n turns += 1;\n sum += value;\n peak = peak === null ? value : Math.max(peak, value);\n }\n return {\n turns,\n average: turns === 0 ? null : Math.round(sum / turns),\n peak,\n exact,\n compactions,\n lastTurnCacheHit: lastUsage === null ? null : reportedCacheHitRatio(lastUsage),\n };\n}\n\nexport interface IdleCacheWarning {\n idleMs: number;\n tokens: number;\n /** A local model: the cost is time, not spend. */\n local: boolean;\n}\n\n/**\n * The next turn of an idle chat re-reads its whole context uncached once the\n * provider's prompt cache has expired (CACHE_IDLE_TTL_MS). Below the fixed\n * prompt every new chat on this engine pays anyway (its estimate) there is\n * nothing worth warning about.\n */\nexport function idleCacheWarning(\n session: Pick<VerseSession, 'status' | 'engine'>,\n tokens: number,\n now: number,\n /**\n * When the chat last TALKED to its provider (`lastTurnActivityAt(events)`),\n * never `session.updatedAt`: a rename or mode switch moves that without\n * warming the provider's cache. Null (no turn yet / log not loaded) → no warning.\n */\n lastActivityAt: string | null,\n): IdleCacheWarning | null {\n if (session.status === 'running' || lastActivityAt === null) return null;\n const last = Date.parse(lastActivityAt);\n if (!Number.isFinite(last)) return null;\n const idleMs = now - last;\n if (idleMs < CACHE_IDLE_TTL_MS || tokens < sessionOverheadTokens(session.engine)) return null;\n return { idleMs, tokens, local: session.engine === 'local' };\n}\n\n// ---------------------------------------------------------------------------\n// Per-seat efficiency across sessions (Usage section)\n// ---------------------------------------------------------------------------\n\nexport interface SeatEfficiencyRow {\n seatId: string;\n label: string;\n engine: VerseEngine;\n /** The seat is no longer in the roster (its sessions remain on disk). */\n retired: boolean;\n sessions: number;\n turns: number;\n /** input + cache read + cache write: every prompt token the seat was sent. */\n promptTokens: number;\n outputTokens: number;\n /** Null when the provider reported no cache activity on any of these sessions. */\n cacheHitRatio: number | null;\n compactions: number;\n expansiveSessions: number;\n /** The fullest context among these sessions right now, as a share of its window. */\n fullest: { sessionId: string; title: string; tokens: number; window: number | null; exact: boolean } | null;\n}\n\n/**\n * \"Fullest\" is a share of the window when both windows are known; a context\n * with a known window outranks one without (its fullness is a fact, the other\n * a size); two unknown windows compare by size.\n */\nfunction fuller(a: NonNullable<SeatEfficiencyRow['fullest']>, b: NonNullable<SeatEfficiencyRow['fullest']>): boolean {\n if (a.window !== null && b.window !== null) return a.tokens / a.window > b.tokens / b.window;\n if (a.window !== null) return true;\n if (b.window !== null) return false;\n return a.tokens > b.tokens;\n}\n\n/**\n * Aggregate every session by seat. Ratios are computed from SUMS, never as a\n * mean of per-session ratios — a two-turn chat must not weigh as much as a\n * two-hundred-turn one. Seats with no sessions are omitted rather than shown\n * as zeros. Sorted by prompt tokens, largest first: that is where efficiency\n * matters most.\n */\nexport function seatEfficiency(sessions: readonly VerseSession[], seats: readonly VerseSeat[]): SeatEfficiencyRow[] {\n const bySeat = new Map<string, VerseSession[]>();\n for (const s of sessions) {\n const list = bySeat.get(s.seatId) ?? [];\n list.push(s);\n bySeat.set(s.seatId, list);\n }\n const rows: SeatEfficiencyRow[] = [];\n for (const [seatId, list] of bySeat) {\n const seat = seats.find((s) => s.id === seatId) ?? null;\n let input = 0;\n let read = 0;\n let write = 0;\n let output = 0;\n let turns = 0;\n let compactions = 0;\n let expansiveSessions = 0;\n let fullest: SeatEfficiencyRow['fullest'] = null;\n for (const s of list) {\n input += s.usage.inputTokens;\n read += s.usage.cacheReadTokens;\n write += s.usage.cacheCreationTokens;\n output += s.usage.outputTokens;\n turns += s.turnCount;\n compactions += s.compactionCount ?? 0;\n // The mode as the meter resolves it (verse-model sessionContextBudget),\n // counted before the empty-reading skip: the mode is a fact about the\n // chat, not about its reading.\n const view = sessionContext(s, seats);\n if (view.mode === 'expansive') expansiveSessions += 1;\n if (view.tokens <= 0) continue;\n const candidate = { sessionId: s.id, title: s.title, tokens: view.tokens, window: view.window, exact: view.exact };\n if (fullest === null || fuller(candidate, fullest)) fullest = candidate;\n }\n rows.push({\n seatId,\n label: seat?.label ?? seatId,\n engine: seat?.engine ?? list[0]!.engine,\n retired: seat === null,\n sessions: list.length,\n turns,\n promptTokens: input + read + write,\n outputTokens: output,\n cacheHitRatio: reportedCacheHitRatio({ inputTokens: input, cacheReadTokens: read, cacheCreationTokens: write }),\n compactions,\n expansiveSessions,\n fullest,\n });\n }\n return rows.sort((a, b) => b.promptTokens - a.promptTokens || a.label.localeCompare(b.label));\n}\n"],"mappings":"oKAgEA,SAAgB,EAAgB,EAAoC,EAA0C,CAC5G,OAAO,EAAO,EAAe,CAAC,CAAI,EAAG,CAAE,OAAQ,EAAK,GAAI,MAAO,CAAQ,CAAC,EAAI,IAC9E,CAGA,SAAgB,EAAmB,EAA6C,EAA0C,CACxH,OAAO,IAAS,YAAc,EAAU,EAAQ,CAAI,IAAM,KAAO,EAAO,UAC1E,CAGA,SAAgB,EAAgB,EAA6C,EAAmD,CAC9H,OAAO,EAAU,EAAQ,EAAmB,EAAQ,CAAI,CAAC,CAC3D,CAGA,SAAgB,EAAuB,EAAiB,EAAyC,CAC/F,IAAM,EAAa,EAAsB,CAAI,EAC7C,GAAI,IAAe,KAAM,OAAO,EAChC,IAAM,EAAS,EAAO,kBACtB,OAAO,OAAO,GAAW,UAAY,EAAO,KAAK,CAAC,CAAC,OAAS,EAAI,EAAO,KAAK,EAAI,IAClF,CAEA,IAAa,EAAuD,CAClE,SAAU,WACV,UAAW,WACb,EAGa,EAA+C,CAC1D,OAAQ,cACR,MAAO,YACP,KAAM,WACN,MAAO,aACT,EAGA,SAAgB,EAAY,EAAgC,CAC1D,IAAM,EAAU,OAAO,EAAK,YAAe,SAAW,EAAK,WAAW,KAAK,EAAI,GAC/E,OAAO,EAAQ,OAAS,EAAI,GAAG,EAAgB,EAAK,QAAQ,GAAG,IAAY,IAC7E,CAGA,SAAgB,EAAiB,EAA2B,CAC1D,OAAQ,EAAK,OAAS,CAAC,EAAA,CAAG,OAAQ,GAAmB,OAAO,GAAM,UAAY,EAAE,KAAK,CAAC,CAAC,OAAS,CAAC,CACnG,CASA,SAAgB,EAAkB,EAAuD,CACvF,OAAO,IAAW,UACpB,CAWA,SAAgB,EAAmB,EAA0B,EAAyB,WAAoB,CACxG,IAAM,EAAW,EAAmB,EAAQ,CAAI,E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U,EAAE,MAAM,aAClB,GAAS,EAAE,UACX,GAAe,EAAE,iBAAmB,EAIpC,IAAM,EAAO,EAAe,EAAG,CAAK,EAEpC,GADI,EAAK,OAAS,cAAa,GAAqB,GAChD,EAAK,QAAU,EAAG,SACtB,IAAM,EAAY,CAAE,UAAW,EAAE,GAAI,MAAO,EAAE,MAAO,OAAQ,EAAK,OAAQ,OAAQ,EAAK,OAAQ,MAAO,EAAK,KAAM,GAC7G,IAAY,MAAQ,EAAO,EAAW,CAAO,KAAG,EAAU,EAChE,CACA,EAAK,KAAK,CACR,SACA,MAAO,GAAM,OAAS,EACtB,OAAQ,GAAM,QAAU,EAAK,EAAE,CAAE,OACjC,QAAS,IAAS,KAClB,SAAU,EAAK,OACf,QACA,aAAc,EAAQ,EAAO,EAC7B,aAAc,EACd,cAAe,EAAsB,CAAE,YAAa,EAAO,gBAAiB,EAAM,oBAAqB,CAAM,CAAC,EAC9G,cACA,oBACA,SACF,CAAC,CACH,CACA,OAAO,EAAK,MAAM,EAAG,IAAM,EAAE,aAAe,EAAE,cAAgB,EAAE,MAAM,cAAc,EAAE,KAAK,CAAC,CAC9F"}
@@ -1,2 +1,2 @@
1
- import{D as e,F as t,M as n,O as r,U as i,W as a,l as o,o as s}from"./global-oEl9Qj8u.js";import{C as c,d as l,n as u,r as d}from"./VerseConsoleApp-DTjDpGCd.js";import{d as f}from"./verse-store-b_Lek_c5.js";import{t as p}from"./format-BkWdOQDL.js";var m=`verse-preferences`,h=`verse-memory:`;async function g(e){try{let t=await e.json();if(typeof t.error==`string`&&t.error)return t.error;if(typeof t.note==`string`&&t.note)return t.note}catch{}return null}async function _(e,t){let i=await fetch(e,{method:`GET`,credentials:`same-origin`,headers:{"x-ashlr-read-client":r()},signal:t});if(i.status===401)throw n(),new s(`Read session expired.`,401,e);if(!i.ok){let t=await g(i);throw new s(`GET ${e} failed (HTTP ${i.status})${t?`: ${p(t)}`:``}.`,i.status,e,t)}return await i.json()}async function v(n,r){let i=e();if(!i)throw new d;let a=await o(n,r,i);return t(),a}function y(e,t){let n=t.toString();return n?`${e}?${n}`:e}async function b(e,t){let n={mode:t},r=await v(c(e,`/context-mode`),n);return f(e,r),i(u),r}async function x(e,t={}){let n={};t.includeLastAssistant===!0&&(n.includeLastAssistant=!0);let r=typeof t.focus==`string`?t.focus.trim().slice(0,500):``;return r&&(n.focus=r),v(c(e,`/handoff-preview`),n)}async function S(e){let{source:t}=e,n={projectPath:t.projectPath,seatId:e.seatId,handoffFromSessionId:t.id},r=(t.extraRoots??[]).filter(e=>typeof e==`string`&&e.length>0&&e!==t.projectPath);r.length>0&&(n.extraRoots=r),e.model&&(n.model=e.model),e.contextMode&&(n.contextMode=e.contextMode);let i=e.title?.trim();i&&(n.title=i);let a=await v(`/api/verse/sessions`,n);return l(),a}function C(e){return _(`/api/verse/preferences`,e)}var w={key:m,fetch:e=>C(e)};async function T(e){let t=await v(`/api/verse/preferences`,e);return i(m),a(h),t}function E(e){let t=new URLSearchParams,n=e.workspaceId?.trim()??``,r=e.projectPath?.trim()??``,i=(e.extraRoots??[]).map(e=>e.trim()).filter(e=>e.length>0);if(n){if(r||i.length>0)throw Error(`Estimate a workspace or a folder set, not both.`);t.set(`workspaceId`,n)}else if(r){t.set(`projectPath`,r);for(let e of i)t.append(`extraRoots`,e)}else throw Error(`Pick a project or a workspace to estimate.`);return y(`/api/verse/context-fit`,t)}function D(e,t){return _(E(e),t)}function O(e,t,n){let r=new URLSearchParams({q:e});return typeof t==`number`&&Number.isFinite(t)&&r.set(`limit`,String(Math.max(1,Math.min(50,Math.floor(t))))),_(y(`/api/verse/search`,r),n)}function k(e){return`${h}${e}`}function A(e,t){return _(y(`/api/verse/memory`,new URLSearchParams({projectPath:e})),t)}function j(e){return{key:k(e),fetch:t=>A(e,t)}}async function M(e,t){let n=await v(`/api/verse/memory`,{projectPath:e,content:t});return i(k(e)),n}export{A as a,T as c,M as d,C as i,w as l,D as n,O as o,x as r,b as s,S as t,j as u};
2
- //# sourceMappingURL=context-queries-CrPcHWTz.js.map
1
+ import{D as e,E as t,H as n,P as r,U as i,j as a,l as o,o as s}from"./global-CXHHMz9o.js";import{f as c,i as l,r as u,w as d}from"./VerseConsoleApp-DeuBEvAO.js";import{l as f}from"./verse-store-DNVRuiJL.js";import{t as p}from"./format-DEAaVF6X.js";var m=`verse-preferences`,h=`verse-memory:`;async function g(e){try{let t=await e.json();if(typeof t.error==`string`&&t.error)return t.error;if(typeof t.note==`string`&&t.note)return t.note}catch{}return null}async function _(t,n){let r=await fetch(t,{method:`GET`,credentials:`same-origin`,headers:{"x-ashlr-read-client":e()},signal:n});if(r.status===401)throw a(),new s(`Read session expired.`,401,t);if(!r.ok){let e=await g(r);throw new s(`GET ${t} failed (HTTP ${r.status})${e?`: ${p(e)}`:``}.`,r.status,t,e)}return await r.json()}async function v(e,n){let i=t();if(!i)throw new l;let a=await o(e,n,i);return r(),a}function y(e,t){let n=t.toString();return n?`${e}?${n}`:e}async function b(e,t){let r={mode:t},i=await v(d(e,`/context-mode`),r);return f(e,i),n(u),i}async function x(e,t={}){let n={};t.includeLastAssistant===!0&&(n.includeLastAssistant=!0);let r=typeof t.focus==`string`?t.focus.trim().slice(0,500):``;return r&&(n.focus=r),v(d(e,`/handoff-preview`),n)}async function S(e){let{source:t}=e,n={projectPath:t.projectPath,seatId:e.seatId,handoffFromSessionId:t.id},r=(t.extraRoots??[]).filter(e=>typeof e==`string`&&e.length>0&&e!==t.projectPath);r.length>0&&(n.extraRoots=r),e.model&&(n.model=e.model),e.contextMode&&(n.contextMode=e.contextMode);let i=e.title?.trim();i&&(n.title=i);let a=await v(`/api/verse/sessions`,n);return c(),a}function C(e){return _(`/api/verse/preferences`,e)}var w={key:m,fetch:e=>C(e)};async function T(e){let t=await v(`/api/verse/preferences`,e);return n(m),i(h),t}function E(e){let t=new URLSearchParams,n=e.workspaceId?.trim()??``,r=e.projectPath?.trim()??``,i=(e.extraRoots??[]).map(e=>e.trim()).filter(e=>e.length>0);if(n){if(r||i.length>0)throw Error(`Estimate a workspace or a folder set, not both.`);t.set(`workspaceId`,n)}else if(r){t.set(`projectPath`,r);for(let e of i)t.append(`extraRoots`,e)}else throw Error(`Pick a project or a workspace to estimate.`);return y(`/api/verse/context-fit`,t)}function D(e,t){return _(E(e),t)}function O(e,t,n){let r=new URLSearchParams({q:e});return typeof t==`number`&&Number.isFinite(t)&&r.set(`limit`,String(Math.max(1,Math.min(50,Math.floor(t))))),_(y(`/api/verse/search`,r),n)}function k(e){return`${h}${e}`}function A(e,t){return _(y(`/api/verse/memory`,new URLSearchParams({projectPath:e})),t)}function j(e){return{key:k(e),fetch:t=>A(e,t)}}async function M(e,t){let r=await v(`/api/verse/memory`,{projectPath:e,content:t});return n(k(e)),r}export{A as a,T as c,M as d,C as i,w as l,D as n,O as o,x as r,b as s,S as t,j as u};
2
+ //# sourceMappingURL=context-queries-wvcRnV-I.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context-queries-CrPcHWTz.js","names":[],"sources":["../../../../../../src/web-ui/routes/verse/context/context-queries.ts"],"sourcesContent":["/**\n * routes/verse/context/context-queries.ts — every V3.9 context-orchestration\n * call the Verse console makes (docs/VERSE-CONTEXT.md): context mode, handoff\n * preview + handoff creation, preferences, context fit, session search and\n * shared project memory.\n *\n * Same conventions as ../verse-queries.ts, deliberately:\n *\n * - WRITES pull the held mutation token from auth-store, throw\n * `VerseMutationLockedError` (the SAME class, so ChatSection's `fail`\n * recognises it) when none is held, touch the hold on success, and\n * invalidate exactly the cache keys they obviously change.\n * - READS carry the per-tab read-client proof and report an expired read\n * session, exactly like `apiGet`. They are written out here rather than\n * routed through `apiGet` for one reason: `apiGet` discards the response\n * body on a non-2xx, and the routes below answer a refused read (\"path is\n * not a directory\", \"q must be at least 2 characters\") with a sentence\n * written for a person. Those sentences travel as `ApiError.detail`, the\n * field `describeControlError` already prefers.\n *\n * NOTHING HERE SPENDS. Every route below is deterministic server work\n * (preferences file, git ls-files, events.jsonl scans, a memory file). The\n * one model call a context feature can cause — \"ask this seat to summarize\"\n * — goes through the ordinary `sendVerseTurn`, i.e. through the engine's\n * `startTurn` chokepoint and the local-only policy, never through this file.\n *\n * `handoff-preview` is a POST although it only reads: it spawns\n * `git diff --stat` per root, and the API keeps every spawning route behind\n * the dispatch flag and the mutation token. It therefore needs the token like\n * any write, and the dialog says so.\n */\nimport type { VerseCreateSessionRequest, VerseSession } from '../../../data/api-types.js';\nimport type {\n VerseContextFit,\n VerseContextMode,\n VerseContextModeRequest,\n VerseHandoffPreview,\n VerseHandoffPreviewRequest,\n VersePreferences,\n VersePreferencesUpdate,\n VerseProjectMemory,\n VerseProjectMemoryWrite,\n VerseSearchResponse,\n} from '../../../../core/verse/types.js';\nimport { getMutationToken, reportSessionExpired, getReadClientProof, touchMutationHold } from '../../../data/auth-store.js';\nimport { invalidate, invalidatePrefix } from '../../../data/cache.js';\nimport { ApiError, apiPost } from '../../../data/client.js';\nimport type { QueryDef } from '../../../data/queries.js';\nimport { invalidateVerseLists, verseSessionPath, VERSE_SESSIONS_KEY, VerseMutationLockedError } from '../verse-queries.js';\nimport { setVerseSession } from '../verse-store.js';\nimport { asClause } from '../autonomy/format.js';\n\nexport const VERSE_PREFERENCES_KEY = 'verse-preferences';\n/** Prefix of every per-project memory key; `invalidatePrefix` reaches all of them. */\nexport const VERSE_MEMORY_KEY_PREFIX = 'verse-memory:';\n/** Prefix of every context-fit key (one per root set). */\nexport const VERSE_CONTEXT_FIT_KEY_PREFIX = 'verse-context-fit:';\n\n// ---------------------------------------------------------------------------\n// Transport\n// ---------------------------------------------------------------------------\n\n/** The server's own refusal sentence, when the body carried one. */\nasync function refusalDetail(res: Response): Promise<string | null> {\n try {\n const body = (await res.json()) as { error?: unknown; note?: unknown };\n if (typeof body.error === 'string' && body.error) return body.error;\n if (typeof body.note === 'string' && body.note) return body.note;\n } catch {\n /* not JSON — the status alone has to do */\n }\n return null;\n}\n\n/**\n * GET with the read-client proof. Behaves like `apiGet` (401 reports the\n * expired read session) but keeps the server's refusal sentence.\n */\nasync function getJson<T>(path: string, signal?: AbortSignal): Promise<T> {\n const res = await fetch(path, {\n method: 'GET',\n credentials: 'same-origin',\n headers: { 'x-ashlr-read-client': getReadClientProof() },\n signal,\n });\n if (res.status === 401) {\n reportSessionExpired();\n throw new ApiError('Read session expired.', 401, path);\n }\n if (!res.ok) {\n const detail = await refusalDetail(res);\n // asClause: a detail ending in its own period would otherwise read \"…..\".\n throw new ApiError(`GET ${path} failed (HTTP ${res.status})${detail ? `: ${asClause(detail)}` : ''}.`, res.status, path, detail);\n }\n return (await res.json()) as T;\n}\n\nasync function post<T>(path: string, body: unknown): Promise<T> {\n const token = getMutationToken();\n if (!token) throw new VerseMutationLockedError();\n const result = await apiPost<T>(path, body, token);\n touchMutationHold();\n return result;\n}\n\nfunction withQuery(path: string, params: URLSearchParams): string {\n const query = params.toString();\n return query ? `${path}?${query}` : path;\n}\n\n// ---------------------------------------------------------------------------\n// Context mode\n// ---------------------------------------------------------------------------\n\n/**\n * Switch a session between `standard` and `expansive`. Applies from the next\n * turn (it only changes CLI flags, never prompt content, so the provider's\n * prompt cache survives the switch).\n *\n * The returned record is also written into verse-store, so the meter, the\n * mode chip and the composer hint all move on this response rather than on\n * the next list refresh — whichever component made the call.\n */\nexport async function setSessionContextMode(sessionId: string, mode: VerseContextMode): Promise<VerseSession> {\n const body: VerseContextModeRequest = { mode };\n const session = await post<VerseSession>(verseSessionPath(sessionId, '/context-mode'), body);\n setVerseSession(sessionId, session);\n invalidate(VERSE_SESSIONS_KEY);\n return session;\n}\n\n// ---------------------------------------------------------------------------\n// Handoff\n// ---------------------------------------------------------------------------\n\n/** Longest focus line the API accepts (types.ts VerseHandoffPreviewRequest). */\nexport const HANDOFF_FOCUS_MAX_CHARS = 500;\n\n/**\n * Build the deterministic handoff note for a session. Zero spend: the server\n * reads events.jsonl and a bounded `git diff --stat` per root.\n *\n * Only keys that carry a value are sent — the route rejects unknown keys, and\n * `includeLastAssistant: false` is the default anyway, so omitting it keeps\n * the body minimal and the server's validation the single authority.\n */\nexport async function fetchHandoffPreview(sessionId: string, req: VerseHandoffPreviewRequest = {}): Promise<VerseHandoffPreview> {\n const body: VerseHandoffPreviewRequest = {};\n if (req.includeLastAssistant === true) body.includeLastAssistant = true;\n const focus = typeof req.focus === 'string' ? req.focus.trim().slice(0, HANDOFF_FOCUS_MAX_CHARS) : '';\n if (focus) body.focus = focus;\n return post<VerseHandoffPreview>(verseSessionPath(sessionId, '/handoff-preview'), body);\n}\n\nexport interface HandoffSessionInput {\n /** The session being handed off. Its PINNED roots are reused, see below. */\n source: VerseSession;\n seatId: string;\n model?: string;\n contextMode?: VerseContextMode;\n /** Optional title; absent → the server titles it from the first message. */\n title?: string;\n}\n\n/**\n * Create the session a handoff continues in. FREE: creating a session spawns\n * nothing. The handoff text is NOT sent here — the caller pre-fills the new\n * chat's composer and the operator presses send, so the first (spent) turn is\n * always one the operator read.\n *\n * Roots: the source's PINNED roots (`projectPath` + `extraRoots`), never its\n * `workspaceId`. A session keeps the roots it was created with even if the\n * named workspace was later edited or deleted (types.ts VerseSession\n * `extraRoots`); re-resolving the workspace here would let the continuation\n * silently gain or lose a folder the conversation was about — or fail\n * outright on a deleted workspace. The API also refuses the two spellings\n * mixed, so it is one or the other, and the pinned set is the honest one.\n *\n * The server resolves `handoffFrom.title` from `handoffFromSessionId` itself;\n * nothing about provenance is taken from this body.\n */\nexport async function createHandoffSession(input: HandoffSessionInput): Promise<VerseSession> {\n const { source } = input;\n const req: VerseCreateSessionRequest = {\n projectPath: source.projectPath,\n seatId: input.seatId,\n handoffFromSessionId: source.id,\n };\n const extras = (source.extraRoots ?? []).filter((root) => typeof root === 'string' && root.length > 0 && root !== source.projectPath);\n if (extras.length > 0) req.extraRoots = extras;\n if (input.model) req.model = input.model;\n if (input.contextMode) req.contextMode = input.contextMode;\n const title = input.title?.trim();\n if (title) req.title = title;\n const session = await post<VerseSession>('/api/verse/sessions', req);\n invalidateVerseLists();\n return session;\n}\n\n// ---------------------------------------------------------------------------\n// Preferences\n// ---------------------------------------------------------------------------\n\nexport function fetchPreferences(signal?: AbortSignal): Promise<VersePreferences> {\n return getJson<VersePreferences>('/api/verse/preferences', signal);\n}\n\nexport const versePreferencesQuery: QueryDef<VersePreferences> = {\n key: VERSE_PREFERENCES_KEY,\n fetch: (signal) => fetchPreferences(signal),\n};\n\n/**\n * Change ONE standing preference (the three request forms are exclusive, so a\n * body never changes more than the operator clicked). Memory records carry an\n * `enabled` flag derived from these preferences, so every cached memory read\n * is refreshed too.\n */\nexport async function updatePreferences(update: VersePreferencesUpdate): Promise<VersePreferences> {\n const prefs = await post<VersePreferences>('/api/verse/preferences', update);\n invalidate(VERSE_PREFERENCES_KEY);\n invalidatePrefix(VERSE_MEMORY_KEY_PREFIX);\n return prefs;\n}\n\n// ---------------------------------------------------------------------------\n// Context fit\n// ---------------------------------------------------------------------------\n\nexport interface ContextFitQuery {\n workspaceId?: string;\n projectPath?: string;\n extraRoots?: string[];\n}\n\n/**\n * The query string for a fit request: a workspace id ALONE, or a project path\n * with each extra root as its own repeated `extraRoots` parameter (a path may\n * contain a comma, so a joined list could not be split back honestly). The\n * API refuses the two spellings mixed — refused here first, with the reason.\n */\nexport function contextFitPath(q: ContextFitQuery): string {\n const params = new URLSearchParams();\n const workspaceId = q.workspaceId?.trim() ?? '';\n const projectPath = q.projectPath?.trim() ?? '';\n const extras = (q.extraRoots ?? []).map((r) => r.trim()).filter((r) => r.length > 0);\n if (workspaceId) {\n if (projectPath || extras.length > 0) throw new Error('Estimate a workspace or a folder set, not both.');\n params.set('workspaceId', workspaceId);\n } else if (projectPath) {\n params.set('projectPath', projectPath);\n for (const root of extras) params.append('extraRoots', root);\n } else {\n throw new Error('Pick a project or a workspace to estimate.');\n }\n return withQuery('/api/verse/context-fit', params);\n}\n\n/** How big the reachable code is, in estimated tokens. Zero spend (git ls-files + stat). */\nexport function fetchContextFit(q: ContextFitQuery, signal?: AbortSignal): Promise<VerseContextFit> {\n return getJson<VerseContextFit>(contextFitPath(q), signal);\n}\n\n/** Cache-backed form, keyed by the exact root set, for pickers that re-render often. */\nexport function verseContextFitQuery(q: ContextFitQuery): QueryDef<VerseContextFit> {\n const path = contextFitPath(q);\n return { key: `${VERSE_CONTEXT_FIT_KEY_PREFIX}${path}`, fetch: (signal) => getJson<VerseContextFit>(path, signal) };\n}\n\n// ---------------------------------------------------------------------------\n// Session search\n// ---------------------------------------------------------------------------\n\n/** The API caps `limit` at 50 (session-search.ts); asking for more is refused, so clamp. */\nexport const SEARCH_LIMIT_MAX = 50;\n\n/** Keyword search over past sessions' messages. Zero spend — a bounded scan of events.jsonl. */\nexport function searchSessions(q: string, limit?: number, signal?: AbortSignal): Promise<VerseSearchResponse> {\n const params = new URLSearchParams({ q });\n if (typeof limit === 'number' && Number.isFinite(limit)) {\n params.set('limit', String(Math.max(1, Math.min(SEARCH_LIMIT_MAX, Math.floor(limit)))));\n }\n return getJson<VerseSearchResponse>(withQuery('/api/verse/search', params), signal);\n}\n\n// ---------------------------------------------------------------------------\n// Shared project memory\n// ---------------------------------------------------------------------------\n\n/**\n * The memory record as the browser receives it. The server's public-JSON\n * sanitizer rewrites the home folder as `~` and secret-shaped text as\n * `[REDACTED]` on the way out, so `content` can differ from the file on disk;\n * the route then adds `contentSanitized: true` (absent otherwise). Declared\n * here, not in types.ts: that contract is frozen and the flag is additive.\n */\nexport type VerseProjectMemoryView = VerseProjectMemory & { contentSanitized?: boolean };\n\nexport function verseProjectMemoryKey(projectPath: string): string {\n return `${VERSE_MEMORY_KEY_PREFIX}${projectPath}`;\n}\n\nexport function fetchProjectMemory(projectPath: string, signal?: AbortSignal): Promise<VerseProjectMemoryView> {\n return getJson<VerseProjectMemoryView>(withQuery('/api/verse/memory', new URLSearchParams({ projectPath })), signal);\n}\n\nexport function verseProjectMemoryQuery(projectPath: string): QueryDef<VerseProjectMemoryView> {\n return { key: verseProjectMemoryKey(projectPath), fetch: (signal) => fetchProjectMemory(projectPath, signal) };\n}\n\n/**\n * Replace MEMORY.md for a project (atomic, 0600 on the server, capped at\n * VERSE_MEMORY_MAX_BYTES). `''` clears it. Chats already open keep the block\n * pinned in their instructions at creation; they see the change when they\n * next read the file.\n */\nexport async function writeProjectMemory(projectPath: string, content: string): Promise<VerseProjectMemoryView> {\n const body: VerseProjectMemoryWrite = { projectPath, content };\n const memory = await post<VerseProjectMemoryView>('/api/verse/memory', body);\n invalidate(verseProjectMemoryKey(projectPath));\n return memory;\n}\n"],"mappings":"wPAoDA,IAAa,EAAwB,oBAExB,EAA0B,gBASvC,eAAe,EAAc,EAAuC,CAClE,GAAI,CACF,IAAM,EAAQ,MAAM,EAAI,KAAK,EAC7B,GAAI,OAAO,EAAK,OAAU,UAAY,EAAK,MAAO,OAAO,EAAK,MAC9D,GAAI,OAAO,EAAK,MAAS,UAAY,EAAK,KAAM,OAAO,EAAK,IAC9D,MAAQ,CAER,CACA,OAAO,IACT,CAMA,eAAe,EAAW,EAAc,EAAkC,CACxE,IAAM,EAAM,MAAM,MAAM,EAAM,CAC5B,OAAQ,MACR,YAAa,cACb,QAAS,CAAE,sBAAuB,EAAmB,CAAE,EACvD,QACF,CAAC,EACD,GAAI,EAAI,SAAW,IAEjB,MADA,EAAqB,EACf,IAAI,EAAS,wBAAyB,IAAK,CAAI,EAEvD,GAAI,CAAC,EAAI,GAAI,CACX,IAAM,EAAS,MAAM,EAAc,CAAG,EAEtC,MAAM,IAAI,EAAS,OAAO,EAAK,gBAAgB,EAAI,OAAO,GAAG,EAAS,KAAK,EAAS,CAAM,IAAM,GAAG,GAAI,EAAI,OAAQ,EAAM,CAAM,CACjI,CACA,OAAQ,MAAM,EAAI,KAAK,CACzB,CAEA,eAAe,EAAQ,EAAc,EAA2B,CAC9D,IAAM,EAAQ,EAAiB,EAC/B,GAAI,CAAC,EAAO,MAAM,IAAI,EACtB,IAAM,EAAS,MAAM,EAAW,EAAM,EAAM,CAAK,EAEjD,OADA,EAAkB,EACX,CACT,CAEA,SAAS,EAAU,EAA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,CAC7F,MAAO,CAAE,IAAK,EAAsB,CAAW,EAAG,MAAQ,GAAW,EAAmB,EAAa,CAAM,CAAE,CAC/G,CAQA,eAAsB,EAAmB,EAAqB,EAAkD,CAE9G,IAAM,EAAS,MAAM,EAA6B,oBAAqB,CAD/B,cAAa,SACkB,CAAI,EAE3E,OADA,EAAW,EAAsB,CAAW,CAAC,EACtC,CACT"}
1
+ {"version":3,"file":"context-queries-wvcRnV-I.js","names":[],"sources":["../../../../../../src/web-ui/routes/verse/context/context-queries.ts"],"sourcesContent":["/**\n * routes/verse/context/context-queries.ts — every V3.9 context-orchestration\n * call the Verse console makes (docs/VERSE-CONTEXT.md): context mode, handoff\n * preview + handoff creation, preferences, context fit, session search and\n * shared project memory.\n *\n * Same conventions as ../verse-queries.ts, deliberately:\n *\n * - WRITES pull the held mutation token from auth-store, throw\n * `VerseMutationLockedError` (the SAME class, so ChatSection's `fail`\n * recognises it) when none is held, touch the hold on success, and\n * invalidate exactly the cache keys they obviously change.\n * - READS carry the per-tab read-client proof and report an expired read\n * session, exactly like `apiGet`. They are written out here rather than\n * routed through `apiGet` for one reason: `apiGet` discards the response\n * body on a non-2xx, and the routes below answer a refused read (\"path is\n * not a directory\", \"q must be at least 2 characters\") with a sentence\n * written for a person. Those sentences travel as `ApiError.detail`, the\n * field `describeControlError` already prefers.\n *\n * NOTHING HERE SPENDS. Every route below is deterministic server work\n * (preferences file, git ls-files, events.jsonl scans, a memory file). The\n * one model call a context feature can cause — \"ask this seat to summarize\"\n * — goes through the ordinary `sendVerseTurn`, i.e. through the engine's\n * `startTurn` chokepoint and the local-only policy, never through this file.\n *\n * `handoff-preview` is a POST although it only reads: it spawns\n * `git diff --stat` per root, and the API keeps every spawning route behind\n * the dispatch flag and the mutation token. It therefore needs the token like\n * any write, and the dialog says so.\n */\nimport type { VerseCreateSessionRequest, VerseSession } from '../../../data/api-types.js';\nimport type {\n VerseContextFit,\n VerseContextMode,\n VerseContextModeRequest,\n VerseHandoffPreview,\n VerseHandoffPreviewRequest,\n VersePreferences,\n VersePreferencesUpdate,\n VerseProjectMemory,\n VerseProjectMemoryWrite,\n VerseSearchResponse,\n} from '../../../../core/verse/types.js';\nimport { getMutationToken, reportSessionExpired, getReadClientProof, touchMutationHold } from '../../../data/auth-store.js';\nimport { invalidate, invalidatePrefix } from '../../../data/cache.js';\nimport { ApiError, apiPost } from '../../../data/client.js';\nimport type { QueryDef } from '../../../data/queries.js';\nimport { invalidateVerseLists, verseSessionPath, VERSE_SESSIONS_KEY, VerseMutationLockedError } from '../verse-queries.js';\nimport { setVerseSession } from '../verse-store.js';\nimport { asClause } from '../autonomy/format.js';\n\nexport const VERSE_PREFERENCES_KEY = 'verse-preferences';\n/** Prefix of every per-project memory key; `invalidatePrefix` reaches all of them. */\nexport const VERSE_MEMORY_KEY_PREFIX = 'verse-memory:';\n/** Prefix of every context-fit key (one per root set). */\nexport const VERSE_CONTEXT_FIT_KEY_PREFIX = 'verse-context-fit:';\n\n// ---------------------------------------------------------------------------\n// Transport\n// ---------------------------------------------------------------------------\n\n/** The server's own refusal sentence, when the body carried one. */\nasync function refusalDetail(res: Response): Promise<string | null> {\n try {\n const body = (await res.json()) as { error?: unknown; note?: unknown };\n if (typeof body.error === 'string' && body.error) return body.error;\n if (typeof body.note === 'string' && body.note) return body.note;\n } catch {\n /* not JSON — the status alone has to do */\n }\n return null;\n}\n\n/**\n * GET with the read-client proof. Behaves like `apiGet` (401 reports the\n * expired read session) but keeps the server's refusal sentence.\n */\nasync function getJson<T>(path: string, signal?: AbortSignal): Promise<T> {\n const res = await fetch(path, {\n method: 'GET',\n credentials: 'same-origin',\n headers: { 'x-ashlr-read-client': getReadClientProof() },\n signal,\n });\n if (res.status === 401) {\n reportSessionExpired();\n throw new ApiError('Read session expired.', 401, path);\n }\n if (!res.ok) {\n const detail = await refusalDetail(res);\n // asClause: a detail ending in its own period would otherwise read \"…..\".\n throw new ApiError(`GET ${path} failed (HTTP ${res.status})${detail ? `: ${asClause(detail)}` : ''}.`, res.status, path, detail);\n }\n return (await res.json()) as T;\n}\n\nasync function post<T>(path: string, body: unknown): Promise<T> {\n const token = getMutationToken();\n if (!token) throw new VerseMutationLockedError();\n const result = await apiPost<T>(path, body, token);\n touchMutationHold();\n return result;\n}\n\nfunction withQuery(path: string, params: URLSearchParams): string {\n const query = params.toString();\n return query ? `${path}?${query}` : path;\n}\n\n// ---------------------------------------------------------------------------\n// Context mode\n// ---------------------------------------------------------------------------\n\n/**\n * Switch a session between `standard` and `expansive`. Applies from the next\n * turn (it only changes CLI flags, never prompt content, so the provider's\n * prompt cache survives the switch).\n *\n * The returned record is also written into verse-store, so the meter, the\n * mode chip and the composer hint all move on this response rather than on\n * the next list refresh — whichever component made the call.\n */\nexport async function setSessionContextMode(sessionId: string, mode: VerseContextMode): Promise<VerseSession> {\n const body: VerseContextModeRequest = { mode };\n const session = await post<VerseSession>(verseSessionPath(sessionId, '/context-mode'), body);\n setVerseSession(sessionId, session);\n invalidate(VERSE_SESSIONS_KEY);\n return session;\n}\n\n// ---------------------------------------------------------------------------\n// Handoff\n// ---------------------------------------------------------------------------\n\n/** Longest focus line the API accepts (types.ts VerseHandoffPreviewRequest). */\nexport const HANDOFF_FOCUS_MAX_CHARS = 500;\n\n/**\n * Build the deterministic handoff note for a session. Zero spend: the server\n * reads events.jsonl and a bounded `git diff --stat` per root.\n *\n * Only keys that carry a value are sent — the route rejects unknown keys, and\n * `includeLastAssistant: false` is the default anyway, so omitting it keeps\n * the body minimal and the server's validation the single authority.\n */\nexport async function fetchHandoffPreview(sessionId: string, req: VerseHandoffPreviewRequest = {}): Promise<VerseHandoffPreview> {\n const body: VerseHandoffPreviewRequest = {};\n if (req.includeLastAssistant === true) body.includeLastAssistant = true;\n const focus = typeof req.focus === 'string' ? req.focus.trim().slice(0, HANDOFF_FOCUS_MAX_CHARS) : '';\n if (focus) body.focus = focus;\n return post<VerseHandoffPreview>(verseSessionPath(sessionId, '/handoff-preview'), body);\n}\n\nexport interface HandoffSessionInput {\n /** The session being handed off. Its PINNED roots are reused, see below. */\n source: VerseSession;\n seatId: string;\n model?: string;\n contextMode?: VerseContextMode;\n /** Optional title; absent → the server titles it from the first message. */\n title?: string;\n}\n\n/**\n * Create the session a handoff continues in. FREE: creating a session spawns\n * nothing. The handoff text is NOT sent here — the caller pre-fills the new\n * chat's composer and the operator presses send, so the first (spent) turn is\n * always one the operator read.\n *\n * Roots: the source's PINNED roots (`projectPath` + `extraRoots`), never its\n * `workspaceId`. A session keeps the roots it was created with even if the\n * named workspace was later edited or deleted (types.ts VerseSession\n * `extraRoots`); re-resolving the workspace here would let the continuation\n * silently gain or lose a folder the conversation was about — or fail\n * outright on a deleted workspace. The API also refuses the two spellings\n * mixed, so it is one or the other, and the pinned set is the honest one.\n *\n * The server resolves `handoffFrom.title` from `handoffFromSessionId` itself;\n * nothing about provenance is taken from this body.\n */\nexport async function createHandoffSession(input: HandoffSessionInput): Promise<VerseSession> {\n const { source } = input;\n const req: VerseCreateSessionRequest = {\n projectPath: source.projectPath,\n seatId: input.seatId,\n handoffFromSessionId: source.id,\n };\n const extras = (source.extraRoots ?? []).filter((root) => typeof root === 'string' && root.length > 0 && root !== source.projectPath);\n if (extras.length > 0) req.extraRoots = extras;\n if (input.model) req.model = input.model;\n if (input.contextMode) req.contextMode = input.contextMode;\n const title = input.title?.trim();\n if (title) req.title = title;\n const session = await post<VerseSession>('/api/verse/sessions', req);\n invalidateVerseLists();\n return session;\n}\n\n// ---------------------------------------------------------------------------\n// Preferences\n// ---------------------------------------------------------------------------\n\nexport function fetchPreferences(signal?: AbortSignal): Promise<VersePreferences> {\n return getJson<VersePreferences>('/api/verse/preferences', signal);\n}\n\nexport const versePreferencesQuery: QueryDef<VersePreferences> = {\n key: VERSE_PREFERENCES_KEY,\n fetch: (signal) => fetchPreferences(signal),\n};\n\n/**\n * Change ONE standing preference (the three request forms are exclusive, so a\n * body never changes more than the operator clicked). Memory records carry an\n * `enabled` flag derived from these preferences, so every cached memory read\n * is refreshed too.\n */\nexport async function updatePreferences(update: VersePreferencesUpdate): Promise<VersePreferences> {\n const prefs = await post<VersePreferences>('/api/verse/preferences', update);\n invalidate(VERSE_PREFERENCES_KEY);\n invalidatePrefix(VERSE_MEMORY_KEY_PREFIX);\n return prefs;\n}\n\n// ---------------------------------------------------------------------------\n// Context fit\n// ---------------------------------------------------------------------------\n\nexport interface ContextFitQuery {\n workspaceId?: string;\n projectPath?: string;\n extraRoots?: string[];\n}\n\n/**\n * The query string for a fit request: a workspace id ALONE, or a project path\n * with each extra root as its own repeated `extraRoots` parameter (a path may\n * contain a comma, so a joined list could not be split back honestly). The\n * API refuses the two spellings mixed — refused here first, with the reason.\n */\nexport function contextFitPath(q: ContextFitQuery): string {\n const params = new URLSearchParams();\n const workspaceId = q.workspaceId?.trim() ?? '';\n const projectPath = q.projectPath?.trim() ?? '';\n const extras = (q.extraRoots ?? []).map((r) => r.trim()).filter((r) => r.length > 0);\n if (workspaceId) {\n if (projectPath || extras.length > 0) throw new Error('Estimate a workspace or a folder set, not both.');\n params.set('workspaceId', workspaceId);\n } else if (projectPath) {\n params.set('projectPath', projectPath);\n for (const root of extras) params.append('extraRoots', root);\n } else {\n throw new Error('Pick a project or a workspace to estimate.');\n }\n return withQuery('/api/verse/context-fit', params);\n}\n\n/** How big the reachable code is, in estimated tokens. Zero spend (git ls-files + stat). */\nexport function fetchContextFit(q: ContextFitQuery, signal?: AbortSignal): Promise<VerseContextFit> {\n return getJson<VerseContextFit>(contextFitPath(q), signal);\n}\n\n/** Cache-backed form, keyed by the exact root set, for pickers that re-render often. */\nexport function verseContextFitQuery(q: ContextFitQuery): QueryDef<VerseContextFit> {\n const path = contextFitPath(q);\n return { key: `${VERSE_CONTEXT_FIT_KEY_PREFIX}${path}`, fetch: (signal) => getJson<VerseContextFit>(path, signal) };\n}\n\n// ---------------------------------------------------------------------------\n// Session search\n// ---------------------------------------------------------------------------\n\n/** The API caps `limit` at 50 (session-search.ts); asking for more is refused, so clamp. */\nexport const SEARCH_LIMIT_MAX = 50;\n\n/** Keyword search over past sessions' messages. Zero spend — a bounded scan of events.jsonl. */\nexport function searchSessions(q: string, limit?: number, signal?: AbortSignal): Promise<VerseSearchResponse> {\n const params = new URLSearchParams({ q });\n if (typeof limit === 'number' && Number.isFinite(limit)) {\n params.set('limit', String(Math.max(1, Math.min(SEARCH_LIMIT_MAX, Math.floor(limit)))));\n }\n return getJson<VerseSearchResponse>(withQuery('/api/verse/search', params), signal);\n}\n\n// ---------------------------------------------------------------------------\n// Shared project memory\n// ---------------------------------------------------------------------------\n\n/**\n * The memory record as the browser receives it. The server's public-JSON\n * sanitizer rewrites the home folder as `~` and secret-shaped text as\n * `[REDACTED]` on the way out, so `content` can differ from the file on disk;\n * the route then adds `contentSanitized: true` (absent otherwise). Declared\n * here, not in types.ts: that contract is frozen and the flag is additive.\n */\nexport type VerseProjectMemoryView = VerseProjectMemory & { contentSanitized?: boolean };\n\nexport function verseProjectMemoryKey(projectPath: string): string {\n return `${VERSE_MEMORY_KEY_PREFIX}${projectPath}`;\n}\n\nexport function fetchProjectMemory(projectPath: string, signal?: AbortSignal): Promise<VerseProjectMemoryView> {\n return getJson<VerseProjectMemoryView>(withQuery('/api/verse/memory', new URLSearchParams({ projectPath })), signal);\n}\n\nexport function verseProjectMemoryQuery(projectPath: string): QueryDef<VerseProjectMemoryView> {\n return { key: verseProjectMemoryKey(projectPath), fetch: (signal) => fetchProjectMemory(projectPath, signal) };\n}\n\n/**\n * Replace MEMORY.md for a project (atomic, 0600 on the server, capped at\n * VERSE_MEMORY_MAX_BYTES). `''` clears it. Chats already open keep the block\n * pinned in their instructions at creation; they see the change when they\n * next read the file.\n */\nexport async function writeProjectMemory(projectPath: string, content: string): Promise<VerseProjectMemoryView> {\n const body: VerseProjectMemoryWrite = { projectPath, content };\n const memory = await post<VerseProjectMemoryView>('/api/verse/memory', body);\n invalidate(verseProjectMemoryKey(projectPath));\n return memory;\n}\n"],"mappings":"wPAoDA,IAAa,EAAwB,o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}from"./mutations-C5S7okTW.js";var s={dailyBudgetUsd:{min:0,max:1e3},perTickItems:{min:1,max:50},parallel:{min:1,max:16},intervalMs:{min:3e4,max:864e5},maxConcurrent:{min:1,max:32},concurrency:{min:1,max:32},subscriptionMaxPercent:{min:1,max:100},foundryLimitMax:{min:0,max:1e6}},c=`verse-control`,l=`verse-caps`,u=`verse-scope`,d=`verse-safety`,f=`verse-audit:`,p=500,m={key:c,fetch:e=>r(`/api/verse/control`,e)},h={key:l,fetch:e=>r(`/api/verse/caps`,e)},g={key:d,fetch:e=>r(`/api/verse/safety`,e)};function _(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var v={key:u,fetch:e=>r(`/api/verse/scope`,e)};function y(e={}){let t=Math.min(e.limit??200,p),n=new URLSearchParams;return n.set(`limit`,String(t)),e.action&&n.set(`action`,e.action),e.result&&n.set(`result`,e.result),{key:`${f}${t}:${e.action??``}:${e.result??``}`,fetch:e=>r(`/api/verse/audit?${n.toString()}`,e)}}var b={key:`goals`,fetch:e=>r(`/api/goals`,e)};function x(e){return e==null?{items:[],absent:!0}:Array.isArray(e)?{items:e,absent:!1}:_(e)&&Array.isArray(e.items)?{items:e.items,absent:!1}:{items:[],absent:!0}}var S={key:`backlog`,fetch:e=>r(`/api/backlog`,e).then(x)},C=class extends Error{constructor(){super(`Unlock actions with the mutation token before changing the loop.`),this.name=`VerseControlLockedError`}};async function w(n,r){let a=e();if(!a)throw new C;let o=await i(n,r,a);return t(),o}function T(){n(c)}async function E(e){let t=await w(`/api/verse/caps`,e);return n(l),T(),t}async function D(e){await w(`/api/verse/scope`,e),n(u),T()}async function O(e){let t=await w(`/api/verse/daemon`,{action:e});return T(),n(`daemon`),t}async function k(){await o(),T()}async function A(){await a(),T()}export{O as a,y as c,m as d,b as f,s as h,A as i,S as l,v as m,C as n,E as o,g as p,k as r,D as s,c as t,h as u};
2
- //# sourceMappingURL=control-queries-CmgBgKV7.js.map
1
+ import{E as e,H as t,P as n,c as r,l as i}from"./global-CXHHMz9o.js";import{i as a,n as o}from"./mutations-CbTSofVH.js";var s={dailyBudgetUsd:{min:0,max:1e3},perTickItems:{min:1,max:50},parallel:{min:1,max:16},intervalMs:{min:3e4,max:864e5},maxConcurrent:{min:1,max:32},concurrency:{min:1,max:32},subscriptionMaxPercent:{min:1,max:100},foundryLimitMax:{min:0,max:1e6}},c=`verse-control`,l=`verse-caps`,u=`verse-scope`,d=`verse-safety`,f=`verse-audit:`,p=500,m={key:c,fetch:e=>r(`/api/verse/control`,e)},h={key:l,fetch:e=>r(`/api/verse/caps`,e)},g={key:d,fetch:e=>r(`/api/verse/safety`,e)};function _(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var v={key:u,fetch:e=>r(`/api/verse/scope`,e)};function y(e={}){let t=Math.min(e.limit??200,p),n=new URLSearchParams;return n.set(`limit`,String(t)),e.action&&n.set(`action`,e.action),e.result&&n.set(`result`,e.result),{key:`${f}${t}:${e.action??``}:${e.result??``}`,fetch:e=>r(`/api/verse/audit?${n.toString()}`,e)}}var b={key:`goals`,fetch:e=>r(`/api/goals`,e)};function x(e){return e==null?{items:[],absent:!0}:Array.isArray(e)?{items:e,absent:!1}:_(e)&&Array.isArray(e.items)?{items:e.items,absent:!1}:{items:[],absent:!0}}var S={key:`backlog`,fetch:e=>r(`/api/backlog`,e).then(x)},C=class extends Error{constructor(){super(`Unlock actions with the mutation token before changing the loop.`),this.name=`VerseControlLockedError`}};async function w(t,r){let a=e();if(!a)throw new C;let o=await i(t,r,a);return n(),o}function T(){t(c)}async function E(e){let n=await w(`/api/verse/caps`,e);return t(l),T(),n}async function D(e){await w(`/api/verse/scope`,e),t(u),T()}async function O(e){let n=await w(`/api/verse/daemon`,{action:e});return T(),t(`daemon`),n}async function k(){await o(),T()}async function A(){await a(),T()}export{O as a,y as c,m as d,b as f,s as h,A as i,S as l,v as m,C as n,E as o,g as p,k as r,D as s,c as t,h as u};
2
+ //# sourceMappingURL=control-queries-DB6Kh7UN.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"control-queries-CmgBgKV7.js","names":[],"sources":["../../../../../../src/core/verse/control-types.ts","../../../../../../src/web-ui/routes/verse/autonomy/control-queries.ts"],"sourcesContent":["/**\n * Ashlr Verse — autonomy control-plane contract (V2).\n *\n * V1 (`./types.ts`) is frozen: it describes interactive chat sessions. This\n * module adds the shapes the Autonomy cockpit needs to run the hub's existing\n * autonomous fleet without a terminal — the CONFIGURED caps, the enrollment\n * scope, the audit trail, the kill switch, and the daemon lifecycle.\n *\n * Two hard rules are encoded here rather than left to the UI:\n *\n * 1. The global kill switch (`~/.ashlr/KILL`) is an EMERGENCY STOP, not a\n * pause. It also refuses the agent's own `mcp-native` write tools. Every\n * shape that carries it is named `killSwitch`, and the action that engages\n * it is named `emergencyStop`. It is never called \"pause\".\n *\n * V2.1 adds the control that name was being withheld from: the\n * DAEMON-SCOPED pause (`~/.ashlr/daemon.paused`, see core/daemon/pause.ts).\n * It halts autonomous dispatch and NOTHING else — `assertMayMutate`,\n * `mcp-native`, and `mcp-native-engineer` do not read it. It travels as\n * `pause: VerseDaemonPause`, always a FIELD OF ITS OWN, never merged into\n * `killSwitch`, because the whole point is that the two have different\n * blast radii and the operator must be able to see which one is on.\n * 2. Nothing in this module is a secret. Launcher commands, tokens, and env\n * values never appear in any of these shapes — the daemon lifecycle result\n * carries a pid, never an argv.\n *\n * Everything is a projection of state the hub already computes; nothing here\n * introduces a new source of truth.\n */\n\nimport type { AuditEntry } from '../types.js';\nimport type { PublicDaemonObservation } from '../daemon/public-observation.js';\nimport type { FrontierEngineUsage } from '../usage/frontier-usage.js';\nimport type { SafetyReport } from '../../cli/verify-safety.js';\n\n// ---------------------------------------------------------------------------\n// Errors\n// ---------------------------------------------------------------------------\n\n/**\n * Error codes for `/api/verse/{control,caps,scope,audit,daemon,safety}`.\n * `VERSE_INVALID` / `VERSE_TOO_LARGE` are deliberately the SAME codes V1 uses,\n * so one client error mapper covers both halves of the Verse API.\n */\nexport type VerseControlErrorCode =\n | 'VERSE_INVALID'\n | 'VERSE_REFUSED'\n | 'VERSE_TOO_LARGE'\n | 'VERSE_UNAVAILABLE';\n\n/** Every error body on these routes. */\nexport interface VerseControlError {\n error: string;\n code: VerseControlErrorCode;\n}\n\n// ---------------------------------------------------------------------------\n// Caps — the CONFIGURED limits (GET/POST /api/verse/caps)\n// ---------------------------------------------------------------------------\n\n/** One `cfg.foundry.limits[engine]` entry, flattened for transport. */\nexport interface VerseFoundryLimit {\n /** EngineId key, e.g. 'claude' | 'codex'. */\n engine: string;\n /** Rolling window label, e.g. '1m' | '5m' | '1h' | '1d'. */\n window: string;\n /** Max dispatches per window. 0 means \"no dispatches allowed\". */\n max: number;\n}\n\n/** `cfg.daemon.concurrency` — null per tier means \"not configured, using the default\". */\nexport interface VerseCapsConcurrency {\n local: number | null;\n cloud: number | null;\n total: number | null;\n}\n\n/**\n * The configured autonomy limits. These are the values the daemon actually\n * reads — no route exposed them before V2, which is why the cockpit could not\n * show a cap next to the usage burning against it.\n */\nexport interface VerseCaps {\n /** HARD daily spend ceiling (USD). 0 means the daemon is stopped by budget. */\n dailyBudgetUsd: number;\n /** Backlog items processed per tick. */\n perTickItems: number;\n /** Concurrent sandboxed swarms per tick (batch mode). */\n parallel: number;\n /** Tick interval in loop mode (ms). */\n intervalMs: number;\n /** Daemon execution mode. */\n mode: 'batch' | 'continuous';\n /** Ceiling on in-flight dispatches in continuous mode; null when unset. */\n maxConcurrent: number | null;\n /** Per-tier concurrency budgets; null per tier when unset. */\n concurrency: VerseCapsConcurrency;\n /** Subscription-window throttle percentage (1–100). */\n subscriptionMaxPercent: number;\n /** Per-engine dispatch limits, sorted by engine id. */\n foundryLimits: VerseFoundryLimit[];\n /**\n * HONEST STATE: the cap keys whose value is a built-in default rather than\n * something configured on disk. The UI renders these as \"default\", never as\n * a deliberate choice the operator made. Sorted, stable.\n */\n defaulted: VerseCapKey[];\n}\n\n/** The scalar cap keys a client may update. `foundryLimits` is handled separately. */\nexport type VerseCapKey =\n | 'dailyBudgetUsd'\n | 'perTickItems'\n | 'parallel'\n | 'intervalMs'\n | 'mode'\n | 'maxConcurrent'\n | 'concurrency'\n | 'subscriptionMaxPercent'\n | 'foundryLimits';\n\n/** POST /api/verse/caps — a partial update. Unknown keys are rejected. */\nexport interface VerseCapsUpdate {\n dailyBudgetUsd?: number;\n perTickItems?: number;\n parallel?: number;\n intervalMs?: number;\n mode?: 'batch' | 'continuous';\n maxConcurrent?: number;\n concurrency?: { local?: number; cloud?: number; total?: number };\n subscriptionMaxPercent?: number;\n /** Replaces the named engines' limits; engines not listed are left alone. */\n foundryLimits?: VerseFoundryLimit[];\n}\n\n/**\n * POST /api/verse/caps result. `live: true` is not decoration — the daemon\n * re-reads config at the top of every tick, so a saved cap binds on the next\n * tick without a restart.\n */\nexport interface VerseCapsUpdateResult {\n ok: true;\n /** The cap keys this request actually changed, in request order. */\n applied: VerseCapKey[];\n live: true;\n /** The full caps AFTER the write, re-read from disk. */\n caps: VerseCaps;\n}\n\n// ---------------------------------------------------------------------------\n// Scope — the enrollment registry (GET/POST /api/verse/scope)\n// ---------------------------------------------------------------------------\n\nexport interface VerseScopeRepo {\n path: string;\n name: string;\n /** False when the registry still lists a directory that is gone. */\n exists: boolean;\n}\n\n/**\n * GET /api/verse/scope. An EMPTY `repos` with no `degradedReason` is the\n * valid default state and means the daemon will do nothing at all — the UI\n * must say that plainly rather than rendering an innocuous empty list.\n */\nexport interface VerseScope {\n repos: VerseScopeRepo[];\n /** Present only when enrollment authority could not be read at all. */\n degradedReason?: string;\n}\n\nexport type VerseScopeAction = 'enroll' | 'unenroll';\n\n/** POST /api/verse/scope body. */\nexport interface VerseScopeRequest {\n action: VerseScopeAction;\n path: string;\n}\n\nexport interface VerseScopeResult {\n ok: boolean;\n action: VerseScopeAction;\n /** The canonical (realpath'd) registry path this acted on. */\n path: string;\n /** False when the registry already had the requested state (idempotent). */\n changed: boolean;\n /** Policy reason string, e.g. 'enrolled' | 'already-unenrolled'. */\n reason: string;\n /** The scope AFTER the mutation. */\n scope: VerseScope;\n}\n\n// ---------------------------------------------------------------------------\n// Audit (GET /api/verse/audit)\n// ---------------------------------------------------------------------------\n\nexport type VerseAuditResult = AuditEntry['result'];\n\n/** GET /api/verse/audit?limit=&action=&result= */\nexport interface VerseAuditResponse {\n /** Newest first, already filtered, at most `limit` entries. */\n entries: AuditEntry[];\n /** The effective cap applied to `entries` (never above 500). */\n limit: number;\n /** Echo of the applied filter so the UI cannot drift from what it shows. */\n filter: { action: string | null; result: VerseAuditResult | null };\n /** How many raw entries were scanned before filtering. */\n scanned: number;\n /**\n * True when the scan filled its own ceiling, so older entries MAY exist\n * beyond what was read. Conservative by design: it never claims the reader\n * reached the end of history when it cannot prove that.\n */\n truncated: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Kill switch\n// ---------------------------------------------------------------------------\n\n/**\n * The GLOBAL kill switch (`~/.ashlr/KILL`). `state: 'unknown'` is a real,\n * distinct outcome — the sentinel was uninspectable — and must never be\n * rendered as \"off\".\n */\nexport interface VerseKillSwitch {\n state: 'active' | 'inactive' | 'unknown';\n sourceState: 'healthy' | 'degraded';\n reason: string;\n /**\n * Plain-language statement of blast radius, shipped with the state so no\n * surface can show the switch without the warning.\n */\n note: string;\n}\n\n// ---------------------------------------------------------------------------\n// Daemon pause — the NARROW stop (POST /api/verse/daemon {action:'pause'})\n// ---------------------------------------------------------------------------\n\n/**\n * The DAEMON-SCOPED pause sentinel (`~/.ashlr/daemon.paused`), projected for\n * transport. Shares `VerseKillSwitch`'s shape on purpose — both are sentinels\n * read the same way, and both keep `'unknown'` as a real third state that must\n * never render as \"off\".\n *\n * `state: 'unknown'` is treated by the daemon as PAUSED (fail safe), so the UI\n * must say \"paused — the sentinel could not be read\", not \"running\".\n *\n * The sentinel PATH is deliberately absent: it is machine-local detail the\n * cockpit has no use for, the same omission `VerseKillSwitch` makes.\n */\nexport interface VerseDaemonPause {\n /** 'paused' = dispatch halted. 'running' = proven not paused. */\n state: 'paused' | 'running' | 'unknown';\n sourceState: 'healthy' | 'degraded';\n reason: string;\n /** ISO time the pause was requested; null when not paused or unknown. */\n pausedAt: string | null;\n /** Which surface paused it ('cli' | 'verse-control-plane' | 'unknown'). */\n by: string | null;\n /** Plain-language statement of the NARROW blast radius, shipped with the state. */\n note: string;\n}\n\n// ---------------------------------------------------------------------------\n// Daemon lifecycle (POST /api/verse/daemon)\n// ---------------------------------------------------------------------------\n\n/**\n * 'start' launches the autonomous loop detached (exactly `ashlr daemon start`).\n * 'once' runs a single tick the same way.\n *\n * Three stops, three honestly different scopes:\n * - 'pause' — halts autonomous DISPATCH only. Reversible with 'resume'.\n * Leaves the agent's own write tools alone. The default choice.\n * - 'stop' — the ordinary stop, which today engages the GLOBAL kill switch\n * (`stopDaemon()` is `setKill(true)`), so it is wider than a\n * pause and the result's `note` says so.\n * - emergency stop — not on this route at all (`POST /api/fleet/pause`).\n */\nexport type VerseDaemonAction = 'start' | 'stop' | 'once' | 'pause' | 'resume';\n\n/** Non-secret projection of `~/.ashlr/daemon.json`. */\nexport interface VerseDaemonStateProjection {\n running: boolean;\n pid: number | null;\n startedAt: string | null;\n lastTickAt: string | null;\n todayDate: string | null;\n todaySpentUsd: number;\n itemsProcessed: number;\n}\n\n/**\n * POST /api/verse/daemon result. `pid` is the only thing that ever escapes the\n * spawn — the argv, the env, and the resolved launcher path never do.\n */\nexport interface VerseDaemonActionResult {\n ok: boolean;\n action: VerseDaemonAction;\n /** True when a detached child was launched by this request. */\n spawned: boolean;\n /** The detached child's pid for 'start'/'once'; null otherwise. */\n pid: number | null;\n state: VerseDaemonStateProjection;\n killSwitch: VerseKillSwitch;\n /** The daemon-scoped pause AFTER this action. Never folded into killSwitch. */\n pause: VerseDaemonPause;\n /** One line of plain language about what just happened, for the UI to echo. */\n note: string;\n}\n\n// ---------------------------------------------------------------------------\n// Fleet essentials + control aggregate (GET /api/verse/control)\n// ---------------------------------------------------------------------------\n\n/**\n * The small honest slice of FleetStatus/ControlSnapshot the cockpit needs.\n * Deliberately excludes service file paths and error-log paths: the cockpit\n * does not need them, and keeping them out keeps this payload trivially\n * provable as free of machine-local command detail.\n */\nexport interface VerseFleetEssentials {\n /** Mode the autonomy control loop last directed, when known. */\n directionMode: string | null;\n directionAt: string | null;\n directionReason: string | null;\n autonomyControlLoop: boolean;\n autonomyControlMode: string;\n service: {\n registrationState: 'present' | 'absent' | 'unknown';\n installed: boolean;\n running: boolean;\n runtimeState: string | null;\n };\n /** Freshness of the shared fleet-status cache backing these values. */\n freshness: { stale: boolean; ageMs: number };\n}\n\n/** Today's spend against the configured ceiling. */\nexport interface VerseSpend {\n /** null when the daemon ledger could not be read (NOT zero). */\n todayUsd: number | null;\n /** Calendar day the counter applies to; null before the first tick. */\n todayDate: string | null;\n dailyBudgetUsd: number;\n}\n\n/**\n * GET /api/verse/control — the ONE aggregate the Autonomy view reads.\n * Every field is a projection of an existing snapshot; nothing is recomputed.\n */\nexport interface VerseControlSnapshot {\n generatedAt: string;\n daemon: PublicDaemonObservation;\n fleet: VerseFleetEssentials;\n caps: VerseCaps;\n scope: VerseScope;\n killSwitch: VerseKillSwitch;\n /**\n * The DAEMON-SCOPED pause, as its own field. A cockpit that folded this into\n * `killSwitch` would be back to one control with two names; keeping them\n * separate is what lets the Autonomy view render \"paused\" and \"kill switch\n * engaged\" as the different situations they are.\n */\n pause: VerseDaemonPause;\n /** Pending inbox proposals awaiting a human decision. */\n pendingApprovals: number;\n spend: VerseSpend;\n /** Per-engine quota usage against the configured foundry limits. */\n quota: FrontierEngineUsage[];\n /** False when this server was started without --allow-dispatch: all POSTs 404. */\n dispatchEnabled: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Safety (GET /api/verse/safety)\n// ---------------------------------------------------------------------------\n\n/** GET /api/verse/safety — the `ashlr verify-safety --json` report, unmodified. */\nexport type VerseSafetyReport = SafetyReport;\n\n// ---------------------------------------------------------------------------\n// Bounds (single source of truth — the API validator and the UI share these)\n// ---------------------------------------------------------------------------\n\nexport const VERSE_CAPS_BOUNDS = {\n dailyBudgetUsd: { min: 0, max: 1_000 },\n perTickItems: { min: 1, max: 50 },\n parallel: { min: 1, max: 16 },\n intervalMs: { min: 30_000, max: 86_400_000 },\n maxConcurrent: { min: 1, max: 32 },\n /**\n * DELIBERATE DEVIATION from VERSE-CONTRACT-V2's \"concurrency 0-32 each\".\n *\n * The daemon cannot honour a zero tier. `resolveCfg` (daemon/loop.ts) only\n * adopts a tier when it is `> 0`, and `TieredPool`'s constructor floors\n * every cap at `Math.max(1, …)` on top of that — so a stored 0 came back as\n * the built-in 2/6/8 while the cockpit displayed 0. Teaching the pool to\n * accept 0 is not a fix either: `tieredBounded` would then never start a\n * task on that tier and never resolve, i.e. a hung tick.\n *\n * A floor of 1 is therefore the only value that is true in both places. To\n * stop dispatch entirely, the honest lever is `dailyBudgetUsd: 0`, which the\n * daemon now really does obey.\n */\n concurrency: { min: 1, max: 32 },\n subscriptionMaxPercent: { min: 1, max: 100 },\n foundryLimitMax: { min: 0, max: 1_000_000 },\n} as const;\n\n/** Hard ceiling on GET /api/verse/audit `limit`. */\nexport const VERSE_AUDIT_MAX_LIMIT = 500;\n/** Default `limit` when the query omits one. */\nexport const VERSE_AUDIT_DEFAULT_LIMIT = 100;\n/**\n * Hard ceiling on how many raw audit entries a single request will read before\n * filtering. Bounds the work a filtered query can ask of the disk.\n */\nexport const VERSE_AUDIT_MAX_SCAN = 5_000;\n\n/** The kill switch's blast-radius warning — one string, used everywhere. */\nexport const VERSE_KILL_SWITCH_NOTE =\n 'Emergency stop: the global kill switch also refuses the agent\\'s own write tools, not just the daemon. Use the daemon pause action for an ordinary, reversible halt.';\n\n/**\n * The pause's blast-radius statement — the counterpart to\n * VERSE_KILL_SWITCH_NOTE, shipped with every pause projection so no surface\n * can show the state without the scope. Says what it does NOT do, because\n * that is the entire difference from the control next to it.\n */\nexport const VERSE_DAEMON_PAUSE_NOTE =\n 'Pause: halts autonomous dispatch only. Your own write tools keep working, nothing in flight is rolled back, and Resume restores the loop without a restart.';\n","/**\n * routes/verse/autonomy/control-queries.ts — every `/api/verse/{control,caps,\n * scope,audit,daemon,safety}` call the Autonomy cockpit makes, plus the two\n * existing read-only feeds it borrows (`/api/goals`, `/api/backlog`).\n *\n * Same contract as routes/verse/verse-queries.ts: reads are QueryDefs consumed\n * through useQuery (cache-backed, so a background refresh never blanks a\n * populated panel); writes pull the held mutation token from auth-store, touch\n * the hold on success, and invalidate exactly the keys they affect.\n *\n * Two deliberate choices worth knowing before editing:\n *\n * 1. **The envelopes are now fixed, so nothing is normalized.**\n * `/api/verse/scope` and `/api/verse/audit` are declared in\n * `src/core/verse/control-types.ts` (`VerseScope`, `VerseAuditResponse`)\n * and the handlers serialize exactly those, so these fetchers are typed\n * straight through. The speculative bare-array/wrapper normalization that\n * let this surface ship before the routes existed has been deleted.\n * `/api/backlog` keeps its normalizer — that route really does answer\n * `loadBacklog() ?? null` and is not part of the V2 contract.\n * 2. **Emergency stop is not a route of its own.** The global kill switch is\n * `POST /api/fleet/pause` (and `/resume` to clear), already wrapped in\n * data/mutations.ts. It is re-exported here under honest names so no call\n * site in this folder can accidentally call it \"pause\".\n */\nimport { VERSE_AUDIT_MAX_LIMIT } from './control-types.js';\nimport type { GoalSummary, QueryDef } from '../../../data/queries.js';\nimport { getMutationToken, touchMutationHold } from '../../../data/auth-store.js';\nimport { apiGet, apiPost } from '../../../data/client.js';\nimport { invalidate } from '../../../data/cache.js';\nimport { pauseFleet, resumeFleet } from '../../../data/mutations.js';\nimport type {\n VerseAuditFilters,\n VerseAuditPage,\n VerseCaps,\n VerseCapsApplyResult,\n VerseCapsPatch,\n VerseControlSnapshot,\n VerseDaemonAction,\n VerseDaemonActionResult,\n VerseSafetyReport,\n VerseScope,\n VerseScopePatch,\n} from './control-types.js';\n\nexport const VERSE_CONTROL_KEY = 'verse-control';\nexport const VERSE_CAPS_KEY = 'verse-caps';\nexport const VERSE_SCOPE_KEY = 'verse-scope';\nexport const VERSE_SAFETY_KEY = 'verse-safety';\nexport const VERSE_AUDIT_PREFIX = 'verse-audit:';\n\n/**\n * Server-side cap on `/api/verse/audit`, re-exported from the backend\n * contract module so the client cannot drift from the value the route\n * actually clamps to.\n */\nexport const VERSE_AUDIT_MAX = VERSE_AUDIT_MAX_LIMIT;\n/** Enough rows that the table is the real \"while I was asleep\" view. */\nexport const VERSE_AUDIT_DEFAULT_LIMIT = 200;\n\nexport const verseControlQuery: QueryDef<VerseControlSnapshot> = {\n key: VERSE_CONTROL_KEY,\n fetch: (signal) => apiGet<VerseControlSnapshot>('/api/verse/control', signal),\n};\n\nexport const verseCapsQuery: QueryDef<VerseCaps> = {\n key: VERSE_CAPS_KEY,\n fetch: (signal) => apiGet<VerseCaps>('/api/verse/caps', signal),\n};\n\nexport const verseSafetyQuery: QueryDef<VerseSafetyReport> = {\n key: VERSE_SAFETY_KEY,\n fetch: (signal) => apiGet<VerseSafetyReport>('/api/verse/safety', signal),\n};\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nexport const verseScopeQuery: QueryDef<VerseScope> = {\n key: VERSE_SCOPE_KEY,\n fetch: (signal) => apiGet<VerseScope>('/api/verse/scope', signal),\n};\n\nexport function verseAuditQuery(filters: VerseAuditFilters = {}): QueryDef<VerseAuditPage> {\n const limit = Math.min(filters.limit ?? VERSE_AUDIT_DEFAULT_LIMIT, VERSE_AUDIT_MAX);\n const params = new URLSearchParams();\n params.set('limit', String(limit));\n if (filters.action) params.set('action', filters.action);\n if (filters.result) params.set('result', filters.result);\n return {\n key: `${VERSE_AUDIT_PREFIX}${limit}:${filters.action ?? ''}:${filters.result ?? ''}`,\n fetch: (signal) => apiGet<VerseAuditPage>(`/api/verse/audit?${params.toString()}`, signal),\n };\n}\n\n/**\n * Read-only in V2 — the contract is explicit that no goal-mutation routes get\n * built here. `/api/goals` returns a bare array; `/api/backlog` returns\n * `loadBacklog() ?? null`, i.e. `null` is \"no backlog on disk\", not an error.\n */\nexport const verseGoalsQuery: QueryDef<GoalSummary[]> = {\n key: 'goals',\n fetch: (signal) => apiGet<GoalSummary[]>('/api/goals', signal),\n};\n\n/** One backlog row, narrowed to what the read-only summary renders. */\nexport interface VerseBacklogItem {\n id?: string;\n title?: string;\n repo?: string;\n score?: number;\n source?: string;\n}\n\nexport interface VerseBacklogSummary {\n items: VerseBacklogItem[];\n /** True when the server answered `null` — no backlog has been built yet. */\n absent: boolean;\n}\n\nexport function normalizeBacklog(raw: unknown): VerseBacklogSummary {\n if (raw === null || raw === undefined) return { items: [], absent: true };\n if (Array.isArray(raw)) return { items: raw as VerseBacklogItem[], absent: false };\n if (isRecord(raw) && Array.isArray(raw['items'])) {\n return { items: raw['items'] as VerseBacklogItem[], absent: false };\n }\n return { items: [], absent: true };\n}\n\nexport const verseBacklogQuery: QueryDef<VerseBacklogSummary> = {\n key: 'backlog',\n fetch: (signal) => apiGet<unknown>('/api/backlog', signal).then(normalizeBacklog),\n};\n\n// ---------------------------------------------------------------------------\n// Writes\n// ---------------------------------------------------------------------------\n\n/** Thrown before any network call when no mutation token is held. */\nexport class VerseControlLockedError extends Error {\n constructor() {\n super('Unlock actions with the mutation token before changing the loop.');\n this.name = 'VerseControlLockedError';\n }\n}\n\nasync function post<T>(path: string, body: unknown): Promise<T> {\n const token = getMutationToken();\n if (!token) throw new VerseControlLockedError();\n const result = await apiPost<T>(path, body, token);\n touchMutationHold();\n return result;\n}\n\n/** Every panel in the cockpit reads through one of these three. */\nexport function invalidateControl(): void {\n invalidate(VERSE_CONTROL_KEY);\n}\n\nexport async function updateVerseCaps(patch: VerseCapsPatch): Promise<VerseCapsApplyResult> {\n const result = await post<VerseCapsApplyResult>('/api/verse/caps', patch);\n invalidate(VERSE_CAPS_KEY);\n invalidateControl();\n return result;\n}\n\nexport async function updateVerseScope(patch: VerseScopePatch): Promise<void> {\n await post<unknown>('/api/verse/scope', patch);\n invalidate(VERSE_SCOPE_KEY);\n invalidateControl();\n}\n\nexport async function runDaemonAction(action: VerseDaemonAction): Promise<VerseDaemonActionResult> {\n const result = await post<VerseDaemonActionResult>('/api/verse/daemon', { action });\n invalidateControl();\n invalidate('daemon');\n return result;\n}\n\n/**\n * ENGAGE the global kill switch (`~/.ashlr/KILL`). This is `POST\n * /api/fleet/pause` under its honest name: it stops the daemon AND refuses\n * the agent's own mcp-native write tools. Never surface it as \"pause\".\n */\nexport async function engageEmergencyStop(): Promise<void> {\n await pauseFleet();\n invalidateControl();\n}\n\n/** Clear the kill switch — writes become possible again fleet-wide. */\nexport async function releaseEmergencyStop(): Promise<void> {\n await resumeFleet();\n invalidateControl();\n}\n"],"mappings":"wHAmYA,IAAa,EAAoB,CAC/B,eAAgB,CAAE,IAAK,EAAG,IAAK,GAAM,EACrC,aAAc,CAAE,IAAK,EAAG,IAAK,EAAG,EAChC,SAAU,CAAE,IAAK,EAAG,IAAK,EAAG,EAC5B,WAAY,CAAE,IAAK,IAAQ,IAAK,KAAW,EAC3C,cAAe,CAAE,IAAK,EAAG,IAAK,EAAG,EAejC,YAAa,CAAE,IAAK,EAAG,IAAK,EAAG,EAC/B,uBAAwB,CAAE,IAAK,EAAG,IAAK,GAAI,EAC3C,gBAAiB,CAAE,IAAK,EAAG,IAAK,GAAU,CAC5C,EC7Wa,EAAoB,gBACpB,EAAiB,aACjB,EAAkB,cAClB,EAAmB,eACnB,EAAqB,eAOrB,EAAA,IAIA,EAAoD,CAC/D,IAAK,EACL,MAAQ,GAAW,EAA6B,qBAAsB,CAAM,CAC9E,EAEa,EAAsC,CACjD,IAAK,EACL,MAAQ,GAAW,EAAkB,kBAAmB,CAAM,CAChE,EAEa,EAAgD,CAC3D,IAAK,EACL,MAAQ,GAAW,EAA0B,oBAAqB,CAAM,CAC1E,EAEA,SAAS,EAAS,EAAkD,CAClE,OAAO,OAAO,GAAU,YAAY,GAAkB,CAAC,MAAM,QAAQ,CAAK,CAC5E,CAEA,IAAa,EAAwC,CACnD,IAAK,EACL,MAAQ,GAAW,EAAmB,mBA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EA,eAAsB,EAAgB,EAAsD,CAC1F,IAAM,EAAS,MAAM,EAA2B,kBAAmB,CAAK,EAGxE,OAFA,EAAW,CAAc,EACzB,EAAkB,EACX,CACT,CAEA,eAAsB,EAAiB,EAAuC,CAC5E,MAAM,EAAc,mBAAoB,CAAK,EAC7C,EAAW,CAAe,EAC1B,EAAkB,CACpB,CAEA,eAAsB,EAAgB,EAA6D,CACjG,IAAM,EAAS,MAAM,EAA8B,oBAAqB,CAAE,QAAO,CAAC,EAGlF,OAFA,EAAkB,EAClB,EAAW,QAAQ,EACZ,CACT,CAOA,eAAsB,GAAqC,CACzD,MAAM,EAAW,EACjB,EAAkB,CACpB,CAGA,eAAsB,GAAsC,CAC1D,MAAM,EAAY,EAClB,EAAkB,CACpB"}
1
+ {"version":3,"file":"control-queries-DB6Kh7UN.js","names":[],"sources":["../../../../../../src/core/verse/control-types.ts","../../../../../../src/web-ui/routes/verse/autonomy/control-queries.ts"],"sourcesContent":["/**\n * Ashlr Verse — autonomy control-plane contract (V2).\n *\n * V1 (`./types.ts`) is frozen: it describes interactive chat sessions. This\n * module adds the shapes the Autonomy cockpit needs to run the hub's existing\n * autonomous fleet without a terminal — the CONFIGURED caps, the enrollment\n * scope, the audit trail, the kill switch, and the daemon lifecycle.\n *\n * Two hard rules are encoded here rather than left to the UI:\n *\n * 1. The global kill switch (`~/.ashlr/KILL`) is an EMERGENCY STOP, not a\n * pause. It also refuses the agent's own `mcp-native` write tools. Every\n * shape that carries it is named `killSwitch`, and the action that engages\n * it is named `emergencyStop`. It is never called \"pause\".\n *\n * V2.1 adds the control that name was being withheld from: the\n * DAEMON-SCOPED pause (`~/.ashlr/daemon.paused`, see core/daemon/pause.ts).\n * It halts autonomous dispatch and NOTHING else — `assertMayMutate`,\n * `mcp-native`, and `mcp-native-engineer` do not read it. It travels as\n * `pause: VerseDaemonPause`, always a FIELD OF ITS OWN, never merged into\n * `killSwitch`, because the whole point is that the two have different\n * blast radii and the operator must be able to see which one is on.\n * 2. Nothing in this module is a secret. Launcher commands, tokens, and env\n * values never appear in any of these shapes — the daemon lifecycle result\n * carries a pid, never an argv.\n *\n * Everything is a projection of state the hub already computes; nothing here\n * introduces a new source of truth.\n */\n\nimport type { AuditEntry } from '../types.js';\nimport type { PublicDaemonObservation } from '../daemon/public-observation.js';\nimport type { FrontierEngineUsage } from '../usage/frontier-usage.js';\nimport type { SafetyReport } from '../../cli/verify-safety.js';\n\n// ---------------------------------------------------------------------------\n// Errors\n// ---------------------------------------------------------------------------\n\n/**\n * Error codes for `/api/verse/{control,caps,scope,audit,daemon,safety}`.\n * `VERSE_INVALID` / `VERSE_TOO_LARGE` are deliberately the SAME codes V1 uses,\n * so one client error mapper covers both halves of the Verse API.\n */\nexport type VerseControlErrorCode =\n | 'VERSE_INVALID'\n | 'VERSE_REFUSED'\n | 'VERSE_TOO_LARGE'\n | 'VERSE_UNAVAILABLE';\n\n/** Every error body on these routes. */\nexport interface VerseControlError {\n error: string;\n code: VerseControlErrorCode;\n}\n\n// ---------------------------------------------------------------------------\n// Caps — the CONFIGURED limits (GET/POST /api/verse/caps)\n// ---------------------------------------------------------------------------\n\n/** One `cfg.foundry.limits[engine]` entry, flattened for transport. */\nexport interface VerseFoundryLimit {\n /** EngineId key, e.g. 'claude' | 'codex'. */\n engine: string;\n /** Rolling window label, e.g. '1m' | '5m' | '1h' | '1d'. */\n window: string;\n /** Max dispatches per window. 0 means \"no dispatches allowed\". */\n max: number;\n}\n\n/** `cfg.daemon.concurrency` — null per tier means \"not configured, using the default\". */\nexport interface VerseCapsConcurrency {\n local: number | null;\n cloud: number | null;\n total: number | null;\n}\n\n/**\n * The configured autonomy limits. These are the values the daemon actually\n * reads — no route exposed them before V2, which is why the cockpit could not\n * show a cap next to the usage burning against it.\n */\nexport interface VerseCaps {\n /** HARD daily spend ceiling (USD). 0 means the daemon is stopped by budget. */\n dailyBudgetUsd: number;\n /** Backlog items processed per tick. */\n perTickItems: number;\n /** Concurrent sandboxed swarms per tick (batch mode). */\n parallel: number;\n /** Tick interval in loop mode (ms). */\n intervalMs: number;\n /** Daemon execution mode. */\n mode: 'batch' | 'continuous';\n /** Ceiling on in-flight dispatches in continuous mode; null when unset. */\n maxConcurrent: number | null;\n /** Per-tier concurrency budgets; null per tier when unset. */\n concurrency: VerseCapsConcurrency;\n /** Subscription-window throttle percentage (1–100). */\n subscriptionMaxPercent: number;\n /** Per-engine dispatch limits, sorted by engine id. */\n foundryLimits: VerseFoundryLimit[];\n /**\n * HONEST STATE: the cap keys whose value is a built-in default rather than\n * something configured on disk. The UI renders these as \"default\", never as\n * a deliberate choice the operator made. Sorted, stable.\n */\n defaulted: VerseCapKey[];\n}\n\n/** The scalar cap keys a client may update. `foundryLimits` is handled separately. */\nexport type VerseCapKey =\n | 'dailyBudgetUsd'\n | 'perTickItems'\n | 'parallel'\n | 'intervalMs'\n | 'mode'\n | 'maxConcurrent'\n | 'concurrency'\n | 'subscriptionMaxPercent'\n | 'foundryLimits';\n\n/** POST /api/verse/caps — a partial update. Unknown keys are rejected. */\nexport interface VerseCapsUpdate {\n dailyBudgetUsd?: number;\n perTickItems?: number;\n parallel?: number;\n intervalMs?: number;\n mode?: 'batch' | 'continuous';\n maxConcurrent?: number;\n concurrency?: { local?: number; cloud?: number; total?: number };\n subscriptionMaxPercent?: number;\n /** Replaces the named engines' limits; engines not listed are left alone. */\n foundryLimits?: VerseFoundryLimit[];\n}\n\n/**\n * POST /api/verse/caps result. `live: true` is not decoration — the daemon\n * re-reads config at the top of every tick, so a saved cap binds on the next\n * tick without a restart.\n */\nexport interface VerseCapsUpdateResult {\n ok: true;\n /** The cap keys this request actually changed, in request order. */\n applied: VerseCapKey[];\n live: true;\n /** The full caps AFTER the write, re-read from disk. */\n caps: VerseCaps;\n}\n\n// ---------------------------------------------------------------------------\n// Scope — the enrollment registry (GET/POST /api/verse/scope)\n// ---------------------------------------------------------------------------\n\nexport interface VerseScopeRepo {\n path: string;\n name: string;\n /** False when the registry still lists a directory that is gone. */\n exists: boolean;\n}\n\n/**\n * GET /api/verse/scope. An EMPTY `repos` with no `degradedReason` is the\n * valid default state and means the daemon will do nothing at all — the UI\n * must say that plainly rather than rendering an innocuous empty list.\n */\nexport interface VerseScope {\n repos: VerseScopeRepo[];\n /** Present only when enrollment authority could not be read at all. */\n degradedReason?: string;\n}\n\nexport type VerseScopeAction = 'enroll' | 'unenroll';\n\n/** POST /api/verse/scope body. */\nexport interface VerseScopeRequest {\n action: VerseScopeAction;\n path: string;\n}\n\nexport interface VerseScopeResult {\n ok: boolean;\n action: VerseScopeAction;\n /** The canonical (realpath'd) registry path this acted on. */\n path: string;\n /** False when the registry already had the requested state (idempotent). */\n changed: boolean;\n /** Policy reason string, e.g. 'enrolled' | 'already-unenrolled'. */\n reason: string;\n /** The scope AFTER the mutation. */\n scope: VerseScope;\n}\n\n// ---------------------------------------------------------------------------\n// Audit (GET /api/verse/audit)\n// ---------------------------------------------------------------------------\n\nexport type VerseAuditResult = AuditEntry['result'];\n\n/** GET /api/verse/audit?limit=&action=&result= */\nexport interface VerseAuditResponse {\n /** Newest first, already filtered, at most `limit` entries. */\n entries: AuditEntry[];\n /** The effective cap applied to `entries` (never above 500). */\n limit: number;\n /** Echo of the applied filter so the UI cannot drift from what it shows. */\n filter: { action: string | null; result: VerseAuditResult | null };\n /** How many raw entries were scanned before filtering. */\n scanned: number;\n /**\n * True when the scan filled its own ceiling, so older entries MAY exist\n * beyond what was read. Conservative by design: it never claims the reader\n * reached the end of history when it cannot prove that.\n */\n truncated: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Kill switch\n// ---------------------------------------------------------------------------\n\n/**\n * The GLOBAL kill switch (`~/.ashlr/KILL`). `state: 'unknown'` is a real,\n * distinct outcome — the sentinel was uninspectable — and must never be\n * rendered as \"off\".\n */\nexport interface VerseKillSwitch {\n state: 'active' | 'inactive' | 'unknown';\n sourceState: 'healthy' | 'degraded';\n reason: string;\n /**\n * Plain-language statement of blast radius, shipped with the state so no\n * surface can show the switch without the warning.\n */\n note: string;\n}\n\n// ---------------------------------------------------------------------------\n// Daemon pause — the NARROW stop (POST /api/verse/daemon {action:'pause'})\n// ---------------------------------------------------------------------------\n\n/**\n * The DAEMON-SCOPED pause sentinel (`~/.ashlr/daemon.paused`), projected for\n * transport. Shares `VerseKillSwitch`'s shape on purpose — both are sentinels\n * read the same way, and both keep `'unknown'` as a real third state that must\n * never render as \"off\".\n *\n * `state: 'unknown'` is treated by the daemon as PAUSED (fail safe), so the UI\n * must say \"paused — the sentinel could not be read\", not \"running\".\n *\n * The sentinel PATH is deliberately absent: it is machine-local detail the\n * cockpit has no use for, the same omission `VerseKillSwitch` makes.\n */\nexport interface VerseDaemonPause {\n /** 'paused' = dispatch halted. 'running' = proven not paused. */\n state: 'paused' | 'running' | 'unknown';\n sourceState: 'healthy' | 'degraded';\n reason: string;\n /** ISO time the pause was requested; null when not paused or unknown. */\n pausedAt: string | null;\n /** Which surface paused it ('cli' | 'verse-control-plane' | 'unknown'). */\n by: string | null;\n /** Plain-language statement of the NARROW blast radius, shipped with the state. */\n note: string;\n}\n\n// ---------------------------------------------------------------------------\n// Daemon lifecycle (POST /api/verse/daemon)\n// ---------------------------------------------------------------------------\n\n/**\n * 'start' launches the autonomous loop detached (exactly `ashlr daemon start`).\n * 'once' runs a single tick the same way.\n *\n * Three stops, three honestly different scopes:\n * - 'pause' — halts autonomous DISPATCH only. Reversible with 'resume'.\n * Leaves the agent's own write tools alone. The default choice.\n * - 'stop' — the ordinary stop, which today engages the GLOBAL kill switch\n * (`stopDaemon()` is `setKill(true)`), so it is wider than a\n * pause and the result's `note` says so.\n * - emergency stop — not on this route at all (`POST /api/fleet/pause`).\n */\nexport type VerseDaemonAction = 'start' | 'stop' | 'once' | 'pause' | 'resume';\n\n/** Non-secret projection of `~/.ashlr/daemon.json`. */\nexport interface VerseDaemonStateProjection {\n running: boolean;\n pid: number | null;\n startedAt: string | null;\n lastTickAt: string | null;\n todayDate: string | null;\n todaySpentUsd: number;\n itemsProcessed: number;\n}\n\n/**\n * POST /api/verse/daemon result. `pid` is the only thing that ever escapes the\n * spawn — the argv, the env, and the resolved launcher path never do.\n */\nexport interface VerseDaemonActionResult {\n ok: boolean;\n action: VerseDaemonAction;\n /** True when a detached child was launched by this request. */\n spawned: boolean;\n /** The detached child's pid for 'start'/'once'; null otherwise. */\n pid: number | null;\n state: VerseDaemonStateProjection;\n killSwitch: VerseKillSwitch;\n /** The daemon-scoped pause AFTER this action. Never folded into killSwitch. */\n pause: VerseDaemonPause;\n /** One line of plain language about what just happened, for the UI to echo. */\n note: string;\n}\n\n// ---------------------------------------------------------------------------\n// Fleet essentials + control aggregate (GET /api/verse/control)\n// ---------------------------------------------------------------------------\n\n/**\n * The small honest slice of FleetStatus/ControlSnapshot the cockpit needs.\n * Deliberately excludes service file paths and error-log paths: the cockpit\n * does not need them, and keeping them out keeps this payload trivially\n * provable as free of machine-local command detail.\n */\nexport interface VerseFleetEssentials {\n /** Mode the autonomy control loop last directed, when known. */\n directionMode: string | null;\n directionAt: string | null;\n directionReason: string | null;\n autonomyControlLoop: boolean;\n autonomyControlMode: string;\n service: {\n registrationState: 'present' | 'absent' | 'unknown';\n installed: boolean;\n running: boolean;\n runtimeState: string | null;\n };\n /** Freshness of the shared fleet-status cache backing these values. */\n freshness: { stale: boolean; ageMs: number };\n}\n\n/** Today's spend against the configured ceiling. */\nexport interface VerseSpend {\n /** null when the daemon ledger could not be read (NOT zero). */\n todayUsd: number | null;\n /** Calendar day the counter applies to; null before the first tick. */\n todayDate: string | null;\n dailyBudgetUsd: number;\n}\n\n/**\n * GET /api/verse/control — the ONE aggregate the Autonomy view reads.\n * Every field is a projection of an existing snapshot; nothing is recomputed.\n */\nexport interface VerseControlSnapshot {\n generatedAt: string;\n daemon: PublicDaemonObservation;\n fleet: VerseFleetEssentials;\n caps: VerseCaps;\n scope: VerseScope;\n killSwitch: VerseKillSwitch;\n /**\n * The DAEMON-SCOPED pause, as its own field. A cockpit that folded this into\n * `killSwitch` would be back to one control with two names; keeping them\n * separate is what lets the Autonomy view render \"paused\" and \"kill switch\n * engaged\" as the different situations they are.\n */\n pause: VerseDaemonPause;\n /** Pending inbox proposals awaiting a human decision. */\n pendingApprovals: number;\n spend: VerseSpend;\n /** Per-engine quota usage against the configured foundry limits. */\n quota: FrontierEngineUsage[];\n /** False when this server was started without --allow-dispatch: all POSTs 404. */\n dispatchEnabled: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Safety (GET /api/verse/safety)\n// ---------------------------------------------------------------------------\n\n/** GET /api/verse/safety — the `ashlr verify-safety --json` report, unmodified. */\nexport type VerseSafetyReport = SafetyReport;\n\n// ---------------------------------------------------------------------------\n// Bounds (single source of truth — the API validator and the UI share these)\n// ---------------------------------------------------------------------------\n\nexport const VERSE_CAPS_BOUNDS = {\n dailyBudgetUsd: { min: 0, max: 1_000 },\n perTickItems: { min: 1, max: 50 },\n parallel: { min: 1, max: 16 },\n intervalMs: { min: 30_000, max: 86_400_000 },\n maxConcurrent: { min: 1, max: 32 },\n /**\n * DELIBERATE DEVIATION from VERSE-CONTRACT-V2's \"concurrency 0-32 each\".\n *\n * The daemon cannot honour a zero tier. `resolveCfg` (daemon/loop.ts) only\n * adopts a tier when it is `> 0`, and `TieredPool`'s constructor floors\n * every cap at `Math.max(1, …)` on top of that — so a stored 0 came back as\n * the built-in 2/6/8 while the cockpit displayed 0. Teaching the pool to\n * accept 0 is not a fix either: `tieredBounded` would then never start a\n * task on that tier and never resolve, i.e. a hung tick.\n *\n * A floor of 1 is therefore the only value that is true in both places. To\n * stop dispatch entirely, the honest lever is `dailyBudgetUsd: 0`, which the\n * daemon now really does obey.\n */\n concurrency: { min: 1, max: 32 },\n subscriptionMaxPercent: { min: 1, max: 100 },\n foundryLimitMax: { min: 0, max: 1_000_000 },\n} as const;\n\n/** Hard ceiling on GET /api/verse/audit `limit`. */\nexport const VERSE_AUDIT_MAX_LIMIT = 500;\n/** Default `limit` when the query omits one. */\nexport const VERSE_AUDIT_DEFAULT_LIMIT = 100;\n/**\n * Hard ceiling on how many raw audit entries a single request will read before\n * filtering. Bounds the work a filtered query can ask of the disk.\n */\nexport const VERSE_AUDIT_MAX_SCAN = 5_000;\n\n/** The kill switch's blast-radius warning — one string, used everywhere. */\nexport const VERSE_KILL_SWITCH_NOTE =\n 'Emergency stop: the global kill switch also refuses the agent\\'s own write tools, not just the daemon. Use the daemon pause action for an ordinary, reversible halt.';\n\n/**\n * The pause's blast-radius statement — the counterpart to\n * VERSE_KILL_SWITCH_NOTE, shipped with every pause projection so no surface\n * can show the state without the scope. Says what it does NOT do, because\n * that is the entire difference from the control next to it.\n */\nexport const VERSE_DAEMON_PAUSE_NOTE =\n 'Pause: halts autonomous dispatch only. Your own write tools keep working, nothing in flight is rolled back, and Resume restores the loop without a restart.';\n","/**\n * routes/verse/autonomy/control-queries.ts — every `/api/verse/{control,caps,\n * scope,audit,daemon,safety}` call the Autonomy cockpit makes, plus the two\n * existing read-only feeds it borrows (`/api/goals`, `/api/backlog`).\n *\n * Same contract as routes/verse/verse-queries.ts: reads are QueryDefs consumed\n * through useQuery (cache-backed, so a background refresh never blanks a\n * populated panel); writes pull the held mutation token from auth-store, touch\n * the hold on success, and invalidate exactly the keys they affect.\n *\n * Two deliberate choices worth knowing before editing:\n *\n * 1. **The envelopes are now fixed, so nothing is normalized.**\n * `/api/verse/scope` and `/api/verse/audit` are declared in\n * `src/core/verse/control-types.ts` (`VerseScope`, `VerseAuditResponse`)\n * and the handlers serialize exactly those, so these fetchers are typed\n * straight through. The speculative bare-array/wrapper normalization that\n * let this surface ship before the routes existed has been deleted.\n * `/api/backlog` keeps its normalizer — that route really does answer\n * `loadBacklog() ?? null` and is not part of the V2 contract.\n * 2. **Emergency stop is not a route of its own.** The global kill switch is\n * `POST /api/fleet/pause` (and `/resume` to clear), already wrapped in\n * data/mutations.ts. It is re-exported here under honest names so no call\n * site in this folder can accidentally call it \"pause\".\n */\nimport { VERSE_AUDIT_MAX_LIMIT } from './control-types.js';\nimport type { GoalSummary, QueryDef } from '../../../data/queries.js';\nimport { getMutationToken, touchMutationHold } from '../../../data/auth-store.js';\nimport { apiGet, apiPost } from '../../../data/client.js';\nimport { invalidate } from '../../../data/cache.js';\nimport { pauseFleet, resumeFleet } from '../../../data/mutations.js';\nimport type {\n VerseAuditFilters,\n VerseAuditPage,\n VerseCaps,\n VerseCapsApplyResult,\n VerseCapsPatch,\n VerseControlSnapshot,\n VerseDaemonAction,\n VerseDaemonActionResult,\n VerseSafetyReport,\n VerseScope,\n VerseScopePatch,\n} from './control-types.js';\n\nexport const VERSE_CONTROL_KEY = 'verse-control';\nexport const VERSE_CAPS_KEY = 'verse-caps';\nexport const VERSE_SCOPE_KEY = 'verse-scope';\nexport const VERSE_SAFETY_KEY = 'verse-safety';\nexport const VERSE_AUDIT_PREFIX = 'verse-audit:';\n\n/**\n * Server-side cap on `/api/verse/audit`, re-exported from the backend\n * contract module so the client cannot drift from the value the route\n * actually clamps to.\n */\nexport const VERSE_AUDIT_MAX = VERSE_AUDIT_MAX_LIMIT;\n/** Enough rows that the table is the real \"while I was asleep\" view. */\nexport const VERSE_AUDIT_DEFAULT_LIMIT = 200;\n\nexport const verseControlQuery: QueryDef<VerseControlSnapshot> = {\n key: VERSE_CONTROL_KEY,\n fetch: (signal) => apiGet<VerseControlSnapshot>('/api/verse/control', signal),\n};\n\nexport const verseCapsQuery: QueryDef<VerseCaps> = {\n key: VERSE_CAPS_KEY,\n fetch: (signal) => apiGet<VerseCaps>('/api/verse/caps', signal),\n};\n\nexport const verseSafetyQuery: QueryDef<VerseSafetyReport> = {\n key: VERSE_SAFETY_KEY,\n fetch: (signal) => apiGet<VerseSafetyReport>('/api/verse/safety', signal),\n};\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nexport const verseScopeQuery: QueryDef<VerseScope> = {\n key: VERSE_SCOPE_KEY,\n fetch: (signal) => apiGet<VerseScope>('/api/verse/scope', signal),\n};\n\nexport function verseAuditQuery(filters: VerseAuditFilters = {}): QueryDef<VerseAuditPage> {\n const limit = Math.min(filters.limit ?? VERSE_AUDIT_DEFAULT_LIMIT, VERSE_AUDIT_MAX);\n const params = new URLSearchParams();\n params.set('limit', String(limit));\n if (filters.action) params.set('action', filters.action);\n if (filters.result) params.set('result', filters.result);\n return {\n key: `${VERSE_AUDIT_PREFIX}${limit}:${filters.action ?? ''}:${filters.result ?? ''}`,\n fetch: (signal) => apiGet<VerseAuditPage>(`/api/verse/audit?${params.toString()}`, signal),\n };\n}\n\n/**\n * Read-only in V2 — the contract is explicit that no goal-mutation routes get\n * built here. `/api/goals` returns a bare array; `/api/backlog` returns\n * `loadBacklog() ?? null`, i.e. `null` is \"no backlog on disk\", not an error.\n */\nexport const verseGoalsQuery: QueryDef<GoalSummary[]> = {\n key: 'goals',\n fetch: (signal) => apiGet<GoalSummary[]>('/api/goals', signal),\n};\n\n/** One backlog row, narrowed to what the read-only summary renders. */\nexport interface VerseBacklogItem {\n id?: string;\n title?: string;\n repo?: string;\n score?: number;\n source?: string;\n}\n\nexport interface VerseBacklogSummary {\n items: VerseBacklogItem[];\n /** True when the server answered `null` — no backlog has been built yet. */\n absent: boolean;\n}\n\nexport function normalizeBacklog(raw: unknown): VerseBacklogSummary {\n if (raw === null || raw === undefined) return { items: [], absent: true };\n if (Array.isArray(raw)) return { items: raw as VerseBacklogItem[], absent: false };\n if (isRecord(raw) && Array.isArray(raw['items'])) {\n return { items: raw['items'] as VerseBacklogItem[], absent: false };\n }\n return { items: [], absent: true };\n}\n\nexport const verseBacklogQuery: QueryDef<VerseBacklogSummary> = {\n key: 'backlog',\n fetch: (signal) => apiGet<unknown>('/api/backlog', signal).then(normalizeBacklog),\n};\n\n// ---------------------------------------------------------------------------\n// Writes\n// ---------------------------------------------------------------------------\n\n/** Thrown before any network call when no mutation token is held. */\nexport class VerseControlLockedError extends Error {\n constructor() {\n super('Unlock actions with the mutation token before changing the loop.');\n this.name = 'VerseControlLockedError';\n }\n}\n\nasync function post<T>(path: string, body: unknown): Promise<T> {\n const token = getMutationToken();\n if (!token) throw new VerseControlLockedError();\n const result = await apiPost<T>(path, body, token);\n touchMutationHold();\n return result;\n}\n\n/** Every panel in the cockpit reads through one of these three. */\nexport function invalidateControl(): void {\n invalidate(VERSE_CONTROL_KEY);\n}\n\nexport async function updateVerseCaps(patch: VerseCapsPatch): Promise<VerseCapsApplyResult> {\n const result = await post<VerseCapsApplyResult>('/api/verse/caps', patch);\n invalidate(VERSE_CAPS_KEY);\n invalidateControl();\n return result;\n}\n\nexport async function updateVerseScope(patch: VerseScopePatch): Promise<void> {\n await post<unknown>('/api/verse/scope', patch);\n invalidate(VERSE_SCOPE_KEY);\n invalidateControl();\n}\n\nexport async function runDaemonAction(action: VerseDaemonAction): Promise<VerseDaemonActionResult> {\n const result = await post<VerseDaemonActionResult>('/api/verse/daemon', { action });\n invalidateControl();\n invalidate('daemon');\n return result;\n}\n\n/**\n * ENGAGE the global kill switch (`~/.ashlr/KILL`). This is `POST\n * /api/fleet/pause` under its honest name: it stops the daemon AND refuses\n * the agent's own mcp-native write tools. Never surface it as \"pause\".\n */\nexport async function engageEmergencyStop(): Promise<void> {\n await pauseFleet();\n invalidateControl();\n}\n\n/** Clear the kill switch — writes become possible again fleet-wide. */\nexport async function releaseEmergencyStop(): Promise<void> {\n await resumeFleet();\n invalidateControl();\n}\n"],"mappings":"wHAmYA,IAAa,EAAoB,CAC/B,eAAgB,CAAE,IAAK,EAAG,IAAK,GAAM,EACrC,aAAc,CAAE,IAAK,EAAG,IAAK,EAAG,EAChC,SAAU,CAAE,IAAK,EAAG,IAAK,EAAG,EAC5B,WAAY,CAAE,IAAK,IAAQ,IAAK,KAAW,EAC3C,cAAe,CAAE,IAAK,EAAG,IAAK,EAAG,EAejC,YAAa,CAAE,IAAK,EAAG,IAAK,EAAG,EAC/B,uBAAwB,CAAE,IAAK,EAAG,IAAK,GAAI,EAC3C,gBAAiB,CAAE,IAAK,EAAG,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AAQ,EAAM,EAE7D,CAAE,MAAO,CAAC,EAAG,OAAQ,EAAK,CACnC,CAEA,IAAa,EAAmD,CAC9D,IAAK,UACL,MAAQ,GAAW,EAAgB,eAAgB,CAAM,CAAC,CAAC,KAAK,CAAgB,CAClF,EAOa,EAAb,cAA6C,KAAM,CACjD,aAAc,CACZ,MAAM,kEAAkE,EACxE,KAAK,KAAO,yBACd,CACF,EAEA,eAAe,EAAQ,EAAc,EAA2B,CAC9D,IAAM,EAAQ,EAAiB,EAC/B,GAAI,CAAC,EAAO,MAAM,IAAI,EACtB,IAAM,EAAS,MAAM,EAAW,EAAM,EAAM,CAAK,EAEjD,OADA,EAAkB,EACX,CACT,CAGA,SAAgB,GAA0B,CACxC,EAAW,CAAiB,CAC9B,CAEA,eAAsB,EAAgB,EAAsD,CAC1F,IAAM,EAAS,MAAM,EAA2B,kBAAmB,CAAK,EAGxE,OAFA,EAAW,CAAc,EACzB,EAAkB,EACX,CACT,CAEA,eAAsB,EAAiB,EAAuC,CAC5E,MAAM,EAAc,mBAAoB,CAAK,EAC7C,EAAW,CAAe,EAC1B,EAAkB,CACpB,CAEA,eAAsB,EAAgB,EAA6D,CACjG,IAAM,EAAS,MAAM,EAA8B,oBAAqB,CAAE,QAAO,CAAC,EAGlF,OAFA,EAAkB,EAClB,EAAW,QAAQ,EACZ,CACT,CAOA,eAAsB,GAAqC,CACzD,MAAM,EAAW,EACjB,EAAkB,CACpB,CAGA,eAAsB,GAAsC,CAC1D,MAAM,EAAY,EAClB,EAAkB,CACpB"}
@@ -0,0 +1,2 @@
1
+ import{B as e}from"./VerseConsoleApp-DeuBEvAO.js";import{t}from"./command-catalog-CmrHNFzh.js";import{t as n}from"./clipboard-DkZdqlxf.js";async function r(){let r=await n(t);return e(r?`Copied \`${t}\`. Run it in a terminal; add --dry-run to see every step first.`:`Could not reach the clipboard. Run \`${t}\` in a terminal.`,r?`success`:`neutral`),r}export{r as copyAutonomySetupCommand};
2
+ //# sourceMappingURL=copy-setup-CJQhFl-4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-setup-CJQhFl-4.js","names":[],"sources":["../../../../../../src/web-ui/routes/verse/shell/copy-setup.ts"],"sourcesContent":["/**\n * routes/verse/shell/copy-setup.ts — ⌘K \"Copy autonomy setup command\" and\n * onboarding's Copy button: put `ashlr authority setup` on the clipboard and\n * say what to do with it.\n *\n * Split from run-command.ts for the same reason guarded-runners.ts is:\n * run-command is on the chat first-paint path (the shell's key handler runs\n * through it), and nothing here is needed until someone asks to copy — so\n * run-command loads this module with import() when the command runs.\n */\nimport { copyText } from '../../../components/primitives/clipboard.js';\nimport { AUTONOMY_SETUP_COMMAND } from './command-catalog.js';\nimport { shellNotify } from './run-command.js';\n\n/** Copy the setup command and toast the outcome; resolves to whether it was copied. */\nexport async function copyAutonomySetupCommand(): Promise<boolean> {\n const ok = await copyText(AUTONOMY_SETUP_COMMAND);\n shellNotify(\n ok\n ? `Copied \\`${AUTONOMY_SETUP_COMMAND}\\`. Run it in a terminal; add --dry-run to see every step first.`\n : `Could not reach the clipboard. Run \\`${AUTONOMY_SETUP_COMMAND}\\` in a terminal.`,\n ok ? 'success' : 'neutral',\n );\n return ok;\n}\n"],"mappings":"2IAeA,eAAsB,GAA6C,CACjE,IAAM,EAAK,MAAM,EAAS,CAAsB,EAOhD,OANA,EACE,EACI,YAAY,EAAuB,kEACnC,wCAAwC,EAAuB,mBACnE,EAAK,UAAY,SACnB,EACO,CACT"}
@@ -0,0 +1,2 @@
1
+ import{a as e,c as t,n}from"./index-BG177cPN.js";import{w as r}from"./verse-model-CSzzdyu2.js";import{a as i}from"./tool-semantics-GX8ScuSH.js";var a=t(e(),1),o=[],s=(0,a.createContext)(o);function c(e){return e}function l(e){return e.replace(/\\/g,`/`).replace(/\/+$/,``).replace(/^\/private(?=\/(?:tmp|var|etc)(?:\/|$))/,``).replace(/^[A-Z](?=:)/,e=>e.toLowerCase())}function u(e,t=o){let n=l(e),r=``;for(let e of t){let t=l(e);t.length>r.length&&!/^(?:[a-z]:)?$/.test(t)&&(n===t||n.startsWith(`${t}/`))&&(r=t)}let i=e.replace(/[\\/]+$/,``);if(r){let e=n.length-r.length-1;return e>0?i.slice(i.length-e):i.slice(Math.max(i.lastIndexOf(`/`),i.lastIndexOf(`\\`))+1)}if(!/^(?:[\\/]|[A-Za-z]:[\\/])/.test(e))return e.replace(/^\.[\\/]/,``);let a=e.includes(`/`)?`/`:`\\`,s=e.replace(/^[A-Za-z]:/,``).split(/[\\/]/).filter(Boolean);return s.length>4?`…${a}${s.slice(-3).join(a)}`:e}function d(e){let t=typeof e==`object`&&e?e:null;return t&&typeof t.command!=`string`&&typeof t.cmd!=`string`?i(t)[0]??null:null}function f(){let e=(0,a.useContext)(s);return(0,a.useCallback)(t=>u(t,e),[e])}var p={live:`_live_ytrey_7`,line:`_line_ytrey_14`,pulse:`_pulse_ytrey_24`,"live-pulse":`_live-pulse_ytrey_1`,text:`_text_ytrey_34`,word:`_word_ytrey_43`,sep:`_sep_ytrey_44`,figure:`_figure_ytrey_45`,detail:`_detail_ytrey_49`,stop:`_stop_ytrey_58`,stopIcon:`_stopIcon_ytrey_75`,notice:`_notice_ytrey_82`,noticeWord:`_noticeWord_ytrey_94`,noticeText:`_noticeText_ytrey_96`},m=n();function h(e,t){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n.kind===`user`)break;if(n.kind===`tool`){if(n.result===null)return{phase:`tool`,detail:r(n.input)||n.name,path:d(n.input)};break}if(n.kind===`assistant`&&n.streaming)return{phase:`writing`,detail:null};if(n.kind===`assistant`||n.kind===`thinking`)break}return t.thinking?{phase:`thinking`,detail:null}:{phase:`waiting`,detail:null}}var g={thinking:`Thinking`,tool:`Running`,writing:`Writing`,waiting:`Waiting`},_={retry:`Retrying`,preflight:`Preflight`,watchdog:`Still running`};function v(e){if(!Number.isFinite(e)||e<0)return`0s`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`}function y(e,t,n){let r=e.progress,i=t.phase===`tool`||t.phase===`writing`?t.phase:r?.phase??t.phase,a=r?r.elapsedMs+Math.max(0,n-r.receivedAt):e.startedAt===null?null:Math.max(0,n-e.startedAt),o=i===`tool`?t.detail??r?.tool??null:null,s=r?.tokPerSec??null,c=(i===`writing`||i===`thinking`)&&s!==null&&s>0?`${s>=10?Math.round(s):s.toFixed(1)} tok/s`:null;return{phase:i,word:g[i],elapsedMs:a,detail:o,rate:c}}var b=(0,a.memo)(function({live:e,derived:t,onStop:n,showNotice:r=!0}){let[i,o]=(0,a.useState)(()=>Date.now());(0,a.useEffect)(()=>{o(Date.now());let e=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(e)},[e.turnId]);let s=f(),c=y(e,t,i),l=c.phase===`tool`&&t.path?{...c,detail:s(t.path)}:c,u=l.detail?`${l.word}: ${l.detail}`:l.word,d=r?e.notice:null;return(0,m.jsxs)(`div`,{className:p.live,"data-phase":l.phase,children:[(0,m.jsxs)(`div`,{className:p.line,children:[(0,m.jsx)(`span`,{className:p.pulse,"aria-hidden":`true`}),(0,m.jsxs)(`span`,{className:p.text,"aria-hidden":`true`,children:[(0,m.jsx)(`span`,{className:p.word,children:l.word}),l.elapsedMs===null?null:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:p.sep,children:`·`}),(0,m.jsx)(`span`,{className:p.figure,children:v(l.elapsedMs)})]}),l.detail?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:p.sep,children:`·`}),(0,m.jsx)(`span`,{className:p.detail,title:t.path??l.detail,children:l.detail})]}):null,l.rate?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:p.sep,children:`·`}),(0,m.jsx)(`span`,{className:p.figure,children:l.rate})]}):null]}),(0,m.jsx)(`span`,{className:`visually-hidden`,role:`status`,children:u}),n?(0,m.jsxs)(`button`,{type:`button`,className:p.stop,onClick:n,"aria-label":`Stop this turn`,title:`Stop this turn (⌘.)`,children:[(0,m.jsx)(`span`,{className:p.stopIcon,"aria-hidden":`true`}),`Stop`]}):null]}),d?(0,m.jsxs)(`p`,{className:p.notice,"data-kind":d.kind,role:`status`,children:[(0,m.jsx)(`span`,{className:p.noticeWord,children:_[d.kind]}),(0,m.jsx)(`span`,{className:p.noticeText,children:d.message})]}):null]})}),x=new Set,S=null,C=Date.now();function w(e){return x.add(e),S===null&&(C=Date.now(),S=setInterval(()=>{C=Date.now();for(let e of[...x])e()},1e3)),()=>{x.delete(e),x.size===0&&S!==null&&(clearInterval(S),S=null)}}function T(){return C}var E=()=>()=>{},D=()=>0;function O(e=!0){let t=(0,a.useSyncExternalStore)(e?w:E,e?T:D,e?T:D);return Math.max(t,Date.now())}function k(e){if(typeof e==`number`)return Number.isFinite(e)?e:null;if(typeof e!=`string`)return null;let t=Date.parse(e);return Number.isFinite(t)?t:null}function A({since:e,className:t,label:n}){let r=k(e),i=O(r!==null);if(r===null)return null;let a=v(Math.max(0,i-r));return(0,m.jsx)(`span`,{className:t,"data-live-timer":``,"aria-hidden":!n||void 0,"aria-label":n?`${n} ${a}`:void 0,role:n?`timer`:void 0,children:a})}function j({size:e=16,children:t,...n}){return(0,m.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,...n,children:t})}function M(e){return(0,m.jsxs)(j,{...e,children:[(0,m.jsx)(`rect`,{x:`1.75`,y:`2.75`,width:`12.5`,height:`10.5`,rx:`1.5`}),(0,m.jsx)(`path`,{d:`m4.5 6.25 2 1.75-2 1.75M8.25 10h3`})]})}function N(e){return(0,m.jsxs)(j,{...e,children:[(0,m.jsx)(`rect`,{x:`1.75`,y:`2.75`,width:`12.5`,height:`10.5`,rx:`1.5`}),(0,m.jsx)(`path`,{d:`M1.75 5.75h12.5M4 4.25h.01M5.75 4.25h.01`})]})}function P(e){return(0,m.jsxs)(j,{...e,children:[(0,m.jsx)(`path`,{d:`M5 2.5v5M2.5 5h5M9 11h4.5`}),(0,m.jsx)(`path`,{d:`M11.5 2.5 4.5 13.5`})]})}function F(e){return(0,m.jsxs)(j,{...e,children:[(0,m.jsx)(`path`,{d:`M6.5 4h7M6.5 8h7M6.5 12h7`}),(0,m.jsx)(`path`,{d:`m2.25 4 1 1 1.5-2M2.5 8h1.75M2.5 12h1.75`})]})}function I(e){return(0,m.jsxs)(j,{...e,children:[(0,m.jsx)(`path`,{d:`m8 2 6 3-6 3-6-3 6-3Z`}),(0,m.jsx)(`path`,{d:`m2 8 6 3 6-3M2 11l6 3 6-3`})]})}function L(e){return(0,m.jsxs)(j,{...e,children:[(0,m.jsx)(`rect`,{x:`2.25`,y:`2.25`,width:`11.5`,height:`11.5`,rx:`1.5`}),(0,m.jsx)(`path`,{d:`M2.25 8h11.5`})]})}function R(e){return(0,m.jsx)(j,{...e,children:(0,m.jsx)(`path`,{d:`m4 4 8 8M12 4l-8 8`})})}function z(e){return(0,m.jsxs)(j,{...e,children:[(0,m.jsx)(`circle`,{cx:`3.5`,cy:`8`,r:`0.9`,fill:`currentColor`,stroke:`none`}),(0,m.jsx)(`circle`,{cx:`8`,cy:`8`,r:`0.9`,fill:`currentColor`,stroke:`none`}),(0,m.jsx)(`circle`,{cx:`12.5`,cy:`8`,r:`0.9`,fill:`currentColor`,stroke:`none`})]})}function B(e){return(0,m.jsxs)(j,{...e,children:[(0,m.jsx)(`path`,{d:`M9.75 2.25 13.75 6.25 11 7.5 8.5 10l.25 2.75-5-5L6.5 8 9 5.25Z`}),(0,m.jsx)(`path`,{d:`m5 11-2.75 2.75`})]})}function V(e){return(0,m.jsxs)(j,{...e,children:[(0,m.jsx)(`rect`,{x:`1.75`,y:`2.75`,width:`12.5`,height:`3`,rx:`1`}),(0,m.jsx)(`path`,{d:`M2.75 5.75v6.5a1 1 0 0 0 1 1h8.5a1 1 0 0 0 1-1v-6.5M6.5 8.5h3`})]})}function H(e){return(0,m.jsx)(j,{...e,children:(0,m.jsx)(`path`,{d:`M10.5 2.75 13.25 5.5 6 12.75H3.25V10Z`})})}function U(e){return(0,m.jsxs)(j,{...e,children:[(0,m.jsx)(`path`,{d:`M2.5 8h9M8.5 4.5 12 8l-3.5 3.5`}),(0,m.jsx)(`path`,{d:`M13.75 3v10`})]})}function W(e){return(0,m.jsxs)(j,{...e,children:[(0,m.jsx)(`rect`,{x:`5.25`,y:`5.25`,width:`8.5`,height:`8.5`,rx:`1.5`}),(0,m.jsx)(`path`,{d:`M10.75 5.25V3.75a1.5 1.5 0 0 0-1.5-1.5h-5.5a1.5 1.5 0 0 0-1.5 1.5v5.5a1.5 1.5 0 0 0 1.5 1.5h1.5`})]})}function G(e){return(0,m.jsx)(j,{...e,children:(0,m.jsx)(`path`,{d:`M2.75 4.25h10.5M6.25 4.25V2.75h3.5v1.5M4.25 4.25l.6 9h6.3l.6-9`})})}var K={terminal:M,preview:N,diff:P,tasks:F,context:I};export{U as a,H as c,A as d,b as f,f as g,c as h,K as i,L as l,s as m,R as n,z as o,h as p,W as r,B as s,V as t,G as u};
2
+ //# sourceMappingURL=dock-icons-BBUGl4tE.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dock-icons-CUh8dOxJ.js","names":[],"sources":["../../../../../../src/web-ui/routes/verse/chat/path-display.ts","../../../../../../src/web-ui/routes/verse/chat/LiveStatus.module.css","../../../../../../src/web-ui/routes/verse/chat/LiveStatus.tsx","../../../../../../src/web-ui/routes/verse/chat/LiveTimer.tsx","../../../../../../src/web-ui/routes/verse/dock/dock-icons.tsx"],"sourcesContent":["/**\n * routes/verse/chat/path-display.ts — how a file path READS in the chat.\n *\n * Tool payloads carry whatever path the CLI used, and that is usually\n * absolute: `/private/tmp/…/scratchpad/e2e-proj-39/math.ts` for a file the\n * operator knows as `math.ts`. Shown raw, the one part that identifies the\n * file is what the row's ellipsis clips. So every path the transcript draws\n * goes through `displayPath`:\n *\n * 1. relative to the chat's roots (the longest root that contains it wins —\n * a worktree nested in its repo is its own root). Paths and roots are\n * compared as `keyOf`s, so `\\` vs `/`, a trailing separator, macOS's\n * `/private/tmp` for `/tmp` and `c:` for `C:` all still match; the rest\n * is sliced out of the ORIGINAL path, in the CLI's own separators;\n * 2. otherwise as the hub sent it when it is relative or `~/…`;\n * 3. otherwise, when it is long, its last three segments behind `…/`.\n *\n * HOME. The hub rewrites the operator's OWN home to `~` on every payload\n * (sanitizePublicJson) and is the only side that knows which home that is —\n * so a `~/…` path or root already says it, and matches as-is. Nothing here\n * guesses a home from `/Users/<x>`, `/home/<x>` or `C:\\Users\\<x>`: one that\n * reaches the browser is another account's or /Users/Shared, and drawing it\n * as `~` (or as in-project, via a `~` root) passes it off as the operator's.\n *\n * Display only. The full path stays in the tooltip and is never rewritten in\n * anything handed back to a tool, a search or a jump anchor. (It is in the\n * chat's first-paint chunk, hence the terse body.)\n */\nimport { createContext, useCallback, useContext } from 'react';\nimport { pathsIn } from './tool-semantics.js';\n\nconst NO_ROOTS: readonly string[] = [];\n\n/** The chat's roots, primary first (Workspace provides them; Transcript can override). */\nexport const PathRootsContext = createContext<readonly string[]>(NO_ROOTS);\n\n/**\n * A path as the operator's home reads: unchanged. The hub already spelled\n * that home `~`; any other `/Users/<x>` is someone else's (see HOME above).\n * Kept as the one seam home display goes through (SessionRoots uses it).\n */\nexport function abbreviateHome(path: string): string {\n return path;\n}\n\n/**\n * One folder's comparable form: `/` separators, no trailing one, the\n * `/private` alias folded (/tmp, /var and /etc are symlinks into it and roots\n * are not realpath'd), a lower-case drive letter. Only the fold changes the\n * length, and only at the head — so a matched tail maps back onto the original.\n */\nfunction keyOf(path: string): string {\n return path.replace(/\\\\/g, '/').replace(/\\/+$/, '')\n .replace(/^\\/private(?=\\/(?:tmp|var|etc)(?:\\/|$))/, '')\n .replace(/^[A-Z](?=:)/, (d) => d.toLowerCase());\n}\n\n/** What the transcript draws for `path`; the full path belongs in the tooltip. */\nexport function displayPath(path: string, roots: readonly string[] = NO_ROOTS): string {\n const key = keyOf(path);\n let root = '';\n for (const raw of roots) {\n const r = keyOf(raw);\n // A bare `/`, `C:` or `\\\\` root would claim every path on the machine.\n if (r.length > root.length && !/^(?:[a-z]:)?$/.test(r) && (key === r || key.startsWith(`${r}/`))) root = r;\n }\n const own = path.replace(/[\\\\/]+$/, '');\n // Inside a root: the rest of the path, or — for the root itself — its name.\n if (root) {\n const rest = key.length - root.length - 1;\n return rest > 0 ? own.slice(own.length - rest) : own.slice(Math.max(own.lastIndexOf('/'), own.lastIndexOf('\\\\')) + 1);\n }\n if (!/^(?:[\\\\/]|[A-Za-z]:[\\\\/])/.test(path)) return path.replace(/^\\.[\\\\/]/, '');\n const sep = path.includes('/') ? '/' : '\\\\';\n const parts = path.replace(/^[A-Za-z]:/, '').split(/[\\\\/]/).filter(Boolean);\n return parts.length > 4 ? `…${sep}${parts.slice(-3).join(sep)}` : path;\n}\n\n/**\n * The file a tool call names, when it runs no command — a shell call keeps\n * its command line verbatim (rewriting a command is not display).\n */\nexport function inputPath(input: unknown): string | null {\n const rec = input !== null && typeof input === 'object' ? input as Record<string, unknown> : null;\n return rec && typeof rec.command !== 'string' && typeof rec.cmd !== 'string' ? pathsIn(rec)[0] ?? null : null;\n}\n\n/** `displayPath` bound to the roots in context. */\nexport function useDisplayPath(): (path: string) => string {\n const roots = useContext(PathRootsContext);\n return useCallback((path: string) => displayPath(path, roots), [roots]);\n}\n","/**\n * The live line sits where the caret used to: under the running turn, on\n * the reading measure, in tertiary text with tabular figures. Colour means\n * state only — the running pulse — and a notice is a 2px rule in the warning\n * colour with its kind in words (DESIGN §6: never colour alone).\n */\n.live {\n display: flex;\n flex-direction: column;\n gap: var(--space-2);\n min-width: 0;\n}\n\n.line {\n display: flex;\n align-items: center;\n gap: var(--space-2);\n min-height: var(--control-h-sm);\n min-width: 0;\n color: var(--text-tertiary);\n font-size: var(--text-sm-size);\n}\n\n.pulse {\n width: 8px;\n height: 8px;\n flex: none;\n border-radius: var(--radius-full);\n background: var(--status-running-solid);\n animation: live-pulse 1.4s var(--ease-standard) infinite;\n}\n.live[data-phase='waiting'] .pulse { background: var(--border-strong); }\n\n.text {\n display: inline-flex;\n align-items: baseline;\n gap: var(--space-2);\n min-width: 0;\n flex: 1 1 auto;\n overflow: hidden;\n white-space: nowrap;\n}\n.word { color: var(--text-secondary); font-weight: var(--font-weight-medium); }\n.sep { color: var(--text-tertiary); }\n.figure {\n font-family: var(--font-display);\n font-variant-numeric: tabular-nums;\n}\n.detail {\n font-family: var(--font-mono);\n font-size: var(--text-xs-size);\n color: var(--text-secondary);\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n}\n\n.stop {\n flex: none;\n display: inline-flex;\n align-items: center;\n gap: var(--space-2);\n min-height: var(--control-h-xs);\n padding: 0 var(--space-2);\n border: 1px solid transparent;\n border-radius: var(--radius-sm);\n background: transparent;\n color: var(--text-secondary);\n font-size: var(--text-xs-size);\n cursor: pointer;\n transition: color var(--duration-fast) var(--ease-standard), background var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard);\n}\n.stop:hover { color: var(--text-primary); background: var(--bg-hover); border-color: var(--border-default); }\n.stop:active { background: var(--bg-active); }\n.stopIcon {\n width: 8px;\n height: 8px;\n border-radius: 1px;\n background: currentColor;\n}\n\n.notice {\n display: flex;\n gap: var(--space-2);\n margin: 0;\n padding-left: var(--space-3);\n border-left: 2px solid var(--status-warning-solid);\n color: var(--text-secondary);\n font-size: var(--text-xs-size);\n line-height: var(--text-xs-line-relaxed);\n overflow-wrap: anywhere;\n}\n.notice[data-kind='preflight'] { border-left-color: var(--status-info-solid); }\n.noticeWord { color: var(--status-warning-fg); font-weight: var(--font-weight-medium); white-space: nowrap; }\n.notice[data-kind='preflight'] .noticeWord { color: var(--status-info-fg); }\n.noticeText { min-width: 0; }\n\n@keyframes live-pulse { 50% { opacity: 0.3; } }\n\n@media (prefers-reduced-motion: reduce) {\n :root:not([data-motion=\"full\"]) .pulse { animation: none; }\n}\n:root[data-motion=\"reduce\"] .pulse { animation: none; }\n\n@media (max-width: 480px) {\n /* 3.10: one line above the composer, beside the tasks chip — the text\n ellipsises (its detail first) rather than wrapping Stop onto a row of\n its own. */\n .line { flex-wrap: nowrap; }\n}\n","/**\n * routes/verse/chat/LiveStatus.tsx — the line under a running turn (V3.10):\n *\n * ● Running · 14s · npm test Stop\n * ● Writing · 1m 3s · 38 tok/s Stop\n *\n * It replaces the bare caret that used to be the ONLY live signal: a turn\n * that had been silently retrying an overloaded API for four minutes looked\n * exactly like one that was about to answer.\n *\n * Sources, best first:\n * 1. transient `progress` frames (phase, server-measured elapsed, tok/s);\n * 2. the transcript itself — a pending tool call means \"running that\n * tool\", a streaming bubble means \"writing\" — so a server that sends no\n * progress frames still gets an honest line;\n * 3. the turn's own start stamp for the clock.\n * A figure nobody measured (tok/s, the tool) is left out, never guessed.\n *\n * Under it, when the engine says so, one plumbing notice: an API retry, a\n * failed preflight (e.g. Ollama not answering), or the no-output watchdog.\n * It clears itself once output resumes (verse-store livePersisted).\n *\n * Accessibility: the visible line ticks every second, so it is NOT a live\n * region; a visually hidden status announces only phase/tool changes, and a\n * notice is announced once when it appears.\n */\nimport { memo, useEffect, useState } from 'react';\nimport type { VerseProgressPhase, VerseStatusKind } from '../../../../core/verse/types.js';\nimport { summarizeToolInput } from '../verse-model.js';\nimport type { TranscriptItem, VerseLiveState } from '../verse-store.js';\nimport { inputPath, useDisplayPath } from './path-display.js';\nimport styles from './LiveStatus.module.css';\n\nexport interface LivePhase {\n phase: VerseProgressPhase;\n /** What the phase is about: the running command/path, when known. */\n detail: string | null;\n /** 3.10.1: the file the running call names, drawn relative to the chat's roots. */\n path?: string | null;\n}\n\n/**\n * What the transcript says the running turn is doing right now — the\n * fallback for a server that sends no `progress` frames, and the source of\n * the tool's human-readable argument even when one does.\n */\nexport function derivePhaseFromTranscript(items: readonly TranscriptItem[], live: Pick<VerseLiveState, 'thinking'>): LivePhase {\n for (let i = items.length - 1; i >= 0; i -= 1) {\n const item = items[i]!;\n if (item.kind === 'user') break;\n if (item.kind === 'tool') {\n if (item.result === null) return { phase: 'tool', detail: summarizeToolInput(item.input) || item.name, path: inputPath(item.input) };\n break;\n }\n if (item.kind === 'assistant' && item.streaming) return { phase: 'writing', detail: null };\n if (item.kind === 'assistant' || item.kind === 'thinking') break;\n }\n if (live.thinking) return { phase: 'thinking', detail: null };\n return { phase: 'waiting', detail: null };\n}\n\nconst PHASE_WORD: Record<VerseProgressPhase, string> = {\n thinking: 'Thinking',\n tool: 'Running',\n writing: 'Writing',\n waiting: 'Waiting',\n};\n\nconst NOTICE_WORD: Record<VerseStatusKind, string> = {\n retry: 'Retrying',\n preflight: 'Preflight',\n watchdog: 'Still running',\n};\n\n/** \"14s\" / \"1m 3s\" / \"1h 2m\". */\nexport function formatLiveElapsed(ms: number): string {\n if (!Number.isFinite(ms) || ms < 0) return '0s';\n const s = Math.floor(ms / 1000);\n if (s < 60) return `${s}s`;\n const m = Math.floor(s / 60);\n if (m < 60) return `${m}m ${s % 60}s`;\n return `${Math.floor(m / 60)}h ${m % 60}m`;\n}\n\nexport interface LiveStatusLine {\n phase: VerseProgressPhase;\n word: string;\n elapsedMs: number | null;\n detail: string | null;\n rate: string | null;\n}\n\n/** Pure: the parts of the line at clock time `now` (exported for tests). */\nexport function liveStatusLine(live: VerseLiveState, derived: LivePhase, now: number): LiveStatusLine {\n const progress = live.progress;\n // The transcript knows a tool call is pending before (or without) a\n // progress frame saying so, and it knows the call's argument; a progress\n // frame knows about reasoning and waiting, which the transcript cannot see.\n const phase: VerseProgressPhase = derived.phase === 'tool' || derived.phase === 'writing'\n ? derived.phase\n : progress?.phase ?? derived.phase;\n const elapsedMs = progress\n ? progress.elapsedMs + Math.max(0, now - progress.receivedAt)\n : live.startedAt !== null ? Math.max(0, now - live.startedAt) : null;\n const detail = phase === 'tool' ? derived.detail ?? progress?.tool ?? null : null;\n const tps = progress?.tokPerSec ?? null;\n const rate = (phase === 'writing' || phase === 'thinking') && tps !== null && tps > 0 ? `${tps >= 10 ? Math.round(tps) : tps.toFixed(1)} tok/s` : null;\n return { phase, word: PHASE_WORD[phase], elapsedMs, detail, rate };\n}\n\nexport interface LiveStatusProps {\n live: VerseLiveState;\n derived: LivePhase;\n onStop?: () => void;\n /**\n * 3.10: above the composer the engine's notice goes to the notice slot\n * (one notice at a time, in priority order), so the line omits it.\n */\n showNotice?: boolean;\n}\n\nexport const LiveStatus = memo(function LiveStatus({ live, derived, onStop, showNotice = true }: LiveStatusProps) {\n const [now, setNow] = useState(() => Date.now());\n // The clock only; never a request. Re-armed per turn.\n useEffect(() => {\n setNow(Date.now());\n const id = setInterval(() => setNow(Date.now()), 1000);\n return () => clearInterval(id);\n }, [live.turnId]);\n\n const show = useDisplayPath();\n const computed = liveStatusLine(live, derived, now);\n // A running Read names its file as the transcript does — relative, not the\n // head of an absolute path (chat/path-display.ts); the full path is the title.\n const line = computed.phase === 'tool' && derived.path ? { ...computed, detail: show(derived.path) } : computed;\n const spoken = line.detail ? `${line.word}: ${line.detail}` : line.word;\n const notice = showNotice ? live.notice : null;\n\n return (\n <div className={styles.live} data-phase={line.phase}>\n <div className={styles.line}>\n <span className={styles.pulse} aria-hidden=\"true\" />\n <span className={styles.text} aria-hidden=\"true\">\n <span className={styles.word}>{line.word}</span>\n {line.elapsedMs !== null ? <><span className={styles.sep}>·</span><span className={styles.figure}>{formatLiveElapsed(line.elapsedMs)}</span></> : null}\n {line.detail ? <><span className={styles.sep}>·</span><span className={styles.detail} title={derived.path ?? line.detail}>{line.detail}</span></> : null}\n {line.rate ? <><span className={styles.sep}>·</span><span className={styles.figure}>{line.rate}</span></> : null}\n </span>\n <span className=\"visually-hidden\" role=\"status\">{spoken}</span>\n {onStop ? (\n <button type=\"button\" className={styles.stop} onClick={onStop} aria-label=\"Stop this turn\" title=\"Stop this turn (⌘.)\">\n <span className={styles.stopIcon} aria-hidden=\"true\" />Stop\n </button>\n ) : null}\n </div>\n {notice ? (\n <p className={styles.notice} data-kind={notice.kind} role=\"status\">\n <span className={styles.noticeWord}>{NOTICE_WORD[notice.kind]}</span>\n <span className={styles.noticeText}>{notice.message}</span>\n </p>\n ) : null}\n </div>\n );\n});\n","/**\n * routes/verse/chat/LiveTimer.tsx — \"12s\", counting, for anything running\n * (unit C2): a pending tool row, an activity group, a running chat in the\n * sidebar, a task in the Tasks pane.\n *\n * ONE shared one-second clock for every timer on the page. A long session\n * can show dozens of running rows at once (a group of parallel tool calls,\n * the sidebar's running chats, the tasks list); a `setInterval` each would\n * be dozens of timers re-rendering out of phase. Subscribers join a single\n * interval that exists only while at least one of them is mounted, and all\n * of them tick on the same beat.\n *\n * It is a clock, never a request (SPEC-310A §0: no polling faster than 2 s —\n * this polls nothing).\n */\nimport { useSyncExternalStore } from 'react';\nimport { formatLiveElapsed } from './LiveStatus.js';\n\nconst listeners = new Set<() => void>();\nlet timer: ReturnType<typeof setInterval> | null = null;\nlet now = Date.now();\n\nfunction subscribe(listener: () => void): () => void {\n listeners.add(listener);\n if (timer === null) {\n now = Date.now();\n timer = setInterval(() => {\n now = Date.now();\n for (const l of [...listeners]) l();\n }, 1000);\n }\n return () => {\n listeners.delete(listener);\n if (listeners.size === 0 && timer !== null) {\n clearInterval(timer);\n timer = null;\n }\n };\n}\n\nfunction snapshot(): number {\n return now;\n}\n\nconst idle = () => () => {};\n// A constant: useSyncExternalStore requires a stable snapshot between\n// renders, and `Date.now` as a snapshot would loop.\nconst idleSnapshot = () => 0;\n\n/**\n * The shared clock (ms). While `active` is false the component does not\n * subscribe at all — a settled row costs nothing — and reads the wall clock\n * once per render instead.\n */\nexport function useSecondClock(active = true): number {\n const tick = useSyncExternalStore(active ? subscribe : idle, active ? snapshot : idleSnapshot, active ? snapshot : idleSnapshot);\n // A freshly mounted subscriber must not show the clock as it stood when the\n // previous beat fired (up to a second stale): take the later of the two.\n return Math.max(tick, Date.now());\n}\n\n/** Parse an ISO stamp or client-clock ms into ms; null when unusable. */\nexport function startMs(since: string | number | null | undefined): number | null {\n if (typeof since === 'number') return Number.isFinite(since) ? since : null;\n if (typeof since !== 'string') return null;\n const ms = Date.parse(since);\n return Number.isFinite(ms) ? ms : null;\n}\n\nexport interface LiveTimerProps {\n /** ISO start stamp or client-clock ms. Unparseable → renders nothing (an unknown start is not \"0s\"). */\n since: string | number | null | undefined;\n className?: string;\n /** Spoken label prefix, e.g. \"running for\". Omit to hide the timer from assistive tech (it ticks every second). */\n label?: string;\n}\n\nexport function LiveTimer({ since, className, label }: LiveTimerProps) {\n const start = startMs(since);\n const clock = useSecondClock(start !== null);\n if (start === null) return null;\n const text = formatLiveElapsed(Math.max(0, clock - start));\n return (\n <span className={className} data-live-timer=\"\" aria-hidden={label ? undefined : true}\n aria-label={label ? `${label} ${text}` : undefined} role={label ? 'timer' : undefined}>\n {text}\n </span>\n );\n}\n","/**\n * routes/verse/dock/dock-icons.tsx — the chat surface's own 16px glyphs\n * (unit C2): the dock's pane tabs and the header's pane toggles, the ⋯\n * menu, pin and archive. Same drawing grammar as components/primitives/icons\n * (16-unit box, 1.5 stroke, round caps, currentColor) so they sit beside the\n * shared set without looking borrowed; kept here because verse-icons.tsx is\n * the shell's file.\n */\nimport type { ReactNode, SVGProps } from 'react';\nimport type { DockPaneId } from '../shell/dock-catalog.js';\n\nexport interface GlyphProps extends Omit<SVGProps<SVGSVGElement>, 'children' | 'viewBox'> {\n size?: number;\n}\n\nfunction Glyph({ size = 16, children, ...rest }: GlyphProps & { children: ReactNode }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.5}\n strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\" focusable=\"false\" {...rest}>\n {children}\n </svg>\n );\n}\n\nexport function TerminalGlyph(p: GlyphProps) {\n return <Glyph {...p}><rect x=\"1.75\" y=\"2.75\" width=\"12.5\" height=\"10.5\" rx=\"1.5\" /><path d=\"m4.5 6.25 2 1.75-2 1.75M8.25 10h3\" /></Glyph>;\n}\n\nexport function PreviewGlyph(p: GlyphProps) {\n return <Glyph {...p}><rect x=\"1.75\" y=\"2.75\" width=\"12.5\" height=\"10.5\" rx=\"1.5\" /><path d=\"M1.75 5.75h12.5M4 4.25h.01M5.75 4.25h.01\" /></Glyph>;\n}\n\nexport function ReviewGlyph(p: GlyphProps) {\n return <Glyph {...p}><path d=\"M5 2.5v5M2.5 5h5M9 11h4.5\" /><path d=\"M11.5 2.5 4.5 13.5\" /></Glyph>;\n}\n\nexport function TasksGlyph(p: GlyphProps) {\n return <Glyph {...p}><path d=\"M6.5 4h7M6.5 8h7M6.5 12h7\" /><path d=\"m2.25 4 1 1 1.5-2M2.5 8h1.75M2.5 12h1.75\" /></Glyph>;\n}\n\nexport function ContextGlyph(p: GlyphProps) {\n return <Glyph {...p}><path d=\"m8 2 6 3-6 3-6-3 6-3Z\" /><path d=\"m2 8 6 3 6-3M2 11l6 3 6-3\" /></Glyph>;\n}\n\nexport function SplitGlyph(p: GlyphProps) {\n return <Glyph {...p}><rect x=\"2.25\" y=\"2.25\" width=\"11.5\" height=\"11.5\" rx=\"1.5\" /><path d=\"M2.25 8h11.5\" /></Glyph>;\n}\n\nexport function CloseGlyph(p: GlyphProps) {\n return <Glyph {...p}><path d=\"m4 4 8 8M12 4l-8 8\" /></Glyph>;\n}\n\nexport function MoreGlyph(p: GlyphProps) {\n return (\n <Glyph {...p}>\n <circle cx=\"3.5\" cy=\"8\" r=\"0.9\" fill=\"currentColor\" stroke=\"none\" />\n <circle cx=\"8\" cy=\"8\" r=\"0.9\" fill=\"currentColor\" stroke=\"none\" />\n <circle cx=\"12.5\" cy=\"8\" r=\"0.9\" fill=\"currentColor\" stroke=\"none\" />\n </Glyph>\n );\n}\n\nexport function PinGlyph(p: GlyphProps) {\n return <Glyph {...p}><path d=\"M9.75 2.25 13.75 6.25 11 7.5 8.5 10l.25 2.75-5-5L6.5 8 9 5.25Z\" /><path d=\"m5 11-2.75 2.75\" /></Glyph>;\n}\n\nexport function ArchiveGlyph(p: GlyphProps) {\n return <Glyph {...p}><rect x=\"1.75\" y=\"2.75\" width=\"12.5\" height=\"3\" rx=\"1\" /><path d=\"M2.75 5.75v6.5a1 1 0 0 0 1 1h8.5a1 1 0 0 0 1-1v-6.5M6.5 8.5h3\" /></Glyph>;\n}\n\nexport function RenameGlyph(p: GlyphProps) {\n return <Glyph {...p}><path d=\"M10.5 2.75 13.25 5.5 6 12.75H3.25V10Z\" /></Glyph>;\n}\n\nexport function HandoffGlyph(p: GlyphProps) {\n return <Glyph {...p}><path d=\"M2.5 8h9M8.5 4.5 12 8l-3.5 3.5\" /><path d=\"M13.75 3v10\" /></Glyph>;\n}\n\nexport function CopyGlyph(p: GlyphProps) {\n return <Glyph {...p}><rect x=\"5.25\" y=\"5.25\" width=\"8.5\" height=\"8.5\" rx=\"1.5\" /><path d=\"M10.75 5.25V3.75a1.5 1.5 0 0 0-1.5-1.5h-5.5a1.5 1.5 0 0 0-1.5 1.5v5.5a1.5 1.5 0 0 0 1.5 1.5h1.5\" /></Glyph>;\n}\n\nexport function TrashGlyph(p: GlyphProps) {\n return <Glyph {...p}><path d=\"M2.75 4.25h10.5M6.25 4.25V2.75h3.5v1.5M4.25 4.25l.6 9h6.3l.6-9\" /></Glyph>;\n}\n\nexport const DOCK_PANE_GLYPH: Readonly<Record<DockPaneId, (p: GlyphProps) => ReactNode>> = {\n terminal: TerminalGlyph,\n preview: PreviewGlyph,\n diff: ReviewGlyph,\n tasks: TasksGlyph,\n context: ContextGlyph,\n};\n"],"mappings":"oKA+BM,EAA8B,CAAC,EAGxB,GAAA,EAAmB,EAAA,cAAA,CAAiC,CAAQ,EAOzE,SAAgB,EAAe,EAAsB,CACnD,OAAO,CACT,CAQA,SAAS,EAAM,EAAsB,CACnC,OAAO,EAAK,QAAQ,MAAO,GAAG,CAAC,CAAC,QAAQ,OAAQ,EAAE,CAAC,CAChD,QAAQ,0CAA2C,EAAE,CAAC,CACt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U,EAAe,CACvC,OAAO,EAAA,EAAA,KAAA,CAAC,EAAD,CAAO,GAAI,EAAX,SAAA,EAAc,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,EAAE,OAAO,EAAE,OAAO,MAAM,MAAM,OAAO,MAAM,GAAG,KAAO,CAAA,GAAC,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,EAAE,iGAAmG,CAAA,CAAQ,GACtM,CAEA,SAAgB,EAAW,EAAe,CACxC,OAAO,EAAA,EAAA,IAAA,CAAC,EAAD,CAAO,GAAI,EAAG,UAAA,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,EAAE,gEAAkE,CAAA,CAAQ,CAAA,CACzG,CAEA,IAAa,EAA8E,CACzF,SAAU,EACV,QAAS,EACT,KAAM,EACN,MAAO,EACP,QAAS,CACX"}
1
+ {"version":3,"file":"dock-icons-BBUGl4tE.js","names":[],"sources":["../../../../../../src/web-ui/routes/verse/chat/path-display.ts","../../../../../../src/web-ui/routes/verse/chat/LiveStatus.module.css","../../../../../../src/web-ui/routes/verse/chat/LiveStatus.tsx","../../../../../../src/web-ui/routes/verse/chat/LiveTimer.tsx","../../../../../../src/web-ui/routes/verse/dock/dock-icons.tsx"],"sourcesContent":["/**\n * routes/verse/chat/path-display.ts — how a file path READS in the chat.\n *\n * Tool payloads carry whatever path the CLI used, and that is usually\n * absolute: `/private/tmp/…/scratchpad/e2e-proj-39/math.ts` for a file the\n * operator knows as `math.ts`. Shown raw, the one part that identifies the\n * file is what the row's ellipsis clips. So every path the transcript draws\n * goes through `displayPath`:\n *\n * 1. relative to the chat's roots (the longest root that contains it wins —\n * a worktree nested in its repo is its own root). Paths and roots are\n * compared as `keyOf`s, so `\\` vs `/`, a trailing separator, macOS's\n * `/private/tmp` for `/tmp` and `c:` for `C:` all still match; the rest\n * is sliced out of the ORIGINAL path, in the CLI's own separators;\n * 2. otherwise as the hub sent it when it is relative or `~/…`;\n * 3. otherwise, when it is long, its last three segments behind `…/`.\n *\n * HOME. The hub rewrites the operator's OWN home to `~` on every payload\n * (sanitizePublicJson) and is the only side that knows which home that is —\n * so a `~/…` path or root already says it, and matches as-is. Nothing here\n * guesses a home from `/Users/<x>`, `/home/<x>` or `C:\\Users\\<x>`: one that\n * reaches the browser is another account's or /Users/Shared, and drawing it\n * as `~` (or as in-project, via a `~` root) passes it off as the operator's.\n *\n * Display only. The full path stays in the tooltip and is never rewritten in\n * anything handed back to a tool, a search or a jump anchor. (It is in the\n * chat's first-paint chunk, hence the terse body.)\n */\nimport { createContext, useCallback, useContext } from 'react';\nimport { pathsIn } from './tool-semantics.js';\n\nconst NO_ROOTS: readonly string[] = [];\n\n/** The chat's roots, primary first (Workspace provides them; Transcript can override). */\nexport const PathRootsContext = createContext<readonly string[]>(NO_ROOTS);\n\n/**\n * A path as the operator's home reads: unchanged. The hub already spelled\n * that home `~`; any other `/Users/<x>` is someone else's (see HOME above).\n * Kept as the one seam home display goes through (SessionRoots uses it).\n */\nexport function abbreviateHome(path: string): string {\n return path;\n}\n\n/**\n * One folder's comparable form: `/` separators, no trailing one, the\n * `/private` alias folded (/tmp, /var and /etc are symlinks into it and roots\n * are not realpath'd), a lower-case drive letter. Only the fold changes the\n * length, and only at the head — so a matched tail maps back onto the original.\n */\nfunction keyOf(path: string): string {\n return path.replace(/\\\\/g, '/').replace(/\\/+$/, '')\n .replace(/^\\/private(?=\\/(?:tmp|var|etc)(?:\\/|$))/, '')\n .replace(/^[A-Z](?=:)/, (d) => d.toLowerCase());\n}\n\n/** What the transcript draws for `path`; the full path belongs in the tooltip. */\nexport function displayPath(path: string, roots: readonly string[] = NO_ROOTS): string {\n const key = keyOf(path);\n let root = '';\n for (const raw of roots) {\n const r = keyOf(raw);\n // A bare `/`, `C:` or `\\\\` root would claim every path on the machine.\n if (r.length > root.length && !/^(?:[a-z]:)?$/.test(r) && (key === r || key.startsWith(`${r}/`))) root = r;\n }\n const own = path.replace(/[\\\\/]+$/, '');\n // Inside a root: the rest of the path, or — for the root itself — its name.\n if (root) {\n const rest = key.length - root.length - 1;\n return rest > 0 ? own.slice(own.length - rest) : own.slice(Math.max(own.lastIndexOf('/'), own.lastIndexOf('\\\\')) + 1);\n }\n if (!/^(?:[\\\\/]|[A-Za-z]:[\\\\/])/.test(path)) return path.replace(/^\\.[\\\\/]/, '');\n const sep = path.includes('/') ? '/' : '\\\\';\n const parts = path.replace(/^[A-Za-z]:/, '').split(/[\\\\/]/).filter(Boolean);\n return parts.length > 4 ? `…${sep}${parts.slice(-3).join(sep)}` : path;\n}\n\n/**\n * The file a tool call names, when it runs no command — a shell call keeps\n * its command line verbatim (rewriting a command is not display).\n */\nexport function inputPath(input: unknown): string | null {\n const rec = input !== null && typeof input === 'object' ? input as Record<string, unknown> : null;\n return rec && typeof rec.command !== 'string' && typeof rec.cmd !== 'string' ? pathsIn(rec)[0] ?? null : null;\n}\n\n/** `displayPath` bound to the roots in context. */\nexport function useDisplayPath(): (path: string) => string {\n const roots = useContext(PathRootsContext);\n return useCallback((path: string) => displayPath(path, roots), [roots]);\n}\n","/**\n * The live line sits where the caret used to: under the running turn, on\n * the reading measure, in tertiary text with tabular figures. Colour means\n * state only — the running pulse — and a notice is a 2px rule in the warning\n * colour with its kind in words (DESIGN §6: never colour alone).\n */\n.live {\n display: flex;\n flex-direction: column;\n gap: var(--space-2);\n min-width: 0;\n}\n\n.line {\n display: flex;\n align-items: center;\n gap: var(--space-2);\n min-height: var(--control-h-sm);\n min-width: 0;\n color: var(--text-tertiary);\n font-size: var(--text-sm-size);\n}\n\n.pulse {\n width: 8px;\n height: 8px;\n flex: none;\n border-radius: var(--radius-full);\n background: var(--status-running-solid);\n animation: live-pulse 1.4s var(--ease-standard) infinite;\n}\n.live[data-phase='waiting'] .pulse { background: var(--border-strong); }\n\n.text {\n display: inline-flex;\n align-items: baseline;\n gap: var(--space-2);\n min-width: 0;\n flex: 1 1 auto;\n overflow: hidden;\n white-space: nowrap;\n}\n.word { color: var(--text-secondary); font-weight: var(--font-weight-medium); }\n.sep { color: var(--text-tertiary); }\n.figure {\n font-family: var(--font-display);\n font-variant-numeric: tabular-nums;\n}\n.detail {\n font-family: var(--font-mono);\n font-size: var(--text-xs-size);\n color: var(--text-secondary);\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n}\n\n.stop {\n flex: none;\n display: inline-flex;\n align-items: center;\n gap: var(--space-2);\n min-height: var(--control-h-xs);\n padding: 0 var(--space-2);\n border: 1px solid transparent;\n border-radius: var(--radius-sm);\n background: transparent;\n color: var(--text-secondary);\n font-size: var(--text-xs-size);\n cursor: pointer;\n transition: color var(--duration-fast) var(--ease-standard), background var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard);\n}\n.stop:hover { color: var(--text-primary); background: var(--bg-hover); border-color: var(--border-default); }\n.stop:active { background: var(--bg-active); }\n.stopIcon {\n width: 8px;\n height: 8px;\n border-radius: 1px;\n background: currentColor;\n}\n\n.notice {\n display: flex;\n gap: var(--space-2);\n margin: 0;\n padding-left: var(--space-3);\n border-left: 2px solid var(--status-warning-solid);\n color: var(--text-secondary);\n font-size: var(--text-xs-size);\n line-height: var(--text-xs-line-relaxed);\n overflow-wrap: anywhere;\n}\n.notice[data-kind='preflight'] { border-left-color: var(--status-info-solid); }\n.noticeWord { color: var(--status-warning-fg); font-weight: var(--font-weight-medium); white-space: nowrap; }\n.notice[data-kind='preflight'] .noticeWord { color: var(--status-info-fg); }\n.noticeText { min-width: 0; }\n\n@keyframes live-pulse { 50% { opacity: 0.3; } }\n\n@media (prefers-reduced-motion: reduce) {\n :root:not([data-motion=\"full\"]) .pulse { animation: none; }\n}\n:root[data-motion=\"reduce\"] .pulse { animation: none; }\n\n@media (max-width: 480px) {\n /* 3.10: one line above the composer, beside the tasks chip — the text\n ellipsises (its detail first) rather than wrapping Stop onto a row of\n its own. */\n .line { flex-wrap: nowrap; }\n}\n","/**\n * routes/verse/chat/LiveStatus.tsx — the line under a running turn (V3.10):\n *\n * ● Running · 14s · npm test Stop\n * ● Writing · 1m 3s · 38 tok/s Stop\n *\n * It replaces the bare caret that used to be the ONLY live signal: a turn\n * that had been silently retrying an overloaded API for four minutes looked\n * exactly like one that was about to answer.\n *\n * Sources, best first:\n * 1. transient `progress` frames (phase, server-measured elapsed, tok/s);\n * 2. the transcript itself — a pending tool call means \"running that\n * tool\", a streaming bubble means \"writing\" — so a server that sends no\n * progress frames still gets an honest line;\n * 3. the turn's own start stamp for the clock.\n * A figure nobody measured (tok/s, the tool) is left out, never guessed.\n *\n * Under it, when the engine says so, one plumbing notice: an API retry, a\n * failed preflight (e.g. Ollama not answering), or the no-output watchdog.\n * It clears itself once output resumes (verse-store livePersisted).\n *\n * Accessibility: the visible line ticks every second, so it is NOT a live\n * region; a visually hidden status announces only phase/tool changes, and a\n * notice is announced once when it appears.\n */\nimport { memo, useEffect, useState } from 'react';\nimport type { VerseProgressPhase, VerseStatusKind } from '../../../../core/verse/types.js';\nimport { summarizeToolInput } from '../verse-model.js';\nimport type { TranscriptItem, VerseLiveState } from '../verse-store.js';\nimport { inputPath, useDisplayPath } from './path-display.js';\nimport styles from './LiveStatus.module.css';\n\nexport interface LivePhase {\n phase: VerseProgressPhase;\n /** What the phase is about: the running command/path, when known. */\n detail: string | null;\n /** 3.10.1: the file the running call names, drawn relative to the chat's roots. */\n path?: string | null;\n}\n\n/**\n * What the transcript says the running turn is doing right now — the\n * fallback for a server that sends no `progress` frames, and the source of\n * the tool's human-readable argument even when one does.\n */\nexport function derivePhaseFromTranscript(items: readonly TranscriptItem[], live: Pick<VerseLiveState, 'thinking'>): LivePhase {\n for (let i = items.length - 1; i >= 0; i -= 1) {\n const item = items[i]!;\n if (item.kind === 'user') break;\n if (item.kind === 'tool') {\n if (item.result === null) return { phase: 'tool', detail: summarizeToolInput(item.input) || item.name, path: inputPath(item.input) };\n break;\n }\n if (item.kind === 'assistant' && item.streaming) return { phase: 'writing', detail: null };\n if (item.kind === 'assistant' || item.kind === 'thinking') break;\n }\n if (live.thinking) return { phase: 'thinking', detail: null };\n return { phase: 'waiting', detail: null };\n}\n\nconst PHASE_WORD: Record<VerseProgressPhase, string> = {\n thinking: 'Thinking',\n tool: 'Running',\n writing: 'Writing',\n waiting: 'Waiting',\n};\n\nconst NOTICE_WORD: Record<VerseStatusKind, string> = {\n retry: 'Retrying',\n preflight: 'Preflight',\n watchdog: 'Still running',\n};\n\n/** \"14s\" / \"1m 3s\" / \"1h 2m\". */\nexport function formatLiveElapsed(ms: number): string {\n if (!Number.isFinite(ms) || ms < 0) return '0s';\n const s = Math.floor(ms / 1000);\n if (s < 60) return `${s}s`;\n const m = Math.floor(s / 60);\n if (m < 60) return `${m}m ${s % 60}s`;\n return `${Math.floor(m / 60)}h ${m % 60}m`;\n}\n\nexport interface LiveStatusLine {\n phase: VerseProgressPhase;\n word: string;\n elapsedMs: number | null;\n detail: string | null;\n rate: string | null;\n}\n\n/** Pure: the parts of the line at clock time `now` (exported for tests). */\nexport function liveStatusLine(live: VerseLiveState, derived: LivePhase, now: number): LiveStatusLine {\n const progress = live.progress;\n // The transcript knows a tool call is pending before (or without) a\n // progress frame saying so, and it knows the call's argument; a progress\n // frame knows about reasoning and waiting, which the transcript cannot see.\n const phase: VerseProgressPhase = derived.phase === 'tool' || derived.phase === 'writing'\n ? derived.phase\n : progress?.phase ?? derived.phase;\n const elapsedMs = progress\n ? progress.elapsedMs + Math.max(0, now - progress.receivedAt)\n : live.startedAt !== null ? Math.max(0, now - live.startedAt) : null;\n const detail = phase === 'tool' ? derived.detail ?? progress?.tool ?? null : null;\n const tps = progress?.tokPerSec ?? null;\n const rate = (phase === 'writing' || phase === 'thinking') && tps !== null && tps > 0 ? `${tps >= 10 ? Math.round(tps) : tps.toFixed(1)} tok/s` : null;\n return { phase, word: PHASE_WORD[phase], elapsedMs, detail, rate };\n}\n\nexport interface LiveStatusProps {\n live: VerseLiveState;\n derived: LivePhase;\n onStop?: () => void;\n /**\n * 3.10: above the composer the engine's notice goes to the notice slot\n * (one notice at a time, in priority order), so the line omits it.\n */\n showNotice?: boolean;\n}\n\nexport const LiveStatus = memo(function LiveStatus({ live, derived, onStop, showNotice = true }: LiveStatusProps) {\n const [now, setNow] = useState(() => Date.now());\n // The clock only; never a request. Re-armed per turn.\n useEffect(() => {\n setNow(Date.now());\n const id = setInterval(() => setNow(Date.now()), 1000);\n return () => clearInterval(id);\n }, [live.turnId]);\n\n const show = useDisplayPath();\n const computed = liveStatusLine(live, derived, now);\n // A running Read names its file as the transcript does — relative, not the\n // head of an absolute path (chat/path-display.ts); the full path is the title.\n const line = computed.phase === 'tool' && derived.path ? { ...computed, detail: show(derived.path) } : computed;\n const spoken = line.detail ? `${line.word}: ${line.detail}` : line.word;\n const notice = showNotice ? live.notice : null;\n\n return (\n <div className={styles.live} data-phase={line.phase}>\n <div className={styles.line}>\n <span className={styles.pulse} aria-hidden=\"true\" />\n <span className={styles.text} aria-hidden=\"true\">\n <span className={styles.word}>{line.word}</span>\n {line.elapsedMs !== null ? <><span className={styles.sep}>·</span><span className={styles.figure}>{formatLiveElapsed(line.elapsedMs)}</span></> : null}\n {line.detail ? <><span className={styles.sep}>·</span><span className={styles.detail} title={derived.path ?? line.detail}>{line.detail}</span></> : null}\n {line.rate ? <><span className={styles.sep}>·</span><span className={styles.figure}>{line.rate}</span></> : null}\n </span>\n <span className=\"visually-hidden\" role=\"status\">{spoken}</span>\n {onStop ? (\n <button type=\"button\" className={styles.stop} onClick={onStop} aria-label=\"Stop this turn\" title=\"Stop this turn (⌘.)\">\n <span className={styles.stopIcon} aria-hidden=\"true\" />Stop\n </button>\n ) : null}\n </div>\n {notice ? (\n <p className={styles.notice} data-kind={notice.kind} role=\"status\">\n <span className={styles.noticeWord}>{NOTICE_WORD[notice.kind]}</span>\n <span className={styles.noticeText}>{notice.message}</span>\n </p>\n ) : null}\n </div>\n );\n});\n","/**\n * routes/verse/chat/LiveTimer.tsx — \"12s\", counting, for anything running\n * (unit C2): a pending tool row, an activity group, a running chat in the\n * sidebar, a task in the Tasks pane.\n *\n * ONE shared one-second clock for every timer on the page. A long session\n * can show dozens of running rows at once (a group of parallel tool calls,\n * the sidebar's running chats, the tasks list); a `setInterval` each would\n * be dozens of timers re-rendering out of phase. Subscribers join a single\n * interval that exists only while at least one of them is mounted, and all\n * of them tick on the same beat.\n *\n * It is a clock, never a request (SPEC-310A §0: no polling faster than 2 s —\n * this polls nothing).\n */\nimport { useSyncExternalStore } from 'react';\nimport { formatLiveElapsed } from './LiveStatus.js';\n\nconst listeners = new Set<() => void>();\nlet timer: ReturnType<typeof setInterval> | null = null;\nlet now = Date.now();\n\nfunction subscribe(listener: () => void): () => void {\n listeners.add(listener);\n if (timer === null) {\n now = Date.now();\n timer = setInterval(() => {\n now = Date.now();\n for (const l of [...listeners]) l();\n }, 1000);\n }\n return () => {\n listeners.delete(listener);\n if (listeners.size === 0 && timer !== null) {\n clearInterval(timer);\n timer = null;\n }\n };\n}\n\nfunction snapshot(): number {\n return now;\n}\n\nconst idle = () => () => {};\n// A constant: useSyncExternalStore requires a stable snapshot between\n// renders, and `Date.now` as a snapshot would loop.\nconst idleSnapshot = () => 0;\n\n/**\n * The shared clock (ms). While `active` is false the component does not\n * subscribe at all — a settled row costs nothing — and reads the wall clock\n * once per render instead.\n */\nexport function useSecondClock(active = true): number {\n const tick = useSyncExternalStore(active ? subscribe : idle, active ? snapshot : idleSnapshot, active ? snapshot : idleSnapshot);\n // A freshly mounted subscriber must not show the clock as it stood when the\n // previous beat fired (up to a second stale): take the later of the two.\n return Math.max(tick, Date.now());\n}\n\n/** Parse an ISO stamp or client-clock ms into ms; null when unusable. */\nexport function startMs(since: string | number | null | undefined): number | null {\n if (typeof since === 'number') return Number.isFinite(since) ? since : null;\n if (typeof since !== 'string') return null;\n const ms = Date.parse(since);\n return Number.isFinite(ms) ? ms : null;\n}\n\nexport interface LiveTimerProps {\n /** ISO start stamp or client-clock ms. Unparseable → renders nothing (an unknown start is not \"0s\"). */\n since: string | number | null | undefined;\n className?: string;\n /** Spoken label prefix, e.g. \"running for\". Omit to hide the timer from assistive tech (it ticks every second). */\n label?: string;\n}\n\nexport function LiveTimer({ since, className, label }: LiveTimerProps) {\n const start = startMs(since);\n const clock = useSecondClock(start !== null);\n if (start === null) return null;\n const text = formatLiveElapsed(Math.max(0, clock - start));\n return (\n <span className={className} data-live-timer=\"\" aria-hidden={label ? undefined : true}\n aria-label={label ? `${label} ${text}` : undefined} role={label ? 'timer' : undefined}>\n {text}\n </span>\n );\n}\n","/**\n * routes/verse/dock/dock-icons.tsx — the chat surface's own 16px glyphs\n * (unit C2): the dock's pane tabs and the header's pane toggles, the ⋯\n * menu, pin and archive. Same drawing grammar as components/primitives/icons\n * (16-unit box, 1.5 stroke, round caps, currentColor) so they sit beside the\n * shared set without looking borrowed; kept here because verse-icons.tsx is\n * the shell's file.\n */\nimport type { ReactNode, SVGProps } from 'react';\nimport type { DockPaneId } from '../shell/dock-catalog.js';\n\nexport interface GlyphProps extends Omit<SVGProps<SVGSVGElement>, 'children' | 'viewBox'> {\n size?: number;\n}\n\nfunction Glyph({ size = 16, children, ...rest }: GlyphProps & { children: ReactNode }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth={1.5}\n strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\" focusable=\"false\" {...rest}>\n {children}\n </svg>\n );\n}\n\nexport function TerminalGlyph(p: GlyphProps) {\n return <Glyph {...p}><rect x=\"1.75\" y=\"2.75\" width=\"12.5\" height=\"10.5\" rx=\"1.5\" /><path d=\"m4.5 6.25 2 1.75-2 1.75M8.25 10h3\" /></Glyph>;\n}\n\nexport function PreviewGlyph(p: GlyphProps) {\n return <Glyph {...p}><rect x=\"1.75\" y=\"2.75\" width=\"12.5\" height=\"10.5\" rx=\"1.5\" /><path d=\"M1.75 5.75h12.5M4 4.25h.01M5.75 4.25h.01\" /></Glyph>;\n}\n\nexport function ReviewGlyph(p: GlyphProps) {\n return <Glyph {...p}><path d=\"M5 2.5v5M2.5 5h5M9 11h4.5\" /><path d=\"M11.5 2.5 4.5 13.5\" /></Glyph>;\n}\n\nexport function TasksGlyph(p: GlyphProps) {\n return <Glyph {...p}><path d=\"M6.5 4h7M6.5 8h7M6.5 12h7\" /><path d=\"m2.25 4 1 1 1.5-2M2.5 8h1.75M2.5 12h1.75\" /></Glyph>;\n}\n\nexport function ContextGlyph(p: GlyphProps) {\n return <Glyph {...p}><path d=\"m8 2 6 3-6 3-6-3 6-3Z\" /><path d=\"m2 8 6 3 6-3M2 11l6 3 6-3\" /></Glyph>;\n}\n\nexport function SplitGlyph(p: GlyphProps) {\n return <Glyph {...p}><rect x=\"2.25\" y=\"2.25\" width=\"11.5\" height=\"11.5\" rx=\"1.5\" /><path d=\"M2.25 8h11.5\" /></Glyph>;\n}\n\nexport function CloseGlyph(p: GlyphProps) {\n return <Glyph {...p}><path d=\"m4 4 8 8M12 4l-8 8\" /></Glyph>;\n}\n\nexport function MoreGlyph(p: GlyphProps) {\n return (\n <Glyph {...p}>\n <circle cx=\"3.5\" cy=\"8\" r=\"0.9\" fill=\"currentColor\" stroke=\"none\" />\n <circle cx=\"8\" cy=\"8\" r=\"0.9\" fill=\"currentColor\" stroke=\"none\" />\n <circle cx=\"12.5\" cy=\"8\" r=\"0.9\" fill=\"currentColor\" stroke=\"none\" />\n </Glyph>\n );\n}\n\nexport function PinGlyph(p: GlyphProps) {\n return <Glyph {...p}><path d=\"M9.75 2.25 13.75 6.25 11 7.5 8.5 10l.25 2.75-5-5L6.5 8 9 5.25Z\" /><path d=\"m5 11-2.75 2.75\" /></Glyph>;\n}\n\nexport function ArchiveGlyph(p: GlyphProps) {\n return <Glyph {...p}><rect x=\"1.75\" y=\"2.75\" width=\"12.5\" height=\"3\" rx=\"1\" /><path d=\"M2.75 5.75v6.5a1 1 0 0 0 1 1h8.5a1 1 0 0 0 1-1v-6.5M6.5 8.5h3\" /></Glyph>;\n}\n\nexport function RenameGlyph(p: GlyphProps) {\n return <Glyph {...p}><path d=\"M10.5 2.75 13.25 5.5 6 12.75H3.25V10Z\" /></Glyph>;\n}\n\nexport function HandoffGlyph(p: GlyphProps) {\n return <Glyph {...p}><path d=\"M2.5 8h9M8.5 4.5 12 8l-3.5 3.5\" /><path d=\"M13.75 3v10\" /></Glyph>;\n}\n\nexport function CopyGlyph(p: GlyphProps) {\n return <Glyph {...p}><rect x=\"5.25\" y=\"5.25\" width=\"8.5\" height=\"8.5\" rx=\"1.5\" /><path d=\"M10.75 5.25V3.75a1.5 1.5 0 0 0-1.5-1.5h-5.5a1.5 1.5 0 0 0-1.5 1.5v5.5a1.5 1.5 0 0 0 1.5 1.5h1.5\" /></Glyph>;\n}\n\nexport function TrashGlyph(p: GlyphProps) {\n return <Glyph {...p}><path d=\"M2.75 4.25h10.5M6.25 4.25V2.75h3.5v1.5M4.25 4.25l.6 9h6.3l.6-9\" /></Glyph>;\n}\n\nexport const DOCK_PANE_GLYPH: Readonly<Record<DockPaneId, (p: GlyphProps) => ReactNode>> = {\n terminal: TerminalGlyph,\n preview: PreviewGlyph,\n diff: ReviewGlyph,\n tasks: TasksGlyph,\n context: ContextGlyph,\n};\n"],"mappings":"+JA+BM,EAA8B,CAAC,EAGxB,GAAA,EAAmB,EAAA,cAAA,CAAiC,CAAQ,EAOzE,SAAgB,EAAe,EAAsB,CACnD,OAAO,CACT,CAQA,SAAS,EAAM,EAAsB,CACnC,OAAO,EAAK,QAAQ,MAAO,GAAG,CAAC,CAAC,QAAQ,OAAQ,EAAE,CAAC,CAChD,QAAQ,0CAA2C,EAAE,CAAC,CACtD,QAAQ,cAAgB,GAAM,EAAE,YAAY,CAAC,CAClD,CAGA,SAAgB,EAAY,EAAc,EAA2B,EAAkB,CACrF,IAAM,EAAM,EAAM,CAAI,EAClB,EAAO,GACX,IAAK,IAAM,KAAO,EAAO,CACvB,IAAM,EAAI,EAAM,CAAG,EAEf,EAAE,OAAS,EAAK,QAAU,CAAC,gBAAgB,KAAK,CAAC,IAAM,IAAQ,GAAK,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