@moberg_hr/work-tree 2.18.0 → 2.18.1

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 (218) hide show
  1. package/dist/{account-TT5TOV7Y.js → account-B3HHUCH6.js} +11 -11
  2. package/dist/{add-repo-LM5M2TW4.js → add-repo-2U2FLGJQ.js} +8 -8
  3. package/dist/{answer-Q47UH37K.js → answer-HHCSBUQE.js} +5 -5
  4. package/dist/{attach-JMA4XCEB.js → attach-RNWANIFC.js} +9 -9
  5. package/dist/bin.js +2 -2
  6. package/dist/{block-TTMTQ5WO.js → block-FSGNBJSN.js} +7 -7
  7. package/dist/{broadcast-MQL3PHVK.js → broadcast-5WAUMYVO.js} +3 -3
  8. package/dist/{catchup-DKD3BGTG.js → catchup-T5SOCXHV.js} +8 -8
  9. package/dist/{chunk-KX6KZYU4.js → chunk-26DBVWJC.js} +3 -3
  10. package/dist/{chunk-DA2KILWV.js → chunk-2LUTV7UB.js} +2 -2
  11. package/dist/{chunk-CZWZMRQ3.js → chunk-2SLALFWA.js} +4 -4
  12. package/dist/{chunk-JIK4FY3E.js → chunk-2YRR5Q3C.js} +2 -2
  13. package/dist/{chunk-WVZG5Q4L.js → chunk-374HKMSE.js} +2 -2
  14. package/dist/{chunk-QHFUCX2J.js → chunk-3JLMVWRO.js} +2 -2
  15. package/dist/chunk-4YG55UQ6.js +9 -0
  16. package/dist/{chunk-XUO5F4JU.js → chunk-55T4LC2P.js} +3 -3
  17. package/dist/{chunk-LVNRPAQK.js → chunk-6EW27TKI.js} +7 -7
  18. package/dist/{chunk-D77U5ELL.js → chunk-A72CRTFG.js} +2 -2
  19. package/dist/{chunk-T3KZSJHU.js → chunk-AC7FECH5.js} +5 -5
  20. package/dist/{chunk-NGB2K7HX.js → chunk-ADVMIHTB.js} +2 -2
  21. package/dist/{chunk-FAGTMW6W.js → chunk-AMKLWFT3.js} +2 -2
  22. package/dist/{chunk-E25DJVBD.js → chunk-AT4EPCOV.js} +2 -2
  23. package/dist/{chunk-XPX5AAYH.js → chunk-AWP2MCMN.js} +3 -3
  24. package/dist/{chunk-V6KHER6C.js → chunk-BGPCIL4U.js} +4 -4
  25. package/dist/{chunk-VEERK6HO.js → chunk-BGS5M542.js} +2 -2
  26. package/dist/{chunk-JEH4X76F.js → chunk-BMLV63AW.js} +2 -2
  27. package/dist/{chunk-NBLF2SNP.js → chunk-CIUTNNF4.js} +4 -4
  28. package/dist/{chunk-IALCEDTH.js → chunk-DAQJZE3B.js} +9 -9
  29. package/dist/{chunk-PLTFWTIE.js → chunk-F5RPC3LT.js} +3 -3
  30. package/dist/{chunk-O22DNTKU.js → chunk-FJYM2JQN.js} +2 -2
  31. package/dist/{chunk-FJADRDML.js → chunk-G7VLIMOH.js} +4 -4
  32. package/dist/{chunk-63RNLC25.js → chunk-GUEJVX2X.js} +2 -2
  33. package/dist/{chunk-QEZGXU5Q.js → chunk-H4TNGZKT.js} +5 -5
  34. package/dist/{chunk-YCCZKF4F.js → chunk-H5JNYD63.js} +2 -2
  35. package/dist/{chunk-U4INTLIY.js → chunk-IBTA4DSY.js} +5 -5
  36. package/dist/{chunk-C2BFHQHX.js → chunk-ITNSUPVJ.js} +4 -4
  37. package/dist/{chunk-ESEIPUMT.js → chunk-IVH5T4U2.js} +2 -2
  38. package/dist/{chunk-VFZI4SAH.js → chunk-J5B2Z7SO.js} +2 -2
  39. package/dist/{chunk-VFRJO737.js → chunk-KK5RCNDL.js} +6 -6
  40. package/dist/{chunk-Z5TRUCIA.js → chunk-LBJHFVH3.js} +6 -6
  41. package/dist/{chunk-7PKIZVR7.js → chunk-LVNPLXUO.js} +5 -5
  42. package/dist/{chunk-ZKSITAVC.js → chunk-N2IDEZGB.js} +4 -4
  43. package/dist/{chunk-SFFAPGA5.js → chunk-PJ7ZKAZF.js} +2 -2
  44. package/dist/{chunk-KQ7QLBY2.js → chunk-PYHYZGY4.js} +3 -3
  45. package/dist/{chunk-OEQASHE3.js → chunk-PZGLIYMD.js} +54 -54
  46. package/dist/{chunk-XFWO5FYK.js → chunk-QDNNFL56.js} +3 -3
  47. package/dist/{chunk-5JRO64D4.js → chunk-QO4QWQUO.js} +2 -2
  48. package/dist/{chunk-Z4MI3HBV.js → chunk-QTENJUM3.js} +5 -5
  49. package/dist/{chunk-HREHEBL2.js → chunk-S7OCHVVD.js} +5 -5
  50. package/dist/{chunk-GR4LV3ZS.js → chunk-V76KARDB.js} +2 -2
  51. package/dist/{chunk-EP7LCLHB.js → chunk-VBB3E37Z.js} +5 -5
  52. package/dist/{chunk-ARQSFOYE.js → chunk-VG5WQPQB.js} +3 -3
  53. package/dist/{chunk-JPXEX3XW.js → chunk-WKHP3AXS.js} +2 -2
  54. package/dist/{chunk-AQKPXFC2.js → chunk-WVDIS22N.js} +3 -3
  55. package/dist/{chunk-3OUUWNK2.js → chunk-WXYUABCL.js} +5 -5
  56. package/dist/{chunk-RNEN6NUX.js → chunk-XKPF4MD2.js} +3 -3
  57. package/dist/{chunk-TI2CNJLD.js → chunk-XQEP3QYX.js} +4 -4
  58. package/dist/{cleanup-MW27IU2D.js → cleanup-LJHC5O6U.js} +22 -22
  59. package/dist/{cli-QVGLGPQB.js → cli-K6T6AJHP.js} +3 -3
  60. package/dist/{color-RGMFJAHN.js → color-7PZNDE4R.js} +5 -5
  61. package/dist/{config-AWVOZGZR.js → config-TM37HUBM.js} +5 -5
  62. package/dist/{diff-WJKZRFRM.js → diff-RSSLOKE7.js} +6 -6
  63. package/dist/{digest-OX5NEL2K.js → digest-LCHLLJ4M.js} +5 -5
  64. package/dist/{fork-4AAA7GAX.js → fork-XVNZMWCA.js} +19 -19
  65. package/dist/{history-MMA6YXFH.js → history-CRUFLMA2.js} +3 -3
  66. package/dist/{hook-MOC7MYLG.js → hook-U4WCMGD6.js} +7 -7
  67. package/dist/{hydrate-EGS47UUM.js → hydrate-BYXK4W6T.js} +3 -3
  68. package/dist/{init-QOFM5BTW.js → init-JWBB4HBE.js} +8 -8
  69. package/dist/{install-skills-E24KULUM.js → install-skills-M2Y6ZGQC.js} +3 -3
  70. package/dist/install-skills-bin.js +2 -2
  71. package/dist/{keep-WLDMR63Z.js → keep-OZJ2XXKF.js} +5 -5
  72. package/dist/{list-YJ6BSG2M.js → list-YVZSGKT4.js} +3 -3
  73. package/dist/{move-AGSZHGWY.js → move-7TAU3LI3.js} +9 -9
  74. package/dist/{note-GCNBL5A2.js → note-ESLGTIYH.js} +5 -5
  75. package/dist/{overlaps-X3YDTLTV.js → overlaps-FYXO3OL2.js} +9 -9
  76. package/dist/{pin-22MYV72V.js → pin-AAMXBCV3.js} +5 -5
  77. package/dist/{pr-YRQYEWL7.js → pr-42UBVLUT.js} +14 -14
  78. package/dist/{prune-7RV6GMHU.js → prune-B72T33B6.js} +20 -20
  79. package/dist/{pty-host-PUVNAZ3F.js → pty-host-72L4DQL5.js} +7 -7
  80. package/dist/{read-BOB63DIH.js → read-75KS2EXO.js} +5 -5
  81. package/dist/{recent-S2JIDTHB.js → recent-H665DNCJ.js} +8 -8
  82. package/dist/{remove-EKBQROBE.js → remove-ZZBCNASU.js} +21 -21
  83. package/dist/{restart-UM7XOGDO.js → restart-WFMCSOPB.js} +5 -5
  84. package/dist/{resume-BFE6ETTN.js → resume-GICIEI2I.js} +8 -8
  85. package/dist/{review-XQG3AEMG.js → review-TZUVYEAL.js} +4 -4
  86. package/dist/{run-KFICX2JE.js → run-SVJLTKSR.js} +3 -3
  87. package/dist/{screen-2B66BGKO.js → screen-JC6L6MT5.js} +5 -5
  88. package/dist/{search-3MXCGLOL.js → search-3BZMJM3P.js} +3 -3
  89. package/dist/{section-QJV7ENVX.js → section-GNYPAEQC.js} +5 -5
  90. package/dist/{send-LAAEMPZQ.js → send-KVUFOWCP.js} +6 -6
  91. package/dist/{sessions-TWN3F43J.js → sessions-W36QTHAD.js} +17 -17
  92. package/dist/{show-JFRJVS3G.js → show-FQPMGZO3.js} +4 -4
  93. package/dist/{snooze-RRPHFFMD.js → snooze-HGO3W2OF.js} +5 -5
  94. package/dist/{start-XTEZKSA3.js → start-UQSJGUMJ.js} +5 -5
  95. package/dist/{status-2BFFMHO2.js → status-MGTUAZTA.js} +7 -7
  96. package/dist/{stop-I6WWTUFP.js → stop-JBUL4WY3.js} +5 -5
  97. package/dist/{sync-SB5JN2EN.js → sync-ILYA3AHS.js} +20 -20
  98. package/dist/{time-IEFF5FEV.js → time-ZOJD7HFL.js} +6 -6
  99. package/dist/{timesheet-RRK4ENUU.js → timesheet-WT7QUB7M.js} +8 -8
  100. package/dist/{tree-G4ATBUTH.js → tree-M6YEJCXF.js} +19 -19
  101. package/dist/{update-LSDD3ZDO.js → update-47FZ6YO5.js} +11 -11
  102. package/dist/{usage-CTT5CMQK.js → usage-PTD3C34L.js} +5 -5
  103. package/dist/{usage-ask-YJNTOGXY.js → usage-ask-BULFMCUZ.js} +16 -16
  104. package/dist/{usage-ask-YJNTOGXY.js.map → usage-ask-BULFMCUZ.js.map} +1 -1
  105. package/dist/{wait-2L67BLEO.js → wait-JHFM3MA7.js} +6 -6
  106. package/dist/wd-bin.js +2 -2
  107. package/dist/web/assets/{PtyView-DhDNPvL9.js → PtyView-DpIVcrTI.js} +2 -2
  108. package/dist/web/assets/{PtyView-DhDNPvL9.js.map → PtyView-DpIVcrTI.js.map} +1 -1
  109. package/dist/web/assets/{index-CfBb7suR.js → index-DhXqtaRc.js} +4 -4
  110. package/dist/web/assets/{index-CfBb7suR.js.map → index-DhXqtaRc.js.map} +1 -1
  111. package/dist/web/index.html +1 -1
  112. package/dist/{web-MUO46QAX.js → web-HRGWOUDV.js} +48 -45
  113. package/dist/web-HRGWOUDV.js.map +1 -0
  114. package/npm-shrinkwrap.json +2 -2
  115. package/package.json +1 -1
  116. package/dist/chunk-UKPZXS5B.js +0 -9
  117. package/dist/web-MUO46QAX.js.map +0 -1
  118. /package/dist/{account-TT5TOV7Y.js.map → account-B3HHUCH6.js.map} +0 -0
  119. /package/dist/{add-repo-LM5M2TW4.js.map → add-repo-2U2FLGJQ.js.map} +0 -0
  120. /package/dist/{answer-Q47UH37K.js.map → answer-HHCSBUQE.js.map} +0 -0
  121. /package/dist/{attach-JMA4XCEB.js.map → attach-RNWANIFC.js.map} +0 -0
  122. /package/dist/{block-TTMTQ5WO.js.map → block-FSGNBJSN.js.map} +0 -0
  123. /package/dist/{broadcast-MQL3PHVK.js.map → broadcast-5WAUMYVO.js.map} +0 -0
  124. /package/dist/{catchup-DKD3BGTG.js.map → catchup-T5SOCXHV.js.map} +0 -0
  125. /package/dist/{chunk-KX6KZYU4.js.map → chunk-26DBVWJC.js.map} +0 -0
  126. /package/dist/{chunk-DA2KILWV.js.map → chunk-2LUTV7UB.js.map} +0 -0
  127. /package/dist/{chunk-CZWZMRQ3.js.map → chunk-2SLALFWA.js.map} +0 -0
  128. /package/dist/{chunk-JIK4FY3E.js.map → chunk-2YRR5Q3C.js.map} +0 -0
  129. /package/dist/{chunk-WVZG5Q4L.js.map → chunk-374HKMSE.js.map} +0 -0
  130. /package/dist/{chunk-QHFUCX2J.js.map → chunk-3JLMVWRO.js.map} +0 -0
  131. /package/dist/{chunk-UKPZXS5B.js.map → chunk-4YG55UQ6.js.map} +0 -0
  132. /package/dist/{chunk-XUO5F4JU.js.map → chunk-55T4LC2P.js.map} +0 -0
  133. /package/dist/{chunk-LVNRPAQK.js.map → chunk-6EW27TKI.js.map} +0 -0
  134. /package/dist/{chunk-D77U5ELL.js.map → chunk-A72CRTFG.js.map} +0 -0
  135. /package/dist/{chunk-T3KZSJHU.js.map → chunk-AC7FECH5.js.map} +0 -0
  136. /package/dist/{chunk-NGB2K7HX.js.map → chunk-ADVMIHTB.js.map} +0 -0
  137. /package/dist/{chunk-FAGTMW6W.js.map → chunk-AMKLWFT3.js.map} +0 -0
  138. /package/dist/{chunk-E25DJVBD.js.map → chunk-AT4EPCOV.js.map} +0 -0
  139. /package/dist/{chunk-XPX5AAYH.js.map → chunk-AWP2MCMN.js.map} +0 -0
  140. /package/dist/{chunk-V6KHER6C.js.map → chunk-BGPCIL4U.js.map} +0 -0
  141. /package/dist/{chunk-VEERK6HO.js.map → chunk-BGS5M542.js.map} +0 -0
  142. /package/dist/{chunk-JEH4X76F.js.map → chunk-BMLV63AW.js.map} +0 -0
  143. /package/dist/{chunk-NBLF2SNP.js.map → chunk-CIUTNNF4.js.map} +0 -0
  144. /package/dist/{chunk-IALCEDTH.js.map → chunk-DAQJZE3B.js.map} +0 -0
  145. /package/dist/{chunk-PLTFWTIE.js.map → chunk-F5RPC3LT.js.map} +0 -0
  146. /package/dist/{chunk-O22DNTKU.js.map → chunk-FJYM2JQN.js.map} +0 -0
  147. /package/dist/{chunk-FJADRDML.js.map → chunk-G7VLIMOH.js.map} +0 -0
  148. /package/dist/{chunk-63RNLC25.js.map → chunk-GUEJVX2X.js.map} +0 -0
  149. /package/dist/{chunk-QEZGXU5Q.js.map → chunk-H4TNGZKT.js.map} +0 -0
  150. /package/dist/{chunk-YCCZKF4F.js.map → chunk-H5JNYD63.js.map} +0 -0
  151. /package/dist/{chunk-U4INTLIY.js.map → chunk-IBTA4DSY.js.map} +0 -0
  152. /package/dist/{chunk-C2BFHQHX.js.map → chunk-ITNSUPVJ.js.map} +0 -0
  153. /package/dist/{chunk-ESEIPUMT.js.map → chunk-IVH5T4U2.js.map} +0 -0
  154. /package/dist/{chunk-VFZI4SAH.js.map → chunk-J5B2Z7SO.js.map} +0 -0
  155. /package/dist/{chunk-VFRJO737.js.map → chunk-KK5RCNDL.js.map} +0 -0
  156. /package/dist/{chunk-Z5TRUCIA.js.map → chunk-LBJHFVH3.js.map} +0 -0
  157. /package/dist/{chunk-7PKIZVR7.js.map → chunk-LVNPLXUO.js.map} +0 -0
  158. /package/dist/{chunk-ZKSITAVC.js.map → chunk-N2IDEZGB.js.map} +0 -0
  159. /package/dist/{chunk-SFFAPGA5.js.map → chunk-PJ7ZKAZF.js.map} +0 -0
  160. /package/dist/{chunk-KQ7QLBY2.js.map → chunk-PYHYZGY4.js.map} +0 -0
  161. /package/dist/{chunk-OEQASHE3.js.map → chunk-PZGLIYMD.js.map} +0 -0
  162. /package/dist/{chunk-XFWO5FYK.js.map → chunk-QDNNFL56.js.map} +0 -0
  163. /package/dist/{chunk-5JRO64D4.js.map → chunk-QO4QWQUO.js.map} +0 -0
  164. /package/dist/{chunk-Z4MI3HBV.js.map → chunk-QTENJUM3.js.map} +0 -0
  165. /package/dist/{chunk-HREHEBL2.js.map → chunk-S7OCHVVD.js.map} +0 -0
  166. /package/dist/{chunk-GR4LV3ZS.js.map → chunk-V76KARDB.js.map} +0 -0
  167. /package/dist/{chunk-EP7LCLHB.js.map → chunk-VBB3E37Z.js.map} +0 -0
  168. /package/dist/{chunk-ARQSFOYE.js.map → chunk-VG5WQPQB.js.map} +0 -0
  169. /package/dist/{chunk-JPXEX3XW.js.map → chunk-WKHP3AXS.js.map} +0 -0
  170. /package/dist/{chunk-AQKPXFC2.js.map → chunk-WVDIS22N.js.map} +0 -0
  171. /package/dist/{chunk-3OUUWNK2.js.map → chunk-WXYUABCL.js.map} +0 -0
  172. /package/dist/{chunk-RNEN6NUX.js.map → chunk-XKPF4MD2.js.map} +0 -0
  173. /package/dist/{chunk-TI2CNJLD.js.map → chunk-XQEP3QYX.js.map} +0 -0
  174. /package/dist/{cleanup-MW27IU2D.js.map → cleanup-LJHC5O6U.js.map} +0 -0
  175. /package/dist/{cli-QVGLGPQB.js.map → cli-K6T6AJHP.js.map} +0 -0
  176. /package/dist/{color-RGMFJAHN.js.map → color-7PZNDE4R.js.map} +0 -0
  177. /package/dist/{config-AWVOZGZR.js.map → config-TM37HUBM.js.map} +0 -0
  178. /package/dist/{diff-WJKZRFRM.js.map → diff-RSSLOKE7.js.map} +0 -0
  179. /package/dist/{digest-OX5NEL2K.js.map → digest-LCHLLJ4M.js.map} +0 -0
  180. /package/dist/{fork-4AAA7GAX.js.map → fork-XVNZMWCA.js.map} +0 -0
  181. /package/dist/{history-MMA6YXFH.js.map → history-CRUFLMA2.js.map} +0 -0
  182. /package/dist/{hook-MOC7MYLG.js.map → hook-U4WCMGD6.js.map} +0 -0
  183. /package/dist/{hydrate-EGS47UUM.js.map → hydrate-BYXK4W6T.js.map} +0 -0
  184. /package/dist/{init-QOFM5BTW.js.map → init-JWBB4HBE.js.map} +0 -0
  185. /package/dist/{install-skills-E24KULUM.js.map → install-skills-M2Y6ZGQC.js.map} +0 -0
  186. /package/dist/{keep-WLDMR63Z.js.map → keep-OZJ2XXKF.js.map} +0 -0
  187. /package/dist/{list-YJ6BSG2M.js.map → list-YVZSGKT4.js.map} +0 -0
  188. /package/dist/{move-AGSZHGWY.js.map → move-7TAU3LI3.js.map} +0 -0
  189. /package/dist/{note-GCNBL5A2.js.map → note-ESLGTIYH.js.map} +0 -0
  190. /package/dist/{overlaps-X3YDTLTV.js.map → overlaps-FYXO3OL2.js.map} +0 -0
  191. /package/dist/{pin-22MYV72V.js.map → pin-AAMXBCV3.js.map} +0 -0
  192. /package/dist/{pr-YRQYEWL7.js.map → pr-42UBVLUT.js.map} +0 -0
  193. /package/dist/{prune-7RV6GMHU.js.map → prune-B72T33B6.js.map} +0 -0
  194. /package/dist/{pty-host-PUVNAZ3F.js.map → pty-host-72L4DQL5.js.map} +0 -0
  195. /package/dist/{read-BOB63DIH.js.map → read-75KS2EXO.js.map} +0 -0
  196. /package/dist/{recent-S2JIDTHB.js.map → recent-H665DNCJ.js.map} +0 -0
  197. /package/dist/{remove-EKBQROBE.js.map → remove-ZZBCNASU.js.map} +0 -0
  198. /package/dist/{restart-UM7XOGDO.js.map → restart-WFMCSOPB.js.map} +0 -0
  199. /package/dist/{resume-BFE6ETTN.js.map → resume-GICIEI2I.js.map} +0 -0
  200. /package/dist/{review-XQG3AEMG.js.map → review-TZUVYEAL.js.map} +0 -0
  201. /package/dist/{run-KFICX2JE.js.map → run-SVJLTKSR.js.map} +0 -0
  202. /package/dist/{screen-2B66BGKO.js.map → screen-JC6L6MT5.js.map} +0 -0
  203. /package/dist/{search-3MXCGLOL.js.map → search-3BZMJM3P.js.map} +0 -0
  204. /package/dist/{section-QJV7ENVX.js.map → section-GNYPAEQC.js.map} +0 -0
  205. /package/dist/{send-LAAEMPZQ.js.map → send-KVUFOWCP.js.map} +0 -0
  206. /package/dist/{sessions-TWN3F43J.js.map → sessions-W36QTHAD.js.map} +0 -0
  207. /package/dist/{show-JFRJVS3G.js.map → show-FQPMGZO3.js.map} +0 -0
  208. /package/dist/{snooze-RRPHFFMD.js.map → snooze-HGO3W2OF.js.map} +0 -0
  209. /package/dist/{start-XTEZKSA3.js.map → start-UQSJGUMJ.js.map} +0 -0
  210. /package/dist/{status-2BFFMHO2.js.map → status-MGTUAZTA.js.map} +0 -0
  211. /package/dist/{stop-I6WWTUFP.js.map → stop-JBUL4WY3.js.map} +0 -0
  212. /package/dist/{sync-SB5JN2EN.js.map → sync-ILYA3AHS.js.map} +0 -0
  213. /package/dist/{time-IEFF5FEV.js.map → time-ZOJD7HFL.js.map} +0 -0
  214. /package/dist/{timesheet-RRK4ENUU.js.map → timesheet-WT7QUB7M.js.map} +0 -0
  215. /package/dist/{tree-G4ATBUTH.js.map → tree-M6YEJCXF.js.map} +0 -0
  216. /package/dist/{update-LSDD3ZDO.js.map → update-47FZ6YO5.js.map} +0 -0
  217. /package/dist/{usage-CTT5CMQK.js.map → usage-PTD3C34L.js.map} +0 -0
  218. /package/dist/{wait-2L67BLEO.js.map → wait-JHFM3MA7.js.map} +0 -0
@@ -5,49 +5,49 @@ import {
5
5
  } from "./chunk-ABQYKTG4.js";
6
6
  import {
7
7
  defaultCleanupDeps
8
- } from "./chunk-Z4MI3HBV.js";
9
- import "./chunk-IALCEDTH.js";
10
- import "./chunk-T3KZSJHU.js";
8
+ } from "./chunk-QTENJUM3.js";
9
+ import "./chunk-DAQJZE3B.js";
10
+ import "./chunk-AC7FECH5.js";
11
11
  import {
12
12
  applyCleanup,
13
13
  scanCleanup
14
14
  } from "./chunk-AKMPF72Y.js";
15
- import "./chunk-KQ7QLBY2.js";
15
+ import "./chunk-PYHYZGY4.js";
16
16
  import "./chunk-ICEP4WAK.js";
17
- import "./chunk-HREHEBL2.js";
17
+ import "./chunk-S7OCHVVD.js";
18
18
  import "./chunk-VRMALBZK.js";
19
- import "./chunk-WVZG5Q4L.js";
19
+ import "./chunk-374HKMSE.js";
20
20
  import "./chunk-4J2F6OWM.js";
21
21
  import "./chunk-DLV7TRON.js";
22
- import "./chunk-C2BFHQHX.js";
22
+ import "./chunk-ITNSUPVJ.js";
23
23
  import "./chunk-PZ7WTBSI.js";
24
24
  import "./chunk-EORL2V7P.js";
25
- import "./chunk-XFWO5FYK.js";
26
- import "./chunk-V6KHER6C.js";
27
- import "./chunk-5JRO64D4.js";
25
+ import "./chunk-QDNNFL56.js";
26
+ import "./chunk-BGPCIL4U.js";
27
+ import "./chunk-QO4QWQUO.js";
28
28
  import "./chunk-SJBEIYLK.js";
29
- import "./chunk-FAGTMW6W.js";
29
+ import "./chunk-AMKLWFT3.js";
30
30
  import "./chunk-7E5XPDKX.js";
31
- import "./chunk-63RNLC25.js";
32
- import "./chunk-XPX5AAYH.js";
31
+ import "./chunk-GUEJVX2X.js";
32
+ import "./chunk-AWP2MCMN.js";
33
33
  import "./chunk-ZSHWP2VS.js";
34
34
  import "./chunk-CNZV3UCM.js";
35
35
  import "./chunk-HUXS3VAI.js";
36
36
  import "./chunk-LM2T5OR3.js";
37
- import "./chunk-EP7LCLHB.js";
38
- import "./chunk-TI2CNJLD.js";
39
- import "./chunk-JPXEX3XW.js";
37
+ import "./chunk-VBB3E37Z.js";
38
+ import "./chunk-XQEP3QYX.js";
39
+ import "./chunk-WKHP3AXS.js";
40
40
  import "./chunk-FGPXMAYU.js";
41
- import "./chunk-QHFUCX2J.js";
41
+ import "./chunk-3JLMVWRO.js";
42
42
  import "./chunk-GNIYYXQX.js";
43
43
  import "./chunk-T5GJVUSL.js";
44
44
  import "./chunk-XBWS77S2.js";
45
45
  import "./chunk-4CXUVBOD.js";
46
- import "./chunk-D77U5ELL.js";
46
+ import "./chunk-A72CRTFG.js";
47
47
  import "./chunk-NEJVK5CF.js";
48
48
  import "./chunk-ALBTIOP3.js";
49
49
  import "./chunk-LNHSBM4L.js";
50
- import "./chunk-O22DNTKU.js";
50
+ import "./chunk-FJYM2JQN.js";
51
51
  import "./chunk-KGHWHAVF.js";
52
52
  import "./chunk-WIYDT3PY.js";
53
53
  import "./chunk-YQSWVHKK.js";
@@ -123,4 +123,4 @@ var syncCommand = {
123
123
  export {
124
124
  syncCommand
125
125
  };
126
- //# sourceMappingURL=sync-SB5JN2EN.js.map
126
+ //# sourceMappingURL=sync-ILYA3AHS.js.map
@@ -7,19 +7,19 @@ import {
7
7
  } from "./chunk-SRE4CK6Y.js";
8
8
  import {
9
9
  sessionWorkTime
10
- } from "./chunk-PLTFWTIE.js";
10
+ } from "./chunk-F5RPC3LT.js";
11
11
  import {
12
12
  sessionFromArgs,
13
13
  sessionPositionals
14
- } from "./chunk-ARQSFOYE.js";
14
+ } from "./chunk-VG5WQPQB.js";
15
15
  import "./chunk-6AQRYLOB.js";
16
- import "./chunk-XPX5AAYH.js";
16
+ import "./chunk-AWP2MCMN.js";
17
17
  import "./chunk-ZSHWP2VS.js";
18
18
  import "./chunk-CNZV3UCM.js";
19
19
  import "./chunk-HUXS3VAI.js";
20
20
  import {
21
21
  loadHistory
22
- } from "./chunk-D77U5ELL.js";
22
+ } from "./chunk-A72CRTFG.js";
23
23
  import {
24
24
  dayKey,
25
25
  formatWorked,
@@ -28,7 +28,7 @@ import {
28
28
  import {
29
29
  sessionIdFor
30
30
  } from "./chunk-ALBTIOP3.js";
31
- import "./chunk-O22DNTKU.js";
31
+ import "./chunk-FJYM2JQN.js";
32
32
  import "./chunk-KGHWHAVF.js";
33
33
  import "./chunk-WIYDT3PY.js";
34
34
  import "./chunk-YQSWVHKK.js";
@@ -123,4 +123,4 @@ var timeCommand = {
123
123
  export {
124
124
  timeCommand
125
125
  };
126
- //# sourceMappingURL=time-IEFF5FEV.js.map
126
+ //# sourceMappingURL=time-ZOJD7HFL.js.map
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  createMonthGather,
4
4
  defaultTimeDeps
5
- } from "./chunk-7PKIZVR7.js";
6
- import "./chunk-PLTFWTIE.js";
7
- import "./chunk-V6KHER6C.js";
8
- import "./chunk-5JRO64D4.js";
5
+ } from "./chunk-LVNPLXUO.js";
6
+ import "./chunk-F5RPC3LT.js";
7
+ import "./chunk-BGPCIL4U.js";
8
+ import "./chunk-QO4QWQUO.js";
9
9
  import {
10
10
  buildDay,
11
11
  dayArg,
@@ -26,16 +26,16 @@ import "./chunk-JVE2JFLV.js";
26
26
  import {
27
27
  callWorkWeb
28
28
  } from "./chunk-SZAD5U3J.js";
29
- import "./chunk-JPXEX3XW.js";
29
+ import "./chunk-WKHP3AXS.js";
30
30
  import "./chunk-FGPXMAYU.js";
31
31
  import "./chunk-GNIYYXQX.js";
32
32
  import "./chunk-T5GJVUSL.js";
33
33
  import "./chunk-XBWS77S2.js";
34
34
  import "./chunk-4CXUVBOD.js";
35
- import "./chunk-D77U5ELL.js";
35
+ import "./chunk-A72CRTFG.js";
36
36
  import "./chunk-NEJVK5CF.js";
37
37
  import "./chunk-ALBTIOP3.js";
38
- import "./chunk-O22DNTKU.js";
38
+ import "./chunk-FJYM2JQN.js";
39
39
  import "./chunk-KGHWHAVF.js";
40
40
  import "./chunk-WIYDT3PY.js";
41
41
  import "./chunk-YQSWVHKK.js";
@@ -206,4 +206,4 @@ var timesheetCommand = {
206
206
  export {
207
207
  timesheetCommand
208
208
  };
209
- //# sourceMappingURL=timesheet-RRK4ENUU.js.map
209
+ //# sourceMappingURL=timesheet-WT7QUB7M.js.map
@@ -4,26 +4,26 @@ import {
4
4
  openInLeftovers,
5
5
  resolvePrToStart,
6
6
  workOnPrPrompt
7
- } from "./chunk-AQKPXFC2.js";
7
+ } from "./chunk-WVDIS22N.js";
8
8
  import {
9
9
  retiredUnsafeOption,
10
10
  warnRetiredUnsafe
11
11
  } from "./chunk-S3CTXKSN.js";
12
12
  import {
13
13
  clearLaunchedUnsafeWhenIdle
14
- } from "./chunk-3OUUWNK2.js";
14
+ } from "./chunk-WXYUABCL.js";
15
15
  import "./chunk-FZHFD2AY.js";
16
- import "./chunk-VEERK6HO.js";
16
+ import "./chunk-BGS5M542.js";
17
17
  import "./chunk-ICEP4WAK.js";
18
18
  import {
19
19
  attachSession
20
- } from "./chunk-JIK4FY3E.js";
20
+ } from "./chunk-2YRR5Q3C.js";
21
21
  import {
22
22
  SETUP_WARNINGS
23
- } from "./chunk-FJADRDML.js";
24
- import "./chunk-HREHEBL2.js";
23
+ } from "./chunk-G7VLIMOH.js";
24
+ import "./chunk-S7OCHVVD.js";
25
25
  import "./chunk-VRMALBZK.js";
26
- import "./chunk-WVZG5Q4L.js";
26
+ import "./chunk-374HKMSE.js";
27
27
  import "./chunk-4J2F6OWM.js";
28
28
  import "./chunk-DLV7TRON.js";
29
29
  import {
@@ -32,27 +32,27 @@ import {
32
32
  openBaseCheckout,
33
33
  parseBaseSpec,
34
34
  setupWorktree
35
- } from "./chunk-C2BFHQHX.js";
35
+ } from "./chunk-ITNSUPVJ.js";
36
36
  import "./chunk-PZ7WTBSI.js";
37
37
  import "./chunk-EORL2V7P.js";
38
38
  import "./chunk-SJBEIYLK.js";
39
- import "./chunk-FAGTMW6W.js";
39
+ import "./chunk-AMKLWFT3.js";
40
40
  import "./chunk-7E5XPDKX.js";
41
- import "./chunk-63RNLC25.js";
42
- import "./chunk-XPX5AAYH.js";
41
+ import "./chunk-GUEJVX2X.js";
42
+ import "./chunk-AWP2MCMN.js";
43
43
  import "./chunk-ZSHWP2VS.js";
44
44
  import "./chunk-CNZV3UCM.js";
45
45
  import "./chunk-HUXS3VAI.js";
46
46
  import "./chunk-LM2T5OR3.js";
47
- import "./chunk-EP7LCLHB.js";
48
- import "./chunk-TI2CNJLD.js";
49
- import "./chunk-JPXEX3XW.js";
47
+ import "./chunk-VBB3E37Z.js";
48
+ import "./chunk-XQEP3QYX.js";
49
+ import "./chunk-WKHP3AXS.js";
50
50
  import "./chunk-FGPXMAYU.js";
51
- import "./chunk-QHFUCX2J.js";
51
+ import "./chunk-3JLMVWRO.js";
52
52
  import {
53
53
  launchAi,
54
54
  openVSCode
55
- } from "./chunk-YCCZKF4F.js";
55
+ } from "./chunk-H5JNYD63.js";
56
56
  import "./chunk-GNIYYXQX.js";
57
57
  import "./chunk-T5GJVUSL.js";
58
58
  import "./chunk-XBWS77S2.js";
@@ -60,7 +60,7 @@ import "./chunk-4CXUVBOD.js";
60
60
  import {
61
61
  findSession,
62
62
  loadHistory
63
- } from "./chunk-D77U5ELL.js";
63
+ } from "./chunk-A72CRTFG.js";
64
64
  import "./chunk-NEJVK5CF.js";
65
65
  import "./chunk-ALBTIOP3.js";
66
66
  import "./chunk-LNHSBM4L.js";
@@ -68,7 +68,7 @@ import {
68
68
  agentFor,
69
69
  ownsBranch,
70
70
  sessionToolFor
71
- } from "./chunk-O22DNTKU.js";
71
+ } from "./chunk-FJYM2JQN.js";
72
72
  import "./chunk-KGHWHAVF.js";
73
73
  import "./chunk-WIYDT3PY.js";
74
74
  import {
@@ -333,4 +333,4 @@ var treeCommand = {
333
333
  export {
334
334
  treeCommand
335
335
  };
336
- //# sourceMappingURL=tree-G4ATBUTH.js.map
336
+ //# sourceMappingURL=tree-M6YEJCXF.js.map
@@ -1,30 +1,30 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  updateSession
4
- } from "./chunk-U4INTLIY.js";
5
- import "./chunk-XFWO5FYK.js";
4
+ } from "./chunk-IBTA4DSY.js";
5
+ import "./chunk-QDNNFL56.js";
6
6
  import {
7
7
  sessionFromArgs,
8
8
  sessionPositionals
9
- } from "./chunk-ARQSFOYE.js";
9
+ } from "./chunk-VG5WQPQB.js";
10
10
  import "./chunk-6AQRYLOB.js";
11
- import "./chunk-XPX5AAYH.js";
11
+ import "./chunk-AWP2MCMN.js";
12
12
  import "./chunk-ZSHWP2VS.js";
13
13
  import "./chunk-CNZV3UCM.js";
14
14
  import "./chunk-HUXS3VAI.js";
15
- import "./chunk-EP7LCLHB.js";
16
- import "./chunk-TI2CNJLD.js";
17
- import "./chunk-JPXEX3XW.js";
15
+ import "./chunk-VBB3E37Z.js";
16
+ import "./chunk-XQEP3QYX.js";
17
+ import "./chunk-WKHP3AXS.js";
18
18
  import "./chunk-FGPXMAYU.js";
19
- import "./chunk-QHFUCX2J.js";
19
+ import "./chunk-3JLMVWRO.js";
20
20
  import "./chunk-GNIYYXQX.js";
21
21
  import "./chunk-T5GJVUSL.js";
22
22
  import "./chunk-XBWS77S2.js";
23
23
  import "./chunk-4CXUVBOD.js";
24
- import "./chunk-D77U5ELL.js";
24
+ import "./chunk-A72CRTFG.js";
25
25
  import "./chunk-NEJVK5CF.js";
26
26
  import "./chunk-ALBTIOP3.js";
27
- import "./chunk-O22DNTKU.js";
27
+ import "./chunk-FJYM2JQN.js";
28
28
  import "./chunk-KGHWHAVF.js";
29
29
  import "./chunk-WIYDT3PY.js";
30
30
  import "./chunk-YQSWVHKK.js";
@@ -74,4 +74,4 @@ var updateCommand = {
74
74
  export {
75
75
  updateCommand
76
76
  };
77
- //# sourceMappingURL=update-LSDD3ZDO.js.map
77
+ //# sourceMappingURL=update-47FZ6YO5.js.map
@@ -4,18 +4,18 @@ import {
4
4
  realUsageDeps,
5
5
  refreshUsage,
6
6
  restoreAgentUsage
7
- } from "./chunk-CZWZMRQ3.js";
8
- import "./chunk-PLTFWTIE.js";
7
+ } from "./chunk-2SLALFWA.js";
8
+ import "./chunk-F5RPC3LT.js";
9
9
  import {
10
10
  formatTokens,
11
11
  resetPhrase
12
12
  } from "./chunk-LK7HJGUC.js";
13
- import "./chunk-D77U5ELL.js";
13
+ import "./chunk-A72CRTFG.js";
14
14
  import "./chunk-NEJVK5CF.js";
15
15
  import "./chunk-ALBTIOP3.js";
16
16
  import {
17
17
  knownAgents
18
- } from "./chunk-O22DNTKU.js";
18
+ } from "./chunk-FJYM2JQN.js";
19
19
  import "./chunk-KGHWHAVF.js";
20
20
  import "./chunk-WIYDT3PY.js";
21
21
  import "./chunk-YQSWVHKK.js";
@@ -90,4 +90,4 @@ export {
90
90
  usageCommand,
91
91
  usageLines
92
92
  };
93
- //# sourceMappingURL=usage-CTT5CMQK.js.map
93
+ //# sourceMappingURL=usage-PTD3C34L.js.map
@@ -146,22 +146,22 @@ async function askClaudeUsage(o = {}) {
146
146
  }
147
147
  const due = accounts.filter((a) => loggedIn(a.dir) !== false && now - (lastAsked.get(a.name) ?? -Infinity) >= ASK_EVERY_MS);
148
148
  for (const a of due) lastAsked.set(a.name, now);
149
- const done = await Promise.all(
150
- due.map(async (a) => {
151
- try {
152
- const windows = parseUsageAnswer(await run(askEnv(a.name)));
153
- if (!windows || windows.length === 0) {
154
- debugLog("INFO", `[usage] ${a.name}: Claude Code gave no usage answer (get_usage)`);
155
- return null;
156
- }
157
- recordReading("claude", accountOf(a.dir), windows, now, { full: true });
158
- return a.name;
159
- } catch (e) {
160
- debugLog("WARN", `[usage] ${a.name}: asking Claude Code for usage failed: ${e instanceof Error ? e.message : String(e)}`);
161
- return null;
149
+ const done = [];
150
+ for (const a of due) {
151
+ try {
152
+ const windows = parseUsageAnswer(await run(askEnv(a.name)));
153
+ if (!windows || windows.length === 0) {
154
+ debugLog("INFO", `[usage] ${a.name}: Claude Code gave no usage answer (get_usage)`);
155
+ done.push(null);
156
+ continue;
162
157
  }
163
- })
164
- );
158
+ recordReading("claude", accountOf(a.dir), windows, now, { full: true });
159
+ done.push(a.name);
160
+ } catch (e) {
161
+ debugLog("WARN", `[usage] ${a.name}: asking Claude Code for usage failed: ${e instanceof Error ? e.message : String(e)}`);
162
+ done.push(null);
163
+ }
164
+ }
165
165
  return done.filter((n) => n !== null);
166
166
  }
167
167
  export {
@@ -173,4 +173,4 @@ export {
173
173
  parseUsageAnswer,
174
174
  resetUsageAsks
175
175
  };
176
- //# sourceMappingURL=usage-ask-YJNTOGXY.js.map
176
+ //# sourceMappingURL=usage-ask-BULFMCUZ.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/agents/claude/usage-ask.ts"],"sourcesContent":["import os from 'node:os';\nimport spawn from '../../platform/spawn.js';\nimport { applyEnvDelta } from '../../platform/env-delta.js';\nimport { internalRunEnv } from '../../platform/internal-run.js';\nimport { debugLog } from '../../platform/logger.js';\nimport { recordReading } from '../../usage/usage-store.js';\nimport { accountEnv, isLoggedIn, setUpAccounts, type ClaudeAccount } from './accounts.js';\nimport { withoutParentSession } from './env.js';\nimport { accountOf, clampPercent, labelOf } from './rate-limits.js';\nimport type { UsageWindow } from '../../usage/usage.js';\n\n/**\n * Asking Claude Code for its plan limits, as `/usage` shows them. Its status line (rate-limits.ts) carries only the\n * 5-hour and weekly windows; a model's own weekly window (Fable's: `/usage`'s \"Current week (Fable)\") is in no status\n * line and no rate-limit event. Claude Code tells it when asked, through a `get_usage` control request written to\n * `claude -p --input-format stream-json --output-format stream-json --verbose` with no prompt: no model is asked, it\n * costs nothing and answers in about a second, signed in as the account's sessions are (no token of ours).\n *\n * Measured on 2.1.330 (2026-11-21, Windows; the request as Novadeck found it on 2.1.323): the answer's\n * `rate_limits.model_scoped` lists each model's window by `display_name` with `utilization` (0–100) and an ISO\n * `resets_at`; `five_hour` and `seven_day` are there too, and `seven_day_opus` / `seven_day_sonnet` where the plan has\n * them (else null). It is undocumented: an answer that doesn't fit gives no reading, and the status line's stay.\n *\n * The run loads none of the user's settings, hooks, plugins or MCP servers (`--setting-sources \"\"`,\n * `--strict-mcp-config`), keeps no session (`--no-session-persistence`), starts in a neutral folder, and goes without\n * `ANTHROPIC_API_KEY` / `ANTHROPIC_AUTH_TOKEN` (print mode would take them; the plan's limits are the login's).\n */\n\nexport const USAGE_ASK_ARGS = [\n '-p',\n '--input-format',\n 'stream-json',\n '--output-format',\n 'stream-json',\n '--verbose',\n '--setting-sources',\n '',\n '--no-session-persistence',\n '--strict-mcp-config',\n];\n\nconst REQUEST_ID = 'work-usage';\n\n/** The one line written to the run's input. */\nexport const USAGE_ASK_REQUEST = JSON.stringify({\n type: 'control_request',\n request_id: REQUEST_ID,\n request: { subtype: 'get_usage', skip_behaviors: true },\n});\n\n/** How often an account is asked at most: GET /api/usage asks, and it comes on every reading the status line writes. */\nexport const ASK_EVERY_MS = 5 * 60_000;\n\n/** A run that hasn't answered by then is stopped. */\nconst ASK_TIMEOUT_MS = 20_000;\n\nconst isRecord = (v: unknown): v is Record<string, unknown> => typeof v === 'object' && v !== null && !Array.isArray(v);\n\nfunction resetIso(v: unknown): string | null {\n if (typeof v !== 'string' || v.trim() === '') return null;\n const ms = Date.parse(v);\n return Number.isFinite(ms) ? new Date(ms).toISOString() : null;\n}\n\n/** `Fable` → `fable`, `Opus 4` → `opus_4`: a model window's id part. */\nconst slug = (name: string) =>\n name\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '_')\n .replace(/^_|_$/g, '');\n\n/** The account-wide windows the status line also gives, and the per-model ones it doesn't (`asked`). */\nconst ACCOUNT_KEYS = ['five_hour', 'seven_day'];\nconst MODEL_KEYS = ['seven_day_opus', 'seven_day_sonnet'];\n\n/** The windows in a `get_usage` answer (the run's stdout, one JSON object per line); null when no answer fits. */\nexport function parseUsageAnswer(stdout: string): UsageWindow[] | null {\n for (const line of stdout.split('\\n')) {\n if (!line.includes('\"control_response\"')) continue;\n let v: unknown;\n try {\n v = JSON.parse(line);\n } catch {\n continue;\n }\n if (!isRecord(v) || v.type !== 'control_response' || !isRecord(v.response)) continue;\n const r = v.response;\n if (r.subtype !== 'success' || r.request_id !== REQUEST_ID || !isRecord(r.response)) continue;\n const limits = r.response.rate_limits;\n if (!isRecord(limits)) return null;\n const windows: UsageWindow[] = [];\n const add = (id: string, label: string, w: unknown, asked: boolean) => {\n if (!isRecord(w) || typeof w.utilization !== 'number' || !Number.isFinite(w.utilization)) return;\n windows.push({\n id,\n label,\n usedPercent: clampPercent(w.utilization),\n resetsAt: resetIso(w.resets_at),\n ...(asked ? { asked: true } : {}),\n });\n };\n for (const key of ACCOUNT_KEYS) add(key, labelOf(key), limits[key], false);\n for (const key of MODEL_KEYS) add(key, labelOf(key), limits[key], true);\n if (Array.isArray(limits.model_scoped)) {\n for (const m of limits.model_scoped) {\n if (!isRecord(m) || typeof m.display_name !== 'string' || !m.display_name.trim()) continue;\n const name = m.display_name.trim().slice(0, 40);\n const id = `seven_day_model_${slug(name)}`;\n if (windows.some((w) => w.id === id)) continue;\n add(id, `Weekly ${name} limit`, m, true);\n }\n }\n return windows;\n }\n return null;\n}\n\n/** Runs the ask with `env` and gives back what it printed (rejects when it couldn't run). Injectable for tests. */\nexport type UsageAskRun = (env: NodeJS.ProcessEnv) => Promise<string>;\n\nconst runAsk: UsageAskRun = (env) =>\n new Promise((resolve, reject) => {\n const child = spawn('claude', USAGE_ASK_ARGS, { cwd: os.tmpdir(), env, stdio: ['pipe', 'pipe', 'pipe'], windowsHide: true });\n let out = '';\n const timer = setTimeout(() => child.kill(), ASK_TIMEOUT_MS);\n timer.unref?.();\n child.stdout?.setEncoding('utf8');\n child.stdout?.on('data', (d: string) => {\n out += d;\n // The answer is all we wanted: don't wait for it to wind down.\n if (out.includes(`\"request_id\":\"${REQUEST_ID}\"`) && out.endsWith('\\n')) child.kill();\n });\n child.stderr?.resume();\n child.on('error', (e) => {\n clearTimeout(timer);\n reject(e);\n });\n child.on('close', () => {\n clearTimeout(timer);\n resolve(out);\n });\n child.stdin?.on('error', () => undefined); // it may exit before reading\n child.stdin?.end(`${USAGE_ASK_REQUEST}\\n`);\n });\n\n/** The environment an account is asked in: its config folder, work's internal-run marker, no API key and no parent session. */\nexport function askEnv(account: string, base: NodeJS.ProcessEnv = process.env): NodeJS.ProcessEnv {\n const env = withoutParentSession({ ...applyEnvDelta(base, accountEnv(account)), ...internalRunEnv() }) as NodeJS.ProcessEnv;\n for (const k of Object.keys(env)) if (/^ANTHROPIC_(API_KEY|AUTH_TOKEN)$/i.test(k)) delete env[k];\n return env;\n}\n\nconst lastAsked = new Map<string, number>();\n\n/** Forget when each account was asked (tests). */\nexport function resetUsageAsks(): void {\n lastAsked.clear();\n}\n\n/**\n * Ask each signed-in account not asked in the last ASK_EVERY_MS and keep its answer as the account's reading (a full\n * one: it replaces the status line's, `asked` windows included). Never throws; returns the accounts it recorded.\n */\nexport async function askClaudeUsage(\n o: { now?: number; run?: UsageAskRun; accounts?: ClaudeAccount[]; loggedIn?: (dir: string) => boolean | null } = {},\n): Promise<string[]> {\n const now = o.now ?? Date.now();\n const run = o.run ?? runAsk;\n const loggedIn = o.loggedIn ?? isLoggedIn;\n let accounts: ClaudeAccount[];\n try {\n accounts = o.accounts ?? setUpAccounts();\n } catch (e) {\n debugLog('WARN', `[usage] accounts not read for asking: ${e instanceof Error ? e.message : String(e)}`);\n return [];\n }\n const due = accounts.filter((a) => loggedIn(a.dir) !== false && now - (lastAsked.get(a.name) ?? -Infinity) >= ASK_EVERY_MS);\n for (const a of due) lastAsked.set(a.name, now);\n const done = await Promise.all(\n due.map(async (a) => {\n try {\n const windows = parseUsageAnswer(await run(askEnv(a.name)));\n if (!windows || windows.length === 0) {\n debugLog('INFO', `[usage] ${a.name}: Claude Code gave no usage answer (get_usage)`);\n return null;\n }\n // Kept under the key the status-line hook uses for this folder (~/.claude: `default`).\n recordReading('claude', accountOf(a.dir), windows, now, { full: true });\n return a.name;\n } catch (e) {\n debugLog('WARN', `[usage] ${a.name}: asking Claude Code for usage failed: ${e instanceof Error ? e.message : String(e)}`);\n return null;\n }\n }),\n );\n return done.filter((n): n is string => n !== null);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AA4BR,IAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,aAAa;AAGZ,IAAM,oBAAoB,KAAK,UAAU;AAAA,EAC9C,MAAM;AAAA,EACN,YAAY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AAO,MAAM;AACnB,UAAI;AACF,cAAM,UAAU,iBAAiB,MAAM,IAAI,OAAO,EAAE,IAAI,CAAC,CAAC;AAC1D,YAAI,CAAC,WAAW,QAAQ,WAAW,GAAG;AACpC,mBAAS,QAAQ,WAAW,EAAE,IAAI,gDAAgD;AAClF,iBAAO;AAAA,QACT;AAEA,sBAAc,UAAU,UAAU,EAAE,GAAG,GAAG,SAAS,KAAK,EAAE,MAAM,KAAK,CAAC;AACtE,eAAO,EAAE;AAAA,MACX,SAAS,GAAG;AACV,iBAAS,QAAQ,WAAW,EAAE,IAAI,0CAA0C,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC,CAAC,EAAE;AACxH,eAAO;AAAA,MACT;AAAA,IACF,CAAC;AAAA,EACH;AACA,SAAO,KAAK,OAAO,CAAC,MAAmB,MAAM,IAAI;AACnD;","names":[]}
1
+ {"version":3,"sources":["../src/core/agents/claude/usage-ask.ts"],"sourcesContent":["import os from 'node:os';\nimport spawn from '../../platform/spawn.js';\nimport { applyEnvDelta } from '../../platform/env-delta.js';\nimport { internalRunEnv } from '../../platform/internal-run.js';\nimport { debugLog } from '../../platform/logger.js';\nimport { recordReading } from '../../usage/usage-store.js';\nimport { accountEnv, isLoggedIn, setUpAccounts, type ClaudeAccount } from './accounts.js';\nimport { withoutParentSession } from './env.js';\nimport { accountOf, clampPercent, labelOf } from './rate-limits.js';\nimport type { UsageWindow } from '../../usage/usage.js';\n\n/**\n * Asking Claude Code for its plan limits, as `/usage` shows them. Its status line (rate-limits.ts) carries only the\n * 5-hour and weekly windows; a model's own weekly window (Fable's: `/usage`'s \"Current week (Fable)\") is in no status\n * line and no rate-limit event. Claude Code tells it when asked, through a `get_usage` control request written to\n * `claude -p --input-format stream-json --output-format stream-json --verbose` with no prompt: no model is asked, it\n * costs nothing and answers in about a second, signed in as the account's sessions are (no token of ours).\n *\n * Measured on 2.1.330 (2026-11-21, Windows; the request as Novadeck found it on 2.1.323): the answer's\n * `rate_limits.model_scoped` lists each model's window by `display_name` with `utilization` (0–100) and an ISO\n * `resets_at`; `five_hour` and `seven_day` are there too, and `seven_day_opus` / `seven_day_sonnet` where the plan has\n * them (else null). It is undocumented: an answer that doesn't fit gives no reading, and the status line's stay.\n *\n * The run loads none of the user's settings, hooks, plugins or MCP servers (`--setting-sources \"\"`,\n * `--strict-mcp-config`), keeps no session (`--no-session-persistence`), starts in a neutral folder, and goes without\n * `ANTHROPIC_API_KEY` / `ANTHROPIC_AUTH_TOKEN` (print mode would take them; the plan's limits are the login's).\n */\n\nexport const USAGE_ASK_ARGS = [\n '-p',\n '--input-format',\n 'stream-json',\n '--output-format',\n 'stream-json',\n '--verbose',\n '--setting-sources',\n '',\n '--no-session-persistence',\n '--strict-mcp-config',\n];\n\nconst REQUEST_ID = 'work-usage';\n\n/** The one line written to the run's input. */\nexport const USAGE_ASK_REQUEST = JSON.stringify({\n type: 'control_request',\n request_id: REQUEST_ID,\n request: { subtype: 'get_usage', skip_behaviors: true },\n});\n\n/** How often an account is asked at most: GET /api/usage asks, and it comes on every reading the status line writes. */\nexport const ASK_EVERY_MS = 5 * 60_000;\n\n/** A run that hasn't answered by then is stopped. */\nconst ASK_TIMEOUT_MS = 20_000;\n\nconst isRecord = (v: unknown): v is Record<string, unknown> => typeof v === 'object' && v !== null && !Array.isArray(v);\n\nfunction resetIso(v: unknown): string | null {\n if (typeof v !== 'string' || v.trim() === '') return null;\n const ms = Date.parse(v);\n return Number.isFinite(ms) ? new Date(ms).toISOString() : null;\n}\n\n/** `Fable` → `fable`, `Opus 4` → `opus_4`: a model window's id part. */\nconst slug = (name: string) =>\n name\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '_')\n .replace(/^_|_$/g, '');\n\n/** The account-wide windows the status line also gives, and the per-model ones it doesn't (`asked`). */\nconst ACCOUNT_KEYS = ['five_hour', 'seven_day'];\nconst MODEL_KEYS = ['seven_day_opus', 'seven_day_sonnet'];\n\n/** The windows in a `get_usage` answer (the run's stdout, one JSON object per line); null when no answer fits. */\nexport function parseUsageAnswer(stdout: string): UsageWindow[] | null {\n for (const line of stdout.split('\\n')) {\n if (!line.includes('\"control_response\"')) continue;\n let v: unknown;\n try {\n v = JSON.parse(line);\n } catch {\n continue;\n }\n if (!isRecord(v) || v.type !== 'control_response' || !isRecord(v.response)) continue;\n const r = v.response;\n if (r.subtype !== 'success' || r.request_id !== REQUEST_ID || !isRecord(r.response)) continue;\n const limits = r.response.rate_limits;\n if (!isRecord(limits)) return null;\n const windows: UsageWindow[] = [];\n const add = (id: string, label: string, w: unknown, asked: boolean) => {\n if (!isRecord(w) || typeof w.utilization !== 'number' || !Number.isFinite(w.utilization)) return;\n windows.push({\n id,\n label,\n usedPercent: clampPercent(w.utilization),\n resetsAt: resetIso(w.resets_at),\n ...(asked ? { asked: true } : {}),\n });\n };\n for (const key of ACCOUNT_KEYS) add(key, labelOf(key), limits[key], false);\n for (const key of MODEL_KEYS) add(key, labelOf(key), limits[key], true);\n if (Array.isArray(limits.model_scoped)) {\n for (const m of limits.model_scoped) {\n if (!isRecord(m) || typeof m.display_name !== 'string' || !m.display_name.trim()) continue;\n const name = m.display_name.trim().slice(0, 40);\n const id = `seven_day_model_${slug(name)}`;\n if (windows.some((w) => w.id === id)) continue;\n add(id, `Weekly ${name} limit`, m, true);\n }\n }\n return windows;\n }\n return null;\n}\n\n/** Runs the ask with `env` and gives back what it printed (rejects when it couldn't run). Injectable for tests. */\nexport type UsageAskRun = (env: NodeJS.ProcessEnv) => Promise<string>;\n\nconst runAsk: UsageAskRun = (env) =>\n new Promise((resolve, reject) => {\n const child = spawn('claude', USAGE_ASK_ARGS, { cwd: os.tmpdir(), env, stdio: ['pipe', 'pipe', 'pipe'], windowsHide: true });\n let out = '';\n const timer = setTimeout(() => child.kill(), ASK_TIMEOUT_MS);\n timer.unref?.();\n child.stdout?.setEncoding('utf8');\n child.stdout?.on('data', (d: string) => {\n out += d;\n // The answer is all we wanted: don't wait for it to wind down.\n if (out.includes(`\"request_id\":\"${REQUEST_ID}\"`) && out.endsWith('\\n')) child.kill();\n });\n child.stderr?.resume();\n child.on('error', (e) => {\n clearTimeout(timer);\n reject(e);\n });\n child.on('close', () => {\n clearTimeout(timer);\n resolve(out);\n });\n child.stdin?.on('error', () => undefined); // it may exit before reading\n child.stdin?.end(`${USAGE_ASK_REQUEST}\\n`);\n });\n\n/** The environment an account is asked in: its config folder, work's internal-run marker, no API key and no parent session. */\nexport function askEnv(account: string, base: NodeJS.ProcessEnv = process.env): NodeJS.ProcessEnv {\n const env = withoutParentSession({ ...applyEnvDelta(base, accountEnv(account)), ...internalRunEnv() }) as NodeJS.ProcessEnv;\n for (const k of Object.keys(env)) if (/^ANTHROPIC_(API_KEY|AUTH_TOKEN)$/i.test(k)) delete env[k];\n return env;\n}\n\nconst lastAsked = new Map<string, number>();\n\n/** Forget when each account was asked (tests). */\nexport function resetUsageAsks(): void {\n lastAsked.clear();\n}\n\n/**\n * Ask each signed-in account not asked in the last ASK_EVERY_MS and keep its answer as the account's reading (a full\n * one: it replaces the status line's, `asked` windows included). Never throws; returns the accounts it recorded.\n */\nexport async function askClaudeUsage(\n o: { now?: number; run?: UsageAskRun; accounts?: ClaudeAccount[]; loggedIn?: (dir: string) => boolean | null } = {},\n): Promise<string[]> {\n const now = o.now ?? Date.now();\n const run = o.run ?? runAsk;\n const loggedIn = o.loggedIn ?? isLoggedIn;\n let accounts: ClaudeAccount[];\n try {\n accounts = o.accounts ?? setUpAccounts();\n } catch (e) {\n debugLog('WARN', `[usage] accounts not read for asking: ${e instanceof Error ? e.message : String(e)}`);\n return [];\n }\n const due = accounts.filter((a) => loggedIn(a.dir) !== false && now - (lastAsked.get(a.name) ?? -Infinity) >= ASK_EVERY_MS);\n for (const a of due) lastAsked.set(a.name, now);\n // One account at a time: each ask starts a Claude Code, and several at once weigh on a busy machine.\n const done: Array<string | null> = [];\n for (const a of due) {\n try {\n const windows = parseUsageAnswer(await run(askEnv(a.name)));\n if (!windows || windows.length === 0) {\n debugLog('INFO', `[usage] ${a.name}: Claude Code gave no usage answer (get_usage)`);\n done.push(null);\n continue;\n }\n // Kept under the key the status-line hook uses for this folder (~/.claude: `default`).\n recordReading('claude', accountOf(a.dir), windows, now, { full: true });\n done.push(a.name);\n } catch (e) {\n debugLog('WARN', `[usage] ${a.name}: asking Claude Code for usage failed: ${e instanceof Error ? e.message : String(e)}`);\n done.push(null);\n }\n }\n return done.filter((n): n is string => n !== null);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AA4BR,IAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,aAAa;AAGZ,IAAM,oBAAoB,KAAK,UAAU;AAAA,EAC9C,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,SAAS,EAAE,SAAS,aAAa,gBAAgB,KAAK;AACxD,CAAC;AAGM,IAAM,eAAe,IAAI;AAGhC,IAAM,iBAAiB;AAEvB,IAAM,WAAW,CAAC,MAA6C,OAAO,MAAM,YAAY,MAAM,QAAQ,CAAC,MAAM,QAAQ,CAAC;AAEtH,SAAS,SAAS,GAA2B;AAC3C,MAAI,OAAO,MAAM,YAAY,EAAE,KAAK,MAAM,GAAI,QAAO;AACrD,QAAM,KAAK,KAAK,MAAM,CAAC;AACvB,SAAO,OAAO,SAAS,EAAE,IAAI,IAAI,KAAK,EAAE,EAAE,YAAY,IAAI;AAC5D;AAGA,IAAM,OAAO,CAAC,SACZ,KACG,YAAY,EACZ,QAAQ,eAAe,GAAG,EAC1B,QAAQ,UAAU,EAAE;AAGzB,IAAM,eAAe,CAAC,aAAa,WAAW;AAC9C,IAAM,aAAa,CAAC,kBAAkB,kBAAkB;AAGjD,SAAS,iBAAiB,QAAsC;AACrE,aAAW,QAAQ,OAAO,MAAM,IAAI,GAAG;AACrC,QAAI,CAAC,KAAK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import {
6
6
  parseDuration,
7
7
  waitForTurn
@@ -10,18 +10,18 @@ import "./chunk-FZHFD2AY.js";
10
10
  import {
11
11
  sessionFromArgs,
12
12
  sessionPositionals
13
- } from "./chunk-ARQSFOYE.js";
13
+ } from "./chunk-VG5WQPQB.js";
14
14
  import "./chunk-6AQRYLOB.js";
15
- import "./chunk-XPX5AAYH.js";
15
+ import "./chunk-AWP2MCMN.js";
16
16
  import "./chunk-ZSHWP2VS.js";
17
17
  import "./chunk-CNZV3UCM.js";
18
18
  import "./chunk-HUXS3VAI.js";
19
- import "./chunk-D77U5ELL.js";
19
+ import "./chunk-A72CRTFG.js";
20
20
  import "./chunk-NEJVK5CF.js";
21
21
  import {
22
22
  sessionIdFor
23
23
  } from "./chunk-ALBTIOP3.js";
24
- import "./chunk-O22DNTKU.js";
24
+ import "./chunk-FJYM2JQN.js";
25
25
  import "./chunk-KGHWHAVF.js";
26
26
  import "./chunk-WIYDT3PY.js";
27
27
  import "./chunk-YQSWVHKK.js";
@@ -67,4 +67,4 @@ var waitCommand = {
67
67
  export {
68
68
  waitCommand
69
69
  };
70
- //# sourceMappingURL=wait-2L67BLEO.js.map
70
+ //# sourceMappingURL=wait-JHFM3MA7.js.map
package/dist/wd-bin.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  run
4
- } from "./chunk-OEQASHE3.js";
4
+ } from "./chunk-PZGLIYMD.js";
5
5
  import {
6
6
  consoleReporter
7
7
  } from "./chunk-S5HJT7CM.js";
8
- import "./chunk-UKPZXS5B.js";
8
+ import "./chunk-4YG55UQ6.js";
9
9
  import "./chunk-IPHADNF5.js";
10
10
  import "./chunk-JYWX2N5W.js";
11
11
  import "./chunk-MWIPHUAE.js";
@@ -1,4 +1,4 @@
1
- import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./index-CfBb7suR.js";var l=r(t(),1),u=2e3,d=20,f=class{sentAt=null;samples=[];shownSamples=[];open=null;keySent(e){let t=this.open;return this.open=null,this.sentAt===null&&(this.sentAt=e),t?{arrived:t.arrived,shown:null}:null}output(e){if(this.sentAt===null)return null;let t=e-this.sentAt,n=this.sentAt;return this.sentAt=null,t<0||t>u?null:(p(this.samples,t),this.open={sentAt:n,arrived:t},t)}rendered(e){let t=this.open;if(!t)return null;this.open=null;let n=e-t.sentAt;return n<0||n>u?{arrived:t.arrived,shown:null}:(p(this.shownSamples,n),{arrived:t.arrived,shown:n})}median(){return this.samples.length?m(this.samples).median:null}reading(){return this.samples.length?{arrived:m(this.samples),shown:this.shownSamples.length?m(this.shownSamples):null}:null}};function p(e,t){e.push(t),e.length>d&&e.shift()}function m(e){let t=[...e].sort((e,t)=>e-t),n=t.length>>1;return{median:t.length%2?t[n]:(t[n-1]+t[n])/2,worst:t[Math.min(t.length-1,Math.ceil(t.length*.9)-1)]}}function h(e,t,n=null){let r=t!==`webgl`;if(e===null&&!r)return null;let i=e=>`${Math.round(e)} ms`,a=e?.shown??e?.arrived??null;return{text:[a&&`⌁ ${i(a.median)}${a.worst>a.median*1.5?` (${i(a.worst)})`:``}`,r&&`DOM`].filter(Boolean).join(` · `),title:[e&&`A keystroke, over the last 20 (median, and in brackets the slowest of most of them): its echo arrived in ${i(e.arrived.median)} (${i(e.arrived.worst)}) — browser → PTY host → ConPTY → Claude and back`+(e.shown?`; it was on screen in ${i(e.shown.median)} (${i(e.shown.worst)}) — the frame drawn after it.`:`.`),e&&n===`direct`&&`Connected straight to the PTY host.`,e&&n===`relay`&&"Connected through work web (the PTY host gave no ticket: restart it with `work pty-host --restart`).",r&&`Drawn without the GPU, which is slower while Claude works.`,t===`retrying`&&`The GPU renderer was lost; it is tried again by itself.`,t===`dom`&&`WebGL is unavailable here, or kept getting lost; reloading the page tries it again.`,e&&`Each keystroke and every freeze of this window is written to work’s debug log (terminal-perf).`].filter(Boolean).join(` `),slow:r||(a?.median??0)>100}}var g=200,_=100,v=class{keys=[];stalls=[];key(e){e&&this.keys.length<g&&this.keys.push({arrived:Math.round(e.arrived),shown:e.shown===null?null:Math.round(e.shown)})}stall(e,t){this.stalls.length>=_||this.stalls.push({at:t,ms:Math.round(e.duration),blocking:e.blockingDuration===void 0?null:Math.round(e.blockingDuration),what:y(e)})}take(e){if(!this.keys.length&&!this.stalls.length)return null;let t={...e,keys:this.keys,stalls:this.stalls};return this.keys=[],this.stalls=[],t}};function y(e){return[...e.scripts??[]].sort((e,t)=>(t.duration??0)-(e.duration??0)).slice(0,3).map(e=>{let t=(e.sourceURL??``).split(`/`).pop()?.split(`?`)[0]??``;return[e.invoker,e.sourceFunctionName,t,e.duration===void 0?``:`${Math.round(e.duration)}ms`].filter(Boolean).join(` `).slice(0,160)}).join(`; `)}function ee(e){let t=typeof PerformanceObserver>`u`?null:PerformanceObserver,n=t?.supportedEntryTypes??[],r=n.includes(`long-animation-frame`)?`long-animation-frame`:n.includes(`longtask`)?`longtask`:null;if(!t||!r)return()=>{};let i=new t(t=>{for(let n of t.getEntries())e(n)});return i.observe({type:r,buffered:!1}),()=>i.disconnect()}async function te(e,t){try{let n=await fetch(`/api/terminals/${encodeURIComponent(e)}/ticket`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({force:t})});return n.status===404&&!(n.headers.get(`content-type`)??``).includes(`json`)?null:await n.json()}catch{return null}}function ne(e,t){let n=t.WebSocketImpl??WebSocket,r=t.askTicket??te,i=[],a=[],o=[],s=null,c=!1,l=!1,u=null,d=e=>{let t=new MessageEvent(`message`,{data:e});for(let e of i)e(t)},f=(e=new Event(`close`))=>{if(!l){l=!0;for(let t of a)t(e)}},p=(e,r)=>{if(c)return;u=r?`direct`:`relay`;let a=new n(e);a.binaryType=m.binaryType,s=a;let l=!1;a.addEventListener(`open`,()=>{l=!0;for(let e of o)a.send(e);o.length=0}),a.addEventListener(`message`,e=>{if(s===a)for(let t of i)t(e)}),a.addEventListener(`close`,e=>{if(s===a){if(r&&!l&&!c)return p(t.relayUrl,!1);f(e)}})},m={binaryType:`blob`,addEventListener(e,t){e===`message`?i.push(t):a.push(t)},send(e){s&&s.readyState===n.OPEN?s.send(e):o.push(e)},close(){c=!0,s?s.close():f()},get route(){return u}};return r(e,t.force).then(e=>{if(!c){if(e&&`url`in e)return p(e.url,!0);if(e&&`elsewhere`in e)return d(JSON.stringify(e.elsewhere)),f();if(e&&`error`in e)return d(JSON.stringify({type:`error`,message:e.error})),f();p(t.relayUrl,!1)}}),m}var re=[3,10,30,60];function ie(e){return e>=0&&e<re.length?re[e]*1e3:null}function ae(e){return e?.trim()?e.trim():`the connection closed before it started`}var b=[2e3,1e4,6e4],x=6e5,oe=class{losses=[];lost(e){return this.losses=this.losses.filter(t=>e-t<x),this.losses.push(e),b[this.losses.length-1]??null}},S=/^(\s*)([●⏺⎿])(\s)/u,se=/^(?:[-*+•]\s|\d+[.)]\s|#{1,6}\s|>\s|[│┃|┌└├╭╰─━])/u,ce=/^(?:[-*+•]|\d+[.)])\s+/u,le=e=>e.length-e.trimStart().length,C=``,w=``,T=``,ue=``,de=/[\uE000-\uE003]/gu,fe=e=>e.replace(de,``);function pe(e,t){let n=``,r=0;for(;r<e.length&&t>0;r++)if(/[\uE000-\uE003]/u.test(e[r]))n+=e[r];else if(/\s/u.test(e[r]))t--;else break;return n+e.slice(r)}var me=e=>pe(e,le(fe(e)));function he(e,t,n){let r=e.split(/\r?\n/).map(e=>{let t=e.replace(/\s+$/u,``);return S.test(fe(t))?t.replace(/[●⏺⎿]/u,` `):t}),i=e=>e===0?n:0,a=[],o=null;for(let e=0;e<r.length;e++){let n=r[e],s=fe(n),c=me(n),l=s.trimStart(),u=i(e)+le(s),d=i(e)+s.length;if(o&&l&&o.end+1+(l.split(/\s/u)[0]?.length??0)>t-2&&!se.test(l)&&u===o.cont){o.text+=` `+c,o.end=d;continue}if(o&&a.push(o.text),!l){o=null,a.push(``);continue}let f=ce.exec(l);o={text:(e===0?``:` `.repeat(le(s)))+c,cont:u+(f?f[0].length:0),end:d},/[│┃]/u.test(l)&&(a.push(o.text),o=null)}o&&a.push(o.text);let s=a.slice(1).filter(e=>fe(e).trim()),c=s.length?Math.min(...s.map(e=>le(fe(e)))):0;return a.map((e,t)=>t===0?me(e):pe(e,Math.min(c,le(fe(e))))).join(`
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./index-DhXqtaRc.js";var l=r(t(),1),u=2e3,d=20,f=class{sentAt=null;samples=[];shownSamples=[];open=null;keySent(e){let t=this.open;return this.open=null,this.sentAt===null&&(this.sentAt=e),t?{arrived:t.arrived,shown:null}:null}output(e){if(this.sentAt===null)return null;let t=e-this.sentAt,n=this.sentAt;return this.sentAt=null,t<0||t>u?null:(p(this.samples,t),this.open={sentAt:n,arrived:t},t)}rendered(e){let t=this.open;if(!t)return null;this.open=null;let n=e-t.sentAt;return n<0||n>u?{arrived:t.arrived,shown:null}:(p(this.shownSamples,n),{arrived:t.arrived,shown:n})}median(){return this.samples.length?m(this.samples).median:null}reading(){return this.samples.length?{arrived:m(this.samples),shown:this.shownSamples.length?m(this.shownSamples):null}:null}};function p(e,t){e.push(t),e.length>d&&e.shift()}function m(e){let t=[...e].sort((e,t)=>e-t),n=t.length>>1;return{median:t.length%2?t[n]:(t[n-1]+t[n])/2,worst:t[Math.min(t.length-1,Math.ceil(t.length*.9)-1)]}}function h(e,t,n=null){let r=t!==`webgl`;if(e===null&&!r)return null;let i=e=>`${Math.round(e)} ms`,a=e?.shown??e?.arrived??null;return{text:[a&&`⌁ ${i(a.median)}${a.worst>a.median*1.5?` (${i(a.worst)})`:``}`,r&&`DOM`].filter(Boolean).join(` · `),title:[e&&`A keystroke, over the last 20 (median, and in brackets the slowest of most of them): its echo arrived in ${i(e.arrived.median)} (${i(e.arrived.worst)}) — browser → PTY host → ConPTY → Claude and back`+(e.shown?`; it was on screen in ${i(e.shown.median)} (${i(e.shown.worst)}) — the frame drawn after it.`:`.`),e&&n===`direct`&&`Connected straight to the PTY host.`,e&&n===`relay`&&"Connected through work web (the PTY host gave no ticket: restart it with `work pty-host --restart`).",r&&`Drawn without the GPU, which is slower while Claude works.`,t===`retrying`&&`The GPU renderer was lost; it is tried again by itself.`,t===`dom`&&`WebGL is unavailable here, or kept getting lost; reloading the page tries it again.`,e&&`Each keystroke and every freeze of this window is written to work’s debug log (terminal-perf).`].filter(Boolean).join(` `),slow:r||(a?.median??0)>100}}var g=200,_=100,v=class{keys=[];stalls=[];key(e){e&&this.keys.length<g&&this.keys.push({arrived:Math.round(e.arrived),shown:e.shown===null?null:Math.round(e.shown)})}stall(e,t){this.stalls.length>=_||this.stalls.push({at:t,ms:Math.round(e.duration),blocking:e.blockingDuration===void 0?null:Math.round(e.blockingDuration),what:y(e)})}take(e){if(!this.keys.length&&!this.stalls.length)return null;let t={...e,keys:this.keys,stalls:this.stalls};return this.keys=[],this.stalls=[],t}};function y(e){return[...e.scripts??[]].sort((e,t)=>(t.duration??0)-(e.duration??0)).slice(0,3).map(e=>{let t=(e.sourceURL??``).split(`/`).pop()?.split(`?`)[0]??``;return[e.invoker,e.sourceFunctionName,t,e.duration===void 0?``:`${Math.round(e.duration)}ms`].filter(Boolean).join(` `).slice(0,160)}).join(`; `)}function ee(e){let t=typeof PerformanceObserver>`u`?null:PerformanceObserver,n=t?.supportedEntryTypes??[],r=n.includes(`long-animation-frame`)?`long-animation-frame`:n.includes(`longtask`)?`longtask`:null;if(!t||!r)return()=>{};let i=new t(t=>{for(let n of t.getEntries())e(n)});return i.observe({type:r,buffered:!1}),()=>i.disconnect()}async function te(e,t){try{let n=await fetch(`/api/terminals/${encodeURIComponent(e)}/ticket`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({force:t})});return n.status===404&&!(n.headers.get(`content-type`)??``).includes(`json`)?null:await n.json()}catch{return null}}function ne(e,t){let n=t.WebSocketImpl??WebSocket,r=t.askTicket??te,i=[],a=[],o=[],s=null,c=!1,l=!1,u=null,d=e=>{let t=new MessageEvent(`message`,{data:e});for(let e of i)e(t)},f=(e=new Event(`close`))=>{if(!l){l=!0;for(let t of a)t(e)}},p=(e,r)=>{if(c)return;u=r?`direct`:`relay`;let a=new n(e);a.binaryType=m.binaryType,s=a;let l=!1;a.addEventListener(`open`,()=>{l=!0;for(let e of o)a.send(e);o.length=0}),a.addEventListener(`message`,e=>{if(s===a)for(let t of i)t(e)}),a.addEventListener(`close`,e=>{if(s===a){if(r&&!l&&!c)return p(t.relayUrl,!1);f(e)}})},m={binaryType:`blob`,addEventListener(e,t){e===`message`?i.push(t):a.push(t)},send(e){s&&s.readyState===n.OPEN?s.send(e):o.push(e)},close(){c=!0,s?s.close():f()},get route(){return u}};return r(e,t.force).then(e=>{if(!c){if(e&&`url`in e)return p(e.url,!0);if(e&&`elsewhere`in e)return d(JSON.stringify(e.elsewhere)),f();if(e&&`error`in e)return d(JSON.stringify({type:`error`,message:e.error})),f();p(t.relayUrl,!1)}}),m}var re=[3,10,30,60];function ie(e){return e>=0&&e<re.length?re[e]*1e3:null}function ae(e){return e?.trim()?e.trim():`the connection closed before it started`}var b=[2e3,1e4,6e4],x=6e5,oe=class{losses=[];lost(e){return this.losses=this.losses.filter(t=>e-t<x),this.losses.push(e),b[this.losses.length-1]??null}},S=/^(\s*)([●⏺⎿])(\s)/u,se=/^(?:[-*+•]\s|\d+[.)]\s|#{1,6}\s|>\s|[│┃|┌└├╭╰─━])/u,ce=/^(?:[-*+•]|\d+[.)])\s+/u,le=e=>e.length-e.trimStart().length,C=``,w=``,T=``,ue=``,de=/[\uE000-\uE003]/gu,fe=e=>e.replace(de,``);function pe(e,t){let n=``,r=0;for(;r<e.length&&t>0;r++)if(/[\uE000-\uE003]/u.test(e[r]))n+=e[r];else if(/\s/u.test(e[r]))t--;else break;return n+e.slice(r)}var me=e=>pe(e,le(fe(e)));function he(e,t,n){let r=e.split(/\r?\n/).map(e=>{let t=e.replace(/\s+$/u,``);return S.test(fe(t))?t.replace(/[●⏺⎿]/u,` `):t}),i=e=>e===0?n:0,a=[],o=null;for(let e=0;e<r.length;e++){let n=r[e],s=fe(n),c=me(n),l=s.trimStart(),u=i(e)+le(s),d=i(e)+s.length;if(o&&l&&o.end+1+(l.split(/\s/u)[0]?.length??0)>t-2&&!se.test(l)&&u===o.cont){o.text+=` `+c,o.end=d;continue}if(o&&a.push(o.text),!l){o=null,a.push(``);continue}let f=ce.exec(l);o={text:(e===0?``:` `.repeat(le(s)))+c,cont:u+(f?f[0].length:0),end:d},/[│┃]/u.test(l)&&(a.push(o.text),o=null)}o&&a.push(o.text);let s=a.slice(1).filter(e=>fe(e).trim()),c=s.length?Math.min(...s.map(e=>le(fe(e)))):0;return a.map((e,t)=>t===0?me(e):pe(e,Math.min(c,le(fe(e))))).join(`
2
2
  `)}function ge(e,t){let n=``;for(let r=t.start.y;r<=t.end.y;r++){let i=e.getLine(r);if(!i)break;let a=r<t.end.y&&!!e.getLine(r+1)?.isWrapped,o=[],s=r===t.end.y?Math.min(t.end.x,i.length):i.length;for(let e=r===t.start.y?t.start.x:0;e<s;e++){let t=i.getCell(e);t&&t.getWidth()!==0&&o.push({ch:t.getChars()||` `,b:!!t.isBold(),i:!!t.isItalic()})}let c=o.length;if(!a)for(;c>0&&o[c-1].ch.trim()===``;)c--;let l=!1,u=!1;for(let e of o.slice(0,c)){let t=e.ch.trim()?e.b:l,r=e.ch.trim()?e.i:u;(t!==l||r!==u)&&(u&&(n+=ue),l&&(n+=w),t&&(n+=C),r&&(n+=T),l=t,u=r),n+=e.ch}u&&(n+=ue),l&&(n+=w),r<t.end.y&&!a&&(n+=`
3
3
  `)}return n}function _e(e){let t=e.getSelection(),n=e.getSelectionPosition();if(!n)return t;let r=ge(e.buffer.active,n),i=e=>e.replace(/\r\n/gu,`
4
4
  `).replace(/[ \t]+$/gmu,``);return i(fe(r))===i(t)?r:t}function ve(e){let t=c(e).replaceAll(C,`<b>`).replaceAll(w,`</b>`).replaceAll(T,`<i>`).replaceAll(ue,`</i>`).replace(/<\/b>(\s*)<b>/gu,`$1`).replace(/<\/i>(\s*)<i>/gu,`$1`);for(let e=``;e!==t;)e=t,t=t.replace(/(\s+)(<\/[bi]>)/gu,`$2$1`);return t}var ye=/^\s*[│┃|].*[│┃|]\s*$/u,be=/^\s*(?:[┌├└╭╰┏┣┗┡╞][─━┬┼┴┳╋┻┐┤┘╮╯┓┫┛┩╡═╪╤╧\s]*|\|?(?:\s*:?-{3,}:?\s*\|)+\s*:?-*:?\s*\|?)$/u,xe=e=>e.trim().replace(/^[│┃|]|[│┃|]$/gu,``).split(/[│┃|]/u).map(e=>e.trim());function Se(e){let t=[[]],n=0;for(let r of e)be.test(r)?(n++,t[t.length-1].length&&t.push([])):ye.test(r)&&t[t.length-1].push(xe(r));let r=t.filter(e=>e.length);if(!r.length||!r.some(e=>e.some(e=>e.length>1)))return null;let i=r.length>2||r.length===2&&r[1].length===1,a=e=>e[0].map((t,n)=>e.map(e=>e[n]??``).filter(Boolean).join(` `)),o=i?r.map(a):[a(r[0]),...r.slice(1).flat()];return n||o.length>1?o:null}function Ce(e){let[t,...n]=e,r=(e,t)=>`<tr>${e.map(e=>`<${t}>${c(e)}</${t}>`).join(``)}</tr>`;return`<table><thead>${r(t,`th`)}</thead><tbody>${n.map(e=>r(e,`td`)).join(``)}</tbody></table>`}function we(e,t,n=0){let r=he(e,t,n).split(`
@@ -93,4 +93,4 @@ void main() {
93
93
  `);be=!0});let ke=t.onData(e=>{if(be){e===`\r`&&_(e=>e+1);return}Ae(e)});function Ae(e){be||(ge?(w.send(JSON.stringify({type:`input`,data:e})),Ee.key(xe.keySent(performance.now()))):ve.push(e))}let je=t.cols,Me=t.rows,Ne=(e=!1)=>{u.current&&(n.fit(),(e||t.cols!==je||t.rows!==Me)&&(je=t.cols,Me=t.rows,ge&&w.send(JSON.stringify({type:`resize`,cols:t.cols,rows:t.rows}))))},Pe=()=>Ne(),Fe=typeof ResizeObserver<`u`?new ResizeObserver(()=>Ne()):null;Fe?Fe.observe(c.current):window.addEventListener(`resize`,Pe),d.current=()=>{Ne(!0),t.focus()};let Ie=()=>Ne(!0);return t.textarea?.addEventListener(`focus`,Ie),()=>{l=!0,clearTimeout(fe),clearTimeout(he),clearTimeout(s),t.textarea?.removeEventListener(`paste`,b,!0),t.element?.removeEventListener(`copy`,se,!0),t.textarea?.removeEventListener(`focus`,Ie),d.current=null,Fe?.disconnect(),window.removeEventListener(`resize`,Pe),ke.dispose(),De.dispose(),clearInterval(Oe),E(),D(),clearTimeout(Ce);try{w.close()}catch{}t.dispose()}},[e,g]);let me=()=>{pe(!0),_(e=>e+1)};(0,l.useEffect)(()=>{if(!b||!i)return;let e=setInterval(()=>{document.visibilityState===`visible`&&me()},wp);return()=>clearInterval(e)},[b,i]);let he=async()=>{await s(`Start this session's Claude here?
94
94
 
95
95
  If it is still open in another terminal, both would write to the same conversation.`,{ok:`Start it here`})&&(S.current=!0,x(null),_(e=>e+1))},ge=t?`work tree ${t}${r?` ${r}`:``}`:`work tree <target> <branch>`,ve=h(se,w,le);return(0,$.jsxs)($.Fragment,{children:[b&&(0,$.jsxs)(`div`,{className:`wd-pty-elsewhere`,role:`status`,children:[(0,$.jsxs)(`p`,{className:`wd-pty-elsewhere-title`,children:[b.confirmed?`This session’s Claude is open in another terminal`:`This session’s Claude seems to be running in another terminal`,b.lastActivity!==null&&(0,$.jsxs)($.Fragment,{children:[` (last wrote `,Ep(b.lastActivity),`)`]}),b.state===`needs_input`&&(0,$.jsx)($.Fragment,{children:`, waiting for your answer there`}),`.`]}),(0,$.jsxs)(`p`,{children:[`Close it there (type `,(0,$.jsx)(`code`,{children:`/exit`}),`) and this tab attaches by itself — it checks every few seconds. To have both show the same screen instead, restart it with `,(0,$.jsx)(`code`,{children:ge}),` (Ctrl+] detaches, Claude keeps running).`]}),(0,$.jsxs)(`p`,{className:`wd-pty-elsewhere-actions`,children:[(0,$.jsx)(`button`,{type:`button`,className:`wd-btn-secondary`,onClick:me,disabled:fe,children:fe?`Checking…`:`Check again`}),!b.confirmed&&(0,$.jsx)(`button`,{type:`button`,className:`wd-link-button`,onClick:()=>void he(),children:`It's not running — start it here…`})]})]}),(0,$.jsxs)(`div`,{className:`wd-pty-frame`,style:b?{display:`none`}:void 0,children:[(0,$.jsx)(`div`,{ref:c,className:`wd-pty-host`}),ve&&(0,$.jsx)(`span`,{className:`wd-pty-latency`+(ve.slow?` wd-pty-latency-slow`:``),title:ve.title,children:ve.text}),p!==`ready`&&!b&&!y&&(0,$.jsx)(`div`,{className:`wd-pty-connecting`,role:`status`,children:p===`starting`?`Starting Claude — resuming the conversation…`:`Connecting…`}),p!==`ready`&&!b&&y&&(0,$.jsxs)(`div`,{className:`wd-pty-connecting wd-pty-failed`,role:`alert`,children:[(0,$.jsxs)(`p`,{children:[`Couldn't start Claude: `,y.reason,`.`]}),(0,$.jsxs)(`p`,{children:[y.retryAt===null?`Stopped trying on its own.`:(0,$.jsx)(Op,{at:y.retryAt}),` `,(0,$.jsx)(`button`,{type:`button`,className:`wd-btn-secondary`,onClick:()=>{re.current=0,te(null),_(e=>e+1)},children:y.retryAt===null?`Try again`:`Try now`})]})]})]})]})}function Op({at:e}){let[t,n]=(0,l.useState)(()=>Date.now());return(0,l.useEffect)(()=>{let e=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(e)},[]),(0,$.jsxs)($.Fragment,{children:[`Trying again in `,Math.max(1,Math.ceil((e-t)/1e3)),` s…`]})}export{wp as ELSEWHERE_RECHECK_MS,Dp as PtyView,Cp as openLink};
96
- //# sourceMappingURL=PtyView-DhDNPvL9.js.map
96
+ //# sourceMappingURL=PtyView-DpIVcrTI.js.map