very-happy-cli 0.2.203 → 0.2.204

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 (222) hide show
  1. package/dist/{AcpBackend-CAMuhS0Z.mjs → AcpBackend-BBfcpIDj.mjs} +3 -3
  2. package/dist/{AcpBackend-DReFgpYD.cjs → AcpBackend-BupxHXGp.cjs} +3 -3
  3. package/dist/{AcpSessionManager-CJOxMFCF.mjs → AcpSessionManager-B9UkPYGi.mjs} +2 -2
  4. package/dist/{AcpSessionManager-BZKM-sCt.cjs → AcpSessionManager-JJrnenKM.cjs} +2 -2
  5. package/dist/{BasePermissionHandler-BBR9Gkob.cjs → BasePermissionHandler-86_xnisC.cjs} +1 -1
  6. package/dist/{BasePermissionHandler-BgX73mQ5.mjs → BasePermissionHandler-tGylJLUH.mjs} +1 -1
  7. package/dist/{account-hy0rztXY.mjs → account-BRqUOj_D.mjs} +11 -11
  8. package/dist/{account-41PkJ9nx.cjs → account-C91_R-kw.cjs} +11 -11
  9. package/dist/{accountService-DEpIq6CF.mjs → accountService-CqrWNH8K.mjs} +4 -4
  10. package/dist/{accountService-Cns8UYGI.cjs → accountService-SOeB_21A.cjs} +4 -4
  11. package/dist/{acpSessionResume-5El4xksf.mjs → acpSessionResume-CZQ91ano.mjs} +1 -1
  12. package/dist/{acpSessionResume-DmOPXKpC.cjs → acpSessionResume-DK8EjIY0.cjs} +1 -1
  13. package/dist/{agentHome-DUxArmak.mjs → agentHome-71zGywwx.mjs} +4 -4
  14. package/dist/{agentHome-BXaVMqHX.cjs → agentHome-BZvbPuy1.cjs} +4 -4
  15. package/dist/{api-D8ZDxBWw.mjs → api-BYh1VGBa.mjs} +107 -18
  16. package/dist/{api-ChhFBuB0.cjs → api-BoJA-zK3.cjs} +107 -18
  17. package/dist/{apiMachine-qav2pnk5.mjs → apiMachine--_eI4PTv.mjs} +105 -21
  18. package/dist/{apiMachine-MPwddFXq.cjs → apiMachine-CA58NM_V.cjs} +105 -21
  19. package/dist/{attachmentContent-BfSQxccA.mjs → attachmentContent-D95cCBX5.mjs} +2 -2
  20. package/dist/{attachmentContent-f5gwnv9J.cjs → attachmentContent-y621KwMz.cjs} +2 -2
  21. package/dist/{auth-thi2T_T8.cjs → auth-CAkpHr8F.cjs} +5 -5
  22. package/dist/{auth-BxNuFv_0.mjs → auth-DCzFx5BN.mjs} +8 -8
  23. package/dist/{auth-xW7SDE_7.mjs → auth-DRJ_WPn3.mjs} +5 -5
  24. package/dist/{auth-DkPAHXLj.cjs → auth-Dofm64Kp.cjs} +8 -8
  25. package/dist/{auto-DmXTwayU.mjs → auto-CrgOy5OR.mjs} +18 -18
  26. package/dist/{auto-BiRlQ4tm.cjs → auto-D4IBwJEE.cjs} +18 -18
  27. package/dist/{bootstrap-EGhaCmXy.cjs → bootstrap-D16MMPNP.cjs} +2 -2
  28. package/dist/{bootstrap-pGaFGbWO.mjs → bootstrap-PnL2FX64.mjs} +2 -2
  29. package/dist/{browser-BYSYzXvP.mjs → browser-D2enJJfv.mjs} +1 -1
  30. package/dist/{browser-DSxpOnPb.cjs → browser-DK2GfyEr.cjs} +1 -1
  31. package/dist/{claudeAccountEnv-Btp39mfa.cjs → claudeAccountEnv-BTZjHTpF.cjs} +1 -1
  32. package/dist/{claudeAccountEnv-DowsOlDB.mjs → claudeAccountEnv-C6Wl-ZbT.mjs} +1 -1
  33. package/dist/{claudeLocal-bDarWqaU.mjs → claudeLocal-BbzN1qly.mjs} +5 -5
  34. package/dist/{claudeLocal-ClqHmkk6.cjs → claudeLocal-DaqiRW9N.cjs} +5 -5
  35. package/dist/{claudeLocalLauncher-Bxi0_eW9.cjs → claudeLocalLauncher-B0qbyOUc.cjs} +10 -10
  36. package/dist/{claudeLocalLauncher-Ccpj2KgW.mjs → claudeLocalLauncher-D7bhZ9rp.mjs} +10 -10
  37. package/dist/claudeLongContext-BR_zdjUp.cjs +239 -0
  38. package/dist/claudeLongContext-CZ60xo5p.mjs +219 -0
  39. package/dist/{claudeSessionFork-Cize0Y2T.mjs → claudeSessionFork-BPF3cpGs.mjs} +1 -1
  40. package/dist/{claudeSessionFork-nyNFjgaf.cjs → claudeSessionFork-lcajftLB.cjs} +1 -1
  41. package/dist/{client-DO8DNDC3.mjs → client-BH4s6mzX.mjs} +2 -2
  42. package/dist/{client-CgMVIP7v.mjs → client-BHt14nix.mjs} +2 -2
  43. package/dist/{client-DP8FabOE.cjs → client-ByK8-iRd.cjs} +3 -3
  44. package/dist/{client-Cddb1dhi.cjs → client-CqmT_ur8.cjs} +2 -2
  45. package/dist/{client-6Y6O72Uq.cjs → client-D5_YDMpA.cjs} +2 -2
  46. package/dist/{client-Wr_BiOon.mjs → client-Og5iNZ6S.mjs} +16 -7
  47. package/dist/{client-CX8kRedW.mjs → client-t1vQ7gho.mjs} +3 -3
  48. package/dist/{client-CMKgB-76.cjs → client-xA44FUnf.cjs} +16 -7
  49. package/dist/codex/happyMcpStdioBridge.cjs +20 -19
  50. package/dist/codex/happyMcpStdioBridge.mjs +20 -19
  51. package/dist/{codexAccount-CieIQLOX.mjs → codexAccount-BPQ-lPhH.mjs} +1 -1
  52. package/dist/{codexAccount-D-OBY29W.cjs → codexAccount-BjaHvmKH.cjs} +1 -1
  53. package/dist/{codexAppServerClient-D-cD2Dfj.mjs → codexAppServerClient-CvL3eBlM.mjs} +3 -3
  54. package/dist/{codexAppServerClient-EzrHWYhX.cjs → codexAppServerClient-CyLtj1kP.cjs} +3 -3
  55. package/dist/{codexCommand-BMcXtvU3.cjs → codexCommand-B0Slfvne.cjs} +67 -56
  56. package/dist/{codexCommand-D79GnRhB.mjs → codexCommand-CXytYlk9.mjs} +67 -56
  57. package/dist/{codexTermination-CF6xiFbb.cjs → codexTermination-CykPnK3G.cjs} +1 -1
  58. package/dist/{codexTermination-CK1MYJT7.mjs → codexTermination-D0sBaTvW.mjs} +1 -1
  59. package/dist/{config-F6zSRyk2.cjs → config-7Z5qIB3k.cjs} +3 -3
  60. package/dist/{config-Crn1mNgr.mjs → config-DeXK_5y4.mjs} +3 -3
  61. package/dist/{configuration-Cl9kOv09.cjs → configuration-CDqmWkHO.cjs} +1 -1
  62. package/dist/{configuration-i9MVy0a5.mjs → configuration-D_YrWa_i.mjs} +1 -1
  63. package/dist/{connect-CiA13Xm4.mjs → connect-CivOym_v.mjs} +13 -13
  64. package/dist/{connect-ClklWmnI.cjs → connect-D_tzdR4l.cjs} +13 -13
  65. package/dist/{context-DvdZsGgl.mjs → context-DXfkj_FL.mjs} +1 -1
  66. package/dist/{context-BxODP3mG.cjs → context-k2CbuBtp.cjs} +1 -1
  67. package/dist/{controlClient-DxCQKfqe.cjs → controlClient-BS86Ksm8.cjs} +12 -3
  68. package/dist/{controlClient-D6vqMUfi.mjs → controlClient-Daki7wgo.mjs} +12 -4
  69. package/dist/{createSessionMetadata-B_NZvmhm.cjs → createSessionMetadata-2s80RDL1.cjs} +2 -2
  70. package/dist/{createSessionMetadata-BuAVB-xI.mjs → createSessionMetadata-B_hQ8lDn.mjs} +2 -2
  71. package/dist/{daemonAccounts-ciidbU2h.cjs → daemonAccounts-BOoI7-sw.cjs} +2 -2
  72. package/dist/{daemonAccounts-D5shoCLt.mjs → daemonAccounts-BtkmoJmC.mjs} +3 -3
  73. package/dist/{defaultPermissionMode-DgeiMMqy.mjs → defaultPermissionMode-CYQi7vqJ.mjs} +1 -1
  74. package/dist/{defaultPermissionMode-Cs_Tv83b.cjs → defaultPermissionMode-DmLYaaL8.cjs} +1 -1
  75. package/dist/{deterministicJson-B9XrEawW.mjs → deterministicJson-DKiOtrSA.mjs} +23 -16
  76. package/dist/{deterministicJson-kM2OdGZu.cjs → deterministicJson-lwG_VzWd.cjs} +23 -16
  77. package/dist/{doctor-DiPRqsqg.cjs → doctor-C0kONAQn.cjs} +7 -7
  78. package/dist/{doctor-HHS4YegX.mjs → doctor-DegBfYjz.mjs} +7 -7
  79. package/dist/{downloadTarget-osB-mGh0.cjs → downloadTarget-BTEVg8t6.cjs} +6 -6
  80. package/dist/{downloadTarget-Cd8hx54t.mjs → downloadTarget-osakJyyA.mjs} +6 -6
  81. package/dist/{ensureDaemonRunning-C0iDtuL7.mjs → ensureDaemonRunning-ED6UVEbk.mjs} +5 -5
  82. package/dist/{ensureDaemonRunning-CtBvPHVB.cjs → ensureDaemonRunning-vxHxmXo2.cjs} +5 -5
  83. package/dist/exitNotice-BhRrv8dx.cjs +88 -0
  84. package/dist/exitNotice-D1tMULzu.mjs +79 -0
  85. package/dist/{forkBackfill-DYIjlN1Z.mjs → forkBackfill-C9EfJ64O.mjs} +28 -2
  86. package/dist/{forkBackfill-8eLDeS73.cjs → forkBackfill-D2WW91fz.cjs} +28 -1
  87. package/dist/{format-B5V7ie8N.cjs → format-9KvRMdvY.cjs} +1 -1
  88. package/dist/{format-Dc5zMslz.mjs → format-DJwRUrQm.mjs} +1 -1
  89. package/dist/{handleResumeCommand-vcD2qcAM.cjs → handleResumeCommand-0lsgLgBB.cjs} +5 -5
  90. package/dist/{handleResumeCommand-xrOAA1qI.mjs → handleResumeCommand-PfKmR-hv.mjs} +5 -5
  91. package/dist/{index-iFVMrlPo.mjs → index-BNcFxRSt.mjs} +4 -4
  92. package/dist/{index-44o_qMvE.cjs → index-BYL_X3gP.cjs} +27 -6
  93. package/dist/{index-AyDwQ6FG.cjs → index-B_narjYR.cjs} +45 -44
  94. package/dist/{index-Cl-WkB_6.cjs → index-Bm_9wBaO.cjs} +4 -4
  95. package/dist/{index-C_ePuQwB.cjs → index-C7yXrMau.cjs} +3 -3
  96. package/dist/{index-B7pKBIcn.mjs → index-CUJZx4cs.mjs} +3 -3
  97. package/dist/{index-DIKJMfs2.mjs → index-CUeuMsap.mjs} +4 -4
  98. package/dist/{index-B7CXMlrz.mjs → index-D1rxFJ2b.mjs} +46 -45
  99. package/dist/{index-CiRMvS73.mjs → index-DWk-WTU-.mjs} +24 -7
  100. package/dist/{index-D0rCXp-e.cjs → index-l8Xg3Mbf.cjs} +4 -4
  101. package/dist/index.cjs +2 -2
  102. package/dist/index.mjs +2 -2
  103. package/dist/{install-yqS4y1cm.mjs → install-B593oYZs.mjs} +3 -3
  104. package/dist/{install-BgBgsOlS.cjs → install-C0I1a5sL.cjs} +3 -3
  105. package/dist/{issue-D7liK6bR.cjs → issue-CJrXCpnf.cjs} +8 -8
  106. package/dist/{issue-aKZd7J55.mjs → issue-D9ukoK-U.mjs} +8 -8
  107. package/dist/lib.cjs +12 -12
  108. package/dist/lib.d.cts +42 -1
  109. package/dist/lib.d.mts +42 -1
  110. package/dist/lib.mjs +12 -12
  111. package/dist/{localHappyAgentAuth-B2JJxlE9.mjs → localHappyAgentAuth-CxNcSjMM.mjs} +1 -1
  112. package/dist/{localHappyAgentAuth-Dm9obisi.cjs → localHappyAgentAuth-D3GKuEC2.cjs} +1 -1
  113. package/dist/{logger-BiKmiREe.mjs → logger-BcdURxNR.mjs} +2 -2
  114. package/dist/{logger-BtWBoP60.cjs → logger-C8anCmdW.cjs} +2 -2
  115. package/dist/{machineMetadata-CiyO9wm-.mjs → machineMetadata-BQaQQk6Z.mjs} +3 -3
  116. package/dist/{machineMetadata-C0-LyMsb.cjs → machineMetadata-DYWtdEtE.cjs} +3 -3
  117. package/dist/{main-C7hKf5hG.cjs → main-Bw7qSCWA.cjs} +48 -48
  118. package/dist/{main-BP2TBnp5.mjs → main-KsUdHnwc.mjs} +48 -48
  119. package/dist/{mcp-DO00rr9n.cjs → mcp-CxPUFOEd.cjs} +20 -18
  120. package/dist/{mcp-Cn4k-PXb.mjs → mcp-OeLaQ2XR.mjs} +20 -18
  121. package/dist/{mirrorProtocol-DDtEN49F.mjs → mirrorProtocol-Sj0yEHHU.mjs} +3 -3
  122. package/dist/{mirrorProtocol-DwO8QgLM.cjs → mirrorProtocol-cTQcrW55.cjs} +3 -3
  123. package/dist/{package-Djdgx8nb.cjs → package-DkpXQvp1.cjs} +7 -7
  124. package/dist/{package-CIW5lwaN.mjs → package-Dx3hbh9J.mjs} +7 -7
  125. package/dist/{panels-DMLtEOtJ.cjs → panels-CPNZnwCH.cjs} +5 -5
  126. package/dist/{panels-BpfVEvwF.mjs → panels-DKYO14Sq.mjs} +5 -5
  127. package/dist/{peerTools-CQ60fUPp.mjs → peerTools-DYFslv6R.mjs} +5 -5
  128. package/dist/{peerTools-fYuKq3ev.cjs → peerTools-DpCWFxI6.cjs} +5 -5
  129. package/dist/{persistence-D_zVC4Xz.mjs → persistence-3iZXGbfb.mjs} +2 -2
  130. package/dist/{persistence-BOEZtiKb.cjs → persistence-Ch78xygf.cjs} +2 -2
  131. package/dist/{piRunnerArgs-Dz9P62db.cjs → piRunnerArgs-CA6jqQ0k.cjs} +1 -1
  132. package/dist/{piRunnerArgs-DE_YXvS1.mjs → piRunnerArgs-DEuYl6FL.mjs} +1 -1
  133. package/dist/{piRuntime-Du62fjeU.cjs → piRuntime-BIVHf-hN.cjs} +1 -1
  134. package/dist/{piRuntime-8SbpRmNA.mjs → piRuntime-CyN43ILm.mjs} +1 -1
  135. package/dist/{piTerminal-Cl45kac0.mjs → piTerminal-DXz5L73L.mjs} +22 -20
  136. package/dist/{piTerminal-CGAw7WDW.cjs → piTerminal-Hw4StZWN.cjs} +22 -20
  137. package/dist/{pushNotifications-B19lT5mY.cjs → pushNotifications-D2ejrxlN.cjs} +17 -3
  138. package/dist/{pushNotifications-RVpbqrxR.mjs → pushNotifications-Db1NGJiA.mjs} +17 -3
  139. package/dist/{query-DBRR3TOO.mjs → query-CeYpZWVb.mjs} +1 -1
  140. package/dist/{query-CNWdX2r5.cjs → query-velpFYxW.cjs} +1 -1
  141. package/dist/{rateLimitWindows-DX5y23x_.mjs → rateLimitWindows-BSQttrPk.mjs} +1 -1
  142. package/dist/{rateLimitWindows-mfdokrkQ.cjs → rateLimitWindows-C78D8Uf-.cjs} +1 -1
  143. package/dist/{reconnectGate-DSxYUCWy.mjs → reconnectGate-Ie4nSKNl.mjs} +1 -1
  144. package/dist/{reconnectGate-B8ltzSJD.cjs → reconnectGate-S9yNiuY7.cjs} +1 -1
  145. package/dist/{registerCommonHandlers-Y2siJGwL.cjs → registerCommonHandlers-51llVpLx.cjs} +2 -2
  146. package/dist/{registerCommonHandlers-CQDRKlkG.mjs → registerCommonHandlers-BR7BeGX3.mjs} +2 -2
  147. package/dist/{registerKillSessionHandler-B0pMZOdH.cjs → registerKillSessionHandler-BjY79qBi.cjs} +6 -6
  148. package/dist/{registerKillSessionHandler-U4Dxtohy.mjs → registerKillSessionHandler-RbWPmKnK.mjs} +6 -6
  149. package/dist/{registerSideQuestionHandler--ruKhCdY.cjs → registerSideQuestionHandler-B1Xk7dFK.cjs} +4 -4
  150. package/dist/{registerSideQuestionHandler-DM1QqTxf.mjs → registerSideQuestionHandler-BbYT7QfR.mjs} +4 -4
  151. package/dist/{remoteSessionClient-T-Raoiy6.mjs → remoteSessionClient-Ddns3U8M.mjs} +5 -5
  152. package/dist/{remoteSessionClient-CjINaEs_.cjs → remoteSessionClient-r-UnqHor.cjs} +5 -5
  153. package/dist/{reportProgressTool-DDfL1OY7.cjs → reportProgressTool-ByadxJtc.cjs} +5 -5
  154. package/dist/{reportProgressTool-Stg0xrjF.mjs → reportProgressTool-C3sf9D8m.mjs} +5 -5
  155. package/dist/{run-Dq48xBtw.mjs → run-jsINwBOz.mjs} +200 -55
  156. package/dist/{run-BoSVfVCZ.cjs → run-r5sY3wHk.cjs} +200 -55
  157. package/dist/{runClaude-D8ScJdJU.cjs → runClaude-CRKsRfnq.cjs} +53 -38
  158. package/dist/{runClaude-CJe5atrS.mjs → runClaude-D8CuiZhi.mjs} +44 -29
  159. package/dist/{runClaudeDeps-4RFRR4cY.cjs → runClaudeDeps-BiVzNIE6.cjs} +129 -61
  160. package/dist/{runClaudeDeps-CL3goCXG.mjs → runClaudeDeps-CUuPWcg9.mjs} +125 -57
  161. package/dist/{runGemini-BcbNxgsA.cjs → runGemini-DANnc0BW.cjs} +36 -35
  162. package/dist/{runGemini-DZv6jPxV.mjs → runGemini-cqVZjPT6.mjs} +36 -35
  163. package/dist/{runOpenClaw-CRqCoj-_.mjs → runOpenClaw-B6V2nz8J.mjs} +18 -18
  164. package/dist/{runOpenClaw-BeSivE0X.cjs → runOpenClaw-CGwc6mfJ.cjs} +18 -18
  165. package/dist/{sandbox-xflHChws.cjs → sandbox-CNheYPva.cjs} +4 -4
  166. package/dist/{sandbox-DAvJJZcV.mjs → sandbox-JYBMckKE.mjs} +4 -4
  167. package/dist/{selfCheck-DZwdgBg0.cjs → selfCheck-DtSEBt0g.cjs} +40 -40
  168. package/dist/selfCheck-Jjy_wMw3.mjs +89 -0
  169. package/dist/{send-Co_l_Nmg.mjs → send-BHrbbGJ7.mjs} +8 -8
  170. package/dist/{send-ConAuYqL.cjs → send-DNdJR3n8.cjs} +8 -8
  171. package/dist/{server-by6kezmM.cjs → server-CvP_b3eb.cjs} +6 -6
  172. package/dist/{server-D1Qrmxl7.mjs → server-DhQjVsyZ.mjs} +4 -4
  173. package/dist/{sessionLock-DFrwAnwR.mjs → sessionLock-5i516L-w.mjs} +21 -4
  174. package/dist/{sessionLock-Db_uQcUP.cjs → sessionLock-UkF8M3j5.cjs} +22 -3
  175. package/dist/{sessionOps-CptDjoZi.cjs → sessionOps-D77IeFSt.cjs} +4 -4
  176. package/dist/{sessionOps-C7nps7qG.mjs → sessionOps-DX49XNAT.mjs} +4 -4
  177. package/dist/{sessionProvider-BaJq1AnY.mjs → sessionProvider-C5xW4Dt3.mjs} +10 -10
  178. package/dist/{sessionProvider-D9nsAE14.cjs → sessionProvider-mSI2UgLX.cjs} +10 -10
  179. package/dist/{sessionScanner-C6OVO0Ne.cjs → sessionScanner-B1Am8D4Y.cjs} +3 -3
  180. package/dist/{sessionScanner-BOb33NVJ.mjs → sessionScanner-BZkOnp5a.mjs} +3 -3
  181. package/dist/{sessions-GCql_3Dl.mjs → sessions-ClQFpjcA.mjs} +10 -10
  182. package/dist/{sessions-qVHDXJa6.cjs → sessions-DDDEiHVR.cjs} +10 -10
  183. package/dist/{setupOfflineReconnection-B8QKqc9a.cjs → setupOfflineReconnection-Cn2_vuvO.cjs} +2 -2
  184. package/dist/{setupOfflineReconnection-lu0YbS7m.mjs → setupOfflineReconnection-PjK9laDd.mjs} +2 -2
  185. package/dist/{spawn-C9NSlg99.mjs → spawn-BJGaxdot.mjs} +15 -15
  186. package/dist/{spawn-tL-724RS.cjs → spawn-DOj-sY6W.cjs} +15 -15
  187. package/dist/{spawnAgents-BclZYkov.mjs → spawnAgents-CcFKtKdX.mjs} +2 -1
  188. package/dist/{spawnAgents-DvbEDCIq.cjs → spawnAgents-D4lR468W.cjs} +2 -1
  189. package/dist/{spawnHappyCLI-jXUKLUT5.mjs → spawnHappyCLI-CpOMz9hX.mjs} +1 -1
  190. package/dist/{spawnHappyCLI-D7EO8s4E.cjs → spawnHappyCLI-DvxZ7elP.cjs} +1 -1
  191. package/dist/{startFileWatcher-6NpLGxg5.cjs → startFileWatcher-1ar7WS96.cjs} +1 -1
  192. package/dist/{startFileWatcher-C7eFs4hA.mjs → startFileWatcher-CPbPNFGY.mjs} +1 -1
  193. package/dist/{startupSessionCreate-C5wdvraY.cjs → startupSessionCreate-COc5Nnr9.cjs} +3 -3
  194. package/dist/{startupSessionCreate-D3ph1DtL.mjs → startupSessionCreate-CnVaUZ16.mjs} +3 -3
  195. package/dist/{store-Cpb1LMNW.cjs → store-DGMILdMn.cjs} +1 -1
  196. package/dist/{store-DWmjM4Ex.mjs → store-Fge1h9wy.mjs} +1 -1
  197. package/dist/{streamRelay-DdGOsW8v.mjs → streamRelay-MaaYNNuh.mjs} +1 -1
  198. package/dist/{streamRelay-4XiiNB3N.cjs → streamRelay-keuifCPQ.cjs} +1 -1
  199. package/dist/{sync-BIXH8ijr.mjs → sync-BZji3J2r.mjs} +1 -1
  200. package/dist/{sync-ni64k2OI.cjs → sync-DzInYE_l.cjs} +1 -1
  201. package/dist/{systemPrompt-DuoULaqr.cjs → systemPrompt-CvpjNmQL.cjs} +2 -2
  202. package/dist/{systemPrompt-B_vnlIr1.mjs → systemPrompt-Dhdq8hGf.mjs} +2 -2
  203. package/dist/{teams-DLfcbOMh.cjs → teams-CRCbDPob.cjs} +20 -9
  204. package/dist/{teams-CsR_8p3Q.mjs → teams-CVW4ZvmW.mjs} +20 -9
  205. package/dist/{template-3fV9bi0X.cjs → template-ChUotPTL.cjs} +1 -1
  206. package/dist/{template-CtRLg2PG.mjs → template-D8fzlO58.mjs} +1 -1
  207. package/dist/{time-Che8GhII.mjs → time-BWVJTcWI.mjs} +1 -1
  208. package/dist/{time-BMCY7zJL.cjs → time-UUMqbIq8.cjs} +1 -1
  209. package/dist/{titleGenerator-HVEN1e7o.cjs → titleGenerator-BHOA2Wkx.cjs} +3 -3
  210. package/dist/{titleGenerator-B9LckLDq.mjs → titleGenerator-Ck82YoB7.mjs} +2 -2
  211. package/dist/{todo-bc7db5NN.mjs → todo-Cf52TlmX.mjs} +8 -8
  212. package/dist/{todo-B8byb_cy.cjs → todo-Cwo7joub.cjs} +8 -8
  213. package/dist/{tools--RN1SFkD.cjs → tools-DEErCtZG.cjs} +1 -1
  214. package/dist/{tools-BAMaBbbP.mjs → tools-DmNaOlUF.mjs} +1 -1
  215. package/dist/{uninstall-Dv4C-W9z.mjs → uninstall-B85MiNK2.mjs} +3 -3
  216. package/dist/{uninstall-UC0Q8YTj.cjs → uninstall-CoAK4ANz.cjs} +3 -3
  217. package/dist/{wrapperAccount-nGGMJDBF.cjs → wrapperAccount-BHMM9I6g.cjs} +2 -2
  218. package/dist/{wrapperAccount-z8Swrd08.mjs → wrapperAccount-CwaA-n1S.mjs} +2 -2
  219. package/package.json +7 -7
  220. package/dist/permissionMode-CH4FoZfU.mjs +0 -80
  221. package/dist/permissionMode-CrV-XuMs.cjs +0 -87
  222. package/dist/selfCheck-BKOIROoJ.mjs +0 -89
@@ -1,11 +1,11 @@
1
1
  import { spawn } from 'node:child_process';
2
2
  import { ndJsonStream, ClientSideConnection } from '@agentclientprotocol/sdk';
3
3
  import { randomUUID } from 'node:crypto';
4
- import { l as logger } from './logger-BiKmiREe.mjs';
5
- import { d as delay } from './time-Che8GhII.mjs';
4
+ import { l as logger } from './logger-BcdURxNR.mjs';
5
+ import { d as delay } from './time-BWVJTcWI.mjs';
6
6
  import { c as contentLogMetadata, e as errorLogMetadata } from './contentLogMetadata-BlWI0egu.mjs';
7
7
  import { r as readableStderrTail, a as appendStderrRing, s as stopProcessGracefully, k as killProcessTree } from './processTree-CP5IvQ2Z.mjs';
8
- import { p as packageJson } from './package-CIW5lwaN.mjs';
8
+ import { p as packageJson } from './package-Dx3hbh9J.mjs';
9
9
 
10
10
  function acpImageBlocks(attachments, supportsImages) {
11
11
  return attachments.filter((file) => ["image/jpeg", "image/png", "image/gif", "image/webp"].includes(file.mimeType)).map((file) => {
@@ -3,11 +3,11 @@
3
3
  var node_child_process = require('node:child_process');
4
4
  var sdk = require('@agentclientprotocol/sdk');
5
5
  var node_crypto = require('node:crypto');
6
- var logger = require('./logger-BtWBoP60.cjs');
7
- var time = require('./time-BMCY7zJL.cjs');
6
+ var logger = require('./logger-C8anCmdW.cjs');
7
+ var time = require('./time-UUMqbIq8.cjs');
8
8
  var contentLogMetadata = require('./contentLogMetadata-ZSFk_NjQ.cjs');
9
9
  var processTree = require('./processTree-CMHWlVse.cjs');
10
- var _package = require('./package-Djdgx8nb.cjs');
10
+ var _package = require('./package-DkpXQvp1.cjs');
11
11
 
12
12
  function acpImageBlocks(attachments, supportsImages) {
13
13
  return attachments.filter((file) => ["image/jpeg", "image/png", "image/gif", "image/webp"].includes(file.mimeType)).map((file) => {
@@ -1,6 +1,6 @@
1
1
  import { createId } from '@paralleldrive/cuid2';
2
- import { s as streamKeyOf, t as createEnvelope } from './index-CiRMvS73.mjs';
3
- import { t as textResultPayload, b as toolResultPayload } from './api-D8ZDxBWw.mjs';
2
+ import { s as streamKeyOf, t as createEnvelope } from './index-DWk-WTU-.mjs';
3
+ import { t as textResultPayload, b as toolResultPayload } from './api-BYh1VGBa.mjs';
4
4
 
5
5
  function turnOptions(turnId, time) {
6
6
  return turnId ? { turn: turnId, time } : { time };
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var cuid2 = require('@paralleldrive/cuid2');
4
- var index = require('./index-44o_qMvE.cjs');
5
- var api = require('./api-ChhFBuB0.cjs');
4
+ var index = require('./index-BYL_X3gP.cjs');
5
+ var api = require('./api-BoJA-zK3.cjs');
6
6
 
7
7
  function turnOptions(turnId, time) {
8
8
  return turnId ? { turn: turnId, time } : { time };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var logger = require('./logger-BtWBoP60.cjs');
3
+ var logger = require('./logger-C8anCmdW.cjs');
4
4
 
5
5
  class BasePermissionHandler {
6
6
  pendingRequests = /* @__PURE__ */ new Map();
@@ -1,4 +1,4 @@
1
- import { l as logger } from './logger-BiKmiREe.mjs';
1
+ import { l as logger } from './logger-BcdURxNR.mjs';
2
2
 
3
3
  class BasePermissionHandler {
4
4
  pendingRequests = /* @__PURE__ */ new Map();
@@ -1,26 +1,26 @@
1
1
  import chalk from 'chalk';
2
2
  import { createInterface } from 'node:readline/promises';
3
- import { c as configuration } from './configuration-i9MVy0a5.mjs';
4
- import { g as getDaemonAgentProfiles, r as restartDaemonSession, l as listDaemonSessions } from './controlClient-D6vqMUfi.mjs';
5
- import { A as AccountService, b as bindResultMessages, a as AccountError, l as localRestartFailure } from './accountService-DEpIq6CF.mjs';
3
+ import { c as configuration } from './configuration-D_YrWa_i.mjs';
4
+ import { g as getDaemonAgentProfiles, r as restartDaemonSession, l as listDaemonSessions } from './controlClient-Daki7wgo.mjs';
5
+ import { A as AccountService, b as bindResultMessages, a as AccountError, l as localRestartFailure } from './accountService-CqrWNH8K.mjs';
6
6
  import 'node:fs';
7
7
  import 'node:os';
8
8
  import 'node:path';
9
- import './package-CIW5lwaN.mjs';
9
+ import './package-Dx3hbh9J.mjs';
10
10
  import 'node:fs/promises';
11
- import './logger-BiKmiREe.mjs';
11
+ import './logger-BcdURxNR.mjs';
12
12
  import 'node:util';
13
- import './persistence-D_zVC4Xz.mjs';
13
+ import './persistence-3iZXGbfb.mjs';
14
14
  import 'zod';
15
15
  import './authRelay-DhQhkBvX.mjs';
16
16
  import 'node:crypto';
17
17
  import 'tweetnacl';
18
- import './index-CiRMvS73.mjs';
18
+ import './index-DWk-WTU-.mjs';
19
19
  import '@paralleldrive/cuid2';
20
20
  import 'node:child_process';
21
- import './claudeAccountEnv-DowsOlDB.mjs';
22
- import './store-DWmjM4Ex.mjs';
23
- import './codexAccount-CieIQLOX.mjs';
21
+ import './claudeAccountEnv-C6Wl-ZbT.mjs';
22
+ import './store-Fge1h9wy.mjs';
23
+ import './codexAccount-BPQ-lPhH.mjs';
24
24
  import 'node:readline';
25
25
 
26
26
  const ACCOUNT_HELP = `Usage:
@@ -183,7 +183,7 @@ Waiting (expires in 15 minutes; Ctrl-C to cancel)\u2026`);
183
183
  }
184
184
  }
185
185
  async function loginInteractive(target) {
186
- const { spawnSetupTokenPty } = await import('./daemonAccounts-D5shoCLt.mjs');
186
+ const { spawnSetupTokenPty } = await import('./daemonAccounts-BtkmoJmC.mjs');
187
187
  const { homedir } = await import('node:os');
188
188
  const svc = new AccountService({ home: configuration.happyHomeDir, spawnPty: (env) => spawnSetupTokenPty(homedir(), env) });
189
189
  const started = await svc.loginStart({ agent: "claude", kind: "claude-subscription", ...target });
@@ -2,27 +2,27 @@
2
2
 
3
3
  var chalk = require('chalk');
4
4
  var promises = require('node:readline/promises');
5
- var configuration = require('./configuration-Cl9kOv09.cjs');
6
- var controlClient = require('./controlClient-DxCQKfqe.cjs');
7
- var accountService = require('./accountService-Cns8UYGI.cjs');
5
+ var configuration = require('./configuration-CDqmWkHO.cjs');
6
+ var controlClient = require('./controlClient-BS86Ksm8.cjs');
7
+ var accountService = require('./accountService-SOeB_21A.cjs');
8
8
  require('node:fs');
9
9
  require('node:os');
10
10
  require('node:path');
11
- require('./package-Djdgx8nb.cjs');
11
+ require('./package-DkpXQvp1.cjs');
12
12
  require('node:fs/promises');
13
- require('./logger-BtWBoP60.cjs');
13
+ require('./logger-C8anCmdW.cjs');
14
14
  require('node:util');
15
- require('./persistence-BOEZtiKb.cjs');
15
+ require('./persistence-Ch78xygf.cjs');
16
16
  require('zod');
17
17
  require('./authRelay-Dy1qU9td.cjs');
18
18
  require('node:crypto');
19
19
  require('tweetnacl');
20
- require('./index-44o_qMvE.cjs');
20
+ require('./index-BYL_X3gP.cjs');
21
21
  require('@paralleldrive/cuid2');
22
22
  require('node:child_process');
23
- require('./claudeAccountEnv-Btp39mfa.cjs');
24
- require('./store-Cpb1LMNW.cjs');
25
- require('./codexAccount-D-OBY29W.cjs');
23
+ require('./claudeAccountEnv-BTZjHTpF.cjs');
24
+ require('./store-DGMILdMn.cjs');
25
+ require('./codexAccount-BjaHvmKH.cjs');
26
26
  require('node:readline');
27
27
 
28
28
  const ACCOUNT_HELP = `Usage:
@@ -185,7 +185,7 @@ Waiting (expires in 15 minutes; Ctrl-C to cancel)\u2026`);
185
185
  }
186
186
  }
187
187
  async function loginInteractive(target) {
188
- const { spawnSetupTokenPty } = await Promise.resolve().then(function () { return require('./daemonAccounts-ciidbU2h.cjs'); });
188
+ const { spawnSetupTokenPty } = await Promise.resolve().then(function () { return require('./daemonAccounts-BOoI7-sw.cjs'); });
189
189
  const { homedir } = await import('node:os');
190
190
  const svc = new accountService.AccountService({ home: configuration.configuration.happyHomeDir, spawnPty: (env) => spawnSetupTokenPty(homedir(), env) });
191
191
  const started = await svc.loginStart({ agent: "claude", kind: "claude-subscription", ...target });
@@ -1,12 +1,12 @@
1
1
  import { randomUUID } from 'node:crypto';
2
2
  import { mkdirSync, writeFileSync, readFileSync } from 'node:fs';
3
3
  import { join } from 'node:path';
4
- import { L as AGENT_PROFILE_FEATURE_LAUNCH, M as AgentProfileAddRequestSchema, N as AgentProfileLoginStartRequestSchema, O as AgentProfileLoginSubmitRequestSchema, Q as AgentProfileBindRequestSchema } from './index-CiRMvS73.mjs';
4
+ import { N as AGENT_PROFILE_FEATURE_LAUNCH, O as AgentProfileAddRequestSchema, Q as AgentProfileLoginStartRequestSchema, T as AgentProfileLoginSubmitRequestSchema, U as AgentProfileBindRequestSchema } from './index-DWk-WTU-.mjs';
5
5
  import { spawn } from 'node:child_process';
6
- import { A as ACCOUNT_STRIPPED_ENV_KEYS } from './claudeAccountEnv-DowsOlDB.mjs';
7
- import { C as CODEX_ALWAYS_STRIPPED_ENV_KEYS, r as readCodexProviders, s as syncCodexOverlay, b as baseCodexHome } from './codexAccount-CieIQLOX.mjs';
6
+ import { A as ACCOUNT_STRIPPED_ENV_KEYS } from './claudeAccountEnv-C6Wl-ZbT.mjs';
7
+ import { C as CODEX_ALWAYS_STRIPPED_ENV_KEYS, r as readCodexProviders, s as syncCodexOverlay, b as baseCodexHome } from './codexAccount-BPQ-lPhH.mjs';
8
8
  import { createInterface } from 'node:readline';
9
- import { h as buildAgentProfilesState, d as defaultSecretProbe, a as readAccounts, s as summarizeAccount, c as readAccountsFileV2, n as newAccountId, i as writeAccountSecret, f as writeAccountsFile, j as sessionsBoundTo, r as readSessionBindings, k as removeAccountSecret, b as accountSecretPath, e as expandHome, l as accountCodexHomePath, m as SUBSCRIPTION_TOKEN_TTL_MS, w as writeSessionBinding, o as readSessionBindingV2 } from './store-DWmjM4Ex.mjs';
9
+ import { h as buildAgentProfilesState, d as defaultSecretProbe, a as readAccounts, s as summarizeAccount, c as readAccountsFileV2, n as newAccountId, i as writeAccountSecret, f as writeAccountsFile, j as sessionsBoundTo, r as readSessionBindings, k as removeAccountSecret, b as accountSecretPath, e as expandHome, l as accountCodexHomePath, m as SUBSCRIPTION_TOKEN_TTL_MS, w as writeSessionBinding, o as readSessionBindingV2 } from './store-Fge1h9wy.mjs';
10
10
 
11
11
  const CHECK_TIMEOUT_MS = 2e4;
12
12
  const DEFAULT_CHECK_MODEL = "claude-haiku-4-5";
@@ -3,12 +3,12 @@
3
3
  var node_crypto = require('node:crypto');
4
4
  var node_fs = require('node:fs');
5
5
  var path = require('node:path');
6
- var index = require('./index-44o_qMvE.cjs');
6
+ var index = require('./index-BYL_X3gP.cjs');
7
7
  var node_child_process = require('node:child_process');
8
- var claudeAccountEnv = require('./claudeAccountEnv-Btp39mfa.cjs');
9
- var codexAccount = require('./codexAccount-D-OBY29W.cjs');
8
+ var claudeAccountEnv = require('./claudeAccountEnv-BTZjHTpF.cjs');
9
+ var codexAccount = require('./codexAccount-BjaHvmKH.cjs');
10
10
  var node_readline = require('node:readline');
11
- var store = require('./store-Cpb1LMNW.cjs');
11
+ var store = require('./store-DGMILdMn.cjs');
12
12
 
13
13
  const CHECK_TIMEOUT_MS = 2e4;
14
14
  const DEFAULT_CHECK_MODEL = "claude-haiku-4-5";
@@ -1,6 +1,6 @@
1
1
  import { mkdirSync, renameSync, existsSync, unlinkSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
- import { w as writePrivateFileSync, c as configuration } from './configuration-i9MVy0a5.mjs';
3
+ import { w as writePrivateFileSync, c as configuration } from './configuration-D_YrWa_i.mjs';
4
4
 
5
5
  const SESSION_MODE_DIR = "session-modes";
6
6
  const ACP_PERMISSION_MODES = ["default", "acceptEdits", "plan", "bypassPermissions"];
@@ -2,7 +2,7 @@
2
2
 
3
3
  var node_fs = require('node:fs');
4
4
  var path = require('node:path');
5
- var configuration = require('./configuration-Cl9kOv09.cjs');
5
+ var configuration = require('./configuration-CDqmWkHO.cjs');
6
6
 
7
7
  const SESSION_MODE_DIR = "session-modes";
8
8
  const ACP_PERMISSION_MODES = ["default", "acceptEdits", "plan", "bypassPermissions"];
@@ -1,13 +1,13 @@
1
1
  import chalk from 'chalk';
2
2
  import { homedir } from 'node:os';
3
- import { r as readSettings, u as updateSettings } from './persistence-D_zVC4Xz.mjs';
3
+ import { r as readSettings, u as updateSettings } from './persistence-3iZXGbfb.mjs';
4
4
  import 'node:fs';
5
- import './logger-BiKmiREe.mjs';
5
+ import './logger-BcdURxNR.mjs';
6
6
  import { d as describeAgentHome, p as probeLoginShellEnv, r as resolveAgentHomes, e as expandHomePath, A as AGENT_HOME_ENV_NAMES } from './loginShellEnv-Dw8M7tkI.mjs';
7
7
  import 'node:fs/promises';
8
- import './configuration-i9MVy0a5.mjs';
8
+ import './configuration-D_YrWa_i.mjs';
9
9
  import 'node:path';
10
- import './package-CIW5lwaN.mjs';
10
+ import './package-Dx3hbh9J.mjs';
11
11
  import 'zod';
12
12
  import './authRelay-DhQhkBvX.mjs';
13
13
  import 'node:crypto';
@@ -2,14 +2,14 @@
2
2
 
3
3
  var chalk = require('chalk');
4
4
  var os = require('node:os');
5
- var persistence = require('./persistence-BOEZtiKb.cjs');
5
+ var persistence = require('./persistence-Ch78xygf.cjs');
6
6
  require('node:fs');
7
- require('./logger-BtWBoP60.cjs');
7
+ require('./logger-C8anCmdW.cjs');
8
8
  var loginShellEnv = require('./loginShellEnv-BkuYtExZ.cjs');
9
9
  require('node:fs/promises');
10
- require('./configuration-Cl9kOv09.cjs');
10
+ require('./configuration-CDqmWkHO.cjs');
11
11
  require('node:path');
12
- require('./package-Djdgx8nb.cjs');
12
+ require('./package-DkpXQvp1.cjs');
13
13
  require('zod');
14
14
  require('./authRelay-Dy1qU9td.cjs');
15
15
  require('node:crypto');
@@ -1,20 +1,20 @@
1
1
  import axios from 'axios';
2
- import { l as logger, a as redactLogValue } from './logger-BiKmiREe.mjs';
3
- import { A as AsyncLock, S as SESSION_SUPERSEDED_ERROR, a as agentInstanceAuth, b as MAX_CHAT_ATTACHMENT_ENCRYPTED_BYTES, U as UserMessageSchema, F as FileEventMessageSchema, P as PushNotificationClient } from './pushNotifications-RVpbqrxR.mjs';
4
- import { R as RpcHandlerManager, a as answerSocketRequest, c as connectGuarded, s as socketConnectGuard, d as describeSocketAckDrop, b as safeAck, i as isRateQuotaCode, p as pauseForRateQuota, e as shouldReconnect, f as createReconnectGate } from './reconnectGate-DSxYUCWy.mjs';
2
+ import { l as logger, a as redactLogValue } from './logger-BcdURxNR.mjs';
3
+ import { A as AsyncLock, S as SESSION_SUPERSEDED_ERROR, a as agentInstanceAuth, b as MAX_CHAT_ATTACHMENT_ENCRYPTED_BYTES, U as UserMessageSchema, F as FileEventMessageSchema, P as PushNotificationClient } from './pushNotifications-Db1NGJiA.mjs';
4
+ import { R as RpcHandlerManager, a as answerSocketRequest, c as connectGuarded, s as socketConnectGuard, d as describeSocketAckDrop, b as safeAck, i as isRateQuotaCode, p as pauseForRateQuota, e as shouldReconnect, f as createReconnectGate } from './reconnectGate-Ie4nSKNl.mjs';
5
5
  import { EventEmitter } from 'node:events';
6
6
  import { io } from 'socket.io-client';
7
7
  import { h as decrypt, d as decodeBase64, i as decryptBlob, e as encodeBase64, g as encrypt, l as libsodiumEncryptForPublicKey, j as libsodiumPublicKeyFromSecretKey, k as getRandomBytes } from './authRelay-DhQhkBvX.mjs';
8
8
  import { p as prepareClipboardText, d as prepareClipboardHistoryText } from './limits-DIo7rEBR.mjs';
9
- import { b as backoff, d as delay, e as exponentialBackoffDelay } from './time-Che8GhII.mjs';
10
- import { c as configuration } from './configuration-i9MVy0a5.mjs';
9
+ import { b as backoff, d as delay, e as exponentialBackoffDelay } from './time-BWVJTcWI.mjs';
10
+ import { c as configuration } from './configuration-D_YrWa_i.mjs';
11
11
  import { createHmac, randomUUID } from 'node:crypto';
12
- import { t as createEnvelope, s as streamKeyOf, af as ReleaseDrainNoticeSchema, ag as RelayAssignmentResponseSchema } from './index-CiRMvS73.mjs';
13
- import { r as registerCommonHandlers } from './registerCommonHandlers-CQDRKlkG.mjs';
12
+ import { t as createEnvelope, s as streamKeyOf, ag as ReleaseDrainNoticeSchema, ah as RelayAssignmentResponseSchema } from './index-DWk-WTU-.mjs';
13
+ import { r as registerCommonHandlers } from './registerCommonHandlers-BR7BeGX3.mjs';
14
14
  import { createId } from '@paralleldrive/cuid2';
15
- import { I as InvalidateSync } from './sync-BIXH8ijr.mjs';
15
+ import { I as InvalidateSync } from './sync-BZji3J2r.mjs';
16
16
  import { B as BackgroundTaskReporter } from './backgroundTaskActivity-8PdPxrvy.mjs';
17
- import { q as notifyDaemonTurnEvent, t as notifyDaemonBackgroundTasks } from './controlClient-D6vqMUfi.mjs';
17
+ import { t as notifyDaemonTurnEvent, u as notifyDaemonBackgroundTasks } from './controlClient-Daki7wgo.mjs';
18
18
  import chalk from 'chalk';
19
19
 
20
20
  async function hmac_sha512(key, data) {
@@ -1204,6 +1204,33 @@ class PromptQueueDrain {
1204
1204
  }
1205
1205
  }
1206
1206
 
1207
+ const OUTBOX_BATCH_LIMITS = {
1208
+ maxCount: 100,
1209
+ maxBytes: 768 * 1024,
1210
+ maxItemBytes: 1024 * 1024 - 4 * 1024
1211
+ };
1212
+ function outboxItemBytes(item) {
1213
+ return item.content.length + item.localId.length + 32;
1214
+ }
1215
+ function planOutboxBatch(items, limits = OUTBOX_BATCH_LIMITS) {
1216
+ const first = items[0];
1217
+ if (!first) return null;
1218
+ const firstBytes = outboxItemBytes(first);
1219
+ if (firstBytes > limits.maxItemBytes) return { kind: "oversize", bytes: firstBytes };
1220
+ const backfill = first.backfill === true;
1221
+ let count = 1;
1222
+ let bytes = firstBytes;
1223
+ while (count < items.length && count < limits.maxCount) {
1224
+ const next = items[count];
1225
+ if (next.backfill === true !== backfill) break;
1226
+ const nextBytes = outboxItemBytes(next);
1227
+ if (nextBytes > limits.maxItemBytes || bytes + nextBytes > limits.maxBytes) break;
1228
+ bytes += nextBytes;
1229
+ count += 1;
1230
+ }
1231
+ return { kind: "send", count, backfill };
1232
+ }
1233
+
1207
1234
  function advanceInboundCursor(current, handled) {
1208
1235
  let next = current;
1209
1236
  while (handled.has(next + 1)) {
@@ -1286,6 +1313,10 @@ class ApiSessionClient extends EventEmitter {
1286
1313
  };
1287
1314
  lastSeq = 0;
1288
1315
  pendingOutbox = [];
1316
+ /** B-880: set while a transcript replay enqueues (see `replayHistory`). */
1317
+ replayingHistory = false;
1318
+ /** B-880 PR-2: the server-side backfill quota — declared before the first replay batch, closed after the last. */
1319
+ backfillDeclaration = null;
1289
1320
  sendSync;
1290
1321
  receiveSync;
1291
1322
  directInboundLocalIds = /* @__PURE__ */ new Set();
@@ -1794,18 +1825,23 @@ class ApiSessionClient extends EventEmitter {
1794
1825
  }
1795
1826
  this.awaitingInitialFetch = false;
1796
1827
  }
1797
- static MAX_OUTBOX_BATCH_SIZE = 50;
1798
1828
  async flushOutbox() {
1799
- while (this.pendingOutbox.length > 0) {
1800
- const batchSize = Math.min(this.pendingOutbox.length, ApiSessionClient.MAX_OUTBOX_BATCH_SIZE);
1801
- const batch = this.pendingOutbox.slice(0, batchSize);
1829
+ for (let plan = planOutboxBatch(this.pendingOutbox); plan; plan = planOutboxBatch(this.pendingOutbox)) {
1830
+ if (plan.kind === "oversize") {
1831
+ const [dropped] = this.pendingOutbox.splice(0, 1);
1832
+ logger.debug(`[API] Dropped an outbound message of ${plan.bytes} bytes (over the server's request limit), localId ${dropped.localId}`);
1833
+ continue;
1834
+ }
1835
+ const batch = this.pendingOutbox.slice(0, plan.count);
1836
+ if (plan.backfill && this.backfillDeclaration === "pending") await this.declareBackfill(this.pendingBackfillCount());
1802
1837
  const response = await axios.post(
1803
1838
  `${configuration.serverUrl}/v3/sessions/${encodeURIComponent(this.sessionId)}/messages`,
1804
1839
  {
1805
- messages: batch
1840
+ messages: batch.map(({ content, localId }) => ({ content, localId }))
1806
1841
  },
1807
1842
  {
1808
- headers: this.authHeaders(),
1843
+ // B-880: marks a replayed transcript; the server honours it only for a declared backfill (spec PR-2).
1844
+ headers: plan.backfill ? { ...this.authHeaders(), "X-Happy-Message-Origin": "backfill" } : this.authHeaders(),
1809
1845
  timeout: 6e4
1810
1846
  }
1811
1847
  );
@@ -1813,6 +1849,36 @@ class ApiSessionClient extends EventEmitter {
1813
1849
  this.noteHandledSeqs(messages.map((message) => message.seq));
1814
1850
  this.pushCommittedMessagesToRelay(batch, messages);
1815
1851
  this.pendingOutbox.splice(0, batch.length);
1852
+ if (plan.backfill && this.backfillDeclaration === "declared" && this.pendingBackfillCount() === 0) await this.closeBackfill();
1853
+ }
1854
+ }
1855
+ /**
1856
+ * B-880 PR-2: the server lets a replay use its backfill write budget only up
1857
+ * to what the session declared before its first message. Any answer
1858
+ * (accepted, refused, 404 from an older server) settles it: the replay then
1859
+ * uploads either way, on whichever budget the server picks. A network error
1860
+ * throws, so the outbox retries it with the batch.
1861
+ */
1862
+ async declareBackfill(total) {
1863
+ const response = await axios.post(
1864
+ `${configuration.serverUrl}/v3/sessions/${encodeURIComponent(this.sessionId)}/backfill`,
1865
+ { total },
1866
+ { headers: this.authHeaders(), timeout: 15e3, validateStatus: () => true }
1867
+ );
1868
+ this.backfillDeclaration = response.status === 200 ? "declared" : "closed";
1869
+ logger.debug(`[API] Backfill of ${total} messages declared: HTTP ${response.status}`);
1870
+ }
1871
+ /** B-880 PR-2: the replay is uploaded; later backfill-tagged writes go to the live budget. Best effort. */
1872
+ async closeBackfill() {
1873
+ this.backfillDeclaration = "closed";
1874
+ try {
1875
+ await axios.post(
1876
+ `${configuration.serverUrl}/v3/sessions/${encodeURIComponent(this.sessionId)}/backfill`,
1877
+ { done: true },
1878
+ { headers: this.authHeaders(), timeout: 15e3, validateStatus: () => true }
1879
+ );
1880
+ } catch (error) {
1881
+ logger.debug("[API] Closing the backfill failed (the quota stays as declared):", error);
1816
1882
  }
1817
1883
  }
1818
1884
  /**
@@ -1823,6 +1889,28 @@ class ApiSessionClient extends EventEmitter {
1823
1889
  * the outbox's own (InvalidateSync backoff), so a server that keeps failing
1824
1890
  * keeps this pending rather than resolving early.
1825
1891
  */
1892
+ /**
1893
+ * B-880: enqueue a replayed transcript (import / fork). Everything `replay`
1894
+ * sends is uploaded as a history backfill: its own batches, its own server
1895
+ * rate budget, and counted by `pendingBackfillCount` for the progress the
1896
+ * Web shows. `replay` must be synchronous.
1897
+ */
1898
+ replayHistory(replay) {
1899
+ this.replayingHistory = true;
1900
+ try {
1901
+ return replay();
1902
+ } finally {
1903
+ this.replayingHistory = false;
1904
+ if (this.backfillDeclaration === null && this.pendingBackfillCount() > 0) this.backfillDeclaration = "pending";
1905
+ if (this.pendingOutbox.length > 0) this.sendSync.invalidate();
1906
+ }
1907
+ }
1908
+ /** B-880: replayed messages the server has not accepted yet. */
1909
+ pendingBackfillCount() {
1910
+ let count = 0;
1911
+ for (const item of this.pendingOutbox) if (item.backfill) count += 1;
1912
+ return count;
1913
+ }
1826
1914
  async drainOutbox() {
1827
1915
  const target = new Set(this.pendingOutbox);
1828
1916
  while (this.pendingOutbox.some((item) => target.has(item))) {
@@ -1989,9 +2077,10 @@ class ApiSessionClient extends EventEmitter {
1989
2077
  // Deterministic localIds (terminal mirror, B-105) ride the server's
1990
2078
  // @@unique([sessionId, localId]) for replay idempotency; everything
1991
2079
  // else keeps the fire-once random id.
1992
- localId: localId ?? randomUUID()
2080
+ localId: localId ?? randomUUID(),
2081
+ ...this.replayingHistory ? { backfill: true } : {}
1993
2082
  });
1994
- if (invalidate) {
2083
+ if (invalidate && !this.replayingHistory) {
1995
2084
  this.sendSync.invalidate();
1996
2085
  }
1997
2086
  }
@@ -3114,7 +3203,7 @@ class ApiClient {
3114
3203
  return new ApiSessionClient(this.credential.token, session, opts);
3115
3204
  }
3116
3205
  async machineSyncClient(machine) {
3117
- const { ApiMachineClient } = await import('./apiMachine-qav2pnk5.mjs');
3206
+ const { ApiMachineClient } = await import('./apiMachine--_eI4PTv.mjs');
3118
3207
  return new ApiMachineClient(this.credential.token, machine);
3119
3208
  }
3120
3209
  push() {
@@ -1,22 +1,22 @@
1
1
  'use strict';
2
2
 
3
3
  var axios = require('axios');
4
- var logger = require('./logger-BtWBoP60.cjs');
5
- var pushNotifications = require('./pushNotifications-B19lT5mY.cjs');
6
- var reconnectGate = require('./reconnectGate-B8ltzSJD.cjs');
4
+ var logger = require('./logger-C8anCmdW.cjs');
5
+ var pushNotifications = require('./pushNotifications-D2ejrxlN.cjs');
6
+ var reconnectGate = require('./reconnectGate-S9yNiuY7.cjs');
7
7
  var node_events = require('node:events');
8
8
  var socket_ioClient = require('socket.io-client');
9
9
  var authRelay = require('./authRelay-Dy1qU9td.cjs');
10
10
  var limits = require('./limits-C-a7gr04.cjs');
11
- var time = require('./time-BMCY7zJL.cjs');
12
- var configuration = require('./configuration-Cl9kOv09.cjs');
11
+ var time = require('./time-UUMqbIq8.cjs');
12
+ var configuration = require('./configuration-CDqmWkHO.cjs');
13
13
  var node_crypto = require('node:crypto');
14
- var index = require('./index-44o_qMvE.cjs');
15
- var registerCommonHandlers = require('./registerCommonHandlers-Y2siJGwL.cjs');
14
+ var index = require('./index-BYL_X3gP.cjs');
15
+ var registerCommonHandlers = require('./registerCommonHandlers-51llVpLx.cjs');
16
16
  var cuid2 = require('@paralleldrive/cuid2');
17
- var sync = require('./sync-ni64k2OI.cjs');
17
+ var sync = require('./sync-DzInYE_l.cjs');
18
18
  var backgroundTaskActivity = require('./backgroundTaskActivity-CBvUdj39.cjs');
19
- var controlClient = require('./controlClient-DxCQKfqe.cjs');
19
+ var controlClient = require('./controlClient-BS86Ksm8.cjs');
20
20
  var chalk = require('chalk');
21
21
 
22
22
  async function hmac_sha512(key, data) {
@@ -1206,6 +1206,33 @@ class PromptQueueDrain {
1206
1206
  }
1207
1207
  }
1208
1208
 
1209
+ const OUTBOX_BATCH_LIMITS = {
1210
+ maxCount: 100,
1211
+ maxBytes: 768 * 1024,
1212
+ maxItemBytes: 1024 * 1024 - 4 * 1024
1213
+ };
1214
+ function outboxItemBytes(item) {
1215
+ return item.content.length + item.localId.length + 32;
1216
+ }
1217
+ function planOutboxBatch(items, limits = OUTBOX_BATCH_LIMITS) {
1218
+ const first = items[0];
1219
+ if (!first) return null;
1220
+ const firstBytes = outboxItemBytes(first);
1221
+ if (firstBytes > limits.maxItemBytes) return { kind: "oversize", bytes: firstBytes };
1222
+ const backfill = first.backfill === true;
1223
+ let count = 1;
1224
+ let bytes = firstBytes;
1225
+ while (count < items.length && count < limits.maxCount) {
1226
+ const next = items[count];
1227
+ if (next.backfill === true !== backfill) break;
1228
+ const nextBytes = outboxItemBytes(next);
1229
+ if (nextBytes > limits.maxItemBytes || bytes + nextBytes > limits.maxBytes) break;
1230
+ bytes += nextBytes;
1231
+ count += 1;
1232
+ }
1233
+ return { kind: "send", count, backfill };
1234
+ }
1235
+
1209
1236
  function advanceInboundCursor(current, handled) {
1210
1237
  let next = current;
1211
1238
  while (handled.has(next + 1)) {
@@ -1288,6 +1315,10 @@ class ApiSessionClient extends node_events.EventEmitter {
1288
1315
  };
1289
1316
  lastSeq = 0;
1290
1317
  pendingOutbox = [];
1318
+ /** B-880: set while a transcript replay enqueues (see `replayHistory`). */
1319
+ replayingHistory = false;
1320
+ /** B-880 PR-2: the server-side backfill quota — declared before the first replay batch, closed after the last. */
1321
+ backfillDeclaration = null;
1291
1322
  sendSync;
1292
1323
  receiveSync;
1293
1324
  directInboundLocalIds = /* @__PURE__ */ new Set();
@@ -1796,18 +1827,23 @@ class ApiSessionClient extends node_events.EventEmitter {
1796
1827
  }
1797
1828
  this.awaitingInitialFetch = false;
1798
1829
  }
1799
- static MAX_OUTBOX_BATCH_SIZE = 50;
1800
1830
  async flushOutbox() {
1801
- while (this.pendingOutbox.length > 0) {
1802
- const batchSize = Math.min(this.pendingOutbox.length, ApiSessionClient.MAX_OUTBOX_BATCH_SIZE);
1803
- const batch = this.pendingOutbox.slice(0, batchSize);
1831
+ for (let plan = planOutboxBatch(this.pendingOutbox); plan; plan = planOutboxBatch(this.pendingOutbox)) {
1832
+ if (plan.kind === "oversize") {
1833
+ const [dropped] = this.pendingOutbox.splice(0, 1);
1834
+ logger.logger.debug(`[API] Dropped an outbound message of ${plan.bytes} bytes (over the server's request limit), localId ${dropped.localId}`);
1835
+ continue;
1836
+ }
1837
+ const batch = this.pendingOutbox.slice(0, plan.count);
1838
+ if (plan.backfill && this.backfillDeclaration === "pending") await this.declareBackfill(this.pendingBackfillCount());
1804
1839
  const response = await axios.post(
1805
1840
  `${configuration.configuration.serverUrl}/v3/sessions/${encodeURIComponent(this.sessionId)}/messages`,
1806
1841
  {
1807
- messages: batch
1842
+ messages: batch.map(({ content, localId }) => ({ content, localId }))
1808
1843
  },
1809
1844
  {
1810
- headers: this.authHeaders(),
1845
+ // B-880: marks a replayed transcript; the server honours it only for a declared backfill (spec PR-2).
1846
+ headers: plan.backfill ? { ...this.authHeaders(), "X-Happy-Message-Origin": "backfill" } : this.authHeaders(),
1811
1847
  timeout: 6e4
1812
1848
  }
1813
1849
  );
@@ -1815,6 +1851,36 @@ class ApiSessionClient extends node_events.EventEmitter {
1815
1851
  this.noteHandledSeqs(messages.map((message) => message.seq));
1816
1852
  this.pushCommittedMessagesToRelay(batch, messages);
1817
1853
  this.pendingOutbox.splice(0, batch.length);
1854
+ if (plan.backfill && this.backfillDeclaration === "declared" && this.pendingBackfillCount() === 0) await this.closeBackfill();
1855
+ }
1856
+ }
1857
+ /**
1858
+ * B-880 PR-2: the server lets a replay use its backfill write budget only up
1859
+ * to what the session declared before its first message. Any answer
1860
+ * (accepted, refused, 404 from an older server) settles it: the replay then
1861
+ * uploads either way, on whichever budget the server picks. A network error
1862
+ * throws, so the outbox retries it with the batch.
1863
+ */
1864
+ async declareBackfill(total) {
1865
+ const response = await axios.post(
1866
+ `${configuration.configuration.serverUrl}/v3/sessions/${encodeURIComponent(this.sessionId)}/backfill`,
1867
+ { total },
1868
+ { headers: this.authHeaders(), timeout: 15e3, validateStatus: () => true }
1869
+ );
1870
+ this.backfillDeclaration = response.status === 200 ? "declared" : "closed";
1871
+ logger.logger.debug(`[API] Backfill of ${total} messages declared: HTTP ${response.status}`);
1872
+ }
1873
+ /** B-880 PR-2: the replay is uploaded; later backfill-tagged writes go to the live budget. Best effort. */
1874
+ async closeBackfill() {
1875
+ this.backfillDeclaration = "closed";
1876
+ try {
1877
+ await axios.post(
1878
+ `${configuration.configuration.serverUrl}/v3/sessions/${encodeURIComponent(this.sessionId)}/backfill`,
1879
+ { done: true },
1880
+ { headers: this.authHeaders(), timeout: 15e3, validateStatus: () => true }
1881
+ );
1882
+ } catch (error) {
1883
+ logger.logger.debug("[API] Closing the backfill failed (the quota stays as declared):", error);
1818
1884
  }
1819
1885
  }
1820
1886
  /**
@@ -1825,6 +1891,28 @@ class ApiSessionClient extends node_events.EventEmitter {
1825
1891
  * the outbox's own (InvalidateSync backoff), so a server that keeps failing
1826
1892
  * keeps this pending rather than resolving early.
1827
1893
  */
1894
+ /**
1895
+ * B-880: enqueue a replayed transcript (import / fork). Everything `replay`
1896
+ * sends is uploaded as a history backfill: its own batches, its own server
1897
+ * rate budget, and counted by `pendingBackfillCount` for the progress the
1898
+ * Web shows. `replay` must be synchronous.
1899
+ */
1900
+ replayHistory(replay) {
1901
+ this.replayingHistory = true;
1902
+ try {
1903
+ return replay();
1904
+ } finally {
1905
+ this.replayingHistory = false;
1906
+ if (this.backfillDeclaration === null && this.pendingBackfillCount() > 0) this.backfillDeclaration = "pending";
1907
+ if (this.pendingOutbox.length > 0) this.sendSync.invalidate();
1908
+ }
1909
+ }
1910
+ /** B-880: replayed messages the server has not accepted yet. */
1911
+ pendingBackfillCount() {
1912
+ let count = 0;
1913
+ for (const item of this.pendingOutbox) if (item.backfill) count += 1;
1914
+ return count;
1915
+ }
1828
1916
  async drainOutbox() {
1829
1917
  const target = new Set(this.pendingOutbox);
1830
1918
  while (this.pendingOutbox.some((item) => target.has(item))) {
@@ -1991,9 +2079,10 @@ class ApiSessionClient extends node_events.EventEmitter {
1991
2079
  // Deterministic localIds (terminal mirror, B-105) ride the server's
1992
2080
  // @@unique([sessionId, localId]) for replay idempotency; everything
1993
2081
  // else keeps the fire-once random id.
1994
- localId: localId ?? node_crypto.randomUUID()
2082
+ localId: localId ?? node_crypto.randomUUID(),
2083
+ ...this.replayingHistory ? { backfill: true } : {}
1995
2084
  });
1996
- if (invalidate) {
2085
+ if (invalidate && !this.replayingHistory) {
1997
2086
  this.sendSync.invalidate();
1998
2087
  }
1999
2088
  }
@@ -3116,7 +3205,7 @@ class ApiClient {
3116
3205
  return new ApiSessionClient(this.credential.token, session, opts);
3117
3206
  }
3118
3207
  async machineSyncClient(machine) {
3119
- const { ApiMachineClient } = await Promise.resolve().then(function () { return require('./apiMachine-MPwddFXq.cjs'); });
3208
+ const { ApiMachineClient } = await Promise.resolve().then(function () { return require('./apiMachine-CA58NM_V.cjs'); });
3120
3209
  return new ApiMachineClient(this.credential.token, machine);
3121
3210
  }
3122
3211
  push() {