very-happy-cli 0.2.184 → 0.2.185

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 (186) hide show
  1. package/dist/{AcpBackend-DOzn74zn.cjs → AcpBackend-CCqL9mP1.cjs} +3 -3
  2. package/dist/{AcpBackend-Csg7Sy2P.mjs → AcpBackend-DkoqWhTa.mjs} +3 -3
  3. package/dist/{AcpSessionManager-BRK2F2yN.mjs → AcpSessionManager-BNPex8tJ.mjs} +1 -1
  4. package/dist/{AcpSessionManager-CJXDNNtq.cjs → AcpSessionManager-DrtAJQUH.cjs} +1 -1
  5. package/dist/{BasePermissionHandler-CfrnkG3v.cjs → BasePermissionHandler-DJZITwmL.cjs} +1 -1
  6. package/dist/{BasePermissionHandler-BqYwrCra.mjs → BasePermissionHandler-Dd4oGPDg.mjs} +1 -1
  7. package/dist/{acpSessionResume-Dz1myMbR.mjs → acpSessionResume-_2NtETqb.mjs} +1 -1
  8. package/dist/{acpSessionResume-DZ65DBeE.cjs → acpSessionResume-umHzSMbQ.cjs} +1 -1
  9. package/dist/{agentHome-CKAXhc8P.cjs → agentHome-CmIMqMWy.cjs} +4 -4
  10. package/dist/{agentHome-B_tu3tFJ.mjs → agentHome-Dv_hRIt7.mjs} +4 -4
  11. package/dist/{api-rw5xkzxo.cjs → api-BSz8MYte.cjs} +66 -16
  12. package/dist/{api-BpTDU2BO.mjs → api-BTS8mqLy.mjs} +66 -16
  13. package/dist/{apiMachine-wp0hWG3F.mjs → apiMachine-BcjccOmd.mjs} +13 -13
  14. package/dist/{apiMachine-Bs1XXHKs.cjs → apiMachine-utCDabnO.cjs} +13 -13
  15. package/dist/{attachmentContent-CWSSGMMo.mjs → attachmentContent-DpOzgDTw.mjs} +2 -2
  16. package/dist/{attachmentContent-K_Up4InS.cjs → attachmentContent-hkdGP2NV.cjs} +2 -2
  17. package/dist/{auth-gGryJImw.cjs → auth-B8nCUEiK.cjs} +5 -5
  18. package/dist/{auth-D6kSt2sR.mjs → auth-BKD2U9S2.mjs} +5 -5
  19. package/dist/{auth-CBESCCCn.mjs → auth-CpbTj74y.mjs} +8 -8
  20. package/dist/{auth-C4_mXYgj.cjs → auth-DzXdF08E.cjs} +8 -8
  21. package/dist/{auto-CEucVmFR.mjs → auto-C-NK2JS8.mjs} +14 -14
  22. package/dist/{auto-Do43AOza.cjs → auto-E3ouHO37.cjs} +14 -14
  23. package/dist/{bootstrap-BPz1iX77.cjs → bootstrap-DIMkxIbR.cjs} +2 -2
  24. package/dist/{bootstrap-CodyCmGt.mjs → bootstrap-DV4dqeCe.mjs} +2 -2
  25. package/dist/{browser-CqMhj8Gm.mjs → browser-C0xt1NE-.mjs} +1 -1
  26. package/dist/{browser-D9D-1eqa.cjs → browser-Ch50ZchJ.cjs} +1 -1
  27. package/dist/{claudeLocal-Dywp8NKr.cjs → claudeLocal-Curd8-dn.cjs} +4 -4
  28. package/dist/{claudeLocal-BgIRtT3Q.mjs → claudeLocal-D-U3fIdS.mjs} +4 -4
  29. package/dist/{claudeLocalLauncher-_TOL73g5.cjs → claudeLocalLauncher-BEJ9Wad_.cjs} +9 -9
  30. package/dist/{claudeLocalLauncher-CaHjZ8HW.mjs → claudeLocalLauncher-BTNUVzRK.mjs} +9 -9
  31. package/dist/{claudeSessionFork-jq-_WiAu.cjs → claudeSessionFork-DMdeScGk.cjs} +1 -1
  32. package/dist/{claudeSessionFork-C9nB7fs5.mjs → claudeSessionFork-JPEHVbfR.mjs} +1 -1
  33. package/dist/{client-C49zFRkX.cjs → client-C54hMWx6.cjs} +2 -2
  34. package/dist/{client-BdbVizjk.mjs → client-Ct1rnpJw.mjs} +2 -2
  35. package/dist/{client-DwlYk8uJ.mjs → client-D1rJt15-.mjs} +3 -3
  36. package/dist/{client-CX-_2myt.mjs → client-D2lOnvzs.mjs} +2 -2
  37. package/dist/{client-ByZFACEw.cjs → client-dpo5EbS9.cjs} +3 -3
  38. package/dist/{client-BFDji81N.cjs → client-qgKef7S6.cjs} +2 -2
  39. package/dist/codex/happyMcpStdioBridge.cjs +15 -15
  40. package/dist/codex/happyMcpStdioBridge.mjs +15 -15
  41. package/dist/{codexAppServerClient-CmOIqiNQ.mjs → codexAppServerClient-CM3O0zHW.mjs} +3 -3
  42. package/dist/{codexAppServerClient-DF12ZSw1.cjs → codexAppServerClient-DGeqZViU.cjs} +3 -3
  43. package/dist/{codexCommand-BN05uEyv.mjs → codexCommand-CkdopWS7.mjs} +41 -41
  44. package/dist/{codexCommand-H-ObWTtx.cjs → codexCommand-D_8fbJEk.cjs} +41 -41
  45. package/dist/{codexTermination-Byohgj8h.mjs → codexTermination-FO52Ahcx.mjs} +1 -1
  46. package/dist/{codexTermination-RwKa8pKk.cjs → codexTermination-MG2j2DDX.cjs} +1 -1
  47. package/dist/{config-ChHLh-hf.mjs → config-CppOKnWe.mjs} +3 -3
  48. package/dist/{config-D_wNqwxX.cjs → config-IDbpY1Am.cjs} +3 -3
  49. package/dist/{configuration-C9Sx-Foo.cjs → configuration-CwfmwaLU.cjs} +1 -1
  50. package/dist/{configuration-CVgUe2qN.mjs → configuration-HPdj5Til.mjs} +1 -1
  51. package/dist/{connect-DJEQjS7C.mjs → connect-1YK7vPbW.mjs} +12 -12
  52. package/dist/{connect-B61xJDRq.cjs → connect-BNlBIAM8.cjs} +12 -12
  53. package/dist/{context-Bf3BG7w8.cjs → context-D3vDWjiI.cjs} +1 -1
  54. package/dist/{context-CDPfhHTo.mjs → context-DetK5c-x.mjs} +1 -1
  55. package/dist/{controlClient-DMCxtwq2.mjs → controlClient-DBylxaEh.mjs} +3 -3
  56. package/dist/{controlClient-BLO1_pPx.cjs → controlClient-DTMI1aTp.cjs} +3 -3
  57. package/dist/{createSessionMetadata-5Mde6Dfh.cjs → createSessionMetadata-D2Ll7PlQ.cjs} +2 -2
  58. package/dist/{createSessionMetadata-BYroCdrU.mjs → createSessionMetadata-D8pfpX4V.mjs} +2 -2
  59. package/dist/{defaultPermissionMode-CTdxUV_3.mjs → defaultPermissionMode-Bkhj_DwT.mjs} +2 -2
  60. package/dist/{defaultPermissionMode-B7mjHQKp.cjs → defaultPermissionMode-DVXkcryy.cjs} +2 -2
  61. package/dist/{deterministicJson-C1Z9MlDX.cjs → deterministicJson-DUCYjhHe.cjs} +12 -12
  62. package/dist/{deterministicJson-C3QXOc1N.mjs → deterministicJson-cEWItQun.mjs} +12 -12
  63. package/dist/{doctor-OwNmTpYh.mjs → doctor-DpWtxNeT.mjs} +7 -7
  64. package/dist/{doctor-DRdV3thy.cjs → doctor-tLRILlmz.cjs} +7 -7
  65. package/dist/{downloadTarget-CNtQ8rhV.mjs → downloadTarget-B5b5BHb2.mjs} +6 -6
  66. package/dist/{downloadTarget-Di5bf7r0.cjs → downloadTarget-Ci5wcYC2.cjs} +6 -6
  67. package/dist/{ensureDaemonRunning-CMY--T9Q.cjs → ensureDaemonRunning-Dsv8UPwx.cjs} +5 -5
  68. package/dist/{ensureDaemonRunning-IRV-w0wH.mjs → ensureDaemonRunning-GDGwNDGF.mjs} +5 -5
  69. package/dist/{handleResumeCommand-z7wY7QVM.cjs → handleResumeCommand-CncudrQd.cjs} +5 -5
  70. package/dist/{handleResumeCommand-BO00SYjG.mjs → handleResumeCommand-DW7Ml1u5.mjs} +5 -5
  71. package/dist/{index-B4cyX2by.cjs → index-BEHzEYP0.cjs} +37 -37
  72. package/dist/{index-NhmqjrGv.cjs → index-Bh806Q-1.cjs} +3 -3
  73. package/dist/{index-_LfuIz-O.mjs → index-C1qLnBOk.mjs} +38 -38
  74. package/dist/{index-CVUiytNq.mjs → index-DRWlaLbe.mjs} +3 -3
  75. package/dist/{index-BsoUsrKS.cjs → index-Dzb_Bsfu.cjs} +4 -4
  76. package/dist/{index-wYJu2yGc.cjs → index-Vx4EQ6wI.cjs} +4 -4
  77. package/dist/{index-C7zgeuLP.mjs → index-Wf6mKJq9.mjs} +4 -4
  78. package/dist/{index-DZvi6_tB.mjs → index-bT1X9Brv.mjs} +4 -4
  79. package/dist/index.cjs +2 -2
  80. package/dist/index.mjs +2 -2
  81. package/dist/{install-CGYDeYes.cjs → install-CRs4tGBa.cjs} +3 -3
  82. package/dist/{install-DeUM6h8X.mjs → install-DmF9wfwV.mjs} +3 -3
  83. package/dist/lib.cjs +11 -11
  84. package/dist/lib.d.cts +11 -0
  85. package/dist/lib.d.mts +11 -0
  86. package/dist/lib.mjs +11 -11
  87. package/dist/{lidState-CBjQEwTt.mjs → lidState-CG9jFcML.mjs} +1 -1
  88. package/dist/{lidState-C4YgPn6y.cjs → lidState-wwiu6M3p.cjs} +1 -1
  89. package/dist/{localHappyAgentAuth-CcWGU_lS.mjs → localHappyAgentAuth-CWha8BiX.mjs} +1 -1
  90. package/dist/{localHappyAgentAuth-BzCuIkzi.cjs → localHappyAgentAuth-UoytSUX0.cjs} +1 -1
  91. package/dist/{logger-D2qd0mMg.mjs → logger-BjXkscIr.mjs} +2 -2
  92. package/dist/{logger-CrtT0opS.cjs → logger-CIUMiSLo.cjs} +2 -2
  93. package/dist/{machineMetadata-D1hlm_oF.cjs → machineMetadata-BPlyxzxb.cjs} +3 -3
  94. package/dist/{machineMetadata-B2czDiTd.mjs → machineMetadata-Ca4Dpy6s.mjs} +3 -3
  95. package/dist/{main-BNYWELul.mjs → main-CS1U9i4s.mjs} +46 -46
  96. package/dist/{main-BWgWN5d1.cjs → main-FD8mmcsK.cjs} +46 -46
  97. package/dist/{mcp-ColtiH23.mjs → mcp-BS6rdR8p.mjs} +14 -14
  98. package/dist/{mcp-C18unjs1.cjs → mcp-C7Rm1dTM.cjs} +14 -14
  99. package/dist/{mirrorProtocol-DTHWtAE5.mjs → mirrorProtocol-C3Anki4S.mjs} +2 -2
  100. package/dist/{mirrorProtocol-D4CR5I5W.cjs → mirrorProtocol-CMJ2HOZF.cjs} +2 -2
  101. package/dist/{package-DczR1k0c.cjs → package-CRDjc5vK.cjs} +7 -7
  102. package/dist/{package-Ek5FOyEo.mjs → package-Do0Y9bGA.mjs} +7 -7
  103. package/dist/{panels-BIQ7FrCB.mjs → panels-C-jss7nF.mjs} +5 -5
  104. package/dist/{panels-DYSMHhdb.cjs → panels-DwTHrZuo.cjs} +5 -5
  105. package/dist/{peerTools-CABQ6iKd.mjs → peerTools-CL7zBxlC.mjs} +5 -5
  106. package/dist/{peerTools-Cufh4Qp_.cjs → peerTools-SLRntgX6.cjs} +5 -5
  107. package/dist/{persistence-IYH6bAXY.cjs → persistence-CNWBdUH2.cjs} +2 -2
  108. package/dist/{persistence-DFtgQvr6.mjs → persistence-CmVwM5uq.mjs} +2 -2
  109. package/dist/{piRunnerArgs-Dgjmj8KL.cjs → piRunnerArgs-CXJx3PPx.cjs} +1 -1
  110. package/dist/{piRunnerArgs-CIWprC1S.mjs → piRunnerArgs-K0K9Y0Yq.mjs} +1 -1
  111. package/dist/{piRuntime-K6o4GPZ9.mjs → piRuntime-BSoHy-QJ.mjs} +1 -1
  112. package/dist/{piRuntime-C_nX977w.cjs → piRuntime-Bv41vG05.cjs} +1 -1
  113. package/dist/{piTerminal-CRl0EZc3.mjs → piTerminal-B8acGxsm.mjs} +16 -16
  114. package/dist/{piTerminal-CYhcmkyi.cjs → piTerminal-DSs-fnps.cjs} +16 -16
  115. package/dist/{pushNotifications-BgQ_QTgS.cjs → pushNotifications-C651e0ZZ.cjs} +2 -2
  116. package/dist/{pushNotifications-gVJWGFBP.mjs → pushNotifications-DnpJJ7VR.mjs} +2 -2
  117. package/dist/{query-DFreaScb.cjs → query-DXFx2VZY.cjs} +1 -1
  118. package/dist/{query-CGp9vY4e.mjs → query-rxLftxvh.mjs} +1 -1
  119. package/dist/{rateLimitWindows-CeogT1b6.cjs → rateLimitWindows-1WoBs8ln.cjs} +1 -1
  120. package/dist/{rateLimitWindows-DM_gshI4.mjs → rateLimitWindows-D9mQRGHv.mjs} +1 -1
  121. package/dist/{registerCommonHandlers-CyAtDNvs.mjs → registerCommonHandlers-DpBxSCBi.mjs} +2 -2
  122. package/dist/{registerCommonHandlers-CRqKXwQt.cjs → registerCommonHandlers-K-BTp2iR.cjs} +2 -2
  123. package/dist/{registerKillSessionHandler-DGWADNla.mjs → registerKillSessionHandler-BDxd20fg.mjs} +5 -5
  124. package/dist/{registerKillSessionHandler-CX49N52L.cjs → registerKillSessionHandler-DwPEAS2G.cjs} +5 -5
  125. package/dist/{remoteSessionClient-1nycIdrG.mjs → remoteSessionClient-DHWfDMHA.mjs} +5 -5
  126. package/dist/{remoteSessionClient-CuAkp19e.cjs → remoteSessionClient-DnFblfFz.cjs} +5 -5
  127. package/dist/{reportProgressTool-BS7TkeEk.cjs → reportProgressTool-CYgnezAO.cjs} +2 -2
  128. package/dist/{reportProgressTool-CdSi-uSC.mjs → reportProgressTool-DJXfK6rp.mjs} +2 -2
  129. package/dist/{run-gVwkplx0.cjs → run-BChqUxs6.cjs} +32 -32
  130. package/dist/{run-DqjEj8M2.mjs → run-BkixRBWm.mjs} +32 -32
  131. package/dist/{runClaude-CtVoFstP.cjs → runClaude-Bdw9vTgv.cjs} +21 -21
  132. package/dist/{runClaude-CuSjrZSf.mjs → runClaude-FWTCLnVq.mjs} +21 -21
  133. package/dist/{runClaudeDeps-eazOhb6g.mjs → runClaudeDeps-C6mCzhtO.mjs} +41 -41
  134. package/dist/{runClaudeDeps-DqOgRuKq.cjs → runClaudeDeps-CN_moqup.cjs} +36 -36
  135. package/dist/{runGemini-B4EqAd1U.mjs → runGemini-CI7ut_ng.mjs} +32 -32
  136. package/dist/{runGemini-81wkPvMv.cjs → runGemini-CzPwEltY.cjs} +32 -32
  137. package/dist/{runOpenClaw-Brb1KKAA.mjs → runOpenClaw-8V2K_-lg.mjs} +17 -17
  138. package/dist/{runOpenClaw-BK7ZQEKj.cjs → runOpenClaw-CLw64Nmq.cjs} +17 -17
  139. package/dist/{sandbox-t43Exd4t.mjs → sandbox-BMkBdvHW.mjs} +4 -4
  140. package/dist/{sandbox-DFD6an8o.cjs → sandbox-DD2oQTt3.cjs} +4 -4
  141. package/dist/{selfCheck-Bel50SH3.cjs → selfCheck-0jELpLE9.cjs} +37 -37
  142. package/dist/selfCheck-DgWZfw5E.mjs +86 -0
  143. package/dist/{send-Co9jxmc4.mjs → send-BNjwFaVp.mjs} +8 -8
  144. package/dist/{send-IR5DnG9V.cjs → send-BoLglO1t.cjs} +8 -8
  145. package/dist/{server-KnIeKeTb.mjs → server-C5wOp8jw.mjs} +4 -4
  146. package/dist/{server-CAo6a3Vw.cjs → server-Uw82k7zD.cjs} +6 -6
  147. package/dist/{sessionLock-DNGDn9oj.cjs → sessionLock-BTo7Cdbi.cjs} +3 -3
  148. package/dist/{sessionLock-ha9gsQEn.mjs → sessionLock-YMRCi-Ec.mjs} +3 -3
  149. package/dist/{sessionOps-hRqzcMXB.cjs → sessionOps-BDHEzyAY.cjs} +4 -4
  150. package/dist/{sessionOps-Di9MC0FP.mjs → sessionOps-BO6AesNJ.mjs} +4 -4
  151. package/dist/{sessionProvider-4Nn6e9Kd.mjs → sessionProvider-CB9lGJdF.mjs} +5 -5
  152. package/dist/{sessionProvider-LqE7Y_cf.cjs → sessionProvider-DLdJJV6A.cjs} +5 -5
  153. package/dist/{sessionScanner-BzEtrHB8.cjs → sessionScanner-3TevonZd.cjs} +3 -3
  154. package/dist/{sessionScanner-DKFKDsrW.mjs → sessionScanner-BkukogZy.mjs} +3 -3
  155. package/dist/{sessions-CmLiagcb.cjs → sessions-BkBcZSj7.cjs} +10 -10
  156. package/dist/{sessions-DzgMNXo5.mjs → sessions-Bx-6fXTL.mjs} +10 -10
  157. package/dist/{setupOfflineReconnection-Dq4N2Txp.cjs → setupOfflineReconnection-DMfoVL-0.cjs} +2 -2
  158. package/dist/{setupOfflineReconnection-D4NGi3Jf.mjs → setupOfflineReconnection-DYzysFFJ.mjs} +2 -2
  159. package/dist/{spawn-C6CE5PsI.mjs → spawn-CHC32rLr.mjs} +12 -12
  160. package/dist/{spawn-tmoekkOW.cjs → spawn-DvyBhowH.cjs} +12 -12
  161. package/dist/{spawnHappyCLI-8NcKgkuy.cjs → spawnHappyCLI-WYJCvAWD.cjs} +1 -1
  162. package/dist/{spawnHappyCLI-66grqHO0.mjs → spawnHappyCLI-e9MaJWB0.mjs} +1 -1
  163. package/dist/{specialCommands-BO8ipH0n.mjs → specialCommands-D00VrQ09.mjs} +3 -3
  164. package/dist/{specialCommands-Dq0TmY1Z.cjs → specialCommands-DqrQnKHC.cjs} +3 -3
  165. package/dist/{startFileWatcher-BLDkieUW.mjs → startFileWatcher-CvUUesns.mjs} +1 -1
  166. package/dist/{startFileWatcher-CjgKvec9.cjs → startFileWatcher-VFZ-Bpwa.cjs} +1 -1
  167. package/dist/{startupSessionCreate-CXRVahaU.cjs → startupSessionCreate-B25xTUJ4.cjs} +1 -1
  168. package/dist/{startupSessionCreate-B60THeNz.mjs → startupSessionCreate-B6HNLg0g.mjs} +1 -1
  169. package/dist/{sync-DKSZOi6w.cjs → sync-DliZ1zZh.cjs} +1 -1
  170. package/dist/{sync-DJvx7RbO.mjs → sync-HPnxI4fz.mjs} +1 -1
  171. package/dist/{systemPrompt-Duos1BtM.cjs → systemPrompt-CYvRvanR.cjs} +1 -1
  172. package/dist/{systemPrompt-dOOpz8L7.mjs → systemPrompt-D9JJpzl_.mjs} +1 -1
  173. package/dist/{teams-uWiMJEe1.mjs → teams-C0PJlIMz.mjs} +6 -6
  174. package/dist/{teams-pO5rjvPO.cjs → teams-D7Ad6YSf.cjs} +6 -6
  175. package/dist/{time-D-8GFCE7.cjs → time-BCGGrWp4.cjs} +1 -1
  176. package/dist/{time-Du0scQeJ.mjs → time-BbJ-NWcl.mjs} +1 -1
  177. package/dist/{titleGenerator-DKYj8rLY.mjs → titleGenerator-03Y2uoZW.mjs} +1 -1
  178. package/dist/{titleGenerator-DnKygjBP.cjs → titleGenerator-IrI84kqh.cjs} +2 -2
  179. package/dist/{todo-Du5dAwnt.mjs → todo-DOh8KaxD.mjs} +5 -5
  180. package/dist/{todo-BFDb7O8q.cjs → todo-DdV9_uEu.cjs} +5 -5
  181. package/dist/{tools-DK_x86Kl.cjs → tools-DeoxWyQ0.cjs} +1 -1
  182. package/dist/{tools-DHvMVL0a.mjs → tools-WXF7ApAe.mjs} +1 -1
  183. package/dist/{uninstall-CLDEXir0.mjs → uninstall-BVYlC0jw.mjs} +3 -3
  184. package/dist/{uninstall-c3zjum2o.cjs → uninstall-oGvAKOlN.cjs} +3 -3
  185. package/package.json +7 -7
  186. package/dist/selfCheck-CwpZepG-.mjs +0 -86
@@ -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-CrtT0opS.cjs');
7
- var time = require('./time-D-8GFCE7.cjs');
6
+ var logger = require('./logger-CIUMiSLo.cjs');
7
+ var time = require('./time-BCGGrWp4.cjs');
8
8
  var contentLogMetadata = require('./contentLogMetadata-ZSFk_NjQ.cjs');
9
9
  var processTree = require('./processTree-CMHWlVse.cjs');
10
- var _package = require('./package-DczR1k0c.cjs');
10
+ var _package = require('./package-CRDjc5vK.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,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-D2qd0mMg.mjs';
5
- import { d as delay } from './time-Du0scQeJ.mjs';
4
+ import { l as logger } from './logger-BjXkscIr.mjs';
5
+ import { d as delay } from './time-BbJ-NWcl.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-Ek5FOyEo.mjs';
8
+ import { p as packageJson } from './package-Do0Y9bGA.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) => {
@@ -1,6 +1,6 @@
1
1
  import { createId } from '@paralleldrive/cuid2';
2
2
  import { s as streamKeyOf, g as createEnvelope } from './index-DisBaRvM.mjs';
3
- import { t as textResultPayload, b as toolResultPayload } from './api-BpTDU2BO.mjs';
3
+ import { t as textResultPayload, b as toolResultPayload } from './api-BTS8mqLy.mjs';
4
4
 
5
5
  function turnOptions(turnId, time) {
6
6
  return turnId ? { turn: turnId, time } : { time };
@@ -2,7 +2,7 @@
2
2
 
3
3
  var cuid2 = require('@paralleldrive/cuid2');
4
4
  var index = require('./index-Ub-5xbcU.cjs');
5
- var api = require('./api-rw5xkzxo.cjs');
5
+ var api = require('./api-BSz8MYte.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-CrtT0opS.cjs');
3
+ var logger = require('./logger-CIUMiSLo.cjs');
4
4
 
5
5
  class BasePermissionHandler {
6
6
  pendingRequests = /* @__PURE__ */ new Map();
@@ -1,4 +1,4 @@
1
- import { l as logger } from './logger-D2qd0mMg.mjs';
1
+ import { l as logger } from './logger-BjXkscIr.mjs';
2
2
 
3
3
  class BasePermissionHandler {
4
4
  pendingRequests = /* @__PURE__ */ new Map();
@@ -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-CVgUe2qN.mjs';
3
+ import { w as writePrivateFileSync, c as configuration } from './configuration-HPdj5Til.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-C9Sx-Foo.cjs');
5
+ var configuration = require('./configuration-CwfmwaLU.cjs');
6
6
 
7
7
  const SESSION_MODE_DIR = "session-modes";
8
8
  const ACP_PERMISSION_MODES = ["default", "acceptEdits", "plan", "bypassPermissions"];
@@ -2,14 +2,14 @@
2
2
 
3
3
  var chalk = require('chalk');
4
4
  var os = require('node:os');
5
- var persistence = require('./persistence-IYH6bAXY.cjs');
5
+ var persistence = require('./persistence-CNWBdUH2.cjs');
6
6
  require('node:fs');
7
- require('./logger-CrtT0opS.cjs');
7
+ require('./logger-CIUMiSLo.cjs');
8
8
  var loginShellEnv = require('./loginShellEnv-BkuYtExZ.cjs');
9
9
  require('node:fs/promises');
10
- require('./configuration-C9Sx-Foo.cjs');
10
+ require('./configuration-CwfmwaLU.cjs');
11
11
  require('node:path');
12
- require('./package-DczR1k0c.cjs');
12
+ require('./package-CRDjc5vK.cjs');
13
13
  require('zod');
14
14
  require('./authRelay-Dy1qU9td.cjs');
15
15
  require('node:crypto');
@@ -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-DFtgQvr6.mjs';
3
+ import { r as readSettings, u as updateSettings } from './persistence-CmVwM5uq.mjs';
4
4
  import 'node:fs';
5
- import './logger-D2qd0mMg.mjs';
5
+ import './logger-BjXkscIr.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-CVgUe2qN.mjs';
8
+ import './configuration-HPdj5Til.mjs';
9
9
  import 'node:path';
10
- import './package-Ek5FOyEo.mjs';
10
+ import './package-Do0Y9bGA.mjs';
11
11
  import 'zod';
12
12
  import './authRelay-DhQhkBvX.mjs';
13
13
  import 'node:crypto';
@@ -1,22 +1,22 @@
1
1
  'use strict';
2
2
 
3
3
  var axios = require('axios');
4
- var logger = require('./logger-CrtT0opS.cjs');
5
- var lidState = require('./lidState-C4YgPn6y.cjs');
4
+ var logger = require('./logger-CIUMiSLo.cjs');
5
+ var lidState = require('./lidState-wwiu6M3p.cjs');
6
6
  var node_events = require('node:events');
7
7
  var socket_ioClient = require('socket.io-client');
8
- var pushNotifications = require('./pushNotifications-BgQ_QTgS.cjs');
8
+ var pushNotifications = require('./pushNotifications-C651e0ZZ.cjs');
9
9
  var authRelay = require('./authRelay-Dy1qU9td.cjs');
10
10
  var limits = require('./limits-C-a7gr04.cjs');
11
- var time = require('./time-D-8GFCE7.cjs');
12
- var configuration = require('./configuration-C9Sx-Foo.cjs');
11
+ var time = require('./time-BCGGrWp4.cjs');
12
+ var configuration = require('./configuration-CwfmwaLU.cjs');
13
13
  var node_crypto = require('node:crypto');
14
14
  var index = require('./index-Ub-5xbcU.cjs');
15
- var registerCommonHandlers = require('./registerCommonHandlers-CRqKXwQt.cjs');
15
+ var registerCommonHandlers = require('./registerCommonHandlers-K-BTp2iR.cjs');
16
16
  var cuid2 = require('@paralleldrive/cuid2');
17
- var sync = require('./sync-DKSZOi6w.cjs');
17
+ var sync = require('./sync-DliZ1zZh.cjs');
18
18
  var backgroundTaskActivity = require('./backgroundTaskActivity-CBvUdj39.cjs');
19
- var controlClient = require('./controlClient-BLO1_pPx.cjs');
19
+ var controlClient = require('./controlClient-DTMI1aTp.cjs');
20
20
  var chalk = require('chalk');
21
21
 
22
22
  async function hmac_sha512(key, data) {
@@ -1200,6 +1200,17 @@ class PromptQueueDrain {
1200
1200
  }
1201
1201
  }
1202
1202
 
1203
+ function advanceInboundCursor(current, handled) {
1204
+ let next = current;
1205
+ while (handled.has(next + 1)) {
1206
+ next += 1;
1207
+ }
1208
+ for (const seq of handled) {
1209
+ if (seq <= next) handled.delete(seq);
1210
+ }
1211
+ return { next, gap: handled.size > 0 };
1212
+ }
1213
+
1203
1214
  const guardOptions = { log: (message) => logger.logger.debug(message) };
1204
1215
  class ApiSessionClient extends node_events.EventEmitter {
1205
1216
  /**
@@ -1274,6 +1285,8 @@ class ApiSessionClient extends node_events.EventEmitter {
1274
1285
  receiveSync;
1275
1286
  directInboundLocalIds = /* @__PURE__ */ new Set();
1276
1287
  routedInboundLocalIds = /* @__PURE__ */ new Set();
1288
+ /** B-806: seqs above `lastSeq` our own POSTs confirmed (see inboundCursor.ts). */
1289
+ handledSeqs = /* @__PURE__ */ new Set();
1277
1290
  handoverInFlight = null;
1278
1291
  /** B-265 reconnect: the message cursor was seeded from the server, so
1279
1292
  * nothing before it is history to replay — but socket fast-path routing
@@ -1369,8 +1382,9 @@ class ApiSessionClient extends node_events.EventEmitter {
1369
1382
  }
1370
1383
  const localId = data.body.message.localId;
1371
1384
  const relayAccepted = !!localId && this.directInboundLocalIds.delete(localId);
1372
- if (localId && this.routedInboundLocalIds.has(localId)) {
1385
+ if (localId && this.routedInboundLocalIds.has(localId) || this.isOwnOutbound(messageSeq, localId)) {
1373
1386
  this.lastSeq = messageSeq;
1387
+ this.advanceCursorThroughHandled();
1374
1388
  return;
1375
1389
  }
1376
1390
  if (relayAccepted) {
@@ -1381,6 +1395,7 @@ class ApiSessionClient extends node_events.EventEmitter {
1381
1395
  this.routeIncomingMessage(body, localId);
1382
1396
  if (localId) this.rememberRoutedInbound(localId);
1383
1397
  this.lastSeq = messageSeq;
1398
+ this.advanceCursorThroughHandled();
1384
1399
  } else if (data.body.t === "update-session") {
1385
1400
  if (data.body.metadata && data.body.metadata.version > this.metadataVersion) {
1386
1401
  this.metadata = authRelay.decrypt(this.encryptionKey, this.encryptionVariant, authRelay.decodeBase64(data.body.metadata.value));
@@ -1722,6 +1737,7 @@ class ApiSessionClient extends node_events.EventEmitter {
1722
1737
  maxSeq = message.seq;
1723
1738
  }
1724
1739
  if (skipRouting) continue;
1740
+ if (message.seq <= this.lastSeq || this.isOwnOutbound(message.seq, message.localId)) continue;
1725
1741
  const relayAccepted = !!message.localId && this.directInboundLocalIds.delete(message.localId);
1726
1742
  if (message.localId && this.routedInboundLocalIds.has(message.localId)) {
1727
1743
  continue;
@@ -1744,7 +1760,7 @@ class ApiSessionClient extends node_events.EventEmitter {
1744
1760
  });
1745
1761
  }
1746
1762
  }
1747
- this.lastSeq = Math.max(this.lastSeq, maxSeq);
1763
+ this.lastSeq = advanceInboundCursor(Math.max(this.lastSeq, maxSeq), this.handledSeqs).next;
1748
1764
  const hasMore = !!response.data.hasMore;
1749
1765
  if (hasMore && maxSeq === afterSeq) {
1750
1766
  logger.logger.debug("[API] fetchMessages pagination stalled, stopping to avoid infinite loop", {
@@ -1776,8 +1792,7 @@ class ApiSessionClient extends node_events.EventEmitter {
1776
1792
  }
1777
1793
  );
1778
1794
  const messages = Array.isArray(response.data.messages) ? response.data.messages : [];
1779
- const maxSeq = messages.reduce((acc, message) => message.seq > acc ? message.seq : acc, this.lastSeq);
1780
- this.lastSeq = maxSeq;
1795
+ this.noteHandledSeqs(messages.map((message) => message.seq));
1781
1796
  this.pushCommittedMessagesToRelay(batch, messages);
1782
1797
  this.pendingOutbox.splice(0, batch.length);
1783
1798
  }
@@ -1798,6 +1813,27 @@ class ApiSessionClient extends node_events.EventEmitter {
1798
1813
  }
1799
1814
  return true;
1800
1815
  }
1816
+ /**
1817
+ * B-806: an ack proves only OUR messages exist. Hold them as handled and
1818
+ * move the cursor through a contiguous run; a gap below them (a Web
1819
+ * message whose update has not been applied) is filled by a fetch.
1820
+ */
1821
+ noteHandledSeqs(seqs) {
1822
+ for (const seq of seqs) {
1823
+ if (typeof seq === "number" && seq > this.lastSeq) this.handledSeqs.add(seq);
1824
+ }
1825
+ this.advanceCursorThroughHandled();
1826
+ }
1827
+ advanceCursorThroughHandled() {
1828
+ const { next, gap } = advanceInboundCursor(this.lastSeq, this.handledSeqs);
1829
+ this.lastSeq = next;
1830
+ if (gap) this.receiveSync.invalidate();
1831
+ }
1832
+ /** Our own output (acked, or still in flight) seen on the inbound path: never routed. */
1833
+ isOwnOutbound(seq, localId) {
1834
+ if (this.handledSeqs.has(seq)) return true;
1835
+ return !!localId && this.pendingOutbox.some((item) => item.localId === localId);
1836
+ }
1801
1837
  rememberRoutedInbound(localId) {
1802
1838
  this.routedInboundLocalIds.add(localId);
1803
1839
  if (this.routedInboundLocalIds.size > 2e3) {
@@ -1872,13 +1908,27 @@ class ApiSessionClient extends node_events.EventEmitter {
1872
1908
  if (batch.some((item) => !storedLocalIds.has(item.localId))) {
1873
1909
  throw new Error("Central persistence response omitted a session message");
1874
1910
  }
1875
- this.lastSeq = stored.reduce((max, message) => Math.max(max, message.seq), this.lastSeq);
1876
- for (const item of batch) {
1877
- if (this.routedInboundLocalIds.has(item.localId)) continue;
1911
+ const seqOf = new Map(stored.map((message) => [message.localId, message.seq]));
1912
+ let deferred = 0;
1913
+ for (const item of [...batch].sort((a, b) => seqOf.get(a.localId) - seqOf.get(b.localId))) {
1914
+ const seq = seqOf.get(item.localId);
1915
+ if (this.routedInboundLocalIds.has(item.localId)) {
1916
+ this.noteHandledSeqs([seq]);
1917
+ continue;
1918
+ }
1919
+ if (this.lastSeq > 0 && seq > this.lastSeq + 1) {
1920
+ deferred += 1;
1921
+ continue;
1922
+ }
1923
+ this.noteHandledSeqs([seq]);
1878
1924
  const body = authRelay.decrypt(this.encryptionKey, this.encryptionVariant, authRelay.decodeBase64(item.content));
1879
1925
  this.routeIncomingMessage(body, item.localId);
1880
1926
  this.rememberRoutedInbound(item.localId);
1881
1927
  }
1928
+ if (deferred > 0) {
1929
+ logger.logger.debug(`[API] Relay-delivered message(s) above a seq gap wait for catch-up: ${deferred}`);
1930
+ this.receiveSync.invalidate();
1931
+ }
1882
1932
  callback({ ok: true, messages: stored });
1883
1933
  } catch (error) {
1884
1934
  const routed = batch.filter((item) => this.routedInboundLocalIds.has(item.localId)).length;
@@ -3016,7 +3066,7 @@ class ApiClient {
3016
3066
  return new ApiSessionClient(this.credential.token, session, opts);
3017
3067
  }
3018
3068
  async machineSyncClient(machine) {
3019
- const { ApiMachineClient } = await Promise.resolve().then(function () { return require('./apiMachine-Bs1XXHKs.cjs'); });
3069
+ const { ApiMachineClient } = await Promise.resolve().then(function () { return require('./apiMachine-utCDabnO.cjs'); });
3020
3070
  return new ApiMachineClient(this.credential.token, machine);
3021
3071
  }
3022
3072
  push() {
@@ -1,20 +1,20 @@
1
1
  import axios from 'axios';
2
- import { l as logger, r as redactLogValue } from './logger-D2qd0mMg.mjs';
3
- 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 } from './lidState-CBjQEwTt.mjs';
2
+ import { l as logger, r as redactLogValue } from './logger-BjXkscIr.mjs';
3
+ 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 } from './lidState-CG9jFcML.mjs';
4
4
  import { EventEmitter } from 'node:events';
5
5
  import { io } from 'socket.io-client';
6
- import { A as AsyncLock, a as MAX_CHAT_ATTACHMENT_ENCRYPTED_BYTES, U as UserMessageSchema, F as FileEventMessageSchema, P as PushNotificationClient } from './pushNotifications-gVJWGFBP.mjs';
6
+ import { A as AsyncLock, a as MAX_CHAT_ATTACHMENT_ENCRYPTED_BYTES, U as UserMessageSchema, F as FileEventMessageSchema, P as PushNotificationClient } from './pushNotifications-DnpJJ7VR.mjs';
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-Du0scQeJ.mjs';
10
- import { c as configuration } from './configuration-CVgUe2qN.mjs';
9
+ import { b as backoff, d as delay, e as exponentialBackoffDelay } from './time-BbJ-NWcl.mjs';
10
+ import { c as configuration } from './configuration-HPdj5Til.mjs';
11
11
  import { createHmac, randomUUID } from 'node:crypto';
12
12
  import { g as createEnvelope, s as streamKeyOf, R as ReleaseDrainNoticeSchema, H as RelayAssignmentResponseSchema } from './index-DisBaRvM.mjs';
13
- import { r as registerCommonHandlers } from './registerCommonHandlers-CyAtDNvs.mjs';
13
+ import { r as registerCommonHandlers } from './registerCommonHandlers-DpBxSCBi.mjs';
14
14
  import { createId } from '@paralleldrive/cuid2';
15
- import { I as InvalidateSync } from './sync-DJvx7RbO.mjs';
15
+ import { I as InvalidateSync } from './sync-HPnxI4fz.mjs';
16
16
  import { B as BackgroundTaskReporter } from './backgroundTaskActivity-8PdPxrvy.mjs';
17
- import { m as notifyDaemonTurnEvent, o as notifyDaemonBackgroundTasks } from './controlClient-DMCxtwq2.mjs';
17
+ import { m as notifyDaemonTurnEvent, o as notifyDaemonBackgroundTasks } from './controlClient-DBylxaEh.mjs';
18
18
  import chalk from 'chalk';
19
19
 
20
20
  async function hmac_sha512(key, data) {
@@ -1198,6 +1198,17 @@ class PromptQueueDrain {
1198
1198
  }
1199
1199
  }
1200
1200
 
1201
+ function advanceInboundCursor(current, handled) {
1202
+ let next = current;
1203
+ while (handled.has(next + 1)) {
1204
+ next += 1;
1205
+ }
1206
+ for (const seq of handled) {
1207
+ if (seq <= next) handled.delete(seq);
1208
+ }
1209
+ return { next, gap: handled.size > 0 };
1210
+ }
1211
+
1201
1212
  const guardOptions = { log: (message) => logger.debug(message) };
1202
1213
  class ApiSessionClient extends EventEmitter {
1203
1214
  /**
@@ -1272,6 +1283,8 @@ class ApiSessionClient extends EventEmitter {
1272
1283
  receiveSync;
1273
1284
  directInboundLocalIds = /* @__PURE__ */ new Set();
1274
1285
  routedInboundLocalIds = /* @__PURE__ */ new Set();
1286
+ /** B-806: seqs above `lastSeq` our own POSTs confirmed (see inboundCursor.ts). */
1287
+ handledSeqs = /* @__PURE__ */ new Set();
1275
1288
  handoverInFlight = null;
1276
1289
  /** B-265 reconnect: the message cursor was seeded from the server, so
1277
1290
  * nothing before it is history to replay — but socket fast-path routing
@@ -1367,8 +1380,9 @@ class ApiSessionClient extends EventEmitter {
1367
1380
  }
1368
1381
  const localId = data.body.message.localId;
1369
1382
  const relayAccepted = !!localId && this.directInboundLocalIds.delete(localId);
1370
- if (localId && this.routedInboundLocalIds.has(localId)) {
1383
+ if (localId && this.routedInboundLocalIds.has(localId) || this.isOwnOutbound(messageSeq, localId)) {
1371
1384
  this.lastSeq = messageSeq;
1385
+ this.advanceCursorThroughHandled();
1372
1386
  return;
1373
1387
  }
1374
1388
  if (relayAccepted) {
@@ -1379,6 +1393,7 @@ class ApiSessionClient extends EventEmitter {
1379
1393
  this.routeIncomingMessage(body, localId);
1380
1394
  if (localId) this.rememberRoutedInbound(localId);
1381
1395
  this.lastSeq = messageSeq;
1396
+ this.advanceCursorThroughHandled();
1382
1397
  } else if (data.body.t === "update-session") {
1383
1398
  if (data.body.metadata && data.body.metadata.version > this.metadataVersion) {
1384
1399
  this.metadata = decrypt(this.encryptionKey, this.encryptionVariant, decodeBase64(data.body.metadata.value));
@@ -1720,6 +1735,7 @@ class ApiSessionClient extends EventEmitter {
1720
1735
  maxSeq = message.seq;
1721
1736
  }
1722
1737
  if (skipRouting) continue;
1738
+ if (message.seq <= this.lastSeq || this.isOwnOutbound(message.seq, message.localId)) continue;
1723
1739
  const relayAccepted = !!message.localId && this.directInboundLocalIds.delete(message.localId);
1724
1740
  if (message.localId && this.routedInboundLocalIds.has(message.localId)) {
1725
1741
  continue;
@@ -1742,7 +1758,7 @@ class ApiSessionClient extends EventEmitter {
1742
1758
  });
1743
1759
  }
1744
1760
  }
1745
- this.lastSeq = Math.max(this.lastSeq, maxSeq);
1761
+ this.lastSeq = advanceInboundCursor(Math.max(this.lastSeq, maxSeq), this.handledSeqs).next;
1746
1762
  const hasMore = !!response.data.hasMore;
1747
1763
  if (hasMore && maxSeq === afterSeq) {
1748
1764
  logger.debug("[API] fetchMessages pagination stalled, stopping to avoid infinite loop", {
@@ -1774,8 +1790,7 @@ class ApiSessionClient extends EventEmitter {
1774
1790
  }
1775
1791
  );
1776
1792
  const messages = Array.isArray(response.data.messages) ? response.data.messages : [];
1777
- const maxSeq = messages.reduce((acc, message) => message.seq > acc ? message.seq : acc, this.lastSeq);
1778
- this.lastSeq = maxSeq;
1793
+ this.noteHandledSeqs(messages.map((message) => message.seq));
1779
1794
  this.pushCommittedMessagesToRelay(batch, messages);
1780
1795
  this.pendingOutbox.splice(0, batch.length);
1781
1796
  }
@@ -1796,6 +1811,27 @@ class ApiSessionClient extends EventEmitter {
1796
1811
  }
1797
1812
  return true;
1798
1813
  }
1814
+ /**
1815
+ * B-806: an ack proves only OUR messages exist. Hold them as handled and
1816
+ * move the cursor through a contiguous run; a gap below them (a Web
1817
+ * message whose update has not been applied) is filled by a fetch.
1818
+ */
1819
+ noteHandledSeqs(seqs) {
1820
+ for (const seq of seqs) {
1821
+ if (typeof seq === "number" && seq > this.lastSeq) this.handledSeqs.add(seq);
1822
+ }
1823
+ this.advanceCursorThroughHandled();
1824
+ }
1825
+ advanceCursorThroughHandled() {
1826
+ const { next, gap } = advanceInboundCursor(this.lastSeq, this.handledSeqs);
1827
+ this.lastSeq = next;
1828
+ if (gap) this.receiveSync.invalidate();
1829
+ }
1830
+ /** Our own output (acked, or still in flight) seen on the inbound path: never routed. */
1831
+ isOwnOutbound(seq, localId) {
1832
+ if (this.handledSeqs.has(seq)) return true;
1833
+ return !!localId && this.pendingOutbox.some((item) => item.localId === localId);
1834
+ }
1799
1835
  rememberRoutedInbound(localId) {
1800
1836
  this.routedInboundLocalIds.add(localId);
1801
1837
  if (this.routedInboundLocalIds.size > 2e3) {
@@ -1870,13 +1906,27 @@ class ApiSessionClient extends EventEmitter {
1870
1906
  if (batch.some((item) => !storedLocalIds.has(item.localId))) {
1871
1907
  throw new Error("Central persistence response omitted a session message");
1872
1908
  }
1873
- this.lastSeq = stored.reduce((max, message) => Math.max(max, message.seq), this.lastSeq);
1874
- for (const item of batch) {
1875
- if (this.routedInboundLocalIds.has(item.localId)) continue;
1909
+ const seqOf = new Map(stored.map((message) => [message.localId, message.seq]));
1910
+ let deferred = 0;
1911
+ for (const item of [...batch].sort((a, b) => seqOf.get(a.localId) - seqOf.get(b.localId))) {
1912
+ const seq = seqOf.get(item.localId);
1913
+ if (this.routedInboundLocalIds.has(item.localId)) {
1914
+ this.noteHandledSeqs([seq]);
1915
+ continue;
1916
+ }
1917
+ if (this.lastSeq > 0 && seq > this.lastSeq + 1) {
1918
+ deferred += 1;
1919
+ continue;
1920
+ }
1921
+ this.noteHandledSeqs([seq]);
1876
1922
  const body = decrypt(this.encryptionKey, this.encryptionVariant, decodeBase64(item.content));
1877
1923
  this.routeIncomingMessage(body, item.localId);
1878
1924
  this.rememberRoutedInbound(item.localId);
1879
1925
  }
1926
+ if (deferred > 0) {
1927
+ logger.debug(`[API] Relay-delivered message(s) above a seq gap wait for catch-up: ${deferred}`);
1928
+ this.receiveSync.invalidate();
1929
+ }
1880
1930
  callback({ ok: true, messages: stored });
1881
1931
  } catch (error) {
1882
1932
  const routed = batch.filter((item) => this.routedInboundLocalIds.has(item.localId)).length;
@@ -3014,7 +3064,7 @@ class ApiClient {
3014
3064
  return new ApiSessionClient(this.credential.token, session, opts);
3015
3065
  }
3016
3066
  async machineSyncClient(machine) {
3017
- const { ApiMachineClient } = await import('./apiMachine-wp0hWG3F.mjs');
3067
+ const { ApiMachineClient } = await import('./apiMachine-BcjccOmd.mjs');
3018
3068
  return new ApiMachineClient(this.credential.token, machine);
3019
3069
  }
3020
3070
  push() {
@@ -1,44 +1,44 @@
1
1
  import { io } from 'socket.io-client';
2
2
  import { a as webPanelsSignature } from './webPanels-B2_C2-3g.mjs';
3
- import { l as logger } from './logger-D2qd0mMg.mjs';
4
- import { R as RpcHandlerManager, i as isRateQuotaCode, p as pauseForRateQuota, s as socketConnectGuard, c as connectGuarded, a as answerSocketRequest, e as shouldReconnect, d as describeSocketAckDrop } from './lidState-CBjQEwTt.mjs';
5
- import { i as isClaudeSessionId, s as stableVersion, a as sanitizeTagList, p as pickMirrorForTerminal, l as liveSnapshotChanged, b as sanitizeLiveSnapshot, c as serializeLiveSnapshot, r as registerWorktreeHandlers, d as configureWorktreeService, e as summarizeSpawnSessionForLog, f as parseMirrorSendParams } from './mirrorProtocol-DTHWtAE5.mjs';
6
- import { c as configuration } from './configuration-CVgUe2qN.mjs';
3
+ import { l as logger } from './logger-BjXkscIr.mjs';
4
+ import { R as RpcHandlerManager, i as isRateQuotaCode, p as pauseForRateQuota, s as socketConnectGuard, c as connectGuarded, a as answerSocketRequest, e as shouldReconnect, d as describeSocketAckDrop } from './lidState-CG9jFcML.mjs';
5
+ import { i as isClaudeSessionId, s as stableVersion, a as sanitizeTagList, p as pickMirrorForTerminal, l as liveSnapshotChanged, b as sanitizeLiveSnapshot, c as serializeLiveSnapshot, r as registerWorktreeHandlers, d as configureWorktreeService, e as summarizeSpawnSessionForLog, f as parseMirrorSendParams } from './mirrorProtocol-C3Anki4S.mjs';
6
+ import { c as configuration } from './configuration-HPdj5Til.mjs';
7
7
  import { w as withCurrentCliUpdateState } from './cliUpdate-Y34VGe9Y.mjs';
8
- import { r as registerCommonHandlers } from './registerCommonHandlers-CyAtDNvs.mjs';
8
+ import { r as registerCommonHandlers } from './registerCommonHandlers-DpBxSCBi.mjs';
9
9
  import { stat, readdir, lstat, open, readFile, rm, mkdir, chmod, writeFile, rename } from 'node:fs/promises';
10
10
  import { join, isAbsolute, resolve } from 'node:path';
11
11
  import os, { homedir } from 'node:os';
12
12
  import { f as fsMkdir } from './fsMkdir-DumgLTzR.mjs';
13
13
  import { spawn, execFile, spawnSync } from 'node:child_process';
14
- import { r as readSettings, c as readPersistedSessions, o as readTrackedClaudeSessionIds, p as readTrackedCodexThreadIds } from './persistence-DFtgQvr6.mjs';
14
+ import { r as readSettings, c as readPersistedSessions, o as readTrackedClaudeSessionIds, p as readTrackedCodexThreadIds } from './persistence-CmVwM5uq.mjs';
15
15
  import { M as ModelConfigError } from './fileStore-5qpetZS0.mjs';
16
16
  import { e as encodeBase64, g as encrypt, h as decrypt, d as decodeBase64 } from './authRelay-DhQhkBvX.mjs';
17
17
  import { p as prepareClipboardText, d as prepareClipboardHistoryText } from './limits-DIo7rEBR.mjs';
18
- import { b as backoff, d as delay } from './time-Du0scQeJ.mjs';
18
+ import { b as backoff, d as delay } from './time-BbJ-NWcl.mjs';
19
19
  import * as pty from 'node-pty';
20
20
  import { a as attachStartupCommand, v as validateTerminalTags, d as deriveAutoTitle, T as TMUX_SESSION_ID_RE, i as isSafeTmuxSessionName, b as isVhSessionName, U as USER_SESSIONS_FORMAT, p as parseUserSessions, L as LIST_SESSIONS_FORMAT, c as parseSessionListLine, e as LIST_FIELD_SEP, s as sendToVhTerminal } from './terminals-Dlg0x3nY.mjs';
21
21
  import { t as tmuxArgs, V as VH_TMUX_SOCKET_ENV, a as scrubTmuxClientEnv } from './tmuxSocket-B8Yx20sT.mjs';
22
- import { locateClaudeConversation, refreshAgentHomes } from './index-C7zgeuLP.mjs';
22
+ import { locateClaudeConversation, refreshAgentHomes } from './index-Wf6mKJq9.mjs';
23
23
  import { randomBytes } from 'node:crypto';
24
24
  import { readdirSync, unlinkSync, existsSync, mkdirSync, writeFileSync, readFileSync, statSync, chmodSync, renameSync, rmSync, accessSync, constants } from 'node:fs';
25
25
  import axios from 'axios';
26
26
  import { p as projectPath } from './projectPath-BTBIMB57.mjs';
27
27
  import { a as isValidTerminalId } from './ids-DU6sLx4C.mjs';
28
28
  import { d as detectCLIAvailability } from './detectCLI-CSGMlV51.mjs';
29
- import { d as detectResumeSupport } from './localHappyAgentAuth-CcWGU_lS.mjs';
29
+ import { d as detectResumeSupport } from './localHappyAgentAuth-CWha8BiX.mjs';
30
30
  import { g as getProjectPath, a as getClaudeProjectsRoot } from './path-D2wdaNSk.mjs';
31
31
  import { i as isVeryHappyOneShotPrompt } from './oneShotPrompts-DT4p6RNd.mjs';
32
- import { f as forkSession, F as ForkSourceMissingError, d as discardForkedSession, l as listClaudeRewindPoints, a as forkAndTruncateSession, b as ForkTruncateUuidNotFoundError, c as forkBeforeUserMessage } from './claudeSessionFork-C9nB7fs5.mjs';
33
- import { C as CodexAppServerClient } from './codexAppServerClient-CmOIqiNQ.mjs';
32
+ import { f as forkSession, F as ForkSourceMissingError, d as discardForkedSession, l as listClaudeRewindPoints, a as forkAndTruncateSession, b as ForkTruncateUuidNotFoundError, c as forkBeforeUserMessage } from './claudeSessionFork-JPEHVbfR.mjs';
33
+ import { C as CodexAppServerClient } from './codexAppServerClient-CM3O0zHW.mjs';
34
34
  import { J as RelayCandidatesResponseSchema, H as RelayAssignmentResponseSchema, R as ReleaseDrainNoticeSchema } from './index-DisBaRvM.mjs';
35
35
  import { f as forkCodexThread, C as CodexForkRewindPointNotFoundError, l as listCodexRewindPoints, a as forkCodexBeforeUserMessage } from './codexThreadFork-R76RU5H0.mjs';
36
- import { p as planRateLimitWrite, m as mergeRateLimitReports } from './rateLimitWindows-DM_gshI4.mjs';
36
+ import { p as planRateLimitWrite, m as mergeRateLimitReports } from './rateLimitWindows-D9mQRGHv.mjs';
37
37
  import 'chalk';
38
38
  import 'node:util';
39
39
  import 'os';
40
40
  import 'child_process';
41
- import './package-Ek5FOyEo.mjs';
41
+ import './package-Do0Y9bGA.mjs';
42
42
  import 'util';
43
43
  import 'fs/promises';
44
44
  import 'crypto';
@@ -2,45 +2,45 @@
2
2
 
3
3
  var socket_ioClient = require('socket.io-client');
4
4
  var webPanels = require('./webPanels-FCgFKvVe.cjs');
5
- var logger = require('./logger-CrtT0opS.cjs');
6
- var lidState = require('./lidState-C4YgPn6y.cjs');
7
- var mirrorProtocol = require('./mirrorProtocol-D4CR5I5W.cjs');
8
- var configuration = require('./configuration-C9Sx-Foo.cjs');
5
+ var logger = require('./logger-CIUMiSLo.cjs');
6
+ var lidState = require('./lidState-wwiu6M3p.cjs');
7
+ var mirrorProtocol = require('./mirrorProtocol-CMJ2HOZF.cjs');
8
+ var configuration = require('./configuration-CwfmwaLU.cjs');
9
9
  var cliUpdate = require('./cliUpdate-DsKXPFYp.cjs');
10
- var registerCommonHandlers = require('./registerCommonHandlers-CRqKXwQt.cjs');
10
+ var registerCommonHandlers = require('./registerCommonHandlers-K-BTp2iR.cjs');
11
11
  var promises = require('node:fs/promises');
12
12
  var path = require('node:path');
13
13
  var os = require('node:os');
14
14
  var fsMkdir = require('./fsMkdir-0K3yENml.cjs');
15
15
  var node_child_process = require('node:child_process');
16
- var persistence = require('./persistence-IYH6bAXY.cjs');
16
+ var persistence = require('./persistence-CNWBdUH2.cjs');
17
17
  var fileStore = require('./fileStore-7qhnbs6N.cjs');
18
18
  var authRelay = require('./authRelay-Dy1qU9td.cjs');
19
19
  var limits = require('./limits-C-a7gr04.cjs');
20
- var time = require('./time-D-8GFCE7.cjs');
20
+ var time = require('./time-BCGGrWp4.cjs');
21
21
  var pty = require('node-pty');
22
22
  var terminals = require('./terminals-B_bfC9c2.cjs');
23
23
  var tmuxSocket = require('./tmuxSocket-D-Xt6Vn-.cjs');
24
- var index = require('./index-BsoUsrKS.cjs');
24
+ var index = require('./index-Dzb_Bsfu.cjs');
25
25
  var node_crypto = require('node:crypto');
26
26
  var node_fs = require('node:fs');
27
27
  var axios = require('axios');
28
28
  var projectPath = require('./projectPath-C3ioB4Bu.cjs');
29
29
  var ids = require('./ids-B6ZC0HGt.cjs');
30
30
  var detectCLI = require('./detectCLI-BuYR_Qxe.cjs');
31
- var localHappyAgentAuth = require('./localHappyAgentAuth-BzCuIkzi.cjs');
31
+ var localHappyAgentAuth = require('./localHappyAgentAuth-UoytSUX0.cjs');
32
32
  var path$1 = require('./path-B7zW-WwE.cjs');
33
33
  var oneShotPrompts = require('./oneShotPrompts-CL0dip9C.cjs');
34
- var claudeSessionFork = require('./claudeSessionFork-jq-_WiAu.cjs');
35
- var codexAppServerClient = require('./codexAppServerClient-DF12ZSw1.cjs');
34
+ var claudeSessionFork = require('./claudeSessionFork-DMdeScGk.cjs');
35
+ var codexAppServerClient = require('./codexAppServerClient-DGeqZViU.cjs');
36
36
  var index$1 = require('./index-Ub-5xbcU.cjs');
37
37
  var codexThreadFork = require('./codexThreadFork-DNekT4nQ.cjs');
38
- var rateLimitWindows = require('./rateLimitWindows-CeogT1b6.cjs');
38
+ var rateLimitWindows = require('./rateLimitWindows-1WoBs8ln.cjs');
39
39
  require('chalk');
40
40
  require('node:util');
41
41
  require('os');
42
42
  require('child_process');
43
- require('./package-DczR1k0c.cjs');
43
+ require('./package-CRDjc5vK.cjs');
44
44
  require('util');
45
45
  require('fs/promises');
46
46
  require('crypto');
@@ -1,8 +1,8 @@
1
1
  import { randomUUID } from 'node:crypto';
2
2
  import { writeFile, rename, unlink } from 'node:fs/promises';
3
3
  import { join, basename } from 'node:path';
4
- import { M as MAX_CHAT_ATTACHMENT_SOURCE_BYTES } from './pushNotifications-gVJWGFBP.mjs';
5
- import { e as ensurePrivateDirectory, h as hardenPrivateFile } from './configuration-CVgUe2qN.mjs';
4
+ import { M as MAX_CHAT_ATTACHMENT_SOURCE_BYTES } from './pushNotifications-DnpJJ7VR.mjs';
5
+ import { e as ensurePrivateDirectory, h as hardenPrivateFile } from './configuration-HPdj5Til.mjs';
6
6
 
7
7
  const CLAUDE_ATTACHMENT_KINDS = [
8
8
  "image/jpeg",
@@ -3,8 +3,8 @@
3
3
  var node_crypto = require('node:crypto');
4
4
  var promises = require('node:fs/promises');
5
5
  var path = require('node:path');
6
- var pushNotifications = require('./pushNotifications-BgQ_QTgS.cjs');
7
- var configuration = require('./configuration-C9Sx-Foo.cjs');
6
+ var pushNotifications = require('./pushNotifications-C651e0ZZ.cjs');
7
+ var configuration = require('./configuration-CwfmwaLU.cjs');
8
8
 
9
9
  const CLAUDE_ATTACHMENT_KINDS = [
10
10
  "image/jpeg",
@@ -1,14 +1,14 @@
1
1
  'use strict';
2
2
 
3
3
  var authRelay = require('./authRelay-Dy1qU9td.cjs');
4
- var configuration = require('./configuration-C9Sx-Foo.cjs');
4
+ var configuration = require('./configuration-CwfmwaLU.cjs');
5
5
  var node_crypto = require('node:crypto');
6
6
  var tweetnacl = require('tweetnacl');
7
7
  var axios = require('axios');
8
- var time = require('./time-D-8GFCE7.cjs');
9
- var persistence = require('./persistence-IYH6bAXY.cjs');
10
- var browser = require('./browser-D9D-1eqa.cjs');
11
- var logger = require('./logger-CrtT0opS.cjs');
8
+ var time = require('./time-BCGGrWp4.cjs');
9
+ var persistence = require('./persistence-CNWBdUH2.cjs');
10
+ var browser = require('./browser-Ch50ZchJ.cjs');
11
+ var logger = require('./logger-CIUMiSLo.cjs');
12
12
 
13
13
  function generateWebAuthUrl(publicKey) {
14
14
  const publicKeyBase64 = authRelay.encodeBase64(publicKey, "base64url");