@ashlr/hub 3.12.0 → 3.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (719) hide show
  1. package/CHANGELOG.md +157 -0
  2. package/README.md +29 -16
  3. package/dist/authority-surface.json +274 -148
  4. package/dist/build-identity.json +2 -2
  5. package/dist/cli/authority.d.ts +145 -33
  6. package/dist/cli/authority.js +1292 -315
  7. package/dist/cli/authority.js.map +1 -1
  8. package/dist/cli/cloud.js +12 -3
  9. package/dist/cli/cloud.js.map +1 -1
  10. package/dist/cli/comms.d.ts +33 -19
  11. package/dist/cli/comms.js +128 -151
  12. package/dist/cli/comms.js.map +1 -1
  13. package/dist/cli/completions.js +1 -1
  14. package/dist/cli/completions.js.map +1 -1
  15. package/dist/cli/daemon.js +29 -0
  16. package/dist/cli/daemon.js.map +1 -1
  17. package/dist/cli/director.d.ts +8 -12
  18. package/dist/cli/director.js +17 -52
  19. package/dist/cli/director.js.map +1 -1
  20. package/dist/cli/fleet.js +4 -1
  21. package/dist/cli/fleet.js.map +1 -1
  22. package/dist/cli/help.js +1 -0
  23. package/dist/cli/help.js.map +1 -1
  24. package/dist/cli/leader.d.ts +27 -3
  25. package/dist/cli/leader.js +253 -4
  26. package/dist/cli/leader.js.map +1 -1
  27. package/dist/core/authority/protected-paths.js +11 -0
  28. package/dist/core/authority/protected-paths.js.map +1 -1
  29. package/dist/core/authority/resident.d.ts +101 -0
  30. package/dist/core/authority/resident.js +246 -0
  31. package/dist/core/authority/resident.js.map +1 -0
  32. package/dist/core/authority/server-enforcement.d.ts +110 -0
  33. package/dist/core/authority/server-enforcement.js +260 -0
  34. package/dist/core/authority/server-enforcement.js.map +1 -0
  35. package/dist/core/authority/standing-grant.d.ts +24 -4
  36. package/dist/core/authority/standing-grant.js +19 -3
  37. package/dist/core/authority/standing-grant.js.map +1 -1
  38. package/dist/core/authority/types.d.ts +43 -0
  39. package/dist/core/authority/types.js +6 -0
  40. package/dist/core/authority/types.js.map +1 -1
  41. package/dist/core/cloud/budget.js +11 -1
  42. package/dist/core/cloud/budget.js.map +1 -1
  43. package/dist/core/cloud/cloud-api.d.ts +25 -2
  44. package/dist/core/cloud/cloud-api.js +139 -5
  45. package/dist/core/cloud/cloud-api.js.map +1 -1
  46. package/dist/core/cloud/pr-actions.d.ts +93 -0
  47. package/dist/core/cloud/pr-actions.js +436 -0
  48. package/dist/core/cloud/pr-actions.js.map +1 -0
  49. package/dist/core/cloud/pr-preview.d.ts +128 -0
  50. package/dist/core/cloud/pr-preview.js +228 -0
  51. package/dist/core/cloud/pr-preview.js.map +1 -0
  52. package/dist/core/cloud/store.d.ts +2 -0
  53. package/dist/core/cloud/store.js +28 -0
  54. package/dist/core/cloud/store.js.map +1 -1
  55. package/dist/core/cloud/timeline-api.d.ts +24 -0
  56. package/dist/core/cloud/timeline-api.js +46 -0
  57. package/dist/core/cloud/timeline-api.js.map +1 -0
  58. package/dist/core/cloud/timeline-types.d.ts +62 -0
  59. package/dist/core/cloud/timeline-types.js +36 -0
  60. package/dist/core/cloud/timeline-types.js.map +1 -0
  61. package/dist/core/cloud/timeline.d.ts +102 -0
  62. package/dist/core/cloud/timeline.js +925 -0
  63. package/dist/core/cloud/timeline.js.map +1 -0
  64. package/dist/core/cloud/tracker.js +67 -0
  65. package/dist/core/cloud/tracker.js.map +1 -1
  66. package/dist/core/cloud/types.d.ts +38 -0
  67. package/dist/core/cloud/types.js +1 -1
  68. package/dist/core/cloud/types.js.map +1 -1
  69. package/dist/core/comms/change-digest.d.ts +130 -0
  70. package/dist/core/comms/change-digest.js +451 -0
  71. package/dist/core/comms/change-digest.js.map +1 -0
  72. package/dist/core/comms/director-prompt.d.ts +4 -5
  73. package/dist/core/comms/director-prompt.js +4 -71
  74. package/dist/core/comms/director-prompt.js.map +1 -1
  75. package/dist/core/comms/director.d.ts +24 -61
  76. package/dist/core/comms/director.js +29 -382
  77. package/dist/core/comms/director.js.map +1 -1
  78. package/dist/core/comms/dispatch.d.ts +37 -12
  79. package/dist/core/comms/dispatch.js +244 -177
  80. package/dist/core/comms/dispatch.js.map +1 -1
  81. package/dist/core/comms/elon-dialogue.d.ts +23 -15
  82. package/dist/core/comms/elon-dialogue.js +36 -307
  83. package/dist/core/comms/elon-dialogue.js.map +1 -1
  84. package/dist/core/comms/fleet-pulse.js +4 -7
  85. package/dist/core/comms/fleet-pulse.js.map +1 -1
  86. package/dist/core/comms/handlers.d.ts +10 -6
  87. package/dist/core/comms/handlers.js +14 -48
  88. package/dist/core/comms/handlers.js.map +1 -1
  89. package/dist/core/comms/migrations.d.ts +47 -0
  90. package/dist/core/comms/migrations.js +125 -0
  91. package/dist/core/comms/migrations.js.map +1 -0
  92. package/dist/core/comms/requests.d.ts +32 -5
  93. package/dist/core/comms/requests.js +101 -5
  94. package/dist/core/comms/requests.js.map +1 -1
  95. package/dist/core/comms/telegram-channel.d.ts +104 -0
  96. package/dist/core/comms/telegram-channel.js +622 -0
  97. package/dist/core/comms/telegram-channel.js.map +1 -0
  98. package/dist/core/comms/telegram-thread-map.d.ts +56 -0
  99. package/dist/core/comms/telegram-thread-map.js +144 -0
  100. package/dist/core/comms/telegram-thread-map.js.map +1 -0
  101. package/dist/core/daemon/capacity-publisher.d.ts +8 -1
  102. package/dist/core/daemon/capacity-publisher.js +40 -2
  103. package/dist/core/daemon/capacity-publisher.js.map +1 -1
  104. package/dist/core/daemon/loop.js +18 -4
  105. package/dist/core/daemon/loop.js.map +1 -1
  106. package/dist/core/daemon/service-install-authority.d.ts +10 -2
  107. package/dist/core/daemon/service-install-authority.js +14 -5
  108. package/dist/core/daemon/service-install-authority.js.map +1 -1
  109. package/dist/core/daemon/service.d.ts +15 -0
  110. package/dist/core/daemon/service.js +26 -0
  111. package/dist/core/daemon/service.js.map +1 -1
  112. package/dist/core/daemon/tick-deadline.d.ts +44 -0
  113. package/dist/core/daemon/tick-deadline.js +83 -0
  114. package/dist/core/daemon/tick-deadline.js.map +1 -0
  115. package/dist/core/daemon/tick-hooks.d.ts +7 -0
  116. package/dist/core/daemon/tick-hooks.js.map +1 -1
  117. package/dist/core/daemon/tick-progress.d.ts +39 -0
  118. package/dist/core/daemon/tick-progress.js +194 -0
  119. package/dist/core/daemon/tick-progress.js.map +1 -0
  120. package/dist/core/dashboard.js +3 -1
  121. package/dist/core/dashboard.js.map +1 -1
  122. package/dist/core/fleet/cloud-intake.d.ts +95 -0
  123. package/dist/core/fleet/cloud-intake.js +557 -0
  124. package/dist/core/fleet/cloud-intake.js.map +1 -0
  125. package/dist/core/fleet/dispatch-router.d.ts +13 -0
  126. package/dist/core/fleet/dispatch-router.js +32 -8
  127. package/dist/core/fleet/dispatch-router.js.map +1 -1
  128. package/dist/core/fleet/fleet-merge-state.d.ts +16 -0
  129. package/dist/core/fleet/fleet-merge-state.js.map +1 -1
  130. package/dist/core/fleet/host-merge.d.ts +14 -0
  131. package/dist/core/fleet/host-merge.js +24 -2
  132. package/dist/core/fleet/host-merge.js.map +1 -1
  133. package/dist/core/fleet/merge-gates.d.ts +21 -0
  134. package/dist/core/fleet/merge-gates.js +39 -5
  135. package/dist/core/fleet/merge-gates.js.map +1 -1
  136. package/dist/core/fleet/mirrors.d.ts +162 -6
  137. package/dist/core/fleet/mirrors.js +1051 -49
  138. package/dist/core/fleet/mirrors.js.map +1 -1
  139. package/dist/core/fleet/standing-merge-pass.d.ts +8 -0
  140. package/dist/core/fleet/standing-merge-pass.js +102 -1
  141. package/dist/core/fleet/standing-merge-pass.js.map +1 -1
  142. package/dist/core/fleet/status.d.ts +17 -0
  143. package/dist/core/fleet/status.js +22 -0
  144. package/dist/core/fleet/status.js.map +1 -1
  145. package/dist/core/fleet/tick-hooks-live.d.ts +10 -1
  146. package/dist/core/fleet/tick-hooks-live.js +57 -8
  147. package/dist/core/fleet/tick-hooks-live.js.map +1 -1
  148. package/dist/core/fleet/verify-check-run.d.ts +90 -0
  149. package/dist/core/fleet/verify-check-run.js +274 -0
  150. package/dist/core/fleet/verify-check-run.js.map +1 -0
  151. package/dist/core/git.d.ts +17 -0
  152. package/dist/core/git.js +124 -25
  153. package/dist/core/git.js.map +1 -1
  154. package/dist/core/goals/open-goals.d.ts +47 -0
  155. package/dist/core/goals/open-goals.js +33 -0
  156. package/dist/core/goals/open-goals.js.map +1 -0
  157. package/dist/core/inbox/merge.d.ts +5 -0
  158. package/dist/core/inbox/merge.js +58 -2
  159. package/dist/core/inbox/merge.js.map +1 -1
  160. package/dist/core/integrations/locus.d.ts +28 -0
  161. package/dist/core/integrations/locus.js +155 -30
  162. package/dist/core/integrations/locus.js.map +1 -1
  163. package/dist/core/integrations/telegram-format.d.ts +40 -0
  164. package/dist/core/integrations/telegram-format.js +123 -0
  165. package/dist/core/integrations/telegram-format.js.map +1 -0
  166. package/dist/core/integrations/telegram.d.ts +60 -4
  167. package/dist/core/integrations/telegram.js +161 -28
  168. package/dist/core/integrations/telegram.js.map +1 -1
  169. package/dist/core/mcp-registry.d.ts +12 -0
  170. package/dist/core/mcp-registry.js +70 -0
  171. package/dist/core/mcp-registry.js.map +1 -1
  172. package/dist/core/observability/rollup.d.ts +12 -10
  173. package/dist/core/observability/rollup.js +44 -17
  174. package/dist/core/observability/rollup.js.map +1 -1
  175. package/dist/core/resources/connection-monitor.d.ts +9 -0
  176. package/dist/core/resources/connection-monitor.js +19 -9
  177. package/dist/core/resources/connection-monitor.js.map +1 -1
  178. package/dist/core/resources/quota-refresh-lease.d.ts +17 -0
  179. package/dist/core/resources/quota-refresh-lease.js +34 -1
  180. package/dist/core/resources/quota-refresh-lease.js.map +1 -1
  181. package/dist/core/routing/budget-api.d.ts +18 -1
  182. package/dist/core/routing/budget-api.js +120 -10
  183. package/dist/core/routing/budget-api.js.map +1 -1
  184. package/dist/core/routing/budget-store.d.ts +22 -1
  185. package/dist/core/routing/budget-store.js +22 -8
  186. package/dist/core/routing/budget-store.js.map +1 -1
  187. package/dist/core/routing/readiness-types.d.ts +82 -0
  188. package/dist/core/routing/readiness-types.js +23 -0
  189. package/dist/core/routing/readiness-types.js.map +1 -0
  190. package/dist/core/routing/readiness.d.ts +103 -0
  191. package/dist/core/routing/readiness.js +480 -0
  192. package/dist/core/routing/readiness.js.map +1 -0
  193. package/dist/core/sandbox/confine.js +22 -1
  194. package/dist/core/sandbox/confine.js.map +1 -1
  195. package/dist/core/sandbox/policy.d.ts +23 -0
  196. package/dist/core/sandbox/policy.js +100 -0
  197. package/dist/core/sandbox/policy.js.map +1 -1
  198. package/dist/core/types.d.ts +13 -0
  199. package/dist/core/types.js.map +1 -1
  200. package/dist/core/universe/builtins/preparation/manifest.json +1 -1
  201. package/dist/core/universe/builtins/preparation/preparation-bridge.mjs +1204 -939
  202. package/dist/core/universe/builtins/preparation/preparation-verification-fixtures.mjs +1319 -1054
  203. package/dist/core/usage/frontier-usage.d.ts +20 -2
  204. package/dist/core/usage/frontier-usage.js +75 -17
  205. package/dist/core/usage/frontier-usage.js.map +1 -1
  206. package/dist/core/verse/account-health.js +9 -3
  207. package/dist/core/verse/account-health.js.map +1 -1
  208. package/dist/core/verse/accounts.d.ts +45 -0
  209. package/dist/core/verse/accounts.js +246 -17
  210. package/dist/core/verse/accounts.js.map +1 -1
  211. package/dist/core/verse/activity-api.d.ts +5 -1
  212. package/dist/core/verse/activity-api.js +62 -14
  213. package/dist/core/verse/activity-api.js.map +1 -1
  214. package/dist/core/verse/apps-api.js +23 -11
  215. package/dist/core/verse/apps-api.js.map +1 -1
  216. package/dist/core/verse/apps.d.ts +11 -9
  217. package/dist/core/verse/apps.js +2 -2
  218. package/dist/core/verse/apps.js.map +1 -1
  219. package/dist/core/verse/authority-api.d.ts +17 -3
  220. package/dist/core/verse/authority-api.js +122 -7
  221. package/dist/core/verse/authority-api.js.map +1 -1
  222. package/dist/core/verse/autonomy-ladder.d.ts +172 -0
  223. package/dist/core/verse/autonomy-ladder.js +251 -0
  224. package/dist/core/verse/autonomy-ladder.js.map +1 -0
  225. package/dist/core/verse/context-fit.js +7 -5
  226. package/dist/core/verse/context-fit.js.map +1 -1
  227. package/dist/core/verse/control-api.d.ts +23 -1
  228. package/dist/core/verse/control-api.js +117 -10
  229. package/dist/core/verse/control-api.js.map +1 -1
  230. package/dist/core/verse/fleet-live-api.js +13 -5
  231. package/dist/core/verse/fleet-live-api.js.map +1 -1
  232. package/dist/core/verse/folder-io.d.ts +50 -0
  233. package/dist/core/verse/folder-io.js +142 -0
  234. package/dist/core/verse/folder-io.js.map +1 -0
  235. package/dist/core/verse/git-api.js +5 -4
  236. package/dist/core/verse/git-api.js.map +1 -1
  237. package/dist/core/verse/git-ops.d.ts +10 -1
  238. package/dist/core/verse/git-ops.js +18 -2
  239. package/dist/core/verse/git-ops.js.map +1 -1
  240. package/dist/core/verse/github-api.d.ts +1 -1
  241. package/dist/core/verse/github-api.js +5 -4
  242. package/dist/core/verse/github-api.js.map +1 -1
  243. package/dist/core/verse/github-repo.js +118 -14
  244. package/dist/core/verse/github-repo.js.map +1 -1
  245. package/dist/core/verse/leader-api.d.ts +5 -4
  246. package/dist/core/verse/leader-api.js +237 -10
  247. package/dist/core/verse/leader-api.js.map +1 -1
  248. package/dist/core/verse/local-models.d.ts +10 -0
  249. package/dist/core/verse/local-models.js +10 -1
  250. package/dist/core/verse/local-models.js.map +1 -1
  251. package/dist/core/verse/login-path.d.ts +73 -0
  252. package/dist/core/verse/login-path.js +123 -14
  253. package/dist/core/verse/login-path.js.map +1 -1
  254. package/dist/core/verse/mcp-control-api.js +4 -4
  255. package/dist/core/verse/mcp-control-api.js.map +1 -1
  256. package/dist/core/verse/mcp-scope.d.ts +22 -0
  257. package/dist/core/verse/mcp-scope.js +41 -1
  258. package/dist/core/verse/mcp-scope.js.map +1 -1
  259. package/dist/core/verse/mcp-seat-view.d.ts +10 -0
  260. package/dist/core/verse/mcp-seat-view.js +30 -4
  261. package/dist/core/verse/mcp-seat-view.js.map +1 -1
  262. package/dist/core/verse/overnight-api.js +20 -2
  263. package/dist/core/verse/overnight-api.js.map +1 -1
  264. package/dist/core/verse/path-guard.d.ts +24 -0
  265. package/dist/core/verse/path-guard.js +91 -22
  266. package/dist/core/verse/path-guard.js.map +1 -1
  267. package/dist/core/verse/preview-api.js +22 -0
  268. package/dist/core/verse/preview-api.js.map +1 -1
  269. package/dist/core/verse/projects.d.ts +21 -0
  270. package/dist/core/verse/projects.js +82 -0
  271. package/dist/core/verse/projects.js.map +1 -1
  272. package/dist/core/verse/seat-readiness.d.ts +25 -0
  273. package/dist/core/verse/seat-readiness.js +43 -6
  274. package/dist/core/verse/seat-readiness.js.map +1 -1
  275. package/dist/core/verse/session-controls-api.js +5 -3
  276. package/dist/core/verse/session-controls-api.js.map +1 -1
  277. package/dist/core/verse/session-handoff.d.ts +26 -0
  278. package/dist/core/verse/session-handoff.js +90 -12
  279. package/dist/core/verse/session-handoff.js.map +1 -1
  280. package/dist/core/verse/terminal-api.js +7 -4
  281. package/dist/core/verse/terminal-api.js.map +1 -1
  282. package/dist/core/verse/terminal.js +9 -5
  283. package/dist/core/verse/terminal.js.map +1 -1
  284. package/dist/core/verse/verse-api.d.ts +3 -1
  285. package/dist/core/verse/verse-api.js +87 -27
  286. package/dist/core/verse/verse-api.js.map +1 -1
  287. package/dist/core/verse/workspaces.d.ts +51 -0
  288. package/dist/core/verse/workspaces.js +177 -47
  289. package/dist/core/verse/workspaces.js.map +1 -1
  290. package/dist/core/vision/leader-apply.d.ts +40 -0
  291. package/dist/core/vision/leader-apply.js +101 -30
  292. package/dist/core/vision/leader-apply.js.map +1 -1
  293. package/dist/core/vision/leader-cadence.d.ts +114 -0
  294. package/dist/core/vision/leader-cadence.js +127 -0
  295. package/dist/core/vision/leader-cadence.js.map +1 -0
  296. package/dist/core/vision/leader-goal-evidence.d.ts +25 -0
  297. package/dist/core/vision/leader-goal-evidence.js +36 -0
  298. package/dist/core/vision/leader-goal-evidence.js.map +1 -0
  299. package/dist/core/vision/leader-health.d.ts +53 -0
  300. package/dist/core/vision/leader-health.js +92 -0
  301. package/dist/core/vision/leader-health.js.map +1 -0
  302. package/dist/core/vision/leader-operator.d.ts +176 -0
  303. package/dist/core/vision/leader-operator.js +355 -0
  304. package/dist/core/vision/leader-operator.js.map +1 -0
  305. package/dist/core/vision/leader-run-chain.d.ts +41 -0
  306. package/dist/core/vision/leader-run-chain.js +54 -0
  307. package/dist/core/vision/leader-run-chain.js.map +1 -0
  308. package/dist/core/vision/leader-seat-plan.d.ts +68 -0
  309. package/dist/core/vision/leader-seat-plan.js +93 -0
  310. package/dist/core/vision/leader-seat-plan.js.map +1 -0
  311. package/dist/core/vision/leader-seat.d.ts +71 -5
  312. package/dist/core/vision/leader-seat.js +235 -33
  313. package/dist/core/vision/leader-seat.js.map +1 -1
  314. package/dist/core/vision/leader-thread-types.d.ts +104 -0
  315. package/dist/core/vision/leader-thread-types.js +9 -0
  316. package/dist/core/vision/leader-thread-types.js.map +1 -0
  317. package/dist/core/vision/leader-thread.d.ts +138 -0
  318. package/dist/core/vision/leader-thread.js +926 -0
  319. package/dist/core/vision/leader-thread.js.map +1 -0
  320. package/dist/core/vision/leader-types.d.ts +75 -1
  321. package/dist/core/vision/leader.d.ts +88 -18
  322. package/dist/core/vision/leader.js +269 -69
  323. package/dist/core/vision/leader.js.map +1 -1
  324. package/dist/core/web/public/next/assets/{ActionMenu-B4-39f2S.js → ActionMenu-CIiX2X8w.js} +2 -2
  325. package/dist/core/web/public/next/assets/{ActionMenu-B4-39f2S.js.map → ActionMenu-CIiX2X8w.js.map} +1 -1
  326. package/dist/core/web/public/next/assets/Advanced-DHsysoIL.js +2 -0
  327. package/dist/core/web/public/next/assets/{Advanced-B-LqYXvd.js.map → Advanced-DHsysoIL.js.map} +1 -1
  328. package/dist/core/web/public/next/assets/App-CMeAocmW.js +7 -0
  329. package/dist/core/web/public/next/assets/{App-E2zCDRxm.js.map → App-CMeAocmW.js.map} +1 -1
  330. package/dist/core/web/public/next/assets/AppsSection-DISYnMnc.js +2 -0
  331. package/dist/core/web/public/next/assets/{AppsSection-8wXPPhZb.js.map → AppsSection-DISYnMnc.js.map} +1 -1
  332. package/dist/core/web/public/next/assets/AreaTrend-DK2Y2TbZ.js +2 -0
  333. package/dist/core/web/public/next/assets/AreaTrend-DK2Y2TbZ.js.map +1 -0
  334. package/dist/core/web/public/next/assets/AutonomyOffState-CEPSZToP.js +3 -0
  335. package/dist/core/web/public/next/assets/AutonomyOffState-CEPSZToP.js.map +1 -0
  336. package/dist/core/web/public/next/assets/AutonomyOffState-CmSSTHVe.css +1 -0
  337. package/dist/core/web/public/next/assets/AutonomySection-DWc3ciAD.js +2 -0
  338. package/dist/core/web/public/next/assets/{AutonomySection-B46igJKR.js.map → AutonomySection-DWc3ciAD.js.map} +1 -1
  339. package/dist/core/web/public/next/assets/AutonomyStatus-CYaHjJ9U.js +2 -0
  340. package/dist/core/web/public/next/assets/AutonomyStatus-CYaHjJ9U.js.map +1 -0
  341. package/dist/core/web/public/next/assets/{BranchBar-BRkrEQGs.js → BranchBar-BxhdiIpx.js} +2 -2
  342. package/dist/core/web/public/next/assets/{BranchBar-BRkrEQGs.js.map → BranchBar-BxhdiIpx.js.map} +1 -1
  343. package/dist/core/web/public/next/assets/BudgetControl-C-0KhjRS.js +2 -0
  344. package/dist/core/web/public/next/assets/BudgetControl-C-0KhjRS.js.map +1 -0
  345. package/dist/core/web/public/next/assets/{Button-BhO-WKPp.js → Button-D90dzI_o.js} +2 -2
  346. package/dist/core/web/public/next/assets/{Button-BhO-WKPp.js.map → Button-D90dzI_o.js.map} +1 -1
  347. package/dist/core/web/public/next/assets/{CapacityStrip-CkFz5vq2.js → CapacityStrip-qKDBC65C.js} +2 -2
  348. package/dist/core/web/public/next/assets/{CapacityStrip-CkFz5vq2.js.map → CapacityStrip-qKDBC65C.js.map} +1 -1
  349. package/dist/core/web/public/next/assets/ChartFrame-DY-GVUb3.js +2 -0
  350. package/dist/core/web/public/next/assets/ChartFrame-DY-GVUb3.js.map +1 -0
  351. package/dist/core/web/public/next/assets/ChartFrame-DyjmyV8N.css +1 -0
  352. package/dist/core/web/public/next/assets/ChatSection-DlT4QU6a.js +3 -0
  353. package/dist/core/web/public/next/assets/ChatSection-DlT4QU6a.js.map +1 -0
  354. package/dist/core/web/public/next/assets/{CloudBudgetForm-Bd91iStN.js → CloudBudgetForm-BrNun_Yu.js} +2 -2
  355. package/dist/core/web/public/next/assets/{CloudBudgetForm-Bd91iStN.js.map → CloudBudgetForm-BrNun_Yu.js.map} +1 -1
  356. package/dist/core/web/public/next/assets/CommandPalette-C5lDDKN0.js +2 -0
  357. package/dist/core/web/public/next/assets/CommandPalette-C5lDDKN0.js.map +1 -0
  358. package/dist/core/web/public/next/assets/CommandSection-B0xuU-yZ.css +1 -0
  359. package/dist/core/web/public/next/assets/CommandSection-DXFvPgKp.js +3 -0
  360. package/dist/core/web/public/next/assets/CommandSection-DXFvPgKp.js.map +1 -0
  361. package/dist/core/web/public/next/assets/{ConfirmDialog-Bv4hdK2T.js → ConfirmDialog-BR4nZQ2D.js} +2 -2
  362. package/dist/core/web/public/next/assets/{ConfirmDialog-Bv4hdK2T.js.map → ConfirmDialog-BR4nZQ2D.js.map} +1 -1
  363. package/dist/core/web/public/next/assets/{DeleteChatDialog-CH1Ix8Eh.js → DeleteChatDialog-BCfP12GH.js} +2 -2
  364. package/dist/core/web/public/next/assets/{DeleteChatDialog-CH1Ix8Eh.js.map → DeleteChatDialog-BCfP12GH.js.map} +1 -1
  365. package/dist/core/web/public/next/assets/{Dialog-BSsIFNqD.js → Dialog-D3msQlCj.js} +2 -2
  366. package/dist/core/web/public/next/assets/{Dialog-BSsIFNqD.js.map → Dialog-D3msQlCj.js.map} +1 -1
  367. package/dist/core/web/public/next/assets/{DiffPane-BpNuJmth.js → DiffPane-Ix6hvXlY.js} +2 -2
  368. package/dist/core/web/public/next/assets/{DiffPane-BpNuJmth.js.map → DiffPane-Ix6hvXlY.js.map} +1 -1
  369. package/dist/core/web/public/next/assets/{DiffViewer-CJarUvs0.js → DiffViewer-C4WKsCIe.js} +2 -2
  370. package/dist/core/web/public/next/assets/{DiffViewer-CJarUvs0.js.map → DiffViewer-C4WKsCIe.js.map} +1 -1
  371. package/dist/core/web/public/next/assets/DockHost-aWP7liri.js +2 -0
  372. package/dist/core/web/public/next/assets/{DockHost-DW9q0NdR.js.map → DockHost-aWP7liri.js.map} +1 -1
  373. package/dist/core/web/public/next/assets/{EmptyState-DPrd2aak.js → EmptyState-D2IRy3Cg.js} +2 -2
  374. package/dist/core/web/public/next/assets/{EmptyState-DPrd2aak.js.map → EmptyState-D2IRy3Cg.js.map} +1 -1
  375. package/dist/core/web/public/next/assets/{Epistemic-D7MxSmED.js → Epistemic-DMr18muX.js} +2 -2
  376. package/dist/core/web/public/next/assets/{Epistemic-D7MxSmED.js.map → Epistemic-DMr18muX.js.map} +1 -1
  377. package/dist/core/web/public/next/assets/EvidenceTimeline-DXmmz6Fi.js +2 -0
  378. package/dist/core/web/public/next/assets/EvidenceTimeline-DXmmz6Fi.js.map +1 -0
  379. package/dist/core/web/public/next/assets/EvidenceTimeline-PBDAiSuG.css +1 -0
  380. package/dist/core/web/public/next/assets/FleetSection-BfplcwFU.js +3 -0
  381. package/dist/core/web/public/next/assets/FleetSection-BfplcwFU.js.map +1 -0
  382. package/dist/core/web/public/next/assets/Funnel-Dh2yVHws.js +2 -0
  383. package/dist/core/web/public/next/assets/Funnel-Dh2yVHws.js.map +1 -0
  384. package/dist/core/web/public/next/assets/{GearTray-CIPtzeIx.js → GearTray-Dt-ee32-.js} +2 -2
  385. package/dist/core/web/public/next/assets/{GearTray-CIPtzeIx.js.map → GearTray-Dt-ee32-.js.map} +1 -1
  386. package/dist/core/web/public/next/assets/GrowthSection-P9EUfGeA.js +2 -0
  387. package/dist/core/web/public/next/assets/{GrowthSection-iiQg6wvK.js.map → GrowthSection-P9EUfGeA.js.map} +1 -1
  388. package/dist/core/web/public/next/assets/{HandoffDialog-DrQ6ofuy.js → HandoffDialog-CLJQLe7M.js} +2 -2
  389. package/dist/core/web/public/next/assets/{HandoffDialog-DrQ6ofuy.js.map → HandoffDialog-CLJQLe7M.js.map} +1 -1
  390. package/dist/core/web/public/next/assets/{Input-C0MQxEM6.js → Input-D_KRJA9V.js} +2 -2
  391. package/dist/core/web/public/next/assets/{Input-C0MQxEM6.js.map → Input-D_KRJA9V.js.map} +1 -1
  392. package/dist/core/web/public/next/assets/LeaderCard-D-7DlJuR.js +2 -0
  393. package/dist/core/web/public/next/assets/LeaderCard-D-7DlJuR.js.map +1 -0
  394. package/dist/core/web/public/next/assets/LeaderCard-DNsbLwY3.css +1 -0
  395. package/dist/core/web/public/next/assets/LeaderConversation-DGZjWI-E.js +2 -0
  396. package/dist/core/web/public/next/assets/LeaderConversation-DGZjWI-E.js.map +1 -0
  397. package/dist/core/web/public/next/assets/LeaderConversation-DPHUTq6W.css +1 -0
  398. package/dist/core/web/public/next/assets/MatrixHeatmap-C7BCG2d7.js +2 -0
  399. package/dist/core/web/public/next/assets/MatrixHeatmap-C7BCG2d7.js.map +1 -0
  400. package/dist/core/web/public/next/assets/McpSection-DGbRcyv8.js +2 -0
  401. package/dist/core/web/public/next/assets/{McpSection-BRuCcTjT.js.map → McpSection-DGbRcyv8.js.map} +1 -1
  402. package/dist/core/web/public/next/assets/{MessageMarkdown-bRvD5nSc.js → MessageMarkdown-DFvk06qG.js} +3 -3
  403. package/dist/core/web/public/next/assets/{MessageMarkdown-bRvD5nSc.js.map → MessageMarkdown-DFvk06qG.js.map} +1 -1
  404. package/dist/core/web/public/next/assets/{MessageMarkdownRenderer-FjjkPKA2.js → MessageMarkdownRenderer-BAv4oEUf.js} +2 -2
  405. package/dist/core/web/public/next/assets/{MessageMarkdownRenderer-FjjkPKA2.js.map → MessageMarkdownRenderer-BAv4oEUf.js.map} +1 -1
  406. package/dist/core/web/public/next/assets/{Meter-CFNLpwA-.js → Meter-CMj-VafN.js} +2 -2
  407. package/dist/core/web/public/next/assets/{Meter-CFNLpwA-.js.map → Meter-CMj-VafN.js.map} +1 -1
  408. package/dist/core/web/public/next/assets/MindSection-C6kLPIjt.js +3 -0
  409. package/dist/core/web/public/next/assets/MindSection-C6kLPIjt.js.map +1 -0
  410. package/dist/core/web/public/next/assets/{MutationTokenDialog-T7gv3a9r.js → MutationTokenDialog-DbnO8aYi.js} +2 -2
  411. package/dist/core/web/public/next/assets/{MutationTokenDialog-T7gv3a9r.js.map → MutationTokenDialog-DbnO8aYi.js.map} +1 -1
  412. package/dist/core/web/public/next/assets/NeedsYouDrawer-crsiX-Nc.js +3 -0
  413. package/dist/core/web/public/next/assets/NeedsYouDrawer-crsiX-Nc.js.map +1 -0
  414. package/dist/core/web/public/next/assets/NeedsYouList-CCsijdWt.js +2 -0
  415. package/dist/core/web/public/next/assets/{NeedsYouList-BgH8ezqf.js.map → NeedsYouList-CCsijdWt.js.map} +1 -1
  416. package/dist/core/web/public/next/assets/NeedsYouList-CH6Mq-E_.css +1 -0
  417. package/dist/core/web/public/next/assets/NewChatDialog-BlCHtOIr.js +3 -0
  418. package/dist/core/web/public/next/assets/{NewChatDialog-Db5Xjrk8.js.map → NewChatDialog-BlCHtOIr.js.map} +1 -1
  419. package/dist/core/web/public/next/assets/OnboardingFlow-Cy9BA9eR.js +3 -0
  420. package/dist/core/web/public/next/assets/OnboardingFlow-Cy9BA9eR.js.map +1 -0
  421. package/dist/core/web/public/next/assets/OnboardingGate-BXpNFoLt.js +3 -0
  422. package/dist/core/web/public/next/assets/{OnboardingGate-C4VXn7BJ.js.map → OnboardingGate-BXpNFoLt.js.map} +1 -1
  423. package/dist/core/web/public/next/assets/PreviewPane-COid5A0f.js +2 -0
  424. package/dist/core/web/public/next/assets/{PreviewPane-BPBbcROb.js.map → PreviewPane-COid5A0f.js.map} +1 -1
  425. package/dist/core/web/public/next/assets/{ProviderLogo-CT2cSfkg.js → ProviderLogo-Cq-CYIwT.js} +2 -2
  426. package/dist/core/web/public/next/assets/{ProviderLogo-CT2cSfkg.js.map → ProviderLogo-Cq-CYIwT.js.map} +1 -1
  427. package/dist/core/web/public/next/assets/{RailStatus-Vgl0GYtd.js → RailStatus-Co5UB6We.js} +2 -2
  428. package/dist/core/web/public/next/assets/{RailStatus-Vgl0GYtd.js.map → RailStatus-Co5UB6We.js.map} +1 -1
  429. package/dist/core/web/public/next/assets/{RefreshIndicator-CSyqpY_q.js → RefreshIndicator-DO9ibnSq.js} +2 -2
  430. package/dist/core/web/public/next/assets/{RefreshIndicator-CSyqpY_q.js.map → RefreshIndicator-DO9ibnSq.js.map} +1 -1
  431. package/dist/core/web/public/next/assets/ResourcePoolConsoleApp-Dr2WRgkq.js +7 -0
  432. package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-BX2nkdmZ.js.map → ResourcePoolConsoleApp-Dr2WRgkq.js.map} +1 -1
  433. package/dist/core/web/public/next/assets/ResourcesChrome-CwMnbqI1.js +3 -0
  434. package/dist/core/web/public/next/assets/ResourcesChrome-CwMnbqI1.js.map +1 -0
  435. package/dist/core/web/public/next/assets/ResourcesDrawer-B_Xp_JNc.js +2 -0
  436. package/dist/core/web/public/next/assets/ResourcesDrawer-B_Xp_JNc.js.map +1 -0
  437. package/dist/core/web/public/next/assets/ResourcesDrawer-DrGoO8KG.css +1 -0
  438. package/dist/core/web/public/next/assets/{RouteErrorBoundary-BaC7YVzR.js → RouteErrorBoundary-SkNhhUbt.js} +2 -2
  439. package/dist/core/web/public/next/assets/{RouteErrorBoundary-BaC7YVzR.js.map → RouteErrorBoundary-SkNhhUbt.js.map} +1 -1
  440. package/dist/core/web/public/next/assets/{RunInCloudAction-D5PDHJPE.js → RunInCloudAction-BXPlZwJQ.js} +2 -2
  441. package/dist/core/web/public/next/assets/{RunInCloudAction-D5PDHJPE.js.map → RunInCloudAction-BXPlZwJQ.js.map} +1 -1
  442. package/dist/core/web/public/next/assets/{SeatSelector-Cg75LInq.js → SeatSelector-J5R3zDkB.js} +3 -3
  443. package/dist/core/web/public/next/assets/{SeatSelector-Cg75LInq.js.map → SeatSelector-J5R3zDkB.js.map} +1 -1
  444. package/dist/core/web/public/next/assets/{Segmented-CametjLt.js → Segmented-CGh_-tBb.js} +2 -2
  445. package/dist/core/web/public/next/assets/{Segmented-CametjLt.js.map → Segmented-CGh_-tBb.js.map} +1 -1
  446. package/dist/core/web/public/next/assets/{Select-De52fghU.js → Select-CWnmUzs3.js} +2 -2
  447. package/dist/core/web/public/next/assets/{Select-De52fghU.js.map → Select-CWnmUzs3.js.map} +1 -1
  448. package/dist/core/web/public/next/assets/{SessionGate-CzlcNq3O.js → SessionGate-sp4KsnUo.js} +2 -2
  449. package/dist/core/web/public/next/assets/{SessionGate-CzlcNq3O.js.map → SessionGate-sp4KsnUo.js.map} +1 -1
  450. package/dist/core/web/public/next/assets/{SessionInsightChip-Bk_Owa7u.js → SessionInsightChip-DLFAzdbi.js} +2 -2
  451. package/dist/core/web/public/next/assets/{SessionInsightChip-Bk_Owa7u.js.map → SessionInsightChip-DLFAzdbi.js.map} +1 -1
  452. package/dist/core/web/public/next/assets/{SessionSearch-C6C8DHN8.js → SessionSearch-DbFjwR1h.js} +2 -2
  453. package/dist/core/web/public/next/assets/{SessionSearch-C6C8DHN8.js.map → SessionSearch-DbFjwR1h.js.map} +1 -1
  454. package/dist/core/web/public/next/assets/{SettingsSection-mI9wQYZg.js → SettingsSection-Ch23msJ5.js} +2 -2
  455. package/dist/core/web/public/next/assets/SettingsSection-Ch23msJ5.js.map +1 -0
  456. package/dist/core/web/public/next/assets/SetupChecklist-Bd76MBAR.js +2 -0
  457. package/dist/core/web/public/next/assets/SetupChecklist-Bd76MBAR.js.map +1 -0
  458. package/dist/core/web/public/next/assets/SetupChecklist-BhZpFLsj.css +1 -0
  459. package/dist/core/web/public/next/assets/ShadowDecisions-C5RAY91f.js +3 -0
  460. package/dist/core/web/public/next/assets/ShadowDecisions-C5RAY91f.js.map +1 -0
  461. package/dist/core/web/public/next/assets/{Sheet-CJhK9Dqv.js → Sheet-BZ2AG4Eo.js} +2 -2
  462. package/dist/core/web/public/next/assets/{Sheet-CJhK9Dqv.js.map → Sheet-BZ2AG4Eo.js.map} +1 -1
  463. package/dist/core/web/public/next/assets/{ShortcutsOverlay-DDW-i9Fc.js → ShortcutsOverlay-C8n8y3zf.js} +2 -2
  464. package/dist/core/web/public/next/assets/{ShortcutsOverlay-DDW-i9Fc.js.map → ShortcutsOverlay-C8n8y3zf.js.map} +1 -1
  465. package/dist/core/web/public/next/assets/Sidebar-DN--cPYN.js +3 -0
  466. package/dist/core/web/public/next/assets/Sidebar-DN--cPYN.js.map +1 -0
  467. package/dist/core/web/public/next/assets/{Slider-Bwd9HfXl.js → Slider-KVoJLDD6.js} +2 -2
  468. package/dist/core/web/public/next/assets/{Slider-Bwd9HfXl.js.map → Slider-KVoJLDD6.js.map} +1 -1
  469. package/dist/core/web/public/next/assets/StatTile-C4KgjltA.js +2 -0
  470. package/dist/core/web/public/next/assets/StatTile-C4KgjltA.js.map +1 -0
  471. package/dist/core/web/public/next/assets/StatTile-CNCqDoPO.css +1 -0
  472. package/dist/core/web/public/next/assets/{StatusBadge-DHKRtttH.js → StatusBadge-CXsYqmdU.js} +2 -2
  473. package/dist/core/web/public/next/assets/{StatusBadge-DHKRtttH.js.map → StatusBadge-CXsYqmdU.js.map} +1 -1
  474. package/dist/core/web/public/next/assets/StepBand-BMtVOFpK.js +2 -0
  475. package/dist/core/web/public/next/assets/StepBand-BMtVOFpK.js.map +1 -0
  476. package/dist/core/web/public/next/assets/{Surface-D--LXgQm.js → Surface-BfDmQcKe.js} +2 -2
  477. package/dist/core/web/public/next/assets/{Surface-D--LXgQm.js.map → Surface-BfDmQcKe.js.map} +1 -1
  478. package/dist/core/web/public/next/assets/Swimlane-B9Exxekk.js +2 -0
  479. package/dist/core/web/public/next/assets/Swimlane-B9Exxekk.js.map +1 -0
  480. package/dist/core/web/public/next/assets/Swimlane-Bf4Rjoy9.css +1 -0
  481. package/dist/core/web/public/next/assets/{Switch-PMixU6b0.js → Switch-9NtO_6Lj.js} +2 -2
  482. package/dist/core/web/public/next/assets/{Switch-PMixU6b0.js.map → Switch-9NtO_6Lj.js.map} +1 -1
  483. package/dist/core/web/public/next/assets/{Tag-fordBsrJ.js → Tag-DscCRFcN.js} +2 -2
  484. package/dist/core/web/public/next/assets/{Tag-fordBsrJ.js.map → Tag-DscCRFcN.js.map} +1 -1
  485. package/dist/core/web/public/next/assets/{TerminalPane-BSnGdUuF.js → TerminalPane-B668-DJW.js} +5 -5
  486. package/dist/core/web/public/next/assets/{TerminalPane-BSnGdUuF.js.map → TerminalPane-B668-DJW.js.map} +1 -1
  487. package/dist/core/web/public/next/assets/UniverseConsoleApp-BUV_brY7.js +2 -0
  488. package/dist/core/web/public/next/assets/{UniverseConsoleApp-DtXFhAhw.js.map → UniverseConsoleApp-BUV_brY7.js.map} +1 -1
  489. package/dist/core/web/public/next/assets/{UniverseView-sWm3pnTW.js → UniverseView-DG70zH0W.js} +4 -4
  490. package/dist/core/web/public/next/assets/{UniverseView-sWm3pnTW.js.map → UniverseView-DG70zH0W.js.map} +1 -1
  491. package/dist/core/web/public/next/assets/UsageSection-DY7uOTm1.js +3 -0
  492. package/dist/core/web/public/next/assets/UsageSection-DY7uOTm1.js.map +1 -0
  493. package/dist/core/web/public/next/assets/VerseConsoleApp-CWU6R3By.js +3 -0
  494. package/dist/core/web/public/next/assets/VerseConsoleApp-CWU6R3By.js.map +1 -0
  495. package/dist/core/web/public/next/assets/Workspace-D1nP9BhD.js +10 -0
  496. package/dist/core/web/public/next/assets/{Workspace-BQSZFSeO.js.map → Workspace-D1nP9BhD.js.map} +1 -1
  497. package/dist/core/web/public/next/assets/actions-CY-PjpGc.js +2 -0
  498. package/dist/core/web/public/next/assets/{actions-Ci6I4C0l.js.map → actions-CY-PjpGc.js.map} +1 -1
  499. package/dist/core/web/public/next/assets/actions-DkWhhWIg.css +1 -0
  500. package/dist/core/web/public/next/assets/{apps-model-DlwnfqwJ.js → apps-model-Du02KhAf.js} +2 -2
  501. package/dist/core/web/public/next/assets/{apps-model-DlwnfqwJ.js.map → apps-model-Du02KhAf.js.map} +1 -1
  502. package/dist/core/web/public/next/assets/{authority-model-BFuPezSo.js → authority-model-79SeuKlJ.js} +2 -2
  503. package/dist/core/web/public/next/assets/{authority-model-BFuPezSo.js.map → authority-model-79SeuKlJ.js.map} +1 -1
  504. package/dist/core/web/public/next/assets/autonomy-ladder-BGWmZzP7.css +1 -0
  505. package/dist/core/web/public/next/assets/autonomy-ladder.module-ArDv4bkr.js +2 -0
  506. package/dist/core/web/public/next/assets/autonomy-ladder.module-ArDv4bkr.js.map +1 -0
  507. package/dist/core/web/public/next/assets/budget-queries-D8QV5XtH.js +2 -0
  508. package/dist/core/web/public/next/assets/{budget-queries-DsAjH8ac.js.map → budget-queries-D8QV5XtH.js.map} +1 -1
  509. package/dist/core/web/public/next/assets/{capacity-strip-model-Dn1cNOhz.js → capacity-strip-model-BwZ1ZbkU.js} +2 -2
  510. package/dist/core/web/public/next/assets/{capacity-strip-model-Dn1cNOhz.js.map → capacity-strip-model-BwZ1ZbkU.js.map} +1 -1
  511. package/dist/core/web/public/next/assets/charts-BZ50mZD_.js +2 -0
  512. package/dist/core/web/public/next/assets/charts-BZ50mZD_.js.map +1 -0
  513. package/dist/core/web/public/next/assets/charts-ClCB18la.css +1 -0
  514. package/dist/core/web/public/next/assets/cloud-model-BDivRMqv.js +2 -0
  515. package/dist/core/web/public/next/assets/{cloud-model-CX407gPY.js.map → cloud-model-BDivRMqv.js.map} +1 -1
  516. package/dist/core/web/public/next/assets/{cloud-queries-QAhpExlz.js → cloud-queries-BPQQ5_pJ.js} +2 -2
  517. package/dist/core/web/public/next/assets/{cloud-queries-QAhpExlz.js.map → cloud-queries-BPQQ5_pJ.js.map} +1 -1
  518. package/dist/core/web/public/next/assets/{colors-BZ3a9wFf.js → colors-DvK0wMHH.js} +2 -2
  519. package/dist/core/web/public/next/assets/{colors-BZ3a9wFf.js.map → colors-DvK0wMHH.js.map} +1 -1
  520. package/dist/core/web/public/next/assets/{command-catalog-CF0cQQac.js → command-catalog-BIntSa9l.js} +2 -2
  521. package/dist/core/web/public/next/assets/command-catalog-BIntSa9l.js.map +1 -0
  522. package/dist/core/web/public/next/assets/{context-model-Co4wh3SM.js → context-model-Br8t9jgG.js} +2 -2
  523. package/dist/core/web/public/next/assets/{context-model-Co4wh3SM.js.map → context-model-Br8t9jgG.js.map} +1 -1
  524. package/dist/core/web/public/next/assets/{context-model-DV1zCfAm.js → context-model-CokrgEUq.js} +3 -3
  525. package/dist/core/web/public/next/assets/{context-model-DV1zCfAm.js.map → context-model-CokrgEUq.js.map} +1 -1
  526. package/dist/core/web/public/next/assets/context-queries-eL3caKVG.js +2 -0
  527. package/dist/core/web/public/next/assets/{context-queries-CktFQqSS.js.map → context-queries-eL3caKVG.js.map} +1 -1
  528. package/dist/core/web/public/next/assets/{control-queries-DAvlh_YM.js → control-queries-B9K-wmcB.js} +2 -2
  529. package/dist/core/web/public/next/assets/{control-queries-DAvlh_YM.js.map → control-queries-B9K-wmcB.js.map} +1 -1
  530. package/dist/core/web/public/next/assets/copy-setup-XMgCC5f8.js +2 -0
  531. package/dist/core/web/public/next/assets/copy-setup-XMgCC5f8.js.map +1 -0
  532. package/dist/core/web/public/next/assets/{dock-icons-BFuBbqJl.js → dock-icons-BJ6ZqB2t.js} +2 -2
  533. package/dist/core/web/public/next/assets/{dock-icons-BFuBbqJl.js.map → dock-icons-BJ6ZqB2t.js.map} +1 -1
  534. package/dist/core/web/public/next/assets/{fleet-model-Dfd5JyLR.js → fleet-model-BvDR3gjp.js} +2 -2
  535. package/dist/core/web/public/next/assets/{fleet-model-Dfd5JyLR.js.map → fleet-model-BvDR3gjp.js.map} +1 -1
  536. package/dist/core/web/public/next/assets/{fleet-queries-RtMTd5rR.js → fleet-queries-W2UFVMZJ.js} +2 -2
  537. package/dist/core/web/public/next/assets/{fleet-queries-RtMTd5rR.js.map → fleet-queries-W2UFVMZJ.js.map} +1 -1
  538. package/dist/core/web/public/next/assets/{focus-trap-BdrbWfC4.js → focus-trap-CtI1SlMX.js} +2 -2
  539. package/dist/core/web/public/next/assets/{focus-trap-BdrbWfC4.js.map → focus-trap-CtI1SlMX.js.map} +1 -1
  540. package/dist/core/web/public/next/assets/format-CH4g_sl1.js +2 -0
  541. package/dist/core/web/public/next/assets/format-CH4g_sl1.js.map +1 -0
  542. package/dist/core/web/public/next/assets/{format-DKrNjdwD.js → format-D7nBg2bn.js} +2 -2
  543. package/dist/core/web/public/next/assets/{format-DKrNjdwD.js.map → format-D7nBg2bn.js.map} +1 -1
  544. package/dist/core/web/public/next/assets/{git-model-_BnI_Ogh.js → git-model-Dnkd1TnK.js} +2 -2
  545. package/dist/core/web/public/next/assets/{git-model-_BnI_Ogh.js.map → git-model-Dnkd1TnK.js.map} +1 -1
  546. package/dist/core/web/public/next/assets/global-CMNW_dqn.js +2 -0
  547. package/dist/core/web/public/next/assets/{global-CNNGMril.js.map → global-CMNW_dqn.js.map} +1 -1
  548. package/dist/core/web/public/next/assets/guarded-runners-YeAc9wLQ.js +2 -0
  549. package/dist/core/web/public/next/assets/{guarded-runners-DPh2d32e.js.map → guarded-runners-YeAc9wLQ.js.map} +1 -1
  550. package/dist/core/web/public/next/assets/{icons-0haWy6nh.js → icons-D1sYbCTQ.js} +2 -2
  551. package/dist/core/web/public/next/assets/{icons-0haWy6nh.js.map → icons-D1sYbCTQ.js.map} +1 -1
  552. package/dist/core/web/public/next/assets/{index-QesfXBsb.js → index-DZ-UQ7v8.js} +3 -3
  553. package/dist/core/web/public/next/assets/{index-QesfXBsb.js.map → index-DZ-UQ7v8.js.map} +1 -1
  554. package/dist/core/web/public/next/assets/leader-focus-BjeJv7CW.js +2 -0
  555. package/dist/core/web/public/next/assets/leader-focus-BjeJv7CW.js.map +1 -0
  556. package/dist/core/web/public/next/assets/leader-thread-types-CDb-VPPO.js +2 -0
  557. package/dist/core/web/public/next/assets/leader-thread-types-CDb-VPPO.js.map +1 -0
  558. package/dist/core/web/public/next/assets/{live-model-De-q0ZFK.js → live-model-D_32RAOR.js} +2 -2
  559. package/dist/core/web/public/next/assets/live-model-D_32RAOR.js.map +1 -0
  560. package/dist/core/web/public/next/assets/{mind.module-BrK2nFOL.js → mind.module-7hA92hRg.js} +2 -2
  561. package/dist/core/web/public/next/assets/{mind.module-BrK2nFOL.js.map → mind.module-7hA92hRg.js.map} +1 -1
  562. package/dist/core/web/public/next/assets/mutations-DQPbFdRJ.js +2 -0
  563. package/dist/core/web/public/next/assets/{mutations-DTCtKCn_.js.map → mutations-DQPbFdRJ.js.map} +1 -1
  564. package/dist/core/web/public/next/assets/{nav-KmGX0CVz.js → nav-0dOYe2rJ.js} +2 -2
  565. package/dist/core/web/public/next/assets/{nav-KmGX0CVz.js.map → nav-0dOYe2rJ.js.map} +1 -1
  566. package/dist/core/web/public/next/assets/{overnight-queries-mlO0xzsr.js → overnight-queries-C4wOnFtE.js} +2 -2
  567. package/dist/core/web/public/next/assets/{overnight-queries-mlO0xzsr.js.map → overnight-queries-C4wOnFtE.js.map} +1 -1
  568. package/dist/core/web/public/next/assets/primitives-2A5Eq8FQ.js +1 -0
  569. package/dist/core/web/public/next/assets/{queries-CyBE8nsW.js → queries-BTXWdZzU.js} +2 -2
  570. package/dist/core/web/public/next/assets/{queries-CyBE8nsW.js.map → queries-BTXWdZzU.js.map} +1 -1
  571. package/dist/core/web/public/next/assets/{reasoning-pref-CaoA4_Vl.js → reasoning-pref-Ca6lN6x_.js} +2 -2
  572. package/dist/core/web/public/next/assets/{reasoning-pref-CaoA4_Vl.js.map → reasoning-pref-Ca6lN6x_.js.map} +1 -1
  573. package/dist/core/web/public/next/assets/{reveal-anchor-BP1VqnPU.js → reveal-anchor-DfNLgK_I.js} +2 -2
  574. package/dist/core/web/public/next/assets/{reveal-anchor-BP1VqnPU.js.map → reveal-anchor-DfNLgK_I.js.map} +1 -1
  575. package/dist/core/web/public/next/assets/seat-subscription-C5uPHBsN.js +2 -0
  576. package/dist/core/web/public/next/assets/{seat-subscription-C5Tvr0WQ.js.map → seat-subscription-C5uPHBsN.js.map} +1 -1
  577. package/dist/core/web/public/next/assets/{sidebar-model-B5Qk95k_.js → sidebar-model-CLCdqwkR.js} +2 -2
  578. package/dist/core/web/public/next/assets/{sidebar-model-B5Qk95k_.js.map → sidebar-model-CLCdqwkR.js.map} +1 -1
  579. package/dist/core/web/public/next/assets/{slots-DHKQDoE6.js → slots-C-qBeu-8.js} +3 -3
  580. package/dist/core/web/public/next/assets/{slots-DHKQDoE6.js.map → slots-C-qBeu-8.js.map} +1 -1
  581. package/dist/core/web/public/next/assets/{surface-data-CchClvHo.js → surface-data-Dj71tdD-.js} +2 -2
  582. package/dist/core/web/public/next/assets/{surface-data-CchClvHo.js.map → surface-data-Dj71tdD-.js.map} +1 -1
  583. package/dist/core/web/public/next/assets/surface-prefetch-B0WdJOJG.js +2 -0
  584. package/dist/core/web/public/next/assets/surface-prefetch-B0WdJOJG.js.map +1 -0
  585. package/dist/core/web/public/next/assets/{tasks-model-D6WFVULI.js → tasks-model-O8yR5YXp.js} +2 -2
  586. package/dist/core/web/public/next/assets/{tasks-model-D6WFVULI.js.map → tasks-model-O8yR5YXp.js.map} +1 -1
  587. package/dist/core/web/public/next/assets/{terminal-icons-BvCvuXk2.js → terminal-icons-CoRZq9iO.js} +2 -2
  588. package/dist/core/web/public/next/assets/{terminal-icons-BvCvuXk2.js.map → terminal-icons-CoRZq9iO.js.map} +1 -1
  589. package/dist/core/web/public/next/assets/thread-data-DQB_g66d.js +2 -0
  590. package/dist/core/web/public/next/assets/thread-data-DQB_g66d.js.map +1 -0
  591. package/dist/core/web/public/next/assets/types-IYKrYLku.js +2 -0
  592. package/dist/core/web/public/next/assets/types-IYKrYLku.js.map +1 -0
  593. package/dist/core/web/public/next/assets/{usage-queries-D1SU1t7r.js → usage-queries-AdjEyEtn.js} +2 -2
  594. package/dist/core/web/public/next/assets/{usage-queries-D1SU1t7r.js.map → usage-queries-AdjEyEtn.js.map} +1 -1
  595. package/dist/core/web/public/next/assets/{use-guarded-action-BZmBv7CJ.js → use-guarded-action-CuuMHeDX.js} +2 -2
  596. package/dist/core/web/public/next/assets/{use-guarded-action-BZmBv7CJ.js.map → use-guarded-action-CuuMHeDX.js.map} +1 -1
  597. package/dist/core/web/public/next/assets/{use-ticker-CkJ4-0wU.js → use-ticker-BBcp02SZ.js} +2 -2
  598. package/dist/core/web/public/next/assets/{use-ticker-CkJ4-0wU.js.map → use-ticker-BBcp02SZ.js.map} +1 -1
  599. package/dist/core/web/public/next/assets/{use-token-gate-CYcfk_GS.js → use-token-gate-CbXVYQYI.js} +2 -2
  600. package/dist/core/web/public/next/assets/{use-token-gate-CYcfk_GS.js.map → use-token-gate-CbXVYQYI.js.map} +1 -1
  601. package/dist/core/web/public/next/assets/{useOnboarding-CujRS6PK.js → useOnboarding-C_Fpe_sH.js} +2 -2
  602. package/dist/core/web/public/next/assets/{useOnboarding-CujRS6PK.js.map → useOnboarding-C_Fpe_sH.js.map} +1 -1
  603. package/dist/core/web/public/next/assets/{useSeatsRefresh-BEaQdkZs.js → useSeatsRefresh-Co1CnxLc.js} +2 -2
  604. package/dist/core/web/public/next/assets/{useSeatsRefresh-BEaQdkZs.js.map → useSeatsRefresh-Co1CnxLc.js.map} +1 -1
  605. package/dist/core/web/public/next/assets/{useVerseTranscript-BQ0J6Xhx.js → useVerseTranscript-DgbigUlV.js} +2 -2
  606. package/dist/core/web/public/next/assets/{useVerseTranscript-BQ0J6Xhx.js.map → useVerseTranscript-DgbigUlV.js.map} +1 -1
  607. package/dist/core/web/public/next/assets/{verse-icons-DndgEgKS.js → verse-icons-S56hIiXS.js} +2 -2
  608. package/dist/core/web/public/next/assets/{verse-icons-DndgEgKS.js.map → verse-icons-S56hIiXS.js.map} +1 -1
  609. package/dist/core/web/public/next/assets/verse-model-DAVevkNe.js +2 -0
  610. package/dist/core/web/public/next/assets/{verse-model-MMySehjj.js.map → verse-model-DAVevkNe.js.map} +1 -1
  611. package/dist/core/web/public/next/assets/{warmup-CNEH_-be.js → warmup-B_RAtNZ_.js} +3 -3
  612. package/dist/core/web/public/next/assets/{warmup-CNEH_-be.js.map → warmup-B_RAtNZ_.js.map} +1 -1
  613. package/dist/core/web/public/next/assets/why-seat-model-M_r0wX3b.js +2 -0
  614. package/dist/core/web/public/next/assets/why-seat-model-M_r0wX3b.js.map +1 -0
  615. package/dist/core/web/public/next/assets/{workspace-model-Dukb2wwv.js → workspace-model-dji5-Al3.js} +2 -2
  616. package/dist/core/web/public/next/assets/{workspace-model-Dukb2wwv.js.map → workspace-model-dji5-Al3.js.map} +1 -1
  617. package/dist/core/web/public/next/index.html +1 -1
  618. package/dist/core/web/read-projection-worker.js +2 -1
  619. package/dist/core/web/read-projection-worker.js.map +1 -1
  620. package/dist/core/web/read-projections.d.ts +3 -0
  621. package/dist/core/web/read-projections.js +2 -2
  622. package/dist/core/web/read-projections.js.map +1 -1
  623. package/dist/core/web/visibility.js +3 -4
  624. package/dist/core/web/visibility.js.map +1 -1
  625. package/dist/release-dependency-inventory.json +1 -1
  626. package/docs/AUTONOMY-GAP.md +1 -1
  627. package/package.json +3 -2
  628. package/dist/core/web/public/next/assets/Advanced-B-LqYXvd.js +0 -2
  629. package/dist/core/web/public/next/assets/App-E2zCDRxm.js +0 -7
  630. package/dist/core/web/public/next/assets/AppsSection-8wXPPhZb.js +0 -2
  631. package/dist/core/web/public/next/assets/AreaTrend-BFimExYn.js +0 -2
  632. package/dist/core/web/public/next/assets/AreaTrend-BFimExYn.js.map +0 -1
  633. package/dist/core/web/public/next/assets/AutonomyOffState-B5eEkmiz.js +0 -2
  634. package/dist/core/web/public/next/assets/AutonomyOffState-B5eEkmiz.js.map +0 -1
  635. package/dist/core/web/public/next/assets/AutonomyOffState-DmbE71vI.css +0 -1
  636. package/dist/core/web/public/next/assets/AutonomySection-B46igJKR.js +0 -2
  637. package/dist/core/web/public/next/assets/BudgetControl-T_RjPrw9.js +0 -2
  638. package/dist/core/web/public/next/assets/BudgetControl-T_RjPrw9.js.map +0 -1
  639. package/dist/core/web/public/next/assets/ChartFrame-BVuBe6RP.css +0 -1
  640. package/dist/core/web/public/next/assets/ChartFrame-SygZ7B3x.js +0 -2
  641. package/dist/core/web/public/next/assets/ChartFrame-SygZ7B3x.js.map +0 -1
  642. package/dist/core/web/public/next/assets/ChatSection-D6WybBpB.js +0 -3
  643. package/dist/core/web/public/next/assets/ChatSection-D6WybBpB.js.map +0 -1
  644. package/dist/core/web/public/next/assets/CommandPalette-B6SgDJH-.js +0 -2
  645. package/dist/core/web/public/next/assets/CommandPalette-B6SgDJH-.js.map +0 -1
  646. package/dist/core/web/public/next/assets/CommandSection-CvAVd1w4.css +0 -1
  647. package/dist/core/web/public/next/assets/CommandSection-DgMGoepd.js +0 -2
  648. package/dist/core/web/public/next/assets/CommandSection-DgMGoepd.js.map +0 -1
  649. package/dist/core/web/public/next/assets/DockHost-DW9q0NdR.js +0 -2
  650. package/dist/core/web/public/next/assets/FleetSection-BdZN6rGS.js +0 -3
  651. package/dist/core/web/public/next/assets/FleetSection-BdZN6rGS.js.map +0 -1
  652. package/dist/core/web/public/next/assets/Funnel-BeNQZWv2.js +0 -2
  653. package/dist/core/web/public/next/assets/Funnel-BeNQZWv2.js.map +0 -1
  654. package/dist/core/web/public/next/assets/GrowthSection-iiQg6wvK.js +0 -2
  655. package/dist/core/web/public/next/assets/LeaderCard-BRr3_yE-.js +0 -2
  656. package/dist/core/web/public/next/assets/LeaderCard-BRr3_yE-.js.map +0 -1
  657. package/dist/core/web/public/next/assets/MatrixHeatmap-DZvZeWXL.js +0 -2
  658. package/dist/core/web/public/next/assets/MatrixHeatmap-DZvZeWXL.js.map +0 -1
  659. package/dist/core/web/public/next/assets/McpSection-BRuCcTjT.js +0 -2
  660. package/dist/core/web/public/next/assets/MindSection-BTIiQS8P.js +0 -2
  661. package/dist/core/web/public/next/assets/MindSection-BTIiQS8P.js.map +0 -1
  662. package/dist/core/web/public/next/assets/NeedsYouDrawer-lYN4G_aM.js +0 -2
  663. package/dist/core/web/public/next/assets/NeedsYouDrawer-lYN4G_aM.js.map +0 -1
  664. package/dist/core/web/public/next/assets/NeedsYouList-BgH8ezqf.js +0 -2
  665. package/dist/core/web/public/next/assets/NeedsYouList-CruOt4JT.css +0 -1
  666. package/dist/core/web/public/next/assets/NewChatDialog-Db5Xjrk8.js +0 -3
  667. package/dist/core/web/public/next/assets/OnboardingFlow-LoY-zuSe.js +0 -2
  668. package/dist/core/web/public/next/assets/OnboardingFlow-LoY-zuSe.js.map +0 -1
  669. package/dist/core/web/public/next/assets/OnboardingGate-C4VXn7BJ.js +0 -3
  670. package/dist/core/web/public/next/assets/PreviewPane-BPBbcROb.js +0 -2
  671. package/dist/core/web/public/next/assets/ResourcePoolConsoleApp-BX2nkdmZ.js +0 -7
  672. package/dist/core/web/public/next/assets/ResourcesChrome-B2U2lO1H.js +0 -3
  673. package/dist/core/web/public/next/assets/ResourcesChrome-B2U2lO1H.js.map +0 -1
  674. package/dist/core/web/public/next/assets/ResourcesDrawer-BCFJ2Uq8.css +0 -1
  675. package/dist/core/web/public/next/assets/ResourcesDrawer-DlUKOjl9.js +0 -2
  676. package/dist/core/web/public/next/assets/ResourcesDrawer-DlUKOjl9.js.map +0 -1
  677. package/dist/core/web/public/next/assets/SettingsSection-mI9wQYZg.js.map +0 -1
  678. package/dist/core/web/public/next/assets/Sidebar-DT7ykaqS.js +0 -3
  679. package/dist/core/web/public/next/assets/Sidebar-DT7ykaqS.js.map +0 -1
  680. package/dist/core/web/public/next/assets/StatTile-BuLMsJMx.css +0 -1
  681. package/dist/core/web/public/next/assets/StatTile-DPZ5yyaU.js +0 -2
  682. package/dist/core/web/public/next/assets/StatTile-DPZ5yyaU.js.map +0 -1
  683. package/dist/core/web/public/next/assets/StepBand-DQykLkk_.js +0 -2
  684. package/dist/core/web/public/next/assets/StepBand-DQykLkk_.js.map +0 -1
  685. package/dist/core/web/public/next/assets/Swimlane-BzH6OCee.js +0 -2
  686. package/dist/core/web/public/next/assets/Swimlane-BzH6OCee.js.map +0 -1
  687. package/dist/core/web/public/next/assets/Swimlane-o6_Zsrnr.css +0 -1
  688. package/dist/core/web/public/next/assets/UniverseConsoleApp-DtXFhAhw.js +0 -2
  689. package/dist/core/web/public/next/assets/UsageSection-CiD1DbuF.js +0 -3
  690. package/dist/core/web/public/next/assets/UsageSection-CiD1DbuF.js.map +0 -1
  691. package/dist/core/web/public/next/assets/VerseConsoleApp-BCY5uSok.js +0 -3
  692. package/dist/core/web/public/next/assets/VerseConsoleApp-BCY5uSok.js.map +0 -1
  693. package/dist/core/web/public/next/assets/Workspace-BQSZFSeO.js +0 -10
  694. package/dist/core/web/public/next/assets/actions-BmIf9avl.css +0 -1
  695. package/dist/core/web/public/next/assets/actions-Ci6I4C0l.js +0 -2
  696. package/dist/core/web/public/next/assets/budget-queries-DsAjH8ac.js +0 -2
  697. package/dist/core/web/public/next/assets/charts-C_xJbJiw.js +0 -2
  698. package/dist/core/web/public/next/assets/charts-C_xJbJiw.js.map +0 -1
  699. package/dist/core/web/public/next/assets/charts-DhKTrQLw.css +0 -1
  700. package/dist/core/web/public/next/assets/cloud-model-CX407gPY.js +0 -2
  701. package/dist/core/web/public/next/assets/command-catalog-CF0cQQac.js.map +0 -1
  702. package/dist/core/web/public/next/assets/context-queries-CktFQqSS.js +0 -2
  703. package/dist/core/web/public/next/assets/copy-setup-CqRSfELB.js +0 -2
  704. package/dist/core/web/public/next/assets/copy-setup-CqRSfELB.js.map +0 -1
  705. package/dist/core/web/public/next/assets/format-Dk4Fmxax.js +0 -2
  706. package/dist/core/web/public/next/assets/format-Dk4Fmxax.js.map +0 -1
  707. package/dist/core/web/public/next/assets/global-CNNGMril.js +0 -2
  708. package/dist/core/web/public/next/assets/guarded-runners-DPh2d32e.js +0 -2
  709. package/dist/core/web/public/next/assets/live-model-De-q0ZFK.js.map +0 -1
  710. package/dist/core/web/public/next/assets/mutations-DTCtKCn_.js +0 -2
  711. package/dist/core/web/public/next/assets/primitives-D0Fb3TtS.js +0 -1
  712. package/dist/core/web/public/next/assets/seat-subscription-C5Tvr0WQ.js +0 -2
  713. package/dist/core/web/public/next/assets/surface-prefetch-BWr0LBQn.js +0 -2
  714. package/dist/core/web/public/next/assets/surface-prefetch-BWr0LBQn.js.map +0 -1
  715. package/dist/core/web/public/next/assets/types-D5XOdyw8.js +0 -2
  716. package/dist/core/web/public/next/assets/types-D5XOdyw8.js.map +0 -1
  717. package/dist/core/web/public/next/assets/verse-model-MMySehjj.js +0 -2
  718. package/dist/core/web/public/next/assets/why-seat-model-jlDTwYSc.js +0 -2
  719. package/dist/core/web/public/next/assets/why-seat-model-jlDTwYSc.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useVerseTranscript-BQ0J6Xhx.js","names":[],"sources":["../../../../../../src/web-ui/routes/verse/dock/dock-panes.ts","../../../../../../src/web-ui/routes/verse/verse-transcript.ts","../../../../../../src/web-ui/routes/verse/useVerseTranscript.ts"],"sourcesContent":["/**\n * routes/verse/dock/dock-panes.ts — which dock panes exist in this build,\n * and their names (unit C2).\n *\n * Split out of Dock.tsx so the header's pane toggles can ask without pulling\n * the dock itself into the chat's first-paint chunk: the dock is lazy (it\n * starts closed), the toggles are not.\n */\nimport { DOCK_PANES, type DockPaneId } from '../shell/dock-catalog.js';\nimport { isSlotAvailable, type SlotId } from '../shell/slots.js';\n\nconst SLOT_FOR: Readonly<Partial<Record<DockPaneId, SlotId>>> = Object.fromEntries(\n DOCK_PANES.filter((p) => p.slot !== null).map((p) => [p.id, p.slot]),\n);\n\n/** A pane exists in this build: C2's always, a slot pane once its unit's file landed. */\nexport function isPaneAvailable(pane: DockPaneId): boolean {\n const slot = SLOT_FOR[pane];\n return slot === undefined || isSlotAvailable(slot);\n}\n\nexport const DOCK_PANE_LABEL: Readonly<Record<DockPaneId, string>> = Object.fromEntries(\n DOCK_PANES.map((p) => [p.id, p.label]),\n) as Record<DockPaneId, string>;\n","/**\n * routes/verse/verse-transcript.ts — what the transcript renders, derived\n * from a session's raw event log (moved out of verse-store.ts).\n *\n * WHY A SEPARATE MODULE: verse-store is on the chat first-paint path (the\n * Chat section opens the selected chat's stream as it mounts), but nothing\n * reads a DERIVED transcript until the workspace or the dock — both lazy\n * chunks — renders one. Keeping the derivation here keeps ~5 KB of it out of\n * the chat first-paint critical JS (SPEC-310A §1, scripts/check-first-paint-\n * budget.mjs). verse-store must never import this module back as a value.\n *\n * `buildTranscript()` derives what the transcript renders from the raw\n * events: streamed `text-delta`s accumulate into a provisional assistant\n * bubble until the matching `assistant-message` arrives and replaces it;\n * `tool-use` and `tool-result` pair up by toolUseId into one card.\n * `getVerseTranscript()` memoizes it per session against the store's event\n * log, rebuilding only the turn segments that changed.\n */\nimport type { VerseEvent, VerseUsage } from '../../data/api-types.js';\nimport type { VerseRecoveryHow, VerseThinkingKind } from '../../../core/verse/types.js';\nimport { getVerseSessionState, getVerseThinkingStats, subscribeVerseStoreLifecycle, type VerseThinkingStat } from './verse-store.js';\n\n// ---------------------------------------------------------------------------\n// Per-session memo over the store\n// ---------------------------------------------------------------------------\n\nconst transcriptMemo = new Map<string, { events: readonly VerseEvent[]; transcript: Transcript; cache: TranscriptCache }>();\n\n// The store tells us when a chat is forgotten or everything is reset\n// (logout, tests), exactly when it used to clear this memo itself.\nsubscribeVerseStoreLifecycle((event) => {\n if (event.kind === 'reset') transcriptMemo.clear();\n else transcriptMemo.delete(event.sessionId);\n});\n\nconst EMPTY_TRANSCRIPT: Transcript = { items: [], live: false, usage: null, segments: [] };\n\n/**\n * The derived transcript, rebuilt only when the event log changed and then\n * only for the turn segments that changed (see buildTranscript's cache).\n */\nexport function getVerseTranscript(sessionId: string | null): Transcript {\n if (!sessionId) return EMPTY_TRANSCRIPT;\n const entry = getVerseSessionState(sessionId);\n const memo = transcriptMemo.get(sessionId);\n if (memo && memo.events === entry.events) return memo.transcript;\n const cache = memo?.cache ?? createTranscriptCache();\n const transcript = buildTranscript(entry.events, { cache, thinkingStats: getVerseThinkingStats(sessionId) });\n transcriptMemo.set(sessionId, { events: entry.events, transcript, cache });\n return transcript;\n}\n\n// ---------------------------------------------------------------------------\n// Transcript derivation\n// ---------------------------------------------------------------------------\n\nexport type TranscriptItem =\n | { kind: 'user'; key: string; turnId: string; at: string; text: string }\n | { kind: 'assistant'; key: string; turnId: string; at: string; text: string; streaming: boolean }\n | {\n kind: 'thinking';\n key: string;\n turnId: string;\n at: string;\n text: string;\n /** V3.10: the CLI sent a signature-only / redacted block — the model thought, the text is withheld. */\n redacted: boolean;\n /** Streaming wall time: the event's own figure, else what this tab measured; null = unknown. */\n durationMs: number | null;\n /** The CLI's reasoning-token estimate this tab saw while it streamed; null = unknown. */\n estimatedTokens: number | null;\n thinkingKind: VerseThinkingKind | null;\n }\n | {\n kind: 'tool';\n key: string;\n turnId: string;\n at: string;\n toolUseId: string;\n name: string;\n input: unknown;\n result: { output: string; isError: boolean } | null;\n /** tool-use → tool-result wall time; null while pending or unstamped. */\n durationMs: number | null;\n }\n | { kind: 'error'; key: string; turnId: string | null; at: string; message: string; code: string | null }\n | {\n /** V3.9: the CLI compacted its own context. Counts are null when the CLI does not report them (codex). */\n kind: 'compaction';\n key: string;\n turnId: string | null;\n at: string;\n trigger: 'auto' | 'manual';\n preTokens: number | null;\n postTokens: number | null;\n durationMs: number | null;\n }\n | { kind: 'cancelled'; key: string; turnId: string; at: string }\n | { kind: 'turn-done'; key: string; turnId: string; at: string; ok: boolean; durationMs: number }\n /** V3.10: the engine restored a lost native conversation. */\n | { kind: 'recovered'; key: string; turnId: string | null; at: string; how: VerseRecoveryHow; message: string }\n /** V3.10: the log hit its cap and dropped everything before `droppedBefore` (at a turn boundary). */\n | { kind: 'truncated'; key: string; turnId: null; at: string; droppedBefore: number };\n\n/**\n * One turn's worth of items — the log cut at each `user-message`. Unchanged\n * segments come back as the SAME object from a cached build, which is what\n * lets the renderer skip every finished turn while one is streaming.\n */\nexport interface TranscriptSegment {\n key: string;\n items: TranscriptItem[];\n}\n\nexport interface Transcript {\n items: TranscriptItem[];\n /** True while a turn is open (started and not yet done/cancelled). */\n live: boolean;\n /** Most recent usage frame seen in the log, if any. */\n usage: VerseUsage | null;\n /** `items`, cut into turn segments. Absent on a hand-built transcript (treated as one segment). */\n segments?: TranscriptSegment[];\n}\n\n/** Wall time between two ISO stamps; null when either is unparseable. */\nfunction spanMs(from: string, to: string): number | null {\n const a = Date.parse(from);\n const b = Date.parse(to);\n return Number.isFinite(a) && Number.isFinite(b) ? Math.max(0, b - a) : null;\n}\n\ninterface PendingText {\n turnId: string;\n at: string;\n text: string;\n key: string;\n}\n\ninterface SegmentBuild {\n /** Items without the trailing streamed text, which depends on whether the WHOLE log is live. */\n items: TranscriptItem[];\n pending: PendingText | null;\n /** The last live-flag change in this segment: true (started), false (ended) or null (none). */\n liveEffect: boolean | null;\n usage: VerseUsage | null;\n /** tool-results in this segment whose tool-use is not in it. */\n orphanResults: string[];\n toolUseIds: string[];\n}\n\ninterface CachedSegment {\n firstSeq: number;\n lastSeq: number;\n count: number;\n build: SegmentBuild;\n /** The finished segment per trailing-streaming flag it was finalized with. */\n finalized: { streaming: boolean; segment: TranscriptSegment } | null;\n}\n\nexport interface TranscriptCache {\n segments: Map<string, CachedSegment>;\n}\n\nexport function createTranscriptCache(): TranscriptCache {\n return { segments: new Map() };\n}\n\nexport interface BuildTranscriptOptions {\n /** Reuse segments from a previous build of the same session's log. */\n cache?: TranscriptCache;\n /** Measured figures for reasoning blocks this tab watched stream, by the persisted event's seq. */\n thinkingStats?: ReadonlyMap<number, VerseThinkingStat>;\n}\n\n/**\n * The original single-pass derivation over `events[from, to)`. A whole log\n * run through it in one range is exactly the pre-3.10 buildTranscript; cut\n * at `user-message` boundaries (where it flushes anyway) the pieces\n * concatenate to the same items.\n */\nfunction buildSegment(\n events: readonly VerseEvent[],\n from: number,\n to: number,\n stats: ReadonlyMap<number, VerseThinkingStat> | undefined,\n): SegmentBuild {\n const items: TranscriptItem[] = [];\n const toolIndex = new Map<string, number>();\n const orphanResults: string[] = [];\n const toolUseIds: string[] = [];\n let pending: PendingText | null = null;\n let liveEffect: boolean | null = null;\n let usage: VerseUsage | null = null;\n\n const flushPending = () => {\n if (!pending) return;\n items.push({ kind: 'assistant', key: pending.key, turnId: pending.turnId, at: pending.at, text: pending.text, streaming: false });\n pending = null;\n };\n\n for (let i = from; i < to; i += 1) {\n const e = events[i]!;\n switch (e.type) {\n case 'user-message':\n flushPending();\n items.push({ kind: 'user', key: `u-${e.seq}`, turnId: e.turnId, at: e.at, text: e.text });\n break;\n case 'turn-started':\n liveEffect = true;\n break;\n case 'text-delta':\n if (pending && pending.turnId !== e.turnId) flushPending();\n if (!pending) pending = { turnId: e.turnId, at: e.at, text: '', key: `d-${e.seq}` };\n pending.text += e.text;\n break;\n case 'assistant-message':\n // The complete message supersedes whatever deltas streamed before it.\n pending = null;\n items.push({ kind: 'assistant', key: `a-${e.seq}`, turnId: e.turnId, at: e.at, text: e.text, streaming: false });\n break;\n case 'thinking': {\n flushPending();\n const measured = stats?.get(e.seq);\n items.push({\n kind: 'thinking',\n key: `t-${e.seq}`,\n turnId: e.turnId,\n at: e.at,\n text: e.text,\n redacted: e.redacted === true,\n durationMs: typeof e.durationMs === 'number' && Number.isFinite(e.durationMs) && e.durationMs >= 0\n ? e.durationMs\n : measured?.durationMs ?? null,\n estimatedTokens: measured?.estimatedTokens ?? null,\n thinkingKind: e.kind ?? null,\n });\n break;\n }\n case 'tool-use':\n flushPending();\n toolIndex.set(e.toolUseId, items.length);\n toolUseIds.push(e.toolUseId);\n items.push({\n kind: 'tool',\n key: `tu-${e.seq}`,\n turnId: e.turnId,\n at: e.at,\n toolUseId: e.toolUseId,\n name: e.name,\n input: e.input,\n result: null,\n durationMs: null,\n });\n break;\n case 'tool-result': {\n const idx = toolIndex.get(e.toolUseId);\n const existing = idx === undefined ? undefined : items[idx];\n if (existing && existing.kind === 'tool') {\n items[idx!] = { ...existing, result: { output: e.output, isError: e.isError }, durationMs: spanMs(existing.at, e.at) };\n } else {\n orphanResults.push(e.toolUseId);\n items.push({\n kind: 'tool',\n key: `tr-${e.seq}`,\n turnId: e.turnId,\n at: e.at,\n toolUseId: e.toolUseId,\n name: 'tool',\n input: null,\n result: { output: e.output, isError: e.isError },\n durationMs: null,\n });\n }\n break;\n }\n case 'usage':\n usage = e.usage;\n break;\n case 'compaction':\n // Deliberately NO flushPending: CLIs compact between model calls, and\n // flushing a streamed bubble here would leave it in the list when the\n // complete `assistant-message` arrives — the same reply twice.\n items.push({\n kind: 'compaction',\n key: `k-${e.seq}`,\n turnId: e.turnId,\n at: e.at,\n trigger: e.trigger,\n preTokens: e.preTokens,\n postTokens: e.postTokens,\n durationMs: e.durationMs,\n });\n break;\n case 'error':\n flushPending();\n items.push({ kind: 'error', key: `e-${e.seq}`, turnId: e.turnId, at: e.at, message: e.message, code: typeof e.code === 'string' && e.code ? e.code : null });\n break;\n case 'cancelled':\n flushPending();\n liveEffect = false;\n items.push({ kind: 'cancelled', key: `c-${e.seq}`, turnId: e.turnId, at: e.at });\n break;\n case 'turn-done':\n flushPending();\n liveEffect = false;\n items.push({ kind: 'turn-done', key: `td-${e.seq}`, turnId: e.turnId, at: e.at, ok: e.ok, durationMs: e.durationMs });\n break;\n case 'recovered':\n // Like compaction, no flush: recovery happens before the new native\n // session produces anything, never in the middle of a reply.\n items.push({ kind: 'recovered', key: `r-${e.seq}`, turnId: e.turnId, at: e.at, how: e.how, message: e.message });\n break;\n case 'history-truncated':\n items.push({ kind: 'truncated', key: `h-${e.seq}`, turnId: null, at: e.at, droppedBefore: e.droppedBefore });\n break;\n default:\n break;\n }\n }\n return { items, pending, liveEffect, usage, orphanResults, toolUseIds };\n}\n\nfunction finalizeSegment(key: string, build: SegmentBuild, streaming: boolean): TranscriptSegment {\n const p = build.pending;\n if (!p) return { key, items: build.items };\n return {\n key,\n items: [...build.items, { kind: 'assistant', key: p.key, turnId: p.turnId, at: p.at, text: p.text, streaming }],\n };\n}\n\n// `VerseEvent[]` (not readonly) is the published signature: callers type\n// their fixture arrays as `Parameters<typeof buildTranscript>[0]` and push.\nexport function buildTranscript(events: VerseEvent[], options: BuildTranscriptOptions = {}): Transcript {\n const { cache, thinkingStats: stats } = options;\n if (events.length === 0) return { items: [], live: false, usage: null, segments: [] };\n\n // Cut at every user-message: a new ask always opens a new turn, and the\n // derivation flushes its streamed text there, so nothing spans the cut.\n const starts: number[] = [0];\n for (let i = 1; i < events.length; i += 1) if (events[i]!.type === 'user-message') starts.push(i);\n\n const builds: Array<{ key: string; build: SegmentBuild; cached: CachedSegment | null }> = [];\n const seenKeys = new Set<string>();\n for (let s = 0; s < starts.length; s += 1) {\n const from = starts[s]!;\n const to = s + 1 < starts.length ? starts[s + 1]! : events.length;\n const firstSeq = events[from]!.seq;\n const lastSeq = events[to - 1]!.seq;\n const count = to - from;\n const key = `s-${firstSeq}`;\n seenKeys.add(key);\n const hit = cache?.segments.get(key);\n if (hit && hit.firstSeq === firstSeq && hit.lastSeq === lastSeq && hit.count === count) {\n builds.push({ key, build: hit.build, cached: hit });\n continue;\n }\n const build = buildSegment(events, from, to, stats);\n const entry: CachedSegment = { firstSeq, lastSeq, count, build, finalized: null };\n cache?.segments.set(key, entry);\n builds.push({ key, build, cached: entry });\n }\n if (cache) for (const key of [...cache.segments.keys()]) if (!seenKeys.has(key)) cache.segments.delete(key);\n\n // A tool-result whose tool-use sits in an EARLIER segment would have\n // updated that earlier card in the single-pass derivation. It never\n // happens in a real log (a result follows its call inside one turn); if it\n // does, derive the whole log in one pass rather than render it differently.\n if (builds.length > 1) {\n const earlier = new Set<string>();\n for (const b of builds) {\n if (b.build.orphanResults.some((id) => earlier.has(id))) return singlePass(events, stats);\n for (const id of b.build.toolUseIds) earlier.add(id);\n }\n }\n\n let live = false;\n let usage: VerseUsage | null = null;\n for (const b of builds) {\n if (b.build.liveEffect !== null) live = b.build.liveEffect;\n if (b.build.usage !== null) usage = b.build.usage;\n }\n\n const segments: TranscriptSegment[] = [];\n const items: TranscriptItem[] = [];\n for (let s = 0; s < builds.length; s += 1) {\n const b = builds[s]!;\n // Deltas still arriving for an open turn render as a streaming bubble;\n // every earlier segment's trailing text was flushed by the next ask.\n const streaming = s === builds.length - 1 ? live : false;\n let segment: TranscriptSegment;\n if (b.cached?.finalized && b.cached.finalized.streaming === streaming) {\n segment = b.cached.finalized.segment;\n } else {\n segment = finalizeSegment(b.key, b.build, streaming);\n if (b.cached) b.cached.finalized = { streaming, segment };\n }\n segments.push(segment);\n for (const item of segment.items) items.push(item);\n }\n return { items, live, usage, segments };\n}\n\nfunction singlePass(events: readonly VerseEvent[], stats: ReadonlyMap<number, VerseThinkingStat> | undefined): Transcript {\n const build = buildSegment(events, 0, events.length, stats);\n const live = build.liveEffect ?? false;\n const segment = finalizeSegment(`s-${events[0]!.seq}`, build, live);\n return { items: segment.items, live, usage: build.usage, segments: [segment] };\n}\n\n// ---------------------------------------------------------------------------\n// Render-time grouping\n// ---------------------------------------------------------------------------\n\nexport type ToolGroupMember = Extract<TranscriptItem, { kind: 'tool' | 'thinking' }>;\n\nexport interface ToolGroupItem {\n kind: 'toolGroup';\n key: string;\n turnId: string;\n at: string;\n items: ToolGroupMember[];\n /** Tool calls only (thinking blocks are not counted). */\n toolCount: number;\n /** \"Read ×6, Edit ×4\" — names in first-seen order. */\n summary: string;\n errorCount: number;\n /** A member is still waiting for its result. */\n pending: boolean;\n /** Wall time between the first and last member, when both have parseable timestamps. */\n spanMs: number | null;\n}\n\nexport type TranscriptRenderItem = TranscriptItem | ToolGroupItem;\n\n/**\n * Fold runs of consecutive tool calls from the same turn that hold two or\n * more calls into one `toolGroup`, so an agentic turn reads as \"N tool calls\"\n * with a single disclosure instead of a wall of cards. A single call (with\n * whatever reasoning surrounds it) stays as it is.\n * Pure over buildTranscript()'s output (the index-based tool-result pairing\n * there is untouched).\n *\n * Reasoning INTERLEAVED between tool calls folds with them (it explains the\n * next call). Reasoning that ENDS a run — the model's last thought before it\n * answers or before the next ask — is lifted out and rendered on its own, so\n * the part worth reading is never two disclosures deep. A run of reasoning\n * alone never folds.\n */\nexport function groupTranscriptItems(items: readonly TranscriptItem[]): TranscriptRenderItem[] {\n const out: TranscriptRenderItem[] = [];\n let run: ToolGroupMember[] = [];\n\n const flush = () => {\n if (run.length === 0) return;\n let end = run.length;\n while (end > 0 && run[end - 1]!.kind === 'thinking') end -= 1;\n const folded = run.slice(0, end);\n const trailing = run.slice(end);\n // Only a run with two or more CALLS is worth a disclosure: \"1 tool\" hiding\n // a single call plus the reasoning before it is a click for nothing.\n if (folded.filter((m) => m.kind === 'tool').length >= 2) out.push(makeToolGroup(folded));\n else for (const member of folded) out.push(member);\n for (const thought of trailing) out.push(thought);\n run = [];\n };\n\n for (const item of items) {\n if ((item.kind === 'tool' || item.kind === 'thinking') && (run.length === 0 || run[0]!.turnId === item.turnId)) {\n run.push(item);\n continue;\n }\n flush();\n if (item.kind === 'tool' || item.kind === 'thinking') run.push(item);\n else out.push(item);\n }\n flush();\n return out;\n}\n\nfunction makeToolGroup(members: ToolGroupMember[]): ToolGroupItem {\n const counts = new Map<string, number>();\n let errorCount = 0;\n let pending = false;\n for (const m of members) {\n if (m.kind !== 'tool') continue;\n counts.set(m.name, (counts.get(m.name) ?? 0) + 1);\n if (m.result === null) pending = true;\n else if (m.result.isError) errorCount += 1;\n }\n const toolCount = [...counts.values()].reduce((a, b) => a + b, 0);\n const summary = [...counts.entries()].map(([name, n]) => (n > 1 ? `${name} ×${n}` : name)).join(', ');\n const span = spanMs(members[0]!.at, members[members.length - 1]!.at);\n return {\n kind: 'toolGroup',\n key: `g-${members[0]!.key}`,\n turnId: members[0]!.turnId,\n at: members[0]!.at,\n items: members,\n toolCount,\n summary,\n errorCount,\n pending,\n spanMs: span,\n };\n}\n","/**\n * routes/verse/useVerseTranscript.ts — the React glue over the derived\n * transcript (verse-transcript.ts).\n *\n * Not in useVerseSession.ts because that module is on the chat first-paint\n * path (the Chat section opens the chat through it) while the transcript is\n * rendered only by lazy chunks (the workspace, the dock). Importing the\n * derivation from there would put it back in the first-paint critical JS.\n */\nimport { useSyncExternalStore } from 'react';\nimport { useSessionSubscription } from './useVerseSession.js';\nimport { getVerseTranscript, type Transcript } from './verse-transcript.js';\n\n/** The transcript of one chat, rebuilt only for the turn that changed. */\nexport function useVerseTranscript(sessionId: string | null): Transcript {\n const subscribe = useSessionSubscription(sessionId);\n return useSyncExternalStore(\n subscribe,\n () => getVerseTranscript(sessionId),\n () => getVerseTranscript(sessionId),\n );\n}\n"],"mappings":"+OAWA,IAAM,EAA0D,OAAO,YACrE,EAAW,OAAQ,GAAM,EAAE,OAAS,IAAI,CAAC,CAAC,IAAK,GAAM,CAAC,EAAE,GAAI,EAAE,IAAI,CAAC,CACrE,EAGA,SAAgB,EAAgB,EAA2B,CACzD,IAAM,EAAO,EAAS,GACtB,OAAO,IAAS,IAAA,IAAa,EAAgB,CAAI,CACnD,CAEA,IAAa,EAAwD,OAAO,YAC1E,EAAW,IAAK,GAAM,CAAC,EAAE,GAAI,EAAE,KAAK,CAAC,CACvC,aCGM,EAAiB,IAAI,IAI3B,EAA8B,GAAU,CAClC,EAAM,OAAS,QAAS,EAAe,MAAM,EAC5C,EAAe,OAAO,EAAM,SAAS,CAC5C,CAAC,EAED,IAAM,EAA+B,CAAE,MAAO,CAAC,EAAG,KAAM,GAAO,MAAO,KAAM,SAAU,CAAC,CAAE,EAMzF,SAAgB,EAAmB,EAAsC,CACvE,GAAI,CAAC,EAAW,OAAO,EACvB,IAAM,EAAQ,EAAqB,CAAS,EACtC,EAAO,EAAe,IAAI,CAAS,EACzC,GAAI,GAAQ,EAAK,SAAW,EAAM,OAAQ,OAAO,EAAK,WACtD,IAAM,EAAQ,GAAM,OAAS,EAAsB,EAC7C,EAAa,EAAgB,EAAM,OAAQ,CAAE,QAAO,cAAe,EAAsB,CAAS,CAAE,CAAC,EAE3G,OADA,EAAe,IAAI,EAAW,CAAE,OAAQ,EAAM,OAAQ,aAAY,OAAM,CAAC,EAClE,CACT,CA2EA,SAAS,EAAO,EAAc,EAA2B,CACvD,IAAM,EAAI,KAAK,MAAM,CAAI,EACnB,EAAI,KAAK,M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,EAAE,CAAE,EAAE,EACnE,MAAO,CACL,KAAM,YACN,IAAK,KAAK,EAAQ,EAAE,CAAE,MACtB,OAAQ,EAAQ,EAAE,CAAE,OACpB,GAAI,EAAQ,EAAE,CAAE,GAChB,MAAO,EACP,YACA,UACA,aACA,UACA,OAAQ,CACV,CACF,CC3eA,SAAgB,EAAmB,EAAsC,CACvE,IAAM,EAAY,EAAuB,CAAS,EAClD,OAAA,EAAO,EAAA,qBAAA,CACL,MACM,EAAmB,CAAS,MAC5B,EAAmB,CAAS,CACpC,CACF"}
1
+ {"version":3,"file":"useVerseTranscript-DgbigUlV.js","names":[],"sources":["../../../../../../src/web-ui/routes/verse/dock/dock-panes.ts","../../../../../../src/web-ui/routes/verse/verse-transcript.ts","../../../../../../src/web-ui/routes/verse/useVerseTranscript.ts"],"sourcesContent":["/**\n * routes/verse/dock/dock-panes.ts — which dock panes exist in this build,\n * and their names (unit C2).\n *\n * Split out of Dock.tsx so the header's pane toggles can ask without pulling\n * the dock itself into the chat's first-paint chunk: the dock is lazy (it\n * starts closed), the toggles are not.\n */\nimport { DOCK_PANES, type DockPaneId } from '../shell/dock-catalog.js';\nimport { isSlotAvailable, type SlotId } from '../shell/slots.js';\n\nconst SLOT_FOR: Readonly<Partial<Record<DockPaneId, SlotId>>> = Object.fromEntries(\n DOCK_PANES.filter((p) => p.slot !== null).map((p) => [p.id, p.slot]),\n);\n\n/** A pane exists in this build: C2's always, a slot pane once its unit's file landed. */\nexport function isPaneAvailable(pane: DockPaneId): boolean {\n const slot = SLOT_FOR[pane];\n return slot === undefined || isSlotAvailable(slot);\n}\n\nexport const DOCK_PANE_LABEL: Readonly<Record<DockPaneId, string>> = Object.fromEntries(\n DOCK_PANES.map((p) => [p.id, p.label]),\n) as Record<DockPaneId, string>;\n","/**\n * routes/verse/verse-transcript.ts — what the transcript renders, derived\n * from a session's raw event log (moved out of verse-store.ts).\n *\n * WHY A SEPARATE MODULE: verse-store is on the chat first-paint path (the\n * Chat section opens the selected chat's stream as it mounts), but nothing\n * reads a DERIVED transcript until the workspace or the dock — both lazy\n * chunks — renders one. Keeping the derivation here keeps ~5 KB of it out of\n * the chat first-paint critical JS (SPEC-310A §1, scripts/check-first-paint-\n * budget.mjs). verse-store must never import this module back as a value.\n *\n * `buildTranscript()` derives what the transcript renders from the raw\n * events: streamed `text-delta`s accumulate into a provisional assistant\n * bubble until the matching `assistant-message` arrives and replaces it;\n * `tool-use` and `tool-result` pair up by toolUseId into one card.\n * `getVerseTranscript()` memoizes it per session against the store's event\n * log, rebuilding only the turn segments that changed.\n */\nimport type { VerseEvent, VerseUsage } from '../../data/api-types.js';\nimport type { VerseRecoveryHow, VerseThinkingKind } from '../../../core/verse/types.js';\nimport { getVerseSessionState, getVerseThinkingStats, subscribeVerseStoreLifecycle, type VerseThinkingStat } from './verse-store.js';\n\n// ---------------------------------------------------------------------------\n// Per-session memo over the store\n// ---------------------------------------------------------------------------\n\nconst transcriptMemo = new Map<string, { events: readonly VerseEvent[]; transcript: Transcript; cache: TranscriptCache }>();\n\n// The store tells us when a chat is forgotten or everything is reset\n// (logout, tests), exactly when it used to clear this memo itself.\nsubscribeVerseStoreLifecycle((event) => {\n if (event.kind === 'reset') transcriptMemo.clear();\n else transcriptMemo.delete(event.sessionId);\n});\n\nconst EMPTY_TRANSCRIPT: Transcript = { items: [], live: false, usage: null, segments: [] };\n\n/**\n * The derived transcript, rebuilt only when the event log changed and then\n * only for the turn segments that changed (see buildTranscript's cache).\n */\nexport function getVerseTranscript(sessionId: string | null): Transcript {\n if (!sessionId) return EMPTY_TRANSCRIPT;\n const entry = getVerseSessionState(sessionId);\n const memo = transcriptMemo.get(sessionId);\n if (memo && memo.events === entry.events) return memo.transcript;\n const cache = memo?.cache ?? createTranscriptCache();\n const transcript = buildTranscript(entry.events, { cache, thinkingStats: getVerseThinkingStats(sessionId) });\n transcriptMemo.set(sessionId, { events: entry.events, transcript, cache });\n return transcript;\n}\n\n// ---------------------------------------------------------------------------\n// Transcript derivation\n// ---------------------------------------------------------------------------\n\nexport type TranscriptItem =\n | { kind: 'user'; key: string; turnId: string; at: string; text: string }\n | { kind: 'assistant'; key: string; turnId: string; at: string; text: string; streaming: boolean }\n | {\n kind: 'thinking';\n key: string;\n turnId: string;\n at: string;\n text: string;\n /** V3.10: the CLI sent a signature-only / redacted block — the model thought, the text is withheld. */\n redacted: boolean;\n /** Streaming wall time: the event's own figure, else what this tab measured; null = unknown. */\n durationMs: number | null;\n /** The CLI's reasoning-token estimate this tab saw while it streamed; null = unknown. */\n estimatedTokens: number | null;\n thinkingKind: VerseThinkingKind | null;\n }\n | {\n kind: 'tool';\n key: string;\n turnId: string;\n at: string;\n toolUseId: string;\n name: string;\n input: unknown;\n result: { output: string; isError: boolean } | null;\n /** tool-use → tool-result wall time; null while pending or unstamped. */\n durationMs: number | null;\n }\n | { kind: 'error'; key: string; turnId: string | null; at: string; message: string; code: string | null }\n | {\n /** V3.9: the CLI compacted its own context. Counts are null when the CLI does not report them (codex). */\n kind: 'compaction';\n key: string;\n turnId: string | null;\n at: string;\n trigger: 'auto' | 'manual';\n preTokens: number | null;\n postTokens: number | null;\n durationMs: number | null;\n }\n | { kind: 'cancelled'; key: string; turnId: string; at: string }\n | { kind: 'turn-done'; key: string; turnId: string; at: string; ok: boolean; durationMs: number }\n /** V3.10: the engine restored a lost native conversation. */\n | { kind: 'recovered'; key: string; turnId: string | null; at: string; how: VerseRecoveryHow; message: string }\n /** V3.10: the log hit its cap and dropped everything before `droppedBefore` (at a turn boundary). */\n | { kind: 'truncated'; key: string; turnId: null; at: string; droppedBefore: number };\n\n/**\n * One turn's worth of items — the log cut at each `user-message`. Unchanged\n * segments come back as the SAME object from a cached build, which is what\n * lets the renderer skip every finished turn while one is streaming.\n */\nexport interface TranscriptSegment {\n key: string;\n items: TranscriptItem[];\n}\n\nexport interface Transcript {\n items: TranscriptItem[];\n /** True while a turn is open (started and not yet done/cancelled). */\n live: boolean;\n /** Most recent usage frame seen in the log, if any. */\n usage: VerseUsage | null;\n /** `items`, cut into turn segments. Absent on a hand-built transcript (treated as one segment). */\n segments?: TranscriptSegment[];\n}\n\n/** Wall time between two ISO stamps; null when either is unparseable. */\nfunction spanMs(from: string, to: string): number | null {\n const a = Date.parse(from);\n const b = Date.parse(to);\n return Number.isFinite(a) && Number.isFinite(b) ? Math.max(0, b - a) : null;\n}\n\ninterface PendingText {\n turnId: string;\n at: string;\n text: string;\n key: string;\n}\n\ninterface SegmentBuild {\n /** Items without the trailing streamed text, which depends on whether the WHOLE log is live. */\n items: TranscriptItem[];\n pending: PendingText | null;\n /** The last live-flag change in this segment: true (started), false (ended) or null (none). */\n liveEffect: boolean | null;\n usage: VerseUsage | null;\n /** tool-results in this segment whose tool-use is not in it. */\n orphanResults: string[];\n toolUseIds: string[];\n}\n\ninterface CachedSegment {\n firstSeq: number;\n lastSeq: number;\n count: number;\n build: SegmentBuild;\n /** The finished segment per trailing-streaming flag it was finalized with. */\n finalized: { streaming: boolean; segment: TranscriptSegment } | null;\n}\n\nexport interface TranscriptCache {\n segments: Map<string, CachedSegment>;\n}\n\nexport function createTranscriptCache(): TranscriptCache {\n return { segments: new Map() };\n}\n\nexport interface BuildTranscriptOptions {\n /** Reuse segments from a previous build of the same session's log. */\n cache?: TranscriptCache;\n /** Measured figures for reasoning blocks this tab watched stream, by the persisted event's seq. */\n thinkingStats?: ReadonlyMap<number, VerseThinkingStat>;\n}\n\n/**\n * The original single-pass derivation over `events[from, to)`. A whole log\n * run through it in one range is exactly the pre-3.10 buildTranscript; cut\n * at `user-message` boundaries (where it flushes anyway) the pieces\n * concatenate to the same items.\n */\nfunction buildSegment(\n events: readonly VerseEvent[],\n from: number,\n to: number,\n stats: ReadonlyMap<number, VerseThinkingStat> | undefined,\n): SegmentBuild {\n const items: TranscriptItem[] = [];\n const toolIndex = new Map<string, number>();\n const orphanResults: string[] = [];\n const toolUseIds: string[] = [];\n let pending: PendingText | null = null;\n let liveEffect: boolean | null = null;\n let usage: VerseUsage | null = null;\n\n const flushPending = () => {\n if (!pending) return;\n items.push({ kind: 'assistant', key: pending.key, turnId: pending.turnId, at: pending.at, text: pending.text, streaming: false });\n pending = null;\n };\n\n for (let i = from; i < to; i += 1) {\n const e = events[i]!;\n switch (e.type) {\n case 'user-message':\n flushPending();\n items.push({ kind: 'user', key: `u-${e.seq}`, turnId: e.turnId, at: e.at, text: e.text });\n break;\n case 'turn-started':\n liveEffect = true;\n break;\n case 'text-delta':\n if (pending && pending.turnId !== e.turnId) flushPending();\n if (!pending) pending = { turnId: e.turnId, at: e.at, text: '', key: `d-${e.seq}` };\n pending.text += e.text;\n break;\n case 'assistant-message':\n // The complete message supersedes whatever deltas streamed before it.\n pending = null;\n items.push({ kind: 'assistant', key: `a-${e.seq}`, turnId: e.turnId, at: e.at, text: e.text, streaming: false });\n break;\n case 'thinking': {\n flushPending();\n const measured = stats?.get(e.seq);\n items.push({\n kind: 'thinking',\n key: `t-${e.seq}`,\n turnId: e.turnId,\n at: e.at,\n text: e.text,\n redacted: e.redacted === true,\n durationMs: typeof e.durationMs === 'number' && Number.isFinite(e.durationMs) && e.durationMs >= 0\n ? e.durationMs\n : measured?.durationMs ?? null,\n estimatedTokens: measured?.estimatedTokens ?? null,\n thinkingKind: e.kind ?? null,\n });\n break;\n }\n case 'tool-use':\n flushPending();\n toolIndex.set(e.toolUseId, items.length);\n toolUseIds.push(e.toolUseId);\n items.push({\n kind: 'tool',\n key: `tu-${e.seq}`,\n turnId: e.turnId,\n at: e.at,\n toolUseId: e.toolUseId,\n name: e.name,\n input: e.input,\n result: null,\n durationMs: null,\n });\n break;\n case 'tool-result': {\n const idx = toolIndex.get(e.toolUseId);\n const existing = idx === undefined ? undefined : items[idx];\n if (existing && existing.kind === 'tool') {\n items[idx!] = { ...existing, result: { output: e.output, isError: e.isError }, durationMs: spanMs(existing.at, e.at) };\n } else {\n orphanResults.push(e.toolUseId);\n items.push({\n kind: 'tool',\n key: `tr-${e.seq}`,\n turnId: e.turnId,\n at: e.at,\n toolUseId: e.toolUseId,\n name: 'tool',\n input: null,\n result: { output: e.output, isError: e.isError },\n durationMs: null,\n });\n }\n break;\n }\n case 'usage':\n usage = e.usage;\n break;\n case 'compaction':\n // Deliberately NO flushPending: CLIs compact between model calls, and\n // flushing a streamed bubble here would leave it in the list when the\n // complete `assistant-message` arrives — the same reply twice.\n items.push({\n kind: 'compaction',\n key: `k-${e.seq}`,\n turnId: e.turnId,\n at: e.at,\n trigger: e.trigger,\n preTokens: e.preTokens,\n postTokens: e.postTokens,\n durationMs: e.durationMs,\n });\n break;\n case 'error':\n flushPending();\n items.push({ kind: 'error', key: `e-${e.seq}`, turnId: e.turnId, at: e.at, message: e.message, code: typeof e.code === 'string' && e.code ? e.code : null });\n break;\n case 'cancelled':\n flushPending();\n liveEffect = false;\n items.push({ kind: 'cancelled', key: `c-${e.seq}`, turnId: e.turnId, at: e.at });\n break;\n case 'turn-done':\n flushPending();\n liveEffect = false;\n items.push({ kind: 'turn-done', key: `td-${e.seq}`, turnId: e.turnId, at: e.at, ok: e.ok, durationMs: e.durationMs });\n break;\n case 'recovered':\n // Like compaction, no flush: recovery happens before the new native\n // session produces anything, never in the middle of a reply.\n items.push({ kind: 'recovered', key: `r-${e.seq}`, turnId: e.turnId, at: e.at, how: e.how, message: e.message });\n break;\n case 'history-truncated':\n items.push({ kind: 'truncated', key: `h-${e.seq}`, turnId: null, at: e.at, droppedBefore: e.droppedBefore });\n break;\n default:\n break;\n }\n }\n return { items, pending, liveEffect, usage, orphanResults, toolUseIds };\n}\n\nfunction finalizeSegment(key: string, build: SegmentBuild, streaming: boolean): TranscriptSegment {\n const p = build.pending;\n if (!p) return { key, items: build.items };\n return {\n key,\n items: [...build.items, { kind: 'assistant', key: p.key, turnId: p.turnId, at: p.at, text: p.text, streaming }],\n };\n}\n\n// `VerseEvent[]` (not readonly) is the published signature: callers type\n// their fixture arrays as `Parameters<typeof buildTranscript>[0]` and push.\nexport function buildTranscript(events: VerseEvent[], options: BuildTranscriptOptions = {}): Transcript {\n const { cache, thinkingStats: stats } = options;\n if (events.length === 0) return { items: [], live: false, usage: null, segments: [] };\n\n // Cut at every user-message: a new ask always opens a new turn, and the\n // derivation flushes its streamed text there, so nothing spans the cut.\n const starts: number[] = [0];\n for (let i = 1; i < events.length; i += 1) if (events[i]!.type === 'user-message') starts.push(i);\n\n const builds: Array<{ key: string; build: SegmentBuild; cached: CachedSegment | null }> = [];\n const seenKeys = new Set<string>();\n for (let s = 0; s < starts.length; s += 1) {\n const from = starts[s]!;\n const to = s + 1 < starts.length ? starts[s + 1]! : events.length;\n const firstSeq = events[from]!.seq;\n const lastSeq = events[to - 1]!.seq;\n const count = to - from;\n const key = `s-${firstSeq}`;\n seenKeys.add(key);\n const hit = cache?.segments.get(key);\n if (hit && hit.firstSeq === firstSeq && hit.lastSeq === lastSeq && hit.count === count) {\n builds.push({ key, build: hit.build, cached: hit });\n continue;\n }\n const build = buildSegment(events, from, to, stats);\n const entry: CachedSegment = { firstSeq, lastSeq, count, build, finalized: null };\n cache?.segments.set(key, entry);\n builds.push({ key, build, cached: entry });\n }\n if (cache) for (const key of [...cache.segments.keys()]) if (!seenKeys.has(key)) cache.segments.delete(key);\n\n // A tool-result whose tool-use sits in an EARLIER segment would have\n // updated that earlier card in the single-pass derivation. It never\n // happens in a real log (a result follows its call inside one turn); if it\n // does, derive the whole log in one pass rather than render it differently.\n if (builds.length > 1) {\n const earlier = new Set<string>();\n for (const b of builds) {\n if (b.build.orphanResults.some((id) => earlier.has(id))) return singlePass(events, stats);\n for (const id of b.build.toolUseIds) earlier.add(id);\n }\n }\n\n let live = false;\n let usage: VerseUsage | null = null;\n for (const b of builds) {\n if (b.build.liveEffect !== null) live = b.build.liveEffect;\n if (b.build.usage !== null) usage = b.build.usage;\n }\n\n const segments: TranscriptSegment[] = [];\n const items: TranscriptItem[] = [];\n for (let s = 0; s < builds.length; s += 1) {\n const b = builds[s]!;\n // Deltas still arriving for an open turn render as a streaming bubble;\n // every earlier segment's trailing text was flushed by the next ask.\n const streaming = s === builds.length - 1 ? live : false;\n let segment: TranscriptSegment;\n if (b.cached?.finalized && b.cached.finalized.streaming === streaming) {\n segment = b.cached.finalized.segment;\n } else {\n segment = finalizeSegment(b.key, b.build, streaming);\n if (b.cached) b.cached.finalized = { streaming, segment };\n }\n segments.push(segment);\n for (const item of segment.items) items.push(item);\n }\n return { items, live, usage, segments };\n}\n\nfunction singlePass(events: readonly VerseEvent[], stats: ReadonlyMap<number, VerseThinkingStat> | undefined): Transcript {\n const build = buildSegment(events, 0, events.length, stats);\n const live = build.liveEffect ?? false;\n const segment = finalizeSegment(`s-${events[0]!.seq}`, build, live);\n return { items: segment.items, live, usage: build.usage, segments: [segment] };\n}\n\n// ---------------------------------------------------------------------------\n// Render-time grouping\n// ---------------------------------------------------------------------------\n\nexport type ToolGroupMember = Extract<TranscriptItem, { kind: 'tool' | 'thinking' }>;\n\nexport interface ToolGroupItem {\n kind: 'toolGroup';\n key: string;\n turnId: string;\n at: string;\n items: ToolGroupMember[];\n /** Tool calls only (thinking blocks are not counted). */\n toolCount: number;\n /** \"Read ×6, Edit ×4\" — names in first-seen order. */\n summary: string;\n errorCount: number;\n /** A member is still waiting for its result. */\n pending: boolean;\n /** Wall time between the first and last member, when both have parseable timestamps. */\n spanMs: number | null;\n}\n\nexport type TranscriptRenderItem = TranscriptItem | ToolGroupItem;\n\n/**\n * Fold runs of consecutive tool calls from the same turn that hold two or\n * more calls into one `toolGroup`, so an agentic turn reads as \"N tool calls\"\n * with a single disclosure instead of a wall of cards. A single call (with\n * whatever reasoning surrounds it) stays as it is.\n * Pure over buildTranscript()'s output (the index-based tool-result pairing\n * there is untouched).\n *\n * Reasoning INTERLEAVED between tool calls folds with them (it explains the\n * next call). Reasoning that ENDS a run — the model's last thought before it\n * answers or before the next ask — is lifted out and rendered on its own, so\n * the part worth reading is never two disclosures deep. A run of reasoning\n * alone never folds.\n */\nexport function groupTranscriptItems(items: readonly TranscriptItem[]): TranscriptRenderItem[] {\n const out: TranscriptRenderItem[] = [];\n let run: ToolGroupMember[] = [];\n\n const flush = () => {\n if (run.length === 0) return;\n let end = run.length;\n while (end > 0 && run[end - 1]!.kind === 'thinking') end -= 1;\n const folded = run.slice(0, end);\n const trailing = run.slice(end);\n // Only a run with two or more CALLS is worth a disclosure: \"1 tool\" hiding\n // a single call plus the reasoning before it is a click for nothing.\n if (folded.filter((m) => m.kind === 'tool').length >= 2) out.push(makeToolGroup(folded));\n else for (const member of folded) out.push(member);\n for (const thought of trailing) out.push(thought);\n run = [];\n };\n\n for (const item of items) {\n if ((item.kind === 'tool' || item.kind === 'thinking') && (run.length === 0 || run[0]!.turnId === item.turnId)) {\n run.push(item);\n continue;\n }\n flush();\n if (item.kind === 'tool' || item.kind === 'thinking') run.push(item);\n else out.push(item);\n }\n flush();\n return out;\n}\n\nfunction makeToolGroup(members: ToolGroupMember[]): ToolGroupItem {\n const counts = new Map<string, number>();\n let errorCount = 0;\n let pending = false;\n for (const m of members) {\n if (m.kind !== 'tool') continue;\n counts.set(m.name, (counts.get(m.name) ?? 0) + 1);\n if (m.result === null) pending = true;\n else if (m.result.isError) errorCount += 1;\n }\n const toolCount = [...counts.values()].reduce((a, b) => a + b, 0);\n const summary = [...counts.entries()].map(([name, n]) => (n > 1 ? `${name} ×${n}` : name)).join(', ');\n const span = spanMs(members[0]!.at, members[members.length - 1]!.at);\n return {\n kind: 'toolGroup',\n key: `g-${members[0]!.key}`,\n turnId: members[0]!.turnId,\n at: members[0]!.at,\n items: members,\n toolCount,\n summary,\n errorCount,\n pending,\n spanMs: span,\n };\n}\n","/**\n * routes/verse/useVerseTranscript.ts — the React glue over the derived\n * transcript (verse-transcript.ts).\n *\n * Not in useVerseSession.ts because that module is on the chat first-paint\n * path (the Chat section opens the chat through it) while the transcript is\n * rendered only by lazy chunks (the workspace, the dock). Importing the\n * derivation from there would put it back in the first-paint critical JS.\n */\nimport { useSyncExternalStore } from 'react';\nimport { useSessionSubscription } from './useVerseSession.js';\nimport { getVerseTranscript, type Transcript } from './verse-transcript.js';\n\n/** The transcript of one chat, rebuilt only for the turn that changed. */\nexport function useVerseTranscript(sessionId: string | null): Transcript {\n const subscribe = useSessionSubscription(sessionId);\n return useSyncExternalStore(\n subscribe,\n () => getVerseTranscript(sessionId),\n () => getVerseTranscript(sessionId),\n );\n}\n"],"mappings":"+OAWA,IAAM,EAA0D,OAAO,YACrE,EAAW,OAAQ,GAAM,EAAE,OAAS,IAAI,CAAC,CAAC,IAAK,GAAM,CAAC,EAAE,GAAI,EAAE,IAAI,CAAC,CACrE,EAGA,SAAgB,EAAgB,EAA2B,CACzD,IAAM,EAAO,EAAS,GACtB,OAAO,IAAS,IAAA,IAAa,EAAgB,CAAI,CACnD,CAEA,IAAa,EAAwD,OAAO,YAC1E,EAAW,IAAK,GAAM,CAAC,EAAE,GAAI,EAAE,KAAK,CAAC,CACvC,aCGM,EAAiB,IAAI,IAI3B,EAA8B,GAAU,CAClC,EAAM,OAAS,QAAS,EAAe,MAAM,EAC5C,EAAe,OAAO,EAAM,SAAS,CAC5C,CAAC,EAED,IAAM,EAA+B,CAAE,MAAO,CAAC,EAAG,KAAM,GAAO,MAAO,KAAM,SAAU,CAAC,CAAE,EAMzF,SAAgB,EAAmB,EAAsC,CACvE,GAAI,CAAC,EAAW,OAAO,EACvB,IAAM,EAAQ,EAAqB,CAAS,EACtC,EAAO,EAAe,IAAI,CAAS,EACzC,GAAI,GAAQ,EAAK,SAAW,EAAM,OAAQ,OAAO,EAAK,WACtD,IAAM,EAAQ,GAAM,OAAS,EAAsB,EAC7C,EAAa,EAAgB,EAAM,OAAQ,CAAE,QAAO,cAAe,EAAsB,CAAS,CAAE,CAAC,EAE3G,OADA,EAAe,IAAI,EAAW,CAAE,OAAQ,EAAM,OAAQ,aAAY,OAAM,CAAC,EAClE,CACT,CA2EA,SAAS,EAAO,EAAc,EAA2B,CACvD,IAAM,EAAI,KAAK,MAAM,CAAI,EACnB,EAAI,KAAK,MAAM,CAAE,EACvB,OA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EACnE,MAAO,CACL,KAAM,YACN,IAAK,KAAK,EAAQ,EAAE,CAAE,MACtB,OAAQ,EAAQ,EAAE,CAAE,OACpB,GAAI,EAAQ,EAAE,CAAE,GAChB,MAAO,EACP,YACA,UACA,aACA,UACA,OAAQ,CACV,CACF,CC3eA,SAAgB,EAAmB,EAAsC,CACvE,IAAM,EAAY,EAAuB,CAAS,EAClD,OAAA,EAAO,EAAA,qBAAA,CACL,MACM,EAAmB,CAAS,MAC5B,EAAmB,CAAS,CACpC,CACF"}
@@ -1,2 +1,2 @@
1
- import{n as e}from"./index-QesfXBsb.js";import{O as t,k as n}from"./VerseConsoleApp-BCY5uSok.js";import{a as r,b as i,g as a,i as o,l as s,v as c}from"./icons-0haWy6nh.js";var l=e(),u=s,d=i;function f(e){return(0,l.jsxs)(t,{...e,children:[(0,l.jsx)(`rect`,{x:`2.5`,y:`2.5`,width:`4.5`,height:`4.5`,rx:`1`}),(0,l.jsx)(`rect`,{x:`9`,y:`2.5`,width:`4.5`,height:`4.5`,rx:`1`}),(0,l.jsx)(`rect`,{x:`2.5`,y:`9`,width:`4.5`,height:`4.5`,rx:`1`}),(0,l.jsx)(`rect`,{x:`9`,y:`9`,width:`4.5`,height:`4.5`,rx:`1`})]})}var p={command:n.command,fleet:n.fleet,growth:n.growth,mind:n.mind,chat:n.chat,settings:d,apps:f,usage:u},m=c,h=a,g=o,_=r;function v(e){return(0,l.jsxs)(t,{...e,children:[(0,l.jsx)(`rect`,{x:`2.5`,y:`3`,width:`11`,height:`10`,rx:`1.5`}),(0,l.jsx)(`path`,{d:`M10 3v10`})]})}function y(e){return(0,l.jsxs)(t,{...e,children:[(0,l.jsx)(`rect`,{x:`2.5`,y:`3`,width:`11`,height:`10`,rx:`1.5`}),(0,l.jsx)(`path`,{d:`M6 3v10`})]})}function b(e){return(0,l.jsxs)(t,{width:`1em`,height:`1em`,style:{display:`inline-block`,verticalAlign:`-0.125em`},...e,children:[(0,l.jsx)(`path`,{d:`M13 3.5v5a2 2 0 0 1-2 2H3.5`}),(0,l.jsx)(`path`,{d:`M6 8 3.5 10.5 6 13`})]})}export{h as a,m as c,u as d,v as i,d as l,g as n,b as o,_ as r,p as s,f as t,y as u};
2
- //# sourceMappingURL=verse-icons-DndgEgKS.js.map
1
+ import{n as e}from"./index-DZ-UQ7v8.js";import{O as t,k as n}from"./VerseConsoleApp-CWU6R3By.js";import{a as r,b as i,g as a,i as o,l as s,v as c}from"./icons-D1sYbCTQ.js";var l=e(),u=s,d=i;function f(e){return(0,l.jsxs)(t,{...e,children:[(0,l.jsx)(`rect`,{x:`2.5`,y:`2.5`,width:`4.5`,height:`4.5`,rx:`1`}),(0,l.jsx)(`rect`,{x:`9`,y:`2.5`,width:`4.5`,height:`4.5`,rx:`1`}),(0,l.jsx)(`rect`,{x:`2.5`,y:`9`,width:`4.5`,height:`4.5`,rx:`1`}),(0,l.jsx)(`rect`,{x:`9`,y:`9`,width:`4.5`,height:`4.5`,rx:`1`})]})}var p={command:n.command,fleet:n.fleet,growth:n.growth,mind:n.mind,chat:n.chat,settings:d,apps:f,usage:u},m=c,h=a,g=o,_=r;function v(e){return(0,l.jsxs)(t,{...e,children:[(0,l.jsx)(`rect`,{x:`2.5`,y:`3`,width:`11`,height:`10`,rx:`1.5`}),(0,l.jsx)(`path`,{d:`M10 3v10`})]})}function y(e){return(0,l.jsxs)(t,{...e,children:[(0,l.jsx)(`rect`,{x:`2.5`,y:`3`,width:`11`,height:`10`,rx:`1.5`}),(0,l.jsx)(`path`,{d:`M6 3v10`})]})}function b(e){return(0,l.jsxs)(t,{width:`1em`,height:`1em`,style:{display:`inline-block`,verticalAlign:`-0.125em`},...e,children:[(0,l.jsx)(`path`,{d:`M13 3.5v5a2 2 0 0 1-2 2H3.5`}),(0,l.jsx)(`path`,{d:`M6 8 3.5 10.5 6 13`})]})}export{h as a,m as c,u as d,v as i,d as l,g as n,b as o,_ as r,p as s,f as t,y as u};
2
+ //# sourceMappingURL=verse-icons-S56hIiXS.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"verse-icons-DndgEgKS.js","names":[],"sources":["../../../../../../src/web-ui/routes/verse/verse-icons.tsx"],"sourcesContent":["/**\n * routes/verse/verse-icons.tsx — the icons the shell rail and the chat chrome\n * use, under the names the Verse surfaces already import.\n *\n * Owner A's `components/primitives/icons.tsx` is now the drawing authority:\n * one geometry (16px box, 1.5px stroke, round caps/joins, currentColor), one\n * stroke weight, one accessibility convention. Everything below that has an\n * equivalent there is an ALIAS of it, so the rail and the inbox cannot drift\n * to two different chat glyphs.\n *\n * 3.10 adds the workbench surfaces (Command, Fleet, Growth, Mind), the gear\n * tray and Apps. They are drawn here, not in the shared set, because they\n * name Verse surfaces — a console page borrowing \"Fleet\" would be a lie.\n *\n * Five icons stay drawn here because the shared set has no equivalent and\n * they are Verse-specific chrome, not general console vocabulary:\n * `PanelIcon` / `SidebarIcon` (the two pane toggles, which must read as\n * mirror images of each other), `RailToggleIcon` (the rail's own expand /\n * collapse control, which has to read as the same family as those two),\n * `VerseMark` (the brand mark in the rail head, which is 32px and never takes\n * a color state; drawn in rail-icons.tsx with the other rail glyphs) and `McpIcon` (a plug — the shared set has no connector\n * glyph, and every candidate in it already means another rail section).\n */\nimport {\n IconChevronDown,\n IconChevronRight,\n IconCpu,\n IconGauge,\n IconInbox,\n IconMoon,\n IconPlus,\n IconSearch,\n IconSliders,\n IconTrash,\n type IconProps,\n} from '../../components/primitives/icons.js';\nimport { Icon, RAIL_ICON } from './rail-icons.js';\nimport type { ComponentType } from 'react';\nimport type { VerseSectionId } from './verse-ui-store.js';\n\nexport type { IconProps };\n// The rail's icons (the section glyphs, the gear, the mark) live in\n// rail-icons.tsx so the shell's first paint does not pull this module and the\n// shared icon set in with them; re-exported so the names stay importable here.\nexport {\n ChatIcon,\n CommandIcon,\n FleetIcon,\n GearIcon,\n GrowthIcon,\n MindIcon,\n NeedsYouIcon,\n RAIL_ICON,\n VerseMark,\n} from './rail-icons.js';\n\n// The gear tray's pages: drawn when the tray (or onboarding's tour) opens,\n// never by the rail itself, so not in rail-icons.tsx.\nexport const UsageIcon = IconGauge;\nexport const SettingsIcon = IconSliders;\n\n/** Apps & Accounts — a grid of tiles. */\nexport function AppsIcon(props: IconProps) {\n return (\n <Icon {...props}>\n <rect x=\"2.5\" y=\"2.5\" width=\"4.5\" height=\"4.5\" rx=\"1\" />\n <rect x=\"9\" y=\"2.5\" width=\"4.5\" height=\"4.5\" rx=\"1\" />\n <rect x=\"2.5\" y=\"9\" width=\"4.5\" height=\"4.5\" rx=\"1\" />\n <rect x=\"9\" y=\"9\" width=\"4.5\" height=\"4.5\" rx=\"1\" />\n </Icon>\n );\n}\n\n/** Every section's glyph: the rail's, plus the tray's. */\nexport const SECTION_ICON: Readonly<Record<VerseSectionId, ComponentType<IconProps>>> = {\n command: RAIL_ICON.command!,\n fleet: RAIL_ICON.fleet!,\n growth: RAIL_ICON.growth!,\n mind: RAIL_ICON.mind!,\n chat: RAIL_ICON.chat!,\n settings: SettingsIcon,\n apps: AppsIcon,\n usage: UsageIcon,\n};\n\n/**\n * Aliases onto the shared set. The names are the ones the Verse rail, sidebar\n * and composer already import — keeping them means this reconciliation\n * touched no call site.\n */\nexport const AutonomyIcon = IconCpu;\nexport const ApprovalsIcon = IconInbox;\nexport const SearchIcon = IconSearch;\nexport const PlusIcon = IconPlus;\nexport const TrashIcon = IconTrash;\nexport const ArrowDownIcon = IconChevronDown;\nexport const ChevronIcon = IconChevronRight;\n/** The rail's theme quick-toggle. One glyph for the control, not per-theme. */\nexport const ThemeIcon = IconMoon;\n\nexport function PanelIcon(props: IconProps) {\n return <Icon {...props}><rect x=\"2.5\" y=\"3\" width=\"11\" height=\"10\" rx=\"1.5\" /><path d=\"M10 3v10\" /></Icon>;\n}\n\nexport function SidebarIcon(props: IconProps) {\n return <Icon {...props}><rect x=\"2.5\" y=\"3\" width=\"11\" height=\"10\" rx=\"1.5\" /><path d=\"M6 3v10\" /></Icon>;\n}\n\n/**\n * The Return key (↩) as a key-legend glyph, 1em and inline so it sits in a\n * <kbd> like the letters around it. WHY drawn: of the fonts the console\n * serves, only the 230 KB full Plex face has U+21A9, so typing it into the\n * palette's or the drawer's key legend fetched that face each time one opened\n * (3.10 first-paint review; global.css scopes the full faces).\n */\nexport function ReturnKeyIcon(props: IconProps) {\n return (\n <Icon width=\"1em\" height=\"1em\" style={{ display: 'inline-block', verticalAlign: '-0.125em' }} {...props}>\n <path d=\"M13 3.5v5a2 2 0 0 1-2 2H3.5\" /><path d=\"M6 8 3.5 10.5 6 13\" />\n </Icon>\n );\n}\n\n/**\n * The rail's own expand/collapse control: the same framed panel as the two\n * pane toggles above, plus a chevron saying which way it is about to move.\n * ONE glyph that rotates rather than two drawings, so the control reads as a\n * single thing in two states — and so the state is carried by direction, the\n * one property a user can read without having memorised the other icon.\n */\nexport function RailToggleIcon({ expanded = false, ...props }: IconProps & { expanded?: boolean }) {\n return (\n <Icon {...props}>\n <rect x=\"2.5\" y=\"3\" width=\"11\" height=\"10\" rx=\"1.5\" />\n <path d=\"M6 3v10\" />\n {expanded ? <path d=\"M11.2 6.4 9.6 8l1.6 1.6\" /> : <path d=\"M9.4 6.4 11 8l-1.6 1.6\" />}\n </Icon>\n );\n}\n\n/**\n * MCP — a plug in a socket. Drawn here rather than aliased: the shared set's\n * nearest candidates (`IconCpu`, `IconSliders`, `IconKey`) are already the\n * Autonomy, Settings and credential glyphs, and two rail items that read as\n * the same picture is worse than one more 16px drawing.\n */\nexport function McpIcon(props: IconProps) {\n return (\n <Icon {...props}>\n <path d=\"M6 1.8v3.2M10 1.8v3.2\" />\n <path d=\"M3.8 5h8.4v2.6a4.2 4.2 0 0 1-4.2 4.2 4.2 4.2 0 0 1-4.2-4.2V5Z\" />\n <path d=\"M8 11.8v2.4\" />\n </Icon>\n );\n}\n"],"mappings":"sLA0Da,EAAY,EACZ,EAAe,EAG5B,SAAgB,EAAS,EAAkB,CACzC,OACE,EAAA,EAAA,KAAA,CAAC,EAAD,CAAM,GAAI,EAA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C9C,OACE,EAAA,EAAA,KAAA,CAAC,EAAD,CAAM,MAAM,MAAM,OAAO,MAAM,MAAO,CAAE,QAAS,eAAgB,cAAe,UAAW,EAAG,GAAI,EAAlG,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,EAAE,6BAA+B,CAAA,GAAC,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,EAAE,oBAAsB,CAAA,CAClE,GAEV"}
1
+ {"version":3,"file":"verse-icons-S56hIiXS.js","names":[],"sources":["../../../../../../src/web-ui/routes/verse/verse-icons.tsx"],"sourcesContent":["/**\n * routes/verse/verse-icons.tsx — the icons the shell rail and the chat chrome\n * use, under the names the Verse surfaces already import.\n *\n * Owner A's `components/primitives/icons.tsx` is now the drawing authority:\n * one geometry (16px box, 1.5px stroke, round caps/joins, currentColor), one\n * stroke weight, one accessibility convention. Everything below that has an\n * equivalent there is an ALIAS of it, so the rail and the inbox cannot drift\n * to two different chat glyphs.\n *\n * 3.10 adds the workbench surfaces (Command, Fleet, Growth, Mind), the gear\n * tray and Apps. They are drawn here, not in the shared set, because they\n * name Verse surfaces — a console page borrowing \"Fleet\" would be a lie.\n *\n * Five icons stay drawn here because the shared set has no equivalent and\n * they are Verse-specific chrome, not general console vocabulary:\n * `PanelIcon` / `SidebarIcon` (the two pane toggles, which must read as\n * mirror images of each other), `RailToggleIcon` (the rail's own expand /\n * collapse control, which has to read as the same family as those two),\n * `VerseMark` (the brand mark in the rail head, which is 32px and never takes\n * a color state; drawn in rail-icons.tsx with the other rail glyphs) and `McpIcon` (a plug — the shared set has no connector\n * glyph, and every candidate in it already means another rail section).\n */\nimport {\n IconChevronDown,\n IconChevronRight,\n IconCpu,\n IconGauge,\n IconInbox,\n IconMoon,\n IconPlus,\n IconSearch,\n IconSliders,\n IconTrash,\n type IconProps,\n} from '../../components/primitives/icons.js';\nimport { Icon, RAIL_ICON } from './rail-icons.js';\nimport type { ComponentType } from 'react';\nimport type { VerseSectionId } from './verse-ui-store.js';\n\nexport type { IconProps };\n// The rail's icons (the section glyphs, the gear, the mark) live in\n// rail-icons.tsx so the shell's first paint does not pull this module and the\n// shared icon set in with them; re-exported so the names stay importable here.\nexport {\n ChatIcon,\n CommandIcon,\n FleetIcon,\n GearIcon,\n GrowthIcon,\n MindIcon,\n NeedsYouIcon,\n RAIL_ICON,\n VerseMark,\n} from './rail-icons.js';\n\n// The gear tray's pages: drawn when the tray (or onboarding's tour) opens,\n// never by the rail itself, so not in rail-icons.tsx.\nexport const UsageIcon = IconGauge;\nexport const SettingsIcon = IconSliders;\n\n/** Apps & Accounts — a grid of tiles. */\nexport function AppsIcon(props: IconProps) {\n return (\n <Icon {...props}>\n <rect x=\"2.5\" y=\"2.5\" width=\"4.5\" height=\"4.5\" rx=\"1\" />\n <rect x=\"9\" y=\"2.5\" width=\"4.5\" height=\"4.5\" rx=\"1\" />\n <rect x=\"2.5\" y=\"9\" width=\"4.5\" height=\"4.5\" rx=\"1\" />\n <rect x=\"9\" y=\"9\" width=\"4.5\" height=\"4.5\" rx=\"1\" />\n </Icon>\n );\n}\n\n/** Every section's glyph: the rail's, plus the tray's. */\nexport const SECTION_ICON: Readonly<Record<VerseSectionId, ComponentType<IconProps>>> = {\n command: RAIL_ICON.command!,\n fleet: RAIL_ICON.fleet!,\n growth: RAIL_ICON.growth!,\n mind: RAIL_ICON.mind!,\n chat: RAIL_ICON.chat!,\n settings: SettingsIcon,\n apps: AppsIcon,\n usage: UsageIcon,\n};\n\n/**\n * Aliases onto the shared set. The names are the ones the Verse rail, sidebar\n * and composer already import — keeping them means this reconciliation\n * touched no call site.\n */\nexport const AutonomyIcon = IconCpu;\nexport const ApprovalsIcon = IconInbox;\nexport const SearchIcon = IconSearch;\nexport const PlusIcon = IconPlus;\nexport const TrashIcon = IconTrash;\nexport const ArrowDownIcon = IconChevronDown;\nexport const ChevronIcon = IconChevronRight;\n/** The rail's theme quick-toggle. One glyph for the control, not per-theme. */\nexport const ThemeIcon = IconMoon;\n\nexport function PanelIcon(props: IconProps) {\n return <Icon {...props}><rect x=\"2.5\" y=\"3\" width=\"11\" height=\"10\" rx=\"1.5\" /><path d=\"M10 3v10\" /></Icon>;\n}\n\nexport function SidebarIcon(props: IconProps) {\n return <Icon {...props}><rect x=\"2.5\" y=\"3\" width=\"11\" height=\"10\" rx=\"1.5\" /><path d=\"M6 3v10\" /></Icon>;\n}\n\n/**\n * The Return key (↩) as a key-legend glyph, 1em and inline so it sits in a\n * <kbd> like the letters around it. WHY drawn: of the fonts the console\n * serves, only the 230 KB full Plex face has U+21A9, so typing it into the\n * palette's or the drawer's key legend fetched that face each time one opened\n * (3.10 first-paint review; global.css scopes the full faces).\n */\nexport function ReturnKeyIcon(props: IconProps) {\n return (\n <Icon width=\"1em\" height=\"1em\" style={{ display: 'inline-block', verticalAlign: '-0.125em' }} {...props}>\n <path d=\"M13 3.5v5a2 2 0 0 1-2 2H3.5\" /><path d=\"M6 8 3.5 10.5 6 13\" />\n </Icon>\n );\n}\n\n/**\n * The rail's own expand/collapse control: the same framed panel as the two\n * pane toggles above, plus a chevron saying which way it is about to move.\n * ONE glyph that rotates rather than two drawings, so the control reads as a\n * single thing in two states — and so the state is carried by direction, the\n * one property a user can read without having memorised the other icon.\n */\nexport function RailToggleIcon({ expanded = false, ...props }: IconProps & { expanded?: boolean }) {\n return (\n <Icon {...props}>\n <rect x=\"2.5\" y=\"3\" width=\"11\" height=\"10\" rx=\"1.5\" />\n <path d=\"M6 3v10\" />\n {expanded ? <path d=\"M11.2 6.4 9.6 8l1.6 1.6\" /> : <path d=\"M9.4 6.4 11 8l-1.6 1.6\" />}\n </Icon>\n );\n}\n\n/**\n * MCP — a plug in a socket. Drawn here rather than aliased: the shared set's\n * nearest candidates (`IconCpu`, `IconSliders`, `IconKey`) are already the\n * Autonomy, Settings and credential glyphs, and two rail items that read as\n * the same picture is worse than one more 16px drawing.\n */\nexport function McpIcon(props: IconProps) {\n return (\n <Icon {...props}>\n <path d=\"M6 1.8v3.2M10 1.8v3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AAA,KAAA,CAAC,EAAD,CAAM,GAAI,EAAV,SAAA,EAAiB,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,EAAE,MAAM,EAAE,IAAI,MAAM,KAAK,OAAO,KAAK,GAAG,KAAO,CAAA,GAAC,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,EAAE,SAAW,CAAA,CAAO,GAC1G,CASA,SAAgB,EAAc,EAAkB,CAC9C,OACE,EAAA,EAAA,KAAA,CAAC,EAAD,CAAM,MAAM,MAAM,OAAO,MAAM,MAAO,CAAE,QAAS,eAAgB,cAAe,UAAW,EAAG,GAAI,EAAlG,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,EAAE,6BAA+B,CAAA,GAAC,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,EAAE,oBAAsB,CAAA,CAClE,GAEV"}
@@ -0,0 +1,2 @@
1
+ import{s as e}from"./index-DZ-UQ7v8.js";import{D as t}from"./VerseConsoleApp-CWU6R3By.js";import{i as n,n as r,r as i,t as a}from"./compaction-point-VL9oegWS.js";var o=4e5,s=36e5,c={claude:25e3,codex:15e3,grok:2e4,local:15e3},l=25e3;function u(e){return e?c[e]??25e3:l}c.local+8e3+r+a;var ee={"claude-opus-5.5":`claude-opus-5-5`};function d(e){return ee[e]??e}function f(e,t){if(!e)return null;if(t===`expansive`)return e.expansive??null;let n=i(e.contextWindow);return n===null?null:{contextWindow:n,autoCompactAt:i(e.autoCompactAt??null)}}function p(e){let t=f(e,`standard`),n=f(e,`expansive`);return n?!t||(n.autoCompactAt??n.contextWindow)>(t.autoCompactAt??t.contextWindow):!1}function m(e,t){if(t===`expansive`)return null;let n=i(e?.contextWindow??null);return n!==null&&n>4e5&&p(e)?o:null}var te=.8,ne=.95;function h(e){let t=Math.max(0,Math.floor(e.contextTokens||0)),n=i(e.contextWindow),r=i(e.autoCompactAt??null),a=n===null?null:t/n,o=r===null?null:t/r,s=o??a,c=e.contextTokensExact!==!1,l=`unknown`;return!c&&s!==null&&s>=1?l=`unknown`:n!==null&&t>n?l=`over`:s!==null&&(l=s>=.95?`danger`:s>=.8?`warn`:`ok`),{tokens:t,window:n,autoCompactAt:r,ofWindow:a,ofCompaction:o,untilCompaction:r===null?null:Math.max(0,r-t),tone:l,exact:c}}function g(e){let t=e.inputTokens+e.cacheReadTokens+e.cacheCreationTokens;return t>0?e.cacheReadTokens/t:null}function re(e){return Math.ceil(Math.max(0,e)/4)}function _(e,t,n=l){let r=f(t,`standard`);if(!r)return null;let i=Math.max(0,e)+Math.max(0,n),a=r.autoCompactAt??r.contextWindow;if(i<=a*.6)return`fits`;if(i<=a)return`tight`;let o=f(t,`expansive`);return o&&i<=(o.autoCompactAt??o.contextWindow)?`expansive`:`split`}function v(e){return e>=1e6?`${(e/1e6).toFixed(e%1e6==0?0:1)}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e)}function ie(e){let t=h(e.usage),n=[],r=`none`,i=e=>{(e===`urge`||e===`suggest`&&r===`none`)&&(r=e)};t.exact&&(t.tone===`over`?(i(`urge`),n.push(`Context (${v(t.tokens)}) is past the ${v(t.window??0)} window.`)):t.ofCompaction!==null&&t.ofCompaction>=.8&&(i(`suggest`),n.push(`About ${v(t.untilCompaction??0)} tokens left before the CLI auto-compacts.`)));let a=e.compactionCount??0;if(a>=2&&(i(`suggest`),n.push(`Compacted ${a} times — early turns now survive only as summaries.`)),e.lastActivityAt){let r=e.now-Date.parse(e.lastActivityAt);t.exact&&Number.isFinite(r)&&r>=36e5&&t.tokens>=1e5&&(i(`suggest`),n.push(`Idle over an hour: the prompt cache has likely expired, so the next turn re-reads ~${v(t.tokens)} tokens at full cost.`))}return{level:r,reasons:n}}function y(e){if((e.session.contextMode??`standard`)!==`standard`||!p(e.option))return{suggest:!1,reason:null};let t=e.session.compactionCount??0;return t>=2?{suggest:!0,reason:`This session has compacted ${t} times; expansive mode keeps more of it in view.`}:typeof e.workingSetTokens==`number`&&_(e.workingSetTokens,e.option)===`expansive`?{suggest:!0,reason:`The reachable code (~${v(e.workingSetTokens)} tokens) only fits the expansive budget.`}:{suggest:!1,reason:null}}function b(e){return e===`claude`||e===`codex`}function x(e){let t=null;for(let n of e)(n.type===`usage`||n.type===`turn-done`||n.type===`cancelled`||n.type===`context`&&n.turnId!==null)&&typeof n.at==`string`&&(t===null||n.at>t)&&(t=n.at);return t}function S(e){return e==null||!Number.isFinite(e)?`—`:Math.round(e)<1e3?String(Math.round(e)):Math.round(e/1e3)<1e3?`${Math.round(e/1e3)}k`:`${(e/1e6).toFixed(1).replace(/\.0$/,``)}M`}var C=e({CODEX_EXPANSIVE_METERING_NOTE:()=>I,ENGINE_LABEL:()=>T,ENGINE_ORDER:()=>w,SEAT_CAPACITY_WORD:()=>z,WINDOW_SOURCE_TEXT:()=>P,firstRunnableModel:()=>L,formatClock:()=>q,formatContextWindow:()=>$,formatDuration:()=>G,formatElapsed:()=>W,formatRelative:()=>K,groupSeats:()=>H,groupSessions:()=>U,isAbsolutePath:()=>Z,isVerseEngine:()=>E,modelLabel:()=>A,modelOptionFor:()=>j,prettyJson:()=>X,projectName:()=>D,seatById:()=>O,seatCapacity:()=>V,seatLabel:()=>k,seatPillLabel:()=>Q,seatUnavailableReason:()=>R,seatWindowLabel:()=>B,sessionContextBudget:()=>N,summarizeToolInput:()=>J,truncate:()=>Y,windowSourceText:()=>F}),w=[`claude`,`codex`,`grok`,`local`],T={claude:`Claude`,codex:`Codex`,grok:`Grok`,local:`Local`};function E(e){return w.includes(e)}function D(e,t=[]){let n=t.find(t=>t.path===e);return n?n.name:e.split(/[\\/]/).filter(Boolean).at(-1)??e}function O(e,t){return e.find(e=>e.id===t)}function k(e,t){return O(e,t.seatId)?.label??T[t.engine]}function A(e,t){return O(e,t.seatId)?.models.find(e=>e.id===t.model)?.label??t.model}function j(e,t){let n=O(e,t.seatId);if(!n)return null;let r=n.models.find(e=>e.id===t.model);if(r)return r;let i=d(t.model);return n.models.find(e=>d(e.id)===i)??null}function M(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:null}function N(e,t){let r=t.usage,i=t.contextMode??`standard`,a=j(e,t),o={contextTokens:typeof r.contextTokens==`number`&&Number.isFinite(r.contextTokens)?Math.max(0,r.contextTokens):0,exact:r.contextTokensExact!==!1,mode:i,option:a},s=f(a,i),c=M(r.contextWindow);if(c!==null&&(t.engine===`local`||r.contextWindowSource===`runtime`)){let e=M(r.autoCompactAt??null)??n({engine:t.engine,runtimeWindow:c,budget:t.engine===`local`?null:s,autocompactWindow:t.engine===`claude`?m(a,i):null,maxOutputTokens:a?.maxOutputTokens??null}),l=t.engine===`local`?r.contextWindowSource??null:`runtime`;return{...o,contextWindow:c,autoCompactAt:e,source:l}}if(s)return{...o,contextWindow:s.contextWindow,autoCompactAt:s.autoCompactAt,source:a?.windowSource??`fallback`};if(c!==null)return{...o,contextWindow:c,autoCompactAt:M(r.autoCompactAt??null),source:r.contextWindowSource??null};let l=M(O(e,t.seatId)?.contextWindow??null);return{...o,contextWindow:l,autoCompactAt:null,source:l===null?null:`fallback`}}var P={runtime:`reported by the CLI on the last turn`,"provider-catalog":`from this seat's own model catalog`,"cli-catalog":`from the pinned CLI's built-in model table`,documented:`from the provider's published model table`,fallback:`a default estimate — the CLI has not reported the real window yet`};function F(e,t){return t===`local`?`${e===`runtime`?`measured from the local model server`:e===`fallback`?`a default estimate — the model server did not report one`:P[e]}; Verse passes this window to Claude Code for this chat`:P[e]}var I=`OpenAI reportedly also counts requests above 272k tokens at about 2× against plan limits, so a turn near the expansive limit may cost roughly twice that.`;function L(e){return e.models.find(e=>!e.unavailableReason)??null}function R(e){return e.health.state===`unavailable`?e.health.summary??`seat unavailable`:null}var z={ready:`usable`,tight:`tight`,blocked:`blocked`,unread:`no reading`},ae=85;function B(e){let t={five_hour:`5-hour window`,seven_day:`weekly window`,codex:`weekly window`};if(t[e])return t[e];let n=/^seven_day_(.+)$/.exec(e);return n?`weekly ${n[1].replace(/_/g,` `)} window`:`${e.replace(/_/g,` `)} window`}function V(e){let n=R(e);if(n!==null)return{cls:`blocked`,usedPercent:null,text:n};let r=e.health.windows.filter(e=>typeof e.usedPercent==`number`&&Number.isFinite(e.usedPercent));if(r.length===0)return{cls:`unread`,usedPercent:null,text:`no capacity reading`};let i=r.reduce((e,t)=>t.usedPercent>e.usedPercent?t:e),a=Math.max(0,Math.min(100,i.usedPercent)),o=B(i.id);return a>=100?{cls:`blocked`,usedPercent:null,text:`${o} limit reached`}:{cls:a>=ae?`tight`:`ready`,usedPercent:a,text:`${t(a)} of ${o} used`}}function H(e){return w.map(t=>({engine:t,seats:e.filter(e=>e.engine===t)})).filter(e=>e.seats.length>0)}function U(e,t,n=``){let r=n.trim().toLowerCase(),i=r?e.filter(e=>e.title.toLowerCase().includes(r)||e.projectPath.toLowerCase().includes(r)||e.model.toLowerCase().includes(r)||e.seatId.toLowerCase().includes(r)):[...e],a=new Map;for(let e of i){let t=a.get(e.projectPath)??[];t.push(e),a.set(e.projectPath,t)}let o=[];for(let[e,n]of a)n.sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt)),o.push({projectPath:e,name:D(e,t),enrolled:t.find(t=>t.path===e)?.enrolled??!1,sessions:n});return o.sort((e,t)=>t.sessions[0].updatedAt.localeCompare(e.sessions[0].updatedAt)),o}function W(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 G(e){return!Number.isFinite(e)||e<0?`—`:e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:W(e)}function K(e,t=Date.now()){let n=Date.parse(e);if(!Number.isFinite(n))return``;let r=Math.round((t-n)/1e3);if(r<0||r<60)return`now`;let i=Math.floor(r/60);if(i<60)return`${i}m`;let a=Math.floor(i/60);if(a<24)return`${a}h`;let o=Math.floor(a/24);return o<7?`${o}d`:new Date(n).toLocaleDateString([],{month:`short`,day:`numeric`})}function q(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}function J(e){if(e==null)return``;if(typeof e==`string`)return Y(e,96);if(typeof e!=`object`)return Y(String(e),96);let t=e;for(let e of[`command`,`cmd`,`file_path`,`path`,`pattern`,`query`,`url`,`description`,`prompt`,`text`]){let n=t[e];if(typeof n==`string`&&n.trim())return Y(n.trim().replace(/\s+/g,` `),96)}let n=Object.keys(t);if(n.length===0)return``;let r=t[n[0]],i=typeof r==`string`?r:JSON.stringify(r);return Y(`${n[0]}: ${i??``}`.replace(/\s+/g,` `),96)}function Y(e,t){return e.length>t?`${e.slice(0,t-1)}…`:e}function X(e){if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)??``}catch{return String(e)}}function Z(e){return/^(?:\/|~(?:\/|$)|[a-zA-Z]:[\\/]|\\\\)/.test(e)&&![...e].some(e=>e.charCodeAt(0)<32||e.charCodeAt(0)>=127&&e.charCodeAt(0)<=159)}function Q(e,t){let n=k(e,t),r=A(e,t);return!r||n.toLowerCase().includes(r.toLowerCase())?n:`${n} · ${r}`}function $(e){return e==null||!Number.isInteger(e)||e<1024||e%1024!=0?S(e):e<1048576?`${e/1024}k`:`${(e/1048576).toFixed(1).replace(/\.0$/,``)}M`}export{s as A,ie as B,B as C,F as D,C as E,d as F,h as H,b as I,re as L,te as M,f as N,S as O,g as P,y as R,R as S,J as T,u as U,p as V,X as _,L as a,V as b,G as c,H as d,U as f,j as g,A as h,P as i,ne as j,x as k,W as l,E as m,T as n,q as o,Z as p,z as r,$ as s,I as t,K as u,D as v,N as w,Q as x,O as y,_ as z};
2
+ //# sourceMappingURL=verse-model-DAVevkNe.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"verse-model-MMySehjj.js","names":[],"sources":["../../../../../../src/core/verse/context-math.ts","../../../../../../src/web-ui/routes/verse/verse-readouts.ts","../../../../../../src/web-ui/routes/verse/verse-model.ts"],"sourcesContent":["/**\n * Ashlr Verse — context arithmetic shared by the server and the browser.\n *\n * PURE and BROWSER-SAFE: no node imports, no I/O. The seat catalog, the\n * session engine, the adapters and the UI all compute thresholds through this\n * one module, so \"compacts at 367k\" can never mean two different numbers in\n * two places. docs/VERSE-CONTEXT.md is the prose authority for every constant.\n *\n * Where each formula comes from (all read from the CLIs themselves, 2026-09-23):\n *\n * Claude Code (2.1.257 and 2.1.280 binaries): the auto-compaction window is\n * `min(--autocompact | autoCompactWindow | auto, model window)`. From it the\n * CLI reserves `min(max output, 20_000)` for the reply and compacts a\n * further 13_000 below that. On a 1M model at `auto` that is 967_000 — the\n * `pre_tokens` observed on real compactions (967_391).\n * Codex (0.136 – 0.155 rollouts): the window the CLI measures against is\n * `context_window × effective_context_window_percent / 100` = 258_400 for\n * every 272k model; auto-compaction triggers at 90% of the RAW window\n * (244_800). The largest uncompacted call across 62,104 was 243_204.\n * Grok (0.2.118 catalog): compacts at `auto_compact_threshold_percent` (80)\n * of `context_window` (500_000) = 400_000.\n * Local seats run the Claude Code binary against Ollama, so they compact by\n * the Claude formula over the window Verse passes in\n * `CLAUDE_CODE_MAX_CONTEXT_TOKENS`.\n */\n\nimport type {\n VerseContextBudget,\n VerseContextMode,\n VerseEngine,\n VerseFitVerdict,\n VerseModelOption,\n VerseSession,\n VerseUsage,\n} from './types.js';\nimport {\n CLAUDE_COMPACT_BUFFER,\n CLAUDE_OUTPUT_RESERVE_CAP,\n CODEX_EFFECTIVE_WINDOW_PERCENT,\n positiveInt,\n} from './compaction-point.js';\n\n// The runtime compaction-point formulas live in compaction-point.ts (the\n// browser's chat first-paint path needs them without the rest of this\n// module); re-exported so every existing importer keeps one entry point.\nexport {\n CLAUDE_COMPACT_BUFFER,\n CLAUDE_OUTPUT_RESERVE_CAP,\n CODEX_AUTO_COMPACT_FRACTION,\n CODEX_EFFECTIVE_WINDOW_PERCENT,\n claudeAutoCompactAt,\n codexAutoCompactAt,\n reconcileAutoCompactAt,\n} from './compaction-point.js';\n\n// ---------------------------------------------------------------------------\n// Constants\n// ---------------------------------------------------------------------------\n\n/**\n * Standard-mode compaction window for 1M-context Claude models.\n *\n * WHY 400k and not the CLI's ~967k: every turn re-sends the whole prefix, so a\n * session held near 900k costs ~2.3× per call what one held under 400k does,\n * and long-context recall degrades with length on every published benchmark\n * (docs/VERSE-CONTEXT.md §2). 400k keeps a large working set — far above the\n * 150k Anthropic's own API compacts at by default — while leaving the full\n * window one click away in `expansive` mode. Grok's native budget is also\n * 400k, so the two frontier engines share one standard ceiling.\n */\nexport const CLAUDE_STANDARD_AUTOCOMPACT_WINDOW = 400_000;\n\n/** Claude Code clamps `--autocompact` to [100k, 1M]. */\nexport const CLAUDE_AUTOCOMPACT_MIN = 100_000;\nexport const CLAUDE_AUTOCOMPACT_MAX = 1_000_000;\n\n/** Grok: `auto_compact_threshold_percent` in the 0.2.118 catalog. */\nexport const GROK_AUTO_COMPACT_PERCENT = 80;\n\n/**\n * How long a provider keeps a conversation's prompt cache warm while idle.\n * Claude Code on a subscription: 1h (5 min without it). Past this, the next\n * turn re-reads the whole context at full price — the single most expensive\n * thing an idle long session can do.\n */\nexport const CACHE_IDLE_TTL_MS = 60 * 60 * 1000;\n\n/**\n * Fixed prompt overhead (system prompt + tool definitions) a FRESH session\n * already occupies before any work, per engine.\n *\n * local 15k — measured: two real turns through Claude Code 2.1.280 against\n * Ollama with `--exclude-dynamic-system-prompt-sections`\n * reported 14,695 and 14,942 context tokens for a one-word reply.\n * claude 25k — the same CLI without that flag measured 17.8k–23.3k on local\n * seats; rounded up. An ESTIMATE, never shown as a measurement.\n * codex 15k / grok 20k — estimates; neither CLI reports its base prompt.\n *\n * Only used by the fit verdicts, which are labelled as estimates in the UI.\n */\nexport const SESSION_BASE_OVERHEAD_BY_ENGINE: Readonly<Record<VerseEngine, number>> = {\n claude: 25_000,\n codex: 15_000,\n grok: 20_000,\n local: 15_000,\n};\n\n/** Fallback overhead when the engine is unknown (the largest estimate). */\nexport const SESSION_BASE_OVERHEAD_TOKENS = 25_000;\n\nexport function sessionOverheadTokens(engine: VerseEngine | null | undefined): number {\n return engine ? SESSION_BASE_OVERHEAD_BY_ENGINE[engine] ?? SESSION_BASE_OVERHEAD_TOKENS : SESSION_BASE_OVERHEAD_TOKENS;\n}\n\n/**\n * Smallest local window worth offering as a seat. Local turns run Claude Code\n * with `CLAUDE_CODE_MAX_CONTEXT_TOKENS=<window>`, which compacts at\n * `window − 20k − 13k`; below this the compaction point leaves under 8k of\n * working room above the ~15k base prompt, so every turn would compact.\n */\nexport const LOCAL_MIN_WORKING_TOKENS = 8_000;\nexport const LOCAL_MIN_USABLE_WINDOW =\n SESSION_BASE_OVERHEAD_BY_ENGINE.local + LOCAL_MIN_WORKING_TOKENS + CLAUDE_OUTPUT_RESERVE_CAP + CLAUDE_COMPACT_BUFFER;\n\n/** True when a local window leaves real working room under Claude Code's compaction rule. */\nexport function localWindowUsable(window: number | null | undefined): boolean {\n return typeof window === 'number' && Number.isFinite(window) && window >= LOCAL_MIN_USABLE_WINDOW;\n}\n\n/** chars → tokens estimator used everywhere a count is estimated rather than measured. */\nexport const CHARS_PER_TOKEN = 4;\n\n// ---------------------------------------------------------------------------\n// Per-engine formulas\n// ---------------------------------------------------------------------------\n\n/** Codex: the window the CLI measures occupancy against. */\nexport function codexEffectiveWindow(rawWindow: number, percent: number | null = null): number {\n const pct = positiveInt(percent) !== null && (percent as number) <= 100 ? (percent as number) : CODEX_EFFECTIVE_WINDOW_PERCENT;\n return Math.floor((rawWindow * pct) / 100);\n}\n\n/** Grok: where auto-compaction fires. */\nexport function grokAutoCompactAt(window: number, percent: number | null = null): number {\n const pct = positiveInt(percent) !== null && (percent as number) <= 100 ? (percent as number) : GROK_AUTO_COMPACT_PERCENT;\n return Math.floor((window * pct) / 100);\n}\n\n// ---------------------------------------------------------------------------\n// Model ids\n// ---------------------------------------------------------------------------\n\n/**\n * Ids Verse once shipped that the CLI does NOT resolve to the model the label\n * promised. `claude-opus-5.5` is parsed by Claude Code as a fuzzy match for\n * `claude-opus-5` (its normaliser rejects the `.5` suffix and falls back to\n * `includes('claude-opus-5')`), so every \"Opus 5.5\" turn actually ran Opus 5.\n * Old session records keep their stored id; adapters send the canonical one.\n */\nexport const VERSE_MODEL_ID_ALIASES: Readonly<Record<string, string>> = {\n 'claude-opus-5.5': 'claude-opus-5-5',\n};\n\nexport function canonicalModelId(id: string): string {\n return VERSE_MODEL_ID_ALIASES[id] ?? id;\n}\n\n// ---------------------------------------------------------------------------\n// Budgets and occupancy\n// ---------------------------------------------------------------------------\n\n/** The budget a model runs with in a mode, or null when that mode does not exist for it. */\nexport function budgetFor(option: VerseModelOption | null | undefined, mode: VerseContextMode): VerseContextBudget | null {\n if (!option) return null;\n if (mode === 'expansive') return option.expansive ?? null;\n const window = positiveInt(option.contextWindow);\n if (window === null) return null;\n return { contextWindow: window, autoCompactAt: positiveInt(option.autoCompactAt ?? null) };\n}\n\n/** True when this model has a genuine expansive budget larger than its standard one. */\nexport function hasExpansiveMode(option: VerseModelOption | null | undefined): boolean {\n const standard = budgetFor(option, 'standard');\n const expansive = budgetFor(option, 'expansive');\n if (!expansive) return false;\n if (!standard) return true;\n return (expansive.autoCompactAt ?? expansive.contextWindow) > (standard.autoCompactAt ?? standard.contextWindow);\n}\n\n/**\n * The `--autocompact` value Verse passes to Claude Code for a model in a mode,\n * or null for \"let the CLI use `auto`\". Only 1M-native models are capped in\n * standard mode; a 200k model already compacts near 167k natively.\n */\nexport function claudeAutocompactFlag(option: VerseModelOption | null | undefined, mode: VerseContextMode): number | null {\n if (mode === 'expansive') return null;\n const window = positiveInt(option?.contextWindow ?? null);\n return window !== null && window > CLAUDE_STANDARD_AUTOCOMPACT_WINDOW && hasExpansiveMode(option)\n ? CLAUDE_STANDARD_AUTOCOMPACT_WINDOW\n : null;\n}\n\nexport type VerseOccupancyTone = 'unknown' | 'ok' | 'warn' | 'danger' | 'over';\n\nexport interface VerseOccupancy {\n tokens: number;\n window: number | null;\n autoCompactAt: number | null;\n /** tokens / window, unclamped; null when the window is unknown. */\n ofWindow: number | null;\n /** tokens / autoCompactAt, unclamped; null when the compaction point is unknown. */\n ofCompaction: number | null;\n /** Tokens left before auto-compaction (≥ 0), null when unknown. */\n untilCompaction: number | null;\n tone: VerseOccupancyTone;\n /** False when `tokens` is an upper bound (codex before its rollout is readable). */\n exact: boolean;\n}\n\n/** Warn at 80% of the compaction point, danger from 95% — BEFORE the CLI compacts, not after. */\nexport const OCCUPANCY_WARN = 0.8;\nexport const OCCUPANCY_DANGER = 0.95;\n\nexport function occupancy(usage: Pick<VerseUsage, 'contextTokens' | 'contextWindow' | 'autoCompactAt' | 'contextTokensExact'>): VerseOccupancy {\n const tokens = Math.max(0, Math.floor(usage.contextTokens || 0));\n const window = positiveInt(usage.contextWindow);\n const compactAt = positiveInt(usage.autoCompactAt ?? null);\n const ofWindow = window !== null ? tokens / window : null;\n const ofCompaction = compactAt !== null ? tokens / compactAt : null;\n const gauge = ofCompaction ?? ofWindow;\n const exact = usage.contextTokensExact !== false;\n let tone: VerseOccupancyTone = 'unknown';\n if (!exact && gauge !== null && gauge >= 1) {\n // An UPPER BOUND past the compaction point says nothing about the real\n // prompt: codex's turn total sums every model call (median 29× the last\n // one). Claiming \"over the window\" from it would be invented precision.\n tone = 'unknown';\n } else if (window !== null && tokens > window) tone = 'over';\n else if (gauge !== null) tone = gauge >= OCCUPANCY_DANGER ? 'danger' : gauge >= OCCUPANCY_WARN ? 'warn' : 'ok';\n return {\n tokens,\n window,\n autoCompactAt: compactAt,\n ofWindow,\n ofCompaction,\n untilCompaction: compactAt !== null ? Math.max(0, compactAt - tokens) : null,\n tone,\n exact,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Efficiency\n// ---------------------------------------------------------------------------\n\n/**\n * Share of prompt tokens served from cache: cacheRead / (input + cacheRead +\n * cacheCreation). Adapters already report `inputTokens` EXCLUDING cached\n * tokens (codex's turn total is split by its adapter), so the buckets are\n * disjoint. Null when nothing has been read yet.\n */\nexport function cacheHitRatio(usage: Pick<VerseUsage, 'inputTokens' | 'cacheReadTokens' | 'cacheCreationTokens'>): number | null {\n const denominator = usage.inputTokens + usage.cacheReadTokens + usage.cacheCreationTokens;\n return denominator > 0 ? usage.cacheReadTokens / denominator : null;\n}\n\nexport function estimateTokensFromChars(chars: number): number {\n return Math.ceil(Math.max(0, chars) / CHARS_PER_TOKEN);\n}\n\n// ---------------------------------------------------------------------------\n// Advice (pure; the UI decides how to show it, nothing here spends)\n// ---------------------------------------------------------------------------\n\n/**\n * Would this working set fit one context on this model?\n *\n * fits — working set + fixed overhead ≤ 60% of the standard compaction point\n * tight — ≤ 100% of it: it fits, but the session will compact soon\n * expansive — only the expansive budget holds it\n * split — no single context holds it; fan the work out instead\n *\n * Null when the model's budget is unknown (never guessed). Pass the engine's\n * `sessionOverheadTokens(engine)`; the default is the largest estimate.\n */\nexport function fitVerdict(\n workingSetTokens: number,\n option: VerseModelOption | null | undefined,\n overheadTokens: number = SESSION_BASE_OVERHEAD_TOKENS,\n): VerseFitVerdict | null {\n const standard = budgetFor(option, 'standard');\n if (!standard) return null;\n const need = Math.max(0, workingSetTokens) + Math.max(0, overheadTokens);\n const standardCap = standard.autoCompactAt ?? standard.contextWindow;\n if (need <= standardCap * 0.6) return 'fits';\n if (need <= standardCap) return 'tight';\n const expansive = budgetFor(option, 'expansive');\n if (expansive && need <= (expansive.autoCompactAt ?? expansive.contextWindow)) return 'expansive';\n return 'split';\n}\n\nexport type VerseAdviceLevel = 'none' | 'suggest' | 'urge';\n\nexport interface VerseHandoffAdvice {\n level: VerseAdviceLevel;\n /** Plain sentences, most important first. Empty when level is 'none'. */\n reasons: string[];\n}\n\n/** Compactions after which early-turn detail is mostly summaries. */\nexport const HANDOFF_COMPACTION_THRESHOLD = 2;\n/** Below this, an expired cache is cheap to re-read and not worth a handoff. */\nexport const HANDOFF_IDLE_MIN_TOKENS = 100_000;\n\nfunction compactTokens(n: number): string {\n if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(n % 1_000_000 === 0 ? 0 : 1)}M`;\n if (n >= 1_000) return `${Math.round(n / 1_000)}k`;\n return String(n);\n}\n\n/**\n * Should the operator continue in a fresh session? Pure: `now` and\n * `lastActivityAt` are passed in, so the verdict is reproducible in tests.\n */\nexport function handoffAdvice(input: {\n usage: VerseUsage;\n compactionCount?: number;\n lastActivityAt?: string | null;\n now: number;\n}): VerseHandoffAdvice {\n const occ = occupancy(input.usage);\n const reasons: string[] = [];\n let level: VerseAdviceLevel = 'none';\n const bump = (to: VerseAdviceLevel): void => {\n // (level only ever rises)\n if (to === 'urge' || (to === 'suggest' && level === 'none')) level = to;\n };\n\n if (!occ.exact) {\n // An upper bound cannot justify \"you are near compaction\"; wait for a reading.\n } else if (occ.tone === 'over') {\n bump('urge');\n reasons.push(`Context (${compactTokens(occ.tokens)}) is past the ${compactTokens(occ.window ?? 0)} window.`);\n } else if (occ.ofCompaction !== null && occ.ofCompaction >= OCCUPANCY_WARN) {\n bump('suggest');\n reasons.push(`About ${compactTokens(occ.untilCompaction ?? 0)} tokens left before the CLI auto-compacts.`);\n }\n\n const compactions = input.compactionCount ?? 0;\n if (compactions >= HANDOFF_COMPACTION_THRESHOLD) {\n bump('suggest');\n reasons.push(`Compacted ${compactions} times — early turns now survive only as summaries.`);\n }\n\n if (input.lastActivityAt) {\n const idle = input.now - Date.parse(input.lastActivityAt);\n if (occ.exact && Number.isFinite(idle) && idle >= CACHE_IDLE_TTL_MS && occ.tokens >= HANDOFF_IDLE_MIN_TOKENS) {\n bump('suggest');\n reasons.push(`Idle over an hour: the prompt cache has likely expired, so the next turn re-reads ~${compactTokens(occ.tokens)} tokens at full cost.`);\n }\n }\n return { level, reasons };\n}\n\nexport interface VerseExpansiveAdvice {\n suggest: boolean;\n reason: string | null;\n}\n\n/**\n * Suggest — never switch on — expansive mode. Only for a session in standard\n * mode whose model has a real expansive budget, and only on evidence: it has\n * already compacted repeatedly, or its working set only fits expansive.\n */\nexport function expansiveAdvice(input: {\n session: Pick<VerseSession, 'contextMode' | 'compactionCount'>;\n option: VerseModelOption | null | undefined;\n workingSetTokens?: number | null;\n}): VerseExpansiveAdvice {\n if ((input.session.contextMode ?? 'standard') !== 'standard' || !hasExpansiveMode(input.option)) {\n return { suggest: false, reason: null };\n }\n const compactions = input.session.compactionCount ?? 0;\n if (compactions >= HANDOFF_COMPACTION_THRESHOLD) {\n return { suggest: true, reason: `This session has compacted ${compactions} times; expansive mode keeps more of it in view.` };\n }\n if (typeof input.workingSetTokens === 'number' && fitVerdict(input.workingSetTokens, input.option) === 'expansive') {\n return { suggest: true, reason: `The reachable code (~${compactTokens(input.workingSetTokens)} tokens) only fits the expansive budget.` };\n }\n return { suggest: false, reason: null };\n}\n\n/** Engines whose CLIs can be told a compaction budget per invocation. */\nexport function engineSupportsModes(engine: VerseEngine): boolean {\n return engine === 'claude' || engine === 'codex';\n}\n","/**\n * routes/verse/verse-readouts.ts — display derivations the chat's lazy\n * surfaces (workspace, transcript, context meter, composer, usage panels)\n * read from a session's events and usage.\n *\n * Split from verse-store.ts because the store is on the chat first-paint\n * path and these are not: a value exported from the store rides in its\n * first-paint chunk whoever imports it.\n */\nimport type { VerseEvent } from '../../data/api-types.js';\n\n/**\n * When this chat last talked to its provider — the newest `usage`,\n * `turn-done`, `cancelled` or TURN-attributed `context` event — or null when\n * the log holds none (no turn yet, or the log is not loaded).\n *\n * WHY NOT `session.updatedAt`: the idle-cache advice (\"the prompt cache has\n * likely expired\") asks how long the PROVIDER has gone without a request,\n * and `updatedAt` moves on things that never reach a provider: a rename, a\n * context-mode switch (whose `context` event has `turnId: null`), a reload's\n * record save. Measured from `updatedAt`, one rename silenced the warning\n * for another hour while the cache stayed cold.\n */\nexport function lastTurnActivityAt(events: readonly VerseEvent[]): string | null {\n let latest: string | null = null;\n for (const e of events) {\n const turnActivity = e.type === 'usage' || e.type === 'turn-done' || e.type === 'cancelled' ||\n (e.type === 'context' && e.turnId !== null);\n if (turnActivity && typeof e.at === 'string' && (latest === null || e.at > latest)) latest = e.at;\n }\n return latest;\n}\n\n/**\n * \"123k\" / \"1.2M\" — compact token counts for the meter and usage rows.\n *\n * The unit is chosen AFTER rounding: choosing it first printed 999,500–\n * 999,999 as \"1000k\" (and 999.5–999.9 as \"1000\"), a band a 1M Claude chat in\n * Expansive can actually reach.\n */\nexport function formatTokens(n: number | null | undefined): string {\n if (n === null || n === undefined || !Number.isFinite(n)) return '—';\n if (Math.round(n) < 1000) return String(Math.round(n));\n if (Math.round(n / 1000) < 1000) return `${Math.round(n / 1000)}k`;\n return `${(n / 1_000_000).toFixed(1).replace(/\\.0$/, '')}M`;\n}\n","/**\n * routes/verse/verse-model.ts — small pure helpers shared by the Verse\n * components (labels, grouping, health → tone). No React, no I/O.\n */\nimport type { VerseEngine, VerseModelOption, VerseProject, VerseSeat, VerseSeatHealth, VerseSession } from '../../data/api-types.js';\nimport type { VerseContextMode, VerseWindowSource } from '../../../core/verse/types.js';\nimport type { Tone } from '../../components/primitives/StatusBadge.js';\n// context-math is PURE and browser-safe by contract (its only import is\n// type-only), so a value import here does not drag node into the bundle.\nimport { budgetFor, canonicalModelId, claudeAutocompactFlag, reconcileAutoCompactAt } from '../../../core/verse/context-math.js';\nimport { usedPercentText } from './percent-text.js';\nimport { formatTokens } from './verse-readouts.js';\n\nexport const ENGINE_ORDER: readonly VerseEngine[] = ['claude', 'codex', 'grok', 'local'];\n\nexport const ENGINE_LABEL: Record<VerseEngine, string> = {\n claude: 'Claude',\n codex: 'Codex',\n grok: 'Grok',\n local: 'Local',\n};\n\nexport function isVerseEngine(value: string): value is VerseEngine {\n return (ENGINE_ORDER as readonly string[]).includes(value);\n}\n\nexport function projectName(path: string, projects: readonly VerseProject[] = []): string {\n const known = projects.find((p) => p.path === path);\n if (known) return known.name;\n return path.split(/[\\\\/]/).filter(Boolean).at(-1) ?? path;\n}\n\nexport function seatById(seats: readonly VerseSeat[], seatId: string): VerseSeat | undefined {\n return seats.find((s) => s.id === seatId);\n}\n\nexport function seatLabel(seats: readonly VerseSeat[], session: Pick<VerseSession, 'seatId' | 'engine'>): string {\n return seatById(seats, session.seatId)?.label ?? ENGINE_LABEL[session.engine];\n}\n\nexport function modelLabel(seats: readonly VerseSeat[], session: Pick<VerseSession, 'seatId' | 'model'>): string {\n const seat = seatById(seats, session.seatId);\n return seat?.models.find((m) => m.id === session.model)?.label ?? session.model;\n}\n\n/**\n * The seat's catalog entry for a session's model. Exact id first; then the\n * canonical form, because a session created before the alias fix stores\n * `claude-opus-5.5` while today's catalog lists `claude-opus-5-5` (context-math\n * `VERSE_MODEL_ID_ALIASES`) — the record keeps its id, the lookup must not miss.\n */\nexport function modelOptionFor(seats: readonly VerseSeat[], session: Pick<VerseSession, 'seatId' | 'model'>): VerseModelOption | null {\n const seat = seatById(seats, session.seatId);\n if (!seat) return null;\n const exact = seat.models.find((m) => m.id === session.model);\n if (exact) return exact;\n const canonical = canonicalModelId(session.model);\n return seat.models.find((m) => canonicalModelId(m.id) === canonical) ?? null;\n}\n\n/** Everything the meter, the composer's cost hint and the advice banners read. */\nexport interface SessionContextBudget {\n /** Live occupancy as stored — UNCLAMPED; only the drawing clamps. */\n contextTokens: number;\n contextWindow: number | null;\n autoCompactAt: number | null;\n /** False when `contextTokens` is an upper bound (codex before its rollout is read). */\n exact: boolean;\n /** Where `contextWindow` came from; null when nothing on the record says. */\n source: VerseWindowSource | null;\n mode: VerseContextMode;\n /** The catalog option the session's model maps to on its seat, when listed. */\n option: VerseModelOption | null;\n}\n\nfunction positive(value: number | null | undefined): number | null {\n return typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : null;\n}\n\n/**\n * The window a session is measured against, and where it compacts.\n *\n * Precedence (docs/VERSE-CONTEXT.md, \"honesty rules\"):\n *\n * 0. LOCAL — the window STORED on the record, whatever its source. Verse\n * SETS a local seat's window: the claude adapter passes the stored\n * `usage.contextWindow` as `CLAUDE_CODE_MAX_CONTEXT_TOKENS`, and the\n * engine refreshes that stored value from live discovery before each\n * turn. The seat's CURRENT option can differ (another dispatch lane,\n * another resident num_ctx), and drawing it measured the chat against a\n * window the CLI was never told — \"past the 66k window\" for a chat the\n * CLI compacts at 229k. The meter and the CLI must quote one number.\n * 1. RUNTIME — the CLI reported the window for this session's last turn\n * (`usage.contextWindowSource === 'runtime'`). Nothing outranks what the\n * CLI said it is actually running with (e.g. Claude Code clamping a 1M\n * model to 200k when long-context credit runs out).\n * 2. CATALOG — the seat's CURRENT option for the session's model, in the\n * session's mode. Current rather than stored so a corrected catalog (a\n * fixed window table, a mode switch) shows up without waiting for a turn.\n * 3. STORED — whatever the record carries (every pre-3.9 session).\n * 4. The seat's default window, marked `fallback`.\n *\n * A compaction point is only ever DERIVED from a window it belongs to: a\n * runtime window without a stored point is reconciled with context-math's\n * per-engine formula, never paired with a catalog point for another window.\n */\nexport function sessionContextBudget(\n seats: readonly VerseSeat[],\n session: Pick<VerseSession, 'seatId' | 'model' | 'usage' | 'engine' | 'contextMode'>,\n): SessionContextBudget {\n const usage = session.usage;\n // No UI-side legacy rule: the engine materialises a pre-3.9 Claude\n // record's mode (and its budget) on startup and on every touch, so every\n // record reaching the browser already names the mode it runs in.\n const mode: VerseContextMode = session.contextMode ?? 'standard';\n const option = modelOptionFor(seats, session);\n const base = {\n contextTokens: typeof usage.contextTokens === 'number' && Number.isFinite(usage.contextTokens) ? Math.max(0, usage.contextTokens) : 0,\n exact: usage.contextTokensExact !== false,\n mode,\n option,\n };\n const catalog = budgetFor(option, mode);\n\n const stored = positive(usage.contextWindow);\n if (stored !== null && (session.engine === 'local' || usage.contextWindowSource === 'runtime')) {\n const storedPoint = positive(usage.autoCompactAt ?? null);\n const autoCompactAt = storedPoint ?? reconcileAutoCompactAt({\n engine: session.engine,\n runtimeWindow: stored,\n // A local window is the whole budget (no --autocompact); pairing it\n // with the seat's current option would borrow another window's point.\n budget: session.engine === 'local' ? null : catalog,\n autocompactWindow: session.engine === 'claude' ? claudeAutocompactFlag(option, mode) : null,\n maxOutputTokens: option?.maxOutputTokens ?? null,\n });\n const source = session.engine === 'local' ? usage.contextWindowSource ?? null : 'runtime';\n return { ...base, contextWindow: stored, autoCompactAt, source };\n }\n if (catalog) {\n return { ...base, contextWindow: catalog.contextWindow, autoCompactAt: catalog.autoCompactAt, source: option?.windowSource ?? 'fallback' };\n }\n if (stored !== null) {\n return { ...base, contextWindow: stored, autoCompactAt: positive(usage.autoCompactAt ?? null), source: usage.contextWindowSource ?? null };\n }\n const seatWindow = positive(seatById(seats, session.seatId)?.contextWindow ?? null);\n return { ...base, contextWindow: seatWindow, autoCompactAt: null, source: seatWindow !== null ? 'fallback' : null };\n}\n\n/** Context window for a session — see {@link sessionContextBudget} for the precedence. */\nexport function contextWindowFor(\n seats: readonly VerseSeat[],\n session: Pick<VerseSession, 'seatId' | 'model' | 'usage' | 'engine' | 'contextMode'>,\n): number | null {\n return sessionContextBudget(seats, session).contextWindow;\n}\n\n/** Plain words for a window's provenance — the meter's tooltip and the resources panel share them. */\nexport const WINDOW_SOURCE_TEXT: Record<VerseWindowSource, string> = {\n runtime: 'reported by the CLI on the last turn',\n 'provider-catalog': \"from this seat's own model catalog\",\n 'cli-catalog': \"from the pinned CLI's built-in model table\",\n documented: \"from the provider's published model table\",\n fallback: 'a default estimate — the CLI has not reported the real window yet',\n};\n\n/**\n * The same provenance, per engine. On a LOCAL seat nothing is \"reported by\n * the CLI\": Verse measures the window from the model server (llama-server\n * slot, Ollama residency/defaults) and TELLS Claude Code to use it, so the\n * sentence names both halves.\n */\nexport function windowSourceText(source: VerseWindowSource, engine: VerseEngine | null | undefined): string {\n if (engine !== 'local') return WINDOW_SOURCE_TEXT[source];\n const from = source === 'runtime' ? 'measured from the local model server'\n : source === 'fallback' ? 'a default estimate — the model server did not report one'\n : WINDOW_SOURCE_TEXT[source];\n return `${from}; Verse passes this window to Claude Code for this chat`;\n}\n\n/**\n * The one sentence about Codex's surcharge above its standard window, for\n * every surface that prices Expansive on codex (the mode menu, the\n * \"Expansive could help\" chip, the new-chat mode selector, the handoff\n * dialog). Worded as REPORTED because that is all it is: the sources\n * docs/VERSE-CONTEXT.md §2.3 cites say GPT-5.6-class requests above 272k\n * count about 2× against plan limits, and Verse has no reading of its own\n * that confirms the multiplier. It multiplies the size ratio the copy quotes\n * (the ratio of the two compaction points), which is why it says \"twice that\".\n */\nexport const CODEX_EXPANSIVE_METERING_NOTE =\n 'OpenAI reportedly also counts requests above 272k tokens at about 2× against plan limits, so a turn near the expansive limit may cost roughly twice that.';\n\n/** The first model on a seat that can actually run (skips ones listed with an `unavailableReason`). */\nexport function firstRunnableModel(seat: VerseSeat): VerseModelOption | null {\n return seat.models.find((m) => !m.unavailableReason) ?? null;\n}\n\nexport function healthTone(state: VerseSeatHealth['state']): Tone {\n switch (state) {\n case 'ready':\n return 'success';\n case 'degraded':\n return 'warning';\n case 'unavailable':\n return 'danger';\n default:\n return 'unknown';\n }\n}\n\nexport function seatUnavailableReason(seat: VerseSeat): string | null {\n if (seat.health.state !== 'unavailable') return null;\n return seat.health.summary ?? 'seat unavailable';\n}\n\n// ---------------------------------------------------------------------------\n// Seat capacity — \"which account can I actually use right now\", at the point\n// the choice is made\n// ---------------------------------------------------------------------------\n\n/**\n * The four answers a picker needs. Same vocabulary as the Usage section's\n * `CapacityClass` so the two surfaces never use different words for one state.\n */\nexport type SeatCapacityClass = 'ready' | 'tight' | 'blocked' | 'unread';\n\n/** Word, never colour alone (DESIGN-V2 §6). */\nexport const SEAT_CAPACITY_WORD: Record<SeatCapacityClass, string> = {\n ready: 'usable',\n tight: 'tight',\n blocked: 'blocked',\n unread: 'no reading',\n};\n\n/** Above this share of the binding window a seat is worth flagging. */\nconst TIGHT_PERCENT = 85;\n\nexport interface SeatCapacityNote {\n cls: SeatCapacityClass;\n /**\n * The binding window's percent when it is a real measurement. Null for an\n * unread seat AND at the 100 ceiling, where the upstream value may be the\n * provider's \"limit reached\" sentinel rather than a reading\n * (docs/VERSE-TELEMETRY-V2.md) — and \"limit reached\" is true under either.\n */\n usedPercent: number | null;\n /** One short phrase for an option label, a pill title, a menu row. */\n text: string;\n}\n\n/** `seven_day_fable` → `weekly (fable)`; `five_hour` → `5-hour`. */\nexport function seatWindowLabel(id: string): string {\n const known: Record<string, string> = {\n five_hour: '5-hour window',\n seven_day: 'weekly window',\n codex: 'weekly window',\n };\n if (known[id]) return known[id];\n const perModel = /^seven_day_(.+)$/.exec(id);\n if (perModel) return `weekly ${perModel[1]!.replace(/_/g, ' ')} window`;\n return `${id.replace(/_/g, ' ')} window`;\n}\n\n/**\n * What a seat's own health says about whether a turn sent to it will land.\n *\n * This exists because the seat picker showed NOTHING: it annotated an option\n * only when `health.state === 'unavailable'`, and Claude's `health` is\n * `unknown` by construction (docs/VERSE-TELEMETRY-V2.md). So a Claude seat\n * whose binding weekly window reads 100% used appeared as an ordinary,\n * enabled, unannotated choice, and the exhaustion was discovered at turn time\n * — exactly the failure the Usage section was built to prevent.\n *\n * A `blocked` seat is MARKED, never disabled: a used-up window can coexist\n * with a spendable credit balance, so refusing the choice would be a stronger\n * claim than the data supports.\n */\nexport function seatCapacity(seat: VerseSeat): SeatCapacityNote {\n const reason = seatUnavailableReason(seat);\n if (reason !== null) return { cls: 'blocked', usedPercent: null, text: reason };\n\n const measured = seat.health.windows.filter(\n (w): w is { id: string; usedPercent: number; resetsAt: string | null } =>\n typeof w.usedPercent === 'number' && Number.isFinite(w.usedPercent),\n );\n // No window reported a number. That is an unanswered question, not a zero —\n // an empty meter would read \"plenty left\".\n if (measured.length === 0) return { cls: 'unread', usedPercent: null, text: 'no capacity reading' };\n\n const binding = measured.reduce((a, b) => (b.usedPercent > a.usedPercent ? b : a));\n const pct = Math.max(0, Math.min(100, binding.usedPercent));\n const where = seatWindowLabel(binding.id);\n if (pct >= 100) return { cls: 'blocked', usedPercent: null, text: `${where} limit reached` };\n return {\n cls: pct >= TIGHT_PERCENT ? 'tight' : 'ready',\n usedPercent: pct,\n text: `${usedPercentText(pct)} of ${where} used`,\n };\n}\n\n/** Seats grouped in the fixed engine order; empty engines are omitted. */\nexport function groupSeats(seats: readonly VerseSeat[]): Array<{ engine: VerseEngine; seats: VerseSeat[] }> {\n return ENGINE_ORDER.map((engine) => ({ engine, seats: seats.filter((s) => s.engine === engine) })).filter((g) => g.seats.length > 0);\n}\n\nexport interface SessionGroup {\n projectPath: string;\n name: string;\n enrolled: boolean;\n sessions: VerseSession[];\n}\n\n/** Sidebar grouping: by project, most recently touched project first, sessions newest first. */\nexport function groupSessions(sessions: readonly VerseSession[], projects: readonly VerseProject[], query = ''): SessionGroup[] {\n const q = query.trim().toLowerCase();\n const filtered = q\n ? sessions.filter((s) =>\n s.title.toLowerCase().includes(q) ||\n s.projectPath.toLowerCase().includes(q) ||\n s.model.toLowerCase().includes(q) ||\n s.seatId.toLowerCase().includes(q))\n : [...sessions];\n const byProject = new Map<string, VerseSession[]>();\n for (const s of filtered) {\n const list = byProject.get(s.projectPath) ?? [];\n list.push(s);\n byProject.set(s.projectPath, list);\n }\n const groups: SessionGroup[] = [];\n for (const [projectPath, list] of byProject) {\n list.sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));\n groups.push({\n projectPath,\n name: projectName(projectPath, projects),\n enrolled: projects.find((p) => p.path === projectPath)?.enrolled ?? false,\n sessions: list,\n });\n }\n groups.sort((a, b) => b.sessions[0]!.updatedAt.localeCompare(a.sessions[0]!.updatedAt));\n return groups;\n}\n\nexport function formatElapsed(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 const h = Math.floor(m / 60);\n return `${h}h ${m % 60}m`;\n}\n\nexport function formatDuration(ms: number): string {\n if (!Number.isFinite(ms) || ms < 0) return '—';\n if (ms < 1000) return `${Math.round(ms)}ms`;\n if (ms < 60_000) return `${(ms / 1000).toFixed(1)}s`;\n return formatElapsed(ms);\n}\n\n/**\n * Sidebar rows carry a right-aligned relative time. Short by design — the\n * row has ~5ch for it — and it degrades to a date rather than \"412d\".\n * `now` is injectable so the format is testable without faking the clock.\n */\nexport function formatRelative(iso: string, now: number = Date.now()): string {\n const then = Date.parse(iso);\n if (!Number.isFinite(then)) return '';\n const seconds = Math.round((now - then) / 1000);\n if (seconds < 0) return 'now';\n if (seconds < 60) return 'now';\n const minutes = Math.floor(seconds / 60);\n if (minutes < 60) return `${minutes}m`;\n const hours = Math.floor(minutes / 60);\n if (hours < 24) return `${hours}h`;\n const days = Math.floor(hours / 24);\n if (days < 7) return `${days}d`;\n return new Date(then).toLocaleDateString([], { month: 'short', day: 'numeric' });\n}\n\nexport function formatClock(iso: string): string {\n const d = new Date(iso);\n if (Number.isNaN(d.getTime())) return '';\n return d.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });\n}\n\n/** One-line description of a tool call for a collapsed card header. */\nexport function summarizeToolInput(input: unknown): string {\n if (input === null || input === undefined) return '';\n if (typeof input === 'string') return truncate(input, 96);\n if (typeof input !== 'object') return truncate(String(input), 96);\n const record = input as Record<string, unknown>;\n const preferred = ['command', 'cmd', 'file_path', 'path', 'pattern', 'query', 'url', 'description', 'prompt', 'text'];\n for (const key of preferred) {\n const v = record[key];\n if (typeof v === 'string' && v.trim()) return truncate(v.trim().replace(/\\s+/g, ' '), 96);\n }\n const keys = Object.keys(record);\n if (keys.length === 0) return '';\n const first = record[keys[0]!];\n const rendered = typeof first === 'string' ? first : JSON.stringify(first);\n return truncate(`${keys[0]}: ${rendered ?? ''}`.replace(/\\s+/g, ' '), 96);\n}\n\nexport function truncate(value: string, max: number): string {\n return value.length > max ? `${value.slice(0, max - 1)}…` : value;\n}\n\n/** Pretty JSON for tool cards; falls back to String() for non-serializable input. */\nexport function prettyJson(value: unknown): string {\n if (typeof value === 'string') return value;\n try {\n return JSON.stringify(value, null, 2) ?? '';\n } catch {\n return String(value);\n }\n}\n\n/**\n * Accepts POSIX/Windows absolute paths and `~/...`. The server rewrites the\n * home directory as `~` in every outbound payload (sanitizePublicJson) and\n * expands it again on the way in, so a `~/` project from bootstrap is valid.\n */\nexport function isAbsolutePath(value: string): boolean {\n return /^(?:\\/|~(?:\\/|$)|[a-zA-Z]:[\\\\/]|\\\\\\\\)/.test(value) &&\n ![...value].some((c) => c.charCodeAt(0) < 32 || (c.charCodeAt(0) >= 127 && c.charCodeAt(0) <= 159));\n}\n\n/**\n * Seat pill text: \"<seat> · <model>\", collapsing to just the seat when the\n * model label is already contained in it (local seats expose one model whose\n * name is the seat name), so the pill never reads \"Qwen3-Coder · Qwen3-Coder\".\n */\nexport function seatPillLabel(seats: readonly VerseSeat[], ref: Pick<VerseSession, 'seatId' | 'engine' | 'model'>): string {\n const seat = seatLabel(seats, ref);\n const model = modelLabel(seats, ref);\n if (!model || seat.toLowerCase().includes(model.toLowerCase())) return seat;\n return `${seat} · ${model}`;\n}\n\n/**\n * The ONE spelling of a context WINDOW's size, for every surface that prints\n * one (New chat's picker, the context meter, Usage, Resources, Fleet).\n *\n * There used to be two: decimal (`formatTokens`, 65536 → \"66k\") in the\n * picker and meter, binary (65536 → \"64k\") in Usage / Resources / Fleet, so\n * one local model read \"66k ctx\" in New chat and \"64k\" in Resources. Now:\n *\n * - an exact multiple of 1024 is quoted in binary k, the way its model card\n * and a `ctx64k` tag say it: 65536 → \"64k\", 262144 → \"256k\", 1048576 → \"1M\";\n * - anything else stays decimal: 200000 → \"200k\", 272000 → \"272k\", 1000000 → \"1M\".\n *\n * Token COUNTS (what a chat holds, where it compacts) are not windows and\n * keep `formatTokens`. Lives in this (lazy, already shared) module rather\n * than one of its own: a new module became one more chunk name in the\n * first-paint files' preload tables, and verse-store.ts is first-paint code.\n */\nexport function formatContextWindow(n: number | null | undefined): string {\n if (n === null || n === undefined || !Number.isInteger(n) || n < 1024 || n % 1024 !== 0) return formatTokens(n);\n return n < 1_048_576 ? `${n / 1024}k` : `${(n / 1_048_576).toFixed(1).replace(/\\.0$/, '')}M`;\n}\n"],"mappings":"kKAsEA,IAAa,EAAqC,IAerC,EAAoB,KAepB,EAAyE,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AAU,SAAU,OAAO,EACtC,GAAI,CACF,OAAO,KAAK,UAAU,EAAO,KAAM,CAAC,GAAK,EAC3C,MAAQ,CACN,OAAO,OAAO,CAAK,CACrB,CACF,CAOA,SAAgB,EAAe,EAAwB,CACrD,MAAO,wCAAwC,KAAK,CAAK,GACvD,CAAC,CAAC,GAAG,CAAK,CAAC,CAAC,KAAM,GAAM,EAAE,WAAW,CAAC,EAAI,IAAO,EAAE,WAAW,CAAC,GAAK,KAAO,EAAE,WAAW,CAAC,GAAK,GAAI,CACtG,CAOA,SAAgB,EAAc,EAA6B,EAAgE,CACzH,IAAM,EAAO,EAAU,EAAO,CAAG,EAC3B,EAAQ,EAAW,EAAO,CAAG,EAEnC,MADI,CAAC,GAAS,EAAK,YAAY,CAAC,CAAC,SAAS,EAAM,YAAY,CAAC,EAAU,EAChE,GAAG,EAAK,KAAK,GACtB,CAmBA,SAAgB,EAAoB,EAAsC,CAExE,OADI,GAAM,MAA2B,CAAC,OAAO,UAAU,CAAC,GAAK,EAAI,MAAQ,EAAI,MAAS,EAAU,EAAa,CAAC,EACvG,EAAI,QAAY,GAAG,EAAI,KAAK,GAAK,IAAI,EAAI,QAAA,CAAW,QAAQ,CAAC,CAAC,CAAC,QAAQ,OAAQ,EAAE,EAAE,EAC5F"}
1
+ {"version":3,"file":"verse-model-DAVevkNe.js","names":[],"sources":["../../../../../../src/core/verse/context-math.ts","../../../../../../src/web-ui/routes/verse/verse-readouts.ts","../../../../../../src/web-ui/routes/verse/verse-model.ts"],"sourcesContent":["/**\n * Ashlr Verse — context arithmetic shared by the server and the browser.\n *\n * PURE and BROWSER-SAFE: no node imports, no I/O. The seat catalog, the\n * session engine, the adapters and the UI all compute thresholds through this\n * one module, so \"compacts at 367k\" can never mean two different numbers in\n * two places. docs/VERSE-CONTEXT.md is the prose authority for every constant.\n *\n * Where each formula comes from (all read from the CLIs themselves, 2026-09-23):\n *\n * Claude Code (2.1.257 and 2.1.280 binaries): the auto-compaction window is\n * `min(--autocompact | autoCompactWindow | auto, model window)`. From it the\n * CLI reserves `min(max output, 20_000)` for the reply and compacts a\n * further 13_000 below that. On a 1M model at `auto` that is 967_000 — the\n * `pre_tokens` observed on real compactions (967_391).\n * Codex (0.136 – 0.155 rollouts): the window the CLI measures against is\n * `context_window × effective_context_window_percent / 100` = 258_400 for\n * every 272k model; auto-compaction triggers at 90% of the RAW window\n * (244_800). The largest uncompacted call across 62,104 was 243_204.\n * Grok (0.2.118 catalog): compacts at `auto_compact_threshold_percent` (80)\n * of `context_window` (500_000) = 400_000.\n * Local seats run the Claude Code binary against Ollama, so they compact by\n * the Claude formula over the window Verse passes in\n * `CLAUDE_CODE_MAX_CONTEXT_TOKENS`.\n */\n\nimport type {\n VerseContextBudget,\n VerseContextMode,\n VerseEngine,\n VerseFitVerdict,\n VerseModelOption,\n VerseSession,\n VerseUsage,\n} from './types.js';\nimport {\n CLAUDE_COMPACT_BUFFER,\n CLAUDE_OUTPUT_RESERVE_CAP,\n CODEX_EFFECTIVE_WINDOW_PERCENT,\n positiveInt,\n} from './compaction-point.js';\n\n// The runtime compaction-point formulas live in compaction-point.ts (the\n// browser's chat first-paint path needs them without the rest of this\n// module); re-exported so every existing importer keeps one entry point.\nexport {\n CLAUDE_COMPACT_BUFFER,\n CLAUDE_OUTPUT_RESERVE_CAP,\n CODEX_AUTO_COMPACT_FRACTION,\n CODEX_EFFECTIVE_WINDOW_PERCENT,\n claudeAutoCompactAt,\n codexAutoCompactAt,\n reconcileAutoCompactAt,\n} from './compaction-point.js';\n\n// ---------------------------------------------------------------------------\n// Constants\n// ---------------------------------------------------------------------------\n\n/**\n * Standard-mode compaction window for 1M-context Claude models.\n *\n * WHY 400k and not the CLI's ~967k: every turn re-sends the whole prefix, so a\n * session held near 900k costs ~2.3× per call what one held under 400k does,\n * and long-context recall degrades with length on every published benchmark\n * (docs/VERSE-CONTEXT.md §2). 400k keeps a large working set — far above the\n * 150k Anthropic's own API compacts at by default — while leaving the full\n * window one click away in `expansive` mode. Grok's native budget is also\n * 400k, so the two frontier engines share one standard ceiling.\n */\nexport const CLAUDE_STANDARD_AUTOCOMPACT_WINDOW = 400_000;\n\n/** Claude Code clamps `--autocompact` to [100k, 1M]. */\nexport const CLAUDE_AUTOCOMPACT_MIN = 100_000;\nexport const CLAUDE_AUTOCOMPACT_MAX = 1_000_000;\n\n/** Grok: `auto_compact_threshold_percent` in the 0.2.118 catalog. */\nexport const GROK_AUTO_COMPACT_PERCENT = 80;\n\n/**\n * How long a provider keeps a conversation's prompt cache warm while idle.\n * Claude Code on a subscription: 1h (5 min without it). Past this, the next\n * turn re-reads the whole context at full price — the single most expensive\n * thing an idle long session can do.\n */\nexport const CACHE_IDLE_TTL_MS = 60 * 60 * 1000;\n\n/**\n * Fixed prompt overhead (system prompt + tool definitions) a FRESH session\n * already occupies before any work, per engine.\n *\n * local 15k — measured: two real turns through Claude Code 2.1.280 against\n * Ollama with `--exclude-dynamic-system-prompt-sections`\n * reported 14,695 and 14,942 context tokens for a one-word reply.\n * claude 25k — the same CLI without that flag measured 17.8k–23.3k on local\n * seats; rounded up. An ESTIMATE, never shown as a measurement.\n * codex 15k / grok 20k — estimates; neither CLI reports its base prompt.\n *\n * Only used by the fit verdicts, which are labelled as estimates in the UI.\n */\nexport const SESSION_BASE_OVERHEAD_BY_ENGINE: Readonly<Record<VerseEngine, number>> = {\n claude: 25_000,\n codex: 15_000,\n grok: 20_000,\n local: 15_000,\n};\n\n/** Fallback overhead when the engine is unknown (the largest estimate). */\nexport const SESSION_BASE_OVERHEAD_TOKENS = 25_000;\n\nexport function sessionOverheadTokens(engine: VerseEngine | null | undefined): number {\n return engine ? SESSION_BASE_OVERHEAD_BY_ENGINE[engine] ?? SESSION_BASE_OVERHEAD_TOKENS : SESSION_BASE_OVERHEAD_TOKENS;\n}\n\n/**\n * Smallest local window worth offering as a seat. Local turns run Claude Code\n * with `CLAUDE_CODE_MAX_CONTEXT_TOKENS=<window>`, which compacts at\n * `window − 20k − 13k`; below this the compaction point leaves under 8k of\n * working room above the ~15k base prompt, so every turn would compact.\n */\nexport const LOCAL_MIN_WORKING_TOKENS = 8_000;\nexport const LOCAL_MIN_USABLE_WINDOW =\n SESSION_BASE_OVERHEAD_BY_ENGINE.local + LOCAL_MIN_WORKING_TOKENS + CLAUDE_OUTPUT_RESERVE_CAP + CLAUDE_COMPACT_BUFFER;\n\n/** True when a local window leaves real working room under Claude Code's compaction rule. */\nexport function localWindowUsable(window: number | null | undefined): boolean {\n return typeof window === 'number' && Number.isFinite(window) && window >= LOCAL_MIN_USABLE_WINDOW;\n}\n\n/** chars → tokens estimator used everywhere a count is estimated rather than measured. */\nexport const CHARS_PER_TOKEN = 4;\n\n// ---------------------------------------------------------------------------\n// Per-engine formulas\n// ---------------------------------------------------------------------------\n\n/** Codex: the window the CLI measures occupancy against. */\nexport function codexEffectiveWindow(rawWindow: number, percent: number | null = null): number {\n const pct = positiveInt(percent) !== null && (percent as number) <= 100 ? (percent as number) : CODEX_EFFECTIVE_WINDOW_PERCENT;\n return Math.floor((rawWindow * pct) / 100);\n}\n\n/** Grok: where auto-compaction fires. */\nexport function grokAutoCompactAt(window: number, percent: number | null = null): number {\n const pct = positiveInt(percent) !== null && (percent as number) <= 100 ? (percent as number) : GROK_AUTO_COMPACT_PERCENT;\n return Math.floor((window * pct) / 100);\n}\n\n// ---------------------------------------------------------------------------\n// Model ids\n// ---------------------------------------------------------------------------\n\n/**\n * Ids Verse once shipped that the CLI does NOT resolve to the model the label\n * promised. `claude-opus-5.5` is parsed by Claude Code as a fuzzy match for\n * `claude-opus-5` (its normaliser rejects the `.5` suffix and falls back to\n * `includes('claude-opus-5')`), so every \"Opus 5.5\" turn actually ran Opus 5.\n * Old session records keep their stored id; adapters send the canonical one.\n */\nexport const VERSE_MODEL_ID_ALIASES: Readonly<Record<string, string>> = {\n 'claude-opus-5.5': 'claude-opus-5-5',\n};\n\nexport function canonicalModelId(id: string): string {\n return VERSE_MODEL_ID_ALIASES[id] ?? id;\n}\n\n// ---------------------------------------------------------------------------\n// Budgets and occupancy\n// ---------------------------------------------------------------------------\n\n/** The budget a model runs with in a mode, or null when that mode does not exist for it. */\nexport function budgetFor(option: VerseModelOption | null | undefined, mode: VerseContextMode): VerseContextBudget | null {\n if (!option) return null;\n if (mode === 'expansive') return option.expansive ?? null;\n const window = positiveInt(option.contextWindow);\n if (window === null) return null;\n return { contextWindow: window, autoCompactAt: positiveInt(option.autoCompactAt ?? null) };\n}\n\n/** True when this model has a genuine expansive budget larger than its standard one. */\nexport function hasExpansiveMode(option: VerseModelOption | null | undefined): boolean {\n const standard = budgetFor(option, 'standard');\n const expansive = budgetFor(option, 'expansive');\n if (!expansive) return false;\n if (!standard) return true;\n return (expansive.autoCompactAt ?? expansive.contextWindow) > (standard.autoCompactAt ?? standard.contextWindow);\n}\n\n/**\n * The `--autocompact` value Verse passes to Claude Code for a model in a mode,\n * or null for \"let the CLI use `auto`\". Only 1M-native models are capped in\n * standard mode; a 200k model already compacts near 167k natively.\n */\nexport function claudeAutocompactFlag(option: VerseModelOption | null | undefined, mode: VerseContextMode): number | null {\n if (mode === 'expansive') return null;\n const window = positiveInt(option?.contextWindow ?? null);\n return window !== null && window > CLAUDE_STANDARD_AUTOCOMPACT_WINDOW && hasExpansiveMode(option)\n ? CLAUDE_STANDARD_AUTOCOMPACT_WINDOW\n : null;\n}\n\nexport type VerseOccupancyTone = 'unknown' | 'ok' | 'warn' | 'danger' | 'over';\n\nexport interface VerseOccupancy {\n tokens: number;\n window: number | null;\n autoCompactAt: number | null;\n /** tokens / window, unclamped; null when the window is unknown. */\n ofWindow: number | null;\n /** tokens / autoCompactAt, unclamped; null when the compaction point is unknown. */\n ofCompaction: number | null;\n /** Tokens left before auto-compaction (≥ 0), null when unknown. */\n untilCompaction: number | null;\n tone: VerseOccupancyTone;\n /** False when `tokens` is an upper bound (codex before its rollout is readable). */\n exact: boolean;\n}\n\n/** Warn at 80% of the compaction point, danger from 95% — BEFORE the CLI compacts, not after. */\nexport const OCCUPANCY_WARN = 0.8;\nexport const OCCUPANCY_DANGER = 0.95;\n\nexport function occupancy(usage: Pick<VerseUsage, 'contextTokens' | 'contextWindow' | 'autoCompactAt' | 'contextTokensExact'>): VerseOccupancy {\n const tokens = Math.max(0, Math.floor(usage.contextTokens || 0));\n const window = positiveInt(usage.contextWindow);\n const compactAt = positiveInt(usage.autoCompactAt ?? null);\n const ofWindow = window !== null ? tokens / window : null;\n const ofCompaction = compactAt !== null ? tokens / compactAt : null;\n const gauge = ofCompaction ?? ofWindow;\n const exact = usage.contextTokensExact !== false;\n let tone: VerseOccupancyTone = 'unknown';\n if (!exact && gauge !== null && gauge >= 1) {\n // An UPPER BOUND past the compaction point says nothing about the real\n // prompt: codex's turn total sums every model call (median 29× the last\n // one). Claiming \"over the window\" from it would be invented precision.\n tone = 'unknown';\n } else if (window !== null && tokens > window) tone = 'over';\n else if (gauge !== null) tone = gauge >= OCCUPANCY_DANGER ? 'danger' : gauge >= OCCUPANCY_WARN ? 'warn' : 'ok';\n return {\n tokens,\n window,\n autoCompactAt: compactAt,\n ofWindow,\n ofCompaction,\n untilCompaction: compactAt !== null ? Math.max(0, compactAt - tokens) : null,\n tone,\n exact,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Efficiency\n// ---------------------------------------------------------------------------\n\n/**\n * Share of prompt tokens served from cache: cacheRead / (input + cacheRead +\n * cacheCreation). Adapters already report `inputTokens` EXCLUDING cached\n * tokens (codex's turn total is split by its adapter), so the buckets are\n * disjoint. Null when nothing has been read yet.\n */\nexport function cacheHitRatio(usage: Pick<VerseUsage, 'inputTokens' | 'cacheReadTokens' | 'cacheCreationTokens'>): number | null {\n const denominator = usage.inputTokens + usage.cacheReadTokens + usage.cacheCreationTokens;\n return denominator > 0 ? usage.cacheReadTokens / denominator : null;\n}\n\nexport function estimateTokensFromChars(chars: number): number {\n return Math.ceil(Math.max(0, chars) / CHARS_PER_TOKEN);\n}\n\n// ---------------------------------------------------------------------------\n// Advice (pure; the UI decides how to show it, nothing here spends)\n// ---------------------------------------------------------------------------\n\n/**\n * Would this working set fit one context on this model?\n *\n * fits — working set + fixed overhead ≤ 60% of the standard compaction point\n * tight — ≤ 100% of it: it fits, but the session will compact soon\n * expansive — only the expansive budget holds it\n * split — no single context holds it; fan the work out instead\n *\n * Null when the model's budget is unknown (never guessed). Pass the engine's\n * `sessionOverheadTokens(engine)`; the default is the largest estimate.\n */\nexport function fitVerdict(\n workingSetTokens: number,\n option: VerseModelOption | null | undefined,\n overheadTokens: number = SESSION_BASE_OVERHEAD_TOKENS,\n): VerseFitVerdict | null {\n const standard = budgetFor(option, 'standard');\n if (!standard) return null;\n const need = Math.max(0, workingSetTokens) + Math.max(0, overheadTokens);\n const standardCap = standard.autoCompactAt ?? standard.contextWindow;\n if (need <= standardCap * 0.6) return 'fits';\n if (need <= standardCap) return 'tight';\n const expansive = budgetFor(option, 'expansive');\n if (expansive && need <= (expansive.autoCompactAt ?? expansive.contextWindow)) return 'expansive';\n return 'split';\n}\n\nexport type VerseAdviceLevel = 'none' | 'suggest' | 'urge';\n\nexport interface VerseHandoffAdvice {\n level: VerseAdviceLevel;\n /** Plain sentences, most important first. Empty when level is 'none'. */\n reasons: string[];\n}\n\n/** Compactions after which early-turn detail is mostly summaries. */\nexport const HANDOFF_COMPACTION_THRESHOLD = 2;\n/** Below this, an expired cache is cheap to re-read and not worth a handoff. */\nexport const HANDOFF_IDLE_MIN_TOKENS = 100_000;\n\nfunction compactTokens(n: number): string {\n if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(n % 1_000_000 === 0 ? 0 : 1)}M`;\n if (n >= 1_000) return `${Math.round(n / 1_000)}k`;\n return String(n);\n}\n\n/**\n * Should the operator continue in a fresh session? Pure: `now` and\n * `lastActivityAt` are passed in, so the verdict is reproducible in tests.\n */\nexport function handoffAdvice(input: {\n usage: VerseUsage;\n compactionCount?: number;\n lastActivityAt?: string | null;\n now: number;\n}): VerseHandoffAdvice {\n const occ = occupancy(input.usage);\n const reasons: string[] = [];\n let level: VerseAdviceLevel = 'none';\n const bump = (to: VerseAdviceLevel): void => {\n // (level only ever rises)\n if (to === 'urge' || (to === 'suggest' && level === 'none')) level = to;\n };\n\n if (!occ.exact) {\n // An upper bound cannot justify \"you are near compaction\"; wait for a reading.\n } else if (occ.tone === 'over') {\n bump('urge');\n reasons.push(`Context (${compactTokens(occ.tokens)}) is past the ${compactTokens(occ.window ?? 0)} window.`);\n } else if (occ.ofCompaction !== null && occ.ofCompaction >= OCCUPANCY_WARN) {\n bump('suggest');\n reasons.push(`About ${compactTokens(occ.untilCompaction ?? 0)} tokens left before the CLI auto-compacts.`);\n }\n\n const compactions = input.compactionCount ?? 0;\n if (compactions >= HANDOFF_COMPACTION_THRESHOLD) {\n bump('suggest');\n reasons.push(`Compacted ${compactions} times — early turns now survive only as summaries.`);\n }\n\n if (input.lastActivityAt) {\n const idle = input.now - Date.parse(input.lastActivityAt);\n if (occ.exact && Number.isFinite(idle) && idle >= CACHE_IDLE_TTL_MS && occ.tokens >= HANDOFF_IDLE_MIN_TOKENS) {\n bump('suggest');\n reasons.push(`Idle over an hour: the prompt cache has likely expired, so the next turn re-reads ~${compactTokens(occ.tokens)} tokens at full cost.`);\n }\n }\n return { level, reasons };\n}\n\nexport interface VerseExpansiveAdvice {\n suggest: boolean;\n reason: string | null;\n}\n\n/**\n * Suggest — never switch on — expansive mode. Only for a session in standard\n * mode whose model has a real expansive budget, and only on evidence: it has\n * already compacted repeatedly, or its working set only fits expansive.\n */\nexport function expansiveAdvice(input: {\n session: Pick<VerseSession, 'contextMode' | 'compactionCount'>;\n option: VerseModelOption | null | undefined;\n workingSetTokens?: number | null;\n}): VerseExpansiveAdvice {\n if ((input.session.contextMode ?? 'standard') !== 'standard' || !hasExpansiveMode(input.option)) {\n return { suggest: false, reason: null };\n }\n const compactions = input.session.compactionCount ?? 0;\n if (compactions >= HANDOFF_COMPACTION_THRESHOLD) {\n return { suggest: true, reason: `This session has compacted ${compactions} times; expansive mode keeps more of it in view.` };\n }\n if (typeof input.workingSetTokens === 'number' && fitVerdict(input.workingSetTokens, input.option) === 'expansive') {\n return { suggest: true, reason: `The reachable code (~${compactTokens(input.workingSetTokens)} tokens) only fits the expansive budget.` };\n }\n return { suggest: false, reason: null };\n}\n\n/** Engines whose CLIs can be told a compaction budget per invocation. */\nexport function engineSupportsModes(engine: VerseEngine): boolean {\n return engine === 'claude' || engine === 'codex';\n}\n","/**\n * routes/verse/verse-readouts.ts — display derivations the chat's lazy\n * surfaces (workspace, transcript, context meter, composer, usage panels)\n * read from a session's events and usage.\n *\n * Split from verse-store.ts because the store is on the chat first-paint\n * path and these are not: a value exported from the store rides in its\n * first-paint chunk whoever imports it.\n */\nimport type { VerseEvent } from '../../data/api-types.js';\n\n/**\n * When this chat last talked to its provider — the newest `usage`,\n * `turn-done`, `cancelled` or TURN-attributed `context` event — or null when\n * the log holds none (no turn yet, or the log is not loaded).\n *\n * WHY NOT `session.updatedAt`: the idle-cache advice (\"the prompt cache has\n * likely expired\") asks how long the PROVIDER has gone without a request,\n * and `updatedAt` moves on things that never reach a provider: a rename, a\n * context-mode switch (whose `context` event has `turnId: null`), a reload's\n * record save. Measured from `updatedAt`, one rename silenced the warning\n * for another hour while the cache stayed cold.\n */\nexport function lastTurnActivityAt(events: readonly VerseEvent[]): string | null {\n let latest: string | null = null;\n for (const e of events) {\n const turnActivity = e.type === 'usage' || e.type === 'turn-done' || e.type === 'cancelled' ||\n (e.type === 'context' && e.turnId !== null);\n if (turnActivity && typeof e.at === 'string' && (latest === null || e.at > latest)) latest = e.at;\n }\n return latest;\n}\n\n/**\n * \"123k\" / \"1.2M\" — compact token counts for the meter and usage rows.\n *\n * The unit is chosen AFTER rounding: choosing it first printed 999,500–\n * 999,999 as \"1000k\" (and 999.5–999.9 as \"1000\"), a band a 1M Claude chat in\n * Expansive can actually reach.\n */\nexport function formatTokens(n: number | null | undefined): string {\n if (n === null || n === undefined || !Number.isFinite(n)) return '—';\n if (Math.round(n) < 1000) return String(Math.round(n));\n if (Math.round(n / 1000) < 1000) return `${Math.round(n / 1000)}k`;\n return `${(n / 1_000_000).toFixed(1).replace(/\\.0$/, '')}M`;\n}\n","/**\n * routes/verse/verse-model.ts — small pure helpers shared by the Verse\n * components (labels, grouping, health → tone). No React, no I/O.\n */\nimport type { VerseEngine, VerseModelOption, VerseProject, VerseSeat, VerseSeatHealth, VerseSession } from '../../data/api-types.js';\nimport type { VerseContextMode, VerseWindowSource } from '../../../core/verse/types.js';\nimport type { Tone } from '../../components/primitives/StatusBadge.js';\n// context-math is PURE and browser-safe by contract (its only import is\n// type-only), so a value import here does not drag node into the bundle.\nimport { budgetFor, canonicalModelId, claudeAutocompactFlag, reconcileAutoCompactAt } from '../../../core/verse/context-math.js';\nimport { usedPercentText } from './percent-text.js';\nimport { formatTokens } from './verse-readouts.js';\n\nexport const ENGINE_ORDER: readonly VerseEngine[] = ['claude', 'codex', 'grok', 'local'];\n\nexport const ENGINE_LABEL: Record<VerseEngine, string> = {\n claude: 'Claude',\n codex: 'Codex',\n grok: 'Grok',\n local: 'Local',\n};\n\nexport function isVerseEngine(value: string): value is VerseEngine {\n return (ENGINE_ORDER as readonly string[]).includes(value);\n}\n\nexport function projectName(path: string, projects: readonly VerseProject[] = []): string {\n const known = projects.find((p) => p.path === path);\n if (known) return known.name;\n return path.split(/[\\\\/]/).filter(Boolean).at(-1) ?? path;\n}\n\nexport function seatById(seats: readonly VerseSeat[], seatId: string): VerseSeat | undefined {\n return seats.find((s) => s.id === seatId);\n}\n\nexport function seatLabel(seats: readonly VerseSeat[], session: Pick<VerseSession, 'seatId' | 'engine'>): string {\n return seatById(seats, session.seatId)?.label ?? ENGINE_LABEL[session.engine];\n}\n\nexport function modelLabel(seats: readonly VerseSeat[], session: Pick<VerseSession, 'seatId' | 'model'>): string {\n const seat = seatById(seats, session.seatId);\n return seat?.models.find((m) => m.id === session.model)?.label ?? session.model;\n}\n\n/**\n * The seat's catalog entry for a session's model. Exact id first; then the\n * canonical form, because a session created before the alias fix stores\n * `claude-opus-5.5` while today's catalog lists `claude-opus-5-5` (context-math\n * `VERSE_MODEL_ID_ALIASES`) — the record keeps its id, the lookup must not miss.\n */\nexport function modelOptionFor(seats: readonly VerseSeat[], session: Pick<VerseSession, 'seatId' | 'model'>): VerseModelOption | null {\n const seat = seatById(seats, session.seatId);\n if (!seat) return null;\n const exact = seat.models.find((m) => m.id === session.model);\n if (exact) return exact;\n const canonical = canonicalModelId(session.model);\n return seat.models.find((m) => canonicalModelId(m.id) === canonical) ?? null;\n}\n\n/** Everything the meter, the composer's cost hint and the advice banners read. */\nexport interface SessionContextBudget {\n /** Live occupancy as stored — UNCLAMPED; only the drawing clamps. */\n contextTokens: number;\n contextWindow: number | null;\n autoCompactAt: number | null;\n /** False when `contextTokens` is an upper bound (codex before its rollout is read). */\n exact: boolean;\n /** Where `contextWindow` came from; null when nothing on the record says. */\n source: VerseWindowSource | null;\n mode: VerseContextMode;\n /** The catalog option the session's model maps to on its seat, when listed. */\n option: VerseModelOption | null;\n}\n\nfunction positive(value: number | null | undefined): number | null {\n return typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : null;\n}\n\n/**\n * The window a session is measured against, and where it compacts.\n *\n * Precedence (docs/VERSE-CONTEXT.md, \"honesty rules\"):\n *\n * 0. LOCAL — the window STORED on the record, whatever its source. Verse\n * SETS a local seat's window: the claude adapter passes the stored\n * `usage.contextWindow` as `CLAUDE_CODE_MAX_CONTEXT_TOKENS`, and the\n * engine refreshes that stored value from live discovery before each\n * turn. The seat's CURRENT option can differ (another dispatch lane,\n * another resident num_ctx), and drawing it measured the chat against a\n * window the CLI was never told — \"past the 66k window\" for a chat the\n * CLI compacts at 229k. The meter and the CLI must quote one number.\n * 1. RUNTIME — the CLI reported the window for this session's last turn\n * (`usage.contextWindowSource === 'runtime'`). Nothing outranks what the\n * CLI said it is actually running with (e.g. Claude Code clamping a 1M\n * model to 200k when long-context credit runs out).\n * 2. CATALOG — the seat's CURRENT option for the session's model, in the\n * session's mode. Current rather than stored so a corrected catalog (a\n * fixed window table, a mode switch) shows up without waiting for a turn.\n * 3. STORED — whatever the record carries (every pre-3.9 session).\n * 4. The seat's default window, marked `fallback`.\n *\n * A compaction point is only ever DERIVED from a window it belongs to: a\n * runtime window without a stored point is reconciled with context-math's\n * per-engine formula, never paired with a catalog point for another window.\n */\nexport function sessionContextBudget(\n seats: readonly VerseSeat[],\n session: Pick<VerseSession, 'seatId' | 'model' | 'usage' | 'engine' | 'contextMode'>,\n): SessionContextBudget {\n const usage = session.usage;\n // No UI-side legacy rule: the engine materialises a pre-3.9 Claude\n // record's mode (and its budget) on startup and on every touch, so every\n // record reaching the browser already names the mode it runs in.\n const mode: VerseContextMode = session.contextMode ?? 'standard';\n const option = modelOptionFor(seats, session);\n const base = {\n contextTokens: typeof usage.contextTokens === 'number' && Number.isFinite(usage.contextTokens) ? Math.max(0, usage.contextTokens) : 0,\n exact: usage.contextTokensExact !== false,\n mode,\n option,\n };\n const catalog = budgetFor(option, mode);\n\n const stored = positive(usage.contextWindow);\n if (stored !== null && (session.engine === 'local' || usage.contextWindowSource === 'runtime')) {\n const storedPoint = positive(usage.autoCompactAt ?? null);\n const autoCompactAt = storedPoint ?? reconcileAutoCompactAt({\n engine: session.engine,\n runtimeWindow: stored,\n // A local window is the whole budget (no --autocompact); pairing it\n // with the seat's current option would borrow another window's point.\n budget: session.engine === 'local' ? null : catalog,\n autocompactWindow: session.engine === 'claude' ? claudeAutocompactFlag(option, mode) : null,\n maxOutputTokens: option?.maxOutputTokens ?? null,\n });\n const source = session.engine === 'local' ? usage.contextWindowSource ?? null : 'runtime';\n return { ...base, contextWindow: stored, autoCompactAt, source };\n }\n if (catalog) {\n return { ...base, contextWindow: catalog.contextWindow, autoCompactAt: catalog.autoCompactAt, source: option?.windowSource ?? 'fallback' };\n }\n if (stored !== null) {\n return { ...base, contextWindow: stored, autoCompactAt: positive(usage.autoCompactAt ?? null), source: usage.contextWindowSource ?? null };\n }\n const seatWindow = positive(seatById(seats, session.seatId)?.contextWindow ?? null);\n return { ...base, contextWindow: seatWindow, autoCompactAt: null, source: seatWindow !== null ? 'fallback' : null };\n}\n\n/** Context window for a session — see {@link sessionContextBudget} for the precedence. */\nexport function contextWindowFor(\n seats: readonly VerseSeat[],\n session: Pick<VerseSession, 'seatId' | 'model' | 'usage' | 'engine' | 'contextMode'>,\n): number | null {\n return sessionContextBudget(seats, session).contextWindow;\n}\n\n/** Plain words for a window's provenance — the meter's tooltip and the resources panel share them. */\nexport const WINDOW_SOURCE_TEXT: Record<VerseWindowSource, string> = {\n runtime: 'reported by the CLI on the last turn',\n 'provider-catalog': \"from this seat's own model catalog\",\n 'cli-catalog': \"from the pinned CLI's built-in model table\",\n documented: \"from the provider's published model table\",\n fallback: 'a default estimate — the CLI has not reported the real window yet',\n};\n\n/**\n * The same provenance, per engine. On a LOCAL seat nothing is \"reported by\n * the CLI\": Verse measures the window from the model server (llama-server\n * slot, Ollama residency/defaults) and TELLS Claude Code to use it, so the\n * sentence names both halves.\n */\nexport function windowSourceText(source: VerseWindowSource, engine: VerseEngine | null | undefined): string {\n if (engine !== 'local') return WINDOW_SOURCE_TEXT[source];\n const from = source === 'runtime' ? 'measured from the local model server'\n : source === 'fallback' ? 'a default estimate — the model server did not report one'\n : WINDOW_SOURCE_TEXT[source];\n return `${from}; Verse passes this window to Claude Code for this chat`;\n}\n\n/**\n * The one sentence about Codex's surcharge above its standard window, for\n * every surface that prices Expansive on codex (the mode menu, the\n * \"Expansive could help\" chip, the new-chat mode selector, the handoff\n * dialog). Worded as REPORTED because that is all it is: the sources\n * docs/VERSE-CONTEXT.md §2.3 cites say GPT-5.6-class requests above 272k\n * count about 2× against plan limits, and Verse has no reading of its own\n * that confirms the multiplier. It multiplies the size ratio the copy quotes\n * (the ratio of the two compaction points), which is why it says \"twice that\".\n */\nexport const CODEX_EXPANSIVE_METERING_NOTE =\n 'OpenAI reportedly also counts requests above 272k tokens at about 2× against plan limits, so a turn near the expansive limit may cost roughly twice that.';\n\n/** The first model on a seat that can actually run (skips ones listed with an `unavailableReason`). */\nexport function firstRunnableModel(seat: VerseSeat): VerseModelOption | null {\n return seat.models.find((m) => !m.unavailableReason) ?? null;\n}\n\nexport function healthTone(state: VerseSeatHealth['state']): Tone {\n switch (state) {\n case 'ready':\n return 'success';\n case 'degraded':\n return 'warning';\n case 'unavailable':\n return 'danger';\n default:\n return 'unknown';\n }\n}\n\nexport function seatUnavailableReason(seat: VerseSeat): string | null {\n if (seat.health.state !== 'unavailable') return null;\n return seat.health.summary ?? 'seat unavailable';\n}\n\n// ---------------------------------------------------------------------------\n// Seat capacity — \"which account can I actually use right now\", at the point\n// the choice is made\n// ---------------------------------------------------------------------------\n\n/**\n * The four answers a picker needs. Same vocabulary as the Usage section's\n * `CapacityClass` so the two surfaces never use different words for one state.\n */\nexport type SeatCapacityClass = 'ready' | 'tight' | 'blocked' | 'unread';\n\n/** Word, never colour alone (DESIGN-V2 §6). */\nexport const SEAT_CAPACITY_WORD: Record<SeatCapacityClass, string> = {\n ready: 'usable',\n tight: 'tight',\n blocked: 'blocked',\n unread: 'no reading',\n};\n\n/** Above this share of the binding window a seat is worth flagging. */\nconst TIGHT_PERCENT = 85;\n\nexport interface SeatCapacityNote {\n cls: SeatCapacityClass;\n /**\n * The binding window's percent when it is a real measurement. Null for an\n * unread seat AND at the 100 ceiling, where the upstream value may be the\n * provider's \"limit reached\" sentinel rather than a reading\n * (docs/VERSE-TELEMETRY-V2.md) — and \"limit reached\" is true under either.\n */\n usedPercent: number | null;\n /** One short phrase for an option label, a pill title, a menu row. */\n text: string;\n}\n\n/** `seven_day_fable` → `weekly (fable)`; `five_hour` → `5-hour`. */\nexport function seatWindowLabel(id: string): string {\n const known: Record<string, string> = {\n five_hour: '5-hour window',\n seven_day: 'weekly window',\n codex: 'weekly window',\n };\n if (known[id]) return known[id];\n const perModel = /^seven_day_(.+)$/.exec(id);\n if (perModel) return `weekly ${perModel[1]!.replace(/_/g, ' ')} window`;\n return `${id.replace(/_/g, ' ')} window`;\n}\n\n/**\n * What a seat's own health says about whether a turn sent to it will land.\n *\n * This exists because the seat picker showed NOTHING: it annotated an option\n * only when `health.state === 'unavailable'`, and Claude's `health` is\n * `unknown` by construction (docs/VERSE-TELEMETRY-V2.md). So a Claude seat\n * whose binding weekly window reads 100% used appeared as an ordinary,\n * enabled, unannotated choice, and the exhaustion was discovered at turn time\n * — exactly the failure the Usage section was built to prevent.\n *\n * A `blocked` seat is MARKED, never disabled: a used-up window can coexist\n * with a spendable credit balance, so refusing the choice would be a stronger\n * claim than the data supports.\n */\nexport function seatCapacity(seat: VerseSeat): SeatCapacityNote {\n const reason = seatUnavailableReason(seat);\n if (reason !== null) return { cls: 'blocked', usedPercent: null, text: reason };\n\n const measured = seat.health.windows.filter(\n (w): w is { id: string; usedPercent: number; resetsAt: string | null } =>\n typeof w.usedPercent === 'number' && Number.isFinite(w.usedPercent),\n );\n // No window reported a number. That is an unanswered question, not a zero —\n // an empty meter would read \"plenty left\".\n if (measured.length === 0) return { cls: 'unread', usedPercent: null, text: 'no capacity reading' };\n\n const binding = measured.reduce((a, b) => (b.usedPercent > a.usedPercent ? b : a));\n const pct = Math.max(0, Math.min(100, binding.usedPercent));\n const where = seatWindowLabel(binding.id);\n if (pct >= 100) return { cls: 'blocked', usedPercent: null, text: `${where} limit reached` };\n return {\n cls: pct >= TIGHT_PERCENT ? 'tight' : 'ready',\n usedPercent: pct,\n text: `${usedPercentText(pct)} of ${where} used`,\n };\n}\n\n/** Seats grouped in the fixed engine order; empty engines are omitted. */\nexport function groupSeats(seats: readonly VerseSeat[]): Array<{ engine: VerseEngine; seats: VerseSeat[] }> {\n return ENGINE_ORDER.map((engine) => ({ engine, seats: seats.filter((s) => s.engine === engine) })).filter((g) => g.seats.length > 0);\n}\n\nexport interface SessionGroup {\n projectPath: string;\n name: string;\n enrolled: boolean;\n sessions: VerseSession[];\n}\n\n/** Sidebar grouping: by project, most recently touched project first, sessions newest first. */\nexport function groupSessions(sessions: readonly VerseSession[], projects: readonly VerseProject[], query = ''): SessionGroup[] {\n const q = query.trim().toLowerCase();\n const filtered = q\n ? sessions.filter((s) =>\n s.title.toLowerCase().includes(q) ||\n s.projectPath.toLowerCase().includes(q) ||\n s.model.toLowerCase().includes(q) ||\n s.seatId.toLowerCase().includes(q))\n : [...sessions];\n const byProject = new Map<string, VerseSession[]>();\n for (const s of filtered) {\n const list = byProject.get(s.projectPath) ?? [];\n list.push(s);\n byProject.set(s.projectPath, list);\n }\n const groups: SessionGroup[] = [];\n for (const [projectPath, list] of byProject) {\n list.sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));\n groups.push({\n projectPath,\n name: projectName(projectPath, projects),\n enrolled: projects.find((p) => p.path === projectPath)?.enrolled ?? false,\n sessions: list,\n });\n }\n groups.sort((a, b) => b.sessions[0]!.updatedAt.localeCompare(a.sessions[0]!.updatedAt));\n return groups;\n}\n\nexport function formatElapsed(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 const h = Math.floor(m / 60);\n return `${h}h ${m % 60}m`;\n}\n\nexport function formatDuration(ms: number): string {\n if (!Number.isFinite(ms) || ms < 0) return '—';\n if (ms < 1000) return `${Math.round(ms)}ms`;\n if (ms < 60_000) return `${(ms / 1000).toFixed(1)}s`;\n return formatElapsed(ms);\n}\n\n/**\n * Sidebar rows carry a right-aligned relative time. Short by design — the\n * row has ~5ch for it — and it degrades to a date rather than \"412d\".\n * `now` is injectable so the format is testable without faking the clock.\n */\nexport function formatRelative(iso: string, now: number = Date.now()): string {\n const then = Date.parse(iso);\n if (!Number.isFinite(then)) return '';\n const seconds = Math.round((now - then) / 1000);\n if (seconds < 0) return 'now';\n if (seconds < 60) return 'now';\n const minutes = Math.floor(seconds / 60);\n if (minutes < 60) return `${minutes}m`;\n const hours = Math.floor(minutes / 60);\n if (hours < 24) return `${hours}h`;\n const days = Math.floor(hours / 24);\n if (days < 7) return `${days}d`;\n return new Date(then).toLocaleDateString([], { month: 'short', day: 'numeric' });\n}\n\nexport function formatClock(iso: string): string {\n const d = new Date(iso);\n if (Number.isNaN(d.getTime())) return '';\n return d.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });\n}\n\n/** One-line description of a tool call for a collapsed card header. */\nexport function summarizeToolInput(input: unknown): string {\n if (input === null || input === undefined) return '';\n if (typeof input === 'string') return truncate(input, 96);\n if (typeof input !== 'object') return truncate(String(input), 96);\n const record = input as Record<string, unknown>;\n const preferred = ['command', 'cmd', 'file_path', 'path', 'pattern', 'query', 'url', 'description', 'prompt', 'text'];\n for (const key of preferred) {\n const v = record[key];\n if (typeof v === 'string' && v.trim()) return truncate(v.trim().replace(/\\s+/g, ' '), 96);\n }\n const keys = Object.keys(record);\n if (keys.length === 0) return '';\n const first = record[keys[0]!];\n const rendered = typeof first === 'string' ? first : JSON.stringify(first);\n return truncate(`${keys[0]}: ${rendered ?? ''}`.replace(/\\s+/g, ' '), 96);\n}\n\nexport function truncate(value: string, max: number): string {\n return value.length > max ? `${value.slice(0, max - 1)}…` : value;\n}\n\n/** Pretty JSON for tool cards; falls back to String() for non-serializable input. */\nexport function prettyJson(value: unknown): string {\n if (typeof value === 'string') return value;\n try {\n return JSON.stringify(value, null, 2) ?? '';\n } catch {\n return String(value);\n }\n}\n\n/**\n * Accepts POSIX/Windows absolute paths and `~/...`. The server rewrites the\n * home directory as `~` in every outbound payload (sanitizePublicJson) and\n * expands it again on the way in, so a `~/` project from bootstrap is valid.\n */\nexport function isAbsolutePath(value: string): boolean {\n return /^(?:\\/|~(?:\\/|$)|[a-zA-Z]:[\\\\/]|\\\\\\\\)/.test(value) &&\n ![...value].some((c) => c.charCodeAt(0) < 32 || (c.charCodeAt(0) >= 127 && c.charCodeAt(0) <= 159));\n}\n\n/**\n * Seat pill text: \"<seat> · <model>\", collapsing to just the seat when the\n * model label is already contained in it (local seats expose one model whose\n * name is the seat name), so the pill never reads \"Qwen3-Coder · Qwen3-Coder\".\n */\nexport function seatPillLabel(seats: readonly VerseSeat[], ref: Pick<VerseSession, 'seatId' | 'engine' | 'model'>): string {\n const seat = seatLabel(seats, ref);\n const model = modelLabel(seats, ref);\n if (!model || seat.toLowerCase().includes(model.toLowerCase())) return seat;\n return `${seat} · ${model}`;\n}\n\n/**\n * The ONE spelling of a context WINDOW's size, for every surface that prints\n * one (New chat's picker, the context meter, Usage, Resources, Fleet).\n *\n * There used to be two: decimal (`formatTokens`, 65536 → \"66k\") in the\n * picker and meter, binary (65536 → \"64k\") in Usage / Resources / Fleet, so\n * one local model read \"66k ctx\" in New chat and \"64k\" in Resources. Now:\n *\n * - an exact multiple of 1024 is quoted in binary k, the way its model card\n * and a `ctx64k` tag say it: 65536 → \"64k\", 262144 → \"256k\", 1048576 → \"1M\";\n * - anything else stays decimal: 200000 → \"200k\", 272000 → \"272k\", 1000000 → \"1M\".\n *\n * Token COUNTS (what a chat holds, where it compacts) are not windows and\n * keep `formatTokens`. Lives in this (lazy, already shared) module rather\n * than one of its own: a new module became one more chunk name in the\n * first-paint files' preload tables, and verse-store.ts is first-paint code.\n */\nexport function formatContextWindow(n: number | null | undefined): string {\n if (n === null || n === undefined || !Number.isInteger(n) || n < 1024 || n % 1024 !== 0) return formatTokens(n);\n return n < 1_048_576 ? `${n / 1024}k` : `${(n / 1_048_576).toFixed(1).replace(/\\.0$/, '')}M`;\n}\n"],"mappings":"kKAsEA,IAAa,EAAqC,IAerC,EAAoB,KAepB,EAAyE,CACpF,OAAQ,KACR,MAAO,KACP,KAAM,IACN,MAAO,IACT,EAGa,EAA+B,KAE5C,SAAgB,EAAsB,EAAgD,CACpF,OAAO,EAAS,EAAgC,IAAA,KAA0C,CAC5F,CAUE,EAAgC,MAAQ,IAA2B,EAA4B,EAqCjG,IAAa,GAA2D,CACtE,kBAAmB,iBACrB,EAEA,SAAgB,EAAiB,EAAoB,CACnD,OAAO,GAAuB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AK,EAC3C,MAAQ,CACN,OAAO,OAAO,CAAK,CACrB,CACF,CAOA,SAAgB,EAAe,EAAwB,CACrD,MAAO,wCAAwC,KAAK,CAAK,GACvD,CAAC,CAAC,GAAG,CAAK,CAAC,CAAC,KAAM,GAAM,EAAE,WAAW,CAAC,EAAI,IAAO,EAAE,WAAW,CAAC,GAAK,KAAO,EAAE,WAAW,CAAC,GAAK,GAAI,CACtG,CAOA,SAAgB,EAAc,EAA6B,EAAgE,CACzH,IAAM,EAAO,EAAU,EAAO,CAAG,EAC3B,EAAQ,EAAW,EAAO,CAAG,EAEnC,MADI,CAAC,GAAS,EAAK,YAAY,CAAC,CAAC,SAAS,EAAM,YAAY,CAAC,EAAU,EAChE,GAAG,EAAK,KAAK,GACtB,CAmBA,SAAgB,EAAoB,EAAsC,CAExE,OADI,GAAM,MAA2B,CAAC,OAAO,UAAU,CAAC,GAAK,EAAI,MAAQ,EAAI,MAAS,EAAU,EAAa,CAAC,EACvG,EAAI,QAAY,GAAG,EAAI,KAAK,GAAK,IAAI,EAAI,QAAA,CAAW,QAAQ,CAAC,CAAC,CAAC,QAAQ,OAAQ,EAAE,EAAE,EAC5F"}
@@ -1,3 +1,3 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/surface-prefetch-BWr0LBQn.js","assets/queries-CyBE8nsW.js","assets/budget-queries-DsAjH8ac.js","assets/cloud-queries-QAhpExlz.js","assets/types-D5XOdyw8.js","assets/overnight-queries-mlO0xzsr.js","assets/format-Dk4Fmxax.js","assets/format-DKrNjdwD.js","assets/verse-model-MMySehjj.js","assets/compaction-point-VL9oegWS.js","assets/control-queries-DAvlh_YM.js","assets/mutations-DTCtKCn_.js","assets/surface-data-CchClvHo.js","assets/global-BlI2BYa1.css","assets/RouteErrorBoundary-DdxhTdZ6.css","assets/VerseConsoleApp-Cxqr-3qc.css"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./index-QesfXBsb.js";import{Q as t,q as n}from"./VerseConsoleApp-BCY5uSok.js";var r=[`pointerdown`,`keydown`,`wheel`,`touchstart`],i={capture:!0,passive:!0};function a(e={}){let t=e.win??window,n=e.doc??document,a=e.now??(()=>Date.now()),o=e.quietMs??2e3,s=Math.max(1,e.pollMs??250),c=e.busy??(()=>!1),l=e.timeoutMs??3e3,u=!1,d=a(),f=new Set,p=()=>{d=a()};for(let e of r)n.addEventListener(e,p,i);let m=()=>d+o-a(),h=()=>n.visibilityState!==`hidden`&&m()<=0&&!c();function g(){return u?Promise.resolve(!1):new Promise(e=>{let r=()=>void 0,i=()=>{r(),e(!1)},o=()=>{f.delete(i),e(!0)};f.add(i);let u=()=>{if(r=()=>void 0,n.visibilityState===`hidden`){let e=()=>{n.visibilityState!==`hidden`&&(n.removeEventListener(`visibilitychange`,e),d=a(),u())};n.addEventListener(`visibilitychange`,e),r=()=>n.removeEventListener(`visibilitychange`,e);return}let e=m();if(e>0||c()){let n=t.setTimeout(u,e>0?e:s);r=()=>t.clearTimeout(n);return}if(typeof t.requestIdleCallback==`function`){let e=t.requestIdleCallback(()=>h()?o():u(),{timeout:l});r=()=>t.cancelIdleCallback?.(e);return}o()};u()})}function _(e){return u?Promise.resolve(!1):new Promise(n=>{let r=0,i=()=>{t.clearTimeout(r),n(!1)};r=t.setTimeout(()=>{f.delete(i),n(!0)},e),f.add(i)})}function v(){if(!u){u=!0;for(let e of r)n.removeEventListener(e,p,i);for(let e of[...f])e();f.clear()}}return{wait:g,pause:_,cancel:v}}function o(e,t={}){let n=a(t),r=t.gapMs??400;return(async()=>{for(let[t,i]of e.entries()){if(t>0&&r>0&&!await n.pause(r)||!await n.wait())return;try{await i(n)}catch{}}n.cancel()})(),n.cancel}var s=()=>e(()=>import(`./surface-prefetch-BWr0LBQn.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]));function c(e,r={}){let i=e=>async()=>{await e()},a=n=>async r=>{if(t().mounted.includes(n))return;await e.loadSection(n);let{prefetchSurfaceData:i}=await s();await i(n,{beforeEach:()=>r.wait()})};return o([...e.overlays.map(i),...n.map(e=>a(e.id))],{busy:e.readsInFlight,...r})}export{c as warmUpAfterFirstPaint};
3
- //# sourceMappingURL=warmup-CNEH_-be.js.map
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/surface-prefetch-B0WdJOJG.js","assets/queries-BTXWdZzU.js","assets/budget-queries-D8QV5XtH.js","assets/cloud-queries-BPQQ5_pJ.js","assets/types-IYKrYLku.js","assets/surface-data-Dj71tdD-.js","assets/control-queries-B9K-wmcB.js","assets/mutations-DQPbFdRJ.js","assets/overnight-queries-C4wOnFtE.js","assets/format-CH4g_sl1.js","assets/format-D7nBg2bn.js","assets/verse-model-DAVevkNe.js","assets/compaction-point-VL9oegWS.js","assets/thread-data-DQB_g66d.js","assets/leader-thread-types-CDb-VPPO.js","assets/global-BlI2BYa1.css","assets/RouteErrorBoundary-DdxhTdZ6.css","assets/VerseConsoleApp-Cxqr-3qc.css"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./index-DZ-UQ7v8.js";import{Q as t,q as n}from"./VerseConsoleApp-CWU6R3By.js";var r=[`pointerdown`,`keydown`,`wheel`,`touchstart`],i={capture:!0,passive:!0};function a(e={}){let t=e.win??window,n=e.doc??document,a=e.now??(()=>Date.now()),o=e.quietMs??2e3,s=Math.max(1,e.pollMs??250),c=e.busy??(()=>!1),l=e.timeoutMs??3e3,u=!1,d=a(),f=new Set,p=()=>{d=a()};for(let e of r)n.addEventListener(e,p,i);let m=()=>d+o-a(),h=()=>n.visibilityState!==`hidden`&&m()<=0&&!c();function g(){return u?Promise.resolve(!1):new Promise(e=>{let r=()=>void 0,i=()=>{r(),e(!1)},o=()=>{f.delete(i),e(!0)};f.add(i);let u=()=>{if(r=()=>void 0,n.visibilityState===`hidden`){let e=()=>{n.visibilityState!==`hidden`&&(n.removeEventListener(`visibilitychange`,e),d=a(),u())};n.addEventListener(`visibilitychange`,e),r=()=>n.removeEventListener(`visibilitychange`,e);return}let e=m();if(e>0||c()){let n=t.setTimeout(u,e>0?e:s);r=()=>t.clearTimeout(n);return}if(typeof t.requestIdleCallback==`function`){let e=t.requestIdleCallback(()=>h()?o():u(),{timeout:l});r=()=>t.cancelIdleCallback?.(e);return}o()};u()})}function _(e){return u?Promise.resolve(!1):new Promise(n=>{let r=0,i=()=>{t.clearTimeout(r),n(!1)};r=t.setTimeout(()=>{f.delete(i),n(!0)},e),f.add(i)})}function v(){if(!u){u=!0;for(let e of r)n.removeEventListener(e,p,i);for(let e of[...f])e();f.clear()}}return{wait:g,pause:_,cancel:v}}function o(e,t={}){let n=a(t),r=t.gapMs??400;return(async()=>{for(let[t,i]of e.entries()){if(t>0&&r>0&&!await n.pause(r)||!await n.wait())return;try{await i(n)}catch{}}n.cancel()})(),n.cancel}var s=()=>e(()=>import(`./surface-prefetch-B0WdJOJG.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]));function c(e,r={}){let i=e=>async()=>{await e()},a=n=>async r=>{if(t().mounted.includes(n))return;await e.loadSection(n);let{prefetchSurfaceData:i}=await s();await i(n,{beforeEach:()=>r.wait()})};return o([...e.overlays.map(i),...n.map(e=>a(e.id))],{busy:e.readsInFlight,...r})}export{c as warmUpAfterFirstPaint};
3
+ //# sourceMappingURL=warmup-B_RAtNZ_.js.map