@moberg_hr/work-tree 2.7.0 → 2.9.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 (295) hide show
  1. package/dist/account-FKNMH5IT.js +245 -0
  2. package/dist/account-FKNMH5IT.js.map +1 -0
  3. package/dist/{add-repo-E7KWNJJV.js → add-repo-SG4D3C76.js} +26 -22
  4. package/dist/{add-repo-E7KWNJJV.js.map → add-repo-SG4D3C76.js.map} +1 -1
  5. package/dist/{answer-2CBOWCL5.js → answer-M4YETVGV.js} +15 -12
  6. package/dist/{answer-2CBOWCL5.js.map → answer-M4YETVGV.js.map} +1 -1
  7. package/dist/{attach-AWRY4LSI.js → attach-3P3WQJKZ.js} +19 -16
  8. package/dist/{attach-AWRY4LSI.js.map → attach-3P3WQJKZ.js.map} +1 -1
  9. package/dist/bin.js +7 -5
  10. package/dist/bin.js.map +1 -1
  11. package/dist/{block-JTJX5QIO.js → block-2C3GZYAP.js} +15 -12
  12. package/dist/{block-JTJX5QIO.js.map → block-2C3GZYAP.js.map} +1 -1
  13. package/dist/{broadcast-3SF55HA6.js → broadcast-BH2H7UTU.js} +12 -9
  14. package/dist/{broadcast-3SF55HA6.js.map → broadcast-BH2H7UTU.js.map} +1 -1
  15. package/dist/{catchup-2WNHEMLD.js → catchup-PENTMANK.js} +18 -15
  16. package/dist/{catchup-2WNHEMLD.js.map → catchup-PENTMANK.js.map} +1 -1
  17. package/dist/{chunk-C5HPSURF.js → chunk-3JFRM4IY.js} +12 -12
  18. package/dist/{chunk-O34CKSE4.js → chunk-3N3UQEC4.js} +2 -2
  19. package/dist/{chunk-EPNYZJMM.js → chunk-3TN77GOI.js} +9 -6
  20. package/dist/chunk-3TN77GOI.js.map +1 -0
  21. package/dist/{chunk-YJ4CAD3X.js → chunk-44AU2STD.js} +5 -5
  22. package/dist/{chunk-TPPTL7LA.js → chunk-4M5TIZDC.js} +113 -6
  23. package/dist/chunk-4M5TIZDC.js.map +1 -0
  24. package/dist/chunk-4NITDMDH.js +372 -0
  25. package/dist/chunk-4NITDMDH.js.map +1 -0
  26. package/dist/{chunk-SNRP2MC3.js → chunk-5QGCF3PS.js} +2 -2
  27. package/dist/{chunk-ZS6F6JLC.js → chunk-6MJ6BDHL.js} +88 -12
  28. package/dist/chunk-6MJ6BDHL.js.map +1 -0
  29. package/dist/chunk-6THUVP6T.js +118 -0
  30. package/dist/chunk-6THUVP6T.js.map +1 -0
  31. package/dist/{chunk-BHU26CNH.js → chunk-6XMH3WFY.js} +6 -4
  32. package/dist/{chunk-BHU26CNH.js.map → chunk-6XMH3WFY.js.map} +1 -1
  33. package/dist/{chunk-DYJ4VJJD.js → chunk-A42MFPMC.js} +8 -33
  34. package/dist/chunk-A42MFPMC.js.map +1 -0
  35. package/dist/{chunk-JIYGGN2N.js → chunk-AU27USPZ.js} +2 -2
  36. package/dist/chunk-BBZ2DK6W.js +9 -0
  37. package/dist/{chunk-B2HUKRWX.js → chunk-BT7SZQQL.js} +4 -4
  38. package/dist/{chunk-MGQK6BWH.js → chunk-CNE5SWFH.js} +35 -18
  39. package/dist/chunk-CNE5SWFH.js.map +1 -0
  40. package/dist/chunk-D675JTUZ.js +442 -0
  41. package/dist/chunk-D675JTUZ.js.map +1 -0
  42. package/dist/{chunk-FUNZ7TOS.js → chunk-F6M255O5.js} +534 -121
  43. package/dist/chunk-F6M255O5.js.map +1 -0
  44. package/dist/chunk-FDKJFIUU.js +169 -0
  45. package/dist/chunk-FDKJFIUU.js.map +1 -0
  46. package/dist/{chunk-YNHIMOE7.js → chunk-GNGXYXBC.js} +2 -2
  47. package/dist/{chunk-KU63EHZO.js → chunk-ICJPVSRY.js} +2 -2
  48. package/dist/{chunk-VEKEA3ER.js → chunk-J36ULZBO.js} +2 -2
  49. package/dist/{chunk-UHYIB6AV.js → chunk-JEET43KM.js} +2 -2
  50. package/dist/{chunk-2IKWNRMV.js → chunk-K5QBU5CY.js} +3 -3
  51. package/dist/{chunk-LDFICXOZ.js → chunk-KC66FLGZ.js} +10 -6
  52. package/dist/{chunk-LDFICXOZ.js.map → chunk-KC66FLGZ.js.map} +1 -1
  53. package/dist/{chunk-TBY6ZFAV.js → chunk-KNRGVUW7.js} +3 -3
  54. package/dist/{chunk-AFW7HREX.js → chunk-KUO5ATYX.js} +9 -41
  55. package/dist/chunk-KUO5ATYX.js.map +1 -0
  56. package/dist/{chunk-WIWO3YWP.js → chunk-LCV62KMO.js} +2 -2
  57. package/dist/{chunk-3JY3QT4J.js → chunk-LZUFHLBF.js} +5 -5
  58. package/dist/{chunk-CFLMBFBO.js → chunk-M6LJ3GE3.js} +76 -10
  59. package/dist/chunk-M6LJ3GE3.js.map +1 -0
  60. package/dist/{chunk-3PLWNCRM.js → chunk-MMFXUIQQ.js} +2 -2
  61. package/dist/{chunk-J5CMORVD.js → chunk-NMSJJCOD.js} +28 -15
  62. package/dist/chunk-NMSJJCOD.js.map +1 -0
  63. package/dist/{chunk-46UTKL5L.js → chunk-OMIMK3LB.js} +2 -2
  64. package/dist/chunk-P2HOLCBF.js +34 -0
  65. package/dist/chunk-P2HOLCBF.js.map +1 -0
  66. package/dist/{chunk-PUTZR6F5.js → chunk-P4EQWC5W.js} +2 -2
  67. package/dist/{chunk-4PRPDACI.js → chunk-PC67UHUW.js} +10 -7
  68. package/dist/chunk-PC67UHUW.js.map +1 -0
  69. package/dist/{chunk-OFCY7RCM.js → chunk-QJLJH5DC.js} +4 -4
  70. package/dist/{chunk-ZMCU2PZN.js → chunk-RCGFHJM7.js} +5 -3
  71. package/dist/chunk-RCGFHJM7.js.map +1 -0
  72. package/dist/{chunk-G2FE7HUB.js → chunk-RGUSVBGN.js} +2 -2
  73. package/dist/{chunk-R3DASZQF.js → chunk-S3BAD4IR.js} +2 -2
  74. package/dist/{chunk-B7C3RYSJ.js → chunk-SG5LUMGE.js} +3 -3
  75. package/dist/{chunk-KUVL75PL.js → chunk-SVSRQ3R2.js} +8 -8
  76. package/dist/{chunk-QGKJXCEJ.js → chunk-T2ZB6I3Y.js} +19 -13
  77. package/dist/chunk-T2ZB6I3Y.js.map +1 -0
  78. package/dist/{chunk-5GA3PFK5.js → chunk-TGWUOZJL.js} +13 -9
  79. package/dist/chunk-TGWUOZJL.js.map +1 -0
  80. package/dist/{chunk-5XSY3C6E.js → chunk-UBOKRHNV.js} +13 -13
  81. package/dist/chunk-UBOKRHNV.js.map +1 -0
  82. package/dist/{chunk-TTTIKTNR.js → chunk-UMYB6DZX.js} +2 -2
  83. package/dist/{chunk-W4YWFAYC.js → chunk-VEWSK3FG.js} +4 -4
  84. package/dist/{chunk-BVJ2ZE7B.js → chunk-VQGHVXGL.js} +34 -13
  85. package/dist/chunk-VQGHVXGL.js.map +1 -0
  86. package/dist/{chunk-W7WC7UA2.js → chunk-VRHQMUPB.js} +5 -5
  87. package/dist/{chunk-LQXGNO5X.js → chunk-W7NCZ3VU.js} +3 -3
  88. package/dist/{chunk-3UHKPHTB.js → chunk-WM4JWBKJ.js} +4 -4
  89. package/dist/{chunk-MCSEYS2J.js → chunk-WPZTIF5C.js} +5 -5
  90. package/dist/{chunk-USUQYM6V.js → chunk-WVJASLMV.js} +58 -54
  91. package/dist/chunk-WVJASLMV.js.map +1 -0
  92. package/dist/{chunk-ZNXACRZ5.js → chunk-WZ4QXVCC.js} +9 -5
  93. package/dist/{chunk-ZNXACRZ5.js.map → chunk-WZ4QXVCC.js.map} +1 -1
  94. package/dist/{chunk-DO5NW46X.js → chunk-X4AXKO3A.js} +2 -2
  95. package/dist/{chunk-LWKFZOCJ.js → chunk-X63DS7BW.js} +3 -3
  96. package/dist/{chunk-5WEDCEZG.js → chunk-X7TWBG4X.js} +5 -5
  97. package/dist/{chunk-KE2TFF7B.js → chunk-XNLQSW6J.js} +23 -212
  98. package/dist/chunk-XNLQSW6J.js.map +1 -0
  99. package/dist/{chunk-5BNNPXID.js → chunk-YA3WCQ2A.js} +4 -4
  100. package/dist/{chunk-ZGPWIBSZ.js → chunk-YEXW2OCN.js} +9 -34
  101. package/dist/chunk-YEXW2OCN.js.map +1 -0
  102. package/dist/chunk-YEY2WKOE.js +43 -0
  103. package/dist/chunk-YEY2WKOE.js.map +1 -0
  104. package/dist/{chunk-COKQPFLB.js → chunk-YYBXQBW2.js} +3 -3
  105. package/dist/chunk-ZDMJPEBO.js +31 -0
  106. package/dist/chunk-ZDMJPEBO.js.map +1 -0
  107. package/dist/{chunk-PIKOCEWX.js → chunk-ZOGGTAOK.js} +5 -5
  108. package/dist/chunk-ZXHMC7UO.js +106 -0
  109. package/dist/chunk-ZXHMC7UO.js.map +1 -0
  110. package/dist/{cleanup-PWN4XZ2F.js → cleanup-HEUCA22O.js} +31 -27
  111. package/dist/{cleanup-PWN4XZ2F.js.map → cleanup-HEUCA22O.js.map} +1 -1
  112. package/dist/cli-Y4JSWLZ2.js +19 -0
  113. package/dist/{command-hook-installer-RJH5QLCD.js → command-hook-installer-7Q7UD7AU.js} +9 -8
  114. package/dist/command-hook-installer-7Q7UD7AU.js.map +1 -0
  115. package/dist/{config-KGDVJKQN.js → config-TPK3PXW6.js} +19 -15
  116. package/dist/{config-KGDVJKQN.js.map → config-TPK3PXW6.js.map} +1 -1
  117. package/dist/{diff-ZORXBJDI.js → diff-XGPISLYB.js} +16 -13
  118. package/dist/{diff-ZORXBJDI.js.map → diff-XGPISLYB.js.map} +1 -1
  119. package/dist/{digest-PUUBJTD3.js → digest-4IF376QE.js} +14 -11
  120. package/dist/{digest-PUUBJTD3.js.map → digest-4IF376QE.js.map} +1 -1
  121. package/dist/{fork-7L76HZAS.js → fork-DQMXZEQM.js} +27 -24
  122. package/dist/{fork-7L76HZAS.js.map → fork-DQMXZEQM.js.map} +1 -1
  123. package/dist/{history-YX74IRQY.js → history-OXEG6SOK.js} +13 -8
  124. package/dist/{hook-JCD6SDB3.js → hook-Z3THJRUB.js} +20 -19
  125. package/dist/{hook-JCD6SDB3.js.map → hook-Z3THJRUB.js.map} +1 -1
  126. package/dist/{hydrate-W4V5RJYU.js → hydrate-47IPPOYB.js} +14 -11
  127. package/dist/{hydrate-W4V5RJYU.js.map → hydrate-47IPPOYB.js.map} +1 -1
  128. package/dist/{init-5MMV2UF5.js → init-OZ6ARQJB.js} +14 -11
  129. package/dist/{init-5MMV2UF5.js.map → init-OZ6ARQJB.js.map} +1 -1
  130. package/dist/install-skills-QTWYVAOZ.js +20 -0
  131. package/dist/install-skills-bin.js +9 -5
  132. package/dist/install-skills-bin.js.map +1 -1
  133. package/dist/{list-ZS3UWOGJ.js → list-22MUAA6K.js} +14 -11
  134. package/dist/{list-ZS3UWOGJ.js.map → list-22MUAA6K.js.map} +1 -1
  135. package/dist/{move-ZTL7HAIU.js → move-7QGWP7FG.js} +42 -18
  136. package/dist/move-7QGWP7FG.js.map +1 -0
  137. package/dist/{note-B4FVZGJJ.js → note-PA7HHBXX.js} +15 -12
  138. package/dist/{note-B4FVZGJJ.js.map → note-PA7HHBXX.js.map} +1 -1
  139. package/dist/{overlaps-W3BLUG53.js → overlaps-FE36QGVQ.js} +13 -10
  140. package/dist/{overlaps-W3BLUG53.js.map → overlaps-FE36QGVQ.js.map} +1 -1
  141. package/dist/{pin-YYQV5OPS.js → pin-AD43POUY.js} +15 -12
  142. package/dist/{pin-YYQV5OPS.js.map → pin-AD43POUY.js.map} +1 -1
  143. package/dist/{pr-HQTMQOF5.js → pr-MCPGZ44W.js} +15 -12
  144. package/dist/{pr-HQTMQOF5.js.map → pr-MCPGZ44W.js.map} +1 -1
  145. package/dist/{prune-6BYOFOUR.js → prune-M4BMLYDQ.js} +29 -26
  146. package/dist/{prune-6BYOFOUR.js.map → prune-M4BMLYDQ.js.map} +1 -1
  147. package/dist/{pty-host-KSS45FVH.js → pty-host-BMQOW67M.js} +142 -37
  148. package/dist/pty-host-BMQOW67M.js.map +1 -0
  149. package/dist/{read-I5TGSBPC.js → read-VALY2SX6.js} +14 -11
  150. package/dist/{read-I5TGSBPC.js.map → read-VALY2SX6.js.map} +1 -1
  151. package/dist/{recent-GRKJEEKT.js → recent-SCQJX6DJ.js} +22 -12
  152. package/dist/recent-SCQJX6DJ.js.map +1 -0
  153. package/dist/{remove-64T6TMOE.js → remove-24KP2GMZ.js} +28 -25
  154. package/dist/{remove-64T6TMOE.js.map → remove-24KP2GMZ.js.map} +1 -1
  155. package/dist/{report-KAS2UEXO.js → report-J7TUQRJS.js} +3 -3
  156. package/dist/{restart-WJROWFMU.js → restart-SSOENWTH.js} +15 -12
  157. package/dist/{restart-WJROWFMU.js.map → restart-SSOENWTH.js.map} +1 -1
  158. package/dist/{resume-634R6KNE.js → resume-GM66FDEP.js} +16 -12
  159. package/dist/resume-GM66FDEP.js.map +1 -0
  160. package/dist/{run-57LGOBXQ.js → run-OATO7NBV.js} +11 -8
  161. package/dist/{run-57LGOBXQ.js.map → run-OATO7NBV.js.map} +1 -1
  162. package/dist/{screen-CX7WUVXM.js → screen-RV2SJGJP.js} +15 -12
  163. package/dist/{screen-CX7WUVXM.js.map → screen-RV2SJGJP.js.map} +1 -1
  164. package/dist/{search-JYAQWT6A.js → search-UHYMBMA7.js} +11 -8
  165. package/dist/{search-JYAQWT6A.js.map → search-UHYMBMA7.js.map} +1 -1
  166. package/dist/{section-4FICXE46.js → section-24WUAJKW.js} +15 -12
  167. package/dist/{section-4FICXE46.js.map → section-24WUAJKW.js.map} +1 -1
  168. package/dist/{send-RRTPY47A.js → send-GRTDUQIN.js} +16 -13
  169. package/dist/{send-RRTPY47A.js.map → send-GRTDUQIN.js.map} +1 -1
  170. package/dist/{sessions-UJNUCYND.js → sessions-FAYRQHXJ.js} +21 -18
  171. package/dist/{sessions-UJNUCYND.js.map → sessions-FAYRQHXJ.js.map} +1 -1
  172. package/dist/{snooze-DJEPOBT5.js → snooze-WPUVDSBY.js} +14 -11
  173. package/dist/{snooze-DJEPOBT5.js.map → snooze-WPUVDSBY.js.map} +1 -1
  174. package/dist/{start-YPEN5QI3.js → start-EDY2RTZ3.js} +15 -12
  175. package/dist/{start-YPEN5QI3.js.map → start-EDY2RTZ3.js.map} +1 -1
  176. package/dist/{state-UAW6DWWU.js → state-DC73V5TS.js} +6 -4
  177. package/dist/{state-UAW6DWWU.js.map → state-DC73V5TS.js.map} +1 -1
  178. package/dist/{status-4EOTN33T.js → status-KISVX264.js} +13 -10
  179. package/dist/{status-4EOTN33T.js.map → status-KISVX264.js.map} +1 -1
  180. package/dist/{statusline-EUT6VZLP.js → statusline-A2DTGLK5.js} +40 -28
  181. package/dist/statusline-A2DTGLK5.js.map +1 -0
  182. package/dist/statusline-hook-OVWHHFBV.js +63 -0
  183. package/dist/statusline-hook-OVWHHFBV.js.map +1 -0
  184. package/dist/{stop-3UNZ22YA.js → stop-YJCB5IOT.js} +15 -12
  185. package/dist/{stop-3UNZ22YA.js.map → stop-YJCB5IOT.js.map} +1 -1
  186. package/dist/{sync-XXZBP6PK.js → sync-GD6LFFCX.js} +29 -26
  187. package/dist/{sync-XXZBP6PK.js.map → sync-GD6LFFCX.js.map} +1 -1
  188. package/dist/{time-G5Z57AE5.js → time-YUSOOTR5.js} +17 -14
  189. package/dist/{time-G5Z57AE5.js.map → time-YUSOOTR5.js.map} +1 -1
  190. package/dist/time-actions-4XNIRNMH.js +16 -0
  191. package/dist/{timesheet-NA7NQUVR.js → timesheet-W6RIHJE7.js} +19 -16
  192. package/dist/{timesheet-NA7NQUVR.js.map → timesheet-W6RIHJE7.js.map} +1 -1
  193. package/dist/{todo-V7EVWHF2.js → todo-4VTGOCKH.js} +7 -5
  194. package/dist/{todo-V7EVWHF2.js.map → todo-4VTGOCKH.js.map} +1 -1
  195. package/dist/{tree-R5YXQTP7.js → tree-UVJP5XF4.js} +41 -30
  196. package/dist/tree-UVJP5XF4.js.map +1 -0
  197. package/dist/{update-B3MQXQJ6.js → update-2A4JGE3U.js} +16 -13
  198. package/dist/{update-B3MQXQJ6.js.map → update-2A4JGE3U.js.map} +1 -1
  199. package/dist/{usage-2HE4RSVM.js → usage-KJZAMQW5.js} +18 -13
  200. package/dist/usage-KJZAMQW5.js.map +1 -0
  201. package/dist/{wait-2OPYJO3K.js → wait-XA3ZS2WF.js} +15 -12
  202. package/dist/{wait-2OPYJO3K.js.map → wait-XA3ZS2WF.js.map} +1 -1
  203. package/dist/wd-bin.js +8 -6
  204. package/dist/wd-bin.js.map +1 -1
  205. package/dist/web/assets/{PtyView-DgdSx6WG.js → PtyView-BPk8N9xQ.js} +2 -2
  206. package/dist/web/assets/{PtyView-DgdSx6WG.js.map → PtyView-BPk8N9xQ.js.map} +1 -1
  207. package/dist/web/assets/{index-C5JNhi3-.css → index-CZwdUbxG.css} +1 -1
  208. package/dist/web/assets/index-vXchs7b4.js +119 -0
  209. package/dist/web/assets/index-vXchs7b4.js.map +1 -0
  210. package/dist/web/index.html +2 -2
  211. package/dist/{web-QXQ4NGCJ.js → web-QCHECDRD.js} +407 -262
  212. package/dist/web-QCHECDRD.js.map +1 -0
  213. package/npm-shrinkwrap.json +2 -2
  214. package/package.json +1 -1
  215. package/dist/chunk-3Q5RZCQW.js +0 -9
  216. package/dist/chunk-3ZGZNZTY.js +0 -134
  217. package/dist/chunk-3ZGZNZTY.js.map +0 -1
  218. package/dist/chunk-4PRPDACI.js.map +0 -1
  219. package/dist/chunk-5GA3PFK5.js.map +0 -1
  220. package/dist/chunk-5XSY3C6E.js.map +0 -1
  221. package/dist/chunk-AFW7HREX.js.map +0 -1
  222. package/dist/chunk-BVJ2ZE7B.js.map +0 -1
  223. package/dist/chunk-CFLMBFBO.js.map +0 -1
  224. package/dist/chunk-DYJ4VJJD.js.map +0 -1
  225. package/dist/chunk-EPNYZJMM.js.map +0 -1
  226. package/dist/chunk-FUNZ7TOS.js.map +0 -1
  227. package/dist/chunk-J5CMORVD.js.map +0 -1
  228. package/dist/chunk-KE2TFF7B.js.map +0 -1
  229. package/dist/chunk-MGQK6BWH.js.map +0 -1
  230. package/dist/chunk-QGKJXCEJ.js.map +0 -1
  231. package/dist/chunk-TPPTL7LA.js.map +0 -1
  232. package/dist/chunk-TUFQJXXO.js +0 -19
  233. package/dist/chunk-TUFQJXXO.js.map +0 -1
  234. package/dist/chunk-USUQYM6V.js.map +0 -1
  235. package/dist/chunk-VMBWCDBA.js +0 -186
  236. package/dist/chunk-VMBWCDBA.js.map +0 -1
  237. package/dist/chunk-ZGPWIBSZ.js.map +0 -1
  238. package/dist/chunk-ZMCU2PZN.js.map +0 -1
  239. package/dist/chunk-ZS6F6JLC.js.map +0 -1
  240. package/dist/cli-UTID323G.js +0 -17
  241. package/dist/command-hook-installer-RJH5QLCD.js.map +0 -1
  242. package/dist/install-skills-7EHZBANC.js +0 -16
  243. package/dist/move-ZTL7HAIU.js.map +0 -1
  244. package/dist/pty-host-KSS45FVH.js.map +0 -1
  245. package/dist/recent-GRKJEEKT.js.map +0 -1
  246. package/dist/resume-634R6KNE.js.map +0 -1
  247. package/dist/statusline-EUT6VZLP.js.map +0 -1
  248. package/dist/statusline-hook-TZ7M762P.js +0 -118
  249. package/dist/statusline-hook-TZ7M762P.js.map +0 -1
  250. package/dist/time-actions-H5WCOYZG.js +0 -14
  251. package/dist/tree-R5YXQTP7.js.map +0 -1
  252. package/dist/usage-2HE4RSVM.js.map +0 -1
  253. package/dist/web/assets/index-O8yTaaWX.js +0 -119
  254. package/dist/web/assets/index-O8yTaaWX.js.map +0 -1
  255. package/dist/web-QXQ4NGCJ.js.map +0 -1
  256. /package/dist/{chunk-C5HPSURF.js.map → chunk-3JFRM4IY.js.map} +0 -0
  257. /package/dist/{chunk-O34CKSE4.js.map → chunk-3N3UQEC4.js.map} +0 -0
  258. /package/dist/{chunk-YJ4CAD3X.js.map → chunk-44AU2STD.js.map} +0 -0
  259. /package/dist/{chunk-SNRP2MC3.js.map → chunk-5QGCF3PS.js.map} +0 -0
  260. /package/dist/{chunk-JIYGGN2N.js.map → chunk-AU27USPZ.js.map} +0 -0
  261. /package/dist/{chunk-3Q5RZCQW.js.map → chunk-BBZ2DK6W.js.map} +0 -0
  262. /package/dist/{chunk-B2HUKRWX.js.map → chunk-BT7SZQQL.js.map} +0 -0
  263. /package/dist/{chunk-YNHIMOE7.js.map → chunk-GNGXYXBC.js.map} +0 -0
  264. /package/dist/{chunk-KU63EHZO.js.map → chunk-ICJPVSRY.js.map} +0 -0
  265. /package/dist/{chunk-VEKEA3ER.js.map → chunk-J36ULZBO.js.map} +0 -0
  266. /package/dist/{chunk-UHYIB6AV.js.map → chunk-JEET43KM.js.map} +0 -0
  267. /package/dist/{chunk-2IKWNRMV.js.map → chunk-K5QBU5CY.js.map} +0 -0
  268. /package/dist/{chunk-TBY6ZFAV.js.map → chunk-KNRGVUW7.js.map} +0 -0
  269. /package/dist/{chunk-WIWO3YWP.js.map → chunk-LCV62KMO.js.map} +0 -0
  270. /package/dist/{chunk-3JY3QT4J.js.map → chunk-LZUFHLBF.js.map} +0 -0
  271. /package/dist/{chunk-3PLWNCRM.js.map → chunk-MMFXUIQQ.js.map} +0 -0
  272. /package/dist/{chunk-46UTKL5L.js.map → chunk-OMIMK3LB.js.map} +0 -0
  273. /package/dist/{chunk-PUTZR6F5.js.map → chunk-P4EQWC5W.js.map} +0 -0
  274. /package/dist/{chunk-OFCY7RCM.js.map → chunk-QJLJH5DC.js.map} +0 -0
  275. /package/dist/{chunk-G2FE7HUB.js.map → chunk-RGUSVBGN.js.map} +0 -0
  276. /package/dist/{chunk-R3DASZQF.js.map → chunk-S3BAD4IR.js.map} +0 -0
  277. /package/dist/{chunk-B7C3RYSJ.js.map → chunk-SG5LUMGE.js.map} +0 -0
  278. /package/dist/{chunk-KUVL75PL.js.map → chunk-SVSRQ3R2.js.map} +0 -0
  279. /package/dist/{chunk-TTTIKTNR.js.map → chunk-UMYB6DZX.js.map} +0 -0
  280. /package/dist/{chunk-W4YWFAYC.js.map → chunk-VEWSK3FG.js.map} +0 -0
  281. /package/dist/{chunk-W7WC7UA2.js.map → chunk-VRHQMUPB.js.map} +0 -0
  282. /package/dist/{chunk-LQXGNO5X.js.map → chunk-W7NCZ3VU.js.map} +0 -0
  283. /package/dist/{chunk-3UHKPHTB.js.map → chunk-WM4JWBKJ.js.map} +0 -0
  284. /package/dist/{chunk-MCSEYS2J.js.map → chunk-WPZTIF5C.js.map} +0 -0
  285. /package/dist/{chunk-DO5NW46X.js.map → chunk-X4AXKO3A.js.map} +0 -0
  286. /package/dist/{chunk-LWKFZOCJ.js.map → chunk-X63DS7BW.js.map} +0 -0
  287. /package/dist/{chunk-5WEDCEZG.js.map → chunk-X7TWBG4X.js.map} +0 -0
  288. /package/dist/{chunk-5BNNPXID.js.map → chunk-YA3WCQ2A.js.map} +0 -0
  289. /package/dist/{chunk-COKQPFLB.js.map → chunk-YYBXQBW2.js.map} +0 -0
  290. /package/dist/{chunk-PIKOCEWX.js.map → chunk-ZOGGTAOK.js.map} +0 -0
  291. /package/dist/{cli-UTID323G.js.map → cli-Y4JSWLZ2.js.map} +0 -0
  292. /package/dist/{history-YX74IRQY.js.map → history-OXEG6SOK.js.map} +0 -0
  293. /package/dist/{install-skills-7EHZBANC.js.map → install-skills-QTWYVAOZ.js.map} +0 -0
  294. /package/dist/{report-KAS2UEXO.js.map → report-J7TUQRJS.js.map} +0 -0
  295. /package/dist/{time-actions-H5WCOYZG.js.map → time-actions-4XNIRNMH.js.map} +0 -0
@@ -11,11 +11,17 @@ import {
11
11
  serveSpa,
12
12
  sessionBaseForPath,
13
13
  submitReviewSchema
14
- } from "./chunk-YJ4CAD3X.js";
14
+ } from "./chunk-44AU2STD.js";
15
15
  import {
16
- ensureAgentPath,
17
- findOnPath
18
- } from "./chunk-ZGPWIBSZ.js";
16
+ ensureAgentPath
17
+ } from "./chunk-YEXW2OCN.js";
18
+ import {
19
+ createBuildFoldersJob,
20
+ defaultBranchTidyDeps,
21
+ defaultBuildFoldersDeps,
22
+ deleteMergedBranches,
23
+ findMergedBranches
24
+ } from "./chunk-KUO5ATYX.js";
19
25
  import {
20
26
  defaultTimeDeps,
21
27
  fetchIssueDetail,
@@ -28,7 +34,10 @@ import {
28
34
  graphProblem,
29
35
  signOutGraph,
30
36
  startDeviceLogin
31
- } from "./chunk-J5CMORVD.js";
37
+ } from "./chunk-NMSJJCOD.js";
38
+ import {
39
+ defaultCleanupDeps
40
+ } from "./chunk-SVSRQ3R2.js";
32
41
  import {
33
42
  addTask,
34
43
  completeTask,
@@ -36,7 +45,7 @@ import {
36
45
  getTasks,
37
46
  removeTask,
38
47
  uncompleteTask
39
- } from "./chunk-46UTKL5L.js";
48
+ } from "./chunk-OMIMK3LB.js";
40
49
  import {
41
50
  announceChange,
42
51
  createArchivedRows,
@@ -51,39 +60,42 @@ import {
51
60
  stageSeenKey,
52
61
  storeHolding,
53
62
  withRestoring
54
- } from "./chunk-5GA3PFK5.js";
63
+ } from "./chunk-TGWUOZJL.js";
55
64
  import {
56
65
  DiffStatCache,
57
66
  findOverlaps,
58
67
  wantsDiffStat
59
- } from "./chunk-UHYIB6AV.js";
68
+ } from "./chunk-JEET43KM.js";
60
69
  import {
61
70
  createDigestSource
62
- } from "./chunk-PIKOCEWX.js";
71
+ } from "./chunk-ZOGGTAOK.js";
72
+ import {
73
+ QUEUE_RECHECK_MS,
74
+ accountSwitchNote,
75
+ busyForRestart,
76
+ createAccountSwitcher,
77
+ createRestarter,
78
+ defaultAccountSwitchDeps,
79
+ installedAtCache,
80
+ outdatedPtys,
81
+ restartNotesSummary,
82
+ switchRefusal
83
+ } from "./chunk-D675JTUZ.js";
84
+ import "./chunk-ZDMJPEBO.js";
63
85
  import {
64
86
  agentsBySession,
65
- createBuildFoldersJob,
66
- defaultBranchTidyDeps,
67
- defaultBuildFoldersDeps,
68
- deleteMergedBranches,
69
- findMergedBranches,
70
87
  summarizeAgents
71
- } from "./chunk-AFW7HREX.js";
72
- import {
73
- defaultCleanupDeps
74
- } from "./chunk-KUVL75PL.js";
88
+ } from "./chunk-YEY2WKOE.js";
89
+ import "./chunk-TNJF7T33.js";
75
90
  import {
76
91
  buildUsage,
77
92
  realUsageDeps,
78
93
  setupAgentUsage
79
- } from "./chunk-DYJ4VJJD.js";
94
+ } from "./chunk-A42MFPMC.js";
95
+ import "./chunk-P2HOLCBF.js";
80
96
  import {
81
97
  sendToSession
82
98
  } from "./chunk-RYNBBSLY.js";
83
- import {
84
- LATER_TEXT,
85
- restartCountsText
86
- } from "./chunk-TNJF7T33.js";
87
99
  import {
88
100
  BehindCache,
89
101
  behindMain,
@@ -99,7 +111,7 @@ import {
99
111
  stackedOn,
100
112
  updateFromBase,
101
113
  updateFromMain
102
- } from "./chunk-5WEDCEZG.js";
114
+ } from "./chunk-X7TWBG4X.js";
103
115
  import {
104
116
  applyPlacePatch,
105
117
  applySectionOp,
@@ -108,13 +120,13 @@ import {
108
120
  cleanSectionOp,
109
121
  placeSession,
110
122
  readRailLayout
111
- } from "./chunk-R3DASZQF.js";
123
+ } from "./chunk-S3BAD4IR.js";
112
124
  import {
113
125
  MAX_NOTE_CHARS,
114
126
  readNote,
115
127
  saveNote,
116
128
  sessionsWithNotes
117
- } from "./chunk-YNHIMOE7.js";
129
+ } from "./chunk-GNGXYXBC.js";
118
130
  import {
119
131
  addBlocker,
120
132
  allBlocks,
@@ -125,16 +137,16 @@ import {
125
137
  removeBlocker,
126
138
  sweepBlocks,
127
139
  unblockedPrompt
128
- } from "./chunk-LQXGNO5X.js";
140
+ } from "./chunk-W7NCZ3VU.js";
129
141
  import {
130
142
  jiraWorklogPoster,
131
143
  logWorkDay,
132
144
  loggedDays,
133
145
  worklogSettings
134
- } from "./chunk-PUTZR6F5.js";
146
+ } from "./chunk-P4EQWC5W.js";
135
147
  import {
136
148
  sessionWorkTime
137
- } from "./chunk-LWKFZOCJ.js";
149
+ } from "./chunk-X63DS7BW.js";
138
150
  import {
139
151
  DEFAULT_CATCH_UP_DAYS,
140
152
  addDays,
@@ -146,22 +158,25 @@ import {
146
158
  daysWire,
147
159
  daysWireOf,
148
160
  isDay,
161
+ isMonth,
162
+ listFrom,
149
163
  localDay,
164
+ monthRange,
165
+ monthWire,
166
+ monthWireOf,
167
+ needsBuild,
150
168
  postStoredDay,
151
169
  readDays,
152
170
  tempoClient,
153
171
  tempoSetup,
154
172
  timeRange,
155
173
  updateDay
156
- } from "./chunk-TPPTL7LA.js";
157
- import {
158
- isOwnCheckout
159
- } from "./chunk-TUFQJXXO.js";
174
+ } from "./chunk-4M5TIZDC.js";
160
175
  import {
161
176
  checkTools,
162
177
  saveFolders,
163
178
  setupState
164
- } from "./chunk-LDFICXOZ.js";
179
+ } from "./chunk-KC66FLGZ.js";
165
180
  import {
166
181
  RepoAdminError,
167
182
  deleteGroup,
@@ -171,7 +186,7 @@ import {
171
186
  saveGroup,
172
187
  setRepoIgnored,
173
188
  setScanRoot
174
- } from "./chunk-ZNXACRZ5.js";
189
+ } from "./chunk-WZ4QXVCC.js";
175
190
  import {
176
191
  freeLeftovers,
177
192
  leftoversOf,
@@ -179,16 +194,16 @@ import {
179
194
  openInLeftovers,
180
195
  parsePrRef,
181
196
  resolvePrToStart
182
- } from "./chunk-KU63EHZO.js";
197
+ } from "./chunk-ICJPVSRY.js";
183
198
  import {
184
199
  editorArgs,
185
200
  openUrl
186
- } from "./chunk-EPNYZJMM.js";
201
+ } from "./chunk-3TN77GOI.js";
187
202
  import {
188
203
  archiveMergedSession,
189
204
  archiveWaiting,
190
205
  defaultArchiveDeps
191
- } from "./chunk-C5HPSURF.js";
206
+ } from "./chunk-3JFRM4IY.js";
192
207
  import {
193
208
  MAX_REPLY_CHARS,
194
209
  THREAD_ID,
@@ -203,7 +218,7 @@ import {
203
218
  rememberSent,
204
219
  retireResolvedReplies,
205
220
  sessionRepoRefs
206
- } from "./chunk-3JY3QT4J.js";
221
+ } from "./chunk-LZUFHLBF.js";
207
222
  import {
208
223
  cleanupVerdict,
209
224
  createCleanupJob
@@ -211,11 +226,11 @@ import {
211
226
  import {
212
227
  sessionStatusView,
213
228
  shownState
214
- } from "./chunk-5BNNPXID.js";
229
+ } from "./chunk-YA3WCQ2A.js";
215
230
  import {
216
231
  listProcesses,
217
232
  runningFromNames
218
- } from "./chunk-B7C3RYSJ.js";
233
+ } from "./chunk-SG5LUMGE.js";
219
234
  import {
220
235
  fetchAllPullRequests
221
236
  } from "./chunk-VTLDYH3C.js";
@@ -228,17 +243,14 @@ import {
228
243
  defaultForkDeps,
229
244
  forkSession,
230
245
  startSessionWithPrompt
231
- } from "./chunk-QGKJXCEJ.js";
246
+ } from "./chunk-T2ZB6I3Y.js";
232
247
  import {
233
248
  askCatchUp,
234
249
  cachedCatchUp,
235
250
  catchUp,
236
251
  catchUpFacts,
237
252
  forgetCatchUp
238
- } from "./chunk-MCSEYS2J.js";
239
- import {
240
- resolveWorkBinPath
241
- } from "./chunk-AH5TM3NB.js";
253
+ } from "./chunk-WPZTIF5C.js";
242
254
  import {
243
255
  childText,
244
256
  createInChild,
@@ -246,17 +258,20 @@ import {
246
258
  keyedQueue,
247
259
  oneAtATime,
248
260
  runWorkChild
249
- } from "./chunk-4PRPDACI.js";
261
+ } from "./chunk-PC67UHUW.js";
262
+ import {
263
+ resolveWorkBinPath
264
+ } from "./chunk-AH5TM3NB.js";
250
265
  import {
251
266
  runInternal,
252
267
  summarizeCheckpoint,
253
268
  throttleTrailing
254
- } from "./chunk-W7WC7UA2.js";
269
+ } from "./chunk-VRHQMUPB.js";
255
270
  import {
256
271
  computeDiff,
257
272
  computeRangeDiff,
258
273
  parseGitDiff
259
- } from "./chunk-B2HUKRWX.js";
274
+ } from "./chunk-BT7SZQQL.js";
260
275
  import {
261
276
  configurePtyPool,
262
277
  detachPtyPool,
@@ -281,22 +296,22 @@ import {
281
296
  subscribeSession,
282
297
  syncPtyPool,
283
298
  writeToPty
284
- } from "./chunk-ZS6F6JLC.js";
299
+ } from "./chunk-6MJ6BDHL.js";
285
300
  import {
286
301
  dbPtySessions
287
- } from "./chunk-TBY6ZFAV.js";
288
- import "./chunk-CFLMBFBO.js";
302
+ } from "./chunk-KNRGVUW7.js";
303
+ import "./chunk-M6LJ3GE3.js";
289
304
  import {
290
305
  ASSISTANT_ID,
291
306
  CONTEXT_WARN,
292
307
  assistantDir,
293
308
  describeView,
294
309
  writeAssistantContext
295
- } from "./chunk-BHU26CNH.js";
310
+ } from "./chunk-6XMH3WFY.js";
296
311
  import {
297
312
  addRepoRefusal,
298
313
  addedRepoNote
299
- } from "./chunk-TTTIKTNR.js";
314
+ } from "./chunk-UMYB6DZX.js";
300
315
  import {
301
316
  clearDevWebDiscovery,
302
317
  clearWebDiscovery,
@@ -308,17 +323,17 @@ import {
308
323
  readWebUrl,
309
324
  writeDevWebDiscovery,
310
325
  writeWebDiscovery
311
- } from "./chunk-DO5NW46X.js";
326
+ } from "./chunk-X4AXKO3A.js";
312
327
  import {
313
328
  NOTE_NUDGE,
314
329
  findSessionForCwd,
315
330
  readPendingForSession,
316
331
  readPendingForWorktree
317
- } from "./chunk-3UHKPHTB.js";
332
+ } from "./chunk-WM4JWBKJ.js";
318
333
  import "./chunk-ZSHWP2VS.js";
319
334
  import {
320
335
  getCommentFileStore
321
- } from "./chunk-SNRP2MC3.js";
336
+ } from "./chunk-5QGCF3PS.js";
322
337
  import {
323
338
  createCommentStore
324
339
  } from "./chunk-HUXS3VAI.js";
@@ -326,8 +341,8 @@ import {
326
341
  teardownWorktree,
327
342
  toBaseSpec,
328
343
  wouldRefuseRemoval
329
- } from "./chunk-BVJ2ZE7B.js";
330
- import "./chunk-G2FE7HUB.js";
344
+ } from "./chunk-VQGHVXGL.js";
345
+ import "./chunk-RGUSVBGN.js";
331
346
  import {
332
347
  isWorktreeFolder
333
348
  } from "./chunk-KUCMJHQW.js";
@@ -344,13 +359,13 @@ import {
344
359
  } from "./chunk-LNHSBM4L.js";
345
360
  import {
346
361
  VERSION
347
- } from "./chunk-3Q5RZCQW.js";
362
+ } from "./chunk-BBZ2DK6W.js";
348
363
  import {
349
364
  resolveProjectTarget
350
- } from "./chunk-VEKEA3ER.js";
365
+ } from "./chunk-J36ULZBO.js";
351
366
  import {
352
367
  git
353
- } from "./chunk-O34CKSE4.js";
368
+ } from "./chunk-3N3UQEC4.js";
354
369
  import {
355
370
  DECISION_MARKER,
356
371
  STAGE_WANTS_YOU,
@@ -431,7 +446,7 @@ import {
431
446
  updateCheckpoint,
432
447
  whileRestoring,
433
448
  writeArchiveRecord
434
- } from "./chunk-MGQK6BWH.js";
449
+ } from "./chunk-CNE5SWFH.js";
435
450
  import {
436
451
  dayKey
437
452
  } from "./chunk-NEJVK5CF.js";
@@ -442,45 +457,54 @@ import {
442
457
  sessionIdFor,
443
458
  tx,
444
459
  withDb
445
- } from "./chunk-COKQPFLB.js";
460
+ } from "./chunk-YYBXQBW2.js";
446
461
  import {
447
462
  activityRoots,
463
+ agentAccountFolders,
448
464
  agentFor,
449
465
  agentOf,
450
466
  agentWriteMs,
467
+ isOwnCheckout,
451
468
  knownAgents,
452
469
  lineTimeOf,
453
470
  liveAgents,
454
471
  readJsonlSince
455
- } from "./chunk-FUNZ7TOS.js";
472
+ } from "./chunk-F6M255O5.js";
456
473
  import {
457
474
  usageDir
458
- } from "./chunk-ZMCU2PZN.js";
475
+ } from "./chunk-RCGFHJM7.js";
476
+ import "./chunk-FDKJFIUU.js";
477
+ import {
478
+ DEFAULT_ACCOUNT,
479
+ DEFAULT_PROMPTS,
480
+ DEFAULT_TIME_SETTINGS,
481
+ isWorkday,
482
+ loadConfig
483
+ } from "./chunk-XNLQSW6J.js";
459
484
  import {
460
485
  detachHere,
461
486
  isPidAlive,
462
487
  recentProcessTable
463
- } from "./chunk-VMBWCDBA.js";
488
+ } from "./chunk-4NITDMDH.js";
464
489
  import {
465
490
  spawn_default
466
491
  } from "./chunk-RCYI7SRA.js";
492
+ import {
493
+ atomicWriteFile
494
+ } from "./chunk-ZXHMC7UO.js";
467
495
  import {
468
496
  report
469
- } from "./chunk-JIYGGN2N.js";
497
+ } from "./chunk-AU27USPZ.js";
470
498
  import {
471
- DEFAULT_PROMPTS,
472
- DEFAULT_TIME_SETTINGS,
473
- atomicWriteFile,
474
- getConfigDir,
475
- isWorkday,
476
- loadConfig
477
- } from "./chunk-KE2TFF7B.js";
499
+ getConfigDir
500
+ } from "./chunk-6THUVP6T.js";
478
501
 
479
502
  // src/commands/web.ts
503
+ import fs16 from "fs";
480
504
  import chalk from "chalk";
481
505
 
482
506
  // src/server/web-server.ts
483
- import fs15 from "fs";
507
+ import fs14 from "fs";
484
508
 
485
509
  // src/core/conversations/last-reply.ts
486
510
  function lastReplyOf(entries) {
@@ -1150,8 +1174,8 @@ async function readCodeFile(s, repo, rel, io = realIo) {
1150
1174
  // src/core/worktree/code-symbols.ts
1151
1175
  var MAX_LINE_CHARS = 240;
1152
1176
  function parseGrepLine(line) {
1153
- const z7 = /^([^\0]+)\0(\d+)\0(.*)$/.exec(line);
1154
- if (z7) return { path: z7[1], line: Number(z7[2]), text: z7[3] };
1177
+ const z8 = /^([^\0]+)\0(\d+)\0(.*)$/.exec(line);
1178
+ if (z8) return { path: z8[1], line: Number(z8[2]), text: z8[3] };
1155
1179
  const m = /^(.+?):(\d+):(.*)$/.exec(line);
1156
1180
  return m ? { path: m[1], line: Number(m[2]), text: m[3] } : null;
1157
1181
  }
@@ -2812,7 +2836,9 @@ function mountWorktreeRoutes(app, opts) {
2812
2836
  /** Start Claude with this as its first message. */
2813
2837
  prompt: z4.string().max(2e4).optional(),
2814
2838
  /** Name the session (its title); the branch stays its identity. */
2815
- name: z4.string().max(120).optional()
2839
+ name: z4.string().max(120).optional(),
2840
+ /** The Claude account a new session runs on (a name from `work account list`); empty: the configured default. */
2841
+ account: z4.string().max(64).optional()
2816
2842
  });
2817
2843
  const startSession = opts.startSession ?? startSessionWithPrompt;
2818
2844
  const create = opts.create ?? createInProcess;
@@ -2824,6 +2850,7 @@ function mountWorktreeRoutes(app, opts) {
2824
2850
  });
2825
2851
  app.post("/api/worktrees", zValidator5("json", createSchema), async (c) => {
2826
2852
  const { target, base, jiraKey, prompt, name } = c.req.valid("json");
2853
+ const account = c.req.valid("json").account?.trim() || void 0;
2827
2854
  const config = loadConfig();
2828
2855
  if (!config) return c.json({ error: "no config" }, 400);
2829
2856
  const wanted = c.req.valid("json").branch?.trim() ?? "";
@@ -2831,7 +2858,7 @@ function mountWorktreeRoutes(app, opts) {
2831
2858
  return c.json({ error: "a base needs a branch to fork (leave both empty to open the repo as it is)" }, 400);
2832
2859
  try {
2833
2860
  const made = await create(
2834
- { target, branch: wanted || void 0, base: base?.trim() ? toBaseSpec(base.trim()) : void 0, jiraKey, name },
2861
+ { target, branch: wanted || void 0, base: base?.trim() ? toBaseSpec(base.trim()) : void 0, jiraKey, name, account },
2835
2862
  config
2836
2863
  );
2837
2864
  if (!made.ok) return c.json({ error: made.error }, 400);
@@ -4355,11 +4382,6 @@ function dirBytes(dir) {
4355
4382
  var TIME_EVERY_MS = 30 * 6e4;
4356
4383
  var CATCH_UP_DAYS = DEFAULT_CATCH_UP_DAYS;
4357
4384
  var AFTER_TURN_MS = 2 * 6e4;
4358
- function dayEnd(day) {
4359
- const d = /* @__PURE__ */ new Date(`${day}T00:00:00`);
4360
- d.setDate(d.getDate() + 1);
4361
- return d.getTime();
4362
- }
4363
4385
  function createTimeKeeper(deps, opts) {
4364
4386
  const now = opts.now ?? (() => Date.now());
4365
4387
  let busy = null;
@@ -4368,12 +4390,11 @@ function createTimeKeeper(deps, opts) {
4368
4390
  deps.fresh?.(what);
4369
4391
  const today = localDay(now());
4370
4392
  const settings = deps.settings();
4371
- const from = addDays(today, -((settings.catchUpDays ?? CATCH_UP_DAYS) - 1));
4393
+ const from = listFrom(today, settings.catchUpDays ?? CATCH_UP_DAYS);
4372
4394
  const builtAt = new Map(readDays(from, today).map((r) => [r.day, r.builtAt]));
4373
4395
  const days = daysBetween(from, today).filter((d) => {
4374
4396
  if (d === today) return true;
4375
- const at = builtAt.get(d);
4376
- return at === void 0 || !at || Date.parse(at) < dayEnd(d);
4397
+ return needsBuild(d, builtAt.get(d));
4377
4398
  });
4378
4399
  const run2 = opts.activity?.start("time", days.length === 1 ? "Updating today" : `Building ${days.length} days`);
4379
4400
  const failed = [];
@@ -4429,6 +4450,44 @@ function createTimeKeeper(deps, opts) {
4429
4450
  };
4430
4451
  }
4431
4452
 
4453
+ // src/core/time/month-gather.ts
4454
+ function createMonthGather(deps, opts) {
4455
+ const now = opts.now ?? (() => Date.now());
4456
+ const running = /* @__PURE__ */ new Map();
4457
+ const errors = /* @__PURE__ */ new Map();
4458
+ return {
4459
+ start: (month) => {
4460
+ if (running.has(month)) return false;
4461
+ const today = localDay(now());
4462
+ const range = monthRange(month, today);
4463
+ if (!range) return false;
4464
+ const built = new Map(readDays(range.from, range.to).map((r) => [r.day, r.builtAt]));
4465
+ const days = daysBetween(range.from, range.to).filter((d) => d < today && needsBuild(d, built.get(d)));
4466
+ if (!days.length) return false;
4467
+ errors.delete(month);
4468
+ const p = (async () => {
4469
+ const failed = [];
4470
+ for (const d of days) {
4471
+ try {
4472
+ await buildDay(d, deps);
4473
+ opts.changed(d);
4474
+ } catch (err) {
4475
+ failed.push(`${d}: ${err.message}`);
4476
+ }
4477
+ }
4478
+ if (failed.length) errors.set(month, `${failed.length} of ${days.length} days not gathered \u2014 ${failed.join("; ")}`);
4479
+ })().finally(() => {
4480
+ running.delete(month);
4481
+ opts.changed(days[days.length - 1]);
4482
+ });
4483
+ running.set(month, p);
4484
+ return true;
4485
+ },
4486
+ state: (month) => ({ gathering: running.has(month), error: errors.get(month) ?? null }),
4487
+ done: (month) => running.get(month) ?? Promise.resolve()
4488
+ };
4489
+ }
4490
+
4432
4491
  // src/server/routes/time-routes.ts
4433
4492
  var realTempo = () => {
4434
4493
  const s = tempoSetup(loadConfig()?.time?.tempo, process.env);
@@ -4506,6 +4565,30 @@ function mountTimeRoutes(app, opts) {
4506
4565
  if ("error" in r) return c.json({ error: r.error }, 400);
4507
4566
  return c.json(daysWire(r.from, r.to, settings));
4508
4567
  });
4568
+ const gather = createMonthGather(opts.deps, { changed });
4569
+ const monthWithState = (month) => {
4570
+ const t = tempo();
4571
+ return {
4572
+ ...monthWire(month, localDay(), opts.deps.settings()),
4573
+ gathering: gather.state(month).gathering,
4574
+ gatherError: gather.state(month).error,
4575
+ posting: "why" in t ? { ready: false, why: t.why } : { ready: true, why: null }
4576
+ };
4577
+ };
4578
+ const badMonth = (month) => !isMonth(month) ? "month: YYYY-MM" : !monthRange(month, localDay()) ? "month: one that has started" : null;
4579
+ app.get("/api/time/month/:month", (c) => {
4580
+ const month = c.req.param("month");
4581
+ const bad = badMonth(month);
4582
+ if (bad) return c.json({ error: bad }, 400);
4583
+ return c.json(monthWithState(month));
4584
+ });
4585
+ app.post("/api/time/month/:month/gather", (c) => {
4586
+ const month = c.req.param("month");
4587
+ const bad = badMonth(month);
4588
+ if (bad) return c.json({ error: bad }, 400);
4589
+ gather.start(month);
4590
+ return c.json(monthWithState(month), 202);
4591
+ });
4509
4592
  app.get("/api/time/:day", (c) => {
4510
4593
  const day = c.req.param("day");
4511
4594
  if (!isDay(day)) return c.json({ error: "day: a real day, YYYY-MM-DD" }, 400);
@@ -5635,157 +5718,6 @@ async function bridgeToHost(ws, sessionId, pending) {
5635
5718
  });
5636
5719
  }
5637
5720
 
5638
- // src/core/pty/agent-restart.ts
5639
- import fs14 from "fs";
5640
- var PACKED_MTIME_BEFORE = Date.parse("1990-01-01T00:00:00Z");
5641
- function installedAt(cmd, find = findOnPath) {
5642
- const file = find(cmd);
5643
- if (!file) return null;
5644
- try {
5645
- return installTime(fs14.statSync(fs14.realpathSync(file)));
5646
- } catch {
5647
- return null;
5648
- }
5649
- }
5650
- function installTime(st) {
5651
- const real = (ms) => ms >= PACKED_MTIME_BEFORE ? ms : null;
5652
- const known = [real(st.mtimeMs), real(st.birthtimeMs)].filter((x) => x !== null);
5653
- return known.length ? Math.max(...known) : st.ctimeMs;
5654
- }
5655
- function installedAtCache(ttlMs = 6e4, look = installedAt, now = Date.now) {
5656
- const cache = /* @__PURE__ */ new Map();
5657
- return (cmd) => {
5658
- const hit = cache.get(cmd);
5659
- if (hit && now() - hit.read < ttlMs) return hit.at;
5660
- const at = look(cmd);
5661
- cache.set(cmd, { at, read: now() });
5662
- return at;
5663
- };
5664
- }
5665
- function outdatedPtys(ptys, toolInstalledAt) {
5666
- return ptys.filter((p) => {
5667
- if (p.exited || !p.tool) return false;
5668
- const at = toolInstalledAt(p.tool);
5669
- const started = Date.parse(p.startedAt);
5670
- return at !== null && Number.isFinite(started) && started < at;
5671
- });
5672
- }
5673
- var PRINTING_MS = 1e4;
5674
- function busyForRestart(state, lastOutputMs, now = Date.now(), live = null) {
5675
- if (live === "busy" || live === "waiting") return true;
5676
- if (state === "working" || state === "needs_input") return true;
5677
- return lastOutputMs !== null && now - lastOutputMs < PRINTING_MS;
5678
- }
5679
- function restartPlan(ids, busy) {
5680
- const now = [];
5681
- const later = [];
5682
- for (const id of new Set(ids)) (busy(id) ? later : now).push(id);
5683
- return { now, later };
5684
- }
5685
- var RESTART_AT_ONCE = 3;
5686
- function restartNotesSummary(notes) {
5687
- const n = (level) => notes.filter((x) => x.level === level).length;
5688
- return restartCountsText({ restarted: n("action"), later: n("info"), failed: n("warn") });
5689
- }
5690
- var QUEUE_RECHECK_MS = 15e3;
5691
- var TURN_END_GRACE_MS = 1e4;
5692
- function createRestarter(deps) {
5693
- const queued = /* @__PURE__ */ new Set();
5694
- const inFlight = /* @__PURE__ */ new Map();
5695
- const later = deps.later ?? ((fn, ms) => void setTimeout(fn, ms).unref?.());
5696
- const one = (id) => {
5697
- const running = inFlight.get(id);
5698
- if (running) return running;
5699
- queued.delete(id);
5700
- const p = deps.restart(id).then(
5701
- (how) => ({ ok: true, how: how || "restarted its agent (its conversation goes on)" }),
5702
- (err) => ({ ok: false, error: err.message })
5703
- );
5704
- inFlight.set(id, p);
5705
- void p.finally(() => inFlight.delete(id));
5706
- return p;
5707
- };
5708
- const run = async (ids, notes) => {
5709
- const failed = [];
5710
- const ok = /* @__PURE__ */ new Set();
5711
- const queue = [...ids];
5712
- const worker = async () => {
5713
- for (let id = queue.shift(); id !== void 0; id = queue.shift()) {
5714
- const r = await one(id);
5715
- if (r.ok) {
5716
- ok.add(id);
5717
- notes.push({ id, text: r.how, level: "action" });
5718
- } else {
5719
- failed.push({ id, error: r.error });
5720
- notes.push({ id, text: `couldn't restart its agent: ${r.error}`, level: "warn" });
5721
- }
5722
- }
5723
- };
5724
- await Promise.all(Array.from({ length: Math.min(RESTART_AT_ONCE, queue.length) }, worker));
5725
- return { done: ids.filter((id) => ok.has(id)), failed };
5726
- };
5727
- const finish = (notes) => {
5728
- if (!notes.length) return;
5729
- deps.report?.(notes);
5730
- deps.changed?.();
5731
- };
5732
- const request = async (ids) => {
5733
- const plan = restartPlan(ids, (id) => deps.busy(id));
5734
- const notes = [];
5735
- for (const id of plan.later) {
5736
- queued.add(id);
5737
- notes.push({ id, text: `${LATER_TEXT} (it is working or waiting on you)`, level: "info" });
5738
- }
5739
- const { done, failed } = await run(plan.now, notes);
5740
- finish(notes);
5741
- tick();
5742
- return { now: done, later: plan.later, failed };
5743
- };
5744
- let ticking = false;
5745
- const tick = () => {
5746
- if (ticking) return;
5747
- if (queued.size === 0) {
5748
- deps.scheduled?.(null);
5749
- return;
5750
- }
5751
- ticking = true;
5752
- deps.scheduled?.(Date.now() + QUEUE_RECHECK_MS);
5753
- later(() => {
5754
- ticking = false;
5755
- void retry().catch(() => {
5756
- }).finally(tick);
5757
- }, QUEUE_RECHECK_MS);
5758
- };
5759
- const retry = async (only, opts) => {
5760
- const notes = [];
5761
- const ready = [];
5762
- for (const id of [...queued]) {
5763
- if (only !== void 0 && id !== only) continue;
5764
- if (!deps.running(id)) {
5765
- queued.delete(id);
5766
- notes.push({ id, text: "no longer waits to restart: it was stopped meanwhile (it starts on the new version)", level: "info" });
5767
- continue;
5768
- }
5769
- if (!deps.busy(id, opts)) ready.push(id);
5770
- }
5771
- await run(ready, notes);
5772
- finish(notes);
5773
- };
5774
- return {
5775
- request,
5776
- retry: () => retry(),
5777
- /** A session's turn ended: restart it if it was waiting for that — and if it still reads as busy, look again shortly. */
5778
- turnEnded: (id) => {
5779
- if (!queued.has(id)) return;
5780
- later(() => void retry(id, { turnEnded: true }).catch(() => {
5781
- }), TURN_END_GRACE_MS);
5782
- },
5783
- queued: () => [...queued],
5784
- /** Being restarted now (the host lists them as exited meanwhile: still this session's). */
5785
- restarting: () => [...inFlight.keys()]
5786
- };
5787
- }
5788
-
5789
5721
  // src/server/routes/agent-restart-routes.ts
5790
5722
  function agentsWire(ptys, deps) {
5791
5723
  const times = /* @__PURE__ */ new Map();
@@ -5822,6 +5754,72 @@ function mountAgentRestartRoutes(app, opts) {
5822
5754
  });
5823
5755
  }
5824
5756
 
5757
+ // src/server/routes/account-routes.ts
5758
+ import { zValidator as zValidator8 } from "@hono/zod-validator";
5759
+ import { z as z7 } from "zod";
5760
+ function mountAccountRoutes(app, opts) {
5761
+ app.get("/api/accounts", (c) => {
5762
+ const accounts = agentFor(loadConfig()).accounts;
5763
+ const list = accounts?.list() ?? [];
5764
+ return c.json({
5765
+ accounts: list.map((a) => ({ name: a.name, dir: a.dir, isDefault: a.isDefault, loggedIn: a.loggedIn })),
5766
+ default: accounts?.defaultName() ?? DEFAULT_ACCOUNT
5767
+ });
5768
+ });
5769
+ app.post("/api/sessions/:id/account", zValidator8("json", z7.object({ to: z7.string().min(1).max(64) })), async (c) => {
5770
+ if (opts.lookOnly) return c.json({ error: opts.lookOnly }, 409);
5771
+ const r = await opts.switcher.switchAccount(c.req.param("id"), c.req.valid("json").to).catch((err) => ({
5772
+ ok: false,
5773
+ status: 502,
5774
+ error: err.message
5775
+ }));
5776
+ if (!r.ok) return c.json({ error: r.error }, r.status);
5777
+ opts.broadcast("sessions-changed", { ts: Date.now() });
5778
+ return c.json({ ok: true, outcome: r.outcome, ...r.moved !== void 0 ? { moved: r.moved } : {} });
5779
+ });
5780
+ app.delete("/api/sessions/:id/account", (c) => {
5781
+ if (opts.lookOnly) return c.json({ error: opts.lookOnly }, 409);
5782
+ const r = opts.switcher.cancel(c.req.param("id"));
5783
+ if (r === "running") return c.json({ error: "the switch is being done right now" }, 409);
5784
+ if (r === "none") return c.json({ error: "no switch is waiting for its turn" }, 409);
5785
+ opts.broadcast("sessions-changed", { ts: Date.now() });
5786
+ return c.json({ ok: true });
5787
+ });
5788
+ }
5789
+
5790
+ // src/core/sessions/account-switch-link.ts
5791
+ function createAccountSwitchLink() {
5792
+ let restarter = null;
5793
+ let switcher = null;
5794
+ return {
5795
+ connect(r, s) {
5796
+ restarter = r;
5797
+ switcher = s;
5798
+ },
5799
+ /** The agent restarter's `foldedInto`: a switch that waits or runs restarts it anyway. */
5800
+ foldedInto: (id) => {
5801
+ const to = switcher?.restartsAnyway(id) ?? null;
5802
+ return to === null ? null : `its switch to the ${to || "other"} account`;
5803
+ },
5804
+ /** The switcher's `cancelRestart`. */
5805
+ cancelRestart: (id) => restarter?.cancel(id) ?? false,
5806
+ /** A session's turn ended: a restart or a switch that waited for it goes now (after its hooks have run). */
5807
+ turnEnded(id) {
5808
+ restarter?.turnEnded(id);
5809
+ switcher?.turnEnded(id);
5810
+ },
5811
+ /** The sweep: the ones waiting on a turn whose end no hook reported. Never rejects. */
5812
+ async retry() {
5813
+ await restarter?.retry().catch(() => {
5814
+ });
5815
+ await switcher?.retry().catch(() => {
5816
+ });
5817
+ },
5818
+ /** The account a session waits to move to (SessionWire.accountPending), or null. */
5819
+ pendingFor: (id) => switcher?.pendingFor(id) ?? null
5820
+ };
5821
+ }
5822
+
5825
5823
  // src/core/pty/host-health.ts
5826
5824
  var UNRESPONSIVE_MS = 11e3;
5827
5825
  var SLOW_MS = 1500;
@@ -5958,7 +5956,7 @@ async function startWebServer(opts = {}) {
5958
5956
  let activityWatcher = null;
5959
5957
  if (!lean) {
5960
5958
  try {
5961
- const roots = activityRoots().filter((r) => fs15.existsSync(r));
5959
+ const roots = activityRoots().filter((r) => fs14.existsSync(r));
5962
5960
  if (roots.length > 0) {
5963
5961
  activityWatcher = createFsWatcher({
5964
5962
  roots,
@@ -6060,6 +6058,7 @@ async function startWebServer(opts = {}) {
6060
6058
  prStageFor: (id) => prStageWire(prWatch.state(id), (k) => stageSeen(id).has(k)),
6061
6059
  replyDraftsFor: (id) => drafts.get(id) ?? 0,
6062
6060
  hasNote: (id) => noted.has(id),
6061
+ accountPendingFor: (id) => accountLink.pendingFor(id),
6063
6062
  blockedByFor: (id) => (blocks.get(id)?.by ?? []).filter((b) => !blockerDone(b, (x) => !live.has(x))).map((b) => ({
6064
6063
  key: blockKey(b),
6065
6064
  kind: b.kind,
@@ -6170,7 +6169,9 @@ async function startWebServer(opts = {}) {
6170
6169
  return busyForRestart(session ? shownState(session) : null, opts2?.turnEnded ? null : ptyLastOutputMs(id), Date.now(), live);
6171
6170
  };
6172
6171
  const restartSchedule = dev ? null : activity.schedule("agents", "Agents waiting to restart", QUEUE_RECHECK_MS);
6172
+ const accountLink = createAccountSwitchLink();
6173
6173
  const restarter = createRestarter({
6174
+ foldedInto: accountLink.foldedInto,
6174
6175
  restart: restartPty,
6175
6176
  busy: restartBusy,
6176
6177
  running: peekPty,
@@ -6193,10 +6194,28 @@ async function startWebServer(opts = {}) {
6193
6194
  // The dev server shares the real PTY host and acts on nothing: the real work web restarts.
6194
6195
  lookOnly: dev ? "the dev server restarts nothing: use the real work web (the app, or `work restart`)" : void 0
6195
6196
  });
6197
+ const accountSchedule = dev ? null : activity.schedule("accounts", "Account switches waiting for a turn", QUEUE_RECHECK_MS);
6198
+ const accountSwitcher = createAccountSwitcher(
6199
+ defaultAccountSwitchDeps({
6200
+ busy: restartBusy,
6201
+ note: accountSwitchNote(activity, (id) => {
6202
+ const s = findSession2(id);
6203
+ return s ? `${s.target} ${s.branch}` : null;
6204
+ }),
6205
+ changed: () => broadcast("sessions-changed", { ts: Date.now() }),
6206
+ scheduled: (nextAt) => accountSchedule?.next(nextAt),
6207
+ cancelRestart: accountLink.cancelRestart
6208
+ })
6209
+ );
6210
+ accountLink.connect(restarter, accountSwitcher);
6211
+ mountAccountRoutes(app, {
6212
+ switcher: accountSwitcher,
6213
+ broadcast,
6214
+ lookOnly: dev ? "the dev server switches nothing: use the real work web (the app, or `work account switch`)" : void 0
6215
+ });
6196
6216
  const sleepIdle = async () => {
6197
6217
  sleepSchedule?.next(Date.now() + SLEEP_EVERY_MS);
6198
- await restarter.retry().catch(() => {
6199
- });
6218
+ await accountLink.retry();
6200
6219
  const minutes = loadConfig()?.sleepIdleAfterMinutes ?? DEFAULT_SLEEP_AFTER_MINUTES;
6201
6220
  if (sleepAfterMs(minutes) === 0)
6202
6221
  return activity.skip("idle-sleep", "Looking for idle Claudes", "turned off (sleepIdleAfterMinutes: 0)");
@@ -6445,7 +6464,7 @@ async function startWebServer(opts = {}) {
6445
6464
  } : {},
6446
6465
  onStatusChanged: (id) => {
6447
6466
  diffStats.invalidate(id);
6448
- restarter.turnEnded(id);
6467
+ accountLink.turnEnded(id);
6449
6468
  timeKeeper?.soon();
6450
6469
  if (jobs) void syncStacksAfter(id);
6451
6470
  const session = findSession2(id);
@@ -6501,7 +6520,7 @@ async function startWebServer(opts = {}) {
6501
6520
  updatesTimer?.unref?.();
6502
6521
  const desktopFile = desktopUpdatePath();
6503
6522
  const onDesktopUpdate = () => broadcast("updates-changed", { ts: Date.now() });
6504
- if (jobs) fs15.watchFile(desktopFile, { interval: 3e3 }, onDesktopUpdate);
6523
+ if (jobs) fs14.watchFile(desktopFile, { interval: 3e3 }, onDesktopUpdate);
6505
6524
  const usageWatcher = wireUsage(app, { broadcast, build: () => buildUsage(realUsageDeps()) });
6506
6525
  app.get("/api/pty-host/health", (c) => c.json(hostHealth(hostBeat())));
6507
6526
  let lastHostState = hostHealth(hostBeat()).state;
@@ -6568,7 +6587,7 @@ async function startWebServer(opts = {}) {
6568
6587
  if (timeFirst) clearTimeout(timeFirst);
6569
6588
  if (timeTimer) clearInterval(timeTimer);
6570
6589
  timeKeeper?.stop();
6571
- fs15.unwatchFile(desktopFile, onDesktopUpdate);
6590
+ fs14.unwatchFile(desktopFile, onDesktopUpdate);
6572
6591
  usageWatcher.stop();
6573
6592
  for (const t of conversationSyncs.values()) clearTimeout(t);
6574
6593
  clearTimeout(sweepTimer);
@@ -6591,8 +6610,41 @@ async function startWebServer(opts = {}) {
6591
6610
  };
6592
6611
  }
6593
6612
 
6613
+ // src/core/agents/account-sync.ts
6614
+ var keyOf = (folders) => [...new Set(folders)].sort().join("\n");
6615
+ function startAccountSync(deps) {
6616
+ let last = keyOf(deps.folders());
6617
+ let running = false;
6618
+ const check = async () => {
6619
+ if (running) return false;
6620
+ let now;
6621
+ try {
6622
+ now = keyOf(deps.folders());
6623
+ } catch (err) {
6624
+ deps.onError?.(err);
6625
+ return false;
6626
+ }
6627
+ if (now === last) return false;
6628
+ running = true;
6629
+ last = now;
6630
+ try {
6631
+ await deps.apply();
6632
+ return true;
6633
+ } catch (err) {
6634
+ deps.onError?.(err);
6635
+ return false;
6636
+ } finally {
6637
+ running = false;
6638
+ }
6639
+ };
6640
+ const every = deps.everyMs ?? 1e4;
6641
+ const timer = every > 0 ? setInterval(() => void check(), every) : null;
6642
+ timer?.unref?.();
6643
+ return { check, stop: () => timer && clearInterval(timer) };
6644
+ }
6645
+
6594
6646
  // src/core/platform/autostart.ts
6595
- import fs16 from "fs";
6647
+ import fs15 from "fs";
6596
6648
  import path16 from "path";
6597
6649
  function startupScriptPath() {
6598
6650
  if (process.platform !== "win32" || !process.env.APPDATA) return null;
@@ -6614,11 +6666,11 @@ function setAutostart(enabled, workBin) {
6614
6666
  const file = startupScriptPath();
6615
6667
  if (!file) throw new Error("Autostart is only supported on Windows so far.");
6616
6668
  if (enabled) {
6617
- fs16.mkdirSync(path16.dirname(file), { recursive: true });
6618
- fs16.writeFileSync(file, buildStartupScript(process.execPath, workBin), "utf-8");
6669
+ fs15.mkdirSync(path16.dirname(file), { recursive: true });
6670
+ fs15.writeFileSync(file, buildStartupScript(process.execPath, workBin), "utf-8");
6619
6671
  } else {
6620
6672
  try {
6621
- fs16.unlinkSync(file);
6673
+ fs15.unlinkSync(file);
6622
6674
  } catch {
6623
6675
  }
6624
6676
  }
@@ -6736,8 +6788,31 @@ function createDemoRepos(liveTargets) {
6736
6788
  };
6737
6789
  }
6738
6790
 
6791
+ // src/server/demo/demo-accounts.ts
6792
+ var DEMO_ACCOUNTS = {
6793
+ accounts: [
6794
+ { name: "default", dir: "~/.claude", isDefault: true, loggedIn: true },
6795
+ { name: "work", dir: "~/.claude-work", isDefault: false, loggedIn: true },
6796
+ { name: "spare", dir: "~/.claude-spare", isDefault: false, loggedIn: false }
6797
+ ],
6798
+ default: "default"
6799
+ };
6800
+ var isDemoAccount = (name) => DEMO_ACCOUNTS.accounts.some((a) => a.name === name);
6801
+ function demoSwitch(session, to) {
6802
+ const refused = switchRefusal(to, {
6803
+ archived: session.archived,
6804
+ accounts: { list: DEMO_ACCOUNTS.accounts, current: session.account ?? "default" },
6805
+ pendingTo: null,
6806
+ // The demo's Claudes are all "in the host": none runs in a terminal outside it.
6807
+ inHost: true,
6808
+ runningOutside: false
6809
+ });
6810
+ if (refused) return { ok: false, ...refused };
6811
+ return { ok: true, body: { ok: true, outcome: "recorded", moved: 0 } };
6812
+ }
6813
+
6739
6814
  // src/server/demo/scenario.ts
6740
- var DEMO_AGENT = { id: "claude", name: "Claude Code", can: { read: true, hooks: true, live: true, answer: true } };
6815
+ var DEMO_AGENT = { id: "claude", name: "Claude Code", can: { read: true, hooks: true, live: true, answer: true, accounts: true } };
6741
6816
  function fileBlocks(diff) {
6742
6817
  return diff ? diff.split(/(?=^diff --git )/m).filter((b) => b.startsWith("diff --git ")) : [];
6743
6818
  }
@@ -7376,6 +7451,7 @@ ${reply}\r
7376
7451
  const stat = this.diffStat(s);
7377
7452
  return {
7378
7453
  agent: DEMO_AGENT,
7454
+ ...s.account && s.account !== "default" ? { account: s.account } : {},
7379
7455
  id: s.id,
7380
7456
  target: s.target,
7381
7457
  branch: s.branch,
@@ -7766,6 +7842,17 @@ ${reply}\r
7766
7842
  this.changed();
7767
7843
  return true;
7768
7844
  }
7845
+ /** Move a session to another account (demo-accounts.ts): just recorded. */
7846
+ switchAccount(id, to) {
7847
+ const s = this.sessions.get(id);
7848
+ if (!s) return null;
7849
+ const r = demoSwitch({ account: s.account, archived: !!s.archivedAt }, to);
7850
+ if (r.ok) {
7851
+ s.account = to === "default" ? void 0 : to;
7852
+ this.changed();
7853
+ }
7854
+ return r;
7855
+ }
7769
7856
  remove(id) {
7770
7857
  const ok = this.sessions.delete(id);
7771
7858
  if (ok) this.changed();
@@ -7853,7 +7940,7 @@ ${reply}\r
7853
7940
  this.changed();
7854
7941
  return true;
7855
7942
  }
7856
- create(target, branch, prompt, baseBranch) {
7943
+ create(target, branch, prompt, baseBranch, account) {
7857
7944
  const project = this.projects();
7858
7945
  const group = project.groups.find((g) => g.name === target);
7859
7946
  const first = prompt?.split("\n")[0];
@@ -7866,6 +7953,7 @@ ${reply}\r
7866
7953
  0
7867
7954
  );
7868
7955
  if (baseBranch) s.baseBranch = baseBranch;
7956
+ if (account && account !== "default") s.account = account;
7869
7957
  this.changed();
7870
7958
  return this.wire(s);
7871
7959
  }
@@ -8137,11 +8225,21 @@ function demoUsage(now = Date.now()) {
8137
8225
  accounts: [
8138
8226
  {
8139
8227
  account: "default",
8228
+ isDefault: true,
8140
8229
  at: new Date(now - 6e4).toISOString(),
8141
8230
  windows: [
8142
8231
  { id: "five_hour", label: "5-hour limit", usedPercent: 42, resetsAt: new Date(now + 2 * 36e5).toISOString() },
8143
8232
  { id: "seven_day", label: "Weekly limit", usedPercent: 18, resetsAt: monday.toISOString() }
8144
8233
  ]
8234
+ },
8235
+ // The second login (demo-accounts.ts): little used this week, read a while ago.
8236
+ {
8237
+ account: "work",
8238
+ at: new Date(now - 3 * 36e5).toISOString(),
8239
+ windows: [
8240
+ { id: "five_hour", label: "5-hour limit", usedPercent: 6, resetsAt: new Date(now + 4 * 36e5).toISOString() },
8241
+ { id: "seven_day", label: "Weekly limit", usedPercent: 3, resetsAt: monday.toISOString() }
8242
+ ]
8145
8243
  }
8146
8244
  ]
8147
8245
  }
@@ -8341,12 +8439,13 @@ function evidenceFor(n) {
8341
8439
  jira: n % 4 === 1 ? [{ key: "WEB-9", summary: TITLES["WEB-9"], what: "moved (now In review)" }] : []
8342
8440
  };
8343
8441
  }
8442
+ var DEMO_DAYS = 31;
8344
8443
  function createDemoTime(now) {
8345
8444
  const edits = /* @__PURE__ */ new Map();
8346
8445
  const record = (day) => {
8347
8446
  const today = localDay(now());
8348
8447
  if (day > today) return null;
8349
- const all = daysBetween(addDays(today, -13), today);
8448
+ const all = daysBetween(addDays(today, -(DEMO_DAYS - 1)), today);
8350
8449
  const n = all.indexOf(day);
8351
8450
  const e = edits.get(day) ?? {};
8352
8451
  if (n < 0 && !e.edited && !e.dayOff) return null;
@@ -8367,6 +8466,12 @@ function createDemoTime(now) {
8367
8466
  SETTINGS,
8368
8467
  daysBetween(from, to).map(record).filter((r) => !!r)
8369
8468
  ),
8469
+ month: (month) => {
8470
+ const today = localDay(now());
8471
+ const r = monthRange(month, today);
8472
+ const records = r ? daysBetween(r.from, r.to).map(record).filter((x) => !!x) : [];
8473
+ return { ...monthWireOf(month, today, SETTINGS, records), gathering: false, gatherError: null, posting: { ready: true, why: null } };
8474
+ },
8370
8475
  day: (day) => ({ ...dayWireOf(day, SETTINGS, record(day)), posting: { ready: true, why: null } }),
8371
8476
  update: (day, change) => {
8372
8477
  edits.set(day, { ...edits.get(day) ?? {}, ...change });
@@ -8612,13 +8717,13 @@ async function startDemoServer(opts) {
8612
8717
  (c) => c.json({
8613
8718
  sessions: scenario.list().filter((w) => c.req.query("archived") === "1" || !w.archivedAt).map((w) => {
8614
8719
  const out = draftsFor(w.id) ? { ...w, replyDrafts: draftsFor(w.id) } : { ...w };
8615
- const z7 = snoozes.get(w.id);
8720
+ const z8 = snoozes.get(w.id);
8616
8721
  const waiting = (blocks.get(w.id) ?? []).filter(
8617
8722
  (b) => b.kind === "pr" || scenario.list().some((x) => x.id === b.sessionId && !x.archivedAt)
8618
8723
  );
8619
8724
  const withBlocks = waiting.length ? { ...out, blockedBy: waiting } : out;
8620
8725
  const noted = notes.has(w.id) ? { ...withBlocks, hasNote: true } : withBlocks;
8621
- return z7 && snoozeActive(z7, noted) ? { ...noted, snoozed: { until: z7.until } } : noted;
8726
+ return z8 && snoozeActive(z8, noted) ? { ...noted, snoozed: { until: z8.until } } : noted;
8622
8727
  })
8623
8728
  })
8624
8729
  );
@@ -8626,13 +8731,13 @@ async function startDemoServer(opts) {
8626
8731
  const body = await json2(c);
8627
8732
  const w = scenario.list().find((x) => x.id === c.req.param("id"));
8628
8733
  if (!w) return notFound(c);
8629
- let z7;
8630
- if (typeof body.until === "string") z7 = snoozeUntil(body.until, new Date(scenario.clockMs()));
8631
- else if (body.for === "2h" || body.for === "tomorrow" || body.for === "change") z7 = snoozeFor(body.for, w);
8734
+ let z8;
8735
+ if (typeof body.until === "string") z8 = snoozeUntil(body.until, new Date(scenario.clockMs()));
8736
+ else if (body.for === "2h" || body.for === "tomorrow" || body.for === "change") z8 = snoozeFor(body.for, w);
8632
8737
  else return c.json({ error: "for: '2h', 'tomorrow' or 'change', or until: a time" }, 400);
8633
- if (!z7) return c.json({ error: "not a time to snooze until: give one in the next 30 days" }, 400);
8634
- snoozes.set(w.id, z7);
8635
- return c.json({ ok: true, snooze: z7 });
8738
+ if (!z8) return c.json({ error: "not a time to snooze until: give one in the next 30 days" }, 400);
8739
+ snoozes.set(w.id, z8);
8740
+ return c.json({ ok: true, snooze: z8 });
8636
8741
  });
8637
8742
  app.delete("/api/sessions/:id/snooze", (c) => {
8638
8743
  snoozes.delete(c.req.param("id"));
@@ -8988,7 +9093,9 @@ async function startDemoServer(opts) {
8988
9093
  if (typeof body.target !== "string" || !body.target) return c.json({ error: "target is required" }, 400);
8989
9094
  const branch = typeof body.branch === "string" && body.branch.trim() ? body.branch.trim() : "main";
8990
9095
  const prompt = typeof body.prompt === "string" && body.prompt.trim() ? body.prompt.trim() : void 0;
8991
- const s = scenario.create(body.target, branch, prompt);
9096
+ const account = typeof body.account === "string" && body.account ? body.account : void 0;
9097
+ if (account !== void 0 && !isDemoAccount(account)) return c.json({ error: `Unknown Claude Code account: ${account}` }, 400);
9098
+ const s = scenario.create(body.target, branch, prompt, void 0, account);
8992
9099
  return c.json({ sessionId: s.id, launchDir: s.paths[0], paths: s.paths, ...prompt ? { started: "started" } : {} });
8993
9100
  });
8994
9101
  const demoTime = createDemoTime(() => scenario.clockMs());
@@ -9023,6 +9130,16 @@ async function startDemoServer(opts) {
9023
9130
  broadcast({ event: "time-graph-changed", data: {} });
9024
9131
  return c.json(graphWire());
9025
9132
  });
9133
+ app.get("/api/time/month/:month", (c) => {
9134
+ const month = c.req.param("month");
9135
+ if (!monthRange(month, localDay(scenario.clockMs()))) return c.json({ error: "month: YYYY-MM, one that has started" }, 400);
9136
+ return c.json(demoTime.month(month));
9137
+ });
9138
+ app.post("/api/time/month/:month/gather", (c) => {
9139
+ const month = c.req.param("month");
9140
+ if (!monthRange(month, localDay(scenario.clockMs()))) return c.json({ error: "month: YYYY-MM, one that has started" }, 400);
9141
+ return c.json(demoTime.month(month), 202);
9142
+ });
9026
9143
  app.get("/api/time/:day", (c) => {
9027
9144
  const day = c.req.param("day");
9028
9145
  if (!isDay(day)) return c.json({ error: "day: YYYY-MM-DD" }, 400);
@@ -9147,6 +9264,18 @@ async function startDemoServer(opts) {
9147
9264
  whatsNew: demoSeen === "2.1.0" ? null : "2.1.0"
9148
9265
  });
9149
9266
  app.get("/api/usage", (c) => c.json(demoUsage()));
9267
+ app.get("/api/accounts", (c) => c.json(DEMO_ACCOUNTS));
9268
+ app.post("/api/sessions/:id/account", async (c) => {
9269
+ const to = (await json2(c)).to;
9270
+ if (typeof to !== "string" || !to) return c.json({ error: "to is required" }, 400);
9271
+ const r = scenario.switchAccount(c.req.param("id"), to);
9272
+ if (!r) return notFound(c);
9273
+ return r.ok ? c.json(r.body) : c.json({ error: r.error }, r.status);
9274
+ });
9275
+ app.delete(
9276
+ "/api/sessions/:id/account",
9277
+ (c) => scenario.sessions.has(c.req.param("id")) ? c.json({ error: "no switch is waiting for its turn" }, 409) : notFound(c)
9278
+ );
9150
9279
  app.get("/api/updates", (c) => c.json(demoUpdates()));
9151
9280
  app.post("/api/updates/check", (c) => c.json(demoUpdates()));
9152
9281
  app.post("/api/updates/restart", (c) => c.json({ error: "No downloaded update to restart into." }, 409));
@@ -9361,6 +9490,18 @@ async function installAgentHooks(lean, onError = () => () => {
9361
9490
  await agent.events.install(lean ? LEAN_HOOKS : FULL_HOOKS, lean ? [] : LEGACY_HOOKS).catch(onError(agent.name));
9362
9491
  }
9363
9492
  }
9493
+ async function reinstallAgentSetup(lean) {
9494
+ await installAgentHooks(lean, (name) => swallow(`install ${name} hooks`));
9495
+ await setupAgentUsage(knownAgents(), loadConfig(), lean);
9496
+ }
9497
+ function startAccountSetupSync(lean, o = {}) {
9498
+ return startAccountSync({
9499
+ folders: () => (o.folders ?? agentAccountFolders)().filter((dir) => fs16.existsSync(dir)),
9500
+ apply: o.apply ?? (() => reinstallAgentSetup(lean)),
9501
+ onError: swallow("set up a changed Claude account"),
9502
+ ...o.everyMs !== void 0 ? { everyMs: o.everyMs } : {}
9503
+ });
9504
+ }
9364
9505
  function removeAgentHooksSync(lean) {
9365
9506
  const ours = (lean ? LEAN_HOOKS : FULL_HOOKS).map(({ owner, edge }) => ({ owner, edge }));
9366
9507
  for (const agent of hookedAgents()) bestEffort(`remove ${agent.name} hooks`, () => agent.events.removeSync([...ours, ...LEGACY_HOOKS]));
@@ -9513,7 +9654,9 @@ var webCommand = {
9513
9654
  }
9514
9655
  await installAgentHooks(lean, (name) => swallow(`install ${name} hooks`));
9515
9656
  await setupAgentUsage(knownAgents(), loadConfig(), lean).catch(swallow("set up the usage readings"));
9657
+ const accountSync = startAccountSetupSync(lean);
9516
9658
  shutdown = () => {
9659
+ accountSync.stop();
9517
9660
  info(chalk.gray("\nStopping work web."));
9518
9661
  clearWebDiscovery(process.pid);
9519
9662
  removeAgentHooksSync(lean);
@@ -9641,8 +9784,10 @@ export {
9641
9784
  LEAN_HOOKS,
9642
9785
  LEGACY_HOOKS,
9643
9786
  installAgentHooks,
9787
+ reinstallAgentSetup,
9644
9788
  removeAgentHooksSync,
9789
+ startAccountSetupSync,
9645
9790
  stopExisting,
9646
9791
  webCommand
9647
9792
  };
9648
- //# sourceMappingURL=web-QXQ4NGCJ.js.map
9793
+ //# sourceMappingURL=web-QCHECDRD.js.map