very-happy-cli 0.2.166 → 0.2.168

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 (178) hide show
  1. package/dist/{AcpBackend-tRWk7yi7.mjs → AcpBackend-BoLDLYNT.mjs} +3 -3
  2. package/dist/{AcpBackend-20VHOXwb.cjs → AcpBackend-r83MMm-i.cjs} +3 -3
  3. package/dist/{BasePermissionHandler-COKc4pmt.cjs → BasePermissionHandler-CS0eRtT-.cjs} +1 -1
  4. package/dist/{BasePermissionHandler-CDCLIrZJ.mjs → BasePermissionHandler-DTcVlmKi.mjs} +1 -1
  5. package/dist/{BaseReasoningProcessor-BDVKvooR.mjs → BaseReasoningProcessor-BddnNlXQ.mjs} +1 -1
  6. package/dist/{BaseReasoningProcessor-DAGQdkNp.cjs → BaseReasoningProcessor-RJiBhA8h.cjs} +1 -1
  7. package/dist/{agentHome-2IbIjKCa.mjs → agentHome--LRsdUx6.mjs} +4 -4
  8. package/dist/{agentHome-KVWj6nCl.cjs → agentHome-D-e_j9hK.cjs} +4 -4
  9. package/dist/{api-DnNL5fLw.cjs → api-COSJ3Yb7.cjs} +88 -10
  10. package/dist/{api-Cmz3XS4P.mjs → api-hXLwtgMi.mjs} +88 -10
  11. package/dist/{apiMachine-DeoQ8QbZ.cjs → apiMachine-BTCUUGC6.cjs} +50 -15
  12. package/dist/{apiMachine-B6ySCFe0.mjs → apiMachine-BauSXWNd.mjs} +50 -15
  13. package/dist/{attachmentContent-DPWxHgX4.cjs → attachmentContent-BCK0AxDS.cjs} +2 -2
  14. package/dist/{attachmentContent-CTXapi-_.mjs → attachmentContent-CS0B2N0Q.mjs} +2 -2
  15. package/dist/{attachmentLimits-BfgKV5iE.cjs → attachmentLimits-BEYEEBm8.cjs} +13 -1
  16. package/dist/{attachmentLimits-C1PCCM79.mjs → attachmentLimits-CxG3T18E.mjs} +13 -1
  17. package/dist/{auth-pzWIFdOD.mjs → auth-BFeFguVs.mjs} +5 -5
  18. package/dist/{auth-BMaBjRAj.mjs → auth-BUXH1L2k.mjs} +10 -10
  19. package/dist/{auth-D4-eQz85.cjs → auth-CCj5KlYS.cjs} +10 -10
  20. package/dist/{auth-ietHtvwu.cjs → auth-CfB2XcAW.cjs} +5 -5
  21. package/dist/{auto-DL75Dx3I.mjs → auto-D5BYdAoT.mjs} +14 -14
  22. package/dist/{auto-DOWTQDPa.cjs → auto-ZCHKb4jo.cjs} +14 -14
  23. package/dist/{bootstrap-BpXIc2wn.cjs → bootstrap-DSX64t23.cjs} +2 -2
  24. package/dist/{bootstrap-XE8A7Ut2.mjs → bootstrap-DklT121U.mjs} +2 -2
  25. package/dist/{browser-CcG8GLRV.cjs → browser-CeekQeKt.cjs} +1 -1
  26. package/dist/{browser-DDFi1T8C.mjs → browser-DUf1dth8.mjs} +1 -1
  27. package/dist/{claudeLocal-DmM5Oyhv.mjs → claudeLocal-C8pXtb8q.mjs} +5 -5
  28. package/dist/{claudeLocal-DXBXwIOG.cjs → claudeLocal-hH0YYex3.cjs} +5 -5
  29. package/dist/{claudeLocalLauncher-Cs4eUC3P.mjs → claudeLocalLauncher-AtUe2tM-.mjs} +10 -10
  30. package/dist/{claudeLocalLauncher-C41Y6Kp4.cjs → claudeLocalLauncher-B-ta13pT.cjs} +10 -10
  31. package/dist/{claudeSessionFork-BdLnc2Hv.mjs → claudeSessionFork-BQPBKEHk.mjs} +1 -1
  32. package/dist/{claudeSessionFork-Cs0I3eGI.cjs → claudeSessionFork-Cq9FBfjD.cjs} +1 -1
  33. package/dist/{client-CbK33y_s.mjs → client-Bg6-mQKO.mjs} +3 -3
  34. package/dist/{client-GjTnsq6F.mjs → client-Cbl3ejoq.mjs} +2 -2
  35. package/dist/{client-JISJx2f-.cjs → client-DZpkmS5l.cjs} +3 -3
  36. package/dist/{client-DJ0kX_8M.cjs → client-EnFomCjx.cjs} +2 -2
  37. package/dist/codex/happyMcpStdioBridge.cjs +14 -14
  38. package/dist/codex/happyMcpStdioBridge.mjs +14 -14
  39. package/dist/{codexAppServerClient-BTjn2ZCZ.cjs → codexAppServerClient-pllsN90-.cjs} +4 -4
  40. package/dist/{codexAppServerClient-CldXEojt.mjs → codexAppServerClient-sWuwtddZ.mjs} +4 -4
  41. package/dist/{codexCommand-DjMU-Ijf.mjs → codexCommand-DbTkMlW4.mjs} +137 -56
  42. package/dist/{codexCommand-BpD0N1F7.cjs → codexCommand-_jkx59gI.cjs} +137 -56
  43. package/dist/{config-DuLL0Ppe.cjs → config-BuIIZPZK.cjs} +3 -3
  44. package/dist/{config-DjSJKatx.mjs → config-FCOoREKj.mjs} +3 -3
  45. package/dist/{configuration-D2v3puap.mjs → configuration-BZo1JWNV.mjs} +2 -2
  46. package/dist/{configuration-B0cb3xA3.cjs → configuration-DeuGrnej.cjs} +1 -1
  47. package/dist/{connect-CnNNyM9I.mjs → connect-C2yHh85e.mjs} +13 -13
  48. package/dist/{connect-B7JWEzyg.cjs → connect-CjDdF12U.cjs} +13 -13
  49. package/dist/{context-BFUpYT39.cjs → context-BhvZtm3j.cjs} +1 -1
  50. package/dist/{context-DjfqLWzE.mjs → context-DZIIcfld.mjs} +1 -1
  51. package/dist/{controlClient-BMUJfUeF.mjs → controlClient-CXD-Xdny.mjs} +18 -4
  52. package/dist/{controlClient-CmnHGcyl.cjs → controlClient-IDE3se23.cjs} +18 -3
  53. package/dist/{createSessionMetadata-DbfRBhRu.cjs → createSessionMetadata-BCHFLSLk.cjs} +56 -3
  54. package/dist/{createSessionMetadata-DU0bCg2m.mjs → createSessionMetadata-DoLFya-Q.mjs} +57 -5
  55. package/dist/defaultPermissionMode-BtZtLdQz.cjs +197 -0
  56. package/dist/defaultPermissionMode-Dxfv-5Ud.mjs +191 -0
  57. package/dist/{deterministicJson-Dp3TVyap.cjs → deterministicJson-BqQKrUzw.cjs} +8 -8
  58. package/dist/{deterministicJson-D-WPUrZb.mjs → deterministicJson-CF1fJMaM.mjs} +8 -8
  59. package/dist/{doctor-BlXXyQ1L.mjs → doctor-C98yYhYr.mjs} +6 -6
  60. package/dist/{doctor-CkJmdPbi.cjs → doctor-D61ncaeL.cjs} +6 -6
  61. package/dist/{downloadTarget-DjSwMHun.mjs → downloadTarget-CaISZbNy.mjs} +6 -6
  62. package/dist/{downloadTarget-CiQqRIc-.cjs → downloadTarget-Dist9t2e.cjs} +6 -6
  63. package/dist/{ensureDaemonRunning-C_aIOhgG.cjs → ensureDaemonRunning-BB0hnWY_.cjs} +5 -5
  64. package/dist/{ensureDaemonRunning-CAQag1zE.mjs → ensureDaemonRunning-CNiqOarI.mjs} +5 -5
  65. package/dist/{handleResumeCommand-Ci7wacT-.mjs → handleResumeCommand-BzcANj0i.mjs} +5 -5
  66. package/dist/{handleResumeCommand-6KzBGDnl.cjs → handleResumeCommand-CkzW-T_f.cjs} +5 -5
  67. package/dist/{index-DEKIgZUo.cjs → index-BQU1sS9K.cjs} +4 -4
  68. package/dist/{index-DBmNwMX9.cjs → index-BeeWN9Et.cjs} +33 -33
  69. package/dist/{index-WGCT6SSV.mjs → index-CdmIOFwG.mjs} +34 -34
  70. package/dist/{index-HQsigW_J.mjs → index-D2hg_u5i.mjs} +3 -3
  71. package/dist/{index-DQplgo0W.mjs → index-Dgqk3lfG.mjs} +4 -4
  72. package/dist/{index-CaFCAlX8.cjs → index-DipBfs9w.cjs} +3 -3
  73. package/dist/index.cjs +2 -2
  74. package/dist/index.mjs +2 -2
  75. package/dist/{install-oJUvsFu9.mjs → install-CK1FvmYQ.mjs} +3 -3
  76. package/dist/{install-CejEiRGW.cjs → install-VtuffPLu.cjs} +3 -3
  77. package/dist/lib.cjs +11 -11
  78. package/dist/lib.d.cts +61 -0
  79. package/dist/lib.d.mts +61 -0
  80. package/dist/lib.mjs +11 -11
  81. package/dist/{lidState-D8BmnJV1.cjs → lidState-2IT0tas7.cjs} +1 -1
  82. package/dist/{lidState-BfximpjX.mjs → lidState-CJ3XkJRn.mjs} +1 -1
  83. package/dist/{localHappyAgentAuth-d7B6S_o7.cjs → localHappyAgentAuth-CPMh61Su.cjs} +1 -1
  84. package/dist/{localHappyAgentAuth-Ct1aXwqd.mjs → localHappyAgentAuth-DkLbntlf.mjs} +1 -1
  85. package/dist/{logger-BpQcwNnt.mjs → logger-C6zzu57a.mjs} +2 -2
  86. package/dist/{logger-JTcJU-uL.cjs → logger-Ockf1cjN.cjs} +2 -2
  87. package/dist/{machineMetadata-BBg_Njw3.cjs → machineMetadata-CoMYwSlG.cjs} +4 -3
  88. package/dist/{machineMetadata-CBdxABeI.mjs → machineMetadata-DmTGIZAV.mjs} +4 -3
  89. package/dist/{main-B5b1gA3K.mjs → main-B8TX9xPq.mjs} +45 -45
  90. package/dist/{main-C16fOGgn.cjs → main-CThJ9JQb.cjs} +45 -45
  91. package/dist/{manager-BQ4flvQZ.mjs → manager-BEsI4qt3.mjs} +9 -3
  92. package/dist/{manager-Cly8xVIR.cjs → manager-HrEj442o.cjs} +8 -2
  93. package/dist/{mcp-BnNiBBax.cjs → mcp-Dwku1p2I.cjs} +14 -14
  94. package/dist/{mcp-DGNWgVdv.mjs → mcp-Yw93dOiW.mjs} +14 -14
  95. package/dist/mirrorProtocol-CQ5fAUgq.mjs +1247 -0
  96. package/dist/mirrorProtocol-CdPhEBSh.cjs +1270 -0
  97. package/dist/{package-BqwrPxL0.mjs → package-5xAdq5fu.mjs} +7 -7
  98. package/dist/{package-C1XvUQFy.cjs → package-DfoyJe1O.cjs} +7 -7
  99. package/dist/{peerTools-DPvbcs8V.cjs → peerTools-BEnBvEcU.cjs} +4 -4
  100. package/dist/{peerTools-CeCe-3lk.mjs → peerTools-uDR6MG0-.mjs} +4 -4
  101. package/dist/{persistence-2Xp_o6x6.cjs → persistence-B5oT6oQ9.cjs} +147 -25
  102. package/dist/{persistence-B9LmhAE2.mjs → persistence-B6M_W5iC.mjs} +123 -12
  103. package/dist/{piRunnerArgs-DI29dDNo.cjs → piRunnerArgs-MLN46-nK.cjs} +1 -1
  104. package/dist/{piRunnerArgs-7FaTyNOq.mjs → piRunnerArgs-vNIUWHqo.mjs} +1 -1
  105. package/dist/{piRuntime-R8XVChxK.cjs → piRuntime-DkUg8_5q.cjs} +1 -1
  106. package/dist/{piRuntime-0qEK5AqE.mjs → piRuntime-WMuI7f4q.mjs} +1 -1
  107. package/dist/{piTerminal-zcQKc8Sp.mjs → piTerminal-4NBSZVxd.mjs} +16 -16
  108. package/dist/{piTerminal-Ccj0KNPr.cjs → piTerminal-Bskvs69Z.cjs} +16 -16
  109. package/dist/{rateLimitWindows-C2Jk3Ih7.cjs → rateLimitWindows-C2-Ky86q.cjs} +1 -1
  110. package/dist/{rateLimitWindows-Dhfhbtqu.mjs → rateLimitWindows-CJ1xDAxa.mjs} +1 -1
  111. package/dist/{registerCommonHandlers-DdfGsFbM.mjs → registerCommonHandlers-BLHKlk5Z.mjs} +2 -2
  112. package/dist/{registerCommonHandlers-Aha_KfM3.cjs → registerCommonHandlers-COSTo15G.cjs} +2 -2
  113. package/dist/{registerKillSessionHandler-DboQlGcH.mjs → registerKillSessionHandler-BVQfhSgm.mjs} +14 -9
  114. package/dist/{registerKillSessionHandler-CjitOpUA.cjs → registerKillSessionHandler-DDZISNzu.cjs} +14 -9
  115. package/dist/{remoteSessionClient-BwI8rpQw.cjs → remoteSessionClient-B2pOMZRw.cjs} +5 -5
  116. package/dist/{remoteSessionClient-B2DtWuNP.mjs → remoteSessionClient-Dx0M2MXV.mjs} +5 -5
  117. package/dist/{reportProgressTool-B-Rcy0s3.cjs → reportProgressTool-C5vDEv9Y.cjs} +1 -1
  118. package/dist/{reportProgressTool-DnAD8wOa.mjs → reportProgressTool-CcwFr0ek.mjs} +1 -1
  119. package/dist/{run-Bh66Xs40.cjs → run-BKTv1E-D.cjs} +323 -37
  120. package/dist/{run-DPEwJpQR.mjs → run-BZjIDOGM.mjs} +322 -36
  121. package/dist/{runClaude-DLr_nBzw.mjs → runClaude-DFa77Ffl.mjs} +87 -25
  122. package/dist/{runClaude-C-lJdAKD.cjs → runClaude-DUlFZWiK.cjs} +87 -25
  123. package/dist/{runClaudeDeps-vWWLod7J.cjs → runClaudeDeps--TnER0c3.cjs} +100 -31
  124. package/dist/{runClaudeDeps-C7JV7nXG.mjs → runClaudeDeps-BYohagQU.mjs} +105 -36
  125. package/dist/{runGemini-o-CUSayc.cjs → runGemini-BSBejXek.cjs} +32 -32
  126. package/dist/{runGemini-tH6sLw-G.mjs → runGemini-CUiq1Zei.mjs} +32 -32
  127. package/dist/{runOpenClaw-C5DZvVhn.mjs → runOpenClaw-CgwRP4gR.mjs} +16 -16
  128. package/dist/{runOpenClaw-D24f35l0.cjs → runOpenClaw-DQFEi3E1.cjs} +16 -16
  129. package/dist/{sandbox-BaL1aslA.mjs → sandbox-BTwAN7Yi.mjs} +4 -4
  130. package/dist/{sandbox-TJZJ6ngw.cjs → sandbox-DuLRfMY3.cjs} +4 -4
  131. package/dist/selfCheck-DF26lf1b.mjs +84 -0
  132. package/dist/{selfCheck-Dugi0Nk_.cjs → selfCheck-DuOLndWl.cjs} +34 -34
  133. package/dist/{send-DDcJ3ayi.mjs → send-ComZSvT5.mjs} +8 -8
  134. package/dist/{send-CkWOSYmU.cjs → send-Dl4TJ0Ia.cjs} +8 -8
  135. package/dist/{server-7qFQ8J2u.cjs → server-CWmamKcS.cjs} +6 -6
  136. package/dist/{server-CUjRvQSd.mjs → server-CXFSsyZx.mjs} +4 -4
  137. package/dist/{sessionLock-DfhNICyS.cjs → sessionLock-BFD8cFNP.cjs} +12 -3
  138. package/dist/{sessionLock-DqVyHFAQ.mjs → sessionLock-DCKf-gjd.mjs} +12 -4
  139. package/dist/{sessionModeFile-M4OpiyrF.mjs → sessionModeFile-BYxsFSvc.mjs} +1 -1
  140. package/dist/{sessionModeFile-CIznKD7O.cjs → sessionModeFile-i-MVQRcU.cjs} +1 -1
  141. package/dist/{sessionOps-DOyy4gkY.cjs → sessionOps-BAQ_80Rg.cjs} +4 -4
  142. package/dist/{sessionOps-BnaEaOKs.mjs → sessionOps-CBXsQGV5.mjs} +4 -4
  143. package/dist/{sessionScanner-CcuOn9uU.mjs → sessionScanner-CwPBvQK2.mjs} +3 -3
  144. package/dist/{sessionScanner-Cu1yKlj4.cjs → sessionScanner-Dth3iDCi.cjs} +3 -3
  145. package/dist/{sessions-BQgk5Kw8.cjs → sessions-BULd_RQt.cjs} +9 -9
  146. package/dist/{sessions-C9O91rL1.mjs → sessions-DYAqiUS0.mjs} +9 -9
  147. package/dist/{setupOfflineReconnection-Byy8aeKT.mjs → setupOfflineReconnection-Bo9xb30l.mjs} +2 -2
  148. package/dist/{setupOfflineReconnection-DFmQ8s6I.cjs → setupOfflineReconnection-DI8BQf_g.cjs} +2 -2
  149. package/dist/{spawn-EZ2yrtWd.mjs → spawn-DmXpKIOT.mjs} +13 -13
  150. package/dist/{spawn-BS7LPmSm.cjs → spawn-oikb5mUh.cjs} +13 -13
  151. package/dist/{spawnHappyCLI-BAa49m0q.mjs → spawnHappyCLI-BCnZfffk.mjs} +1 -1
  152. package/dist/{spawnHappyCLI-DyaldIe5.cjs → spawnHappyCLI-Cs177BB4.cjs} +1 -1
  153. package/dist/{specialCommands-DouFaJ_0.cjs → specialCommands-CmrwEh71.cjs} +3 -3
  154. package/dist/{specialCommands-CCWtwIGZ.mjs → specialCommands-xD4uOtdG.mjs} +3 -3
  155. package/dist/{startFileWatcher-Dfs4whzr.mjs → startFileWatcher-De7rN8QW.mjs} +1 -1
  156. package/dist/{startFileWatcher-DQbbypJv.cjs → startFileWatcher-S_Af_QPR.cjs} +1 -1
  157. package/dist/{sync-x_lI_3j_.cjs → sync-BS9_zSQ2.cjs} +1 -1
  158. package/dist/{sync-BLpH13Kb.mjs → sync-CHOB3Org.mjs} +1 -1
  159. package/dist/{systemPrompt-4erwILTB.cjs → systemPrompt-D2ICcIsu.cjs} +1 -1
  160. package/dist/{systemPrompt-BanyDihy.mjs → systemPrompt-DNLUUejs.mjs} +1 -1
  161. package/dist/{teams-DzetlGWC.cjs → teams-BUbESH6L.cjs} +6 -6
  162. package/dist/{teams-D6BOT3lR.mjs → teams-By3oBC7r.mjs} +6 -6
  163. package/dist/{time-CfDKj6Bx.mjs → time-CN0jVVir.mjs} +1 -1
  164. package/dist/{time-T0YmeOhS.cjs → time-uSKpEhew.cjs} +1 -1
  165. package/dist/{titleGenerator-CoMxqKfP.cjs → titleGenerator-CLIXjn9b.cjs} +2 -2
  166. package/dist/{titleGenerator-ChImQ4q-.mjs → titleGenerator-CegRJ47n.mjs} +1 -1
  167. package/dist/{todo-CZZebKZg.cjs → todo-Bg1vurv9.cjs} +5 -5
  168. package/dist/{todo-SVtYxGON.mjs → todo-Bl3abqvy.mjs} +5 -5
  169. package/dist/{tools-3X2z3YDe.mjs → tools-BcLUrC57.mjs} +1 -1
  170. package/dist/{tools-IJ0TAcJs.cjs → tools-DuWKlc0k.cjs} +1 -1
  171. package/dist/{uninstall-CypD-kr1.mjs → uninstall-BlpZlM9U.mjs} +3 -3
  172. package/dist/{uninstall-CqqCWj7w.cjs → uninstall-DWnj2XVT.cjs} +3 -3
  173. package/package.json +7 -7
  174. package/dist/defaultPermissionMode-BnxJPVHT.mjs +0 -4
  175. package/dist/defaultPermissionMode-CxmTXUQR.cjs +0 -7
  176. package/dist/mirrorProtocol-BEGk2--0.cjs +0 -266
  177. package/dist/mirrorProtocol-h5WHpdhh.mjs +0 -248
  178. package/dist/selfCheck-DPi4lqme.mjs +0 -84
package/dist/lib.d.cts CHANGED
@@ -367,6 +367,7 @@ type Session = {
367
367
  declare const MachineMetadataSchema: z$1.ZodObject<{
368
368
  teamsVersion: z$1.ZodOptional<z$1.ZodNumber>;
369
369
  teamLaunchVersion: z$1.ZodOptional<z$1.ZodNumber>;
370
+ worktreeVersion: z$1.ZodOptional<z$1.ZodNumber>;
370
371
  host: z$1.ZodString;
371
372
  platform: z$1.ZodString;
372
373
  happyCliVersion: z$1.ZodString;
@@ -582,6 +583,11 @@ declare const DaemonStateSchema: z$1.ZodObject<{
582
583
  }, z$1.core.$strip>>;
583
584
  }, z$1.core.$strip>>;
584
585
  }, z$1.core.$strip>>;
586
+ agentHibernation: z$1.ZodOptional<z$1.ZodObject<{
587
+ idleMs: z$1.ZodNumber;
588
+ rpcAvailable: z$1.ZodBoolean;
589
+ detectedAt: z$1.ZodNumber;
590
+ }, z$1.core.$loose>>;
585
591
  }, z$1.core.$strip>;
586
592
  type DaemonState = z$1.infer<typeof DaemonStateSchema>;
587
593
  type ClaudeAuthState = ClaudeAuthState$1;
@@ -714,6 +720,11 @@ type Metadata = {
714
720
  queueCancellation?: boolean;
715
721
  /** Explicit feature negotiation; old CLIs omit this field. */
716
722
  capabilities?: string[];
723
+ /** B-586: session started inside a linked git worktree (snapshot at start). Old clients ignore it. */
724
+ worktree?: {
725
+ branch: string | null;
726
+ root: string;
727
+ } | null;
717
728
  homeDir: string;
718
729
  happyHomeDir: string;
719
730
  happyLibDir: string;
@@ -725,6 +736,19 @@ type Metadata = {
725
736
  lifecycleStateSince?: number;
726
737
  archivedBy?: string;
727
738
  archiveReason?: string;
739
+ /**
740
+ * B-587: written by a wrapper that exited by idle hibernation (offline, not
741
+ * archived); cleared by the next wrapper on reconnect. `seq` = its message
742
+ * cursor — records above it are replayed on wake. Old clients ignore it.
743
+ */
744
+ hibernation?: {
745
+ at: number;
746
+ seq: number;
747
+ idleMs: number;
748
+ v: 1;
749
+ };
750
+ /** B-587: user opted this session out of idle hibernation (web ⋯ menu). */
751
+ keepAwake?: boolean;
728
752
  flavor?: string;
729
753
  sandbox?: SandboxConfig | null;
730
754
  dangerouslySkipPermissions?: boolean | null;
@@ -1286,6 +1310,28 @@ declare class ApiSessionClient extends EventEmitter {
1286
1310
  } | {
1287
1311
  type: 'ready';
1288
1312
  }, id?: string): void;
1313
+ /** Last user/agent activity this wrapper saw (spec §2.1). */
1314
+ private lastActivity;
1315
+ private inboundFrozen;
1316
+ private frozenInbound;
1317
+ private heartbeatsMuted;
1318
+ private lastHeartbeat;
1319
+ get lastHeartbeatAt(): number;
1320
+ muteHeartbeats(): void;
1321
+ unmuteHeartbeats(): void;
1322
+ private inboundRoutedDuringCommit;
1323
+ noteActivity(now?: number): void;
1324
+ get lastActivityAt(): number;
1325
+ /** The message cursor (highest seq this wrapper has seen). */
1326
+ get messageCursor(): number;
1327
+ /** Start watching for inbound routed during the hibernation commit window. */
1328
+ beginHibernationCommit(): void;
1329
+ /** Was any inbound message routed since beginHibernationCommit()? */
1330
+ inboundRoutedSinceCommit(): boolean;
1331
+ /** Stop routing inbound messages; the next wrapper replays them (spec §3/§4). */
1332
+ freezeInbound(): void;
1333
+ /** An aborted hibernation: route whatever arrived while frozen, in order. */
1334
+ unfreezeInbound(): void;
1289
1335
  /**
1290
1336
  * Send a ping message to keep the connection alive
1291
1337
  */
@@ -1379,6 +1425,13 @@ declare class ApiSessionClient extends EventEmitter {
1379
1425
  body: unknown;
1380
1426
  }>>;
1381
1427
  updateMetadata(handler: (metadata: Metadata) => Metadata): void;
1428
+ /**
1429
+ * B-587: the same write, awaitable with a ceiling — the hibernation stamp
1430
+ * must land before `session-end`. Resolves false on timeout (the write
1431
+ * itself keeps retrying in the background, exactly like updateMetadata).
1432
+ */
1433
+ updateMetadataAndWait(handler: (metadata: Metadata) => Metadata, timeoutMs?: number): Promise<boolean>;
1434
+ private writeMetadata;
1382
1435
  /**
1383
1436
  * Update session agent state
1384
1437
  * @param handler - Handler function that returns the updated agent state
@@ -1628,6 +1681,8 @@ declare class ApiMachineClient {
1628
1681
  private cliUpdateState;
1629
1682
  private cliUpdatePushChain;
1630
1683
  private claudeAuthState;
1684
+ /** B-587: the machine's hibernation threshold, published as a capability. */
1685
+ private agentHibernationIdleMs;
1631
1686
  private rateLimitPushChain;
1632
1687
  private readonly rateLimitPublisher;
1633
1688
  private rpcHandlerManager;
@@ -1702,6 +1757,12 @@ declare class ApiMachineClient {
1702
1757
  * caller checks the echoed state and re-sends on the next probe).
1703
1758
  */
1704
1759
  setClaudeAuthState(state: ClaudeAuthState): Promise<boolean>;
1760
+ /**
1761
+ * B-587: `agent-hibernation-set {idleMs}` (0 = off) and the
1762
+ * `daemonState.agentHibernation` capability. Call before connect().
1763
+ */
1764
+ setAgentHibernationHandlers(initialIdleMs: number, set: (idleMs: number) => Promise<number>): void;
1765
+ private publishAgentHibernation;
1705
1766
  /** B-276 machine RPCs. Responses always carry `claudeAuth` so the web can refresh in place. */
1706
1767
  setClaudeAuthHandlers(handlers: {
1707
1768
  probe: () => Promise<ClaudeAuthState>;
package/dist/lib.d.mts CHANGED
@@ -367,6 +367,7 @@ type Session = {
367
367
  declare const MachineMetadataSchema: z$1.ZodObject<{
368
368
  teamsVersion: z$1.ZodOptional<z$1.ZodNumber>;
369
369
  teamLaunchVersion: z$1.ZodOptional<z$1.ZodNumber>;
370
+ worktreeVersion: z$1.ZodOptional<z$1.ZodNumber>;
370
371
  host: z$1.ZodString;
371
372
  platform: z$1.ZodString;
372
373
  happyCliVersion: z$1.ZodString;
@@ -582,6 +583,11 @@ declare const DaemonStateSchema: z$1.ZodObject<{
582
583
  }, z$1.core.$strip>>;
583
584
  }, z$1.core.$strip>>;
584
585
  }, z$1.core.$strip>>;
586
+ agentHibernation: z$1.ZodOptional<z$1.ZodObject<{
587
+ idleMs: z$1.ZodNumber;
588
+ rpcAvailable: z$1.ZodBoolean;
589
+ detectedAt: z$1.ZodNumber;
590
+ }, z$1.core.$loose>>;
585
591
  }, z$1.core.$strip>;
586
592
  type DaemonState = z$1.infer<typeof DaemonStateSchema>;
587
593
  type ClaudeAuthState = ClaudeAuthState$1;
@@ -714,6 +720,11 @@ type Metadata = {
714
720
  queueCancellation?: boolean;
715
721
  /** Explicit feature negotiation; old CLIs omit this field. */
716
722
  capabilities?: string[];
723
+ /** B-586: session started inside a linked git worktree (snapshot at start). Old clients ignore it. */
724
+ worktree?: {
725
+ branch: string | null;
726
+ root: string;
727
+ } | null;
717
728
  homeDir: string;
718
729
  happyHomeDir: string;
719
730
  happyLibDir: string;
@@ -725,6 +736,19 @@ type Metadata = {
725
736
  lifecycleStateSince?: number;
726
737
  archivedBy?: string;
727
738
  archiveReason?: string;
739
+ /**
740
+ * B-587: written by a wrapper that exited by idle hibernation (offline, not
741
+ * archived); cleared by the next wrapper on reconnect. `seq` = its message
742
+ * cursor — records above it are replayed on wake. Old clients ignore it.
743
+ */
744
+ hibernation?: {
745
+ at: number;
746
+ seq: number;
747
+ idleMs: number;
748
+ v: 1;
749
+ };
750
+ /** B-587: user opted this session out of idle hibernation (web ⋯ menu). */
751
+ keepAwake?: boolean;
728
752
  flavor?: string;
729
753
  sandbox?: SandboxConfig | null;
730
754
  dangerouslySkipPermissions?: boolean | null;
@@ -1286,6 +1310,28 @@ declare class ApiSessionClient extends EventEmitter {
1286
1310
  } | {
1287
1311
  type: 'ready';
1288
1312
  }, id?: string): void;
1313
+ /** Last user/agent activity this wrapper saw (spec §2.1). */
1314
+ private lastActivity;
1315
+ private inboundFrozen;
1316
+ private frozenInbound;
1317
+ private heartbeatsMuted;
1318
+ private lastHeartbeat;
1319
+ get lastHeartbeatAt(): number;
1320
+ muteHeartbeats(): void;
1321
+ unmuteHeartbeats(): void;
1322
+ private inboundRoutedDuringCommit;
1323
+ noteActivity(now?: number): void;
1324
+ get lastActivityAt(): number;
1325
+ /** The message cursor (highest seq this wrapper has seen). */
1326
+ get messageCursor(): number;
1327
+ /** Start watching for inbound routed during the hibernation commit window. */
1328
+ beginHibernationCommit(): void;
1329
+ /** Was any inbound message routed since beginHibernationCommit()? */
1330
+ inboundRoutedSinceCommit(): boolean;
1331
+ /** Stop routing inbound messages; the next wrapper replays them (spec §3/§4). */
1332
+ freezeInbound(): void;
1333
+ /** An aborted hibernation: route whatever arrived while frozen, in order. */
1334
+ unfreezeInbound(): void;
1289
1335
  /**
1290
1336
  * Send a ping message to keep the connection alive
1291
1337
  */
@@ -1379,6 +1425,13 @@ declare class ApiSessionClient extends EventEmitter {
1379
1425
  body: unknown;
1380
1426
  }>>;
1381
1427
  updateMetadata(handler: (metadata: Metadata) => Metadata): void;
1428
+ /**
1429
+ * B-587: the same write, awaitable with a ceiling — the hibernation stamp
1430
+ * must land before `session-end`. Resolves false on timeout (the write
1431
+ * itself keeps retrying in the background, exactly like updateMetadata).
1432
+ */
1433
+ updateMetadataAndWait(handler: (metadata: Metadata) => Metadata, timeoutMs?: number): Promise<boolean>;
1434
+ private writeMetadata;
1382
1435
  /**
1383
1436
  * Update session agent state
1384
1437
  * @param handler - Handler function that returns the updated agent state
@@ -1628,6 +1681,8 @@ declare class ApiMachineClient {
1628
1681
  private cliUpdateState;
1629
1682
  private cliUpdatePushChain;
1630
1683
  private claudeAuthState;
1684
+ /** B-587: the machine's hibernation threshold, published as a capability. */
1685
+ private agentHibernationIdleMs;
1631
1686
  private rateLimitPushChain;
1632
1687
  private readonly rateLimitPublisher;
1633
1688
  private rpcHandlerManager;
@@ -1702,6 +1757,12 @@ declare class ApiMachineClient {
1702
1757
  * caller checks the echoed state and re-sends on the next probe).
1703
1758
  */
1704
1759
  setClaudeAuthState(state: ClaudeAuthState): Promise<boolean>;
1760
+ /**
1761
+ * B-587: `agent-hibernation-set {idleMs}` (0 = off) and the
1762
+ * `daemonState.agentHibernation` capability. Call before connect().
1763
+ */
1764
+ setAgentHibernationHandlers(initialIdleMs: number, set: (idleMs: number) => Promise<number>): void;
1765
+ private publishAgentHibernation;
1705
1766
  /** B-276 machine RPCs. Responses always carry `claudeAuth` so the web can refresh in place. */
1706
1767
  setClaudeAuthHandlers(handlers: {
1707
1768
  probe: () => Promise<ClaudeAuthState>;
package/dist/lib.mjs CHANGED
@@ -1,9 +1,9 @@
1
- export { A as ApiClient, a as ApiSessionClient } from './api-Cmz3XS4P.mjs';
2
- export { l as logger } from './logger-BpQcwNnt.mjs';
3
- export { c as configuration } from './configuration-D2v3puap.mjs';
1
+ export { A as ApiClient, a as ApiSessionClient } from './api-hXLwtgMi.mjs';
2
+ export { l as logger } from './logger-C6zzu57a.mjs';
3
+ export { c as configuration } from './configuration-BZo1JWNV.mjs';
4
4
  export { R as RawJSONLinesSchema } from './types-CkqAACXx.mjs';
5
5
  import 'axios';
6
- import './lidState-BfximpjX.mjs';
6
+ import './lidState-CJ3XkJRn.mjs';
7
7
  import './authRelay-DSAvg1uv.mjs';
8
8
  import 'node:crypto';
9
9
  import 'tweetnacl';
@@ -11,13 +11,13 @@ import 'os';
11
11
  import 'child_process';
12
12
  import 'node:events';
13
13
  import 'socket.io-client';
14
- import './attachmentLimits-C1PCCM79.mjs';
14
+ import './attachmentLimits-CxG3T18E.mjs';
15
15
  import 'zod';
16
16
  import './index-B0HEEYGh.mjs';
17
17
  import '@paralleldrive/cuid2';
18
18
  import './limits-DIo7rEBR.mjs';
19
- import './time-CfDKj6Bx.mjs';
20
- import './registerCommonHandlers-DdfGsFbM.mjs';
19
+ import './time-CN0jVVir.mjs';
20
+ import './registerCommonHandlers-BLHKlk5Z.mjs';
21
21
  import 'util';
22
22
  import 'fs/promises';
23
23
  import 'crypto';
@@ -25,10 +25,10 @@ import 'path';
25
25
  import 'cross-spawn';
26
26
  import './projectPath-BTBIMB57.mjs';
27
27
  import 'url';
28
- import './sync-BLpH13Kb.mjs';
28
+ import './sync-CHOB3Org.mjs';
29
29
  import './backgroundTaskActivity-8PdPxrvy.mjs';
30
- import './controlClient-BMUJfUeF.mjs';
31
- import './persistence-B9LmhAE2.mjs';
30
+ import './controlClient-CXD-Xdny.mjs';
31
+ import './persistence-B6M_W5iC.mjs';
32
32
  import 'node:fs/promises';
33
33
  import 'node:fs';
34
34
  import './contentLogMetadata-BlWI0egu.mjs';
@@ -36,4 +36,4 @@ import 'chalk';
36
36
  import 'node:util';
37
37
  import 'node:path';
38
38
  import 'node:os';
39
- import './package-BqwrPxL0.mjs';
39
+ import './package-5xAdq5fu.mjs';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var logger = require('./logger-JTcJU-uL.cjs');
3
+ var logger = require('./logger-Ockf1cjN.cjs');
4
4
  var authRelay = require('./authRelay-BdYkC1Po.cjs');
5
5
  var os = require('os');
6
6
  var child_process = require('child_process');
@@ -1,4 +1,4 @@
1
- import { l as logger } from './logger-BpQcwNnt.mjs';
1
+ import { l as logger } from './logger-C6zzu57a.mjs';
2
2
  import { e as encodeBase64, g as encrypt, h as decrypt, d as decodeBase64 } from './authRelay-DSAvg1uv.mjs';
3
3
  import os from 'os';
4
4
  import { execSync } from 'child_process';
@@ -6,7 +6,7 @@ var path = require('node:path');
6
6
  var tweetnacl = require('tweetnacl');
7
7
  var z = require('zod');
8
8
  var authRelay = require('./authRelay-BdYkC1Po.cjs');
9
- var configuration = require('./configuration-B0cb3xA3.cjs');
9
+ var configuration = require('./configuration-DeuGrnej.cjs');
10
10
 
11
11
  const AgentCredentialsSchema = z.z.object({
12
12
  token: z.z.string().min(1),
@@ -4,7 +4,7 @@ import { join } from 'node:path';
4
4
  import tweetnacl from 'tweetnacl';
5
5
  import { z } from 'zod';
6
6
  import { c as credentialRelayProblem, d as decodeBase64 } from './authRelay-DSAvg1uv.mjs';
7
- import { c as configuration } from './configuration-D2v3puap.mjs';
7
+ import { c as configuration } from './configuration-BZo1JWNV.mjs';
8
8
 
9
9
  const AgentCredentialsSchema = z.object({
10
10
  token: z.string().min(1),
@@ -1,6 +1,6 @@
1
1
  import chalk from 'chalk';
2
2
  import { inspect } from 'node:util';
3
- import { d as appendPrivateFileSync, c as configuration } from './configuration-D2v3puap.mjs';
3
+ import { d as appendPrivateFileSync, c as configuration } from './configuration-BZo1JWNV.mjs';
4
4
  import { existsSync, readdirSync, statSync } from 'node:fs';
5
5
  import { join, basename } from 'node:path';
6
6
 
@@ -236,7 +236,7 @@ async function listDaemonLogFiles(limit = 50) {
236
236
  return { file, path: fullPath, modified: stats.mtime };
237
237
  }).sort((a, b) => b.modified.getTime() - a.modified.getTime());
238
238
  try {
239
- const { readDaemonState } = await import('./persistence-B9LmhAE2.mjs');
239
+ const { readDaemonState } = await import('./persistence-B6M_W5iC.mjs').then(function (n) { return n.E; });
240
240
  const state = await readDaemonState();
241
241
  if (!state) {
242
242
  return logs;
@@ -2,7 +2,7 @@
2
2
 
3
3
  var chalk = require('chalk');
4
4
  var node_util = require('node:util');
5
- var configuration = require('./configuration-B0cb3xA3.cjs');
5
+ var configuration = require('./configuration-DeuGrnej.cjs');
6
6
  var node_fs = require('node:fs');
7
7
  var path = require('node:path');
8
8
 
@@ -238,7 +238,7 @@ async function listDaemonLogFiles(limit = 50) {
238
238
  return { file, path: fullPath, modified: stats.mtime };
239
239
  }).sort((a, b) => b.modified.getTime() - a.modified.getTime());
240
240
  try {
241
- const { readDaemonState } = await Promise.resolve().then(function () { return require('./persistence-2Xp_o6x6.cjs'); });
241
+ const { readDaemonState } = await Promise.resolve().then(function () { return require('./persistence-B5oT6oQ9.cjs'); }).then(function (n) { return n.persistence; });
242
242
  const state = await readDaemonState();
243
243
  if (!state) {
244
244
  return logs;
@@ -1,17 +1,18 @@
1
1
  'use strict';
2
2
 
3
3
  var os = require('node:os');
4
- var _package = require('./package-C1XvUQFy.cjs');
5
- var configuration = require('./configuration-B0cb3xA3.cjs');
4
+ var _package = require('./package-DfoyJe1O.cjs');
5
+ var configuration = require('./configuration-DeuGrnej.cjs');
6
6
  var projectPath = require('./projectPath-ChLhdOyt.cjs');
7
7
  var detectCLI = require('./detectCLI-DR9ZaN6B.cjs');
8
- var localHappyAgentAuth = require('./localHappyAgentAuth-d7B6S_o7.cjs');
8
+ var localHappyAgentAuth = require('./localHappyAgentAuth-CPMh61Su.cjs');
9
9
 
10
10
  function buildInitialMachineMetadata(cliAvailability) {
11
11
  const hostSuffix = process.env.HAPPY_VARIANT === "dev" ? "-dev" : "";
12
12
  return {
13
13
  teamsVersion: 1,
14
14
  teamLaunchVersion: 1,
15
+ worktreeVersion: 1,
15
16
  host: os.hostname() + hostSuffix,
16
17
  platform: os.platform(),
17
18
  happyCliVersion: _package.packageJson.version,
@@ -1,15 +1,16 @@
1
1
  import os from 'node:os';
2
- import { p as packageJson } from './package-BqwrPxL0.mjs';
3
- import { c as configuration } from './configuration-D2v3puap.mjs';
2
+ import { p as packageJson } from './package-5xAdq5fu.mjs';
3
+ import { c as configuration } from './configuration-BZo1JWNV.mjs';
4
4
  import { p as projectPath } from './projectPath-BTBIMB57.mjs';
5
5
  import { d as detectCLIAvailability } from './detectCLI-CSGMlV51.mjs';
6
- import { d as detectResumeSupport } from './localHappyAgentAuth-Ct1aXwqd.mjs';
6
+ import { d as detectResumeSupport } from './localHappyAgentAuth-DkLbntlf.mjs';
7
7
 
8
8
  function buildInitialMachineMetadata(cliAvailability) {
9
9
  const hostSuffix = process.env.HAPPY_VARIANT === "dev" ? "-dev" : "";
10
10
  return {
11
11
  teamsVersion: 1,
12
12
  teamLaunchVersion: 1,
13
+ worktreeVersion: 1,
13
14
  host: os.hostname() + hostSuffix,
14
15
  platform: os.platform(),
15
16
  happyCliVersion: packageJson.version,