very-happy-cli 0.2.178 → 0.2.180

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 (217) hide show
  1. package/dist/{AcpBackend-DCQXHRzT.mjs → AcpBackend-B8Zi30Zh.mjs} +135 -16
  2. package/dist/{AcpBackend-CDkAQXYf.cjs → AcpBackend-DfRDtMcG.cjs} +135 -16
  3. package/dist/{AcpSessionManager-DckmUZza.cjs → AcpSessionManager-CASKOnOj.cjs} +38 -4
  4. package/dist/{AcpSessionManager-BXrQcqwC.mjs → AcpSessionManager-i8Rab0xT.mjs} +38 -4
  5. package/dist/{BasePermissionHandler-BVlrEhIi.mjs → BasePermissionHandler-26fKbRCm.mjs} +5 -2
  6. package/dist/{BasePermissionHandler-DyLmKKtO.cjs → BasePermissionHandler-BlM_tfej.cjs} +5 -2
  7. package/dist/acpSessionResume-B9l54P-X.mjs +67 -0
  8. package/dist/acpSessionResume-CR5pmgVo.cjs +74 -0
  9. package/dist/{agentHome-CEp9RMyK.cjs → agentHome-C7Sb7-Tz.cjs} +4 -4
  10. package/dist/{agentHome-C1xi37as.mjs → agentHome-CmGy0NWv.mjs} +4 -4
  11. package/dist/{api-JANhFdZV.cjs → api-DM7b1OKj.cjs} +38 -262
  12. package/dist/{api-Dib0dmqC.mjs → api-Hov8p7CA.mjs} +32 -256
  13. package/dist/{apiMachine-DNTJidYH.mjs → apiMachine-CwGEhQDT.mjs} +62 -15
  14. package/dist/{apiMachine-QhK-sKcr.cjs → apiMachine-DkGRj-Ai.cjs} +64 -17
  15. package/dist/{attachmentContent-bpQTBJ0y.cjs → attachmentContent-CEm13_gF.cjs} +4 -4
  16. package/dist/{attachmentContent-DkkdpSSJ.mjs → attachmentContent-CIn4iPEk.mjs} +2 -2
  17. package/dist/{auth-BRjd2esb.mjs → auth-BG1DY0gj.mjs} +5 -5
  18. package/dist/{auth-DgIV0Cvt.cjs → auth-CBXnm-Mj.cjs} +5 -5
  19. package/dist/{auth-omWDtgR8.cjs → auth-Dawj7pP5.cjs} +8 -8
  20. package/dist/{auth-DNct7VUi.mjs → auth-rggxMpEE.mjs} +8 -8
  21. package/dist/{auto-DKGFOJBo.mjs → auto-CXXLXGeL.mjs} +19 -18
  22. package/dist/{auto-CI16FZmX.cjs → auto-CbYOfoPS.cjs} +19 -18
  23. package/dist/{backgroundTaskActivity-BVwJBl02.mjs → backgroundTaskActivity-8PdPxrvy.mjs} +1 -1
  24. package/dist/{bootstrap-DCQ87Aan.cjs → bootstrap-DoA7okld.cjs} +2 -2
  25. package/dist/{bootstrap-BUagGC_-.mjs → bootstrap-Dt5I1SOl.mjs} +2 -2
  26. package/dist/{browser-Dj_DYQEh.mjs → browser-DUNetFT4.mjs} +1 -1
  27. package/dist/{browser-CSKhc0Bl.cjs → browser-DZ6qRtfH.cjs} +1 -1
  28. package/dist/{claudeCliPath-U4HHmV4r.cjs → claudeCliPath-GaP3UUz1.cjs} +1 -1
  29. package/dist/{claudeLocal-CdIVnOZp.cjs → claudeLocal--DNyMOSv.cjs} +8 -7
  30. package/dist/{claudeLocal-CCCvAeMd.mjs → claudeLocal-OHWQigCl.mjs} +6 -5
  31. package/dist/{claudeLocalLauncher-BmrpaRYJ.mjs → claudeLocalLauncher-BStvfa7M.mjs} +11 -10
  32. package/dist/{claudeLocalLauncher-21-xh5gc.cjs → claudeLocalLauncher-BhvPbcyH.cjs} +13 -12
  33. package/dist/{claudeSessionFork-kYCP1IJB.cjs → claudeSessionFork-Be16vzGc.cjs} +1 -1
  34. package/dist/{claudeSessionFork-DvxMKAmY.mjs → claudeSessionFork-GAVWhiKG.mjs} +1 -1
  35. package/dist/{client-C4zKGjiJ.cjs → client-BWjaHKtj.cjs} +2 -2
  36. package/dist/client-Ca5Pcgy_.mjs +71 -0
  37. package/dist/{client-CnlkkrZO.mjs → client-CnB7kRCT.mjs} +2 -2
  38. package/dist/{client-BTX9hsbr.mjs → client-D4uPb1uu.mjs} +3 -3
  39. package/dist/client-DJplzPjD.cjs +76 -0
  40. package/dist/{client-Dnza1hgN.cjs → client-D_loZ9IK.cjs} +3 -3
  41. package/dist/codex/happyMcpStdioBridge.cjs +24 -15
  42. package/dist/codex/happyMcpStdioBridge.mjs +25 -16
  43. package/dist/{codexAppServerClient-DvkpQgyv.mjs → codexAppServerClient-CO4G6OS4.mjs} +3 -3
  44. package/dist/{codexAppServerClient-CRlBWGn3.cjs → codexAppServerClient-PE-12AsW.cjs} +3 -3
  45. package/dist/{codexCommand-DzxIWXIT.cjs → codexCommand-BNoD1t1C.cjs} +127 -116
  46. package/dist/{codexCommand-BxjogBzU.mjs → codexCommand-B_xUH79E.mjs} +77 -66
  47. package/dist/{codexTermination-C28FzlLb.cjs → codexTermination-BmBbizFK.cjs} +7 -2
  48. package/dist/{codexTermination-ySDNMEhd.mjs → codexTermination-Dx48ma6e.mjs} +7 -2
  49. package/dist/{config-BFB5uJ4t.cjs → config-CtwEUxUP.cjs} +26 -26
  50. package/dist/{config-DwfEpFr3.mjs → config-DSu0Blos.mjs} +3 -3
  51. package/dist/{configuration-4TGMrjul.cjs → configuration-CYO-kPOS.cjs} +1 -1
  52. package/dist/{configuration-DVrb61aY.mjs → configuration-PxzEJumr.mjs} +1 -1
  53. package/dist/{connect-C7FPY0PI.mjs → connect-BQrg3TB6.mjs} +15 -15
  54. package/dist/{connect-QH2VJGBG.cjs → connect-Dq7wndzR.cjs} +28 -28
  55. package/dist/{context-JoKu0V54.cjs → context-6TP-iz_c.cjs} +1 -1
  56. package/dist/{context-B3XPVJlj.mjs → context-CJGRRGWW.mjs} +1 -1
  57. package/dist/{controlClient-BTaZlbC6.cjs → controlClient-Bqv5v5OM.cjs} +3 -3
  58. package/dist/{controlClient-BYKyGyxj.mjs → controlClient-DoeYovwP.mjs} +4 -4
  59. package/dist/{createSessionMetadata-8Fuj2-IV.mjs → createSessionMetadata-DDIChCx8.mjs} +2 -2
  60. package/dist/{createSessionMetadata-B2NynaWZ.cjs → createSessionMetadata-xz767pcG.cjs} +3 -3
  61. package/dist/{defaultPermissionMode-BEWCqJU-.cjs → defaultPermissionMode-PkZGsQDk.cjs} +2 -2
  62. package/dist/{defaultPermissionMode-B8kJG9uI.mjs → defaultPermissionMode-i5KzdK09.mjs} +2 -2
  63. package/dist/{detectCLI-DR9ZaN6B.cjs → detectCLI-BuYR_Qxe.cjs} +4 -4
  64. package/dist/{deterministicJson-C5ZwZ7hu.mjs → deterministicJson-CTEJDqtS.mjs} +217 -12
  65. package/dist/{deterministicJson-BjNQsAjO.cjs → deterministicJson-xqA6DaOm.cjs} +222 -16
  66. package/dist/{doctor-BshRnjLi.cjs → doctor-BrgSlfXn.cjs} +9 -9
  67. package/dist/{doctor-0BiGwJXk.mjs → doctor-IctjVh9T.mjs} +8 -8
  68. package/dist/{doctorReadiness-BCZGcN0a.cjs → doctorReadiness-Dl6yRQCy.cjs} +1 -1
  69. package/dist/{downloadTarget-BN5vZt3K.cjs → downloadTarget-CEb9che-.cjs} +6 -6
  70. package/dist/{downloadTarget-DJPwAZlu.mjs → downloadTarget-jbOz1egC.mjs} +6 -6
  71. package/dist/{ensureDaemonRunning-C5QfToCe.cjs → ensureDaemonRunning-D-HyjGIX.cjs} +6 -6
  72. package/dist/{ensureDaemonRunning-CSmb_mqt.mjs → ensureDaemonRunning-b1e8LCSM.mjs} +5 -5
  73. package/dist/{handleResumeCommand-BwnUZmbo.cjs → handleResumeCommand-BvWVuRwH.cjs} +23 -7
  74. package/dist/{handleResumeCommand-CgjpsdDe.mjs → handleResumeCommand-DpaZvm2c.mjs} +22 -6
  75. package/dist/{index-piJPsTsm.cjs → index-B2p2Mut7.cjs} +259 -53
  76. package/dist/{index-BehVbAsA.mjs → index-BUNnpGFF.mjs} +256 -50
  77. package/dist/{index-Bvldtdny.mjs → index-Bsvbgh9e.mjs} +4 -4
  78. package/dist/{index-BYOZ_8WZ.cjs → index-C64Ufj4D.cjs} +4 -4
  79. package/dist/{index-Clqlu17M.mjs → index-C6Vn5Eac.mjs} +155 -34
  80. package/dist/index-CMf5VbzG.mjs +18 -0
  81. package/dist/index-DmTlDRSL.cjs +24 -0
  82. package/dist/{index-_l1Sdmbi.cjs → index-Dv0Q48P3.cjs} +156 -33
  83. package/dist/{index-BRClDe07.cjs → index-F2UejqYs.cjs} +3 -3
  84. package/dist/{index-BYgfern_.mjs → index-wCbtF4BK.mjs} +3 -3
  85. package/dist/index.cjs +2 -2
  86. package/dist/index.mjs +2 -2
  87. package/dist/{install-BdvKiOQw.mjs → install-BX3lv3NO.mjs} +1 -1
  88. package/dist/{install-Cf6AFSWC.cjs → install-BXvf2E3o.cjs} +1 -1
  89. package/dist/{install-TO4taKW7.cjs → install-C0ANcEAW.cjs} +7 -7
  90. package/dist/{install-fYWHrPcC.mjs → install-CdzSV7qO.mjs} +3 -3
  91. package/dist/{installPiTools-BKnXjrVu.cjs → installPiTools-CL_axh_6.cjs} +1 -1
  92. package/dist/{installTerminalHooks-BQZbvxsZ.cjs → installTerminalHooks-BETLKAtd.cjs} +3 -3
  93. package/dist/lib.cjs +14 -14
  94. package/dist/lib.d.cts +239 -2
  95. package/dist/lib.d.mts +239 -2
  96. package/dist/lib.mjs +14 -14
  97. package/dist/{lidState-BeOwj6eW.cjs → lidState-DWGnm2H4.cjs} +1 -1
  98. package/dist/{lidState-DNMlIhX0.mjs → lidState-bBrmaQd2.mjs} +1 -1
  99. package/dist/{localHappyAgentAuth-Br-mgogg.cjs → localHappyAgentAuth-DZHQnIW9.cjs} +1 -1
  100. package/dist/{localHappyAgentAuth-BezKSFDi.mjs → localHappyAgentAuth-Dn1jYDpt.mjs} +1 -1
  101. package/dist/{logger--vAVtXB_.mjs → logger-BUngm5Xg.mjs} +2 -2
  102. package/dist/{logger-DXTWlPzP.cjs → logger-CphW5nUE.cjs} +2 -2
  103. package/dist/machineMetadata-BQm9YTcI.cjs +79 -0
  104. package/dist/machineMetadata-BXN_bKU3.mjs +68 -0
  105. package/dist/{main-DoMFJ2Cl.cjs → main-B2UV51nK.cjs} +112 -132
  106. package/dist/{main-CshDb5-1.mjs → main-DGkdYfEq.mjs} +106 -126
  107. package/dist/{mcp-pNc1EbQf.cjs → mcp-BFvAEIRz.cjs} +15 -15
  108. package/dist/{mcp-DKT_lrvQ.mjs → mcp-CbTtbs0f.mjs} +15 -15
  109. package/dist/{mirrorProtocol-6IFGPpjJ.mjs → mirrorProtocol-BR4luBC0.mjs} +148 -7
  110. package/dist/{mirrorProtocol-qKflWTX_.cjs → mirrorProtocol-HKPivs5o.cjs} +150 -4
  111. package/dist/{package-B7B03ejW.mjs → package-7Ld1YMhh.mjs} +8 -7
  112. package/dist/{package-DY4zTbKS.cjs → package-KhLqBDX9.cjs} +8 -7
  113. package/dist/panels-C7IVqpJk.mjs +137 -0
  114. package/dist/panels-Njf6GelF.cjs +142 -0
  115. package/dist/{peerTools-3R9RUARX.mjs → peerTools-BOlDRyhi.mjs} +60 -10
  116. package/dist/{peerTools-iy3_6Yc5.cjs → peerTools-DQNlrcqM.cjs} +60 -9
  117. package/dist/{persistence-BfX72dne.cjs → persistence-9BMYspxG.cjs} +2 -2
  118. package/dist/{persistence-DTk4sNpd.mjs → persistence-BFUOHW5h.mjs} +3 -3
  119. package/dist/{piRunnerArgs-CRQVR9o-.cjs → piRunnerArgs-DGaq6VYM.cjs} +8 -2
  120. package/dist/{piRunnerArgs-AT8QJY7x.mjs → piRunnerArgs-H2pgpA5z.mjs} +7 -1
  121. package/dist/{piRuntime-BHRT5MKO.cjs → piRuntime-CT5xv_3h.cjs} +2 -2
  122. package/dist/{piRuntime-E44qTVQ4.mjs → piRuntime-CdN0JAsa.mjs} +2 -2
  123. package/dist/{piTerminal-hI4WFdWm.cjs → piTerminal-0FBtXTHK.cjs} +18 -18
  124. package/dist/{piTerminal-De8nbciM.mjs → piTerminal-C4m9YXAV.mjs} +18 -18
  125. package/dist/processTreeSnapshot-CuLJDNC-.mjs +101 -0
  126. package/dist/processTreeSnapshot-mDbnuojn.cjs +105 -0
  127. package/dist/projectPath-C3ioB4Bu.cjs +13 -0
  128. package/dist/prompt-BOouDaTM.mjs +99 -0
  129. package/dist/prompt-lgF9IE82.cjs +105 -0
  130. package/dist/{attachmentLimits-UyFn8fkQ.mjs → pushNotifications-DCiBEVeC.mjs} +307 -3
  131. package/dist/{attachmentLimits-SqeAHrVC.cjs → pushNotifications-DI92havG.cjs} +308 -2
  132. package/dist/{index-DFPT4HOO.cjs → query-BETKBrnz.cjs} +25 -5
  133. package/dist/{index-CEjJnq05.mjs → query-ywZbQUzR.mjs} +26 -3
  134. package/dist/{rateLimitWindows-XrJiiBpU.mjs → rateLimitWindows-BkfuUB1a.mjs} +1 -1
  135. package/dist/{rateLimitWindows-Czb7_7cK.cjs → rateLimitWindows-YRIYVdo4.cjs} +1 -1
  136. package/dist/{registerCommonHandlers-C0_fyBQ0.cjs → registerCommonHandlers-C7a_dUWs.cjs} +30 -30
  137. package/dist/{registerCommonHandlers-CvIedVRf.mjs → registerCommonHandlers-CTkCvjxt.mjs} +2 -2
  138. package/dist/{registerKillSessionHandler-DYl7l4Ts.cjs → registerKillSessionHandler-CIsvBrVe.cjs} +6 -6
  139. package/dist/{registerKillSessionHandler-gwJ5lTf0.mjs → registerKillSessionHandler-CaqqRYq6.mjs} +6 -6
  140. package/dist/{remoteSessionClient-BRTIOX5b.cjs → remoteSessionClient-D843fkzL.cjs} +5 -5
  141. package/dist/{remoteSessionClient-DRb2Jr5s.mjs → remoteSessionClient-PP-mOKmw.mjs} +5 -5
  142. package/dist/{reportProgressTool-B9nCzbkL.cjs → reportProgressTool-14AXr959.cjs} +84 -2
  143. package/dist/{reportProgressTool-D5tEoXMW.mjs → reportProgressTool-ZOCNjWHr.mjs} +82 -3
  144. package/dist/{resources-JDPugcDq.cjs → resources-CvIlkzpP.cjs} +30 -0
  145. package/dist/{resources-BdFBQi8r.mjs → resources-y9jfyO-_.mjs} +30 -0
  146. package/dist/{run-CKe_WeLW.cjs → run-CAOCYYfT.cjs} +2806 -110
  147. package/dist/{run-BQ_FGaOL.mjs → run-Dajw2E5j.mjs} +2787 -91
  148. package/dist/{runClaude-zrrNcQC_.mjs → runClaude-C6oxWYbp.mjs} +49 -47
  149. package/dist/{runClaude-MHI5IKM-.cjs → runClaude-CRRKt-tm.cjs} +50 -48
  150. package/dist/{runClaudeDeps-RRw-Nusc.cjs → runClaudeDeps-B1ysqTvx.cjs} +310 -237
  151. package/dist/{runClaudeDeps-CVBCokOS.mjs → runClaudeDeps-BcZ68cX3.mjs} +297 -226
  152. package/dist/{runGemini-kipag2ag.mjs → runGemini-D7yKc4wD.mjs} +61 -55
  153. package/dist/{runGemini-D7Lg9yCr.cjs → runGemini-DtKFXqf-.cjs} +89 -83
  154. package/dist/{runOpenClaw-C_lRY3Do.mjs → runOpenClaw-C8ilyLP9.mjs} +19 -19
  155. package/dist/{runOpenClaw-DCcQ0L2N.cjs → runOpenClaw-Cq29mryb.cjs} +20 -20
  156. package/dist/{sandbox-BSyXFVFp.mjs → sandbox-CbCutma4.mjs} +4 -4
  157. package/dist/{sandbox-dMwPTmjm.cjs → sandbox-gIj-EuF4.cjs} +4 -4
  158. package/dist/{selfCheck-DkzDDUsE.cjs → selfCheck-BTGBVthv.cjs} +39 -38
  159. package/dist/selfCheck-Smt-5Xiq.mjs +85 -0
  160. package/dist/{send-dxC0miIA.cjs → send-CZf5lLw_.cjs} +8 -8
  161. package/dist/{send-C-k9nsd3.mjs → send-YZRMQvMJ.mjs} +9 -9
  162. package/dist/{server-DxoTYNlw.mjs → server-BqwXRzFZ.mjs} +4 -4
  163. package/dist/{server-B-W6P7Qr.cjs → server-CknFq6xG.cjs} +6 -6
  164. package/dist/sessionExitLifecycle-CzkLIgNZ.mjs +142 -0
  165. package/dist/sessionExitLifecycle-DFltxXU8.cjs +148 -0
  166. package/dist/{sessionLock-DWX6BbiU.cjs → sessionLock-DRZUcKHT.cjs} +38 -5
  167. package/dist/{sessionLock-DBdtZGOL.mjs → sessionLock-nBXdJxJm.mjs} +36 -5
  168. package/dist/{sessionOps-BAnr7n8t.cjs → sessionOps-BrGiU9-s.cjs} +10 -5
  169. package/dist/{sessionOps-BVoXe12O.mjs → sessionOps-C58iDeD5.mjs} +11 -6
  170. package/dist/{sessionScanner-BtxoeluY.mjs → sessionScanner-Bm57LEXe.mjs} +3 -3
  171. package/dist/{sessionScanner-CDOYsEUD.cjs → sessionScanner-CaO8bLaG.cjs} +3 -3
  172. package/dist/{sessions-C3sZJkzI.mjs → sessions-BXyBHo8n.mjs} +40 -18
  173. package/dist/{sessions-hAitoN-m.cjs → sessions-uzqPCc37.cjs} +39 -16
  174. package/dist/{setupOfflineReconnection-_eD4cuUT.mjs → setupOfflineReconnection-1Qlek3wl.mjs} +2 -2
  175. package/dist/{setupOfflineReconnection-C2EeYTFH.cjs → setupOfflineReconnection-DvvVX3TB.cjs} +2 -2
  176. package/dist/{spawn-Bc9v7pIf.cjs → spawn-DBkodJEO.cjs} +49 -18
  177. package/dist/{spawn-qNrB2CD_.mjs → spawn-vn93PhYL.mjs} +49 -18
  178. package/dist/spawnAgents-CgPMWexP.mjs +79 -0
  179. package/dist/{spawnAgents-BVEaz35W.cjs → spawnAgents-DLNMlhWJ.cjs} +37 -1
  180. package/dist/{spawnHappyCLI-C2stUioM.mjs → spawnHappyCLI-BjFZc_7V.mjs} +1 -1
  181. package/dist/{spawnHappyCLI-fzUagkKV.cjs → spawnHappyCLI-DnUZv0X2.cjs} +2 -2
  182. package/dist/{specialCommands-BJ-nqY4s.cjs → specialCommands-BRufxlqe.cjs} +3 -3
  183. package/dist/{specialCommands-C6W-rVyh.mjs → specialCommands-D3ND9bdg.mjs} +3 -3
  184. package/dist/{startFileWatcher-Bqlqjt93.cjs → startFileWatcher-D9cYzZOq.cjs} +1 -1
  185. package/dist/{startFileWatcher-CR09Snmz.mjs → startFileWatcher-DXJ7yB5v.mjs} +1 -1
  186. package/dist/startupSessionCreate-kdr3m1uX.cjs +26 -0
  187. package/dist/startupSessionCreate-uZ6BM0ty.mjs +24 -0
  188. package/dist/{streamRelay-CJoMk_d2.mjs → streamRelay-DnMCMMfV.mjs} +1 -1
  189. package/dist/{streamRelay-9kBPpbvU.cjs → streamRelay-Dy6amlzx.cjs} +1 -1
  190. package/dist/{sync-Dhmtk66S.cjs → sync-Bn-idAoy.cjs} +1 -1
  191. package/dist/{sync-DbW07iQS.mjs → sync-BvVhDO40.mjs} +1 -1
  192. package/dist/{systemPrompt-CQcuUmVp.mjs → systemPrompt-CIZcJuJF.mjs} +4 -3
  193. package/dist/{systemPrompt-3PYi3EUY.cjs → systemPrompt-DlyEk35T.cjs} +4 -3
  194. package/dist/{teams-DpxLcUU_.cjs → teams-BLeRpDxv.cjs} +8 -8
  195. package/dist/{teams-CwF4Z2fA.mjs → teams-DLY3B5yi.mjs} +8 -8
  196. package/dist/{time-A6zR3Iy6.cjs → time-Cjv0zxQO.cjs} +1 -1
  197. package/dist/{time-BuGWTVP6.mjs → time-D3ETL7Jb.mjs} +1 -1
  198. package/dist/{titleGenerator-D26gvNaS.cjs → titleGenerator-Cgp5ihFb.cjs} +10 -9
  199. package/dist/{titleGenerator-BGEzNWC9.mjs → titleGenerator-Uzbd4utr.mjs} +9 -8
  200. package/dist/{todo-DrZc76H5.mjs → todo-C9Ga-oEM.mjs} +6 -6
  201. package/dist/{todo-73g3NCIO.cjs → todo-pOMcEECE.cjs} +6 -6
  202. package/dist/{tools-CxJp4T1T.cjs → tools-BL7Byl_x.cjs} +1 -1
  203. package/dist/{tools-BtsrQnNS.mjs → tools-Cho7iIWf.mjs} +1 -1
  204. package/dist/{uninstall-DWNYvewQ.cjs → uninstall-CbayEVoV.cjs} +6 -6
  205. package/dist/{uninstall-DOb2mTwV.mjs → uninstall-CvZHVY9C.mjs} +3 -3
  206. package/dist/webPanels-B2_C2-3g.mjs +49 -0
  207. package/dist/webPanels-FCgFKvVe.cjs +53 -0
  208. package/package.json +8 -7
  209. package/dist/machineMetadata-B1H9gNbN.mjs +0 -39
  210. package/dist/machineMetadata-DcUupMje.cjs +0 -42
  211. package/dist/messageBuffer-BWlGgR3A.mjs +0 -71
  212. package/dist/messageBuffer-fJMH6uY8.cjs +0 -73
  213. package/dist/projectPath-ChLhdOyt.cjs +0 -13
  214. package/dist/selfCheck-CF7XGJPb.mjs +0 -84
  215. package/dist/sessionModeFile-ByLbXTbg.mjs +0 -32
  216. package/dist/sessionModeFile-CLLdidiJ.cjs +0 -36
  217. package/dist/spawnAgents-Bw6j4tqz.mjs +0 -45
@@ -1,86 +1,91 @@
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';
4
- import { s as sameBackgroundTasks, e as createBackgroundTaskTracker } from './backgroundTaskActivity-BVwJBl02.mjs';
1
+ import { l as logger } from './logger-BUngm5Xg.mjs';
2
+ import { o as notifyDaemonSessionEvent, q as notifyDaemonClaudeAuthFailed } from './controlClient-DoeYovwP.mjs';
3
+ export { j as reportSessionEditToDaemon } from './controlClient-DoeYovwP.mjs';
4
+ import { s as sameBackgroundTasks, c as createBackgroundTaskTracker } from './backgroundTaskActivity-8PdPxrvy.mjs';
5
+ import { c as createProjectInjector, h as hashObject } from './deterministicJson-CTEJDqtS.mjs';
6
+ export { s as startHappyServer } from './deterministicJson-CTEJDqtS.mjs';
7
+ import { s as sharedProjectsClient } from './client-Ca5Pcgy_.mjs';
5
8
  import { randomInt, randomUUID, createHash } from 'node:crypto';
6
- import { M as MessageBuffer } from './messageBuffer-BWlGgR3A.mjs';
7
- import { query } from './index-CEjJnq05.mjs';
9
+ import { M as MessageBuffer } from './sessionExitLifecycle-CzkLIgNZ.mjs';
10
+ export { S as SessionExitGate, e as exitIntentFromArchiveFlag, s as settleSessionOnExit } from './sessionExitLifecycle-CzkLIgNZ.mjs';
11
+ import { q as query } from './query-ywZbQUzR.mjs';
8
12
  import { AbortError } from '@anthropic-ai/claude-agent-sdk';
9
13
  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';
14
+ import { c as claudeCheckSession, s as systemPrompt } from './systemPrompt-CIZcJuJF.mjs';
11
15
  import { join, resolve, dirname } from 'node:path';
12
- import { p as parseSpecialCommand, w as wrapperRateLimitReporter } from './specialCommands-C6W-rVyh.mjs';
16
+ import { p as parseSpecialCommand, w as wrapperRateLimitReporter } from './specialCommands-D3ND9bdg.mjs';
13
17
  import 'axios';
14
18
  import 'node:events';
15
19
  import 'socket.io-client';
16
- import { A as AsyncLock } from './attachmentLimits-UyFn8fkQ.mjs';
20
+ import { A as AsyncLock } from './pushNotifications-DCiBEVeC.mjs';
17
21
  import 'tweetnacl';
18
- import { c as configuration, e as ensurePrivateDirectory } from './configuration-DVrb61aY.mjs';
19
- import './index-Clqlu17M.mjs';
20
- import './registerCommonHandlers-CvIedVRf.mjs';
22
+ import { c as configuration, e as ensurePrivateDirectory } from './configuration-PxzEJumr.mjs';
23
+ import './index-C6Vn5Eac.mjs';
24
+ import './registerCommonHandlers-CTkCvjxt.mjs';
21
25
  import 'os';
22
26
  import 'child_process';
23
27
  import '@paralleldrive/cuid2';
24
- import './persistence-DTk4sNpd.mjs';
28
+ import './persistence-BFUOHW5h.mjs';
25
29
  import { c as contentLogMetadata } from './contentLogMetadata-BlWI0egu.mjs';
26
30
  import 'chalk';
27
- export { R as RawJSONLinesSchema } from './types-CkqAACXx.mjs';
31
+ import { R as RawJSONLinesSchema } from './types-CkqAACXx.mjs';
28
32
  import { g as getProjectPath } from './path-D2wdaNSk.mjs';
29
33
  import { access } from 'fs/promises';
30
- import { d as delay } from './time-BuGWTVP6.mjs';
34
+ import { d as delay } from './time-D3ETL7Jb.mjs';
31
35
  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';
36
+ import { F as Future, d as describeClaudeProcessExit } from './sessionScanner-Bm57LEXe.mjs';
37
+ export { c as createSessionScanner } from './sessionScanner-Bm57LEXe.mjs';
36
38
  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';
39
+ import { S as StreamRelay } from './streamRelay-DnMCMMfV.mjs';
40
+ import { C as CLAUDE_ATTACHMENT_KINDS, c as chatAttachmentDirectory, a as stageClaudeAttachments, b as appendStagedAttachmentsToPrompt } from './attachmentContent-CIn4iPEk.mjs';
39
41
  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';
42
+ import { F as ForkSourceMissingError } from './claudeSessionFork-GAVWhiKG.mjs';
43
+ export { M as MessageQueue2, r as registerKillSessionHandler } from './registerKillSessionHandler-CaqqRYq6.mjs';
44
+ export { g as getEnvironmentInfo } from './doctor-IctjVh9T.mjs';
43
45
  import { createServer } from 'node:http';
44
46
  export { E as EditReportThrottle, b as extractClaudeEditPaths } from './editPaths-BVfS_FFL.mjs';
45
47
  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';
48
+ export { s as snapshotTree, t as terminateSurvivors } from './processTreeSnapshot-CuLJDNC-.mjs';
49
+ import { r as resolveClaudeBinary, a as runClaudeOneShot } from './titleGenerator-Uzbd4utr.mjs';
50
+ export { T as TitleGenerator } from './titleGenerator-Uzbd4utr.mjs';
48
51
  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';
52
+ import { i as isSelfReportFresh } from './reportProgressTool-ZOCNjWHr.mjs';
53
+ export { c as createSelfReportState } from './reportProgressTool-ZOCNjWHr.mjs';
51
54
  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';
55
+ import './prompt-BOouDaTM.mjs';
57
56
  import 'zod';
58
- import './package-B7B03ejW.mjs';
59
- import 'util';
60
- import 'crypto';
61
- import 'path';
62
- import 'cross-spawn';
57
+ import './client-D4uPb1uu.mjs';
58
+ import './context-CJGRRGWW.mjs';
59
+ import './sessionOps-C58iDeD5.mjs';
63
60
  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';
61
+ import './resources-y9jfyO-_.mjs';
62
+ import './tools-Cho7iIWf.mjs';
63
+ import './peerTools-BOlDRyhi.mjs';
64
+ import 'node:os';
70
65
  import './ids-DU6sLx4C.mjs';
71
- import './remoteSessionClient-DRb2Jr5s.mjs';
66
+ import './remoteSessionClient-PP-mOKmw.mjs';
72
67
  import '@modelcontextprotocol/sdk/server/mcp.js';
73
68
  import '@modelcontextprotocol/sdk/server/streamableHttp.js';
74
69
  import './limits-DIo7rEBR.mjs';
75
- import './downloadTarget-DJPwAZlu.mjs';
70
+ import './downloadTarget-jbOz1egC.mjs';
76
71
  import './terminals-Dlg0x3nY.mjs';
77
72
  import './terminalTitleSuggest-CeKsX_V6.mjs';
78
73
  import './tmuxSocket-B8Yx20sT.mjs';
79
- import './bootstrap-BUagGC_-.mjs';
74
+ import './bootstrap-Dt5I1SOl.mjs';
75
+ import './package-7Ld1YMhh.mjs';
76
+ import './agentGuidance-BDYt2Qy2.mjs';
77
+ import './trimIdent-BAjmv_TG.mjs';
78
+ import './webPanels-B2_C2-3g.mjs';
80
79
  import './previewPath-CXN4Vag0.mjs';
81
- import './sync-DbW07iQS.mjs';
80
+ import 'crypto';
81
+ import './smallFastModel-BLNgMrwR.mjs';
82
+ import './rateLimitWindows-BkfuUB1a.mjs';
83
+ import 'util';
84
+ import 'path';
85
+ import 'cross-spawn';
86
+ import './sync-BvVhDO40.mjs';
82
87
  import './transcriptCursor-B7T_gkQ0.mjs';
83
- import './startFileWatcher-CR09Snmz.mjs';
88
+ import './startFileWatcher-DXJ7yB5v.mjs';
84
89
  import 'node:readline';
85
90
  import './doctor-BPkYWSuq.mjs';
86
91
  import 'ps-list';
@@ -88,11 +93,11 @@ import './doctorReadiness-C208SMN9.mjs';
88
93
  import './detectCLI-CSGMlV51.mjs';
89
94
  import 'fs';
90
95
  import './cliUpdate-Y34VGe9Y.mjs';
91
- import './piRunnerArgs-AT8QJY7x.mjs';
92
- import './sessionModeFile-ByLbXTbg.mjs';
96
+ import './piRunnerArgs-H2pgpA5z.mjs';
97
+ import './acpSessionResume-B9l54P-X.mjs';
93
98
  import 'url';
94
99
  import 'node:module';
95
- import './client-CnlkkrZO.mjs';
100
+ import './client-CnB7kRCT.mjs';
96
101
  import './precheckCompat-DeEbilbr.mjs';
97
102
 
98
103
  const SCHEDULE_WAKEUP_GRACE_MS = 6e4;
@@ -130,6 +135,41 @@ function createScheduledWakeupTracker() {
130
135
  return { observe, pending };
131
136
  }
132
137
 
138
+ function modelTarget(model) {
139
+ return model == null || model === "" ? void 0 : model;
140
+ }
141
+ function needsModelSwitch(current, next) {
142
+ return modelTarget(current) !== modelTarget(next);
143
+ }
144
+ function modelSwitchFailureNotice(model, error) {
145
+ const name = modelTarget(model) ?? "default";
146
+ const detail = error instanceof Error ? error.message : String(error);
147
+ return `\u26A0\uFE0F Could not switch to model "${name}" \u2014 continuing with the previous model. ${detail}`;
148
+ }
149
+
150
+ const CLAUDE_MODEL_NOT_FOUND = "model_not_found";
151
+ function retiredModelFrom(message, runningModel) {
152
+ const m = message;
153
+ if (!m || m.type !== "assistant" || m.error !== CLAUDE_MODEL_NOT_FOUND) return null;
154
+ if ((m.parent_tool_use_id ?? null) !== null) return null;
155
+ return modelTarget(runningModel) ?? null;
156
+ }
157
+ function createRetiredModels() {
158
+ const retired = /* @__PURE__ */ new Set();
159
+ return {
160
+ retire(model) {
161
+ retired.add(model);
162
+ },
163
+ effective(model) {
164
+ const target = modelTarget(model);
165
+ return target !== void 0 && retired.has(target) ? void 0 : target;
166
+ }
167
+ };
168
+ }
169
+ function retiredModelNotice(model) {
170
+ 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.`;
171
+ }
172
+
133
173
  class Session {
134
174
  path;
135
175
  logPath;
@@ -158,6 +198,8 @@ class Session {
158
198
  backgroundTasks = [];
159
199
  /** B-587 review P3-4: CronCreate / ScheduleWakeup pending in this Claude process. */
160
200
  scheduledWakeups = createScheduledWakeupTracker();
201
+ /** B-634 ③: model ids Claude Code reported as model_not_found — session-scoped, survives relaunches. */
202
+ retiredModels = createRetiredModels();
161
203
  /**
162
204
  * Window after a user-initiated abort during which stray promise rejections
163
205
  * from tearing down the SDK query (MCP transports, in-flight tool calls,
@@ -211,6 +253,20 @@ class Session {
211
253
  sessionFoundCallbacks = [];
212
254
  /** Keep alive interval reference for cleanup */
213
255
  keepAliveInterval;
256
+ /**
257
+ * B-645: project context rides in front of real user messages (never the
258
+ * system prompt), so it survives relaunches without touching the mode hash
259
+ * or prewarm key. One per session process; created on first use.
260
+ */
261
+ _projectInjector = null;
262
+ get projectInjector() {
263
+ return this._projectInjector ??= createProjectInjector({
264
+ client: sharedProjectsClient(),
265
+ sessionId: () => this.client.sessionId,
266
+ metadata: () => this.client.getMetadata?.() ?? null,
267
+ agent: "claude"
268
+ });
269
+ }
214
270
  constructor(opts) {
215
271
  this.path = opts.path;
216
272
  this.api = opts.api;
@@ -597,6 +653,112 @@ function createRuntimeControls(isThinking) {
597
653
  return { setQuery, observe, request, stopRunningTasks };
598
654
  }
599
655
 
656
+ const CLAUDE_COMMAND_LIFECYCLE_STATES = ["queued", "started", "completed", "cancelled", "discarded", "refused"];
657
+ function readClaudeCommandLifecycle(frame) {
658
+ const m = frame;
659
+ if (!m) return null;
660
+ const isLifecycle = m.type === "command_lifecycle" || m.type === "system" && m.subtype === "command_lifecycle";
661
+ if (!isLifecycle || typeof m.command_uuid !== "string" || m.command_uuid.length === 0) return null;
662
+ const state = CLAUDE_COMMAND_LIFECYCLE_STATES.find((candidate) => candidate === m.state);
663
+ return state ? { uuid: m.command_uuid, state } : null;
664
+ }
665
+ const uuidList = (value) => Array.isArray(value) ? value.filter((item) => typeof item === "string" && item.length > 0) : [];
666
+ const INTERRUPT_CANCEL_QUEUED_CAPABILITY = "interrupt_cancel_queued_v1";
667
+ const PENDING_MAX = 256;
668
+ const REPORTED_MAX = 512;
669
+ const MSG_LIFECYCLE_CAPABILITY = "msg_lifecycle_v1";
670
+ function createClaudeCommandTracker() {
671
+ const pending = /* @__PURE__ */ new Map();
672
+ const reported = /* @__PURE__ */ new Set();
673
+ const drop = (uuid) => {
674
+ pending.delete(uuid);
675
+ if (reported.has(uuid)) return null;
676
+ reported.add(uuid);
677
+ if (reported.size > REPORTED_MAX) reported.delete(reported.values().next().value);
678
+ return uuid;
679
+ };
680
+ return {
681
+ /** A uuid-stamped user message (prompt or steer) was handed to the Query. */
682
+ track(uuid, payload) {
683
+ if (!pending.has(uuid) && pending.size >= PENDING_MAX) pending.delete(pending.keys().next().value);
684
+ pending.set(uuid, { started: false, payload });
685
+ },
686
+ isTracked(uuid) {
687
+ return pending.has(uuid);
688
+ },
689
+ /** A lifecycle frame; returns the uuids now known to have never run. */
690
+ observe(lifecycle) {
691
+ const entry = pending.get(lifecycle.uuid);
692
+ if (!entry) return [];
693
+ switch (lifecycle.state) {
694
+ case "queued":
695
+ return [];
696
+ case "started":
697
+ entry.started = true;
698
+ return [];
699
+ case "completed":
700
+ pending.delete(lifecycle.uuid);
701
+ return [];
702
+ default: {
703
+ if (entry.started) {
704
+ pending.delete(lifecycle.uuid);
705
+ return [];
706
+ }
707
+ const dropped = drop(lifecycle.uuid);
708
+ return dropped ? [dropped] : [];
709
+ }
710
+ }
711
+ },
712
+ /**
713
+ * An interrupt's receipt: `cancelled` members we track never ran;
714
+ * `still_queued` members we track are returned for the per-uuid
715
+ * follow-up (`cancel_async_message`) a CLI without cancel_queued needs.
716
+ */
717
+ onInterruptReceipt(receipt) {
718
+ const dropped = [];
719
+ for (const uuid of uuidList(receipt?.cancelled)) {
720
+ if (!pending.has(uuid)) continue;
721
+ const result = drop(uuid);
722
+ if (result) dropped.push(result);
723
+ }
724
+ const stillQueued = uuidList(receipt?.still_queued).filter((uuid) => pending.has(uuid));
725
+ return { dropped, stillQueued };
726
+ },
727
+ /** The answer to `cancel_async_message`: true = withdrawn before it ran; false = already dequeued, its lifecycle frames follow. */
728
+ onCancelResponse(uuid, cancelled) {
729
+ if (!cancelled || !pending.has(uuid)) return [];
730
+ const dropped = drop(uuid);
731
+ return dropped ? [dropped] : [];
732
+ },
733
+ /**
734
+ * B-634 ②: the Query is over — every tracked message that never
735
+ * `started` and was not already reported, in the order it was sent.
736
+ * Untracked afterwards; a later frame for one of them is ignored.
737
+ */
738
+ takeUnconfirmed() {
739
+ const out = [];
740
+ for (const [uuid, entry] of pending) {
741
+ if (entry.started || entry.payload === void 0 || reported.has(uuid)) continue;
742
+ out.push({ uuid, payload: entry.payload });
743
+ }
744
+ for (const { uuid } of out) pending.delete(uuid);
745
+ return out;
746
+ },
747
+ clear() {
748
+ pending.clear();
749
+ }
750
+ };
751
+ }
752
+ function planUnconfirmedCommands(commands, context) {
753
+ if (context.aborted || !context.parkFree) return { redeliver: null, tombstone: commands.map((c) => c.uuid) };
754
+ const index = commands.findIndex((c) => !context.redelivered.has(c.uuid));
755
+ if (index < 0) return { redeliver: null, tombstone: commands.map((c) => c.uuid) };
756
+ return {
757
+ redeliver: commands[index],
758
+ tombstone: commands.filter((_, i) => i !== index).map((c) => c.uuid)
759
+ };
760
+ }
761
+
600
762
  const AUTH_FAILURE_RESULT_TEXT = /Failed to authenticate|OAuth session expired/i;
601
763
  const QUERY_RECYCLE_NOTICE = {
602
764
  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 +912,6 @@ async function awaitFileExist(file, timeout = 1e4) {
750
912
  return false;
751
913
  }
752
914
 
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
915
  const SDK_TIMING_FIELDS = ["ttft_ms", "time_to_request_ms", "time_to_request_from_spawn_ms"];
766
916
  function delta(from, to) {
767
917
  if (typeof from !== "number" || typeof to !== "number" || to < from) return "-";
@@ -1096,88 +1246,6 @@ function createClaudeTurnTracker() {
1096
1246
  };
1097
1247
  }
1098
1248
 
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
1249
  const SET_MODEL_TIMEOUT_MS = 3e4;
1182
1250
  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
1251
  function promptUuid(uuid) {
@@ -1351,9 +1419,14 @@ async function claudeRemote(opts) {
1351
1419
  const discardWarm = (reason) => {
1352
1420
  warm?.lease.discard(reason);
1353
1421
  };
1422
+ const withoutRetiredModel = (next) => {
1423
+ if (!next || !opts.retiredModels) return next;
1424
+ const model = opts.retiredModels.effective(next.mode.model);
1425
+ return model === next.mode.model ? next : { ...next, mode: { ...next.mode, model } };
1426
+ };
1354
1427
  let initial;
1355
1428
  try {
1356
- initial = await opts.nextMessage();
1429
+ initial = withoutRetiredModel(await opts.nextMessage());
1357
1430
  } catch (error) {
1358
1431
  discardWarm("error");
1359
1432
  throw error;
@@ -1513,7 +1586,7 @@ async function claudeRemote(opts) {
1513
1586
  steer: (message, nextMode, localKey) => {
1514
1587
  mode = { ...nextMode, model: mode.model };
1515
1588
  const uuid = promptUuid(localKey);
1516
- if (uuid.uuid) commandTracker.track(uuid.uuid);
1589
+ if (uuid.uuid) commandTracker.track(uuid.uuid, { message, mode: nextMode });
1517
1590
  messages.push({
1518
1591
  type: "user",
1519
1592
  parent_tool_use_id: null,
@@ -1527,7 +1600,7 @@ async function claudeRemote(opts) {
1527
1600
  }
1528
1601
  let lastAssistantError;
1529
1602
  turn.pushed();
1530
- if (initialUserMessage.uuid) commandTracker.track(initialUserMessage.uuid);
1603
+ if (initialUserMessage.uuid) commandTracker.track(initialUserMessage.uuid, { message: initial.message, mode: initial.mode });
1531
1604
  let modelUnconfirmed = false;
1532
1605
  let pullingNext = false;
1533
1606
  const pullNextMessage = () => {
@@ -1536,8 +1609,10 @@ async function claudeRemote(opts) {
1536
1609
  return;
1537
1610
  }
1538
1611
  pullingNext = true;
1539
- opts.nextMessage().then(async (next) => {
1612
+ opts.nextMessage().then(async (pulled) => {
1613
+ let next = withoutRetiredModel(pulled);
1540
1614
  if (!next) {
1615
+ pullingNext = false;
1541
1616
  messages.end();
1542
1617
  return;
1543
1618
  }
@@ -1557,8 +1632,9 @@ async function claudeRemote(opts) {
1557
1632
  updateThinking(true);
1558
1633
  turn.pushed();
1559
1634
  const uuid = promptUuid(next.uuid);
1560
- if (uuid.uuid) commandTracker.track(uuid.uuid);
1635
+ if (uuid.uuid) commandTracker.track(uuid.uuid, { message: next.message, mode: next.mode });
1561
1636
  timingMarks = { pushedAt: next.enqueuedAt ?? Date.now() };
1637
+ pullingNext = false;
1562
1638
  messages.push({
1563
1639
  type: "user",
1564
1640
  parent_tool_use_id: null,
@@ -1567,9 +1643,8 @@ async function claudeRemote(opts) {
1567
1643
  message: { role: "user", content: next.message }
1568
1644
  });
1569
1645
  }).catch(() => {
1570
- messages.end();
1571
- }).finally(() => {
1572
1646
  pullingNext = false;
1647
+ messages.end();
1573
1648
  });
1574
1649
  };
1575
1650
  const recycleIfPoisoned = (result) => {
@@ -1608,6 +1683,17 @@ async function claudeRemote(opts) {
1608
1683
  if (message.type === "assistant" && message.error) {
1609
1684
  lastAssistantError = message.error;
1610
1685
  }
1686
+ const retired = opts.retiredModels ? retiredModelFrom(message, mode.model) : null;
1687
+ if (retired) {
1688
+ opts.retiredModels.retire(retired);
1689
+ mode = { ...mode, model: void 0 };
1690
+ logger.debug(`[claudeRemote] Model ${retired} reported model_not_found; moving the session to the default model`);
1691
+ opts.onCompletionEvent?.(retiredModelNotice(retired));
1692
+ void withTimeout(response.setModel(void 0), SET_MODEL_TIMEOUT_MS, "set_model").catch((e) => {
1693
+ logger.debug(`[claudeRemote] setModel(default) after model_not_found failed: ${e instanceof Error ? e.message : String(e)}`);
1694
+ modelUnconfirmed = true;
1695
+ });
1696
+ }
1611
1697
  if (message.type === "assistant" && timingMarks.firstAssistantAt === void 0) {
1612
1698
  timingMarks.firstAssistantAt = Date.now();
1613
1699
  } else if (message.type === "system" && message.subtype === "init" && timingMarks.initAt === void 0) {
@@ -1721,6 +1807,13 @@ async function claudeRemote(opts) {
1721
1807
  }
1722
1808
  } finally {
1723
1809
  updateThinking(false);
1810
+ if (cliCapabilities.has(MSG_LIFECYCLE_CAPABILITY)) {
1811
+ const unconfirmed = commandTracker.takeUnconfirmed();
1812
+ if (unconfirmed.length > 0) {
1813
+ logger.debug(`[claudeRemote] Query ended with ${unconfirmed.length} user message(s) never started: ${unconfirmed.map((c) => c.uuid).join(", ")}`);
1814
+ opts.onCommandsUnconfirmed?.(unconfirmed, { aborted: opts.signal?.aborted === true });
1815
+ }
1816
+ }
1724
1817
  }
1725
1818
  }
1726
1819
 
@@ -3952,6 +4045,7 @@ async function claudeRemoteLauncher(session, onPermissionModeChange, onEffective
3952
4045
  }
3953
4046
  try {
3954
4047
  const modeGate = new LaunchModeGate(session.queue.modeHasher);
4048
+ const redeliveredCommands = /* @__PURE__ */ new Set();
3955
4049
  let previousSessionId = null;
3956
4050
  await Promise.race([
3957
4051
  rewindReconciler.startup().catch((error) => logger.debug("[rewind] startup reconcile failed", error)),
@@ -4007,10 +4101,15 @@ async function claudeRemoteLauncher(session, onPermissionModeChange, onEffective
4007
4101
  return permissionHandler.isAborted(toolCallId);
4008
4102
  },
4009
4103
  nextMessage: async () => {
4104
+ const finalize = async (text) => {
4105
+ const out = await session.projectInjector.decorate(text);
4106
+ onPromptFinalized?.(out);
4107
+ return out;
4108
+ };
4010
4109
  const parked = modeGate.takeParked();
4011
4110
  if (parked) {
4012
4111
  permissionHandler.handleModeChange(parked.mode.permissionMode);
4013
- if (typeof parked.message === "string") onPromptFinalized?.(parked.message);
4112
+ if (typeof parked.message === "string") return { ...parked, message: await finalize(parked.message) };
4014
4113
  return parked;
4015
4114
  }
4016
4115
  await rewindReconciler.settled(controller.signal);
@@ -4039,8 +4138,7 @@ async function claudeRemoteLauncher(session, onPermissionModeChange, onEffective
4039
4138
  sessionId: session.client.sessionId
4040
4139
  });
4041
4140
  logger.debug(`[remote] Staged ${staged.length} attachment(s) for the coding agent`);
4042
- const withAttachments = appendStagedAttachmentsToPrompt(msg.message, staged);
4043
- onPromptFinalized?.(withAttachments);
4141
+ const withAttachments = await finalize(appendStagedAttachmentsToPrompt(msg.message, staged));
4044
4142
  return {
4045
4143
  message: withAttachments,
4046
4144
  mode: msg.mode,
@@ -4048,9 +4146,9 @@ async function claudeRemoteLauncher(session, onPermissionModeChange, onEffective
4048
4146
  uuid: promptUuidFor(msg.sourceIds)
4049
4147
  };
4050
4148
  }
4051
- onPromptFinalized?.(msg.message);
4149
+ const finalized = await finalize(msg.message);
4052
4150
  return {
4053
- message: msg.message,
4151
+ message: finalized,
4054
4152
  mode: msg.mode,
4055
4153
  enqueuedAt: msg.enqueuedAt,
4056
4154
  uuid: promptUuidFor(msg.sourceIds)
@@ -4124,6 +4222,25 @@ async function claudeRemoteLauncher(session, onPermissionModeChange, onEffective
4124
4222
  // queued behind a pre-empting steer's turn) before the model
4125
4223
  // read them — the same tombstone a destroyed queue item gets
4126
4224
  // (B-332), so the web shows them as not delivered, not answered.
4225
+ retiredModels: session.retiredModels,
4226
+ // B-634 ②: messages the Query ended without Claude Code ever
4227
+ // starting them — sent once more, or tombstoned (B-332).
4228
+ onCommandsUnconfirmed: (commands, { aborted }) => {
4229
+ const plan = planUnconfirmedCommands(commands, {
4230
+ aborted: aborted || exitReason !== null,
4231
+ parkFree: !modeGate.hasParked,
4232
+ redelivered: redeliveredCommands
4233
+ });
4234
+ if (plan.redeliver) {
4235
+ redeliveredCommands.add(plan.redeliver.uuid);
4236
+ logger.debug(`[remote]: re-sending unconfirmed user message ${plan.redeliver.uuid} into the next launch`);
4237
+ modeGate.park({ message: plan.redeliver.payload.message, mode: plan.redeliver.payload.mode, uuid: plan.redeliver.uuid });
4238
+ }
4239
+ if (plan.tombstone.length > 0) {
4240
+ logger.debug(`[remote]: ${plan.tombstone.length} user message(s) never started before the query ended`);
4241
+ session.client.sendQueueCancelReason(plan.tombstone, "aborted");
4242
+ }
4243
+ },
4127
4244
  onCommandsDropped: (uuids) => {
4128
4245
  logger.debug(`[remote]: ${uuids.length} user message(s) never read before the turn ended`);
4129
4246
  session.client.sendQueueCancelReason(uuids, "aborted");
@@ -4266,7 +4383,7 @@ async function loop(opts) {
4266
4383
  logger.debug(`[loop] Iteration with mode: ${mode}`);
4267
4384
  switch (mode) {
4268
4385
  case "local": {
4269
- const { claudeLocalLauncher } = await import('./claudeLocalLauncher-BmrpaRYJ.mjs');
4386
+ const { claudeLocalLauncher } = await import('./claudeLocalLauncher-BStvfa7M.mjs');
4270
4387
  const result = await claudeLocalLauncher(session);
4271
4388
  switch (result.type) {
4272
4389
  case "switch":
@@ -4431,71 +4548,6 @@ function cleanupHookSettingsFile(filepath) {
4431
4548
  }
4432
4549
  }
4433
4550
 
4434
- async function settleSessionOnExit(sessionId, intent, deps) {
4435
- if (intent === "archive") {
4436
- deps.updateMetadata((currentMetadata) => ({
4437
- ...currentMetadata,
4438
- lifecycleState: "archived",
4439
- lifecycleStateSince: Date.now(),
4440
- archivedBy: "cli",
4441
- archiveReason: "User terminated"
4442
- }));
4443
- }
4444
- if (intent === "hibernate" && deps.hibernation) {
4445
- const stamp = deps.hibernation;
4446
- const handler = (currentMetadata) => ({ ...currentMetadata, hibernation: stamp });
4447
- const landed = deps.updateMetadataAndWait ? await deps.updateMetadataAndWait(handler) : (deps.updateMetadata(handler), false);
4448
- if (!landed) deps.log?.("[START] hibernation stamp not confirmed before going offline");
4449
- }
4450
- deps.sendSessionDeath();
4451
- try {
4452
- if (intent === "archive") await deps.archiveSession(sessionId);
4453
- else await deps.deactivateSession(sessionId);
4454
- } catch (error) {
4455
- deps.log?.(`[START] ${intent === "archive" ? "archiveSession" : "deactivateSession"} during cleanup failed:`, error);
4456
- }
4457
- }
4458
- class SessionExitGate {
4459
- decided = null;
4460
- hibernateCommitted = false;
4461
- deferred = null;
4462
- /** Returns the intent to act on, or null when cleanup already started. */
4463
- claim(intent) {
4464
- if (this.decided === "hibernate" && !this.hibernateCommitted && intent !== "hibernate") {
4465
- if (this.deferred !== "archive") this.deferred = intent;
4466
- return null;
4467
- }
4468
- if (this.decided !== null) return null;
4469
- this.decided = intent;
4470
- return intent;
4471
- }
4472
- get current() {
4473
- return this.decided;
4474
- }
4475
- /** B-587: an exit was requested while the hibernation was deciding. */
4476
- get exitRequested() {
4477
- return this.deferred !== null;
4478
- }
4479
- /** B-587: the hibernation passed its last check — no more deferral. */
4480
- commitHibernate() {
4481
- if (this.decided === "hibernate") this.hibernateCommitted = true;
4482
- }
4483
- /**
4484
- * B-587: a hibernation that aborted hands the exit back. Returns the exit
4485
- * deferred meanwhile (the caller must run it now), or null.
4486
- */
4487
- release(intent) {
4488
- if (this.decided !== intent || intent === "hibernate" && this.hibernateCommitted) return null;
4489
- this.decided = null;
4490
- const deferred = this.deferred;
4491
- this.deferred = null;
4492
- return deferred;
4493
- }
4494
- }
4495
- function exitIntentFromArchiveFlag(archive) {
4496
- return archive ?? true ? "archive" : "offline";
4497
- }
4498
-
4499
4551
  function isUnsupportedSideQuestionError(error) {
4500
4552
  const message = error instanceof Error ? error.message : String(error);
4501
4553
  return /unknown|unsupported|not supported|unrecognized|invalid.*subtype/i.test(message);
@@ -4672,7 +4724,7 @@ function registerSideQuestionHandler(rpc, deps) {
4672
4724
  const retainMs = deps.retainMs ?? SIDE_QUESTION_RETAIN_MS;
4673
4725
  const maxRunMs = deps.maxRunMs ?? SIDE_QUESTION_MAX_RUN_MS;
4674
4726
  const fork = deps.run ?? (async (input) => {
4675
- const { query } = await import('./index-CEjJnq05.mjs');
4727
+ const { query } = await import('./index-CMf5VbzG.mjs');
4676
4728
  return runSideQuestion(query, input);
4677
4729
  });
4678
4730
  const run = async (input, live) => {
@@ -4786,6 +4838,25 @@ function registerSideQuestionHandler(rpc, deps) {
4786
4838
  };
4787
4839
  }
4788
4840
 
4841
+ function replayClaudeForkJsonl(file, sink) {
4842
+ let replayed = 0;
4843
+ for (const line of file.split("\n")) {
4844
+ if (line.trim().length === 0) continue;
4845
+ let parsed;
4846
+ try {
4847
+ parsed = JSON.parse(line);
4848
+ } catch {
4849
+ continue;
4850
+ }
4851
+ const result = RawJSONLinesSchema.safeParse(parsed);
4852
+ if (!result.success) continue;
4853
+ sink.send(result.data);
4854
+ replayed += 1;
4855
+ }
4856
+ if (replayed > 0) sink.closeTurn();
4857
+ return replayed;
4858
+ }
4859
+
4789
4860
  const ANALYZE_MIN_INTERVAL_MS = 5 * 60 * 1e3;
4790
4861
  const HOURLY_LIMIT = 30;
4791
4862
  const HOURLY_WINDOW_MS = 60 * 60 * 1e3;
@@ -5074,4 +5145,4 @@ function resolveMessageMode(current, meta, ctx) {
5074
5145
  };
5075
5146
  }
5076
5147
 
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 };
5148
+ export { BoardAnalyzer, FileRateLimiter, PrewarmHookGate, RawJSONLinesSchema, acquirePrewarmSlot, claudeCheckSession, claudeModeHash, claudePrewarmEligibility, claudePrewarmSessionEligibility, cleanupHookSettingsFile, contentLogMetadata, createClaudePrewarmLease, disposeAllClaudePrewarms, evaluatePrewarmPrediction, formatPrewarmLine, generateHookSettingsFile, getProjectPath, loop, parseSpecialCommand, prewarmCacheFile, prewarmPredictionMeta, prewarmSlotDir, readPrewarmCache, registerSideQuestionHandler, replayClaudeForkJsonl, resolveMessageMode, startHookServer, withAssistantDenylist, writePrewarmCache, writeSideQuestionSettingsFile };