very-happy-cli 0.2.178 → 0.2.179

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 (201) hide show
  1. package/dist/{AcpBackend-DCQXHRzT.mjs → AcpBackend-CHp3y7cb.mjs} +135 -16
  2. package/dist/{AcpBackend-CDkAQXYf.cjs → AcpBackend-DFipFF7-.cjs} +135 -16
  3. package/dist/{AcpSessionManager-DckmUZza.cjs → AcpSessionManager-0zpvRJXc.cjs} +38 -4
  4. package/dist/{AcpSessionManager-BXrQcqwC.mjs → AcpSessionManager-d2-rKWWa.mjs} +38 -4
  5. package/dist/{BasePermissionHandler-DyLmKKtO.cjs → BasePermissionHandler-CH3zuEkA.cjs} +5 -2
  6. package/dist/{BasePermissionHandler-BVlrEhIi.mjs → BasePermissionHandler-DdZBYIR4.mjs} +5 -2
  7. package/dist/acpSessionResume-DTGmAPLt.mjs +67 -0
  8. package/dist/acpSessionResume-oiCBnAVA.cjs +74 -0
  9. package/dist/{agentHome-CEp9RMyK.cjs → agentHome-BWcz8mz0.cjs} +4 -4
  10. package/dist/{agentHome-C1xi37as.mjs → agentHome-CghLvL_1.mjs} +4 -4
  11. package/dist/{api-JANhFdZV.cjs → api-Cmjfr8Z7.cjs} +28 -260
  12. package/dist/{api-Dib0dmqC.mjs → api-CzwFpJQc.mjs} +21 -253
  13. package/dist/{apiMachine-DNTJidYH.mjs → apiMachine-DJkTEiqy.mjs} +43 -15
  14. package/dist/{apiMachine-QhK-sKcr.cjs → apiMachine-G6OogT08.cjs} +43 -15
  15. package/dist/{attachmentContent-DkkdpSSJ.mjs → attachmentContent-B2os4HbA.mjs} +2 -2
  16. package/dist/{attachmentContent-bpQTBJ0y.cjs → attachmentContent-Bo0UAsSu.cjs} +4 -4
  17. package/dist/{auth-BRjd2esb.mjs → auth-BS6PaOOG.mjs} +5 -5
  18. package/dist/{auth-DgIV0Cvt.cjs → auth-D6bBUwZa.cjs} +5 -5
  19. package/dist/{auth-DNct7VUi.mjs → auth-DMX0xPNK.mjs} +8 -8
  20. package/dist/{auth-omWDtgR8.cjs → auth-HEhRaNgL.cjs} +8 -8
  21. package/dist/{auto-CI16FZmX.cjs → auto-C6I55iOh.cjs} +18 -17
  22. package/dist/{auto-DKGFOJBo.mjs → auto-Cl1SEDcD.mjs} +18 -17
  23. package/dist/{bootstrap-DCQ87Aan.cjs → bootstrap-exVucYav.cjs} +2 -2
  24. package/dist/{bootstrap-BUagGC_-.mjs → bootstrap-iuyufnp3.mjs} +2 -2
  25. package/dist/{browser-CSKhc0Bl.cjs → browser-BohJK12g.cjs} +1 -1
  26. package/dist/{browser-Dj_DYQEh.mjs → browser-CSYum7xH.mjs} +1 -1
  27. package/dist/{claudeLocal-CCCvAeMd.mjs → claudeLocal-Dq_R3Ax_.mjs} +6 -5
  28. package/dist/{claudeLocal-CdIVnOZp.cjs → claudeLocal-re4yjSTx.cjs} +6 -5
  29. package/dist/{claudeLocalLauncher-21-xh5gc.cjs → claudeLocalLauncher-B4hJHpCA.cjs} +11 -10
  30. package/dist/{claudeLocalLauncher-BmrpaRYJ.mjs → claudeLocalLauncher-CN67lN7-.mjs} +11 -10
  31. package/dist/{claudeSessionFork-DvxMKAmY.mjs → claudeSessionFork-BihfD0Ik.mjs} +1 -1
  32. package/dist/{claudeSessionFork-kYCP1IJB.cjs → claudeSessionFork-DiSMYerV.cjs} +1 -1
  33. package/dist/{client-Dnza1hgN.cjs → client-BKcK1Bi-.cjs} +3 -3
  34. package/dist/client-BhoEBnuN.mjs +71 -0
  35. package/dist/{client-C4zKGjiJ.cjs → client-CuVdN6PP.cjs} +2 -2
  36. package/dist/{client-BTX9hsbr.mjs → client-DuTDwWSQ.mjs} +3 -3
  37. package/dist/client-ZjOsn6nZ.cjs +76 -0
  38. package/dist/{client-CnlkkrZO.mjs → client-wo9nbxuf.mjs} +2 -2
  39. package/dist/codex/happyMcpStdioBridge.cjs +24 -15
  40. package/dist/codex/happyMcpStdioBridge.mjs +24 -15
  41. package/dist/{codexAppServerClient-DvkpQgyv.mjs → codexAppServerClient-BK3zra_1.mjs} +3 -3
  42. package/dist/{codexAppServerClient-CRlBWGn3.cjs → codexAppServerClient-Dt5zxrun.cjs} +3 -3
  43. package/dist/{codexCommand-BxjogBzU.mjs → codexCommand-B6pY7CMh.mjs} +65 -60
  44. package/dist/{codexCommand-DzxIWXIT.cjs → codexCommand-CAZ1SLjg.cjs} +88 -83
  45. package/dist/{codexTermination-ySDNMEhd.mjs → codexTermination-Cd1Eon_4.mjs} +1 -1
  46. package/dist/{codexTermination-C28FzlLb.cjs → codexTermination-DmGbHxcD.cjs} +1 -1
  47. package/dist/{config-DwfEpFr3.mjs → config-2oMG_fEI.mjs} +3 -3
  48. package/dist/{config-BFB5uJ4t.cjs → config-B0uK6K7n.cjs} +3 -3
  49. package/dist/{configuration-4TGMrjul.cjs → configuration-CMHZnp6G.cjs} +1 -1
  50. package/dist/{configuration-DVrb61aY.mjs → configuration-WMi4idBB.mjs} +1 -1
  51. package/dist/{connect-C7FPY0PI.mjs → connect-BLVHhHzA.mjs} +14 -14
  52. package/dist/{connect-QH2VJGBG.cjs → connect-uaglGrde.cjs} +14 -14
  53. package/dist/{context-JoKu0V54.cjs → context-DXzU5bFM.cjs} +1 -1
  54. package/dist/{context-B3XPVJlj.mjs → context-DploEcoN.mjs} +1 -1
  55. package/dist/{controlClient-BYKyGyxj.mjs → controlClient-BWUJrj3t.mjs} +3 -3
  56. package/dist/{controlClient-BTaZlbC6.cjs → controlClient-C-5qCt8W.cjs} +3 -3
  57. package/dist/{createSessionMetadata-8Fuj2-IV.mjs → createSessionMetadata-3uXrJgOW.mjs} +2 -2
  58. package/dist/{createSessionMetadata-B2NynaWZ.cjs → createSessionMetadata-BkIzHALd.cjs} +2 -2
  59. package/dist/{defaultPermissionMode-B8kJG9uI.mjs → defaultPermissionMode-BzxLh20a.mjs} +2 -2
  60. package/dist/{defaultPermissionMode-BEWCqJU-.cjs → defaultPermissionMode-pS3vmiSg.cjs} +2 -2
  61. package/dist/{deterministicJson-BjNQsAjO.cjs → deterministicJson-B8z2GPi9.cjs} +220 -14
  62. package/dist/{deterministicJson-C5ZwZ7hu.mjs → deterministicJson-D_whDMFd.mjs} +217 -12
  63. package/dist/{doctor-BshRnjLi.cjs → doctor-Br1Kcy2J.cjs} +7 -7
  64. package/dist/{doctor-0BiGwJXk.mjs → doctor-CmtSsR2-.mjs} +7 -7
  65. package/dist/{downloadTarget-BN5vZt3K.cjs → downloadTarget-BQJK_6oH.cjs} +6 -6
  66. package/dist/{downloadTarget-DJPwAZlu.mjs → downloadTarget-BoNwTIH_.mjs} +6 -6
  67. package/dist/{ensureDaemonRunning-C5QfToCe.cjs → ensureDaemonRunning-BRUmsq6J.cjs} +5 -5
  68. package/dist/{ensureDaemonRunning-CSmb_mqt.mjs → ensureDaemonRunning-Czo9IHJQ.mjs} +5 -5
  69. package/dist/{handleResumeCommand-CgjpsdDe.mjs → handleResumeCommand-C8thKjqf.mjs} +21 -5
  70. package/dist/{handleResumeCommand-BwnUZmbo.cjs → handleResumeCommand-tKD_Hpxc.cjs} +21 -5
  71. package/dist/{index-BYOZ_8WZ.cjs → index-B0UjHlAe.cjs} +4 -4
  72. package/dist/{index-BehVbAsA.mjs → index-BTxHphpV.mjs} +254 -49
  73. package/dist/index-BiyC7cZ3.mjs +18 -0
  74. package/dist/{index-_l1Sdmbi.cjs → index-C6O2vVjm.cjs} +154 -33
  75. package/dist/index-CUuc6iCn.cjs +24 -0
  76. package/dist/{index-Bvldtdny.mjs → index-CdQI0C9p.mjs} +4 -4
  77. package/dist/{index-BRClDe07.cjs → index-D09T1m8Y.cjs} +3 -3
  78. package/dist/{index-BYgfern_.mjs → index-D3bidoG8.mjs} +3 -3
  79. package/dist/{index-piJPsTsm.cjs → index-DMqDMT1Q.cjs} +256 -51
  80. package/dist/{index-Clqlu17M.mjs → index-DPOa4NhL.mjs} +153 -34
  81. package/dist/index.cjs +2 -2
  82. package/dist/index.mjs +2 -2
  83. package/dist/{install-BdvKiOQw.mjs → install-BX3lv3NO.mjs} +1 -1
  84. package/dist/{install-Cf6AFSWC.cjs → install-BXvf2E3o.cjs} +1 -1
  85. package/dist/{install-TO4taKW7.cjs → install-CYRZxS87.cjs} +3 -3
  86. package/dist/{install-fYWHrPcC.mjs → install-hnve_9vq.mjs} +3 -3
  87. package/dist/lib.cjs +13 -13
  88. package/dist/lib.d.cts +62 -1
  89. package/dist/lib.d.mts +62 -1
  90. package/dist/lib.mjs +13 -13
  91. package/dist/{lidState-DNMlIhX0.mjs → lidState-Bb8fgXg3.mjs} +1 -1
  92. package/dist/{lidState-BeOwj6eW.cjs → lidState-Dv2wwFTj.cjs} +1 -1
  93. package/dist/{localHappyAgentAuth-Br-mgogg.cjs → localHappyAgentAuth-DjYvkXvV.cjs} +1 -1
  94. package/dist/{localHappyAgentAuth-BezKSFDi.mjs → localHappyAgentAuth-NEU7fax7.mjs} +1 -1
  95. package/dist/{logger--vAVtXB_.mjs → logger-BtVhHnD8.mjs} +2 -2
  96. package/dist/{logger-DXTWlPzP.cjs → logger-C1GWx3gi.cjs} +2 -2
  97. package/dist/{machineMetadata-DcUupMje.cjs → machineMetadata-CLHS9sv_.cjs} +3 -3
  98. package/dist/{machineMetadata-B1H9gNbN.mjs → machineMetadata-D-g--oU_.mjs} +3 -3
  99. package/dist/{main-CshDb5-1.mjs → main-B2LWV8DI.mjs} +58 -45
  100. package/dist/{main-DoMFJ2Cl.cjs → main-CWhSsbtU.cjs} +58 -45
  101. package/dist/{mcp-pNc1EbQf.cjs → mcp-CARUsXHV.cjs} +14 -14
  102. package/dist/{mcp-DKT_lrvQ.mjs → mcp-ext92q3Y.mjs} +14 -14
  103. package/dist/{mirrorProtocol-6IFGPpjJ.mjs → mirrorProtocol-BwYibqry.mjs} +3 -3
  104. package/dist/{mirrorProtocol-qKflWTX_.cjs → mirrorProtocol-DEy2g1CB.cjs} +3 -3
  105. package/dist/{package-B7B03ejW.mjs → package-BPPebGQF.mjs} +7 -7
  106. package/dist/{package-DY4zTbKS.cjs → package-SgqTYsjn.cjs} +7 -7
  107. package/dist/panels-BZ0_Tt7B.mjs +137 -0
  108. package/dist/panels-D1c7q2dD.cjs +142 -0
  109. package/dist/{peerTools-3R9RUARX.mjs → peerTools-CWKzcQ7u.mjs} +60 -10
  110. package/dist/{peerTools-iy3_6Yc5.cjs → peerTools-DRQETXaz.cjs} +60 -9
  111. package/dist/{persistence-BfX72dne.cjs → persistence-BegE7NPa.cjs} +2 -2
  112. package/dist/{persistence-DTk4sNpd.mjs → persistence-Cr-wutZ4.mjs} +3 -3
  113. package/dist/{piRunnerArgs-CRQVR9o-.cjs → piRunnerArgs-Cs-378Vz.cjs} +8 -2
  114. package/dist/{piRunnerArgs-AT8QJY7x.mjs → piRunnerArgs-DwvM_yWA.mjs} +7 -1
  115. package/dist/{piRuntime-BHRT5MKO.cjs → piRuntime-BG-1td_n.cjs} +2 -2
  116. package/dist/{piRuntime-E44qTVQ4.mjs → piRuntime-Bue5mnlc.mjs} +2 -2
  117. package/dist/{piTerminal-De8nbciM.mjs → piTerminal-B5x9X5yV.mjs} +17 -17
  118. package/dist/{piTerminal-hI4WFdWm.cjs → piTerminal-G4z-xVyy.cjs} +17 -17
  119. package/dist/processTreeSnapshot-CuLJDNC-.mjs +101 -0
  120. package/dist/processTreeSnapshot-mDbnuojn.cjs +105 -0
  121. package/dist/prompt-BOouDaTM.mjs +99 -0
  122. package/dist/prompt-lgF9IE82.cjs +105 -0
  123. package/dist/{attachmentLimits-UyFn8fkQ.mjs → pushNotifications-BdFjDjQe.mjs} +303 -3
  124. package/dist/{attachmentLimits-SqeAHrVC.cjs → pushNotifications-DaLQUyi0.cjs} +304 -2
  125. package/dist/{index-DFPT4HOO.cjs → query-Ctfg-5gy.cjs} +25 -5
  126. package/dist/{index-CEjJnq05.mjs → query-DYP_W1wp.mjs} +26 -3
  127. package/dist/{rateLimitWindows-XrJiiBpU.mjs → rateLimitWindows-CuEqk_0g.mjs} +1 -1
  128. package/dist/{rateLimitWindows-Czb7_7cK.cjs → rateLimitWindows-Dj_8voBK.cjs} +1 -1
  129. package/dist/{registerCommonHandlers-CvIedVRf.mjs → registerCommonHandlers-BAlP7SGc.mjs} +2 -2
  130. package/dist/{registerCommonHandlers-C0_fyBQ0.cjs → registerCommonHandlers-Cj084Sg7.cjs} +2 -2
  131. package/dist/{registerKillSessionHandler-gwJ5lTf0.mjs → registerKillSessionHandler-PD0jWtQo.mjs} +6 -6
  132. package/dist/{registerKillSessionHandler-DYl7l4Ts.cjs → registerKillSessionHandler-qMju0ZfF.cjs} +6 -6
  133. package/dist/{remoteSessionClient-BRTIOX5b.cjs → remoteSessionClient-B7i7MkYV.cjs} +5 -5
  134. package/dist/{remoteSessionClient-DRb2Jr5s.mjs → remoteSessionClient-Bn2qu5C5.mjs} +5 -5
  135. package/dist/{reportProgressTool-B9nCzbkL.cjs → reportProgressTool-CM1JFAHg.cjs} +84 -2
  136. package/dist/{reportProgressTool-D5tEoXMW.mjs → reportProgressTool-gHItlSzz.mjs} +82 -3
  137. package/dist/{resources-JDPugcDq.cjs → resources-CvIlkzpP.cjs} +30 -0
  138. package/dist/{resources-BdFBQi8r.mjs → resources-y9jfyO-_.mjs} +30 -0
  139. package/dist/{run-BQ_FGaOL.mjs → run-BM4TxiyN.mjs} +177 -41
  140. package/dist/{run-CKe_WeLW.cjs → run-CNXwIe0A.cjs} +191 -55
  141. package/dist/{runClaude-MHI5IKM-.cjs → runClaude-CWhj2V4Q.cjs} +36 -40
  142. package/dist/{runClaude-zrrNcQC_.mjs → runClaude-C_3I8hvR.mjs} +36 -40
  143. package/dist/{runClaudeDeps-RRw-Nusc.cjs → runClaudeDeps-B81cOKnH.cjs} +294 -156
  144. package/dist/{runClaudeDeps-CVBCokOS.mjs → runClaudeDeps-QGrOeDe2.mjs} +294 -159
  145. package/dist/{runGemini-kipag2ag.mjs → runGemini-BEdWEZLR.mjs} +60 -54
  146. package/dist/{runGemini-D7Lg9yCr.cjs → runGemini-CgRLYbt5.cjs} +60 -54
  147. package/dist/{runOpenClaw-DCcQ0L2N.cjs → runOpenClaw-C1NVmzOL.cjs} +18 -18
  148. package/dist/{runOpenClaw-C_lRY3Do.mjs → runOpenClaw-DdQZAYj1.mjs} +18 -18
  149. package/dist/{sandbox-BSyXFVFp.mjs → sandbox-DjQUdCMG.mjs} +4 -4
  150. package/dist/{sandbox-dMwPTmjm.cjs → sandbox-nocIjliq.cjs} +4 -4
  151. package/dist/selfCheck-CjCF4C3v.mjs +85 -0
  152. package/dist/{selfCheck-DkzDDUsE.cjs → selfCheck-DCt4Uzbq.cjs} +36 -35
  153. package/dist/{send-C-k9nsd3.mjs → send-Ct7X4pPU.mjs} +8 -8
  154. package/dist/{send-dxC0miIA.cjs → send-Dydf_hwZ.cjs} +8 -8
  155. package/dist/{server-B-W6P7Qr.cjs → server-CosABFbd.cjs} +6 -6
  156. package/dist/{server-DxoTYNlw.mjs → server-DTQGZMxh.mjs} +4 -4
  157. package/dist/{sessionLock-DWX6BbiU.cjs → sessionLock-DokGab2R.cjs} +16 -3
  158. package/dist/{sessionLock-DBdtZGOL.mjs → sessionLock-WYIyaVO4.mjs} +16 -4
  159. package/dist/{sessionOps-BVoXe12O.mjs → sessionOps-BIGgRube.mjs} +10 -5
  160. package/dist/{sessionOps-BAnr7n8t.cjs → sessionOps-S-qPBLFf.cjs} +10 -5
  161. package/dist/{sessionScanner-CDOYsEUD.cjs → sessionScanner-CIMM2hvZ.cjs} +3 -3
  162. package/dist/{sessionScanner-BtxoeluY.mjs → sessionScanner-o5hnMi5e.mjs} +3 -3
  163. package/dist/{sessions-C3sZJkzI.mjs → sessions-BJHEZpi2.mjs} +39 -17
  164. package/dist/{sessions-hAitoN-m.cjs → sessions-JchI1w3z.cjs} +39 -16
  165. package/dist/{setupOfflineReconnection-C2EeYTFH.cjs → setupOfflineReconnection-CNiAt5ZP.cjs} +2 -2
  166. package/dist/{setupOfflineReconnection-_eD4cuUT.mjs → setupOfflineReconnection-DMiBO2y9.mjs} +2 -2
  167. package/dist/{spawn-Bc9v7pIf.cjs → spawn-6PD7nnoC.cjs} +48 -17
  168. package/dist/{spawn-qNrB2CD_.mjs → spawn-DgvUNYEo.mjs} +48 -17
  169. package/dist/{spawnAgents-BVEaz35W.cjs → spawnAgents-DsXgegHM.cjs} +37 -1
  170. package/dist/spawnAgents-P006Hqio.mjs +79 -0
  171. package/dist/{spawnHappyCLI-C2stUioM.mjs → spawnHappyCLI-CCOrEtf9.mjs} +1 -1
  172. package/dist/{spawnHappyCLI-fzUagkKV.cjs → spawnHappyCLI-Dywezwk6.cjs} +1 -1
  173. package/dist/{specialCommands-C6W-rVyh.mjs → specialCommands-DPcd9edP.mjs} +3 -3
  174. package/dist/{specialCommands-BJ-nqY4s.cjs → specialCommands-QxPpkGKf.cjs} +3 -3
  175. package/dist/{startFileWatcher-CR09Snmz.mjs → startFileWatcher-DghDOCO4.mjs} +1 -1
  176. package/dist/{startFileWatcher-Bqlqjt93.cjs → startFileWatcher-RECH5qY8.cjs} +1 -1
  177. package/dist/{streamRelay-CJoMk_d2.mjs → streamRelay-DMV_TXfS.mjs} +1 -1
  178. package/dist/{streamRelay-9kBPpbvU.cjs → streamRelay-DlUWKUpo.cjs} +1 -1
  179. package/dist/{sync-DbW07iQS.mjs → sync-CSe0Rf45.mjs} +1 -1
  180. package/dist/{sync-Dhmtk66S.cjs → sync-D23jbqVa.cjs} +1 -1
  181. package/dist/{systemPrompt-3PYi3EUY.cjs → systemPrompt-BOy4kU4P.cjs} +4 -3
  182. package/dist/{systemPrompt-CQcuUmVp.mjs → systemPrompt-CFNKnh65.mjs} +4 -3
  183. package/dist/{teams-CwF4Z2fA.mjs → teams-DyY669f0.mjs} +8 -8
  184. package/dist/{teams-DpxLcUU_.cjs → teams-Ov2BDT-A.cjs} +8 -8
  185. package/dist/{time-BuGWTVP6.mjs → time-65DcU6Jx.mjs} +1 -1
  186. package/dist/{time-A6zR3Iy6.cjs → time-CrwIMHta.cjs} +1 -1
  187. package/dist/{titleGenerator-D26gvNaS.cjs → titleGenerator-CS_rh2_J.cjs} +9 -8
  188. package/dist/{titleGenerator-BGEzNWC9.mjs → titleGenerator-CiAMxf7s.mjs} +9 -8
  189. package/dist/{todo-DrZc76H5.mjs → todo-BDONw0sK.mjs} +6 -6
  190. package/dist/{todo-73g3NCIO.cjs → todo-KY-okGii.cjs} +6 -6
  191. package/dist/{tools-BtsrQnNS.mjs → tools-D8-PnZEG.mjs} +1 -1
  192. package/dist/{tools-CxJp4T1T.cjs → tools-_w52DZG6.cjs} +1 -1
  193. package/dist/{uninstall-DWNYvewQ.cjs → uninstall-8vnLN-IE.cjs} +3 -3
  194. package/dist/{uninstall-DOb2mTwV.mjs → uninstall-_fjGRP9b.mjs} +3 -3
  195. package/dist/webPanels-B2_C2-3g.mjs +49 -0
  196. package/dist/webPanels-FCgFKvVe.cjs +53 -0
  197. package/package.json +7 -7
  198. package/dist/selfCheck-CF7XGJPb.mjs +0 -84
  199. package/dist/sessionModeFile-ByLbXTbg.mjs +0 -32
  200. package/dist/sessionModeFile-CLLdidiJ.cjs +0 -36
  201. package/dist/spawnAgents-Bw6j4tqz.mjs +0 -45
@@ -1,86 +1,90 @@
1
- import { l as logger } from './logger--vAVtXB_.mjs';
2
- import { q as notifyDaemonSessionEvent, t as notifyDaemonClaudeAuthFailed } from './controlClient-BYKyGyxj.mjs';
3
- export { j as reportSessionEditToDaemon } from './controlClient-BYKyGyxj.mjs';
1
+ import { l as logger } from './logger-BtVhHnD8.mjs';
2
+ import { q as notifyDaemonSessionEvent, t as notifyDaemonClaudeAuthFailed } from './controlClient-BWUJrj3t.mjs';
3
+ export { j as reportSessionEditToDaemon } from './controlClient-BWUJrj3t.mjs';
4
4
  import { s as sameBackgroundTasks, e as createBackgroundTaskTracker } from './backgroundTaskActivity-BVwJBl02.mjs';
5
+ import { c as createProjectInjector, h as hashObject } from './deterministicJson-D_whDMFd.mjs';
6
+ export { s as startHappyServer } from './deterministicJson-D_whDMFd.mjs';
7
+ import { s as sharedProjectsClient } from './client-BhoEBnuN.mjs';
5
8
  import { randomInt, randomUUID, createHash } from 'node:crypto';
6
9
  import { M as MessageBuffer } from './messageBuffer-BWlGgR3A.mjs';
7
- import { query } from './index-CEjJnq05.mjs';
10
+ import { q as query } from './query-DYP_W1wp.mjs';
8
11
  import { AbortError } from '@anthropic-ai/claude-agent-sdk';
9
12
  import { m as mapToClaudeMode, p as parseClaudePermissionMode, c as resolveRemoteClaudePermissionMode } from './permissionMode-CH4FoZfU.mjs';
10
- import { c as claudeCheckSession, s as systemPrompt } from './systemPrompt-CQcuUmVp.mjs';
13
+ import { c as claudeCheckSession, s as systemPrompt } from './systemPrompt-CFNKnh65.mjs';
11
14
  import { join, resolve, dirname } from 'node:path';
12
- import { p as parseSpecialCommand, w as wrapperRateLimitReporter } from './specialCommands-C6W-rVyh.mjs';
15
+ import { p as parseSpecialCommand, w as wrapperRateLimitReporter } from './specialCommands-DPcd9edP.mjs';
13
16
  import 'axios';
14
17
  import 'node:events';
15
18
  import 'socket.io-client';
16
- import { A as AsyncLock } from './attachmentLimits-UyFn8fkQ.mjs';
19
+ import { A as AsyncLock } from './pushNotifications-BdFjDjQe.mjs';
17
20
  import 'tweetnacl';
18
- import { c as configuration, e as ensurePrivateDirectory } from './configuration-DVrb61aY.mjs';
19
- import './index-Clqlu17M.mjs';
20
- import './registerCommonHandlers-CvIedVRf.mjs';
21
+ import { c as configuration, e as ensurePrivateDirectory } from './configuration-WMi4idBB.mjs';
22
+ import './index-DPOa4NhL.mjs';
23
+ import './registerCommonHandlers-BAlP7SGc.mjs';
21
24
  import 'os';
22
25
  import 'child_process';
23
26
  import '@paralleldrive/cuid2';
24
- import './persistence-DTk4sNpd.mjs';
27
+ import './persistence-Cr-wutZ4.mjs';
25
28
  import { c as contentLogMetadata } from './contentLogMetadata-BlWI0egu.mjs';
26
29
  import 'chalk';
27
- export { R as RawJSONLinesSchema } from './types-CkqAACXx.mjs';
30
+ import { R as RawJSONLinesSchema } from './types-CkqAACXx.mjs';
28
31
  import { g as getProjectPath } from './path-D2wdaNSk.mjs';
29
32
  import { access } from 'fs/promises';
30
- import { d as delay } from './time-BuGWTVP6.mjs';
33
+ import { d as delay } from './time-65DcU6Jx.mjs';
31
34
  import { mkdirSync, writeFileSync, readFileSync, unlinkSync, renameSync, statSync, existsSync } from 'node:fs';
32
- import { h as hashObject } from './deterministicJson-C5ZwZ7hu.mjs';
33
- export { s as startHappyServer } from './deterministicJson-C5ZwZ7hu.mjs';
34
- import { F as Future, d as describeClaudeProcessExit } from './sessionScanner-BtxoeluY.mjs';
35
- export { c as createSessionScanner } from './sessionScanner-BtxoeluY.mjs';
35
+ import { F as Future, d as describeClaudeProcessExit } from './sessionScanner-o5hnMi5e.mjs';
36
+ export { c as createSessionScanner } from './sessionScanner-o5hnMi5e.mjs';
36
37
  import { execSync } from 'node:child_process';
37
- import { S as StreamRelay } from './streamRelay-CJoMk_d2.mjs';
38
- import { C as CLAUDE_ATTACHMENT_KINDS, c as chatAttachmentDirectory, a as stageClaudeAttachments, b as appendStagedAttachmentsToPrompt } from './attachmentContent-DkkdpSSJ.mjs';
38
+ import { S as StreamRelay } from './streamRelay-DMV_TXfS.mjs';
39
+ import { C as CLAUDE_ATTACHMENT_KINDS, c as chatAttachmentDirectory, a as stageClaudeAttachments, b as appendStagedAttachmentsToPrompt } from './attachmentContent-B2os4HbA.mjs';
39
40
  import { writeFile, rename, unlink, readFile } from 'node:fs/promises';
40
- import { F as ForkSourceMissingError } from './claudeSessionFork-DvxMKAmY.mjs';
41
- export { M as MessageQueue2, r as registerKillSessionHandler } from './registerKillSessionHandler-gwJ5lTf0.mjs';
42
- export { a as getEnvironmentInfo } from './doctor-0BiGwJXk.mjs';
41
+ import { F as ForkSourceMissingError } from './claudeSessionFork-BihfD0Ik.mjs';
42
+ export { M as MessageQueue2, r as registerKillSessionHandler } from './registerKillSessionHandler-PD0jWtQo.mjs';
43
+ export { a as getEnvironmentInfo } from './doctor-CmtSsR2-.mjs';
43
44
  import { createServer } from 'node:http';
44
45
  export { E as EditReportThrottle, b as extractClaudeEditPaths } from './editPaths-BVfS_FFL.mjs';
45
46
  import { p as projectPath } from './projectPath-BTBIMB57.mjs';
46
- import { r as resolveClaudeBinary, a as runClaudeOneShot } from './titleGenerator-BGEzNWC9.mjs';
47
- export { T as TitleGenerator } from './titleGenerator-BGEzNWC9.mjs';
47
+ export { s as snapshotTree, t as terminateSurvivors } from './processTreeSnapshot-CuLJDNC-.mjs';
48
+ import { r as resolveClaudeBinary, a as runClaudeOneShot } from './titleGenerator-CiAMxf7s.mjs';
49
+ export { T as TitleGenerator } from './titleGenerator-CiAMxf7s.mjs';
48
50
  import { B as BOARD_ANALYZER_PROMPT_PREFIX } from './oneShotPrompts-DT4p6RNd.mjs';
49
- import { i as isSelfReportFresh } from './reportProgressTool-D5tEoXMW.mjs';
50
- export { c as createSelfReportState } from './reportProgressTool-D5tEoXMW.mjs';
51
+ import { i as isSelfReportFresh } from './reportProgressTool-gHItlSzz.mjs';
52
+ export { c as createSelfReportState } from './reportProgressTool-gHItlSzz.mjs';
51
53
  import 'node:util';
52
- import './smallFastModel-BLNgMrwR.mjs';
53
- import './trimIdent-BAjmv_TG.mjs';
54
- import 'node:os';
55
- import './agentGuidance-BDYt2Qy2.mjs';
56
- import './rateLimitWindows-XrJiiBpU.mjs';
54
+ import './prompt-BOouDaTM.mjs';
57
55
  import 'zod';
58
- import './package-B7B03ejW.mjs';
59
- import 'util';
60
- import 'crypto';
61
- import 'path';
62
- import 'cross-spawn';
56
+ import './client-DuTDwWSQ.mjs';
57
+ import './context-DploEcoN.mjs';
58
+ import './sessionOps-BIGgRube.mjs';
63
59
  import './authRelay-DhQhkBvX.mjs';
64
- import './client-BTX9hsbr.mjs';
65
- import './context-B3XPVJlj.mjs';
66
- import './sessionOps-BVoXe12O.mjs';
67
- import './resources-BdFBQi8r.mjs';
68
- import './tools-BtsrQnNS.mjs';
69
- import './peerTools-3R9RUARX.mjs';
60
+ import './resources-y9jfyO-_.mjs';
61
+ import './tools-D8-PnZEG.mjs';
62
+ import './peerTools-CWKzcQ7u.mjs';
63
+ import 'node:os';
70
64
  import './ids-DU6sLx4C.mjs';
71
- import './remoteSessionClient-DRb2Jr5s.mjs';
65
+ import './remoteSessionClient-Bn2qu5C5.mjs';
72
66
  import '@modelcontextprotocol/sdk/server/mcp.js';
73
67
  import '@modelcontextprotocol/sdk/server/streamableHttp.js';
74
68
  import './limits-DIo7rEBR.mjs';
75
- import './downloadTarget-DJPwAZlu.mjs';
69
+ import './downloadTarget-BoNwTIH_.mjs';
76
70
  import './terminals-Dlg0x3nY.mjs';
77
71
  import './terminalTitleSuggest-CeKsX_V6.mjs';
78
72
  import './tmuxSocket-B8Yx20sT.mjs';
79
- import './bootstrap-BUagGC_-.mjs';
73
+ import './bootstrap-iuyufnp3.mjs';
74
+ import './package-BPPebGQF.mjs';
75
+ import './agentGuidance-BDYt2Qy2.mjs';
76
+ import './trimIdent-BAjmv_TG.mjs';
77
+ import './webPanels-B2_C2-3g.mjs';
80
78
  import './previewPath-CXN4Vag0.mjs';
81
- import './sync-DbW07iQS.mjs';
79
+ import 'crypto';
80
+ import './smallFastModel-BLNgMrwR.mjs';
81
+ import './rateLimitWindows-CuEqk_0g.mjs';
82
+ import 'util';
83
+ import 'path';
84
+ import 'cross-spawn';
85
+ import './sync-CSe0Rf45.mjs';
82
86
  import './transcriptCursor-B7T_gkQ0.mjs';
83
- import './startFileWatcher-CR09Snmz.mjs';
87
+ import './startFileWatcher-DghDOCO4.mjs';
84
88
  import 'node:readline';
85
89
  import './doctor-BPkYWSuq.mjs';
86
90
  import 'ps-list';
@@ -88,11 +92,11 @@ import './doctorReadiness-C208SMN9.mjs';
88
92
  import './detectCLI-CSGMlV51.mjs';
89
93
  import 'fs';
90
94
  import './cliUpdate-Y34VGe9Y.mjs';
91
- import './piRunnerArgs-AT8QJY7x.mjs';
92
- import './sessionModeFile-ByLbXTbg.mjs';
95
+ import './piRunnerArgs-DwvM_yWA.mjs';
96
+ import './acpSessionResume-DTGmAPLt.mjs';
93
97
  import 'url';
94
98
  import 'node:module';
95
- import './client-CnlkkrZO.mjs';
99
+ import './client-wo9nbxuf.mjs';
96
100
  import './precheckCompat-DeEbilbr.mjs';
97
101
 
98
102
  const SCHEDULE_WAKEUP_GRACE_MS = 6e4;
@@ -130,6 +134,41 @@ function createScheduledWakeupTracker() {
130
134
  return { observe, pending };
131
135
  }
132
136
 
137
+ function modelTarget(model) {
138
+ return model == null || model === "" ? void 0 : model;
139
+ }
140
+ function needsModelSwitch(current, next) {
141
+ return modelTarget(current) !== modelTarget(next);
142
+ }
143
+ function modelSwitchFailureNotice(model, error) {
144
+ const name = modelTarget(model) ?? "default";
145
+ const detail = error instanceof Error ? error.message : String(error);
146
+ return `\u26A0\uFE0F Could not switch to model "${name}" \u2014 continuing with the previous model. ${detail}`;
147
+ }
148
+
149
+ const CLAUDE_MODEL_NOT_FOUND = "model_not_found";
150
+ function retiredModelFrom(message, runningModel) {
151
+ const m = message;
152
+ if (!m || m.type !== "assistant" || m.error !== CLAUDE_MODEL_NOT_FOUND) return null;
153
+ if ((m.parent_tool_use_id ?? null) !== null) return null;
154
+ return modelTarget(runningModel) ?? null;
155
+ }
156
+ function createRetiredModels() {
157
+ const retired = /* @__PURE__ */ new Set();
158
+ return {
159
+ retire(model) {
160
+ retired.add(model);
161
+ },
162
+ effective(model) {
163
+ const target = modelTarget(model);
164
+ return target !== void 0 && retired.has(target) ? void 0 : target;
165
+ }
166
+ };
167
+ }
168
+ function retiredModelNotice(model) {
169
+ return `\u26A0\uFE0F Model "${model}" is no longer available \u2014 switched this session to the default model. Pick another model to change it, then send your message again.`;
170
+ }
171
+
133
172
  class Session {
134
173
  path;
135
174
  logPath;
@@ -158,6 +197,8 @@ class Session {
158
197
  backgroundTasks = [];
159
198
  /** B-587 review P3-4: CronCreate / ScheduleWakeup pending in this Claude process. */
160
199
  scheduledWakeups = createScheduledWakeupTracker();
200
+ /** B-634 ③: model ids Claude Code reported as model_not_found — session-scoped, survives relaunches. */
201
+ retiredModels = createRetiredModels();
161
202
  /**
162
203
  * Window after a user-initiated abort during which stray promise rejections
163
204
  * from tearing down the SDK query (MCP transports, in-flight tool calls,
@@ -211,6 +252,20 @@ class Session {
211
252
  sessionFoundCallbacks = [];
212
253
  /** Keep alive interval reference for cleanup */
213
254
  keepAliveInterval;
255
+ /**
256
+ * B-645: project context rides in front of real user messages (never the
257
+ * system prompt), so it survives relaunches without touching the mode hash
258
+ * or prewarm key. One per session process; created on first use.
259
+ */
260
+ _projectInjector = null;
261
+ get projectInjector() {
262
+ return this._projectInjector ??= createProjectInjector({
263
+ client: sharedProjectsClient(),
264
+ sessionId: () => this.client.sessionId,
265
+ metadata: () => this.client.getMetadata?.() ?? null,
266
+ agent: "claude"
267
+ });
268
+ }
214
269
  constructor(opts) {
215
270
  this.path = opts.path;
216
271
  this.api = opts.api;
@@ -597,6 +652,112 @@ function createRuntimeControls(isThinking) {
597
652
  return { setQuery, observe, request, stopRunningTasks };
598
653
  }
599
654
 
655
+ const CLAUDE_COMMAND_LIFECYCLE_STATES = ["queued", "started", "completed", "cancelled", "discarded", "refused"];
656
+ function readClaudeCommandLifecycle(frame) {
657
+ const m = frame;
658
+ if (!m) return null;
659
+ const isLifecycle = m.type === "command_lifecycle" || m.type === "system" && m.subtype === "command_lifecycle";
660
+ if (!isLifecycle || typeof m.command_uuid !== "string" || m.command_uuid.length === 0) return null;
661
+ const state = CLAUDE_COMMAND_LIFECYCLE_STATES.find((candidate) => candidate === m.state);
662
+ return state ? { uuid: m.command_uuid, state } : null;
663
+ }
664
+ const uuidList = (value) => Array.isArray(value) ? value.filter((item) => typeof item === "string" && item.length > 0) : [];
665
+ const INTERRUPT_CANCEL_QUEUED_CAPABILITY = "interrupt_cancel_queued_v1";
666
+ const PENDING_MAX = 256;
667
+ const REPORTED_MAX = 512;
668
+ const MSG_LIFECYCLE_CAPABILITY = "msg_lifecycle_v1";
669
+ function createClaudeCommandTracker() {
670
+ const pending = /* @__PURE__ */ new Map();
671
+ const reported = /* @__PURE__ */ new Set();
672
+ const drop = (uuid) => {
673
+ pending.delete(uuid);
674
+ if (reported.has(uuid)) return null;
675
+ reported.add(uuid);
676
+ if (reported.size > REPORTED_MAX) reported.delete(reported.values().next().value);
677
+ return uuid;
678
+ };
679
+ return {
680
+ /** A uuid-stamped user message (prompt or steer) was handed to the Query. */
681
+ track(uuid, payload) {
682
+ if (!pending.has(uuid) && pending.size >= PENDING_MAX) pending.delete(pending.keys().next().value);
683
+ pending.set(uuid, { started: false, payload });
684
+ },
685
+ isTracked(uuid) {
686
+ return pending.has(uuid);
687
+ },
688
+ /** A lifecycle frame; returns the uuids now known to have never run. */
689
+ observe(lifecycle) {
690
+ const entry = pending.get(lifecycle.uuid);
691
+ if (!entry) return [];
692
+ switch (lifecycle.state) {
693
+ case "queued":
694
+ return [];
695
+ case "started":
696
+ entry.started = true;
697
+ return [];
698
+ case "completed":
699
+ pending.delete(lifecycle.uuid);
700
+ return [];
701
+ default: {
702
+ if (entry.started) {
703
+ pending.delete(lifecycle.uuid);
704
+ return [];
705
+ }
706
+ const dropped = drop(lifecycle.uuid);
707
+ return dropped ? [dropped] : [];
708
+ }
709
+ }
710
+ },
711
+ /**
712
+ * An interrupt's receipt: `cancelled` members we track never ran;
713
+ * `still_queued` members we track are returned for the per-uuid
714
+ * follow-up (`cancel_async_message`) a CLI without cancel_queued needs.
715
+ */
716
+ onInterruptReceipt(receipt) {
717
+ const dropped = [];
718
+ for (const uuid of uuidList(receipt?.cancelled)) {
719
+ if (!pending.has(uuid)) continue;
720
+ const result = drop(uuid);
721
+ if (result) dropped.push(result);
722
+ }
723
+ const stillQueued = uuidList(receipt?.still_queued).filter((uuid) => pending.has(uuid));
724
+ return { dropped, stillQueued };
725
+ },
726
+ /** The answer to `cancel_async_message`: true = withdrawn before it ran; false = already dequeued, its lifecycle frames follow. */
727
+ onCancelResponse(uuid, cancelled) {
728
+ if (!cancelled || !pending.has(uuid)) return [];
729
+ const dropped = drop(uuid);
730
+ return dropped ? [dropped] : [];
731
+ },
732
+ /**
733
+ * B-634 ②: the Query is over — every tracked message that never
734
+ * `started` and was not already reported, in the order it was sent.
735
+ * Untracked afterwards; a later frame for one of them is ignored.
736
+ */
737
+ takeUnconfirmed() {
738
+ const out = [];
739
+ for (const [uuid, entry] of pending) {
740
+ if (entry.started || entry.payload === void 0 || reported.has(uuid)) continue;
741
+ out.push({ uuid, payload: entry.payload });
742
+ }
743
+ for (const { uuid } of out) pending.delete(uuid);
744
+ return out;
745
+ },
746
+ clear() {
747
+ pending.clear();
748
+ }
749
+ };
750
+ }
751
+ function planUnconfirmedCommands(commands, context) {
752
+ if (context.aborted || !context.parkFree) return { redeliver: null, tombstone: commands.map((c) => c.uuid) };
753
+ const index = commands.findIndex((c) => !context.redelivered.has(c.uuid));
754
+ if (index < 0) return { redeliver: null, tombstone: commands.map((c) => c.uuid) };
755
+ return {
756
+ redeliver: commands[index],
757
+ tombstone: commands.filter((_, i) => i !== index).map((c) => c.uuid)
758
+ };
759
+ }
760
+
600
761
  const AUTH_FAILURE_RESULT_TEXT = /Failed to authenticate|OAuth session expired/i;
601
762
  const QUERY_RECYCLE_NOTICE = {
602
763
  authentication_failed: "\u26A0\uFE0F Claude Code could not refresh its OAuth session. This agent process was ended so your next message starts a fresh one that re-reads the credentials on this machine; if it fails again, run `claude` on the machine to log in again."
@@ -750,18 +911,6 @@ async function awaitFileExist(file, timeout = 1e4) {
750
911
  return false;
751
912
  }
752
913
 
753
- function modelTarget(model) {
754
- return model == null || model === "" ? void 0 : model;
755
- }
756
- function needsModelSwitch(current, next) {
757
- return modelTarget(current) !== modelTarget(next);
758
- }
759
- function modelSwitchFailureNotice(model, error) {
760
- const name = modelTarget(model) ?? "default";
761
- const detail = error instanceof Error ? error.message : String(error);
762
- return `\u26A0\uFE0F Could not switch to model "${name}" \u2014 continuing with the previous model. ${detail}`;
763
- }
764
-
765
914
  const SDK_TIMING_FIELDS = ["ttft_ms", "time_to_request_ms", "time_to_request_from_spawn_ms"];
766
915
  function delta(from, to) {
767
916
  if (typeof from !== "number" || typeof to !== "number" || to < from) return "-";
@@ -1096,88 +1245,6 @@ function createClaudeTurnTracker() {
1096
1245
  };
1097
1246
  }
1098
1247
 
1099
- const CLAUDE_COMMAND_LIFECYCLE_STATES = ["queued", "started", "completed", "cancelled", "discarded", "refused"];
1100
- function readClaudeCommandLifecycle(frame) {
1101
- const m = frame;
1102
- if (!m) return null;
1103
- const isLifecycle = m.type === "command_lifecycle" || m.type === "system" && m.subtype === "command_lifecycle";
1104
- if (!isLifecycle || typeof m.command_uuid !== "string" || m.command_uuid.length === 0) return null;
1105
- const state = CLAUDE_COMMAND_LIFECYCLE_STATES.find((candidate) => candidate === m.state);
1106
- return state ? { uuid: m.command_uuid, state } : null;
1107
- }
1108
- const uuidList = (value) => Array.isArray(value) ? value.filter((item) => typeof item === "string" && item.length > 0) : [];
1109
- const INTERRUPT_CANCEL_QUEUED_CAPABILITY = "interrupt_cancel_queued_v1";
1110
- const PENDING_MAX = 256;
1111
- const REPORTED_MAX = 512;
1112
- function createClaudeCommandTracker() {
1113
- const pending = /* @__PURE__ */ new Map();
1114
- const reported = /* @__PURE__ */ new Set();
1115
- const drop = (uuid) => {
1116
- pending.delete(uuid);
1117
- if (reported.has(uuid)) return null;
1118
- reported.add(uuid);
1119
- if (reported.size > REPORTED_MAX) reported.delete(reported.values().next().value);
1120
- return uuid;
1121
- };
1122
- return {
1123
- /** A uuid-stamped user message (prompt or steer) was handed to the Query. */
1124
- track(uuid) {
1125
- if (!pending.has(uuid) && pending.size >= PENDING_MAX) pending.delete(pending.keys().next().value);
1126
- pending.set(uuid, { started: false });
1127
- },
1128
- isTracked(uuid) {
1129
- return pending.has(uuid);
1130
- },
1131
- /** A lifecycle frame; returns the uuids now known to have never run. */
1132
- observe(lifecycle) {
1133
- const entry = pending.get(lifecycle.uuid);
1134
- if (!entry) return [];
1135
- switch (lifecycle.state) {
1136
- case "queued":
1137
- return [];
1138
- case "started":
1139
- entry.started = true;
1140
- return [];
1141
- case "completed":
1142
- pending.delete(lifecycle.uuid);
1143
- return [];
1144
- default: {
1145
- if (entry.started) {
1146
- pending.delete(lifecycle.uuid);
1147
- return [];
1148
- }
1149
- const dropped = drop(lifecycle.uuid);
1150
- return dropped ? [dropped] : [];
1151
- }
1152
- }
1153
- },
1154
- /**
1155
- * An interrupt's receipt: `cancelled` members we track never ran;
1156
- * `still_queued` members we track are returned for the per-uuid
1157
- * follow-up (`cancel_async_message`) a CLI without cancel_queued needs.
1158
- */
1159
- onInterruptReceipt(receipt) {
1160
- const dropped = [];
1161
- for (const uuid of uuidList(receipt?.cancelled)) {
1162
- if (!pending.has(uuid)) continue;
1163
- const result = drop(uuid);
1164
- if (result) dropped.push(result);
1165
- }
1166
- const stillQueued = uuidList(receipt?.still_queued).filter((uuid) => pending.has(uuid));
1167
- return { dropped, stillQueued };
1168
- },
1169
- /** The answer to `cancel_async_message`: true = withdrawn before it ran; false = already dequeued, its lifecycle frames follow. */
1170
- onCancelResponse(uuid, cancelled) {
1171
- if (!cancelled || !pending.has(uuid)) return [];
1172
- const dropped = drop(uuid);
1173
- return dropped ? [dropped] : [];
1174
- },
1175
- clear() {
1176
- pending.clear();
1177
- }
1178
- };
1179
- }
1180
-
1181
1248
  const SET_MODEL_TIMEOUT_MS = 3e4;
1182
1249
  const PROMPT_UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
1183
1250
  function promptUuid(uuid) {
@@ -1351,9 +1418,14 @@ async function claudeRemote(opts) {
1351
1418
  const discardWarm = (reason) => {
1352
1419
  warm?.lease.discard(reason);
1353
1420
  };
1421
+ const withoutRetiredModel = (next) => {
1422
+ if (!next || !opts.retiredModels) return next;
1423
+ const model = opts.retiredModels.effective(next.mode.model);
1424
+ return model === next.mode.model ? next : { ...next, mode: { ...next.mode, model } };
1425
+ };
1354
1426
  let initial;
1355
1427
  try {
1356
- initial = await opts.nextMessage();
1428
+ initial = withoutRetiredModel(await opts.nextMessage());
1357
1429
  } catch (error) {
1358
1430
  discardWarm("error");
1359
1431
  throw error;
@@ -1513,7 +1585,7 @@ async function claudeRemote(opts) {
1513
1585
  steer: (message, nextMode, localKey) => {
1514
1586
  mode = { ...nextMode, model: mode.model };
1515
1587
  const uuid = promptUuid(localKey);
1516
- if (uuid.uuid) commandTracker.track(uuid.uuid);
1588
+ if (uuid.uuid) commandTracker.track(uuid.uuid, { message, mode: nextMode });
1517
1589
  messages.push({
1518
1590
  type: "user",
1519
1591
  parent_tool_use_id: null,
@@ -1527,7 +1599,7 @@ async function claudeRemote(opts) {
1527
1599
  }
1528
1600
  let lastAssistantError;
1529
1601
  turn.pushed();
1530
- if (initialUserMessage.uuid) commandTracker.track(initialUserMessage.uuid);
1602
+ if (initialUserMessage.uuid) commandTracker.track(initialUserMessage.uuid, { message: initial.message, mode: initial.mode });
1531
1603
  let modelUnconfirmed = false;
1532
1604
  let pullingNext = false;
1533
1605
  const pullNextMessage = () => {
@@ -1536,8 +1608,10 @@ async function claudeRemote(opts) {
1536
1608
  return;
1537
1609
  }
1538
1610
  pullingNext = true;
1539
- opts.nextMessage().then(async (next) => {
1611
+ opts.nextMessage().then(async (pulled) => {
1612
+ let next = withoutRetiredModel(pulled);
1540
1613
  if (!next) {
1614
+ pullingNext = false;
1541
1615
  messages.end();
1542
1616
  return;
1543
1617
  }
@@ -1557,8 +1631,9 @@ async function claudeRemote(opts) {
1557
1631
  updateThinking(true);
1558
1632
  turn.pushed();
1559
1633
  const uuid = promptUuid(next.uuid);
1560
- if (uuid.uuid) commandTracker.track(uuid.uuid);
1634
+ if (uuid.uuid) commandTracker.track(uuid.uuid, { message: next.message, mode: next.mode });
1561
1635
  timingMarks = { pushedAt: next.enqueuedAt ?? Date.now() };
1636
+ pullingNext = false;
1562
1637
  messages.push({
1563
1638
  type: "user",
1564
1639
  parent_tool_use_id: null,
@@ -1567,9 +1642,8 @@ async function claudeRemote(opts) {
1567
1642
  message: { role: "user", content: next.message }
1568
1643
  });
1569
1644
  }).catch(() => {
1570
- messages.end();
1571
- }).finally(() => {
1572
1645
  pullingNext = false;
1646
+ messages.end();
1573
1647
  });
1574
1648
  };
1575
1649
  const recycleIfPoisoned = (result) => {
@@ -1608,6 +1682,17 @@ async function claudeRemote(opts) {
1608
1682
  if (message.type === "assistant" && message.error) {
1609
1683
  lastAssistantError = message.error;
1610
1684
  }
1685
+ const retired = opts.retiredModels ? retiredModelFrom(message, mode.model) : null;
1686
+ if (retired) {
1687
+ opts.retiredModels.retire(retired);
1688
+ mode = { ...mode, model: void 0 };
1689
+ logger.debug(`[claudeRemote] Model ${retired} reported model_not_found; moving the session to the default model`);
1690
+ opts.onCompletionEvent?.(retiredModelNotice(retired));
1691
+ void withTimeout(response.setModel(void 0), SET_MODEL_TIMEOUT_MS, "set_model").catch((e) => {
1692
+ logger.debug(`[claudeRemote] setModel(default) after model_not_found failed: ${e instanceof Error ? e.message : String(e)}`);
1693
+ modelUnconfirmed = true;
1694
+ });
1695
+ }
1611
1696
  if (message.type === "assistant" && timingMarks.firstAssistantAt === void 0) {
1612
1697
  timingMarks.firstAssistantAt = Date.now();
1613
1698
  } else if (message.type === "system" && message.subtype === "init" && timingMarks.initAt === void 0) {
@@ -1721,6 +1806,13 @@ async function claudeRemote(opts) {
1721
1806
  }
1722
1807
  } finally {
1723
1808
  updateThinking(false);
1809
+ if (cliCapabilities.has(MSG_LIFECYCLE_CAPABILITY)) {
1810
+ const unconfirmed = commandTracker.takeUnconfirmed();
1811
+ if (unconfirmed.length > 0) {
1812
+ logger.debug(`[claudeRemote] Query ended with ${unconfirmed.length} user message(s) never started: ${unconfirmed.map((c) => c.uuid).join(", ")}`);
1813
+ opts.onCommandsUnconfirmed?.(unconfirmed, { aborted: opts.signal?.aborted === true });
1814
+ }
1815
+ }
1724
1816
  }
1725
1817
  }
1726
1818
 
@@ -3952,6 +4044,7 @@ async function claudeRemoteLauncher(session, onPermissionModeChange, onEffective
3952
4044
  }
3953
4045
  try {
3954
4046
  const modeGate = new LaunchModeGate(session.queue.modeHasher);
4047
+ const redeliveredCommands = /* @__PURE__ */ new Set();
3955
4048
  let previousSessionId = null;
3956
4049
  await Promise.race([
3957
4050
  rewindReconciler.startup().catch((error) => logger.debug("[rewind] startup reconcile failed", error)),
@@ -4007,10 +4100,15 @@ async function claudeRemoteLauncher(session, onPermissionModeChange, onEffective
4007
4100
  return permissionHandler.isAborted(toolCallId);
4008
4101
  },
4009
4102
  nextMessage: async () => {
4103
+ const finalize = async (text) => {
4104
+ const out = await session.projectInjector.decorate(text);
4105
+ onPromptFinalized?.(out);
4106
+ return out;
4107
+ };
4010
4108
  const parked = modeGate.takeParked();
4011
4109
  if (parked) {
4012
4110
  permissionHandler.handleModeChange(parked.mode.permissionMode);
4013
- if (typeof parked.message === "string") onPromptFinalized?.(parked.message);
4111
+ if (typeof parked.message === "string") return { ...parked, message: await finalize(parked.message) };
4014
4112
  return parked;
4015
4113
  }
4016
4114
  await rewindReconciler.settled(controller.signal);
@@ -4039,8 +4137,7 @@ async function claudeRemoteLauncher(session, onPermissionModeChange, onEffective
4039
4137
  sessionId: session.client.sessionId
4040
4138
  });
4041
4139
  logger.debug(`[remote] Staged ${staged.length} attachment(s) for the coding agent`);
4042
- const withAttachments = appendStagedAttachmentsToPrompt(msg.message, staged);
4043
- onPromptFinalized?.(withAttachments);
4140
+ const withAttachments = await finalize(appendStagedAttachmentsToPrompt(msg.message, staged));
4044
4141
  return {
4045
4142
  message: withAttachments,
4046
4143
  mode: msg.mode,
@@ -4048,9 +4145,9 @@ async function claudeRemoteLauncher(session, onPermissionModeChange, onEffective
4048
4145
  uuid: promptUuidFor(msg.sourceIds)
4049
4146
  };
4050
4147
  }
4051
- onPromptFinalized?.(msg.message);
4148
+ const finalized = await finalize(msg.message);
4052
4149
  return {
4053
- message: msg.message,
4150
+ message: finalized,
4054
4151
  mode: msg.mode,
4055
4152
  enqueuedAt: msg.enqueuedAt,
4056
4153
  uuid: promptUuidFor(msg.sourceIds)
@@ -4124,6 +4221,25 @@ async function claudeRemoteLauncher(session, onPermissionModeChange, onEffective
4124
4221
  // queued behind a pre-empting steer's turn) before the model
4125
4222
  // read them — the same tombstone a destroyed queue item gets
4126
4223
  // (B-332), so the web shows them as not delivered, not answered.
4224
+ retiredModels: session.retiredModels,
4225
+ // B-634 ②: messages the Query ended without Claude Code ever
4226
+ // starting them — sent once more, or tombstoned (B-332).
4227
+ onCommandsUnconfirmed: (commands, { aborted }) => {
4228
+ const plan = planUnconfirmedCommands(commands, {
4229
+ aborted: aborted || exitReason !== null,
4230
+ parkFree: !modeGate.hasParked,
4231
+ redelivered: redeliveredCommands
4232
+ });
4233
+ if (plan.redeliver) {
4234
+ redeliveredCommands.add(plan.redeliver.uuid);
4235
+ logger.debug(`[remote]: re-sending unconfirmed user message ${plan.redeliver.uuid} into the next launch`);
4236
+ modeGate.park({ message: plan.redeliver.payload.message, mode: plan.redeliver.payload.mode, uuid: plan.redeliver.uuid });
4237
+ }
4238
+ if (plan.tombstone.length > 0) {
4239
+ logger.debug(`[remote]: ${plan.tombstone.length} user message(s) never started before the query ended`);
4240
+ session.client.sendQueueCancelReason(plan.tombstone, "aborted");
4241
+ }
4242
+ },
4127
4243
  onCommandsDropped: (uuids) => {
4128
4244
  logger.debug(`[remote]: ${uuids.length} user message(s) never read before the turn ended`);
4129
4245
  session.client.sendQueueCancelReason(uuids, "aborted");
@@ -4266,7 +4382,7 @@ async function loop(opts) {
4266
4382
  logger.debug(`[loop] Iteration with mode: ${mode}`);
4267
4383
  switch (mode) {
4268
4384
  case "local": {
4269
- const { claudeLocalLauncher } = await import('./claudeLocalLauncher-BmrpaRYJ.mjs');
4385
+ const { claudeLocalLauncher } = await import('./claudeLocalLauncher-CN67lN7-.mjs');
4270
4386
  const result = await claudeLocalLauncher(session);
4271
4387
  switch (result.type) {
4272
4388
  case "switch":
@@ -4672,7 +4788,7 @@ function registerSideQuestionHandler(rpc, deps) {
4672
4788
  const retainMs = deps.retainMs ?? SIDE_QUESTION_RETAIN_MS;
4673
4789
  const maxRunMs = deps.maxRunMs ?? SIDE_QUESTION_MAX_RUN_MS;
4674
4790
  const fork = deps.run ?? (async (input) => {
4675
- const { query } = await import('./index-CEjJnq05.mjs');
4791
+ const { query } = await import('./index-BiyC7cZ3.mjs');
4676
4792
  return runSideQuestion(query, input);
4677
4793
  });
4678
4794
  const run = async (input, live) => {
@@ -4786,6 +4902,25 @@ function registerSideQuestionHandler(rpc, deps) {
4786
4902
  };
4787
4903
  }
4788
4904
 
4905
+ function replayClaudeForkJsonl(file, sink) {
4906
+ let replayed = 0;
4907
+ for (const line of file.split("\n")) {
4908
+ if (line.trim().length === 0) continue;
4909
+ let parsed;
4910
+ try {
4911
+ parsed = JSON.parse(line);
4912
+ } catch {
4913
+ continue;
4914
+ }
4915
+ const result = RawJSONLinesSchema.safeParse(parsed);
4916
+ if (!result.success) continue;
4917
+ sink.send(result.data);
4918
+ replayed += 1;
4919
+ }
4920
+ if (replayed > 0) sink.closeTurn();
4921
+ return replayed;
4922
+ }
4923
+
4789
4924
  const ANALYZE_MIN_INTERVAL_MS = 5 * 60 * 1e3;
4790
4925
  const HOURLY_LIMIT = 30;
4791
4926
  const HOURLY_WINDOW_MS = 60 * 60 * 1e3;
@@ -5074,4 +5209,4 @@ function resolveMessageMode(current, meta, ctx) {
5074
5209
  };
5075
5210
  }
5076
5211
 
5077
- export { BoardAnalyzer, FileRateLimiter, PrewarmHookGate, SessionExitGate, acquirePrewarmSlot, claudeCheckSession, claudeModeHash, claudePrewarmEligibility, claudePrewarmSessionEligibility, cleanupHookSettingsFile, contentLogMetadata, createClaudePrewarmLease, disposeAllClaudePrewarms, evaluatePrewarmPrediction, exitIntentFromArchiveFlag, formatPrewarmLine, generateHookSettingsFile, getProjectPath, loop, parseSpecialCommand, prewarmCacheFile, prewarmPredictionMeta, prewarmSlotDir, readPrewarmCache, registerSideQuestionHandler, resolveMessageMode, settleSessionOnExit, startHookServer, withAssistantDenylist, writePrewarmCache, writeSideQuestionSettingsFile };
5212
+ export { BoardAnalyzer, FileRateLimiter, PrewarmHookGate, RawJSONLinesSchema, SessionExitGate, acquirePrewarmSlot, claudeCheckSession, claudeModeHash, claudePrewarmEligibility, claudePrewarmSessionEligibility, cleanupHookSettingsFile, contentLogMetadata, createClaudePrewarmLease, disposeAllClaudePrewarms, evaluatePrewarmPrediction, exitIntentFromArchiveFlag, formatPrewarmLine, generateHookSettingsFile, getProjectPath, loop, parseSpecialCommand, prewarmCacheFile, prewarmPredictionMeta, prewarmSlotDir, readPrewarmCache, registerSideQuestionHandler, replayClaudeForkJsonl, resolveMessageMode, settleSessionOnExit, startHookServer, withAssistantDenylist, writePrewarmCache, writeSideQuestionSettingsFile };