very-happy-cli 0.2.192 → 0.2.194

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 (210) hide show
  1. package/dist/{AcpBackend-CGHTDJd9.mjs → AcpBackend-C3Kx0QJb.mjs} +3 -3
  2. package/dist/{AcpBackend-BQO4ShOy.cjs → AcpBackend-DJzsue14.cjs} +3 -3
  3. package/dist/{AcpSessionManager-LlUMmcpB.cjs → AcpSessionManager-Bc3iafB1.cjs} +2 -2
  4. package/dist/{AcpSessionManager-G0xD6Jbq.mjs → AcpSessionManager-SteuoqMY.mjs} +2 -2
  5. package/dist/{BasePermissionHandler-BmTIg376.mjs → BasePermissionHandler-D2pNcAXn.mjs} +1 -1
  6. package/dist/{BasePermissionHandler-N6Ip3tFt.cjs → BasePermissionHandler-DKzNFVCh.cjs} +1 -1
  7. package/dist/{account-DtaouikP.cjs → account-ByVjlvFj.cjs} +84 -27
  8. package/dist/{account-CCVT-HO_.mjs → account-DC2YyU24.mjs} +84 -27
  9. package/dist/{accountService-Dd9uqde2.mjs → accountService-Cd7bnkfd.mjs} +369 -19
  10. package/dist/{accountService-Bddy0zwL.cjs → accountService-CuUSJDhP.cjs} +369 -19
  11. package/dist/{acpSessionResume-BWEUxNtC.mjs → acpSessionResume-B6VClxKQ.mjs} +1 -1
  12. package/dist/{acpSessionResume-BnHDk5eD.cjs → acpSessionResume-DHHgbNnk.cjs} +1 -1
  13. package/dist/{agentHome-B0VnjkZW.mjs → agentHome-9caXwo7k.mjs} +4 -4
  14. package/dist/{agentHome-CqQ29YY7.cjs → agentHome-Bov1aHYS.cjs} +4 -4
  15. package/dist/{api-_LeBScjg.mjs → api-aE60mNjs.mjs} +10 -10
  16. package/dist/{api-hMDsC6Wg.cjs → api-wYwQCJml.cjs} +10 -10
  17. package/dist/{apiMachine-CgRldeJ6.mjs → apiMachine-CvNB38Xg.mjs} +36 -19
  18. package/dist/{apiMachine-CqW2m6Zr.cjs → apiMachine-DwaqfM9Q.cjs} +36 -19
  19. package/dist/{attachmentContent-CyptLIfq.mjs → attachmentContent-C2ymY_-w.mjs} +2 -2
  20. package/dist/{attachmentContent-BEeT2J5n.cjs → attachmentContent-DB8ZsxGE.cjs} +2 -2
  21. package/dist/{auth-CFQikywl.mjs → auth-BYtmGgE1.mjs} +8 -8
  22. package/dist/{auth-CA1OClsW.cjs → auth-Bce0Zk3q.cjs} +8 -8
  23. package/dist/{auth-DL8_J9vu.mjs → auth-CWO6cQ4G.mjs} +5 -5
  24. package/dist/{auth-C9NvNHhL.cjs → auth-boIcb7iq.cjs} +5 -5
  25. package/dist/{auto-uQOxlxLp.cjs → auto-AaggdihK.cjs} +24 -22
  26. package/dist/{auto-CKI05w1D.mjs → auto-B-kopWQx.mjs} +24 -22
  27. package/dist/{bootstrap-DaZ0Np7X.mjs → bootstrap-CiWwfHB2.mjs} +2 -2
  28. package/dist/{bootstrap-DsZGc69k.cjs → bootstrap-kywZ0tvD.cjs} +2 -2
  29. package/dist/{browser-BUIaSHK2.mjs → browser-CFfZM3yg.mjs} +1 -1
  30. package/dist/{browser-Ft0ASDm7.cjs → browser-Do2MFdq6.cjs} +1 -1
  31. package/dist/{claudeAccountEnv-ON24i0qv.mjs → claudeAccountEnv-BL1pR_37.mjs} +2 -1
  32. package/dist/{claudeAccountEnv-BOBpJ3k8.cjs → claudeAccountEnv-CEX_EMZr.cjs} +2 -1
  33. package/dist/{claudeLocal-B1ZVtryl.mjs → claudeLocal-B47NjZfB.mjs} +5 -5
  34. package/dist/{claudeLocal-BMf9t4Fa.cjs → claudeLocal-DLd8ogcH.cjs} +5 -5
  35. package/dist/{claudeLocalLauncher-Bp8bqF4y.mjs → claudeLocalLauncher-5DDuHpCD.mjs} +10 -10
  36. package/dist/{claudeLocalLauncher-C8TeJcfF.cjs → claudeLocalLauncher-D_UTQ4o_.cjs} +10 -10
  37. package/dist/{claudeSessionFork-YiktY55n.cjs → claudeSessionFork-4g6-Sk3Q.cjs} +104 -38
  38. package/dist/{claudeSessionFork-8AA47z8Y.mjs → claudeSessionFork-BrJTncNL.mjs} +105 -40
  39. package/dist/{client-Crh8_cNx.cjs → client-BIg2LPVx.cjs} +2 -2
  40. package/dist/{client-CFHZfh9x.cjs → client-BfDga3xi.cjs} +4 -4
  41. package/dist/{client-Bm4oKvW7.mjs → client-Cbxr9VUE.mjs} +4 -2
  42. package/dist/{client-D8XROyZc.cjs → client-CsfPUxLy.cjs} +4 -2
  43. package/dist/{client-BmPaBnDK.mjs → client-DS5JEsHs.mjs} +4 -4
  44. package/dist/{client-Cxlp_D4I.mjs → client-OjYRPhZs.mjs} +2 -2
  45. package/dist/codex/happyMcpStdioBridge.cjs +16 -16
  46. package/dist/codex/happyMcpStdioBridge.mjs +16 -16
  47. package/dist/codexAccount-BDQjRbtI.cjs +1028 -0
  48. package/dist/codexAccount-NOX5pmQf.mjs +1015 -0
  49. package/dist/{codexAppServerClient-q8GHQhyC.cjs → codexAppServerClient-Bj5vN7sb.cjs} +18 -7
  50. package/dist/{codexAppServerClient-BWJbLCQn.mjs → codexAppServerClient-HKAm8f_D.mjs} +18 -7
  51. package/dist/{codexCommand-BfXfRQr4.mjs → codexCommand-655pR6CR.mjs} +188 -58
  52. package/dist/{codexCommand-BgpGg-Zy.cjs → codexCommand-DtbDjHZp.cjs} +187 -57
  53. package/dist/{codexTermination-CVUF0X75.cjs → codexTermination-CX_FHKT5.cjs} +1 -1
  54. package/dist/{codexTermination-s9fd1gkA.mjs → codexTermination-DxLR-bb5.mjs} +1 -1
  55. package/dist/{codexThreadFork-5kwoKjMu.cjs → codexThreadFork-C6ZmcT2z.cjs} +22 -1
  56. package/dist/{codexThreadFork-DobPd19R.mjs → codexThreadFork-CVzAqELg.mjs} +22 -2
  57. package/dist/{config-BF8XgLyc.mjs → config-CIvXVGlP.mjs} +3 -3
  58. package/dist/{config-BAjyTyYp.cjs → config-Cv-A-Bw0.cjs} +3 -3
  59. package/dist/{configuration-CXEVKAyF.cjs → configuration-2Pbg3a0H.cjs} +1 -1
  60. package/dist/{configuration-IhRiLDVe.mjs → configuration-rTcdHkhE.mjs} +1 -1
  61. package/dist/{connect-LZh1gr08.mjs → connect-B9Bl68PF.mjs} +13 -13
  62. package/dist/{connect-rCS56arw.cjs → connect-BAYNAE8A.cjs} +13 -13
  63. package/dist/{context-DO6F5YwH.mjs → context-C7QarZMk.mjs} +1 -1
  64. package/dist/{context-3_S_mWz9.cjs → context-CLTyu_tQ.cjs} +1 -1
  65. package/dist/{controlClient-8ILulwjc.mjs → controlClient-BIdGnYBo.mjs} +3 -3
  66. package/dist/{controlClient-j7p5p3_7.cjs → controlClient-CIqHL07h.cjs} +3 -3
  67. package/dist/{createSessionMetadata-DwdD_uVo.cjs → createSessionMetadata-BHjzRzPc.cjs} +2 -2
  68. package/dist/{createSessionMetadata-oyaTZm1b.mjs → createSessionMetadata-PrN-dT7K.mjs} +2 -2
  69. package/dist/{daemonAccounts-BCjDgoNt.cjs → daemonAccounts-CpGDY_4k.cjs} +4 -1
  70. package/dist/{daemonAccounts-BJgt6IJe.mjs → daemonAccounts-DwPwKxvv.mjs} +5 -2
  71. package/dist/{defaultPermissionMode-BFShzF55.cjs → defaultPermissionMode-BakXiqRr.cjs} +1 -1
  72. package/dist/{defaultPermissionMode-Lt3PUCwY.mjs → defaultPermissionMode-DF5AfeBb.mjs} +1 -1
  73. package/dist/{deterministicJson-Dfp-7wUZ.mjs → deterministicJson-DFwJ57jR.mjs} +13 -13
  74. package/dist/{deterministicJson-DUN0v3St.cjs → deterministicJson-ZBFn1jtS.cjs} +13 -13
  75. package/dist/{doctor-B_UwMcVT.mjs → doctor-CFYpAXvt.mjs} +7 -7
  76. package/dist/{doctor-FgUYTbAT.cjs → doctor-yyM-zii7.cjs} +7 -7
  77. package/dist/{downloadTarget-C0d6jRx-.mjs → downloadTarget-CVPBZMnY.mjs} +6 -6
  78. package/dist/{downloadTarget-BrrQEDxg.cjs → downloadTarget-DlmqPQp9.cjs} +6 -6
  79. package/dist/{ensureDaemonRunning-KUMFfIil.mjs → ensureDaemonRunning-B6Y-CMWe.mjs} +5 -5
  80. package/dist/{ensureDaemonRunning-Cq4FYI5Q.cjs → ensureDaemonRunning-D2ny0yon.cjs} +5 -5
  81. package/dist/{handleResumeCommand-Cl9GIL5F.cjs → handleResumeCommand-D-mGugcu.cjs} +5 -5
  82. package/dist/{handleResumeCommand-BGhVo3QH.mjs → handleResumeCommand-DlrDcV5B.mjs} +5 -5
  83. package/dist/{index-CQ_hLLCj.cjs → index-2Fcq3AGX.cjs} +3 -3
  84. package/dist/{index-CRipkiqo.cjs → index-5c33fqLQ.cjs} +4 -4
  85. package/dist/{index-JQDyJ3Li.mjs → index-BJsenPFp.mjs} +3 -3
  86. package/dist/{index-BzAYnYct.cjs → index-BUFrKZeQ.cjs} +198 -108
  87. package/dist/{index-D8ODb0_U.cjs → index-BWvmUCQF.cjs} +42 -42
  88. package/dist/{index-v5EmjT8l.mjs → index-Bi3dVJ0S.mjs} +4 -4
  89. package/dist/{index-CZaLMmPC.cjs → index-CPkSLWP_.cjs} +4 -4
  90. package/dist/{index-DYD3GM1m.mjs → index-D1YnIih6.mjs} +195 -109
  91. package/dist/{index-BjXjMhGY.mjs → index-DEN6vfEY.mjs} +4 -4
  92. package/dist/{index-Ca1Tt96A.mjs → index-DuDD9khO.mjs} +43 -43
  93. package/dist/index.cjs +2 -2
  94. package/dist/index.mjs +2 -2
  95. package/dist/{install-ClUA9tbC.cjs → install-BOA4nEbm.cjs} +3 -3
  96. package/dist/{install-D6EHRtAN.mjs → install-BVYL-wSO.mjs} +3 -3
  97. package/dist/lib.cjs +12 -12
  98. package/dist/lib.d.cts +97 -25
  99. package/dist/lib.d.mts +97 -25
  100. package/dist/lib.mjs +12 -12
  101. package/dist/{lidState-DqoN7zH4.cjs → lidState-DYeb7Wud.cjs} +1 -1
  102. package/dist/{lidState-CZOXXdzv.mjs → lidState-zy20u7T3.mjs} +1 -1
  103. package/dist/{localHappyAgentAuth-YHxDZ4x4.mjs → localHappyAgentAuth-CBsX08VJ.mjs} +1 -1
  104. package/dist/{localHappyAgentAuth-BnGCpHRX.cjs → localHappyAgentAuth-CScN2McN.cjs} +1 -1
  105. package/dist/{logger-8su64lqR.cjs → logger-CepF8C5Z.cjs} +2 -2
  106. package/dist/{logger-Fd_rNvgd.mjs → logger-SGCwRIV5.mjs} +2 -2
  107. package/dist/{machineMetadata-1HIIC7Bc.mjs → machineMetadata-ClJfd7ay.mjs} +3 -3
  108. package/dist/{machineMetadata-DYXt3p6u.cjs → machineMetadata-ObK4hjF0.cjs} +3 -3
  109. package/dist/{main-BI6GIzUL.mjs → main-C7ZcZVBY.mjs} +47 -47
  110. package/dist/{main-C_GrcYkn.cjs → main-mhXOpUV7.cjs} +47 -47
  111. package/dist/{mcp-XGoxywno.mjs → mcp-BuCpkYTY.mjs} +18 -18
  112. package/dist/{mcp-BycIv9oQ.cjs → mcp-Zz7m0j8A.cjs} +18 -18
  113. package/dist/{mirrorProtocol-DXT3rv7T.mjs → mirrorProtocol-B0H9UTBM.mjs} +3 -3
  114. package/dist/{mirrorProtocol-DVnB8EO8.cjs → mirrorProtocol-IhICxf0K.cjs} +3 -3
  115. package/dist/{package-iuLlSiSF.cjs → package-C7WgesIw.cjs} +7 -7
  116. package/dist/{package-6KkRAops.mjs → package-Q_ELj5DL.mjs} +7 -7
  117. package/dist/{panels-B5Di2zb2.mjs → panels-Cm69UXgE.mjs} +5 -5
  118. package/dist/{panels-0C89q0Tu.cjs → panels-yyxpwZnk.cjs} +5 -5
  119. package/dist/{peerTools-CANTX_mG.cjs → peerTools-BcZAbqBL.cjs} +5 -5
  120. package/dist/{peerTools-CKJ-IDM4.mjs → peerTools-DUg9RduG.mjs} +5 -5
  121. package/dist/{persistence-B4ttN-fR.cjs → persistence-D0gNvqXe.cjs} +2 -2
  122. package/dist/{persistence-DWcHe035.mjs → persistence-mr4Y484W.mjs} +2 -2
  123. package/dist/{piRunnerArgs-Bl5GpBoN.mjs → piRunnerArgs-CGjpl4iF.mjs} +1 -1
  124. package/dist/{piRunnerArgs-BOkfxyak.cjs → piRunnerArgs-DK_DDkYW.cjs} +1 -1
  125. package/dist/{piRuntime-DzrIiZU8.cjs → piRuntime-CtZRNOEb.cjs} +1 -1
  126. package/dist/{piRuntime-BhwxzdQf.mjs → piRuntime-HUA19wG8.mjs} +1 -1
  127. package/dist/{piTerminal-DnA2CbGr.mjs → piTerminal-Bgy1W9mA.mjs} +20 -20
  128. package/dist/{piTerminal-BdS7ol7v.cjs → piTerminal-D9OPouek.cjs} +20 -20
  129. package/dist/{pushNotifications-BqFoLye2.cjs → pushNotifications-CH0XVPQe.cjs} +3 -3
  130. package/dist/{pushNotifications-DkQ0yvFs.mjs → pushNotifications-DjEl8G0a.mjs} +3 -3
  131. package/dist/{query-BQ4br3yn.cjs → query-Df3WhSA0.cjs} +1 -1
  132. package/dist/{query-BRJYSkb1.mjs → query-DmIo5OXf.mjs} +1 -1
  133. package/dist/{rateLimitReporter-BRbYkmuP.mjs → rateLimitReporter-B_PZClib.mjs} +3 -3
  134. package/dist/{rateLimitReporter-DK5SQuCc.cjs → rateLimitReporter-M_IKRRS7.cjs} +3 -3
  135. package/dist/{rateLimitWindows-DBfiuYeg.cjs → rateLimitWindows-B9PERFm1.cjs} +1 -1
  136. package/dist/{rateLimitWindows-Da5AR-4u.mjs → rateLimitWindows-a2yE3kCv.mjs} +1 -1
  137. package/dist/{registerCommonHandlers-yQ7Ru-l0.mjs → registerCommonHandlers-CND00Dpj.mjs} +2 -2
  138. package/dist/{registerCommonHandlers-m6pxxf2J.cjs → registerCommonHandlers-D4uXC0he.cjs} +2 -2
  139. package/dist/{registerKillSessionHandler-BDNpi7YO.mjs → registerKillSessionHandler-CwyHwm_n.mjs} +6 -6
  140. package/dist/{registerKillSessionHandler-BAOIa_Fs.cjs → registerKillSessionHandler-DQKsD9CW.cjs} +6 -6
  141. package/dist/{remoteSessionClient-iJMXRN_D.cjs → remoteSessionClient-DOWgca08.cjs} +5 -5
  142. package/dist/{remoteSessionClient-CZ7aaNgj.mjs → remoteSessionClient-mIr_9OL_.mjs} +5 -5
  143. package/dist/{reportProgressTool-DpFs7pSe.cjs → reportProgressTool-BLw2_Ohi.cjs} +3 -3
  144. package/dist/{reportProgressTool-DfQhPu0s.mjs → reportProgressTool-DTKlUlHv.mjs} +3 -3
  145. package/dist/{run-p-xp1_HY.cjs → run-1V6DLzTY.cjs} +178 -847
  146. package/dist/{run-CwN28mcj.mjs → run-bfxXYL5N.mjs} +176 -845
  147. package/dist/{runClaude-DRKtAGTm.mjs → runClaude-BgvDhl2p.mjs} +25 -25
  148. package/dist/{runClaude-D6U1Z575.cjs → runClaude-DuFgZZwO.cjs} +25 -25
  149. package/dist/{runClaudeDeps-BheVcIlD.mjs → runClaudeDeps-CX7GtH7O.mjs} +46 -46
  150. package/dist/{runClaudeDeps-Dkofokgb.cjs → runClaudeDeps-DeVinBmE.cjs} +41 -41
  151. package/dist/{runGemini-owbvhFbi.mjs → runGemini-Cd27u-7R.mjs} +33 -33
  152. package/dist/{runGemini-C8q3YCc0.cjs → runGemini-DiYSk3s1.cjs} +33 -33
  153. package/dist/{runOpenClaw-Dky3-mjO.mjs → runOpenClaw-CWkkfRSo.mjs} +18 -18
  154. package/dist/{runOpenClaw-DGeN66-t.cjs → runOpenClaw-DyQnBzpy.cjs} +18 -18
  155. package/dist/{sandbox-D2CPyoCA.cjs → sandbox-BAXXYewR.cjs} +4 -4
  156. package/dist/{sandbox-sq_wy9Gl.mjs → sandbox-C35zDrkc.mjs} +4 -4
  157. package/dist/selfCheck-DKMF0Dyu.mjs +88 -0
  158. package/dist/{selfCheck-BgLvQKSt.cjs → selfCheck-R71q-x7u.cjs} +39 -39
  159. package/dist/{send-Cd10YhXh.cjs → send-3Wa9th3D.cjs} +8 -8
  160. package/dist/{send-K9vg-8t-.mjs → send-DiSaR5Bk.mjs} +8 -8
  161. package/dist/{server-DRrV64r0.cjs → server-BJu2bFBy.cjs} +6 -6
  162. package/dist/{server-De4W1zuK.mjs → server-BxMJxaE6.mjs} +4 -4
  163. package/dist/{sessionLock-BDtSzzKS.cjs → sessionLock-BJ1ngLgm.cjs} +3 -3
  164. package/dist/{sessionLock-Dl6i7IgA.mjs → sessionLock-dbi4JPhP.mjs} +3 -3
  165. package/dist/{sessionOps-DvnEH4PL.cjs → sessionOps-BUlpeaUe.cjs} +50 -8
  166. package/dist/{sessionOps-gU88-W9F.mjs → sessionOps-C9wRmCBg.mjs} +51 -9
  167. package/dist/{sessionProvider-CKcIo7KO.mjs → sessionProvider-BEHfI5gs.mjs} +11 -9
  168. package/dist/{sessionProvider-CbSZeZrl.cjs → sessionProvider-DYD6JepE.cjs} +11 -9
  169. package/dist/{sessionScanner-7RtcCeyD.cjs → sessionScanner-BwbjEoSf.cjs} +3 -3
  170. package/dist/{sessionScanner-DR32uSby.mjs → sessionScanner-CFITViIZ.mjs} +3 -3
  171. package/dist/{sessions-BvuMjgvJ.cjs → sessions-C-wBd0fN.cjs} +10 -10
  172. package/dist/{sessions-DTt2Eguk.mjs → sessions-wOcO2X-k.mjs} +10 -10
  173. package/dist/{setupOfflineReconnection-DduOsw6p.cjs → setupOfflineReconnection-Bd6XsWhA.cjs} +2 -2
  174. package/dist/{setupOfflineReconnection-BGnvhRfb.mjs → setupOfflineReconnection-BrljmbqX.mjs} +2 -2
  175. package/dist/{spawn-CL3cUc7b.mjs → spawn-BPioepNz.mjs} +66 -22
  176. package/dist/{spawn-DMB6rRPA.cjs → spawn-Crprnq9Z.cjs} +66 -22
  177. package/dist/{spawnAgents-CClb7buD.cjs → spawnAgents-B9olJ8xn.cjs} +1 -1
  178. package/dist/{spawnAgents-CRMfOJhh.mjs → spawnAgents-I29H9nO8.mjs} +1 -1
  179. package/dist/{spawnHappyCLI-Cj_6IICe.mjs → spawnHappyCLI-BA1bTIiO.mjs} +1 -1
  180. package/dist/{spawnHappyCLI-DJdhX_Qx.cjs → spawnHappyCLI-C0XAWy8V.cjs} +1 -1
  181. package/dist/{startFileWatcher-DikVa8kg.mjs → startFileWatcher-COCEjNT8.mjs} +1 -1
  182. package/dist/{startFileWatcher-LnOmVW6H.cjs → startFileWatcher-Ca5izs24.cjs} +1 -1
  183. package/dist/{startupSessionCreate-CDdaLaMq.mjs → startupSessionCreate-BnEPBxsJ.mjs} +3 -3
  184. package/dist/{startupSessionCreate-B3ND-917.cjs → startupSessionCreate-Cmg1gkKS.cjs} +3 -3
  185. package/dist/{store-DV__wCvP.cjs → store-CkNa6oj4.cjs} +46 -9
  186. package/dist/{store--XN-7MS0.mjs → store-Vej_738f.mjs} +46 -10
  187. package/dist/{streamRelay-DFdOaLOn.cjs → streamRelay-C0G1HOOd.cjs} +1 -1
  188. package/dist/{streamRelay-sABnxEXq.mjs → streamRelay-C5U-C4GS.mjs} +1 -1
  189. package/dist/{sync-_2lsZ1U2.cjs → sync-BfrnSdL1.cjs} +1 -1
  190. package/dist/{sync-JoEZKRo8.mjs → sync-DVcNkv8e.mjs} +1 -1
  191. package/dist/{systemPrompt-Zq4HyrZ5.mjs → systemPrompt-BxZebU75.mjs} +2 -2
  192. package/dist/{systemPrompt-CJEvNCuW.cjs → systemPrompt-Os5ca7pu.cjs} +2 -2
  193. package/dist/{teams-BNZafnrT.cjs → teams--pv0QFMA.cjs} +7 -7
  194. package/dist/{teams-qz4LqKJ2.mjs → teams-CNB3DE_n.mjs} +7 -7
  195. package/dist/{template-LgvBbOna.cjs → template-B9pLEP8v.cjs} +2 -2
  196. package/dist/{template-CJ8BWSsc.mjs → template-CL9EvQLQ.mjs} +2 -2
  197. package/dist/{time-bzmet4s5.mjs → time-0Ru4clBD.mjs} +1 -1
  198. package/dist/{time-CaUlWSNJ.cjs → time-Da5GIiCa.cjs} +1 -1
  199. package/dist/{titleGenerator-BuIIu_JP.cjs → titleGenerator-9xIXHA5K.cjs} +3 -3
  200. package/dist/{titleGenerator-CbTtJ_1D.mjs → titleGenerator-CaCzpYyA.mjs} +2 -2
  201. package/dist/{todo-DIrVF_Ak.mjs → todo-CZXHl2Lg.mjs} +6 -6
  202. package/dist/{todo-CQ_BTf9C.cjs → todo-DUY_J3l_.cjs} +6 -6
  203. package/dist/{tools-cLOjBvPn.mjs → tools-DqA2Jt2R.mjs} +3 -2
  204. package/dist/{tools-BnmmFZji.cjs → tools-hPD2Hvei.cjs} +3 -2
  205. package/dist/{uninstall-C5OuW6dE.mjs → uninstall-CjMzELYw.mjs} +3 -3
  206. package/dist/{uninstall-uEEGKB84.cjs → uninstall-rTvdpRLt.cjs} +3 -3
  207. package/dist/{wrapperAccount-DXlD3bsO.mjs → wrapperAccount-BkufO_9g.mjs} +5 -4
  208. package/dist/{wrapperAccount-DzoGqS2b.cjs → wrapperAccount-D2A4DuZy.cjs} +6 -3
  209. package/package.json +7 -7
  210. package/dist/selfCheck-vkfrgQ7X.mjs +0 -88
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var store = require('./store-DV__wCvP.cjs');
3
+ var store = require('./store-CkNa6oj4.cjs');
4
4
 
5
5
  const ACCOUNT_STRIPPED_ENV_KEYS = [
6
6
  "ANTHROPIC_API_KEY",
@@ -67,6 +67,7 @@ function resolveClaudeAccount(sessionId, deps) {
67
67
  const record = deps.accounts.accounts[id];
68
68
  if (!record) return unavailable(id, id, "unknown", "missing");
69
69
  const { label, kind } = record;
70
+ if (record.agent !== "claude") return unavailable(id, label, kind, "agent-mismatch");
70
71
  if (kind === "claude-subscription") {
71
72
  const path = store.accountSecretPath(deps.home, id);
72
73
  if (!deps.fileReadable(path)) return unavailable(id, label, kind, "missing-secret");
@@ -2,21 +2,21 @@ import { spawn } from 'cross-spawn';
2
2
  import { createInterface } from 'node:readline';
3
3
  import { readdirSync, statSync, mkdirSync, existsSync } from 'node:fs';
4
4
  import { randomUUID } from 'node:crypto';
5
- import { l as logger } from './logger-Fd_rNvgd.mjs';
5
+ import { l as logger } from './logger-SGCwRIV5.mjs';
6
6
  import { p as pinSmallFastModel, a as applyPromptCacheTtlDefault, e as ensureLocalProxyBypass } from './promptCacheTtl-Ce0TVbrx.mjs';
7
7
  import { join } from 'node:path';
8
8
  import { g as getProjectPath } from './path-D2wdaNSk.mjs';
9
- import { c as claudeCheckSession, s as systemPrompt } from './systemPrompt-Zq4HyrZ5.mjs';
9
+ import { c as claudeCheckSession, s as systemPrompt } from './systemPrompt-BxZebU75.mjs';
10
10
  import { i as initializeSandbox, a as wrapCommand } from './manager-BEsI4qt3.mjs';
11
11
  import { c as contentLogMetadata } from './contentLogMetadata-BlWI0egu.mjs';
12
12
  import { claudeCliPath } from './claudeCliPath-BqkaH2oR.mjs';
13
13
  import 'chalk';
14
14
  import 'node:util';
15
- import './configuration-IhRiLDVe.mjs';
15
+ import './configuration-rTcdHkhE.mjs';
16
16
  import 'node:os';
17
- import './package-6KkRAops.mjs';
17
+ import './package-Q_ELj5DL.mjs';
18
18
  import 'node:fs/promises';
19
- import './index-DYD3GM1m.mjs';
19
+ import './index-D1YnIih6.mjs';
20
20
  import 'zod';
21
21
  import '@paralleldrive/cuid2';
22
22
  import './trimIdent-BAjmv_TG.mjs';
@@ -4,21 +4,21 @@ var spawn = require('cross-spawn');
4
4
  var node_readline = require('node:readline');
5
5
  var node_fs = require('node:fs');
6
6
  var node_crypto = require('node:crypto');
7
- var logger = require('./logger-8su64lqR.cjs');
7
+ var logger = require('./logger-CepF8C5Z.cjs');
8
8
  var promptCacheTtl = require('./promptCacheTtl-B8PCzE6k.cjs');
9
9
  var path$1 = require('node:path');
10
10
  var path = require('./path-B7zW-WwE.cjs');
11
- var systemPrompt = require('./systemPrompt-CJEvNCuW.cjs');
11
+ var systemPrompt = require('./systemPrompt-Os5ca7pu.cjs');
12
12
  var manager = require('./manager-HrEj442o.cjs');
13
13
  var contentLogMetadata = require('./contentLogMetadata-ZSFk_NjQ.cjs');
14
14
  var claudeCliPath = require('./claudeCliPath-GaP3UUz1.cjs');
15
15
  require('chalk');
16
16
  require('node:util');
17
- require('./configuration-CXEVKAyF.cjs');
17
+ require('./configuration-2Pbg3a0H.cjs');
18
18
  require('node:os');
19
- require('./package-iuLlSiSF.cjs');
19
+ require('./package-C7WgesIw.cjs');
20
20
  require('node:fs/promises');
21
- require('./index-BzAYnYct.cjs');
21
+ require('./index-BUFrKZeQ.cjs');
22
22
  require('zod');
23
23
  require('@paralleldrive/cuid2');
24
24
  require('./trimIdent-4gvk9Wk6.cjs');
@@ -1,21 +1,21 @@
1
- import { l as logger } from './logger-Fd_rNvgd.mjs';
2
- import { claudeLocal, ExitCodeError } from './claudeLocal-B1ZVtryl.mjs';
3
- import { c as createSessionScanner, F as Future, d as describeClaudeProcessExit } from './sessionScanner-DR32uSby.mjs';
1
+ import { l as logger } from './logger-SGCwRIV5.mjs';
2
+ import { claudeLocal, ExitCodeError } from './claudeLocal-B47NjZfB.mjs';
3
+ import { c as createSessionScanner, F as Future, d as describeClaudeProcessExit } from './sessionScanner-CFITViIZ.mjs';
4
4
  import 'chalk';
5
5
  import 'node:util';
6
- import './configuration-IhRiLDVe.mjs';
6
+ import './configuration-rTcdHkhE.mjs';
7
7
  import 'node:fs';
8
8
  import 'node:os';
9
9
  import 'node:path';
10
- import './package-6KkRAops.mjs';
10
+ import './package-Q_ELj5DL.mjs';
11
11
  import 'node:fs/promises';
12
12
  import 'cross-spawn';
13
13
  import 'node:readline';
14
14
  import 'node:crypto';
15
15
  import './promptCacheTtl-Ce0TVbrx.mjs';
16
16
  import './path-D2wdaNSk.mjs';
17
- import './systemPrompt-Zq4HyrZ5.mjs';
18
- import './index-DYD3GM1m.mjs';
17
+ import './systemPrompt-BxZebU75.mjs';
18
+ import './index-D1YnIih6.mjs';
19
19
  import 'zod';
20
20
  import '@paralleldrive/cuid2';
21
21
  import './trimIdent-BAjmv_TG.mjs';
@@ -28,11 +28,11 @@ import './claudeCliPath-BqkaH2oR.mjs';
28
28
  import './projectPath-BTBIMB57.mjs';
29
29
  import 'path';
30
30
  import 'url';
31
- import './sync-JoEZKRo8.mjs';
32
- import './time-bzmet4s5.mjs';
31
+ import './sync-DVcNkv8e.mjs';
32
+ import './time-0Ru4clBD.mjs';
33
33
  import './types-CkqAACXx.mjs';
34
34
  import './transcriptCursor-B7T_gkQ0.mjs';
35
- import './startFileWatcher-DikVa8kg.mjs';
35
+ import './startFileWatcher-COCEjNT8.mjs';
36
36
  import 'fs/promises';
37
37
 
38
38
  async function claudeLocalLauncher(session) {
@@ -1,23 +1,23 @@
1
1
  'use strict';
2
2
 
3
- var logger = require('./logger-8su64lqR.cjs');
4
- var claudeLocal = require('./claudeLocal-BMf9t4Fa.cjs');
5
- var sessionScanner = require('./sessionScanner-7RtcCeyD.cjs');
3
+ var logger = require('./logger-CepF8C5Z.cjs');
4
+ var claudeLocal = require('./claudeLocal-DLd8ogcH.cjs');
5
+ var sessionScanner = require('./sessionScanner-BwbjEoSf.cjs');
6
6
  require('chalk');
7
7
  require('node:util');
8
- require('./configuration-CXEVKAyF.cjs');
8
+ require('./configuration-2Pbg3a0H.cjs');
9
9
  require('node:fs');
10
10
  require('node:os');
11
11
  require('node:path');
12
- require('./package-iuLlSiSF.cjs');
12
+ require('./package-C7WgesIw.cjs');
13
13
  require('node:fs/promises');
14
14
  require('cross-spawn');
15
15
  require('node:readline');
16
16
  require('node:crypto');
17
17
  require('./promptCacheTtl-B8PCzE6k.cjs');
18
18
  require('./path-B7zW-WwE.cjs');
19
- require('./systemPrompt-CJEvNCuW.cjs');
20
- require('./index-BzAYnYct.cjs');
19
+ require('./systemPrompt-Os5ca7pu.cjs');
20
+ require('./index-BUFrKZeQ.cjs');
21
21
  require('zod');
22
22
  require('@paralleldrive/cuid2');
23
23
  require('./trimIdent-4gvk9Wk6.cjs');
@@ -30,11 +30,11 @@ require('./claudeCliPath-GaP3UUz1.cjs');
30
30
  require('./projectPath-C3ioB4Bu.cjs');
31
31
  require('path');
32
32
  require('url');
33
- require('./sync-_2lsZ1U2.cjs');
34
- require('./time-CaUlWSNJ.cjs');
33
+ require('./sync-BfrnSdL1.cjs');
34
+ require('./time-Da5GIiCa.cjs');
35
35
  require('./types-CRS-srZK.cjs');
36
36
  require('./transcriptCursor-DcXGLeSc.cjs');
37
- require('./startFileWatcher-LnOmVW6H.cjs');
37
+ require('./startFileWatcher-Ca5izs24.cjs');
38
38
  require('fs/promises');
39
39
 
40
40
  async function claudeLocalLauncher(session) {
@@ -5,7 +5,7 @@ var promises = require('node:fs/promises');
5
5
  var node_fs = require('node:fs');
6
6
  var path = require('node:path');
7
7
  var node_readline = require('node:readline');
8
- var logger = require('./logger-8su64lqR.cjs');
8
+ var logger = require('./logger-CepF8C5Z.cjs');
9
9
 
10
10
  class ForkTruncateUuidNotFoundError extends Error {
11
11
  constructor(cutAfterUuid, sourcePath) {
@@ -54,20 +54,109 @@ async function discardForkedSession(projectDir, claudeSessionId) {
54
54
  }
55
55
  }
56
56
  async function forkSession(projectDir, sourceClaudeSessionId) {
57
- const newId = node_crypto.randomUUID();
58
57
  const src = jsonlPath(projectDir, sourceClaudeSessionId);
59
- const dst = jsonlPath(projectDir, newId);
58
+ const lines = completeLines(await readSource(src));
59
+ const newId = await writeFork(projectDir, lines);
60
+ logger.logger.debug(`[CLAUDE FORK] Forked ${sourceClaudeSessionId} -> ${newId}`);
61
+ return newId;
62
+ }
63
+ async function readSource(src) {
60
64
  try {
61
- await promises.copyFile(src, dst);
65
+ return await promises.readFile(src, "utf-8");
62
66
  } catch (error) {
63
- if (error.code === "ENOENT") {
64
- throw new ForkSourceMissingError(src);
65
- }
67
+ if (error.code === "ENOENT") throw new ForkSourceMissingError(src);
68
+ throw error;
69
+ }
70
+ }
71
+ async function writeFork(projectDir, lines) {
72
+ const newId = node_crypto.randomUUID();
73
+ const destination = jsonlPath(projectDir, newId);
74
+ const temporary = `${destination}.tmp-${process.pid}`;
75
+ try {
76
+ await promises.writeFile(temporary, lines.length > 0 ? lines.join("\n") + "\n" : "", { encoding: "utf-8", flag: "wx" });
77
+ await promises.rename(temporary, destination);
78
+ } catch (error) {
79
+ await promises.unlink(temporary).catch(() => void 0);
66
80
  throw error;
67
81
  }
68
- logger.logger.debug(`[CLAUDE FORK] Forked ${sourceClaudeSessionId} -> ${newId}`);
69
82
  return newId;
70
83
  }
84
+ function completeLines(raw) {
85
+ const lines = raw.split("\n");
86
+ const tail = lines.pop() ?? "";
87
+ if (tail.trim()) {
88
+ try {
89
+ JSON.parse(tail);
90
+ lines.push(tail);
91
+ } catch {
92
+ }
93
+ }
94
+ return lines.filter((line) => line.length > 0);
95
+ }
96
+ const INTERRUPTED_PROMPT = /^\[Request interrupted by user(?: for tool use)?\]$/i;
97
+ const LOCAL_COMMAND_OUTPUT = /^<local-command-(?:stdout|stderr)>/;
98
+ const CONTINUING_STOPS = /* @__PURE__ */ new Set(["tool_use", "pause_turn"]);
99
+ function endsTurn(entry) {
100
+ if (!entry || entry.isSidechain) return false;
101
+ if (entry.type === "assistant") {
102
+ const stop = entry.message?.stop_reason;
103
+ return typeof stop === "string" && !CONTINUING_STOPS.has(stop);
104
+ }
105
+ if (entry.type === "system" && entry.subtype === "compact_boundary") return true;
106
+ if (entry.type === "user" && entry.isCompactSummary) return true;
107
+ const text = userPromptText(entry)?.trim();
108
+ return text !== void 0 && (INTERRUPTED_PROMPT.test(text) || LOCAL_COMMAND_OUTPUT.test(text));
109
+ }
110
+ function findUnfinishedTurn(lines) {
111
+ let start = -1;
112
+ const prompts = [];
113
+ for (let i = lines.length - 1; i >= 0; i--) {
114
+ let entry;
115
+ try {
116
+ entry = JSON.parse(lines[i]);
117
+ } catch {
118
+ continue;
119
+ }
120
+ if (endsTurn(entry)) break;
121
+ const text = userPromptText(entry);
122
+ if (text === null || typeof entry.uuid !== "string") continue;
123
+ start = i;
124
+ prompts.unshift(text);
125
+ }
126
+ return start < 0 ? null : { start, prompts };
127
+ }
128
+ function conversationOf(lines) {
129
+ let conversation = false;
130
+ let prompt = false;
131
+ for (const line of lines) {
132
+ let entry;
133
+ try {
134
+ entry = JSON.parse(line);
135
+ } catch {
136
+ continue;
137
+ }
138
+ if (entry?.isSidechain || entry?.isMeta || entry?.isSynthetic || entry?.type !== "user" && entry?.type !== "assistant") continue;
139
+ conversation = true;
140
+ const content = entry.message?.content;
141
+ if (entry.type === "user" && (typeof content === "string" || Array.isArray(content) && content.length > 0 && !content.some((block) => block?.type === "tool_result"))) {
142
+ prompt = true;
143
+ }
144
+ }
145
+ return { conversation, prompt };
146
+ }
147
+ async function forkCompletedTurns(projectDir, sourceClaudeSessionId) {
148
+ const src = jsonlPath(projectDir, sourceClaudeSessionId);
149
+ const lines = completeLines(await readSource(src));
150
+ const unfinished = findUnfinishedTurn(lines);
151
+ const kept = unfinished ? lines.slice(0, unfinished.start) : lines;
152
+ const excludedPrompts = unfinished?.prompts ?? [];
153
+ const history = conversationOf(kept);
154
+ if (!history.conversation) return { startFresh: true, excludedPrompts };
155
+ if (!history.prompt) throw new Error("Cannot safely fork: earlier history has no user prompt");
156
+ const newClaudeSessionId = await writeFork(projectDir, kept);
157
+ logger.logger.debug(`[CLAUDE FORK] Forked completed turns of ${sourceClaudeSessionId} -> ${newClaudeSessionId} (${excludedPrompts.length} prompt(s) left out)`);
158
+ return { newClaudeSessionId, excludedPrompts };
159
+ }
71
160
  async function forkAndTruncateSession(projectDir, sourceClaudeSessionId, cutAfterUuid) {
72
161
  const newId = node_crypto.randomUUID();
73
162
  const src = jsonlPath(projectDir, sourceClaudeSessionId);
@@ -158,16 +247,7 @@ async function listClaudeRewindPoints(projectDir, claudeSessionId) {
158
247
  }
159
248
  async function forkBeforeUserMessage(projectDir, sourceClaudeSessionId, cutBeforeUuid) {
160
249
  const src = jsonlPath(projectDir, sourceClaudeSessionId);
161
- let raw;
162
- try {
163
- raw = await promises.readFile(src, "utf-8");
164
- } catch (error) {
165
- if (error.code === "ENOENT") throw new ForkSourceMissingError(src);
166
- throw error;
167
- }
168
- const lines = raw.split("\n");
169
- let hasPreviousConversation = false;
170
- let hasPreviousPrompt = false;
250
+ const lines = completeLines(await readSource(src));
171
251
  let cut = -1;
172
252
  for (let i = 0; i < lines.length; i++) {
173
253
  let entry;
@@ -181,28 +261,13 @@ async function forkBeforeUserMessage(projectDir, sourceClaudeSessionId, cutBefor
181
261
  cut = i;
182
262
  break;
183
263
  }
184
- if (!entry?.isSidechain && !entry?.isMeta && !entry?.isSynthetic && (entry?.type === "user" || entry?.type === "assistant")) {
185
- hasPreviousConversation = true;
186
- const content = entry.message?.content;
187
- if (entry.type === "user" && (typeof content === "string" || Array.isArray(content) && content.length > 0 && !content.some((block) => block?.type === "tool_result"))) {
188
- hasPreviousPrompt = true;
189
- }
190
- }
191
264
  }
192
265
  if (cut < 0) throw new ForkTruncateUuidNotFoundError(cutBeforeUuid, src);
193
- if (!hasPreviousConversation) return null;
194
- if (!hasPreviousPrompt) throw new Error("Cannot safely rewind: earlier history has no user prompt");
195
- const newId = node_crypto.randomUUID();
196
- const destination = jsonlPath(projectDir, newId);
197
- const temporary = `${destination}.tmp-${process.pid}`;
198
- try {
199
- await promises.writeFile(temporary, lines.slice(0, cut).join("\n") + "\n", { encoding: "utf-8", flag: "wx" });
200
- await promises.rename(temporary, destination);
201
- } catch (error) {
202
- await promises.unlink(temporary).catch(() => void 0);
203
- throw error;
204
- }
205
- return newId;
266
+ const kept = lines.slice(0, cut);
267
+ const history = conversationOf(kept);
268
+ if (!history.conversation) return null;
269
+ if (!history.prompt) throw new Error("Cannot safely rewind: earlier history has no user prompt");
270
+ return writeFork(projectDir, kept);
206
271
  }
207
272
 
208
273
  exports.ForkSourceMissingError = ForkSourceMissingError;
@@ -210,5 +275,6 @@ exports.ForkTruncateUuidNotFoundError = ForkTruncateUuidNotFoundError;
210
275
  exports.discardForkedSession = discardForkedSession;
211
276
  exports.forkAndTruncateSession = forkAndTruncateSession;
212
277
  exports.forkBeforeUserMessage = forkBeforeUserMessage;
278
+ exports.forkCompletedTurns = forkCompletedTurns;
213
279
  exports.forkSession = forkSession;
214
280
  exports.listClaudeRewindPoints = listClaudeRewindPoints;
@@ -1,9 +1,9 @@
1
1
  import { randomUUID } from 'node:crypto';
2
- import { copyFile, unlink, readFile, rename, writeFile } from 'node:fs/promises';
2
+ import { unlink, readFile, rename, writeFile } from 'node:fs/promises';
3
3
  import { createReadStream, createWriteStream } from 'node:fs';
4
4
  import { join } from 'node:path';
5
5
  import { createInterface } from 'node:readline';
6
- import { l as logger } from './logger-Fd_rNvgd.mjs';
6
+ import { l as logger } from './logger-SGCwRIV5.mjs';
7
7
 
8
8
  class ForkTruncateUuidNotFoundError extends Error {
9
9
  constructor(cutAfterUuid, sourcePath) {
@@ -52,20 +52,109 @@ async function discardForkedSession(projectDir, claudeSessionId) {
52
52
  }
53
53
  }
54
54
  async function forkSession(projectDir, sourceClaudeSessionId) {
55
- const newId = randomUUID();
56
55
  const src = jsonlPath(projectDir, sourceClaudeSessionId);
57
- const dst = jsonlPath(projectDir, newId);
56
+ const lines = completeLines(await readSource(src));
57
+ const newId = await writeFork(projectDir, lines);
58
+ logger.debug(`[CLAUDE FORK] Forked ${sourceClaudeSessionId} -> ${newId}`);
59
+ return newId;
60
+ }
61
+ async function readSource(src) {
58
62
  try {
59
- await copyFile(src, dst);
63
+ return await readFile(src, "utf-8");
60
64
  } catch (error) {
61
- if (error.code === "ENOENT") {
62
- throw new ForkSourceMissingError(src);
63
- }
65
+ if (error.code === "ENOENT") throw new ForkSourceMissingError(src);
66
+ throw error;
67
+ }
68
+ }
69
+ async function writeFork(projectDir, lines) {
70
+ const newId = randomUUID();
71
+ const destination = jsonlPath(projectDir, newId);
72
+ const temporary = `${destination}.tmp-${process.pid}`;
73
+ try {
74
+ await writeFile(temporary, lines.length > 0 ? lines.join("\n") + "\n" : "", { encoding: "utf-8", flag: "wx" });
75
+ await rename(temporary, destination);
76
+ } catch (error) {
77
+ await unlink(temporary).catch(() => void 0);
64
78
  throw error;
65
79
  }
66
- logger.debug(`[CLAUDE FORK] Forked ${sourceClaudeSessionId} -> ${newId}`);
67
80
  return newId;
68
81
  }
82
+ function completeLines(raw) {
83
+ const lines = raw.split("\n");
84
+ const tail = lines.pop() ?? "";
85
+ if (tail.trim()) {
86
+ try {
87
+ JSON.parse(tail);
88
+ lines.push(tail);
89
+ } catch {
90
+ }
91
+ }
92
+ return lines.filter((line) => line.length > 0);
93
+ }
94
+ const INTERRUPTED_PROMPT = /^\[Request interrupted by user(?: for tool use)?\]$/i;
95
+ const LOCAL_COMMAND_OUTPUT = /^<local-command-(?:stdout|stderr)>/;
96
+ const CONTINUING_STOPS = /* @__PURE__ */ new Set(["tool_use", "pause_turn"]);
97
+ function endsTurn(entry) {
98
+ if (!entry || entry.isSidechain) return false;
99
+ if (entry.type === "assistant") {
100
+ const stop = entry.message?.stop_reason;
101
+ return typeof stop === "string" && !CONTINUING_STOPS.has(stop);
102
+ }
103
+ if (entry.type === "system" && entry.subtype === "compact_boundary") return true;
104
+ if (entry.type === "user" && entry.isCompactSummary) return true;
105
+ const text = userPromptText(entry)?.trim();
106
+ return text !== void 0 && (INTERRUPTED_PROMPT.test(text) || LOCAL_COMMAND_OUTPUT.test(text));
107
+ }
108
+ function findUnfinishedTurn(lines) {
109
+ let start = -1;
110
+ const prompts = [];
111
+ for (let i = lines.length - 1; i >= 0; i--) {
112
+ let entry;
113
+ try {
114
+ entry = JSON.parse(lines[i]);
115
+ } catch {
116
+ continue;
117
+ }
118
+ if (endsTurn(entry)) break;
119
+ const text = userPromptText(entry);
120
+ if (text === null || typeof entry.uuid !== "string") continue;
121
+ start = i;
122
+ prompts.unshift(text);
123
+ }
124
+ return start < 0 ? null : { start, prompts };
125
+ }
126
+ function conversationOf(lines) {
127
+ let conversation = false;
128
+ let prompt = false;
129
+ for (const line of lines) {
130
+ let entry;
131
+ try {
132
+ entry = JSON.parse(line);
133
+ } catch {
134
+ continue;
135
+ }
136
+ if (entry?.isSidechain || entry?.isMeta || entry?.isSynthetic || entry?.type !== "user" && entry?.type !== "assistant") continue;
137
+ conversation = true;
138
+ const content = entry.message?.content;
139
+ if (entry.type === "user" && (typeof content === "string" || Array.isArray(content) && content.length > 0 && !content.some((block) => block?.type === "tool_result"))) {
140
+ prompt = true;
141
+ }
142
+ }
143
+ return { conversation, prompt };
144
+ }
145
+ async function forkCompletedTurns(projectDir, sourceClaudeSessionId) {
146
+ const src = jsonlPath(projectDir, sourceClaudeSessionId);
147
+ const lines = completeLines(await readSource(src));
148
+ const unfinished = findUnfinishedTurn(lines);
149
+ const kept = unfinished ? lines.slice(0, unfinished.start) : lines;
150
+ const excludedPrompts = unfinished?.prompts ?? [];
151
+ const history = conversationOf(kept);
152
+ if (!history.conversation) return { startFresh: true, excludedPrompts };
153
+ if (!history.prompt) throw new Error("Cannot safely fork: earlier history has no user prompt");
154
+ const newClaudeSessionId = await writeFork(projectDir, kept);
155
+ logger.debug(`[CLAUDE FORK] Forked completed turns of ${sourceClaudeSessionId} -> ${newClaudeSessionId} (${excludedPrompts.length} prompt(s) left out)`);
156
+ return { newClaudeSessionId, excludedPrompts };
157
+ }
69
158
  async function forkAndTruncateSession(projectDir, sourceClaudeSessionId, cutAfterUuid) {
70
159
  const newId = randomUUID();
71
160
  const src = jsonlPath(projectDir, sourceClaudeSessionId);
@@ -156,16 +245,7 @@ async function listClaudeRewindPoints(projectDir, claudeSessionId) {
156
245
  }
157
246
  async function forkBeforeUserMessage(projectDir, sourceClaudeSessionId, cutBeforeUuid) {
158
247
  const src = jsonlPath(projectDir, sourceClaudeSessionId);
159
- let raw;
160
- try {
161
- raw = await readFile(src, "utf-8");
162
- } catch (error) {
163
- if (error.code === "ENOENT") throw new ForkSourceMissingError(src);
164
- throw error;
165
- }
166
- const lines = raw.split("\n");
167
- let hasPreviousConversation = false;
168
- let hasPreviousPrompt = false;
248
+ const lines = completeLines(await readSource(src));
169
249
  let cut = -1;
170
250
  for (let i = 0; i < lines.length; i++) {
171
251
  let entry;
@@ -179,28 +259,13 @@ async function forkBeforeUserMessage(projectDir, sourceClaudeSessionId, cutBefor
179
259
  cut = i;
180
260
  break;
181
261
  }
182
- if (!entry?.isSidechain && !entry?.isMeta && !entry?.isSynthetic && (entry?.type === "user" || entry?.type === "assistant")) {
183
- hasPreviousConversation = true;
184
- const content = entry.message?.content;
185
- if (entry.type === "user" && (typeof content === "string" || Array.isArray(content) && content.length > 0 && !content.some((block) => block?.type === "tool_result"))) {
186
- hasPreviousPrompt = true;
187
- }
188
- }
189
262
  }
190
263
  if (cut < 0) throw new ForkTruncateUuidNotFoundError(cutBeforeUuid, src);
191
- if (!hasPreviousConversation) return null;
192
- if (!hasPreviousPrompt) throw new Error("Cannot safely rewind: earlier history has no user prompt");
193
- const newId = randomUUID();
194
- const destination = jsonlPath(projectDir, newId);
195
- const temporary = `${destination}.tmp-${process.pid}`;
196
- try {
197
- await writeFile(temporary, lines.slice(0, cut).join("\n") + "\n", { encoding: "utf-8", flag: "wx" });
198
- await rename(temporary, destination);
199
- } catch (error) {
200
- await unlink(temporary).catch(() => void 0);
201
- throw error;
202
- }
203
- return newId;
264
+ const kept = lines.slice(0, cut);
265
+ const history = conversationOf(kept);
266
+ if (!history.conversation) return null;
267
+ if (!history.prompt) throw new Error("Cannot safely rewind: earlier history has no user prompt");
268
+ return writeFork(projectDir, kept);
204
269
  }
205
270
 
206
- export { ForkSourceMissingError as F, forkAndTruncateSession as a, ForkTruncateUuidNotFoundError as b, forkBeforeUserMessage as c, discardForkedSession as d, forkSession as f, listClaudeRewindPoints as l };
271
+ export { ForkSourceMissingError as F, forkCompletedTurns as a, forkAndTruncateSession as b, ForkTruncateUuidNotFoundError as c, discardForkedSession as d, forkBeforeUserMessage as e, forkSession as f, listClaudeRewindPoints as l };
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var configuration = require('./configuration-CXEVKAyF.cjs');
4
- var persistence = require('./persistence-B4ttN-fR.cjs');
3
+ var configuration = require('./configuration-2Pbg3a0H.cjs');
4
+ var persistence = require('./persistence-D0gNvqXe.cjs');
5
5
 
6
6
  class AutomationsRequestError extends Error {
7
7
  constructor(status, code, runStatus, invalidFields = []) {
@@ -4,10 +4,10 @@ var node_crypto = require('node:crypto');
4
4
  var node_child_process = require('node:child_process');
5
5
  var node_util = require('node:util');
6
6
  var path = require('node:path');
7
- var index = require('./index-BzAYnYct.cjs');
8
- var configuration = require('./configuration-CXEVKAyF.cjs');
9
- var persistence = require('./persistence-B4ttN-fR.cjs');
10
- var context = require('./context-3_S_mWz9.cjs');
7
+ var index = require('./index-BUFrKZeQ.cjs');
8
+ var configuration = require('./configuration-2Pbg3a0H.cjs');
9
+ var persistence = require('./persistence-D0gNvqXe.cjs');
10
+ var context = require('./context-CLTyu_tQ.cjs');
11
11
 
12
12
  async function teamRequest(path, method, token, scoped, body) {
13
13
  const response = await fetch(`${configuration.configuration.serverUrl}${path}`, {
@@ -1,5 +1,5 @@
1
- import { c as configuration } from './configuration-IhRiLDVe.mjs';
2
- import { b as readCredentialsForConfiguredRelay } from './persistence-DWcHe035.mjs';
1
+ import { c as configuration } from './configuration-rTcdHkhE.mjs';
2
+ import { b as readCredentialsForConfiguredRelay } from './persistence-mr4Y484W.mjs';
3
3
 
4
4
  const UNSUPPORTED_BACKOFF_MS = 10 * 6e4;
5
5
  class ProjectsUnsupportedError extends Error {
@@ -51,6 +51,8 @@ function createProjectsClient(deps = {}) {
51
51
  isDisabled: () => now() < disabledUntil,
52
52
  context: (sessionId, opts = {}, timeoutMs) => request(`/v1/projects/session/${sid(sessionId)}/context?full=${opts.full ? 1 : 0}&peek=${opts.peek ? 1 : 0}`, "GET", void 0, timeoutMs),
53
53
  digest: (sessionId, since, timeoutMs) => request(`/v1/projects/session/${sid(sessionId)}/digest?since=${Math.max(0, Math.floor(since))}`, "GET", void 0, timeoutMs),
54
+ /** B-850d: a project's new-session defaults (spawn --project resolves its account). */
55
+ defaults: (projectId) => request(`/v1/projects/${sid(projectId)}`, "GET").then((r) => r.project.defaults ?? {}),
54
56
  membership: (sessionId) => request(`/v1/projects/session/${sid(sessionId)}`, "GET"),
55
57
  note: (projectId, input) => request(`/v1/projects/${sid(projectId)}/log`, "POST", input),
56
58
  revoke: (projectId, ref, bySessionId) => request(`/v1/projects/${sid(projectId)}/log/${sid(ref)}/revoke`, "POST", { bySessionId }),
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var configuration = require('./configuration-CXEVKAyF.cjs');
4
- var persistence = require('./persistence-B4ttN-fR.cjs');
3
+ var configuration = require('./configuration-2Pbg3a0H.cjs');
4
+ var persistence = require('./persistence-D0gNvqXe.cjs');
5
5
 
6
6
  const UNSUPPORTED_BACKOFF_MS = 10 * 6e4;
7
7
  class ProjectsUnsupportedError extends Error {
@@ -53,6 +53,8 @@ function createProjectsClient(deps = {}) {
53
53
  isDisabled: () => now() < disabledUntil,
54
54
  context: (sessionId, opts = {}, timeoutMs) => request(`/v1/projects/session/${sid(sessionId)}/context?full=${opts.full ? 1 : 0}&peek=${opts.peek ? 1 : 0}`, "GET", void 0, timeoutMs),
55
55
  digest: (sessionId, since, timeoutMs) => request(`/v1/projects/session/${sid(sessionId)}/digest?since=${Math.max(0, Math.floor(since))}`, "GET", void 0, timeoutMs),
56
+ /** B-850d: a project's new-session defaults (spawn --project resolves its account). */
57
+ defaults: (projectId) => request(`/v1/projects/${sid(projectId)}`, "GET").then((r) => r.project.defaults ?? {}),
56
58
  membership: (sessionId) => request(`/v1/projects/session/${sid(sessionId)}`, "GET"),
57
59
  note: (projectId, input) => request(`/v1/projects/${sid(projectId)}/log`, "POST", input),
58
60
  revoke: (projectId, ref, bySessionId) => request(`/v1/projects/${sid(projectId)}/log/${sid(ref)}/revoke`, "POST", { bySessionId }),
@@ -2,10 +2,10 @@ import { randomUUID } from 'node:crypto';
2
2
  import { execFile } from 'node:child_process';
3
3
  import { promisify } from 'node:util';
4
4
  import { basename, dirname } from 'node:path';
5
- import { f as isInsideTeamWorktree, g as rebaseTeamWorktreePath } from './index-DYD3GM1m.mjs';
6
- import { c as configuration } from './configuration-IhRiLDVe.mjs';
7
- import { r as readSettings, c as readPersistedSessions, b as readCredentialsForConfiguredRelay } from './persistence-DWcHe035.mjs';
8
- import { r as readTeamScope, t as teamScopePath, w as writeTeamScope } from './context-DO6F5YwH.mjs';
5
+ import { f as isInsideTeamWorktree, g as rebaseTeamWorktreePath } from './index-D1YnIih6.mjs';
6
+ import { c as configuration } from './configuration-rTcdHkhE.mjs';
7
+ import { r as readSettings, c as readPersistedSessions, b as readCredentialsForConfiguredRelay } from './persistence-mr4Y484W.mjs';
8
+ import { r as readTeamScope, t as teamScopePath, w as writeTeamScope } from './context-C7QarZMk.mjs';
9
9
 
10
10
  async function teamRequest(path, method, token, scoped, body) {
11
11
  const response = await fetch(`${configuration.serverUrl}${path}`, {
@@ -1,5 +1,5 @@
1
- import { c as configuration } from './configuration-IhRiLDVe.mjs';
2
- import { b as readCredentialsForConfiguredRelay, r as readSettings } from './persistence-DWcHe035.mjs';
1
+ import { c as configuration } from './configuration-rTcdHkhE.mjs';
2
+ import { b as readCredentialsForConfiguredRelay, r as readSettings } from './persistence-mr4Y484W.mjs';
3
3
 
4
4
  class AutomationsRequestError extends Error {
5
5
  constructor(status, code, runStatus, invalidFields = []) {