@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
@@ -0,0 +1,372 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ spawn_default
4
+ } from "./chunk-RCYI7SRA.js";
5
+ import {
6
+ getConfigDir
7
+ } from "./chunk-6THUVP6T.js";
8
+
9
+ // src/core/agents/claude/rate-limits.ts
10
+ import os from "os";
11
+ import path from "path";
12
+ import { createHash } from "crypto";
13
+ var isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
14
+ var clampPercent = (n) => Math.round(Math.min(100, Math.max(0, n)) * 10) / 10;
15
+ function resetIso(v) {
16
+ let ms;
17
+ if (typeof v === "number" && Number.isFinite(v)) ms = v < 1e12 ? v * 1e3 : v;
18
+ else if (typeof v === "string" && v.trim() !== "") ms = Date.parse(v);
19
+ else return null;
20
+ return Number.isFinite(ms) ? new Date(ms).toISOString() : null;
21
+ }
22
+ var capitalise = (s) => s.charAt(0).toUpperCase() + s.slice(1);
23
+ function labelOf(key) {
24
+ if (key === "five_hour") return "5-hour limit";
25
+ if (key === "seven_day") return "Weekly limit";
26
+ const named = /^seven_day_(.+)$/.exec(key);
27
+ if (named) return `Weekly ${capitalise(named[1].replace(/_/g, " "))} limit`;
28
+ const span = /^(\d+)_(hour|day)$/.exec(key);
29
+ if (span) return `${span[1]}-${span[2]} limit`;
30
+ return `${capitalise(key.replace(/_/g, " "))} limit`;
31
+ }
32
+ var rank = (key) => key === "five_hour" ? 0 : key === "seven_day" ? 1 : 2;
33
+ function parseClaudeRateLimits(raw) {
34
+ if (!isRecord(raw)) return [];
35
+ const windows = [];
36
+ const keys = Object.keys(raw).filter((k) => k !== "spend_limit").sort((a, b) => rank(a) - rank(b) || a.localeCompare(b));
37
+ for (const key of keys) {
38
+ const w = raw[key];
39
+ if (!isRecord(w) || typeof w.used_percentage !== "number" || !Number.isFinite(w.used_percentage)) continue;
40
+ windows.push({ id: key, label: labelOf(key), usedPercent: clampPercent(w.used_percentage), resetsAt: resetIso(w.resets_at) });
41
+ }
42
+ const spend = raw.spend_limit;
43
+ if (isRecord(spend)) {
44
+ const { used_percentage: pct, used_usd: used, limit_usd: limit } = spend;
45
+ let percent = null;
46
+ if (typeof pct === "number" && Number.isFinite(pct)) percent = pct;
47
+ else if (typeof used === "number" && typeof limit === "number" && Number.isFinite(used) && Number.isFinite(limit) && limit > 0)
48
+ percent = used / limit * 100;
49
+ if (percent !== null) {
50
+ windows.push({ id: "spend_limit", label: "Spend limit", usedPercent: clampPercent(percent), resetsAt: resetIso(spend.resets_at) });
51
+ }
52
+ }
53
+ return windows;
54
+ }
55
+ function accountOf(configDir) {
56
+ if (!configDir) return "default";
57
+ const norm = (p) => process.platform === "win32" ? path.resolve(p).toLowerCase() : path.resolve(p);
58
+ const resolved = norm(configDir);
59
+ if (resolved === norm(path.join(os.homedir(), ".claude"))) return "default";
60
+ const hash = createHash("sha1").update(resolved).digest("hex");
61
+ return `cfg-${hash.slice(0, 8)}`;
62
+ }
63
+
64
+ // src/core/platform/process.ts
65
+ import fs from "fs";
66
+ import os2 from "os";
67
+ import { execFile, spawn, spawnSync } from "child_process";
68
+ function detachHere(platform = process.platform) {
69
+ return platform !== "win32";
70
+ }
71
+ function isPidAlive(pid) {
72
+ try {
73
+ process.kill(pid, 0);
74
+ } catch {
75
+ return false;
76
+ }
77
+ return !isZombie(pid);
78
+ }
79
+ function isZombie(pid, read = procFs, platform = process.platform) {
80
+ if (platform !== "linux") return false;
81
+ const stat = read.file(`/proc/${pid}/stat`) ?? "";
82
+ const close = stat.lastIndexOf(")");
83
+ return close >= 0 && stat[close + 2] === "Z";
84
+ }
85
+ var procFs = {
86
+ link: (p) => {
87
+ try {
88
+ return fs.readlinkSync(p);
89
+ } catch {
90
+ return null;
91
+ }
92
+ },
93
+ file: (p) => {
94
+ try {
95
+ return fs.readFileSync(p, "utf-8");
96
+ } catch {
97
+ return null;
98
+ }
99
+ },
100
+ pids: () => {
101
+ try {
102
+ return fs.readdirSync("/proc").filter((n) => /^\d+$/.test(n)).map(Number);
103
+ } catch {
104
+ return [];
105
+ }
106
+ }
107
+ };
108
+ var baseName = (p) => p.split("/").pop() || p;
109
+ function linuxProcessName(pid, read = procFs) {
110
+ const exe = read.link(`/proc/${pid}/exe`);
111
+ if (exe) return baseName(exe.replace(/ \(deleted\)$/, ""));
112
+ const argv0 = (read.file(`/proc/${pid}/cmdline`) ?? "").split("\0")[0];
113
+ if (argv0) return baseName(argv0.split(" ")[0]);
114
+ const comm = (read.file(`/proc/${pid}/comm`) ?? "").trim();
115
+ return comm || null;
116
+ }
117
+ function linuxProcessTable(read = procFs) {
118
+ const out = /* @__PURE__ */ new Map();
119
+ for (const pid of read.pids()) {
120
+ const name = linuxProcessName(pid, read);
121
+ if (name) out.set(pid, name);
122
+ }
123
+ return out;
124
+ }
125
+ function processName(pid) {
126
+ try {
127
+ if (process.platform === "win32") {
128
+ const r2 = spawnSync("tasklist", ["/FI", `PID eq ${pid}`, "/FO", "CSV", "/NH"], {
129
+ encoding: "utf-8",
130
+ windowsHide: true,
131
+ timeout: 5e3
132
+ });
133
+ const m = /^"([^"]+)","(\d+)"/.exec((r2.stdout ?? "").trim());
134
+ return m && Number(m[2]) === pid ? m[1] : null;
135
+ }
136
+ if (process.platform === "linux") return isPidAlive(pid) ? linuxProcessName(pid) : null;
137
+ const r = spawnSync("ps", ["-o", "comm=", "-p", String(pid)], { encoding: "utf-8", timeout: 5e3, windowsHide: true });
138
+ const name = (r.stdout ?? "").trim();
139
+ return r.status === 0 && name ? name.split("/").pop() : null;
140
+ } catch {
141
+ return null;
142
+ }
143
+ }
144
+ var recentTable = null;
145
+ var refreshingTable = null;
146
+ function recentProcessTable(maxAgeMs, now = Date.now()) {
147
+ if (!recentTable || now - recentTable.at >= maxAgeMs) {
148
+ refreshingTable ??= processTableAsync().then((table) => void (table.size > 0 && (recentTable = { at: Date.now(), table }))).finally(() => void (refreshingTable = null));
149
+ }
150
+ return recentTable?.table ?? null;
151
+ }
152
+ function processTableAsync() {
153
+ if (process.platform === "linux") return Promise.resolve(linuxProcessTable());
154
+ return new Promise((resolve) => {
155
+ const win = process.platform === "win32";
156
+ const [cmd, args] = win ? ["tasklist", ["/FO", "CSV", "/NH"]] : ["ps", ["-A", "-o", "pid=,comm="]];
157
+ execFile(
158
+ cmd,
159
+ args,
160
+ { encoding: "utf-8", windowsHide: true, timeout: 8e3, maxBuffer: 16 * 1024 * 1024 },
161
+ (_err, stdout) => {
162
+ resolve(parseProcessTable(stdout ?? "", win));
163
+ }
164
+ );
165
+ });
166
+ }
167
+ function parseProcessTable(stdout, win) {
168
+ const out = /* @__PURE__ */ new Map();
169
+ for (const line of stdout.split(/\r?\n/)) {
170
+ if (win) {
171
+ const m = /^"([^"]+)","(\d+)"/.exec(line);
172
+ if (m) out.set(Number(m[2]), m[1]);
173
+ } else {
174
+ const m = /^\s*(\d+)\s+(.+)$/.exec(line);
175
+ if (m) out.set(Number(m[1]), m[2].trim().split("/").pop());
176
+ }
177
+ }
178
+ return out;
179
+ }
180
+ function processTable() {
181
+ if (process.platform === "linux") return linuxProcessTable();
182
+ try {
183
+ const win = process.platform === "win32";
184
+ const r = win ? spawnSync("tasklist", ["/FO", "CSV", "/NH"], { encoding: "utf-8", windowsHide: true, timeout: 8e3, maxBuffer: 16 * 1024 * 1024 }) : spawnSync("ps", ["-A", "-o", "pid=,comm="], { encoding: "utf-8", timeout: 8e3, windowsHide: true, maxBuffer: 16 * 1024 * 1024 });
185
+ return parseProcessTable(r.stdout ?? "", win);
186
+ } catch {
187
+ return /* @__PURE__ */ new Map();
188
+ }
189
+ }
190
+ function bootTime() {
191
+ return Date.now() - os2.uptime() * 1e3;
192
+ }
193
+ function killTree(pid) {
194
+ if (process.platform === "win32") {
195
+ return spawnSync("taskkill", ["/PID", String(pid), "/T", "/F"], { stdio: "ignore", windowsHide: true }).status === 0;
196
+ }
197
+ try {
198
+ process.kill(pid);
199
+ return true;
200
+ } catch {
201
+ return false;
202
+ }
203
+ }
204
+ function killTreeAsync(pid) {
205
+ if (process.platform !== "win32") return Promise.resolve(killTree(pid) || !isPidAlive(pid));
206
+ return new Promise(
207
+ (resolve) => (
208
+ // taskkill fails the whole call when one child had already exited or won't go; the top gone is what counts.
209
+ execFile(
210
+ "taskkill",
211
+ ["/PID", String(pid), "/T", "/F"],
212
+ { windowsHide: true, timeout: 1e4 },
213
+ (err) => resolve(!err || !isPidAlive(pid))
214
+ )
215
+ )
216
+ );
217
+ }
218
+ function spawnDetachedWork(workBin, args, logFile) {
219
+ const log = fs.openSync(logFile, "a");
220
+ try {
221
+ const child = spawn(process.execPath, [workBin, ...args], {
222
+ detached: true,
223
+ stdio: ["ignore", log, log],
224
+ windowsHide: true,
225
+ // Not the caller's folder: a long-lived server working from it keeps it
226
+ // in use on Windows — a worktree then can't be removed, the desktop
227
+ // app's install folder can't be updated.
228
+ cwd: os2.homedir()
229
+ });
230
+ child.unref();
231
+ } finally {
232
+ fs.closeSync(log);
233
+ }
234
+ }
235
+
236
+ // src/core/agents/claude/statusline-run.ts
237
+ import fs2 from "fs";
238
+ import path2 from "path";
239
+ var WORK_STATUSLINE = "work hook statusline";
240
+ var NESTED_ENV = "WORK_STATUSLINE_NESTED";
241
+ var isRecord2 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
242
+ var savedPath = (configDir) => {
243
+ const account = accountOf(configDir);
244
+ return path2.join(getConfigDir(), account === "default" ? "statusline.json" : `statusline-${account}.json`);
245
+ };
246
+ var isOurs = (v) => isRecord2(v) && typeof v.command === "string" && /\bhook\s+statusline\b/.test(v.command);
247
+ function readSaved(configDir) {
248
+ let text;
249
+ try {
250
+ text = fs2.readFileSync(savedPath(configDir), "utf-8");
251
+ } catch (e) {
252
+ const code = e.code;
253
+ return code === "ENOENT" ? { kind: "missing" } : { kind: "unreadable", why: code ?? String(e) };
254
+ }
255
+ let v;
256
+ try {
257
+ v = JSON.parse(text);
258
+ } catch (e) {
259
+ return { kind: "unreadable", why: e instanceof Error ? e.message : String(e) };
260
+ }
261
+ if (!isRecord2(v) || !("original" in v)) return { kind: "unreadable", why: "no original in it" };
262
+ if (v.original === null) return { kind: "ok", original: null };
263
+ return isRecord2(v.original) ? { kind: "ok", original: v.original } : { kind: "unreadable", why: "original is not an object" };
264
+ }
265
+ function originalStatusLine(onDamage, configDir) {
266
+ let saved = readSaved(configDir);
267
+ if (saved.kind === "missing" && accountOf(configDir) !== "default") saved = readSaved();
268
+ if (saved.kind === "unreadable") onDamage?.(saved.why);
269
+ const o = saved.kind === "ok" ? saved.original : null;
270
+ return o && typeof o.command === "string" && o.command ? { command: o.command } : null;
271
+ }
272
+ function shellFor(platform = process.platform, env = process.env, exists = fs2.existsSync) {
273
+ const args = (cmd) => ["-c", cmd];
274
+ if (platform !== "win32") return { file: "/bin/sh", args };
275
+ const configured = env.CLAUDE_CODE_GIT_BASH_PATH;
276
+ if (configured && exists(configured)) return { file: configured, args };
277
+ for (const dir of (env.PATH ?? env.Path ?? "").split(";").filter(Boolean)) {
278
+ if (!exists(path2.win32.join(dir, "git.exe"))) continue;
279
+ for (const bash of [path2.win32.join(dir, "..", "bin", "bash.exe"), path2.win32.join(dir, "bash.exe")])
280
+ if (exists(bash)) return { file: bash, args };
281
+ }
282
+ const standard = "C:\\Program Files\\Git\\bin\\bash.exe";
283
+ return { file: exists(standard) ? standard : "bash", args };
284
+ }
285
+ var OUTPUT_CAP = 64 * 1024;
286
+ var EXIT_GRACE_MS = 100;
287
+ function killCommand(pid) {
288
+ if (detachHere()) {
289
+ try {
290
+ process.kill(-pid, "SIGKILL");
291
+ return;
292
+ } catch {
293
+ }
294
+ }
295
+ killTree(pid);
296
+ }
297
+ function runStatusLineCommand(cmd, stdin, o = {}) {
298
+ return new Promise((resolve) => {
299
+ let done = false;
300
+ const out = [];
301
+ let outBytes = 0;
302
+ let timer;
303
+ let grace;
304
+ let child;
305
+ const finish = (ok) => {
306
+ if (done) return;
307
+ done = true;
308
+ clearTimeout(timer);
309
+ clearTimeout(grace);
310
+ child?.stdout?.destroy();
311
+ child?.stdin?.destroy();
312
+ child?.unref();
313
+ resolve(ok ? Buffer.concat(out).subarray(0, OUTPUT_CAP).toString("utf-8") : "");
314
+ };
315
+ try {
316
+ const sh = shellFor();
317
+ child = spawn_default(sh.file, sh.args(cmd), {
318
+ stdio: ["pipe", "pipe", "ignore"],
319
+ windowsHide: true,
320
+ cwd: o.cwd,
321
+ // Its own process group on POSIX, so a timeout stops what it started too.
322
+ detached: detachHere(),
323
+ // Marked, so a command that runs work's hook again doesn't run itself (runStatusLineHook).
324
+ env: { ...process.env, [NESTED_ENV]: "1" }
325
+ });
326
+ const c = child;
327
+ timer = setTimeout(() => {
328
+ if (c.pid) killCommand(c.pid);
329
+ finish(false);
330
+ }, o.timeoutMs ?? 5e3);
331
+ c.on("error", () => finish(false));
332
+ c.stdout?.on("data", (d) => {
333
+ if (outBytes >= OUTPUT_CAP) return;
334
+ out.push(d);
335
+ outBytes += d.length;
336
+ });
337
+ c.on("exit", (code) => {
338
+ if (code !== 0) finish(false);
339
+ else grace ??= setTimeout(() => finish(true), EXIT_GRACE_MS);
340
+ });
341
+ c.on("close", (code) => finish(code === 0));
342
+ c.stdin?.on("error", () => {
343
+ });
344
+ c.stdin?.end(stdin);
345
+ } catch {
346
+ finish(false);
347
+ }
348
+ });
349
+ }
350
+
351
+ export {
352
+ parseClaudeRateLimits,
353
+ accountOf,
354
+ detachHere,
355
+ isPidAlive,
356
+ processName,
357
+ recentProcessTable,
358
+ processTable,
359
+ bootTime,
360
+ killTree,
361
+ killTreeAsync,
362
+ spawnDetachedWork,
363
+ WORK_STATUSLINE,
364
+ NESTED_ENV,
365
+ isRecord2 as isRecord,
366
+ savedPath,
367
+ isOurs,
368
+ readSaved,
369
+ originalStatusLine,
370
+ runStatusLineCommand
371
+ };
372
+ //# sourceMappingURL=chunk-4NITDMDH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/agents/claude/rate-limits.ts","../src/core/platform/process.ts","../src/core/agents/claude/statusline-run.ts"],"sourcesContent":["import os from 'node:os';\nimport path from 'node:path';\nimport { createHash } from 'node:crypto';\nimport type { UsageWindow } from '../../usage/usage.js';\n\n// What Claude Code's status line says about its plan limits, and whose they are. Light on purpose: the status-line hook imports it on every refresh.\n\nconst isRecord = (v: unknown): v is Record<string, unknown> => typeof v === 'object' && v !== null && !Array.isArray(v);\n\nconst clampPercent = (n: number) => Math.round(Math.min(100, Math.max(0, n)) * 10) / 10;\n\n/** Epoch seconds below 1e12, milliseconds above; a string is parsed as a date. */\nfunction resetIso(v: unknown): string | null {\n let ms: number;\n if (typeof v === 'number' && Number.isFinite(v)) ms = v < 1e12 ? v * 1000 : v;\n else if (typeof v === 'string' && v.trim() !== '') ms = Date.parse(v);\n else return null;\n return Number.isFinite(ms) ? new Date(ms).toISOString() : null;\n}\n\nconst capitalise = (s: string) => s.charAt(0).toUpperCase() + s.slice(1);\n\nfunction labelOf(key: string): string {\n if (key === 'five_hour') return '5-hour limit';\n if (key === 'seven_day') return 'Weekly limit';\n const named = /^seven_day_(.+)$/.exec(key);\n if (named) return `Weekly ${capitalise(named[1]!.replace(/_/g, ' '))} limit`;\n const span = /^(\\d+)_(hour|day)$/.exec(key);\n if (span) return `${span[1]}-${span[2]} limit`;\n return `${capitalise(key.replace(/_/g, ' '))} limit`;\n}\n\nconst rank = (key: string) => (key === 'five_hour' ? 0 : key === 'seven_day' ? 1 : 2);\n\n/** Claude Code's status-line `rate_limits`; whatever doesn't fit is skipped. */\nexport function parseClaudeRateLimits(raw: unknown): UsageWindow[] {\n if (!isRecord(raw)) return [];\n const windows: UsageWindow[] = [];\n const keys = Object.keys(raw)\n .filter((k) => k !== 'spend_limit')\n .sort((a, b) => rank(a) - rank(b) || a.localeCompare(b));\n for (const key of keys) {\n const w = raw[key];\n if (!isRecord(w) || typeof w.used_percentage !== 'number' || !Number.isFinite(w.used_percentage)) continue;\n windows.push({ id: key, label: labelOf(key), usedPercent: clampPercent(w.used_percentage), resetsAt: resetIso(w.resets_at) });\n }\n const spend = raw.spend_limit;\n if (isRecord(spend)) {\n const { used_percentage: pct, used_usd: used, limit_usd: limit } = spend;\n let percent: number | null = null;\n if (typeof pct === 'number' && Number.isFinite(pct)) percent = pct;\n else if (typeof used === 'number' && typeof limit === 'number' && Number.isFinite(used) && Number.isFinite(limit) && limit > 0)\n percent = (used / limit) * 100;\n if (percent !== null) {\n windows.push({ id: 'spend_limit', label: 'Spend limit', usedPercent: clampPercent(percent), resetsAt: resetIso(spend.resets_at) });\n }\n }\n return windows;\n}\n\n/** The account a Claude runs as: `default` for its normal config folder (~/.claude), else a short stable name for its CLAUDE_CONFIG_DIR. */\nexport function accountOf(configDir: string | undefined): string {\n if (!configDir) return 'default';\n const norm = (p: string) => (process.platform === 'win32' ? path.resolve(p).toLowerCase() : path.resolve(p));\n const resolved = norm(configDir);\n // CLAUDE_CONFIG_DIR set to the folder Claude uses anyway is the same account.\n if (resolved === norm(path.join(os.homedir(), '.claude'))) return 'default';\n const hash = createHash('sha1').update(resolved).digest('hex');\n return `cfg-${hash.slice(0, 8)}`;\n}\n","import fs from 'node:fs';\nimport os from 'node:os';\nimport { execFile, spawn, spawnSync } from 'node:child_process';\n\n/**\n * Process lifecycle rules for the long-lived pieces (work web, the PTY\n * host), in one place — they differ on Windows in ways that bit us:\n *\n * - Killing: process.kill on Windows is TerminateProcess of that one\n * process — its ConPTY children (Claudes) survive, orphaned. Kill the\n * tree with taskkill /T /F. Elsewhere SIGTERM lets the process clean up\n * its own children.\n * - Liveness: `process.kill(pid, 0)` works on both, but a live PID is not\n * proof it's OURS (Windows reuses PIDs fast) — callers that act on it\n * must also verify identity (e.g. the host's /health token check).\n * - Detached `work` children: `detached` + `windowsHide` so no console\n * window flashes and the child outlives the parent's terminal; output\n * goes to a log file, never the parent's stdio.\n * - Anything else started in the background (an editor, a URL, a toast, a\n * status hook): `detached` on POSIX only (`detachHere`). On Windows a\n * detached process has no console at all, so every console program it\n * starts — cmd.exe running code.cmd, PowerShell — opens a window of its\n * own, and `windowsHide` can't stop that (measured: detached flashed a\n * Windows Terminal window every time, hidden alone never). A child there\n * outlives its parent anyway.\n */\n\n/** Start a background program detached? POSIX yes (its own process group); Windows no — see above. */\nexport function detachHere(platform: NodeJS.Platform = process.platform): boolean {\n return platform !== 'win32';\n}\n\nexport function isPidAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n } catch {\n return false;\n }\n return !isZombie(pid);\n}\n\n/**\n * Exited, but not yet collected by its parent (a zombie): `kill(pid, 0)` still\n * succeeds, though nothing runs. A server started by a parent that never\n * waits for it — the desktop app's work web, or a test's child while the test\n * blocks in spawnSync — is one once it stops, and `work web --dev --stop`\n * waited for it to go, then said it didn't. Linux only (/proc/<pid>/stat: the\n * state letter after the command's closing parenthesis); elsewhere false.\n */\nexport function isZombie(pid: number, read: Pick<ProcReader, 'file'> = procFs, platform: NodeJS.Platform = process.platform): boolean {\n if (platform !== 'linux') return false;\n const stat = read.file(`/proc/${pid}/stat`) ?? '';\n // The state follows the command name, which is in parentheses and may hold some.\n const close = stat.lastIndexOf(')');\n return close >= 0 && stat[close + 2] === 'Z';\n}\n\n/** How /proc is read (tests pass a fake one). */\nexport interface ProcReader {\n link: (p: string) => string | null;\n file: (p: string) => string | null;\n pids: () => number[];\n}\n\nconst procFs: ProcReader = {\n link: (p) => {\n try {\n return fs.readlinkSync(p);\n } catch {\n return null;\n }\n },\n file: (p) => {\n try {\n return fs.readFileSync(p, 'utf-8');\n } catch {\n return null;\n }\n },\n pids: () => {\n try {\n return fs\n .readdirSync('/proc')\n .filter((n) => /^\\d+$/.test(n))\n .map(Number);\n } catch {\n return [];\n }\n },\n};\n\nconst baseName = (p: string) => p.split('/').pop() || p;\n\n/**\n * On Linux, the program a process runs, from /proc: its executable when it\n * can be read (our own processes), else its command line's first word, else\n * its `comm`. Not `ps -o comm` alone: that is its main thread's name, which\n * Node 24 sets to \"MainThread\" — every node process, Claude Code's included,\n * read as that, and no Claude was ever found running.\n */\nexport function linuxProcessName(pid: number, read: ProcReader = procFs): string | null {\n const exe = read.link(`/proc/${pid}/exe`);\n if (exe) return baseName(exe.replace(/ \\(deleted\\)$/, ''));\n const argv0 = (read.file(`/proc/${pid}/cmdline`) ?? '').split('\\0')[0];\n if (argv0) return baseName(argv0.split(' ')[0]);\n const comm = (read.file(`/proc/${pid}/comm`) ?? '').trim();\n return comm || null;\n}\n\n/** On Linux, every process's program by pid (linuxProcessName), from /proc: no `ps` to run. */\nexport function linuxProcessTable(read: ProcReader = procFs): Map<number, string> {\n const out = new Map<number, string>();\n for (const pid of read.pids()) {\n const name = linuxProcessName(pid, read);\n if (name) out.set(pid, name);\n }\n return out;\n}\n\n/**\n * The executable name of a live process (\"cmd.exe\", \"sh\"), or null if it\n * isn't running or can't be read. For checking a remembered pid is still\n * the process we started before acting on it — pids get reused.\n */\nexport function processName(pid: number): string | null {\n try {\n if (process.platform === 'win32') {\n const r = spawnSync('tasklist', ['/FI', `PID eq ${pid}`, '/FO', 'CSV', '/NH'], {\n encoding: 'utf-8',\n windowsHide: true,\n timeout: 5000,\n });\n const m = /^\"([^\"]+)\",\"(\\d+)\"/.exec((r.stdout ?? '').trim());\n return m && Number(m[2]) === pid ? m[1] : null;\n }\n if (process.platform === 'linux') return isPidAlive(pid) ? linuxProcessName(pid) : null;\n const r = spawnSync('ps', ['-o', 'comm=', '-p', String(pid)], { encoding: 'utf-8', timeout: 5000, windowsHide: true });\n const name = (r.stdout ?? '').trim();\n return r.status === 0 && name ? name.split('/').pop()! : null;\n } catch {\n return null;\n }\n}\n\nlet recentTable: { at: number; table: Map<number, string> } | null = null;\nlet refreshingTable: Promise<void> | null = null;\n\n/**\n * The process table as of at most `maxAgeMs` ago, without waiting: a stale\n * or missing one starts a background refresh (one at a time) and the last\n * one is returned — null before the first is in. For views that refresh\n * often (the session list); a decision that must be right now (is a Claude\n * already running, before starting one?) uses processTable().\n */\nexport function recentProcessTable(maxAgeMs: number, now = Date.now()): Map<number, string> | null {\n if (!recentTable || now - recentTable.at >= maxAgeMs) {\n refreshingTable ??= processTableAsync()\n // An empty table is a failed or timed-out listing (there is always at\n // least this process): keep the last good one, and try again next time.\n .then((table) => void (table.size > 0 && (recentTable = { at: Date.now(), table })))\n .finally(() => void (refreshingTable = null));\n }\n return recentTable?.table ?? null;\n}\n\n/** processTable(), without blocking the event loop. */\nexport function processTableAsync(): Promise<Map<number, string>> {\n if (process.platform === 'linux') return Promise.resolve(linuxProcessTable());\n return new Promise((resolve) => {\n const win = process.platform === 'win32';\n const [cmd, args] = win ? ['tasklist', ['/FO', 'CSV', '/NH']] : ['ps', ['-A', '-o', 'pid=,comm=']];\n execFile(\n cmd,\n args as string[],\n { encoding: 'utf-8', windowsHide: true, timeout: 8000, maxBuffer: 16 * 1024 * 1024 },\n (_err, stdout) => {\n resolve(parseProcessTable(stdout ?? '', win));\n },\n );\n });\n}\n\nfunction parseProcessTable(stdout: string, win: boolean): Map<number, string> {\n const out = new Map<number, string>();\n for (const line of stdout.split(/\\r?\\n/)) {\n if (win) {\n const m = /^\"([^\"]+)\",\"(\\d+)\"/.exec(line);\n if (m) out.set(Number(m[2]), m[1]);\n } else {\n const m = /^\\s*(\\d+)\\s+(.+)$/.exec(line);\n if (m) out.set(Number(m[1]), m[2].trim().split('/').pop()!);\n }\n }\n return out;\n}\n\n/**\n * Every running process's executable name, by pid, in ONE call (tasklist /\n * ps) — for checking many remembered pids at once. Empty if it can't be read.\n */\nexport function processTable(): Map<number, string> {\n if (process.platform === 'linux') return linuxProcessTable();\n try {\n const win = process.platform === 'win32';\n const r = win\n ? spawnSync('tasklist', ['/FO', 'CSV', '/NH'], { encoding: 'utf-8', windowsHide: true, timeout: 8000, maxBuffer: 16 * 1024 * 1024 })\n : spawnSync('ps', ['-A', '-o', 'pid=,comm='], { encoding: 'utf-8', timeout: 8000, windowsHide: true, maxBuffer: 16 * 1024 * 1024 });\n return parseProcessTable(r.stdout ?? '', win);\n } catch {\n return new Map(); // unreadable: nothing is known to be alive\n }\n}\n\n/** When this machine last booted (ms since epoch, ±1 s). */\nexport function bootTime(): number {\n return Date.now() - os.uptime() * 1000;\n}\n\n/** Kill a process AND its children. True if the kill was delivered. */\nexport function killTree(pid: number): boolean {\n if (process.platform === 'win32') {\n return spawnSync('taskkill', ['/PID', String(pid), '/T', '/F'], { stdio: 'ignore', windowsHide: true }).status === 0;\n }\n try {\n process.kill(pid);\n return true;\n } catch {\n return false;\n }\n}\n\n/** killTree, not blocking the event loop (taskkill takes a few hundred ms): for a server killing several at once. */\nexport function killTreeAsync(pid: number): Promise<boolean> {\n // Already gone counts as stopped, as with taskkill below: it's what the caller wanted.\n if (process.platform !== 'win32') return Promise.resolve(killTree(pid) || !isPidAlive(pid));\n return new Promise((resolve) =>\n // taskkill fails the whole call when one child had already exited or won't go; the top gone is what counts.\n execFile('taskkill', ['/PID', String(pid), '/T', '/F'], { windowsHide: true, timeout: 10_000 }, (err) =>\n resolve(!err || !isPidAlive(pid)),\n ),\n );\n}\n\n/**\n * Start `node <workBin> ...args` detached, appending its output to\n * `logFile`. Returns immediately; the caller polls for readiness (a\n * discovery file / health check), because a detached child can't report\n * back directly.\n */\nexport function spawnDetachedWork(workBin: string, args: string[], logFile: string): void {\n const log = fs.openSync(logFile, 'a');\n try {\n const child = spawn(process.execPath, [workBin, ...args], {\n detached: true,\n stdio: ['ignore', log, log],\n windowsHide: true,\n // Not the caller's folder: a long-lived server working from it keeps it\n // in use on Windows — a worktree then can't be removed, the desktop\n // app's install folder can't be updated.\n cwd: os.homedir(),\n });\n child.unref();\n } finally {\n fs.closeSync(log);\n }\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport { getConfigDir } from '../../platform/config-dir.js';\nimport { detachHere, killTree } from '../../platform/process.js';\nimport spawn from '../../platform/spawn.js';\nimport { accountOf } from './rate-limits.js';\n\n// The status-line hook's half of statusline.ts: what runs on every refresh of every Claude. Light on purpose — no\n// settings editor, no locks, no registry; installing and removing the wrapper is statusline.ts.\n\nexport const WORK_STATUSLINE = 'work hook statusline';\n/** Set on the user's own command: a status line that runs work's hook again (it called `work hook statusline` itself) records, and runs nothing more. */\nexport const NESTED_ENV = 'WORK_STATUSLINE_NESTED';\n\nexport type StatusLine = Record<string, unknown>;\n\nexport const isRecord = (v: unknown): v is Record<string, unknown> => typeof v === 'object' && v !== null && !Array.isArray(v);\n/**\n * Where the user's own status line is saved: `statusline.json` for the default account, `statusline-<account>.json` for\n * another — named by `accountOf(CLAUDE_CONFIG_DIR)`, a short hash of the folder, the same name the hook computes from its\n * environment (it knows the folder, not the registry's name for it, and loads no config to find out; a renamed account\n * keeps its saved line).\n */\nexport const savedPath = (configDir?: string) => {\n const account = accountOf(configDir);\n return path.join(getConfigDir(), account === 'default' ? 'statusline.json' : `statusline-${account}.json`);\n};\n\n/**\n * work's hook under any path (`/usr/bin/work hook statusline`, `node …/bin.js hook statusline`), with or without the\n * user's line after `||` as its fallback: saved as \"the original\", it would run itself.\n */\nexport const isOurs = (v: unknown) => isRecord(v) && typeof v.command === 'string' && /\\bhook\\s+statusline\\b/.test(v.command);\n\n/** What ~/.work/statusline.json says: an original (null: there was none), nothing saved, or a file that can't be read. */\nexport type Saved = { kind: 'ok'; original: StatusLine | null } | { kind: 'missing' } | { kind: 'unreadable'; why: string };\n\nexport function readSaved(configDir?: string): Saved {\n let text: string;\n try {\n text = fs.readFileSync(savedPath(configDir), 'utf-8');\n } catch (e) {\n const code = (e as NodeJS.ErrnoException).code;\n return code === 'ENOENT' ? { kind: 'missing' } : { kind: 'unreadable', why: code ?? String(e) };\n }\n let v: unknown;\n try {\n v = JSON.parse(text);\n } catch (e) {\n return { kind: 'unreadable', why: e instanceof Error ? e.message : String(e) };\n }\n if (!isRecord(v) || !('original' in v)) return { kind: 'unreadable', why: 'no original in it' };\n if (v.original === null) return { kind: 'ok', original: null };\n return isRecord(v.original) ? { kind: 'ok', original: v.original } : { kind: 'unreadable', why: 'original is not an object' };\n}\n\n/**\n * The user's own status line command, when they had one — the one saved for the account of the Claude that runs it\n * (`configDir`: its `CLAUDE_CONFIG_DIR`). `onDamage` hears why a saved file couldn't be read.\n *\n * An account with nothing saved whose settings run work's line anyway — a settings.json copied from the default\n * account's, or a folder shared with it — falls back to the default account's saved original: that is the line its\n * settings came with, and without it the user's own line would show nowhere on that account.\n */\nexport function originalStatusLine(onDamage?: (why: string) => void, configDir?: string): { command: string } | null {\n let saved = readSaved(configDir);\n if (saved.kind === 'missing' && accountOf(configDir) !== 'default') saved = readSaved();\n if (saved.kind === 'unreadable') onDamage?.(saved.why);\n const o = saved.kind === 'ok' ? saved.original : null;\n return o && typeof o.command === 'string' && o.command ? { command: o.command } : null;\n}\n\n/** The shell Claude Code runs a status line in: sh on POSIX, Git Bash on Windows. */\nexport function shellFor(\n platform: NodeJS.Platform = process.platform,\n env: NodeJS.ProcessEnv = process.env,\n exists: (p: string) => boolean = fs.existsSync,\n): { file: string; args: (cmd: string) => string[] } {\n const args = (cmd: string) => ['-c', cmd];\n if (platform !== 'win32') return { file: '/bin/sh', args };\n const configured = env.CLAUDE_CODE_GIT_BASH_PATH;\n if (configured && exists(configured)) return { file: configured, args };\n for (const dir of (env.PATH ?? env.Path ?? '').split(';').filter(Boolean)) {\n if (!exists(path.win32.join(dir, 'git.exe'))) continue;\n for (const bash of [path.win32.join(dir, '..', 'bin', 'bash.exe'), path.win32.join(dir, 'bash.exe')])\n if (exists(bash)) return { file: bash, args };\n }\n const standard = 'C:\\\\Program Files\\\\Git\\\\bin\\\\bash.exe';\n return { file: exists(standard) ? standard : 'bash', args };\n}\n\nconst OUTPUT_CAP = 64 * 1024;\n/** After the command exits, how long what it printed may still be on its way: its stdout can stay open past its exit. */\nconst EXIT_GRACE_MS = 100;\n\n/** Stop the command and whatever it started: its process group on POSIX (a `cmd &` holding stdout keeps no hook alive), taskkill /T on Windows. */\nfunction killCommand(pid: number): void {\n if (detachHere()) {\n try {\n process.kill(-pid, 'SIGKILL');\n return;\n } catch {\n /* no group (it wasn't detached, or has gone): the process alone */\n }\n }\n killTree(pid);\n}\n\n/** Run the user's own status line with Claude's JSON on stdin. Its output, or '' when it fails or takes too long: never rejects. */\nexport function runStatusLineCommand(cmd: string, stdin: string, o: { timeoutMs?: number; cwd?: string } = {}): Promise<string> {\n return new Promise((resolve) => {\n let done = false;\n const out: Buffer[] = [];\n let outBytes = 0;\n let timer: NodeJS.Timeout | undefined;\n let grace: NodeJS.Timeout | undefined;\n let child: ReturnType<typeof spawn> | undefined;\n const finish = (ok: boolean) => {\n if (done) return;\n done = true;\n clearTimeout(timer);\n clearTimeout(grace);\n // Let go of it: a pipe still held by something it started would keep this process (Claude's hook) alive past its cap.\n child?.stdout?.destroy();\n child?.stdin?.destroy();\n child?.unref();\n resolve(ok ? Buffer.concat(out).subarray(0, OUTPUT_CAP).toString('utf-8') : '');\n };\n try {\n const sh = shellFor();\n child = spawn(sh.file, sh.args(cmd), {\n stdio: ['pipe', 'pipe', 'ignore'],\n windowsHide: true,\n cwd: o.cwd,\n // Its own process group on POSIX, so a timeout stops what it started too.\n detached: detachHere(),\n // Marked, so a command that runs work's hook again doesn't run itself (runStatusLineHook).\n env: { ...process.env, [NESTED_ENV]: '1' },\n });\n const c = child;\n timer = setTimeout(() => {\n if (c.pid) killCommand(c.pid);\n finish(false);\n }, o.timeoutMs ?? 5000);\n c.on('error', () => finish(false));\n c.stdout?.on('data', (d: Buffer) => {\n if (outBytes >= OUTPUT_CAP) return;\n out.push(d);\n outBytes += d.length;\n });\n // 'close' waits for stdout to end, and something the command left running (`cmd &`) holds it: the line would wait\n // for the cap, and be lost. Its exit decides; what it printed is read until stdout ends, or a moment more.\n c.on('exit', (code) => {\n if (code !== 0) finish(false);\n else grace ??= setTimeout(() => finish(true), EXIT_GRACE_MS);\n });\n c.on('close', (code) => finish(code === 0));\n c.stdin?.on('error', () => {\n /* it exited before reading: its exit code decides */\n });\n c.stdin?.end(stdin);\n } catch {\n finish(false);\n }\n });\n}\n"],"mappings":";;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,SAAS,kBAAkB;AAK3B,IAAM,WAAW,CAAC,MAA6C,OAAO,MAAM,YAAY,MAAM,QAAQ,CAAC,MAAM,QAAQ,CAAC;AAEtH,IAAM,eAAe,CAAC,MAAc,KAAK,MAAM,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI;AAGrF,SAAS,SAAS,GAA2B;AAC3C,MAAI;AACJ,MAAI,OAAO,MAAM,YAAY,OAAO,SAAS,CAAC,EAAG,MAAK,IAAI,OAAO,IAAI,MAAO;AAAA,WACnE,OAAO,MAAM,YAAY,EAAE,KAAK,MAAM,GAAI,MAAK,KAAK,MAAM,CAAC;AAAA,MAC/D,QAAO;AACZ,SAAO,OAAO,SAAS,EAAE,IAAI,IAAI,KAAK,EAAE,EAAE,YAAY,IAAI;AAC5D;AAEA,IAAM,aAAa,CAAC,MAAc,EAAE,OAAO,CAAC,EAAE,YAAY,IAAI,EAAE,MAAM,CAAC;AAEvE,SAAS,QAAQ,KAAqB;AACpC,MAAI,QAAQ,YAAa,QAAO;AAChC,MAAI,QAAQ,YAAa,QAAO;AAChC,QAAM,QAAQ,mBAAmB,KAAK,GAAG;AACzC,MAAI,MAAO,QAAO,UAAU,WAAW,MAAM,CAAC,EAAG,QAAQ,MAAM,GAAG,CAAC,CAAC;AACpE,QAAM,OAAO,qBAAqB,KAAK,GAAG;AAC1C,MAAI,KAAM,QAAO,GAAG,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC;AACtC,SAAO,GAAG,WAAW,IAAI,QAAQ,MAAM,GAAG,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A;AAAA,QAEP,UAAU,WAAW;AAAA;AAAA,QAErB,KAAK,EAAE,GAAG,QAAQ,KAAK,CAAC,UAAU,GAAG,IAAI;AAAA,MAC3C,CAAC;AACD,YAAM,IAAI;AACV,cAAQ,WAAW,MAAM;AACvB,YAAI,EAAE,IAAK,aAAY,EAAE,GAAG;AAC5B,eAAO,KAAK;AAAA,MACd,GAAG,EAAE,aAAa,GAAI;AACtB,QAAE,GAAG,SAAS,MAAM,OAAO,KAAK,CAAC;AACjC,QAAE,QAAQ,GAAG,QAAQ,CAAC,MAAc;AAClC,YAAI,YAAY,WAAY;AAC5B,YAAI,KAAK,CAAC;AACV,oBAAY,EAAE;AAAA,MAChB,CAAC;AAGD,QAAE,GAAG,QAAQ,CAAC,SAAS;AACrB,YAAI,SAAS,EAAG,QAAO,KAAK;AAAA,YACvB,WAAU,WAAW,MAAM,OAAO,IAAI,GAAG,aAAa;AAAA,MAC7D,CAAC;AACD,QAAE,GAAG,SAAS,CAAC,SAAS,OAAO,SAAS,CAAC,CAAC;AAC1C,QAAE,OAAO,GAAG,SAAS,MAAM;AAAA,MAE3B,CAAC;AACD,QAAE,OAAO,IAAI,KAAK;AAAA,IACpB,QAAQ;AACN,aAAO,KAAK;AAAA,IACd;AAAA,EACF,CAAC;AACH;","names":["os","r","fs","path","isRecord","path","fs"]}
@@ -6,7 +6,7 @@ import {
6
6
  json,
7
7
  tx,
8
8
  withDb
9
- } from "./chunk-JF72AS6T.js";
9
+ } from "./chunk-YYBXQBW2.js";
10
10
 
11
11
  // src/core/comments/comment-file-store.ts
12
12
  function isComment(x) {
@@ -137,4 +137,4 @@ export {
137
137
  getCommentFileStore,
138
138
  moveStoreComments
139
139
  };
140
- //# sourceMappingURL=chunk-EYUBVLPF.js.map
140
+ //# sourceMappingURL=chunk-5QGCF3PS.js.map
@@ -1,11 +1,23 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- getConfigDir
4
- } from "./chunk-RYEPQLXQ.js";
5
2
 
6
- // src/core/platform/logger.ts
3
+ // src/core/platform/config-dir.ts
7
4
  import fs from "fs";
8
5
  import path from "path";
6
+ import os from "os";
7
+ function configDirPath() {
8
+ return path.join(os.homedir(), ".work");
9
+ }
10
+ function getConfigDir() {
11
+ const dir = path.join(os.homedir(), ".work");
12
+ if (!fs.existsSync(dir)) {
13
+ fs.mkdirSync(dir, { recursive: true });
14
+ }
15
+ return dir;
16
+ }
17
+
18
+ // src/core/platform/logger.ts
19
+ import fs2 from "fs";
20
+ import path2 from "path";
9
21
  var maxLogSize = 5 * 1024 * 1024;
10
22
  var logPath = null;
11
23
  var logFd = null;
@@ -13,11 +25,11 @@ var logBytes = 0;
13
25
  function rotate(file) {
14
26
  const prev = file + ".1";
15
27
  try {
16
- fs.unlinkSync(prev);
28
+ fs2.unlinkSync(prev);
17
29
  } catch {
18
30
  }
19
31
  try {
20
- fs.renameSync(file, prev);
32
+ fs2.renameSync(file, prev);
21
33
  } catch {
22
34
  }
23
35
  }
@@ -25,18 +37,18 @@ function ensureLog() {
25
37
  if (logFd !== null) return logFd;
26
38
  try {
27
39
  const dir = getConfigDir();
28
- fs.mkdirSync(dir, { recursive: true });
29
- logPath = path.join(dir, "debug.log");
40
+ fs2.mkdirSync(dir, { recursive: true });
41
+ logPath = path2.join(dir, "debug.log");
30
42
  let size = 0;
31
43
  try {
32
- size = fs.statSync(logPath).size;
44
+ size = fs2.statSync(logPath).size;
33
45
  } catch {
34
46
  }
35
47
  if (size > maxLogSize) {
36
48
  rotate(logPath);
37
49
  size = 0;
38
50
  }
39
- logFd = fs.openSync(logPath, "a");
51
+ logFd = fs2.openSync(logPath, "a");
40
52
  logBytes = size;
41
53
  return logFd;
42
54
  } catch {
@@ -56,7 +68,7 @@ function debugLog(level, ...args) {
56
68
  const line = `${timestamp()} [${level}] ${msg}
57
69
  `;
58
70
  try {
59
- fs.writeSync(fd, line);
71
+ fs2.writeSync(fd, line);
60
72
  } catch {
61
73
  return;
62
74
  }
@@ -89,7 +101,7 @@ function debug(...args) {
89
101
  function closeLog() {
90
102
  if (logFd !== null) {
91
103
  try {
92
- fs.closeSync(logFd);
104
+ fs2.closeSync(logFd);
93
105
  } catch {
94
106
  }
95
107
  logFd = null;
@@ -97,8 +109,10 @@ function closeLog() {
97
109
  }
98
110
 
99
111
  export {
112
+ configDirPath,
113
+ getConfigDir,
100
114
  debugLog,
101
115
  installConsoleLogger,
102
116
  debug
103
117
  };
104
- //# sourceMappingURL=chunk-75MIXOUK.js.map
118
+ //# sourceMappingURL=chunk-6THUVP6T.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/platform/config-dir.ts","../src/core/platform/logger.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport os from 'node:os';\n\n/** `~/.work`, never made: for what only reads (an install must write nothing there). */\nexport function configDirPath(): string {\n return path.join(os.homedir(), '.work');\n}\n\n/** `~/.work`, made when missing. Its own module (config.ts re-exports it) so the logger can find it without importing config, which reports through the logger. */\nexport function getConfigDir(): string {\n const dir = path.join(os.homedir(), '.work');\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir, { recursive: true });\n }\n return dir;\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport { getConfigDir } from './config-dir.js';\n\nlet maxLogSize = 5 * 1024 * 1024; // 5MB, then debug.log → debug.log.1\n\nlet logPath: string | null = null;\n/** A plain file descriptor, written synchronously: a line is on disk when\n * debugLog returns (a buffered stream lost the last lines on exit), and\n * rotation can close the file before renaming it — Windows refuses to\n * rename a file that is still open. */\nlet logFd: number | null = null;\n/** Bytes in the current file: its size at open plus what we wrote since. */\nlet logBytes = 0;\n\n/** Tests shrink the cap to exercise rotation. */\nexport function setMaxLogSizeForTests(bytes: number): void {\n maxLogSize = bytes;\n}\n\nfunction rotate(file: string): void {\n const prev = file + '.1';\n try {\n fs.unlinkSync(prev);\n } catch {\n /* */\n }\n try {\n fs.renameSync(file, prev);\n } catch {\n /* another process has it open; next time */\n }\n}\n\nfunction ensureLog(): number | null {\n if (logFd !== null) return logFd;\n try {\n const dir = getConfigDir();\n fs.mkdirSync(dir, { recursive: true });\n logPath = path.join(dir, 'debug.log');\n let size = 0;\n try {\n size = fs.statSync(logPath).size;\n } catch {\n /* file doesn't exist yet */\n }\n if (size > maxLogSize) {\n rotate(logPath);\n size = 0;\n }\n logFd = fs.openSync(logPath, 'a');\n logBytes = size;\n return logFd;\n } catch {\n return null;\n }\n}\n\nfunction timestamp(): string {\n return new Date().toISOString();\n}\n\n// Strip ANSI escape codes for clean log output\nfunction stripAnsi(str: string): string {\n return str.replace(/\\x1b\\[[0-9;]*m/g, '');\n}\n\nexport function debugLog(level: 'INFO' | 'ERROR' | 'DEBUG' | 'WARN', ...args: unknown[]): void {\n const fd = ensureLog();\n if (fd === null) return;\n const msg = args.map((a) => (typeof a === 'string' ? stripAnsi(a) : JSON.stringify(a))).join(' ');\n const line = `${timestamp()} [${level}] ${msg}\\n`;\n try {\n fs.writeSync(fd, line);\n } catch {\n return; // best effort: logging must never break the host\n }\n logBytes += Buffer.byteLength(line);\n // Rotate while running too: work web and the PTY host run for days, and\n // the cap used to be checked only when a process opened the log.\n if (logBytes > maxLogSize && logPath) {\n closeLog();\n rotate(logPath);\n }\n}\n\n/**\n * Patch console.log and console.error to also write to the debug log.\n * Call once at startup.\n */\nexport function installConsoleLogger(): void {\n const origLog = console.log.bind(console);\n const origError = console.error.bind(console);\n const origWarn = console.warn.bind(console);\n\n console.log = (...args: unknown[]) => {\n origLog(...args);\n debugLog('INFO', ...args);\n };\n\n console.error = (...args: unknown[]) => {\n origError(...args);\n debugLog('ERROR', ...args);\n };\n\n console.warn = (...args: unknown[]) => {\n origWarn(...args);\n debugLog('WARN', ...args);\n };\n}\n\n/** Write a debug-only message (not shown to user). */\nexport function debug(...args: unknown[]): void {\n debugLog('DEBUG', ...args);\n}\n\n/** Get the log file path. */\nexport function getLogPath(): string {\n ensureLog();\n return logPath ?? path.join(getConfigDir(), 'debug.log');\n}\n\n/** Flush and close the log stream. */\nexport function closeLog(): void {\n if (logFd !== null) {\n try {\n fs.closeSync(logFd);\n } catch {\n /* */\n }\n logFd = null;\n }\n}\n"],"mappings":";;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,QAAQ;AAGR,SAAS,gBAAwB;AACtC,SAAO,KAAK,KAAK,GAAG,QAAQ,GAAG,OAAO;AACxC;AAGO,SAAS,eAAuB;AACrC,QAAM,MAAM,KAAK,KAAK,GAAG,QAAQ,GAAG,OAAO;AAC3C,MAAI,CAAC,GAAG,WAAW,GAAG,GAAG;AACvB,OAAG,UAAU,KAAK,EAAE,WAAW,KAAK,CAAC;AAAA,EACvC;AACA,SAAO;AACT;;;AChBA,OAAOA,SAAQ;AACf,OAAOC,WAAU;AAGjB,IAAI,aAAa,IAAI,OAAO;AAE5B,IAAI,UAAyB;AAK7B,IAAI,QAAuB;AAE3B,IAAI,WAAW;AAOf,SAAS,OAAO,MAAoB;AAClC,QAAM,OAAO,OAAO;AACpB,MAAI;AACF,IAAAC,IAAG,WAAW,IAAI;AAAA,EACpB,QAAQ;AAAA,EAER;AACA,MAAI;AACF,IAAAA,IAAG,WAAW,MAAM,IAAI;AAAA,EAC1B,QAAQ;AAAA,EAER;AACF;AAEA,SAAS,YAA2B;AAClC,MAAI,UAAU,KAAM,QAAO;AAC3B,MAAI;AACF,UAAM,MAAM,aAAa;AACzB,IAAAA,IAAG,UAAU,KAAK,EAAE,WAAW,KAAK,CAAC;AACrC,cAAUC,MAAK,KAAK,KAAK,WAAW;AACpC,QAAI,OAAO;AACX,QAAI;AACF,aAAOD,IAAG,SAAS,OAAO,EAAE;AAAA,IAC9B,QAAQ;AAAA,IAER;AACA,QAAI,OAAO,YAAY;AACrB,aAAO,OAAO;AACd,aAAO;AAAA,IACT;AACA,YAAQA,IAAG,SAAS,SAAS,GAAG;AAChC,eAAW;AACX,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,YAAoB;AAC3B,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AACF;","names":["fs","path","fs","path","fs"]}
@@ -1,19 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runInternal
4
- } from "./chunk-U7EQ2O6C.js";
4
+ } from "./chunk-NPCBJV7T.js";
5
5
  import {
6
6
  messageOf,
7
7
  readStatus
8
- } from "./chunk-MSZQUJZZ.js";
8
+ } from "./chunk-QLAVWIDJ.js";
9
+ import {
10
+ sessionIdFor
11
+ } from "./chunk-YYBXQBW2.js";
9
12
  import {
10
13
  agentOf,
11
14
  lineTimeOf,
12
15
  readJsonlSince
13
- } from "./chunk-VESYLAVA.js";
14
- import {
15
- sessionIdFor
16
- } from "./chunk-JF72AS6T.js";
16
+ } from "./chunk-F6M255O5.js";
17
17
 
18
18
  // src/core/conversations/catch-up-deps.ts
19
19
  var askCatchUp = (prompt) => runInternal(prompt, 9e4);
@@ -100,4 +100,4 @@ export {
100
100
  cachedCatchUp,
101
101
  catchUp
102
102
  };
103
- //# sourceMappingURL=chunk-5ZGF2M52.js.map
103
+ //# sourceMappingURL=chunk-7GGIVYWP.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readStatus
4
- } from "./chunk-MSZQUJZZ.js";
4
+ } from "./chunk-QLAVWIDJ.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-MJNXAAJF.js.map
19
+ //# sourceMappingURL=chunk-7NVEGPZT.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  debugLog
4
- } from "./chunk-75MIXOUK.js";
4
+ } from "./chunk-6THUVP6T.js";
5
5
 
6
6
  // src/core/platform/report.ts
7
7
  import { AsyncLocalStorage } from "async_hooks";
@@ -48,4 +48,4 @@ export {
48
48
  collectingReporter,
49
49
  keepingWarnings
50
50
  };
51
- //# sourceMappingURL=chunk-ZGXRWL7T.js.map
51
+ //# sourceMappingURL=chunk-AU27USPZ.js.map