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
@@ -2,6 +2,8 @@
2
2
 
3
3
  var claudeAgentSdk = require('@anthropic-ai/claude-agent-sdk');
4
4
  var smallFastModel = require('./smallFastModel-D_uxGMo3.cjs');
5
+ var logger = require('./logger-CphW5nUE.cjs');
6
+ var processTreeSnapshot = require('./processTreeSnapshot-mDbnuojn.cjs');
5
7
 
6
8
  const HAPPY_DEFAULT_ENTRYPOINT = "remote_mobile";
7
9
  function resolveHappyEntrypoint(currentValue) {
@@ -11,6 +13,20 @@ function resolveHappyEntrypoint(currentValue) {
11
13
  return HAPPY_DEFAULT_ENTRYPOINT;
12
14
  }
13
15
 
16
+ const CLAUDE_TREE_REAP_DELAY_MS = 8e3;
17
+ function scheduleClaudeTreeReap(pid, deps = {}) {
18
+ const snapshot = (deps.snapshot ?? ((root) => processTreeSnapshot.snapshotTree(root, { includeRoot: true, read: deps.read })))(pid);
19
+ if (snapshot.length === 0) return snapshot;
20
+ const schedule = deps.schedule ?? ((callback, delayMs) => {
21
+ setTimeout(callback, delayMs).unref?.();
22
+ });
23
+ schedule(() => {
24
+ const killed = processTreeSnapshot.killSurvivors(snapshot, deps);
25
+ if (killed.length > 0) logger.logger.debug(`[claude] Reaped ${killed.length} process(es) left from aborted Claude Code ${pid}: ${killed.join(", ")}`);
26
+ }, CLAUDE_TREE_REAP_DELAY_MS);
27
+ return snapshot;
28
+ }
29
+
14
30
  function query(params) {
15
31
  const opts = params.options;
16
32
  let systemPrompt = void 0;
@@ -63,12 +79,20 @@ function query(params) {
63
79
  onUserDialog: opts?.onUserDialog,
64
80
  supportedDialogKinds: opts?.onUserDialog ? opts.supportedDialogKinds : void 0
65
81
  };
82
+ let claudePid;
83
+ sdkOptions.onProcessSpawned = (pid) => {
84
+ claudePid = pid;
85
+ opts?.onProcessSpawned?.(pid);
86
+ };
66
87
  if (opts?.abort) {
67
88
  const controller = new AbortController();
68
89
  if (opts.abort.aborted) {
69
90
  controller.abort(opts.abort.reason);
70
91
  } else {
71
- opts.abort.addEventListener("abort", () => controller.abort(opts.abort?.reason), { once: true });
92
+ opts.abort.addEventListener("abort", () => {
93
+ if (claudePid !== void 0) scheduleClaudeTreeReap(claudePid);
94
+ controller.abort(opts.abort?.reason);
95
+ }, { once: true });
72
96
  }
73
97
  sdkOptions.abortController = controller;
74
98
  }
@@ -103,8 +127,4 @@ function query(params) {
103
127
  });
104
128
  }
105
129
 
106
- Object.defineProperty(exports, "AbortError", {
107
- enumerable: true,
108
- get: function () { return claudeAgentSdk.AbortError; }
109
- });
110
130
  exports.query = query;
@@ -1,6 +1,7 @@
1
1
  import { query as query$1 } from '@anthropic-ai/claude-agent-sdk';
2
- export { AbortError } from '@anthropic-ai/claude-agent-sdk';
3
2
  import { p as pinSmallFastModel, e as ensureLocalProxyBypass } from './smallFastModel-BLNgMrwR.mjs';
3
+ import { l as logger } from './logger-BUngm5Xg.mjs';
4
+ import { s as snapshotTree, k as killSurvivors } from './processTreeSnapshot-CuLJDNC-.mjs';
4
5
 
5
6
  const HAPPY_DEFAULT_ENTRYPOINT = "remote_mobile";
6
7
  function resolveHappyEntrypoint(currentValue) {
@@ -10,6 +11,20 @@ function resolveHappyEntrypoint(currentValue) {
10
11
  return HAPPY_DEFAULT_ENTRYPOINT;
11
12
  }
12
13
 
14
+ const CLAUDE_TREE_REAP_DELAY_MS = 8e3;
15
+ function scheduleClaudeTreeReap(pid, deps = {}) {
16
+ const snapshot = (deps.snapshot ?? ((root) => snapshotTree(root, { includeRoot: true, read: deps.read })))(pid);
17
+ if (snapshot.length === 0) return snapshot;
18
+ const schedule = deps.schedule ?? ((callback, delayMs) => {
19
+ setTimeout(callback, delayMs).unref?.();
20
+ });
21
+ schedule(() => {
22
+ const killed = killSurvivors(snapshot, deps);
23
+ if (killed.length > 0) logger.debug(`[claude] Reaped ${killed.length} process(es) left from aborted Claude Code ${pid}: ${killed.join(", ")}`);
24
+ }, CLAUDE_TREE_REAP_DELAY_MS);
25
+ return snapshot;
26
+ }
27
+
13
28
  function query(params) {
14
29
  const opts = params.options;
15
30
  let systemPrompt = void 0;
@@ -62,12 +77,20 @@ function query(params) {
62
77
  onUserDialog: opts?.onUserDialog,
63
78
  supportedDialogKinds: opts?.onUserDialog ? opts.supportedDialogKinds : void 0
64
79
  };
80
+ let claudePid;
81
+ sdkOptions.onProcessSpawned = (pid) => {
82
+ claudePid = pid;
83
+ opts?.onProcessSpawned?.(pid);
84
+ };
65
85
  if (opts?.abort) {
66
86
  const controller = new AbortController();
67
87
  if (opts.abort.aborted) {
68
88
  controller.abort(opts.abort.reason);
69
89
  } else {
70
- opts.abort.addEventListener("abort", () => controller.abort(opts.abort?.reason), { once: true });
90
+ opts.abort.addEventListener("abort", () => {
91
+ if (claudePid !== void 0) scheduleClaudeTreeReap(claudePid);
92
+ controller.abort(opts.abort?.reason);
93
+ }, { once: true });
71
94
  }
72
95
  sdkOptions.abortController = controller;
73
96
  }
@@ -102,4 +125,4 @@ function query(params) {
102
125
  });
103
126
  }
104
127
 
105
- export { query };
128
+ export { query as q };
@@ -1,4 +1,4 @@
1
- import { l as logger } from './logger--vAVtXB_.mjs';
1
+ import { l as logger } from './logger-BUngm5Xg.mjs';
2
2
 
3
3
  const MAX_WINDOWS_PER_PROVIDER = 8;
4
4
  function finite(value) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var logger = require('./logger-DXTWlPzP.cjs');
3
+ var logger = require('./logger-CphW5nUE.cjs');
4
4
 
5
5
  const MAX_WINDOWS_PER_PROVIDER = 8;
6
6
  function finite(value) {
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var logger = require('./logger-DXTWlPzP.cjs');
3
+ var logger = require('./logger-CphW5nUE.cjs');
4
4
  var child_process = require('child_process');
5
5
  var util = require('util');
6
6
  var fs = require('fs/promises');
7
- var crypto = require('crypto');
8
- var path = require('path');
7
+ var require$$3 = require('crypto');
8
+ var require$$1 = require('path');
9
9
  var spawn = require('cross-spawn');
10
- var projectPath = require('./projectPath-ChLhdOyt.cjs');
10
+ var projectPath = require('./projectPath-C3ioB4Bu.cjs');
11
11
  var os = require('os');
12
- var configuration = require('./configuration-4TGMrjul.cjs');
12
+ var configuration = require('./configuration-CYO-kPOS.cjs');
13
13
 
14
14
  function run$1(args, options) {
15
- const RUNNER_PATH = path.resolve(path.join(projectPath.projectPath(), "scripts", "ripgrep_launcher.cjs"));
15
+ const RUNNER_PATH = require$$1.resolve(require$$1.join(projectPath.projectPath(), "scripts", "ripgrep_launcher.cjs"));
16
16
  return new Promise((resolve2, reject) => {
17
17
  const child = spawn.spawn("node", [RUNNER_PATH, JSON.stringify(args)], {
18
18
  stdio: ["pipe", "pipe", "pipe"],
@@ -43,7 +43,7 @@ function run$1(args, options) {
43
43
  function getBinaryPath() {
44
44
  const platformName = os.platform();
45
45
  const binaryName = platformName === "win32" ? "difft.exe" : "difft";
46
- return path.resolve(path.join(projectPath.projectPath(), "tools", "unpacked", binaryName));
46
+ return require$$1.resolve(require$$1.join(projectPath.projectPath(), "tools", "unpacked", binaryName));
47
47
  }
48
48
  function run(args, options) {
49
49
  const binaryPath = getBinaryPath();
@@ -80,9 +80,9 @@ function run(args, options) {
80
80
  }
81
81
 
82
82
  function validatePath(targetPath, workingDirectory) {
83
- const resolvedTarget = path.resolve(workingDirectory, targetPath);
84
- const resolvedWorkingDir = path.resolve(workingDirectory);
85
- if (!resolvedTarget.startsWith(resolvedWorkingDir + path.sep) && resolvedTarget !== resolvedWorkingDir) {
83
+ const resolvedTarget = require$$1.resolve(workingDirectory, targetPath);
84
+ const resolvedWorkingDir = require$$1.resolve(workingDirectory);
85
+ if (!resolvedTarget.startsWith(resolvedWorkingDir + require$$1.sep) && resolvedTarget !== resolvedWorkingDir) {
86
86
  return {
87
87
  valid: false,
88
88
  resolvedPath: resolvedTarget,
@@ -155,9 +155,9 @@ function createUploadFileHandlers(happyHomeDir, now = Date.now, pathQuoteStyle =
155
155
  const entries = await fs.readdir(dir, { withFileTypes: true }).catch(() => []);
156
156
  await Promise.all(entries.map(async (entry) => {
157
157
  if (!entry.isFile() || !/^\..+\.[A-Za-z0-9_-]{8,80}\.part$/.test(entry.name)) return;
158
- const path$1 = path.join(dir, entry.name);
159
- const fileStat = await fs.stat(path$1).catch(() => null);
160
- if (fileStat && fileStat.mtimeMs < cutoff) await fs.unlink(path$1).catch(() => {
158
+ const path = require$$1.join(dir, entry.name);
159
+ const fileStat = await fs.stat(path).catch(() => null);
160
+ if (fileStat && fileStat.mtimeMs < cutoff) await fs.unlink(path).catch(() => {
161
161
  });
162
162
  }));
163
163
  };
@@ -165,12 +165,12 @@ function createUploadFileHandlers(happyHomeDir, now = Date.now, pathQuoteStyle =
165
165
  let tempPath = null;
166
166
  try {
167
167
  const buffer = decodeUploadBase64(data.content, MAX_USER_UPLOAD_BYTES);
168
- const dir = path.join(happyHomeDir, "uploads", safeSegment(data.subdir, "misc", 80));
168
+ const dir = require$$1.join(happyHomeDir, "uploads", safeSegment(data.subdir, "misc", 80));
169
169
  await fs.mkdir(dir, { recursive: true });
170
170
  const name = safeFileName(data.name);
171
- const token = crypto.randomUUID().replace(/-/g, "").slice(0, 12);
172
- const target = path.join(dir, uniqueFileName(name, token));
173
- tempPath = path.join(dir, `.${name}.legacy_${crypto.randomUUID().replace(/-/g, "")}.part`);
171
+ const token = require$$3.randomUUID().replace(/-/g, "").slice(0, 12);
172
+ const target = require$$1.join(dir, uniqueFileName(name, token));
173
+ tempPath = require$$1.join(dir, `.${name}.legacy_${require$$3.randomUUID().replace(/-/g, "")}.part`);
174
174
  await fs.writeFile(tempPath, buffer, { flag: "wx" });
175
175
  await fs.rename(tempPath, target);
176
176
  tempPath = null;
@@ -191,12 +191,12 @@ function createUploadFileHandlers(happyHomeDir, now = Date.now, pathQuoteStyle =
191
191
  }
192
192
  if (active.has(uploadId)) throw new Error("Upload id is already active");
193
193
  if (active.size >= MAX_ACTIVE_UPLOADS) throw new Error("Too many active uploads");
194
- const dir = path.join(happyHomeDir, "uploads", safeSegment(data.subdir, "misc", 80));
194
+ const dir = require$$1.join(happyHomeDir, "uploads", safeSegment(data.subdir, "misc", 80));
195
195
  await fs.mkdir(dir, { recursive: true });
196
196
  await sweepExpiredFiles(dir);
197
197
  const name = safeFileName(data.name);
198
- const targetPath = path.join(dir, uniqueFileName(name, crypto.randomUUID().replace(/-/g, "").slice(0, 12)));
199
- const tempPath = path.join(dir, `.${name}.${uploadId}.part`);
198
+ const targetPath = require$$1.join(dir, uniqueFileName(name, require$$3.randomUUID().replace(/-/g, "").slice(0, 12)));
199
+ const tempPath = require$$1.join(dir, `.${name}.${uploadId}.part`);
200
200
  await fs.writeFile(tempPath, Buffer.alloc(0), { flag: "wx" });
201
201
  active.set(uploadId, { tempPath, targetPath, totalSize: data.totalSize, received: 0, touchedAt: now() });
202
202
  return { success: true, size: 0 };
@@ -333,7 +333,7 @@ function registerCommonHandlers(rpcHandlerManager, workingDirectory) {
333
333
  if (data.expectedHash !== null && data.expectedHash !== void 0) {
334
334
  try {
335
335
  const existingBuffer = await fs.readFile(validation.resolvedPath);
336
- const existingHash = crypto.createHash("sha256").update(existingBuffer).digest("hex");
336
+ const existingHash = require$$3.createHash("sha256").update(existingBuffer).digest("hex");
337
337
  if (existingHash !== data.expectedHash) {
338
338
  return {
339
339
  success: false,
@@ -366,7 +366,7 @@ function registerCommonHandlers(rpcHandlerManager, workingDirectory) {
366
366
  }
367
367
  const buffer = Buffer.from(data.content, "base64");
368
368
  await fs.writeFile(validation.resolvedPath, buffer);
369
- const hash = crypto.createHash("sha256").update(buffer).digest("hex");
369
+ const hash = require$$3.createHash("sha256").update(buffer).digest("hex");
370
370
  return { success: true, hash };
371
371
  } catch (error) {
372
372
  logger.logger.debug("Failed to write file:", error);
@@ -387,7 +387,7 @@ function registerCommonHandlers(rpcHandlerManager, workingDirectory) {
387
387
  const entries = await fs.readdir(directoryPath, { withFileTypes: true });
388
388
  const directoryEntries = await Promise.all(
389
389
  entries.map(async (entry) => {
390
- const fullPath = path.join(directoryPath, entry.name);
390
+ const fullPath = require$$1.join(directoryPath, entry.name);
391
391
  let type = "other";
392
392
  let size;
393
393
  let modified;
@@ -428,26 +428,26 @@ function registerCommonHandlers(rpcHandlerManager, workingDirectory) {
428
428
  if (!validation.valid) {
429
429
  return { success: false, error: validation.error };
430
430
  }
431
- async function buildTree(path$1, name, currentDepth) {
431
+ async function buildTree(path, name, currentDepth) {
432
432
  try {
433
- const stats = await fs.stat(path$1);
433
+ const stats = await fs.stat(path);
434
434
  const node = {
435
435
  name,
436
- path: path$1,
436
+ path,
437
437
  type: stats.isDirectory() ? "directory" : "file",
438
438
  size: stats.size,
439
439
  modified: stats.mtime.getTime()
440
440
  };
441
441
  if (stats.isDirectory() && currentDepth < data.maxDepth) {
442
- const entries = await fs.readdir(path$1, { withFileTypes: true });
442
+ const entries = await fs.readdir(path, { withFileTypes: true });
443
443
  const children = [];
444
444
  await Promise.all(
445
445
  entries.map(async (entry) => {
446
446
  if (entry.isSymbolicLink()) {
447
- logger.logger.debug(`Skipping symlink: ${path.join(path$1, entry.name)}`);
447
+ logger.logger.debug(`Skipping symlink: ${require$$1.join(path, entry.name)}`);
448
448
  return;
449
449
  }
450
- const childPath = path.join(path$1, entry.name);
450
+ const childPath = require$$1.join(path, entry.name);
451
451
  const childNode = await buildTree(childPath, entry.name, currentDepth + 1);
452
452
  if (childNode) {
453
453
  children.push(childNode);
@@ -463,7 +463,7 @@ function registerCommonHandlers(rpcHandlerManager, workingDirectory) {
463
463
  }
464
464
  return node;
465
465
  } catch (error) {
466
- logger.logger.debug(`Failed to process ${path$1}:`, error instanceof Error ? error.message : String(error));
466
+ logger.logger.debug(`Failed to process ${path}:`, error instanceof Error ? error.message : String(error));
467
467
  return null;
468
468
  }
469
469
  }
@@ -1,4 +1,4 @@
1
- import { l as logger } from './logger--vAVtXB_.mjs';
1
+ import { l as logger } from './logger-BUngm5Xg.mjs';
2
2
  import { spawn as spawn$1, exec } from 'child_process';
3
3
  import { promisify } from 'util';
4
4
  import { mkdir, writeFile, appendFile, stat, rename, unlink, readdir, readFile } from 'fs/promises';
@@ -7,7 +7,7 @@ import { resolve, join, sep } from 'path';
7
7
  import { spawn } from 'cross-spawn';
8
8
  import { p as projectPath } from './projectPath-BTBIMB57.mjs';
9
9
  import { platform } from 'os';
10
- import { c as configuration } from './configuration-DVrb61aY.mjs';
10
+ import { c as configuration } from './configuration-PxzEJumr.mjs';
11
11
 
12
12
  function run$1(args, options) {
13
13
  const RUNNER_PATH = resolve(join(projectPath(), "scripts", "ripgrep_launcher.cjs"));
@@ -1,19 +1,19 @@
1
1
  'use strict';
2
2
 
3
- var logger = require('./logger-DXTWlPzP.cjs');
3
+ var logger = require('./logger-CphW5nUE.cjs');
4
4
  require('axios');
5
5
  require('node:events');
6
6
  require('socket.io-client');
7
- require('./attachmentLimits-SqeAHrVC.cjs');
7
+ require('./pushNotifications-DI92havG.cjs');
8
8
  require('node:crypto');
9
9
  require('tweetnacl');
10
- require('./configuration-4TGMrjul.cjs');
11
- require('./index-_l1Sdmbi.cjs');
12
- require('./registerCommonHandlers-C0_fyBQ0.cjs');
10
+ require('./configuration-CYO-kPOS.cjs');
11
+ require('./index-Dv0Q48P3.cjs');
12
+ require('./registerCommonHandlers-C7a_dUWs.cjs');
13
13
  require('os');
14
14
  require('child_process');
15
15
  require('@paralleldrive/cuid2');
16
- require('./persistence-BfX72dne.cjs');
16
+ require('./persistence-9BMYspxG.cjs');
17
17
  require('chalk');
18
18
  require('./types-CRS-srZK.cjs');
19
19
 
@@ -1,17 +1,17 @@
1
- import { l as logger } from './logger--vAVtXB_.mjs';
1
+ import { l as logger } from './logger-BUngm5Xg.mjs';
2
2
  import 'axios';
3
3
  import 'node:events';
4
4
  import 'socket.io-client';
5
- import './attachmentLimits-UyFn8fkQ.mjs';
5
+ import './pushNotifications-DCiBEVeC.mjs';
6
6
  import 'node:crypto';
7
7
  import 'tweetnacl';
8
- import './configuration-DVrb61aY.mjs';
9
- import './index-Clqlu17M.mjs';
10
- import './registerCommonHandlers-CvIedVRf.mjs';
8
+ import './configuration-PxzEJumr.mjs';
9
+ import './index-C6Vn5Eac.mjs';
10
+ import './registerCommonHandlers-CTkCvjxt.mjs';
11
11
  import 'os';
12
12
  import 'child_process';
13
13
  import '@paralleldrive/cuid2';
14
- import './persistence-DTk4sNpd.mjs';
14
+ import './persistence-BFUOHW5h.mjs';
15
15
  import 'chalk';
16
16
  import './types-CkqAACXx.mjs';
17
17
 
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var controlClient = require('./controlClient-BTaZlbC6.cjs');
4
- var sessionOps = require('./sessionOps-BAnr7n8t.cjs');
5
- var time = require('./time-A6zR3Iy6.cjs');
3
+ var controlClient = require('./controlClient-Bqv5v5OM.cjs');
4
+ var sessionOps = require('./sessionOps-BrGiU9-s.cjs');
5
+ var time = require('./time-Cjv0zxQO.cjs');
6
6
  var axios = require('axios');
7
7
  var os = require('node:os');
8
- var configuration = require('./configuration-4TGMrjul.cjs');
9
- var persistence = require('./persistence-BfX72dne.cjs');
8
+ var configuration = require('./configuration-CYO-kPOS.cjs');
9
+ var persistence = require('./persistence-9BMYspxG.cjs');
10
10
  var node_crypto = require('node:crypto');
11
11
 
12
12
  const ACTIVE_FRESH_WINDOW_MS = 15 * 60 * 1e3;
@@ -1,10 +1,10 @@
1
- import { h as resumeDaemonSession, l as listDaemonSessions } from './controlClient-BYKyGyxj.mjs';
2
- import { d as archiveSession, u as unarchiveSession, h as sessionLiveness, e as sendUserMessage, i as readSessionState, o as openUserScopedSocket } from './sessionOps-BVoXe12O.mjs';
3
- import { d as delay } from './time-BuGWTVP6.mjs';
1
+ import { h as resumeDaemonSession, l as listDaemonSessions } from './controlClient-DoeYovwP.mjs';
2
+ import { d as archiveSession, u as unarchiveSession, h as sessionLiveness, e as sendUserMessage, i as readSessionState, o as openUserScopedSocket } from './sessionOps-C58iDeD5.mjs';
3
+ import { d as delay } from './time-D3ETL7Jb.mjs';
4
4
  import axios from 'axios';
5
5
  import { hostname } from 'node:os';
6
- import { c as configuration } from './configuration-DVrb61aY.mjs';
7
- import { r as readSettings, c as readCredentialsForConfiguredRelay } from './persistence-DTk4sNpd.mjs';
6
+ import { c as configuration } from './configuration-PxzEJumr.mjs';
7
+ import { r as readSettings, b as readCredentialsForConfiguredRelay } from './persistence-BFUOHW5h.mjs';
8
8
  import { randomUUID } from 'node:crypto';
9
9
 
10
10
  const ACTIVE_FRESH_WINDOW_MS = 15 * 60 * 1e3;
@@ -1,9 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  var z = require('zod');
4
- var index = require('./index-_l1Sdmbi.cjs');
5
- var client = require('./client-C4zKGjiJ.cjs');
4
+ var index = require('./index-Dv0Q48P3.cjs');
5
+ var client = require('./client-BWjaHKtj.cjs');
6
6
  var precheckCompat = require('./precheckCompat-CWOi5c9L.cjs');
7
+ var client$1 = require('./client-DJplzPjD.cjs');
8
+ var prompt = require('./prompt-lgF9IE82.cjs');
7
9
  var agentGuidance = require('./agentGuidance-BtBx2xxE.cjs');
8
10
 
9
11
  const AUTOMATION_TOOL_NAMES = [
@@ -183,6 +185,83 @@ function registerAutomationTools(server, execute = createAutomationToolExecutor(
183
185
  }
184
186
  }
185
187
 
188
+ const PROJECT_TOOL_NAMES = ["project_context", "project_note"];
189
+ const PROJECT_TOOL_SCHEMAS = {
190
+ project_context: {
191
+ title: "Read Project Context",
192
+ readOnly: true,
193
+ description: `Read this session's Very Happy project: instructions, decisions in effect, recent log entries, other sessions and unread messages. By default returns only what changed since you last read it (\u22642KB); full=true returns everything. Returns "not in a project" when the session has no project.`,
194
+ inputSchema: {
195
+ section: z.z.enum(["instructions", "log", "sessions", "messages"]).optional().describe("Only this part"),
196
+ full: z.z.boolean().optional().describe("Everything, not just changes since your last read")
197
+ }
198
+ },
199
+ project_note: {
200
+ title: "Write Project Note",
201
+ readOnly: false,
202
+ description: 'Append to the project log what other sessions will need: kind "decision" (changes how they work), "finding" (they would otherwise redo it) or "handoff" (when you stop). Not progress. Takes effect immediately; the user can revoke it. To change an entry, write a new one with supersedes; revoke=true with supersedes withdraws your own entry.',
203
+ inputSchema: {
204
+ kind: z.z.enum(["decision", "finding", "handoff"]).describe("decision | finding | handoff"),
205
+ title: z.z.string().min(1).max(200).describe("One line"),
206
+ body: z.z.string().max(4e3).optional().describe("Details (\u22644KB)"),
207
+ supersedes: z.z.string().min(1).max(128).optional().describe('Entry it replaces: "#12" or its id'),
208
+ revoke: z.z.boolean().optional().describe("With supersedes: withdraw that entry (only your own) instead of writing a new one")
209
+ }
210
+ }
211
+ };
212
+ function describeError(error) {
213
+ if (error instanceof client$1.ProjectsUnsupportedError) return "This Very Happy server does not support projects yet.";
214
+ if (error instanceof client$1.ProjectRequestError) {
215
+ if (error.code === "project_note_quota_exceeded" && typeof error.details.suggestion === "string") return error.details.suggestion;
216
+ if (error.code === "not_a_project_member") return "not in a project";
217
+ if (error.code) return `Project request failed: ${error.code}`;
218
+ return "Project request failed";
219
+ }
220
+ return error instanceof Error && error.message ? error.message : "Project request failed";
221
+ }
222
+ function createProjectToolExecutor(sessionId, client = client$1.sharedProjectsClient()) {
223
+ return async (name, args) => {
224
+ const sid = sessionId();
225
+ if (name === "project_context") {
226
+ const full = args?.full === true;
227
+ const ctx = await client.context(sid, { full });
228
+ return { text: prompt.formatContextForTool(ctx, { full, section: typeof args?.section === "string" ? args.section : void 0 }) };
229
+ }
230
+ const membership = await client.membership(sid);
231
+ if (!membership.projectId) return { text: "not in a project" };
232
+ if (args?.revoke) {
233
+ if (!args?.supersedes) throw new Error("revoke needs supersedes (the entry to withdraw)");
234
+ const { entry: entry2 } = await client.revoke(membership.projectId, String(args.supersedes), sid);
235
+ return { text: `revoked #${entry2.seq}` };
236
+ }
237
+ const { entry } = await client.note(membership.projectId, {
238
+ kind: String(args?.kind),
239
+ title: String(args?.title ?? ""),
240
+ authorSessionId: sid,
241
+ ...typeof args?.body === "string" && args.body ? { body: args.body } : {},
242
+ ...typeof args?.supersedes === "string" ? { supersedes: args.supersedes } : {}
243
+ });
244
+ return { text: `recorded #${entry.seq}${entry.supersedes ? " (supersedes an earlier entry)" : ""}` };
245
+ };
246
+ }
247
+ function registerProjectTools(server, execute) {
248
+ for (const name of PROJECT_TOOL_NAMES) {
249
+ const spec = PROJECT_TOOL_SCHEMAS[name];
250
+ server.registerTool(name, {
251
+ description: spec.description,
252
+ title: spec.title,
253
+ inputSchema: spec.inputSchema,
254
+ annotations: { readOnlyHint: spec.readOnly, idempotentHint: spec.readOnly, openWorldHint: false, destructiveHint: false }
255
+ }, async (args) => {
256
+ try {
257
+ return { content: [{ type: "text", text: (await execute(name, args ?? {})).text }], isError: false };
258
+ } catch (error) {
259
+ return { content: [{ type: "text", text: describeError(error) }], isError: true };
260
+ }
261
+ });
262
+ }
263
+ }
264
+
186
265
  const SELF_REPORT_MIN_INTERVAL_MS = 30 * 1e3;
187
266
  const SELF_REPORT_FRESH_MS = 15 * 60 * 1e3;
188
267
  const ATTENTION_VALUES = ["none", "review", "blocked"];
@@ -234,11 +313,14 @@ function registerReportProgressTool(server, execute) {
234
313
  }
235
314
 
236
315
  exports.AUTOMATION_TOOL_NAMES = AUTOMATION_TOOL_NAMES;
316
+ exports.PROJECT_TOOL_NAMES = PROJECT_TOOL_NAMES;
317
+ exports.createProjectToolExecutor = createProjectToolExecutor;
237
318
  exports.createSelfReportState = createSelfReportState;
238
319
  exports.isSelfReportFresh = isSelfReportFresh;
239
320
  exports.normalizeAttention = normalizeAttention;
240
321
  exports.normalizePhase = normalizePhase;
241
322
  exports.normalizeProgress = normalizeProgress;
242
323
  exports.registerAutomationTools = registerAutomationTools;
324
+ exports.registerProjectTools = registerProjectTools;
243
325
  exports.registerReportProgressTool = registerReportProgressTool;
244
326
  exports.shouldAcceptSelfReport = shouldAcceptSelfReport;
@@ -1,7 +1,9 @@
1
1
  import { z } from 'zod';
2
- import { h as AutomationNameSchema, b as AutomationPrecheckSchema, j as AutomationConcurrencySchema, k as AutomationActionSchema, l as AutomationTriggerSchema } from './index-Clqlu17M.mjs';
3
- import { a as authenticatedAutomationsClient, b as automationRunIdFromEnv } from './client-CnlkkrZO.mjs';
2
+ import { k as AutomationNameSchema, c as AutomationPrecheckSchema, l as AutomationConcurrencySchema, m as AutomationActionSchema, o as AutomationTriggerSchema } from './index-C6Vn5Eac.mjs';
3
+ import { a as authenticatedAutomationsClient, b as automationRunIdFromEnv } from './client-CnB7kRCT.mjs';
4
4
  import { u as updateAutomationChecked, c as createAutomationChecked } from './precheckCompat-DeEbilbr.mjs';
5
+ import { P as ProjectsUnsupportedError, a as ProjectRequestError, s as sharedProjectsClient } from './client-Ca5Pcgy_.mjs';
6
+ import { f as formatContextForTool } from './prompt-BOouDaTM.mjs';
5
7
  import { R as REPORT_PROGRESS_TOOL_NAME, d as REPORT_PROGRESS_TOOL_TITLE, e as REPORT_PROGRESS_TOOL_DESCRIPTION } from './agentGuidance-BDYt2Qy2.mjs';
6
8
 
7
9
  const AUTOMATION_TOOL_NAMES = [
@@ -181,6 +183,83 @@ function registerAutomationTools(server, execute = createAutomationToolExecutor(
181
183
  }
182
184
  }
183
185
 
186
+ const PROJECT_TOOL_NAMES = ["project_context", "project_note"];
187
+ const PROJECT_TOOL_SCHEMAS = {
188
+ project_context: {
189
+ title: "Read Project Context",
190
+ readOnly: true,
191
+ description: `Read this session's Very Happy project: instructions, decisions in effect, recent log entries, other sessions and unread messages. By default returns only what changed since you last read it (\u22642KB); full=true returns everything. Returns "not in a project" when the session has no project.`,
192
+ inputSchema: {
193
+ section: z.enum(["instructions", "log", "sessions", "messages"]).optional().describe("Only this part"),
194
+ full: z.boolean().optional().describe("Everything, not just changes since your last read")
195
+ }
196
+ },
197
+ project_note: {
198
+ title: "Write Project Note",
199
+ readOnly: false,
200
+ description: 'Append to the project log what other sessions will need: kind "decision" (changes how they work), "finding" (they would otherwise redo it) or "handoff" (when you stop). Not progress. Takes effect immediately; the user can revoke it. To change an entry, write a new one with supersedes; revoke=true with supersedes withdraws your own entry.',
201
+ inputSchema: {
202
+ kind: z.enum(["decision", "finding", "handoff"]).describe("decision | finding | handoff"),
203
+ title: z.string().min(1).max(200).describe("One line"),
204
+ body: z.string().max(4e3).optional().describe("Details (\u22644KB)"),
205
+ supersedes: z.string().min(1).max(128).optional().describe('Entry it replaces: "#12" or its id'),
206
+ revoke: z.boolean().optional().describe("With supersedes: withdraw that entry (only your own) instead of writing a new one")
207
+ }
208
+ }
209
+ };
210
+ function describeError(error) {
211
+ if (error instanceof ProjectsUnsupportedError) return "This Very Happy server does not support projects yet.";
212
+ if (error instanceof ProjectRequestError) {
213
+ if (error.code === "project_note_quota_exceeded" && typeof error.details.suggestion === "string") return error.details.suggestion;
214
+ if (error.code === "not_a_project_member") return "not in a project";
215
+ if (error.code) return `Project request failed: ${error.code}`;
216
+ return "Project request failed";
217
+ }
218
+ return error instanceof Error && error.message ? error.message : "Project request failed";
219
+ }
220
+ function createProjectToolExecutor(sessionId, client = sharedProjectsClient()) {
221
+ return async (name, args) => {
222
+ const sid = sessionId();
223
+ if (name === "project_context") {
224
+ const full = args?.full === true;
225
+ const ctx = await client.context(sid, { full });
226
+ return { text: formatContextForTool(ctx, { full, section: typeof args?.section === "string" ? args.section : void 0 }) };
227
+ }
228
+ const membership = await client.membership(sid);
229
+ if (!membership.projectId) return { text: "not in a project" };
230
+ if (args?.revoke) {
231
+ if (!args?.supersedes) throw new Error("revoke needs supersedes (the entry to withdraw)");
232
+ const { entry: entry2 } = await client.revoke(membership.projectId, String(args.supersedes), sid);
233
+ return { text: `revoked #${entry2.seq}` };
234
+ }
235
+ const { entry } = await client.note(membership.projectId, {
236
+ kind: String(args?.kind),
237
+ title: String(args?.title ?? ""),
238
+ authorSessionId: sid,
239
+ ...typeof args?.body === "string" && args.body ? { body: args.body } : {},
240
+ ...typeof args?.supersedes === "string" ? { supersedes: args.supersedes } : {}
241
+ });
242
+ return { text: `recorded #${entry.seq}${entry.supersedes ? " (supersedes an earlier entry)" : ""}` };
243
+ };
244
+ }
245
+ function registerProjectTools(server, execute) {
246
+ for (const name of PROJECT_TOOL_NAMES) {
247
+ const spec = PROJECT_TOOL_SCHEMAS[name];
248
+ server.registerTool(name, {
249
+ description: spec.description,
250
+ title: spec.title,
251
+ inputSchema: spec.inputSchema,
252
+ annotations: { readOnlyHint: spec.readOnly, idempotentHint: spec.readOnly, openWorldHint: false, destructiveHint: false }
253
+ }, async (args) => {
254
+ try {
255
+ return { content: [{ type: "text", text: (await execute(name, args ?? {})).text }], isError: false };
256
+ } catch (error) {
257
+ return { content: [{ type: "text", text: describeError(error) }], isError: true };
258
+ }
259
+ });
260
+ }
261
+ }
262
+
184
263
  const SELF_REPORT_MIN_INTERVAL_MS = 30 * 1e3;
185
264
  const SELF_REPORT_FRESH_MS = 15 * 60 * 1e3;
186
265
  const ATTENTION_VALUES = ["none", "review", "blocked"];
@@ -231,4 +310,4 @@ function registerReportProgressTool(server, execute) {
231
310
  });
232
311
  }
233
312
 
234
- export { AUTOMATION_TOOL_NAMES as A, registerReportProgressTool as a, normalizePhase as b, createSelfReportState as c, normalizeProgress as d, isSelfReportFresh as i, normalizeAttention as n, registerAutomationTools as r, shouldAcceptSelfReport as s };
313
+ export { AUTOMATION_TOOL_NAMES as A, PROJECT_TOOL_NAMES as P, registerProjectTools as a, registerReportProgressTool as b, createSelfReportState as c, createProjectToolExecutor as d, normalizePhase as e, normalizeProgress as f, isSelfReportFresh as i, normalizeAttention as n, registerAutomationTools as r, shouldAcceptSelfReport as s };
@@ -53,6 +53,36 @@ export default async function(pi) {
53
53
  });
54
54
  }
55
55
  }
56
+ const steerEndpoint = managed && process.env.HAPPY_PI_STEER_URL;
57
+ if (steerEndpoint && pi.sendUserMessage) {
58
+ // B-632: \u300CSteer\u300D from the web \u2014 taken from the wrapper's long poll while pi runs,
59
+ // handed to pi as a steer, acknowledged (agent/acp/piSteerChannel.ts).
60
+ const target = new URL(steerEndpoint);
61
+ if (target.origin !== url.origin || !target.pathname.startsWith('/runtime-steer/')) throw new Error('Very Happy steer must be local');
62
+ const post = (suffix, body) => fetch(steerEndpoint + suffix, {method:'POST', redirect:'error', headers:{'content-type':'application/json'}, body:JSON.stringify(body || {}), signal:AbortSignal.timeout(2000)}).catch(() => {});
63
+ let running = false, polling = false;
64
+ const poll = async () => {
65
+ if (polling) return;
66
+ polling = true;
67
+ try {
68
+ while (running) {
69
+ let item = null;
70
+ try {
71
+ const response = await fetch(steerEndpoint, {redirect:'error', signal:AbortSignal.timeout(30000)});
72
+ if (response.status === 200) item = await response.json();
73
+ else if (response.status !== 204) await new Promise(r => setTimeout(r, 1000));
74
+ } catch { await new Promise(r => setTimeout(r, 1000)); continue; }
75
+ if (!item || typeof item.text !== 'string') continue;
76
+ if (!running) { await post('/ack', {id:item.id, delivered:false}); continue; }
77
+ try { pi.sendUserMessage(item.text, {deliverAs:'steer'}); await post('/ack', {id:item.id, delivered:true}); }
78
+ catch { await post('/ack', {id:item.id, delivered:false}); }
79
+ }
80
+ } finally { polling = false; }
81
+ };
82
+ pi.on('agent_start', async () => { running = true; void poll(); });
83
+ pi.on('agent_end', async () => { running = false; });
84
+ await post('/hello');
85
+ }
56
86
  if (managed) pi.on('tool_call', async (event, ctx) => {
57
87
  let mode = process.env.HAPPY_PERMISSION_MODE || 'default';
58
88
  const sid = process.env.HAPPY_SESSION_ID;