@moberg_hr/work-tree 2.6.4 → 2.8.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 (286) hide show
  1. package/dist/account-SOJAHTL5.js +245 -0
  2. package/dist/account-SOJAHTL5.js.map +1 -0
  3. package/dist/{add-repo-J2KNR7S3.js → add-repo-B4ITRH4Q.js} +38 -33
  4. package/dist/{add-repo-J2KNR7S3.js.map → add-repo-B4ITRH4Q.js.map} +1 -1
  5. package/dist/{answer-3INUTHDR.js → answer-JHK4SZAH.js} +16 -12
  6. package/dist/{answer-3INUTHDR.js.map → answer-JHK4SZAH.js.map} +1 -1
  7. package/dist/{attach-EQARDJEU.js → attach-3IU7O7YE.js} +19 -15
  8. package/dist/{attach-EQARDJEU.js.map → attach-3IU7O7YE.js.map} +1 -1
  9. package/dist/bin.js +12 -8
  10. package/dist/bin.js.map +1 -1
  11. package/dist/{block-K2RSDPMB.js → block-JTA7ULQS.js} +16 -12
  12. package/dist/{block-K2RSDPMB.js.map → block-JTA7ULQS.js.map} +1 -1
  13. package/dist/{broadcast-NIFOTFCC.js → broadcast-JKPTCLUZ.js} +13 -9
  14. package/dist/{broadcast-NIFOTFCC.js.map → broadcast-JKPTCLUZ.js.map} +1 -1
  15. package/dist/{catchup-OF2EBZCA.js → catchup-MT55LLAS.js} +19 -15
  16. package/dist/{catchup-OF2EBZCA.js.map → catchup-MT55LLAS.js.map} +1 -1
  17. package/dist/{chunk-GTVQYGY3.js → chunk-26MWJLDS.js} +3 -3
  18. package/dist/{chunk-IID3W5PI.js → chunk-27BDXWSY.js} +9 -5
  19. package/dist/{chunk-IID3W5PI.js.map → chunk-27BDXWSY.js.map} +1 -1
  20. package/dist/{chunk-TQKIAQJT.js → chunk-27UC5NXT.js} +20 -16
  21. package/dist/chunk-27UC5NXT.js.map +1 -0
  22. package/dist/{chunk-2FUNUN5C.js → chunk-2MQWAQ2D.js} +8 -8
  23. package/dist/{chunk-G635EV2D.js → chunk-3N3UQEC4.js} +2 -2
  24. package/dist/{chunk-SMZ7W34L.js → chunk-3TN77GOI.js} +9 -4
  25. package/dist/chunk-3TN77GOI.js.map +1 -0
  26. package/dist/{chunk-QLTENN7R.js → chunk-45DVD6HF.js} +17 -13
  27. package/dist/{chunk-QLTENN7R.js.map → chunk-45DVD6HF.js.map} +1 -1
  28. package/dist/chunk-4NITDMDH.js +372 -0
  29. package/dist/chunk-4NITDMDH.js.map +1 -0
  30. package/dist/{chunk-EYUBVLPF.js → chunk-5QGCF3PS.js} +2 -2
  31. package/dist/{chunk-75MIXOUK.js → chunk-6THUVP6T.js} +27 -13
  32. package/dist/chunk-6THUVP6T.js.map +1 -0
  33. package/dist/{chunk-5ZGF2M52.js → chunk-7GGIVYWP.js} +7 -7
  34. package/dist/{chunk-MJNXAAJF.js → chunk-7NVEGPZT.js} +2 -2
  35. package/dist/{chunk-ZGXRWL7T.js → chunk-AU27USPZ.js} +2 -2
  36. package/dist/chunk-BOEAOIQT.js +43 -0
  37. package/dist/chunk-BOEAOIQT.js.map +1 -0
  38. package/dist/{chunk-HNFWIJRZ.js → chunk-BUX66OI7.js} +6 -6
  39. package/dist/{chunk-ZPJ5W2KB.js → chunk-C4T3F3XO.js} +4 -4
  40. package/dist/{chunk-ADGQADDE.js → chunk-CI4EAIMR.js} +23 -17
  41. package/dist/chunk-CI4EAIMR.js.map +1 -0
  42. package/dist/chunk-DJ2X4LKE.js +9 -0
  43. package/dist/{chunk-VESYLAVA.js → chunk-F6M255O5.js} +614 -314
  44. package/dist/chunk-F6M255O5.js.map +1 -0
  45. package/dist/chunk-FDKJFIUU.js +169 -0
  46. package/dist/chunk-FDKJFIUU.js.map +1 -0
  47. package/dist/{chunk-4VVIBQ4P.js → chunk-FMCSF2QB.js} +58 -53
  48. package/dist/chunk-FMCSF2QB.js.map +1 -0
  49. package/dist/{chunk-OUUDQA7O.js → chunk-GNGXYXBC.js} +2 -2
  50. package/dist/{chunk-ZYTZBGBP.js → chunk-HN2QQMMX.js} +22 -22
  51. package/dist/{chunk-MYDQNX7W.js → chunk-ICJPVSRY.js} +2 -2
  52. package/dist/{chunk-5UICLGJK.js → chunk-IRKYLDMX.js} +89 -13
  53. package/dist/chunk-IRKYLDMX.js.map +1 -0
  54. package/dist/{chunk-YIWGKZOZ.js → chunk-IWO4DILT.js} +10 -6
  55. package/dist/{chunk-YIWGKZOZ.js.map → chunk-IWO4DILT.js.map} +1 -1
  56. package/dist/{chunk-MHHVNQB4.js → chunk-IXC7JM35.js} +4 -4
  57. package/dist/{chunk-FBJKFNKX.js → chunk-J2AZIO22.js} +2 -2
  58. package/dist/{chunk-CGVYVTGF.js → chunk-J36ULZBO.js} +2 -2
  59. package/dist/{chunk-FO7B466S.js → chunk-JU5T3JIN.js} +10 -7
  60. package/dist/chunk-JU5T3JIN.js.map +1 -0
  61. package/dist/{chunk-24GXAENC.js → chunk-KH3TRWUV.js} +7 -7
  62. package/dist/chunk-KLY6QDA5.js +135 -0
  63. package/dist/chunk-KLY6QDA5.js.map +1 -0
  64. package/dist/{chunk-4RDAWJZY.js → chunk-KNRGVUW7.js} +3 -3
  65. package/dist/{chunk-TQTMLZFT.js → chunk-LKZSPHAT.js} +2 -2
  66. package/dist/{chunk-XWRVIEFW.js → chunk-LXU24GCM.js} +5 -5
  67. package/dist/{chunk-DAQCIJHW.js → chunk-M6LJ3GE3.js} +76 -10
  68. package/dist/chunk-M6LJ3GE3.js.map +1 -0
  69. package/dist/{chunk-ZM7MVV4D.js → chunk-MJGKE7XZ.js} +36 -17
  70. package/dist/chunk-MJGKE7XZ.js.map +1 -0
  71. package/dist/{chunk-35VLAPL2.js → chunk-MMFXUIQQ.js} +2 -2
  72. package/dist/{chunk-FSNKCSXO.js → chunk-MXA2RZBC.js} +5 -5
  73. package/dist/{chunk-UDRKYWQL.js → chunk-MZTPKKTO.js} +4 -4
  74. package/dist/{chunk-LFH74AIE.js → chunk-NMAJM3C5.js} +3 -3
  75. package/dist/{chunk-U7EQ2O6C.js → chunk-NPCBJV7T.js} +7 -5
  76. package/dist/{chunk-U7EQ2O6C.js.map → chunk-NPCBJV7T.js.map} +1 -1
  77. package/dist/{chunk-376P7NDW.js → chunk-OAVHTRML.js} +6 -4
  78. package/dist/{chunk-376P7NDW.js.map → chunk-OAVHTRML.js.map} +1 -1
  79. package/dist/{chunk-CRPV5YCC.js → chunk-OMIMK3LB.js} +2 -2
  80. package/dist/chunk-P2HOLCBF.js +34 -0
  81. package/dist/chunk-P2HOLCBF.js.map +1 -0
  82. package/dist/{chunk-56P7G2DI.js → chunk-P4EQWC5W.js} +2 -2
  83. package/dist/{chunk-MSZQUJZZ.js → chunk-QLAVWIDJ.js} +45 -28
  84. package/dist/chunk-QLAVWIDJ.js.map +1 -0
  85. package/dist/chunk-RCGFHJM7.js +81 -0
  86. package/dist/chunk-RCGFHJM7.js.map +1 -0
  87. package/dist/{chunk-EUAJT7FS.js → chunk-RGUSVBGN.js} +2 -2
  88. package/dist/{chunk-ZO6MZNLI.js → chunk-S3BAD4IR.js} +2 -2
  89. package/dist/{chunk-BDIAIO3H.js → chunk-SDQI3QB3.js} +3 -3
  90. package/dist/{chunk-Z3NQJALE.js → chunk-SG5LUMGE.js} +3 -3
  91. package/dist/chunk-UBOKRHNV.js +134 -0
  92. package/dist/chunk-UBOKRHNV.js.map +1 -0
  93. package/dist/chunk-UESDYZG3.js +442 -0
  94. package/dist/chunk-UESDYZG3.js.map +1 -0
  95. package/dist/{chunk-XEPH5FCH.js → chunk-WTF4CYHH.js} +7 -7
  96. package/dist/{chunk-TJFX5BWH.js → chunk-X4AXKO3A.js} +2 -2
  97. package/dist/{chunk-RYEPQLXQ.js → chunk-XNLQSW6J.js} +23 -115
  98. package/dist/chunk-XNLQSW6J.js.map +1 -0
  99. package/dist/{chunk-OUWKEJEC.js → chunk-YEXW2OCN.js} +11 -34
  100. package/dist/chunk-YEXW2OCN.js.map +1 -0
  101. package/dist/{chunk-2X5TDKGV.js → chunk-YKMURNKL.js} +11 -43
  102. package/dist/chunk-YKMURNKL.js.map +1 -0
  103. package/dist/{chunk-JSSQ3P73.js → chunk-YRW4YF4U.js} +60 -10
  104. package/dist/chunk-YRW4YF4U.js.map +1 -0
  105. package/dist/{chunk-JF72AS6T.js → chunk-YYBXQBW2.js} +3 -3
  106. package/dist/{chunk-TNU4PRE6.js → chunk-YZPP6354.js} +5 -5
  107. package/dist/chunk-ZDMJPEBO.js +31 -0
  108. package/dist/chunk-ZDMJPEBO.js.map +1 -0
  109. package/dist/chunk-ZXHMC7UO.js +106 -0
  110. package/dist/chunk-ZXHMC7UO.js.map +1 -0
  111. package/dist/{cleanup-JYKSRN2G.js → cleanup-PNTCVB2S.js} +33 -28
  112. package/dist/{cleanup-JYKSRN2G.js.map → cleanup-PNTCVB2S.js.map} +1 -1
  113. package/dist/cli-OYO6OXNK.js +19 -0
  114. package/dist/command-hook-installer-7Q7UD7AU.js +98 -0
  115. package/dist/command-hook-installer-7Q7UD7AU.js.map +1 -0
  116. package/dist/{config-AABHS4J2.js → config-VILJYT6P.js} +20 -15
  117. package/dist/{config-AABHS4J2.js.map → config-VILJYT6P.js.map} +1 -1
  118. package/dist/{diff-NLYS5TIG.js → diff-J6VRJYKR.js} +18 -14
  119. package/dist/{diff-NLYS5TIG.js.map → diff-J6VRJYKR.js.map} +1 -1
  120. package/dist/{digest-SSY2TNMB.js → digest-GMJLCYTF.js} +15 -11
  121. package/dist/{digest-SSY2TNMB.js.map → digest-GMJLCYTF.js.map} +1 -1
  122. package/dist/{fork-KDMSZB5E.js → fork-NNHH2BXV.js} +35 -31
  123. package/dist/{fork-KDMSZB5E.js.map → fork-NNHH2BXV.js.map} +1 -1
  124. package/dist/{history-6KGCW2WA.js → history-52MGO5V5.js} +14 -8
  125. package/dist/{hook-5YZBX64G.js → hook-SWX7NXJN.js} +22 -20
  126. package/dist/{hook-5YZBX64G.js.map → hook-SWX7NXJN.js.map} +1 -1
  127. package/dist/{hydrate-FL2BCC7M.js → hydrate-F5XVXZ2T.js} +14 -10
  128. package/dist/{hydrate-FL2BCC7M.js.map → hydrate-F5XVXZ2T.js.map} +1 -1
  129. package/dist/{init-5RZXYR7N.js → init-MRGRQWQM.js} +15 -11
  130. package/dist/{init-5RZXYR7N.js.map → init-MRGRQWQM.js.map} +1 -1
  131. package/dist/install-skills-QTWYVAOZ.js +20 -0
  132. package/dist/install-skills-bin.js +9 -3
  133. package/dist/install-skills-bin.js.map +1 -1
  134. package/dist/{list-7QPCYMVP.js → list-5MMNVGNN.js} +14 -10
  135. package/dist/{list-7QPCYMVP.js.map → list-5MMNVGNN.js.map} +1 -1
  136. package/dist/{move-QTLHMYRT.js → move-DUYNTJP2.js} +47 -22
  137. package/dist/move-DUYNTJP2.js.map +1 -0
  138. package/dist/{note-QE3VB77M.js → note-SZCVRH4D.js} +16 -12
  139. package/dist/{note-QE3VB77M.js.map → note-SZCVRH4D.js.map} +1 -1
  140. package/dist/{overlaps-6QOJU37M.js → overlaps-QANRNFZC.js} +14 -10
  141. package/dist/{overlaps-6QOJU37M.js.map → overlaps-QANRNFZC.js.map} +1 -1
  142. package/dist/{pin-LS3I7W3V.js → pin-UZGC26LU.js} +16 -12
  143. package/dist/{pin-LS3I7W3V.js.map → pin-UZGC26LU.js.map} +1 -1
  144. package/dist/{pr-ARGKUTRB.js → pr-EKNBGR6X.js} +20 -16
  145. package/dist/{pr-ARGKUTRB.js.map → pr-EKNBGR6X.js.map} +1 -1
  146. package/dist/{prune-OAWQZHHQ.js → prune-AOR4R3CT.js} +31 -27
  147. package/dist/{prune-OAWQZHHQ.js.map → prune-AOR4R3CT.js.map} +1 -1
  148. package/dist/{pty-host-DVHFTOIW.js → pty-host-LYE546KI.js} +145 -39
  149. package/dist/pty-host-LYE546KI.js.map +1 -0
  150. package/dist/{read-QSUCR7Q2.js → read-APEM6NPD.js} +15 -11
  151. package/dist/{read-QSUCR7Q2.js.map → read-APEM6NPD.js.map} +1 -1
  152. package/dist/{recent-YQTDHLRE.js → recent-N7JQCDRG.js} +23 -12
  153. package/dist/recent-N7JQCDRG.js.map +1 -0
  154. package/dist/{remove-I3RJIOVP.js → remove-QM5CRMEG.js} +30 -26
  155. package/dist/{remove-I3RJIOVP.js.map → remove-QM5CRMEG.js.map} +1 -1
  156. package/dist/{report-JEG2FKOB.js → report-J7TUQRJS.js} +3 -4
  157. package/dist/{restart-UDXVORL2.js → restart-O6DYGEMN.js} +16 -12
  158. package/dist/{restart-UDXVORL2.js.map → restart-O6DYGEMN.js.map} +1 -1
  159. package/dist/{resume-LMOST4UO.js → resume-P5DQOZ2R.js} +17 -12
  160. package/dist/resume-P5DQOZ2R.js.map +1 -0
  161. package/dist/{run-LS4SS4D7.js → run-PSGYELSP.js} +12 -8
  162. package/dist/{run-LS4SS4D7.js.map → run-PSGYELSP.js.map} +1 -1
  163. package/dist/{screen-QTVQDNZM.js → screen-EBITKGXW.js} +16 -12
  164. package/dist/{screen-QTVQDNZM.js.map → screen-EBITKGXW.js.map} +1 -1
  165. package/dist/{search-CJA7VHRD.js → search-MM35D6P4.js} +12 -8
  166. package/dist/{search-CJA7VHRD.js.map → search-MM35D6P4.js.map} +1 -1
  167. package/dist/{section-NOTTKMKJ.js → section-6C6N7KKF.js} +16 -12
  168. package/dist/{section-NOTTKMKJ.js.map → section-6C6N7KKF.js.map} +1 -1
  169. package/dist/{send-O3YA6SGT.js → send-ASTESOMV.js} +23 -19
  170. package/dist/{send-O3YA6SGT.js.map → send-ASTESOMV.js.map} +1 -1
  171. package/dist/{sessions-C3IUXV5G.js → sessions-JTZF776H.js} +25 -21
  172. package/dist/{sessions-C3IUXV5G.js.map → sessions-JTZF776H.js.map} +1 -1
  173. package/dist/{snooze-2RSHIHKF.js → snooze-M2IOYZSD.js} +15 -11
  174. package/dist/{snooze-2RSHIHKF.js.map → snooze-M2IOYZSD.js.map} +1 -1
  175. package/dist/{start-RWRNHJQ4.js → start-HIBG7DYS.js} +16 -12
  176. package/dist/{start-RWRNHJQ4.js.map → start-HIBG7DYS.js.map} +1 -1
  177. package/dist/{state-2J4TR7IC.js → state-DC73V5TS.js} +6 -5
  178. package/dist/{state-2J4TR7IC.js.map → state-DC73V5TS.js.map} +1 -1
  179. package/dist/{status-RI6OCK7U.js → status-JSM6FETL.js} +13 -9
  180. package/dist/{status-RI6OCK7U.js.map → status-JSM6FETL.js.map} +1 -1
  181. package/dist/statusline-A2DTGLK5.js +105 -0
  182. package/dist/statusline-A2DTGLK5.js.map +1 -0
  183. package/dist/statusline-hook-OVWHHFBV.js +63 -0
  184. package/dist/statusline-hook-OVWHHFBV.js.map +1 -0
  185. package/dist/{stop-2SCT3PEV.js → stop-IEMNFVGW.js} +16 -12
  186. package/dist/{stop-2SCT3PEV.js.map → stop-IEMNFVGW.js.map} +1 -1
  187. package/dist/{sync-VFFDCH4N.js → sync-FP4J5ODY.js} +31 -27
  188. package/dist/{sync-VFFDCH4N.js.map → sync-FP4J5ODY.js.map} +1 -1
  189. package/dist/{time-ADXHL6QP.js → time-QHLGCYPZ.js} +17 -13
  190. package/dist/{time-ADXHL6QP.js.map → time-QHLGCYPZ.js.map} +1 -1
  191. package/dist/time-actions-4YP5DZKQ.js +16 -0
  192. package/dist/{timesheet-RCFXIWRZ.js → timesheet-LSUOCD6V.js} +19 -15
  193. package/dist/{timesheet-RCFXIWRZ.js.map → timesheet-LSUOCD6V.js.map} +1 -1
  194. package/dist/{todo-FXPXLXXW.js → todo-4VTGOCKH.js} +7 -6
  195. package/dist/{todo-FXPXLXXW.js.map → todo-4VTGOCKH.js.map} +1 -1
  196. package/dist/{tree-EYDQUMZY.js → tree-VTQRBC7I.js} +42 -30
  197. package/dist/tree-VTQRBC7I.js.map +1 -0
  198. package/dist/{update-OVZRE7IN.js → update-VL67LR6U.js} +18 -14
  199. package/dist/{update-OVZRE7IN.js.map → update-VL67LR6U.js.map} +1 -1
  200. package/dist/usage-EMZVZZEQ.js +84 -0
  201. package/dist/usage-EMZVZZEQ.js.map +1 -0
  202. package/dist/{wait-VSDT3KFB.js → wait-HQTY7OW5.js} +16 -12
  203. package/dist/{wait-VSDT3KFB.js.map → wait-HQTY7OW5.js.map} +1 -1
  204. package/dist/wd-bin.js +10 -9
  205. package/dist/wd-bin.js.map +1 -1
  206. package/dist/web/assets/{PtyView-Cl0maIsn.js → PtyView-BMRi1NT9.js} +2 -2
  207. package/dist/web/assets/{PtyView-Cl0maIsn.js.map → PtyView-BMRi1NT9.js.map} +1 -1
  208. package/dist/web/assets/index-BCCeJjez.css +1 -0
  209. package/dist/web/assets/index-By_qebb-.js +119 -0
  210. package/dist/web/assets/index-By_qebb-.js.map +1 -0
  211. package/dist/web/index.html +2 -2
  212. package/dist/{web-ZW37IV76.js → web-6QSSPH4I.js} +601 -385
  213. package/dist/web-6QSSPH4I.js.map +1 -0
  214. package/npm-shrinkwrap.json +2 -2
  215. package/package.json +1 -1
  216. package/dist/chunk-2X5TDKGV.js.map +0 -1
  217. package/dist/chunk-4VVIBQ4P.js.map +0 -1
  218. package/dist/chunk-5UICLGJK.js.map +0 -1
  219. package/dist/chunk-75MIXOUK.js.map +0 -1
  220. package/dist/chunk-ADGQADDE.js.map +0 -1
  221. package/dist/chunk-DAQCIJHW.js.map +0 -1
  222. package/dist/chunk-FO7B466S.js.map +0 -1
  223. package/dist/chunk-GQVV3EMN.js +0 -9
  224. package/dist/chunk-JSSQ3P73.js.map +0 -1
  225. package/dist/chunk-MSZQUJZZ.js.map +0 -1
  226. package/dist/chunk-OUWKEJEC.js.map +0 -1
  227. package/dist/chunk-RYEPQLXQ.js.map +0 -1
  228. package/dist/chunk-SMZ7W34L.js.map +0 -1
  229. package/dist/chunk-TQKIAQJT.js.map +0 -1
  230. package/dist/chunk-TUFQJXXO.js +0 -19
  231. package/dist/chunk-TUFQJXXO.js.map +0 -1
  232. package/dist/chunk-VESYLAVA.js.map +0 -1
  233. package/dist/chunk-ZM7MVV4D.js.map +0 -1
  234. package/dist/cli-OTCENNUJ.js +0 -18
  235. package/dist/command-hook-installer-W7IEVT6V.js +0 -204
  236. package/dist/command-hook-installer-W7IEVT6V.js.map +0 -1
  237. package/dist/install-skills-TFP6EHI3.js +0 -14
  238. package/dist/move-QTLHMYRT.js.map +0 -1
  239. package/dist/pty-host-DVHFTOIW.js.map +0 -1
  240. package/dist/recent-YQTDHLRE.js.map +0 -1
  241. package/dist/resume-LMOST4UO.js.map +0 -1
  242. package/dist/time-actions-LMJUFDDR.js +0 -15
  243. package/dist/tree-EYDQUMZY.js.map +0 -1
  244. package/dist/web/assets/index-DywhirOd.css +0 -1
  245. package/dist/web/assets/index-mP4gis5R.js +0 -119
  246. package/dist/web/assets/index-mP4gis5R.js.map +0 -1
  247. package/dist/web-ZW37IV76.js.map +0 -1
  248. /package/dist/{chunk-GTVQYGY3.js.map → chunk-26MWJLDS.js.map} +0 -0
  249. /package/dist/{chunk-2FUNUN5C.js.map → chunk-2MQWAQ2D.js.map} +0 -0
  250. /package/dist/{chunk-G635EV2D.js.map → chunk-3N3UQEC4.js.map} +0 -0
  251. /package/dist/{chunk-EYUBVLPF.js.map → chunk-5QGCF3PS.js.map} +0 -0
  252. /package/dist/{chunk-5ZGF2M52.js.map → chunk-7GGIVYWP.js.map} +0 -0
  253. /package/dist/{chunk-MJNXAAJF.js.map → chunk-7NVEGPZT.js.map} +0 -0
  254. /package/dist/{chunk-ZGXRWL7T.js.map → chunk-AU27USPZ.js.map} +0 -0
  255. /package/dist/{chunk-HNFWIJRZ.js.map → chunk-BUX66OI7.js.map} +0 -0
  256. /package/dist/{chunk-ZPJ5W2KB.js.map → chunk-C4T3F3XO.js.map} +0 -0
  257. /package/dist/{chunk-GQVV3EMN.js.map → chunk-DJ2X4LKE.js.map} +0 -0
  258. /package/dist/{chunk-OUUDQA7O.js.map → chunk-GNGXYXBC.js.map} +0 -0
  259. /package/dist/{chunk-ZYTZBGBP.js.map → chunk-HN2QQMMX.js.map} +0 -0
  260. /package/dist/{chunk-MYDQNX7W.js.map → chunk-ICJPVSRY.js.map} +0 -0
  261. /package/dist/{chunk-MHHVNQB4.js.map → chunk-IXC7JM35.js.map} +0 -0
  262. /package/dist/{chunk-FBJKFNKX.js.map → chunk-J2AZIO22.js.map} +0 -0
  263. /package/dist/{chunk-CGVYVTGF.js.map → chunk-J36ULZBO.js.map} +0 -0
  264. /package/dist/{chunk-24GXAENC.js.map → chunk-KH3TRWUV.js.map} +0 -0
  265. /package/dist/{chunk-4RDAWJZY.js.map → chunk-KNRGVUW7.js.map} +0 -0
  266. /package/dist/{chunk-TQTMLZFT.js.map → chunk-LKZSPHAT.js.map} +0 -0
  267. /package/dist/{chunk-XWRVIEFW.js.map → chunk-LXU24GCM.js.map} +0 -0
  268. /package/dist/{chunk-35VLAPL2.js.map → chunk-MMFXUIQQ.js.map} +0 -0
  269. /package/dist/{chunk-FSNKCSXO.js.map → chunk-MXA2RZBC.js.map} +0 -0
  270. /package/dist/{chunk-UDRKYWQL.js.map → chunk-MZTPKKTO.js.map} +0 -0
  271. /package/dist/{chunk-LFH74AIE.js.map → chunk-NMAJM3C5.js.map} +0 -0
  272. /package/dist/{chunk-CRPV5YCC.js.map → chunk-OMIMK3LB.js.map} +0 -0
  273. /package/dist/{chunk-56P7G2DI.js.map → chunk-P4EQWC5W.js.map} +0 -0
  274. /package/dist/{chunk-EUAJT7FS.js.map → chunk-RGUSVBGN.js.map} +0 -0
  275. /package/dist/{chunk-ZO6MZNLI.js.map → chunk-S3BAD4IR.js.map} +0 -0
  276. /package/dist/{chunk-BDIAIO3H.js.map → chunk-SDQI3QB3.js.map} +0 -0
  277. /package/dist/{chunk-Z3NQJALE.js.map → chunk-SG5LUMGE.js.map} +0 -0
  278. /package/dist/{chunk-XEPH5FCH.js.map → chunk-WTF4CYHH.js.map} +0 -0
  279. /package/dist/{chunk-TJFX5BWH.js.map → chunk-X4AXKO3A.js.map} +0 -0
  280. /package/dist/{chunk-JF72AS6T.js.map → chunk-YYBXQBW2.js.map} +0 -0
  281. /package/dist/{chunk-TNU4PRE6.js.map → chunk-YZPP6354.js.map} +0 -0
  282. /package/dist/{cli-OTCENNUJ.js.map → cli-OYO6OXNK.js.map} +0 -0
  283. /package/dist/{history-6KGCW2WA.js.map → history-52MGO5V5.js.map} +0 -0
  284. /package/dist/{install-skills-TFP6EHI3.js.map → install-skills-QTWYVAOZ.js.map} +0 -0
  285. /package/dist/{report-JEG2FKOB.js.map → report-J7TUQRJS.js.map} +0 -0
  286. /package/dist/{time-actions-LMJUFDDR.js.map → time-actions-4YP5DZKQ.js.map} +0 -0
@@ -1,8 +1,27 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- ensureAgentPath,
4
- findOnPath
5
- } from "./chunk-OUWKEJEC.js";
3
+ commentInputSchema,
4
+ detectParentBranch,
5
+ launch,
6
+ readContextLines,
7
+ refuseReason,
8
+ resolveRepoDiff,
9
+ resolveSchema,
10
+ resolveWebRoot,
11
+ serveSpa,
12
+ sessionBaseForPath,
13
+ submitReviewSchema
14
+ } from "./chunk-MXA2RZBC.js";
15
+ import {
16
+ ensureAgentPath
17
+ } from "./chunk-YEXW2OCN.js";
18
+ import {
19
+ createBuildFoldersJob,
20
+ defaultBranchTidyDeps,
21
+ defaultBuildFoldersDeps,
22
+ deleteMergedBranches,
23
+ findMergedBranches
24
+ } from "./chunk-YKMURNKL.js";
6
25
  import {
7
26
  defaultTimeDeps,
8
27
  fetchIssueDetail,
@@ -15,7 +34,10 @@ import {
15
34
  graphProblem,
16
35
  signOutGraph,
17
36
  startDeviceLogin
18
- } from "./chunk-QLTENN7R.js";
37
+ } from "./chunk-45DVD6HF.js";
38
+ import {
39
+ defaultCleanupDeps
40
+ } from "./chunk-2MQWAQ2D.js";
19
41
  import {
20
42
  addTask,
21
43
  completeTask,
@@ -23,20 +45,7 @@ import {
23
45
  getTasks,
24
46
  removeTask,
25
47
  uncompleteTask
26
- } from "./chunk-CRPV5YCC.js";
27
- import {
28
- commentInputSchema,
29
- detectParentBranch,
30
- launch,
31
- readContextLines,
32
- refuseReason,
33
- resolveRepoDiff,
34
- resolveSchema,
35
- resolveWebRoot,
36
- serveSpa,
37
- sessionBaseForPath,
38
- submitReviewSchema
39
- } from "./chunk-FSNKCSXO.js";
48
+ } from "./chunk-OMIMK3LB.js";
40
49
  import {
41
50
  announceChange,
42
51
  createArchivedRows,
@@ -51,34 +60,58 @@ import {
51
60
  stageSeenKey,
52
61
  storeHolding,
53
62
  withRestoring
54
- } from "./chunk-TQKIAQJT.js";
63
+ } from "./chunk-27UC5NXT.js";
64
+ import {
65
+ DiffStatCache,
66
+ findOverlaps,
67
+ wantsDiffStat
68
+ } from "./chunk-J2AZIO22.js";
55
69
  import {
56
70
  createDigestSource
57
- } from "./chunk-XEPH5FCH.js";
71
+ } from "./chunk-WTF4CYHH.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-UESDYZG3.js";
84
+ import "./chunk-ZDMJPEBO.js";
58
85
  import {
59
86
  agentsBySession,
60
- createBuildFoldersJob,
61
- defaultBranchTidyDeps,
62
- defaultBuildFoldersDeps,
63
- deleteMergedBranches,
64
- findMergedBranches,
65
87
  summarizeAgents
66
- } from "./chunk-2X5TDKGV.js";
67
- import {
68
- defaultCleanupDeps
69
- } from "./chunk-2FUNUN5C.js";
70
- import {
71
- DiffStatCache,
72
- findOverlaps,
73
- wantsDiffStat
74
- } from "./chunk-FBJKFNKX.js";
88
+ } from "./chunk-BOEAOIQT.js";
89
+ import "./chunk-TNJF7T33.js";
75
90
  import {
76
- LATER_TEXT,
77
- restartCountsText
78
- } from "./chunk-TNJF7T33.js";
91
+ buildUsage,
92
+ realUsageDeps,
93
+ setupAgentUsage
94
+ } from "./chunk-KLY6QDA5.js";
95
+ import "./chunk-P2HOLCBF.js";
79
96
  import {
80
97
  sendToSession
81
98
  } from "./chunk-RYNBBSLY.js";
99
+ import {
100
+ BehindCache,
101
+ behindMain,
102
+ mergedParent,
103
+ moveOntoMain,
104
+ parentTipFor,
105
+ retargetBlocker,
106
+ retargetIsClean,
107
+ retargetOntoMain,
108
+ sessionStacks,
109
+ stackChildCounts,
110
+ stackParents,
111
+ stackedOn,
112
+ updateFromBase,
113
+ updateFromMain
114
+ } from "./chunk-LXU24GCM.js";
82
115
  import {
83
116
  applyPlacePatch,
84
117
  applySectionOp,
@@ -87,13 +120,13 @@ import {
87
120
  cleanSectionOp,
88
121
  placeSession,
89
122
  readRailLayout
90
- } from "./chunk-ZO6MZNLI.js";
123
+ } from "./chunk-S3BAD4IR.js";
91
124
  import {
92
125
  MAX_NOTE_CHARS,
93
126
  readNote,
94
127
  saveNote,
95
128
  sessionsWithNotes
96
- } from "./chunk-OUUDQA7O.js";
129
+ } from "./chunk-GNGXYXBC.js";
97
130
  import {
98
131
  addBlocker,
99
132
  allBlocks,
@@ -104,21 +137,40 @@ import {
104
137
  removeBlocker,
105
138
  sweepBlocks,
106
139
  unblockedPrompt
107
- } from "./chunk-BDIAIO3H.js";
140
+ } from "./chunk-SDQI3QB3.js";
108
141
  import {
109
142
  jiraWorklogPoster,
110
143
  logWorkDay,
111
144
  loggedDays,
112
145
  worklogSettings
113
- } from "./chunk-56P7G2DI.js";
146
+ } from "./chunk-P4EQWC5W.js";
114
147
  import {
115
148
  sessionWorkTime
116
- } from "./chunk-JSSQ3P73.js";
149
+ } from "./chunk-YRW4YF4U.js";
150
+ import {
151
+ DEFAULT_CATCH_UP_DAYS,
152
+ addDays,
153
+ buildDay,
154
+ dayChange,
155
+ dayWire,
156
+ dayWireOf,
157
+ daysBetween,
158
+ daysWire,
159
+ daysWireOf,
160
+ isDay,
161
+ localDay,
162
+ postStoredDay,
163
+ readDays,
164
+ tempoClient,
165
+ tempoSetup,
166
+ timeRange,
167
+ updateDay
168
+ } from "./chunk-26MWJLDS.js";
117
169
  import {
118
170
  checkTools,
119
171
  saveFolders,
120
172
  setupState
121
- } from "./chunk-YIWGKZOZ.js";
173
+ } from "./chunk-IWO4DILT.js";
122
174
  import {
123
175
  RepoAdminError,
124
176
  deleteGroup,
@@ -128,7 +180,7 @@ import {
128
180
  saveGroup,
129
181
  setRepoIgnored,
130
182
  setScanRoot
131
- } from "./chunk-IID3W5PI.js";
183
+ } from "./chunk-27BDXWSY.js";
132
184
  import {
133
185
  freeLeftovers,
134
186
  leftoversOf,
@@ -136,20 +188,16 @@ import {
136
188
  openInLeftovers,
137
189
  parsePrRef,
138
190
  resolvePrToStart
139
- } from "./chunk-MYDQNX7W.js";
191
+ } from "./chunk-ICJPVSRY.js";
140
192
  import {
141
193
  editorArgs,
142
194
  openUrl
143
- } from "./chunk-SMZ7W34L.js";
195
+ } from "./chunk-3TN77GOI.js";
144
196
  import {
145
197
  archiveMergedSession,
146
198
  archiveWaiting,
147
199
  defaultArchiveDeps
148
- } from "./chunk-ZYTZBGBP.js";
149
- import {
150
- cleanupVerdict,
151
- createCleanupJob
152
- } from "./chunk-AKMPF72Y.js";
200
+ } from "./chunk-HN2QQMMX.js";
153
201
  import {
154
202
  MAX_REPLY_CHARS,
155
203
  THREAD_ID,
@@ -164,11 +212,19 @@ import {
164
212
  rememberSent,
165
213
  retireResolvedReplies,
166
214
  sessionRepoRefs
167
- } from "./chunk-TNU4PRE6.js";
215
+ } from "./chunk-YZPP6354.js";
216
+ import {
217
+ cleanupVerdict,
218
+ createCleanupJob
219
+ } from "./chunk-AKMPF72Y.js";
220
+ import {
221
+ sessionStatusView,
222
+ shownState
223
+ } from "./chunk-BUX66OI7.js";
168
224
  import {
169
225
  listProcesses,
170
226
  runningFromNames
171
- } from "./chunk-Z3NQJALE.js";
227
+ } from "./chunk-SG5LUMGE.js";
172
228
  import {
173
229
  fetchAllPullRequests
174
230
  } from "./chunk-VTLDYH3C.js";
@@ -181,7 +237,14 @@ import {
181
237
  defaultForkDeps,
182
238
  forkSession,
183
239
  startSessionWithPrompt
184
- } from "./chunk-ADGQADDE.js";
240
+ } from "./chunk-CI4EAIMR.js";
241
+ import {
242
+ askCatchUp,
243
+ cachedCatchUp,
244
+ catchUp,
245
+ catchUpFacts,
246
+ forgetCatchUp
247
+ } from "./chunk-7GGIVYWP.js";
185
248
  import {
186
249
  childText,
187
250
  createInChild,
@@ -189,10 +252,20 @@ import {
189
252
  keyedQueue,
190
253
  oneAtATime,
191
254
  runWorkChild
192
- } from "./chunk-FO7B466S.js";
255
+ } from "./chunk-JU5T3JIN.js";
193
256
  import {
194
257
  resolveWorkBinPath
195
258
  } from "./chunk-AH5TM3NB.js";
259
+ import {
260
+ runInternal,
261
+ summarizeCheckpoint,
262
+ throttleTrailing
263
+ } from "./chunk-NPCBJV7T.js";
264
+ import {
265
+ computeDiff,
266
+ computeRangeDiff,
267
+ parseGitDiff
268
+ } from "./chunk-IXC7JM35.js";
196
269
  import {
197
270
  configurePtyPool,
198
271
  detachPtyPool,
@@ -217,110 +290,22 @@ import {
217
290
  subscribeSession,
218
291
  syncPtyPool,
219
292
  writeToPty
220
- } from "./chunk-5UICLGJK.js";
293
+ } from "./chunk-IRKYLDMX.js";
221
294
  import {
222
295
  dbPtySessions
223
- } from "./chunk-4RDAWJZY.js";
224
- import "./chunk-DAQCIJHW.js";
225
- import {
226
- addRepoRefusal,
227
- addedRepoNote
228
- } from "./chunk-TQTMLZFT.js";
229
- import {
230
- teardownWorktree,
231
- toBaseSpec,
232
- wouldRefuseRemoval
233
- } from "./chunk-ZM7MVV4D.js";
234
- import "./chunk-EUAJT7FS.js";
235
- import {
236
- isWorktreeFolder
237
- } from "./chunk-KUCMJHQW.js";
238
- import "./chunk-PSUJZUYX.js";
239
- import "./chunk-5WM24P5N.js";
240
- import {
241
- BehindCache,
242
- behindMain,
243
- mergedParent,
244
- moveOntoMain,
245
- parentTipFor,
246
- retargetBlocker,
247
- retargetIsClean,
248
- retargetOntoMain,
249
- sessionStacks,
250
- stackChildCounts,
251
- stackParents,
252
- stackedOn,
253
- updateFromBase,
254
- updateFromMain
255
- } from "./chunk-XWRVIEFW.js";
256
- import {
257
- sessionStatusView,
258
- shownState
259
- } from "./chunk-HNFWIJRZ.js";
260
- import {
261
- defaultRunner,
262
- mergeSelected,
263
- runShipAction,
264
- shipPreflight
265
- } from "./chunk-3GIH4WTA.js";
266
- import {
267
- askCatchUp,
268
- cachedCatchUp,
269
- catchUp,
270
- catchUpFacts,
271
- forgetCatchUp
272
- } from "./chunk-5ZGF2M52.js";
273
- import {
274
- runInternal,
275
- summarizeCheckpoint,
276
- throttleTrailing
277
- } from "./chunk-U7EQ2O6C.js";
278
- import {
279
- computeDiff,
280
- computeRangeDiff,
281
- parseGitDiff
282
- } from "./chunk-MHHVNQB4.js";
283
- import {
284
- packageRoot
285
- } from "./chunk-LNHSBM4L.js";
286
- import {
287
- VERSION
288
- } from "./chunk-GQVV3EMN.js";
289
- import {
290
- resolveProjectTarget
291
- } from "./chunk-CGVYVTGF.js";
292
- import {
293
- git
294
- } from "./chunk-G635EV2D.js";
295
- import {
296
- DEFAULT_CATCH_UP_DAYS,
297
- addDays,
298
- buildDay,
299
- dayChange,
300
- dayWire,
301
- dayWireOf,
302
- daysBetween,
303
- daysWire,
304
- daysWireOf,
305
- isDay,
306
- localDay,
307
- postStoredDay,
308
- readDays,
309
- tempoClient,
310
- tempoSetup,
311
- timeRange,
312
- updateDay
313
- } from "./chunk-GTVQYGY3.js";
314
- import {
315
- isOwnCheckout
316
- } from "./chunk-TUFQJXXO.js";
296
+ } from "./chunk-KNRGVUW7.js";
297
+ import "./chunk-M6LJ3GE3.js";
317
298
  import {
318
299
  ASSISTANT_ID,
319
300
  CONTEXT_WARN,
320
301
  assistantDir,
321
302
  describeView,
322
303
  writeAssistantContext
323
- } from "./chunk-376P7NDW.js";
304
+ } from "./chunk-OAVHTRML.js";
305
+ import {
306
+ addRepoRefusal,
307
+ addedRepoNote
308
+ } from "./chunk-LKZSPHAT.js";
324
309
  import {
325
310
  clearDevWebDiscovery,
326
311
  clearWebDiscovery,
@@ -332,20 +317,49 @@ import {
332
317
  readWebUrl,
333
318
  writeDevWebDiscovery,
334
319
  writeWebDiscovery
335
- } from "./chunk-TJFX5BWH.js";
320
+ } from "./chunk-X4AXKO3A.js";
336
321
  import {
337
322
  NOTE_NUDGE,
338
323
  findSessionForCwd,
339
324
  readPendingForSession,
340
325
  readPendingForWorktree
341
- } from "./chunk-24GXAENC.js";
326
+ } from "./chunk-KH3TRWUV.js";
327
+ import "./chunk-ZSHWP2VS.js";
342
328
  import {
343
329
  getCommentFileStore
344
- } from "./chunk-EYUBVLPF.js";
345
- import "./chunk-ZSHWP2VS.js";
330
+ } from "./chunk-5QGCF3PS.js";
346
331
  import {
347
332
  createCommentStore
348
333
  } from "./chunk-HUXS3VAI.js";
334
+ import {
335
+ teardownWorktree,
336
+ toBaseSpec,
337
+ wouldRefuseRemoval
338
+ } from "./chunk-MJGKE7XZ.js";
339
+ import "./chunk-RGUSVBGN.js";
340
+ import {
341
+ isWorktreeFolder
342
+ } from "./chunk-KUCMJHQW.js";
343
+ import "./chunk-PSUJZUYX.js";
344
+ import "./chunk-5WM24P5N.js";
345
+ import {
346
+ defaultRunner,
347
+ mergeSelected,
348
+ runShipAction,
349
+ shipPreflight
350
+ } from "./chunk-3GIH4WTA.js";
351
+ import {
352
+ packageRoot
353
+ } from "./chunk-LNHSBM4L.js";
354
+ import {
355
+ VERSION
356
+ } from "./chunk-DJ2X4LKE.js";
357
+ import {
358
+ resolveProjectTarget
359
+ } from "./chunk-J36ULZBO.js";
360
+ import {
361
+ git
362
+ } from "./chunk-3N3UQEC4.js";
349
363
  import {
350
364
  DECISION_MARKER,
351
365
  STAGE_WANTS_YOU,
@@ -426,23 +440,7 @@ import {
426
440
  updateCheckpoint,
427
441
  whileRestoring,
428
442
  writeArchiveRecord
429
- } from "./chunk-MSZQUJZZ.js";
430
- import {
431
- activityRoots,
432
- agentFor,
433
- agentOf,
434
- agentWriteMs,
435
- detachHere,
436
- isPidAlive,
437
- knownAgents,
438
- lineTimeOf,
439
- liveAgents,
440
- readJsonlSince,
441
- recentProcessTable
442
- } from "./chunk-VESYLAVA.js";
443
- import {
444
- spawn_default
445
- } from "./chunk-RCYI7SRA.js";
443
+ } from "./chunk-QLAVWIDJ.js";
446
444
  import {
447
445
  dayKey
448
446
  } from "./chunk-NEJVK5CF.js";
@@ -453,21 +451,50 @@ import {
453
451
  sessionIdFor,
454
452
  tx,
455
453
  withDb
456
- } from "./chunk-JF72AS6T.js";
454
+ } from "./chunk-YYBXQBW2.js";
457
455
  import {
458
- report
459
- } from "./chunk-ZGXRWL7T.js";
460
- import "./chunk-75MIXOUK.js";
456
+ activityRoots,
457
+ agentAccountFolders,
458
+ agentFor,
459
+ agentOf,
460
+ agentWriteMs,
461
+ isOwnCheckout,
462
+ knownAgents,
463
+ lineTimeOf,
464
+ liveAgents,
465
+ readJsonlSince
466
+ } from "./chunk-F6M255O5.js";
461
467
  import {
468
+ usageDir
469
+ } from "./chunk-RCGFHJM7.js";
470
+ import "./chunk-FDKJFIUU.js";
471
+ import {
472
+ DEFAULT_ACCOUNT,
462
473
  DEFAULT_PROMPTS,
463
474
  DEFAULT_TIME_SETTINGS,
464
- atomicWriteFile,
465
- getConfigDir,
466
475
  isWorkday,
467
476
  loadConfig
468
- } from "./chunk-RYEPQLXQ.js";
477
+ } from "./chunk-XNLQSW6J.js";
478
+ import {
479
+ detachHere,
480
+ isPidAlive,
481
+ recentProcessTable
482
+ } from "./chunk-4NITDMDH.js";
483
+ import {
484
+ spawn_default
485
+ } from "./chunk-RCYI7SRA.js";
486
+ import {
487
+ atomicWriteFile
488
+ } from "./chunk-ZXHMC7UO.js";
489
+ import {
490
+ report
491
+ } from "./chunk-AU27USPZ.js";
492
+ import {
493
+ getConfigDir
494
+ } from "./chunk-6THUVP6T.js";
469
495
 
470
496
  // src/commands/web.ts
497
+ import fs16 from "fs";
471
498
  import chalk from "chalk";
472
499
 
473
500
  // src/server/web-server.ts
@@ -1141,8 +1168,8 @@ async function readCodeFile(s, repo, rel, io = realIo) {
1141
1168
  // src/core/worktree/code-symbols.ts
1142
1169
  var MAX_LINE_CHARS = 240;
1143
1170
  function parseGrepLine(line) {
1144
- const z7 = /^([^\0]+)\0(\d+)\0(.*)$/.exec(line);
1145
- if (z7) return { path: z7[1], line: Number(z7[2]), text: z7[3] };
1171
+ const z8 = /^([^\0]+)\0(\d+)\0(.*)$/.exec(line);
1172
+ if (z8) return { path: z8[1], line: Number(z8[2]), text: z8[3] };
1146
1173
  const m = /^(.+?):(\d+):(.*)$/.exec(line);
1147
1174
  return m ? { path: m[1], line: Number(m[2]), text: m[3] } : null;
1148
1175
  }
@@ -1790,6 +1817,88 @@ function mountAppUpdateRoutes(app, opts) {
1790
1817
  });
1791
1818
  }
1792
1819
 
1820
+ // src/server/routes/usage-routes.ts
1821
+ import fs5 from "fs";
1822
+ var FRESH_MS = 5e3;
1823
+ function createUsageCache(build, ttlMs = FRESH_MS, now = Date.now) {
1824
+ let last = null;
1825
+ let inFlight = null;
1826
+ let gen = 0;
1827
+ return {
1828
+ get() {
1829
+ if (last && last.gen === gen && now() - last.at < ttlMs) return Promise.resolve(last.value);
1830
+ if (inFlight && inFlight.gen === gen) return inFlight.p;
1831
+ const mine = gen;
1832
+ const p = build().then((value) => {
1833
+ if (mine === gen) last = { at: now(), gen: mine, value };
1834
+ return value;
1835
+ });
1836
+ const flight = { gen: mine, p };
1837
+ inFlight = flight;
1838
+ void p.then(
1839
+ () => inFlight === flight ? inFlight = null : void 0,
1840
+ () => inFlight === flight ? inFlight = null : void 0
1841
+ );
1842
+ return p;
1843
+ },
1844
+ invalidate() {
1845
+ gen++;
1846
+ }
1847
+ };
1848
+ }
1849
+ function mountUsageRoutes(app, opts) {
1850
+ app.get("/api/usage", async (c) => {
1851
+ try {
1852
+ return c.json(await opts.build());
1853
+ } catch (e) {
1854
+ const why = e instanceof Error ? e.message : String(e);
1855
+ report("warn", `[usage] GET /api/usage failed: ${why}`);
1856
+ return c.json({ error: why }, 500);
1857
+ }
1858
+ });
1859
+ }
1860
+ var THROTTLE_MS = 2e3;
1861
+ function watchUsage(opts) {
1862
+ const throttleMs = opts.throttleMs ?? THROTTLE_MS;
1863
+ const dir = opts.dir ?? usageDir();
1864
+ let last = 0;
1865
+ let timer = null;
1866
+ const send = () => {
1867
+ last = Date.now();
1868
+ opts.broadcast("usage-changed", { ts: last });
1869
+ };
1870
+ const onChange = () => {
1871
+ opts.onChange?.();
1872
+ if (timer) return;
1873
+ const wait = last + throttleMs - Date.now();
1874
+ if (wait <= 0) return send();
1875
+ timer = setTimeout(() => {
1876
+ timer = null;
1877
+ send();
1878
+ }, wait);
1879
+ timer.unref?.();
1880
+ };
1881
+ let watcher = null;
1882
+ try {
1883
+ fs5.mkdirSync(dir, { recursive: true });
1884
+ watcher = createFsWatcher({ roots: [dir], onChange });
1885
+ } catch (e) {
1886
+ report("warn", `[usage] not watching ${dir}: ${e instanceof Error ? e.message : String(e)}`);
1887
+ }
1888
+ return {
1889
+ stop() {
1890
+ if (timer) clearTimeout(timer);
1891
+ timer = null;
1892
+ watcher?.stop();
1893
+ }
1894
+ };
1895
+ }
1896
+ function wireUsage(app, opts) {
1897
+ const cache = createUsageCache(opts.build, opts.ttlMs);
1898
+ mountUsageRoutes(app, { broadcast: opts.broadcast, build: () => cache.get() });
1899
+ return watchUsage({ broadcast: opts.broadcast, onChange: () => cache.invalidate(), dir: opts.dir, throttleMs: opts.throttleMs });
1900
+ }
1901
+
1793
1902
  // src/server/routes/repo-routes.ts
1794
1903
  import crossSpawn from "cross-spawn";
1795
1904
  function mountRepoRoutes(app, opts) {
@@ -1986,7 +2095,7 @@ function mountBlockRoutes(app, opts) {
1986
2095
  }
1987
2096
 
1988
2097
  // src/server/routes/jira-watch-routes.ts
1989
- import fs5 from "fs";
2098
+ import fs6 from "fs";
1990
2099
  import path5 from "path";
1991
2100
 
1992
2101
  // src/core/jira/jira-prompt.ts
@@ -2208,16 +2317,16 @@ async function sweepJira(deps) {
2208
2317
  var EVERY_MS = 5 * 6e4;
2209
2318
  function aboutRepo(dir) {
2210
2319
  try {
2211
- const readme = ["README.md", "readme.md", "README"].map((n) => path5.join(dir, n)).find((f) => fs5.existsSync(f));
2320
+ const readme = ["README.md", "readme.md", "README"].map((n) => path5.join(dir, n)).find((f) => fs6.existsSync(f));
2212
2321
  if (readme) {
2213
- const line = fs5.readFileSync(readme, "utf8").split(/\r?\n/).map(
2322
+ const line = fs6.readFileSync(readme, "utf8").split(/\r?\n/).map(
2214
2323
  (l) => l.replace(/^[#>*\-\s]+/, "").replace(/[`*_[\]]/g, "").trim()
2215
2324
  ).find((l) => l.length > 20 && !/^(!|<|http)/.test(l));
2216
2325
  if (line) return line.slice(0, 160);
2217
2326
  }
2218
2327
  const pkg = path5.join(dir, "package.json");
2219
- if (fs5.existsSync(pkg)) {
2220
- const d = JSON.parse(fs5.readFileSync(pkg, "utf8")).description;
2328
+ if (fs6.existsSync(pkg)) {
2329
+ const d = JSON.parse(fs6.readFileSync(pkg, "utf8")).description;
2221
2330
  if (typeof d === "string" && d.trim()) return d.trim().slice(0, 160);
2222
2331
  }
2223
2332
  } catch {
@@ -2705,7 +2814,7 @@ function mountPanesRoutes(app, opts) {
2705
2814
  }
2706
2815
 
2707
2816
  // src/server/routes/worktree-routes.ts
2708
- import fs6 from "fs";
2817
+ import fs7 from "fs";
2709
2818
  import path6 from "path";
2710
2819
  import { spawn } from "child_process";
2711
2820
  import crossSpawn2 from "cross-spawn";
@@ -2721,7 +2830,9 @@ function mountWorktreeRoutes(app, opts) {
2721
2830
  /** Start Claude with this as its first message. */
2722
2831
  prompt: z4.string().max(2e4).optional(),
2723
2832
  /** Name the session (its title); the branch stays its identity. */
2724
- name: z4.string().max(120).optional()
2833
+ name: z4.string().max(120).optional(),
2834
+ /** The Claude account a new session runs on (a name from `work account list`); empty: the configured default. */
2835
+ account: z4.string().max(64).optional()
2725
2836
  });
2726
2837
  const startSession = opts.startSession ?? startSessionWithPrompt;
2727
2838
  const create = opts.create ?? createInProcess;
@@ -2733,6 +2844,7 @@ function mountWorktreeRoutes(app, opts) {
2733
2844
  });
2734
2845
  app.post("/api/worktrees", zValidator5("json", createSchema), async (c) => {
2735
2846
  const { target, base, jiraKey, prompt, name } = c.req.valid("json");
2847
+ const account = c.req.valid("json").account?.trim() || void 0;
2736
2848
  const config = loadConfig();
2737
2849
  if (!config) return c.json({ error: "no config" }, 400);
2738
2850
  const wanted = c.req.valid("json").branch?.trim() ?? "";
@@ -2740,7 +2852,7 @@ function mountWorktreeRoutes(app, opts) {
2740
2852
  return c.json({ error: "a base needs a branch to fork (leave both empty to open the repo as it is)" }, 400);
2741
2853
  try {
2742
2854
  const made = await create(
2743
- { target, branch: wanted || void 0, base: base?.trim() ? toBaseSpec(base.trim()) : void 0, jiraKey, name },
2855
+ { target, branch: wanted || void 0, base: base?.trim() ? toBaseSpec(base.trim()) : void 0, jiraKey, name, account },
2744
2856
  config
2745
2857
  );
2746
2858
  if (!made.ok) return c.json({ error: made.error }, 400);
@@ -2802,7 +2914,7 @@ function mountWorktreeRoutes(app, opts) {
2802
2914
  if (waiting.length) return { body: { error: `Not deleted: ${waiting.join("; ")}.`, blocked: waiting }, status: 409 };
2803
2915
  }
2804
2916
  try {
2805
- const onDisk = session.paths.some((p) => fs6.existsSync(p));
2917
+ const onDisk = session.paths.some((p) => fs7.existsSync(p));
2806
2918
  if (!sessionOnly && onDisk && session.paths.some((p) => wouldRefuseRemoval(p, force ?? false))) {
2807
2919
  return { body: { error: REFUSED }, status: 409 };
2808
2920
  }
@@ -3846,7 +3958,7 @@ function mountRailRoutes(app, opts) {
3846
3958
  }
3847
3959
 
3848
3960
  // src/core/worktree/shared-folders.ts
3849
- import fs7 from "fs";
3961
+ import fs8 from "fs";
3850
3962
  import path9 from "path";
3851
3963
  var norm = (p) => path9.resolve(p).replace(/\\/g, "/").toLowerCase();
3852
3964
  function shadowedSessions(sessions, branchCheckedOut2) {
@@ -3869,12 +3981,12 @@ function branchCheckedOut(dir) {
3869
3981
  try {
3870
3982
  const dotGit = path9.join(dir, ".git");
3871
3983
  let gitDir = dotGit;
3872
- if (fs7.statSync(dotGit).isFile()) {
3873
- const m = /^gitdir:\s*(.+)$/m.exec(fs7.readFileSync(dotGit, "utf8"));
3984
+ if (fs8.statSync(dotGit).isFile()) {
3985
+ const m = /^gitdir:\s*(.+)$/m.exec(fs8.readFileSync(dotGit, "utf8"));
3874
3986
  if (!m) return null;
3875
3987
  gitDir = path9.resolve(dir, m[1].trim());
3876
3988
  }
3877
- const head = fs7.readFileSync(path9.join(gitDir, "HEAD"), "utf8");
3989
+ const head = fs8.readFileSync(path9.join(gitDir, "HEAD"), "utf8");
3878
3990
  const ref = /^ref:\s*refs\/heads\/(.+)$/m.exec(head);
3879
3991
  return ref ? ref[1].trim() : null;
3880
3992
  } catch {
@@ -3883,14 +3995,14 @@ function branchCheckedOut(dir) {
3883
3995
  }
3884
3996
 
3885
3997
  // src/core/platform/build-stamp.ts
3886
- import fs8 from "fs";
3998
+ import fs9 from "fs";
3887
3999
  var cached = null;
3888
4000
  function buildStamp() {
3889
4001
  if (cached) return cached;
3890
4002
  const forced = process.env.WORK_BUILD_STAMP;
3891
4003
  if (forced) return cached = forced;
3892
4004
  try {
3893
- cached = String(Math.floor(fs8.statSync(process.argv[1]).mtimeMs));
4005
+ cached = String(Math.floor(fs9.statSync(process.argv[1]).mtimeMs));
3894
4006
  } catch {
3895
4007
  cached = "unknown";
3896
4008
  }
@@ -4193,7 +4305,7 @@ function mountPrReplyRoutes(app, opts) {
4193
4305
  }
4194
4306
 
4195
4307
  // src/core/archive/archive-retention.ts
4196
- import fs9 from "fs";
4308
+ import fs10 from "fs";
4197
4309
  import path10 from "path";
4198
4310
  import zlib from "zlib";
4199
4311
  var DEFAULT_COMPRESS_AFTER_DAYS = 30;
@@ -4206,7 +4318,7 @@ function applyArchiveRetention(opts) {
4206
4318
  const out = { compressed: [], dropped: [], bytesSaved: 0 };
4207
4319
  let ids;
4208
4320
  try {
4209
- ids = fs9.readdirSync(root, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name);
4321
+ ids = fs10.readdirSync(root, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name);
4210
4322
  } catch {
4211
4323
  return out;
4212
4324
  }
@@ -4216,8 +4328,8 @@ function applyArchiveRetention(opts) {
4216
4328
  const age = now - Date.parse(rec.archivedAt);
4217
4329
  if (!Number.isFinite(age)) continue;
4218
4330
  const ignored = path10.join(archiveDirFor(id, root), "ignored");
4219
- if (compressAfter > 0 && age >= compressAfter * DAY_MS && !rec.ignoredDroppedAt && fs9.existsSync(ignored)) {
4220
- fs9.rmSync(ignored, { recursive: true, force: true });
4331
+ if (compressAfter > 0 && age >= compressAfter * DAY_MS && !rec.ignoredDroppedAt && fs10.existsSync(ignored)) {
4332
+ fs10.rmSync(ignored, { recursive: true, force: true });
4221
4333
  rec.ignoredDroppedAt = new Date(now).toISOString();
4222
4334
  writeArchiveRecord(rec, root);
4223
4335
  }
@@ -4225,7 +4337,7 @@ function applyArchiveRetention(opts) {
4225
4337
  const dir = path10.join(archiveDirFor(id, root), "transcripts");
4226
4338
  if (dropAfter > 0 && age >= dropAfter * DAY_MS) {
4227
4339
  out.bytesSaved += dirBytes(dir);
4228
- fs9.rmSync(dir, { recursive: true, force: true });
4340
+ fs10.rmSync(dir, { recursive: true, force: true });
4229
4341
  rec.transcriptsDroppedAt = new Date(now).toISOString();
4230
4342
  writeArchiveRecord(rec, root);
4231
4343
  out.dropped.push(id);
@@ -4234,15 +4346,15 @@ function applyArchiveRetention(opts) {
4234
4346
  if (compressAfter <= 0 || rec.compressedAt || age < compressAfter * DAY_MS) continue;
4235
4347
  for (const t of rec.transcripts) {
4236
4348
  const plain = path10.join(dir, t.file);
4237
- if (!fs9.existsSync(plain)) continue;
4238
- const data = fs9.readFileSync(plain);
4349
+ if (!fs10.existsSync(plain)) continue;
4350
+ const data = fs10.readFileSync(plain);
4239
4351
  const gz = zlib.gzipSync(data);
4240
- fs9.writeFileSync(`${plain}.gz`, gz);
4241
- if (!zlib.gunzipSync(fs9.readFileSync(`${plain}.gz`)).equals(data)) {
4242
- fs9.rmSync(`${plain}.gz`, { force: true });
4352
+ fs10.writeFileSync(`${plain}.gz`, gz);
4353
+ if (!zlib.gunzipSync(fs10.readFileSync(`${plain}.gz`)).equals(data)) {
4354
+ fs10.rmSync(`${plain}.gz`, { force: true });
4243
4355
  continue;
4244
4356
  }
4245
- fs9.rmSync(plain, { force: true });
4357
+ fs10.rmSync(plain, { force: true });
4246
4358
  out.bytesSaved += data.length - gz.length;
4247
4359
  }
4248
4360
  rec.compressedAt = new Date(now).toISOString();
@@ -4254,7 +4366,7 @@ function applyArchiveRetention(opts) {
4254
4366
  function dirBytes(dir) {
4255
4367
  let n = 0;
4256
4368
  try {
4257
- for (const f of fs9.readdirSync(dir)) n += fs9.statSync(path10.join(dir, f)).size;
4369
+ for (const f of fs10.readdirSync(dir)) n += fs10.statSync(path10.join(dir, f)).size;
4258
4370
  } catch {
4259
4371
  }
4260
4372
  return n;
@@ -4464,7 +4576,7 @@ import { zValidator as zValidator7 } from "@hono/zod-validator";
4464
4576
  import { z as z6 } from "zod";
4465
4577
 
4466
4578
  // src/core/diff/revert.ts
4467
- import fs10 from "fs";
4579
+ import fs11 from "fs";
4468
4580
  import path11 from "path";
4469
4581
  function inside(root, rel) {
4470
4582
  const abs = path11.resolve(root, rel);
@@ -4479,7 +4591,7 @@ function removeNew(root, rel) {
4479
4591
  const abs = inside(root, rel);
4480
4592
  if (!abs) return { ok: false, status: 400, error: `path escapes the worktree: ${rel}` };
4481
4593
  git(["rm", "--cached", "-q", "--ignore-unmatch", "--", rel], root);
4482
- fs10.rmSync(abs, { force: true });
4594
+ fs11.rmSync(abs, { force: true });
4483
4595
  return null;
4484
4596
  }
4485
4597
  function revertFile(root, file) {
@@ -4640,7 +4752,7 @@ function mountDevRoutes(app, opts) {
4640
4752
  }
4641
4753
 
4642
4754
  // src/server/routes/ci-routes.ts
4643
- import fs11 from "fs";
4755
+ import fs12 from "fs";
4644
4756
 
4645
4757
  // src/core/pr/review-quote.ts
4646
4758
  function quoteForAgent(s, max = 600) {
@@ -5184,7 +5296,7 @@ async function wakeForNote(id) {
5184
5296
  const url = await ensurePty(id, { initialPrompt: WAKE_PROMPT }).catch(() => null);
5185
5297
  return url ? "started" : "failed";
5186
5298
  }
5187
- var FRESH_MS = 6e4;
5299
+ var FRESH_MS2 = 6e4;
5188
5300
  function midTurn(id) {
5189
5301
  return turnInProgress(readStatus(id));
5190
5302
  }
@@ -5193,7 +5305,7 @@ function mountCiRoutes(app, opts) {
5193
5305
  lookOnly: opts.lookOnly,
5194
5306
  sessions: () => {
5195
5307
  const now = Date.now();
5196
- return loadHistory().filter((s) => watchable(s, now, { exists: (p) => fs11.existsSync(p), lastWriteMs: lastConversationWriteMs })).map((session) => ({ id: sessionIdFor(session), session }));
5308
+ return loadHistory().filter((s) => watchable(s, now, { exists: (p) => fs12.existsSync(p), lastWriteMs: lastConversationWriteMs })).map((session) => ({ id: sessionIdFor(session), session }));
5197
5309
  },
5198
5310
  // Never-pushed branches can't have a PR: don't ask GitHub about them,
5199
5311
  // unless the watch already knows one (a merged PR whose branch is gone).
@@ -5232,7 +5344,7 @@ function mountCiRoutes(app, opts) {
5232
5344
  },
5233
5345
  retireReplies: async (id, ci) => {
5234
5346
  const s = findSession2(id);
5235
- const gone = await retireResolvedReplies(id, ci, s?.paths.find((p) => fs11.existsSync(p)) ?? null, defaultRunner);
5347
+ const gone = await retireResolvedReplies(id, ci, s?.paths.find((p) => fs12.existsSync(p)) ?? null, defaultRunner);
5236
5348
  if (gone.length) opts.broadcast("replies-changed", { sessionId: id });
5237
5349
  return gone;
5238
5350
  },
@@ -5255,7 +5367,7 @@ function mountCiRoutes(app, opts) {
5255
5367
  const id = c.req.param("id");
5256
5368
  if (!findSession2(id)) return c.json({ error: "unknown session" }, 404);
5257
5369
  const cached2 = watch.state(id);
5258
- if (cached2 && Date.now() - Date.parse(cached2.checkedAt) < FRESH_MS) return c.json(cached2);
5370
+ if (cached2 && Date.now() - Date.parse(cached2.checkedAt) < FRESH_MS2) return c.json(cached2);
5259
5371
  return c.json(await watch.refresh(id, { act: false }) ?? { checkedAt: (/* @__PURE__ */ new Date()).toISOString(), repos: [] });
5260
5372
  });
5261
5373
  app.post("/api/sessions/:id/ci/fix", async (c) => {
@@ -5268,7 +5380,7 @@ function mountCiRoutes(app, opts) {
5268
5380
  }
5269
5381
 
5270
5382
  // src/core/diff/diffs-sweep.ts
5271
- import fs12 from "fs";
5383
+ import fs13 from "fs";
5272
5384
  import path13 from "path";
5273
5385
  var SWEEP_AFTER_DAYS = 30;
5274
5386
  var DISPOSABLE = /\.(html|log)$/i;
@@ -5278,7 +5390,7 @@ function sweepOldDiffArtifacts(now = Date.now(), maxAgeDays = SWEEP_AFTER_DAYS,
5278
5390
  let bytes = 0;
5279
5391
  let names;
5280
5392
  try {
5281
- names = fs12.readdirSync(dir);
5393
+ names = fs13.readdirSync(dir);
5282
5394
  } catch {
5283
5395
  return { removed, bytes };
5284
5396
  }
@@ -5286,9 +5398,9 @@ function sweepOldDiffArtifacts(now = Date.now(), maxAgeDays = SWEEP_AFTER_DAYS,
5286
5398
  if (!DISPOSABLE.test(name)) continue;
5287
5399
  const file = path13.join(dir, name);
5288
5400
  try {
5289
- const st = fs12.statSync(file);
5401
+ const st = fs13.statSync(file);
5290
5402
  if (!st.isFile() || st.mtimeMs >= cutoff) continue;
5291
- fs12.rmSync(file, { force: true });
5403
+ fs13.rmSync(file, { force: true });
5292
5404
  removed++;
5293
5405
  bytes += st.size;
5294
5406
  } catch {
@@ -5544,157 +5656,6 @@ async function bridgeToHost(ws, sessionId, pending) {
5544
5656
  });
5545
5657
  }
5546
5658
 
5547
- // src/core/pty/agent-restart.ts
5548
- import fs13 from "fs";
5549
- var PACKED_MTIME_BEFORE = Date.parse("1990-01-01T00:00:00Z");
5550
- function installedAt(cmd, find = findOnPath) {
5551
- const file = find(cmd);
5552
- if (!file) return null;
5553
- try {
5554
- return installTime(fs13.statSync(fs13.realpathSync(file)));
5555
- } catch {
5556
- return null;
5557
- }
5558
- }
5559
- function installTime(st) {
5560
- const real = (ms) => ms >= PACKED_MTIME_BEFORE ? ms : null;
5561
- const known = [real(st.mtimeMs), real(st.birthtimeMs)].filter((x) => x !== null);
5562
- return known.length ? Math.max(...known) : st.ctimeMs;
5563
- }
5564
- function installedAtCache(ttlMs = 6e4, look = installedAt, now = Date.now) {
5565
- const cache = /* @__PURE__ */ new Map();
5566
- return (cmd) => {
5567
- const hit = cache.get(cmd);
5568
- if (hit && now() - hit.read < ttlMs) return hit.at;
5569
- const at = look(cmd);
5570
- cache.set(cmd, { at, read: now() });
5571
- return at;
5572
- };
5573
- }
5574
- function outdatedPtys(ptys, toolInstalledAt) {
5575
- return ptys.filter((p) => {
5576
- if (p.exited || !p.tool) return false;
5577
- const at = toolInstalledAt(p.tool);
5578
- const started = Date.parse(p.startedAt);
5579
- return at !== null && Number.isFinite(started) && started < at;
5580
- });
5581
- }
5582
- var PRINTING_MS = 1e4;
5583
- function busyForRestart(state, lastOutputMs, now = Date.now(), live = null) {
5584
- if (live === "busy" || live === "waiting") return true;
5585
- if (state === "working" || state === "needs_input") return true;
5586
- return lastOutputMs !== null && now - lastOutputMs < PRINTING_MS;
5587
- }
5588
- function restartPlan(ids, busy) {
5589
- const now = [];
5590
- const later = [];
5591
- for (const id of new Set(ids)) (busy(id) ? later : now).push(id);
5592
- return { now, later };
5593
- }
5594
- var RESTART_AT_ONCE = 3;
5595
- function restartNotesSummary(notes) {
5596
- const n = (level) => notes.filter((x) => x.level === level).length;
5597
- return restartCountsText({ restarted: n("action"), later: n("info"), failed: n("warn") });
5598
- }
5599
- var QUEUE_RECHECK_MS = 15e3;
5600
- var TURN_END_GRACE_MS = 1e4;
5601
- function createRestarter(deps) {
5602
- const queued = /* @__PURE__ */ new Set();
5603
- const inFlight = /* @__PURE__ */ new Map();
5604
- const later = deps.later ?? ((fn, ms) => void setTimeout(fn, ms).unref?.());
5605
- const one = (id) => {
5606
- const running = inFlight.get(id);
5607
- if (running) return running;
5608
- queued.delete(id);
5609
- const p = deps.restart(id).then(
5610
- (how) => ({ ok: true, how: how || "restarted its agent (its conversation goes on)" }),
5611
- (err) => ({ ok: false, error: err.message })
5612
- );
5613
- inFlight.set(id, p);
5614
- void p.finally(() => inFlight.delete(id));
5615
- return p;
5616
- };
5617
- const run = async (ids, notes) => {
5618
- const failed = [];
5619
- const ok = /* @__PURE__ */ new Set();
5620
- const queue = [...ids];
5621
- const worker = async () => {
5622
- for (let id = queue.shift(); id !== void 0; id = queue.shift()) {
5623
- const r = await one(id);
5624
- if (r.ok) {
5625
- ok.add(id);
5626
- notes.push({ id, text: r.how, level: "action" });
5627
- } else {
5628
- failed.push({ id, error: r.error });
5629
- notes.push({ id, text: `couldn't restart its agent: ${r.error}`, level: "warn" });
5630
- }
5631
- }
5632
- };
5633
- await Promise.all(Array.from({ length: Math.min(RESTART_AT_ONCE, queue.length) }, worker));
5634
- return { done: ids.filter((id) => ok.has(id)), failed };
5635
- };
5636
- const finish = (notes) => {
5637
- if (!notes.length) return;
5638
- deps.report?.(notes);
5639
- deps.changed?.();
5640
- };
5641
- const request = async (ids) => {
5642
- const plan = restartPlan(ids, (id) => deps.busy(id));
5643
- const notes = [];
5644
- for (const id of plan.later) {
5645
- queued.add(id);
5646
- notes.push({ id, text: `${LATER_TEXT} (it is working or waiting on you)`, level: "info" });
5647
- }
5648
- const { done, failed } = await run(plan.now, notes);
5649
- finish(notes);
5650
- tick();
5651
- return { now: done, later: plan.later, failed };
5652
- };
5653
- let ticking = false;
5654
- const tick = () => {
5655
- if (ticking) return;
5656
- if (queued.size === 0) {
5657
- deps.scheduled?.(null);
5658
- return;
5659
- }
5660
- ticking = true;
5661
- deps.scheduled?.(Date.now() + QUEUE_RECHECK_MS);
5662
- later(() => {
5663
- ticking = false;
5664
- void retry().catch(() => {
5665
- }).finally(tick);
5666
- }, QUEUE_RECHECK_MS);
5667
- };
5668
- const retry = async (only, opts) => {
5669
- const notes = [];
5670
- const ready = [];
5671
- for (const id of [...queued]) {
5672
- if (only !== void 0 && id !== only) continue;
5673
- if (!deps.running(id)) {
5674
- queued.delete(id);
5675
- notes.push({ id, text: "no longer waits to restart: it was stopped meanwhile (it starts on the new version)", level: "info" });
5676
- continue;
5677
- }
5678
- if (!deps.busy(id, opts)) ready.push(id);
5679
- }
5680
- await run(ready, notes);
5681
- finish(notes);
5682
- };
5683
- return {
5684
- request,
5685
- retry: () => retry(),
5686
- /** A session's turn ended: restart it if it was waiting for that — and if it still reads as busy, look again shortly. */
5687
- turnEnded: (id) => {
5688
- if (!queued.has(id)) return;
5689
- later(() => void retry(id, { turnEnded: true }).catch(() => {
5690
- }), TURN_END_GRACE_MS);
5691
- },
5692
- queued: () => [...queued],
5693
- /** Being restarted now (the host lists them as exited meanwhile: still this session's). */
5694
- restarting: () => [...inFlight.keys()]
5695
- };
5696
- }
5697
-
5698
5659
  // src/server/routes/agent-restart-routes.ts
5699
5660
  function agentsWire(ptys, deps) {
5700
5661
  const times = /* @__PURE__ */ new Map();
@@ -5731,6 +5692,72 @@ function mountAgentRestartRoutes(app, opts) {
5731
5692
  });
5732
5693
  }
5733
5694
 
5695
+ // src/server/routes/account-routes.ts
5696
+ import { zValidator as zValidator8 } from "@hono/zod-validator";
5697
+ import { z as z7 } from "zod";
5698
+ function mountAccountRoutes(app, opts) {
5699
+ app.get("/api/accounts", (c) => {
5700
+ const accounts = agentFor(loadConfig()).accounts;
5701
+ const list = accounts?.list() ?? [];
5702
+ return c.json({
5703
+ accounts: list.map((a) => ({ name: a.name, dir: a.dir, isDefault: a.isDefault, loggedIn: a.loggedIn })),
5704
+ default: accounts?.defaultName() ?? DEFAULT_ACCOUNT
5705
+ });
5706
+ });
5707
+ app.post("/api/sessions/:id/account", zValidator8("json", z7.object({ to: z7.string().min(1).max(64) })), async (c) => {
5708
+ if (opts.lookOnly) return c.json({ error: opts.lookOnly }, 409);
5709
+ const r = await opts.switcher.switchAccount(c.req.param("id"), c.req.valid("json").to).catch((err) => ({
5710
+ ok: false,
5711
+ status: 502,
5712
+ error: err.message
5713
+ }));
5714
+ if (!r.ok) return c.json({ error: r.error }, r.status);
5715
+ opts.broadcast("sessions-changed", { ts: Date.now() });
5716
+ return c.json({ ok: true, outcome: r.outcome, ...r.moved !== void 0 ? { moved: r.moved } : {} });
5717
+ });
5718
+ app.delete("/api/sessions/:id/account", (c) => {
5719
+ if (opts.lookOnly) return c.json({ error: opts.lookOnly }, 409);
5720
+ const r = opts.switcher.cancel(c.req.param("id"));
5721
+ if (r === "running") return c.json({ error: "the switch is being done right now" }, 409);
5722
+ if (r === "none") return c.json({ error: "no switch is waiting for its turn" }, 409);
5723
+ opts.broadcast("sessions-changed", { ts: Date.now() });
5724
+ return c.json({ ok: true });
5725
+ });
5726
+ }
5727
+
5728
+ // src/core/sessions/account-switch-link.ts
5729
+ function createAccountSwitchLink() {
5730
+ let restarter = null;
5731
+ let switcher = null;
5732
+ return {
5733
+ connect(r, s) {
5734
+ restarter = r;
5735
+ switcher = s;
5736
+ },
5737
+ /** The agent restarter's `foldedInto`: a switch that waits or runs restarts it anyway. */
5738
+ foldedInto: (id) => {
5739
+ const to = switcher?.restartsAnyway(id) ?? null;
5740
+ return to === null ? null : `its switch to the ${to || "other"} account`;
5741
+ },
5742
+ /** The switcher's `cancelRestart`. */
5743
+ cancelRestart: (id) => restarter?.cancel(id) ?? false,
5744
+ /** A session's turn ended: a restart or a switch that waited for it goes now (after its hooks have run). */
5745
+ turnEnded(id) {
5746
+ restarter?.turnEnded(id);
5747
+ switcher?.turnEnded(id);
5748
+ },
5749
+ /** The sweep: the ones waiting on a turn whose end no hook reported. Never rejects. */
5750
+ async retry() {
5751
+ await restarter?.retry().catch(() => {
5752
+ });
5753
+ await switcher?.retry().catch(() => {
5754
+ });
5755
+ },
5756
+ /** The account a session waits to move to (SessionWire.accountPending), or null. */
5757
+ pendingFor: (id) => switcher?.pendingFor(id) ?? null
5758
+ };
5759
+ }
5760
+
5734
5761
  // src/core/pty/host-health.ts
5735
5762
  var UNRESPONSIVE_MS = 11e3;
5736
5763
  var SLOW_MS = 1500;
@@ -5969,6 +5996,7 @@ async function startWebServer(opts = {}) {
5969
5996
  prStageFor: (id) => prStageWire(prWatch.state(id), (k) => stageSeen(id).has(k)),
5970
5997
  replyDraftsFor: (id) => drafts.get(id) ?? 0,
5971
5998
  hasNote: (id) => noted.has(id),
5999
+ accountPendingFor: (id) => accountLink.pendingFor(id),
5972
6000
  blockedByFor: (id) => (blocks.get(id)?.by ?? []).filter((b) => !blockerDone(b, (x) => !live.has(x))).map((b) => ({
5973
6001
  key: blockKey(b),
5974
6002
  kind: b.kind,
@@ -6079,7 +6107,9 @@ async function startWebServer(opts = {}) {
6079
6107
  return busyForRestart(session ? shownState(session) : null, opts2?.turnEnded ? null : ptyLastOutputMs(id), Date.now(), live);
6080
6108
  };
6081
6109
  const restartSchedule = dev ? null : activity.schedule("agents", "Agents waiting to restart", QUEUE_RECHECK_MS);
6110
+ const accountLink = createAccountSwitchLink();
6082
6111
  const restarter = createRestarter({
6112
+ foldedInto: accountLink.foldedInto,
6083
6113
  restart: restartPty,
6084
6114
  busy: restartBusy,
6085
6115
  running: peekPty,
@@ -6102,10 +6132,28 @@ async function startWebServer(opts = {}) {
6102
6132
  // The dev server shares the real PTY host and acts on nothing: the real work web restarts.
6103
6133
  lookOnly: dev ? "the dev server restarts nothing: use the real work web (the app, or `work restart`)" : void 0
6104
6134
  });
6135
+ const accountSchedule = dev ? null : activity.schedule("accounts", "Account switches waiting for a turn", QUEUE_RECHECK_MS);
6136
+ const accountSwitcher = createAccountSwitcher(
6137
+ defaultAccountSwitchDeps({
6138
+ busy: restartBusy,
6139
+ note: accountSwitchNote(activity, (id) => {
6140
+ const s = findSession2(id);
6141
+ return s ? `${s.target} ${s.branch}` : null;
6142
+ }),
6143
+ changed: () => broadcast("sessions-changed", { ts: Date.now() }),
6144
+ scheduled: (nextAt) => accountSchedule?.next(nextAt),
6145
+ cancelRestart: accountLink.cancelRestart
6146
+ })
6147
+ );
6148
+ accountLink.connect(restarter, accountSwitcher);
6149
+ mountAccountRoutes(app, {
6150
+ switcher: accountSwitcher,
6151
+ broadcast,
6152
+ lookOnly: dev ? "the dev server switches nothing: use the real work web (the app, or `work account switch`)" : void 0
6153
+ });
6105
6154
  const sleepIdle = async () => {
6106
6155
  sleepSchedule?.next(Date.now() + SLEEP_EVERY_MS);
6107
- await restarter.retry().catch(() => {
6108
- });
6156
+ await accountLink.retry();
6109
6157
  const minutes = loadConfig()?.sleepIdleAfterMinutes ?? DEFAULT_SLEEP_AFTER_MINUTES;
6110
6158
  if (sleepAfterMs(minutes) === 0)
6111
6159
  return activity.skip("idle-sleep", "Looking for idle Claudes", "turned off (sleepIdleAfterMinutes: 0)");
@@ -6354,7 +6402,7 @@ async function startWebServer(opts = {}) {
6354
6402
  } : {},
6355
6403
  onStatusChanged: (id) => {
6356
6404
  diffStats.invalidate(id);
6357
- restarter.turnEnded(id);
6405
+ accountLink.turnEnded(id);
6358
6406
  timeKeeper?.soon();
6359
6407
  if (jobs) void syncStacksAfter(id);
6360
6408
  const session = findSession2(id);
@@ -6411,6 +6459,7 @@ async function startWebServer(opts = {}) {
6411
6459
  const desktopFile = desktopUpdatePath();
6412
6460
  const onDesktopUpdate = () => broadcast("updates-changed", { ts: Date.now() });
6413
6461
  if (jobs) fs14.watchFile(desktopFile, { interval: 3e3 }, onDesktopUpdate);
6462
+ const usageWatcher = wireUsage(app, { broadcast, build: () => buildUsage(realUsageDeps()) });
6414
6463
  app.get("/api/pty-host/health", (c) => c.json(hostHealth(hostBeat())));
6415
6464
  let lastHostState = hostHealth(hostBeat()).state;
6416
6465
  const hostTick = lean ? null : setInterval(() => {
@@ -6477,6 +6526,7 @@ async function startWebServer(opts = {}) {
6477
6526
  if (timeTimer) clearInterval(timeTimer);
6478
6527
  timeKeeper?.stop();
6479
6528
  fs14.unwatchFile(desktopFile, onDesktopUpdate);
6529
+ usageWatcher.stop();
6480
6530
  for (const t of conversationSyncs.values()) clearTimeout(t);
6481
6531
  clearTimeout(sweepTimer);
6482
6532
  activityWatcher?.stop();
@@ -6498,6 +6548,39 @@ async function startWebServer(opts = {}) {
6498
6548
  };
6499
6549
  }
6500
6550
 
6551
+ // src/core/agents/account-sync.ts
6552
+ var keyOf = (folders) => [...new Set(folders)].sort().join("\n");
6553
+ function startAccountSync(deps) {
6554
+ let last = keyOf(deps.folders());
6555
+ let running = false;
6556
+ const check = async () => {
6557
+ if (running) return false;
6558
+ let now;
6559
+ try {
6560
+ now = keyOf(deps.folders());
6561
+ } catch (err) {
6562
+ deps.onError?.(err);
6563
+ return false;
6564
+ }
6565
+ if (now === last) return false;
6566
+ running = true;
6567
+ last = now;
6568
+ try {
6569
+ await deps.apply();
6570
+ return true;
6571
+ } catch (err) {
6572
+ deps.onError?.(err);
6573
+ return false;
6574
+ } finally {
6575
+ running = false;
6576
+ }
6577
+ };
6578
+ const every = deps.everyMs ?? 1e4;
6579
+ const timer = every > 0 ? setInterval(() => void check(), every) : null;
6580
+ timer?.unref?.();
6581
+ return { check, stop: () => timer && clearInterval(timer) };
6582
+ }
6583
+
6501
6584
  // src/core/platform/autostart.ts
6502
6585
  import fs15 from "fs";
6503
6586
  import path16 from "path";
@@ -6643,8 +6726,31 @@ function createDemoRepos(liveTargets) {
6643
6726
  };
6644
6727
  }
6645
6728
 
6729
+ // src/server/demo/demo-accounts.ts
6730
+ var DEMO_ACCOUNTS = {
6731
+ accounts: [
6732
+ { name: "default", dir: "~/.claude", isDefault: true, loggedIn: true },
6733
+ { name: "work", dir: "~/.claude-work", isDefault: false, loggedIn: true },
6734
+ { name: "spare", dir: "~/.claude-spare", isDefault: false, loggedIn: false }
6735
+ ],
6736
+ default: "default"
6737
+ };
6738
+ var isDemoAccount = (name) => DEMO_ACCOUNTS.accounts.some((a) => a.name === name);
6739
+ function demoSwitch(session, to) {
6740
+ const refused = switchRefusal(to, {
6741
+ archived: session.archived,
6742
+ accounts: { list: DEMO_ACCOUNTS.accounts, current: session.account ?? "default" },
6743
+ pendingTo: null,
6744
+ // The demo's Claudes are all "in the host": none runs in a terminal outside it.
6745
+ inHost: true,
6746
+ runningOutside: false
6747
+ });
6748
+ if (refused) return { ok: false, ...refused };
6749
+ return { ok: true, body: { ok: true, outcome: "recorded", moved: 0 } };
6750
+ }
6751
+
6646
6752
  // src/server/demo/scenario.ts
6647
- var DEMO_AGENT = { id: "claude", name: "Claude Code", can: { read: true, hooks: true, live: true, answer: true } };
6753
+ var DEMO_AGENT = { id: "claude", name: "Claude Code", can: { read: true, hooks: true, live: true, answer: true, accounts: true } };
6648
6754
  function fileBlocks(diff) {
6649
6755
  return diff ? diff.split(/(?=^diff --git )/m).filter((b) => b.startsWith("diff --git ")) : [];
6650
6756
  }
@@ -7283,6 +7389,7 @@ ${reply}\r
7283
7389
  const stat = this.diffStat(s);
7284
7390
  return {
7285
7391
  agent: DEMO_AGENT,
7392
+ ...s.account && s.account !== "default" ? { account: s.account } : {},
7286
7393
  id: s.id,
7287
7394
  target: s.target,
7288
7395
  branch: s.branch,
@@ -7673,6 +7780,17 @@ ${reply}\r
7673
7780
  this.changed();
7674
7781
  return true;
7675
7782
  }
7783
+ /** Move a session to another account (demo-accounts.ts): just recorded. */
7784
+ switchAccount(id, to) {
7785
+ const s = this.sessions.get(id);
7786
+ if (!s) return null;
7787
+ const r = demoSwitch({ account: s.account, archived: !!s.archivedAt }, to);
7788
+ if (r.ok) {
7789
+ s.account = to === "default" ? void 0 : to;
7790
+ this.changed();
7791
+ }
7792
+ return r;
7793
+ }
7676
7794
  remove(id) {
7677
7795
  const ok = this.sessions.delete(id);
7678
7796
  if (ok) this.changed();
@@ -7760,7 +7878,7 @@ ${reply}\r
7760
7878
  this.changed();
7761
7879
  return true;
7762
7880
  }
7763
- create(target, branch, prompt, baseBranch) {
7881
+ create(target, branch, prompt, baseBranch, account) {
7764
7882
  const project = this.projects();
7765
7883
  const group = project.groups.find((g) => g.name === target);
7766
7884
  const first = prompt?.split("\n")[0];
@@ -7773,6 +7891,7 @@ ${reply}\r
7773
7891
  0
7774
7892
  );
7775
7893
  if (baseBranch) s.baseBranch = baseBranch;
7894
+ if (account && account !== "default") s.account = account;
7776
7895
  this.changed();
7777
7896
  return this.wire(s);
7778
7897
  }
@@ -8031,6 +8150,71 @@ function demoSha(seed) {
8031
8150
  return out.slice(0, 40);
8032
8151
  }
8033
8152
 
8153
+ // src/server/demo/demo-usage.ts
8154
+ function demoUsage(now = Date.now()) {
8155
+ const monday = new Date(now);
8156
+ monday.setHours(9, 0, 0, 0);
8157
+ monday.setDate(monday.getDate() + ((8 - monday.getDay()) % 7 || 7));
8158
+ return {
8159
+ agents: [
8160
+ {
8161
+ agent: "claude",
8162
+ name: "Claude Code",
8163
+ accounts: [
8164
+ {
8165
+ account: "default",
8166
+ isDefault: true,
8167
+ at: new Date(now - 6e4).toISOString(),
8168
+ windows: [
8169
+ { id: "five_hour", label: "5-hour limit", usedPercent: 42, resetsAt: new Date(now + 2 * 36e5).toISOString() },
8170
+ { id: "seven_day", label: "Weekly limit", usedPercent: 18, resetsAt: monday.toISOString() }
8171
+ ]
8172
+ },
8173
+ // The second login (demo-accounts.ts): little used this week, read a while ago.
8174
+ {
8175
+ account: "work",
8176
+ at: new Date(now - 3 * 36e5).toISOString(),
8177
+ windows: [
8178
+ { id: "five_hour", label: "5-hour limit", usedPercent: 6, resetsAt: new Date(now + 4 * 36e5).toISOString() },
8179
+ { id: "seven_day", label: "Weekly limit", usedPercent: 3, resetsAt: monday.toISOString() }
8180
+ ]
8181
+ }
8182
+ ]
8183
+ }
8184
+ ],
8185
+ tokens: {
8186
+ today: { input: 182e3, cached: 34e5, output: 61e3 },
8187
+ week: { input: 96e4, cached: 178e5, output: 318e3 },
8188
+ byModel: [
8189
+ {
8190
+ model: "claude-opus-5-5",
8191
+ today: { input: 12e4, cached: 25e5, output: 44e3 },
8192
+ week: { input: 7e5, cached: 131e5, output: 24e4 }
8193
+ },
8194
+ {
8195
+ model: "claude-haiku-4-5",
8196
+ today: { input: 62e3, cached: 9e5, output: 17e3 },
8197
+ week: { input: 26e4, cached: 47e5, output: 78e3 }
8198
+ }
8199
+ ],
8200
+ topSessions: [
8201
+ {
8202
+ id: "demo-api-feat-invoice-export",
8203
+ label: "api \xB7 feat/invoice-export",
8204
+ week: { input: 38e4, cached: 72e5, output: 12e4 }
8205
+ },
8206
+ { id: "demo-shop-feat-checkout-v2", label: "shop \xB7 feat/checkout-v2", week: { input: 25e4, cached: 46e5, output: 9e4 } },
8207
+ {
8208
+ id: "demo-web-fix-login-redirect",
8209
+ label: "web \xB7 fix/login-redirect",
8210
+ week: { input: 14e4, cached: 25e5, output: 5e4 }
8211
+ }
8212
+ ]
8213
+ },
8214
+ at: new Date(now).toISOString()
8215
+ };
8216
+ }
8217
+
8034
8218
  // src/server/demo/demo-code.ts
8035
8219
  var COMMON = {
8036
8220
  "README.md": "# {repo}\n\nThe {repo} service of the demo shop.\n\n## Running it\n\n```sh\nnpm install\nnpm run dev\n```\n",
@@ -8464,13 +8648,13 @@ async function startDemoServer(opts) {
8464
8648
  (c) => c.json({
8465
8649
  sessions: scenario.list().filter((w) => c.req.query("archived") === "1" || !w.archivedAt).map((w) => {
8466
8650
  const out = draftsFor(w.id) ? { ...w, replyDrafts: draftsFor(w.id) } : { ...w };
8467
- const z7 = snoozes.get(w.id);
8651
+ const z8 = snoozes.get(w.id);
8468
8652
  const waiting = (blocks.get(w.id) ?? []).filter(
8469
8653
  (b) => b.kind === "pr" || scenario.list().some((x) => x.id === b.sessionId && !x.archivedAt)
8470
8654
  );
8471
8655
  const withBlocks = waiting.length ? { ...out, blockedBy: waiting } : out;
8472
8656
  const noted = notes.has(w.id) ? { ...withBlocks, hasNote: true } : withBlocks;
8473
- return z7 && snoozeActive(z7, noted) ? { ...noted, snoozed: { until: z7.until } } : noted;
8657
+ return z8 && snoozeActive(z8, noted) ? { ...noted, snoozed: { until: z8.until } } : noted;
8474
8658
  })
8475
8659
  })
8476
8660
  );
@@ -8478,13 +8662,13 @@ async function startDemoServer(opts) {
8478
8662
  const body = await json2(c);
8479
8663
  const w = scenario.list().find((x) => x.id === c.req.param("id"));
8480
8664
  if (!w) return notFound(c);
8481
- let z7;
8482
- if (typeof body.until === "string") z7 = snoozeUntil(body.until, new Date(scenario.clockMs()));
8483
- else if (body.for === "2h" || body.for === "tomorrow" || body.for === "change") z7 = snoozeFor(body.for, w);
8665
+ let z8;
8666
+ if (typeof body.until === "string") z8 = snoozeUntil(body.until, new Date(scenario.clockMs()));
8667
+ else if (body.for === "2h" || body.for === "tomorrow" || body.for === "change") z8 = snoozeFor(body.for, w);
8484
8668
  else return c.json({ error: "for: '2h', 'tomorrow' or 'change', or until: a time" }, 400);
8485
- if (!z7) return c.json({ error: "not a time to snooze until: give one in the next 30 days" }, 400);
8486
- snoozes.set(w.id, z7);
8487
- return c.json({ ok: true, snooze: z7 });
8669
+ if (!z8) return c.json({ error: "not a time to snooze until: give one in the next 30 days" }, 400);
8670
+ snoozes.set(w.id, z8);
8671
+ return c.json({ ok: true, snooze: z8 });
8488
8672
  });
8489
8673
  app.delete("/api/sessions/:id/snooze", (c) => {
8490
8674
  snoozes.delete(c.req.param("id"));
@@ -8840,7 +9024,9 @@ async function startDemoServer(opts) {
8840
9024
  if (typeof body.target !== "string" || !body.target) return c.json({ error: "target is required" }, 400);
8841
9025
  const branch = typeof body.branch === "string" && body.branch.trim() ? body.branch.trim() : "main";
8842
9026
  const prompt = typeof body.prompt === "string" && body.prompt.trim() ? body.prompt.trim() : void 0;
8843
- const s = scenario.create(body.target, branch, prompt);
9027
+ const account = typeof body.account === "string" && body.account ? body.account : void 0;
9028
+ if (account !== void 0 && !isDemoAccount(account)) return c.json({ error: `Unknown Claude Code account: ${account}` }, 400);
9029
+ const s = scenario.create(body.target, branch, prompt, void 0, account);
8844
9030
  return c.json({ sessionId: s.id, launchDir: s.paths[0], paths: s.paths, ...prompt ? { started: "started" } : {} });
8845
9031
  });
8846
9032
  const demoTime = createDemoTime(() => scenario.clockMs());
@@ -8998,6 +9184,19 @@ async function startDemoServer(opts) {
8998
9184
  available: null,
8999
9185
  whatsNew: demoSeen === "2.1.0" ? null : "2.1.0"
9000
9186
  });
9187
+ app.get("/api/usage", (c) => c.json(demoUsage()));
9188
+ app.get("/api/accounts", (c) => c.json(DEMO_ACCOUNTS));
9189
+ app.post("/api/sessions/:id/account", async (c) => {
9190
+ const to = (await json2(c)).to;
9191
+ if (typeof to !== "string" || !to) return c.json({ error: "to is required" }, 400);
9192
+ const r = scenario.switchAccount(c.req.param("id"), to);
9193
+ if (!r) return notFound(c);
9194
+ return r.ok ? c.json(r.body) : c.json({ error: r.error }, r.status);
9195
+ });
9196
+ app.delete(
9197
+ "/api/sessions/:id/account",
9198
+ (c) => scenario.sessions.has(c.req.param("id")) ? c.json({ error: "no switch is waiting for its turn" }, 409) : notFound(c)
9199
+ );
9001
9200
  app.get("/api/updates", (c) => c.json(demoUpdates()));
9002
9201
  app.post("/api/updates/check", (c) => c.json(demoUpdates()));
9003
9202
  app.post("/api/updates/restart", (c) => c.json({ error: "No downloaded update to restart into." }, 409));
@@ -9212,6 +9411,18 @@ async function installAgentHooks(lean, onError = () => () => {
9212
9411
  await agent.events.install(lean ? LEAN_HOOKS : FULL_HOOKS, lean ? [] : LEGACY_HOOKS).catch(onError(agent.name));
9213
9412
  }
9214
9413
  }
9414
+ async function reinstallAgentSetup(lean) {
9415
+ await installAgentHooks(lean, (name) => swallow(`install ${name} hooks`));
9416
+ await setupAgentUsage(knownAgents(), loadConfig(), lean);
9417
+ }
9418
+ function startAccountSetupSync(lean, o = {}) {
9419
+ return startAccountSync({
9420
+ folders: () => (o.folders ?? agentAccountFolders)().filter((dir) => fs16.existsSync(dir)),
9421
+ apply: o.apply ?? (() => reinstallAgentSetup(lean)),
9422
+ onError: swallow("set up a changed Claude account"),
9423
+ ...o.everyMs !== void 0 ? { everyMs: o.everyMs } : {}
9424
+ });
9425
+ }
9215
9426
  function removeAgentHooksSync(lean) {
9216
9427
  const ours = (lean ? LEAN_HOOKS : FULL_HOOKS).map(({ owner, edge }) => ({ owner, edge }));
9217
9428
  for (const agent of hookedAgents()) bestEffort(`remove ${agent.name} hooks`, () => agent.events.removeSync([...ours, ...LEGACY_HOOKS]));
@@ -9363,7 +9574,10 @@ var webCommand = {
9363
9574
  );
9364
9575
  }
9365
9576
  await installAgentHooks(lean, (name) => swallow(`install ${name} hooks`));
9577
+ await setupAgentUsage(knownAgents(), loadConfig(), lean).catch(swallow("set up the usage readings"));
9578
+ const accountSync = startAccountSetupSync(lean);
9366
9579
  shutdown = () => {
9580
+ accountSync.stop();
9367
9581
  info(chalk.gray("\nStopping work web."));
9368
9582
  clearWebDiscovery(process.pid);
9369
9583
  removeAgentHooksSync(lean);
@@ -9491,8 +9705,10 @@ export {
9491
9705
  LEAN_HOOKS,
9492
9706
  LEGACY_HOOKS,
9493
9707
  installAgentHooks,
9708
+ reinstallAgentSetup,
9494
9709
  removeAgentHooksSync,
9710
+ startAccountSetupSync,
9495
9711
  stopExisting,
9496
9712
  webCommand
9497
9713
  };
9498
- //# sourceMappingURL=web-ZW37IV76.js.map
9714
+ //# sourceMappingURL=web-6QSSPH4I.js.map