@moberg_hr/work-tree 2.23.1 → 2.23.2

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 (227) hide show
  1. package/dist/{account-O62WFR7C.js → account-6ZQ3VFA2.js} +15 -13
  2. package/dist/{account-O62WFR7C.js.map → account-6ZQ3VFA2.js.map} +1 -1
  3. package/dist/{add-repo-FTAMMPVM.js → add-repo-WXDEKZRX.js} +6 -6
  4. package/dist/{answer-LKNMN2ZM.js → answer-L55DWMR5.js} +4 -4
  5. package/dist/{attach-A3KA4YTK.js → attach-KLVI7BHS.js} +9 -9
  6. package/dist/bin.js +2 -2
  7. package/dist/{block-3ZUFH2RO.js → block-BRNRP226.js} +6 -6
  8. package/dist/{broadcast-I23BZI3R.js → broadcast-GQE7H3MF.js} +2 -2
  9. package/dist/{catchup-G4EOJIZP.js → catchup-ZMG4OWF2.js} +7 -7
  10. package/dist/{child-MVNEFA2I.js → child-MPXXJ2QX.js} +4 -4
  11. package/dist/{chunk-N7T6NPE2.js → chunk-6S3DYLGH.js} +4 -4
  12. package/dist/{chunk-ZLPK2LQ3.js → chunk-7BH2PUYY.js} +3 -3
  13. package/dist/{chunk-NXS53NHR.js → chunk-7HQSILMM.js} +4 -4
  14. package/dist/{chunk-4HQEYZIM.js → chunk-A53OR6P5.js} +3 -3
  15. package/dist/{chunk-5QENUGSC.js → chunk-BBI4YQTS.js} +5 -5
  16. package/dist/{chunk-GHY7GZWN.js → chunk-BGQ6NUU7.js} +3 -3
  17. package/dist/{chunk-BI7HIO2I.js → chunk-BZOYUBK4.js} +2 -2
  18. package/dist/{chunk-6PZ7RCXK.js → chunk-C5BBVVHW.js} +2 -2
  19. package/dist/{chunk-INXHVNMZ.js → chunk-CRAGAIOS.js} +5 -5
  20. package/dist/{chunk-HQDQRC4F.js → chunk-DK3UMOX7.js} +2 -2
  21. package/dist/{chunk-TL7VLRRF.js → chunk-DNC2ZJOF.js} +3 -3
  22. package/dist/chunk-DYKA3LO3.js +9 -0
  23. package/dist/{chunk-MQXMYVZV.js → chunk-G4VKMMIC.js} +8 -8
  24. package/dist/{chunk-ZX4ONO5Y.js → chunk-HBYXSFLN.js} +4 -4
  25. package/dist/{chunk-HPUD5IGB.js → chunk-HO5KESIB.js} +2 -2
  26. package/dist/{chunk-4FN45EAF.js → chunk-HUGHF45U.js} +2 -2
  27. package/dist/{chunk-5SXTMOO6.js → chunk-IUVMVNIO.js} +4 -4
  28. package/dist/chunk-JVOQSU6R.js +151 -0
  29. package/dist/chunk-JVOQSU6R.js.map +1 -0
  30. package/dist/{chunk-OPV6BE3W.js → chunk-K6FD5WDW.js} +4 -4
  31. package/dist/{chunk-ET5K6S5H.js → chunk-KJAE7WO5.js} +21 -10
  32. package/dist/chunk-KJAE7WO5.js.map +1 -0
  33. package/dist/{chunk-IXZOZZGD.js → chunk-KWJ6S4NZ.js} +2 -2
  34. package/dist/{chunk-U4XSBYQW.js → chunk-LCYYJFSZ.js} +3 -3
  35. package/dist/{chunk-ZMJR4Z6O.js → chunk-LOFGDH5B.js} +2 -2
  36. package/dist/{chunk-YKTJL4SW.js → chunk-LW6VCL6S.js} +5 -5
  37. package/dist/{chunk-44QJVFOF.js → chunk-M2P722BR.js} +2 -2
  38. package/dist/{chunk-VH5FRKJM.js → chunk-MMEFW2PI.js} +2 -2
  39. package/dist/{chunk-ETAPX4JN.js → chunk-MYASALCU.js} +3 -3
  40. package/dist/{chunk-DHZ5DF6Y.js → chunk-MYXEX6BB.js} +2 -1
  41. package/dist/{chunk-WOY35FXP.js → chunk-NLU6MBYT.js} +8 -6
  42. package/dist/chunk-NLU6MBYT.js.map +1 -0
  43. package/dist/{chunk-W5YYTITQ.js → chunk-P53UYZZ4.js} +2 -2
  44. package/dist/{chunk-U2A2DHWP.js → chunk-PSALWCBD.js} +2 -2
  45. package/dist/{chunk-IVS2MAHD.js → chunk-QAIG5FSQ.js} +2 -2
  46. package/dist/{chunk-2MJQTFTI.js → chunk-QMWV4UKB.js} +3 -3
  47. package/dist/{chunk-MVBBESXK.js → chunk-QSSCVTFG.js} +3 -3
  48. package/dist/{chunk-ZNRPBP5O.js → chunk-RGKGJOES.js} +135 -4
  49. package/dist/chunk-RGKGJOES.js.map +1 -0
  50. package/dist/{chunk-24FQ5XXN.js → chunk-SF3DIIKN.js} +3 -3
  51. package/dist/{chunk-GTFMUWK6.js → chunk-SUHANL3G.js} +3 -3
  52. package/dist/{chunk-XTAYJDL2.js → chunk-VNZBFVGY.js} +3 -3
  53. package/dist/{chunk-IXC6EXVJ.js → chunk-VPZ5ILKT.js} +3 -3
  54. package/dist/{chunk-FHC6KHIH.js → chunk-VQEMPGJL.js} +2 -2
  55. package/dist/{chunk-2FNYJEOH.js → chunk-WH6DAD6D.js} +2 -2
  56. package/dist/{chunk-GN7EAXHU.js → chunk-XB4SCJWD.js} +82 -20
  57. package/dist/chunk-XB4SCJWD.js.map +1 -0
  58. package/dist/{chunk-HUWWMTNG.js → chunk-XL4YNA3L.js} +1 -1
  59. package/dist/chunk-XL4YNA3L.js.map +1 -0
  60. package/dist/{chunk-HNZ736XN.js → chunk-XT3FON6A.js} +2 -2
  61. package/dist/{chunk-ROEEXEN7.js → chunk-XWUX474Q.js} +4 -150
  62. package/dist/chunk-XWUX474Q.js.map +1 -0
  63. package/dist/{chunk-XWKN2HJD.js → chunk-ZHK5XOV5.js} +56 -56
  64. package/dist/{chunk-IRDWXDID.js → chunk-ZPDCVDE2.js} +2 -2
  65. package/dist/{cleanup-ANVUCOBK.js → cleanup-DRELB6UC.js} +22 -22
  66. package/dist/{cli-CAF6VCVO.js → cli-C3U2BC44.js} +3 -3
  67. package/dist/{color-7CQNI6Y4.js → color-T75ANAWG.js} +4 -4
  68. package/dist/{config-EXQY26W4.js → config-KI6JOXKW.js} +3 -3
  69. package/dist/{coordinate-LRY7LXS6.js → coordinate-4PPZN4U4.js} +5 -5
  70. package/dist/{diff-JRK3AUD5.js → diff-NDZPRQV7.js} +4 -4
  71. package/dist/{digest-2AFW3WBL.js → digest-H5YFX5WR.js} +4 -4
  72. package/dist/{fork-DSNMPWUE.js → fork-HHHATXVI.js} +18 -18
  73. package/dist/{history-RFIDCGQY.js → history-3Z7AS2AC.js} +2 -2
  74. package/dist/{hook-XBALB337.js → hook-KOK7NKCO.js} +8 -8
  75. package/dist/{hydrate-DAEY4PB6.js → hydrate-VI3XSZQH.js} +2 -2
  76. package/dist/{init-4BK3T34W.js → init-7NOKRHNJ.js} +6 -6
  77. package/dist/{keep-57TUKADV.js → keep-G62GSDOQ.js} +4 -4
  78. package/dist/{list-DRQRIT6U.js → list-CEVAZQ4V.js} +2 -2
  79. package/dist/{move-UEHJ375P.js → move-ISAW6RDM.js} +7 -7
  80. package/dist/{note-FHPDVBRI.js → note-YIVFXTGM.js} +4 -4
  81. package/dist/{overlaps-GKAKEUB6.js → overlaps-YBEHBRRK.js} +5 -5
  82. package/dist/{pin-CFTQDPPC.js → pin-J4IDSHRG.js} +4 -4
  83. package/dist/{pr-ZP4COZEZ.js → pr-Z7CPBBGT.js} +13 -13
  84. package/dist/{prune-IQB2T45B.js → prune-UA3UDZSM.js} +19 -19
  85. package/dist/{pty-host-BPFGJFBC.js → pty-host-JIQUP62K.js} +49 -7
  86. package/dist/pty-host-JIQUP62K.js.map +1 -0
  87. package/dist/{read-DHJ6VY44.js → read-DG4PCLFH.js} +4 -4
  88. package/dist/{recent-OZW2ZNJ4.js → recent-PGD6QYAH.js} +7 -7
  89. package/dist/{remove-MW25RLNV.js → remove-TPLA64HP.js} +20 -20
  90. package/dist/{report-II75EKM6.js → report-K3OTT2ED.js} +4 -4
  91. package/dist/{restart-4BGVRBX6.js → restart-477IX2JX.js} +4 -4
  92. package/dist/{resume-4J53KDCO.js → resume-OYBAJCYE.js} +7 -7
  93. package/dist/{review-WKB3K6LI.js → review-6PWFSBAO.js} +3 -3
  94. package/dist/{run-YS2D7WAQ.js → run-XEHF2N4A.js} +2 -2
  95. package/dist/{screen-VVRNQXVW.js → screen-SFU6TCDV.js} +4 -4
  96. package/dist/{search-MKYCKZF4.js → search-VJ3BGWPX.js} +2 -2
  97. package/dist/{section-Y6RDD3MN.js → section-ZLINSTGS.js} +4 -4
  98. package/dist/{send-AZM2XKN2.js → send-NBP2WYBG.js} +5 -5
  99. package/dist/{sessions-OER6VNQJ.js → sessions-UT4I7A43.js} +14 -14
  100. package/dist/{show-33VV3XCF.js → show-RK2EWOR6.js} +3 -3
  101. package/dist/{snooze-OFYZVVYS.js → snooze-T2WWIKZN.js} +4 -4
  102. package/dist/{start-OEQ5VW7Y.js → start-AWHOIA3Q.js} +4 -4
  103. package/dist/{status-HPYMNO2T.js → status-QE2DA6RR.js} +5 -5
  104. package/dist/{stop-QNICDWAU.js → stop-YOU3P3ZR.js} +4 -4
  105. package/dist/{sync-RH3M47QK.js → sync-74EFTPBJ.js} +19 -19
  106. package/dist/{time-PM72GK5W.js → time-ZGMZZ5OY.js} +5 -5
  107. package/dist/{time-actions-O3MCB7FU.js → time-actions-VAGRSY5B.js} +2 -2
  108. package/dist/{timesheet-HJXQ4KHL.js → timesheet-N74LPF5M.js} +11 -10
  109. package/dist/timesheet-N74LPF5M.js.map +1 -0
  110. package/dist/{tree-RGT736E3.js → tree-FXTCWC6D.js} +18 -18
  111. package/dist/{update-CMYVBWV3.js → update-5QSRHIWH.js} +9 -9
  112. package/dist/{usage-VEKD3JPL.js → usage-CW7CDFU3.js} +4 -4
  113. package/dist/{wait-RQZU3KDY.js → wait-XXC3I6DK.js} +5 -5
  114. package/dist/wd-bin.js +2 -2
  115. package/dist/web/assets/{PtyView-qP6blm2-.js → PtyView-BLTE5F3E.js} +2 -2
  116. package/dist/web/assets/{PtyView-qP6blm2-.js.map → PtyView-BLTE5F3E.js.map} +1 -1
  117. package/dist/web/assets/{index-DuFRboh6.js → index-BiadbzE6.js} +59 -59
  118. package/dist/web/assets/index-BiadbzE6.js.map +1 -0
  119. package/dist/web/assets/{index-yBTfBzDm.css → index-CfTmdABt.css} +1 -1
  120. package/dist/web/index.html +2 -2
  121. package/dist/{web-GOCU26ZD.js → web-SUSR4IAK.js} +87 -54
  122. package/dist/web-SUSR4IAK.js.map +1 -0
  123. package/npm-shrinkwrap.json +2 -2
  124. package/package.json +1 -1
  125. package/dist/chunk-ET5K6S5H.js.map +0 -1
  126. package/dist/chunk-GN7EAXHU.js.map +0 -1
  127. package/dist/chunk-HUWWMTNG.js.map +0 -1
  128. package/dist/chunk-NRX5V443.js +0 -9
  129. package/dist/chunk-ROEEXEN7.js.map +0 -1
  130. package/dist/chunk-WOY35FXP.js.map +0 -1
  131. package/dist/chunk-ZNRPBP5O.js.map +0 -1
  132. package/dist/pty-host-BPFGJFBC.js.map +0 -1
  133. package/dist/timesheet-HJXQ4KHL.js.map +0 -1
  134. package/dist/web/assets/index-DuFRboh6.js.map +0 -1
  135. package/dist/web-GOCU26ZD.js.map +0 -1
  136. /package/dist/{add-repo-FTAMMPVM.js.map → add-repo-WXDEKZRX.js.map} +0 -0
  137. /package/dist/{answer-LKNMN2ZM.js.map → answer-L55DWMR5.js.map} +0 -0
  138. /package/dist/{attach-A3KA4YTK.js.map → attach-KLVI7BHS.js.map} +0 -0
  139. /package/dist/{block-3ZUFH2RO.js.map → block-BRNRP226.js.map} +0 -0
  140. /package/dist/{broadcast-I23BZI3R.js.map → broadcast-GQE7H3MF.js.map} +0 -0
  141. /package/dist/{catchup-G4EOJIZP.js.map → catchup-ZMG4OWF2.js.map} +0 -0
  142. /package/dist/{child-MVNEFA2I.js.map → child-MPXXJ2QX.js.map} +0 -0
  143. /package/dist/{chunk-N7T6NPE2.js.map → chunk-6S3DYLGH.js.map} +0 -0
  144. /package/dist/{chunk-ZLPK2LQ3.js.map → chunk-7BH2PUYY.js.map} +0 -0
  145. /package/dist/{chunk-NXS53NHR.js.map → chunk-7HQSILMM.js.map} +0 -0
  146. /package/dist/{chunk-4HQEYZIM.js.map → chunk-A53OR6P5.js.map} +0 -0
  147. /package/dist/{chunk-5QENUGSC.js.map → chunk-BBI4YQTS.js.map} +0 -0
  148. /package/dist/{chunk-GHY7GZWN.js.map → chunk-BGQ6NUU7.js.map} +0 -0
  149. /package/dist/{chunk-BI7HIO2I.js.map → chunk-BZOYUBK4.js.map} +0 -0
  150. /package/dist/{chunk-6PZ7RCXK.js.map → chunk-C5BBVVHW.js.map} +0 -0
  151. /package/dist/{chunk-INXHVNMZ.js.map → chunk-CRAGAIOS.js.map} +0 -0
  152. /package/dist/{chunk-HQDQRC4F.js.map → chunk-DK3UMOX7.js.map} +0 -0
  153. /package/dist/{chunk-TL7VLRRF.js.map → chunk-DNC2ZJOF.js.map} +0 -0
  154. /package/dist/{chunk-NRX5V443.js.map → chunk-DYKA3LO3.js.map} +0 -0
  155. /package/dist/{chunk-MQXMYVZV.js.map → chunk-G4VKMMIC.js.map} +0 -0
  156. /package/dist/{chunk-ZX4ONO5Y.js.map → chunk-HBYXSFLN.js.map} +0 -0
  157. /package/dist/{chunk-HPUD5IGB.js.map → chunk-HO5KESIB.js.map} +0 -0
  158. /package/dist/{chunk-4FN45EAF.js.map → chunk-HUGHF45U.js.map} +0 -0
  159. /package/dist/{chunk-5SXTMOO6.js.map → chunk-IUVMVNIO.js.map} +0 -0
  160. /package/dist/{chunk-OPV6BE3W.js.map → chunk-K6FD5WDW.js.map} +0 -0
  161. /package/dist/{chunk-IXZOZZGD.js.map → chunk-KWJ6S4NZ.js.map} +0 -0
  162. /package/dist/{chunk-U4XSBYQW.js.map → chunk-LCYYJFSZ.js.map} +0 -0
  163. /package/dist/{chunk-ZMJR4Z6O.js.map → chunk-LOFGDH5B.js.map} +0 -0
  164. /package/dist/{chunk-YKTJL4SW.js.map → chunk-LW6VCL6S.js.map} +0 -0
  165. /package/dist/{chunk-44QJVFOF.js.map → chunk-M2P722BR.js.map} +0 -0
  166. /package/dist/{chunk-VH5FRKJM.js.map → chunk-MMEFW2PI.js.map} +0 -0
  167. /package/dist/{chunk-ETAPX4JN.js.map → chunk-MYASALCU.js.map} +0 -0
  168. /package/dist/{chunk-DHZ5DF6Y.js.map → chunk-MYXEX6BB.js.map} +0 -0
  169. /package/dist/{chunk-W5YYTITQ.js.map → chunk-P53UYZZ4.js.map} +0 -0
  170. /package/dist/{chunk-U2A2DHWP.js.map → chunk-PSALWCBD.js.map} +0 -0
  171. /package/dist/{chunk-IVS2MAHD.js.map → chunk-QAIG5FSQ.js.map} +0 -0
  172. /package/dist/{chunk-2MJQTFTI.js.map → chunk-QMWV4UKB.js.map} +0 -0
  173. /package/dist/{chunk-MVBBESXK.js.map → chunk-QSSCVTFG.js.map} +0 -0
  174. /package/dist/{chunk-24FQ5XXN.js.map → chunk-SF3DIIKN.js.map} +0 -0
  175. /package/dist/{chunk-GTFMUWK6.js.map → chunk-SUHANL3G.js.map} +0 -0
  176. /package/dist/{chunk-XTAYJDL2.js.map → chunk-VNZBFVGY.js.map} +0 -0
  177. /package/dist/{chunk-IXC6EXVJ.js.map → chunk-VPZ5ILKT.js.map} +0 -0
  178. /package/dist/{chunk-FHC6KHIH.js.map → chunk-VQEMPGJL.js.map} +0 -0
  179. /package/dist/{chunk-2FNYJEOH.js.map → chunk-WH6DAD6D.js.map} +0 -0
  180. /package/dist/{chunk-HNZ736XN.js.map → chunk-XT3FON6A.js.map} +0 -0
  181. /package/dist/{chunk-XWKN2HJD.js.map → chunk-ZHK5XOV5.js.map} +0 -0
  182. /package/dist/{chunk-IRDWXDID.js.map → chunk-ZPDCVDE2.js.map} +0 -0
  183. /package/dist/{cleanup-ANVUCOBK.js.map → cleanup-DRELB6UC.js.map} +0 -0
  184. /package/dist/{cli-CAF6VCVO.js.map → cli-C3U2BC44.js.map} +0 -0
  185. /package/dist/{color-7CQNI6Y4.js.map → color-T75ANAWG.js.map} +0 -0
  186. /package/dist/{config-EXQY26W4.js.map → config-KI6JOXKW.js.map} +0 -0
  187. /package/dist/{coordinate-LRY7LXS6.js.map → coordinate-4PPZN4U4.js.map} +0 -0
  188. /package/dist/{diff-JRK3AUD5.js.map → diff-NDZPRQV7.js.map} +0 -0
  189. /package/dist/{digest-2AFW3WBL.js.map → digest-H5YFX5WR.js.map} +0 -0
  190. /package/dist/{fork-DSNMPWUE.js.map → fork-HHHATXVI.js.map} +0 -0
  191. /package/dist/{history-RFIDCGQY.js.map → history-3Z7AS2AC.js.map} +0 -0
  192. /package/dist/{hook-XBALB337.js.map → hook-KOK7NKCO.js.map} +0 -0
  193. /package/dist/{hydrate-DAEY4PB6.js.map → hydrate-VI3XSZQH.js.map} +0 -0
  194. /package/dist/{init-4BK3T34W.js.map → init-7NOKRHNJ.js.map} +0 -0
  195. /package/dist/{keep-57TUKADV.js.map → keep-G62GSDOQ.js.map} +0 -0
  196. /package/dist/{list-DRQRIT6U.js.map → list-CEVAZQ4V.js.map} +0 -0
  197. /package/dist/{move-UEHJ375P.js.map → move-ISAW6RDM.js.map} +0 -0
  198. /package/dist/{note-FHPDVBRI.js.map → note-YIVFXTGM.js.map} +0 -0
  199. /package/dist/{overlaps-GKAKEUB6.js.map → overlaps-YBEHBRRK.js.map} +0 -0
  200. /package/dist/{pin-CFTQDPPC.js.map → pin-J4IDSHRG.js.map} +0 -0
  201. /package/dist/{pr-ZP4COZEZ.js.map → pr-Z7CPBBGT.js.map} +0 -0
  202. /package/dist/{prune-IQB2T45B.js.map → prune-UA3UDZSM.js.map} +0 -0
  203. /package/dist/{read-DHJ6VY44.js.map → read-DG4PCLFH.js.map} +0 -0
  204. /package/dist/{recent-OZW2ZNJ4.js.map → recent-PGD6QYAH.js.map} +0 -0
  205. /package/dist/{remove-MW25RLNV.js.map → remove-TPLA64HP.js.map} +0 -0
  206. /package/dist/{report-II75EKM6.js.map → report-K3OTT2ED.js.map} +0 -0
  207. /package/dist/{restart-4BGVRBX6.js.map → restart-477IX2JX.js.map} +0 -0
  208. /package/dist/{resume-4J53KDCO.js.map → resume-OYBAJCYE.js.map} +0 -0
  209. /package/dist/{review-WKB3K6LI.js.map → review-6PWFSBAO.js.map} +0 -0
  210. /package/dist/{run-YS2D7WAQ.js.map → run-XEHF2N4A.js.map} +0 -0
  211. /package/dist/{screen-VVRNQXVW.js.map → screen-SFU6TCDV.js.map} +0 -0
  212. /package/dist/{search-MKYCKZF4.js.map → search-VJ3BGWPX.js.map} +0 -0
  213. /package/dist/{section-Y6RDD3MN.js.map → section-ZLINSTGS.js.map} +0 -0
  214. /package/dist/{send-AZM2XKN2.js.map → send-NBP2WYBG.js.map} +0 -0
  215. /package/dist/{sessions-OER6VNQJ.js.map → sessions-UT4I7A43.js.map} +0 -0
  216. /package/dist/{show-33VV3XCF.js.map → show-RK2EWOR6.js.map} +0 -0
  217. /package/dist/{snooze-OFYZVVYS.js.map → snooze-T2WWIKZN.js.map} +0 -0
  218. /package/dist/{start-OEQ5VW7Y.js.map → start-AWHOIA3Q.js.map} +0 -0
  219. /package/dist/{status-HPYMNO2T.js.map → status-QE2DA6RR.js.map} +0 -0
  220. /package/dist/{stop-QNICDWAU.js.map → stop-YOU3P3ZR.js.map} +0 -0
  221. /package/dist/{sync-RH3M47QK.js.map → sync-74EFTPBJ.js.map} +0 -0
  222. /package/dist/{time-PM72GK5W.js.map → time-ZGMZZ5OY.js.map} +0 -0
  223. /package/dist/{time-actions-O3MCB7FU.js.map → time-actions-VAGRSY5B.js.map} +0 -0
  224. /package/dist/{tree-RGT736E3.js.map → tree-FXTCWC6D.js.map} +0 -0
  225. /package/dist/{update-CMYVBWV3.js.map → update-5QSRHIWH.js.map} +0 -0
  226. /package/dist/{usage-VEKD3JPL.js.map → usage-CW7CDFU3.js.map} +0 -0
  227. /package/dist/{wait-RQZU3KDY.js.map → wait-XXC3I6DK.js.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  workSteps,
5
5
  workedBetween,
6
6
  workedByDay
7
- } from "./chunk-HUWWMTNG.js";
7
+ } from "./chunk-XL4YNA3L.js";
8
8
  import {
9
9
  dayKey
10
10
  } from "./chunk-NEJVK5CF.js";
@@ -153,4 +153,4 @@ export {
153
153
  sessionTokens,
154
154
  sessionWorkTime
155
155
  };
156
- //# sourceMappingURL=chunk-IVS2MAHD.js.map
156
+ //# sourceMappingURL=chunk-QAIG5FSQ.js.map
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CONTEXT_WARN
4
- } from "./chunk-HQDQRC4F.js";
4
+ } from "./chunk-DK3UMOX7.js";
5
5
  import {
6
6
  MAX_THREAD_BODY,
7
7
  isThreadCode
8
8
  } from "./chunk-FGPXMAYU.js";
9
9
  import {
10
10
  commandsFor
11
- } from "./chunk-HUWWMTNG.js";
11
+ } from "./chunk-XL4YNA3L.js";
12
12
  import {
13
13
  json,
14
14
  withDb
@@ -184,4 +184,4 @@ export {
184
184
  isSessionCi,
185
185
  createCiStore
186
186
  };
187
- //# sourceMappingURL=chunk-2MJQTFTI.js.map
187
+ //# sourceMappingURL=chunk-QMWV4UKB.js.map
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  computeDiff,
4
4
  isInsideRoot
5
- } from "./chunk-IRDWXDID.js";
5
+ } from "./chunk-ZPDCVDE2.js";
6
6
  import {
7
7
  createFsWatcher,
8
8
  loadHistory
9
- } from "./chunk-HUWWMTNG.js";
9
+ } from "./chunk-XL4YNA3L.js";
10
10
  import {
11
11
  packageRoot
12
12
  } from "./chunk-NWKVTUTN.js";
@@ -535,4 +535,4 @@ export {
535
535
  submitReviewSchema,
536
536
  resolveSchema
537
537
  };
538
- //# sourceMappingURL=chunk-MVBBESXK.js.map
538
+ //# sourceMappingURL=chunk-QSSCVTFG.js.map
@@ -1,8 +1,12 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ continueWhenReady
4
+ } from "./chunk-XWUX474Q.js";
2
5
  import {
3
6
  validGrid
4
7
  } from "./chunk-6KMG4WNW.js";
5
8
  import {
9
+ PtyHostClient,
6
10
  ensureHost,
7
11
  probeHostDetailed
8
12
  } from "./chunk-NREZVTBP.js";
@@ -10,11 +14,18 @@ import {
10
14
  hostInfoPath,
11
15
  readHostInfo
12
16
  } from "./chunk-NS7WH53I.js";
17
+ import {
18
+ json,
19
+ tx,
20
+ withDb
21
+ } from "./chunk-QGUBOOEN.js";
13
22
  import {
14
23
  agentFor,
15
24
  agentSettings,
16
25
  assistantAgent,
17
- internalAgent
26
+ internalAgent,
27
+ liveAgents,
28
+ logSwallowed
18
29
  } from "./chunk-NWKVTUTN.js";
19
30
  import {
20
31
  detachHere,
@@ -32,6 +43,98 @@ import {
32
43
  debugLog
33
44
  } from "./chunk-IAKOKZYW.js";
34
45
 
46
+ // src/core/pty/restart-carry-on.ts
47
+ var KEY = "pty:interrupted";
48
+ var CARRY_ON_FRESH_MS = 30 * 6e4;
49
+ var CARRY_ON_READY_MS = 18e4;
50
+ var asRecord = (v) => {
51
+ const o = v;
52
+ return o && Array.isArray(o.ids) && o.ids.every((x) => typeof x === "string") && typeof o.at === "string" ? o : null;
53
+ };
54
+ function interruptedBy(terminals, agents) {
55
+ const mid = new Set(agents.filter((a) => a.state === "busy" || a.state === "waiting").map((a) => a.pid));
56
+ return [...new Set(terminals.filter((t) => mid.has(t.pid)).map((t) => t.id))];
57
+ }
58
+ function freshIds(d, now) {
59
+ const row = d.prepare("SELECT value FROM meta WHERE key = ?").get(KEY);
60
+ if (!row) return [];
61
+ const rec = asRecord(json.parse(row.value));
62
+ if (rec && now - Date.parse(rec.at) <= CARRY_ON_FRESH_MS) return rec.ids;
63
+ d.prepare("DELETE FROM meta WHERE key = ?").run(KEY);
64
+ return [];
65
+ }
66
+ function write(d, ids, at) {
67
+ if (ids.length)
68
+ d.prepare("INSERT OR REPLACE INTO meta (key, value) VALUES (?, ?)").run(KEY, JSON.stringify({ ids, at: at.toISOString() }));
69
+ else d.prepare("DELETE FROM meta WHERE key = ?").run(KEY);
70
+ }
71
+ function recordInterrupted(ids, now = /* @__PURE__ */ new Date()) {
72
+ return tx((d) => {
73
+ const all = [.../* @__PURE__ */ new Set([...freshIds(d, now.getTime()), ...ids])];
74
+ write(d, all, now);
75
+ return all;
76
+ });
77
+ }
78
+ function unrecordInterrupted(ids, now = Date.now()) {
79
+ if (!ids.length) return;
80
+ tx((d) => {
81
+ const left = freshIds(d, now).filter((id) => !ids.includes(id));
82
+ write(d, left, new Date(now));
83
+ });
84
+ }
85
+ function pendingInterrupted(now = Date.now()) {
86
+ return tx((d) => freshIds(d, now));
87
+ }
88
+ function interruptedWaiting(now = Date.now()) {
89
+ return withDb((d) => {
90
+ const row = d.prepare("SELECT value FROM meta WHERE key = ?").get(KEY);
91
+ const rec = row ? asRecord(json.parse(row.value)) : null;
92
+ return rec && now - Date.parse(rec.at) <= CARRY_ON_FRESH_MS ? rec.ids.length : 0;
93
+ });
94
+ }
95
+ function doneInterrupted(id) {
96
+ tx((d) => {
97
+ const row = d.prepare("SELECT value FROM meta WHERE key = ?").get(KEY);
98
+ const rec = row ? asRecord(json.parse(row.value)) : null;
99
+ if (!rec) return;
100
+ const left = rec.ids.filter((x) => x !== id);
101
+ if (left.length) d.prepare("INSERT OR REPLACE INTO meta (key, value) VALUES (?, ?)").run(KEY, JSON.stringify({ ...rec, ids: left }));
102
+ else d.prepare("DELETE FROM meta WHERE key = ?").run(KEY);
103
+ });
104
+ }
105
+ async function carryOn(ids, io, opts = {}) {
106
+ const one = async (id) => {
107
+ if (io.pidOf(id) === null) return "not-restored";
108
+ let gone = false;
109
+ let failed = false;
110
+ const told = await continueWhenReady(
111
+ id,
112
+ {
113
+ ready: () => {
114
+ const pid = io.pidOf(id);
115
+ if (pid === null) gone = true;
116
+ return gone || io.ready(id, pid);
117
+ },
118
+ send: async (_id, text) => {
119
+ if (gone) return;
120
+ failed = !await io.submit(id, text).catch(() => false);
121
+ },
122
+ ...io.sleep ? { sleep: io.sleep } : {}
123
+ },
124
+ { everyMs: opts.everyMs, timeoutMs: opts.timeoutMs ?? CARRY_ON_READY_MS }
125
+ );
126
+ return gone ? "not-restored" : !told ? "never-ready" : failed ? "failed" : "told";
127
+ };
128
+ const out = await Promise.all(
129
+ ids.map(async (id) => {
130
+ const how = await one(id);
131
+ io.done?.(id);
132
+ return [id, how];
133
+ })
134
+ );
135
+ return Object.fromEntries(out);
136
+ }
137
+
35
138
  // src/core/pty/host-control.ts
36
139
  import fs from "fs";
37
140
  import { execFile } from "child_process";
@@ -57,20 +160,43 @@ function commandLineOf(pid) {
57
160
  function looksLikeHost(commandLine) {
58
161
  return !!commandLine && /(^|\s|["'\\/])pty-host(\s|$|["'])/.test(commandLine) && !/\bpty-host\b.*--(stop|restart|status)\b/.test(commandLine);
59
162
  }
163
+ async function noteInterrupted(info) {
164
+ try {
165
+ const agents = liveAgents().filter((a) => a.state === "busy" || a.state === "waiting");
166
+ if (!agents.length) return [];
167
+ const terminals = await Promise.race([
168
+ new PtyHostClient(info).list(),
169
+ new Promise((_, reject) => setTimeout(() => reject(new Error("the host did not list its terminals in time")), 3e3).unref())
170
+ ]);
171
+ const ids = interruptedBy(terminals, agents);
172
+ if (ids.length) recordInterrupted(ids);
173
+ return ids;
174
+ } catch (err) {
175
+ logSwallowed("note the sessions a host stop interrupts", err);
176
+ return [];
177
+ }
178
+ }
60
179
  async function stopHost(kill = killTree, probeTimeoutMs = 5e3, opts = {}) {
180
+ const note = opts.noteInterrupted === void 0 ? noteInterrupted : opts.noteInterrupted;
181
+ const noteThenKill = async (info) => {
182
+ const added = note ? await note(info) : [];
183
+ const outcome = killAndForget(kill, info.pid);
184
+ if (outcome !== "stopped" && added.length) unrecordInterrupted(added);
185
+ return outcome;
186
+ };
61
187
  const hostInfo = readHostInfo();
62
188
  if (!hostInfo) return "not-running";
63
189
  const probe = await probeHostDetailed(hostInfo, probeTimeoutMs);
64
190
  if (probe.kind === "timeout") {
65
191
  const ours = opts.isOurHost ?? (async (pid) => isPidAlive(pid) && looksLikeHost(await commandLineOf(pid)));
66
192
  if (!opts.force || !await ours(hostInfo.pid)) return "unresponsive";
67
- return killAndForget(kill, hostInfo.pid);
193
+ return noteThenKill(hostInfo);
68
194
  }
69
195
  if (probe.kind !== "host" || probe.pid !== hostInfo.pid) {
70
196
  removeInfo();
71
197
  return "stale-file";
72
198
  }
73
- return killAndForget(kill, hostInfo.pid);
199
+ return noteThenKill(hostInfo);
74
200
  }
75
201
  function killAndForget(kill, pid) {
76
202
  const ok = kill(pid);
@@ -187,8 +313,13 @@ function resumeFromParams(params) {
187
313
  export {
188
314
  withResume,
189
315
  resumeFromParams,
316
+ CARRY_ON_FRESH_MS,
317
+ pendingInterrupted,
318
+ interruptedWaiting,
319
+ doneInterrupted,
320
+ carryOn,
190
321
  stopHost,
191
322
  restartHost,
192
323
  ensureAgentPath
193
324
  };
194
- //# sourceMappingURL=chunk-ZNRPBP5O.js.map
325
+ //# sourceMappingURL=chunk-RGKGJOES.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/pty/restart-carry-on.ts","../src/core/pty/host-control.ts","../src/core/platform/shell-path.ts","../src/core/agents/agent-path.ts","../src/core/pty/resume.ts"],"sourcesContent":["import type { LiveAgent } from '../agents/types.js';\nimport { json, tx, withDb } from '../platform/db.js';\nimport { continueWhenReady } from '../sessions/account-switch.js';\n\n/**\n * The turns a PTY host restart cut off, carried on by the new host (reported: \"just restarted terminal host after\n * update, do all sessions continue work automatically?\" — they didn't: five sessions sat idle, one of them having lost\n * the permission question it was waiting on). As a switch of account does (account-switch.ts):\n *\n * - **Before** the old host is stopped (`stopHost`, every way: `work pty-host --restart` / `--stop`, the dashboard's\n * Restart it, an update), the sessions it runs whose agent is mid-turn or waiting on you are recorded (`meta`\n * `pty:interrupted`, with when): the host's own terminals (its session ids and their pids) against Claude Code's\n * state for each process. A stop that fails takes them out again — those sessions weren't interrupted.\n * - **After** the new host restored its sessions, it reads the record and, for each one it restored, waits for its\n * agent to say it is at its prompt (`continueWhenReady`, the switch's), then types `continue`. Each one is taken out\n * of the record once dealt with, so a host stopped again before it got to them leaves them for the next one.\n *\n * A record older than CARRY_ON_FRESH_MS is dropped unread: a host stopped long ago and started today doesn't resume\n * yesterday's turns behind your back. One that was idle — its turn done, or at its prompt with background commands\n * (`shell`) — is left alone.\n */\nconst KEY = 'pty:interrupted';\nexport const CARRY_ON_FRESH_MS = 30 * 60_000;\n/** Restoring many sessions at once is slow: each one gets this long to be ready. */\nexport const CARRY_ON_READY_MS = 180_000;\n\ninterface Interrupted {\n ids: string[];\n at: string;\n}\n\nconst asRecord = (v: unknown): Interrupted | null => {\n const o = v as Interrupted | null;\n return o && Array.isArray(o.ids) && o.ids.every((x) => typeof x === 'string') && typeof o.at === 'string' ? o : null;\n};\n\n/**\n * The host's sessions whose agent is mid-turn or waiting on you: the host's terminals (`terminals`: session id → its\n * process) against the agents' own states. Pure.\n */\nexport function interruptedBy(\n terminals: ReadonlyArray<{ id: string; pid: number }>,\n agents: readonly Pick<LiveAgent, 'pid' | 'state'>[],\n): string[] {\n const mid = new Set(agents.filter((a) => a.state === 'busy' || a.state === 'waiting').map((a) => a.pid));\n return [...new Set(terminals.filter((t) => mid.has(t.pid)).map((t) => t.id))];\n}\n\n/** The record's ids when it is fresh, else none (a stale one is removed). Runs inside a transaction. */\nfunction freshIds(d: Parameters<Parameters<typeof tx>[0]>[0], now: number): string[] {\n const row = d.prepare('SELECT value FROM meta WHERE key = ?').get(KEY) as { value: string } | undefined;\n if (!row) return [];\n const rec = asRecord(json.parse(row.value));\n if (rec && now - Date.parse(rec.at) <= CARRY_ON_FRESH_MS) return rec.ids;\n d.prepare('DELETE FROM meta WHERE key = ?').run(KEY);\n return [];\n}\n\nfunction write(d: Parameters<Parameters<typeof tx>[0]>[0], ids: readonly string[], at: Date): void {\n if (ids.length)\n d.prepare('INSERT OR REPLACE INTO meta (key, value) VALUES (?, ?)').run(KEY, JSON.stringify({ ids, at: at.toISOString() }));\n else d.prepare('DELETE FROM meta WHERE key = ?').run(KEY);\n}\n\n/**\n * Record these as interrupted by the stop about to happen, with those an earlier stop recorded that weren't dealt\n * with yet (a host stopped again before it got to them). Returns the whole list now.\n */\nexport function recordInterrupted(ids: readonly string[], now = new Date()): string[] {\n return tx((d) => {\n const all = [...new Set([...freshIds(d, now.getTime()), ...ids])];\n write(d, all, now);\n return all;\n });\n}\n\n/** A stop that didn't happen: these weren't interrupted after all (the rest of the record stays). */\nexport function unrecordInterrupted(ids: readonly string[], now = Date.now()): void {\n if (!ids.length) return;\n tx((d) => {\n const left = freshIds(d, now).filter((id) => !ids.includes(id));\n write(d, left, new Date(now));\n });\n}\n\n/** The ones waiting for a host to carry them on (fresh only). */\nexport function pendingInterrupted(now = Date.now()): string[] {\n return tx((d) => freshIds(d, now));\n}\n\n/** How many are waiting (fresh only; for what a restart says). */\nexport function interruptedWaiting(now = Date.now()): number {\n return withDb((d) => {\n const row = d.prepare('SELECT value FROM meta WHERE key = ?').get(KEY) as { value: string } | undefined;\n const rec = row ? asRecord(json.parse(row.value)) : null;\n return rec && now - Date.parse(rec.at) <= CARRY_ON_FRESH_MS ? rec.ids.length : 0;\n });\n}\n\n/** One dealt with (told, not restored, never ready, failed): out of the record. */\nexport function doneInterrupted(id: string): void {\n tx((d) => {\n const row = d.prepare('SELECT value FROM meta WHERE key = ?').get(KEY) as { value: string } | undefined;\n const rec = row ? asRecord(json.parse(row.value)) : null;\n if (!rec) return;\n const left = rec.ids.filter((x) => x !== id);\n if (left.length) d.prepare('INSERT OR REPLACE INTO meta (key, value) VALUES (?, ?)').run(KEY, JSON.stringify({ ...rec, ids: left }));\n else d.prepare('DELETE FROM meta WHERE key = ?').run(KEY);\n });\n}\n\nexport interface CarryOnIo {\n /** Its agent's process in the new host: null when it wasn't restored, or its terminal has ended. */\n pidOf: (id: string) => number | null;\n /** That agent is at its prompt. */\n ready: (id: string, pid: number) => boolean;\n /** Type `text` into its prompt and submit it. */\n submit: (id: string, text: string) => Promise<boolean>;\n /** One was dealt with (each, as it is). */\n done?: (id: string) => void;\n sleep?: (ms: number) => Promise<void>;\n}\n\nexport type CarryOnOutcome = 'told' | 'not-restored' | 'never-ready' | 'failed';\n\n/**\n * Tell each restored one to continue once it is ready (`continueWhenReady`): all in parallel, each up to `timeoutMs`.\n * One whose terminal isn't there (not restored, or it ended meanwhile) stops being waited for. Returns each outcome.\n */\nexport async function carryOn(\n ids: readonly string[],\n io: CarryOnIo,\n opts: { everyMs?: number; timeoutMs?: number } = {},\n): Promise<Record<string, CarryOnOutcome>> {\n const one = async (id: string): Promise<CarryOnOutcome> => {\n if (io.pidOf(id) === null) return 'not-restored';\n let gone = false;\n let failed = false;\n const told = await continueWhenReady(\n id,\n {\n ready: () => {\n const pid = io.pidOf(id);\n if (pid === null) gone = true;\n return gone || io.ready(id, pid!);\n },\n send: async (_id, text) => {\n if (gone) return;\n failed = !(await io.submit(id, text).catch(() => false));\n },\n ...(io.sleep ? { sleep: io.sleep } : {}),\n },\n { everyMs: opts.everyMs, timeoutMs: opts.timeoutMs ?? CARRY_ON_READY_MS },\n );\n return gone ? 'not-restored' : !told ? 'never-ready' : failed ? 'failed' : 'told';\n };\n const out = await Promise.all(\n ids.map(async (id) => {\n const how = await one(id);\n io.done?.(id);\n return [id, how] as const;\n }),\n );\n return Object.fromEntries(out);\n}\n","import fs from 'node:fs';\nimport { execFile } from 'node:child_process';\nimport { programPath } from '../platform/program-path.js';\nimport { ensureHost, probeHostDetailed } from './pty-host-client.js';\nimport { hostInfoPath, readHostInfo } from './pty-host-protocol.js';\nimport { isPidAlive, killTree } from '../platform/process.js';\nimport { liveAgents } from '../agents/index.js';\nimport { interruptedBy, recordInterrupted, unrecordInterrupted } from './restart-carry-on.js';\nimport { PtyHostClient } from './pty-host-client.js';\nimport type { HostInfo } from './pty-host-protocol.js';\nimport { logSwallowed } from '../platform/best-effort.js';\n\n/**\n * Stopping and restarting the PTY host — the CLI's `work pty-host\n * --stop/--restart` and the dashboard's Restart share it. The persisted\n * session list stays, so the next host restores them with --continue.\n */\n\nexport type StopOutcome = 'stopped' | 'not-running' | 'stale-file' | 'unresponsive' | 'failed';\n\n/** A process's command line, or null when it isn't running or can't be read (Windows: CIM; elsewhere: ps). */\nexport function commandLineOf(pid: number): Promise<string | null> {\n return new Promise((resolve) => {\n const done = (err: Error | null, out: string) => resolve(err ? null : out.trim() || null);\n if (process.platform === 'win32')\n execFile(\n programPath('powershell'),\n ['-NoProfile', '-Command', `(Get-CimInstance Win32_Process -Filter 'ProcessId=${Math.trunc(pid)}').CommandLine`],\n { windowsHide: true, timeout: 15_000 },\n (err, out) => done(err, String(out)),\n );\n else\n execFile(programPath('ps'), ['-o', 'args=', '-p', String(Math.trunc(pid))], { windowsHide: true, timeout: 5000 }, (err, out) =>\n done(err, String(out)),\n );\n });\n}\n\n/**\n * The recorded pid really is a running PTY host of work's: alive, and its command line runs `pty-host` (not a\n * `--stop`/`--restart`/`--status` call). Pids get reused — on Windows fast — so a host that doesn't answer is only\n * force-stopped after this: blind, it could take down any process that took its number. Pure over its inputs.\n */\nexport function looksLikeHost(commandLine: string | null): boolean {\n return (\n !!commandLine && /(^|\\s|[\"'\\\\/])pty-host(\\s|$|[\"'])/.test(commandLine) && !/\\bpty-host\\b.*--(stop|restart|status)\\b/.test(commandLine)\n );\n}\n\n/**\n * Before the host is stopped: which of its sessions are mid-turn or waiting on you, recorded for the next host to tell\n * them to continue (restart-carry-on.ts). The agents' own states first — none busy (the usual stop): nothing more is\n * asked —, then the host's terminals (its session ids and their pids), never a guess from folders. Returns the ones\n * this stop added, to take out again should it fail. Never fails the stop: what can't be read records nothing.\n */\nexport async function noteInterrupted(info: HostInfo): Promise<string[]> {\n try {\n const agents = liveAgents().filter((a) => a.state === 'busy' || a.state === 'waiting');\n if (!agents.length) return [];\n // A hung host (a forced stop) may not answer: a few seconds, then nothing is recorded.\n const terminals = await Promise.race([\n new PtyHostClient(info).list(),\n new Promise<never>((_, reject) => setTimeout(() => reject(new Error('the host did not list its terminals in time')), 3000).unref()),\n ]);\n const ids = interruptedBy(terminals, agents);\n if (ids.length) recordInterrupted(ids);\n return ids;\n } catch (err) {\n logSwallowed('note the sessions a host stop interrupts', err);\n return [];\n }\n}\n\n/**\n * Kill the running host and its PTYs. Only a PID that proves it's our host gets killed: it answers /health with the\n * discovery file's token and that same PID — or, with `force`, it doesn't answer at all (hung: a ConPTY start that\n * blocked its event loop) but its process is alive and runs `work pty-host` (`looksLikeHost`). The file survives\n * crashes and reboots (TerminateProcess skips cleanup), and Windows reuses PIDs. A stale file is just removed.\n * What it interrupts is noted first (`noteInterrupted`; tests pass null), and taken out again when the kill fails.\n */\nexport async function stopHost(\n kill: (pid: number) => boolean = killTree,\n probeTimeoutMs = 5000,\n opts: {\n force?: boolean;\n isOurHost?: (pid: number) => Promise<boolean>;\n noteInterrupted?: ((info: HostInfo) => Promise<string[]>) | null;\n } = {},\n): Promise<StopOutcome> {\n const note = opts.noteInterrupted === undefined ? noteInterrupted : opts.noteInterrupted;\n const noteThenKill = async (info: HostInfo): Promise<StopOutcome> => {\n const added = note ? await note(info) : [];\n const outcome = killAndForget(kill, info.pid);\n // Not stopped: those sessions weren't interrupted after all.\n if (outcome !== 'stopped' && added.length) unrecordInterrupted(added);\n return outcome;\n };\n const hostInfo = readHostInfo();\n if (!hostInfo) return 'not-running';\n // A busy host (restoring many sessions) can miss a short probe; give it\n // longer before concluding anything.\n const probe = await probeHostDetailed(hostInfo, probeTimeoutMs);\n if (probe.kind === 'timeout') {\n // Alive-but-slow must NOT be treated as stale: deleting the file would\n // orphan a live host, and --restart would then start a second one that\n // restores every session again. Keep the file, kill nothing — unless\n // asked to stop a hung one, and it proves to be ours.\n const ours = opts.isOurHost ?? (async (pid: number) => isPidAlive(pid) && looksLikeHost(await commandLineOf(pid)));\n if (!opts.force || !(await ours(hostInfo.pid))) return 'unresponsive';\n return noteThenKill(hostInfo);\n }\n if (probe.kind !== 'host' || probe.pid !== hostInfo.pid) {\n // Nothing listening, or someone else on that port: the file is stale\n // (reboot, crash, PID/port reused). Remove it; kill nothing.\n removeInfo();\n return 'stale-file';\n }\n return noteThenKill(hostInfo);\n}\n\nfunction killAndForget(kill: (pid: number) => boolean, pid: number): StopOutcome {\n const ok = kill(pid);\n // TerminateProcess means the host never runs its own cleanup.\n removeInfo();\n return ok ? 'stopped' : 'failed';\n}\n\nfunction removeInfo(): void {\n try {\n fs.unlinkSync(hostInfoPath());\n } catch {\n /* */\n }\n}\n\n/**\n * Stop the host and start a new one, which restores every saved session with --continue. `force`: a host that\n * doesn't answer is stopped too (see stopHost). Never starts a second host beside one it couldn't stop.\n */\nexport async function restartHost(\n workBin: string,\n opts: { force?: boolean } = {},\n steps: { stop?: (force: boolean) => Promise<StopOutcome>; start?: (workBin: string) => Promise<{ pid: number }>; pauseMs?: number } = {},\n): Promise<{ outcome: StopOutcome; pid: number | null }> {\n const outcome = await (steps.stop ?? ((force) => stopHost(killTree, 5000, { force })))(!!opts.force);\n if (outcome === 'failed' || outcome === 'unresponsive') return { outcome, pid: null };\n // The old one's port and lock let go before the new one takes them.\n await new Promise((r) => setTimeout(r, steps.pauseMs ?? 500));\n const host = await (steps.start ?? ensureHost)(workBin);\n return { outcome, pid: host.pid };\n}\n","import { spawnSync, type SpawnSyncOptionsWithStringEncoding } from 'node:child_process';\nimport path from 'node:path';\nimport { findOnPath } from './find-on-path.js';\nimport { report } from './report.js';\nimport { debugLog } from './logger.js';\nimport { detachHere } from './process.js';\n\n/**\n * The PATH of the user's login shell, for a work started without one.\n *\n * Reported from a Mac: every session ended at once with \"session exited with code 1\", and Enter\n * gave the same. The desktop app started from the Dock or Finder gets the system's minimal PATH\n * (/usr/bin:/bin:/usr/sbin:/sbin), not the one the user's shell sets up, and passes it on to work\n * web, the PTY host and every Claude: `claude` (in ~/.local/bin, /opt/homebrew/bin, an nvm folder…)\n * isn't found, and node-pty's child exits with 1 when its exec fails. So when work web or the PTY\n * host starts on macOS or Linux and the agent's command isn't on its PATH, it asks the login shell\n * for its PATH (`$SHELL -ilc`, as a terminal would set it up) and puts it first. Started from a\n * terminal, the command is found and nothing is asked.\n */\n\nconst MARK = '__WORK_SHELL_PATH__';\n\n/** The shell's PATH first, then what we had that it lacks (e.g. the app's ~/.work/bin). */\nexport function mergePath(current: string | undefined, shellPath: string, sep = path.delimiter): string {\n const out: string[] = [];\n for (const d of [...shellPath.split(sep), ...(current ?? '').split(sep)]) if (d && !out.includes(d)) out.push(d);\n return out.join(sep);\n}\n\n/** The PATH between the markers of the shell's output (an interactive shell may print a greeting around it). */\nexport function parseShellPath(stdout: string): string | null {\n const m = new RegExp(`${MARK}(.*?)${MARK}`, 's').exec(stdout);\n const p = m?.[1].trim();\n return p ? p : null;\n}\n\n/** How long the login shell may take to say its PATH. */\nexport const SHELL_PATH_TIMEOUT_MS = 5_000;\n\n/** The shell's arguments: a login, interactive shell (what a terminal runs) printing its PATH between markers. */\nexport const shellPathArgs = (): string[] => ['-ilc', `printf '%s%s%s' '${MARK}' \"$PATH\" '${MARK}'`];\n\n/**\n * How it's started. `killSignal: SIGKILL`: an interactive bash or zsh ignores SIGTERM (spawnSync's\n * default at the timeout), and Node then waits for it — a stuck profile held work web up for as long as\n * it hung (reproduced: a 2 s timeout returned after 8 s). `detached` (POSIX): its own session, so it\n * never takes this terminal's foreground group — killed while holding it, it left `work web` in the\n * background, where Ctrl+C no longer reached it (reproduced).\n */\nexport const shellPathSpawnOptions = (timeoutMs = SHELL_PATH_TIMEOUT_MS): SpawnSyncOptionsWithStringEncoding =>\n // `detached` isn't in @types/node's spawnSync options, but spawnSync honors it (spawn_sync reads it).\n ({\n encoding: 'utf8',\n timeout: timeoutMs,\n killSignal: 'SIGKILL',\n detached: detachHere(),\n stdio: ['ignore', 'pipe', 'ignore'],\n windowsHide: true,\n }) as SpawnSyncOptionsWithStringEncoding;\n\ntype ShellRun = (cmd: string, args: string[]) => { stdout?: string | null; status?: number | null; signal?: string | null; error?: Error };\n\n/** Ask the login shell for its PATH: its PATH, or why it couldn't say (a timeout, no such shell, no markers). */\nexport function readShellPath(\n shell = process.env.SHELL || '/bin/zsh',\n run: ShellRun = (cmd, args) => spawnSync(cmd, args, shellPathSpawnOptions()),\n): { path: string } | { why: string } {\n try {\n const r = run(shell, shellPathArgs());\n const p = parseShellPath(r.stdout ?? '');\n if (p) return { path: p };\n const how = r.error\n ? r.error.message\n : r.signal\n ? `stopped by ${r.signal} (over ${SHELL_PATH_TIMEOUT_MS / 1000} s?)`\n : `exit ${r.status ?? '?'}, no PATH printed`;\n return { why: `${shell} -ilc: ${how}` };\n } catch (err) {\n return { why: `${shell} -ilc: ${(err as Error).message}` };\n }\n}\n\n/**\n * Make sure the commands in `need` (the agent's binary) can be found: on macOS and Linux, when one\n * isn't on PATH, the login shell's PATH is merged into this process's (which everything it starts\n * inherits). Says what it did; never throws.\n */\nexport function ensureShellPath(\n need: string[],\n opts: {\n platform?: NodeJS.Platform;\n env?: NodeJS.ProcessEnv;\n readPath?: () => { path: string } | { why: string };\n find?: (cmd: string, env: NodeJS.ProcessEnv) => string | null;\n } = {},\n): 'found' | 'added' | 'unavailable' {\n const platform = opts.platform ?? process.platform;\n const env = opts.env ?? process.env;\n if (platform === 'win32') return 'found';\n const find = opts.find ?? ((c: string, e: NodeJS.ProcessEnv) => findOnPath(c, e, platform));\n const missing = need.filter((c) => !find(c, env));\n if (!missing.length) return 'found';\n // Said in the debug log too: started by the desktop app, nothing shows what a reporter prints.\n const say = (level: 'info' | 'warn', text: string) => {\n report(level, text);\n debugLog(level === 'warn' ? 'WARN' : 'INFO', text);\n };\n const read = (opts.readPath ?? (() => readShellPath(env.SHELL)))();\n if ('why' in read) {\n say('warn', `${missing.join(', ')} isn't on PATH (${env.PATH ?? ''}), and the login shell's PATH couldn't be read: ${read.why}`);\n return 'unavailable';\n }\n env.PATH = mergePath(env.PATH, read.path);\n const still = missing.filter((c) => !find(c, env));\n say(\n still.length ? 'warn' : 'info',\n still.length\n ? `${still.join(', ')} isn't on PATH, even with the login shell's (${env.PATH})`\n : `${missing.join(', ')} found with the login shell's PATH: using it (${env.PATH})`,\n );\n return 'added';\n}\n","import { agentFor, agentSettings, assistantAgent, internalAgent } from './index.js';\nimport type { AgentSettings } from './index.js';\nimport { ensureShellPath } from '../platform/shell-path.js';\nimport { debugLog } from '../platform/logger.js';\n\n/**\n * The agents' commands, found on PATH before work web or the PTY host starts any of them\n * (`core/platform/shell-path.ts` says why: the Mac app from the Dock gets the system's PATH).\n */\n\n/** The commands work starts agents with, from the registry: new sessions', the Ctrl+K assistant's, the summaries'. */\nexport function agentCommands(settings: AgentSettings = agentSettings()): string[] {\n return [...new Set([agentFor(settings), assistantAgent(settings), internalAgent(settings)].map((a) => a.launch.tool(settings).cmd))];\n}\n\n/** For `work web` and the PTY host as they start (not wd's lean server: it starts no agent). Never throws. */\nexport function ensureAgentPath(\n deps: { commands?: () => string[]; ensure?: (need: string[]) => ReturnType<typeof ensureShellPath> } = {},\n): ReturnType<typeof ensureShellPath> | 'failed' {\n try {\n return (deps.ensure ?? ensureShellPath)((deps.commands ?? agentCommands)());\n } catch (err) {\n debugLog('WARN', 'finding the agents on PATH failed:', err);\n return 'failed';\n }\n}\n","import { validGrid } from './terminal-size.js';\n\n/**\n * Reattach where a client left off (terminal-rendering.md, \"Reattach where you left off\"). Pure; the Terminal tab and\n * the PTY host share it.\n *\n * Every screen the host sends (the `replay` frame) says which output stream it belongs to (`stream`: one per PTY entry\n * in one host, so a new spawn under the same id after the entry ended, or a host started again, is another stream) and\n * the offset it stands at (`offset`: characters of output since the entry was spawned, the pacer's unit, UTF-16 code\n * units). A restart or halt of its agent in place keeps the entry, and so the stream and the count: the clients attached\n * through it are sent the new process's output as it continues the old one's, with no screen in between, and a client\n * resuming across it is sent the same characters from its offset (pty-registry.test.ts, \"across a restart\"). Live\n * output follows in frames that are contiguous slices of that output, so a client knows its offset without any stamp\n * on them: the screen's offset plus what it was sent since (`utf16Length` of each binary frame, flow-control.ts).\n *\n * Reconnecting, a client that kept its screen states `?resume=<stream>-<offset>-<cols>x<rows>`: it has drawn\n * everything of that stream up to that offset, and its terminal is that grid. If the host can prove that sending what\n * came since is all it needs, it sends that (`replay` with `resumed: true`) and no screen; otherwise a screen as on\n * any attach. Absent, or from an older host or client, nothing changes: a screen.\n */\n\n/** The attach address's parameter a reconnecting client states its position in. An older host ignores it. */\nexport const RESUME_PARAM = 'resume';\n\n/** Where a client stands in a PTY's output: it has drawn all of `stream` up to `offset`, at this grid. */\nexport interface ResumePoint {\n stream: string;\n offset: number;\n cols: number;\n rows: number;\n}\n\n/** A stream id: what the host makes (pty-registry.ts), hex. */\nconst STREAM = /^[0-9a-f]{8,64}$/;\nconst FORMAT = /^([0-9a-f]{8,64})-(\\d{1,15})-(\\d{1,4})x(\\d{1,4})$/;\n\nexport function isStreamId(s: unknown): s is string {\n return typeof s === 'string' && STREAM.test(s);\n}\n\n/** `url` with the client's position added (`?resume=…`). */\nexport function withResume(url: string, at: ResumePoint | null | undefined): string {\n if (!at) return url;\n const value = `${at.stream}-${at.offset}-${at.cols}x${at.rows}`;\n return `${url}${url.includes('?') ? '&' : '?'}${RESUME_PARAM}=${value}`;\n}\n\n/** The position stated on an attach address, or null when there is none or it isn't one (then: a screen). */\nexport function resumeFromParams(params: URLSearchParams): ResumePoint | null {\n const m = FORMAT.exec(params.get(RESUME_PARAM) ?? '');\n if (!m) return null;\n const offset = Number(m[2]);\n const grid = validGrid(Number(m[3]), Number(m[4]));\n if (!Number.isSafeInteger(offset) || !grid) return null;\n return { stream: m[1], offset, cols: grid.cols, rows: grid.rows };\n}\n\n/** What a `replay` frame says about the stream (fields a host from before sends none of). */\nexport interface ReplayPosition {\n stream?: unknown;\n offset?: unknown;\n resumed?: unknown;\n}\n\n/**\n * A client's position in the PTY's output, as it receives it: set by each `replay` frame (a screen, or what it missed),\n * moved on by each binary frame. Unknown (null) when the host said nothing of it (an older host): then the client\n * never asks to resume.\n */\nexport class StreamPosition {\n private stream: string | null = null;\n private at = 0;\n\n /** A `replay` frame: it stands at its offset now (a screen replaces what was drawn; what was missed continues it). */\n replay(msg: ReplayPosition): void {\n const ok = isStreamId(msg.stream) && typeof msg.offset === 'number' && Number.isSafeInteger(msg.offset) && msg.offset >= 0;\n this.stream = ok ? (msg.stream as string) : null;\n this.at = ok ? (msg.offset as number) : 0;\n }\n\n /** A frame of live output, `chars` long in the host's unit (`utf16Length` of its bytes). */\n output(chars: number): void {\n if (this.stream !== null && chars > 0) this.at += chars;\n }\n\n /** Where it stands, at its terminal's grid; null when unknown. */\n point(cols: number, rows: number): ResumePoint | null {\n if (this.stream === null) return null;\n const grid = validGrid(cols, rows);\n return grid ? { stream: this.stream, offset: this.at, cols: grid.cols, rows: grid.rows } : null;\n }\n\n /** Forget it (the screen will be replaced whatever the host says: a fresh terminal). */\n forget(): void {\n this.stream = null;\n this.at = 0;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAM,MAAM;AACL,IAAM,oBAAoB,KAAK;AAE/B,IAAM,oBAAoB;AAOjC,IAAM,WAAW,CAAC,MAAmC;AACnD,QAAM,IAAI;AACV,SAAO,KAAK,MAAM,QAAQ,EAAE,GAAG,KAAK,EAAE,IAAI,MAAM,CAAC,MAAM,OAAO,MAAM,QAAQ,KAAK,OAAO,EAAE,OAAO,WAAW,IAAI;AAClH;AAMO,SAAS,cACd,WACA,QACU;AACV,QAAM,MAAM,IAAI,IAAI,OAAO,OAAO,CAAC,MAAM,EAAE,UAAU,UAAU,EAAE,UAAU,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC;AACvG,SAAO,CAAC,GAAG,IAAI,IAAI,UAAU,OAAO,CAAC,MAAM,IAAI,IAAI,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAC9E;AAGA,SAAS,SAAS,GAA4C,KAAuB;AACnF,QAAM,MAAM,EAAE,QAAQ,sCAAsC,EAAE,IAAI,GAAG;AACrE,MAAI,CAAC,IAAK,QAAO,CAAC;AAClB,QAAM,MAAM,SAAS,KAAK,MAAM,IAAI,KAAK,CAAC;AAC1C,MAAI,OAAO,MAAM,KAAK,MAAM,IAAI,EAAE,KAAK,kBAAmB,QAAO,IAAI;AACrE,IAAE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EAAE,CAAC,CAAC,CAAC;AACjD,MAAI,CAAC,OAAO,cAAc,MAAM,KAAK,CAAC,KAAM,QAAO;AACnD,SAAO,EAAE,QAAQ,EAAE,CAAC,GAAG,QAAQ,MAAM,KAAK,MAAM,MAAM,KAAK,KAAK;AAClE;","names":[]}
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  hostOfPrUrl
4
- } from "./chunk-U2A2DHWP.js";
4
+ } from "./chunk-PSALWCBD.js";
5
5
  import {
6
6
  loadHistory,
7
7
  parsePrLink
8
- } from "./chunk-HUWWMTNG.js";
8
+ } from "./chunk-XL4YNA3L.js";
9
9
  import {
10
10
  json,
11
11
  sessionIdFor,
@@ -164,4 +164,4 @@ export {
164
164
  blockRefFrom,
165
165
  blockedPrState
166
166
  };
167
- //# sourceMappingURL=chunk-24FQ5XXN.js.map
167
+ //# sourceMappingURL=chunk-SF3DIIKN.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  sessionStatusView
4
- } from "./chunk-BI7HIO2I.js";
4
+ } from "./chunk-BZOYUBK4.js";
5
5
  import {
6
6
  buildDigest,
7
7
  loadHistory,
@@ -11,7 +11,7 @@ import {
11
11
  readStatus,
12
12
  scopeHashForPaths,
13
13
  workSteps
14
- } from "./chunk-HUWWMTNG.js";
14
+ } from "./chunk-XL4YNA3L.js";
15
15
  import {
16
16
  sessionIdFor
17
17
  } from "./chunk-QGUBOOEN.js";
@@ -99,4 +99,4 @@ function createDigestSource(deps = {}) {
99
99
  export {
100
100
  createDigestSource
101
101
  };
102
- //# sourceMappingURL=chunk-GTFMUWK6.js.map
102
+ //# sourceMappingURL=chunk-SUHANL3G.js.map
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  hostForOrigin,
7
7
  hostOfPrUrl
8
- } from "./chunk-U2A2DHWP.js";
8
+ } from "./chunk-PSALWCBD.js";
9
9
  import {
10
10
  originUrl,
11
11
  readGitConfig
@@ -21,7 +21,7 @@ import {
21
21
  normDir,
22
22
  parsePrLink,
23
23
  stopRunningFrom
24
- } from "./chunk-HUWWMTNG.js";
24
+ } from "./chunk-XL4YNA3L.js";
25
25
 
26
26
  // src/core/archive/restore-leftovers.ts
27
27
  function leftoversOf(paths) {
@@ -153,4 +153,4 @@ export {
153
153
  workOnPrPrompt,
154
154
  resolvePrToStart
155
155
  };
156
- //# sourceMappingURL=chunk-XTAYJDL2.js.map
156
+ //# sourceMappingURL=chunk-VNZBFVGY.js.map
@@ -3,7 +3,7 @@ import {
3
3
  isEmptyBaseSpec,
4
4
  openBaseCheckout,
5
5
  setupWorktree
6
- } from "./chunk-IXZOZZGD.js";
6
+ } from "./chunk-KWJ6S4NZ.js";
7
7
  import {
8
8
  defaultRunner
9
9
  } from "./chunk-XBWS77S2.js";
@@ -11,7 +11,7 @@ import {
11
11
  findSession,
12
12
  loadHistory,
13
13
  sessionAliases
14
- } from "./chunk-HUWWMTNG.js";
14
+ } from "./chunk-XL4YNA3L.js";
15
15
  import {
16
16
  ownsBranch
17
17
  } from "./chunk-NWKVTUTN.js";
@@ -204,4 +204,4 @@ export {
204
204
  createInChild,
205
205
  createInProcess
206
206
  };
207
- //# sourceMappingURL=chunk-IXC6EXVJ.js.map
207
+ //# sourceMappingURL=chunk-VPZ5ILKT.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readStatus
4
- } from "./chunk-HUWWMTNG.js";
4
+ } from "./chunk-XL4YNA3L.js";
5
5
 
6
6
  // src/commands/shared/turn-wait.ts
7
7
  var cliWaitDeps = {
@@ -16,4 +16,4 @@ var cliWaitDeps = {
16
16
  export {
17
17
  cliWaitDeps
18
18
  };
19
- //# sourceMappingURL=chunk-FHC6KHIH.js.map
19
+ //# sourceMappingURL=chunk-VQEMPGJL.js.map
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  childText,
4
4
  runWorkChild
5
- } from "./chunk-IXC6EXVJ.js";
5
+ } from "./chunk-VPZ5ILKT.js";
6
6
  import {
7
7
  report
8
8
  } from "./chunk-5ZCCUM75.js";
@@ -34,4 +34,4 @@ export {
34
34
  WORKTREE_REMOVED,
35
35
  removeWorktreeInChild
36
36
  };
37
- //# sourceMappingURL=chunk-2FNYJEOH.js.map
37
+ //# sourceMappingURL=chunk-WH6DAD6D.js.map
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  sessionWorkTime
4
- } from "./chunk-IVS2MAHD.js";
4
+ } from "./chunk-QAIG5FSQ.js";
5
5
  import {
6
6
  runInternal
7
- } from "./chunk-ZLPK2LQ3.js";
7
+ } from "./chunk-7BH2PUYY.js";
8
8
  import {
9
9
  DEFAULT_CATCH_UP_DAYS,
10
10
  MAX_RANGE_DAYS,
@@ -19,14 +19,14 @@ import {
19
19
  readIssueIds,
20
20
  rememberIssueId,
21
21
  timeSettings
22
- } from "./chunk-ET5K6S5H.js";
22
+ } from "./chunk-KJAE7WO5.js";
23
23
  import {
24
24
  knownHosts
25
- } from "./chunk-U2A2DHWP.js";
25
+ } from "./chunk-PSALWCBD.js";
26
26
  import {
27
27
  loadHistory,
28
28
  runGitAsync
29
- } from "./chunk-HUWWMTNG.js";
29
+ } from "./chunk-XL4YNA3L.js";
30
30
  import {
31
31
  sessionIdFor
32
32
  } from "./chunk-QGUBOOEN.js";
@@ -48,6 +48,63 @@ import {
48
48
  getConfigDir
49
49
  } from "./chunk-F2ECTTSY.js";
50
50
 
51
+ // src/core/time/tempo-connect.ts
52
+ import fs from "fs";
53
+ import path from "path";
54
+ var tokenPath = () => path.join(getConfigDir(), "tempo-token.json");
55
+ function readStoredTempoToken() {
56
+ try {
57
+ const v = JSON.parse(fs.readFileSync(tokenPath(), "utf8"));
58
+ return typeof v.token === "string" && v.token.trim() ? v.token.trim() : null;
59
+ } catch {
60
+ return null;
61
+ }
62
+ }
63
+ function storeTempoToken(token) {
64
+ const file = tokenPath();
65
+ fs.mkdirSync(path.dirname(file), { recursive: true });
66
+ ensureFile(file, "{}");
67
+ fs.chmodSync(file, 384);
68
+ withFileLockSync(file, () => atomicWriteFile(file, JSON.stringify({ token })));
69
+ }
70
+ function forgetTempoToken() {
71
+ fs.rmSync(tokenPath(), { force: true });
72
+ }
73
+ function cleanTempoToken(raw) {
74
+ const token = typeof raw === "string" ? raw.trim() : "";
75
+ if (!token) return { error: "Paste a Tempo API token." };
76
+ if (token.length > 2e3 || /\s/.test(token)) return { error: "That doesn't look like a Tempo API token (one line, no spaces)." };
77
+ return { token };
78
+ }
79
+ async function connectTempo(rawToken, rawAccountId, deps) {
80
+ const cleaned = cleanTempoToken(rawToken);
81
+ if ("error" in cleaned) return { ok: false, error: cleaned.error };
82
+ const given = typeof rawAccountId === "string" && rawAccountId.trim() ? rawAccountId.trim() : null;
83
+ if (given && !/^[\w:-]{6,128}$/.test(given)) return { ok: false, error: "That doesn't look like a Jira account id." };
84
+ const configured = deps.configured();
85
+ const accountId = given ?? configured ?? await deps.detect().catch(() => null);
86
+ if (!accountId)
87
+ return {
88
+ ok: false,
89
+ needsAccountId: true,
90
+ error: "work couldn't find your Jira account id (acli isn't signed in to Jira). Paste it: it is the last part of your Jira profile's address (\u2026/jira/people/<id>)."
91
+ };
92
+ try {
93
+ await deps.client(cleaned.token).list(accountId, deps.today());
94
+ } catch (err) {
95
+ const m = err.message;
96
+ const why = /\b401\b/.test(m) ? "Tempo refused the token (it may have expired or been revoked)." : /\b403\b/.test(m) ? 'Tempo refused it: the token needs "Worklogs \u2014 Manage", for this account.' : `Tempo didn't answer: ${m}`;
97
+ return { ok: false, error: why };
98
+ }
99
+ try {
100
+ if (accountId !== configured) await deps.saveAccountId(accountId);
101
+ deps.store(cleaned.token);
102
+ } catch (err) {
103
+ return { ok: false, error: `Couldn't keep it: ${err.message}` };
104
+ }
105
+ return { ok: true, accountId };
106
+ }
107
+
51
108
  // src/core/time/month-gather.ts
52
109
  function createMonthGather(deps, opts) {
53
110
  const now = opts.now ?? (() => Date.now());
@@ -87,7 +144,7 @@ function createMonthGather(deps, opts) {
87
144
  }
88
145
 
89
146
  // src/core/time/time-deps.ts
90
- import fs2 from "fs";
147
+ import fs3 from "fs";
91
148
 
92
149
  // src/core/jira/jira.ts
93
150
  import { execFile } from "child_process";
@@ -245,8 +302,8 @@ async function fetchMyIssues() {
245
302
  }
246
303
 
247
304
  // src/core/time/graph.ts
248
- import fs from "fs";
249
- import path from "path";
305
+ import fs2 from "fs";
306
+ import path2 from "path";
250
307
  var GRAPH_SCOPES = "offline_access User.Read Calendars.Read Chat.Read";
251
308
  var GRAPH = "https://graph.microsoft.com/v1.0";
252
309
  var loginUrl = (tenant, what) => `https://login.microsoftonline.com/${encodeURIComponent(tenant)}/oauth2/v2.0/${what}`;
@@ -255,10 +312,10 @@ function graphApp(cfg, env) {
255
312
  if (!clientId) return { why: "No app to sign in to Microsoft with: set time.graph.clientId (and tenantId) in config.json." };
256
313
  return { clientId, tenantId: cfg?.tenantId?.trim() || env.GRAPH_TENANT_ID?.trim() || "organizations" };
257
314
  }
258
- var tokenPath = () => path.join(getConfigDir(), "graph-token.json");
315
+ var tokenPath2 = () => path2.join(getConfigDir(), "graph-token.json");
259
316
  function readTokens() {
260
317
  try {
261
- const v = JSON.parse(fs.readFileSync(tokenPath(), "utf8"));
318
+ const v = JSON.parse(fs2.readFileSync(tokenPath2(), "utf8"));
262
319
  return typeof v.refreshToken === "string" && typeof v.accessToken === "string" && typeof v.expiresAt === "number" ? {
263
320
  refreshToken: v.refreshToken,
264
321
  accessToken: v.accessToken,
@@ -272,15 +329,15 @@ function readTokens() {
272
329
  }
273
330
  }
274
331
  function writeTokens(t) {
275
- const file = tokenPath();
276
- fs.mkdirSync(path.dirname(file), { recursive: true });
332
+ const file = tokenPath2();
333
+ fs2.mkdirSync(path2.dirname(file), { recursive: true });
277
334
  ensureFile(file, "{}");
278
- fs.chmodSync(file, 384);
335
+ fs2.chmodSync(file, 384);
279
336
  withFileLockSync(file, () => atomicWriteFile(file, JSON.stringify(t)));
280
337
  }
281
338
  function updateTokens(change) {
282
- const file = tokenPath();
283
- if (!fs.existsSync(file)) return;
339
+ const file = tokenPath2();
340
+ if (!fs2.existsSync(file)) return;
284
341
  withFileLockSync(file, () => {
285
342
  const cur = readTokens();
286
343
  const next = cur && change(cur);
@@ -300,9 +357,9 @@ function graphProblem(app) {
300
357
  return null;
301
358
  }
302
359
  function signOutGraph() {
303
- const file = tokenPath();
304
- if (!fs.existsSync(file)) return;
305
- withFileLockSync(file, () => fs.rmSync(file, { force: true }));
360
+ const file = tokenPath2();
361
+ if (!fs2.existsSync(file)) return;
362
+ withFileLockSync(file, () => fs2.rmSync(file, { force: true }));
306
363
  }
307
364
  var TIMEOUT_MS = 3e4;
308
365
  var SIGN_IN_GONE = /* @__PURE__ */ new Set(["invalid_grant", "interaction_required", "invalid_client", "unauthorized_client", "consent_required"]);
@@ -600,7 +657,7 @@ var realIo = {
600
657
  git: (cwd, args) => runGitAsync(cwd, { args }),
601
658
  workTime: (s, now, days) => sessionWorkTime(s, now, days),
602
659
  repos: () => loadConfig()?.repos ?? {},
603
- exists: (folder) => fs2.existsSync(folder)
660
+ exists: (folder) => fs3.existsSync(folder)
604
661
  };
605
662
  async function commitLog(git, repo, from) {
606
663
  const email = (await git(repo, ["config", "user.email"])).stdout.trim();
@@ -731,8 +788,13 @@ function defaultTimeDeps(io = realIo) {
731
788
  }
732
789
 
733
790
  export {
791
+ readStoredTempoToken,
792
+ storeTempoToken,
793
+ forgetTempoToken,
794
+ connectTempo,
734
795
  createMonthGather,
735
796
  fetchMyIssuesOrThrow,
797
+ myAccountId,
736
798
  fetchJiraPane,
737
799
  fetchIssueDetail,
738
800
  fetchMyIssues,
@@ -744,4 +806,4 @@ export {
744
806
  finishDeviceLogin,
745
807
  defaultTimeDeps
746
808
  };
747
- //# sourceMappingURL=chunk-GN7EAXHU.js.map
809
+ //# sourceMappingURL=chunk-XB4SCJWD.js.map